:root {
  --bg: #f4f6fa; --card: #ffffff; --ink: #1b2330; --ink2: #566074; --line: #e3e8f0;
  --brand: #2563eb; --brand-ink: #ffffff; --brand-soft: #e8efff;
  --good: #15803d; --good-soft: #e3f6ea; --warn: #b45309; --warn-soft: #fdf1dc;
  --bad: #c0262d; --bad-soft: #fde8e9; --info: #0e7490; --info-soft: #def4f8;
  --muted-soft: #eef1f6; --shadow: 0 1px 2px rgba(20,30,50,.06), 0 4px 14px rgba(20,30,50,.05);
  --h0: #eef1f6; --h1: #cfe0ff; --h2: #8db4ff; --h3: #4b86f5; --h4: #1d4ed8;
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f141c; --card: #171e29; --ink: #e8edf5; --ink2: #9aa6ba; --line: #283142;
    --brand: #5b8cff; --brand-ink: #0b1220; --brand-soft: #1b2a4a;
    --good: #4ade80; --good-soft: #14301f; --warn: #fbbf24; --warn-soft: #3a2c0e;
    --bad: #f87171; --bad-soft: #3b1a1d; --info: #5dd3e8; --info-soft: #11303a; --muted-soft: #202a3a;
    --shadow: 0 1px 2px rgba(0,0,0,.4);
    --h0: #202a3a; --h1: #1f3a6b; --h2: #2d57a8; --h3: #4b86f5; --h4: #8db4ff;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif; }
h1, h2, h3, h4 { line-height: 1.3; margin: 0 0 .5em; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1.05rem; }
p { margin: 0 0 .75em; }
a { color: var(--brand); text-decoration: none; } a:hover { text-decoration: underline; }
.muted { color: var(--ink2); } .small { font-size: .85rem; } .center { text-align: center; }
.mono { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }

/* 顶栏 */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--card); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1120px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; gap: 16px; height: 56px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.logo:hover { text-decoration: none; }
.logo i { width: 28px; height: 28px; border-radius: 8px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-style: normal; font-size: 13px; }
.nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { padding: 8px 12px; border-radius: 8px; color: var(--ink2); white-space: nowrap; font-weight: 500; }
.nav a:hover { background: var(--muted-soft); text-decoration: none; }
.nav a.active { background: var(--brand-soft); color: var(--brand); }
.userbox { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.main { max-width: 1120px; margin: 0 auto; padding: 20px 16px 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { margin: 0; }

/* 卡片/网格 */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.card h2, .card h3 { margin-top: 0; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.c2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid > .card + .card { margin-top: 0; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }
@media (max-width: 860px) { .grid.c3, .grid.c4, .grid.c2-1 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .logo-t { display: none; } .nav a { padding: 8px 9px; } .grid.c2, .grid.c3, .grid.c4, .grid.c2-1 { grid-template-columns: minmax(0, 1fr); } .topbar-in { gap: 8px; } .userbox .uname { display: none; } }

/* 按钮/表单 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 16px; border-radius: 9px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; min-height: 38px; }
.btn:hover:not(:disabled) { background: var(--muted-soft); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover:not(:disabled) { filter: brightness(1.08); background: var(--brand); }
.btn.danger { color: var(--bad); border-color: var(--bad); }
.btn.sm { padding: 4px 10px; min-height: 30px; font-size: .85rem; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .opt:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
label { display: block; font-weight: 600; margin-bottom: 4px; }
input[type=text], input[type=password], input[type=number], input[type=date], select, textarea { width: 100%; padding: 9px 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; }
select.inline { width: auto; display: inline-block; padding: 2px 6px; margin: 0 3px; min-width: 96px; }
textarea { min-height: 220px; resize: vertical; line-height: 1.7; }
.field { margin-bottom: 14px; }
.hint { color: var(--ink2); font-size: .85rem; margin-top: 4px; }
.err { color: var(--bad); background: var(--bad-soft); padding: 8px 12px; border-radius: 8px; margin-bottom: 12px; }

.badge { display: inline-block; padding: 1px 9px; border-radius: 99px; font-size: .78rem; font-weight: 600; background: var(--muted-soft); color: var(--ink2); white-space: nowrap; }
.badge.good { background: var(--good-soft); color: var(--good); } .badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); } .badge.info { background: var(--info-soft); color: var(--info); }
.badge.brand { background: var(--brand-soft); color: var(--brand); }

/* 登录 */
.auth { max-width: 420px; margin: 8vh auto 0; }
.auth .brand { text-align: center; margin-bottom: 20px; }
.auth .brand i { width: 52px; height: 52px; font-size: 22px; border-radius: 14px; background: var(--brand); color: var(--brand-ink); display: inline-grid; place-items: center; font-style: normal; font-weight: 700; margin-bottom: 8px; }
.tabs { display: flex; gap: 4px; background: var(--muted-soft); padding: 4px; border-radius: 10px; margin-bottom: 16px; }
.tabs button { flex: 1; border: 0; background: transparent; padding: 7px; border-radius: 7px; font: inherit; font-weight: 600; color: var(--ink2); cursor: pointer; }
.tabs button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }

/* 指标 */
.tile { padding: 14px 16px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.tile .v { font-size: 1.7rem; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.tile .k { color: var(--ink2); font-size: .85rem; }
.tile .s { color: var(--ink2); font-size: .8rem; margin-top: 2px; }
.hero { background: linear-gradient(135deg, var(--brand), #6d4cf5); color: #fff; border: 0; }
.hero .muted, .hero .small { color: rgba(255,255,255,.82); }
.hero .big { font-size: 2.6rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.hero .phase { background: rgba(255,255,255,.18); color: #fff; }
.hero .meter { background: rgba(255,255,255,.25); }
.hero .meter-fill { background: #fff; }

.meter { position: relative; height: 10px; border-radius: 99px; background: var(--muted-soft); overflow: visible; }
.meter-fill { height: 100%; border-radius: 99px; background: var(--brand); }
.meter.good .meter-fill { background: var(--good); } .meter.warn .meter-fill { background: var(--warn); } .meter.bad .meter-fill { background: var(--bad); }
.meter-mark { position: absolute; top: -4px; width: 2px; height: 18px; background: var(--ink2); opacity: .7; }
.meter-mark.pass { background: var(--warn); } .meter-mark.target { background: var(--good); }
.bars .brow { display: grid; grid-template-columns: 92px 1fr 118px; gap: 10px; align-items: center; margin: 10px 0; }
.bars .brow .lab { font-weight: 600; }
.bars .brow .num { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink2); font-size: .9rem; }

/* 任务 */
.task { display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.task + .task { margin-top: 10px; }
.task.done { background: var(--good-soft); border-color: transparent; }
.task .ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); font-size: 18px; }
.task.done .ico { background: var(--good); color: #fff; }
.task .t { font-weight: 600; } .task .d { color: var(--ink2); font-size: .85rem; }

/* 周计划 */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.wday { border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: var(--card); min-height: 160px; }
.wday.today { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.wday.future { background: transparent; border-style: dashed; }
.wday h4 { margin: 0 0 6px; font-size: .85rem; display: flex; justify-content: space-between; }
.wt { font-size: .78rem; padding: 4px 6px; border-radius: 6px; background: var(--muted-soft); margin-bottom: 4px; }
.wt.done { background: var(--good-soft); color: var(--good); }
.wt.mock { background: var(--warn-soft); color: var(--warn); font-weight: 600; }
@media (max-width: 860px) { .week { grid-template-columns: repeat(2, minmax(0, 1fr)); } .wday { min-height: 0; } }
.phases { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.phase-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.phase-card.current { border-color: var(--brand); background: var(--brand-soft); }
@media (max-width: 700px) { .phases { grid-template-columns: 1fr; } }
.timeline { position: relative; height: 12px; border-radius: 99px; background: var(--muted-soft); margin: 12px 0 6px; display: flex; overflow: hidden; }
.timeline .seg { height: 100%; } .seg.s1 { background: var(--h2); } .seg.s2 { background: var(--h3); } .seg.s3 { background: var(--h4); }
.timeline-now { position: absolute; top: -3px; width: 3px; height: 18px; background: var(--bad); border-radius: 2px; }

/* 考试页 */
.examhead { position: sticky; top: 56px; z-index: 15; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 14px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; box-shadow: var(--shadow); }
.timer { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1.15rem; padding: 2px 10px; border-radius: 8px; background: var(--muted-soft); }
.timer.low { background: var(--bad-soft); color: var(--bad); }
.section { margin-bottom: 18px; }
.section h2 { padding-bottom: 6px; border-bottom: 2px solid var(--brand-soft); }
.passage { white-space: pre-wrap; background: var(--muted-soft); padding: 14px 16px; border-radius: 10px; line-height: 1.85; margin-bottom: 12px; font-family: Georgia, "Times New Roman", "Songti SC", serif; font-size: 1.02rem; }
.para { display: flex; gap: 10px; margin-bottom: 8px; } .para b { color: var(--brand); flex: none; }
.player { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px dashed var(--brand); border-radius: 10px; margin-bottom: 12px; background: var(--brand-soft); flex-wrap: wrap; }
.q { margin: 0 0 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.q .stem { font-weight: 600; margin-bottom: 8px; }
.q .stem .no { color: var(--brand); margin-right: 6px; }
.opt { display: flex; gap: 10px; align-items: flex-start; padding: 7px 10px; border-radius: 8px; cursor: pointer; border: 1px solid transparent; }
.opt:hover { background: var(--muted-soft); }
.opt input { margin-top: 5px; }
.opt.sel { background: var(--brand-soft); border-color: var(--brand); }
.opt.correct { background: var(--good-soft); border-color: var(--good); }
.opt.wrong { background: var(--bad-soft); border-color: var(--bad); }
.opt .L { font-weight: 700; color: var(--ink2); width: 1.2em; flex: none; }
.review .opt { cursor: default; }
.explain { margin-top: 8px; padding: 8px 12px; border-left: 3px solid var(--brand); background: var(--muted-soft); border-radius: 0 8px 8px 0; font-size: .92rem; }
.q.right { border-left: 4px solid var(--good); } .q.miss { border-left: 4px solid var(--bad); }
.matchrow { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.cloze-text { line-height: 2.3; }
.blank { display: inline-block; min-width: 2.2em; text-align: center; font-weight: 700; color: var(--brand); }
.wc { font-variant-numeric: tabular-nums; } .wc.bad { color: var(--bad); } .wc.good { color: var(--good); }
.checklist label { font-weight: 400; display: flex; gap: 8px; align-items: flex-start; margin: 6px 0; cursor: pointer; }
.checklist input { margin-top: 5px; }
.pre { white-space: pre-wrap; }
.sample { white-space: pre-wrap; font-family: Georgia, "Times New Roman", serif; background: var(--good-soft); padding: 12px 14px; border-radius: 10px; }
.mine { white-space: pre-wrap; font-family: Georgia, "Times New Roman", serif; background: var(--muted-soft); padding: 12px 14px; border-radius: 10px; }

/* 单词卡 */
.flash { max-width: 520px; margin: 0 auto; min-height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; cursor: pointer; user-select: none; }
.flash .w { font-size: 2.6rem; font-weight: 800; letter-spacing: .5px; }
.flash .pos { color: var(--ink2); }
.flash .zh { font-size: 1.5rem; margin: 10px 0 6px; font-weight: 600; }
.flash .ex { color: var(--ink2); font-family: Georgia, serif; font-style: italic; max-width: 440px; }

/* 图表 */
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; } .chart .axis { fill: var(--ink2); font-size: 11px; }
.chart .line-pass { stroke: var(--warn); stroke-dasharray: 5 4; stroke-width: 1.5; } .chart .lbl-pass { fill: var(--warn); font-size: 11px; }
.chart .line-target { stroke: var(--good); stroke-dasharray: 5 4; stroke-width: 1.5; } .chart .lbl-target { fill: var(--good); font-size: 11px; }
.chart .line-exam { stroke: var(--bad); stroke-width: 1.5; } .chart .lbl-exam { fill: var(--bad); font-size: 11px; }
.chart .line-score { stroke: var(--brand); stroke-width: 2.5; fill: none; } .chart .dot-score { fill: var(--brand); stroke: var(--card); stroke-width: 2; } .chart .lbl-score { fill: var(--ink); font-size: 11px; font-weight: 700; }
.chart .line-proj { stroke: var(--brand); stroke-dasharray: 2 4; stroke-width: 2; } .chart .dot-proj { fill: none; stroke: var(--brand); stroke-width: 2; } .chart .lbl-proj { fill: var(--brand); font-size: 11px; }
.chart .bar { fill: var(--brand); } .chart .bar-low { fill: var(--warn); }
.heat { max-width: 100%; height: auto; display: block; } .heat .axis { fill: var(--ink2); font-size: 9px; } .hc { stroke: none; }
.hc0 { fill: var(--h0); } .hc1 { fill: var(--h1); } .hc2 { fill: var(--h2); } .hc3 { fill: var(--h3); } .hc4 { fill: var(--h4); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; color: var(--ink2); font-size: .82rem; margin-top: 6px; }
.legend i { display: inline-block; width: 18px; height: 0; border-top: 2px dashed; vertical-align: middle; margin-right: 4px; }

/* 表格 */
.tablewrap { overflow-x: auto; }
.material-text-preview { max-height: 65vh; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); font: 13px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--ink2); font-weight: 600; font-size: .82rem; background: var(--muted-soft); position: sticky; top: 0; }
th.sortable { cursor: pointer; } th.sortable:hover { color: var(--ink); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.click { cursor: pointer; } tr.click:hover td { background: var(--muted-soft); }
.empty { padding: 28px; text-align: center; color: var(--ink2); }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 10px; opacity: 0; pointer-events: none; transition: .2s; z-index: 100; max-width: 90vw; }
#toast.show { opacity: 1; transform: translate(-50%, 0); } #toast.error { background: var(--bad); color: #fff; } #toast.good { background: var(--good); color: #fff; }
.dialog-bg { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.dialog { background: var(--card); border-radius: 14px; padding: 20px; max-width: 440px; width: 100%; }
.spinner { text-align: center; padding: 60px; color: var(--ink2); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.inline-opts { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-opts .opt { padding: 4px 14px; border-color: var(--line); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip { padding: 2px 10px; border-radius: 8px; background: var(--muted-soft); font-size: .9rem; }
.chip.used { text-decoration: line-through; opacity: .5; }
.cl { display: inline-block; padding: 0 6px; border-radius: 6px; font-weight: 700; }
.cl.right { background: var(--good-soft); color: var(--good); } .cl.miss { background: var(--bad-soft); color: var(--bad); }
.cl s { opacity: .7; margin-right: 4px; }
details.script { margin-top: 8px; } details.script summary { cursor: pointer; color: var(--brand); font-weight: 600; }

.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 64px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--brand); font: inherit; font-weight: 600; font-size: .85rem; cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.pw-toggle:hover { background: var(--brand-soft); }

/* ============================================================
   视觉升级：参考 Uxcel（白底、靛紫主色、大圆角、极淡边框、Inter）
   ============================================================ */
:root {
  --bg: #fafafc; --card: #ffffff; --ink: #05060f; --ink2: rgba(5, 6, 15, .62); --line: rgba(5, 6, 15, .10);
  --brand: #513deb; --brand-ink: #ffffff; --brand-soft: #efecfe;
  --muted-soft: #f3f3f8;
  --shadow: 0 1px 0 rgba(0, 19, 41, .02), 0 10px 32px rgba(0, 19, 41, .03);
  --radius: 20px;
  --lv-none: #e3e3ec; --lv-attempted: #f5a524; --lv-familiar: #b9aeff; --lv-proficient: #7a66f2; --lv-mastered: #3b27c9;
  --h0: #eeeef5; --h1: #d9d3ff; --h2: #b2a6fb; --h3: #7a66f2; --h4: #3b27c9;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0b12; --card: #13131c; --ink: #f4f4f8; --ink2: rgba(244, 244, 248, .62); --line: rgba(255, 255, 255, .10);
    --brand: #8b7bff; --brand-ink: #0b0b12; --brand-soft: #231f4a; --muted-soft: #1b1b27;
    --shadow: none;
    --lv-none: #2a2a3a; --lv-attempted: #f5a524; --lv-familiar: #5f52b8; --lv-proficient: #8b7bff; --lv-mastered: #b9aeff;
    --h0: #1b1b27; --h1: #2c2766; --h2: #4a3fb0; --h3: #7a66f2; --h4: #b9aeff;
  }
}
body { font-family: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif; font-feature-settings: "cv11", "ss01"; letter-spacing: -.003em; }
h1 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); font-weight: 700; letter-spacing: -.025em; }
h2 { font-size: 1.3rem; font-weight: 700; letter-spacing: -.015em; }
h3 { font-weight: 650; letter-spacing: -.01em; }
.eyebrow { font-size: .75rem; font-weight: 650; letter-spacing: .08em; color: var(--brand); text-transform: uppercase; }
.bignum { font-size: 2.2rem; font-weight: 750; letter-spacing: -.03em; }

.topbar { background: rgba(255, 255, 255, .86); backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--line); }
@media (prefers-color-scheme: dark) { .topbar { background: rgba(11, 11, 18, .82); } }
.logo i { border-radius: 9px; background: var(--brand); }
.nav a { border-radius: 10px; font-weight: 550; }
.nav a.active { background: var(--brand-soft); color: var(--brand); }

.card { border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.tile { border-radius: 16px; box-shadow: var(--shadow); }
.btn { border-radius: 10px; font-weight: 600; box-shadow: 0 1px 2px rgba(15, 10, 31, .04), 0 2px 6px rgba(15, 10, 31, .05); }
.btn:hover:not(:disabled) { background: var(--muted-soft); }
.btn.primary { box-shadow: 0 1px 2px rgba(81, 61, 235, .25), 0 4px 12px rgba(81, 61, 235, .22); }
.btn.primary:hover:not(:disabled) { filter: brightness(1.06); }
.btn.ghost { box-shadow: none; }
.btn.sm { border-radius: 9px; }
input[type=text], input[type=password], input[type=number], input[type=date], select, textarea { border-radius: 12px; border-color: var(--line); }
input:focus, select:focus, textarea:focus { border-color: var(--brand); outline: 3px solid var(--brand-soft); outline-offset: 0; }
.badge { font-weight: 600; }

/* 首页主视觉：浅靛紫渐变 + 深色文字 */
.hero { background: linear-gradient(180deg, var(--brand-soft), var(--card) 78%); color: var(--ink); border: 1px solid var(--line); }
.hero .muted, .hero .small { color: var(--ink2); }
.hero .big { color: var(--brand); font-size: 3.2rem; letter-spacing: -.04em; }
.hero .phase { background: var(--card); color: var(--brand); border: 1px solid var(--line); }
.hero .meter { background: rgba(81, 61, 235, .14); }
.hero .meter-fill { background: var(--brand); }
.meter { height: 8px; background: var(--muted-soft); }
.meter-fill { background: var(--brand); }

/* 答题：选项做成大卡片（Uxcel 测验风格） */
.q { border-radius: 16px; padding: 16px 18px; }
.opt { border: 1.5px solid var(--line); border-radius: 14px; padding: 11px 14px; margin: 8px 0; background: var(--card); }
.opt:hover { border-color: var(--brand); background: var(--card); }
.opt.sel { border-color: var(--brand); background: var(--brand-soft); }
.opt.correct { border-color: var(--good); } .opt.wrong { border-color: var(--bad); }
.inline-opts .opt { margin: 0; }
.opt input { accent-color: var(--brand); }
.examhead { border-radius: 16px; position: sticky; padding-top: 14px; overflow: hidden; }
.examprog { position: absolute; left: 0; top: 0; height: 4px; width: 100%; background: var(--muted-soft); }
.examprog > i { display: block; height: 100%; width: 0; background: var(--brand); border-radius: 0 4px 4px 0; transition: width .25s; }
.passage { border-radius: 14px; background: var(--muted-soft); }
.timer { border-radius: 10px; }
.player { border-radius: 14px; border-style: solid; border-color: var(--line); background: var(--brand-soft); }
.tabs { border-radius: 12px; } .tabs button { border-radius: 9px; }
.week .wday, .phase-card, .task { border-radius: 14px; }
.task .ico { border-radius: 12px; }
.dialog { border-radius: 20px; }

/* ===== 课程页（Khan Academy 式：课程 → 单元 → 技能点） ===== */
.lv-none { --c: var(--lv-none); } .lv-attempted { --c: var(--lv-attempted); } .lv-familiar { --c: var(--lv-familiar); }
.lv-proficient { --c: var(--lv-proficient); } .lv-mastered { --c: var(--lv-mastered); }
.segbar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--lv-none); gap: 2px; }
.segbar .seg { background: var(--c); height: 100%; }
.legend2 { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .8rem; color: var(--ink2); }
.legend2 .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c); margin-right: 5px; vertical-align: -1px; }
.card.continue { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; background: linear-gradient(90deg, var(--brand-soft), var(--card)); }
.unit-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.unit-tile { text-align: left; font: inherit; color: inherit; cursor: pointer; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.unit-tile:hover { border-color: var(--brand); transform: translateY(-2px); }
.unit-tile .ut-name { font-weight: 650; font-size: 1.05rem; letter-spacing: -.01em; }
@media (max-width: 860px) { .unit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .unit-grid { grid-template-columns: 1fr; } }
.unit-sec { scroll-margin-top: 76px; }
.skill-list { padding: 6px 8px; }
.skill-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 12px; border-radius: 14px; }
.skill-row + .skill-row { border-top: 1px solid var(--line); border-radius: 0; }
.skill-row:hover { background: var(--muted-soft); border-radius: 14px; }
.skill-row.test { background: transparent; }
.sk-ico { width: 24px; height: 24px; border-radius: 50%; background: var(--c); display: grid; place-items: center; color: #fff; font-size: 13px; font-weight: 700; }
.sk-ico.lv-none { background: transparent; border: 2px solid var(--lv-none); }
.sk-ico.quiz { background: var(--brand-soft); color: var(--brand); }
.sk-name { font-weight: 600; } .sk-tip { color: var(--ink2); font-size: .85rem; line-height: 1.4; }
.sk-stat { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.lvpill { display: inline-block; padding: 1px 10px; border-radius: 99px; font-size: .75rem; font-weight: 650; background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--ink); border: 1px solid color-mix(in srgb, var(--c) 55%, transparent); white-space: nowrap; }
.lvpill.lv-none { color: var(--ink2); }
@media (max-width: 700px) { .skill-row { grid-template-columns: 26px minmax(0, 1fr); } .sk-stat { grid-column: 2; justify-content: flex-start; } .skill-row > :last-child { grid-column: 2; justify-self: start; } }

/* 卡片内的题目不再套第二层边框，用分隔线区分 */
.card > .q:not(.right):not(.miss) { border: 0; border-radius: 0; background: transparent; padding: 16px 0; margin: 0; }
.card > .q:not(.right):not(.miss) + .q:not(.right):not(.miss) { border-top: 1px solid var(--line); }
.card > .q:first-of-type { padding-top: 4px; }

/* ============ 进度页 ============ */
.hero2 { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 28px; background: linear-gradient(135deg, var(--brand-soft), var(--card) 62%); }
.hero2-num { font-size: 4rem; font-weight: 800; letter-spacing: -.045em; line-height: 1; color: var(--brand); margin: 6px 0 14px; }
.hero2-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-content: center; }
.mini { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; }
.mini .mv { font-size: 1.5rem; font-weight: 750; letter-spacing: -.025em; } .mini .mk { font-size: .85rem; color: var(--ink2); } .mini .ms { font-size: .78rem; color: var(--ink2); margin-top: 2px; }
@media (max-width: 800px) { .hero2 { grid-template-columns: 1fr; gap: 18px; } .hero2-num { font-size: 3.2rem; } }
/* 差距条改用主色/琥珀，不再红绿 */
.meter.good .meter-fill { background: var(--lv-proficient); } .meter.warn .meter-fill, .meter.bad .meter-fill { background: var(--lv-attempted); }
.meter-mark { background: var(--ink2); opacity: .55; } .meter-mark.pass { background: var(--lv-attempted); opacity: 1; } .meter-mark.target { background: var(--lv-mastered); opacity: 1; }
.bars .brow .num .badge.good { background: var(--brand-soft); color: var(--brand); }
.chart .line-target { stroke: var(--lv-mastered); } .chart .lbl-target { fill: var(--lv-mastered); }
.chart .line-pass { stroke: var(--lv-attempted); } .chart .lbl-pass { fill: var(--lv-attempted); }
.chart .line-exam { stroke: var(--ink2); } .chart .lbl-exam { fill: var(--ink2); }
.chart .bar { fill: var(--brand); opacity: .88; }
.chart .grid { stroke: var(--line); }
/* 知识点掌握 */
.mastery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 28px; }
.mu .chips2 { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip2 { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 99px; border: 1px solid var(--line); font-size: .85rem; background: var(--card); }
.chip2 .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); } .chip2.lv-none .dot { background: transparent; border: 2px solid var(--lv-none); }
.chip2 em { font-style: normal; color: var(--ink2); font-size: .78rem; }
@media (max-width: 800px) { .mastery { grid-template-columns: 1fr; } }
/* 分段选项卡（时间范围/周切换） */
.tabs.tabs-inline { display: inline-flex; margin: 0; padding: 4px; }
.tabs.tabs-inline button { flex: none; padding: 6px 14px; }
.tabs.tabs-inline button.on { background: var(--card); color: var(--brand); box-shadow: 0 1px 2px rgba(5, 6, 15, .08); }
th { background: var(--muted-soft); }

/* ============ 计划页 ============ */
.journey { position: relative; padding: 22px 12px 0 0; }
.jtrack { position: relative; height: 10px; border-radius: 99px; background: var(--muted-soft); }
.jfill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--lv-familiar), var(--brand)); }
.jmark { position: absolute; top: -3px; width: 4px; height: 16px; background: var(--card); border-radius: 2px; box-shadow: 0 0 0 1.5px var(--line); }
.jnow { position: absolute; top: -26px; transform: translateX(-50%); background: var(--brand); color: var(--brand-ink); font-size: .72rem; font-weight: 650; padding: 1px 8px; border-radius: 99px; white-space: nowrap; }
.jnow::after { content: ''; position: absolute; left: 50%; bottom: -4px; width: 8px; height: 8px; background: var(--brand); transform: translateX(-50%) rotate(45deg); }
.jflag { position: absolute; right: -2px; top: 9px; font-size: 1.1rem; line-height: 1; }
.phases { margin-top: 18px; }
.phase-card { border-radius: 16px; padding: 16px 18px; }
.phase-card.current { background: var(--brand-soft); border-color: var(--brand); }
.ph-name { font-weight: 700; font-size: 1.1rem; letter-spacing: -.015em; margin: 4px 0 2px; }
.ph-bar { height: 6px; border-radius: 99px; background: var(--muted-soft); overflow: hidden; margin-top: 10px; }
.phase-card.current .ph-bar { background: var(--card); }
.ph-bar > div { height: 100%; background: var(--brand); border-radius: 99px; }
.daystrip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.daychip { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px 10px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--card); font: inherit; color: inherit; cursor: pointer; transition: border-color .15s, background .15s; }
.daychip:hover { border-color: var(--brand); }
.daychip.sel { border-color: var(--brand); background: var(--brand-soft); }
.daychip.future { border-style: dashed; }
.dc-w { font-size: .78rem; color: var(--ink2); } .dc-d { font-size: 1.4rem; font-weight: 750; letter-spacing: -.03em; line-height: 1.1; }
.daychip.today .dc-d { color: var(--brand); }
.dc-dots { display: flex; gap: 3px; min-height: 8px; align-items: center; flex-wrap: wrap; justify-content: center; }
.dc-dots i { width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--lv-familiar); } .dc-dots i.on { background: var(--brand); border-color: var(--brand); }
.dc-dots em { font-style: normal; color: var(--ink2); font-size: .75rem; }
.dc-t { position: absolute; top: -9px; background: var(--brand); color: var(--brand-ink); font-size: .65rem; font-weight: 650; padding: 0 7px; border-radius: 99px; }
.insights { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.insight { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px; box-shadow: var(--shadow); }
.insight .ik { font-size: .78rem; font-weight: 650; letter-spacing: .06em; color: var(--ink2); }
.insight .iv { font-size: 1.35rem; font-weight: 750; letter-spacing: -.02em; margin: 4px 0 6px; color: var(--brand); }
.insight p { font-size: .88rem; color: var(--ink2); margin: 0; }
@media (max-width: 800px) { .insights { grid-template-columns: 1fr; } .daystrip { gap: 5px; } .dc-d { font-size: 1.15rem; } }
.task.done { background: var(--brand-soft); } .task.done .ico { background: var(--brand); }
.task .ico { background: var(--brand-soft); } .task { border-radius: 16px; }

/* ============ 管理后台 ============ */
.avatar { display: inline-grid; place-items: center; border-radius: 50%; font-weight: 700; flex: none; background: hsl(var(--h) 75% 91%); color: hsl(var(--h) 55% 30%); }
@media (prefers-color-scheme: dark) { .avatar { background: hsl(var(--h) 35% 24%); color: hsl(var(--h) 85% 82%); } }
.mini.accent { border-color: var(--lv-attempted); background: color-mix(in srgb, var(--lv-attempted) 10%, var(--card)); }
.mini.accent .mv { color: var(--lv-attempted); }
.tabdot { display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin-left: 6px; padding: 0 5px; border-radius: 99px; background: var(--lv-attempted); color: #fff; font-size: .7rem; font-weight: 700; }
.filter-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-pills button { font: inherit; font-size: .85rem; font-weight: 550; padding: 5px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--card); color: var(--ink2); cursor: pointer; }
.filter-pills button em { font-style: normal; margin-left: 6px; opacity: .7; font-size: .78rem; }
.filter-pills button:hover { border-color: var(--brand); }
.filter-pills button.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.search { max-width: 240px; }
.utable td, .utable th { padding: 12px 12px; vertical-align: middle; }
.utable th { text-transform: none; }
.utable th.sortable { user-select: none; } .utable th.asc::after { content: ' ↑'; color: var(--brand); } .utable th.desc::after { content: ' ↓'; color: var(--brand); }
.ucell { display: flex; align-items: center; gap: 12px; }
.uname-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.estcell { min-width: 96px; display: flex; flex-direction: column; gap: 6px; } .estcell .meter { height: 6px; }
.radio-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 10px; }
.radio-card { display: flex; gap: 12px; align-items: flex-start; text-align: left; font: inherit; color: inherit; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 16px; background: var(--card); cursor: pointer; }
.radio-card:hover:not(:disabled) { border-color: var(--brand); }
.radio-card.on { border-color: var(--brand); background: var(--brand-soft); }
.radio-card:disabled { opacity: .55; cursor: not-allowed; }
.rc-dot { flex: none; width: 18px; height: 18px; margin-top: 2px; border-radius: 50%; border: 2px solid var(--lv-none); background: var(--card); }
.radio-card.on .rc-dot { border-color: var(--brand); box-shadow: inset 0 0 0 4px var(--card); background: var(--brand); }
@media (max-width: 600px) { .radio-cards { grid-template-columns: 1fr; } }
.fresh { background: var(--brand-soft); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; margin-bottom: 4px; }
.code-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.code-chip { font: 600 .95rem ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .06em; padding: 6px 14px; border-radius: 10px; border: 1.5px dashed var(--brand); background: var(--card); color: var(--brand); cursor: pointer; }
.code-chip:hover { background: var(--brand); color: var(--brand-ink); }
.code-inline { font: .85rem ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; background: var(--muted-soft); padding: 2px 8px; border-radius: 6px; }
.userhead { display: flex; gap: 18px; align-items: center; background: linear-gradient(135deg, var(--brand-soft), var(--card) 60%); }
.uh-main { min-width: 0; }
.acct-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; flex-wrap: wrap; }
.acct-row + .acct-row { border-top: 1px solid var(--line); }
.hero2-num.sm { font-size: 2.4rem; margin: 0; letter-spacing: -.04em; }
.card.hero2-flat { background: linear-gradient(135deg, var(--brand-soft), var(--card) 62%); }
@media (max-width: 600px) { .grid.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .mini { padding: 12px 14px; } .mini .mv { font-size: 1.3rem; } }

