/* ═══════════════════════════════════════════════════════════════════
   CAMVOCAB · PREMIUM POLISH LAYER  (v4.6.0)
   Loads LAST, after ultimate.css. Adds:
     1. Three switchable color themes (indigo / royal / emerald) × light+dark
     2. Token-driven hero + auth gradients (palette-aware)
     3. Typographic + depth refinement ("追求极致")
     4. Settings drawer polish (palette swatches, grouped)
     5. Mobile / touch refinement
     6. Growth Archive, Teacher Report, Admin components
     7. Print styles (parent display + teacher brief)
   Switch palette via  <html data-palette="indigo|royal|emerald">.
   ═══════════════════════════════════════════════════════════════════ */

/* ════════════ HERO + AUTH — now palette-driven ════════════ */
.hero-panel {
  background: var(--hero-grad) !important;
  box-shadow: 0 18px 48px rgba(12, 16, 38, 0.28) !important;
}
.hero-panel::before {
  background: var(--hero-glow-1) !important;
  opacity: 1 !important;
  display: block !important;
}
/* second ambient glow on the hero, lower-left */
.hero-panel::after {
  display: block !important;
  content: "" !important;
  position: absolute !important;
  width: 320px; height: 320px;
  left: -90px; bottom: -120px;
  background: var(--hero-glow-2) !important;
  filter: blur(8px);
  pointer-events: none;
  z-index: 0;
}
.auth-story { background: var(--auth-grad) !important; }
.auth-story::before { background: var(--hero-glow-1) !important; }
.auth-story::after { background: var(--hero-glow-2) !important; }

/* ════════════ TYPOGRAPHY — premium refinement ════════════ */
.hero-panel h2,
.auth-story h1 {
  text-shadow: 0 1px 18px rgba(8, 11, 30, 0.35);
}
.hero-panel .eyebrow { letter-spacing: 0.16em !important; }
/* hero stat numbers — crisp, faintly lifted on the dark panel */
.hero-stat strong, .hero-stats-row strong {
  text-shadow: 0 1px 10px rgba(8, 11, 30, 0.3) !important;
  font-variant-numeric: tabular-nums;
}
/* big numbers everywhere use tabular figures so they don't jitter on count-up */
.metric-card strong, .ring span, .daily-plan-stat strong { font-variant-numeric: tabular-nums; }
/* section heads / card titles a touch tighter */
.section-head h3, .surface-card > h2, .surface-card > h3 { letter-spacing: -0.01em; }

/* ════════════ DEPTH + MICRO-INTERACTION ════════════ */
.metric-card { transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease) !important; }
.metric-card:hover { transform: translateY(-4px) !important; box-shadow: var(--shadow-lg) !important; }
.surface-card:hover { box-shadow: var(--shadow) ; }
/* primary action: subtle sheen on hover */
.primary-action { position: relative; overflow: hidden; }
.primary-action::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 35%, rgba(255,255,255,0.18) 50%, transparent 65%);
  transform: translateX(-120%); transition: transform 0.7s var(--ease); pointer-events: none;
}
.primary-action:hover::after { transform: translateX(120%); }
/* nav active indicator — smoother, palette-aware bar */
.nav-item.active { box-shadow: inset 0 0 0 1px var(--accent-edge); }
/* focus-visible ring everywhere for accessibility + polish */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible,
[tabindex]:focus-visible {
  outline: none !important;
  box-shadow: 0 0 0 3px var(--accent-soft), 0 0 0 1px var(--accent-edge) !important;
  border-radius: 8px;
}

/* progress ring — slightly thicker premium look handled in JS gradient;
   ensure the inner hole is crisp */
.ring { box-shadow: var(--shadow-sm) !important; }

