/* ================================================================
   VERDANT — IELTS Simulator Design System v2
   Sage Teal · Deep Ink · Warm Cream
   Fonts: Cormorant Garamond (display) · DM Sans (body) · DM Mono
   ================================================================ */

/* ----------------------------------------------------------------
   1. Design Tokens
   ---------------------------------------------------------------- */
:root {
  /* Brand */
  --v-teal:       #28786a;
  --v-teal-lt:    rgba(40,120,106,0.1);
  --v-teal-glow:  rgba(40,120,106,0.2);
  --v-ink:        #18273a;
  --v-ink-2:      #3a5068;
  --v-muted:      #5f7489;
  --v-cream:      #faf7f2;
  --v-cream-2:    #f2ede4;
  --v-border:     #e0d9cf;
  --v-warm:       #c07848;
  --v-error:      #c0392b;

  /* Surfaces */
  --bg:       var(--v-cream);
  --surface:  #ffffff;
  --card:     #ffffff;
  --bd:       var(--v-border);

  /* Text */
  --tx:   var(--v-ink);
  --tx-2: var(--v-ink-2);
  --tx-3: var(--v-muted);

  /* Section accent colors */
  --c-listen:  #2563eb;
  --c-read:    #059669;
  --c-write:   #d97706;
  --c-speak:   #7c3aed;

  /* Compat aliases (JS uses these via CSS vars) */
  --text-primary:   var(--tx);
  --text-secondary: var(--tx-2);
  --text-muted:     var(--tx-3);
  --accent-blue:    var(--c-listen);
  --accent-green:   var(--c-read);
  --accent-orange:  var(--c-write);
  --accent-purple:  var(--c-speak);
  --accent-red:     var(--v-error);
  --accent-blue-light:   rgba(37,99,235,0.08);
  --accent-green-light:  rgba(5,150,105,0.08);
  --accent-orange-light: rgba(217,119,6,0.08);
  --accent-purple-light: rgba(124,58,237,0.08);
  --listening-color: var(--c-listen);
  --reading-color:   var(--c-read);
  --writing-color:   var(--c-write);
  --speaking-color:  var(--c-speak);
  --bg-card:    var(--card);
  --bg-primary: var(--bg);
  --bg-secondary: var(--surface);
  --border:     var(--bd);
  --border-light: var(--v-border);

  /* Typography */
  --f-display: 'Cormorant Garamond', 'Georgia', 'STSong', serif;
  --f-body:    'DM Sans', -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --f-mono:    'DM Mono', 'Consolas', monospace;

  /* Shadows */
  --sh-sm:  0 1px 4px rgba(24,39,58,0.07);
  --sh:     0 2px 10px rgba(24,39,58,0.08), 0 1px 3px rgba(24,39,58,0.05);
  --sh-md:  0 6px 20px rgba(24,39,58,0.1);
  --sh-lg:  0 16px 48px rgba(24,39,58,0.13);

  /* Geometry */
  --r-sm: 8px;
  --r:    12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --t:    0.18s ease;
}

/* Dark Mode */
body.dark-mode {
  --bg:       #0f1920;
  --surface:  #172030;
  --card:     #1c2a3c;
  --bd:       rgba(255,255,255,0.08);
  --tx:       #e4edf8;
  --tx-2:     #8fa8c0;
  --tx-3:     #6b8aab;
  --text-primary:   #e4edf8;
  --text-secondary: #8fa8c0;
  --text-muted:     #4e6880;
  --bg-card:    #1c2a3c;
  --bg-primary: #0f1920;
  --bg-secondary: #172030;
  --border:     rgba(255,255,255,0.08);
  --border-light: rgba(255,255,255,0.06);
  --accent-blue-light:   rgba(96,165,250,0.1);
  --accent-green-light:  rgba(52,211,153,0.1);
  --accent-orange-light: rgba(251,191,36,0.1);
  --accent-purple-light: rgba(167,139,250,0.1);
  --c-listen:  #60a5fa;
  --c-read:    #34d399;
  --c-write:   #fbbf24;
  --c-speak:   #a78bfa;
  --accent-blue:   #60a5fa;
  --accent-green:  #34d399;
  --accent-orange: #fbbf24;
  --accent-purple: #a78bfa;
  --listening-color: #60a5fa;
  --reading-color:   #34d399;
  --writing-color:   #fbbf24;
  --speaking-color:  #a78bfa;
  --v-teal: #3aa090;
}

/* ----------------------------------------------------------------
   2. Base
   ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Accessibility: Skip Nav */
.skip-nav {
  position: absolute; top: -100px; left: 0; z-index: 9999;
  background: var(--v-teal); color: #fff; padding: 8px 16px;
  font-size: 0.9rem; text-decoration: none; border-radius: 0 0 8px 0;
  transition: top 0.2s;
}
.skip-nav:focus { top: 0; }

/* Accessibility: Focus Visible */
:focus-visible {
  outline: 2px solid var(--v-teal);
  outline-offset: 2px;
}
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--v-teal);
  outline-offset: 2px;
}

body {
  font-family: var(--f-body);
  background: var(--bg);
  color: var(--tx);
  line-height: 1.6;
  min-height: 100vh;
  transition: background var(--t), color var(--t);
}

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bd); border-radius: 3px; }

.page { display: none; }
.page.active { display: block; }

/* ----------------------------------------------------------------
   3. Loading Overlay
   ---------------------------------------------------------------- */
.v-loading {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(15,25,32,0.6);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
}
.v-loading-card {
  background: var(--v-cream);
  border-radius: var(--r-xl);
  padding: 32px 44px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  box-shadow: var(--sh-lg);
}
body.dark-mode .v-loading-card { background: var(--card); }
.v-spinner {
  width: 30px; height: 30px;
  border: 2.5px solid var(--bd);
  border-top-color: var(--v-teal);
  border-radius: 50%;
  animation: v-spin 0.7s linear infinite;
}
@keyframes v-spin { to { transform: rotate(360deg); } }
.v-loading-msg {
  font-size: 0.87rem; color: var(--tx-2);
}

/* ----------------------------------------------------------------
   4. Auth Page
   ---------------------------------------------------------------- */
#page-auth { height: 100vh; overflow: hidden; }

.v-auth-scene {
  position: relative;
  width: 100%; height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(158deg, #0b1a28 0%, #122a3c 25%, #0e2420 55%, #0b1c2a 80%, #0d1520 100%);
  overflow: hidden;
}
.v-auth-glow {
  position: absolute; border-radius: 50%;
  pointer-events: none; filter: blur(90px);
}
.v-auth-glow-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(40,120,106,0.2) 0%, transparent 65%);
  top: -180px; left: -120px;
}
.v-auth-glow-2 {
  width: 440px; height: 440px;
  background: radial-gradient(circle, rgba(20,60,40,0.18) 0%, transparent 65%);
  bottom: -100px; right: -80px;
}
.v-auth-glow-3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(192,120,72,0.1) 0%, transparent 65%);
  bottom: 20%; left: 20%;
}
.v-auth-card {
  position: relative; z-index: 1;
  width: 420px;
  background: var(--v-cream);
  border-radius: var(--r-xl);
  padding: 44px 40px 40px;
  box-shadow: 0 40px 90px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.06), inset 0 1px 0 rgba(255,255,255,0.8);
  animation: v-card-in 0.7s cubic-bezier(0.16,1,0.3,1) both;
}
@keyframes v-card-in {
  from { opacity: 0; transform: translateY(28px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.v-auth-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 30px; }
.v-auth-mark {
  width: 46px; height: 46px;
  background: var(--v-ink); color: var(--v-cream);
  border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--f-mono); font-size: 0.8rem; font-weight: 500;
  letter-spacing: 0.06em; flex-shrink: 0;
}
.v-auth-brand-name {
  font-family: var(--f-display); font-size: 1.25rem; font-weight: 700;
  color: var(--v-ink); letter-spacing: -0.01em; line-height: 1.1;
}
.v-auth-brand-sub { font-size: 0.7rem; color: var(--v-muted); margin-top: 3px; letter-spacing: 0.02em; }
.v-auth-tabs {
  display: flex; background: var(--v-cream-2);
  border-radius: 11px; padding: 4px; margin-bottom: 26px;
  border: 1px solid var(--v-border);
}
.v-auth-tab {
  flex: 1; padding: 9px; background: none; border: none;
  border-radius: 8px; font-family: var(--f-body);
  font-size: 0.87rem; font-weight: 500; color: var(--v-muted);
  cursor: pointer; transition: all var(--t);
}
.v-auth-tab.active {
  background: var(--v-cream); color: var(--v-ink); font-weight: 600;
  box-shadow: 0 1px 6px rgba(24,39,58,0.12);
}
.v-auth-form { display: flex; flex-direction: column; }
.v-field { margin-bottom: 15px; }
.v-label {
  display: block; font-size: 0.75rem; font-weight: 600;
  color: var(--v-ink-2); margin-bottom: 7px;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.v-input {
  width: 100%; padding: 11px 14px;
  background: #fff; border: 1.5px solid var(--v-border);
  border-radius: 10px; font-family: var(--f-body);
  font-size: 0.9rem; color: var(--v-ink); outline: none;
  transition: border-color var(--t), box-shadow var(--t);
}
.v-input:focus { border-color: var(--v-teal); box-shadow: 0 0 0 3px var(--v-teal-lt); }
.v-input::placeholder { color: #bbb4aa; }
.v-auth-error { font-size: 0.78rem; color: var(--v-error); min-height: 18px; margin-bottom: 6px; }
.v-auth-submit {
  width: 100%; padding: 13px;
  background: var(--v-ink); color: var(--v-cream); border: none;
  border-radius: 11px; font-family: var(--f-body);
  font-size: 0.92rem; font-weight: 600; cursor: pointer;
  margin-top: 6px; letter-spacing: 0.02em;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  position: relative; overflow: hidden;
}
.v-auth-submit::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.07) 0%, transparent 60%);
  pointer-events: none;
}
.v-auth-submit:hover {
  background: var(--v-teal); transform: translateY(-1px);
  box-shadow: 0 8px 24px var(--v-teal-glow);
}
.v-auth-submit:active { transform: translateY(0); }

/* ----------------------------------------------------------------
   5. Home Page
   ---------------------------------------------------------------- */
#page-home { min-height: 100vh; background: var(--bg); }

/* Nav */
.hp-nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250,247,242,0.92);
  border-bottom: 1px solid var(--bd);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
body.dark-mode .hp-nav { background: rgba(15,25,32,0.92); }

.hp-nav-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 0 32px; height: 62px;
  display: flex; align-items: center; justify-content: space-between;
}
.hp-logo { display: flex; align-items: center; gap: 10px; }
.hp-logo-mark {
  width: 34px; height: 34px;
  background: var(--v-ink); color: var(--v-cream);
  border-radius: 9px; display: flex; align-items: center; justify-content: center;
  font-family: var(--f-mono); font-size: 0.68rem; font-weight: 500;
  letter-spacing: 0.06em; flex-shrink: 0;
}
body.dark-mode .hp-logo-mark { background: var(--v-teal); }
.hp-logo-text {
  font-family: var(--f-display); font-size: 1.15rem; font-weight: 700;
  color: var(--tx); letter-spacing: -0.01em;
}
.hp-nav-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.hp-logo { cursor: pointer; }
.hp-logo:focus-visible { outline: 2px solid var(--v-teal); outline-offset: 3px; border-radius: 8px; }

/* Top module tabs (专项 / 模拟 / 扩展) */
.hp-tabs {
  display: flex; align-items: center; gap: 4px;
  background: var(--surface);
  border: 1px solid var(--bd);
  border-radius: 999px;
  padding: 4px;
}
.hp-tab {
  border: none; background: transparent; cursor: pointer;
  font-family: var(--f-body); font-size: 0.86rem; font-weight: 600;
  color: var(--tx-3); padding: 8px 16px; border-radius: 999px;
  transition: background var(--t), color var(--t), box-shadow var(--t);
  white-space: nowrap;
}
.hp-tab:hover { color: var(--tx); }
.hp-tab.active {
  background: var(--card); color: var(--v-teal);
  box-shadow: var(--sh-sm); border: 1px solid var(--bd);
}
body.dark-mode .hp-tab.active { background: rgba(40,120,106,0.18); border-color: rgba(40,120,106,0.35); }

/* Tab panels */
.hp-main-tabs { padding-top: 28px; }
.hp-panel[hidden] { display: none !important; }
.hp-panel-hero {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 20px;
  margin-bottom: 28px; padding: 28px 28px;
  background: linear-gradient(135deg, var(--v-cream-2) 0%, var(--card) 100%);
  border: 1px solid var(--bd); border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
}
body.dark-mode .hp-panel-hero {
  background: linear-gradient(135deg, rgba(40,120,106,0.12) 0%, var(--card) 70%);
}
.hp-panel-title {
  font-family: var(--f-display); font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 700; color: var(--tx); letter-spacing: -0.02em; margin: 8px 0 8px;
}
.hp-panel-sub { font-size: 0.95rem; color: var(--tx-2); line-height: 1.6; max-width: 560px; margin: 0; }
.hp-panel-side-btn {
  flex-shrink: 0; border: 1px solid var(--bd); background: var(--card);
  color: var(--tx); font-family: var(--f-body); font-weight: 600; font-size: 0.86rem;
  padding: 10px 16px; border-radius: 999px; cursor: pointer;
  transition: border-color var(--t), color var(--t), transform var(--t);
}
.hp-panel-side-btn:hover { border-color: var(--v-teal); color: var(--v-teal); transform: translateY(-1px); }

.hp-card-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.hp-feature-card {
  background: var(--card); border: 1.5px solid var(--bd); border-radius: var(--r-lg);
  padding: 22px 20px 18px; box-shadow: var(--sh-sm); cursor: pointer;
  border-top-width: 3px; transition: transform var(--t), box-shadow var(--t), border-color var(--t);
  display: flex; flex-direction: column; gap: 8px; min-height: 168px;
}
.hp-feature-card:hover {
  transform: translateY(-3px); box-shadow: var(--sh-md);
}
.hp-feature-card[data-c="blue"]   { border-top-color: var(--c-listen); }
.hp-feature-card[data-c="green"]  { border-top-color: var(--c-read); }
.hp-feature-card[data-c="amber"]  { border-top-color: var(--c-write); }
.hp-feature-card[data-c="violet"] { border-top-color: var(--c-speak); }
.hp-feature-card[data-c="rose"]   { border-top-color: #e11d48; }
.hp-feature-card[data-c="teal"]   { border-top-color: var(--v-teal); }
.hp-feature-icon { font-size: 1.55rem; line-height: 1; }
.hp-feature-card h3 {
  margin: 0; font-size: 1.05rem; font-weight: 700; color: var(--tx);
}
.hp-feature-card p {
  margin: 0; font-size: 0.84rem; color: var(--tx-3); line-height: 1.5; flex: 1;
}
.hp-feature-go {
  font-size: 0.82rem; font-weight: 600; color: var(--v-teal); margin-top: 6px;
}

/* User badge */
.user-badge {
  font-size: 0.78rem; color: var(--tx-2);
  background: var(--surface); border: 1px solid var(--bd);
  border-radius: 20px; padding: 4px 12px;
  font-weight: 500;
}

/* Logout */
.logout-btn {
  font-size: 0.78rem; font-weight: 500; color: var(--tx-3);
  background: none; border: 1px solid var(--bd);
  border-radius: var(--r-sm); padding: 5px 12px; cursor: pointer;
  transition: all var(--t); font-family: var(--f-body);
}
.logout-btn:hover { border-color: var(--v-error); color: var(--v-error); }

/* Theme toggle (shared) */
.theme-toggle {
  background: var(--surface); border: 1px solid var(--bd);
  border-radius: 10px; width: 38px; height: 38px; cursor: pointer;
  font-size: 1rem; display: flex; align-items: center; justify-content: center;
  transition: all var(--t); color: var(--tx-2);
}
.theme-toggle:hover { border-color: var(--v-teal); color: var(--v-teal); }

/* Hero */
.hp-hero-wrap {
  background: linear-gradient(180deg, var(--v-cream-2) 0%, var(--v-cream) 100%);
  padding: 64px 32px 80px; text-align: center;
  position: relative; overflow: hidden;
}
body.dark-mode .hp-hero-wrap {
  background: radial-gradient(ellipse 80% 55% at 50% -10%, rgba(40,120,106,0.15) 0%, transparent 70%), var(--bg);
}
.hp-hero-rings { position: absolute; inset: 0; pointer-events: none; }
body.dark-mode .hp-hero-rings::before,
body.dark-mode .hp-hero-rings::after {
  content: ''; position: absolute; border-radius: 50%;
  left: 50%; transform: translateX(-50%); border: 1px solid rgba(40,120,106,0.1);
}
body.dark-mode .hp-hero-rings::before { width: 560px; height: 560px; top: -260px; }
body.dark-mode .hp-hero-rings::after  { width: 860px; height: 860px; top: -390px; }

.hp-hero { position: relative; z-index: 1; max-width: 560px; margin: 0 auto; }
.hp-eyebrow {
  display: inline-block; padding: 5px 16px;
  background: var(--v-teal-lt); border: 1px solid rgba(40,120,106,0.2);
  border-radius: 30px; font-size: 0.73rem; font-weight: 500;
  color: var(--v-teal); letter-spacing: 0.04em; margin-bottom: 24px;
  animation: hp-up 0.6s ease both 0.05s;
}
.hp-headline {
  font-family: var(--f-display);
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 700; line-height: 0.95; letter-spacing: -0.02em;
  margin-bottom: 18px; animation: hp-up 0.7s ease both 0.12s;
}
.hp-hl-top { display: block; color: var(--tx); }
.hp-hl-bot { display: block; color: var(--v-teal); font-style: italic; }
body.dark-mode .hp-hl-bot { color: var(--v-teal); }
.hp-sub {
  font-size: 0.97rem; color: var(--tx-2); line-height: 1.65;
  animation: hp-up 0.6s ease both 0.22s;
}
.hp-score-tag {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 20px; padding: 8px 18px;
  background: var(--v-teal-lt); border: 1px solid rgba(40,120,106,0.2);
  border-radius: var(--r-sm); font-size: 0.82rem; font-weight: 600;
  color: var(--v-teal); animation: hp-up 0.6s ease both 0.3s;
}

/* Module strip */
.hp-main { max-width: 1200px; margin: 0 auto; padding: 0 32px 80px; }
.hp-modules {
  display: grid; grid-template-columns: repeat(4,1fr);
  gap: 14px; margin-top: -34px; margin-bottom: 52px;
  position: relative; z-index: 2;
  animation: hp-up 0.7s ease both 0.28s;
}
.hp-mod {
  background: var(--card); border: 1px solid var(--bd);
  border-radius: var(--r-lg); padding: 20px 18px;
  display: flex; align-items: center; gap: 13px;
  box-shadow: var(--sh); transition: transform var(--t), box-shadow var(--t);
  border-top-width: 3px; cursor: pointer;
}
.hp-mod:hover { transform: translateY(-3px); box-shadow: var(--sh-md); }
.hp-mod-arrow { margin-left: auto; font-size: 1rem; opacity: 0.3; transition: opacity var(--t), transform var(--t); }
.hp-mod:hover .hp-mod-arrow { opacity: 0.9; transform: translateX(3px); }
.hp-mod[data-c="blue"]   { border-top-color: var(--c-listen); }
.hp-mod[data-c="green"]  { border-top-color: var(--c-read); }
.hp-mod[data-c="amber"]  { border-top-color: var(--c-write); }
.hp-mod[data-c="violet"] { border-top-color: var(--c-speak); }
.hp-mod-icon { font-size: 1.4rem; flex-shrink: 0; line-height: 1; }
.hp-mod-name { font-size: 0.88rem; font-weight: 700; margin-bottom: 4px; }
.hp-mod[data-c="blue"]   .hp-mod-name { color: var(--c-listen); }
.hp-mod[data-c="green"]  .hp-mod-name { color: var(--c-read); }
.hp-mod[data-c="amber"]  .hp-mod-name { color: var(--c-write); }
.hp-mod[data-c="violet"] .hp-mod-name { color: var(--c-speak); }
.hp-mod-detail { font-size: 0.69rem; color: var(--tx-3); line-height: 1.45; }

/* Tests section */
.hp-tests { animation: hp-up 0.7s ease both 0.38s; }
.hp-tests-hd {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px;
}
.hp-tests-title { font-family: var(--f-display); font-size: 1.5rem; font-weight: 700; color: var(--tx); }
.hp-tests-badge {
  font-size: 0.75rem; font-weight: 500; color: var(--tx-3);
  background: var(--surface); border: 1px solid var(--bd);
  border-radius: 20px; padding: 3px 12px;
}
.hp-tests-tools { margin: 0 0 14px; }
.hp-tests-search {
  width: 100%; max-width: 420px;
  padding: 10px 14px;
  border: 1.5px solid var(--bd);
  border-radius: var(--r-sm);
  background: var(--card);
  color: var(--tx);
  font-family: var(--f-body);
  font-size: 0.88rem;
  outline: none;
  transition: border-color var(--t), box-shadow var(--t);
}
.hp-tests-search:focus {
  border-color: var(--v-teal);
  box-shadow: 0 0 0 3px var(--v-teal-lt);
}
.hp-paper-tabs {
  display: flex;
  gap: 8px;
  margin: 0 0 16px;
  flex-wrap: wrap;
}
.hp-paper-tab {
  appearance: none;
  border: 1px solid var(--bd);
  background: var(--card);
  color: var(--tx-2);
  font-size: 0.88rem;
  font-weight: 600;
  font-family: var(--f-body);
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color var(--t), color var(--t), background var(--t);
}
.hp-paper-tab:hover {
  border-color: var(--v-teal);
  color: var(--v-teal);
}
.hp-paper-tab.active {
  background: var(--v-teal);
  border-color: var(--v-teal);
  color: #fff;
}
body.dark-mode .hp-paper-tab.active {
  background: rgba(40,120,106,0.28);
  border-color: rgba(40,120,106,0.45);
  color: #d8f3ec;
}

/* Test cards (JS-generated) */
#page-home #testsGrid {
  display: grid; grid-template-columns: repeat(5,1fr); gap: 10px;
}
#page-home .test-card {
  position: relative;
  background: var(--card); border: 1.5px solid var(--bd);
  border-radius: var(--r-lg); padding: 18px 15px;
  box-shadow: var(--sh-sm); animation: none;
  transition: border-color var(--t), box-shadow var(--t), transform var(--t);
  text-align: left; cursor: pointer;
}
#page-home .test-card:hover {
  border-color: var(--v-teal);
  box-shadow: 0 0 0 1px var(--v-teal), 0 6px 20px var(--v-teal-glow);
  transform: translateY(-2px);
}
#page-home .test-num {
  font-family: var(--f-display); font-size: 1.15rem; font-weight: 700;
  color: var(--tx); margin-bottom: 5px; letter-spacing: -0.02em;
  transition: color var(--t);
}
#page-home .test-card:hover .test-num { color: var(--v-teal); }
#page-home .test-topic {
  font-size: 0.78rem; color: var(--tx-2); margin-bottom: 10px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
#page-home .test-status { font-size: 0.68rem; }
#page-home .test-done { color: var(--c-read); font-weight: 600; }
#page-home .test-inprogress { color: var(--c-write); }
#page-home .test-badge {
  position: absolute; top: 9px; right: 9px;
  width: 16px; height: 16px; border-radius: 50%;
  font-size: 0.5rem; display: flex; align-items: center; justify-content: center;
}
#page-home .badge-done { background: var(--c-read); color: #fff; }

