/* ===================================================================
 * app.css —— Python 后端 104 天作战计划
 * 深色为主 + 浅色可切换；纯 CSS 变量，无外部依赖
 * =================================================================== */

/* ---------------- tokens ---------------- */
:root {
  --bg: #080a0f;
  --bg-2: #0c0f15;
  --panel: #11151d;
  --panel-2: #171c26;
  --line: #242b39;
  --line-soft: #1a202b;
  --txt: #e9edf5;
  --txt-2: #a2adc0;
  --txt-3: #6a7688;
  --acc: #6d8bff;
  --acc-2: #a9bcff;
  --acc-dim: rgba(109, 139, 255, .15);
  --ok: #3ddc9a;
  --ok-dim: rgba(61, 220, 154, .14);
  --warn: #f5b755;
  --warn-dim: rgba(245, 183, 85, .14);
  --bad: #ff6b63;
  --bad-dim: rgba(255, 107, 99, .14);
  --purple: #b18cff;
  --purple-dim: rgba(177, 140, 255, .14);
  --shadow: 0 20px 48px rgba(0, 0, 0, .5);
  --r: 16px;
  --r-sm: 10px;
  --mono: ui-monospace, "Cascadia Mono", "Consolas", "SF Mono", monospace;
  --sans: "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

html[data-theme="light"] {
  --bg: #f2f5fa;
  --bg-2: #e9eef7;
  --panel: #ffffff;
  --panel-2: #f6f9fd;
  --line: #dce4f0;
  --line-soft: #e8eef7;
  --txt: #16202f;
  --txt-2: #4a5c73;
  --txt-3: #8595aa;
  --acc: #2563eb;
  --acc-2: #1d4ed8;
  --acc-dim: rgba(37, 99, 235, .10);
  --ok: #0e9f6e;
  --ok-dim: rgba(14, 159, 110, .12);
  --warn: #b8730a;
  --warn-dim: rgba(184, 115, 10, .12);
  --bad: #d13a2f;
  --bad-dim: rgba(209, 58, 47, .10);
  --purple: #7c3aed;
  --purple-dim: rgba(124, 58, 237, .10);
  --shadow: 0 8px 24px rgba(20, 40, 80, .10);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
/* 关键：很多容器元素被设成了 display:flex/grid，会盖掉 [hidden] 的默认 display:none。
   这里统一兜底，保证用 hidden 属性控制显示的逻辑真的生效。 */
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--txt);
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--acc); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, kbd { font-family: var(--mono); }
::selection { background: var(--acc-dim); }

/* scrollbar */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--txt-3); }

/* ================= boot ================= */
#boot {
  position: fixed; inset: 0; display: grid; place-items: center;
  background: radial-gradient(1200px 700px at 50% 0%, #16233a 0%, var(--bg) 60%);
  z-index: 999; transition: opacity .25s ease;
}
.boot-in { text-align: center; }
.boot-logo {
  width: 66px; height: 66px; margin: 0 auto 18px; border-radius: 18px;
  display: grid; place-items: center; font-weight: 800; font-size: 24px; letter-spacing: 1px;
  background: linear-gradient(135deg, var(--acc), var(--purple)); color: #fff;
  box-shadow: 0 12px 40px var(--acc-dim);
}
.boot-title { font-size: 19px; font-weight: 650; letter-spacing: .5px; }
.boot-sub { color: var(--txt-3); font-size: 13px; margin-top: 8px; max-width: 420px; }
.boot-sub code { font-size: 11px; color: var(--bad); }
.boot-bar { width: 220px; height: 3px; background: var(--line); border-radius: 3px; margin: 20px auto 0; overflow: hidden; }
.boot-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--acc), var(--purple)); transition: width .2s ease; }

/* ================= layout ================= */
#app { display: grid; grid-template-columns: 236px 1fr; height: 100vh; overflow: hidden; }