/* ════════════ SETTINGS DRAWER — palette swatches + grouping ════════════ */
.palette-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 4px; }
.palette-swatch {
  display: flex; flex-direction: column; gap: 8px; align-items: stretch;
  padding: 10px; border-radius: 14px; cursor: pointer;
  background: var(--surface-2); border: 1.5px solid transparent;
  transition: border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.palette-swatch:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.palette-swatch.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.palette-swatch .swatch-strip { height: 26px; border-radius: 8px; display: flex; overflow: hidden; }
.palette-swatch .swatch-strip i { flex: 1; }
.palette-swatch .swatch-name { font-size: 12px; font-weight: 700; color: var(--ink); text-align: center; }
.palette-swatch .swatch-check { display: none; }
.palette-swatch.active .swatch-check { display: inline; color: var(--accent); }
/* settings: tidy section rhythm */
.settings-card + .settings-card { margin-top: 14px; }
.settings-note { color: var(--muted) !important; }
.settings-seg { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 3px; gap: 2px; }
.settings-seg button {
  border: none; background: transparent; color: var(--muted); font-weight: 700; font-size: 13px;
  padding: 7px 16px; border-radius: 999px; cursor: pointer; transition: all var(--t-fast) var(--ease);
}
.settings-seg button.active { background: var(--surface); color: var(--accent-ink); box-shadow: var(--shadow-xs); }

/* ════════════ MOBILE / TOUCH REFINEMENT ════════════ */
@media (max-width: 768px) {
  .hero-panel { padding: 28px 22px !important; min-height: 232px !important; }
  .hero-panel h2 { font-size: clamp(26px, 7vw, 34px) !important; }
  .hero-stats-row { gap: 8px !important; }
  .hero-stat, .hero-stats-row > div { min-width: 0 !important; flex: 1 1 0 !important; padding: 10px 8px !important; }
  .metric-card { min-height: 96px !important; padding: 15px 16px !important; }
  .metric-card strong { font-size: 28px !important; }
  .section-head { gap: 8px; }
  /* comfortable tap targets */
  .primary-action, .secondary-action, .pill-button, .nav-item, .tab-btn { min-height: 44px; }
  .palette-picker { gap: 8px; }
}
@media (max-width: 560px) {
  .hero-stats-row { display: grid !important; grid-template-columns: repeat(3, 1fr) !important; }
  .hero-actions { flex-direction: column !important; }
  .hero-actions .primary-action, .hero-actions .secondary-action { width: 100% !important; }
}

/* ════════════ GROWTH ARCHIVE ════════════ */
.growth-archive { display: flex; flex-direction: column; gap: 16px; }
.growth-hero { background: var(--hero-grad) !important; color: #fff !important; border: none !important; overflow: hidden; position: relative; }
.growth-hero::after { content: ""; position: absolute; width: 360px; height: 360px; right: -120px; top: -160px; background: var(--hero-glow-1); pointer-events: none; }
.growth-hero .eyebrow { color: rgba(255,255,255,0.62) !important; letter-spacing: 0.16em; }
.growth-hero h2 { color: #fff !important; text-shadow: 0 1px 16px rgba(8,11,30,0.35); }
.growth-hero .muted { color: rgba(255,255,255,0.66) !important; }
.growth-hero-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; position: relative; z-index: 1; }
.growth-hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.growth-hero-actions .secondary-action { background: rgba(255,255,255,0.12) !important; color: #fff !important; border: 1px solid rgba(255,255,255,0.22) !important; }
.growth-hero-actions .secondary-action:hover { background: rgba(255,255,255,0.2) !important; }
.growth-insight {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; gap: 9px;
  margin-top: 16px; padding: 10px 16px;
  border-radius: 999px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.16);
  color: #fff; font-weight: 600; font-size: 13.5px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.growth-insight .ic { width: 16px; height: 16px; color: #ffd479; flex: none; }
.growth-summary-row {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.growth-summary-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 13px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 14px;
  background: rgba(255,255,255,.09);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.growth-summary-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: rgba(255,255,255,.14);
  color: #fff;
}
.growth-summary-icon .ic { width: 19px; height: 19px; }
.growth-summary-card.tone-mastered .growth-summary-icon { background: rgba(255,213,121,.2); color: #ffe29d; }
.growth-summary-card.tone-tricky .growth-summary-icon { background: rgba(116,230,183,.2); color: #9cf0ca; }
.growth-summary-card.tone-streak .growth-summary-icon { background: rgba(255,170,90,.22); color: #ffd09d; }
.growth-summary-copy { min-width: 0; }
.growth-summary-copy small,
.growth-summary-copy strong,
.growth-summary-copy em { display: block; min-width: 0; }
.growth-summary-copy small { color: rgba(255,255,255,.72); font-size: 11px; font-weight: 700; }
.growth-summary-copy strong {
  margin-top: 1px;
  color: #fff;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}
.growth-summary-copy em {
  margin-top: 3px;
  color: rgba(255,255,255,.6);
  font-size: 10.5px;
  font-style: normal;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.growth-stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 18px; position: relative; z-index: 1; }
.growth-stat { background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12); border-radius: 18px; padding: 16px 16px 14px; backdrop-filter: blur(8px); display: flex; flex-direction: column; gap: 2px; }
.growth-stat-ic { width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.14); margin-bottom: 6px; }
.growth-stat-ic .ic { width: 19px; height: 19px; color: #fff; }
.growth-stat.tone-flame .growth-stat-ic { background: rgba(255,170,90,0.28); }
.growth-stat strong { font-size: 30px; font-weight: 800; color: #fff; font-family: var(--font-display); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.05; }
.growth-stat-label { font-size: 13px; font-weight: 700; color: rgba(255,255,255,0.9); }
.growth-stat small { font-size: 11px; color: rgba(255,255,255,0.58); }
.growth-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.growth-grid.one-column { grid-template-columns: 1fr; }
.growth-grid > section { margin: 0; }

/* heatmap */
.gh-grid { display: flex; gap: 4px; overflow-x: auto; padding: 6px 2px 2px; }
.gh-col { display: flex; flex-direction: column; gap: 4px; }
.gh-cell { width: 14px; height: 14px; border-radius: 4px; flex: none; background: var(--surface-3); }
.gh-cell.gh-empty { background: transparent; }
.heat-legend { display: flex; align-items: center; gap: 5px; margin-top: 12px; font-size: 11px; color: var(--muted); }
.heat-legend .gh-cell { width: 12px; height: 12px; }

/* mastery curve */
.growth-curve { margin-top: 6px; }
.curve-svg { width: 100%; height: 150px; display: block; }
.curve-line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.curve-area { fill: var(--accent-soft); stroke: none; }
.curve-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.curve-foot strong { color: var(--accent-ink); font-size: 14px; }

/* tricky trend */
.tricky-trend { display: flex; flex-direction: column; gap: 14px; }
.tricky-bar { height: 12px; border-radius: 999px; background: var(--red-soft); overflow: hidden; }
.tricky-done { display: block; height: 100%; background: var(--green); border-radius: 999px; transition: width var(--t) var(--ease); }
.tricky-legend { display: flex; gap: 12px; }
.tricky-legend > div { flex: 1; background: var(--surface-2); border-radius: 14px; padding: 12px; text-align: center; }
.tricky-legend strong { display: block; font-size: 26px; font-weight: 800; font-family: var(--font-display); }
.tricky-legend strong.ok { color: var(--green); }
.tricky-legend strong.warn { color: var(--red); }
.tricky-legend small { color: var(--muted); font-size: 12px; }

/* timelines */
.growth-timeline { display: flex; flex-direction: column; }
.tl-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--hairline-soft); }
.tl-row:last-child { border-bottom: none; }
.tl-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex: none; box-shadow: 0 0 0 4px var(--accent-soft); }
.tl-body { flex: 1; min-width: 0; }
.tl-body strong { display: block; font-size: 14px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-body small { color: var(--muted); font-size: 12px; }
.score-badge { font-weight: 800; font-size: 14px; padding: 4px 11px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.score-badge.ok { background: var(--green-soft); color: var(--green-ink); }
.score-badge.mid { background: var(--amber-soft); color: var(--amber-ink, var(--amber)); }
.score-badge.low { background: var(--red-soft); color: var(--red-ink); }
@media (max-width: 900px) {
  .growth-grid { grid-template-columns: 1fr; }
  .growth-summary-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .growth-stat-row { grid-template-columns: repeat(2, 1fr); }
  .growth-stat strong { font-size: 26px; }
  .growth-hero-head { display: block; }
  .growth-hero-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    margin-top: 14px;
  }
  .growth-hero-actions .secondary-action {
    width: 100%;
    min-width: 0;
    padding-inline: 10px;
    white-space: normal;
  }
  .growth-insight {
    display: flex;
    width: 100%;
    box-sizing: border-box;
    border-radius: 13px;
    line-height: 1.5;
  }
  .growth-summary-row { gap: 8px; }
  .growth-summary-card { gap: 8px; padding: 11px 10px; }
  .growth-summary-icon { width: 32px; height: 32px; border-radius: 10px; }
  .growth-summary-icon .ic { width: 17px; height: 17px; }
  .growth-summary-copy strong { font-size: 21px; }
}

@media (max-width: 340px) {
  .growth-summary-icon { width: 30px; height: 30px; }
}

/* v4.6.0: Home growth entry, Words training entry, Listen book audio library */
.home-growth-entry {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--hairline-soft);
  border-radius: 14px;
  background: var(--surface-2);
}
.home-growth-icon,
.listen-card-icon,
.listen-hero-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--accent-soft);
  color: var(--accent);
  flex: none;
}
.home-growth-icon .ic,
.listen-card-icon .ic,
.listen-hero-icon .ic { width: 21px; height: 21px; }
.home-growth-copy { min-width: 0; }
.home-growth-copy strong,
.home-growth-copy span { display: block; min-width: 0; }
.home-growth-copy strong { color: var(--ink); font-weight: 750; }
.home-growth-copy span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-growth-entry .secondary-action {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
}

.words-training-panel {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--hairline-soft);
}
.words-training-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}
.words-training-head strong { color: var(--ink); font-weight: 750; }
.words-training-head span { color: var(--muted); font-size: 12px; }
.words-training-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.words-training-actions .secondary-action {
  justify-content: flex-start;
  min-height: 42px;
  gap: 8px;
}
.words-training-actions .ic { width: 17px; height: 17px; }