@keyframes hp-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ----------------------------------------------------------------
   6. Exam Page
   ---------------------------------------------------------------- */
#page-exam { min-height: 100vh; background: var(--bg); }

/* Exam header */
.exam-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--surface); border-bottom: 1px solid var(--bd);
  box-shadow: var(--sh-sm);
}
.exam-header-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 0 28px; height: 60px;
  display: flex; align-items: center; justify-content: space-between;
}
.back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--f-body); font-size: 0.83rem; font-weight: 500;
  color: var(--tx-2); background: none; border: 1px solid var(--bd);
  border-radius: var(--r-sm); padding: 6px 14px; cursor: pointer;
  transition: all var(--t);
}
.back-btn:hover { border-color: var(--v-teal); color: var(--v-teal); }
.exam-title {
  font-family: var(--f-display); font-size: 1.1rem; font-weight: 700;
  color: var(--tx); letter-spacing: -0.01em; margin: 0;
}
.exam-controls { display: flex; align-items: center; gap: 10px; }

/* Timer */
.timer-box {
  display: flex; flex-direction: column; align-items: center;
  background: var(--bg); border: 1px solid var(--bd);
  border-radius: var(--r-sm); padding: 4px 16px;
}
.timer-label { font-size: 0.6rem; color: var(--tx-3); letter-spacing: 0.04em; text-transform: uppercase; }
.timer-value {
  font-family: var(--f-mono); font-size: 1.05rem; font-weight: 500;
  color: var(--tx); letter-spacing: 0.04em;
}
.timer-warning { color: var(--v-error) !important; }

/* Section tabs */
.section-tabs {
  max-width: 1200px; margin: 0 auto; padding: 0 28px;
  display: flex; gap: 0; border-top: 1px solid var(--bd);
  overflow-x: auto;
}
.tab-btn {
  background: none; border: none; border-bottom: 2.5px solid transparent;
  padding: 11px 22px; font-family: var(--f-body);
  font-size: 0.88rem; font-weight: 500;
  color: var(--tx-3); cursor: pointer; white-space: nowrap;
  transition: all var(--t);
}
.tab-btn:hover { color: var(--tx-2); }
.tab-btn.active { color: var(--v-teal); border-bottom-color: var(--v-teal); font-weight: 600; }

/* Exam main */
.exam-main { max-width: 1200px; margin: 0 auto; padding: 28px 28px 120px; }
.section-panel { display: none; }
.section-panel.active { display: block; animation: panel-in 0.22s ease; }
@keyframes panel-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.panel-header { margin-bottom: 28px; }
.panel-header h2 {
  font-family: var(--f-display); font-size: 1.6rem; font-weight: 700;
  color: var(--tx); margin-bottom: 6px;
}
.panel-note { font-size: 0.85rem; color: var(--tx-2); }

/* Listening */
.listening-section {
  background: var(--card); border: 1px solid var(--bd);
  border-radius: var(--r-lg); margin-bottom: 20px;
  overflow: hidden; box-shadow: var(--sh-sm);
}
.ls-header {
  padding: 16px 22px; border-bottom: 1px solid var(--bd);
  display: flex; justify-content: space-between; align-items: center;
  background: var(--bg);
}
.ls-header h3 { font-family: var(--f-display); font-size: 1.05rem; font-weight: 700; color: var(--c-listen); }
.ls-desc { font-size: 0.8rem; color: var(--tx-3); }
.ls-toolbar { display: flex; align-items: center; gap: 8px; padding: 14px 22px; }
.audio-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: 1.5px solid var(--c-listen);
  color: var(--c-listen); padding: 6px 16px;
  border-radius: var(--r-sm); cursor: pointer;
  font-family: var(--f-body); font-size: 0.8rem; font-weight: 600;
  transition: all var(--t);
}
.audio-btn:hover { background: rgba(37,99,235,0.08); }
.audio-btn.audio-playing {
  background: var(--c-listen); color: #fff;
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.75; } }
.transcript-toggle {
  background: none; border: 1px solid var(--bd);
  color: var(--tx-2); padding: 6px 14px;
  border-radius: var(--r-sm); cursor: pointer;
  font-family: var(--f-body); font-size: 0.78rem;
  transition: all var(--t);
}
.transcript-toggle:hover { border-color: var(--v-teal); color: var(--v-teal); }
.ls-transcript {
  margin: 0 22px 16px; padding: 14px 18px;
  background: var(--bg); border: 1px solid var(--bd);
  border-radius: var(--r-sm); font-size: 0.86rem;
  color: var(--tx-2); line-height: 1.8;
  max-height: 220px; overflow-y: auto;
}
.ls-transcript[hidden] { display: none !important; }
.ls-questions { padding: 4px 22px 20px; }
.ls-range {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--tx-2);
  margin-left: 8px;
}

/* One exam unit: Questions X–Y */
.q-block { margin-bottom: 8px; }
.q-block-hd { margin-bottom: 10px; }
.q-block-range {
  display: inline-block;
  font-family: var(--f-display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  background: var(--tx);
  padding: 4px 10px;
  margin-bottom: 10px;
}
.notes-example-row { margin: 0 0 4px; font-size: 0.86rem; }
.notes-line {
  margin: 0.45em 0;
  line-height: 1.75;
}

/* Listening notes sheet (PDF-like form / note completion) */
.ls-layout { margin-top: 8px; }
.notes-sheet {
  border: 1.5px solid var(--tx);
  background: var(--card);
  padding: 18px 22px 20px;
  margin-bottom: 16px;
  color: var(--tx);
  font-size: 0.92rem;
  line-height: 1.7;
}
.notes-sheet-auto { border-color: var(--bd); }
.notes-instruction {
  margin: 0 0 4px;
  font-size: 0.84rem;
  color: var(--tx-2);
}
.notes-instruction-sub {
  margin: 0 0 14px;
  font-size: 0.84rem;
  color: var(--tx-2);
}
.notes-title {
  margin: 6px 0 16px;
  text-align: center;
  font-family: var(--f-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--tx);
}
.notes-heading {
  margin: 14px 0 6px;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--tx);
}
.notes-heading:first-of-type { margin-top: 4px; }
.notes-list {
  margin: 0 0 4px;
  padding-left: 1.25em;
}
.notes-list li {
  margin: 0.35em 0;
  padding-left: 0.15em;
}
.notes-example {
  text-decoration: underline;
  font-weight: 600;
  text-underline-offset: 2px;
}
.notes-blank {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  vertical-align: baseline;
  margin: 0 2px;
  max-width: 100%;
}
.notes-blank-num {
  font-family: var(--f-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--c-listen);
  line-height: 1;
  flex-shrink: 0;
}
.notes-blank-input {
  display: inline-block;
  width: 8.5em;
  max-width: 42vw;
  border: none;
  border-bottom: 1.5px dotted var(--tx);
  border-radius: 0;
  background: transparent;
  padding: 1px 4px 2px;
  font: inherit;
  font-size: 0.92rem;
  color: var(--tx);
  outline: none;
  transition: border-color var(--t), background var(--t);
}
.notes-blank-input:focus {
  border-bottom-style: solid;
  border-bottom-color: var(--c-listen);
  background: rgba(37, 99, 235, 0.06);
}
.notes-blank.correct .notes-blank-input {
  border-bottom-color: var(--c-read);
  background: rgba(5, 150, 105, 0.08);
}
.notes-blank.incorrect .notes-blank-input {
  border-bottom-color: var(--v-error);
  background: rgba(192, 57, 43, 0.06);
}
.notes-blank-missing {
  color: var(--v-error);
  font-family: var(--f-mono);
  font-size: 0.8rem;
}
.ls-map {
  margin: 12px 0 16px;
  text-align: center;
}
.ls-map img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--bd);
  background: #fff;
}
.notes-options {
  list-style: none;
  padding-left: 0.5em;
  margin: 6px 0 10px;
}
.notes-options li { margin: 0.2em 0; }
.notes-qlist {
  padding-left: 1.4em;
  margin: 8px 0;
}
.notes-flow {
  border-left: 3px solid var(--bd);
  padding-left: 14px;
  margin: 10px 0 6px;
}
.notes-flow p { margin: 0.4em 0; }
.notes-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0 14px;
  font-size: 0.9rem;
}
.notes-table th, .notes-table td {
  border: 1px solid var(--bd);
  padding: 8px 10px;
  vertical-align: top;
  text-align: left;
}
.notes-table th { background: var(--bg); font-weight: 700; }
.wt-prompt-box {
  background: var(--bg);
  border: 1px solid var(--bd);
  padding: 12px 14px;
  margin: 10px 0;
  line-height: 1.65;
}
.cue-like { border-width: 2px; }
@media (max-width: 600px) {
  .notes-sheet { padding: 14px 12px 16px; }
  .notes-blank-input { width: 7em; }
}

/* Answer toggle / panel */
.answer-toggle {
  display: inline-block; background: none;
  border: 1px solid var(--bd); color: var(--c-read);
  padding: 5px 14px; border-radius: var(--r-sm);
  cursor: pointer; font-family: var(--f-body);
  font-size: 0.78rem; margin: 0 22px 14px;
  transition: all var(--t);
}
.answer-toggle:hover { background: rgba(5,150,105,0.08); border-color: var(--c-read); }
.answer-toggle-reading { color: var(--c-read); }
.answers-panel {
  margin: 0 22px 16px; padding: 12px 16px;
  background: var(--bg); border-radius: var(--r-sm);
  display: flex; flex-wrap: wrap; gap: 8px;
}
.answers-panel-listening { border: 1px solid rgba(37,99,235,0.3); }
.answers-panel-reading   { border: 1px solid rgba(5,150,105,0.3); }
.answer-row {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--card); border: 1px solid var(--bd);
  border-radius: 6px; padding: 4px 10px; font-size: 0.8rem;
}
.ar-num { font-weight: 700; color: var(--tx-3); font-size: 0.75rem; font-family: var(--f-mono); }
.ar-ans { color: var(--c-read); font-weight: 600; }

/* Reading */
.reading-passage {
  background: var(--card); border: 1px solid var(--bd);
  border-radius: var(--r-lg); margin-bottom: 24px;
  overflow: hidden; box-shadow: var(--sh-sm);
}
.rp-header {
  padding: 16px 22px; border-bottom: 1px solid var(--bd);
  background: var(--bg);
}
.rp-header h3 { font-family: var(--f-display); font-size: 1.05rem; font-weight: 700; color: var(--c-read); }
.rp-title { font-size: 1.05rem; font-weight: 700; color: var(--tx); margin-top: 2px; line-height: 1.35; }
.rp-text {
  padding: 4px 4px 20px; font-size: 0.95rem; line-height: 1.85;
  color: var(--tx);
}
.rp-text p { margin-bottom: 14px; }
.rp-text .para-label { font-weight: 700; color: var(--c-read); margin-right: 4px; }
.rp-questions { padding: 4px 4px 28px; }

/* Reading split layout (CBT-style) — panes scroll independently */
body.exam-reading-layout #page-exam {
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
body.exam-reading-layout .exam-header {
  flex: 0 0 auto;
}
body.exam-reading-layout .exam-body-row {
  flex: 1 1 auto;
  min-height: 0;
}
body.exam-reading-layout .cbt-instr-banner {
  flex: 0 0 auto;
}
body.exam-reading-layout .exam-main {
  flex: 1 1 auto;
  min-height: 0;
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 8px 12px 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
body.exam-reading-layout .exam-footer {
  flex: 0 0 auto;
  position: relative; /* override fixed so flex height math works */
}
body.exam-reading-layout #panel-reading.active {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
body.exam-reading-layout #panel-reading .panel-header-reading {
  flex: 0 0 auto;
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 8px;
  padding: 0 4px;
}
body.exam-reading-layout #panel-reading .panel-header-reading h2 {
  margin: 0;
  font-size: 1rem;
}
body.exam-reading-layout #panel-reading .panel-header-reading .panel-note {
  margin: 0;
  font-size: 0.8rem;
}

.rd-split-root {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}
.rd-sec-tabs {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.rd-sec-tab {
  border: 1px solid var(--bd);
  background: var(--card);
  color: var(--tx-2);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: var(--f-body);
  cursor: pointer;
  transition: all var(--t);
}
.rd-sec-tab:hover { border-color: var(--c-read); color: var(--c-read); }
.rd-sec-tab.active {
  background: var(--c-read);
  border-color: var(--c-read);
  color: #fff;
}

.reading-passage.rd-split {
  display: none;
  flex: 1 1 auto;
  min-height: 0;
  margin-bottom: 0;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #d8d8d8;
  box-shadow: none;
  overflow: hidden;
}
.reading-passage.rd-split.active {
  display: flex;
  flex-direction: row;
  align-items: stretch;
}
.rp-pane {
  flex: 1 1 50%;
  min-width: 0;
  min-height: 0;
  height: auto;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 18px 20px 28px;
  background: #fff;
}
.rp-pane-text { flex: 1 1 52%; }
.rp-pane-qs {
  flex: 1 1 48%;
  background: #fafafa;
}
.rp-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--tx);
  margin: 0 0 14px;
  line-height: 1.35;
}
.rp-splitter {
  flex: 0 0 14px;
  align-self: stretch;
  position: relative;
  cursor: col-resize;
  background: linear-gradient(#e8e8e8, #e8e8e8) center/1px 100% no-repeat;
  touch-action: none;
  user-select: none;
}
.rp-splitter:hover,
.rp-splitter:focus-visible {
  background:
    linear-gradient(rgba(37, 99, 235, 0.35), rgba(37, 99, 235, 0.35)) center/2px 100% no-repeat,
    #f3f6fb;
  outline: none;
}
.rp-splitter-grip {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid #cfd6e0;
  background: #fff;
  color: #64748b;
  font-size: 0.75rem;
  display: grid;
  place-items: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  pointer-events: none;
}
body.rd-splitting {
  cursor: col-resize !important;
  user-select: none !important;
}
body.rd-splitting iframe { pointer-events: none; }

body.dark-mode .reading-passage.rd-split,
body.dark-mode .rp-pane,
body.dark-mode .rp-pane-qs {
  background: var(--card);
  border-color: var(--bd);
}
body.dark-mode .rp-pane-qs { background: var(--bg); }
body.dark-mode .rp-splitter-grip {
  background: var(--card);
  border-color: var(--bd);
  color: var(--tx-2);
}

@media (max-width: 860px) {
  body.exam-reading-layout #page-exam {
    height: auto;
    overflow: auto;
  }
  body.exam-reading-layout .exam-main {
    overflow: visible;
    padding-bottom: 100px;
  }
  body.exam-reading-layout .exam-footer {
    position: fixed;
  }
  .reading-passage.rd-split.active {
    flex-direction: column;
    min-height: 70vh;
  }
  .rp-pane-text,
  .rp-pane-qs {
    flex: 1 1 50% !important;
    max-height: 45vh;
  }
  .rp-splitter {
    flex: 0 0 10px;
    cursor: row-resize;
    background: linear-gradient(#e8e8e8, #e8e8e8) center/100% 1px no-repeat;
  }
  .rp-splitter-grip { transform: translate(-50%, -50%) rotate(90deg); }
}

/* Reading highlight / notes (同桌录屏对齐) */
.rd-hl {
  background: #ffe566;
  color: inherit;
  border-radius: 1px;
  padding: 0 1px;
  cursor: pointer;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.rd-hl-note {
  background: #ffd54a;
}
.rd-anno-bar {
  position: fixed;
  z-index: 12000;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0;
  padding: 2px;
  background: #fff;
  color: #333;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
  font-family: var(--f-body);
  user-select: none;
}
.rd-anno-bar[hidden] { display: none !important; }
.rd-anno-icon-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: #444;
  width: 42px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 4px;
}
.rd-anno-icon-btn:hover { background: #f2f2f2; }
.rd-anno-icon-btn[hidden] { display: none !important; }
.rd-anno-icon-danger { color: #555; }
.rd-anno-icon-btn + .rd-anno-icon-btn:not([hidden]) {
  border-left: 1px solid #e5e5e5;
}

.rd-notes-drawer {
  flex: 0 0 320px;
  width: 320px;
  max-width: 40vw;
  background: #e8f1fb;
  border-left: 1px solid #c5d6ea;
  display: none;
  flex-direction: column;
  min-height: 0;
  z-index: 50;
}
#page-exam.rd-notes-open .rd-notes-drawer:not([hidden]),
.rd-notes-drawer:not([hidden]) {
  display: flex;
}
.rd-notes-drawer[hidden] { display: none !important; }
.rd-notes-drawer-hd {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 10px;
  background: #dceaf8;
  border-bottom: 1px solid #c5d6ea;
}
.rd-notes-drawer-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #111;
}
.rd-notes-drawer-title-cn,
.rd-note-cn,
.rd-note-show-more-cn {
  font-weight: 500;
  opacity: 0.85;
}
.rd-notes-drawer-close {
  appearance: none;
  border: none;
  background: transparent;
  font-size: 1.45rem;
  line-height: 1;
  color: #444;
  cursor: pointer;
  width: 30px;
  height: 30px;
  border-radius: 3px;
}
.rd-notes-drawer-close:hover { background: rgba(0,0,0,0.06); }
.rd-notes-drawer-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 14px 24px;
}
.rd-notes-empty {
  margin: 12px 4px;
  font-size: 0.85rem;
  color: #555;
  line-height: 1.45;
}
.rd-notes-part-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: #222;
  margin: 12px 2px 6px;
}
.rd-note-card {
  background: transparent;
  margin-bottom: 18px;
}
.rd-note-card.is-focus .rd-note-ta {
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px #3b82f6;
}
.rd-note-card.is-saved .rd-note-save-btn {
  background: #16a34a;
}
.rd-note-quote {
  display: block;
  font-size: 0.8rem;
  font-style: italic;
  color: #555;
  line-height: 1.45;
  margin: 0 2px 4px;
}
.rd-note-show-more {
  appearance: none;
  border: none;
  background: none;
  color: #2563eb;
  font-size: inherit;
  font-style: italic;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}
.rd-note-ta {
  width: 100%;
  border: 1px solid #c8c8c8;
  border-radius: 2px;
  padding: 10px 12px;
  font-size: 0.9rem;
  font-family: inherit;
  resize: vertical;
  min-height: 120px;
  outline: none;
  color: #111;
  background: #fff;
  box-sizing: border-box;
}
.rd-note-ta:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px #3b82f6;
}
.rd-note-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding: 0 2px;
}
.rd-note-save-btn {
  appearance: none;
  border: none;
  background: #4a4a4a;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 3px;
  cursor: pointer;
  font-family: inherit;
}
.rd-note-save-btn:hover { background: #333; }
.rd-note-delete-link {
  appearance: none;
  border: none;
  background: none;
  color: #2563eb;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 2px;
  font-family: inherit;
}
.rd-note-delete-link:hover { text-decoration: underline; }

.cbt-icon-btn.is-active {
  color: #1d4ed8;
  background: #e8f0fe;
}
#page-exam.cbt-reading.rd-notes-open .exam-main {
  min-width: 0;
}
@media (max-width: 900px) {
  .rd-notes-drawer {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    max-width: 86vw;
    width: 300px;
    box-shadow: -8px 0 24px rgba(0,0,0,0.12);
  }
  #page-exam.rd-notes-open .exam-body-row {
    position: relative;
  }
}

/* Writing */
.writing-task {
  background: var(--card); border: 1px solid var(--bd);
  border-radius: var(--r-lg); margin-bottom: 20px;
  overflow: hidden; box-shadow: var(--sh-sm);
}
.wt-header {
  padding: 16px 22px; border-bottom: 1px solid var(--bd);
  display: flex; justify-content: space-between; align-items: center;
  background: var(--bg);
}
.wt-header h3 { font-family: var(--f-display); font-size: 1.05rem; font-weight: 700; color: var(--c-write); }
.wt-badge {
  font-size: 0.74rem; color: var(--c-write);
  background: rgba(217,119,6,0.08); border: 1px solid rgba(217,119,6,0.2);
  border-radius: 20px; padding: 3px 12px; font-weight: 500;
}
.wt-body { padding: 20px 22px; }
.chart-desc {
  background: var(--bg); border: 1.5px dashed var(--bd);
  border-radius: var(--r-sm); padding: 14px 16px;
  font-size: 0.84rem; color: var(--tx-2); margin-bottom: 16px;
  font-style: italic; line-height: 1.6;
}
.wt-prompt { font-size: 0.9rem; color: var(--tx); margin-bottom: 16px; line-height: 1.75; }
.wt-prompt strong { color: var(--c-write); }
.writing-textarea {
  width: 100%; min-height: 200px;
  background: var(--bg); border: 1.5px solid var(--bd);
  border-radius: var(--r-sm); padding: 14px 16px;
  font-size: 0.9rem; color: var(--tx); font-family: var(--f-body);
  resize: vertical; transition: border-color var(--t); line-height: 1.75;
  outline: none;
}
.writing-textarea:focus { border-color: var(--c-write); box-shadow: 0 0 0 3px rgba(217,119,6,0.1); }
.word-count { font-size: 0.76rem; color: var(--tx-3); margin-top: 6px; text-align: right; font-family: var(--f-mono); }
.wt-tips {
  margin-top: 12px; padding: 10px 14px;
  background: var(--bg); border-radius: var(--r-sm);
  font-size: 0.8rem; color: var(--tx-2); border-left: 3px solid rgba(217,119,6,0.3);
}

/* Speaking */
.speaking-part {
  background: var(--card); border: 1px solid var(--bd);
  border-radius: var(--r-lg); margin-bottom: 20px;
  overflow: hidden; box-shadow: var(--sh-sm);
}
.sp-header {
  padding: 16px 22px; border-bottom: 1px solid var(--bd);
  background: var(--bg);
}
.sp-header h3 { font-family: var(--f-display); font-size: 1.05rem; font-weight: 700; color: var(--c-speak); }
.sp-desc { font-size: 0.8rem; color: var(--tx-2); margin-top: 3px; }
.sp-body { padding: 20px 22px; }
.cue-card {
  background: var(--bg); border: 2px solid rgba(124,58,237,0.2);
  border-radius: var(--r-sm); padding: 18px; margin-bottom: 16px;
}
.cue-card h4 { font-family: var(--f-display); font-size: 1rem; font-weight: 700; color: var(--c-speak); margin-bottom: 10px; }
.cue-card ul { padding-left: 20px; }
.cue-card ul li { font-size: 0.88rem; margin-bottom: 6px; color: var(--tx); }
.cue-note { font-size: 0.8rem; color: var(--tx-3); margin-top: 10px; font-style: italic; }
.speaking-q-list { list-style: none; padding: 0; }
.speaking-q-item {
  padding: 12px 14px; background: var(--bg);
  border: 1px solid var(--bd); border-radius: var(--r-sm);
  margin-bottom: 10px; font-size: 0.88rem; color: var(--tx);
  display: flex; gap: 12px; align-items: flex-start;
}
.q-num { font-weight: 700; color: var(--c-speak); min-width: 24px; font-family: var(--f-mono); font-size: 0.82rem; }
.speaking-notes {
  width: 100%; min-height: 80px; background: var(--bg);
  border: 1.5px solid var(--bd); border-radius: var(--r-sm);
  padding: 10px 14px; font-size: 0.86rem; color: var(--tx);
  font-family: var(--f-body); resize: vertical; margin-top: 14px;
  transition: border-color var(--t); outline: none;
}
.speaking-notes:focus { border-color: var(--c-speak); box-shadow: 0 0 0 3px rgba(124,58,237,0.1); }