.side {
  background: var(--bg-2);
  border-right: 1px solid var(--line-soft);
  display: flex; flex-direction: column; min-height: 0;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 18px 16px 14px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--acc), var(--purple)); color: #fff;
  font-weight: 800; font-size: 14px; flex: 0 0 auto;
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { font-size: 14px; font-weight: 650; letter-spacing: .2px; }
.brand-text span { font-size: 11.5px; color: var(--txt-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nav { flex: 1; overflow-y: auto; padding: 4px 8px 12px; min-height: 0; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm);
  color: var(--txt-2); font-size: 13.5px; position: relative; margin-bottom: 1px;
  transition: background .12s, color .12s;
}
.nav-item:hover { background: var(--panel); color: var(--txt); text-decoration: none; }
.nav-item.on { background: var(--acc-dim); color: var(--acc-2); font-weight: 600; }
.nav-item.on::before {
  content: ''; position: absolute; left: -8px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 17px; border-radius: 0 3px 3px 0; background: var(--acc);
}
.nav-ico { width: 17px; text-align: center; opacity: .85; font-size: 14px; }
.nav-txt { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-dot {
  font-style: normal; font-size: 10.5px; font-weight: 700; min-width: 19px; height: 17px;
  padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff;
  display: grid; place-items: center;
}
.nav-dot-soft { background: var(--purple); }

.side-foot { padding: 10px 12px 14px; border-top: 1px solid var(--line-soft); }
.side-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.side-tip { font-size: 11px; color: var(--txt-3); line-height: 1.45; }
.chip {
  font-size: 11.5px; padding: 3px 8px; border-radius: 7px;
  background: var(--ok-dim); color: var(--ok); font-weight: 600;
}
.chip-dim { background: var(--panel); color: var(--txt-3); font-weight: 500; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar {
  height: 52px; flex: 0 0 52px; display: flex; align-items: center; gap: 12px;
  padding: 0 20px; border-bottom: 1px solid var(--line-soft); background: var(--bg);
  position: sticky; top: 0; z-index: 20;
}
.crumbs { font-size: 14.5px; font-weight: 620; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs small { color: var(--txt-3); font-weight: 400; font-size: 12.5px; margin-left: 8px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.today-chip { font-size: 12px; color: var(--txt-3); font-variant-numeric: tabular-nums; }
.icon-btn {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel); color: var(--txt-2); cursor: pointer; font-size: 13px;
  display: grid; place-items: center; transition: .12s;
}
.icon-btn:hover { background: var(--panel-2); color: var(--txt); border-color: var(--txt-3); }
.only-mobile { display: none; }

.view { flex: 1; overflow-y: auto; padding: 22px 24px 60px; min-height: 0; }
.view > * + * { margin-top: 16px; }

/* ================= panel ================= */
.panel {
  background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--r);
  overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; gap: 10px; padding: 13px 16px;
  border-bottom: 1px solid var(--line-soft);
}
.panel-head h3 { margin: 0; font-size: 14px; font-weight: 640; flex: 1; letter-spacing: .2px; }
.panel-right { display: flex; gap: 8px; align-items: center; }
.panel-body { padding: 16px; }
.panel-body.flush { padding: 0; }

.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--txt-2); }
.dim { color: var(--txt-3); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
.mb0 { margin-bottom: 0; }

/* ================= buttons ================= */
.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  padding: 7px 14px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--txt); font-size: 13px; font-family: inherit;
  cursor: pointer; transition: .13s; font-weight: 500; white-space: nowrap;
}
.btn:hover { border-color: var(--txt-3); background: var(--panel); }
.btn:active { transform: translateY(1px); }
.btn-pri { background: var(--acc); border-color: var(--acc); color: #fff; font-weight: 600; }
.btn-pri:hover { background: var(--acc-2); border-color: var(--acc-2); }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #04150f; font-weight: 650; }
.btn-ok:hover { filter: brightness(1.08); }
.btn-bad { background: var(--bad-dim); border-color: var(--bad); color: var(--bad); }
.btn-warn { background: var(--warn-dim); border-color: var(--warn); color: var(--warn); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: 7px; }
.btn-lg { padding: 11px 22px; font-size: 14.5px; border-radius: 11px; }
.btn[disabled] { opacity: .42; cursor: not-allowed; }
.btn-block { width: 100%; }

/* ================= chips / tabs ================= */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-btn {
  padding: 5px 11px; border-radius: 8px; border: 1px solid var(--line);
  background: transparent; color: var(--txt-2); font-size: 12.5px; cursor: pointer;
  font-family: inherit; transition: .12s; display: inline-flex; align-items: center; gap: 5px;
}
.chip-btn:hover { border-color: var(--txt-3); color: var(--txt); }
.chip-btn.on { background: var(--acc-dim); border-color: var(--acc); color: var(--acc-2); font-weight: 600; }
.chip-btn em { font-style: normal; font-size: 10.5px; opacity: .75; }
.chip-btn.on em { opacity: 1; }

.tabs { display: flex; gap: 3px; border-bottom: 1px solid var(--line-soft); margin-bottom: 16px; overflow-x: auto; }
.tab {
  padding: 8px 14px; border: none; background: transparent; color: var(--txt-2);
  font-size: 13.5px; cursor: pointer; font-family: inherit; border-bottom: 2px solid transparent;
  margin-bottom: -1px; white-space: nowrap; transition: .12s;
}
.tab:hover { color: var(--txt); }
.tab.on { color: var(--acc-2); border-bottom-color: var(--acc); font-weight: 600; }
.tab em { font-style: normal; font-size: 11px; opacity: .7; margin-left: 3px; }

/* ================= badges / stats ================= */
.badge {
  display: inline-block; padding: 1px 7px; border-radius: 6px; font-size: 11px;
  background: var(--panel-2); color: var(--txt-2); border: 1px solid var(--line-soft);
  font-weight: 500; white-space: nowrap;
}
.badge-acc { background: var(--acc-dim); color: var(--acc-2); border-color: transparent; }
.badge-ok { background: var(--ok-dim); color: var(--ok); border-color: transparent; }
.badge-warn { background: var(--warn-dim); color: var(--warn); border-color: transparent; }
.badge-bad { background: var(--bad-dim); color: var(--bad); border-color: transparent; }
.badge-purple { background: var(--purple-dim); color: var(--purple); border-color: transparent; }

.stat { background: var(--panel-2); border: 1px solid var(--line-soft); border-radius: var(--r-sm); padding: 13px 14px; }
.stat-v { font-size: 23px; font-weight: 720; letter-spacing: -.5px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat-l { font-size: 12px; color: var(--txt-2); margin-top: 3px; }
.stat-s { font-size: 11px; color: var(--txt-3); margin-top: 2px; }
.stat-acc .stat-v { color: var(--acc-2); }
.stat-ok .stat-v { color: var(--ok); }
.stat-warn .stat-v { color: var(--warn); }
.stat-bad .stat-v { color: var(--bad); }
.stat-purple .stat-v { color: var(--purple); }

/* ================= progress ================= */
.bar { height: 6px; background: var(--line-soft); border-radius: 4px; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--acc), var(--acc-2)); border-radius: 4px; transition: width .3s ease; }
.bar-ok i { background: linear-gradient(90deg, var(--ok), #55e0b0); }
.bar-warn i { background: linear-gradient(90deg, var(--warn), #ffd28a); }
.bar-sm { height: 4px; }

.ring { position: relative; display: grid; place-items: center; }
.ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--line-soft); stroke-width: 7; }
.ring-fg { fill: none; stroke: var(--acc); stroke-width: 7; stroke-linecap: round; transition: stroke-dashoffset .5s ease; }
.ring-txt { text-align: center; }
.ring-txt b { display: block; font-size: 20px; font-weight: 720; letter-spacing: -.5px; }
.ring-txt span { font-size: 10.5px; color: var(--txt-3); }

.bars { display: flex; align-items: flex-end; gap: 5px; }
.bar-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; align-items: center; gap: 5px; }
.bar-fill { width: 100%; max-width: 30px; background: linear-gradient(180deg, var(--acc), var(--purple)); border-radius: 4px 4px 2px 2px; min-height: 3px; }
.bar-lab { font-size: 9.5px; color: var(--txt-3); white-space: nowrap; }

/* ================= list ================= */
.bullets { margin: 0; padding-left: 18px; }
.bullets li { margin: 4px 0; color: var(--txt-2); }
.bullets li::marker { color: var(--acc); }
.bullets strong { color: var(--txt); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 7px 14px; margin: 0; }
.kv dt { color: var(--txt-3); font-size: 12.5px; }
.kv dd { margin: 0; font-size: 13px; }

.empty { text-align: center; padding: 44px 20px; color: var(--txt-3); }
.empty-ico { font-size: 30px; opacity: .28; margin-bottom: 10px; }
.empty-t { font-size: 14px; color: var(--txt-2); font-weight: 600; margin-bottom: 5px; }
.empty-s { font-size: 12.5px; margin-bottom: 14px; }

/* ================= cards (八股) ================= */
.card-wrap { display: grid; gap: 12px; }
.qcard {
  background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--r);
  padding: 15px 17px; transition: .14s;
}
.qcard:hover { border-color: var(--line); }
.qcard.due { border-left: 3px solid var(--acc); }
.qcard.mastered { border-left: 3px solid var(--ok); }
.q-head { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 8px; }
.q-cat { font-size: 11px; color: var(--acc-2); background: var(--acc-dim); padding: 2px 7px; border-radius: 5px; white-space: nowrap; flex: 0 0 auto; margin-top: 1px; }
.q-q { font-weight: 620; font-size: 14.5px; line-height: 1.5; flex: 1; }
.q-a { color: var(--txt-2); font-size: 13.5px; line-height: 1.72; margin-top: 8px; padding-top: 10px; border-top: 1px dashed var(--line-soft); }
.q-a code, .q-a strong { color: var(--txt); }
.q-a code { background: var(--panel-2); padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }
.q-code {
  background: #0a0e15; border: 1px solid var(--line-soft); border-radius: var(--r-sm);
  padding: 12px 14px; overflow-x: auto; font-size: 12.5px; line-height: 1.65;
  color: #c8d6ea; margin-top: 10px; white-space: pre;
}
html[data-theme="light"] .q-code { background: #0f172a; color: #d5e0f0; }
.q-foot { display: flex; align-items: center; gap: 7px; margin-top: 11px; flex-wrap: wrap; }
.grade-row { display: flex; gap: 6px; margin-left: auto; }

/* ================= algo ================= */
.prob {
  background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--r);
  padding: 13px 16px; transition: .14s;
}
.prob:hover { border-color: var(--line); }
.prob.done { border-left: 3px solid var(--ok); }
.prob.review { border-left: 3px solid var(--warn); }
.prob-head { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.prob-title { font-weight: 620; font-size: 14px; flex: 1; min-width: 0; }
.prob-title small { color: var(--txt-3); font-weight: 400; font-size: 11.5px; margin-left: 6px; }
.diff { font-size: 11px; padding: 1px 6px; border-radius: 5px; font-weight: 600; white-space: nowrap; }
.diff-简单 { background: var(--ok-dim); color: var(--ok); }
.diff-中等 { background: var(--warn-dim); color: var(--warn); }
.diff-困难 { background: var(--bad-dim); color: var(--bad); }
.prob-body { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line-soft); }
.prob-body h5 { margin: 12px 0 5px; font-size: 12px; color: var(--txt-3); font-weight: 600; letter-spacing: .4px; }
.prob-body h5:first-child { margin-top: 0; }
.code-block {
  background: #0a0e15; border: 1px solid var(--line-soft); border-radius: var(--r-sm);
  padding: 12px 14px; overflow-x: auto; font-size: 12.5px; line-height: 1.6;
  color: #c8d6ea; margin: 0; white-space: pre; tab-size: 4;
}
html[data-theme="light"] .code-block { background: #0f172a; color: #d5e0f0; }

/* ================= 104 天 ================= */
.day-item {
  display: grid; grid-template-columns: 54px 1fr auto; gap: 13px; align-items: start;
  padding: 13px 16px; border-bottom: 1px solid var(--line-soft); transition: .12s;
}
.day-item:last-child { border-bottom: none; }
.day-item:hover { background: var(--panel-2); }
.day-item.today { background: var(--acc-dim); }
.day-item.done { opacity: .62; }
.day-num { text-align: center; }
.day-num b { display: block; font-size: 17px; font-weight: 720; line-height: 1.1; font-variant-numeric: tabular-nums; }
.day-num span { font-size: 10px; color: var(--txt-3); }
.day-main { min-width: 0; }
.day-focus { font-weight: 610; font-size: 13.8px; margin-bottom: 4px; }
.day-tasks { margin: 5px 0 0; padding-left: 16px; }
.day-tasks li { font-size: 12.5px; color: var(--txt-2); margin: 2px 0; }
.day-tasks li.done { text-decoration: line-through; color: var(--txt-3); }
.day-out { font-size: 11.5px; color: var(--ok); margin-top: 5px; }
.day-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }

