:root {
  --ink: #142521;
  --deep: #102b25;
  --forest: #17473b;
  --mint: #dcebe4;
  --cream: #f5f1e8;
  --paper: #fffdf8;
  --line: rgba(20, 37, 33, 0.14);
  --muted: #68756f;
  --lime: #c8ff5a;
  --orange: #f38c59;
  --blue: #a8d8ff;
  --shadow: 0 24px 70px rgba(16, 43, 37, 0.12);
  --radius: 22px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--cream);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.boot-screen {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 28px;
  color: white;
  background: var(--deep);
  text-align: center;
}
.boot-screen span { max-width: 520px; color: rgba(255,255,255,.65); line-height: 1.7; }
.boot-screen button { margin-top: 8px; padding: 11px 18px; border: 0; border-radius: 999px; color: var(--deep); background: var(--lime); font-weight: 700; }
.boot-mark { display: grid; place-items: center; width: 58px; height: 58px; margin-bottom: 6px; border-radius: 50%; color: var(--deep); background: var(--lime); font: 700 31px Georgia, serif; }
.boot-error .boot-mark { background: var(--orange); }

button, input, textarea { font: inherit; }
button { color: inherit; }
a { color: inherit; }

.app-shell { min-height: 100vh; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 0 5vw;
  color: white;
  background: rgba(16, 43, 37, 0.95);
  backdrop-filter: blur(14px);
}

.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--deep);
  background: var(--lime);
  border-radius: 50%;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 23px;
}
.brand-copy small { display: block; margin-top: 1px; color: rgba(255,255,255,.55); font-size: 10px; letter-spacing: .12em; }

.header-actions { display: flex; align-items: center; gap: 10px; }
.progress-chip, .demo-chip {
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 999px;
  color: rgba(255,255,255,.8);
  font-size: 12px;
}
.demo-chip { color: var(--lime); }

.text-button, .ghost-button, .primary-button, .audio-button, .record-button {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease, opacity .2s ease;
}
.text-button:hover, .ghost-button:hover, .primary-button:hover, .audio-button:hover, .record-button:hover { transform: translateY(-1px); }
.text-button { padding: 9px 12px; color: white; background: transparent; }
.ghost-button { padding: 12px 17px; border: 1px solid var(--line); background: transparent; }
.primary-button { padding: 13px 20px; color: var(--deep); background: var(--lime); font-weight: 700; }
.primary-button.dark { color: white; background: var(--deep); }
.full { width: 100%; }

