/* ============================================================
   墨题 InkDrill — 暖石 / 墨绿 练习台视觉系统 v2
   参考 examcrafts.com：暖石底色 · 墨绿主色 · 衬线标题 ·
   浮岛胶囊导航 · 大圆角卡片 · 柔和阴影
   ============================================================ */
:root {
  --paper: #faf7f5;
  --panel: #ffffff;
  --panel-2: #f1ece8;
  --ink: #2b2333;
  --ink-2: #5c5468;
  --ink-3: #8f8799;
  --line: rgba(43, 35, 51, .10);
  --line-2: rgba(43, 35, 51, .22);
  --grid: rgba(43, 35, 51, .045);
  --accent: #e8930c;
  --accent-deep: #9f2d00;
  --accent-soft: rgba(255, 214, 167, .32);
  --primary: #1fb854;
  --primary-deep: #0e7a36;
  --primary-soft: rgba(31, 184, 84, .12);
  --teal: #0e7f92;
  --teal-soft: rgba(14, 127, 146, .10);
  --violet: #7c5cd6;
  --violet-soft: rgba(124, 92, 214, .10);
  --good: #0e7a36;
  --bad: #d9264f;
  --bad-soft: rgba(217, 38, 79, .09);
  --warn: #b45309;
  --neutral: #19362d;
  --neutral-2: #21463a;
  --shadow: 0 1px 2px rgba(43, 35, 51, .04), 0 12px 32px -16px rgba(43, 35, 51, .22);
  --shadow-lg: 0 2px 4px rgba(43, 35, 51, .05), 0 24px 56px -24px rgba(43, 35, 51, .32);
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", Roboto, sans-serif;
  --serif: "Noto Serif", "Source Han Serif SC", "Songti SC", Georgia, serif;
}
html[data-theme="dark"] {
  --paper: #1b1717;
  --panel: #252022;
  --panel-2: #2e282a;
  --ink: #ece7e4;
  --ink-2: #b3aaa7;
  --ink-3: #7d7472;
  --line: rgba(236, 231, 228, .10);
  --line-2: rgba(236, 231, 228, .24);
  --grid: rgba(236, 231, 228, .04);
  --accent: #f5a94b;
  --accent-deep: #ffd6a7;
  --accent-soft: rgba(245, 169, 75, .16);
  --primary: #44ebd3;
  --primary-deep: #7ff2e2;
  --primary-soft: rgba(68, 235, 211, .13);
  --teal: #53cfe0;
  --teal-soft: rgba(83, 207, 224, .12);
  --violet: #b39af5;
  --violet-soft: rgba(179, 154, 245, .12);
  --good: #4ade80;
  --bad: #ff5861;
  --bad-soft: rgba(255, 88, 97, .13);
  --warn: #fbbf24;
  --neutral: #0e0c0c;
  --neutral-2: #1c1819;
  --shadow: 0 0 0 1px rgba(255,255,255,.03), 0 18px 40px -24px #000;
  --shadow-lg: 0 0 0 1px rgba(255,255,255,.04), 0 28px 64px -28px #000;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
/* 顶栏是 sticky 的：滚动定位与元素自身都要留出空间，否则卡片首行（含标签页按钮）会被顶栏压住点不到 */
html { scroll-padding-top: 84px; }
.card, .q, .sec-title, section { scroll-margin-top: 84px; }
/* 作者层的 display 会盖过 UA 的 [hidden]{display:none}，所以必须显式兜底，
   否则「已关闭」的弹层仍是一层铺满视口的透明层，会吞掉下面所有点击 */
.modal-wrap[hidden], .pop[hidden], .toast-wrap[hidden], [hidden].annot-host { display: none !important; }
body {
  background: var(--paper);
  background-image: radial-gradient(circle at 12% -4%, rgba(31, 184, 84, .05), transparent 34%),
                    radial-gradient(circle at 88% 0%, rgba(255, 214, 167, .16), transparent 30%);
  background-attachment: fixed;
  color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.66;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip; /* 移动端安全网：clip 不产生滚动容器，sticky 不受影响 */
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0 0 .4em; font-family: var(--serif); font-weight: 700; letter-spacing: -.01em; line-height: 1.3; }
h1 { font-size: 30px; } h2 { font-size: 22px; } h3 { font-size: 17.5px; } h4 { font-size: 15.5px; }
p { margin: 0 0 .8em; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
kbd, .kbd { font-family: var(--mono); font-size: 11px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 6px; padding: 0 5px; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }

/* ---------- 骨架 ---------- */
.shell { display: grid; grid-template-columns: 216px 1fr; min-height: 100vh; }
.shell.rail-collapsed { grid-template-columns: 60px 1fr; }
#rail {
  position: sticky; top: 0; height: 100vh; border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 62%, transparent);
  backdrop-filter: blur(10px);
  display: flex; flex-direction: column; gap: 2px; padding: 16px 12px; overflow: hidden;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; }
