:root {
  --navy: #0b1f3a;
  --navy-2: #142f52;
  --teal: #0f8b8d;
  --teal-deep: #087174;
  --teal-soft: #def4f3;
  --orange: #f4a261;
  --orange-deep: #c86f2b;
  --orange-soft: #fff1e3;
  --paper: #f5f8fb;
  --white: #ffffff;
  --ink: #1f2a3a;
  --muted: #65748b;
  --line: #dbe2eb;
  --danger: #c94949;
  --success: #2f8f66;
  --shadow: 0 14px 38px rgba(20, 47, 82, .10);
  --radius: 22px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: #e8eef4; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 4%, rgba(15,139,141,.10), transparent 28%),
    radial-gradient(circle at 90% 0%, rgba(244,162,97,.10), transparent 24%),
    #e8eef4;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 3px solid rgba(15,139,141,.28); outline-offset: 2px; }
.hidden { display: none !important; }
.app-frame {
  position: relative;
  width: min(100%, 480px);
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--paper);
  box-shadow: 0 0 70px rgba(11,31,58,.14);
  overflow-x: hidden;
}
.login-screen { min-height: 100dvh; background: var(--paper); }
.login-hero {
  position: relative;
  min-height: 410px;
  padding: calc(28px + env(safe-area-inset-top, 0px)) 28px 48px;
  overflow: hidden;
  background:
    radial-gradient(circle at 85% 15%, rgba(15,139,141,.35), transparent 28%),
    linear-gradient(145deg, #0b1f3a 0%, #102c4f 68%, #14395e 100%);
  color: var(--white);
}
.login-hero::after {
  content: "";
  position: absolute;
  right: -112px;
  bottom: -150px;
  width: 310px;
  height: 310px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 50%;
  box-shadow: 0 0 0 38px rgba(255,255,255,.025), 0 0 0 76px rgba(255,255,255,.018);
}
.brand-mark {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border-radius: 15px;
  background: var(--teal);
  color: var(--white);
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -.06em;
}
.brand-mark.small { width: 38px; height: 38px; border-radius: 12px; font-size: 13px; flex: 0 0 auto; }
.eyebrow {
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .15em;
  text-transform: uppercase;
}
.eyebrow.teal { color: var(--teal); }
.login-hero .eyebrow { margin-top: 28px; color: #86d2d1; letter-spacing: .16em; }
.login-hero h1 {
  margin: 0;
  font-size: clamp(38px, 10vw, 52px);
  line-height: 1.08;
  letter-spacing: -.055em;
}
.login-hero h1 span { color: var(--orange); }
.hero-copy { max-width: 370px; margin: 20px 0 24px; color: #bfd1e5; font-size: 15px; line-height: 1.75; }
.route-mini { position: relative; display: flex; align-items: center; gap: 3px; max-width: 385px; }
.route-mini span {
  display: grid;
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  background: rgba(15,139,141,.28);
  color: #bce9e8;
  font-size: 11px;
  font-weight: 900;
}
.route-mini i { height: 1px; flex: 1; background: rgba(244,162,97,.52); }
.login-card {
  position: relative;
  z-index: 2;
  margin: -30px 18px 32px;
  padding: 24px 22px 22px;
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 28px;
  background: rgba(255,255,255,.98);
  box-shadow: 0 20px 55px rgba(11,31,58,.18);
}
.login-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.login-card h2 { margin: 0; font-size: 23px; letter-spacing: -.03em; }
.text-size-btn, .icon-text-btn {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  color: var(--navy);
  font-size: 12px;
  font-weight: 800;
}
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; margin: 0 0 7px 3px; color: var(--navy); font-size: 13px; font-weight: 800; }
.field input {
  width: 100%;
  height: 54px;
  padding: 0 16px;
  border: 1.5px solid var(--line);
  border-radius: 15px;
  background: #f9fbfd;
  color: var(--ink);
  font-size: 17px;
  transition: border-color .18s, background .18s, box-shadow .18s;
}
.field input::placeholder { color: #a1adbd; }
.field input:focus { border-color: var(--teal); background: #fff; box-shadow: 0 0 0 4px rgba(15,139,141,.08); outline: none; }
.form-error { min-height: 20px; margin: -3px 0 8px; color: var(--danger); font-size: 13px; }
.primary-btn, .ghost-btn {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  border-radius: 15px;
  font-weight: 900;
  transition: transform .16s, opacity .16s, background .16s;
}
.primary-btn { border: 0; background: var(--teal); color: var(--white); box-shadow: 0 8px 19px rgba(15,139,141,.22); }
.primary-btn:active, .ghost-btn:active { transform: scale(.985); }
.primary-btn:hover { background: var(--teal-deep); }
.ghost-btn { margin-top: 10px; border: 1.5px solid var(--line); background: transparent; color: var(--navy); }
.ghost-btn:hover { background: #f3f7fa; }
.primary-btn.wide, .ghost-btn.wide { width: 100%; }
.login-help { margin: 16px 0 0; color: var(--muted); font-size: 12px; text-align: center; }
.main-screen { min-height: 100dvh; background: var(--paper); }
.app-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  min-height: 82px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(15px + env(safe-area-inset-top, 0px)) 18px 13px;
  border-bottom: 1px solid rgba(219,226,235,.7);
  background: rgba(247,250,252,.92);
  backdrop-filter: blur(16px);
}
.header-brand { display: flex; min-width: 0; align-items: center; gap: 11px; }
.header-kicker { margin: 0 0 1px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.header-brand h2 { overflow: hidden; margin: 0; color: var(--navy); font-size: 17px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.header-actions { display: flex; flex: 0 0 auto; gap: 6px; }
.main-content { padding: 22px 18px calc(100px + var(--safe-bottom)); }
.view { display: none; animation: liftIn .28s ease both; }
.view.active { display: block; }
@keyframes liftIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.welcome-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin: 4px 2px 18px; }
.welcome-row h1, .view-heading h1 { margin: 0; color: var(--navy); font-size: 28px; line-height: 1.24; letter-spacing: -.045em; }
.avatar {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 15px;
  background: var(--navy);
  color: var(--white);
  font-size: 17px;
  font-weight: 900;
}
.today-card { padding: 20px; border-radius: var(--radius); background: var(--navy); color: var(--white); box-shadow: var(--shadow); }
.today-card-head { display: flex; align-items: center; gap: 7px; color: #bcd0e5; font-size: 11px; font-weight: 700; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 4px rgba(244,162,97,.12); }
.today-time { margin-left: auto; color: #91a9c3; }
.today-main { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 14px 0 13px; }
.today-label { margin: 0; color: #a8bed4; font-size: 12px; }
.today-number { display: flex; align-items: baseline; gap: 5px; }
.today-number strong { font-size: 43px; line-height: 1.05; letter-spacing: -.06em; }
.today-number span { color: #a8bed4; font-size: 13px; font-weight: 700; }
.progress-ring {
  --p: 0;
  display: grid;
  width: 70px;
  height: 70px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--orange) calc(var(--p) * 1%), rgba(255,255,255,.12) 0);
  position: relative;
}
.progress-ring::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--navy); }
.progress-ring span { position: relative; z-index: 1; font-size: 13px; font-weight: 900; }
.route-strip { display: grid; grid-template-columns: repeat(8, 1fr); gap: 3px; margin: 12px 0 18px; }
.route-strip span {
  display: grid;
  height: 28px;
  place-items: center;
  border-radius: 8px;
  background: rgba(255,255,255,.07);
  color: #8daac7;
  font-size: 11px;
  font-weight: 900;
}
.route-strip span.done { background: rgba(15,139,141,.35); color: #b8efed; }
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0 26px; }
.metric-card { min-width: 0; padding: 15px 12px; border: 1px solid rgba(219,226,235,.8); border-radius: 17px; background: var(--white); box-shadow: 0 7px 21px rgba(20,47,82,.045); text-align: center; }
.metric-icon { display: grid; width: 29px; height: 29px; margin: 0 auto 7px; place-items: center; border-radius: 9px; font-size: 13px; font-weight: 900; }
.teal-bg { background: var(--teal-soft); color: var(--teal); }
.orange-bg { background: var(--orange-soft); color: var(--orange-deep); }
.navy-bg { background: #e9eef5; color: var(--navy); }
.metric-card strong { display: block; color: var(--navy); font-size: 24px; line-height: 1.15; letter-spacing: -.04em; }
.metric-card > span:last-child { color: var(--muted); font-size: 10px; font-weight: 700; }
.section-title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 0 2px 12px; }
.section-title-row h3, .subhead { margin: 0; color: var(--navy); font-size: 18px; letter-spacing: -.03em; }
.link-btn { border: 0; background: transparent; color: var(--teal); font-size: 12px; font-weight: 900; }
.station-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.station-card {
  position: relative;
  min-height: 104px;
  padding: 15px;
  overflow: hidden;
  border: 1px solid rgba(219,226,235,.85);
  border-radius: 18px;
  background: var(--white);
  text-align: left;
  box-shadow: 0 7px 20px rgba(20,47,82,.04);
}
.station-card::after { content: attr(data-route); position: absolute; right: -4px; bottom: -20px; color: rgba(15,139,141,.07); font-size: 70px; font-weight: 900; line-height: 1; }
.station-card b { display: block; margin-bottom: 4px; color: var(--navy); font-size: 15px; }
.station-card small { display: block; color: var(--muted); font-size: 10px; }
.station-card em { display: inline-block; margin-top: 10px; padding: 4px 8px; border-radius: 7px; background: var(--teal-soft); color: var(--teal); font-size: 10px; font-style: normal; font-weight: 900; }
.reminder-card { display: flex; align-items: center; gap: 11px; margin-top: 16px; padding: 14px; border: 1px solid #f0d9c2; border-radius: 17px; background: var(--orange-soft); }
.reminder-icon { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 10px; background: var(--orange); color: #fff; font-size: 12px; font-weight: 900; }
.reminder-card div { min-width: 0; flex: 1; }
.reminder-card strong { display: block; color: var(--navy); font-size: 12px; }
.reminder-card p { margin: 1px 0 0; color: #8a6a4d; font-size: 10px; }
.reminder-card button { border: 0; border-radius: 9px; padding: 7px 10px; background: var(--navy); color: #fff; font-size: 10px; font-weight: 900; }
.tip-card { margin-top: 16px; padding: 15px 17px; border-left: 3px solid var(--teal); border-radius: 0 14px 14px 0; background: #edf6f6; }
.tip-card span { color: var(--teal); font-size: 10px; font-weight: 900; letter-spacing: .08em; }
.tip-card p { margin: 4px 0 0; color: #3c5a60; font-size: 12px; line-height: 1.65; }
.view-heading { margin: 5px 2px 22px; }
.view-heading p:last-child { margin: 9px 0 0; color: var(--muted); font-size: 13px; }
.module-list { display: grid; gap: 11px; }
.module-card { display: flex; align-items: center; gap: 14px; width: 100%; padding: 16px; border: 1px solid rgba(219,226,235,.9); border-radius: 19px; background: var(--white); text-align: left; box-shadow: 0 7px 20px rgba(20,47,82,.04); }
.module-card-route { display: grid; width: 48px; height: 48px; flex: 0 0 auto; place-items: center; border-radius: 15px; background: var(--teal-soft); color: var(--teal); font-size: 19px; font-weight: 900; }
.module-card-main { min-width: 0; flex: 1; }
.module-card-main strong { display: block; color: var(--navy); font-size: 15px; }
.module-card-main span { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.module-card-meta { flex: 0 0 auto; text-align: right; }
.module-card-meta b { display: block; color: var(--teal); font-size: 15px; }
.module-card-meta small { color: var(--muted); font-size: 9px; }
.module-question-list { display: grid; gap: 7px; padding: 0 0 5px 63px; }
.question-row { display: flex; align-items: center; gap: 9px; padding: 10px 12px; border: 0; border-radius: 12px; background: #eef3f7; text-align: left; }
.question-row span { flex: 1; color: var(--ink); font-size: 12px; }
.status-pill { flex: 0 0 auto; padding: 3px 7px; border-radius: 6px; background: #dfe6ee; color: var(--muted); font-size: 8px; font-weight: 900; }
.status-pill.mastered { background: #dff3e8; color: var(--success); }
.status-pill.wrong { background: #fde8e8; color: var(--danger); }
.status-pill.learning { background: var(--orange-soft); color: var(--orange-deep); }
.empty-state { padding: 32px 20px; border: 1px dashed var(--line); border-radius: 20px; background: rgba(255,255,255,.55); text-align: center; }
.empty-state b { display: block; color: var(--navy); font-size: 18px; }
.empty-state p { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.stats-hero { display: flex; align-items: center; gap: 22px; padding: 21px; border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow); }
.progress-ring.large { width: 94px; height: 94px; background: conic-gradient(var(--teal) calc(var(--p) * 1%), #e7edf4 0); }
.progress-ring.large::before { inset: 9px; background: var(--white); }
.progress-ring.large span { color: var(--navy); font-size: 16px; }
.stats-hero > div:last-child strong { display: block; color: var(--navy); font-size: 26px; letter-spacing: -.04em; }
.stats-hero > div:last-child span { color: var(--muted); font-size: 12px; }
.stats-hero p { margin: 6px 0 0; color: var(--teal); font-size: 11px; font-weight: 800; }
.metric-grid.compact { margin: 12px 0 25px; }
.metric-grid.compact .metric-card { padding: 14px 8px; }
.metric-grid.compact .metric-card strong { font-size: 21px; }
.subhead { margin-bottom: 12px; }
.module-stat { margin-bottom: 12px; }
.module-stat-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; color: var(--navy); font-size: 11px; font-weight: 800; }
.module-stat-head span:last-child { color: var(--muted); }
.bar-track { height: 7px; overflow: hidden; border-radius: 9px; background: #e4eaf1; }
.bar-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--teal), #51b8b2); }
.training-view { padding-top: 1px; }
.training-top { display: flex; align-items: center; gap: 10px; margin: 1px 0 18px; }
.round-btn { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--white); color: var(--navy); font-size: 21px; line-height: 1; }
.training-progress { height: 7px; flex: 1; overflow: hidden; border-radius: 10px; background: #e2e9f1; }
.training-progress span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--teal); transition: width .25s ease; }
.training-count { color: var(--muted); font-size: 10px; font-weight: 800; }
.training-card { min-height: 390px; padding: 21px 18px; border-radius: 25px; background: var(--white); box-shadow: var(--shadow); }
.question-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.section-pill { display: inline-flex; min-height: 28px; align-items: center; padding: 0 10px; border-radius: 8px; background: var(--teal-soft); color: var(--teal); font-size: 10px; font-weight: 900; }
.speak-btn { min-height: 33px; padding: 0 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); color: var(--navy); font-size: 10px; font-weight: 800; }
.training-card h1 { margin: 23px 0 10px; color: var(--navy); font-size: 27px; line-height: 1.28; letter-spacing: -.045em; }
.question-prompt { margin: 0; color: #394a60; font-size: 16px; line-height: 1.8; }
.recall-callout { margin: 20px 0 16px; padding: 13px 14px; border-left: 3px solid var(--orange); border-radius: 0 12px 12px 0; background: var(--orange-soft); }
.recall-callout span { color: var(--orange-deep); font-size: 10px; font-weight: 900; }
.recall-callout p { margin: 2px 0 0; color: #6b513c; font-size: 12px; }
.hint-stack { display: grid; gap: 8px; }
.hint-card { padding: 12px 14px; border: 1px solid #cfe8e7; border-radius: 13px; background: #f1fafa; animation: liftIn .2s ease both; }
.hint-card b { display: block; margin-bottom: 4px; color: var(--teal); font-size: 9px; letter-spacing: .08em; }
.hint-card p { margin: 0; color: #2e5960; font-size: 13px; line-height: 1.65; }
.answer-panel { margin-top: 10px; padding: 16px; border-radius: 16px; background: #f6f8fb; animation: liftIn .25s ease both; }
.answer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.answer-head span:first-child { color: var(--navy); font-size: 12px; font-weight: 900; }
.answer-note { color: var(--muted); font-size: 9px; }
.answer-body { color: var(--ink); font-size: 14px; line-height: 1.85; }
.answer-body p { margin: 0 0 8px; }
.answer-body p:last-child { margin-bottom: 0; }
.assessment { margin-top: 17px; padding-top: 15px; border-top: 1px solid var(--line); }
.assessment > p { margin: 0 0 9px; color: var(--muted); font-size: 11px; font-weight: 800; }
.assessment-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.result-btn { min-height: 66px; padding: 8px 5px; border: 1.5px solid var(--line); border-radius: 13px; background: var(--white); text-align: center; }
.result-btn strong { display: block; color: var(--navy); font-size: 11px; }
.result-btn span { color: var(--muted); font-size: 8px; }
.result-btn.miss { border-color: #f1caca; background: #fff7f7; }
.result-btn.partial { border-color: #f3d8bd; background: #fffaf5; }
.result-btn.complete { border-color: #cbe8d8; background: #f5fcf8; }
.training-actions { display: grid; gap: 8px; margin-top: 13px; }
.complete-view { padding-top: 38px; text-align: center; }
.complete-illustration { display: grid; width: 92px; height: 92px; margin: 0 auto 24px; place-items: center; border-radius: 30px; background: var(--teal-soft); color: var(--teal); font-size: 42px; font-weight: 900; box-shadow: 0 15px 35px rgba(15,139,141,.14); }
.complete-view h1 { margin: 0; color: var(--navy); font-size: 32px; letter-spacing: -.045em; }
.complete-view > p:not(.eyebrow) { max-width: 320px; margin: 13px auto 20px; color: var(--muted); font-size: 13px; }
.complete-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 20px 0 28px; }
.complete-stats div { padding: 14px 5px; border: 1px solid var(--line); border-radius: 15px; background: var(--white); }
.complete-stats strong { display: block; color: var(--navy); font-size: 24px; }
.complete-stats span { color: var(--muted); font-size: 9px; }
.bottom-nav {
  position: fixed;
  z-index: 30;
  bottom: 0;
  left: 50%;
  display: grid;
  width: min(100%, 480px);
  grid-template-columns: repeat(4, 1fr);
  transform: translateX(-50%);
  border-top: 1px solid rgba(219,226,235,.9);
  background: rgba(255,255,255,.95);
  padding: 7px 8px calc(7px + var(--safe-bottom));
  backdrop-filter: blur(18px);
}
.nav-item { display: grid; min-height: 49px; place-items: center; gap: 0; border: 0; border-radius: 12px; background: transparent; color: #8a98aa; }
.nav-item span { display: grid; width: 25px; height: 23px; place-items: center; font-size: 15px; font-weight: 900; }
.nav-item b { font-size: 9px; font-weight: 800; }
.nav-item.active { background: var(--teal-soft); color: var(--teal); }
.toast {
  position: fixed;
  z-index: 100;
  bottom: 92px;
  left: 50%;
  max-width: min(86vw, 390px);
  padding: 11px 16px;
  transform: translate(-50%, 14px);
  border-radius: 12px;
  background: rgba(11,31,58,.94);
  color: #fff;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.large-text { font-size: 18px; }
.large-text body { font-size: 18px; }
.large-text .question-prompt { font-size: 19px; }
.large-text .answer-body { font-size: 17px; }
.large-text .hint-card p { font-size: 16px; }
.large-text .training-card h1 { font-size: 31px; }
.large-text .field input { font-size: 19px; }
.large-text .metric-card > span:last-child, .large-text .module-card-main span { font-size: 12px; }
@media (min-width: 520px) {
  .app-frame { margin-top: 18px; margin-bottom: 18px; min-height: calc(100dvh - 36px); border-radius: 28px; }
  .bottom-nav { bottom: 18px; border-radius: 0 0 28px 28px; }
  .login-screen { min-height: calc(100dvh - 36px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
