:root {
  --bg: #f4f1ea;
  --panel: #ffffff;
  --panel-soft: #f8f8f6;
  --ink: #172033;
  --muted: #667085;
  --line: #e4e8ef;
  --accent: #2f6fed;
  --accent-soft: #edf3ff;
  --shadow: 0 14px 34px rgba(18, 29, 51, 0.08);
  --radius-xl: 22px;
  --radius-lg: 18px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
}

button,
input,
textarea,
select {
  font: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.page-shell {
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 16px 0 40px;
}

.topbar,
.scene-panel,
.rail-panel,
.wordlab-panel,
.ad-panel,
.content-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.topbar,
.scene-panel,
.rail-panel,
.wordlab-panel,
.ad-panel,
.content-panel {
  padding: 18px;
}

.app-grid {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.learning-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(280px, 0.72fr);
  gap: 16px;
}

.eyebrow,
.section-kicker {
  margin: 0;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

.topbar h1,
.section-heading h2,
.scene-topline h2,
.focus-word,
.overlay-word {
  margin: 0;
  font-weight: 800;
  letter-spacing: 0;
}

.topbar h1 {
  margin-top: 8px;
  font-size: clamp(1.9rem, 3vw, 2.7rem);
  line-height: 1.12;
}

.lead,
.scene-mood,
.scene-footer p,
.focus-note,
.focus-meta,
.overlay-copy,
.overlay-subcopy,
.lab-row dd,
.vocab-item span {
  color: var(--muted);
  line-height: 1.6;
}

.section-heading,
.scene-topline {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 14px;
}

.section-heading h2,
.scene-topline h2 {
  font-size: clamp(1.22rem, 2vw, 1.82rem);
  line-height: 1.2;
}

.compact {
  align-items: center;
}

.compact h2 {
  font-size: 1.16rem;
}

.scene-stage {
  position: relative;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 18px;
  background: #ebe5da;
  line-height: 0;
}

.scene-stage img {
  width: 100%;
  height: auto;
}

.scene-tip {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 2;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(23, 32, 51, 0.82);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
}

.hotspot-layer {
  position: absolute;
  inset: 0;
}

.hotspot {
  position: absolute;
  width: 30px;
  height: 30px;
  transform: translate(-50%, -50%);
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.hotspot::before,
.hotspot::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 999px;
}

.hotspot::before {
  width: 11px;
  height: 11px;
  background: var(--accent);
  border: 2px solid #fff;
  box-shadow: 0 4px 10px rgba(47, 111, 237, 0.26);
}

.hotspot::after {
  width: 22px;
  height: 22px;
  background: rgba(47, 111, 237, 0.14);
}

.hotspot.active::before {
  background: #ff8259;
}

.hotspot.active::after {
  background: rgba(255, 130, 89, 0.18);
}

.hotspot.hit::before {
  background: #11a36a;
}

.hotspot.hit::after {
  background: rgba(17, 163, 106, 0.18);
}

.desktop-focus,
.vocab-panel {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel-soft);
}

.word-card {
  margin-top: 12px;
  display: grid;
  gap: 12px;
}

.word-chip,
.feedback-chip {
  display: inline-flex;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.word-chip {
  background: var(--accent-soft);
  color: var(--accent);
}

.feedback-chip {
  background: #eef8f3;
  color: #11875d;
}

.feedback-chip.is-wrong {
  background: #fff1ef;
  color: #d44c4c;
}

.focus-word {
  font-size: clamp(2rem, 4vw, 2.7rem);
  line-height: 1.02;
}

.focus-meaning,
.overlay-meaning {
  margin: 6px 0 0;
  font-size: 1rem;
  font-weight: 700;
}

.focus-phonetic,
.overlay-phonetic {
  margin: 4px 0 0;
  color: var(--accent);
  font-weight: 700;
}

.focus-empty {
  display: grid;
  gap: 8px;
}

.scene-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  margin-top: 14px;
}

.scene-hint {
  max-width: 300px;
  padding: 11px 13px;
  border-radius: 14px;
  background: #f6efe4;
  color: var(--ink);
  font-weight: 700;
  line-height: 1.5;
}

.scene-switcher {
  margin-top: 14px;
}

.theme-tabs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  margin-top: 10px;
  padding-bottom: 2px;
  scroll-snap-type: x mandatory;
}