.listen-view {
  display: grid;
  gap: 16px;
}
.listen-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}
.listen-hero h2 { margin-bottom: 6px; }
.listen-source-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.listen-source-line span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 800;
}
.listen-hero-icon {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: var(--green-soft);
  color: var(--green);
}
.listen-hero-icon .ic { width: 28px; height: 28px; }
.listen-library-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.listen-mode-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.listen-library-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 108px;
  text-align: left;
}
button.listen-library-card {
  width: 100%;
  border: 1px solid var(--hairline-soft);
  color: inherit;
  font-family: var(--font);
}
button.listen-library-card.active {
  border-color: var(--accent-edge);
  background: var(--accent-soft-2);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.listen-library-card div:last-child { min-width: 0; }
.listen-library-card span,
.listen-library-card strong,
.listen-library-card small { display: block; }
.listen-library-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.listen-library-card strong {
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
}
.listen-library-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.listen-level-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.listen-search {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 48px;
  margin: 12px 0;
  padding: 0 14px;
  border: 1px solid var(--hairline-soft);
  border-radius: 16px;
  background: var(--surface-2);
  color: var(--muted);
}
.listen-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 750;
}
.listen-search input::placeholder { color: var(--muted); font-weight: 650; }
.listen-level-pill {
  min-height: 62px;
  border: 1px solid var(--hairline-soft);
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--ink);
  font-family: var(--font);
  cursor: pointer;
  display: grid;
  gap: 2px;
  place-items: center;
}
.listen-level-pill.active {
  border-color: var(--accent-edge);
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.listen-level-pill span { font-weight: 800; }
.listen-level-pill small { color: var(--muted); font-size: 11px; }
.listen-group-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.listen-group-pill {
  display: grid;
  gap: 2px;
  min-height: 48px;
  padding: 8px 14px;
  border: 1px solid var(--hairline-soft);
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--ink);
  text-align: left;
}
.listen-group-pill.active {
  border-color: var(--accent-edge);
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.listen-group-pill strong {
  font-size: 13px;
  line-height: 1.1;
}
.listen-group-pill small {
  color: var(--muted);
  font-size: 11px;
}
.listen-player-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 420px);
  gap: 16px;
  align-items: center;
  border-color: var(--accent-edge) !important;
}
.listen-player-copy { min-width: 0; }
.listen-player-copy h3 {
  margin: 4px 0 4px;
  overflow-wrap: anywhere;
}
.listen-player-card audio {
  width: 100%;
  min-width: 0;
}
.listen-list-card .section-head { margin-bottom: 12px; }
.book-audio-list {
  display: grid;
  gap: 8px;
}
.book-audio-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto 42px;
  align-items: center;
  gap: 10px;
  min-height: 68px;
  padding: 10px;
  border: 1px solid var(--hairline-soft);
  border-radius: 16px;
  background: var(--surface-2);
}
.book-audio-row.active {
  border-color: var(--accent-edge);
  background: var(--accent-soft-2);
}
.book-audio-play,
.book-audio-favorite {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--hairline-soft);
  border-radius: 13px;
  background: var(--surface);
  color: var(--accent);
}
.book-audio-play .ic,
.book-audio-favorite .ic {
  width: 18px;
  height: 18px;
}
.book-audio-row.active .book-audio-play {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}
.book-audio-favorite.active {
  background: var(--gold-soft);
  color: var(--gold-ink);
  border-color: rgba(199, 154, 59, 0.28);
}
.book-audio-favorite.active .ic {
  fill: currentColor;
}
.book-audio-main {
  min-width: 0;
}
.book-audio-main strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.book-audio-main small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.book-audio-track {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}
.listen-empty-inner {
  padding: 26px 12px;
  text-align: center;
}
.listen-empty-card .empty-state-card { text-align: center; }
.listen-empty-card .empty-state-card .icon {
  display: inline-grid;
  place-items: center;
  margin-bottom: 10px;
  color: var(--accent);
}