/* Questions (shared) */
.question-block {
  margin-bottom: 18px; padding: 16px 18px;
  background: var(--bg); border-radius: var(--r-sm);
  border: 1px solid var(--bd);
}
.question-block.correct { border-color: var(--c-read); background: rgba(5,150,105,0.05); }
.question-block.incorrect { border-color: var(--v-error); background: rgba(192,57,43,0.05); }
.q-label {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  color: var(--tx-3); margin-bottom: 7px; letter-spacing: 0.06em;
  font-family: var(--f-mono);
}
.q-text { font-size: 0.9rem; color: var(--tx); margin-bottom: 12px; line-height: 1.65; }
.q-options { display: flex; flex-direction: column; gap: 8px; }
.q-option {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 13px; border: 1.5px solid var(--bd);
  border-radius: var(--r-sm); cursor: pointer;
  transition: all var(--t); font-size: 0.88rem;
  background: var(--card); color: var(--tx);
}
.q-option:hover { border-color: var(--v-teal); background: var(--v-teal-lt); }
.q-option input[type="radio"] { accent-color: var(--v-teal); flex-shrink: 0; }
.q-option.selected { border-color: var(--v-teal); background: var(--v-teal-lt); }
.q-option.correct-answer { border-color: var(--c-read) !important; background: rgba(5,150,105,0.08) !important; }
.q-option.wrong-answer   { border-color: var(--v-error) !important; background: rgba(192,57,43,0.06) !important; }
.q-input {
  width: 100%; padding: 9px 13px;
  background: var(--card); border: 1.5px solid var(--bd);
  border-radius: var(--r-sm); font-size: 0.9rem;
  color: var(--tx); font-family: var(--f-body);
  transition: border-color var(--t); outline: none;
}
.q-input:focus { border-color: var(--v-teal); box-shadow: 0 0 0 3px var(--v-teal-lt); }
.q-feedback { margin-top: 8px; font-size: 0.8rem; font-weight: 600; }
.q-feedback.correct   { color: var(--c-read); }
.q-feedback.incorrect { color: var(--v-error); }

/* Exam footer */
.exam-footer {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  background: var(--surface); border-top: 1px solid var(--bd);
  box-shadow: 0 -4px 20px rgba(24,39,58,0.08);
}
.exam-footer-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 12px 28px; display: flex; justify-content: flex-end;
}
.submit-btn {
  background: var(--v-ink); color: var(--v-cream);
  border: none; padding: 12px 28px;
  border-radius: var(--r-sm); cursor: pointer;
  font-family: var(--f-body); font-size: 0.92rem; font-weight: 600;
  letter-spacing: 0.02em; transition: all var(--t);
  position: relative; overflow: hidden;
}
.submit-btn::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.06) 0%, transparent 60%);
  pointer-events: none;
}
.submit-btn:hover {
  background: var(--v-teal); transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--v-teal-glow);
}

/* ----------------------------------------------------------------
   7. Result Page
   ---------------------------------------------------------------- */
#page-result { min-height: 100vh; background: var(--bg); }

/* Result header reuses site-header styles */
.site-header {
  background: var(--surface); border-bottom: 1px solid var(--bd);
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--sh-sm);
}
.header-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 0 28px; height: 62px;
  display: flex; align-items: center; justify-content: space-between;
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon { font-size: 1.3rem; }
.logo-text {
  font-family: var(--f-display); font-size: 1.15rem; font-weight: 700;
  color: var(--tx); letter-spacing: -0.01em;
}
.header-right { display: flex; align-items: center; gap: 10px; }

.result-main { max-width: 900px; margin: 0 auto; padding: 40px 24px 80px; }
.result-main.has-review-open { max-width: 1200px; }

/* Result card (legacy — kept for reference styles reused in rv-score-banner) */
.result-card {
  background: var(--card); border: 1px solid var(--bd);
  border-radius: var(--r-xl); padding: 48px 40px 40px;
  box-shadow: var(--sh-lg); text-align: center; margin-bottom: 28px;
}
.result-card h2 {
  font-family: var(--f-display); font-size: 1.1rem; font-weight: 600;
  color: var(--tx-3); text-transform: uppercase; letter-spacing: 0.1em;
  margin-bottom: 8px;
}
.result-band {
  font-family: var(--f-display); font-size: 7rem; font-weight: 700;
  color: var(--v-teal); line-height: 1; margin: 4px 0 6px;
  letter-spacing: -0.04em; font-style: italic;
}
body.dark-mode .result-band { color: var(--v-teal); }

.result-breakdown {
  display: flex; justify-content: center; gap: 14px;
  flex-wrap: wrap; margin: 28px 0 32px;
}
.breakdown-item {
  background: var(--bg); border: 1px solid var(--bd);
  border-radius: var(--r-lg); padding: 16px 24px;
  text-align: center; min-width: 120px;
}
.bd-label { font-size: 0.72rem; color: var(--tx-3); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.06em; font-family: var(--f-mono); }
.bd-score {
  font-family: var(--f-display); font-size: 1.8rem;
  font-weight: 700; font-style: italic; line-height: 1;
}
.bd-listening { color: var(--c-listen); }
.bd-reading   { color: var(--c-read); }
.bd-writing   { color: var(--c-write); }
.bd-speaking  { color: var(--c-speak); }
.bd-sub { font-size: 0.75rem; color: var(--tx-3); }
.result-desc {
  width: 100%; text-align: center; margin-top: 8px;
  font-size: 0.85rem; color: var(--tx-2);
}

.result-actions { display: flex; justify-content: center; gap: 12px; margin-top: 4px; }
.btn-primary {
  background: var(--v-ink); color: var(--v-cream);
  border: none; padding: 12px 28px;
  border-radius: var(--r-sm); cursor: pointer;
  font-family: var(--f-body); font-size: 0.92rem; font-weight: 600;
  transition: all var(--t);
}
.btn-primary:hover { background: var(--v-teal); box-shadow: 0 6px 20px var(--v-teal-glow); transform: translateY(-1px); }
.btn-secondary {
  background: none; color: var(--tx-2);
  border: 1.5px solid var(--bd); padding: 12px 28px;
  border-radius: var(--r-sm); cursor: pointer;
  font-family: var(--f-body); font-size: 0.92rem; font-weight: 500;
  transition: all var(--t);
}
.btn-secondary:hover { border-color: var(--v-teal); color: var(--v-teal); }

/* AI Feedback */
.ai-feedback-section {
  background: var(--card); border: 1px solid var(--bd);
  border-radius: var(--r-xl); padding: 32px;
  margin-bottom: 24px; box-shadow: var(--sh-sm);
}
.ai-feedback-section h3 {
  font-family: var(--f-display); font-size: 1.3rem; font-weight: 700;
  color: var(--tx); margin-bottom: 18px;
}
#aiFeedbackContent { font-size: 0.9rem; color: var(--tx-2); line-height: 1.8; }

/* Review area */
#reviewArea { margin-top: 24px; }
.review-panel {
  background: var(--card); border: 1px solid var(--bd);
  border-radius: var(--r-xl); padding: 28px 28px 32px;
  box-shadow: var(--sh-sm);
}
.review-panel-head { margin-bottom: 18px; }
.review-panel-head h3 {
  font-family: var(--f-display); font-size: 1.25rem; font-weight: 700;
  color: var(--tx); margin: 0 0 4px;
}
.review-panel-sub { font-size: 0.82rem; color: var(--tx-3); margin: 0; }

.review-toolbar { margin-bottom: 20px; }
.review-toolbar-inner {
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 12px;
}
.review-filter-group {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.review-filter-btn {
  background: var(--bg); border: 1px solid var(--bd);
  color: var(--tx-2); padding: 7px 14px; border-radius: var(--r-sm);
  font-size: 0.82rem; font-weight: 500; cursor: pointer;
  transition: all var(--t);
}
.review-filter-btn:hover { border-color: var(--v-teal); color: var(--v-teal); }
.review-filter-btn.active {
  background: var(--v-ink); color: var(--v-cream); border-color: var(--v-ink);
}
.review-wrong-toggle {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.85rem; color: var(--tx-2); cursor: pointer; user-select: none;
}
.review-wrong-toggle input { accent-color: var(--v-teal); }

.review-skill-block { margin-bottom: 28px; }
.review-skill-block:last-child { margin-bottom: 0; }
.review-skill-title {
  font-family: var(--f-display); font-size: 1.1rem; font-weight: 700;
  color: var(--tx); margin: 0 0 14px; padding-bottom: 10px;
  border-bottom: 2px solid var(--bd);
}
.review-skill-meta {
  font-size: 0.78rem; font-weight: 500; color: var(--tx-3);
  font-family: var(--f-mono); margin-left: 8px;
}

.review-part {
  background: var(--bg); border: 1px solid var(--bd);
  border-radius: var(--r-lg); padding: 18px 20px 20px;
  margin-bottom: 14px;
}
.review-part-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-bottom: 12px;
}
.review-part-title {
  font-size: 0.88rem; font-weight: 700; color: var(--tx);
  margin: 0; font-family: var(--f-mono); letter-spacing: 0.02em;
}
.review-part-score {
  font-size: 0.78rem; font-weight: 600; color: var(--tx-3);
  font-family: var(--f-mono); flex-shrink: 0;
}

.review-nav {
  display: flex; flex-wrap: wrap; gap: 5px;
  margin-bottom: 14px; padding-bottom: 12px;
  border-bottom: 1px dashed var(--bd);
}
.review-nav-pill {
  min-width: 2rem; height: 1.75rem; padding: 0 6px;
  border: 1px solid var(--bd); border-radius: var(--r-sm);
  background: var(--card); font-size: 0.75rem; font-weight: 600;
  font-family: var(--f-mono); cursor: pointer; transition: all var(--t);
}
.review-nav-pill.review-nav-correct { color: var(--c-read); border-color: rgba(5,150,105,0.35); }
.review-nav-pill.review-nav-wrong { color: var(--v-error); border-color: rgba(192,57,43,0.35); }
.review-nav-pill.review-nav-hidden { display: none; }
.review-nav-pill:hover { transform: translateY(-1px); box-shadow: var(--sh-sm); }

.review-layout-context {
  margin-bottom: 16px; padding: 14px 16px;
  background: var(--card); border: 1px solid var(--bd);
  border-radius: var(--r-md); font-size: 0.9rem; line-height: 1.65;
  overflow-x: auto;
}
.review-layout-context .notes-sheet { margin: 0; }

.review-blank {
  flex-wrap: wrap; gap: 3px 6px;
  padding: 1px 4px 2px; border-radius: 3px;
}
.review-blank.correct { background: rgba(5,150,105,0.08); }
.review-blank.incorrect { background: rgba(192,57,43,0.06); }
.review-ans-user { font-weight: 600; }
.review-blank.correct .review-ans-user { color: var(--c-read); }
.review-blank.incorrect .review-ans-user { color: var(--v-error); }
.review-ans-arrow { color: var(--tx-3); font-size: 0.8rem; margin: 0 2px; }
.review-ans-correct { color: var(--c-read); font-weight: 600; }
.review-ans-ok { color: var(--c-read); font-weight: 700; margin-left: 2px; }
.review-empty { color: var(--tx-3); font-style: italic; font-weight: 400; }

.review-items { display: flex; flex-direction: column; gap: 10px; }
.review-item {
  background: var(--card); border: 1px solid var(--bd);
  border-radius: var(--r-md); padding: 12px 14px;
  border-left: 3px solid var(--bd);
  transition: box-shadow var(--t), border-color var(--t);
}
.review-item-correct { border-left-color: var(--c-read); }
.review-item-wrong { border-left-color: var(--v-error); }
.review-item.review-highlight {
  box-shadow: 0 0 0 2px var(--v-teal-glow, rgba(13,148,136,0.25));
}
.review-item-head {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
}
.review-item-num {
  font-family: var(--f-mono); font-weight: 700; font-size: 0.85rem;
  color: var(--tx); min-width: 1.5rem;
}
.review-item-type {
  font-size: 0.72rem; color: var(--tx-3); text-transform: uppercase;
  letter-spacing: 0.04em;
}
.review-item-badge {
  margin-left: auto; font-size: 0.72rem; font-weight: 600;
  padding: 2px 8px; border-radius: 99px;
}
.review-item-correct .review-item-badge { background: rgba(5,150,105,0.12); color: var(--c-read); }
.review-item-wrong .review-item-badge { background: rgba(192,57,43,0.1); color: var(--v-error); }
.review-item-context {
  font-size: 0.84rem; color: var(--tx-2); line-height: 1.55;
  margin-bottom: 8px; padding-bottom: 8px;
  border-bottom: 1px solid var(--bd);
}
.review-item-row {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px;
  font-size: 0.85rem;
}
.review-item-label {
  font-size: 0.72rem; color: var(--tx-3); text-transform: uppercase;
  letter-spacing: 0.05em; min-width: 4.5rem;
}
.review-all-correct, .review-empty-state {
  text-align: center; color: var(--tx-3); font-size: 0.9rem; padding: 20px 0;
}

/* Answer review workspace — L / R / W skill tabs */
.rv-workspace {
  margin-top: 28px;
  background: var(--card);
  border: 1px solid var(--bd);
  border-radius: var(--r-xl);
  padding: 20px 20px 24px;
  box-shadow: var(--sh-sm);
}
#page-result.review-open .rv-workspace { margin-top: 0; }
.rv-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--bd);
}
.rv-head-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}
.rv-back-btn {
  flex-shrink: 0;
  padding: 6px 14px;
  font-size: 0.82rem;
}

/* Score banner at top of answer review */
.rv-score-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px 28px;
  padding: 18px 20px;
  margin-bottom: 16px;
  background: var(--bg);
  border: 1px solid var(--bd);
  border-radius: var(--r-lg);
}
.rv-score-overall {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 100px;
  padding-right: 24px;
  border-right: 1px solid var(--bd);
}
.rv-score-label {
  font-size: 0.72rem;
  color: var(--tx-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--f-mono);
}
.rv-score-band {
  font-family: var(--f-display);
  font-size: 3.2rem;
  font-weight: 700;
  font-style: italic;
  color: var(--v-teal);
  line-height: 1.1;
}
.rv-score-desc {
  font-size: 0.78rem;
  color: var(--tx-3);
  margin-top: 2px;
}
.rv-score-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}
.rv-score-item {
  background: var(--card);
  border: 1px solid var(--bd);
  border-radius: var(--r-md);
  padding: 10px 12px;
  text-align: center;
}
.rv-score-item-label {
  display: block;
  font-size: 0.68rem;
  color: var(--tx-3);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.rv-score-item-band {
  display: block;
  font-family: var(--f-display);
  font-size: 1.5rem;
  font-weight: 700;
  font-style: italic;
  line-height: 1.1;
}
.rv-score-item-sub {
  display: block;
  font-size: 0.72rem;
  color: var(--tx-3);
  margin-top: 2px;
}
.rv-writing-wrap { padding: 4px 8px 16px; }
.rv-writing-title {
  font-family: var(--f-display);
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--tx);
}

@media (max-width: 720px) {
  .rv-score-banner { flex-direction: column; align-items: stretch; }
  .rv-score-overall {
    border-right: none;
    border-bottom: 1px solid var(--bd);
    padding-right: 0;
    padding-bottom: 14px;
  }
  .rv-score-grid { grid-template-columns: repeat(2, 1fr); }
}
.rv-loading-msg {
  text-align: center;
  color: var(--tx-3);
  font-size: 0.88rem;
  padding: 8px 0 12px;
}
.rv-load-error {
  text-align: center;
  color: var(--v-error);
  font-size: 0.88rem;
  padding: 8px 12px;
  margin-bottom: 8px;
  background: rgba(220, 38, 38, 0.06);
  border-radius: var(--r-sm);
}
.rv-skill-tabs {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-bottom: 18px;
  border-bottom: 2px solid var(--bd);
}
.rv-skill-tab {
  flex: 1;
  max-width: 220px;
  border: none;
  background: transparent;
  padding: 14px 16px 12px;
  cursor: pointer;
  text-align: center;
  color: var(--tx-3);
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color var(--t), border-color var(--t);
}
.rv-skill-tab:hover { color: var(--tx); }
.rv-skill-tab.active {
  color: var(--tx);
  border-bottom-color: var(--v-teal);
  font-weight: 700;
}
.rv-skill-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: var(--f-mono);
}
.rv-skill-meta {
  display: block;
  font-size: 0.72rem;
  color: var(--tx-3);
  margin-top: 4px;
  font-family: var(--f-mono);
}
.rv-skill-panel { min-height: 0; }
.rv-writing-panel {
  padding: 8px 4px 12px;
  max-width: 900px;
  margin: 0 auto;
}

/* Listening / Reading split pane */
.lr-root, .rr-root { margin: 0; }
.lr-shell, .rr-shell {
  display: grid;
  grid-template-columns: 52px 1fr minmax(300px, 36%) 44px;
  gap: 0;
  height: min(72vh, 640px);
  min-height: 480px;
  border: 1px solid var(--bd);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--card);
}
.lr-section-nav {
  display: flex; flex-direction: column;
  background: var(--bg); border-right: 1px solid var(--bd);
  padding: 8px 0;
}
.lr-sec-btn {
  writing-mode: vertical-rl; text-orientation: mixed;
  transform: rotate(180deg);
  border: none; background: transparent;
  padding: 14px 6px; margin: 2px 4px;
  font-size: 0.68rem; font-weight: 700; font-family: var(--f-mono);
  color: var(--tx-3); cursor: pointer; border-radius: var(--r-sm);
  letter-spacing: 0.04em;
}
.lr-sec-btn:hover { color: var(--v-teal); background: rgba(13,148,136,0.06); }
.lr-sec-btn.active {
  color: var(--v-cream); background: var(--c-listen);
}
.lr-paper-col, .rv-paper-col {
  overflow: hidden;
  border-right: 1px solid var(--bd);
  background: #fff;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
body.dark-mode .lr-paper-col, body.dark-mode .rv-paper-col { background: var(--bg); }
.lr-paper, .rr-paper {
  flex: 1;
  overflow: auto;
  padding: 16px 18px 20px;
  font-size: 0.9rem;
  line-height: 1.65;
  min-height: 0;
}
.lr-sidebar, .rv-side-col {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg);
  overflow: hidden;
}
.lr-side-content {
  flex: 1 1 auto;
  overflow: auto;
  padding: 12px 14px;
  min-height: 0;
}
.lr-transcript-block {
  flex: 0 0 auto;
  max-height: 34%;
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--bd);
  background: var(--card);
  min-height: 0;
}
.lr-transcript-head {
  padding: 8px 12px 0;
  flex-shrink: 0;
}
.lr-transcript-title {
  font-size: 0.78rem;
  font-weight: 700;
  margin: 0;
  color: var(--tx-2);
}
.lr-transcript {
  flex: 1;
  overflow: auto;
  padding: 8px 12px 10px;
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--tx-2);
  min-height: 0;
}
.lr-transcript-inner { white-space: pre-wrap; }
.lr-vtabs {
  display: flex; flex-direction: column;
  border-left: 1px solid var(--bd);
  background: var(--card);
}
.lr-vtab {
  flex: 1; min-height: 72px;
  border: none; border-bottom: 1px solid var(--bd);
  background: transparent; cursor: pointer;
  writing-mode: vertical-rl; text-orientation: mixed;
  transform: rotate(180deg);
  font-size: 0.78rem; font-weight: 600; color: var(--tx-3);
  padding: 10px 4px; letter-spacing: 0.06em;
}
.lr-vtab:last-child { border-bottom: none; }
.lr-vtab:hover { color: var(--v-teal); background: rgba(13,148,136,0.05); }
.lr-vtab.active {
  color: var(--v-error); background: rgba(192,57,43,0.06);
  font-weight: 700;
}

.lr-ans-toolbar {
  display: flex; flex-wrap: wrap; gap: 8px 14px;
  margin-bottom: 10px; font-size: 0.78rem; color: var(--tx-3);
}
.lr-ans-table-wrap { overflow: auto; max-height: 320px; }
.lr-ans-table {
  width: 100%; border-collapse: collapse; font-size: 0.82rem;
}
.lr-ans-table th, .lr-ans-table td {
  border: 1px solid var(--bd); padding: 7px 8px; text-align: left;
}
.lr-ans-table th {
  background: var(--card); font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.04em; color: var(--tx-3);
  position: sticky; top: 0; z-index: 1;
}
.lr-ans-row { cursor: pointer; transition: background var(--t); }
.lr-ans-row:hover { background: rgba(13,148,136,0.05); }
.lr-ans-wrong .lr-td-user { color: var(--v-error); font-weight: 600; }
.lr-td-correct { color: var(--c-read); }
.lr-mark-ok { color: var(--c-read); font-weight: 700; }
.lr-mark-bad { color: var(--v-error); font-weight: 700; }

.lr-analysis-head { margin-bottom: 14px; }
.lr-analysis-head-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; margin-bottom: 8px;
}
.lr-analysis-actions { margin-top: 10px; }
.lr-wrongbook-btn {
  font-size: 0.78rem; font-weight: 600;
  padding: 6px 14px; border-radius: var(--r-sm);
  border: 1px solid var(--v-error); background: #fff;
  color: var(--v-error); cursor: pointer; transition: all var(--t);
}
.lr-wrongbook-btn:hover:not(:disabled) {
  background: var(--v-error); color: #fff;
}
.lr-wrongbook-btn.lr-wrongbook-done,
.lr-wrongbook-btn:disabled {
  border-color: var(--bd); background: var(--bg);
  color: var(--tx-3); cursor: default;
}
.lr-q-select-label { font-size: 0.82rem; color: var(--tx-2); display: block; margin-bottom: 8px; }
.lr-q-select {
  margin-left: 6px; padding: 4px 8px; border-radius: var(--r-sm);
  border: 1px solid var(--bd); background: var(--card); font-size: 0.82rem;
}
.lr-analysis-ans { font-size: 0.88rem; margin-top: 6px; }
.lr-user-wrong { color: var(--v-error); font-weight: 600; text-decoration: line-through; }
.lr-correct-inline { color: var(--c-read); font-weight: 600; margin-left: 4px; }
.lr-analysis-block {
  margin-bottom: 14px; padding-bottom: 12px;
  border-bottom: 1px dashed var(--bd);
}
.lr-analysis-block h5 {
  font-size: 0.75rem; font-weight: 700; color: var(--tx);
  text-transform: uppercase; letter-spacing: 0.06em; margin: 0 0 6px;
}
.lr-analysis-block p { font-size: 0.84rem; color: var(--tx-2); line-height: 1.6; margin: 0; }
.lr-locate { font-style: italic; }
.lr-explain-body { margin-top: 8px !important; }
.lr-no-analysis { font-size: 0.85rem; color: var(--tx-3); }

.lr-tab-reset { padding: 20px 8px; text-align: center; }
.lr-reset-desc { font-size: 0.85rem; color: var(--tx-2); line-height: 1.6; margin-bottom: 16px; }
.lr-reset-btn { width: 100%; max-width: 220px; }

.lr-player {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-top: 1px solid var(--bd);
  background: var(--card); flex-shrink: 0;
}

/* Reading review — answer sheet + analysis (mockup style) */
.rr-passage-only {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
.rr-passage-toolbar {
  flex-shrink: 0;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--bd);
  margin-bottom: 10px;
}
.rr-passage-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--tx-3);
  font-family: var(--f-mono);
}
.rr-passage-body {
  flex: 1;
  overflow: auto;
  min-height: 0;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--tx);
}
.rr-passage-text p { margin: 0.6em 0; }
.rr-highlight {
  background: rgba(37, 99, 235, 0.18);
  padding: 0 2px;
  border-radius: 2px;
}