.theme-tab {
  flex: 0 0 208px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  scroll-snap-align: start;
}

.theme-tab.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.theme-tab strong {
  display: block;
  font-size: 1rem;
}

.theme-tab span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

.theme-clue {
  margin-top: 10px;
  color: var(--accent);
  font-weight: 700;
}

.vocab-content.is-collapsed {
  display: none;
}

.vocab-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  max-height: 620px;
  overflow: auto;
  padding-right: 4px;
}

.vocab-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.vocab-item.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.vocab-item strong {
  display: block;
  font-size: 0.98rem;
  line-height: 1.35;
}

.vocab-item em {
  font-style: normal;
  color: var(--accent);
  font-weight: 700;
}

.speak-row,
.overlay-actions,
.mini-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.speak-btn,
.secondary-btn,
.overlay-tool,
.overlay-reopen,
.list-toggle,
.overlay-tab,
.mini-btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 150ms ease, opacity 150ms ease;
  font-weight: 700;
}

.speak-btn,
.secondary-btn,
.overlay-reopen,
.list-toggle,
.mini-btn {
  min-height: 40px;
  padding: 0 15px;
}

.overlay-tool,
.overlay-tab {
  min-height: 34px;
  padding: 0 12px;
}

.speak-btn {
  background: var(--ink);
  color: #fff;
}

.secondary-btn,
.overlay-tool,
.overlay-reopen,
.list-toggle,
.mini-btn {
  background: var(--accent-soft);
  color: var(--accent);
}

.overlay-tab {
  background: transparent;
  color: var(--muted);
}

.overlay-tab.is-active {
  background: var(--accent-soft);
  color: var(--accent);
}

.speak-btn:hover,
.secondary-btn:hover,
.overlay-tool:hover,
.overlay-reopen:hover,
.list-toggle:hover,
.mini-btn:hover,
.overlay-tab:hover,
.speak-btn:focus-visible,
.secondary-btn:focus-visible,
.overlay-tool:focus-visible,
.overlay-reopen:focus-visible,
.list-toggle:focus-visible,
.mini-btn:focus-visible,
.overlay-tab:focus-visible {
  transform: translateY(-1px);
  outline: none;
}

.wordlab-sheet {
  margin: 14px 0 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-soft);
  overflow: hidden;
}

.ad-note,
.footer-copy,
.content-copy,
.content-list li,
.contact-line,
.tool-card p,
.disclosure-box p {
  color: var(--muted);
  line-height: 1.65;
}

.ad-slot-grid,
.tool-grid {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.ad-slot-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ad-slot-card,
.tool-card,
.disclosure-box {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel-soft);
  padding: 16px;
}

.ad-slot-label,
.tool-card h3,
.content-panel h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: var(--ink);
}

.ad-slot-copy,
.tool-card p {
  margin: 10px 0 0;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
  margin-top: 18px;
  padding: 18px 4px 4px;
}

.footer-copy {
  margin: 8px 0 0;
  max-width: 420px;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
}

.footer-nav a,
.tool-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

.footer-nav a:hover,
.tool-link:hover {
  text-decoration: underline;
}

.content-shell {
  width: min(880px, calc(100vw - 32px));
}

