/* ============================================================
   AI Business Chinese — main.css
   Design spec V2.1 (Scheme A: Deep Navy x Teal)
   ============================================================ */

:root {
  /* Design tokens (spec V2.1) */
  --brand-950: #0B1F3A;
  --brand-800: #123B63;
  --brand-600: #1769AA;
  --brand-500: #1D8ACB;
  --accent-500: #16B8A6;
  --accent-700: #0E8F82;
  --accent-100: #D8F5F0;
  --surface-0: #FFFFFF;
  --surface-50: #F5F8FB;
  --ink-900: #102033;
  --ink-600: #52657A;
  --border: #D9E2EC;
  --danger-600: #B42318;
  --learner-bubble: #E7F0FA;

  /* Type */
  --font-en: 'Inter', 'Noto Sans SC', system-ui, -apple-system, sans-serif;
  --text-display: clamp(2.5rem, 5vw, 4.5rem);
  --text-h1: clamp(2rem, 4vw, 3.5rem);
  --text-h2: clamp(1.5rem, 2.4vw, 2.25rem);
  --text-h3: clamp(1.15rem, 1.6vw, 1.5rem);

  /* Shape / shadow */
  --radius-btn: 10px;
  --radius-card: 16px;
  --radius-badge: 999px;
  --shadow-card: 0 12px 32px rgba(11, 31, 58, 0.10);
  --shadow-soft: 0 4px 16px rgba(11, 31, 58, 0.06);

  /* Layout */
  --container: 1180px;
  --pad-desktop: 32px;
  --pad-mobile: 20px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-en);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink-900);
  background: var(--surface-0);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 0.5em; color: var(--brand-950); }
h1 { font-size: var(--text-h1); font-weight: 700; line-height: 1.12; }
h2 { font-size: var(--text-h2); font-weight: 700; line-height: 1.2; }
h3 { font-size: var(--text-h3); font-weight: 700; }
p { margin: 0 0 1em; }
a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--pad-desktop); }
@media (max-width: 640px) { .container { padding: 0 var(--pad-mobile); } }

:focus-visible {
  outline: 2px solid var(--brand-600);
  outline-offset: 2px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; min-height: 44px; padding: 10px 22px;
  border-radius: var(--radius-btn); border: 1px solid transparent;
  font-family: inherit; font-size: 0.95rem; font-weight: 600;
  cursor: pointer; text-decoration: none; transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap; line-height: 1.2;
}
.btn:hover { text-decoration: none; }
.btn:disabled { background: var(--border) !important; color: var(--ink-600) !important; cursor: not-allowed; }

.btn-primary { background: var(--accent-500); color: var(--brand-950); }
.btn-primary:hover { background: var(--accent-700); color: #fff; }

.btn-secondary { background: var(--surface-0); color: var(--brand-600); border-color: var(--brand-600); }
.btn-secondary:hover { background: #E7F0FA; }

.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,0.35); }
.btn-ghost:hover { background: rgba(255,255,255,0.12); }