.brand .mark { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 10px; background: var(--neutral); color: #ffd6a7; display: grid; place-items: center; font-family: var(--serif); font-weight: 700; font-size: 16px; }
.brand .txt { font-family: var(--serif); font-weight: 700; letter-spacing: .01em; font-size: 15.5px; }
.brand .txt small { display: block; font-family: var(--mono); font-weight: 500; font-size: 9.5px; color: var(--ink-3); letter-spacing: .18em; text-transform: uppercase; }
.rail-collapsed .brand .txt, .rail-collapsed .nav .lbl, .rail-collapsed .nav-sec { display: none; }
.nav-sec { font: 600 10px/1 var(--mono); letter-spacing: .18em; color: var(--ink-3); padding: 16px 10px 6px; text-transform: uppercase; }
.nav a, .nav button { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; color: var(--ink-2); padding: 8px 11px; border-radius: 999px; font: inherit; font-size: 14px; cursor: pointer; text-align: left; transition: background .15s ease, color .15s ease; }
.nav a:hover, .nav button:hover { background: var(--panel-2); color: var(--ink); }
.nav a.on { background: var(--neutral); color: #f4efe9; box-shadow: var(--shadow); }
html[data-theme="dark"] .nav a.on { background: var(--primary); color: #10312c; }
.nav a.on .ic { color: #ffd6a7; }
html[data-theme="dark"] .nav a.on .ic { color: #10312c; }
.nav .ic { width: 18px; text-align: center; font-size: 15px; flex: 0 0 18px; }
.nav .badge { margin-left: auto; font: 600 11px/1 var(--mono); color: var(--accent-deep); background: var(--accent-soft); border-radius: 999px; padding: 2px 7px; }
.nav a.on .badge { background: rgba(255, 214, 167, .25); color: #ffd6a7; }
html[data-theme="dark"] .nav a.on .badge { background: rgba(16, 49, 44, .2); color: #10312c; }
.rail-foot { margin-top: auto; padding: 8px; border-top: 1px solid var(--line); }

.main { display: flex; flex-direction: column; min-width: 0; }
/* 顶栏：浮岛胶囊 —— 与参考站一致，不与内容等宽贴边 */
#topbar {
  position: sticky; top: 10px; z-index: 30; display: flex; align-items: center; gap: 10px;
  margin: 10px 18px 4px; padding: 9px 16px;
  border: 1px solid var(--line); border-radius: 999px;
  background: color-mix(in srgb, var(--panel) 86%, transparent);
  backdrop-filter: blur(10px); box-shadow: var(--shadow);
}
.crumb { font: 600 12px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.crumb b { color: var(--ink); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
#view { padding: 22px 26px 80px; width: 100%; max-width: 1180px; margin: 0 auto; }
#view.wide { max-width: 1560px; }
/* 页脚：深色墨绿底，与参考站页脚同语言 */
#foot {
  border-top: 1px solid var(--line); margin-top: 30px;
  background: var(--neutral); color: rgba(244, 239, 233, .78);
  padding: 18px 26px; font-size: 12.5px;
}
html[data-theme="dark"] #foot { background: #0e0c0c; }
#foot a { text-decoration: underline; text-underline-offset: 3px; }
#foot .mono { color: #ffd6a7; }
body.exam-mode #rail, body.exam-mode #foot { display: none; }
#tabbar { display: none; }   /* 仅手机端（≤640px）显示，见底部媒体查询 */
body.exam-mode { grid-template-columns: 1fr; }
body.fs { overflow: hidden; }
body.fs #topbar { display: none; }

.icon-btn { border: 1px solid var(--line); background: var(--panel); color: var(--ink-2); width: 34px; height: 32px; border-radius: 999px; cursor: pointer; font-size: 14px; transition: border-color .15s ease, color .15s ease, background .15s ease; }
.icon-btn:hover { border-color: var(--line-2); color: var(--ink); background: var(--panel-2); }
.avatar { width: 32px; height: 32px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-deep); display: grid; place-items: center; font: 700 13px/1 var(--mono); border: 1px solid var(--line); cursor: pointer; }

/* ---------- 控件 ---------- */
.btn { display: inline-flex; align-items: center; gap: 7px; border: 1.5px solid var(--neutral); background: var(--neutral); color: #f4efe9; padding: 8px 18px; border-radius: 999px; font: 600 14px/1.2 var(--sans); cursor: pointer; transition: transform .12s ease, box-shadow .12s ease, background .12s ease, border-color .12s ease; }
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }
html[data-theme="dark"] .btn { background: var(--primary); border-color: var(--primary); color: #10312c; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn.ghost:hover { background: var(--panel-2); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #3c1d00; }
html[data-theme="dark"] .btn.accent { background: var(--accent); border-color: var(--accent); color: #3c1d00; }
.btn.teal { background: var(--teal); border-color: var(--teal); color: #fff; }
html[data-theme="dark"] .btn.teal { color: #06272c; }
.btn.sm { padding: 5px 12px; font-size: 12.5px; }
.btn.lg { padding: 12px 26px; font-size: 15.5px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.danger { background: transparent; border-color: var(--bad); color: var(--bad); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1 1 auto; min-width: 0; }

input[type=text], input[type=password], input[type=email], input[type=number], input[type=search], textarea, select {
  width: 100%; background: var(--panel); color: var(--ink); border: 1px solid var(--line-2); border-radius: var(--r-md);
  padding: 9px 12px; font: inherit; font-size: 14px; transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { resize: vertical; min-height: 96px; line-height: 1.7; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
label.f { display: block; margin-bottom: 12px; }
label.f > span { display: block; font: 600 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 5px; }
.check { display: inline-flex; gap: 7px; align-items: center; font-size: 13.5px; }
.check input { width: auto; accent-color: var(--primary); }

/* ---------- 卡片 ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; position: relative; box-shadow: var(--shadow); }
.card.pad-lg { padding: 26px 28px; }
.card.striped::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; background: var(--primary); border-radius: 0 4px 4px 0; }
.card.striped.teal::before { background: var(--teal); }
.card.striped.violet::before { background: var(--violet); }
.card.flat { background: transparent; box-shadow: none; }
.card > .tab { position: absolute; top: -1px; right: 16px; font: 700 9.5px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; background: var(--neutral); color: #f4efe9; padding: 5px 10px 6px; border-radius: 0 0 8px 8px; }
html[data-theme="dark"] .card > .tab { background: var(--primary); color: #10312c; }
.card + .card { margin-top: 14px; }
.grid { display: grid; gap: 16px; }
.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)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
@media (max-width: 1180px) { .split { grid-template-columns: 1fr; } .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* 页面内联指定的两列布局在窄屏必须让位于单列，否则右侧工具栏会把页面撑出横向滚动 */
@media (max-width: 1080px) { .split { grid-template-columns: 1fr !important; } }
@media (max-width: 820px) { .shell { grid-template-columns: 60px 1fr; } .nav .lbl, .brand .txt, .nav-sec { display: none; } .g2, .g3, .g4 { grid-template-columns: 1fr; } #view { padding: 18px 14px 70px; } #topbar { margin: 8px 10px 2px; padding: 8px 12px; } }

/* ---------- 移动端（≤640px）：顶栏只留关键控件，防横向溢出 ---------- */
@media (max-width: 640px) {
  .crumb { display: none; }                      /* 长面包屑是溢出主源，小屏隐藏 */
  #provider { display: none; }                   /* 批改引擎标签收进个人菜单语义即可 */
  .top-right .small.nowrap { display: none; }    /* 用户名文字隐藏，只留头像 */
  #fsBtn { display: none; }                      /* 手机上无意义 */
  #topbar { gap: 6px; padding: 7px 10px; }
  .icon-btn { width: 30px; height: 30px; }
  .hero { padding: 34px 18px 30px; }
  .hero h1 { font-size: 31px; }
  .hero .rule span { padding: 6px 10px; }
  .card.pad-lg { padding: 18px 16px; }
  .split { grid-template-columns: 1fr !important; }
  .exam-head { flex-wrap: wrap; top: 60px; }
  body.exam-mode .exam-head { top: 8px; }
  .sheet { position: static; }                   /* 答题卡在窄屏改为随文档流，避免遮挡 */

  /* ---- 手机端底部 Tab 导航：替代左侧图标栏 ---- */
  .shell { grid-template-columns: 1fr !important; }
  #rail, #railToggle { display: none; }
  #view { padding-bottom: 24px; }
  #foot { margin-bottom: calc(58px + env(safe-area-inset-bottom, 0px)); } /* 滚到底不被 Tab 栏盖住 */
  body.exam-mode #view { padding-bottom: 70px; } /* 答题页无 Tab 栏，恢复原留白 */
  #tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
    align-items: stretch; gap: 2px;
    padding: 5px 10px calc(5px + env(safe-area-inset-bottom, 0px));
    background: color-mix(in srgb, var(--panel) 90%, transparent);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
  }
  html[data-theme="dark"] #tabbar { background: color-mix(in srgb, var(--panel) 82%, transparent); }
  #tabbar a, #tabbar button {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
    min-width: 0; padding: 4px 0 3px; background: none; border: 0; border-radius: 10px;
    font: 600 10.5px/1.2 var(--sans); color: var(--ink-2); cursor: pointer;
  }
  #tabbar .tic { position: relative; font-family: var(--mono); font-size: 17px; line-height: 1.1; }
  #tabbar a.on, #tabbar button.on { color: var(--primary-deep); }
  html[data-theme="dark"] #tabbar a.on, html[data-theme="dark"] #tabbar button.on { color: var(--primary); }
  #tabbar a.on .tic::after { content: ''; position: absolute; left: 50%; bottom: -4px; transform: translateX(-50%); width: 14px; height: 3px; border-radius: 2px; background: currentColor; }
  .tbdg {
    position: absolute; top: -6px; right: -13px; min-width: 15px; height: 15px; padding: 0 4px;
    border-radius: 999px; background: #c2452d; color: #fff;
    font: 700 9.5px/15px var(--mono); font-style: normal; text-align: center;
  }
  .tab-sheet {
    position: fixed; left: 0; right: 0; bottom: calc(52px + env(safe-area-inset-bottom, 0px)); z-index: 69;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
    background: color-mix(in srgb, var(--panel) 97%, transparent);
    border-top: 1px solid var(--line); box-shadow: 0 -12px 32px rgba(20, 18, 16, .16);
    max-height: 62vh; overflow: auto;
  }
  .tab-sheet-in { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
  #tabbar .tab-sheet a {
    display: flex; flex-direction: row; align-items: center; gap: 10px;
    padding: 12px 10px; border-radius: 10px;
    font: 500 13.5px/1.4 var(--sans); color: var(--ink); text-align: left;
  }
  #tabbar .tab-sheet a:active { background: var(--accent-soft); }
  #tabbar .tab-sheet a .ic { width: 22px; text-align: center; color: var(--ink-2); font-size: 14px; }
  #tabbar .tab-sheet a .tbdg { position: static; margin-left: auto; }
  body.exam-mode #tabbar, body.exam-mode .tab-sheet { display: none; } /* 答题沉浸模式 */
}

.tag { display: inline-block; font: 600 11px/1 var(--mono); letter-spacing: .04em; border: 1px solid var(--line-2); color: var(--ink-2); padding: 4px 9px; border-radius: 999px; }
.tag.solid { background: var(--neutral); color: #f4efe9; border-color: var(--neutral); }
html[data-theme="dark"] .tag.solid { background: var(--primary); border-color: var(--primary); color: #10312c; }
.tag.amber { color: var(--accent-deep); border-color: var(--accent); background: var(--accent-soft); }
html[data-theme="dark"] .tag.amber { color: var(--accent-deep); }
.tag.teal { color: var(--teal); border-color: var(--teal); background: var(--teal-soft); }
.tag.violet { color: var(--violet); border-color: var(--violet); background: var(--violet-soft); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.pill { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 4px 13px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; transition: all .14s ease; }
.pill:hover { border-color: var(--line-2); color: var(--ink); }
.pill.on { background: var(--neutral); color: #f4efe9; border-color: var(--neutral); }
html[data-theme="dark"] .pill.on { background: var(--primary); color: #10312c; border-color: var(--primary); }

/* 成绩票根 */
.stub { display: inline-flex; align-items: stretch; border: 1px solid var(--line-2); border-radius: var(--r-md); overflow: hidden; background: var(--panel); }
.stub .n { font: 700 22px/1 var(--mono); padding: 10px 13px; color: var(--primary-deep); }
html[data-theme="dark"] .stub .n { color: var(--primary); }
.stub .n.big { font-size: 34px; }
.stub .d { border-left: 1px dashed var(--line-2); padding: 6px 12px; display: flex; flex-direction: column; justify-content: center; font: 600 10px/1.5 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }

.stat { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel); padding: 13px 15px; box-shadow: var(--shadow); }
.stat .k { font: 600 10.5px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.stat .v { font: 700 22px/1.2 var(--mono); margin-top: 6px; }
.stat .v small { font-size: 12px; color: var(--ink-3); font-weight: 500; }

.bar { height: 8px; background: var(--panel-2); border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--primary); border-radius: 999px; }
.bar.teal > i { background: var(--teal); }
.bar.good > i { background: var(--good); }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.t th { text-align: left; font: 600 10.5px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); padding: 9px 10px; border-bottom: 1px solid var(--line-2); }
table.t td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t tr:hover td { background: var(--panel-2); }

/* ---------- 首页 ---------- */
.hero {
  border: 1px solid var(--line); border-radius: var(--r-xl); padding: 56px 40px 44px;
  background:
    radial-gradient(circle at 82% 8%, var(--accent-soft), transparent 42%),
    radial-gradient(circle at 8% 90%, var(--primary-soft), transparent 46%),
    var(--panel);
  box-shadow: var(--shadow); text-align: center; position: relative; overflow: hidden;
}
.hero .eyebrow { font: 700 11px/1 var(--mono); letter-spacing: .22em; text-transform: uppercase; color: var(--primary-deep); background: var(--primary-soft); display: inline-block; padding: 7px 14px; border-radius: 999px; }
html[data-theme="dark"] .hero .eyebrow { color: var(--primary); }
.hero h1 { font-size: 46px; margin: 20px auto 12px; max-width: 22ch; letter-spacing: -.015em; }
.hero p { margin-left: auto; margin-right: auto; }
.hero .row { justify-content: center; }
.hero .rule { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; justify-content: center; }
.hero .rule span { font: 600 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 7px 13px; }
.feature { border-top: 3px solid var(--primary); padding-top: 14px; background: var(--panel); border-left: 1px solid var(--line); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); border-radius: 0 0 var(--r-md) var(--r-md); padding-left: 14px; padding-right: 14px; padding-bottom: 12px; box-shadow: var(--shadow); }
.feature .no { font: 700 11px/1 var(--mono); color: var(--primary-deep); letter-spacing: .1em; }
html[data-theme="dark"] .feature .no { color: var(--primary); }
.feature h3 { margin: 9px 0 6px; }

/* ---------- 科目 ---------- */
.subj { display: flex; gap: 14px; align-items: flex-start; }
.subj .glyph { width: 46px; height: 46px; flex: 0 0 46px; border-radius: 14px; border: 1px solid var(--line); display: grid; place-items: center; font: 700 12px/1 var(--mono); text-align: center; letter-spacing: -.02em; }
.subj .glyph.amber { color: var(--accent-deep); border-color: var(--accent); background: var(--accent-soft); }
.subj .glyph.teal { color: var(--teal); border-color: var(--teal); background: var(--teal-soft); }
.subj .glyph.violet { color: var(--violet); border-color: var(--violet); background: var(--violet-soft); }
.subj .glyph.spruce { color: var(--good); border-color: var(--good); background: var(--primary-soft); }
.cat-line { display: flex; align-items: baseline; gap: 12px; margin: 30px 0 14px; }
.cat-line h2 { margin: 0; }
.cat-line i { flex: 1; height: 1px; background: var(--line); }

/* ---------- 答题 ---------- */
.exam-head { display: flex; align-items: center; gap: 14px; position: sticky; top: 68px; z-index: 25; background: color-mix(in srgb, var(--panel) 92%, transparent); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 10px 16px; margin-bottom: 16px; box-shadow: var(--shadow); }
body.exam-mode .exam-head { top: 10px; }
.timer { font: 700 22px/1 var(--mono); color: var(--ink); font-variant-numeric: tabular-nums; }
.timer.warn { color: var(--bad); }
.saved { font: 600 11px/1 var(--mono); color: var(--ink-3); letter-spacing: .06em; }
.saved.busy { color: var(--primary-deep); }
html[data-theme="dark"] .saved.busy { color: var(--primary); }
.sec-title { font: 700 12px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: #f4efe9; background: var(--neutral); display: inline-block; padding: 7px 14px; border-radius: 999px; margin: 26px 0 14px; }
html[data-theme="dark"] .sec-title { background: var(--primary); color: #10312c; }
.q { border: 1px solid var(--line); border-left: 4px solid var(--line-2); border-radius: var(--r-md); background: var(--panel); padding: 16px 18px; margin-bottom: 14px; box-shadow: var(--shadow); }
.q.answered { border-left-color: var(--primary); }
.q.flagged { border-left-color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 40%, var(--panel)); }
.q .qhead { display: flex; gap: 10px; align-items: baseline; margin-bottom: 8px; }
.q .qno { font: 700 13px/1 var(--mono); color: var(--primary-deep); min-width: 26px; }
html[data-theme="dark"] .q .qno { color: var(--primary); }
.q .qstem { font-weight: 600; }
.q .qmeta { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.opt { display: flex; gap: 9px; align-items: flex-start; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 9px 12px; margin-bottom: 7px; cursor: pointer; transition: border-color .13s ease, background .13s ease; }
.opt:hover { border-color: var(--line-2); background: var(--panel-2); }
.opt.on { border-color: var(--neutral); background: var(--neutral); color: #f4efe9; }
html[data-theme="dark"] .opt.on { border-color: var(--primary); background: var(--primary); color: #10312c; }
.opt .lt { font: 700 12px/1.5 var(--mono); opacity: .8; }
.opt.correct { border-color: var(--good); background: color-mix(in srgb, var(--good) 13%, transparent); }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.bank { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 12px; border: 1px dashed var(--line-2); border-radius: var(--r-md); background: var(--panel-2); margin-bottom: 10px; }
.bank b { font: 600 12.5px/1 var(--mono); border: 1px solid var(--line-2); background: var(--panel); padding: 6px 10px; border-radius: 999px; cursor: pointer; }
.bank b.used { opacity: .4; text-decoration: line-through; }
.fillblank { font-family: var(--mono); font-weight: 700; color: var(--primary-deep); border-bottom: 2px solid var(--primary); padding: 0 4px; }
html[data-theme="dark"] .fillblank { color: var(--primary); }

.sheet { position: sticky; top: 130px; }
.sheet .gridno { display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: 6px; }
.sheet .gridno button { border: 1px solid var(--line-2); background: var(--panel); color: var(--ink-2); font: 600 12px/1 var(--mono); padding: 8px 0; border-radius: 10px; cursor: pointer; transition: all .12s ease; }
.sheet .gridno button:hover { border-color: var(--ink-3); }
.sheet .gridno button.on { background: var(--primary); border-color: var(--primary); color: #fff; }
html[data-theme="dark"] .sheet .gridno button.on { color: #10312c; }
.sheet .gridno button.flag { border-color: var(--accent); color: var(--accent-deep); background: var(--accent-soft); }
.sheet .gridno button.miss { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }

/* 原文与字幕 */
.passage { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel); padding: 16px 18px; margin-bottom: 14px; box-shadow: var(--shadow); }
.passage .ptitle { font: 700 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 9px; }
.passage p { margin: 0 0 .7em; }
.passage.para-cols p { column-gap: 26px; }
.word { cursor: pointer; border-radius: 3px; padding: 0 1px; }
.word:hover { background: var(--accent-soft); color: var(--accent-deep); }
html[data-theme="dark"] .word:hover { color: var(--accent); }
.word.gl { border-bottom: 1px dotted var(--teal); }
.sub { font-size: 13.5px; color: var(--ink-2); }
.sent { display: flex; gap: 10px; padding: 6px 9px; border-radius: var(--r-sm); border: 1px solid transparent; }
.sent.cur { background: var(--primary-soft); border-color: var(--primary); }
.sent .idx { font: 700 11px/1.7 var(--mono); color: var(--ink-3); cursor: pointer; }
.sent .zh { display: block; color: var(--ink-3); font-size: 12.5px; }
.player { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel-2); margin-bottom: 10px; }
.player select { width: auto; }
.eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 14px; }
.eq i { width: 3px; background: var(--primary); border-radius: 2px; animation: eq .9s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: .15s } .eq i:nth-child(3) { animation-delay: .3s } .eq i:nth-child(4) { animation-delay: .45s }
@keyframes eq { 0%,100% { height: 4px } 50% { height: 14px } }

/* 标注画布 */
.annot-host { position: fixed; inset: 0; z-index: 60; background: rgba(15, 10, 14, .55); display: grid; place-items: center; padding: 24px; }
.annot-box { background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-lg); width: min(940px, 96vw); box-shadow: var(--shadow-lg); }
.annot-box canvas { display: block; width: 100%; height: 460px; background: repeating-linear-gradient(0deg, var(--panel) 0 27px, var(--line) 27px 28px); touch-action: none; cursor: crosshair; border-radius: var(--r-lg) var(--r-lg) 0 0; }
.tools { display: flex; gap: 6px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.swatch { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-2); cursor: pointer; }
.swatch.on { border-color: var(--ink); }
.thumb { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 3px; background: var(--panel); }
.thumb img { display: block; width: 84px; height: 52px; object-fit: cover; border-radius: 5px; }

/* ---------- 生词卡 / 复盘 ---------- */
.vcard { border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--panel); padding: 32px; text-align: center; box-shadow: var(--shadow); }
.vcard .w { font: 700 40px/1.1 var(--mono); letter-spacing: -.02em; }
.vcard .ph { color: var(--ink-3); font-family: var(--mono); margin: 6px 0 14px; }
.vcard .mean { font-size: 17px; min-height: 40px; }
.mastery { display: inline-flex; gap: 3px; }
.mastery i { width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); }
.mastery i.on { background: var(--primary); }
.verdict { font: 700 10.5px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; }
.verdict.correct { color: var(--good); border: 1px solid var(--good); background: var(--primary-soft); }
.verdict.partial { color: var(--warn); border: 1px solid var(--warn); background: var(--accent-soft); }
.verdict.wrong, .verdict.blank { color: var(--bad); border: 1px solid var(--bad); background: var(--bad-soft); }
.analysis { border-left: 3px solid var(--teal); background: var(--teal-soft); padding: 11px 14px; border-radius: 0 var(--r-sm) var(--r-sm) 0; margin-top: 10px; font-size: 14px; }
/* 完形等题型的题干附句：句子本身要能被一眼找到空格位置，同时保留划词 */
.prompt-line { font-size: 14px; line-height: 1.75; color: var(--ink-2); background: var(--panel-2); border-left: 3px solid var(--line-2); padding: 10px 13px; border-radius: 0 var(--r-sm) var(--r-sm) 0; margin-bottom: 9px; }
.prompt-line.plain { color: var(--ink-2); }
/* 题库检索的选题浮条：跟着滚动常驻，勾选题目跨搜索也不丢 */
.pickbar { position: sticky; bottom: 14px; z-index: 6; margin: 16px 0 4px; background: var(--neutral); color: #f4efe9;
  border-radius: 999px; padding: 11px 18px; box-shadow: var(--shadow-lg); }
html[data-theme="dark"] .pickbar { background: var(--panel-2); color: var(--ink); border: 1px solid var(--line-2); }
.pickbar .muted { color: inherit; opacity: .72; }
.pickbar .btn.ghost { border-color: currentColor; color: inherit; }
.pickbar .btn.ghost:hover { background: rgba(255, 255, 255, .12); }
.blankmark { display: inline-block; min-width: 20px; text-align: center; font: 700 11px/1.5 var(--mono); color: var(--accent-deep); background: var(--panel); border: 1px dashed var(--accent); border-radius: 6px; padding: 0 5px; margin: 0 1px; }
html[data-theme="dark"] .blankmark { color: var(--accent); }
.wrong-answer { color: var(--bad); text-decoration: line-through; }
.ai-report { border: 1px solid var(--line); border-radius: var(--r-md); padding: 13px 15px; background: var(--panel-2); margin-top: 10px; }
.ai-report .line { display: flex; gap: 10px; align-items: center; font-size: 13px; margin-bottom: 5px; }
.ai-report .line .nm { width: 76px; color: var(--ink-2); }
.ai-report .line .bar { flex: 1; }
.bullet { display: flex; gap: 8px; margin-bottom: 5px; font-size: 13.5px; }
.bullet::before { content: "—"; color: var(--ink-3); }

/* 图谱 */
.graph-wrap { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); overflow: hidden; box-shadow: var(--shadow); }
svg.graph { display: block; width: 100%; height: 520px; background: radial-gradient(circle at 20% 10%, var(--panel-2), transparent 60%); cursor: grab; }
svg.graph .node circle { fill: var(--panel); stroke: var(--ink-2); stroke-width: 1.4; cursor: pointer; }
svg.graph .node.on circle { stroke: var(--primary); stroke-width: 3; fill: var(--primary-soft); }
svg.graph .node.weak circle { stroke: var(--bad); stroke-width: 2.5; }
svg.graph .node text { fill: var(--ink); font-size: 11.5px; font-family: var(--sans); pointer-events: none; }
svg.graph line { stroke: var(--line-2); stroke-width: 1.2; }
svg.graph line.parent { stroke-dasharray: 4 3; }

/* 留言墙 */
.wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 14px; }
.note { break-inside: avoid; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel); padding: 14px 16px; margin-bottom: 12px; box-shadow: var(--shadow); }
.note:nth-child(3n+1) { background: color-mix(in srgb, var(--accent-soft) 42%, var(--panel)); }
.note:nth-child(3n) { background: color-mix(in srgb, var(--teal-soft) 60%, var(--panel)); }
.note h4 { margin-bottom: 4px; }
.post { border-top: 3px solid var(--primary); }
.post .who { display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--ink-3); }
.like { border: 1px solid var(--line-2); background: transparent; color: var(--ink-2); border-radius: 999px; padding: 4px 10px; font: 600 12px/1 var(--mono); cursor: pointer; transition: all .13s ease; }
.like:hover { border-color: var(--accent); color: var(--accent-deep); }
.like.on { color: var(--accent-deep); border-color: var(--accent); background: var(--accent-soft); }
html[data-theme="dark"] .like.on { color: var(--accent); }

/* 弹层 */
.toast-wrap { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 90; }
.toast { background: var(--neutral); color: #f4efe9; border-radius: var(--r-md); padding: 11px 16px; font-size: 13.5px; box-shadow: var(--shadow-lg); animation: in .18s ease-out; }
html[data-theme="dark"] .toast { background: var(--panel-2); border: 1px solid var(--line-2); color: var(--ink); }
.toast.bad { background: var(--bad); color: #fff; }
.toast.good { background: var(--good); color: #fff; }
@keyframes in { from { transform: translateY(8px); opacity: 0 } }
.modal-wrap { position: fixed; inset: 0; z-index: 80; background: rgba(20, 14, 18, .5); display: grid; place-items: center; padding: 20px; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-xl); width: min(680px, 94vw); max-height: 88vh; overflow: auto; box-shadow: var(--shadow-lg); }
.modal header { display: flex; align-items: center; padding: 15px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); border-radius: var(--r-xl) var(--r-xl) 0 0; }
.modal .body { padding: 20px; }
.pop { position: fixed; z-index: 70; width: 320px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 14px 16px; }
.pop .pw { font: 700 20px/1.2 var(--mono); }
.hr { height: 1px; background: var(--line); margin: 14px 0; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line-2); margin-bottom: 16px; flex-wrap: wrap; }
.tabs button { border: 0; background: none; font: 600 13px/1 var(--sans); color: var(--ink-3); padding: 10px 14px; cursor: pointer; border-bottom: 2px solid transparent; border-radius: 8px 8px 0 0; transition: color .13s ease; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--primary-deep); border-bottom-color: var(--primary); }
html[data-theme="dark"] .tabs button.on { color: var(--primary); }
.empty { text-align: center; color: var(--ink-3); padding: 48px 16px; border: 1px dashed var(--line-2); border-radius: var(--r-lg); }
.skl { height: 12px; background: var(--panel-2); border-radius: 6px; animation: pl 1.2s ease-in-out infinite; }
@keyframes pl { 50% { opacity: .45 } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
/* ---------- 打印成稿（错题本 / 复盘） ---------- */
.print-foot { display: none; }
@media print {
  body { background: #fff; color: #000; font-size: 12pt; }
  #rail, #tabbar, .tab-sheet, #topbar, #foot, .toast-wrap, .pop, .modal-wrap, .sheet, .player, .pickbar, .row [data-act], .qmeta button, .no-print { display: none !important; }
  .shell { display: block !important; }
  #view { max-width: none !important; padding: 0 !important; }
  .main { display: block !important; }
  .split { display: block !important; }
  .card, .q, .passage { border: 1px solid #bbb !important; background: #fff !important; break-inside: avoid; page-break-inside: avoid; box-shadow: none !important; }
  .q { break-inside: avoid; }
  .sec-title { background: #fff !important; color: #000 !important; border: 1px solid #000; }
  details { display: block; }
  details > summary { display: none; }
  details > *, details[open] > * { display: block !important; }
  details:not([open]) > *:not(summary) { display: block !important; }
  .verdict { border: 1px solid #000 !important; color: #000 !important; background: #fff !important; }
  .opt { border: 1px solid #999 !important; }
  .opt.on, .opt.correct { border-color: #000 !important; font-weight: 700; }
  a[href]::after { content: ""; }
  .print-foot { display: block; position: fixed; bottom: 0; left: 0; right: 0; font: 9pt/1.4 monospace; color: #444; border-top: .5pt solid #999; padding: 4pt 8pt; }
  @page { margin: 16mm 14mm; }
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 999px; }
::-webkit-scrollbar-track { background: transparent; }
