:root {
  --ink: #17324a;
  --muted: #718397;
  --navy: #123b5d;
  --teal: #13a89e;
  --teal-soft: #e5f7f4;
  --gold: #f4b63f;
  --coral: #f17f68;
  --paper: #f5f8fb;
  --white: #fff;
  --line: #dfe8ee;
  --shadow: 0 12px 30px rgba(28, 69, 94, .10);
}

* { box-sizing: border-box; }
html { background: #dce7ec; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; }
.app-shell { width: min(520px, 100vw); min-height: 100vh; margin: 0 auto; background: var(--paper); position: relative; overflow-x: hidden; }
.topbar {
  height: 72px;
  padding: max(12px, env(safe-area-inset-top)) 20px 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(245,248,251,.94);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
}
.avatar, .icon-button {
  width: 42px; height: 42px; border: 0; border-radius: 14px;
  background: var(--navy); color: white; font-weight: 800; cursor: pointer;
}
.icon-button { margin-left: auto; color: var(--navy); background: white; border: 1px solid var(--line); }
.brand { display: grid; font-size: 18px; font-weight: 800; line-height: 1.1; }
.brand small { font-size: 9px; letter-spacing: .18em; color: var(--teal); margin-top: 4px; }
main { padding: 10px 18px 110px; min-height: calc(100vh - 72px); }
.bottom-nav {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(520px, 100vw); height: calc(72px + env(safe-area-inset-bottom));
  padding: 8px 8px env(safe-area-inset-bottom); display: grid; grid-template-columns: repeat(5,1fr);
  background: rgba(255,255,255,.96); border-top: 1px solid var(--line); backdrop-filter: blur(14px); z-index: 30;
}
.bottom-nav button { border: 0; background: none; color: #8a99a7; font-size: 11px; display: grid; place-items: center; gap: 3px; cursor: pointer; }
.bottom-nav span { font-size: 20px; font-weight: 800; line-height: 1; }
.bottom-nav button.active { color: var(--teal); }
.eyebrow { color: var(--teal); font-weight: 800; font-size: 12px; letter-spacing: .08em; }
h1 { font-size: 28px; line-height: 1.25; margin: 8px 0 6px; }
h2 { font-size: 20px; margin: 0; }
p { line-height: 1.65; }
.muted { color: var(--muted); }
.hero {
  color: white; padding: 24px; border-radius: 26px; overflow: hidden; position: relative;
  background: linear-gradient(140deg, #123b5d 15%, #17617b 62%, #13a89e 130%); box-shadow: var(--shadow);
}
.hero::after { content:""; width: 150px; height: 150px; border: 28px solid rgba(255,255,255,.08); border-radius: 50%; position: absolute; right: -62px; top: -62px; }
.hero .eyebrow { color: #8ee9df; }
.hero h1 { max-width: 300px; }
.hero p { margin: 0 0 18px; color: #d8edf3; font-size: 14px; }
.progress { height: 8px; border-radius: 99px; background: rgba(255,255,255,.18); overflow: hidden; }
.progress > i { display:block; height:100%; width: var(--value, 0%); background: var(--gold); border-radius: inherit; }
.progress-row { display:flex; justify-content:space-between; font-size:12px; margin: 8px 0; color:#d8edf3; }
.primary, .secondary, .answer {
  border: 0; border-radius: 15px; min-height: 48px; padding: 0 18px; font-weight: 800; cursor: pointer;
}
.primary { background: var(--gold); color: #42300d; box-shadow: 0 8px 18px rgba(244,182,63,.25); }
.secondary { background: white; color: var(--navy); border: 1px solid var(--line); }
.section-head { display:flex; justify-content:space-between; align-items:end; margin: 26px 2px 13px; }
.section-head button { border:0; background:none; color:var(--teal); font-weight:700; cursor:pointer; }
.quick-grid { display:grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.quick-card { min-width:0; border:0; padding:16px 10px; background:white; border-radius:18px; box-shadow:var(--shadow); color:var(--ink); text-align:left; cursor:pointer; }
.quick-card b { display:block; font-size:14px; margin-top:10px; }
.quick-card small { display:block; color:var(--muted); margin-top:4px; }
.quick-icon { width:38px; height:38px; border-radius:13px; display:grid; place-items:center; background:var(--teal-soft); color:var(--teal); font-weight:900; }
.course-card { background:white; border-radius:22px; padding:18px; display:grid; grid-template-columns:64px 1fr; gap:14px; box-shadow:var(--shadow); margin-bottom:12px; cursor:pointer; }
.course-cover { border-radius:17px; display:grid; place-items:center; color:white; font-size:25px; font-weight:900; background:linear-gradient(145deg,var(--teal),#2bc6b9); }
.course-card.nce .course-cover { background:linear-gradient(145deg,var(--navy),#457aa3); }
.course-card h3 { margin:2px 0 5px; font-size:16px; }
.course-card p { margin:0; font-size:12px; color:var(--muted); }
.mini-progress { margin-top:12px; height:6px; border-radius:9px; background:#edf2f5; overflow:hidden; }
.mini-progress i { display:block; width:var(--value); height:100%; background:var(--teal); }
.stats { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin-top:14px; }
.stat { min-width:0; background:white; border-radius:18px; padding:15px 6px; text-align:center; border:1px solid var(--line); }
.stat strong { display:block; font-size:22px; color:var(--navy); }
.stat small { color:var(--muted); }
.page-title { margin: 8px 2px 20px; }
.page-title h1 { margin-bottom:4px; }
.filter-row { display:flex; gap:8px; overflow:auto; padding:0 0 12px; scrollbar-width:none; }
.chip { white-space:nowrap; border:1px solid var(--line); background:white; color:var(--muted); border-radius:99px; padding:9px 14px; font-weight:700; cursor:pointer; }
.chip.active { color:white; background:var(--navy); border-color:var(--navy); }
.lesson-list { display:grid; gap:10px; }
.lesson { width:100%; border:1px solid var(--line); background:white; border-radius:18px; padding:16px; text-align:left; display:grid; grid-template-columns:44px 1fr auto; gap:12px; align-items:center; cursor:pointer; }
.lesson-num { width:44px; height:44px; display:grid; place-items:center; border-radius:14px; background:var(--teal-soft); color:var(--teal); font-weight:900; }
.lesson h3 { font-size:15px; margin:0 0 5px; }
.lesson p { margin:0; font-size:12px; color:var(--muted); }
.lesson .status { color:var(--gold); font-size:18px; }
.word-stage { text-align:center; background:white; border-radius:26px; padding:28px 22px; box-shadow:var(--shadow); }
.word-count { font-size:12px; color:var(--muted); }
.word { font-size:38px; margin:28px 0 2px; color:var(--navy); }
.phonetic { color:var(--teal); }
.meaning { font-size:20px; margin:26px 0; min-height:32px; }
.word-actions { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.answer-grid { display:grid; gap:10px; margin-top:18px; }
.answer { background:white; border:1px solid var(--line); color:var(--ink); text-align:left; }
.answer.correct { border-color:var(--teal); background:var(--teal-soft); color:#08776f; }
.answer.wrong { border-color:var(--coral); background:#fff0ed; color:#a74131; }
.study-top { display:flex; justify-content:space-between; align-items:center; gap:14px; }
.study-top .progress { flex:1; background:#e5edf2; }
.study-top .close { border:0; background:none; font-size:22px; color:var(--muted); }
.study-card { margin-top:22px; background:white; padding:24px; border-radius:24px; box-shadow:var(--shadow); }
.study-card .sentence { font-size:26px; line-height:1.45; color:var(--navy); }
.translation { border-top:1px dashed var(--line); padding-top:16px; color:var(--muted); }
.record { width:72px; height:72px; margin:20px auto; border-radius:50%; border:8px solid #dff6f2; background:var(--teal); color:white; display:grid; place-items:center; font-size:26px; cursor:pointer; }
.record.recording { background:var(--coral); border-color:#ffe1db; animation:pulse 1.2s infinite; }
.record-result { margin-top:16px; padding:14px; border-radius:15px; background:#f3f8fa; color:var(--muted); text-align:left; font-size:13px; line-height:1.6; }
.record-result strong { color:var(--navy); }
.record-result audio { width:100%; height:38px; margin-top:10px; }
@keyframes pulse { 50% { transform:scale(1.07); box-shadow:0 0 0 10px rgba(241,127,104,.12); } }
.study-footer { display:grid; grid-template-columns:1fr 1.4fr; gap:10px; margin-top:18px; }
.empty { text-align:center; padding:44px 24px; background:white; border-radius:24px; border:1px dashed var(--line); }
.empty .symbol { font-size:42px; color:var(--teal); }
.toast { position:fixed; left:50%; bottom:92px; transform:translate(-50%,20px); background:#18384c; color:white; padding:11px 18px; border-radius:99px; opacity:0; pointer-events:none; transition:.2s; z-index:60; font-size:13px; }
.toast.show { opacity:1; transform:translate(-50%,0); }
.auth-screen { position:fixed; inset:0; z-index:100; background:linear-gradient(150deg,#e8f3f5,#f7fafc 55%,#e5f7f4); display:grid; place-items:center; padding:22px; overflow:auto; }
.auth-screen[hidden] { display:none; }
.auth-card { width:min(100%,420px); background:white; border-radius:28px; padding:28px; box-shadow:0 22px 70px rgba(23,50,74,.16); }
.auth-logo { width:64px; height:64px; border-radius:21px; display:grid; place-items:center; color:white; font-size:28px; font-weight:900; background:linear-gradient(145deg,var(--navy),var(--teal)); }
.auth-card h1 { margin-top:18px; }
.auth-card form { display:grid; gap:13px; margin-top:24px; }
.field { display:grid; gap:7px; color:var(--ink); font-size:13px; font-weight:700; }
.field input { width:100%; height:50px; padding:0 15px; border:1px solid var(--line); border-radius:14px; outline:none; font-size:16px; color:var(--ink); background:#fbfdfe; }
.field input:focus { border-color:var(--teal); box-shadow:0 0 0 3px rgba(19,168,158,.12); }
.auth-card .primary { width:100%; margin-top:5px; }
.auth-links { display:flex; justify-content:space-between; align-items:center; margin-top:18px; gap:10px; }
.auth-link { border:0; background:none; color:var(--teal); font-weight:700; cursor:pointer; padding:7px 0; }
.auth-error { min-height:20px; color:#b44737; font-size:13px; margin-top:10px; }
.recovery-box { padding:16px; border-radius:16px; background:var(--teal-soft); border:1px dashed var(--teal); margin:18px 0; text-align:center; }
.recovery-code { display:block; font-size:21px; letter-spacing:.08em; color:var(--navy); margin:8px 0; user-select:all; }
.account-row { border:1px solid var(--line); border-radius:16px; padding:14px; margin:16px 0; }
@media (min-width: 700px) { body { padding:20px 0; } .app-shell { min-height:calc(100vh - 40px); border-radius:28px; overflow:hidden; box-shadow:0 20px 60px rgba(23,50,74,.16); } }