.rr-side-answers { padding: 0 !important; display: flex; flex-direction: column; min-height: 0; }
.rr-side-analysis { padding: 0 !important; overflow: hidden; display: flex; flex-direction: column; min-height: 0; }

.rr-answer-sheet {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
.rr-sheet-hd {
  flex-shrink: 0;
  background: #3d3d3d;
  color: #fff;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 10px 12px;
  letter-spacing: 0.04em;
}
body.dark-mode .rr-sheet-hd { background: #2a2a2a; }
.rr-sheet-table-wrap {
  flex: 1;
  overflow: auto;
  min-height: 0;
}
.rr-sheet-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.rr-sheet-table th,
.rr-sheet-table td {
  border: 1px solid var(--bd);
  padding: 8px 10px;
  text-align: left;
}
.rr-sheet-table th {
  background: var(--bg);
  font-size: 0.72rem;
  color: var(--tx-3);
  position: sticky;
  top: 0;
  z-index: 1;
}
.rr-sheet-num { width: 2.5rem; text-align: center; font-weight: 700; font-family: var(--f-mono); }
.rr-sheet-correct { color: var(--c-read); }
.rr-sheet-user { color: var(--tx); }
.rr-sheet-wrong .rr-sheet-user { color: var(--v-error); font-weight: 600; }
.rr-sheet-row { cursor: pointer; transition: background var(--t); }
.rr-sheet-row:hover { background: rgba(13, 148, 136, 0.06); }
.rr-sheet-ft {
  flex-shrink: 0;
  padding: 10px 14px;
  font-size: 0.8rem;
  color: var(--tx-2);
  border-top: 1px solid var(--bd);
  background: var(--card);
  text-align: center;
}

.rr-analysis-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
.rr-analysis-sheet-wrap {
  flex: 0 0 42%;
  min-height: 120px;
  max-height: 48%;
  overflow: auto;
  border-bottom: 1px solid var(--bd);
  padding: 10px 12px;
  background: #fff;
}
body.dark-mode .rr-analysis-sheet-wrap { background: var(--bg); }
.rr-analysis-sheet { font-size: 0.85rem; line-height: 1.6; }
.rr-analysis-detail {
  flex: 1;
  overflow: auto;
  min-height: 0;
  padding: 10px 12px 14px;
}
.rr-analysis-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--bd);
}
.rr-q-nav {
  width: 28px;
  height: 28px;
  border: 1px solid var(--bd);
  border-radius: var(--r-sm);
  background: var(--card);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--tx-2);
}
.rr-q-nav:hover { border-color: var(--v-teal); color: var(--v-teal); }
.rr-q-label { font-size: 0.88rem; }
.rr-q-pos {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--tx-3);
  font-family: var(--f-mono);
}
.rr-analysis-ans-line {
  font-size: 0.88rem;
  margin-bottom: 12px;
}
.rr-locate-sentence {
  font-style: italic;
  background: rgba(37, 99, 235, 0.06);
  padding: 8px 10px;
  border-radius: var(--r-sm);
  border-left: 3px solid var(--c-read);
}

.rr-sec-btn { font-size: 0.62rem !important; }

/* Reading review paper split (legacy fallback) */
.rr-paper-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  min-height: 100%;
}
.rr-passage-pane {
  overflow: auto;
  padding: 0 14px 16px 0;
  border-right: 1px solid var(--bd);
  font-size: 0.88rem;
  line-height: 1.65;
}
.rr-qs-pane {
  overflow: auto;
  padding: 0 0 16px 14px;
}
.rr-passage-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 10px;
}
@media (max-width: 900px) {
  .lr-shell, .rr-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(280px, 42vh) minmax(240px, 38vh) auto;
    height: auto;
    min-height: 0;
  }
  .rr-paper-split { grid-template-columns: 1fr; }
  .rr-passage-pane { border-right: none; border-bottom: 1px solid var(--bd); max-height: 200px; }
}
.lr-play-btn {
  width: 32px; height: 32px; border-radius: 50%;
  border: none; background: var(--c-listen); color: #fff;
  cursor: pointer; font-size: 0.75rem; flex-shrink: 0;
}
.lr-progress { flex: 1; min-width: 60px; accent-color: var(--c-listen); }
.lr-time { font-size: 0.72rem; font-family: var(--f-mono); color: var(--tx-3); }
.lr-time-sep { font-size: 0.72rem; color: var(--tx-3); }

.lr-paper-layout .notes-sheet { margin: 0; }

.review-section {
  background: var(--card); border: 1px solid var(--bd);
  border-radius: var(--r-lg); padding: 24px; margin-bottom: 16px;
  box-shadow: var(--sh-sm);
}
.review-section h3 {
  font-family: var(--f-display); font-size: 1.15rem; font-weight: 700;
  color: var(--tx); margin-bottom: 16px;
}

/* ----------------------------------------------------------------
   8. Responsive
   ---------------------------------------------------------------- */
@media (max-width: 960px) {
  .hp-modules { grid-template-columns: repeat(2,1fr); margin-top: 24px; }
  .hp-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hp-nav-inner { flex-wrap: wrap; height: auto; min-height: 62px; gap: 10px; padding-top: 10px; padding-bottom: 10px; }
  .hp-tabs { order: 3; width: 100%; justify-content: center; }
  .hp-panel-hero { flex-direction: column; align-items: flex-start; }
  #page-home #testsGrid { grid-template-columns: repeat(4,1fr); }
}
@media (max-width: 640px) {
  .hp-nav-inner, .hp-main { padding-left: 20px; padding-right: 20px; }
  .hp-hero-wrap { padding: 48px 20px 60px; }
  .hp-modules { grid-template-columns: repeat(2,1fr); }
  .hp-card-grid { grid-template-columns: 1fr; }
  .hp-tab { flex: 1; text-align: center; padding: 8px 10px; font-size: 0.8rem; }
  #page-home #testsGrid { grid-template-columns: repeat(3,1fr); }
  #page-home #testsGrid { grid-template-columns: repeat(3,1fr); }
  .exam-header-inner, .exam-footer-inner, .exam-main { padding-left: 16px; padding-right: 16px; }
  .section-tabs { padding-left: 16px; }
  .tab-btn { padding: 10px 14px; font-size: 0.82rem; }
  .result-card { padding: 36px 24px 32px; }
  .result-band { font-size: 5rem; }
  .v-auth-card { width: calc(100vw - 32px); padding: 36px 24px 32px; }
}
@media (max-width: 420px) {
  #page-home #testsGrid { grid-template-columns: repeat(2,1fr); }
  .result-breakdown { gap: 10px; }
  .breakdown-item { min-width: 90px; padding: 12px 16px; }
}

/* ================================================================
   SPEAKING AI PRACTICE — sa-* components
   ================================================================ */

/* ---- Home CTA Banner ---- */
.hp-speak-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--card);
  border: 1px solid var(--bd);
  border-left: 4px solid var(--c-speak);
  border-radius: var(--r-lg);
  padding: 20px 24px;
  margin-bottom: 28px;
  box-shadow: var(--sh);
  animation: fadeUp 0.4s ease both;
}
.hp-speak-cta-left {
  display: flex;
  align-items: center;
  gap: 16px;
}
.hp-speak-cta-icon {
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
}
.hp-speak-cta-title {
  font-family: var(--f-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--c-speak);
  margin-bottom: 2px;
}
.hp-speak-cta-sub {
  font-size: 0.82rem;
  color: var(--tx-3);
  line-height: 1.4;
}
.hp-speak-cta-btn {
  flex-shrink: 0;
  background: var(--c-speak);
  color: #fff;
  border: none;
  border-radius: var(--r);
  padding: 10px 20px;
  font-family: var(--f-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--t), transform var(--t);
  white-space: nowrap;
}
.hp-speak-cta-btn:hover { opacity: 0.88; transform: translateY(-1px); }

/* ================================================================
   SPEAKING PAGE — Unified with VERDANT Design System
   ================================================================ */

#page-speak, .sp-page {
  background: var(--bg);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Ambient background glows — separate class, position:fixed */
.sp-ambient {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  z-index: 0;
}
.sp-orb-1 {
  width: 520px; height: 520px;
  background: radial-gradient(circle, rgba(124,58,237,0.13) 0%, transparent 70%);
  top: -160px; left: -160px;
}
.sp-orb-2 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(40,120,106,0.09) 0%, transparent 70%);
  bottom: -180px; right: -160px;
}

/* ---- Header ---- */
.sp-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  height: 56px;
  background: var(--bg);
  border-bottom: 1px solid var(--bd);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: background var(--t), border-color var(--t);
}
.sp-back-btn {
  display: flex; align-items: center; gap: 6px;
  background: none;
  border: 1px solid var(--bd);
  border-radius: var(--r-sm);
  padding: 6px 12px;
  font-size: 0.8rem; font-weight: 600;
  color: var(--tx-2);
  cursor: pointer; transition: all var(--t);
  white-space: nowrap; font-family: var(--f-body);
}
.sp-back-btn:hover { background: var(--surface); color: var(--tx); border-color: var(--tx-3); }
.sp-back-btn svg { flex-shrink: 0; }
.sp-header-center {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.sp-header-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--c-speak);
  box-shadow: 0 0 8px rgba(124,58,237,0.8);
  animation: sp-dot 2s ease-in-out infinite;
}
@keyframes sp-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}
.sp-header-title {
  font-family: var(--f-body);
  font-size: 0.88rem; font-weight: 600;
  color: var(--tx); letter-spacing: 0.04em;
}
.sp-header-right { display: flex; align-items: center; gap: 10px; }
.sp-timer {
  display: flex; align-items: center; justify-content: center;
  background: var(--card); border: 1px solid var(--bd);
  border-radius: 20px; padding: 4px 12px;
}
.sp-timer-val {
  font-family: var(--f-mono); font-size: 0.82rem; font-weight: 600;
  color: var(--c-speak); letter-spacing: 0.06em;
}
.sp-theme-btn {
  background: none; border: 1px solid var(--bd);
  border-radius: var(--r-sm); padding: 6px 8px;
  cursor: pointer; transition: background var(--t); font-size: 0.85rem;
  color: var(--tx-2);
}
.sp-theme-btn:hover { background: var(--surface); }

/* ---- Setup Screen ---- */
.sp-setup {
  position: relative; z-index: 1;
  min-height: calc(100vh - 56px);
  display: flex; align-items: center; justify-content: center;
  padding: 40px 24px 60px;
}
.sp-setup-inner {
  width: 100%; max-width: 560px;
  animation: sp-up 0.38s cubic-bezier(0.22,1,0.36,1) both;
}
@keyframes sp-up { from { opacity:0; transform:translateY(18px); } to { opacity:1; transform:none; } }

.sp-badge {
  display: inline-block;
  background: var(--accent-purple-light);
  color: var(--c-speak);
  border: 1px solid rgba(124,58,237,0.2);
  border-radius: 20px; padding: 4px 14px;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  margin-bottom: 20px;
}
.sp-setup-heading {
  font-family: var(--f-display);
  font-size: 2.6rem; font-weight: 700; font-style: italic;
  color: var(--tx); line-height: 1.18; margin: 0 0 10px;
}
.sp-setup-sub {
  font-size: 0.88rem; color: var(--tx-3); line-height: 1.65; margin: 0 0 32px;
}
.sp-section { margin-bottom: 24px; }
.sp-label {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--tx-3); margin-bottom: 10px;
}
.sp-mode-row { display: flex; gap: 8px; flex-wrap: wrap; }
.sa-mode-btn {
  flex: 1; min-width: 90px;
  background: var(--card); border: 1.5px solid var(--bd);
  border-radius: var(--r); padding: 12px 10px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  cursor: pointer; transition: all var(--t); font-family: var(--f-body);
}
.sa-mode-btn:hover { border-color: var(--c-speak); background: var(--accent-purple-light); }
.sa-mode-btn.active { border-color: var(--c-speak); background: var(--accent-purple-light); box-shadow: 0 0 0 3px rgba(124,58,237,0.1); }
.sp-mode-num { font-size: 0.88rem; font-weight: 700; color: var(--tx); }
.sp-mode-sub { font-size: 0.67rem; color: var(--tx-3); }
.sa-mode-btn.active .sp-mode-num { color: var(--c-speak); }
.sa-mode-btn.active .sp-mode-sub { color: var(--c-speak); opacity: 0.8; }

.sp-topic-wrap { display: flex; flex-wrap: wrap; gap: 7px; }
.sa-topic-btn {
  background: var(--card); border: 1px solid var(--bd);
  border-radius: 20px; padding: 6px 14px;
  font-size: 0.78rem; font-weight: 500; color: var(--tx-2);
  cursor: pointer; transition: all var(--t); font-family: var(--f-body);
}
.sa-topic-btn:hover { border-color: var(--c-speak); color: var(--c-speak); }
.sa-topic-btn.selected, .sa-topic-btn.active { background: var(--accent-purple-light); border-color: var(--c-speak); color: var(--c-speak); font-weight: 600; }

.sa-browser-warn {
  background: var(--accent-orange-light); border: 1px solid var(--c-write);
  border-radius: var(--r-sm); padding: 10px 14px;
  font-size: 0.8rem; color: var(--c-write); margin-bottom: 20px;
}

.sp-start-btn {
  width: 100%; padding: 14px;
  background: linear-gradient(135deg, var(--c-speak), #5b21b6);
  color: #fff; border: none; border-radius: var(--r);
  font-family: var(--f-body); font-size: 0.95rem; font-weight: 700;
  cursor: pointer; transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(124,58,237,0.3);
  letter-spacing: 0.03em;
}
.sp-start-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(124,58,237,0.45); }
.sp-start-btn:disabled { opacity: 0.35; cursor: not-allowed; box-shadow: none; transform: none; }

/* ---- Session Screen ---- */
.sp-session {
  display: flex;
  height: calc(100vh - 56px);
  position: relative; z-index: 1;
}
.sp-main { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }

