/* 官网 · 练一练 / 测评 页面样式 */

/* display:grid 等会覆盖浏览器对 [hidden] 的默认隐藏 */
[hidden] {
  display: none !important;
}

.app-page {
  min-height: 100vh;
  padding-bottom: 3rem;
}

.app-page main {
  padding: 1.5rem 0 2rem;
}

.app-hero {
  padding: 1.75rem 0 1.25rem;
}

.app-hero h1 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  margin-bottom: 0.5rem;
}

.app-hero .sub {
  color: var(--muted);
  max-width: 42em;
  font-size: 0.95rem;
}

.app-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
  justify-content: space-between;
  margin: 1.25rem 0;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--ring);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}

.cache-status {
  font-size: 0.85rem;
  color: var(--muted);
}

.grade-nav-row,
.dim-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.grade-pill,
.dim-chip {
  border: 1px solid var(--ring);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.grade-pill:hover,
.dim-chip:hover {
  border-color: rgba(217, 119, 6, 0.45);
  color: var(--accent);
}

.grade-pill.active,
.dim-chip.active {
  background: var(--accent-soft);
  border-color: rgba(217, 119, 6, 0.55);
  color: #b45309;
}

.grade-pill:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: none;
  border-radius: 12px;
  padding: 0.65rem 1.15rem;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-primary {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  box-shadow: var(--shadow-accent);
}

.btn-primary:hover {
  transform: translateY(-1px);
}

.btn-outline {
  background: #fff;
  border: 1px solid var(--ring);
  color: var(--ink);
}

.btn-outline:hover {
  border-color: rgba(217, 119, 6, 0.45);
  color: var(--accent);
}

.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.loading-panel,
.error-panel {
  margin: 1.5rem 0;
  padding: 1.25rem 1.35rem;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--ring);
}

.loading-panel {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted);
}

.loading-spinner {
  width: 22px;
  height: 22px;
  border: 2px solid rgba(217, 119, 6, 0.25);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.error-panel {
  color: #b91c1c;
  background: #fef2f2;
  border-color: #fecaca;
}

.bank-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.q-card {
  background: var(--surface);
  border: 1px solid var(--ring);
  border-radius: 16px;
  padding: 1.15rem 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}

.q-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.65rem;
}

.q-index {
  font-weight: 800;
  color: var(--accent);
  font-size: 0.9rem;
}

.q-dim {
  font-size: 0.78rem;
  color: var(--muted);
  background: #f8fafc;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
}

.q-knowledge {
  font-size: 0.78rem;
  color: #0f766e;
  background: #ecfdf5;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  border: 1px solid rgba(15, 118, 110, 0.18);
}

.q-stem {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 0.85rem;
  white-space: pre-wrap;
}

.q-media {
  margin: 0 0 0.85rem;
  text-align: center;
}

.q-media img {
  max-width: 100%;
  max-height: 280px;
  border-radius: 12px;
  border: 1px solid var(--ring);
}

.q-options {
  list-style: none;
  display: grid;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
}

.q-option {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  background: #f8fafc;
  font-size: 0.92rem;
}

.q-option.correct {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
}

.q-letter {
  flex-shrink: 0;
  width: 1.4rem;
  height: 1.4rem;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #fff;
  border: 1px solid var(--ring);
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--accent);
}

.q-answer {
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  background: #fffbeb;
  border: 1px solid rgba(217, 119, 6, 0.25);
  font-size: 0.9rem;
}

.q-explanation {
  margin-top: 0.45rem;
  color: var(--muted);
  line-height: 1.55;
  white-space: pre-wrap;
}

.q-open-tag {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.65rem;
}

.empty-hint {
  color: var(--muted);
  text-align: center;
  padding: 2rem 1rem;
}

/* 测评 */
.quiz-phase {
  margin-top: 1.25rem;
}

.landing-card {
  background: var(--surface);
  border: 1px solid var(--ring);
  border-radius: 18px;
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  max-width: 520px;
}

.landing-card ul {
  margin: 0.75rem 0 1.25rem 1.1rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.landing-card li {
  margin-bottom: 0.35rem;
}

.quiz-panel {
  max-width: 680px;
  margin: 0 auto;
}

.progress-wrap {
  margin-bottom: 1.25rem;
}

.progress-track {
  height: 8px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.45rem;
}

.progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #f59e0b, #d97706);
  border-radius: 999px;
  transition: width 0.25s;
}

.progress-text {
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 600;
}

.quiz-card {
  background: var(--surface);
  border: 1px solid var(--ring);
  border-radius: 18px;
  padding: 1.35rem 1.5rem;
  box-shadow: var(--shadow-md);
}

.quiz-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: space-between;
  margin-top: 1.25rem;
}

.option-btn {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  width: 100%;
  text-align: left;
  padding: 0.75rem 0.85rem;
  margin-bottom: 0.5rem;
  border: 1px solid var(--ring);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.5;
  transition: border-color 0.15s, background 0.15s;
}

.option-btn:hover {
  border-color: rgba(217, 119, 6, 0.45);
}

.option-btn.active {
  border-color: rgba(217, 119, 6, 0.75);
  background: var(--accent-soft);
}

.result-panel {
  display: grid;
  gap: 1.25rem;
}

.result-right {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

@media (min-width: 860px) {
  .result-panel {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
  .result-left {
    grid-column: 1;
  }
  .result-right {
    grid-column: 2;
  }
}

.result-card {
  background: var(--surface);
  border: 1px solid var(--ring);
  border-radius: 18px;
  padding: 1.35rem;
  box-shadow: var(--shadow-md);
}

.result-score {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--accent);
  line-height: 1.1;
}

.result-score span {
  font-size: 1.1rem;
  color: var(--muted);
  font-weight: 600;
}

.result-index {
  margin-top: 0.35rem;
  font-size: 1.05rem;
}

.result-meta {
  margin-top: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.result-radar-wrap {
  display: flex;
  justify-content: center;
  margin: 0.5rem 0;
}

.result-radar-wrap svg {
  max-width: 100%;
  height: auto;
}

.result-advice {
  white-space: pre-wrap;
  line-height: 1.65;
  color: #334155;
  font-size: 0.92rem;
}

.dim-score-list {
  list-style: none;
  display: grid;
  gap: 0.45rem;
}

.dim-score-list li {
  display: flex;
  justify-content: space-between;
  padding: 0.45rem 0.65rem;
  background: #f8fafc;
  border-radius: 8px;
  font-size: 0.9rem;
}

.dim-score-list strong {
  color: var(--accent);
}

.wrong-item {
  padding: 0.85rem 0;
  border-bottom: 1px dashed var(--ring);
}

.wrong-item:last-child {
  border-bottom: none;
}

.wrong-title {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--accent);
  margin-bottom: 0.35rem;
}

.wrong-stem {
  margin-bottom: 0.45rem;
  line-height: 1.55;
}

.wrong-correct {
  color: #047857;
  font-weight: 600;
}

.nav-app a.active {
  color: var(--accent);
  font-weight: 700;
}

.hint-bar {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: linear-gradient(135deg, #eef2ff 0%, #fff7ed 100%);
  border: 1px solid rgba(99, 102, 241, 0.18);
  font-size: 0.88rem;
  color: #475569;
}

@media (max-width: 640px) {
  nav.nav-app {
    gap: 0.65rem;
    font-size: 0.82rem;
  }
  .app-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
}