@media (max-width: 900px) {
  .listen-library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .listen-level-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .listen-player-card { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .home-growth-entry {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    padding: 10px;
    gap: 10px;
  }
  .home-growth-icon { width: 38px; height: 38px; border-radius: 12px; }
  .home-growth-copy span { font-size: 11px; }
  .home-growth-entry .secondary-action {
    min-height: 34px;
    padding: 0 12px;
  }
  .listen-hero {
    align-items: flex-start;
  }
  .listen-hero-icon {
    width: 48px;
    height: 48px;
    border-radius: 15px;
  }
  .listen-library-grid,
  .listen-level-grid { grid-template-columns: 1fr; }
  .listen-library-card {
    min-height: 0;
    padding: 14px !important;
  }
  .listen-group-grid { display: grid; grid-template-columns: 1fr 1fr; }
  .listen-group-pill { min-width: 0; }
  
  .book-audio-track {
    grid-column: 2 / 4;
    justify-self: start;
  }
  .book-audio-main strong,
  .book-audio-main small {
    white-space: normal;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  
  .book-audio-main small { -webkit-line-clamp: 1; }
}

/* ════════════ TEACHER REPORTS ════════════ */
.teacher-brief-bar { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.completion-ring { position: relative; width: 84px; height: 84px; border-radius: 50%; flex: none;
  background: var(--surface-3);
  background: conic-gradient(var(--accent) calc(var(--pct, 0) * 3.6deg), var(--surface-3) 0); display: grid; place-items: center; }
.completion-ring span { width: 62px; height: 62px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-weight: 800; font-family: var(--font-display); font-size: 18px; color: var(--ink); font-variant-numeric: tabular-nums; }
.completion-ring.big { width: 108px; height: 108px; }
.completion-ring.big span { width: 82px; height: 82px; font-size: 24px; }
.completion-meta { flex: 1; min-width: 180px; }
.completion-meta h3 { margin: 2px 0 4px; }
.brief-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.hardword-table .rank-cell { font-weight: 800; color: var(--accent-ink); font-family: var(--font-display); width: 34px; }
.hardword-table td { vertical-align: middle; }
.hw-bar { display: inline-block; vertical-align: middle; width: 84px; height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-right: 8px; }
.hw-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--amber), var(--red)); border-radius: 999px; }