.welcome {
  min-height: calc(100vh - 72px);
  color: white;
  background:
    radial-gradient(circle at 82% 18%, rgba(200,255,90,.18), transparent 25%),
    linear-gradient(135deg, #102b25 0%, #143f34 58%, #0f3028 100%);
}
.welcome-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr);
  gap: 5vw;
  align-items: center;
  width: min(1180px, 90vw);
  margin: 0 auto;
  padding: 8vh 0 7vh;
}
.eyebrow { margin: 0 0 18px; color: var(--orange); font-size: 12px; font-weight: 700; letter-spacing: .16em; }
.welcome h1 {
  max-width: 760px;
  margin: 0;
  font-family: Georgia, "Songti SC", "STSong", serif;
  font-size: clamp(50px, 7vw, 96px);
  font-weight: 600;
  line-height: .98;
  letter-spacing: -.045em;
}
.welcome h1 span { color: var(--lime); }
.hero-copy { max-width: 610px; margin: 28px 0; color: rgba(255,255,255,.72); font-size: 18px; line-height: 1.8; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-actions .ghost-button { color: white; border-color: rgba(255,255,255,.24); }

.hero-proof {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 46px;
}
.proof-item { padding-top: 16px; border-top: 1px solid rgba(255,255,255,.16); }
.proof-item strong { display: block; color: var(--lime); font-family: Georgia, "Times New Roman", serif; font-size: 34px; }
.proof-item span { color: rgba(255,255,255,.55); font-size: 12px; }

.hero-card {
  position: relative;
  padding: 28px;
  color: var(--ink);
  background: var(--paper);
  border-radius: 28px;
  box-shadow: 0 35px 100px rgba(0,0,0,.22);
  transform: rotate(1.5deg);
}
.hero-card::before {
  content: "";
  position: absolute;
  inset: 12px -12px -12px 12px;
  z-index: -1;
  border: 1px solid rgba(200,255,90,.45);
  border-radius: 28px;
}
.hero-card-top { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; letter-spacing: .1em; }
.wave { display: flex; align-items: center; gap: 4px; height: 52px; margin: 36px 0 22px; }
.wave i { display: block; width: 4px; height: var(--h); background: var(--forest); border-radius: 4px; }
.hero-card h3 { margin: 0 0 12px; font-family: Georgia, "Times New Roman", serif; font-size: 29px; line-height: 1.12; }
.hero-card p { color: var(--muted); line-height: 1.7; }
.mini-flow { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 24px; }
.mini-flow span { padding: 7px 10px; background: var(--mint); border-radius: 999px; font-size: 11px; }

.welcome-bottom { padding: 18px 5vw 22px; border-top: 1px solid rgba(255,255,255,.1); color: rgba(255,255,255,.45); font-size: 11px; text-align: center; }

.dashboard { width: min(1220px, 91vw); margin: 0 auto; padding: 50px 0 80px; }
.dashboard-hero { display: grid; grid-template-columns: 1.4fr .6fr; gap: 24px; align-items: end; margin-bottom: 34px; }
.dashboard-hero h1 { margin: 6px 0 12px; font-family: Georgia, "Songti SC", "STSong", serif; font-size: clamp(42px, 6vw, 74px); line-height: 1; }
.dashboard-hero p { max-width: 690px; color: var(--muted); line-height: 1.7; }
.today-score { padding: 24px; background: var(--deep); color: white; border-radius: var(--radius); }
.today-score span { color: rgba(255,255,255,.58); font-size: 12px; }
.today-score strong { display: block; margin: 4px 0; color: var(--lime); font-family: Georgia, "Times New Roman", serif; font-size: 52px; }

.edition-switch { display: flex; flex-wrap: wrap; gap: 9px; margin: 0 0 22px; }
.edition-switch button { padding: 10px 15px; border: 1px solid var(--line); border-radius: 999px; background: transparent; cursor: pointer; }
.edition-switch button.active { color: white; border-color: var(--forest); background: var(--forest); }
.feed-note { margin: -12px 0 24px; color: var(--muted); font-size: 12px; line-height: 1.6; }

.topic-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 10px; margin-bottom: 28px; scrollbar-width: none; }
.topic-strip::-webkit-scrollbar { display: none; }
.topic-button { flex: 0 0 auto; padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; background: transparent; cursor: pointer; }
.topic-button.active { color: white; background: var(--deep); border-color: var(--deep); }