.phase-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.phase-pill {
  flex: 1; min-width: 150px; background: var(--panel-2); border: 1px solid var(--line-soft);
  border-radius: var(--r-sm); padding: 11px 13px; border-top: 3px solid var(--acc);
}
.phase-pill.on { background: var(--acc-dim); }
.phase-pill b { font-size: 13px; display: block; }
.phase-pill span { font-size: 11.5px; color: var(--txt-3); }

/* ================= 方向卡 ================= */
.track-card {
  background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--r);
  padding: 17px; position: relative; transition: .15s; display: flex; flex-direction: column;
}
.track-card:hover { border-color: var(--line); transform: translateY(-2px); box-shadow: var(--shadow); }
.track-card.on { border-color: var(--acc); box-shadow: 0 0 0 1px var(--acc) inset; }
.track-top { display: flex; align-items: center; gap: 11px; margin-bottom: 10px; }
.track-ico {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  font-size: 19px; flex: 0 0 auto; background: var(--panel-2);
}
.track-name { font-weight: 660; font-size: 15px; }
.track-tag { font-size: 11.5px; color: var(--txt-3); }
.track-tagline { color: var(--txt-2); font-size: 13px; margin-bottom: 11px; flex: 1; }
.track-meta { display: flex; gap: 14px; font-size: 11.5px; color: var(--txt-3); margin-bottom: 12px; }
.track-meta b { color: var(--txt-2); font-weight: 600; }