/* ============ 单词卡片（详情版） ============ */
.flash { max-width: 680px; }
.flash.back { align-items: stretch; text-align: left; justify-content: flex-start; cursor: pointer; }
.wd-ipa { font: 1.05rem/1.2 "Segoe UI", "Lucida Sans Unicode", Arial, sans-serif; color: var(--brand); background: none; border: 0; padding: 2px 6px; border-radius: 8px; cursor: pointer; }
.wd-ipa:hover { background: var(--brand-soft); }
.wd-ipa.big { font-size: 1.35rem; }
.wd-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.wd-word { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.wd-back .wd-ipa { padding-left: 0; cursor: default; }
.wd-zh { font-size: 1.15rem; font-weight: 650; margin: 10px 0 8px; }
.wd-pos { display: inline-block; font-size: .8rem; font-weight: 600; color: var(--ink2); background: var(--muted-soft); border-radius: 6px; padding: 1px 8px; margin-right: 8px; vertical-align: 2px; }
.wd-ex { display: flex; gap: 8px; align-items: flex-start; font-family: Georgia, "Times New Roman", serif; font-style: italic; color: var(--ink2); background: var(--muted-soft); border-radius: 12px; padding: 10px 12px; }
.wd-exbtn { flex: none; border: 0; background: var(--card); border-radius: 8px; cursor: pointer; padding: 2px 6px; font-style: normal; }
.wd-sec { margin-top: 14px; }
.wd-label { font-size: .75rem; font-weight: 650; letter-spacing: .08em; color: var(--brand); margin-bottom: 6px; }
.wd-colloc { list-style: none; margin: 0; padding: 0; }
.wd-colloc li { display: flex; gap: 10px; align-items: baseline; padding: 4px 0; border-bottom: 1px dashed var(--line); flex-wrap: wrap; }
.wd-colloc li:last-child { border-bottom: 0; }
.wd-en { font: inherit; font-weight: 650; color: var(--ink); background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
.wd-en:hover { color: var(--brand); text-decoration: underline; }
.wd-cn { color: var(--ink2); font-size: .9rem; }
.wd-morph { background: var(--brand-soft); border-radius: 12px; padding: 10px 12px; line-height: 1.7; }
.wd-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.wchip { font: inherit; font-size: .9rem; font-weight: 600; padding: 4px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; display: inline-flex; align-items: baseline; gap: 6px; }
.wchip em { font-style: normal; font-weight: 400; font-size: .8rem; color: var(--ink2); }
.wchip:hover { border-color: var(--brand); }
.wchip.strong { font-weight: 700; }
.wchip.syn { background: var(--brand-soft); border-color: transparent; color: var(--brand); }
.wchip.ant { background: color-mix(in srgb, var(--lv-attempted) 14%, var(--card)); border-color: transparent; }
.wd-forms { display: flex; flex-wrap: wrap; gap: 10px; }
.wd-form { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; font-size: .75rem; color: var(--ink2); }

/* ============ 词汇表 ============ */
.vsearch { width: 100%; font-size: 1.1rem; padding: 12px 16px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); }
.vsearch:focus { border-color: var(--brand); outline: 3px solid var(--brand-soft); outline-offset: 0; }
.vfilters { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.vlist { display: flex; flex-direction: column; gap: 8px; }
.vrow { background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.vrow:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
.vhead { display: grid; grid-template-columns: minmax(150px, 1.1fr) minmax(0, 2fr) minmax(130px, .8fr); gap: 16px; align-items: center; padding: 12px 16px; cursor: pointer; }
.vword { font-size: 1.15rem; font-weight: 700; letter-spacing: -.01em; overflow-wrap: anywhere; }
.vipa { font: .85rem "Segoe UI", "Lucida Sans Unicode", Arial, sans-serif; color: var(--brand); background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
.vipa:hover { text-decoration: underline; }
.vzh { line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.vzh2 { margin-top: 2px; }
.vmeta { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.vfreq { width: 100%; max-width: 140px; display: flex; flex-direction: column; gap: 3px; align-items: flex-end; }
.vbar { width: 100%; height: 5px; border-radius: 99px; background: var(--muted-soft); overflow: hidden; }
.vbar i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.vdetail { padding: 4px 16px 16px; border-top: 1px dashed var(--line); }
.vglosses > div { padding: 4px 0; line-height: 1.6; }
.wd-exzh { font-family: inherit; font-style: normal; margin-top: 2px; }
mark { background: color-mix(in srgb, var(--lv-attempted) 40%, transparent); color: inherit; border-radius: 4px; padding: 0 1px; }
@media (max-width: 760px) {
  .vhead { grid-template-columns: 1fr; gap: 6px; }
  .vmeta { align-items: flex-start; flex-direction: row; justify-content: space-between; width: 100%; flex-wrap: wrap; }
  .vfreq { flex-direction: row; max-width: none; align-items: center; width: auto; gap: 8px; } .vbar { width: 70px; }
}

/* 手机顶栏：6 个入口放得下；退出登录在「设置」页里 */
.un-short { display: none; }
@media (max-width: 600px) {
  .nav a { padding: 7px 6px; font-size: .88rem; }
  .userbox .uname { display: inline; }
  .un-full { display: none; } .un-short { display: inline; }
  .userbox .logout { display: none; }
  .topbar-in { gap: 6px; padding: 0 12px; }
}

/* 单词练习 */
.quiz { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; padding: 22px; }
.quiz .w { font-size: 2.2rem; font-weight: 800; }
.quiz-zh { font-size: 1.35rem; font-weight: 700; }
.quiz-sent { font-size: 1.15rem; line-height: 1.7; }
.quiz-hint { color: var(--ink2); font-size: .85rem; }
.quiz-opts { display: grid; gap: 10px; }
.quiz-opt { display: flex; gap: 12px; align-items: center; text-align: left; padding: 12px 14px; border: 1.5px solid var(--line, #e6e6ee); border-radius: 14px; background: #fff; font: inherit; cursor: pointer; }
.quiz-opt b { width: 26px; height: 26px; border-radius: 50%; background: #f0eefe; color: #513deb; display: grid; place-items: center; font-size: .8rem; flex: none; }
.quiz-opt:hover:not(:disabled) { border-color: #513deb; }
.quiz-opt.right { border-color: #16a34a; background: #f0fdf4; }
.quiz-opt.wrong { border-color: #dc2626; background: #fef2f2; }
.quiz-opt:disabled { cursor: default; }
.quiz-in { font: inherit; font-size: 1.1rem; padding: 10px 14px; border: 1.5px solid #d9d9e6; border-radius: 12px; width: min(260px, 60vw); text-align: center; }
.quiz-in:focus { outline: none; border-color: #513deb; box-shadow: 0 0 0 3px rgba(81,61,235,.15); }
.quiz-fb { border-radius: 14px; padding: 14px 16px; text-align: left; }
.quiz-fb.ok { background: #f0fdf4; } .quiz-fb.bad { background: #fef2f2; }
.quiz-fb-h { font-weight: 700; margin-bottom: 6px; }
.filter-pills { flex-wrap: wrap; }

/* ============================================================
   多学科：学科主题色（四级沿用默认靛紫；高数橙；Python 青绿）
   ============================================================ */
:root[data-subject="math"] {
  --brand: #c2540a; --brand-ink: #ffffff; --brand-soft: #fff1e6;
  --lv-proficient: #e07a2f; --lv-mastered: #9a4208; --lv-familiar: #f6c9a1;
  --h1: #fde0c8; --h2: #f7b98a; --h3: #e07a2f; --h4: #9a4208;
}
:root[data-subject="python"] {
  --brand: #0b7a6b; --brand-ink: #ffffff; --brand-soft: #e6f6f3;
  --lv-proficient: #2aa391; --lv-mastered: #075a4e; --lv-familiar: #a5ddd3;
  --h1: #cdeee8; --h2: #8ed3c7; --h3: #2aa391; --h4: #075a4e;
}
@media (prefers-color-scheme: dark) {
  :root[data-subject="math"] { --brand: #fb923c; --brand-ink: #1a0e05; --brand-soft: #3a2210; --lv-proficient: #fb923c; --lv-mastered: #fdba74; --lv-familiar: #9a5a2a; --h1: #3a2210; --h2: #8a4a1c; --h3: #d9772a; --h4: #fdba74; }
  :root[data-subject="python"] { --brand: #2dd4bf; --brand-ink: #04120f; --brand-soft: #0f2f2b; --lv-proficient: #2dd4bf; --lv-mastered: #99f6e4; --lv-familiar: #1f6f64; --h1: #0f2f2b; --h2: #1c6b60; --h3: #25b3a1; --h4: #99f6e4; }
}

/* 首页：三个跳动的学科图标 */
.home-head { text-align: center; padding: 8px 0 4px; }
.home-head h1 { font-size: 1.9rem; }
.subj-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 10px; }
.subj { --sb: #513deb; --sb-soft: #efecfe; --sb-ink: #ffffff; background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 28px 22px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; box-shadow: var(--shadow); }
.subj-cet4 { --sb: #513deb; --sb-soft: #efecfe; }
.subj-math { --sb: #c2540a; --sb-soft: #fff1e6; }
.subj-python { --sb: #0b7a6b; --sb-soft: #e6f6f3; }
@media (prefers-color-scheme: dark) {
  .subj-cet4 { --sb: #8b7bff; --sb-soft: #231f4a; --sb-ink: #0b0b12; }
  .subj-math { --sb: #fb923c; --sb-soft: #3a2210; --sb-ink: #1a0e05; }
  .subj-python { --sb: #2dd4bf; --sb-soft: #0f2f2b; --sb-ink: #04120f; }
}
.subj-icon { width: 112px; height: 112px; border-radius: 32px; border: 0; background: var(--sb); color: var(--sb-ink); cursor: pointer; display: grid; place-items: center; box-shadow: 0 14px 28px -10px var(--sb); animation: subj-hop 1.9s cubic-bezier(.3, 0, .4, 1) infinite; animation-delay: var(--delay, 0s); }
.subj-icon:hover, .subj-icon:focus-visible { animation-play-state: paused; transform: translateY(-6px) scale(1.05); outline: none; }
.subj-icon:focus-visible { box-shadow: 0 0 0 4px var(--sb-soft), 0 0 0 6px var(--sb); }
.subj-glyph { font: 800 2.6rem/1 "Inter", -apple-system, "SF Pro Rounded", "PingFang SC", sans-serif; letter-spacing: -1px; }
.subj-shadow { width: 70px; height: 10px; border-radius: 50%; background: rgba(5, 6, 15, .14); margin: 10px 0 14px; animation: subj-shadow 1.9s cubic-bezier(.3, 0, .4, 1) infinite; animation-delay: var(--delay, 0s); }
.subj h2 { margin: 0 0 4px; font-size: 1.3rem; }
.subj-tag { color: var(--ink2); margin-bottom: 10px; }
.subj-scope { list-style: none; padding: 0; margin: 0 0 18px; text-align: left; font-size: .88rem; display: grid; gap: 6px; width: 100%; }
.subj-scope li { position: relative; padding-left: 16px; color: var(--ink); }
.subj-scope li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: var(--sb, var(--brand)); }
.subj-scope.full { font-size: .95rem; }
.subj .subj-go.btn.primary { margin-top: auto; background: var(--sb); color: var(--sb-ink); border-color: var(--sb); }
@keyframes subj-hop { 0%, 100% { transform: translateY(0) scale(1.04, .94); } 18% { transform: translateY(0) scale(.97, 1.05); } 50% { transform: translateY(-22px) scale(1); } 82% { transform: translateY(0) scale(1.04, .94); } }
@keyframes subj-shadow { 0%, 100% { transform: scaleX(1); opacity: .9; } 50% { transform: scaleX(.6); opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .subj-icon, .subj-shadow { animation: none; } }
@media (max-width: 860px) { .subj-grid { grid-template-columns: 1fr; max-width: 460px; margin-left: auto; margin-right: auto; } }

/* 学科首页里的简单列表行 */
.mrow { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px; border-radius: 14px; }
.mrow + .mrow { border-top: 1px solid var(--line); border-radius: 0; }
.mrow[role="link"]:hover { background: var(--muted-soft); border-radius: 14px; }
.mrow .sk-main { flex: 1; min-width: 0; }
.mrow .segbar { margin-top: 6px; }
.grid.c1 { grid-template-columns: minmax(0, 1fr); }

/* 题干里的代码块（Python 题） */
.q .stem pre.code, .stem pre.code { margin: 8px 0 4px; padding: 12px 14px; border-radius: 12px; background: var(--muted-soft); border: 1px solid var(--line); overflow-x: auto; font: 500 .9rem/1.6 ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-weight: 500; color: var(--ink); white-space: pre; tab-size: 4; }
.stem pre.code code { font: inherit; }

/* 未开通的学科 */
.subj.locked { opacity: .7; }
.subj.locked .subj-icon { animation: none; background: var(--muted-soft); color: var(--ink2); box-shadow: none; }
.subj.locked .subj-shadow { animation: none; opacity: .3; }
.subj.locked .subj-go.btn.primary { background: var(--muted-soft); color: var(--ink2); border-color: var(--line); }

/* Python 在线运行 / 编程练习 */
.code-editor, .code-stdin { width: 100%; box-sizing: border-box; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--muted-soft); color: var(--ink); font: 500 .92rem/1.6 ui-monospace, "SF Mono", Menlo, Consolas, monospace; tab-size: 4; resize: vertical; white-space: pre; overflow: auto; }
.code-editor:focus, .code-stdin:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.code-out { margin: 8px 0 0; padding: 12px 14px; border-radius: 14px; background: var(--muted-soft); border: 1px solid var(--line); min-height: 60px; max-height: 340px; overflow: auto; font: 500 .9rem/1.55 ui-monospace, "SF Mono", Menlo, Consolas, monospace; white-space: pre-wrap; word-break: break-word; }
.code-out .err { color: var(--bad, #dc2626); }
code { font: 500 .88em ui-monospace, "SF Mono", Menlo, Consolas, monospace; background: var(--muted-soft); padding: 1px 6px; border-radius: 6px; }

/* 环境检查 */
.env { border-left: 4px solid var(--line); }
.env.ok { border-left-color: #16a34a; } .env.warn { border-left-color: #d97706; } .env.bad { border-left-color: #dc2626; }
.env-rows { margin-top: 10px; display: grid; gap: 10px; }
.env-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--muted-soft); }
.env-ico { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .8rem; color: #fff; background: #16a34a; }
.env-row.warn .env-ico { background: #d97706; } .env-row.error .env-ico { background: #dc2626; }
.env-title { font-weight: 700; }
.env-fix { margin-top: 4px; font-size: .88rem; color: var(--ink); }
.env-fix b { color: var(--brand); }

/* Python 单元讲解 */
.lesson { max-width: 820px; margin: 0 auto; }
.ls-p { line-height: 1.85; margin: 0 0 10px; }
.ls-list { margin: 6px 0 12px; padding-left: 1.3em; line-height: 1.85; }
.ls-list li { margin: 2px 0; }
.ls-tip { margin: 10px 0 14px; padding: 12px 14px; border-radius: 12px; background: var(--brand-soft); border: 1px solid var(--line); line-height: 1.75; }
.ls-code { margin: 8px 0 16px; }
.ls-code pre.code { margin: 0; padding: 12px 14px; border-radius: 12px 12px 0 0; background: var(--muted-soft); border: 1px solid var(--line); overflow-x: auto; font: 500 .9rem/1.6 ui-monospace, "SF Mono", Menlo, Consolas, monospace; white-space: pre; tab-size: 4; }
.ls-code pre.code code { font: inherit; background: none; padding: 0; }
.ls-out { border: 1px solid var(--line); border-top: 0; border-radius: 0 0 12px 12px; padding: 8px 14px 10px; background: var(--card); }
.ls-out-h { font-size: .72rem; letter-spacing: .06em; color: var(--ink2); margin-bottom: 2px; }
.ls-out pre { margin: 0; font: 500 .9rem/1.55 ui-monospace, "SF Mono", Menlo, Consolas, monospace; white-space: pre-wrap; color: var(--brand); }
.ls-code .btn { margin-top: 8px; }
.lesson-link { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; margin: 6px 0 10px; border-radius: 14px; background: var(--muted-soft); border: 1px solid var(--line); }
.lesson-link.todo { background: var(--brand-soft); border-color: var(--brand); }
.ls-formula { margin: 8px 0 12px; padding: 10px 14px; border-radius: 12px; background: var(--brand-soft); font: 600 1rem/1.7 "Cambria Math", "STIX Two Math", "Times New Roman", serif; color: var(--ink); overflow-x: auto; white-space: pre-wrap; }
.ls-flabel { display: inline-block; margin-right: 10px; padding: 1px 8px; border-radius: 999px; background: var(--brand); color: var(--brand-ink); font: 600 .75rem/1.6 -apple-system, "PingFang SC", sans-serif; }
.ls-example { margin: 10px 0 16px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.ls-ex-h { padding: 4px 14px; background: var(--brand); color: var(--brand-ink); font-size: .78rem; font-weight: 700; letter-spacing: .08em; }
.ls-ex-q { padding: 10px 14px 4px; font-weight: 600; line-height: 1.75; }
.ls-steps { margin: 4px 0 6px; padding: 0 14px 0 2.2em; line-height: 1.85; }
.ls-ex-a { padding: 8px 14px 10px; background: var(--muted-soft); border-top: 1px solid var(--line); }

/* KaTeX 公式 */
.tex:not([data-done]) { color: var(--ink2); font-family: ui-monospace, Menlo, monospace; font-size: .85em; }
.tex[data-done] .katex { font-size: 1.1em; }
.ls-formula { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 26px; font: inherit; font-weight: 400; }
.ls-formula .ls-fitem[data-done] .katex { font-size: 1.18em; }
.tex-fail { color: var(--ink2); }
.opt .tex[data-done] .katex, .explain .tex[data-done] .katex { font-size: 1.05em; }
.quiz-opt .tex, .sk-name .tex[data-done] .katex { font-size: 1em; }