/* Orb Zone — compact, aligned to top */
.sp-orb-zone {
  display: flex; flex-direction: column; align-items: center;
  flex-shrink: 0; padding: 24px 20px 20px;
  background: linear-gradient(180deg, var(--bg) 0%, #0d1117 100%);
}
.sp-sess-tag {
  font-size: 0.7rem; color: var(--c-speak);
  background: var(--accent-purple-light);
  border: 1px solid rgba(124,58,237,0.2);
  border-radius: 20px; padding: 3px 12px; margin-bottom: 20px;
  font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px;
  font-family: var(--f-body);
}
.sp-orb-wrap { position: relative; width: 160px; height: 160px; display: flex; align-items: center; justify-content: center; }
.sp-orb-ring { position: absolute; border-radius: 50%; border: 1px solid rgba(124,58,237,0.18); pointer-events: none; }
.sp-ring-1 { width: 190px; height: 190px; animation: sp-ring 4s ease-out infinite; }
.sp-ring-2 { width: 220px; height: 220px; animation: sp-ring 4s ease-out 1.8s infinite; }
@keyframes sp-ring { 0% { transform: scale(0.92); opacity: 0.5; } 100% { transform: scale(1.08); opacity: 0; } }

/* Interactive orb */
.sp-orb {
  width: 140px; height: 140px; border-radius: 50%;
  position: relative; overflow: hidden; cursor: pointer;
  animation: sp-orb-idle 5s ease-in-out infinite;
  box-shadow: 0 0 40px rgba(124,58,237,0.45), 0 0 80px rgba(124,58,237,0.18), inset 0 0 30px rgba(0,0,0,0.4);
  transition: box-shadow 0.5s ease;
}
.sp-orb-bg { position: absolute; inset: 0; background: linear-gradient(145deg, #1e1b4b 0%, #312e81 50%, #4c1d95 100%); }
.sp-blob { position: absolute; border-radius: 50%; filter: blur(18px); mix-blend-mode: screen; opacity: 0.9; }
.sp-b1 { width: 90px; height: 90px; background: radial-gradient(circle, #6366f1 0%, transparent 70%); animation: sp-blob1 7s ease-in-out infinite; }
.sp-b2 { width: 75px; height: 75px; background: radial-gradient(circle, #8b5cf6 0%, transparent 70%); animation: sp-blob2 9s ease-in-out infinite; }
.sp-b3 { width: 65px; height: 65px; background: radial-gradient(circle, #c4b5fd 0%, transparent 70%); animation: sp-blob3 6s ease-in-out infinite; }
.sp-orb-shine { position: absolute; top: 12%; left: 14%; width: 38%; height: 32%; background: radial-gradient(circle, rgba(255,255,255,0.22) 0%, transparent 100%); border-radius: 50%; pointer-events: none; }

@keyframes sp-blob1 { 0% { top:5%;left:5%; } 25% { top:45%;left:55%; } 50% { top:65%;left:15%; } 75% { top:20%;left:65%; } 100% { top:5%;left:5%; } }
@keyframes sp-blob2 { 0% { top:55%;left:45%; } 33% { top:10%;left:65%; } 66% { top:35%;left:5%; } 100% { top:55%;left:45%; } }
@keyframes sp-blob3 { 0% { top:25%;left:35%; } 50% { top:65%;left:55%; } 100% { top:25%;left:35%; } }
@keyframes sp-orb-idle { 0%,100% { transform: scale(1); } 50% { transform: scale(1.035); } }

.sp-page.sp-speaking .sp-orb { animation: sp-orb-speak 0.9s ease-in-out infinite; box-shadow: 0 0 60px rgba(99,102,241,0.7), 0 0 120px rgba(99,102,241,0.35), inset 0 0 30px rgba(0,0,0,0.3); }
.sp-page.sp-speaking .sp-b1 { animation-duration: 2.5s; }
.sp-page.sp-speaking .sp-b2 { animation-duration: 1.8s; }
.sp-page.sp-speaking .sp-b3 { animation-duration: 1.2s; width: 85px; height: 85px; }
.sp-page.sp-speaking .sp-ring-1 { border-color: rgba(99,102,241,0.4); animation-duration: 2s; }
.sp-page.sp-speaking .sp-ring-2 { border-color: rgba(99,102,241,0.25); animation-duration: 2.5s; }
@keyframes sp-orb-speak { 0% { transform:scale(1); } 20% { transform:scale(1.08); } 40% { transform:scale(1.04); } 60% { transform:scale(1.09); } 80% { transform:scale(1.05); } 100% { transform:scale(1); } }

.sp-page.sp-listening .sp-orb { animation: sp-orb-listen 0.6s ease-in-out infinite; box-shadow: 0 0 60px rgba(52,211,153,0.6), 0 0 120px rgba(52,211,153,0.25), inset 0 0 30px rgba(0,0,0,0.3); }
.sp-page.sp-listening .sp-orb-bg { background: linear-gradient(145deg, #064e3b 0%, #065f46 50%, #047857 100%); }
.sp-page.sp-listening .sp-b1 { background: radial-gradient(circle, #10b981 0%, transparent 70%); animation-duration: 1.5s; }
.sp-page.sp-listening .sp-b2 { background: radial-gradient(circle, #34d399 0%, transparent 70%); animation-duration: 1s; }
.sp-page.sp-listening .sp-b3 { background: radial-gradient(circle, #6ee7b7 0%, transparent 70%); animation-duration: 0.7s; }
.sp-page.sp-listening .sp-ring-1 { border-color: rgba(52,211,153,0.35); }
.sp-page.sp-listening .sp-ring-2 { border-color: rgba(52,211,153,0.2); }
@keyframes sp-orb-listen { 0%,100% { transform: scale(1.04); } 50% { transform: scale(1.09); } }

.sp-page.sp-thinking .sp-orb { animation: sp-orb-idle 2s ease-in-out infinite; opacity: 0.7; }
.sp-orb-status { margin-top: 14px; font-size: 0.82rem; color: rgba(255,255,255,0.4); text-align: center; transition: color 0.3s; letter-spacing: 0.02em; font-family: var(--f-body); }
.sp-page.sp-speaking .sp-orb-status { color: #a5b4fc; }
.sp-page.sp-listening .sp-orb-status { color: #6ee7b7; }
.sp-page.sp-thinking .sp-orb-status { color: rgba(255,255,255,0.6); }

/* ---- Transcript ---- */
.sp-transcript { flex: 1; overflow-y: auto; padding: 12px 20px 8px; display: flex; flex-direction: column; gap: 10px; background: #0d1117; min-height: 0; }
.sp-transcript::-webkit-scrollbar { width: 3px; }
.sp-transcript::-webkit-scrollbar-thumb { background: var(--bd); border-radius: 2px; }
.sa-bubble { max-width: 78%; padding: 10px 14px; border-radius: var(--r); font-size: 0.85rem; line-height: 1.6; word-wrap: break-word; animation: sp-up 0.22s ease both; font-family: var(--f-body); }
.sa-bubble-ai { align-self: flex-start; background: var(--card); border: 1px solid var(--bd); border-bottom-left-radius: 4px; color: var(--tx); }
.sa-bubble-user { align-self: flex-end; background: var(--accent-purple-light); border: 1px solid rgba(124,58,237,0.25); border-bottom-right-radius: 4px; color: var(--tx); }
.sa-cue-card { align-self: flex-start; max-width: 88%; background: var(--card); border: 1px solid var(--bd); border-left: 3px solid var(--c-speak); border-radius: var(--r); padding: 14px 16px; animation: sp-up 0.22s ease both; }
.sa-cue-task { font-family: var(--f-display); font-size: 1rem; font-weight: 700; color: var(--c-speak); margin-bottom: 8px; }
.sa-cue-prompts { margin: 0; padding-left: 16px; font-size: 0.8rem; color: var(--tx-2); line-height: 1.85; }
.sa-cue-hint { margin-top: 8px; font-size: 0.75rem; color: var(--tx-3); font-style: italic; }

/* ---- Controls ---- */
.sp-ctrl-bar { border-top: 1px solid rgba(255,255,255,0.06); background: #0d1117; padding: 12px 20px 16px; display: flex; flex-direction: column; align-items: center; gap: 10px; flex-shrink: 0; }
.sp-text-wrap { display: flex; gap: 8px; width: 100%; max-width: 480px; }
.sp-text-input { flex: 1; padding: 10px 15px; background: var(--surface); border: 1px solid var(--bd); border-radius: var(--r-sm); color: var(--tx); font-family: var(--f-body); font-size: 0.87rem; }
.sp-text-input:focus { outline: none; border-color: var(--c-speak); }
.sp-text-input::placeholder { color: var(--tx-3); }
.sp-send-btn { padding: 10px 18px; background: var(--c-speak); color: #fff; border: none; border-radius: var(--r-sm); font-family: var(--f-body); font-size: 0.84rem; font-weight: 600; cursor: pointer; transition: opacity 0.18s; }
.sp-send-btn:hover { opacity: 0.85; }

.sp-mic-row { display: flex; align-items: center; gap: 16px; }
.sp-end-link { background: none; border: 1px solid var(--bd); border-radius: 20px; padding: 7px 16px; font-size: 0.78rem; font-weight: 600; color: var(--tx-3); cursor: pointer; transition: all var(--t); font-family: var(--f-body); }
.sp-end-link:hover { border-color: var(--v-error); color: var(--v-error); }

.sp-mic-btn {
  width: 60px; height: 60px; border-radius: 50%;
  background: linear-gradient(135deg, var(--c-speak), #5b21b6);
  border: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(124,58,237,0.4); transition: all 0.2s;
  position: relative;
}
.sp-mic-btn:hover { transform: scale(1.07); box-shadow: 0 6px 28px rgba(124,58,237,0.55); }
.sp-mic-btn:disabled { opacity: 0.3; cursor: not-allowed; transform: none; box-shadow: none; }
.sa-mic-active { background: linear-gradient(135deg, #059669, #047857) !important; box-shadow: 0 4px 20px rgba(5,150,105,0.5) !important; animation: sp-mic-pulse 1s ease-in-out infinite; }
@keyframes sp-mic-pulse { 0%,100% { box-shadow: 0 4px 20px rgba(5,150,105,0.5); } 50% { box-shadow: 0 4px 32px rgba(5,150,105,0.8); } }
.sp-mic-icon { color: #fff; }
.sp-mic-status { font-size: 0.7rem; color: var(--tx-3); font-family: var(--f-body); }

/* ---- Sidebar ---- */
.sp-sidebar { width: 240px; border-left: 1px solid var(--bd); background: var(--bg); padding: 16px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }
.sp-tips-hd { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--tx-3); font-family: var(--f-body); }
.sp-tips-list { display: flex; flex-direction: column; gap: 6px; }
.sa-tips-empty { font-size: 0.78rem; color: var(--tx-3); font-style: italic; font-family: var(--f-body); }
.sa-tip-item { font-size: 0.78rem; color: var(--tx-2); padding: 8px 10px; background: var(--card); border: 1px solid var(--bd); border-left: 3px solid var(--c-speak); border-radius: var(--r-sm); line-height: 1.5; font-family: var(--f-body); }

/* ---- Score Overlay ---- */
.sp-score-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; z-index: 50; backdrop-filter: blur(8px); }
.sp-score-card { background: var(--card); border: 1px solid var(--bd); border-radius: var(--r-xl); padding: 32px; width: 90%; max-width: 520px; max-height: 85vh; overflow-y: auto; box-shadow: 0 24px 80px rgba(0,0,0,0.35); }
.sp-sc-loading { font-size: 0.9rem; color: var(--tx-3); font-family: var(--f-body); text-align: center; padding: 20px; }
.sp-sc-band { font-family: var(--f-display); font-size: 5rem; font-weight: 700; text-align: center; color: var(--c-speak); line-height: 1; margin-bottom: 6px; }
.sp-sc-band-label { text-align: center; font-size: 0.75rem; color: var(--tx-3); margin-bottom: 24px; font-family: var(--f-body); letter-spacing: 0.1em; text-transform: uppercase; }
.sp-sc-criteria { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px; }
.sp-sc-crit { background: var(--surface); border: 1px solid var(--bd); border-radius: var(--r); padding: 12px 10px; text-align: center; }
.sp-sc-crit-label { font-size: 0.65rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--tx-3); margin-bottom: 4px; font-family: var(--f-body); }
.sp-sc-crit-score { font-family: var(--f-display); font-size: 1.9rem; font-weight: 700; color: var(--c-speak); line-height: 1.1; }
.sp-sc-crit-comment { font-size: 0.7rem; color: var(--tx-2); margin-top: 5px; line-height: 1.45; font-family: var(--f-body); }
.sp-sc-summary { font-size: 0.85rem; color: var(--tx-2); line-height: 1.7; margin-bottom: 16px; padding: 14px; background: var(--surface); border-radius: var(--r-sm); border: 1px solid var(--bd); font-family: var(--f-body); }
.sp-sc-lists { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
.sp-sc-list-title { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--tx-3); margin-bottom: 8px; font-family: var(--f-body); }
.sp-sc-list-item { font-size: 0.77rem; color: var(--tx-2); line-height: 1.5; padding: 4px 0; border-bottom: 1px solid var(--bd); font-family: var(--f-body); }
.sp-sc-btn { width: 100%; padding: 13px; background: linear-gradient(135deg, var(--c-speak), #5b21b6); color: #fff; border: none; border-radius: var(--r); font-family: var(--f-body); font-size: 0.95rem; font-weight: 600; cursor: pointer; transition: all 0.2s; box-shadow: 0 4px 16px rgba(124,58,237,0.3); }
.sp-sc-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(124,58,237,0.45); }

/* ---- Responsive ---- */
@media (max-width: 860px) {
  .sp-session { flex-direction: column; }
  .sp-sidebar { width: 100%; max-height: 160px; flex-direction: row; flex-wrap: wrap; border-left: none; border-top: 1px solid var(--bd); }
  .sp-tips-list { flex: 1; overflow-y: auto; }
}
@media (max-width: 640px) {
  .sp-setup-heading { font-size: 2rem; }
  .sp-orb { width: 120px; height: 120px; }
  .sp-orb-wrap { width: 140px; height: 140px; }
  .sp-ring-1 { width: 165px; height: 165px; }
  .sp-ring-2 { width: 190px; height: 190px; }
  .sa-bubble { max-width: 92%; }
  .sp-sc-criteria { grid-template-columns: 1fr; }
  .sp-sc-lists { grid-template-columns: 1fr; }
}

/* ----------------------------------------------------------------
   10. Word Hover — Click-to-lookup Dictionary
   ---------------------------------------------------------------- */
.hw-word {
  cursor: pointer;
  border-bottom: 1px dotted transparent;
  border-radius: 2px;
  transition: border-color 0.15s, background-color 0.15s;
}
.hw-word:hover {
  border-bottom-color: var(--v-teal);
}
.hw-word-active {
  background-color: var(--v-teal-lt);
  border-bottom-color: var(--v-teal);
}

/* Tooltip */
.hw-tooltip {
  position: fixed;
  z-index: 10000;
  width: 300px;
  max-width: calc(100vw - 16px);
  background: var(--card);
  border: 1px solid var(--bd);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
  font-family: var(--f-body);
  pointer-events: auto;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.hw-tt-visible {
  opacity: 1;
}

.hw-tt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.hw-tt-word {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--tx);
  font-family: var(--f-display);
}
.hw-tt-audio {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  transition: background 0.15s;
  line-height: 1;
}
.hw-tt-audio:hover {
  background: var(--v-teal-lt);
}

.hw-tt-phonetic {
  font-size: 0.85rem;
  color: var(--v-muted);
  font-family: var(--f-mono);
  margin-bottom: 4px;
}
.hw-tt-pos {
  font-size: 0.8rem;
  color: var(--v-teal);
  font-weight: 500;
  font-style: italic;
  margin-bottom: 6px;
}
.hw-tt-def {
  font-size: 0.92rem;
  color: var(--tx);
  line-height: 1.5;
  word-break: break-word;
}
.hw-tt-def-en {
  font-size: 0.82rem;
  color: var(--v-muted);
  margin-top: 4px;
  line-height: 1.45;
  word-break: break-word;
}
/* Phrase highlight */
.hw-word-phrase {
  background-color: rgba(217, 119, 6, 0.15);
  border-bottom-color: #d97706;
}
.dark-mode .hw-word-phrase {
  background-color: rgba(217, 119, 6, 0.2);
}

/* Phrase section in tooltip */
.hw-tt-phrase-section {
  margin-bottom: 8px;
}
.hw-tt-phrase-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  color: #d97706;
  background: rgba(217, 119, 6, 0.1);
  padding: 1px 7px;
  border-radius: 4px;
  margin-bottom: 4px;
  letter-spacing: 0.02em;
}
.hw-tt-phrase-text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--tx);
  margin-bottom: 2px;
}
.hw-tt-phrase-def {
  font-size: 0.9rem;
  color: var(--tx);
  line-height: 1.45;
}
.hw-tt-divider {
  height: 1px;
  background: var(--bd);
  margin: 8px 0;
}

.hw-tt-loading {
  font-size: 0.88rem;
  color: var(--v-muted);
  text-align: center;
  padding: 8px 0;
  animation: hw-pulse 1.2s ease-in-out infinite;
}
@keyframes hw-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* Dark mode adjustments */
.dark-mode .hw-tooltip {
  box-shadow: 0 8px 32px rgba(0,0,0,0.3), 0 2px 8px rgba(0,0,0,0.2);
}

/* Mobile: slightly smaller tooltip */
@media (max-width: 640px) {
  .hw-tooltip {
    width: 260px;
    padding: 12px 14px;
    border-radius: 10px;
  }
  .hw-tt-word { font-size: 1.05rem; }
  .hw-tt-def { font-size: 0.88rem; }
}

/* ----------------------------------------------------------------
   11. Novel Reading Module
   ---------------------------------------------------------------- */

/* Novel CTA on home page */
.hp-novel-cta { border-color: var(--v-teal); }
.hp-novel-cta .hp-speak-cta-btn { background: var(--v-teal); }

/* Header */
.nv-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--bd);
}
.nv-header-inner {
  max-width: 900px; margin: 0 auto;
  padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.nv-back-btn {
  display: flex; align-items: center; gap: 5px;
  background: none; border: none; color: var(--v-teal);
  font: 500 0.88rem var(--f-body); cursor: pointer;
}
.nv-back-btn:hover { text-decoration: underline; }
.nv-header-title {
  font: 600 1.05rem var(--f-display); color: var(--tx);
  flex: 1; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nv-header-right { display: flex; align-items: center; gap: 8px; }
.nv-tts-btn {
  background: var(--v-teal-lt); color: var(--v-teal);
  border: none; border-radius: 8px; padding: 6px 14px;
  font: 500 0.82rem var(--f-body); cursor: pointer;
  transition: background 0.15s;
}
.nv-tts-btn:hover { background: var(--v-teal-glow); }
.nv-tts-playing { background: var(--v-teal); color: #fff; }
.nv-tts-playing:hover { background: var(--v-teal); opacity: 0.9; }

/* Chapter nav bar */
.nv-ch-nav {
  max-width: 900px; margin: 0 auto;
  padding: 8px 20px;
  display: flex; align-items: center; justify-content: center; gap: 20px;
  border-top: 1px solid var(--bd);
}
.nv-nav-btn {
  background: none; border: 1px solid var(--bd);
  border-radius: 6px; padding: 4px 14px;
  font: 500 0.82rem var(--f-body); color: var(--tx);
  cursor: pointer; transition: all 0.15s;
}
.nv-nav-btn:hover:not(:disabled) { border-color: var(--v-teal); color: var(--v-teal); }
.nv-nav-btn:disabled { opacity: 0.3; cursor: default; }
.nv-ch-info { font: 500 0.85rem var(--f-mono); color: var(--v-muted); }

/* Library */
.nv-library-wrap { padding: 0 20px 40px; max-width: 900px; margin: 0 auto; }
.nv-library-hero {
  text-align: center; padding: 48px 0 32px;
}
.nv-lib-badge {
  display: inline-block;
  font: 600 0.72rem var(--f-body); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--v-teal); background: var(--v-teal-lt);
  padding: 4px 14px; border-radius: 20px; margin-bottom: 14px;
}
.nv-lib-title {
  font: 700 2.2rem var(--f-display); color: var(--tx);
  margin: 0 0 8px;
}
.nv-lib-sub {
  font: 400 0.95rem var(--f-body); color: var(--v-muted);
  max-width: 480px; margin: 0 auto;
}
.nv-library {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px; margin-top: 8px;
}
.nv-lib-home { text-align: center; margin-top: 32px; }
.nv-home-btn {
  background: none; border: 1px solid var(--bd); border-radius: 8px;
  padding: 8px 24px; font: 500 0.88rem var(--f-body); color: var(--v-muted);
  cursor: pointer; transition: all 0.15s;
}
.nv-home-btn:hover { border-color: var(--v-teal); color: var(--v-teal); }

/* Novel card */
.nv-card {
  background: var(--card); border: 1px solid var(--bd);
  border-radius: 14px; overflow: hidden; cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.nv-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.08); }
.nv-card-cover {
  height: 100px; display: flex; align-items: center; justify-content: center;
}
.nv-card-emoji { font-size: 2.8rem; }
.nv-card-body { padding: 16px; }
.nv-card-diff {
  font: 600 0.68rem var(--f-body); letter-spacing: 0.06em;
  text-transform: uppercase; margin-bottom: 6px;
}
.nv-card-title {
  font: 600 1.1rem var(--f-display); color: var(--tx);
  margin-bottom: 2px;
}
.nv-card-author {
  font: 400 0.82rem var(--f-body); color: var(--v-muted);
  margin-bottom: 8px;
}
.nv-card-desc {
  font: 400 0.82rem var(--f-body); color: var(--v-ink-2);
  line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.nv-card-meta {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--bd);
  font: 400 0.78rem var(--f-body); color: var(--v-muted);
}
.nv-card-prog { color: var(--v-teal); font-weight: 500; }

/* Reader */
.nv-reader-wrap {
  max-width: 720px; margin: 0 auto; padding: 0 20px 60px;
}
.nv-reader {
  padding: 24px 0;
}
.nv-loading, .nv-empty {
  text-align: center; padding: 60px 20px;
  color: var(--v-muted); font: 400 0.95rem var(--f-body);
}
.nv-ch-header {
  text-align: center; margin-bottom: 32px; padding-bottom: 20px;
  border-bottom: 1px solid var(--bd);
}
.nv-ch-num {
  font: 600 0.72rem var(--f-body); letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--v-teal); margin-bottom: 6px;
}
.nv-ch-title {
  font: 600 1.6rem var(--f-display); color: var(--tx);
  margin: 0 0 6px;
}
.nv-ch-meta {
  font: 400 0.82rem var(--f-body); color: var(--v-muted);
}

/* Chapter text */
.nv-ch-text {
  font: 400 1.05rem var(--f-body); color: var(--tx);
  line-height: 1.85; letter-spacing: 0.01em;
}
.nv-para {
  margin-bottom: 1.2em;
  transition: background-color 0.3s;
  padding: 4px 8px; border-radius: 6px;
  margin-left: -8px; margin-right: -8px;
}
.nv-para-active {
  background-color: var(--v-teal-lt);
}

/* Moral (for fables) */
.nv-moral {
  margin-top: 28px; padding: 16px 20px;
  background: var(--v-teal-lt); border-radius: 10px;
  border-left: 3px solid var(--v-teal);
}
.nv-moral-badge {
  font: 600 0.7rem var(--f-body); letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--v-teal); margin-bottom: 6px;
}
.nv-moral-en {
  font: 500 0.95rem var(--f-body); color: var(--tx);
  font-style: italic; margin-bottom: 4px;
}
.nv-moral-zh {
  font: 400 0.88rem var(--f-body); color: var(--v-muted);
}

/* Mobile */
@media (max-width: 640px) {
  .nv-lib-title { font-size: 1.6rem; }
  .nv-library { grid-template-columns: 1fr; }
  .nv-ch-title { font-size: 1.3rem; }
  .nv-ch-text { font-size: 0.98rem; line-height: 1.75; }
  .nv-header-inner { padding: 10px 14px; }
  .nv-tts-btn { padding: 5px 10px; font-size: 0.78rem; }
}

/* ================================================================
   VOCABULARY PAGE
   ================================================================ */

/* Star button in word-hover tooltip */
.hw-tt-star {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 6px;
  transition: all 0.2s;
  line-height: 1;
  color: var(--tx-3);
}
.hw-tt-star:hover { color: #e6a817; transform: scale(1.2); }
.hw-tt-star.hw-tt-starred { color: #e6a817; cursor: default; }

/* Header */
.voc-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--bd);
}
.voc-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 900px;
  margin: 0 auto;
  padding: 14px 24px;
}
.voc-back-btn {
  background: none;
  border: none;
  font-size: 0.9rem;
  color: var(--tx-2);
  cursor: pointer;
  font-family: var(--f-body);
}
.voc-back-btn:hover { color: var(--v-teal); }
.voc-header-title {
  font-family: var(--f-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--tx);
  margin: 0;
}
.voc-header-right { display: flex; align-items: center; gap: 8px; }

/* Tabs */
.voc-tabs {
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 0 24px 12px;
  max-width: 900px;
  margin: 0 auto;
}
.voc-tab {
  background: none;
  border: none;
  font-family: var(--f-body);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--tx-3);
  padding: 6px 20px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
}
.voc-tab:hover { color: var(--tx); background: var(--v-teal-lt); }
.voc-tab.active { color: #fff; background: var(--v-teal); }

/* Stats */
.voc-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  padding: 20px 24px;
  max-width: 900px;
  margin: 0 auto;
}
.voc-stat { text-align: center; }
.voc-stat-num {
  display: block;
  font-family: var(--f-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--v-teal);
}
.voc-stat-label {
  font-size: 0.78rem;
  color: var(--tx-3);
  margin-top: 2px;
}

/* Views toggle */
.voc-view { display: none; max-width: 900px; margin: 0 auto; padding: 0 24px 40px; }
.voc-view.active { display: block; }

/* Search */
.voc-search-bar { margin-bottom: 16px; }
.voc-search {
  width: 100%;
  padding: 10px 16px;
  border: 1px solid var(--bd);
  border-radius: 10px;
  font-family: var(--f-body);
  font-size: 0.9rem;
  background: var(--card);
  color: var(--tx);
  outline: none;
  transition: border 0.2s;
  box-sizing: border-box;
}
.voc-search:focus { border-color: var(--v-teal); }

/* Word List */
.voc-list { display: flex; flex-direction: column; gap: 8px; }
.voc-empty {
  text-align: center;
  color: var(--tx-3);
  padding: 48px 0;
  font-size: 0.92rem;
}
.voc-item {
  background: var(--card);
  border: 1px solid var(--bd);
  border-radius: 12px;
  padding: 14px 18px;
  transition: box-shadow 0.2s;
}
.voc-item:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.voc-item-main { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.voc-item-word { font-family: var(--f-display); font-size: 1.1rem; font-weight: 700; color: var(--tx); }
.voc-item-phonetic { font-family: var(--f-mono); font-size: 0.82rem; color: var(--tx-3); }
.voc-item-pos { font-size: 0.78rem; color: var(--v-teal); font-style: italic; }
.voc-item-def { font-size: 0.88rem; color: var(--tx-2); line-height: 1.5; }
.voc-item-def-en { font-size: 0.82rem; color: var(--tx-3); margin-top: 2px; line-height: 1.4; }
.voc-item-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--tx-3);
}
.voc-item-ctx {
  background: var(--v-teal-lt);
  color: var(--v-teal);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.72rem;
}
.voc-item-date { margin-left: auto; }
.voc-item-del {
  background: none;
  border: none;
  color: var(--tx-3);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.15s;
}
.voc-item-del:hover { color: var(--v-error); background: rgba(192,57,43,0.08); }

/* Flashcard */
.voc-review-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 0;
}
.voc-card-container {
  perspective: 800px;
  width: 100%;
  max-width: 420px;
  height: 280px;
  margin-bottom: 24px;
}
.voc-card {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.5s;
  cursor: pointer;
}
.voc-card.voc-card-flipped { transform: rotateY(180deg); }
.voc-card-front, .voc-card-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 16px;
  border: 1px solid var(--bd);
  background: var(--card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}
.voc-card-back { transform: rotateY(180deg); }
.voc-card-word {
  font-family: var(--f-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--tx);
  margin-bottom: 8px;
}
.voc-card-phonetic {
  font-family: var(--f-mono);
  font-size: 0.95rem;
  color: var(--tx-3);
}
.voc-card-hint {
  margin-top: 24px;
  font-size: 0.78rem;
  color: var(--tx-3);
  opacity: 0.5;
}
.voc-card-pos {
  font-size: 0.85rem;
  color: var(--v-teal);
  font-style: italic;
  margin-bottom: 10px;
}
.voc-card-def {
  font-size: 1rem;
  color: var(--tx);
  text-align: center;
  line-height: 1.6;
  margin-bottom: 6px;
}
.voc-card-def-en {
  font-size: 0.85rem;
  color: var(--tx-3);
  text-align: center;
  line-height: 1.5;
}
.voc-card-ctx {
  margin-top: 12px;
  font-size: 0.75rem;
  color: var(--tx-3);
  opacity: 0.6;
}

/* Review Buttons */
.voc-review-btns {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.voc-rbtn {
  border: none;
  padding: 10px 22px;
  border-radius: 10px;
  font-family: var(--f-body);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  color: #fff;
}
.voc-rbtn-fail { background: #e74c3c; }
.voc-rbtn-fail:hover { background: #c0392b; }
.voc-rbtn-hard { background: #e67e22; }
.voc-rbtn-hard:hover { background: #d35400; }
.voc-rbtn-good { background: var(--v-teal); }
.voc-rbtn-good:hover { background: #1f6357; }
.voc-rbtn-easy { background: #2563eb; }
.voc-rbtn-easy:hover { background: #1d4ed8; }

.voc-review-progress {
  margin-top: 16px;
  font-size: 0.82rem;
  color: var(--tx-3);
}

.voc-review-empty {
  text-align: center;
  padding: 60px 0;
}
.voc-review-empty-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--v-teal-lt);
  color: var(--v-teal);
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.voc-review-empty-text {
  font-family: var(--f-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--tx);
  margin-bottom: 6px;
}
.voc-review-empty-sub {
  font-size: 0.85rem;
  color: var(--tx-3);
}

/* Vocab CTA on home */
.hp-vocab-cta .hp-speak-cta-icon { background: linear-gradient(135deg, #e6a817 0%, #d97706 100%); }

/* Responsive */
@media (max-width: 600px) {
  .voc-header-inner { padding: 12px 16px; }
  .voc-stats { gap: 20px; padding: 16px; }
  .voc-stat-num { font-size: 1.4rem; }
  .voc-view { padding: 0 16px 32px; }
  .voc-card-container { height: 240px; }
  .voc-card-word { font-size: 1.6rem; }
  .voc-review-btns { gap: 6px; }
  .voc-rbtn { padding: 8px 16px; font-size: 0.82rem; }
}

/* ================================================================
   WRONG ANSWERS PAGE
   ================================================================ */
.wa-header {
  position: sticky; top: 0; z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--bd);
}
.wa-header-inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 900px; margin: 0 auto; padding: 14px 24px;
}
.wa-back-btn {
  background: none; border: none; font-size: 0.9rem;
  color: var(--tx-2); cursor: pointer; font-family: var(--f-body);
}
.wa-back-btn:hover { color: var(--v-teal); }
.wa-header-title {
  font-family: var(--f-display); font-size: 1.2rem; font-weight: 700; color: var(--tx); margin: 0;
}
.wa-header-right { display: flex; align-items: center; gap: 8px; }

.wa-filters {
  display: flex; justify-content: center; gap: 6px;
  padding: 0 24px 12px; max-width: 900px; margin: 0 auto; flex-wrap: wrap;
}
.wa-filter {
  background: none; border: 1px solid var(--bd); font-family: var(--f-body);
  font-size: 0.82rem; color: var(--tx-3); padding: 5px 14px;
  border-radius: 16px; cursor: pointer; transition: all 0.2s;
}
.wa-filter:hover { color: var(--tx); border-color: var(--v-teal); }
.wa-filter.active { color: #fff; background: var(--v-teal); border-color: var(--v-teal); }

.wa-stats {
  display: flex; justify-content: center; gap: 32px;
  padding: 20px 24px; max-width: 900px; margin: 0 auto;
}
.wa-stat { text-align: center; }
.wa-stat-num {
  display: block; font-family: var(--f-display);
  font-size: 1.8rem; font-weight: 700; color: var(--v-error);
}
.wa-stat-label { font-size: 0.78rem; color: var(--tx-3); margin-top: 2px; }

.wa-list-wrap { max-width: 900px; margin: 0 auto; padding: 0 24px 40px; }
.wa-list { display: flex; flex-direction: column; gap: 16px; }
.wa-empty { text-align: center; color: var(--tx-3); padding: 48px 0; font-size: 0.92rem; }

.wa-group-hd {
  font-family: var(--f-display); font-size: 1.05rem; font-weight: 700;
  color: var(--tx); margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--bd);
}
.wa-group-count { font-size: 0.82rem; font-weight: 400; color: var(--tx-3); margin-left: 8px; }
.wa-group { margin-bottom: 16px; }

.wa-item {
  background: var(--card); border: 1px solid var(--bd); border-radius: 10px;
  padding: 12px 16px; margin-bottom: 8px; transition: box-shadow 0.2s;
}
.wa-item:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.05); }
.wa-item-mastered { opacity: 0.6; }

.wa-item-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.wa-item-badge {
  font-size: 0.72rem; font-weight: 600; padding: 2px 10px;
  border-radius: 10px; color: #fff;
}
.wa-badge-listening { background: var(--c-listen); }
.wa-badge-reading { background: var(--c-read); }
.wa-item-qnum { font-family: var(--f-mono); font-size: 0.82rem; color: var(--tx-2); }
.wa-item-type { font-size: 0.75rem; color: var(--tx-3); }
.wa-item-mastered-tag { font-size: 0.75rem; color: var(--c-read); margin-left: auto; }

.wa-item-q { font-size: 0.88rem; color: var(--tx); line-height: 1.5; margin-bottom: 8px; }
.wa-item-answers { display: flex; gap: 16px; font-size: 0.82rem; flex-wrap: wrap; }
.wa-item-wrong { color: var(--v-error); }
.wa-item-correct { color: var(--c-read); font-weight: 600; }

.wa-master-btn {
  margin-top: 8px; background: none; border: 1px solid var(--c-read);
  color: var(--c-read); font-family: var(--f-body); font-size: 0.78rem;
  padding: 4px 14px; border-radius: 8px; cursor: pointer; transition: all 0.2s;
}
.wa-master-btn:hover { background: var(--c-read); color: #fff; }

.wa-group-title { font-weight: 600; }
.wa-group-id {
  font-size: 0.78rem; color: var(--tx-3); font-family: var(--f-mono); margin-left: 8px;
}
.wa-item-actions {
  display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; align-items: center;
}
.wa-action-btn {
  padding: 5px 12px; border-radius: 6px; font-size: 0.8rem; cursor: pointer;
  border: 1px solid var(--bd); background: var(--bg-2); color: var(--tx-2);
}
.wa-action-btn:hover { border-color: var(--v-teal); color: var(--v-teal); }
.wa-action-review { border-color: var(--v-teal); color: var(--v-teal); }
.wa-action-review:hover { background: var(--v-teal); color: #fff; }
.wa-error { color: var(--v-error); }
.wa-retry-btn {
  margin-top: 12px; padding: 6px 16px; border-radius: 6px; border: 1px solid var(--bd);
  background: var(--bg-2); cursor: pointer; font-size: 0.85rem;
}
.wa-retry-btn:hover { border-color: var(--v-teal); color: var(--v-teal); }

.hp-wrong-cta .hp-speak-cta-icon { background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%); }

@media (max-width: 600px) {
  .wa-header-inner { padding: 12px 16px; }
  .wa-stats { gap: 20px; padding: 16px; }
  .wa-list-wrap { padding: 0 16px 32px; }
  .wa-filters { gap: 4px; padding: 0 16px 10px; }
  .wa-filter { padding: 4px 10px; font-size: 0.78rem; }
}

/* ================================================================
   STREAK & WEEKLY RINGS
   ================================================================ */
.hp-streak-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-top: 16px;
}
.hp-streak-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(217,119,6,0.1);
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid rgba(217,119,6,0.2);
}
.hp-streak-fire { font-size: 1.2rem; }
.hp-streak-num {
  font-family: var(--f-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: #d97706;
}
.hp-streak-label { font-size: 0.78rem; color: var(--tx-3); }

.hp-week-rings { display: flex; gap: 12px; }
.hp-ring-item { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.hp-ring-svg { width: 42px; height: 42px; }
.hp-ring-val {
  font-family: var(--f-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--tx);
  margin-top: -2px;
}
.hp-ring-label { font-size: 0.65rem; color: var(--tx-3); }

@media (max-width: 600px) {
  .hp-streak-row { gap: 16px; flex-wrap: wrap; }
  .hp-ring-svg { width: 36px; height: 36px; }
}

/* ================================================================
   ANALYTICS PAGE
   ================================================================ */
.an-header {
  position: sticky; top: 0; z-index: 20;
  background: var(--surface); border-bottom: 1px solid var(--bd);
}
.an-header-inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 960px; margin: 0 auto; padding: 14px 24px;
}
.an-back-btn {
  background: none; border: none; font-size: 0.9rem;
  color: var(--tx-2); cursor: pointer; font-family: var(--f-body);
}
.an-back-btn:hover { color: var(--v-teal); }
.an-header-title {
  font-family: var(--f-display); font-size: 1.2rem; font-weight: 700; color: var(--tx); margin: 0;
}
.an-header-right { display: flex; align-items: center; gap: 8px; }

.an-content { max-width: 960px; margin: 0 auto; padding: 20px 24px 40px; }

.an-sum-row {
  display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; margin-bottom: 24px;
}
.an-sum-item {
  text-align: center; background: var(--card); border: 1px solid var(--bd);
  border-radius: 12px; padding: 14px 20px; min-width: 100px;
}
.an-sum-num {
  display: block; font-family: var(--f-display);
  font-size: 1.5rem; font-weight: 700; color: var(--v-teal);
}
.an-sum-lbl { font-size: 0.78rem; color: var(--tx-3); }
.an-sum-best .an-sum-num { color: var(--c-read); }
.an-sum-worst .an-sum-num { color: var(--v-error); }

.an-charts { display: flex; gap: 20px; flex-wrap: wrap; }
.an-chart-card {
  flex: 1; min-width: 300px; background: var(--card);
  border: 1px solid var(--bd); border-radius: 14px; padding: 18px;
}
.an-chart-small { flex: 0 0 auto; max-width: 380px; }
.an-chart-title {
  font-family: var(--f-display); font-size: 1rem; font-weight: 700;
  color: var(--tx); margin-bottom: 12px;
}
.an-chart-card canvas { width: 100%; height: auto; }

.an-empty { text-align: center; color: var(--tx-3); padding: 60px 0; font-size: 0.92rem; }
.an-error { color: var(--v-error); }
.an-loading { text-align: center; color: var(--tx-3); padding: 40px 0; }

.an-wrong-card {
  margin-bottom: 20px; padding: 16px 20px; border-radius: 12px;
  background: var(--bg-2); border: 1px solid var(--bd);
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.an-wrong-stats { display: flex; gap: 20px; flex-wrap: wrap; }
.an-wrong-stat { text-align: center; }
.an-wrong-stat-num { font-family: var(--f-mono); font-size: 1.4rem; font-weight: 700; color: var(--v-teal); }
.an-wrong-stat-lbl { font-size: 0.78rem; color: var(--tx-3); }
.an-wrong-link {
  padding: 8px 16px; border-radius: 8px; border: 1px solid var(--v-teal);
  background: transparent; color: var(--v-teal); font-size: 0.85rem; cursor: pointer;
}
.an-wrong-link:hover { background: var(--v-teal); color: #fff; }

.hp-cta-row { display: flex; gap: 16px; }
.hp-cta-half { flex: 1; min-width: 0; }
.hp-analytics-cta .hp-speak-cta-icon { background: linear-gradient(135deg, #2563eb 0%, #059669 100%); }

@media (max-width: 700px) {
  .an-charts { flex-direction: column; }
  .an-chart-small { max-width: 100%; }
  .an-content { padding: 16px; }
  .hp-cta-row { flex-direction: column; }
}

/* ================================================================
   WRITING PRACTICE PAGE
   ================================================================ */
.wp-header { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--bd); }
.wp-header-inner { display: flex; align-items: center; justify-content: space-between; max-width: 800px; margin: 0 auto; padding: 14px 24px; }
.wp-back-btn { background: none; border: none; font-size: 0.9rem; color: var(--tx-2); cursor: pointer; font-family: var(--f-body); }
.wp-back-btn:hover { color: var(--v-teal); }
.wp-header-title { font-family: var(--f-display); font-size: 1.2rem; font-weight: 700; color: var(--tx); }
.wp-header-right { display: flex; align-items: center; gap: 12px; }
.wp-timer { font-family: var(--f-mono); font-size: 0.9rem; color: var(--tx-2); }

.wp-setup { max-width: 800px; margin: 0 auto; padding: 32px 24px; }
.wp-setup-inner { text-align: center; }
.wp-badge { display: inline-block; background: var(--v-teal-lt); color: var(--v-teal); font-size: 0.78rem; font-weight: 600; padding: 4px 14px; border-radius: 12px; margin-bottom: 12px; }
.wp-setup-heading { font-family: var(--f-display); font-size: 1.8rem; font-weight: 700; color: var(--tx); margin-bottom: 8px; }
.wp-setup-sub { font-size: 0.9rem; color: var(--tx-3); margin-bottom: 24px; }

.wp-type-row { display: flex; justify-content: center; gap: 10px; margin-bottom: 24px; }
.wp-type-btn {
  background: none; border: 1px solid var(--bd); font-family: var(--f-body); font-size: 0.88rem;
  padding: 8px 20px; border-radius: 10px; cursor: pointer; transition: all 0.2s; color: var(--tx-2);
}
.wp-type-btn:hover { border-color: var(--v-teal); color: var(--tx); }
.wp-type-btn.active { background: var(--v-teal); color: #fff; border-color: var(--v-teal); }

.wp-topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; text-align: left; margin-bottom: 32px; }
.wp-topic-card {
  background: var(--card); border: 1px solid var(--bd); border-radius: 10px; padding: 12px;
  cursor: pointer; transition: all 0.2s;
}
.wp-topic-card:hover { border-color: var(--v-teal); box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.wp-topic-num { font-family: var(--f-mono); font-size: 0.75rem; color: var(--v-teal); display: block; margin-bottom: 4px; }
.wp-topic-preview { font-size: 0.82rem; color: var(--tx-2); line-height: 1.4; }

.wp-editor { max-width: 800px; margin: 0 auto; padding: 20px 24px; }
.wp-prompt-box {
  background: var(--card); border: 1px solid var(--bd); border-radius: 12px;
  padding: 16px; margin-bottom: 16px;
}
.wp-prompt-label { font-size: 0.82rem; color: var(--v-teal); font-weight: 600; margin-bottom: 8px; }
.wp-prompt-text { font-size: 0.9rem; color: var(--tx); line-height: 1.6; }
.wp-prompt-chart { font-size: 0.85rem; color: var(--tx-2); margin-top: 8px; font-style: italic; }

.wp-textarea {
  width: 100%; min-height: 400px; padding: 16px; border: 1px solid var(--bd);
  border-radius: 12px; font-family: var(--f-body); font-size: 0.92rem;
  line-height: 1.8; color: var(--tx); background: var(--card); resize: vertical;
  outline: none; box-sizing: border-box;
}
.wp-textarea:focus { border-color: var(--v-teal); }

.wp-editor-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.wp-wc { font-family: var(--f-mono); font-size: 0.82rem; color: var(--tx-3); }
.wp-submit-btn {
  background: var(--v-teal); color: #fff; border: none; padding: 10px 28px;
  border-radius: 10px; font-family: var(--f-body); font-size: 0.9rem;
  font-weight: 600; cursor: pointer; transition: background 0.2s;
}
.wp-submit-btn:hover { background: #1f6357; }
.wp-submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.wp-feedback { max-width: 800px; margin: 0 auto; padding: 20px 24px 40px; }
.wp-fb-band {
  text-align: center; font-family: var(--f-display); font-size: 2.5rem;
  font-weight: 700; color: var(--v-teal); margin-bottom: 4px;
}
.wp-fb-wc { text-align: center; font-size: 0.82rem; color: var(--tx-3); margin-bottom: 20px; }
.wp-fb-criteria { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.wp-fb-crit {
  background: var(--card); border: 1px solid var(--bd); border-radius: 10px; padding: 12px;
}
.wp-fb-crit-hd { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 0.85rem; font-weight: 600; color: var(--tx); }
.wp-fb-crit-score { color: var(--v-teal); font-family: var(--f-mono); }
.wp-fb-crit-comment { font-size: 0.82rem; color: var(--tx-2); line-height: 1.5; }

.wp-fb-overall {
  background: var(--card); border: 1px solid var(--bd); border-radius: 10px;
  padding: 14px; font-size: 0.88rem; color: var(--tx); line-height: 1.6; margin-bottom: 16px;
}
.wp-fb-suggestions { font-size: 0.85rem; color: var(--tx-2); line-height: 1.6; }
.wp-fb-suggestions ul { margin: 6px 0 0 18px; padding: 0; }
.wp-fb-suggestions li { margin-bottom: 4px; }

.wp-fb-actions { display: flex; gap: 12px; justify-content: center; margin-top: 24px; }
.wp-fb-btn {
  background: var(--v-teal); color: #fff; border: none; padding: 10px 28px;
  border-radius: 10px; font-family: var(--f-body); font-size: 0.88rem;
  font-weight: 600; cursor: pointer; transition: background 0.2s;
}
.wp-fb-btn:hover { background: #1f6357; }
.wp-fb-btn-sec { background: none; border: 1px solid var(--bd); color: var(--tx-2); }
.wp-fb-btn-sec:hover { border-color: var(--v-teal); color: var(--v-teal); background: none; }

.wp-history-section { text-align: left; margin-top: 32px; }
.wp-history-title { font-family: var(--f-display); font-size: 1rem; font-weight: 700; color: var(--tx); margin-bottom: 10px; }
.wp-history-list { display: flex; flex-direction: column; gap: 6px; }
.wp-history-empty { color: var(--tx-3); font-size: 0.85rem; }
.wp-history-item {
  display: flex; align-items: center; gap: 12px; padding: 8px 12px;
  background: var(--card); border: 1px solid var(--bd); border-radius: 8px; font-size: 0.82rem;
}
.wp-history-type { font-family: var(--f-mono); color: var(--v-teal); font-weight: 600; }
.wp-history-band { font-weight: 600; color: var(--tx); }
.wp-history-wc { color: var(--tx-3); }
.wp-history-date { color: var(--tx-3); margin-left: auto; }

.hp-writing-cta .hp-speak-cta-icon { background: linear-gradient(135deg, #d97706 0%, #c07848 100%); }

@media (max-width: 600px) {
  .wp-setup { padding: 20px 16px; }
  .wp-editor { padding: 16px; }
  .wp-feedback { padding: 16px; }
  .wp-fb-criteria { grid-template-columns: 1fr; }
  .wp-topics { grid-template-columns: 1fr 1fr; }
}

/* ================================================================
   DICTATION PAGE
   ================================================================ */
.dc-header { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--bd); }
.dc-header-inner { display: flex; align-items: center; justify-content: space-between; max-width: 800px; margin: 0 auto; padding: 14px 24px; }
.dc-back-btn { background: none; border: none; font-size: 0.9rem; color: var(--tx-2); cursor: pointer; font-family: var(--f-body); }
.dc-back-btn:hover { color: var(--v-teal); }
.dc-header-title { font-family: var(--f-display); font-size: 1.2rem; font-weight: 700; color: var(--tx); }
.dc-header-right { display: flex; align-items: center; gap: 8px; }

.dc-setup { max-width: 800px; margin: 0 auto; padding: 32px 24px; }
.dc-setup-inner { text-align: center; }
.dc-badge { display: inline-block; background: rgba(37,99,235,0.1); color: var(--c-listen); font-size: 0.78rem; font-weight: 600; padding: 4px 14px; border-radius: 12px; margin-bottom: 12px; }
.dc-setup-heading { font-family: var(--f-display); font-size: 1.8rem; font-weight: 700; color: var(--tx); margin-bottom: 8px; }
.dc-setup-sub { font-size: 0.9rem; color: var(--tx-3); margin-bottom: 20px; }

.dc-speed-row { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 24px; }
.dc-speed-label { font-size: 0.85rem; color: var(--tx-2); }
.dc-speed-btn {
  background: none; border: 1px solid var(--bd); font-family: var(--f-mono); font-size: 0.82rem;
  padding: 4px 14px; border-radius: 8px; cursor: pointer; color: var(--tx-2); transition: all 0.2s;
}
.dc-speed-btn.active { background: var(--c-listen); color: #fff; border-color: var(--c-listen); }

.dc-tests { display: flex; flex-direction: column; gap: 10px; text-align: left; }
.dc-test-card {
  background: var(--card); border: 1px solid var(--bd); border-radius: 10px; padding: 12px 16px;
}
.dc-test-title { font-size: 0.9rem; font-weight: 600; color: var(--tx); margin-bottom: 8px; }
.dc-test-sections { display: flex; gap: 8px; flex-wrap: wrap; }
.dc-sec-btn {
  background: var(--accent-blue-light); border: none; color: var(--c-listen); font-family: var(--f-body);
  font-size: 0.8rem; font-weight: 500; padding: 5px 14px; border-radius: 8px;
  cursor: pointer; transition: all 0.2s;
}
.dc-sec-btn:hover { background: var(--c-listen); color: #fff; }

.dc-session { max-width: 700px; margin: 0 auto; padding: 20px 24px; }
.dc-progress-bar {
  height: 4px; background: var(--bd); border-radius: 2px; margin-bottom: 24px; overflow: hidden;
}
.dc-progress-fill { height: 100%; background: var(--c-listen); border-radius: 2px; transition: width 0.3s; width: 0; }

.dc-sentence-box { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.dc-sent-num { font-family: var(--f-mono); font-size: 0.85rem; color: var(--tx-3); }
.dc-play-btn, .dc-replay-btn {
  background: var(--c-listen); color: #fff; border: none; padding: 8px 18px;
  border-radius: 8px; font-family: var(--f-body); font-size: 0.85rem;
  cursor: pointer; transition: background 0.2s;
}
.dc-play-btn:hover, .dc-replay-btn:hover { background: #1d4ed8; }
.dc-replay-btn { background: none; border: 1px solid var(--c-listen); color: var(--c-listen); }

.dc-input-area { display: flex; gap: 10px; margin-bottom: 16px; }
.dc-input {
  flex: 1; padding: 12px; border: 1px solid var(--bd); border-radius: 10px;
  font-family: var(--f-body); font-size: 0.9rem; color: var(--tx); background: var(--card);
  resize: none; outline: none; box-sizing: border-box;
}
.dc-input:focus { border-color: var(--c-listen); }
.dc-check-btn {
  background: var(--v-teal); color: #fff; border: none; padding: 12px 24px;
  border-radius: 10px; font-family: var(--f-body); font-size: 0.88rem;
  font-weight: 600; cursor: pointer; align-self: flex-end;
}

.dc-diff {
  background: var(--card); border: 1px solid var(--bd); border-radius: 10px;
  padding: 14px; margin-bottom: 16px;
}
.dc-diff-label { font-size: 0.78rem; color: var(--tx-3); margin-bottom: 8px; }
.dc-diff-words { font-size: 0.9rem; line-height: 1.8; }
.dc-w-ok { color: var(--c-read); }
.dc-w-wrong { color: var(--v-error); text-decoration: underline; cursor: help; }
.dc-w-miss { color: var(--tx-3); text-decoration: line-through; }

.dc-next-btn {
  background: var(--c-listen); color: #fff; border: none; padding: 10px 24px;
  border-radius: 10px; font-family: var(--f-body); font-size: 0.88rem;
  font-weight: 600; cursor: pointer; display: block; margin: 0 auto;
}

.dc-result { max-width: 500px; margin: 60px auto; text-align: center; }
.dc-result-inner {
  background: var(--card); border: 1px solid var(--bd); border-radius: 16px; padding: 40px;
}
.dc-result-icon {
  width: 64px; height: 64px; border-radius: 50%;
  background: rgba(37,99,235,0.1); color: var(--c-listen);
  font-size: 1.8rem; display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}
.dc-result-title { font-family: var(--f-display); font-size: 1.4rem; font-weight: 700; color: var(--tx); margin-bottom: 8px; }
.dc-result-accuracy { font-family: var(--f-mono); font-size: 1.2rem; color: var(--c-listen); margin-bottom: 6px; }
.dc-result-stats { font-size: 0.85rem; color: var(--tx-3); margin-bottom: 24px; }
.dc-result-btn {
  background: var(--c-listen); color: #fff; border: none; padding: 10px 28px;
  border-radius: 10px; font-family: var(--f-body); font-size: 0.88rem;
  font-weight: 600; cursor: pointer;
}

.hp-dictation-cta .hp-speak-cta-icon { background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%); }

@media (max-width: 600px) {
  .dc-setup { padding: 20px 16px; }
  .dc-session { padding: 16px; }
  .dc-input-area { flex-direction: column; }
}

/* ================================================================
   TIMED READING PAGE
   ================================================================ */
.tr-header { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--bd); }
.tr-header-inner { display: flex; align-items: center; justify-content: space-between; max-width: 800px; margin: 0 auto; padding: 14px 24px; }
.tr-back-btn { background: none; border: none; font-size: 0.9rem; color: var(--tx-2); cursor: pointer; font-family: var(--f-body); }
.tr-back-btn:hover { color: var(--v-teal); }
.tr-header-title { font-family: var(--f-display); font-size: 1.2rem; font-weight: 700; color: var(--tx); }
.tr-header-right { display: flex; align-items: center; gap: 12px; }
.tr-timer { font-family: var(--f-mono); font-size: 0.95rem; color: var(--c-read); font-weight: 600; }

.tr-setup { max-width: 800px; margin: 0 auto; padding: 32px 24px; }
.tr-setup-inner { text-align: center; }
.tr-badge { display: inline-block; background: rgba(5,150,105,0.1); color: var(--c-read); font-size: 0.78rem; font-weight: 600; padding: 4px 14px; border-radius: 12px; margin-bottom: 12px; }
.tr-setup-heading { font-family: var(--f-display); font-size: 1.8rem; font-weight: 700; color: var(--tx); margin-bottom: 8px; }
.tr-setup-sub { font-size: 0.9rem; color: var(--tx-3); margin-bottom: 24px; }

.tr-passages { display: flex; flex-direction: column; gap: 10px; text-align: left; }
.tr-test-card { background: var(--card); border: 1px solid var(--bd); border-radius: 10px; padding: 12px 16px; }
.tr-test-title { font-size: 0.9rem; font-weight: 600; color: var(--tx); margin-bottom: 8px; }
.tr-test-passages { display: flex; gap: 8px; flex-wrap: wrap; }
.tr-pass-btn {
  background: var(--accent-green-light); border: none; color: var(--c-read);
  font-family: var(--f-body); font-size: 0.8rem; font-weight: 500;
  padding: 5px 14px; border-radius: 8px; cursor: pointer; transition: all 0.2s;
}
.tr-pass-btn:hover { background: var(--c-read); color: #fff; }
.tr-pass-wc { font-family: var(--f-mono); font-size: 0.72rem; opacity: 0.7; margin-left: 4px; }

.tr-reading { max-width: 800px; margin: 0 auto; padding: 20px 24px; }
.tr-passage-box {
  background: var(--card); border: 1px solid var(--bd); border-radius: 14px;
  padding: 24px; margin-bottom: 20px;
}
.tr-pass-title { font-family: var(--f-display); font-size: 1.2rem; font-weight: 700; color: var(--tx); margin-bottom: 12px; }
.tr-pass-text { font-size: 0.92rem; color: var(--tx); line-height: 1.8; }
.tr-pass-text p { margin-bottom: 10px; }
.tr-reading-footer { text-align: center; }
.tr-done-btn {
  background: var(--c-read); color: #fff; border: none; padding: 12px 32px;
  border-radius: 10px; font-family: var(--f-body); font-size: 0.92rem;
  font-weight: 600; cursor: pointer; transition: background 0.2s;
}
.tr-done-btn:hover { background: #047857; }

.tr-quiz { max-width: 700px; margin: 0 auto; padding: 20px 24px; }
.tr-quiz-info {
  text-align: center; font-size: 0.9rem; color: var(--tx-2); margin-bottom: 20px;
  padding: 12px; background: var(--card); border: 1px solid var(--bd); border-radius: 10px;
}
.tr-quiz-qs { display: flex; flex-direction: column; gap: 16px; margin-bottom: 20px; }
.tr-q-item { background: var(--card); border: 1px solid var(--bd); border-radius: 10px; padding: 14px; }
.tr-q-text { font-size: 0.9rem; color: var(--tx); margin-bottom: 10px; font-weight: 500; }
.tr-q-opts { display: flex; flex-direction: column; gap: 6px; }
.tr-q-opt { font-size: 0.85rem; color: var(--tx-2); cursor: pointer; padding: 4px 0; }
.tr-q-input {
  width: 100%; padding: 8px 12px; border: 1px solid var(--bd); border-radius: 8px;
  font-family: var(--f-body); font-size: 0.88rem; color: var(--tx); background: var(--surface);
  outline: none; box-sizing: border-box;
}
.tr-quiz-submit {
  display: block; margin: 0 auto; background: var(--c-read); color: #fff; border: none;
  padding: 10px 28px; border-radius: 10px; font-family: var(--f-body);
  font-size: 0.88rem; font-weight: 600; cursor: pointer;
}

.tr-result { max-width: 500px; margin: 40px auto; padding: 0 24px; }
.tr-result-inner {
  background: var(--card); border: 1px solid var(--bd); border-radius: 16px;
  padding: 40px; text-align: center;
}
.tr-res-wpm {
  font-family: var(--f-display); font-size: 3.5rem; font-weight: 700; color: var(--c-read);
}
.tr-res-wpm-label { font-size: 0.82rem; color: var(--tx-3); margin-bottom: 4px; }
.tr-res-level { font-size: 1rem; font-weight: 600; color: var(--tx); margin-bottom: 16px; }

.tr-res-bar {
  position: relative; height: 12px; background: var(--bd); border-radius: 6px;
  margin-bottom: 4px; overflow: visible;
}
.tr-res-bar-fill { height: 100%; background: linear-gradient(90deg, #ef4444, #d97706, #059669); border-radius: 6px; }
.tr-res-bar-target {
  position: absolute; top: -18px; transform: translateX(-50%);
  font-size: 0.7rem; color: var(--tx-3); font-family: var(--f-mono);
}
.tr-res-bar-target::after {
  content: ''; position: absolute; left: 50%; top: 100%;
  transform: translateX(-50%); width: 1px; height: 18px; background: var(--tx-3);
}
.tr-res-bar-labels {
  display: flex; justify-content: space-between; font-size: 0.68rem; color: var(--tx-3);
  font-family: var(--f-mono); margin-bottom: 16px;
}

.tr-res-comp { font-size: 0.92rem; color: var(--tx); margin-bottom: 6px; }
.tr-res-time { font-size: 0.82rem; color: var(--tx-3); margin-bottom: 24px; }
.tr-res-actions { display: flex; gap: 12px; justify-content: center; }
.tr-res-btn {
  background: var(--c-read); color: #fff; border: none; padding: 10px 24px;
  border-radius: 10px; font-family: var(--f-body); font-size: 0.88rem;
  font-weight: 600; cursor: pointer;
}
.tr-res-btn-sec { background: none; border: 1px solid var(--bd); color: var(--tx-2); }

.hp-tread-cta .hp-speak-cta-icon { background: linear-gradient(135deg, #059669 0%, #047857 100%); }

@media (max-width: 600px) {
  .tr-setup { padding: 20px 16px; }
  .tr-reading { padding: 16px; }
  .tr-result { margin: 20px auto; }
}

/* ----------------------------------------------------------------
   CBT Gate — computer-delivered check-in simulation
   ---------------------------------------------------------------- */
#page-cbt-gate {
  min-height: 100vh;
  position: relative;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  overflow: hidden;
}
#page-cbt-gate.active { display: flex; }

.cbt-scene {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(12, 28, 48, 0.35) 0%, rgba(12, 28, 48, 0.15) 40%, rgba(20, 60, 40, 0.25) 100%),
    radial-gradient(ellipse at 50% 0%, #7eb6d9 0%, #4a7fa3 35%, transparent 60%),
    linear-gradient(180deg, #8ec5e8 0%, #c5dff0 28%, #dce9c8 55%, #6b9b4a 78%, #3d6b2e 100%);
  z-index: 0;
}
.cbt-scene::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 70%, rgba(255, 255, 255, 0.12) 0 2px, transparent 3px),
    radial-gradient(circle at 70% 65%, rgba(255, 220, 120, 0.35) 0 3px, transparent 4px),
    radial-gradient(circle at 45% 80%, rgba(255, 255, 255, 0.1) 0 2px, transparent 3px);
  opacity: 0.7;
  pointer-events: none;
}

.cbt-shell {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  overflow: hidden;
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: #1a1a1a;
}

.cbt-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #4a9fd8;
  color: #fff;
  padding: 6px 10px;
  font-size: 0.82rem;
}
.cbt-close {
  border: none;
  background: #e25555;
  color: #fff;
  width: 22px;
  height: 20px;
  line-height: 18px;
  border-radius: 2px;
  cursor: pointer;
  font-size: 14px;
  padding: 0;
}
.cbt-close:hover { background: #c94444; }

.cbt-tabs {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding: 8px 16px 0;
  border-bottom: 1px solid #d8d8d8;
  background: #f7f7f7;
}
.cbt-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 64px;
  padding: 6px 10px 8px;
  border: none;
  background: transparent;
  color: #666;
  font-size: 0.72rem;
  cursor: default;
  border-bottom: 2px solid transparent;
}
.cbt-tab.active {
  color: #1a6fb5;
  border-bottom-color: #1a6fb5;
  font-weight: 600;
}
.cbt-tab-ico {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e4e4e4;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  color: #555;
}
.cbt-tab.active .cbt-tab-ico {
  background: #d6ebf8;
  color: #1a6fb5;
}
.cbt-tabs-trail {
  margin-left: auto;
  display: flex;
  gap: 10px;
  padding-bottom: 10px;
  opacity: 0.55;
  font-size: 0.9rem;
}

.cbt-body {
  padding: 28px 36px 20px;
  min-height: 340px;
}
.cbt-h {
  margin: 0 0 8px;
  font-size: 1.35rem;
  font-weight: 700;
}
.cbt-sub {
  margin: 0 0 22px;
  color: #666;
  font-size: 0.92rem;
}
.cbt-field {
  display: grid;
  grid-template-columns: 88px minmax(160px, 280px) 1fr;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.cbt-field label {
  font-size: 0.95rem;
  color: #333;
}
.cbt-input {
  height: 34px;
  border: 1px solid #bdbdbd;
  border-radius: 2px;
  padding: 0 10px;
  font-size: 0.95rem;
  font-family: inherit;
}
.cbt-input:focus {
  outline: 2px solid #4a9fd8;
  outline-offset: 1px;
  border-color: #4a9fd8;
}
.cbt-hint {
  color: #8a8a8a;
  font-size: 0.88rem;
}
.cbt-warn {
  color: #d32f2f;
  font-size: 0.88rem;
  margin: 18px 0 10px;
  line-height: 1.5;
}
.cbt-center-actions {
  display: flex;
  justify-content: center;
  margin-top: 28px;
}
.cbt-btn {
  min-width: 120px;
  height: 36px;
  border: 1px solid #c5c5c5;
  border-radius: 4px;
  background: #ececec;
  color: #333;
  font-size: 0.95rem;
  cursor: pointer;
}
.cbt-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.cbt-btn:not(:disabled):hover {
  background: #e0e0e0;
}
.cbt-btn-next {
  border-radius: 18px;
  padding: 0 22px;
  min-width: 96px;
}

.cbt-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-top: 1px solid #ddd;
  background: #fafafa;
}
.cbt-skip-link {
  border: none;
  background: none;
  color: #1a6fb5;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}
.cbt-skip-link:hover { color: #0d4f86; }

.cbt-status-red {
  color: #d32f2f;
  font-size: 0.9rem;
  font-weight: 600;
}
.cbt-info-box {
  border: 1px solid #cfcfcf;
  border-radius: 2px;
  padding: 0 0 20px;
}
.cbt-info-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid #e5e5e5;
  background: #f9f9f9;
  font-size: 0.95rem;
}
.cbt-video-mock {
  margin: 18px 20px;
  border: 1px solid #e0e0e0;
  background: #fff;
  padding: 28px 24px;
  text-align: left;
}
.cbt-video-title {
  text-align: center;
  font-weight: 700;
  font-size: 1.05rem;
  margin: 0 0 18px;
}
.cbt-tips {
  font-size: 0.92rem;
  color: #333;
  line-height: 1.55;
}
.cbt-tips ul {
  margin: 6px 0 12px 1.2em;
  padding: 0;
}
.cbt-confirm-prompt {
  text-align: center;
  margin: 8px 20px 14px;
  color: #444;
}
.cbt-confirm-btn {
  display: block;
  margin: 0 auto;
  min-width: 140px;
  height: 40px;
  border: none;
  border-radius: 6px;
  background: #2f2f2f;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}
.cbt-confirm-btn:hover { background: #1f1f1f; }

@media (max-width: 720px) {
  .cbt-body { padding: 20px 16px; min-height: 280px; }
  .cbt-field {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .cbt-tabs-trail { display: none; }
}

/* ----------------------------------------------------------------
   CBT Guide — post-pincode orientation dashboard
   ---------------------------------------------------------------- */
#page-cbt-guide {
  display: none;
  flex-direction: column;
  min-height: 100vh;
  background: #ececec;
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: #1a1a1a;
}
#page-cbt-guide.active { display: flex; }

.cbt-guide-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid #d0d0d0;
}
.cbt-guide-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  min-height: 52px;
  flex-wrap: wrap;
}
.cbt-guide-top-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  flex: 1 1 240px;
  min-width: 0;
  font-size: 0.82rem;
  color: #222;
}
.cbt-guide-brand {
  font-weight: 700;
  color: #c41e2a;
  letter-spacing: 0.02em;
}
.cbt-guide-taker,
.cbt-guide-paper { font-weight: 600; white-space: nowrap; }
.cbt-guide-timer {
  font-variant-numeric: tabular-nums;
  color: #333;
  white-space: nowrap;
}
.cbt-guide-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}
.cbt-guide-finish-btn {
  min-width: 108px;
  height: 30px;
  padding: 0 12px;
  border: 1px solid #222;
  border-radius: 2px;
  background: #fff;
  color: #111;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.cbt-guide-finish-btn:hover { background: #f5f5f5; }
.cbt-guide-finish-btn.is-ready {
  border-color: #2e7d32;
  background: #2e7d32;
  color: #fff;
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.22);
  animation: cbt-guide-finish-pulse 2s ease-in-out infinite;
}
.cbt-guide-finish-btn.is-ready:hover { background: #256b28; }
@keyframes cbt-guide-finish-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.22); }
  50% { box-shadow: 0 0 0 6px rgba(46, 125, 50, 0.12); }
}
.cbt-guide-panel--all-done .cbt-guide-mock-note {
  color: #2e7d32;
  font-weight: 600;
}
.cbt-guide-icon { opacity: 0.55; font-size: 0.95rem; }
.cbt-guide-icon-btn {
  width: 28px;
  height: 28px;
  border: 1px solid #ccc;
  border-radius: 2px;
  background: #fff;
  color: #444;
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
  padding: 0;
  font-family: inherit;
}
.cbt-guide-icon-btn:disabled { opacity: 0.45; cursor: default; }

.cbt-guide-main {
  flex: 1;
  width: min(980px, 100%);
  margin: 0 auto;
  padding: 18px 16px 32px;
}
.cbt-guide-panel {
  background: #fff;
  border: 1px solid #d0d0d0;
  border-radius: 2px;
  overflow: hidden;
}
.cbt-guide-section {
  padding: 16px 22px 18px;
  border-bottom: 1px solid #e2e2e2;
}
.cbt-guide-section:last-child { border-bottom: none; }
.cbt-guide-section--video { padding-bottom: 14px; }

.cbt-guide-pretest-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.cbt-guide-pretest-head-text { flex: 1; min-width: 0; }
.cbt-guide-pretest-check {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 700;
  color: #2e7d32;
  line-height: 1;
}
.cbt-guide-pretest.is-complete .cbt-guide-pretest-head {
  padding-bottom: 0;
}
.cbt-guide-pretest.is-complete {
  padding-bottom: 14px;
}
.cbt-guide-pretest.is-complete .cbt-guide-pretest-body {
  display: none !important;
  margin: 0;
}
.cbt-guide-pretest-body {
  margin-top: 10px;
}

.cbt-guide-confirm {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #e8e8e8;
}
.cbt-guide-confirm-text {
  margin: 0 0 12px;
  font-size: 0.95rem;
  color: #222;
  line-height: 1.45;
}
.cbt-guide-confirm-yes {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  cursor: pointer;
  user-select: none;
}
.cbt-guide-confirm-yes input {
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
}

.cbt-guide-next-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 8px;
}
.cbt-guide-next-btn {
  min-width: 88px;
  height: 34px;
  padding: 0 18px;
  border: none;
  border-radius: 2px;
  background: #3a3a3a;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  font-family: inherit;
}
.cbt-guide-next-btn:hover { background: #222; }

.cbt-guide-skill-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}
.cbt-guide-skill-head-text { flex: 1; min-width: 0; }
.cbt-guide-skill-check {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 700;
  color: #2e7d32;
  line-height: 1;
}
.cbt-guide-skill.is-complete .cbt-guide-skill-head {
  padding-bottom: 0;
}

.cbt-guide-info {
  margin-bottom: 14px;
  border: 1px solid #e2e2e2;
  border-radius: 2px;
  background: #fafafa;
}
.cbt-guide-info-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.cbt-guide-info-summary::-webkit-details-marker { display: none; }
.cbt-guide-info-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: #d32f2f;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.cbt-guide-info-badge.is-confirmed { color: #2e7d32; }
.cbt-guide-info-content {
  padding: 0 14px 12px;
  font-size: 0.88rem;
  line-height: 1.5;
  color: #444;
}
.cbt-guide-info-content p { margin: 0; }

.cbt-guide-skill-inner {
  border: 1px solid #e2e2e2;
  background: #fafafa;
}
.cbt-guide-skill-inner .cbt-guide-info {
  margin: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  border-bottom: 1px solid #e8e8e8;
}
.cbt-guide-skill-inner .cbt-guide-info-content {
  background: #fff;
}
.cbt-guide-skill-inner .cbt-guide-player-mount {
  padding: 12px;
  margin: 0;
  background: #fff;
}
.cbt-guide-skill-inner .cbt-guide-vid {
  border: none;
}
.cbt-guide-skill-inner .cbt-guide-ready {
  margin: 0;
  padding: 14px 12px 16px;
  border-top: 1px solid #e8e8e8;
  background: #fff;
}
.cbt-guide-skill-inner .cbt-guide-confirm-btn {
  border-color: #333;
  background: #3a3a3a;
  color: #fff;
}
.cbt-guide-skill-inner .cbt-guide-confirm-btn:hover {
  background: #222;
}
.cbt-guide-skill-inner .cbt-guide-confirm-btn.is-pressed {
  border-color: #2e7d32;
  background: #2e7d32;
}
.cbt-guide-skill-check[hidden] { display: none !important; }
.cbt-guide-skill.is-guide-confirmed .cbt-guide-skill-guide-media,
.cbt-guide-skill.is-guide-confirmed .cbt-guide-ready {
  display: none !important;
}
.cbt-guide-start-row[hidden] {
  display: none !important;
}
.cbt-guide-start-row.is-visible,
.cbt-guide-skill.is-guide-confirmed .cbt-guide-start-row,
.cbt-guide-skill.is-guide-confirmed .cbt-guide-start-row[hidden] {
  display: block !important;
}
.cbt-guide-skill-inner.is-guide-confirmed .cbt-guide-info {
  border-bottom: none;
}
.cbt-guide-start-row {
  padding: 12px 12px 14px;
  background: #fff;
}
.cbt-guide-start-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border: none;
  border-radius: 2px;
  background: #222;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.cbt-guide-start-btn:hover { background: #111; }
.cbt-guide-start-btn-arrow {
  font-size: 1rem;
  line-height: 1;
}
.cbt-guide-skill.is-expanded .cbt-guide-skill-head {
  margin-bottom: 0;
}

.cbt-guide-player-mount { margin-top: 4px; }

.cbt-guide-ready {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #e8e8e8;
}
.cbt-guide-ready-title {
  margin: 0 0 10px;
  font-size: 1rem;
  font-weight: 700;
  color: #222;
}
.cbt-guide-confirm-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 132px;
  height: 36px;
  padding: 0 16px;
  border: 1px solid #bdbdbd;
  border-radius: 2px;
  background: #fff;
  color: #333;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.cbt-guide-confirm-btn:hover { border-color: #888; }
.cbt-guide-confirm-btn.is-pressed {
  border-color: #2e7d32;
  background: #2e7d32;
  color: #fff;
}

.cbt-guide-skill.is-expanded {
  cursor: default;
  background: #fff;
}
.cbt-guide-skill.is-expanded .cbt-guide-skill-head { pointer-events: none; }
.cbt-guide-skill-body {
  margin-top: 12px;
  padding-top: 4px;
}
.cbt-guide-skill:not(.is-expanded) .cbt-guide-skill-body { display: none !important; }
.cbt-guide-panel:not(.cbt-guide-panel--pretest-done) .cbt-guide-skill {
  cursor: default;
  opacity: 0.72;
}
.cbt-guide-panel:not(.cbt-guide-panel--pretest-done) .cbt-guide-skill:hover {
  background: transparent;
}
.cbt-guide-panel.cbt-guide-panel--pretest-done:not(.cbt-guide-panel--listening-exam-done) .cbt-guide-skill[data-guide-skill="reading"],
.cbt-guide-panel.cbt-guide-panel--pretest-done:not(.cbt-guide-panel--listening-exam-done) .cbt-guide-skill[data-guide-skill="writing"] {
  cursor: default;
  opacity: 0.72;
}
.cbt-guide-panel.cbt-guide-panel--pretest-done:not(.cbt-guide-panel--listening-exam-done) .cbt-guide-skill[data-guide-skill="reading"]:hover,
.cbt-guide-panel.cbt-guide-panel--pretest-done:not(.cbt-guide-panel--listening-exam-done) .cbt-guide-skill[data-guide-skill="writing"]:hover {
  background: transparent;
}
.cbt-guide-panel.cbt-guide-panel--listening-exam-done:not(.cbt-guide-panel--reading-exam-done) .cbt-guide-skill[data-guide-skill="writing"] {
  cursor: default;
  opacity: 0.72;
}
.cbt-guide-panel.cbt-guide-panel--listening-exam-done:not(.cbt-guide-panel--reading-exam-done) .cbt-guide-skill[data-guide-skill="writing"]:hover {
  background: transparent;
}

.cbt-guide-card-title {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
}
.cbt-guide-status {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: #d32f2f;
}
.cbt-guide-status.is-done { color: #2e7d32; }
.cbt-guide-timing {
  margin: 10px 0 0;
  font-size: 0.88rem;
  color: #333;
}

.cbt-guide-skill {
  min-height: 108px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.cbt-guide-skill:hover,
.cbt-guide-skill.is-active { background: #fafafa; }
.cbt-guide-skill:focus-visible {
  outline: 2px solid #4a9fd8;
  outline-offset: -2px;
}

.cbt-guide-mock-note {
  margin: 12px 4px 0;
  font-size: 0.82rem;
  color: #666;
  line-height: 1.5;
}

.cbt-guide-vid {
  position: relative;
  border: 1px solid #e0e0e0;
  background: #fff;
  overflow: hidden;
}
.cbt-guide-vid-el {
  display: none;
  width: 100%;
  max-height: 320px;
  background: #111;
  object-fit: contain;
}
.cbt-guide-vid.is-playing .cbt-guide-vid-el { display: block; }

.cbt-guide-vid-poster {
  display: block;
  width: 100%;
  border: none;
  padding: 0;
  cursor: pointer;
  background: #ececec;
  font-family: inherit;
}
.cbt-guide-vid.is-playing .cbt-guide-vid-poster,
.cbt-guide-vid.is-missing .cbt-guide-vid-poster,
.cbt-guide-vid.is-ended .cbt-guide-vid-poster { display: none; }

.cbt-guide-vid-ended {
  display: none;
  padding: 16px 18px 12px;
  background: #fff;
  min-height: 180px;
}
.cbt-guide-vid.is-ended .cbt-guide-vid-ended { display: block; }
.cbt-guide-vid.is-ended .cbt-guide-vid-el { display: none; }
.cbt-guide-vid.is-ended .cbt-guide-vid-play { display: none; }

.cbt-guide-vid-ended-title {
  margin: 0 0 12px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #222;
  line-height: 1.45;
}
.cbt-guide-vid-ended-tips {
  font-size: 0.88rem;
  line-height: 1.55;
  color: #333;
}
.cbt-guide-vid-ended-tips p { margin: 0 0 8px; }
.cbt-guide-vid-ended-tips ul {
  margin: 0 0 10px;
  padding-left: 1.2rem;
}
.cbt-guide-vid-ended-tips li { margin-bottom: 4px; }
.cbt-guide-vid-ended-warn {
  color: #c41e2a !important;
  font-weight: 600;
}

.cbt-guide-vid-poster-art {
  display: grid;
  grid-template-columns: minmax(200px, 42%) 1fr;
  align-items: stretch;
  min-height: 168px;
  position: relative;
}
.cbt-guide-vid-poster-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 18px 20px;
  background: #c41e2a;
  color: #fff;
  text-align: left;
}
.cbt-guide-vid-poster-kicker {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.1;
}
.cbt-guide-vid-poster-title {
  font-size: 1rem;
  font-weight: 700;
}
.cbt-guide-vid-poster-sub {
  font-size: 0.92rem;
  font-weight: 600;
}
.cbt-guide-vid-poster-desc {
  margin-top: 4px;
  font-size: 0.76rem;
  line-height: 1.35;
  max-width: 240px;
  opacity: 0.95;
}
.cbt-guide-vid-poster-play {
  position: absolute;
  left: 21%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: #c41e2a;
  display: grid;
  place-items: center;
  font-size: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  pointer-events: none;
}

.cbt-guide-vid-missing {
  display: none;
  margin: 0;
  padding: 48px 16px;
  text-align: center;
  color: #666;
  font-size: 0.88rem;
  background: #f7f7f7;
  min-height: 168px;
  align-items: center;
  justify-content: center;
}
.cbt-guide-vid.is-missing .cbt-guide-vid-missing { display: flex; }
.cbt-guide-vid.is-missing .cbt-guide-vid-controls { display: none; }

.cbt-guide-vid-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: #fff;
  border-top: 1px solid #e8e8e8;
}
.cbt-guide-vid-lock {
  flex: 0 0 auto;
  width: 32px;
  height: 28px;
  border: none;
  border-radius: 2px;
  background: #1e6fd6;
  color: #fff;
  font-size: 0.85rem;
  line-height: 1;
  cursor: default;
  padding: 0;
}
.cbt-guide-vid-play {
  min-width: 56px;
  height: 28px;
  border: 1px solid #8ebfe0;
  border-radius: 2px;
  background: #e8f4fc;
  color: #1a6fb5;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  flex: 0 0 auto;
  font-family: inherit;
}
.cbt-guide-vid-seek {
  flex: 1 1 auto;
  accent-color: #4a9fd8;
  min-width: 0;
}
.cbt-guide-vid-time {
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  color: #555;
  white-space: nowrap;
  min-width: 88px;
  text-align: center;
}
.cbt-guide-vid-vol {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 0 4px;
  flex: 0 0 auto;
}

@media (max-width: 720px) {
  .cbt-guide-top-left { font-size: 0.76rem; }
  .cbt-guide-section { padding: 14px 14px 16px; }
  .cbt-guide-vid-poster-art {
    grid-template-columns: 1fr;
    min-height: 140px;
  }
  .cbt-guide-vid-poster-copy { min-height: 120px; }
  .cbt-guide-vid-poster-play {
    left: 50%;
    top: 38%;
  }
  .cbt-guide-skill { min-height: 92px; }
}

/* ================================================
   CBT chrome (同桌风格机考壳 — 听力 / 阅读)
   ================================================ */
#page-exam.cbt-listening .exam-header-classic,
#page-exam.cbt-listening .exam-footer-classic,
#page-exam.cbt-listening .panel-header-listening-classic,
#page-exam.cbt-reading .exam-header-classic,
#page-exam.cbt-reading .exam-footer-classic,
#page-exam.cbt-reading .panel-header-reading,
#page-exam.cbt-writing .exam-header-classic,
#page-exam.cbt-writing .exam-footer-classic,
#page-exam.cbt-writing .panel-header-writing {
  display: none !important;
}
#page-exam.cbt-listening .exam-header-cbt,
#page-exam.cbt-listening .exam-footer-cbt,
#page-exam.cbt-reading .exam-header-cbt,
#page-exam.cbt-reading .exam-footer-cbt,
#page-exam.cbt-writing .exam-header-cbt,
#page-exam.cbt-writing .exam-footer-cbt {
  display: block !important;
}
#page-exam.cbt-listening .cbt-rail {
  display: flex !important;
}
#page-exam:not(.cbt-listening):not(.cbt-reading):not(.cbt-writing) .exam-header-cbt,
#page-exam:not(.cbt-listening):not(.cbt-reading):not(.cbt-writing) .exam-footer-cbt,
#page-exam:not(.cbt-listening):not(.cbt-reading):not(.cbt-writing) .cbt-rail,
#page-exam:not(.cbt-listening):not(.cbt-reading):not(.cbt-writing) .cbt-instr-banner,
#page-exam:not(.cbt-listening):not(.cbt-reading):not(.cbt-writing) .cbt-skill-bar {
  display: none !important;
}
#page-exam:not(.cbt-listening):not(.cbt-reading):not(.cbt-writing) .exam-header-classic,
#page-exam:not(.cbt-listening):not(.cbt-reading):not(.cbt-writing) .exam-footer-classic {
  display: block;
}

#page-exam.cbt-listening,
#page-exam.cbt-reading,
#page-exam.cbt-writing {
  background: #fff;
  color: #111;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
#page-exam.cbt-listening.active,
#page-exam.cbt-reading.active,
#page-exam.cbt-writing.active {
  display: flex;
}

.exam-header-cbt {
  position: sticky;
  top: 0;
  z-index: 120;
  background: #fff;
  border-bottom: 1px solid #d0d0d0;
}
.cbt-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 6px 12px;
  min-height: 52px;
  flex-wrap: wrap;
}
.cbt-brand {
  flex: 0 0 auto;
  font-size: 1.05rem;
  font-weight: 800;
  color: #c41e2a;
  letter-spacing: 0.02em;
  line-height: 1.2;
  padding-top: 4px;
  white-space: nowrap;
}
.cbt-brand[hidden] { display: none !important; }
.cbt-status-icons {
  display: none;
  align-items: center;
  gap: 6px;
  color: #555;
  font-size: 0.95rem;
}
.cbt-status-ico { line-height: 1; }
#page-exam.cbt-reading .cbt-status-icons { display: inline-flex; }
#page-exam.cbt-reading .cbt-top {
  align-items: center;
  padding: 8px 16px;
  flex-wrap: nowrap;
}
#page-exam.cbt-reading .cbt-top-left {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  font-size: 0.82rem;
}
#page-exam.cbt-reading .cbt-brand {
  display: block !important;
  flex: 0 0 auto;
  margin-right: 12px;
  padding-top: 2px;
  font-size: 1.1rem;
}
#page-exam.cbt-reading .cbt-top {
  flex-wrap: nowrap;
}
#page-exam.cbt-reading .cbt-top > .cbt-brand {
  align-self: center;
}
#page-exam.cbt-reading .cbt-meta-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0;
  min-width: 0;
}
#page-exam.cbt-reading .cbt-taker,
#page-exam.cbt-reading .cbt-paper-title {
  display: inline;
  font-size: 0.82rem;
  font-weight: 600;
  color: #222;
  max-width: none;
  white-space: normal;
}
#page-exam.cbt-reading .cbt-paper-title::before {
  content: ' ';
}
#page-exam.cbt-reading .cbt-timer-text {
  width: auto;
  flex-basis: auto;
  padding-left: 0;
  margin-top: 0;
  font-size: 0.82rem;
  color: #333;
}
.cbt-top-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  flex: 1 1 220px;
  min-width: 0;
  font-size: 0.82rem;
  color: #222;
}
.cbt-meta-line {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  min-width: 0;
}
.cbt-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f87171, #c41e2a 70%);
  flex: 0 0 auto;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08);
}
.cbt-taker { font-weight: 600; white-space: nowrap; }
.cbt-subject-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  background: #e11d2e;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 2px;
  line-height: 1.4;
}
.cbt-paper-title {
  font-weight: 700;
  color: #222;
  max-width: 28vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cbt-timer-text {
  font-variant-numeric: tabular-nums;
  color: #333;
  white-space: nowrap;
}
#page-exam.cbt-reading .cbt-timer-text {
  width: 100%;
  flex-basis: 100%;
  padding-left: 38px;
  margin-top: -4px;
}
.cbt-timer-text.is-warning,
#cbtTimerText.is-warning { color: #c41e2a; font-weight: 700; }

.cbt-skill-bar {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: #f0f0f0;
  border-bottom: 1px solid #d0d0d0;
  flex: 0 0 auto;
}
#page-exam.cbt-listening .cbt-skill-bar,
#page-exam.cbt-reading .cbt-skill-bar,
#page-exam.cbt-writing .cbt-skill-bar {
  display: flex !important;
}
.cbt-skill-bar[hidden] { display: none !important; }
.cbt-skill-btn {
  appearance: none;
  border: 1px solid #bbb;
  background: #fff;
  color: #333;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 2px;
  cursor: pointer;
}
.cbt-skill-btn:hover { background: #f5f5f5; }
.cbt-skill-btn.is-active {
  background: #1f2937;
  border-color: #1f2937;
  color: #fff;
}
.cbt-skill-hint {
  margin-left: auto;
  font-size: 0.72rem;
  color: #777;
  white-space: nowrap;
}
@media (max-width: 700px) {
  .cbt-skill-hint { display: none; }
}

.cbt-player {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 280px;
  max-width: 420px;
  min-width: 200px;
  padding: 4px 8px;
  background: #fff;
  border: 1px solid #d8d8d8;
  border-radius: 4px;
}
.cbt-player[hidden] { display: none !important; }
.cbt-player-btn,
.cbt-player-vol {
  appearance: none;
  border: 1px solid #ccc;
  background: #fafafa;
  width: 30px;
  height: 28px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.75rem;
  line-height: 1;
  padding: 0;
}
.cbt-player-btn:hover,
.cbt-player-vol:hover { background: #eee; }
.cbt-player-track { flex: 1; min-width: 0; }
.cbt-player-seek {
  width: 100%;
  height: 4px;
  margin: 0;
  cursor: pointer;
  accent-color: #2b6cb0;
}
.cbt-player-times {
  display: flex;
  gap: 4px;
  font-size: 0.68rem;
  color: #666;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}

.cbt-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  margin-left: auto;
}
.cbt-action-btn {
  appearance: none;
  border: 1px solid #333;
  background: #fff;
  color: #222;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 2px;
  cursor: pointer;
  white-space: nowrap;
}
.cbt-action-btn:hover { background: #f3f3f3; }
.cbt-action-primary {
  background: #fff;
  border-color: #333;
  color: #222;
}
.cbt-action-primary:hover { background: #f3f3f3; filter: none; }
.cbt-action-btn:disabled { opacity: 0.5; cursor: default; }
.cbt-icon-btn {
  appearance: none;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: #444;
  font-size: 1rem;
  cursor: default;
  border-radius: 3px;
}

.cbt-instr-banner {
  display: none;
  align-items: baseline;
  gap: 18px;
  padding: 12px 24px;
  background: #e8e8e8;
  border-bottom: 1px solid #d0d0d0;
  flex: 0 0 auto;
}
#page-exam.cbt-reading .cbt-instr-banner:not([hidden]) {
  display: flex;
}
.cbt-instr-part {
  font-size: 0.95rem;
  font-weight: 700;
  color: #111;
  flex: 0 0 auto;
}
.cbt-instr-text {
  font-size: 0.88rem;
  font-style: italic;
  color: #333;
  font-weight: 400;
}

.exam-body-row {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  align-items: stretch;
}
#page-exam.cbt-listening .exam-body-row,
#page-exam.cbt-reading .exam-body-row,
#page-exam.cbt-writing .exam-body-row {
  flex: 1;
  min-height: 0;
}
.cbt-rail {
  width: 44px;
  flex: 0 0 44px;
  background: #2c2c2c;
  display: none;
  padding: 10px 0;
}
#page-exam.cbt-listening .cbt-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.cbt-rail-btn {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 4px;
  background: #444;
  color: #ddd;
  cursor: default;
  font-size: 0.85rem;
}

#page-exam.cbt-listening .exam-main {
  flex: 1;
  max-width: none;
  margin: 0;
  padding: 18px 28px 100px;
  background: #fff;
}
#page-exam.cbt-listening .listening-section {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  margin-bottom: 0;
}
#page-exam.cbt-listening .ls-header,
#page-exam.cbt-listening .ls-toolbar,
#page-exam.cbt-listening .ls-transcript {
  display: none !important;
}
#page-exam.cbt-listening .ls-questions { padding: 0; }
#page-exam.cbt-listening .ls-layout { margin: 0; }
#page-exam.cbt-listening .notes-sheet {
  border: none;
  background: transparent;
  padding: 0;
  max-width: 820px;
}
#page-exam.cbt-listening .notes-blank-input {
  border: 1px solid #9bb7d4;
  border-radius: 2px;
  background: #fff;
  min-height: 1.6em;
  padding: 2px 6px;
  width: 7.5em;
}
#page-exam.cbt-listening .notes-blank-input:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 1px;
  border-color: #3b82f6;
}
#page-exam.cbt-listening .listening-part {
  display: none;
}
#page-exam.cbt-listening .listening-part.is-active {
  display: block;
}

/* ---- CBT Reading layout ---- */
body.exam-reading-layout #page-exam.cbt-reading {
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}
#page-exam.cbt-reading .exam-main {
  flex: 1;
  max-width: none;
  margin: 0;
  padding: 0;
  background: #fff;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#page-exam.cbt-reading #panel-reading.active {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  margin: 0;
}
#page-exam.cbt-reading .rd-sec-tabs {
  display: none !important;
}
#page-exam.cbt-reading .rd-split-root {
  flex: 1;
  min-height: 0;
  gap: 0;
  padding: 0;
}
#page-exam.cbt-reading .reading-passage.rd-split {
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: #fff;
}
#page-exam.cbt-reading .rp-pane {
  padding: 20px 28px 48px;
  background: #fff;
}
#page-exam.cbt-reading .rp-pane-qs {
  background: #fff;
  display: flex;
  flex-direction: column;
  padding-bottom: 12px;
}
#page-exam.cbt-reading .rp-questions {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
#page-exam.cbt-reading .rp-title {
  text-align: center;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.2rem;
  margin-bottom: 18px;
}
#page-exam.cbt-reading .rp-text {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.98rem;
  line-height: 1.7;
  text-align: justify;
  color: #1a1a1a;
}
#page-exam.cbt-reading .rp-splitter {
  flex: 0 0 16px;
  background: linear-gradient(#cfcfcf, #cfcfcf) center/1px 100% no-repeat;
  background-color: #f3f3f3;
}
#page-exam.cbt-reading .rp-splitter-grip {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 28px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e8e8e8;
  border: 1px solid #bbb;
  border-radius: 2px;
  font-size: 0.7rem;
  color: #555;
  line-height: 1;
}
#page-exam.cbt-reading .notes-blank {
  display: inline-flex;
  align-items: stretch;
  vertical-align: middle;
  margin: 0 2px;
  border: 1px solid #c0c0c0;
  border-radius: 2px;
  background: #fff;
  overflow: hidden;
}
#page-exam.cbt-reading .notes-blank-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4em;
  padding: 0 4px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #555;
  background: #f5f5f5;
  border-right: 1px solid #ddd;
}
#page-exam.cbt-reading .notes-blank-input {
  border: none;
  border-radius: 0;
  background: transparent;
  min-height: 1.7em;
  padding: 2px 8px;
  width: 8em;
  box-shadow: none;
}
#page-exam.cbt-reading .notes-blank:focus-within {
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px #3b82f6;
}
.rp-pane-nav {
  display: none;
  flex: 0 0 auto;
  justify-content: flex-end;
  gap: 8px;
  padding: 8px 4px 4px;
}
.rp-qs-heading {
  font-size: 1rem;
  font-weight: 700;
  color: #111;
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e5e5e5;
}
#page-exam.cbt-reading .rp-pane-nav {
  display: none !important;
}
.rp-pane-nav-btn {
  width: 36px;
  height: 36px;
  border: 1px solid #bbb;
  border-radius: 50%;
  background: #fff;
  color: #333;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}
.rp-pane-nav-btn:hover { background: #f3f3f3; }

.exam-footer-cbt {
  position: sticky;
  bottom: 0;
  z-index: 110;
  background: #f5f5f5;
  border-top: 1px solid #ccc;
  padding: 0;
}
.cbt-footer-inner {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 12px 10px;
  max-width: 100%;
  overflow-x: auto;
}
#page-exam.cbt-reading .cbt-footer-inner {
  align-items: flex-end;
  padding: 10px 16px 12px;
}
.cbt-nav-arrow {
  flex: 0 0 auto;
  width: 32px;
  height: 36px;
  border: 1px solid #bbb;
  background: #fff;
  border-radius: 3px;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  align-self: center;
}
#page-exam.cbt-reading .cbt-nav-arrow {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.35rem;
  align-self: flex-end;
  margin-left: 4px;
}
#page-exam.cbt-reading .cbt-nav-arrow.is-disabled {
  background: #ececec;
  border-color: #d0d0d0;
  color: #aaa;
  cursor: default;
}
#page-exam.cbt-reading .cbt-nav-arrow-next:not(.is-disabled) {
  background: #1f2937;
  border-color: #1f2937;
  color: #fff;
}
#page-exam.cbt-reading .cbt-part-block:not(.is-active) {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
#page-exam.cbt-reading .cbt-part-block:not(.is-active) .cbt-part-label {
  display: inline;
  margin-bottom: 0;
  font-size: 0.78rem;
}
#page-exam.cbt-reading .cbt-part-block:not(.is-active) .cbt-part-compact {
  font-size: 0.78rem;
  font-weight: 600;
  color: #444;
}
#page-exam.cbt-reading .cbt-part-block.is-active .cbt-part-label {
  color: #111;
  font-size: 0.78rem;
  margin-bottom: 6px;
}
#page-exam.cbt-reading .cbt-qnum {
  min-width: 28px;
  height: 26px;
  font-size: 0.75rem;
  border-radius: 3px;
}
#page-exam.cbt-reading .cbt-qnum.is-current {
  background: #fff;
  outline: 2px solid #2563eb;
  outline-offset: 0;
  border-color: #2563eb;
  color: #111;
}
.cbt-parts {
  display: flex;
  gap: 18px;
  flex: 1;
  min-width: 0;
  align-items: flex-end;
}
.cbt-part-block {
  flex: 0 0 auto;
}
.cbt-part-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: #444;
  margin-bottom: 4px;
}
.cbt-part-block.is-active .cbt-part-label { color: #1d4ed8; }
.cbt-part-compact {
  display: none;
  font-size: 0.78rem;
  color: #444;
  font-weight: 600;
  white-space: nowrap;
}
#page-exam.cbt-reading .cbt-part-block:not(.is-active) .cbt-qnums {
  display: none;
}
#page-exam.cbt-reading .cbt-part-block:not(.is-active) .cbt-part-compact {
  display: inline;
}
#page-exam.cbt-reading .cbt-part-block.is-active .cbt-part-compact {
  display: none;
}
#page-exam.cbt-writing .cbt-part-block .cbt-qnums {
  display: none !important;
}
#page-exam.cbt-writing .cbt-part-block:not(.is-active) .cbt-part-compact {
  display: inline;
}
#page-exam.cbt-writing .cbt-part-block.is-active .cbt-part-compact {
  display: none;
}
#page-exam.cbt-listening .cbt-part-compact {
  display: none !important;
}