.report-overlay { position: fixed; inset: 0; background: rgba(10,12,20,0.55); z-index: 1200; display: none; overflow: auto; backdrop-filter: blur(4px); }
body.brief-open { overflow: hidden; }
body.brief-open .report-overlay { display: block; }
.report-overlay-bar { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 20px; background: var(--glass-drawer); backdrop-filter: saturate(180%) blur(18px); border-bottom: 1px solid var(--hairline); }
.report-overlay-bar > div { display: flex; gap: 8px; }
.report-overlay-body { max-width: 880px; margin: 24px auto; padding: 0 16px 64px; }
.report-sheet { background: var(--surface); border-radius: var(--r); padding: 36px; box-shadow: var(--shadow-lg); }
.report-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; border-bottom: 2px solid var(--accent); padding-bottom: 18px; margin-bottom: 20px; }
.report-head h1 { font-size: 27px; margin: 4px 0 6px; font-family: var(--font-display); letter-spacing: -0.02em; }
.report-head p { color: var(--muted); font-size: 13px; }
.report-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 8px; }
.report-metric { background: var(--surface-2); border-radius: 14px; padding: 14px 16px; }
.report-metric span { display: block; color: var(--muted); font-size: 12px; font-weight: 700; margin-bottom: 4px; }
.report-metric strong { font-size: 24px; font-weight: 800; font-family: var(--font-display); color: var(--ink); }
.report-section { margin-top: 22px; }
.report-section h2 { font-size: 16px; margin-bottom: 12px; }
.report-foot { margin-top: 22px; color: var(--muted); font-size: 12px; text-align: center; }
@media (max-width: 560px) { .report-metrics { grid-template-columns: repeat(2, 1fr); } .report-sheet { padding: 22px; } }