/* ================= 项目 ================= */
.proj-card { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--r); overflow: hidden; }
.proj-head { padding: 15px 17px 13px; border-bottom: 1px solid var(--line-soft); }
.proj-name { font-weight: 660; font-size: 15px; margin-bottom: 4px; }
.proj-why { color: var(--txt-2); font-size: 12.8px; }
.proj-body { padding: 15px 17px; }
.step {
  display: flex; gap: 11px; padding: 9px 0; border-bottom: 1px dashed var(--line-soft);
  align-items: flex-start;
}
.step:last-child { border-bottom: none; }
.step-check {
  width: 19px; height: 19px; border-radius: 5px; border: 1.5px solid var(--line);
  flex: 0 0 auto; cursor: pointer; display: grid; place-items: center; font-size: 12px;
  color: transparent; margin-top: 2px; transition: .12s; background: var(--panel-2);
}
.step-check:hover { border-color: var(--acc); }
.step-check.on { background: var(--ok); border-color: var(--ok); color: #04150f; }
.step-main { flex: 1; min-width: 0; }
.step-name { font-weight: 570; font-size: 13.2px; }
.step.on .step-name { color: var(--txt-3); text-decoration: line-through; }
.step-detail { font-size: 12.3px; color: var(--txt-2); margin-top: 3px; line-height: 1.6; }
.step-days { font-size: 11px; color: var(--txt-3); white-space: nowrap; }

/* ================= 表格 ================= */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left; font-size: 11.5px; color: var(--txt-3); font-weight: 600;
  padding: 8px 10px; border-bottom: 1px solid var(--line); letter-spacing: .3px;
  white-space: nowrap; position: sticky; top: 0; background: var(--panel); z-index: 1;
}
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.tbl tr:hover td { background: var(--panel-2); }
.tbl-wrap { overflow-x: auto; }