.news-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.news-card {
  grid-column: span 4;
  display: flex;
  min-height: 330px;
  flex-direction: column;
  padding: 23px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform .24s ease, box-shadow .24s ease, border-color .24s ease;
}
.news-card:nth-child(1), .news-card:nth-child(6) { grid-column: span 6; }
.news-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: rgba(20,71,59,.32); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tag { display: inline-flex; padding: 6px 9px; color: var(--forest); background: var(--mint); border-radius: 999px; font-size: 11px; font-weight: 700; }
.region { color: var(--muted); font-size: 11px; }
.news-card h2 { margin: 26px 0 10px; font-family: Georgia, "Times New Roman", serif; font-size: 29px; line-height: 1.07; }
.news-card h3 { margin: 0; color: var(--muted); font-size: 14px; font-weight: 500; line-height: 1.55; }
.card-source { margin: 18px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.card-spacer { flex: 1; }
.card-meta { display: flex; justify-content: space-between; margin-top: 24px; padding-top: 17px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.done-mark { color: var(--forest); font-weight: 700; }

.lesson { background: var(--paper); min-height: calc(100vh - 72px); }
.lesson-shell { width: min(1180px, 92vw); margin: 0 auto; padding: 36px 0 80px; }
.back-button { margin-bottom: 24px; border: 0; background: transparent; cursor: pointer; color: var(--muted); }
.lesson-heading { display: grid; grid-template-columns: 1.35fr .65fr; gap: 45px; padding: 34px 0 45px; border-bottom: 1px solid var(--line); }
.lesson-heading h1 { margin: 12px 0 10px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(42px, 6vw, 70px); line-height: .98; }
.lesson-heading h2 { margin: 0; color: var(--muted); font-size: 19px; font-weight: 500; }
.lesson-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.lesson-meta span { padding: 7px 10px; background: var(--mint); border-radius: 999px; font-size: 11px; }
.source-box { align-self: stretch; padding: 22px; color: white; background: var(--deep); border-radius: var(--radius); }
.source-box strong { display: block; margin-bottom: 15px; color: var(--lime); }
.source-box a { display: block; margin: 10px 0; color: rgba(255,255,255,.78); font-size: 13px; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.source-box small { display: block; margin-top: 16px; color: rgba(255,255,255,.45); line-height: 1.6; }

.learning-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 42px; margin-top: 42px; }
.lesson-nav { position: sticky; top: 105px; align-self: start; }
.step-nav { display: grid; gap: 9px; }
.step-nav button { padding: 13px 14px; border: 0; border-radius: 12px; background: transparent; text-align: left; cursor: pointer; }
.step-nav button.active { background: var(--mint); color: var(--forest); font-weight: 700; }
.lesson-body { min-width: 0; }
.step-panel { padding: 0 0 54px; scroll-margin-top: 110px; }
.step-kicker { color: var(--orange); font-size: 11px; font-weight: 700; letter-spacing: .14em; }
.step-panel h3 { margin: 8px 0 14px; font-family: Georgia, "Songti SC", "STSong", serif; font-size: 38px; }
.muted { color: var(--muted); line-height: 1.7; }

.player { margin: 24px 0; padding: 24px; color: white; background: var(--deep); border-radius: var(--radius); }
.player-top { display: flex; align-items: center; gap: 16px; }
.audio-button { display: grid; place-items: center; width: 54px; height: 54px; color: var(--deep); background: var(--lime); font-size: 18px; }
.player-copy strong { display: block; }
.player-copy span { color: rgba(255,255,255,.55); font-size: 12px; }
.speed-row { display: flex; gap: 7px; margin-top: 18px; }
.speed-row button { padding: 6px 10px; color: rgba(255,255,255,.62); border: 1px solid rgba(255,255,255,.15); border-radius: 999px; background: transparent; cursor: pointer; }
.speed-row button.active { color: var(--deep); background: white; }

.transcript-card, .summary-card, .speak-card, .feedback-card {
  padding: 25px;
  background: #f7f5ee;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.transcript-card.blind .transcript-text { filter: blur(7px); user-select: none; }
.transcript-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.transcript-text { font-family: Georgia, "Times New Roman", serif; font-size: 21px; line-height: 1.85; transition: filter .2s ease; }
.transcript-text button { display: inline; padding: 0 2px; border: 0; border-bottom: 2px solid var(--orange); background: transparent; font: inherit; cursor: pointer; }

.impact-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin: 22px 0; }
.impact-node { max-width: 180px; padding: 13px 15px; background: var(--mint); border-radius: 14px; font-size: 13px; line-height: 1.5; }
.impact-arrow { color: var(--orange); font-weight: 700; }

.vocab-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.vocab-card { padding: 17px; border: 1px solid var(--line); border-radius: 16px; background: white; cursor: pointer; text-align: left; }
.vocab-card strong { display: block; font-family: Georgia, "Times New Roman", serif; font-size: 24px; }
.vocab-card span { color: var(--muted); font-size: 12px; }

.prompt-list { display: grid; gap: 10px; margin: 18px 0 22px; }
.prompt-list div { padding: 14px 16px; background: var(--mint); border-radius: 14px; }
.record-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 15px; }
.record-button { padding: 13px 18px; color: white; background: var(--forest); }
.record-button.recording { background: #bd3e3e; animation: pulse 1.1s infinite; }
@keyframes pulse { 50% { opacity: .65; } }
.speech-input { width: 100%; min-height: 150px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: white; resize: vertical; line-height: 1.65; }
.feedback-card { margin-top: 16px; border-color: rgba(23,71,59,.28); }
.feedback-card h4 { margin: 0 0 10px; }
.feedback-meter { display: flex; gap: 5px; margin: 14px 0; }
.feedback-meter i { flex: 1; height: 7px; background: #d9dedb; border-radius: 999px; }
.feedback-meter i.on { background: var(--forest); }

.word-dialog, .auth-dialog, .install-dialog {
  width: min(520px, 90vw);
  padding: 32px;
  border: 0;
  border-radius: 24px;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.fallback-open { position: fixed; inset: 50% auto auto 50%; z-index: 100; display: block; max-height: 88vh; overflow-y: auto; transform: translate(-50%, -50%); }
.fallback-open::before { content: ""; position: fixed; inset: 0; z-index: -1; background: rgba(10, 28, 24, .72); }
dialog::backdrop { background: rgba(10, 28, 24, .72); backdrop-filter: blur(6px); }
.dialog-close { position: absolute; top: 16px; right: 16px; }
.icon-button { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--mint); cursor: pointer; font-size: 22px; }
.word-dialog h2 { margin: 8px 0 0; font-family: Georgia, "Times New Roman", serif; font-size: 45px; }
.phonetic { color: var(--muted); }
.word-section { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.word-section strong { display: block; margin-bottom: 7px; font-size: 12px; letter-spacing: .08em; }
.auth-dialog h2, .install-dialog h2 { margin: 0; font-family: Georgia, "Songti SC", "STSong", serif; font-size: 38px; }
.auth-form { display: grid; gap: 15px; margin-top: 24px; }
.auth-form label { display: grid; gap: 7px; font-size: 13px; font-weight: 600; }
.auth-form input { width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.auth-notice { min-height: 22px; color: var(--forest); font-size: 13px; line-height: 1.5; }
.install-icon { width: 76px; height: 76px; margin-bottom: 22px; border-radius: 20px; box-shadow: 0 12px 28px rgba(16,43,37,.16); }
.install-steps { display: grid; gap: 10px; margin: 22px 0 0; padding: 0; list-style: none; counter-reset: install; }
.install-steps li { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start; padding: 12px; background: var(--mint); border-radius: 13px; line-height: 1.55; }
.install-steps li::before { counter-increment: install; content: counter(install); display: grid; place-items: center; width: 25px; height: 25px; color: white; background: var(--forest); border-radius: 50%; font-size: 12px; font-weight: 700; }

.empty-state { padding: 60px 20px; text-align: center; color: var(--muted); }

@media (max-width: 900px) {
  .welcome-grid, .dashboard-hero, .lesson-heading { grid-template-columns: 1fr; }
  .hero-card { max-width: 580px; transform: none; }
  .news-card, .news-card:nth-child(1), .news-card:nth-child(6) { grid-column: span 6; }
  .learning-grid { grid-template-columns: 1fr; }
  .lesson-nav { position: static; overflow-x: auto; }
  .step-nav { display: flex; min-width: max-content; }
}

@media (max-width: 620px) {
  .site-header { min-height: 64px; padding: 0 18px; }
  .brand-copy small, .progress-chip { display: none; }
  .brand { gap: 8px; }
  .brand-mark { width: 36px; height: 36px; }
  .demo-chip { display: none; }
  .header-actions { gap: 2px; }
  .header-actions .text-button { padding: 9px 8px; font-size: 13px; }
  .welcome { min-height: calc(100vh - 64px); }
  .welcome-grid { width: min(92vw, 520px); padding: 6vh 0; }
  .welcome h1 { font-size: 52px; }
  .hero-copy { font-size: 16px; }
  .hero-proof { gap: 7px; }
  .proof-item strong { font-size: 28px; }
  .hero-card { padding: 22px; }
  .hero-card::before { display: none; }
  .dashboard { width: 92vw; padding-top: 34px; }
  .dashboard-hero { margin-bottom: 24px; }
  .dashboard-hero h1 { font-size: 49px; }
  .news-card, .news-card:nth-child(1), .news-card:nth-child(6) { grid-column: 1 / -1; min-height: 280px; }
  .lesson-shell { width: 90vw; padding-top: 24px; }
  .lesson-heading { gap: 22px; padding-top: 18px; }
  .lesson-heading h1 { font-size: 44px; }
  .learning-grid { gap: 26px; margin-top: 28px; }
  .step-panel h3 { font-size: 33px; }
  .transcript-text { font-size: 19px; }
  .vocab-grid { grid-template-columns: 1fr; }
  .word-dialog, .auth-dialog, .install-dialog { padding: 25px; }
}