/* ════════════ ADMIN CONSOLE ════════════ */
.admin-console { display: flex; flex-direction: column; gap: 16px; }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.admin-search { min-width: 240px; max-width: 320px; }
.admin-search input { width: 100%; }
.role-badge, .status-badge { display: inline-block; font-size: 11px; font-weight: 800; padding: 3px 10px; border-radius: 999px; letter-spacing: 0.01em; }
.role-badge.role-admin { background: var(--purple-soft); color: var(--purple); }
.role-badge.role-teacher { background: var(--accent-soft); color: var(--accent-ink); }
.role-badge.role-student { background: var(--green-soft); color: var(--green-ink); }
.status-badge.st-ok { background: var(--green-soft); color: var(--green-ink); }
.status-badge.st-warn { background: var(--amber-soft); color: var(--amber-ink, var(--amber)); }
.status-badge.st-bad { background: var(--red-soft); color: var(--red-ink); }
.admin-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); margin-bottom: 8px; }
.admin-row strong { display: block; }
.admin-row p { color: var(--muted); font-size: 12px; margin-top: 2px; }
.admin-account-wrap { min-width: 0; }
.admin-account-groups { display: flex; flex-direction: column; gap: 18px; }
.admin-account-group { min-width: 0; }
.admin-account-group-head { margin-bottom: 10px; }
.admin-account-group-head p { margin-top: 3px; font-size: 12px; }
.admin-account-empty { padding: 14px 16px; border: 1px dashed var(--hairline); border-radius: var(--r-sm); color: var(--muted); background: var(--surface-2); font-size: 13px; }
.account-table code, .data-table code { font-family: var(--font-mono, ui-monospace, monospace); font-size: 12px; background: var(--surface-2); padding: 2px 7px; border-radius: 6px; }
@media (max-width: 900px) { .admin-grid { grid-template-columns: 1fr; } .admin-search { max-width: none; } }

/* ════════════ v4.7.1 Home simplification + Growth share report ════════════ */
body[data-view="today"] .main > .hero-grid,
body[data-view="today"] .main > .metric-grid {
  display: none !important;
}

body[data-view="today"] #view-today {
  max-width: 1040px;
  margin: 0 auto;
}

body[data-view="today"] .today-focus-layout {
  grid-template-columns: minmax(0, 1fr) !important;
}

.student-home {
  display: grid;
  gap: 14px;
}

.home-command-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 190px) auto;
  gap: 14px;
  align-items: stretch;
  padding: 16px;
  border: 1px solid var(--hairline-soft);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.92), rgba(246,249,252,0.82)),
    var(--surface);
}

.home-command-copy {
  min-width: 0;
}

.home-command-copy h2 {
  margin: 2px 0 6px;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.08;
}

.home-command-copy p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 13px;
}

.home-command-progress {
  display: grid;
  align-content: center;
  gap: 6px;
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--hairline-soft);
  border-radius: 12px;
  background: var(--surface-2);
}

.home-command-progress strong {
  color: var(--ink);
  font-size: 28px;
  line-height: 1;
  font-family: var(--font-display);
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.home-command-progress span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.home-command-actions {
  display: flex;
  align-content: center;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.home-command-actions .primary-action,
.home-command-actions .secondary-action {
  min-height: 42px;
  white-space: nowrap;
}

.home-command-actions .primary-action {
  padding: 0 18px;
}

.home-progress-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.home-progress-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px 11px;
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--hairline-soft);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: none;
}

.home-progress-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent);
}

.home-progress-icon .ic {
  width: 19px;
  height: 19px;
}

.home-progress-card > div {
  min-width: 0;
}

.home-progress-card strong,
.home-progress-card b,
.home-progress-card small {
  display: block;
  min-width: 0;
}

.home-progress-card strong {
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
}

.home-progress-card b {
  margin-top: 2px;
  color: var(--ink);
  font-size: 23px;
  line-height: 1.05;
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
}

.home-progress-card small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-progress-card .daily-mini-progress {
  grid-column: 1 / -1;
}

.home-progress-card.tone-blue .home-progress-icon { background: var(--accent-soft); color: var(--accent); }
.home-progress-card.tone-purple .home-progress-icon { background: var(--purple-soft); color: var(--purple); }
.home-progress-card.tone-green .home-progress-icon { background: var(--green-soft); color: var(--green); }
.home-progress-card.empty { opacity: 0.82; }

.home-action-list {
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--hairline-soft);
  border-radius: 14px;
  background: var(--surface);
}

.home-scroll-list {
  display: grid;
  gap: 8px;
  max-height: 430px;
  overflow: auto;
  padding-right: 2px;
}

.home-scroll-list .feedback {
  margin: 0;
}

.home-shortcut-strip {
  display: grid;
  gap: 10px;
}

.home-shortcut-strip .home-growth-entry,
.home-shortcut-strip .assignment-shortcut-row {
  margin-top: 0;
}

.home-shortcut-strip .assignment-shortcut-row {
  border: 1px solid var(--hairline-soft) !important;
  background: var(--surface-2) !important;
}