.content-main {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.content-panel h1,
.content-panel h2 {
  margin: 0;
  color: var(--ink);
  letter-spacing: 0;
}

.content-panel h1 {
  font-size: clamp(1.7rem, 3vw, 2.4rem);
}

.content-panel h2 {
  font-size: 1.1rem;
  margin-bottom: 12px;
}

.content-copy {
  margin: 10px 0 0;
}

.content-list {
  margin: 12px 0 0;
  padding-left: 20px;
}

.content-list li + li {
  margin-top: 8px;
}

.contact-block + .contact-block,
.disclosure-box + .tool-grid,
.disclosure-box + .content-list {
  margin-top: 14px;
}

.contact-line {
  margin: 8px 0 0;
}

.tool-meta {
  display: inline-flex;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
}

.lab-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
}

.lab-row:first-child {
  border-top: 0;
}

.lab-row dt {
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 700;
}

.lab-row dd {
  margin: 0;
  font-size: 0.96rem;
}

.lab-row:first-child dd {
  color: var(--ink);
  font-size: 1.24rem;
  font-weight: 800;
}

.mobile-overlay {
  display: none;
}

.overlay-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.overlay-tabs {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  background: #f2f4f7;
}

.overlay-body {
  margin-top: 10px;
}

.overlay-card {
  display: grid;
  gap: 10px;
}

.overlay-word {
  font-size: 1.62rem;
  line-height: 1.04;
}

.overlay-stat {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.overlay-feedback {
  min-height: 22px;
}

.overlay-feedback strong {
  font-size: 0.9rem;
}

.overlay-reopen {
  display: none;
}

@media (max-width: 980px) {
  .learning-layout,
  .scene-footer {
    grid-template-columns: 1fr;
  }

  .ad-slot-grid,
  .tool-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .page-shell {
    width: calc(100vw - 12px);
    padding-top: 8px;
    padding-bottom: 28px;
  }

  .topbar,
  .scene-panel,
  .wordlab-panel,
  .ad-panel,
  .content-panel {
    padding: 12px;
    border-radius: 18px;
  }

  .topbar h1 {
    margin-top: 4px;
    font-size: 1.2rem;
    line-height: 1.16;
  }

  .lead,
  .scene-mood,
  .desktop-focus,
  .desktop-rail,
  .scene-footer {
    display: none;
  }

  .eyebrow,
  .section-kicker {
    font-size: 0.72rem;
  }

  .scene-topline,
  .section-heading {
    flex-direction: column;
    align-items: start;
  }

  .scene-topline h2,
  .section-heading h2 {
    font-size: 1.08rem;
  }

  .scene-stage {
    margin-top: 10px;
  }

  .scene-tip {
    left: 10px;
    top: 10px;
    padding: 6px 10px;
    font-size: 0.74rem;
  }

  .scene-switcher {
    margin-top: 12px;
  }

  .theme-tabs {
    margin-top: 8px;
  }

  .theme-tab {
    flex-basis: 148px;
    padding: 11px 12px;
  }

  .theme-tab span {
    font-size: 0.82rem;
  }

  .mobile-overlay {
    display: block;
    position: sticky;
    bottom: 8px;
    z-index: 8;
    margin-top: 10px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 10px 24px rgba(18, 29, 51, 0.12);
  }

  .mobile-overlay.is-hidden {
    display: none;
  }

  .overlay-reopen {
    display: inline-flex;
    margin-top: 10px;
  }

  .overlay-reopen.is-hidden {
    display: none;
  }

  .overlay-word {
    font-size: 1.38rem;
  }

  .overlay-actions .speak-btn,
  .overlay-actions .secondary-btn,
  .mini-nav .mini-btn {
    min-height: 36px;
    padding: 0 12px;
  }

  .wordlab-panel {
    margin-top: 2px;
  }

  .site-footer {
    flex-direction: column;
    padding: 16px 4px 4px;
  }

  .footer-nav {
    gap: 10px 14px;
  }

  .content-shell {
    width: calc(100vw - 12px);
  }

  .lab-row {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
  }

  .lab-row dt,
  .lab-row dd {
    font-size: 0.9rem;
  }

  .lab-row:first-child dd {
    font-size: 1.1rem;
  }
}