/* ================= form ================= */
.field { margin-bottom: 13px; }
.field > label { display: block; font-size: 12px; color: var(--txt-2); margin-bottom: 5px; font-weight: 550; }
.input, .select, .textarea {
  width: 100%; padding: 8px 11px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--bg); color: var(--txt); font-family: inherit; font-size: 13.5px;
  transition: .12s; outline: none;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-dim); }
.textarea { resize: vertical; min-height: 84px; line-height: 1.6; }
.select { cursor: pointer; }
.hint { font-size: 11.5px; color: var(--txt-3); margin-top: 4px; }

/* ================= modal / toast ================= */
.modal {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center;
  background: rgba(3, 6, 12, .68); backdrop-filter: blur(3px); padding: 20px;
}
.modal[hidden] { display: none; }
.modal-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  width: min(680px, 100%); max-height: 88vh; display: flex; flex-direction: column;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .5); animation: pop .16s ease;
}
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(6px); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line-soft); }
.modal-head h3 { margin: 0; font-size: 15px; flex: 1; }
.modal-body { padding: 18px; overflow-y: auto; flex: 1; }
.modal-foot { padding: 13px 18px; border-top: 1px solid var(--line-soft); display: flex; gap: 9px; justify-content: flex-end; }
.modal-foot:empty { display: none; }