.home-greeting-strip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--hairline-soft);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.94), rgba(246,249,252,0.86)),
    var(--surface);
}

.home-hello-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 850;
  box-shadow: 0 10px 22px rgba(36,87,166,0.18);
}

.home-hello-copy {
  min-width: 0;
}

.home-hello-copy span,
.home-hello-copy strong,
.home-hello-copy small {
  display: block;
  min-width: 0;
}

.home-hello-copy span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 820;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-hello-copy strong {
  margin-top: 1px;
  color: var(--ink);
  font-size: clamp(20px, 2.6vw, 28px);
  line-height: 1.08;
  font-family: var(--font-display);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-hello-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  /* F8 止血批: 桌面也允许换行，最多 2 行，不再把“点击作业卡片开始”截成“点…” */
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.home-greeting-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.home-greeting-tools .home-level-chip {
  min-height: 42px;
  padding: 7px 9px;
  border-radius: 12px;
  grid-template-columns: auto auto;
  column-gap: 8px;
}

.home-greeting-tools .home-level-chip .hlc-k,
.home-greeting-tools .home-level-chip .hlc-sub {
  display: none;
}

.home-greeting-tools .home-level-chip .hlc-v {
  font-size: 17px;
}

.home-greeting-tools .home-level-chip .hlc-go {
  width: 28px;
  height: 28px;
}

.home-greeting-tools .secondary-action {
  min-height: 42px;
  padding: 0 12px;
  border-radius: 12px;
  white-space: nowrap;
}

.daily-task-row.clickable,
.assignment-history-row.clickable {
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}

.daily-task-row.clickable:hover,
.assignment-history-row.clickable:hover {
  border-color: var(--accent-edge) !important;
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.daily-task-row.clickable:focus-visible,
.assignment-history-row.clickable:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.assignment-open-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 780;
  white-space: nowrap;
}

.assignment-type-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 8px 0 12px;
}

.assignment-type-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--hairline-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
}

.assignment-type-pill.tone-blue { background: var(--accent-soft); color: var(--accent-ink); border-color: rgba(36,87,166,0.16); }
.assignment-type-pill.tone-purple { background: var(--purple-soft); color: var(--purple); border-color: rgba(124,92,214,0.16); }
.assignment-type-pill.tone-green { background: var(--green-soft); color: var(--green-ink); border-color: rgba(26,156,82,0.16); }
.assignment-type-pill.tone-amber { background: var(--amber-soft); color: var(--amber-ink, var(--amber)); border-color: rgba(217,138,0,0.18); }

.assignment-type-groups {
  display: grid;
  gap: 12px;
}

.assignment-type-group {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--hairline-soft);
  border-radius: 14px;
  background: var(--surface-2);
}

.assignment-type-group.tone-blue { background: linear-gradient(135deg, var(--accent-soft), var(--surface)); }
.assignment-type-group.tone-purple { background: linear-gradient(135deg, var(--purple-soft), var(--surface)); }
.assignment-type-group.tone-green { background: linear-gradient(135deg, var(--green-soft), var(--surface)); }
.assignment-type-group.tone-amber { background: linear-gradient(135deg, var(--amber-soft), var(--surface)); }

.assignment-type-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.assignment-type-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  color: var(--accent);
  border: 1px solid var(--hairline-soft);
}

.assignment-type-icon .ic {
  width: 18px;
  height: 18px;
}

.assignment-type-group.tone-purple .assignment-type-icon { color: var(--purple); }
.assignment-type-group.tone-green .assignment-type-icon { color: var(--green); }
.assignment-type-group.tone-amber .assignment-type-icon { color: var(--amber-ink, var(--amber)); }

.assignment-type-head div {
  min-width: 0;
}

.assignment-type-head strong,
.assignment-type-head small {
  display: block;
  min-width: 0;
}

.assignment-type-head strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 820;
}

.assignment-type-head small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.assignment-type-head b {
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
  white-space: nowrap;
}

.assignment-type-list {
  display: grid;
  gap: 8px;
}

.assignment-type-groups.home {
  gap: 10px;
}

.assignment-type-groups.home .assignment-type-group {
  padding: 10px;
  border-radius: 13px;
}

.assignment-type-groups.home .assignment-type-head {
  margin-bottom: 8px;
}

.assignment-type-groups.home .assignment-type-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
}

