:root {
  --grad: linear-gradient(135deg, #4f6df5 0%, #7c5cf0 100%);
  --primary: #4f6df5;
  --primary-dark: #3b57d8;
  --bg: #f2f4fb;
  --card: #ffffff;
  --text: #22263a;
  --muted: #7b8098;
  --ok: #16a34a;
  --ok-bg: #e5f8ec;
  --bad: #e2454a;
  --bad-bg: #fdeaea;
  --gold: #f5a623;
  --radius: 16px;
  --shadow: 0 3px 14px rgba(50, 62, 130, .08);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}

button { font-family: inherit; touch-action: manipulation; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ---------- 统一线性图标样式 ---------- */

.i-svg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  width: 1em;
  height: 1em;
  line-height: 1;
}
.i-svg svg {
  width: 100%;
  height: 100%;
  display: block;
}

.lg-icon {
  display: inline-block;
  vertical-align: middle;
  width: 1em;
  height: 1em;
  margin: 0 .15em;
}

/* ---------- 通用 ---------- */

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}

h2 { margin: 0 0 14px; }
h3 { margin: 0 0 10px; font-size: 17px; }

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.card-head h3 { margin: 0; }

.home-duo-card {
  border: 1px solid #dfe6ff;
  background: linear-gradient(180deg, #f7f9ff 0%, #ffffff 60%);
}
.home-duo-tip { margin: 0 0 12px; }
.duo-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
}
.duo-progress-track {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: #e7ebf8;
  overflow: hidden;
}
.duo-progress-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #34c77b 0%, #16a34a 100%);
  transition: width .45s cubic-bezier(.2,.8,.2,1);
}
.duo-progress-txt {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}
.duo-celebrate {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin: 0 0 12px;
  border-radius: 14px;
  background: linear-gradient(135deg, #e5f8ec 0%, #dcfce7 100%);
  border: 1px solid #b6e7c9;
}
.duo-celebrate-emoji { font-size: 26px; line-height: 1; }
.duo-celebrate b { display: block; font-size: 14px; color: #15803d; }
.duo-celebrate span { font-size: 12px; color: #3f8b5c; }
.duo-celebrate.play { animation: celebrate-in .5s cubic-bezier(.2,.8,.2,1); }
.duo-celebrate.play .duo-celebrate-emoji { animation: celebrate-bounce .6s ease; }
@keyframes celebrate-in {
  0% { transform: translateY(-8px) scale(.96); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes celebrate-bounce {
  0%, 100% { transform: translateY(0) rotate(0); }
  30% { transform: translateY(-6px) rotate(-12deg); }
  60% { transform: translateY(-2px) rotate(10deg); }
}
.home-duo-tasks {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.home-duo-row {
  display: grid;
  grid-template-columns: 28px 1fr auto auto;
  gap: 8px 10px;
  align-items: center;
  padding: 12px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #e7ebf8;
}
.home-duo-row .duo-idx {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: var(--primary);
}
.home-duo-row .duo-main { min-width: 0; }
.home-duo-row .duo-main b {
  display: block;
  font-size: 14px;
  margin-bottom: 2px;
}
.home-duo-row .duo-main .hint {
  display: block;
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
}
.home-duo-row .duo-status,
.home-duo-row .duo-status.wait {
  background: #fff1d6;
  color: #b7791f;
}
.home-duo-row .duo-status.ok {
  background: var(--ok-bg);
  color: var(--ok);
}
.home-duo-row .btn { flex-shrink: 0; min-width: 72px; }
.home-read-row {
  border-color: #cfe9d8;
  background: linear-gradient(180deg, #f3fbf6 0%, #fff 70%);
}
.home-read-row .duo-idx { background: #16a34a; }

/* 完成态：整行变绿 + 序号变对勾 */
.home-duo-row.done {
  border-color: #b6e7c9;
  background: linear-gradient(180deg, #ecfaf1 0%, #f7fdfa 70%);
}
.home-duo-row.done .duo-idx {
  background: var(--ok);
  animation: pop-check .32s ease;
}
.home-duo-row.done .duo-main b { color: #15803d; }
@keyframes pop-check {
  0% { transform: scale(.4); opacity: 0; }
  60% { transform: scale(1.18); }
  100% { transform: scale(1); opacity: 1; }
}

/* ---------- 每日阅读 ---------- */
.read-word-box {
  margin: 8px 0 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f3fbf6;
  border: 1px solid #cfe9d8;
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.read-word-box b {
  color: #166534;
  margin-right: 6px;
}
.read-word-box span { color: var(--text); }
.read-passage {
  white-space: pre-wrap;
  line-height: 1.7;
  font-size: 16px;
  color: var(--text);
  background: #f7f9ff;
  border-radius: 12px;
  padding: 14px 16px;
  border: 1px solid #e7ebf8;
  margin: 8px 0 4px;
}
.read-passage mark.focus {
  background: #dcfce7;
  color: #14532d;
  padding: 0 3px;
  border-radius: 4px;
}
.read-passage mark.past {
  background: #e0e7ff;
  color: #312e81;
  padding: 0 3px;
  border-radius: 4px;
}
.read-tip { margin-top: 8px; }
.read-questions { display: flex; flex-direction: column; gap: 16px; }
.read-q {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #e7ebf8;
  background: #fff;
}
.read-q .rq-title {
  font-weight: 650;
  font-size: 14px;
  margin-bottom: 10px;
  line-height: 1.45;
}
.read-q .rq-opts { display: flex; flex-direction: column; gap: 8px; }
.read-q .rq-opt {
  text-align: left;
  border: 1px solid #dfe6ff;
  background: #f7f9ff;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  cursor: pointer;
  color: var(--text);
  transition: transform .1s ease;
}
.read-q .rq-opt:active:not(:disabled) { transform: scale(.97); }
.read-q .rq-opt:disabled { cursor: default; opacity: 1; }
.read-q .rq-opt.correct {
  background: var(--ok-bg);
  border-color: #86efac;
  color: #166534;
  font-weight: 650;
}
.read-q .rq-opt.wrong {
  background: var(--bad-bg);
  border-color: #fca5a5;
  color: #991b1b;
}
.read-q .rq-fb {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 4px;
}
.read-q .rq-fb .i-svg { width: 14px; height: 14px; flex: none; }
.read-q .rq-fb.ok { color: var(--ok); }
.read-q .rq-fb.bad { color: var(--bad); }
.read-result {
  margin: 14px 0;
  padding: 12px;
  border-radius: 12px;
  background: #eef1ff;
  font-size: 14px;
  line-height: 1.5;
}
.chip-status {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.chip-status.warn { background: #fff1d6; color: #b7791f; }
.chip-status.ok { background: var(--ok-bg); color: var(--ok); }
.chip-status.muted { background: #eef0f6; color: var(--muted); }

.btn {
  border: none;
  border-radius: 12px;
  padding: 11px 20px;
  font-size: 15px;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
}
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--grad); color: #fff; font-weight: 600; }
.btn.ghost { background: #edf0fa; color: var(--text); }
.btn.ghost.danger, .btn.small.danger { color: var(--bad); }
.btn.primary.danger-solid { background: linear-gradient(135deg, #ef5a5f 0%, var(--bad) 100%); }
.btn.outline {
  background: #fff;
  border: 1.5px dashed var(--primary);
  color: var(--primary);
  font-weight: 600;
}
.btn.white { background: #fff; color: var(--primary); font-weight: 700; }
.btn.white.ghost { background: rgba(255,255,255,.22); color: #fff; }
.btn.link { background: none; color: var(--primary); padding: 4px 8px; font-size: 14px; }
.btn.big { width: 100%; padding: 14px; font-size: 16px; }
.btn.small { padding: 6px 14px; font-size: 13px; border-radius: 9px; }

.hint { color: var(--muted); font-size: 13px; margin: 6px 0; }
.hint code { background: #edf0fa; padding: 1px 6px; border-radius: 5px; }
.app-version { text-align: center; font-size: 12px; opacity: .6; margin: 18px 0 4px; }

.field { margin-bottom: 16px; }
.field > label { display: block; font-weight: 600; margin-bottom: 8px; }
.field-row { display: flex; gap: 12px; flex-wrap: wrap; }
.field-row .field { flex: 1; min-width: 130px; }

select, input[type=text], input[type=date], textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #dde1f0;
  border-radius: 11px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
}
textarea { resize: vertical; }

.plain-list { list-style: none; padding: 0; margin: 0; }
.plain-list li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 2px;
  border-bottom: 1px dashed #e8ebf5;
  font-size: 14px;
  color: var(--muted);
}
.plain-list li b { color: var(--text); }
.plain-list li:last-child { border-bottom: none; }

.empty-tip { color: var(--muted); text-align: center; padding: 26px 0; font-size: 14px; }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
  text-align: center;
}
.empty-state.compact { padding: 28px 20px; }
.empty-state .empty-img {
  width: 100px;
  height: 100px;
  margin-bottom: 16px;
  opacity: .85;
}
.empty-state.compact .empty-img { width: 80px; height: 80px; margin-bottom: 12px; }
.empty-state .empty-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.empty-state .empty-sub {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  max-width: 280px;
  line-height: 1.5;
}

/* ---------- 登录 ---------- */

#screen-login {
  min-height: 100vh;
  background: var(--grad);
  padding: 0 16px 40px;
}

.login-hero {
  text-align: center;
  color: #fff;
  padding: 56px 0 28px;
}
.login-logo {
  font-size: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-logo svg {
  width: 56px;
  height: 56px;
  color: #fff;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.15));
}
.login-hero h1 { margin: 8px 0 6px; letter-spacing: 2px; }
.login-hero p { margin: 0; opacity: .85; font-size: 14px; }
.login-version { margin-top: 10px !important; font-size: 12px; opacity: .6 !important; }

.login-card { max-width: 420px; margin: 0 auto; padding: 24px; }

.profile-list { display: flex; flex-direction: column; gap: 10px; }
.profile-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1.5px solid #e3e7f5;
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  font-size: 16px;
  width: 100%;
  text-align: left;
}
.profile-item:hover { border-color: var(--primary); background: #f5f7ff; }
.profile-item .pa { font-size: 26px; }
.profile-item .pn { font-weight: 700; flex: 1; }
.profile-item .pd { color: var(--muted); font-size: 12px; }
.profile-item .pdel {
  border: none; background: none; color: #c3c8da; font-size: 15px; cursor: pointer; padding: 4px;
}
.profile-item .pdel:hover { color: var(--bad); }

.divider {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin: 18px 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: #e8ebf5; }

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.avatar-grid button {
  font-size: 24px;
  padding: 8px 0;
  border: 1.5px solid #e3e7f5;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}
.avatar-grid button.picked { border-color: var(--primary); background: #eef1ff; }

.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  background: #edf0fa;
  border-radius: 12px;
  padding: 4px;
}
.auth-tab {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.auth-tab.active { background: #fff; color: var(--primary); box-shadow: var(--shadow); }

/* ---------- 顶栏与底部导航 ---------- */

#topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 18px;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(8px);
  box-shadow: 0 1px 0 rgba(50,62,130,.06);
}
#topbar .brand {
  font-weight: 800;
  font-size: 17px;
  display: flex;
  align-items: center;
  gap: 6px;
}
#topbar .brand svg {
  width: 20px;
  height: 20px;
  flex: none;
}

.user-chip {
  border: none;
  background: #edf0fa;
  border-radius: 999px;
  padding: 5px 14px 5px 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

main { max-width: 680px; margin: 16px auto 84px; padding: 0 14px; }

.screen { display: none; }
.screen.active { display: block; animation: screen-in .26s ease; }
@keyframes screen-in {
  0% { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}
#screen-login.screen { display: none; }
#screen-login.screen.active { display: block; }

#tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(8px);
  box-shadow: 0 -2px 12px rgba(50,62,130,.08);
  padding: 6px 0 max(6px, env(safe-area-inset-bottom));
}
.tab-btn {
  flex: 1;
  border: none;
  background: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 0;
}
.tab-btn span { font-size: 20px; }
.tab-btn svg { width: 24px; height: 24px; display: block; transition: transform .15s ease; }
.tab-btn.active { color: var(--primary); font-weight: 700; }
.tab-btn.active svg { stroke-width: 2.1; }
.tab-btn:active svg { transform: scale(.86); }

/* ---------- 今日 ---------- */

.hero-card {
  background: var(--grad);
  border-radius: 20px;
  color: #fff;
  padding: 22px;
  margin-bottom: 16px;
  box-shadow: 0 6px 20px rgba(79,109,245,.32);
}
.hero-top-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.hero-date { opacity: .8; font-size: 13px; }
.hero-wordcount {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.2);
  white-space: nowrap;
}
.hero-card h2 { margin: 6px 0 4px; font-size: 22px; }
.hero-card p { margin: 0 0 12px; opacity: .92; font-size: 15px; }
.hero-quote {
  font-size: 13px;
  opacity: .95;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,.14);
  line-height: 1.5;
}
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.stat-card {
  background: var(--card);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 12px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stat-card b { font-size: 22px; color: var(--primary); }
.stat-card span { font-size: 12px; color: var(--muted); }
.newbie-tip {
  margin: -6px 0 16px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #eef2ff;
  border: 1px dashed #c3cdfb;
  color: #4453b8;
  font-size: 13px;
  line-height: 1.5;
}

/* ---------- 计划 / 闯关地图 ---------- */

.plan-hero {
  background: var(--grad);
  color: #fff;
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 14px;
  box-shadow: 0 6px 20px rgba(79,109,245,.28);
}
.plan-hero-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.plan-hero-kicker {
  font-size: 12px;
  opacity: .85;
  margin-bottom: 4px;
}
.plan-hero h2 {
  margin: 0 0 6px;
  font-size: 22px;
}
.plan-hero-top p {
  margin: 0;
  opacity: .9;
  font-size: 13px;
  line-height: 1.45;
}
.plan-hero-score {
  min-width: 72px;
  text-align: center;
  background: rgba(255,255,255,.16);
  border-radius: 14px;
  padding: 10px 8px;
}
.plan-hero-score b {
  display: block;
  font-size: 22px;
  line-height: 1.1;
}
.plan-hero-score span { font-size: 11px; opacity: .9; }

.plan-duo-tasks {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.plan-duo-row {
  display: grid;
  grid-template-columns: 28px 1fr auto auto;
  gap: 8px 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.2);
}
.plan-duo-row .duo-idx {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  background: rgba(255,255,255,.22);
}
.plan-duo-row .duo-main { min-width: 0; }
.plan-duo-row .duo-main b {
  display: block;
  font-size: 14px;
  margin-bottom: 2px;
}
.plan-duo-row .duo-main .hint {
  display: block;
  margin: 0;
  color: rgba(255,255,255,.88);
  font-size: 11px;
  line-height: 1.35;
}
.duo-status {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.duo-status.wait { background: rgba(255,255,255,.18); color: #fff; }
.duo-status.ok { background: #dcfce7; color: #15803d; }
.plan-duo-row .btn.white {
  flex-shrink: 0;
  color: var(--primary);
  background: #fff;
  min-width: 72px;
}

.plan-bars { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.plan-bars.compact {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,.18);
  opacity: .92;
}
.plan-bars.compact .plan-bar-row { font-size: 11px; }
.plan-bar-row {
  display: grid;
  grid-template-columns: 36px 1fr 44px;
  gap: 8px;
  align-items: center;
  font-size: 12px;
}
.plan-bar-track {
  height: 8px;
  background: rgba(255,255,255,.25);
  border-radius: 999px;
  overflow: hidden;
}
.plan-bar-fill {
  height: 100%;
  width: 0;
  background: #fff;
  border-radius: inherit;
  transition: width .35s ease;
}
.plan-bar-fill.rev { background: #ffd98a; }
.plan-bar-row em { font-style: normal; text-align: right; opacity: .95; }

.plan-map-card { padding-top: 16px; }

.plan-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.plan-legend .lg {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f1f3fa;
  color: #5c6585;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.plan-legend .lg svg {
  width: 13px;
  height: 13px;
  flex: none;
}
.plan-legend .lg.done { background: #e8f8ef; color: #168a4a; }
.plan-legend .lg.pending { background: #eef1ff; color: #4f6df5; }
.plan-legend .lg.today { background: #fff3d8; color: #c47b00; }
.plan-legend .lg.locked { background: #f1f2f6; color: #8a90a5; }
.plan-legend .lg.miss { background: #fdeaea; color: var(--bad); }

.plan-sections { display: flex; flex-direction: column; gap: 16px; }
.plan-section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}
.plan-section-head h4 { margin: 0; font-size: 15px; }
.plan-section-head span { font-size: 12px; color: var(--muted); }

.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 8px;
}
.plan-cell {
  border: 1.5px solid #e3e7f5;
  border-radius: 14px;
  background: #fff;
  padding: 10px 6px 8px;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font: inherit;
  color: inherit;
  min-height: 78px;
  transition: transform .1s ease;
}
.plan-cell .pl-icon {
  font-size: 14px;
  line-height: 1;
  min-height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.plan-cell .pl-icon .i-svg {
  width: 15px;
  height: 15px;
}
.plan-cell .pl-name { font-weight: 800; font-size: 15px; }
.plan-cell .pl-sub { font-size: 11px; color: var(--muted); font-weight: 600; }

.plan-cell.done { border-color: #22a85b; background: #e8f8ef; }
.plan-cell.done .pl-name,
.plan-cell.done .pl-sub,
.plan-cell.done .pl-icon { color: #168a4a; }
.plan-cell.today { border-color: #f0a933; background: #fff8e8; box-shadow: 0 0 0 2px rgba(240,169,51,.2); }
.plan-cell.today .pl-name,
.plan-cell.today .pl-sub,
.plan-cell.today .pl-icon { color: #c47b00; }
.plan-cell.miss { border-color: #f0b3b5; background: #fdf1f1; }
.plan-cell.miss .pl-name,
.plan-cell.miss .pl-sub,
.plan-cell.miss .pl-icon { color: var(--bad); }
.plan-cell.pending { border-color: #c9d4f5; background: #f4f7ff; }
.plan-cell.pending .pl-name,
.plan-cell.pending .pl-icon { color: #3f5fd0; }
.plan-cell.pending .pl-sub { color: #6b7eb8; }
.plan-cell.locked .pl-icon { color: #a2a8bd; }
.plan-cell:active:not(.locked) { transform: scale(.94); }
.plan-cell.locked { opacity: .62; cursor: not-allowed; background: #f4f5fa; }
.plan-cell.rev { border-style: dashed; }
.plan-cell.rev.done { border-style: solid; }
.plan-cell.selected { outline: 2px solid var(--primary); outline-offset: 1px; }

.plan-action {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #eef1ff, #f7f9ff);
  border-radius: 14px;
  border: 1px solid #dfe6ff;
}
.plan-action-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.plan-action-row.hard {
  padding-top: 10px;
  border-top: 1px dashed #d5dcf5;
}
.plan-action-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.plan-action-main b { font-size: 15px; }
.plan-action-main span { font-size: 12px; color: var(--muted); line-height: 1.4; }
.plan-action-row .btn { flex-shrink: 0; }

.rule-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}
.rule-list b { color: var(--text); }

/* ---------- 统计 ---------- */

.accounts-overview { display: flex; flex-direction: column; gap: 8px; }
.acc-block {
  border: 1px solid #eceef7;
  border-radius: 12px;
  padding: 4px 12px;
}
.acc-block > summary {
  cursor: pointer;
  padding: 10px 0;
  font-weight: 700;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.acc-block > summary .i-svg {
  width: 22px;
  height: 22px;
  flex: none;
}
.acc-block > summary::-webkit-details-marker { display: none; }
.acc-block > summary .hint { margin-left: 6px; font-weight: 400; }
.acc-block-body { padding: 4px 0 10px; display: flex; flex-direction: column; gap: 6px; }
.acc-day {
  border: 1px solid #f0f1f8;
  border-radius: 10px;
  padding: 2px 10px;
  background: #fafbfe;
}
.acc-day > summary {
  cursor: pointer;
  padding: 8px 0;
  font-size: 13px;
  color: var(--muted);
  list-style: none;
}
.acc-day > summary::-webkit-details-marker { display: none; }
.acc-day-body { padding: 2px 0 8px; display: flex; flex-direction: column; gap: 4px; }
.acc-day-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  padding: 4px 0;
  border-bottom: 1px dashed #eceef7;
}
.acc-day-item:last-child { border-bottom: none; }
.acc-day-item b { color: var(--primary); margin: 0 4px; }

.level-bars { display: flex; flex-direction: column; gap: 8px; }
.level-bar-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.level-bar-row .lb-name { width: 56px; font-weight: 600; }
.level-bar-row .lb-track {
  flex: 1;
  height: 12px;
  background: #edf0fa;
  border-radius: 6px;
  overflow: hidden;
}
.level-bar-row .lb-fill { height: 100%; border-radius: 6px; background: var(--grad); }
.level-bar-row .lb-fill.low { background: linear-gradient(135deg, #f08c5c, #e2454a); }
.level-bar-row .lb-val { width: 72px; text-align: right; color: var(--muted); font-size: 12px; }

/* ---------- 我的 ---------- */

.me-card { display: flex; align-items: center; gap: 14px; }
.me-avatar {
  font-size: 38px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #eef1ff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.me-info { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.me-info b { font-size: 18px; }

/* ---------- 选择芯片 ---------- */

.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 13px;
  border: 1.5px solid #dde1f0;
  border-radius: 11px;
  cursor: pointer;
  font-size: 14px;
  user-select: none;
  background: #fff;
  transition: transform .1s ease, border-color .15s ease, background .15s ease;
}
.chip:active { transform: scale(.96); }
.chip small { color: var(--muted); font-size: 12px; }
.chip input { display: none; }
.chip:has(input:checked) { border-color: var(--primary); background: #eef1ff; color: var(--primary); }

.chip.compact { flex-direction: row; align-items: baseline; gap: 6px; padding: 6px 10px; font-size: 13px; }
.chip.compact small { font-size: 11px; }

.picker-tools { float: right; display: flex; gap: 6px; }
.picker-tools .btn { padding: 3px 10px; font-size: 12px; }

.switch-line { display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.switch-line input { width: 18px; height: 18px; }

/* ---------- 答题 ---------- */

.quiz-head { margin-bottom: 14px; }
.progress-wrap { height: 8px; background: #dfe4f5; border-radius: 4px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: var(--grad); transition: width .3s; }
.quiz-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}
.quiz-meta .timer {
  font-weight: 700;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  gap: 4px;
}
.quiz-meta .timer .i-svg {
  width: 16px;
  height: 16px;
}
.quiz-meta .timer.low { color: var(--bad); }
.quiz-meta button { margin-left: auto; }

.question-card { text-align: center; padding: 26px 20px; }
.question-card.q-enter { animation: q-slide-in .28s ease; }
@keyframes q-slide-in {
  0% { opacity: 0; transform: translateX(14px); }
  100% { opacity: 1; transform: translateX(0); }
}

.q-type {
  display: inline-block;
  background: #eef1ff;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.speak-zone {
  display: block;
  width: 100%;
  border: 1.5px dashed transparent;
  background: #f7f9ff;
  border-radius: 14px;
  padding: 14px 12px 10px;
  margin: 0 0 8px;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.speak-zone.enabled {
  border-color: rgba(79, 109, 245, .28);
}
.speak-zone.enabled:active {
  background: #eef1ff;
  border-color: var(--primary);
}
.speak-zone:disabled {
  cursor: default;
  background: transparent;
  border-color: transparent;
}
.speak-hint {
  margin-top: 6px;
  font-size: 12px;
  color: #8b93b0;
}

.q-prompt {
  font-size: 32px;
  font-weight: 800;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  line-height: 1.35;
}

.speak-btn {
  border: none;
  background: #eef1ff;
  font-size: 19px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  cursor: pointer;
  flex: none;
  transition: transform .12s, background .12s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.speak-btn svg {
  width: 20px;
  height: 20px;
}
.speak-btn:hover { background: #dfe6ff; }
.speak-btn:active, .speak-btn.playing {
  background: #4f6df5;
  color: #fff;
  transform: scale(1.08);
}

.q-phonetic {
  color: #5b6b9a;
  margin-top: 8px;
  min-height: 22px;
  font-size: 18px;
  font-family: "Segoe UI", "Lucida Grande", "PingFang SC", sans-serif;
  letter-spacing: .02em;
}
.speak-zone.enabled .q-phonetic {
  text-decoration: underline dotted rgba(79, 109, 245, .45);
  text-underline-offset: 4px;
}

.options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 22px;
}
@media (max-width: 520px) { .options { grid-template-columns: 1fr; } }

.option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 12px;
  border: 1.5px solid #dde1f0;
  border-radius: 13px;
  font-size: 16px;
  cursor: pointer;
  background: #fff;
  text-align: left;
  transition: transform .1s ease, border-color .15s ease, background .15s ease;
}
.option:active:not(:disabled) { transform: scale(.97); background: #f6f8ff; }
.option .opt-letter {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: #eef1ff;
  color: var(--primary);
  font-weight: 800;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.option .opt-text { flex: 1; line-height: 1.4; }
.option:hover:not(:disabled) { border-color: var(--primary); background: #f6f8ff; }
.option.correct { border-color: var(--ok); background: var(--ok-bg); font-weight: 700; animation: opt-correct .32s ease; }
.option.correct .opt-letter { background: var(--ok); color: #fff; }
.option.wrong { border-color: var(--bad); background: var(--bad-bg); animation: opt-shake .32s ease; }
.option.wrong .opt-letter { background: var(--bad); color: #fff; }
.option.picked { border-color: var(--primary); background: #eef1ff; }
.option:disabled { cursor: default; color: var(--text); }
@keyframes opt-correct {
  0% { transform: scale(1); }
  45% { transform: scale(1.025); }
  100% { transform: scale(1); }
}
@keyframes opt-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
}

.write-box { display: flex; gap: 10px; margin-top: 22px; }
.write-box input { flex: 1; font-size: 17px; }

.feedback {
  margin-top: 18px;
  padding: 12px;
  border-radius: 11px;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.feedback .i-svg { width: 18px; height: 18px; }
.feedback.ok { background: var(--ok-bg); color: var(--ok); }
.feedback.bad { background: var(--bad-bg); color: var(--bad); }
.feedback .fb-main { display: flex; align-items: center; gap: 6px; }
.feedback .fb-cheer {
  font-size: 13px;
  font-weight: 500;
  color: #b0575a;
  opacity: .9;
}

.q-actions { margin-top: 18px; display: flex; justify-content: center; gap: 12px; min-height: 44px; }

/* ---------- 本场进度板 ---------- */

.quiz-board { margin-top: 4px; }
.quiz-board-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}
.quiz-board-head h3 { margin: 0; font-size: 16px; }

.quiz-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.quiz-stats .qs {
  background: #f4f6fc;
  border-radius: 12px;
  padding: 8px 4px;
  text-align: center;
}
.quiz-stats .qs b {
  display: block;
  font-size: 20px;
  color: var(--primary);
  line-height: 1.2;
}
.quiz-stats .qs.ok b { color: var(--ok); }
.quiz-stats .qs.bad b { color: var(--bad); }
.quiz-stats .qs span { font-size: 11px; color: var(--muted); }

.quiz-dots-wrap {
  max-height: 148px;
  overflow: auto;
  padding: 2px;
  margin: 0 -2px;
}
.quiz-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.qdot {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: none;
  font-size: 11px;
  font-weight: 700;
  cursor: default;
  color: #7b829c;
  background: #eef0f6;
  padding: 0;
}
.qdot.ok { background: #d8f5e4; color: #168a4a; }
.qdot.bad { background: #fde2e2; color: #d64545; }
.qdot.cur {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
  background: #e8eeff;
  color: var(--primary);
}
.qdot.ok.cur { background: #c8efd8; }
.qdot.bad.cur { background: #fccccc; }
.qdot.wait { background: #eef0f6; color: #8a91a8; }
.qdot.ok, .qdot.bad { cursor: pointer; }

.quiz-dots-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  font-size: 11px;
  color: var(--muted);
}
.quiz-dots-legend span { display: inline-flex; align-items: center; gap: 4px; }
.quiz-dots-legend .d {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}
.quiz-dots-legend .d.ok { background: #22a85b; }
.quiz-dots-legend .d.bad { background: #e2454a; }
.quiz-dots-legend .d.cur { background: var(--primary); }
.quiz-dots-legend .d.wait { background: #cfd3e0; }

/* ---------- 成绩 ---------- */

.result-card { text-align: center; }

.pass-banner {
  background: #fff9ec;
  color: var(--gold);
  font-weight: 800;
  font-size: 17px;
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 14px;
}

.score-circle {
  width: 128px;
  height: 128px;
  margin: 6px auto 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 42px;
  font-weight: 800;
  color: var(--primary);
  border: 8px solid #eef1ff;
}
.score-circle small { font-size: 15px; font-weight: 700; }

.result-summary { color: var(--muted); margin-bottom: 16px; line-height: 1.9; }
.result-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin: 12px 0 2px; }

.review-list { margin-top: 10px; }
.review-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 4px;
  border-bottom: 1px solid #eef1f8;
  font-size: 14px;
  text-align: left;
}
.review-item:last-child { border-bottom: none; }
.review-item .mark {
  font-size: 16px;
  width: 22px;
  text-align: center;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.review-item .mark .i-svg {
  width: 18px;
  height: 18px;
}
.review-item .mark.ok { color: var(--ok); }
.review-item .mark.bad { color: var(--bad); }
.review-item .w { font-weight: 700; min-width: 92px; }
.review-item .t { color: var(--muted); flex: 1; }
.review-item .ua { color: var(--bad); font-size: 12px; }
.review-item .cnt { color: var(--gold); font-size: 12px; font-weight: 700; flex: none; }
.review-item .speak-btn {
  width: 32px;
  height: 32px;
  font-size: 14px;
}
.review-item .speak-btn svg {
  width: 16px;
  height: 16px;
}
.review-item .del { border: none; background: none; color: #c3c8da; cursor: pointer; font-size: 15px; }
.review-item .del:hover { color: var(--bad); }

/* ---------- Toast 提示（替代原生 alert） ---------- */

.toast-stack {
  position: fixed;
  left: 0;
  right: 0;
  bottom: max(78px, calc(env(safe-area-inset-bottom) + 70px));
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 420px;
  width: 100%;
  padding: 12px 16px;
  border-radius: 14px;
  background: #262a3f;
  color: #fff;
  font-size: 14px;
  line-height: 1.45;
  box-shadow: 0 8px 24px rgba(20, 24, 50, .22);
  opacity: 0;
  transform: translateY(10px) scale(.98);
  transition: opacity .22s ease, transform .22s ease;
}
.toast.show { opacity: 1; transform: translateY(0) scale(1); }
.toast .toast-icon {
  flex: none;
  font-size: 17px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.toast .toast-icon .i-svg {
  width: 18px;
  height: 18px;
}
.toast .toast-text { flex: 1; }
.toast.success { background: #16663b; }
.toast.error { background: #7a2323; }
.toast.info { background: #262a3f; }

/* ---------- 确认弹窗（替代原生 confirm） ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(20, 22, 40, .46);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity .18s ease;
}
.modal-overlay.show { opacity: 1; }
.modal-card {
  background: #fff;
  border-radius: 18px;
  padding: 22px 20px 18px;
  max-width: 340px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 48px rgba(20, 24, 50, .28);
  transform: translateY(8px) scale(.97);
  transition: transform .18s ease;
}
.modal-overlay.show .modal-card { transform: translateY(0) scale(1); }
.modal-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: #eef1ff;
  color: var(--primary);
  font-size: 20px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-icon.danger { background: #fdeaea; color: var(--bad); }
.modal-card h3 { font-size: 16px; margin: 0 0 6px; }
.modal-card .hint { margin: 0 0 18px; font-size: 13px; line-height: 1.55; }
.modal-actions { display: flex; gap: 10px; }
.modal-actions .btn { flex: 1; }

/* 里程碑弹窗 */
.milestone-card { max-width: 300px; padding: 28px 22px 20px; }
.milestone-badge {
  position: relative;
  width: 100px;
  height: 100px;
  margin: 0 auto 14px;
  animation: milestone-pop .5s cubic-bezier(.34, 1.56, .64, 1);
}
.milestone-badge svg { width: 100%; height: 100%; }
.milestone-badge .milestone-days {
  position: absolute;
  top: 34px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,.15);
}
.milestone-card h3 { font-size: 18px; font-weight: 800; }
@keyframes milestone-pop {
  0% { transform: scale(.4) rotate(-8deg); opacity: 0; }
  60% { transform: scale(1.08) rotate(3deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); }
}
@media (prefers-reduced-motion: reduce) {
  .milestone-badge { animation: none; }
}