.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translate(-50%, 16px);
  background: var(--panel-2); border: 1px solid var(--line); color: var(--txt);
  padding: 9px 18px; border-radius: 10px; font-size: 13px; z-index: 300;
  opacity: 0; pointer-events: none; transition: .2s; box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast-ok { border-color: var(--ok); color: var(--ok); }
.toast-bad { border-color: var(--bad); color: var(--bad); }

.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 9; }
.scrim[hidden] { display: none; }

/* ================= 其他 ================= */
.err-pre { font-size: 12px; color: var(--bad); white-space: pre-wrap; overflow-x: auto; }
.hero {
  background: linear-gradient(135deg, rgba(79,140,255,.13), rgba(169,123,255,.10));
  border: 1px solid var(--line); border-radius: var(--r); padding: 20px 22px;
}
.hero h2 { margin: 0 0 6px; font-size: 19px; font-weight: 700; letter-spacing: -.2px; }
.hero p { margin: 0; color: var(--txt-2); font-size: 13.5px; }
.hero-acts { display: flex; gap: 9px; margin-top: 15px; flex-wrap: wrap; }

.timer { font-family: var(--mono); font-size: 40px; font-weight: 700; letter-spacing: 1px; font-variant-numeric: tabular-nums; }
.timer.warn { color: var(--warn); }
.timer.bad { color: var(--bad); }

.chat { display: flex; flex-direction: column; gap: 11px; }
.msg { max-width: 84%; padding: 10px 14px; border-radius: 12px; font-size: 13.4px; line-height: 1.66; }
.msg-q { background: var(--panel-2); border: 1px solid var(--line-soft); align-self: flex-start; border-top-left-radius: 3px; }
.msg-a { background: var(--acc-dim); border: 1px solid transparent; align-self: flex-end; border-top-right-radius: 3px; }
.msg-sys { align-self: center; background: transparent; color: var(--txt-3); font-size: 11.5px; padding: 2px; }

.score-chip {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  font-size: 12px; font-weight: 700; background: var(--panel-2); border: 1px solid var(--line);
}
.s1 { color: var(--bad); border-color: var(--bad); }
.s2 { color: var(--warn); border-color: var(--warn); }
.s3 { color: var(--acc-2); border-color: var(--acc); }
.s4 { color: var(--ok); border-color: var(--ok); }
.s5 { color: var(--ok); border-color: var(--ok); background: var(--ok-dim); }

details.acc { border: 1px solid var(--line-soft); border-radius: var(--r-sm); padding: 0; margin-bottom: 9px; background: var(--panel); }
details.acc > summary {
  padding: 10px 14px; cursor: pointer; font-size: 13.2px; font-weight: 560;
  list-style: none; display: flex; align-items: center; gap: 8px;
}
details.acc > summary::-webkit-details-marker { display: none; }
details.acc > summary::before { content: '▸'; color: var(--txt-3); font-size: 10px; transition: .15s; }
details.acc[open] > summary::before { transform: rotate(90deg); }
details.acc > summary:hover { background: var(--panel-2); }
details.acc .acc-body { padding: 0 14px 13px; font-size: 13px; color: var(--txt-2); line-height: 1.7; }
details.acc .acc-body > *:first-child { margin-top: 0; }