@media (max-width: 900px) {
  .home-command-panel {
    grid-template-columns: minmax(0, 1fr);
  }
  .home-command-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  body[data-view="today"] .main {
    gap: 12px !important;
  }
  .student-home {
    gap: 11px;
  }
  .today-plan-card {
    padding: 14px !important;
  }
  .home-greeting-strip {
    border-radius: 13px;
  }
  .home-hello-mark {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    font-size: 17px;
  }
  .home-hello-copy strong {
    font-size: 20px;
  }
  .home-hello-copy small {
    font-size: 11px;
  }
  .home-greeting-tools {
    grid-template-columns: auto auto auto;
  }
  
  .home-greeting-tools .home-level-chip .hlc-v {
    font-size: 15px;
  }
  .home-greeting-tools .home-level-chip .hlc-go {
    width: 24px;
    height: 24px;
  }
  
  .home-greeting-tools .daily-refresh-action span {
    display: none;
  }
  .today-plan-head {
    gap: 10px;
    margin-bottom: 10px;
  }
  .today-plan-head h2 {
    font-size: 18px !important;
    margin: 0;
  }
  .home-command-panel {
    padding: 13px;
    gap: 11px;
    border-radius: 13px;
  }
  .home-command-copy h2 {
    font-size: 24px;
  }
  .home-command-copy p {
    font-size: 12px;
  }
  .home-command-progress {
    padding: 11px;
  }
  .home-command-progress strong {
    font-size: 24px;
  }
  .home-command-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    width: 100%;
  }
  .home-command-actions .primary-action,
  .home-command-actions .secondary-action {
    min-width: 0;
    min-height: 40px;
    padding: 0 12px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .home-command-actions .daily-refresh-action span {
    display: none;
  }
  
  
  .home-progress-icon {
    display: none;
  }
  
  
  .home-progress-card small {
    font-size: 10.5px;
  }
  .home-action-list {
    padding: 11px;
  }
  .home-scroll-list {
    max-height: 390px;
  }
  .assignment-type-summary {
    gap: 6px;
    margin: 7px 0 10px;
  }
  .assignment-type-pill {
    min-height: 26px;
    padding: 0 9px;
    font-size: 11px;
  }
  .assignment-type-group {
    padding: 10px;
  }
  .assignment-type-head {
    grid-template-columns: 30px minmax(0, 1fr) auto;
    gap: 8px;
  }
  .assignment-type-icon {
    width: 30px;
    height: 30px;
    border-radius: 9px;
  }
  .assignment-type-head strong {
    font-size: 13px;
  }
  .assignment-type-head small,
  .assignment-type-head b {
    font-size: 11px;
  }
}

@media (max-width: 390px) {
  .home-progress-cards {
    grid-template-columns: 1fr;
  }
}

/* ════════════ PRINT (student growth report + teacher brief) ════════════ */
@media print {
  .sidebar, .topbar, .mobile-tabbar, .ambient, .global-search-panel,
  .hero-grid, .metric-grid, .no-print, .settings-drawer, .settings-scrim,
  .growth-hero-actions, .daily-refresh-action { display: none !important; }
  body, .app-shell, .main { background: #fff !important; display: block !important; }
  .main { padding: 0 !important; margin: 0 !important; }
  .view:not(.active) { display: none !important; }
  .surface-card, .growth-stat, .metric-card { box-shadow: none !important; border: 1px solid #e2e2ea !important; break-inside: avoid; }
  .growth-hero, .report-hero { background: #f4f5fb !important; color: #1c1c28 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .growth-hero h2, .growth-hero .eyebrow, .growth-hero .muted, .growth-stat strong, .growth-stat-label, .growth-stat small { color: #1c1c28 !important; text-shadow: none !important; }
  .growth-stat { background: #fff !important; border: 1px solid #e2e2ea !important; }
  .gh-cell, .curve-area, .curve-line, .tricky-done, .score-badge { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .growth-grid { grid-template-columns: 1fr 1fr !important; }
  /* teacher brief overlay → print only the sheet */
  body.brief-open .app-shell { display: none !important; }
  body.brief-open .report-overlay { display: block !important; position: static !important; background: #fff !important; backdrop-filter: none !important; overflow: visible !important; }
  .report-overlay-bar { display: none !important; }
  .report-overlay-body { margin: 0 !important; max-width: none !important; padding: 0 !important; }
  .report-sheet { box-shadow: none !important; padding: 0 !important; border: none !important; }
  .completion-ring { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .data-table { font-size: 11px; }
}

/* ════════════ REDUCE MOTION ════════════ */
html.cv-reduce-motion .primary-action::after,
html.cv-reduce-motion .hero-panel::before,
html.cv-reduce-motion .hero-panel::after { transition: none !important; animation: none !important; }