/* ---- CBT Writing layout ---- */
body.exam-reading-layout #page-exam.cbt-writing {
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}
#page-exam.cbt-writing .exam-main {
  flex: 1;
  max-width: none;
  margin: 0;
  padding: 0;
  background: #f3f3f3;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#page-exam.cbt-writing #panel-writing.active {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  margin: 0;
}
.wt-split-root {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
#page-exam.cbt-writing .wt-split-root {
  gap: 0;
}
.writing-task.wt-split {
  display: none;
  flex: 1;
  min-height: 0;
  margin: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: #fff;
  overflow: hidden;
}
.writing-task.wt-split.active {
  display: flex;
  flex-direction: row;
  align-items: stretch;
}
#page-exam.cbt-writing .wt-pane-prompt {
  flex: 1 1 48%;
  background: #fff;
  padding: 20px 24px 28px;
}
#page-exam.cbt-writing .wt-pane-editor {
  flex: 1 1 52%;
  background: #f7f7f7;
  padding: 16px 18px 20px;
  display: flex;
  flex-direction: column;
}
#page-exam.cbt-writing .rp-splitter {
  flex: 0 0 16px;
  background: linear-gradient(#cfcfcf, #cfcfcf) center/1px 100% no-repeat;
  background-color: #ececec;
}
#page-exam.cbt-writing .rp-splitter-grip {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 28px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e8e8e8;
  border: 1px solid #bbb;
  border-radius: 2px;
  font-size: 0.7rem;
  color: #555;
  line-height: 1;
}
.wt-task-title {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #111;
}
.wt-spend {
  margin: 0 0 14px;
  font-size: 0.9rem;
  color: #333;
}
.wt-prompt-box {
  border: 1px solid #222;
  padding: 14px 16px;
  margin: 0 0 12px;
  background: #fff;
}
.wt-prompt-box .wt-prompt,
.wt-prompt-box em.wt-prompt {
  margin: 0;
  font-style: italic;
  font-size: 0.92rem;
  line-height: 1.65;
  color: #222;
  display: block;
}
.wt-min-words {
  margin: 0 0 16px;
  font-size: 0.9rem;
  color: #222;
}
.wt-editor-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
#page-exam.cbt-writing .wt-cbt-textarea {
  flex: 1;
  min-height: 0;
  width: 100%;
  resize: none;
  border: 1px solid #bdbdbd;
  border-radius: 2px;
  background: #fff;
  padding: 14px 16px;
  font-size: 0.95rem;
  line-height: 1.7;
  color: #111;
  box-shadow: none;
  font-family: Georgia, 'Times New Roman', serif;
}
#page-exam.cbt-writing .wt-cbt-textarea:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px #3b82f6;
  outline: none;
}
#page-exam.cbt-writing .wt-cbt-wordcount {
  margin-top: 8px;
  text-align: right;
  font-size: 0.82rem;
  color: #555;
  font-family: inherit;
}
#page-exam.cbt-writing .cbt-action-btn[hidden] {
  display: none !important;
}
#page-exam.cbt-writing .wt-prompt-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 0.85rem;
}
#page-exam.cbt-writing .wt-prompt-body th,
#page-exam.cbt-writing .wt-prompt-body td {
  border: 1px solid #333;
  padding: 6px 8px;
  text-align: left;
}
#page-exam.cbt-writing .wt-prompt-body th {
  background: #e8e8e8;
}
@media (max-width: 900px) {
  #page-exam.cbt-writing .wt-pane-prompt,
  #page-exam.cbt-writing .wt-pane-editor {
    padding: 12px;
  }
}
.cbt-qnums {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.cbt-qnum {
  appearance: none;
  min-width: 26px;
  height: 24px;
  padding: 0 4px;
  border: 1px solid #b0b0b0;
  background: #fff;
  color: #222;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 2px;
  cursor: pointer;
}
.cbt-qnum:hover { border-color: #3b82f6; }
.cbt-qnum.is-current {
  outline: 2px solid #3b82f6;
  outline-offset: 0;
  border-color: #3b82f6;
}
.cbt-qnum.is-answered {
  background: #dbeafe;
  border-color: #93c5fd;
}
.cbt-part-block:not(.is-active) .cbt-qnums { opacity: 0.85; }

.cbt-pause-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.cbt-pause-overlay[hidden] { display: none !important; }
.cbt-pause-card {
  background: #fff;
  border-radius: 8px;
  padding: 28px 32px;
  max-width: 360px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0,0,0,0.18);
}
.cbt-pause-title {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 700;
}
.cbt-pause-desc {
  margin: 0 0 18px;
  font-size: 0.9rem;
  color: #555;
}

.cbt-finish-overlay {
  position: fixed;
  inset: 0;
  z-index: 450;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.cbt-finish-overlay[hidden] { display: none !important; }
.cbt-finish-dialog {
  width: min(520px, 100%);
  background: #fff;
  border: 1px solid #d0d0d0;
  box-shadow: 0 12px 40px rgba(0,0,0,0.18);
}
.cbt-finish-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #e5e5e5;
}
.cbt-finish-dialog-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}
.cbt-finish-dialog-close {
  border: none;
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: #666;
}
.cbt-finish-dialog-text {
  margin: 0;
  padding: 18px 18px 22px;
  font-size: 0.92rem;
  line-height: 1.55;
  color: #333;
}
.cbt-finish-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 18px 18px;
}
.cbt-finish-dialog-btn {
  min-width: 108px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid #333;
  border-radius: 2px;
  background: #fff;
  color: #222;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.cbt-finish-dialog-btn-primary {
  background: #222;
  color: #fff;
}
.cbt-finish-dialog-btn:hover { opacity: 0.92; }

.cbt-skill-btn.is-locked,
.cbt-skill-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@media (max-width: 900px) {
  .cbt-top { padding: 8px; }
  .cbt-paper-title { max-width: 40vw; }
  .cbt-timer-text { padding-left: 0; }
  .cbt-player { max-width: none; flex: 1 1 100%; order: 3; }
  .cbt-top-actions { width: 100%; justify-content: flex-end; order: 2; }
  #page-exam.cbt-listening .exam-main { padding: 14px 14px 90px; }
  #page-exam.cbt-listening .cbt-rail { display: none; }
  #page-exam.cbt-reading .rp-pane { padding: 14px 14px 40px; }
  #page-exam.cbt-reading .cbt-instr-banner { padding: 10px 14px; flex-wrap: wrap; gap: 6px; }
}