.tag-cloud { display: flex; gap: 6px; flex-wrap: wrap; }
.sticky-top { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 8px 0; }

/* ================= 响应式 ================= */
@media (max-width: 1180px) { .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g5 { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (max-width: 940px) {
  #app { grid-template-columns: 1fr; }
  .side {
    position: fixed; left: 0; top: 0; bottom: 0; width: 250px; z-index: 100;
    transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow);
  }
  #app.menu-open .side { transform: none; }
  .only-mobile { display: grid; }
  .today-chip { display: none; }
  .g2, .g3, .g4, .g5 { grid-template-columns: 1fr; }
  .view { padding: 16px 14px 60px; }
  .day-item { grid-template-columns: 44px 1fr; }
  .day-side { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; }
}
@media print {
  .side, .topbar, .toast { display: none !important; }
  #app { grid-template-columns: 1fr; }
  .view { overflow: visible; }
  body { background: #fff; color: #111; }
}

/* ===================================================================
 * v2 视觉打磨层
 * 只做观感增强（背景光晕、层次、悬停反馈、焦点态），不改动任何布局结构
 * =================================================================== */

/* ---- 背景与整体氛围 ---- */
body {
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 520px at 8% -12%, rgba(109, 139, 255, .10), transparent 62%),
    radial-gradient(760px 460px at 100% 0%, rgba(177, 140, 255, .07), transparent 60%);
  background-attachment: fixed;
  letter-spacing: .005em;
}

h1, h2, h3, h4 { letter-spacing: -.012em; }

/* ---- 侧栏 ---- */
.side {
  background: linear-gradient(180deg, #0d1017 0%, #0a0c11 100%);
  border-right-color: rgba(255, 255, 255, .06);
}
.brand { padding: 20px 16px 16px; }
.brand-mark {
  box-shadow: 0 10px 26px rgba(109, 139, 255, .35), inset 0 1px 0 rgba(255, 255, 255, .28);
  border-radius: 12px;
}
.brand-text strong { font-size: 14.5px; }

.nav { padding: 6px 10px 14px; }
.nav-item {
  border-radius: 10px;
  transition: background .18s var(--ease), color .18s var(--ease), transform .18s var(--ease);
}
.nav-item:hover { transform: translateX(2px); }
html:not([data-theme="light"]) .nav-item:hover { background: rgba(255, 255, 255, .045); }
.nav-item.on {
  background: linear-gradient(90deg, rgba(109, 139, 255, .22), rgba(109, 139, 255, .05));
  box-shadow: inset 0 0 0 1px rgba(109, 139, 255, .22);
  color: var(--acc-2);
}
.nav-item.on::before {
  height: 18px;
  background: linear-gradient(180deg, var(--acc), var(--purple));
  box-shadow: 0 0 14px rgba(109, 139, 255, .55);
}
.nav-ico { opacity: .9; }

/* ---- 顶栏 ---- */
.topbar {
  background: rgba(8, 10, 15, .72);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-bottom-color: rgba(255, 255, 255, .06);
  height: 56px; flex-basis: 56px;
}
html[data-theme="light"] .topbar { background: rgba(255, 255, 255, .78); }
.icon-btn {
  border-radius: 10px;
  transition: background .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease), transform .18s var(--ease);
}
.icon-btn:hover { transform: translateY(-1px); }
html:not([data-theme="light"]) .icon-btn { background: rgba(255, 255, 255, .04); border-color: rgba(255, 255, 255, .08); }
html:not([data-theme="light"]) .icon-btn:hover { background: rgba(255, 255, 255, .08); }

/* ---- 内容区 ---- */
.view { padding: 26px 28px 72px; }
.view > * + * { margin-top: 18px; }

.panel {
  border-color: rgba(255, 255, 255, .07);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 18px 40px rgba(0, 0, 0, .28);
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
}
html:not([data-theme="light"]) .panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, .022), rgba(255, 255, 255, 0)), var(--panel);
}
.panel:hover { border-color: rgba(255, 255, 255, .11); }
.panel-head {
  padding: 14px 18px;
  background: rgba(255, 255, 255, .02);
  border-bottom-color: rgba(255, 255, 255, .06);
}
.panel-head h3 { font-size: 14.5px; letter-spacing: 0; }
.panel-body { padding: 18px; }
html[data-theme="light"] .panel-head { background: rgba(16, 32, 64, .02); }