.btn-dark { background: var(--brand-950); color: #fff; }
.btn-dark:hover { background: var(--brand-800); }

.btn-lg { min-height: 52px; padding: 14px 30px; font-size: 1.05rem; }
.btn-block { width: 100%; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: var(--radius-badge); padding: 4px 12px;
  font-size: 0.8rem; font-weight: 600; line-height: 1.4;
}
.badge-accent { background: var(--accent-100); color: var(--accent-700); }
.badge-blue { background: #E7F0FA; color: var(--brand-600); }
.badge-dark { background: var(--brand-950); color: #fff; }
.badge-outline { background: transparent; border: 1px solid var(--border); color: var(--ink-600); }

/* ---------- Header ---------- */
.site-header {
  background: var(--brand-950);
  position: sticky; top: 0; z-index: 50;
  height: 72px;
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px; gap: 24px;
}
.logo { font-size: 1.05rem; font-weight: 700; color: #fff; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.logo:hover { text-decoration: none; opacity: 0.92; }
.logo-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--accent-500); color: var(--brand-950);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.85rem;
}
.main-nav { display: flex; align-items: center; gap: 28px; }
.main-nav a { color: rgba(255,255,255,0.85); font-size: 0.95rem; font-weight: 500; }
.main-nav a:hover { color: #fff; text-decoration: none; }
.header-actions { display: flex; align-items: center; gap: 14px; }
.header-actions .btn { min-height: 40px; padding: 8px 18px; font-size: 0.9rem; }
.login-link { color: rgba(255,255,255,0.9); font-size: 0.9rem; font-weight: 500; }
.login-link:hover { color: #fff; }

.menu-toggle {
  display: none; background: transparent; border: 1px solid rgba(255,255,255,0.4);
  color: #fff; width: 44px; height: 44px; border-radius: 10px; font-size: 1.3rem;
  cursor: pointer; align-items: center; justify-content: center; line-height: 1;
}

@media (max-width: 1023px) {
  .main-nav, .header-actions .login-link { display: none; }
  .menu-toggle { display: inline-flex; }
}
@media (max-width: 640px) {
  .header-actions .btn { display: none; } /* CTA lives in the mobile menu on small screens */
  .logo { font-size: 0.95rem; }
  .site-header .container { gap: 12px; }
}
.mobile-menu {
  display: none; position: fixed; inset: 72px 0 auto 0; z-index: 49;
  background: var(--brand-950); padding: 16px 20px 28px;
  box-shadow: 0 24px 40px rgba(0,0,0,0.25);
}
.mobile-menu.open { display: block; }
.mobile-menu a {
  display: block; color: #fff; padding: 14px 8px; font-size: 1.05rem;
  border-bottom: 1px solid rgba(255,255,255,0.12); font-weight: 500;
}
.mobile-menu a:hover { text-decoration: none; color: var(--accent-500); }
.mobile-menu .btn { margin-top: 16px; width: 100%; }

/* ---------- Footer ---------- */
.site-footer { background: var(--brand-950); color: rgba(255,255,255,0.8); margin-top: 0; }
.site-footer .container { padding-top: 56px; padding-bottom: 40px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr; gap: 32px; }
.footer-brand .logo { margin-bottom: 14px; }
.footer-brand p { font-size: 0.88rem; color: rgba(255,255,255,0.65); max-width: 260px; }
.footer-col h4 { color: #fff; font-size: 0.85rem; margin-bottom: 14px; letter-spacing: 0.03em; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { color: rgba(255,255,255,0.75); font-size: 0.88rem; }
.footer-col a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.14); margin-top: 40px; padding-top: 22px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 0.82rem; color: rgba(255,255,255,0.6);
}
@media (max-width: 1023px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
}

/* ---------- Shared sections ---------- */
.section { padding: 72px 0; }
.section-alt { background: var(--surface-50); }
.section-head { max-width: 720px; margin-bottom: 40px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.eyebrow {
  display: inline-block; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent-700); margin-bottom: 12px;
}
.eyebrow-light { color: var(--accent-500); }
.lead { font-size: 1.1rem; color: var(--ink-600); }

/* ---------- Hero ---------- */
.hero { background: var(--brand-950); color: #fff; }
.hero .container { display: grid; grid-template-columns: 7fr 5fr; gap: 48px; align-items: center; padding-top: 72px; padding-bottom: 84px; }
.hero h1 { color: #fff; max-width: 680px; }
.hero .hero-sub { color: rgba(255,255,255,0.82); font-size: 1.15rem; max-width: 560px; margin-bottom: 28px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 36px; margin-top: 40px; flex-wrap: wrap; }
.hero-stat b { display: block; font-size: 1.6rem; color: var(--accent-500); }
.hero-stat span { font-size: 0.85rem; color: rgba(255,255,255,0.7); }

/* Hero preview chat card */
.hero-preview {
  background: var(--surface-0); border-radius: var(--radius-card); padding: 20px;
  box-shadow: var(--shadow-card); color: var(--ink-900);
}
.preview-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.preview-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent-500); color: var(--brand-950);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem;
}
.preview-head b { font-size: 0.92rem; }
.preview-head span { font-size: 0.78rem; color: var(--ink-600); }
.chat-bubble { border-radius: 14px; padding: 10px 14px; font-size: 0.92rem; margin-bottom: 10px; max-width: 85%; }
.chat-bubble.ai { background: var(--accent-100); color: var(--ink-900); margin-right: auto; }
.chat-bubble.ai .zh { display: block; font-weight: 600; margin-bottom: 2px; }
.chat-bubble.ai .en { display: block; font-size: 0.8rem; color: var(--ink-600); }
.chat-bubble.learner { background: var(--learner-bubble); color: var(--ink-900); margin-left: auto; }
.feedback-row {
  display: flex; align-items: center; gap: 10px; margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--border); font-size: 0.82rem; flex-wrap: wrap;
}
.feedback-row .chip {
  display: inline-flex; align-items: center; gap: 4px; font-weight: 600;
}
.feedback-row .chip .ok { color: var(--accent-700); }
.feedback-score {
  margin-left: auto; background: var(--brand-950); color: #fff;
  border-radius: 10px; padding: 6px 12px; font-weight: 700; font-size: 0.95rem;
}

@media (max-width: 1023px) {
  .hero .container { grid-template-columns: 1fr; padding-top: 56px; padding-bottom: 64px; gap: 40px; }
  .hero-preview { max-width: 560px; }
}
@media (max-width: 640px) {
  .hero .container { padding-top: 40px; padding-bottom: 48px; }
  .hero h1 { font-size: var(--text-h1); }
  .hero-actions .btn { flex: 1 1 100%; }
}

/* ---------- Cards ---------- */
.card {
  background: var(--surface-0); border: 1px solid var(--border);
  border-radius: var(--radius-card); padding: 24px; box-shadow: var(--shadow-soft);
}
.card-hover { transition: transform 0.15s ease, box-shadow 0.15s ease; }
.card-hover:hover { transform: translateY(-2px); box-shadow: var(--shadow-card); }

/* Scenario cards */
.scenario-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.scenario-card { display: flex; flex-direction: column; }
.scenario-card .card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.scenario-card h3 { margin-bottom: 8px; font-size: 1.15rem; }
.scenario-card p { color: var(--ink-600); font-size: 0.92rem; flex: 1; }
.scenario-card .card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; gap: 10px; }
.scenario-meta { display: flex; gap: 14px; font-size: 0.8rem; color: var(--ink-600); }
.scenario-meta span { display: inline-flex; align-items: center; gap: 4px; }
@media (max-width: 1023px) { .scenario-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .scenario-grid { grid-template-columns: 1fr; } }

/* Locked card */
.scenario-card.locked { opacity: 0.68; }
.scenario-card.locked h3 { color: var(--ink-600); }

/* ---------- Pricing ---------- */
.pricing-toggle {
  display: inline-flex; background: var(--surface-50); border: 1px solid var(--border);
  border-radius: 12px; padding: 4px; margin: 0 auto 48px; gap: 4px;
}
.pricing-toggle button {
  border: 0; background: transparent; padding: 10px 22px; min-height: 44px;
  border-radius: 9px; font-family: inherit; font-size: 0.95rem; font-weight: 600;
  color: var(--ink-600); cursor: pointer;
}
.pricing-toggle button.active { background: var(--brand-950); color: #fff; }
.pricing-toggle .save-badge { font-size: 0.72rem; background: var(--accent-100); color: var(--accent-700); border-radius: 999px; padding: 2px 8px; margin-left: 6px; font-weight: 700; }

.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; align-items: stretch; }
.pricing-card {
  display: flex; flex-direction: column; position: relative;
  border: 1px solid var(--border); border-radius: var(--radius-card);
  padding: 32px 28px 28px; background: var(--surface-0); box-shadow: var(--shadow-soft);
}
.pricing-card .price-row { display: flex; align-items: baseline; gap: 8px; margin: 6px 0 2px; }
.pricing-card .price { font-size: 2.4rem; font-weight: 700; color: var(--brand-950); font-variant-numeric: tabular-nums; line-height: 1.1; }
.pricing-card .price-period { font-size: 0.92rem; color: var(--ink-600); }
.pricing-card .billing-note { font-size: 0.82rem; color: var(--accent-700); font-weight: 600; min-height: 20px; margin-bottom: 6px; }
.pricing-card .plan-desc { color: var(--ink-600); font-size: 0.92rem; min-height: 44px; }
.pricing-card ul { list-style: none; margin: 18px 0 24px; padding: 0; flex: 1; }
.pricing-card li { padding: 7px 0 7px 26px; position: relative; font-size: 0.92rem; }
.pricing-card li::before { content: "✓"; position: absolute; left: 0; color: var(--accent-700); font-weight: 700; }
.pricing-card .btn { width: 100%; margin-top: auto; }
.pricing-card.recommended { border: 2px solid var(--brand-950); box-shadow: var(--shadow-card); }
.pricing-card .rec-badge {
  position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
  background: var(--brand-950); color: #fff; border-radius: var(--radius-badge);
  padding: 4px 14px; font-size: 0.75rem; font-weight: 700; white-space: nowrap;
}
@media (max-width: 1023px) {
  .pricing-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .pricing-card { padding: 26px 18px 22px; }
  .pricing-card .price { font-size: 1.9rem; }
}
@media (max-width: 640px) {
  .pricing-grid { grid-template-columns: 1fr; gap: 20px; }
  .pricing-card .price { font-size: 2.2rem; }
  .pricing-toggle { width: 100%; }
  .pricing-toggle button { flex: 1; }
}

/* Comparison table */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius-card); border: 1px solid var(--border); }
.compare-table { width: 100%; min-width: 640px; border-collapse: collapse; background: var(--surface-0); }
.compare-table th, .compare-table td { padding: 14px 18px; text-align: center; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
.compare-table th { background: var(--brand-950); color: #fff; font-weight: 600; }
.compare-table th:first-child, .compare-table td:first-child { text-align: left; font-weight: 500; }
.compare-table td.yes { color: var(--accent-700); font-weight: 600; }
.compare-table td.no { color: var(--ink-600); }
.compare-table tr:last-child th, .compare-table tr:last-child td { border-bottom: 0; }

/* ---------- Scenarios / Level map ---------- */
.level-progress { display: flex; align-items: center; gap: 16px; margin-bottom: 32px; flex-wrap: wrap; }
.level-progress .bar { flex: 1; min-width: 200px; height: 10px; background: var(--border); border-radius: 999px; overflow: hidden; }
.level-progress .bar > span { display: block; height: 100%; background: var(--accent-500); border-radius: 999px; transition: width 0.4s ease; }
.level-progress .pct { font-weight: 700; color: var(--brand-950); font-variant-numeric: tabular-nums; }

.level-list { display: flex; flex-direction: column; gap: 14px; }
.level-row {
  display: flex; align-items: center; gap: 20px;
  background: var(--surface-0); border: 1px solid var(--border); border-radius: var(--radius-card);
  padding: 18px 22px; box-shadow: var(--shadow-soft);
}
.level-row:hover { border-color: var(--brand-600); box-shadow: var(--shadow-card); }
.level-num {
  width: 48px; height: 48px; border-radius: 12px; flex: 0 0 48px;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.05rem; background: #E7F0FA; color: var(--brand-600);
}
.level-row.done .level-num { background: var(--accent-100); color: var(--accent-700); }
.level-row.current { border: 2px solid var(--brand-600); }
.level-row.current .level-num { background: var(--accent-500); color: var(--brand-950); }
.level-row.locked { opacity: 0.62; }
.level-row.locked .level-num { background: var(--surface-50); color: var(--ink-600); }
.level-info { flex: 1; min-width: 0; }
.level-info h3 { margin: 0 0 4px; font-size: 1.08rem; }
.level-info p { margin: 0; color: var(--ink-600); font-size: 0.88rem; }
.level-score { font-size: 0.9rem; font-weight: 700; color: var(--accent-700); font-variant-numeric: tabular-nums; white-space: nowrap; }
.level-lock { color: var(--ink-600); font-size: 1.3rem; }
.level-row .btn { white-space: nowrap; }
@media (max-width: 640px) {
  .level-row { flex-wrap: wrap; padding: 16px; gap: 12px; }
  .level-info { flex: 1 1 100%; order: 3; }
  .level-num { order: 1; }
  .level-score, .level-row .btn { order: 2; }
}

/* ---------- Scenario detail ---------- */
.scenario-detail { display: grid; grid-template-columns: 58fr 42fr; gap: 40px; align-items: start; }
.breadcrumb { font-size: 0.85rem; color: var(--ink-600); margin-bottom: 16px; }
.breadcrumb a { color: var(--brand-600); }
.scenario-detail .main-col h1 { max-width: 680px; }
.goal-list { list-style: none; margin: 0 0 24px; padding: 0; }
.goal-list li { padding: 8px 0 8px 28px; position: relative; }
.goal-list li::before { content: "✓"; position: absolute; left: 0; color: var(--accent-700); font-weight: 700; }
.culture-box { background: var(--accent-100); border-radius: var(--radius-card); padding: 20px 24px; margin: 24px 0; }
.culture-box h3 { font-size: 1rem; }
.overview-card { position: sticky; top: 96px; }
.overview-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
.overview-row:last-of-type { border-bottom: 0; }
.overview-row dt { color: var(--ink-600); }
.overview-row dd { margin: 0; font-weight: 600; }
.overview-card .btn { margin-top: 18px; }
@media (max-width: 1023px) {
  .scenario-detail { grid-template-columns: 1fr; gap: 28px; }
  .overview-card { position: static; }
}

/* ---------- Lesson / chat ---------- */
.lesson-wrap { max-width: 860px; margin: 0 auto; }
.lesson-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 8px; flex-wrap: wrap; }
.lesson-head h1 { font-size: var(--text-h3); margin: 0; }
.lesson-context {
  background: var(--surface-50); border: 1px solid var(--border);
  border-radius: var(--radius-card); padding: 14px 18px; margin-bottom: 16px;
  font-size: 0.92rem; color: var(--ink-900);
}
.lesson-context b { color: var(--brand-950); }
.chat-window {
  border: 1px solid var(--border); border-radius: var(--radius-card);
  background: var(--surface-0); box-shadow: var(--shadow-soft);
  display: flex; flex-direction: column; height: min(62vh, 560px); min-height: 380px;
}
.chat-messages { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.msg { display: flex; flex-direction: column; max-width: 82%; }
.msg.ai { align-self: flex-start; align-items: flex-start; }
.msg.user { align-self: flex-end; align-items: flex-end; }
.msg .bubble { border-radius: 14px; padding: 10px 14px; font-size: 0.95rem; line-height: 1.55; }
.msg.ai .bubble { background: var(--accent-100); color: var(--ink-900); border-bottom-left-radius: 4px; }
.msg.user .bubble { background: var(--learner-bubble); color: var(--ink-900); border-bottom-right-radius: 4px; }
.msg .bubble .zh { font-weight: 600; }
.msg .bubble .en { display: block; font-size: 0.82rem; color: var(--ink-600); margin-top: 4px; }
.msg .msg-label { font-size: 0.72rem; color: var(--ink-600); margin-bottom: 4px; }
.msg.user .msg-label { margin-right: 4px; }
.msg.ai .msg-label { margin-left: 4px; }
.msg .vocab-chips { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.vocab-chip {
  border: 1px solid var(--border); background: var(--surface-0); border-radius: 999px;
  padding: 3px 12px; font-size: 0.8rem; color: var(--brand-600); cursor: pointer;
}
.vocab-chip:hover { background: #E7F0FA; border-color: var(--brand-600); }
.vocab-chip.saved { background: var(--accent-100); border-color: var(--accent-500); color: var(--accent-700); }

.chat-input-row {
  display: flex; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--border);
  background: var(--surface-50); border-radius: 0 0 var(--radius-card) var(--radius-card);
}
.chat-input-row input {
  flex: 1; min-width: 0; min-height: 44px; border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 16px; font-family: inherit; font-size: 0.98rem;
}
.chat-input-row input:focus { outline: 2px solid var(--brand-600); outline-offset: 0; border-color: transparent; }
.chat-input-row .btn { flex: 0 0 auto; }

.chat-status { display: flex; align-items: center; gap: 10px; font-size: 0.82rem; color: var(--ink-600); padding: 10px 18px 0; }
.goal-tracker { display: flex; gap: 8px; margin: 0 0 14px; flex-wrap: wrap; }
.goal-pill {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 999px;
  border: 1px solid var(--border); padding: 4px 12px; font-size: 0.8rem; color: var(--ink-600);
}
.goal-pill.hit { background: var(--accent-100); border-color: var(--accent-500); color: var(--accent-700); font-weight: 600; }

.finish-row { display: flex; gap: 12px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.turns-hint { font-size: 0.85rem; color: var(--ink-600); }

/* ---------- Score report ---------- */
.score-report { max-width: 720px; margin: 0 auto; }
.score-summary {
  background: var(--brand-950); color: #fff; border-radius: var(--radius-card);
  padding: 32px; text-align: center; margin-bottom: 24px;
}
.score-summary .total { font-size: 3.4rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; color: var(--accent-500); }
.score-summary .total-label { font-size: 0.95rem; color: rgba(255,255,255,0.8); margin-top: 8px; }
.score-summary .verdict { margin-top: 12px; font-size: 1.05rem; font-weight: 600; }
.score-dims { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }
.dim-card { background: var(--surface-0); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 20px; }
.dim-card .dim-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.dim-card .dim-name { font-weight: 700; }
.dim-card .dim-score { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 1.15rem; }
.dim-card .dim-score.high { color: var(--accent-700); }
.dim-card .dim-score.mid { color: var(--brand-600); }
.dim-card .dim-score.low { color: var(--danger-600); }
.dim-card p { font-size: 0.88rem; color: var(--ink-600); margin: 0; }
.advice-box { background: var(--surface-50); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 22px 24px; }
.advice-box h3 { font-size: 1rem; margin-bottom: 12px; }
.advice-box ul { margin: 0; padding-left: 20px; }
.advice-box li { margin-bottom: 8px; font-size: 0.93rem; }
.actions-row { display: flex; gap: 12px; justify-content: center; margin-top: 28px; flex-wrap: wrap; }
@media (max-width: 640px) { .score-dims { grid-template-columns: 1fr; } }

/* ---------- Vocabulary ---------- */
.vocab-hero { background: var(--brand-950); color: #fff; padding: 48px 0; }
.vocab-hero h1 { color: #fff; }
.vocab-hero p { color: rgba(255,255,255,0.8); max-width: 640px; }
.wordbank-count { display: inline-flex; align-items: center; gap: 8px; background: var(--accent-100); color: var(--accent-700); border-radius: 999px; padding: 6px 16px; font-weight: 700; font-size: 0.9rem; }

.vocab-tabs { display: flex; gap: 8px; margin-bottom: 24px; flex-wrap: wrap; }
.vocab-tabs button {
  border: 1px solid var(--border); background: var(--surface-0); border-radius: 999px;
  padding: 8px 18px; font-family: inherit; font-size: 0.88rem; font-weight: 600;
  color: var(--ink-600); cursor: pointer; min-height: 40px;
}
.vocab-tabs button.active { background: var(--brand-950); color: #fff; border-color: var(--brand-950); }

.vocab-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.vocab-card { perspective: 800px; height: 220px; }
.vocab-card .inner {
  position: relative; width: 100%; height: 100%; transition: transform 0.4s ease;
  transform-style: preserve-3d; cursor: pointer;
}
.vocab-card.flipped .inner { transform: rotateY(180deg); }
.vocab-face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border: 1px solid var(--border); border-radius: var(--radius-card);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 20px; text-align: center; background: var(--surface-0); box-shadow: var(--shadow-soft);
}
.vocab-face.back { transform: rotateY(180deg); background: var(--surface-50); }
.vocab-face .zh-word { font-size: 1.5rem; font-weight: 700; color: var(--brand-950); }
.vocab-face .pinyin { color: var(--brand-600); font-size: 0.95rem; margin-top: 4px; }
.vocab-face .en-word { font-size: 1.02rem; font-weight: 600; color: var(--brand-950); margin-bottom: 8px; }
.vocab-face .ex-zh { font-size: 0.88rem; color: var(--ink-900); margin-top: 8px; }
.vocab-face .ex-en { font-size: 0.8rem; color: var(--ink-600); margin-top: 4px; }
.vocab-face .save-word {
  margin-top: 12px; background: transparent; border: 1px solid var(--border);
  border-radius: 999px; padding: 5px 14px; font-size: 0.8rem; cursor: pointer;
  color: var(--brand-600); font-family: inherit; font-weight: 600;
}
.vocab-face .save-word.saved { background: var(--accent-100); border-color: var(--accent-500); color: var(--accent-700); }
.vocab-face .flip-hint { position: absolute; bottom: 10px; font-size: 0.7rem; color: var(--ink-600); }
@media (max-width: 1023px) { .vocab-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .vocab-grid { grid-template-columns: 1fr; } }

/* ---------- Legal ---------- */
.legal { max-width: 760px; margin: 0 auto; padding: 56px 0 80px; }
.legal h1 { margin-bottom: 8px; }
.legal .updated { color: var(--ink-600); font-size: 0.88rem; margin-bottom: 32px; }
.legal h2 { font-size: 1.3rem; margin-top: 32px; }
.legal h3 { font-size: 1.05rem; margin-top: 22px; }
.legal p, .legal li { color: var(--ink-900); font-size: 0.95rem; }
.legal ul { padding-left: 22px; }

/* ---------- Auth / CTA band ---------- */
.cta-band { background: var(--brand-950); color: #fff; text-align: center; padding: 72px 0; }
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255,255,255,0.82); max-width: 560px; margin: 0 auto 28px; }
.cta-band .hero-actions { justify-content: center; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--brand-950); color: #fff; padding: 12px 22px; border-radius: 12px;
  font-size: 0.9rem; opacity: 0; pointer-events: none; transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 100; box-shadow: var(--shadow-card); max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Utility ---------- */
.center { text-align: center; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.hidden { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Homepage interactive tool ---------- */
.hero-tool { padding: 28px; }
.hero-tool .preview-head { align-items: center; }
.live-dot { margin-left: auto; color: #9FF3C8; font-size: 0.68rem; font-weight: 800; letter-spacing: .08em; }
.tool-guide { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); color: rgba(255,255,255,.86); border-radius: 10px; padding: 12px 14px; font-size: .82rem; line-height: 1.5; margin: 18px 0 14px; }
.tool-guide b { color: #9FF3C8; }
.tool-input-row { display: flex; gap: 8px; margin-top: 14px; }
.tool-input-row input { min-width: 0; flex: 1; border: 0; border-radius: 8px; padding: 12px 13px; font: inherit; }
.tool-input-row .btn { flex: 0 0 auto; }
.tool-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.tool-actions .btn { font-size: .78rem; padding: 9px 12px; }
.tool-status { color: rgba(255,255,255,.62); font-size: .76rem; margin: 14px 0 0; }
@media (max-width: 640px) {
  .hero-tool { padding: 20px; }
  .tool-actions .btn { flex: 1 1 100%; text-align: center; }
}

