/* englishlearn / 页边 — the working screens
   Sidebar in the library green, canvas on paper. Colour is spent on data and on
   one primary action; everything else is tone steps and hairlines. */

body.app {
  font-variant-numeric: tabular-nums;
  display: grid;
  grid-template-columns: var(--shell-side) minmax(0, 1fr);
  background: var(--canvas-bg);
  color: var(--ink-dark);
  min-height: 100svh;
  font-size: 15px;
}
html[data-theme="day"] { --shell-bg: #e8e6df; --canvas-bg: #f2f1ec; --card-bg: #fbfaf7; --card-2: #efeee8; }
html[data-theme="sepia"] { --shell-bg: #e9dec4; --canvas-bg: #f2e9d6; --card-bg: #fbf4e4; --card-2: #ece1c9; }
html[data-theme="night"] { --shell-bg: #0b0d09; --canvas-bg: #12150f; --card-bg: #191d15; --card-2: #20251b; }
html[data-theme="night"] body.app { color: var(--ink); }

/* the canvas is paper in the two light themes, so its native controls must be light */
.canvas, .page { color-scheme: light; }
html[data-theme="night"] .canvas, html[data-theme="night"] .page { color-scheme: dark; }

/* ---------------------------------------------------------------- sidebar */
.appnav {
  position: sticky;
  top: 0;
  height: 100svh;
  background: var(--shell-bg);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px 12px 14px;
  border-right: 1px solid var(--line);
}
html[data-theme="day"] .appnav { color: var(--ink-dark); border-right-color: #ded6c4; }
html[data-theme="sepia"] .appnav { color: var(--ink-dark); border-right-color: #d8c9aa; }
html[data-theme="day"] .appnav .nav-group-label,
html[data-theme="day"] .appnav .nav-hint { color: #6e7769; }
html[data-theme="sepia"] .appnav .nav-group-label,
html[data-theme="sepia"] .appnav .nav-hint { color: #6f6653; }
html[data-theme="day"] .appnav .nav-item { color: #414a3f; }
html[data-theme="sepia"] .appnav .nav-item { color: #46402f; }
html[data-theme="day"] .appnav .nav-item.on { background: #ded6c4; color: #1d241c; }
html[data-theme="sepia"] .appnav .nav-item.on { background: #d8c9aa; color: #201b12; }
html[data-theme="day"] .appnav .user-meta i { color: #6e7769; }
html[data-theme="sepia"] .appnav .user-meta i { color: #6f6653; }
html[data-theme="day"] .appnav .mark-glyph { border-color: #1d241c; color: #1d241c; }
html[data-theme="sepia"] .appnav .mark-glyph { border-color: #201b12; color: #201b12; }

.mark { display: flex; align-items: center; gap: 10px; padding: 6px 8px 14px; }
.mark-glyph {
  width: 30px; height: 30px; border: 1px solid var(--gold-dim); border-radius: 2px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-read); font-size: 15px; letter-spacing: -0.06em; color: var(--gold);
  flex: none;
}
.mark-glyph span { font-style: italic; }
.mark-text { display: grid; line-height: 1.2; }
.mark-text b { font-family: var(--font-display); font-size: 17px; font-weight: 600; letter-spacing: 0; }
.mark-text i { font-style: normal; font-size: 9.5px; letter-spacing: 0.24em; color: var(--gold-dim); }
html[data-theme="day"] .mark-text i, html[data-theme="sepia"] .mark-text i,
html[data-theme="day"] .buddy-mini-time, html[data-theme="sepia"] .buddy-mini-time,
html[data-theme="day"] .nav-item.on .nav-hint, html[data-theme="sepia"] .nav-item.on .nav-hint { color: var(--ink-dark-2); }
html[data-theme="day"] .nav-item .nav-hint, html[data-theme="sepia"] .nav-item .nav-hint { color: var(--ink-dark-3); }

.app-nav { display: grid; gap: 16px; align-content: start; }
.nav-group { display: grid; gap: 1px; }
.nav-group-label { font-size: 11.5px; color: var(--faint); padding: 0 10px 5px; letter-spacing: 0.02em; }
.nav-item {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  padding: 8px 10px; border-radius: var(--radius-nav); font-size: 14px; color: var(--muted);
  transition: background var(--speed) var(--ease), color var(--speed) var(--ease);
}
.nav-item:hover { background: rgba(242, 213, 116, 0.07); color: var(--ink); }
.nav-item.on { background: rgba(255, 255, 255, 0.08); color: var(--ink); }
.nav-item.on .nav-hint { color: var(--gold-dim); }
.nav-hint { font-size: 11px; color: var(--faint); white-space: nowrap; }

.nav-foot { margin-top: auto; display: grid; gap: 10px; }
.buddy-mini { display: grid; gap: 7px; padding: 10px 10px 9px; border: 1px solid var(--line); border-radius: 2px; }
.buddy-mini-label { font-size: 10.5px; letter-spacing: 0.1em; color: var(--faint); }
.buddy-mini-row { display: flex; align-items: center; gap: -4px; }
.buddy-mini-row .av { margin-right: -6px; border: 1px solid var(--shell-bg); }
.buddy-mini-time { margin-left: auto; font-size: 11px; color: var(--gold-dim); }
html[data-theme="day"] .buddy-mini { border-color: #ded6c4; }
html[data-theme="sepia"] .buddy-mini { border-color: #d8c9aa; }
html[data-theme="day"] .buddy-mini-row .av { border-color: #e8e6df; }
html[data-theme="sepia"] .buddy-mini-row .av { border-color: #e9dec4; }
.user-row { display: flex; align-items: center; gap: 9px; padding: 8px 6px; border-radius: 2px; }
.user-row:hover { background: rgba(255, 255, 255, 0.06); }
.user-meta { display: grid; line-height: 1.25; min-width: 0; }
.user-meta b { font-size: 13px; font-weight: 500; }
.user-meta i { font-style: normal; font-size: 11px; color: var(--faint); }
.user-caret { margin-left: auto; font-size: 12px; color: var(--faint); }

.av {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 999px;
  font-size: 12px; font-weight: 600; letter-spacing: 0; flex: none;
}
.av.sm { width: 24px; height: 24px; font-size: 11px; }
.av.lg { width: 36px; height: 36px; font-size: 14px; }

/* ---------------------------------------------------------------- canvas */
.canvas { min-width: 0; display: flex; flex-direction: column; }

.todaybar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  height: 50px; padding: 0 32px;
  background: var(--canvas-bg);
  border-bottom: 1px solid var(--paper-line);
  font-size: 12.5px; color: var(--ink-dark-2);
}
.todaybar b { color: var(--ink-dark); font-weight: 600; }
html[data-theme="night"] .todaybar b { color: var(--ink); }
.tb-left { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.tb-label { font-size: 11px; letter-spacing: 0.12em; color: var(--ink-dark-3); }
.tb-min { font-variant-numeric: tabular-nums; }
.tb-bar { width: 108px; height: 4px; background: var(--chart-track); display: block; }
.tb-bar span { display: block; height: 100%; background: var(--chart-1); transition: width 500ms var(--ease); }
.tb-right { display: flex; align-items: center; gap: 9px; white-space: nowrap; }
@media (max-width: 620px) { .tb-right .tb-sep, .tb-right .tb-count { display: none; } .todaybar { padding: 0 18px; gap: 10px; } .tb-bar { width: 74px; } .rv-kicker > * { white-space: nowrap; } .tbl th { white-space: normal; } .tbl th, .tbl td { padding-right: 8px; } }
.tb-sep { color: var(--ink-dark-3); }
.tb-streak b { color: var(--gold); }

.page { padding: 30px 32px 80px; max-width: 1220px; width: 100%; }
.page-wide { max-width: 1360px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 22px; }
.page-head h1 { font-family: var(--font-ui); font-size: 25px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; }
.page-find { margin-top: 6px; font-size: 13px; color: var(--ink-dark-2); max-width: 62ch; }
.page-act { display: flex; gap: 8px; flex: none; align-items: center; }

.tabs { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 1px solid var(--paper-line); }
.tab { padding: 8px 2px; margin-right: 18px; font-size: 14px; color: var(--ink-dark-3); border-bottom: 1px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--ink-dark); }
.tab.on { color: var(--ink-dark); border-bottom-color: var(--ink-dark); }

/* --------------------------------------------------------------- surfaces */
.p { background: var(--card-bg); border: 1px solid var(--paper-line); border-radius: 2px; }
.p-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 15px 18px 12px; }
.p-head h2 { font-family: var(--font-ui); font-size: 14px; font-weight: 600; letter-spacing: 0; }
.p-head .p-note { font-size: 12.5px; color: var(--ink-dark-3); }
.p-body { padding: 0 18px 16px; }
.p-body.flush { padding: 0; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--paper-line); background: var(--card-bg); margin-bottom: 18px; }
.kpi { padding: 16px 18px 15px; border-left: 1px solid var(--paper-line); }
.kpi:first-child { border-left: 0; }
.kpi dt { font-size: 12px; color: var(--ink-dark-3); }
.kpi dd { margin: 6px 0 0; font-size: 26px; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.kpi dd small { font-size: 13px; color: var(--ink-dark-2); margin-left: 4px; letter-spacing: 0; }
.kpi .delta { margin-top: 4px; font-size: 11.5px; color: var(--ink-dark-3); }
.kpi .delta.up { color: var(--positive); }
.kpi .delta.down { color: var(--negative); }
.kpi.wide { grid-column: span 2; }
.kpi.answer dd { font-size: 32px; }

.row { display: grid; gap: 18px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.row-32 { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); gap: 18px; align-items: start; }

.tbl { width: 100%; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.tbl th { font-size: 11.5px; font-weight: 400; color: var(--ink-dark-3); text-align: left; padding: 8px 10px 8px 0; border-bottom: 1px solid var(--paper-line); white-space: nowrap; }
.tbl td { padding: 10px 10px 10px 0; border-bottom: 1px solid var(--paper-line); vertical-align: top; color: var(--ink-dark-2); }
.tbl td:first-child { color: var(--ink-dark); }
.tbl .r, .tbl th.r { text-align: right; padding-right: 0; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .en { font-family: var(--font-read); font-size: 15px; color: var(--ink-dark); }

.meta-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--ink-dark-3); }
.meta-dot::before { content: "·"; margin: 0 2px; }

.btn-line { background: transparent; border-color: var(--ink-dark); color: var(--ink-dark); }
.btn-line:hover { background: var(--ink-dark); color: var(--card-bg); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; }
.btn-quiet { height: 32px; padding: 0 10px; font-size: 12.5px; color: var(--ink-dark-2); border: 1px solid transparent; }
.btn-quiet:hover { border-color: var(--paper-line); color: var(--ink-dark); }
.on-paper, .page { --gold: #8a5b18; }
.page .tag { border-color: var(--paper-line); color: var(--ink-dark-2); }
.page .tag-gold { color: #8a5b18; border-color: #b9973f; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 28px; padding: 0 11px; border: 1px solid var(--paper-line); border-radius: 2px; font-size: 12.5px; color: var(--ink-dark-2); background: var(--card-bg); }
.chip:hover { border-color: var(--ink-dark-3); color: var(--ink-dark); }
.chip.on { background: var(--ink-dark); border-color: var(--ink-dark); color: var(--card-bg); }
html[data-theme="night"] .chip.on { background: var(--gold); border-color: var(--gold); color: #14261a; }

.field-inline { display: flex; align-items: center; gap: 10px; }
.input-sm { height: 34px; font-size: 13px; }
.page .input, .page .select, .page .textarea, .modal .input, .modal .select, .modal .textarea {
  background: var(--card-bg); border-color: var(--paper-line); color: var(--ink-dark);
}
.page .input:focus, .page .textarea:focus, .page .select:focus { border-color: var(--ink-dark); }

/* ---------------------------------------------------------------- reader */
.reader-view { display: block; }
.rv-top { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.rv-back { font-size: 13px; color: var(--ink-dark-2); border-bottom: 1px solid var(--paper-line); }
.rv-back:hover { color: var(--ink-dark); border-color: var(--ink-dark); }
.rv-tools { margin-left: auto; display: flex; align-items: center; gap: 6px; }

.reader-grid { display: grid; grid-template-columns: minmax(0, 1fr) 264px; gap: 40px; align-items: start; }
.reader-grid.solo { grid-template-columns: minmax(0, 1fr); }
/* the quiz sits under the reading column, not under the rail */
#rv-quiz { margin-right: 304px; }

.rv-sheet { background: var(--sheet, #fffdf7); border: 1px solid var(--paper-line); padding: 46px 54px 40px; }
html[data-theme="night"] .rv-sheet { background: #191d15; }
.rv-kicker { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--ink-dark-3); letter-spacing: 0.02em; }
.rv-title { margin-top: 14px; font-family: var(--font-display); font-size: 40px; line-height: 1.1; letter-spacing: -0.02em; color: var(--ink-dark); max-width: 22ch; }
html[data-theme="night"] .rv-title { color: var(--ink); }
.rv-intro { margin-top: 16px; padding-left: 14px; border-left: 2px solid var(--chart-2); font-size: 14px; line-height: 1.75; color: var(--ink-dark-2); max-width: 56ch; }
.rv-body { margin-top: 30px; max-width: 66ch; font-family: var(--font-read); font-size: calc(19px * var(--reader-scale, 1)); line-height: var(--read-leading, 1.78); color: var(--ink-dark); }
html[data-theme="night"] .rv-body { color: #e2ddcd; }
html[data-readfont="sans"] .rv-body { font-family: var(--font-ui); font-size: calc(17.5px * var(--reader-scale, 1)); line-height: calc(var(--read-leading, 1.78) - 0.1); }
.rv-body p { margin: 0 0 1.05em; }
.rv-body p.has-note { position: relative; }
.rv-body .gloss { border-bottom: 1px solid #b9973f; }
.rv-body .gloss.seen { border-bottom-color: var(--chart-3); color: inherit; }
.rv-body mark.anno { background: #efe0ab; color: inherit; padding: 0 1px; }
html[data-theme="night"] .rv-body mark.anno { background: #3a3d22; }
.rv-body .chunk-mark { background: #e8e2cd; box-shadow: inset 0 -1px 0 #b9973f; }
.rv-foot { margin-top: 34px; padding-top: 16px; border-top: 1px solid var(--paper-line); display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

.rail { display: grid; gap: 18px; position: sticky; top: 70px; }
.rail-stack { display: grid; gap: 24px; align-content: start; position: sticky; top: 78px; align-self: start; }
.rail-block { border-top: 1px solid var(--paper-line); padding-top: 12px; }
.rail-h { font-size: 11.5px; font-weight: 500; letter-spacing: 0.02em; color: var(--ink-dark-3); }
.rail-note { margin-top: 9px; font-size: 12.5px; line-height: 1.75; color: var(--ink-dark-2); }
.rail-note b { color: var(--ink-dark); font-weight: 500; }
.mark-row { display: grid; grid-template-columns: 1fr auto; gap: 4px; padding: 6px 0; border-bottom: 1px solid var(--paper-line); }
.mark-quote { font-family: var(--font-read); font-size: 13.5px; color: var(--ink-dark); }
.mark-note { font-size: 12px; color: var(--ink-dark-2); margin-top: 3px; }
.mark-del { font-size: 11px; color: var(--ink-dark-3); }
.mark-del:hover { color: var(--negative); }

.read-progress { position: sticky; top: 50px; z-index: 5; height: 2px; background: transparent; }
.read-progress span { display: block; height: 2px; width: 0; background: var(--chart-2); }

/* the questions */
.quiz { margin-top: 34px; border-top: 1px solid var(--paper-line); padding-top: 24px; }
.quiz-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.quiz-h h3 { font-family: var(--font-ui); font-size: 15px; font-weight: 600; }
.quiz-q { padding: 18px 0; border-bottom: 1px solid var(--paper-line); }
.quiz-q:last-child { border-bottom: 0; }
.quiz-q > p { font-family: var(--font-read); font-size: 17px; line-height: 1.5; }
.opts { margin-top: 12px; display: grid; gap: 7px; }
.opt { display: flex; gap: 10px; align-items: baseline; text-align: left; padding: 10px 12px; border: 1px solid var(--paper-line); border-radius: 2px; font-size: 13.5px; color: var(--ink-dark-2); background: var(--card-bg); }
.opt:hover { border-color: var(--ink-dark-3); }
.opt b { font-size: 11px; color: var(--ink-dark-3); font-weight: 400; }
.opt.picked { border-color: var(--ink-dark-2); color: var(--ink-dark); }
.opt.right { border-color: var(--chart-1); background: #eef3e9; color: var(--ink-dark); }
html[data-theme="night"] .opt.right { background: #1d2a1f; }
.opt.wrong { border-color: var(--negative); color: var(--ink-dark); }
.opt[disabled] { cursor: default; }
.quiz-why { margin-top: 10px; font-size: 12.5px; line-height: 1.7; color: var(--ink-dark-2); border-left: 1px solid var(--chart-2); padding-left: 10px; }

/* shadowing */
.shadow { margin-top: 30px; border-top: 1px solid var(--paper-line); padding-top: 22px; }
.shadow-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.shadow-sent { font-family: var(--font-read); font-size: 18px; line-height: 1.6; max-width: 60ch; }
.shadow-sent em { font-style: normal; border-bottom: 1px solid var(--chart-2); }
.rec-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--negative); display: inline-block; }
.rec-bar { height: 4px; background: var(--chart-track); flex: 1; min-width: 80px; }
.rec-bar span { display: block; height: 100%; background: var(--chart-4); width: 0; }

/* -------------------------------------------------------------- practice */
.deck { display: grid; gap: 16px; }
.deck-card { background: var(--card-bg); border: 1px solid var(--paper-line); padding: 34px 36px 28px; min-height: 300px; display: flex; flex-direction: column; }
.deck-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 11.5px; color: var(--ink-dark-3); }
.deck-word { margin-top: 26px; font-family: var(--font-read); font-size: 46px; line-height: 1.05; letter-spacing: -0.02em; color: var(--ink-dark); }
html[data-theme="night"] .deck-word { color: var(--ink); }
.deck-ipa { margin-top: 8px; font-size: 14px; color: var(--ink-dark-3); }
.deck-body { margin-top: 18px; min-height: 92px; }
.deck-body .ctx { font-family: var(--font-read); font-size: 19px; line-height: 1.65; color: var(--ink-dark); max-width: 52ch; }
.deck-body .en { font-family: var(--font-read); font-size: 17px; line-height: 1.6; color: var(--ink-dark-2); }
.deck-body .zh { margin-top: 8px; font-size: 14px; color: var(--ink-dark-3); }
.deck-body .src { margin-top: 14px; font-size: 11.5px; color: var(--ink-dark-3); }
.deck-actions { margin-top: auto; padding-top: 22px; display: flex; gap: 8px; flex-wrap: wrap; }
.deck-actions .btn { flex: 1; min-width: 96px; }
.deck-bar { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--ink-dark-3); }
.deck-bar .track { flex: 1; height: 4px; background: var(--chart-track); }
.deck-bar .track span { display: block; height: 100%; background: var(--chart-1); }

.wrong-item { padding: 16px 0; border-bottom: 1px solid var(--paper-line); display: grid; gap: 8px; }
.wrong-item:last-child { border-bottom: 0; }
.wrong-from { font-size: 11.5px; color: var(--ink-dark-3); }
.wrong-q { font-family: var(--font-read); font-size: 15.5px; line-height: 1.55; }
.wrong-opts { display: grid; gap: 1px; margin: 2px 0 2px; }
.wrong-opts span { display: grid; grid-template-columns: 17px 1fr; gap: 4px; padding: 2px 0; font-size: 13px; line-height: 1.55; color: var(--ink-dark-2); }
.wrong-opts b { font-weight: 500; color: var(--ink-dark-3); }
.wrong-opts .bad { color: #8f3a26; }
.wrong-opts .bad b { color: #8f3a26; }
.wrong-opts .good { color: #2f5a3a; }
.wrong-opts .good b { color: #2f5a3a; }
.wrong-why { font-size: 12.5px; color: var(--ink-dark-2); line-height: 1.7; border-left: 1px solid var(--paper-line); padding-left: 10px; }
.wrong-act { display: flex; gap: 8px; }

/* -------------------------------------------------------------- progress */
.chart { min-height: 200px; }
.chart-tall { min-height: 250px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-wd { font-size: 11.5px; color: var(--ink-dark-3); padding: 0 0 2px 2px; }
.cal-cell { min-height: 62px; padding: 7px 9px; display: flex; flex-direction: column; justify-content: space-between; background: var(--card-2); }
.cal-cell b { font-size: 12.5px; font-weight: 500; color: var(--ink-dark-2); font-variant-numeric: tabular-nums; }
.cal-cell i { font-style: normal; align-self: flex-end; font-size: 11.5px; color: var(--ink-dark-3); font-variant-numeric: tabular-nums; }
.cal-cell.pad { background: transparent; }
.cal-cell.on { background: var(--chart-1); }
.cal-cell.on b, .cal-cell.on i { color: #eef1e6; }
.cal-cell.off { background: transparent; border: 1px dashed var(--paper-line); }
.cal-cell.off i { display: none; }
.cal-cell.best { background: var(--chart-2); }
.cal-cell.best b, .cal-cell.best i { color: #1b2a20; }
.cal-legend { margin-top: 12px; display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--ink-dark-3); }
.cal-swatch { width: 11px; height: 11px; display: inline-block; }
.repile { display: grid; gap: 2px; }
.repile-row { display: grid; grid-template-columns: 1fr 64px 64px 54px; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--paper-line); font-size: 13px; align-items: baseline; }
.repile-row.head { font-size: 11.5px; color: var(--ink-dark-3); }
.repile-row .r { text-align: right; font-variant-numeric: tabular-nums; }
.repile-row .good { color: var(--positive); }
.repile-row .mid { color: var(--ink-dark-2); }

/* ------------------------------------------------------------- community */
.feed { display: grid; gap: 0; }
.post { padding: 20px 0; border-bottom: 1px solid var(--paper-line); }
.post:first-child { padding-top: 4px; }
.post-head { display: flex; align-items: center; gap: 10px; }
.post-who { display: grid; line-height: 1.3; }
.post-who b { font-size: 13.5px; font-weight: 600; }
.post-who i { font-style: normal; font-size: 11.5px; color: var(--ink-dark-3); }
.post-time { margin-left: auto; font-size: 11.5px; color: var(--ink-dark-3); }
.post-body { margin-top: 12px; font-size: 14.5px; line-height: 1.8; color: var(--ink-dark); max-width: 70ch; }
.post-img { margin-top: 12px; border: 1px solid var(--paper-line); max-width: min(420px, 100%); }
.post-img img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.post-act { margin-top: 12px; display: flex; align-items: center; gap: 16px; font-size: 12.5px; color: var(--ink-dark-3); }
.post-act button { font-size: 12.5px; color: var(--ink-dark-3); }
.post-act button:hover { color: var(--ink-dark); }
.post-act button.on { color: var(--chart-2); }
.comments { margin-top: 10px; padding-left: 14px; border-left: 1px solid var(--paper-line); display: grid; gap: 9px; }
.comment { font-size: 13px; line-height: 1.7; color: var(--ink-dark-2); }
.comment b { color: var(--ink-dark); font-weight: 500; margin-right: 6px; }
.comment time { color: var(--ink-dark-3); font-size: 11px; margin-left: 6px; }
.comment-form { margin-top: 4px; display: flex; gap: 8px; }
.comment-form input {
  flex: 1; min-width: 0; height: 34px; padding: 0 10px; font: inherit; font-size: 13px;
  background: var(--card-bg); border: 1px solid var(--paper-line);
  border-radius: var(--radius); color: var(--ink-dark);
}
.comment-form input::placeholder { color: var(--ink-dark-3); }
.composer { padding: 18px; border: 1px solid var(--paper-line); background: var(--card-bg); margin-bottom: 8px; }
.composer textarea { min-height: 76px; }
.composer-foot { margin-top: 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.buddy-row { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--paper-line); }
.buddy-row:last-child { border-bottom: 0; }
.buddy-meta { display: grid; line-height: 1.35; min-width: 0; }
.buddy-meta b { font-size: 13px; font-weight: 500; }
.buddy-meta i { font-style: normal; font-size: 11.5px; color: var(--ink-dark-3); }
.buddy-state { margin-left: auto; font-size: 11px; color: var(--ink-dark-3); text-align: right; }
.buddy-state b { display: block; color: var(--chart-2); font-weight: 500; }

/* ----------------------------------------------------------------- story */
.story-head { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 26px; align-items: start; margin-bottom: 26px; }
.story-cover { border: 1px solid var(--paper-line); }
.story-cover img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.story-intro h1 { font-family: var(--font-display); font-size: 38px; letter-spacing: -0.02em; line-height: 1.05; }
.story-intro p { margin-top: 12px; font-size: 14px; line-height: 1.8; color: var(--ink-dark-2); max-width: 54ch; }
.ch-list { display: grid; }
.ch-item { display: flex; align-items: baseline; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--paper-line); font-size: 14px; }
.ch-item .n { width: 26px; font-size: 11.5px; color: var(--ink-dark-3); }
.ch-item .t { font-family: var(--font-read); font-size: 16px; color: var(--ink-dark); }
.ch-item .w { font-size: 11.5px; color: var(--ink-dark-3); margin-left: auto; }
.ch-item.locked .t { color: var(--ink-dark-3); }
.ch-item.on { background: var(--card-2); margin: 0 -10px; padding-left: 10px; padding-right: 10px; }
.ch-item a:hover .t { color: #8a5b18; }
.ch-rest { padding: 16px 0 0 38px; font-size: 12.5px; line-height: 1.8; color: var(--ink-dark-3); max-width: 62ch; }
.ch-hook { margin-top: 26px; padding: 18px 20px; background: var(--card-2); border-left: 2px solid var(--chart-2); }
.ch-hook .rail-h { color: #8a5b18; }
.ch-hook p { margin-top: 8px; font-family: var(--font-read); font-size: 16px; line-height: 1.6; }
.timer { font-variant-numeric: tabular-nums; }

/* -------------------------------------------------------------- settings */
.set-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 340px); gap: 32px; align-items: start; }
.set-block { padding: 20px 0 22px; border-top: 1px solid var(--paper-line); }
.set-block:first-child { border-top: 0; padding-top: 0; }
.set-h { font-size: 13px; font-weight: 600; }
.set-sub { margin-top: 4px; font-size: 12px; color: var(--ink-dark-3); max-width: 56ch; }
.set-row { margin-top: 14px; display: grid; gap: 10px; }
.set-line { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.set-line label { font-size: 13.5px; }
.set-line .val { font-size: 12px; color: var(--ink-dark-3); font-variant-numeric: tabular-nums; }
.swatches { display: flex; gap: 8px; }
.swatch { width: 54px; height: 36px; border: 1px solid var(--paper-line); border-radius: 2px; position: relative; }
.swatch[aria-pressed="true"] { outline: 1px solid var(--ink-dark); outline-offset: 2px; }
.swatch i { position: absolute; left: 7px; bottom: 6px; font-style: normal; font-size: 9px; letter-spacing: 0.06em; }
.set-preview { position: sticky; top: 70px; }
.preview-sheet { background: var(--sheet, #fffdf7); border: 1px solid var(--paper-line); padding: 26px 26px 22px; }
html[data-theme="night"] .preview-sheet { background: #16211a; }
.preview-sheet h3 { font-family: var(--font-display); font-size: 22px; letter-spacing: -0.01em; }
.preview-body { margin-top: 12px; font-family: var(--font-read); font-size: calc(15px * var(--reader-scale, 1)); line-height: var(--read-leading, 1.78); color: var(--ink-dark); }
html[data-readfont="sans"] .preview-body { font-family: var(--font-ui); }
.preview-note { margin-top: 14px; padding-left: 10px; border-left: 1px solid var(--chart-2); font-size: 11.5px; line-height: 1.7; color: var(--ink-dark-2); }

input[type="range"].slider { -webkit-appearance: none; appearance: none; width: 100%; height: 2px; background: var(--chart-track); }
input[type="range"].slider::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--ink-dark); cursor: grab; }
input[type="range"].slider::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--ink-dark); cursor: grab; border: 0; }

/* ---------------------------------------------------------------- modal */
.modal-back { position: fixed; inset: 0; background: rgba(12, 26, 17, 0.55); display: none; align-items: center; justify-content: center; z-index: 80; padding: 20px; }
.modal-back.on { display: flex; }
.modal { width: min(440px, 100%); background: var(--card-bg); border: 1px solid var(--paper-line); padding: 24px; }
.modal h2 { font-family: var(--font-ui); font-size: 17px; font-weight: 600; }
.modal p { margin-top: 8px; font-size: 13px; line-height: 1.75; color: var(--ink-dark-2); }
.modal-foot { margin-top: 18px; display: flex; gap: 8px; justify-content: flex-end; }

/* -------------------------------------------------------------- join flow */
.join { min-height: 100svh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); }
.join-left { background: var(--ground); color: var(--ink); padding: 46px 52px; display: flex; flex-direction: column; gap: 34px; position: relative; }
.join-left .mark { padding: 0; }
.join-left > div { margin-top: auto; }
.join-left h1 { font-family: var(--font-display); font-size: clamp(34px, 3.6vw, 52px); line-height: 1.02; letter-spacing: -0.03em; }
.join-left p { font-size: 14.5px; line-height: 1.85; color: var(--muted); max-width: 40ch; }
.join-left .join-fine { font-size: 12.5px; line-height: 1.75; color: var(--faint); }
.join-right { background: var(--paper); color: var(--ink-dark); padding: 44px 52px 40px; display: flex; flex-direction: column; }
.join-note { margin-top: auto; padding-top: 44px; max-width: 54ch; font-size: 13px; line-height: 1.85; color: var(--ink-dark-3); }
.join-steps { display: flex; gap: 18px; font-size: 12.5px; color: var(--ink-dark-3); margin-bottom: 26px; }
.join-steps span.on { color: var(--ink-dark); }
.join-steps span.done { color: var(--chart-1); }
.stage-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.stage { text-align: left; padding: 16px 16px 14px; border: 1px solid var(--paper-line); background: var(--card-bg); display: grid; gap: 6px; }
.stage b { font-size: 15px; font-weight: 600; }
.stage span { font-size: 12px; line-height: 1.6; color: var(--ink-dark-3); }
.stage:hover { border-color: var(--ink-dark-3); }
.stage.on { border-color: var(--ink-dark); outline: 1px solid var(--ink-dark); outline-offset: 0; }
.q-wrap { margin-top: 26px; }
.q-num { font-size: 11.5px; color: var(--ink-dark-3); letter-spacing: 0.08em; }
.q-text { margin-top: 10px; font-family: var(--font-read); font-size: 22px; line-height: 1.45; }
.q-opts { margin-top: 16px; display: grid; gap: 8px; }
.q-opts button { text-align: left; padding: 12px 14px; border: 1px solid var(--paper-line); background: var(--card-bg); font-size: 14px; }
.q-opts button:hover { border-color: var(--ink-dark-3); }
.q-opts button.on { border-color: var(--ink-dark); background: var(--card-2); }
.band { display: grid; gap: 8px; margin-top: 16px; padding: 18px; border: 1px solid var(--paper-line); background: var(--card-bg); }
.band .b { font-family: var(--font-display); font-size: 46px; line-height: 1; letter-spacing: -0.02em; }
.band .d { font-size: 13px; line-height: 1.7; color: var(--ink-dark-2); }
.auth-row { display: flex; gap: 10px; margin-top: 16px; }
.auth-btn { flex: 1; height: 46px; border: 1px solid var(--paper-line); background: var(--card-bg); font-size: 14px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.auth-btn:hover { border-color: var(--ink-dark-3); }
.auth-btn .glyph { width: 18px; height: 18px; border-radius: 2px; display: grid; place-items: center; font-size: 10px; color: #fff; background: #2f6b46; }
.auth-btn.qq .glyph { background: #2a6ba8; }

/* ------------------------------------------------------------- responsive */
@media (max-width: 1180px) {
  .reader-grid { grid-template-columns: minmax(0, 1fr); }
  #rv-quiz { margin-right: 0; }
  .rail { position: static; grid-template-columns: 1fr 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi:nth-child(odd) { border-left: 0; }
  .kpi:nth-child(n + 3) { border-top: 1px solid var(--paper-line); }
  .set-grid { grid-template-columns: 1fr; }
  .set-preview { position: static; }
  .join { grid-template-columns: 1fr; }
  .join-left { padding: 34px 28px; gap: 20px; }
  .join-right { padding: 30px 28px 50px; }
}
@media (max-width: 860px) {
  :root { --shell-side: 0px; }
  body.app { grid-template-columns: minmax(0, 1fr); }
  .appnav {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; height: 58px; z-index: 60;
    flex-direction: row; align-items: center; gap: 6px; padding: 0 16px;
    border-right: 0; border-top: 1px solid var(--line); overflow-x: auto;
  }
  .appnav .mark, .appnav .nav-group-label, .appnav .nav-foot, .appnav .nav-hint { display: none; }
  .appnav .app-nav { display: flex; flex-direction: row; gap: 2px; width: 100%; }
  .appnav .nav-group { display: contents; }
  .appnav .nav-item { padding: 7px 4px; font-size: 12.5px; white-space: nowrap; flex: 1; text-align: center; }
  .page { padding: 20px 18px 90px; }
  .todaybar { padding: 0 18px; height: 44px; }
  .tb-bar { width: 64px; }
  .row-2, .row-32, .stage-grid, .row { grid-template-columns: 1fr; }
  .reader-grid { grid-template-columns: 1fr; }
  .rv-sheet { padding: 26px 20px 24px; }
  .rv-title { font-size: 30px; }
  .rail { grid-template-columns: 1fr; }
  .story-head { grid-template-columns: 1fr; }
  .story-cover { max-width: 160px; }
  .page-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .kpis { grid-template-columns: 1fr 1fr; }
}

/* figures line up wherever they sit */
.chart svg text, .page svg text { font-variant-numeric: tabular-nums; }


/* phone pass: iOS zooms a focused field smaller than 16px */
@media (max-width: 760px) {
  input, textarea, select { font-size: 16px; }
  .comment-form input { height: 40px; }
  .btn, .btn-sm, .btn-line { min-height: 40px; }
  .nav-item { min-height: 44px; }
  .chip { min-height: 34px; display: inline-flex; align-items: center; }
}

/* ============================================================ 工作台（dashboard） ============================================================ */
.p { border-radius: 6px; }
.p-head-note { font-size: 12px; color: var(--ink-dark-3); font-variant-numeric: tabular-nums; }
.p-link { font-size: 12.5px; color: var(--gold); text-decoration: none; }
.p-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.p-foot { padding: 0 18px 16px; font-size: 12px; line-height: 1.7; color: var(--ink-dark-3); max-width: 62ch; }

.dash-grid { display: grid; grid-template-columns: 1fr 320px; gap: 18px; align-items: start; }
.dash-col { display: grid; gap: 18px; min-width: 0; }
.dc-main { min-width: 0; }

/* 搜索 */
.dsearch { position: relative; display: flex; align-items: center; gap: 10px; margin-bottom: 18px;
  background: var(--card-bg); border: 1px solid var(--paper-line); border-radius: 6px; padding: 0 14px; height: 46px; }
.ds-icon { font-size: 17px; line-height: 1; color: var(--ink-dark-3); }
.ds-input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; color: var(--ink-dark); font-size: 14.5px; outline: none; }
.ds-input::placeholder { color: var(--ink-dark-3); }
.ds-kbd { font-family: var(--font-ui); font-size: 11px; color: var(--ink-dark-3); border: 1px solid var(--paper-line);
  border-radius: 4px; padding: 2px 6px; }
.ds-out { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 40; background: var(--card-bg);
  border: 1px solid var(--paper-line); border-radius: 6px; overflow: hidden; }
.ds-out li + li { border-top: 1px solid var(--paper-line); }
.ds-out a { display: grid; grid-template-columns: 46px 1fr; gap: 2px 10px; padding: 10px 14px; text-decoration: none; }
.ds-out a:hover { background: var(--card-2); }
.ds-kind { grid-row: span 2; font-size: 11px; color: var(--ink-dark-3); padding-top: 2px; }
.ds-label { font-size: 13.5px; color: var(--ink-dark); line-height: 1.45; }
.ds-meta { font-size: 11.5px; color: var(--ink-dark-3); }
.ds-none { padding: 14px; font-size: 12.5px; color: var(--ink-dark-3); }

/* 继续那张卡 */
.dcontinue { display: grid; grid-template-columns: 1fr 96px; gap: 18px; align-items: center; text-decoration: none;
  background: var(--card-bg); border: 1px solid var(--paper-line); border-radius: 10px; padding: 22px 24px;
  transition: border-color 160ms var(--ease); }
.dcontinue:hover { border-color: var(--ink-dark-3); }
.dc-line { font-size: 12px; color: var(--ink-dark-3); letter-spacing: .02em; }
.dc-title { margin-top: 6px; font-family: var(--font-read); font-weight: 600; font-size: 26px; line-height: 1.25; color: var(--ink-dark); }
.dc-sub { margin-top: 8px; font-size: 13.5px; line-height: 1.7; color: var(--ink-dark-2); max-width: 56ch; }
.dc-bar { margin-top: 14px; height: 4px; background: var(--chart-track); border-radius: 2px; overflow: hidden; max-width: 420px; }
.dc-bar span { display: block; height: 100%; background: var(--chart-1); }
.dc-meta { margin-top: 10px; font-size: 11.5px; color: var(--ink-dark-3); }
.dc-go { justify-self: end; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--gold); }
.dc-go i { font-style: normal; }

/* 今日三件事 */
.dcheck { display: grid; }
.dcheck-row + .dcheck-row { border-top: 1px solid var(--paper-line); }
.dcheck-a { display: grid; grid-template-columns: 20px 1fr auto; gap: 10px; align-items: center; padding: 12px 18px; text-decoration: none; }
.dcheck-a:hover { background: var(--card-2); }
.dcheck-box { width: 16px; height: 16px; border: 1px solid var(--ink-dark-3); border-radius: 3px; display: grid;
  place-items: center; font-size: 10px; line-height: 1; color: var(--card-bg); }
.dcheck-row.done .dcheck-box { background: var(--chart-1); border-color: var(--chart-1); color: #f4f0e2; }
.dcheck-label { font-size: 13.5px; color: var(--ink-dark); }
.dcheck-row.done .dcheck-label { color: var(--ink-dark-3); }
.dcheck-hint { font-size: 11.5px; color: var(--ink-dark-3); }

/* 本周那一格 */
.dstat { padding: 0 18px 10px; display: flex; align-items: baseline; gap: 6px; }
.dstat b { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
.dstat span { font-size: 12px; color: var(--ink-dark-3); }
#chart-week { height: 108px; margin: 0 12px 8px; }

/* 深色小卡 */
.dpromo { display: grid; gap: 6px; padding: 20px; text-decoration: none; border-radius: 10px;
  background: #16321f; color: #eee7d4; }
.dpromo:hover { background: #1b3d26; }
.dp-mark { font-size: 11px; letter-spacing: .1em; color: #c9bd8a; }
.dpromo b { font-family: var(--font-display); font-size: 19px; font-weight: 600; }
.dpromo p { font-size: 12.5px; line-height: 1.7; color: #cfc9b4; }
.dp-go { margin-top: 4px; font-size: 12.5px; color: #e8cf82; }
.dp-go i { font-style: normal; }

@media (max-width: 1180px) {
  .dash-grid { grid-template-columns: 1fr; }
  .dash-col.rail-stack { position: static; }
}
@media (max-width: 760px) {
  .dcontinue { grid-template-columns: 1fr; padding: 18px; }
  .dc-go { justify-self: start; }
  .dc-title { font-size: 22px; }
  .dsearch { height: 44px; }
  .ds-kbd { display: none; }
}

/* 今日学习勾选：用 CSS 画勾，不用字符 */
.dcheck-box { display: inline-grid; place-items: center; width: 18px; height: 18px; border: 1px solid var(--line); border-radius: 3px; background: var(--card-bg); }
.dcheck-box i { width: 9px; height: 5px; border-left: 2px solid var(--card-bg); border-bottom: 2px solid var(--card-bg); transform: rotate(-45deg) translate(1px, -1px); opacity: 0; }
.dcheck-row.done .dcheck-box { background: var(--chart-1); border-color: var(--chart-1); }
.dcheck-row.done .dcheck-box i { opacity: 1; }
.dcheck-row.done .dcheck-label { color: var(--ink-dark-3); }


/* 工作台的「最近读过」：表格不要顶到卡片外 */
#dtable { width: 100%; table-layout: fixed; }
#dtable th:first-child, #dtable td:first-child { width: 46%; }
#dtable th:nth-child(2), #dtable td:nth-child(2) { width: 10%; }
#dtable th, #dtable td { padding-right: 6px; }
#dtable th:last-child, #dtable td:last-child { padding-right: 0; text-align: right; }
#dtable .en { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- 义项（释义 + 例句） ---- */
.senses { margin: 0; padding: 0; list-style: none; display: grid; gap: 14px; }
.sense { display: grid; gap: 4px; }
.s-head { display: flex; align-items: baseline; gap: 8px; }
.s-pos { font-family: var(--font-mark); font-size: 12px; color: var(--gold); letter-spacing: .04em; }
.s-zh { font-size: 17px; font-weight: 600; color: var(--ink-dark); }
.s-en { margin: 0; font-size: 14.5px; line-height: 1.7; color: var(--ink-dark-2); }
.s-ex { margin: 2px 0 0; padding-left: 12px; border-left: 2px solid var(--chart-track); font-family: var(--font-read); font-size: 15px; line-height: 1.7; color: var(--ink-dark); }

/* ---- 拼写 ---- */
.spell-wrap { display: grid; place-items: start; }
.spell-card { width: 100%; max-width: 760px; display: grid; gap: 14px; padding: 26px 28px 22px; background: var(--card-bg); border-radius: 6px; }
.sp-zh { margin: 0; font-family: var(--font-display); font-size: 30px; font-weight: 600; line-height: 1.35; color: var(--ink-dark); }
.sp-ipa { margin: 0; display: flex; align-items: center; gap: 10px; font-size: 14.5px; color: var(--ink-dark-2); }
.sp-slots { display: flex; flex-wrap: wrap; gap: 6px; min-height: 44px; }
.sp-slot { background: var(--card-2); border: 1px solid var(--line); border-radius: 3px; display: grid; place-items: center; width: 28px; height: 38px; border-bottom: 1.5px solid var(--line); font-family: var(--font-read); font-size: 20px; color: var(--ink-dark-2); }
.sp-slot.on { color: var(--ink-dark); border-bottom-color: var(--ink-dark); }
.sp-slot.off { color: var(--negative); border-bottom-color: var(--negative); }
.sp-input { width: 100%; max-width: 460px; height: 44px; font-size: 17px; font-family: var(--font-ui); letter-spacing: .01em; }
.sp-tip { margin: 0; min-height: 22px; font-size: 13.5px; line-height: 1.7; color: var(--ink-dark-2); }
.sp-tip b { color: var(--ink-dark); }
.sp-act { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-top: 6px; }
.sp-act .btn-wide { min-width: 132px; }
.sp-diff { font-family: var(--font-read); font-size: 15px; letter-spacing: .02em; }
.sp-diff i { font-style: normal; }
.sp-diff i.same { color: var(--positive); }
.sp-diff i.diff { color: var(--negative); text-decoration: underline; }
.sp-empty { margin: 0; font-size: 15px; color: var(--ink-dark-2); }
@media (max-width: 760px) {
  .spell-card { padding: 20px 18px 18px; }
  .sp-zh { font-size: 24px; }
  .sp-slot { width: 24px; height: 34px; font-size: 17px; }
}

/* ============================================================
   第十三版：横带 · 渐层底 · 看板
   一块通栏横带先定调子，下面的看板两列分工；底色是一张渐层的纸，
   菜单用半透明加模糊融进页面，不再用一条硬边把左右切开。
   ============================================================ */
:root {
  --tint-sand: #f7f3e8;
  --tint-mint: #eef2ea;
  --tint-sky: #edf1f4;
  --tint-rose: #f7eff0;
}
html[data-theme="sepia"] { --tint-sand: #f6eddc; --tint-mint: #f0ecdc; --tint-sky: #f1eee3; --tint-rose: #f7ede6; }
html[data-theme="night"] { --tint-sand: #171b13; --tint-mint: #131a14; --tint-sky: #12181a; --tint-rose: #1a1517; }

/* 纸的渐层：从上往下略深一点，所有横带都落在它上面 */
html[data-theme="day"] body.app { background: linear-gradient(177deg, #f8f6f0 0%, #f3f0e8 38%, #ece8dc 100%) fixed; }
html[data-theme="sepia"] body.app { background: linear-gradient(177deg, #f7efdd 0%, #f2e8d3 40%, #eadfc6 100%) fixed; }
html[data-theme="night"] body.app { background: linear-gradient(177deg, #14170f 0%, #11150e 45%, #0c0f0a 100%) fixed; }

/* 菜单与顶栏：半透明 + 模糊，边界化在纸里 */
.appnav {
  background: color-mix(in srgb, var(--shell-bg) 78%, transparent);
  backdrop-filter: blur(14px) saturate(130%);
  border-right-color: color-mix(in srgb, var(--line) 55%, transparent);
}
html[data-theme="day"] .appnav,
html[data-theme="sepia"] .appnav {
  background: color-mix(in srgb, var(--shell-bg) 72%, transparent);
  border-right-color: color-mix(in srgb, #ded6c4 65%, transparent);
}
.todaybar {
  background: color-mix(in srgb, var(--canvas-bg) 68%, transparent);
  backdrop-filter: blur(12px) saturate(130%);
  border-bottom-color: color-mix(in srgb, var(--paper-line) 55%, transparent);
}

/* ------------------------------------------------ 通栏横带 */
.head-band {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  padding: 34px 34px 24px;
  margin-bottom: 22px;
  background: var(--tint-sand);
  isolation: isolate;
}
.hb-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 28%;
  opacity: 0.34; filter: saturate(0.72) contrast(0.96);
  z-index: -2;
}
.hb-veil {
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(250, 248, 242, 0.42) 0%, rgba(250, 248, 242, 0.86) 58%, rgba(250, 248, 242, 0.97) 100%);
}
html[data-theme="night"] .hb-veil { background: linear-gradient(180deg, rgba(16, 19, 13, 0.5) 0%, rgba(16, 19, 13, 0.9) 60%, rgba(16, 19, 13, 0.98) 100%); }
.hb-inner { position: relative; }
.hb-inner h1 {
  font-family: var(--font-display);
  font-size: clamp(25px, 2.3vw, 31px);
  font-weight: 600; letter-spacing: -0.015em; line-height: 1.15;
  color: var(--ink-dark);
}
.hb-line { margin: 8px 0 16px; max-width: 54ch; font-size: 15px; line-height: 1.8; color: var(--ink-dark-2); }
.tracks { display: flex; flex-wrap: wrap; gap: 8px; }
.track {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 8px 14px; border-radius: 8px;
  background: rgba(255, 253, 246, 0.86);
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  font-size: 14px; color: var(--ink-dark-2);
  transition: background var(--speed) var(--ease), color var(--speed) var(--ease), transform var(--speed) var(--ease);
}
.track em { font-style: normal; font-size: 12.5px; color: var(--ink-dark-3); font-variant-numeric: tabular-nums; }
.track:hover { background: #fffdf7; transform: translateY(-1px); }
.track.on { background: var(--ink-dark); border-color: var(--ink-dark); color: #f7f4ea; }
.track.on em { color: #cfc9ba; }
html[data-theme="night"] .track { background: #20251b; color: var(--ink-dark-2); }
html[data-theme="night"] .track.on { background: #e8e3d3; color: #14170f; }

/* ------------------------------------------------ 看板 */
.kan {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.85fr);
  gap: 22px;
  align-items: start;
}
.kan-col { display: grid; gap: 16px; align-content: start; min-width: 0; }
.kan-col.stick { position: sticky; top: 74px; }
.p-note { font-size: 12px; color: var(--ink-dark-3); font-variant-numeric: tabular-nums; }
.p.tint-mint { background: var(--tint-mint); }
.p.tint-sand { background: var(--tint-sand); }
.p.tint-sky { background: var(--tint-sky); }
.p.tint-rose { background: var(--tint-rose); }

/* ------------------------------------------------ 拼写卡 */
.spell {
  background: var(--card-bg);
  border: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
  border-radius: 14px;
  padding: 24px 28px 22px;
}
.spell-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--ink-dark-3); }
.spell-track { letter-spacing: 0.02em; }
.spell-count { font-variant-numeric: tabular-nums; }
.spell-zh { font-family: var(--font-read); font-size: clamp(25px, 2.5vw, 33px); line-height: 1.34; margin: 16px 0 6px; color: var(--ink-dark); }
.spell-ipa { display: flex; align-items: center; gap: 12px; margin: 0 0 20px; font-size: 14px; color: var(--ink-dark-3); }
.sp-say { font-size: 12.5px; color: var(--gold); border-bottom: 1px solid rgba(138, 91, 24, 0.32); padding-bottom: 1px; }
.spell-slots { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.spell-slots .sp-slot { width: 34px; height: 46px; font-size: 20px; }
.spell-input { height: 46px; font-size: 17px; max-width: 460px; }
.spell-tip { min-height: 22px; margin: 12px 0 20px; font-size: 14px; line-height: 1.7; color: var(--ink-dark-2); }
.spell-tip b { color: var(--ink-dark); }
.spell-act { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }

/* ------------------------------------------------ 右侧小件 */
.dots { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 12px; }
.dot { width: 15px; height: 15px; border-radius: 999px; background: var(--card-2); border: 1px solid var(--line); }
.dot.on { background: var(--chart-1); border-color: var(--chart-1); }
.dot.bad { background: var(--negative); border-color: var(--negative); }
.dot.skip { background: transparent; border-style: dashed; border-color: var(--ink-dark-3); }
.dot.now { background: var(--ink-dark); border-color: var(--ink-dark); box-shadow: inset 0 0 0 3px var(--card-bg); }
.prog-bar { height: 6px; border-radius: 999px; background: var(--chart-track); overflow: hidden; margin: 12px 0 10px; }
.prog-bar span { display: block; height: 100%; border-radius: 999px; background: var(--chart-1); transition: width 420ms var(--ease); }
.mini-kpi { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 12px 0 10px; }
.mini-kpi dt { font-size: 12.5px; color: var(--ink-dark-3); }
.mini-kpi dd { margin: 3px 0 0; font-size: 21px; font-weight: 600; color: var(--ink-dark); font-variant-numeric: tabular-nums; }

@media (max-width: 1180px) {
  .kan { grid-template-columns: 1fr; }
  .kan-col.stick { position: static; }
  .kan-col.stick { display: grid; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .head-band { padding: 24px 20px 18px; border-radius: 10px; }
  .hb-inner h1 { font-size: 27px; }
  .hb-line { font-size: 14px; }
  .track { padding: 7px 12px; font-size: 13.5px; }
  .spell { padding: 20px 18px 18px; border-radius: 12px; }
  .kan-col.stick { grid-template-columns: 1fr; }
  .spell-slots .sp-slot { width: 30px; height: 42px; }
}

/* 横带里的标题行与搜索框：去掉它们自己的外边距 */
.head-band .page-head { margin: 0 0 16px; padding: 0; }
.head-band .dsearch { margin: 0; background: rgba(255, 253, 246, 0.9); }
.head-band .dconfirm { margin: 0; }

/* iPhone 上的按钮排布：主按钮独占一行，三个次要按钮在下面平分 */
@media (max-width: 760px) {
  .spell-act { display: flex; flex-wrap: wrap; gap: 10px; }
  .spell-act .btn { order: -1; flex: 1 1 100%; }
  .spell-act .btn-quiet { flex: 1 1 0; min-width: 0; text-align: center; }
  .appnav .nav-item { font-size: 11.5px; padding: 6px 2px; }
  .appnav .nav-item .nav-hint { display: none; }
}

/* 合并后的「今天」面板：到期生词并进来，不再单独占一块 */
.p-due {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 14px; padding-top: 12px;
  box-shadow: inset 0 1px 0 var(--line-soft);
}
.p-due .dstat { margin: 0; }

/* 社区的配图：和所有横版插画一个形状 */
.post-img { aspect-ratio: 16 / 10; object-fit: cover; }

/* 应用内卡片跟公开页统一的圆角尺度 */
.p, .step, .band, .head-band { border-radius: 14px; }
.dcontinue { border-radius: 14px; }
.spell-card, .deck-card { border-radius: 16px; }