/* ---- 统计块 ---- */
.stat {
  background: var(--panel-2);
  border-color: rgba(255, 255, 255, .06);
  border-radius: 12px;
  padding: 15px 16px;
  transition: transform .22s var(--ease), border-color .22s var(--ease);
}
.stat:hover { transform: translateY(-2px); border-color: rgba(255, 255, 255, .12); }
.stat-v { font-weight: 700; letter-spacing: -.6px; }

/* ---- 按钮 ---- */
.btn {
  border-radius: 10px;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease),
    border-color .18s var(--ease), color .18s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-pri {
  background: linear-gradient(135deg, var(--acc), #7d5cff);
  border-color: transparent;
  box-shadow: 0 8px 20px rgba(109, 139, 255, .28);
}
.btn-pri:hover { box-shadow: 0 12px 28px rgba(109, 139, 255, .38); }
html:not([data-theme="light"]) .btn:not(.btn-pri):not(.btn-ok) {
  background: rgba(255, 255, 255, .045);
  border-color: rgba(255, 255, 255, .09);
}
html:not([data-theme="light"]) .btn:not(.btn-pri):not(.btn-ok):hover {
  background: rgba(255, 255, 255, .085);
  border-color: rgba(255, 255, 255, .16);
}

/* ---- 表单 ---- */
.input, .select, .textarea {
  border-radius: 10px;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--acc);
  box-shadow: 0 0 0 3px var(--acc-dim);
}
html:not([data-theme="light"]) .input,
html:not([data-theme="light"]) .select,
html:not([data-theme="light"]) .textarea {
  background: rgba(255, 255, 255, .035);
  border-color: rgba(255, 255, 255, .09);
}

/* ---- 徽标 / 标签 ---- */
.chip, .badge { border-radius: 999px; }

/* ---- 滚动条 ---- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .14);
  background-clip: padding-box;
  border: 2px solid transparent;
  border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .26); background-clip: padding-box; }
html[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(20, 32, 54, .18); background-clip: padding-box; }

/* ---- 每日补充资料与常见坑 ---- */
.day-extra {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed rgba(255, 255, 255, .09);
}
.day-extra-t {
  font-size: 12px; font-weight: 600; letter-spacing: .05em;
  color: var(--txt-3); margin-bottom: 6px;
}
.day-res, .day-pit { margin: 0; padding-left: 18px; }
.day-res li, .day-pit li { font-size: 12.8px; line-height: 1.75; color: var(--txt-2); }
.day-res a { color: var(--acc-2); text-decoration: none; }
.day-res a:hover { text-decoration: underline; }
.day-res li::marker { color: var(--acc); }
.day-pit li::marker { color: var(--warn); }
html[data-theme="light"] .day-extra { border-top-color: var(--line-soft); }

/* ---- 返回作品集入口 ---- */
.back-home {
  display: flex; align-items: center; gap: 6px;
  margin: 0 14px 10px; padding: 7px 11px;
  border-radius: 9px;
  font-size: 12.5px; color: var(--txt-3); text-decoration: none;
  border: 1px solid rgba(255, 255, 255, .07);
  background: rgba(255, 255, 255, .02);
  transition: color .18s var(--ease), border-color .18s var(--ease), background .18s var(--ease);
}
.back-home:hover {
  color: var(--txt);
  border-color: rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .06);
  text-decoration: none;
}
html[data-theme="light"] .back-home {
  border-color: var(--line-soft);
  background: transparent;
  color: var(--txt-2);
}

/* ---- 顶部加载 ---- */
.boot-logo { box-shadow: 0 16px 52px rgba(109, 139, 255, .38), inset 0 1px 0 rgba(255, 255, 255, .3); }

