/* 学习总站门户样式 — DeepSeek 浅蓝风：浅蓝主色 / 白卡片 / 圆角 / 轻描边 */
:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #eef2fb;
  --text: #1f2329;
  --text-2: #6b7280;
  --border: #e4e8f2;
  --hairline: #eef1f7;
  --primary: #4d6bfe;
  --primary-soft: #e9eeff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05);
  /* 运动：快、轻、可关 */
  --dur-1: 150ms;
  --dur-2: 250ms;
  --ease-out: cubic-bezier(.2, .8, .3, 1);
}

/* ---------- 深色模式（data-theme="dark" 变量覆写） ---------- */
:root[data-theme="dark"] {
  --bg: #10131a;
  --surface: #191d27;
  --surface-2: #212636;
  --text: #e8eaf0;
  --text-2: #9aa1b2;
  --border: #2a3040;
  --hairline: #232838;
  --primary: #6b85ff;
  --primary-soft: #232c4d;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
}

:root[data-theme="dark"] .p-pill[data-state="未配置"] {
  color: #fbbf24;
  background: #3a2f10;
  border-color: #574815;
}

:root[data-theme="dark"] .t-badge.pass { background: #14301e; color: #6ee7a0; }

:root[data-theme="dark"] .t-badge.warn { background: #3a2f10; color: #fbbf24; }

:root[data-theme="dark"] .l-q.graded .l-opt.ans { background: #14301e; border-color: #2c7a4a; }

:root[data-theme="dark"] .l-q.right { border-color: #2c7a4a; }

:root[data-theme="dark"] .l-q.wrong { border-color: #7a3c38; }

:root[data-theme="dark"] .kw-pop { box-shadow: 0 12px 32px rgba(0, 0, 0, .5); }

/* 动画开关：motion=off 时全局禁用过渡与动画 */
:root[data-motion="off"] *, :root[data-motion="off"] *::before, :root[data-motion="off"] *::after {
  animation-duration: .01ms !important;
  animation-delay: 0ms !important;
  transition-duration: .01ms !important;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
    "Noto Sans CJK SC", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 16px;
}

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ---------- 顶栏 ---------- */
.p-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 1040px;
  margin: 0 auto;
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--border);
}

.p-logo {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  font-weight: 700;
  text-decoration: none;
}

.p-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: .02em;
  line-height: 1.25;
}

.p-sub {
  margin: 1px 0 0;
  font-size: .74rem;
  color: var(--text-2);
}

.p-topbar-mid { flex: 1; min-width: 0; }

.p-pill {
  flex: none;
  font-size: .72rem;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 11px;
  white-space: nowrap;
  text-decoration: none;
}

.p-pill[data-state="未配置"] {
  color: #b45309;
  background: #fef3c7;
  border-color: #fcd34d;
}

.p-pill[data-state="已同步"] {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: #cdd8fe;
}

/* ---------- 布局 ---------- */
.p-wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 18px 16px 56px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.p-sec-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .2em;
  color: var(--text-2);
}

.p-sec-label::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--primary);
  flex: none;
}

.p-sec-label .p-sec-link {
  margin-inline-start: auto;
  letter-spacing: .02em;
  font-weight: 400;
  text-decoration: none;
  color: var(--primary);
}

/* ---------- 倒计时卡片 ---------- */
.p-exams {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.p-exam {
  padding: 16px 18px 14px;
  border-radius: var(--radius);
  text-decoration: none;
  display: block;
}

.p-exam.solid { background: var(--primary); color: #fff; }

.p-exam.soft {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.p-exam-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: .86rem;
  font-weight: 600;
  letter-spacing: .04em;
}

.p-exam.solid .p-exam-top .note { color: rgba(255, 255, 255, .78); }

.p-exam.soft .p-exam-top .note { color: var(--text-2); }

.p-exam-top .note {
  font-size: .68rem;
  font-weight: 400;
  letter-spacing: 0;
  text-align: right;
}

.p-exam-days {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 8px 0 10px;
}

.p-exam-days .n {
  font-size: clamp(2.8rem, 9vw, 3.8rem);
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  animation: num-roll var(--dur-2) var(--ease-out);
}

@keyframes num-roll {
  from { opacity: 0; translate: 0 12px; }
  to { opacity: 1; translate: 0 0; }
}

.p-exam.soft .p-exam-days .n { color: var(--primary); }

.p-exam-days .u { font-size: .9rem; }

.p-exam.solid .p-exam-days .u { color: rgba(255, 255, 255, .85); }

.p-exam.soft .p-exam-days .u { color: var(--text-2); }

.p-exam-date {
  border-top: 1px solid;
  padding-top: 8px;
  font-size: .74rem;
  font-variant-numeric: tabular-nums;
}

.p-exam.solid .p-exam-date { border-color: rgba(255, 255, 255, .35); color: rgba(255, 255, 255, .88); }

.p-exam.soft .p-exam-date { border-color: var(--hairline); color: var(--text-2); }

/* ---------- 卡片 ---------- */
.p-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

.p-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.p-card-title { margin: 0; font-size: 1rem; font-weight: 800; letter-spacing: .02em; }

.p-card-head .meta { font-size: .72rem; color: var(--text-2); text-align: right; }

/* ---------- 数字 ---------- */
.p-nums { display: flex; flex-wrap: wrap; gap: 26px; }

.p-num { display: flex; flex-direction: column; }

.p-num b {
  font-size: 1.9rem;
  line-height: 1.1;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.p-num span { font-size: .74rem; color: var(--text-2); margin-top: 2px; }

/* ---------- 按钮 ---------- */
.p-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: .95rem;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--dur-1) var(--ease-out),
    border-color var(--dur-1) var(--ease-out),
    translate var(--dur-1) var(--ease-out);
}

.p-btn:hover { border-color: #cdd8fe; }

.p-btn:active { translate: 0 1px; }

.p-btn-blue { background: var(--primary); border-color: var(--primary); color: #fff; }

.p-btn-block { display: flex; width: 100%; }

/* ---------- 入口宫格 ---------- */
.p-entries {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.p-entry {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 14px 12px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 76px;
  transition: border-color var(--dur-1) var(--ease-out),
    box-shadow var(--dur-1) var(--ease-out),
    translate var(--dur-1) var(--ease-out),
    scale var(--dur-1) var(--ease-out);
}

.p-entry:hover {
  border-color: #cdd8fe;
  box-shadow: 0 4px 12px rgba(77, 107, 254, .10);
  translate: 0 -2px;
}

.p-entry:active { translate: 0 1px; scale: .985; }

.p-entry .t { font-weight: 700; font-size: .98rem; }

.p-entry .m { font-size: .72rem; color: var(--text-2); }

.p-entry .go { margin-top: auto; align-self: flex-end; color: var(--text-2); }

.p-entry.solid { background: var(--primary); border-color: var(--primary); color: #fff; }

.p-entry.solid .m, .p-entry.solid .go { color: rgba(255, 255, 255, .82); }

/* ---------- 双科进度 ---------- */
.p-grid-2 { display: grid; grid-template-columns: 1fr; gap: 12px; }

.p-bigpct {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 8px;
}

.p-bigpct b {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.p-bigpct span { font-size: .78rem; color: var(--text-2); }

.p-bar {
  height: 10px;
  border-radius: 999px;
  background: var(--surface-2);
  margin-bottom: 12px;
  overflow: hidden;
}

.p-bar > i { display: block; height: 100%; border-radius: 999px; background: var(--primary); }

.p-mini { display: flex; align-items: center; gap: 10px; padding: 6px 0; }

.p-mini + .p-mini { border-top: 1px solid var(--hairline); }

.p-mini .lab { flex: none; width: 7.5em; font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.p-mini .trk { flex: 1; height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }

.p-mini .trk > i { display: block; height: 100%; border-radius: 999px; background: var(--primary); }

.p-mini .pct { flex: none; width: 3.2em; text-align: right; font-size: .74rem; color: var(--text-2); font-variant-numeric: tabular-nums; }

.p-live {
  border-top: 1px solid var(--hairline);
  margin-top: 10px;
  padding-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
}

.p-live .it { font-size: .8rem; color: var(--text-2); }

.p-live .it b { color: var(--primary); font-size: 1rem; font-variant-numeric: tabular-nums; margin-right: 2px; }

.p-card-link {
  display: block;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--hairline);
  font-size: .8rem;
  color: var(--primary);
  text-decoration: none;
}

/* ---------- 测评速览 ---------- */
.p-assess-latest {
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--hairline);
  font-size: .78rem;
  color: var(--text-2);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.p-assess-latest b { color: var(--text); font-weight: 600; }

/* ---------- 表格（测评中心） ---------- */
.p-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.p-table-wrap table { border-collapse: collapse; width: 100%; font-size: .82rem; }

.p-table-wrap th, .p-table-wrap td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--hairline);
  vertical-align: top;
  white-space: nowrap;
}

.p-table-wrap td.c-wide { white-space: normal; }

.p-table-wrap th {
  color: var(--text-2);
  font-weight: 600;
  font-size: .74rem;
  background: var(--surface-2);
}

.p-table-wrap tr:last-child td { border-bottom: 0; }

.p-table-wrap td { min-width: 4em; }

.p-table-wrap .c-wide { min-width: 16em; }

tr.is-due td { background: var(--primary-soft); }

.cell-due { color: var(--primary); font-weight: 700; }

.p-table-group { margin-bottom: 22px; }

.p-table-group h3 {
  margin: 0 0 8px;
  font-size: .88rem;
  font-weight: 700;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.p-table-group h3 .cnt { font-size: .72rem; color: var(--text-2); font-weight: 400; }

/* ---------- 测评：分科 Tab ---------- */
.p-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.p-tab {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: .84rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--dur-1) var(--ease-out),
    color var(--dur-1) var(--ease-out),
    border-color var(--dur-1) var(--ease-out),
    translate var(--dur-1) var(--ease-out);
}

.p-tab:hover { border-color: #cdd8fe; color: var(--primary); }

.p-tab:active { translate: 0 1px; }

.p-tab.on {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.p-tab-filter { margin-inline-start: auto; }

.p-tab-filter.on {
  background: var(--primary-soft);
  border-color: #cdd8fe;
  color: var(--primary);
}

/* ---------- 测评：可折叠表节 ---------- */
.p-fold { margin-bottom: 14px; }

.p-fold-head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: .92rem;
  font-weight: 700;
  font-family: inherit;
  text-align: start;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color var(--dur-1) var(--ease-out);
}

.p-fold-head:hover { border-color: #cdd8fe; }

.p-fold-head .ar {
  flex: none;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--text-2);
  border-bottom: 2px solid var(--text-2);
  rotate: -45deg;
  transition: rotate var(--dur-2) var(--ease-out);
}

.p-fold.open .p-fold-head .ar { rotate: 45deg; }

.p-fold-head .cnt {
  margin-inline-start: auto;
  font-size: .72rem;
  font-weight: 400;
  color: var(--text-2);
}

.p-fold-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--dur-2) var(--ease-out);
}

.p-fold.open .p-fold-body { grid-template-rows: 1fr; }

.p-fold-inner {
  overflow: hidden;
  min-height: 0;
}

.p-fold.open .p-fold-inner { padding-top: 10px; }

/* 入场：折叠节进入视口时轻微上浮 */
.p-fold {
  opacity: 0;
  translate: 0 8px;
  transition: opacity var(--dur-2) var(--ease-out),
    translate var(--dur-2) var(--ease-out);
}

.p-fold.in { opacity: 1; translate: 0 0; }

/* ---------- 测评：手机记录卡（<768px 替代表格） ---------- */
.p-recs { display: none; }

.p-rec {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 14px;
  margin-bottom: 10px;
}

.p-rec.is-due { background: var(--primary-soft); border-color: #cdd8fe; }

.p-rec-row {
  display: flex;
  gap: 10px;
  padding: 3px 0;
  font-size: .82rem;
}

.p-rec-row .k {
  flex: none;
  width: 5.2em;
  color: var(--text-2);
  font-size: .74rem;
  padding-top: 1px;
}

.p-rec-row .v { flex: 1; min-width: 0; }

.p-empty {
  margin: 0;
  padding: 18px 14px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-2);
  font-size: .82rem;
  text-align: center;
}

/* ---------- 页脚 ---------- */
.p-foot {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  font-size: .72rem;
  color: var(--text-2);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* ---------- 返回链接（子页头部） ---------- */
.p-back {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--border);
  background: var(--surface);
}

/* ---------- 今日阅读打卡 ---------- */
.p-check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
}

.p-check-item + .p-check-item { border-top: 1px solid var(--hairline); }

.p-check-item .rid {
  flex: none;
  font-size: .74rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 8px;
  padding: 3px 8px;
  font-variant-numeric: tabular-nums;
}

.p-check-item .rmain { flex: 1; min-width: 0; }

.p-check-item .rmain b {
  display: block;
  font-size: .9rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.p-check-item .rmain i {
  display: block;
  font-style: normal;
  font-size: .72rem;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.p-check-btn {
  flex: none;
  min-width: 84px;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #fff;
  font-size: .84rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--dur-1) var(--ease-out),
    color var(--dur-1) var(--ease-out),
    border-color var(--dur-1) var(--ease-out),
    translate var(--dur-1) var(--ease-out),
    scale var(--dur-1) var(--ease-out);
}

.p-check-btn:hover { background: #3d5cfa; }

.p-check-btn:active { translate: 0 1px; scale: .97; }

.p-check-btn:disabled { cursor: default; }

.p-check-btn.done {
  background: var(--primary-soft);
  border-color: #cdd8fe;
  color: var(--primary);
  cursor: default;
}

.p-check-summary {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--hairline);
  font-size: .8rem;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

.p-rules {
  margin: 10px 0 0;
  padding: 10px 0 0 1.2em;
  border-top: 1px solid var(--hairline);
  font-size: .72rem;
  color: var(--text-2);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* ---------- 题型训练指南 ---------- */
.t-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }

.t-note { margin: 0; font-size: .84rem; color: var(--text); }

.t-note code, .t-kv .v code {
  font-family: ui-monospace, Consolas, monospace;
  font-size: .92em;
  background: var(--surface-2);
  border-radius: 6px;
  padding: 1px 6px;
}

.t-note a { color: var(--primary); }

.t-kv { display: flex; gap: 10px; padding: 7px 0; font-size: .82rem; }

.t-kv + .t-kv { border-top: 1px solid var(--hairline); }

.t-kv .k { flex: none; width: 4.5em; color: var(--text-2); }

.t-kv .v { flex: 1; min-width: 0; }

.t-kv .v b { color: var(--primary); }

.t-kv .v .t-sub {
  display: block;
  font-style: normal;
  font-size: .72rem;
  color: var(--text-2);
  margin-top: 2px;
}

.t-kv .v a.t-ext { color: var(--primary); text-decoration: none; }

.t-kv .v a.t-ext:hover { text-decoration: underline; }

/* AI 训练中心：能力徽章 */
.t-caps { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 10px; }

.t-cap {
  font-size: .7rem;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--border);
}

.t-cap.ai {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: #cdd8fe;
  font-weight: 600;
}

/* 成绩徽章（训练卡 + 测评页共用）：绿=达标 黄=未达标 */
.t-badge {
  display: inline-block;
  font-size: .78rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.t-badge.pass { background: #e7f7ec; color: #157f3c; }

.t-badge.warn { background: #fef3c7; color: #b45309; }

/* 启动命令 + 一键复制 */
.t-cmd { user-select: all; }

.p-copy {
  margin-left: 8px;
  padding: 4px 12px;
  border-radius: 8px;
  border: 1px solid var(--primary);
  background: var(--surface);
  color: var(--primary);
  font-size: .74rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--dur-1) var(--ease-out),
    color var(--dur-1) var(--ease-out),
    translate var(--dur-1) var(--ease-out);
}

.p-copy:hover { background: var(--primary-soft); }

.p-copy:active { translate: 0 1px; }

.p-copy.ok { background: var(--primary); color: #fff; }

/* ---------- 打卡标题链接 ---------- */
.p-check-item .rmain b a.rlink { color: var(--primary); text-decoration: none; }

.p-check-item .rmain b a.rlink:hover { text-decoration: underline; }

/* ---------- 阅读页（read/*） ---------- */
.r-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: transparent;
  z-index: 50;
}

.r-progress i {
  display: block;
  height: 100%;
  background: var(--primary);
  transform-origin: 0 50%;
  transform: scaleX(0);
}

.r-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  max-width: 720px;
  margin: 0 auto;
  padding: 14px 18px 0;
  font-size: 14px;
}

.r-nav a { color: var(--primary); text-decoration: none; }

.r-nav-right { display: flex; align-items: center; gap: 10px; }

.r-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 12px 18px 48px;
  font-size: 17px;
  line-height: 1.8;
  color: var(--text);
  word-wrap: break-word;
}

.r-wrap h1 { font-size: 22px; line-height: 1.5; margin: 18px 0 6px; }

.r-wrap h2 { font-size: 19px; margin: 26px 0 8px; }

.r-wrap h3 { font-size: 17px; margin: 20px 0 6px; }

.r-wrap p { margin: 12px 0; }

.r-wrap blockquote {
  margin: 10px 0;
  padding: 8px 14px;
  background: var(--surface-2);
  border-left: 3px solid var(--primary);
  border-radius: 0 8px 8px 0;
  color: var(--text-2);
  font-size: 15px;
}

.r-wrap .r-li { padding-inline-start: .8em; }

.r-wrap .r-img img { max-width: 100%; border-radius: 8px; display: block; margin: 6px auto; }

.r-scene {
  display: inline-block;
  font-size: .78rem;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 999px;
  padding: 4px 12px;
  margin: 4px 0 8px !important;
}

/* 中英对照：zh 段默认浅色小字，对照/中/英三态切换 */
.r-wrap p.zh {
  color: var(--text-2);
  font-size: .92em;
  margin: -6px 0 14px;
  padding-inline-start: 10px;
  border-inline-start: 2px solid var(--hairline);
}

body[data-read-mode="en"] .r-wrap p.zh { display: none; }

body[data-read-mode="zh"] .r-wrap p.en { display: none; }

/* 模式与字号切换组 */
.r-mode, .r-font {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface);
}

.r-mode button, .r-font button {
  border: 0;
  background: transparent;
  color: var(--text-2);
  font-size: .74rem;
  font-weight: 600;
  font-family: inherit;
  padding: 5px 11px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out);
}

.r-mode button.on, .r-font button:hover {
  background: var(--primary);
  color: #fff;
}

/* 词汇圈出 */
.r-wrap mark.kw {
  background: transparent;
  color: var(--primary);
  font-weight: 600;
  border-bottom: 1.5px dashed var(--primary);
  cursor: pointer;
  padding: 0 1px;
  border-radius: 2px;
  transition: background var(--dur-1) var(--ease-out);
}

.r-wrap mark.kw:hover { background: var(--primary-soft); }

/* 词汇弹卡 */
.kw-pop {
  position: fixed;
  z-index: 60;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(16, 24, 40, .18);
  padding: 14px 16px;
  font-size: .84rem;
  line-height: 1.6;
  max-height: 60vh;
  overflow-y: auto;
  animation: kw-pop-in var(--dur-2) var(--ease-out);
}

@keyframes kw-pop-in {
  from { opacity: 0; translate: 0 6px; }
  to { opacity: 1; translate: 0 0; }
}

/* 页尾重点词汇卡 */
.kw-list { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }

.kw-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px 14px;
  font-size: .86rem;
}

.kw-head { display: flex; align-items: baseline; gap: 10px; }

.kw-head b { font-size: 1rem; color: var(--primary); }

.kw-m { color: var(--text-2); font-size: .8rem; }

.kw-tts {
  margin-inline-start: auto;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 8px;
  padding: 3px 8px;
  font-size: .8rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--dur-1) var(--ease-out), translate var(--dur-1) var(--ease-out);
}

.kw-tts:hover { background: var(--primary-soft); }

.kw-tts:active { translate: 0 1px; }

.kw-root { color: var(--primary); font-weight: 600; margin-top: 6px; }

.kw-family, .kw-hook, .kw-ctx { color: var(--text-2); margin-top: 4px; font-size: .8rem; }

.kw-ctx { font-style: italic; }

/* 篇尾标记已读 */
.r-done { margin: 28px 0 8px; text-align: center; }

/* ---------- 骨架屏（数据加载中） ---------- */
.skel {
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: skel-pulse 1.2s var(--ease-out) infinite;
  min-height: 52px;
}

@keyframes skel-pulse {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

/* ---------- 阅读材料列表 ---------- */
.w-list { display: flex; flex-direction: column; gap: 8px; }

.w-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
  transition: border-color var(--dur-1) var(--ease-out),
    translate var(--dur-1) var(--ease-out);
}

.w-item:hover { border-color: #cdd8fe; translate: 0 -1px; }

.w-item:active { translate: 0 1px; }

.w-item .w-id {
  flex: none;
  font-size: .72rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 8px;
  padding: 3px 8px;
  font-variant-numeric: tabular-nums;
}

.w-item .w-main { flex: 1; min-width: 0; }

.w-item .w-main b {
  display: block;
  font-size: .88rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.w-item .w-main i {
  display: block;
  font-style: normal;
  font-size: .72rem;
  color: var(--text-2);
  margin-top: 1px;
}

.w-item .w-state { flex: none; font-size: .74rem; color: var(--text-2); }

.w-item.done .w-state { color: var(--primary); font-weight: 600; }

.w-item.done { border-color: #cdd8fe; }

/* ---------- 听力训练 ---------- */
.l-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }

.l-set { text-decoration: none; color: var(--text); display: block; }

.l-tag {
  font-size: .7rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
}

.l-tag.listen { background: var(--surface-2); color: var(--text-2); }

.l-meta { font-size: .74rem; color: var(--text-2); margin-bottom: 4px; }

.l-topic { font-size: .82rem; color: var(--text); }

.l-audio-status { font-size: .74rem; color: var(--text-2); margin: 4px 0 0; }
.l-audio-status:empty { display: none; }

.l-speed { display: flex; align-items: center; gap: 6px; margin-top: 10px; }

.l-speed button {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: .74rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out);
}

.l-speed button.on { background: var(--primary); border-color: var(--primary); color: #fff; }

.l-q { margin-bottom: 12px; }

.l-qtitle { font-size: .9rem; font-weight: 600; margin-bottom: 10px; }

.l-qno {
  display: inline-block;
  min-width: 22px;
  text-align: center;
  font-size: .72rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 6px;
  padding: 2px 5px;
  margin-inline-end: 8px;
  font-variant-numeric: tabular-nums;
}

.l-opts { display: flex; flex-direction: column; gap: 4px; }

.l-opt {
  display: flex;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  font-size: .86rem;
  transition: border-color var(--dur-1) var(--ease-out), background var(--dur-1) var(--ease-out);
}

.l-opt:hover { border-color: #cdd8fe; }

.l-opt input { accent-color: var(--primary); margin-top: 2px; }

.l-opt .l-key { font-weight: 700; color: var(--text-2); }

.l-opt .l-val { flex: 1; }

.l-opt:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }

.l-q.graded .l-opt { cursor: default; }

.l-q.right { border-color: #86c79a; }

.l-q.wrong { border-color: #f2b8b5; }

.l-q.graded .l-opt.ans { border-color: #157f3c; background: #e7f7ec; }

.l-exp {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--hairline);
  font-size: .8rem;
  color: var(--text-2);
}

.l-score { text-align: center; padding: 20px 16px; }

.l-score-num { font-size: 2.6rem; font-weight: 800; color: var(--primary); font-variant-numeric: tabular-nums; }

.l-score-num span { font-size: 1.2rem; color: var(--text-2); }

.l-score-pct { font-size: .9rem; color: var(--text); margin: 4px 0 12px; }

.l-score-note { font-size: .76rem; color: var(--text-2); margin: 0 0 14px; }

.l-score .p-btn { margin: 0 4px; }

.l-script { display: flex; flex-direction: column; gap: 6px; font-size: .86rem; }

.l-line { display: flex; gap: 8px; }

.l-sp { flex: none; width: 1.4em; }

.l-qa { border-top: 1px solid var(--hairline); padding: 8px 0; }

.l-qa summary { cursor: pointer; font-size: .86rem; font-weight: 600; list-style: none; }

.l-qa summary::-webkit-details-marker { display: none; }

.l-qa-a { margin-top: 8px; font-size: .84rem; color: var(--text); }

.l-qa-exp { margin-top: 6px; font-size: .78rem; color: var(--text-2); }

@media (min-width: 720px) {
  .l-grid { grid-template-columns: 1fr 1fr; }
}

/* ---------- 设置卡（主页） ---------- */
.set-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.set-field { display: flex; flex-direction: column; gap: 6px; }

.set-field > span { font-size: .78rem; color: var(--text-2); font-weight: 600; }

.set-field input {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  font-size: .9rem;
  font-family: inherit;
  padding: 10px 12px;
  min-height: 44px;
}

.set-field input:focus { outline: 2px solid var(--primary); outline-offset: 1px; border-color: var(--primary); }

.set-seg {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-2);
  align-self: flex-start;
}

.set-seg button {
  border: 0;
  background: transparent;
  color: var(--text-2);
  font-size: .8rem;
  font-weight: 600;
  font-family: inherit;
  padding: 8px 16px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out);
}

.set-seg button.on { background: var(--primary); color: #fff; }

.set-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.set-hint {
  margin: 10px 0 0;
  font-size: .74rem;
  color: var(--text-2);
  transition: color var(--dur-1) var(--ease-out);
}

.set-hint.show { color: var(--primary); font-weight: 600; }

@media (min-width: 720px) {
  .set-grid { grid-template-columns: 1fr 1fr; }
}

/* ---------- 真题库 ---------- */
.z-session + .z-session { margin-top: 12px; }

.z-paper {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--hairline);
  text-decoration: none;
  font-size: .85rem;
  color: var(--text);
}

.z-paper .z-set { font-weight: 600; }

.z-paper .z-size { font-size: .72rem; color: var(--text-2); font-variant-numeric: tabular-nums; }

.z-paper .z-go { margin-left: auto; color: var(--primary); font-size: .8rem; }

/* ---------- 入场 stagger（首屏卡片） ---------- */
.rise {
  opacity: 0;
  animation: rise-in var(--dur-2) var(--ease-out) forwards;
  animation-delay: calc(var(--rise-i, 0) * 45ms);
}

.p-exams .p-exam,
.p-entries .p-entry {
  opacity: 0;
  animation: rise-in var(--dur-2) var(--ease-out) forwards;
}

.p-exams .p-exam:nth-child(1), .p-entries .p-entry:nth-child(1) { animation-delay: 0ms; }
.p-exams .p-exam:nth-child(2), .p-entries .p-entry:nth-child(2) { animation-delay: 45ms; }
.p-entries .p-entry:nth-child(3) { animation-delay: 90ms; }
.p-entries .p-entry:nth-child(4) { animation-delay: 135ms; }
.p-entries .p-entry:nth-child(5) { animation-delay: 180ms; }
.p-entries .p-entry:nth-child(6) { animation-delay: 225ms; }

@keyframes rise-in {
  from { opacity: 0; translate: 0 10px; }
  to { opacity: 1; translate: 0 0; }
}

/* ---------- View Transitions（渐进增强） ---------- */
@view-transition { navigation: auto; }

::view-transition-old(root) { animation: vt-out var(--dur-2) var(--ease-out); }
::view-transition-new(root) { animation: vt-in var(--dur-2) var(--ease-out); }

@keyframes vt-out { to { opacity: 0; translate: 0 -6px; } }
@keyframes vt-in { from { opacity: 0; translate: 0 6px; } }

/* 方向型（assess Tab 切换） */
html:active-view-transition-type(forward)::view-transition-old(root) {
  animation-name: vt-out-left;
}
html:active-view-transition-type(forward)::view-transition-new(root) {
  animation-name: vt-in-right;
}
html:active-view-transition-type(backward)::view-transition-old(root) {
  animation-name: vt-out-right;
}
html:active-view-transition-type(backward)::view-transition-new(root) {
  animation-name: vt-in-left;
}

@keyframes vt-out-left { to { opacity: 0; translate: -12px 0; } }
@keyframes vt-in-right { from { opacity: 0; translate: 12px 0; } }
@keyframes vt-out-right { to { opacity: 0; translate: 12px 0; } }
@keyframes vt-in-left { from { opacity: 0; translate: -12px 0; } }

/* ---------- 无障碍：尊重减少动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-delay: 0ms !important;
    transition-duration: .01ms !important;
  }
  .rise, .p-fold { opacity: 1; translate: 0 0; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) {
    animation: none !important;
  }
}

/* ---------- 宽屏 ---------- */
@media (min-width: 720px) {
  .p-exams { grid-template-columns: 1fr 1fr; }
  .p-entries { grid-template-columns: repeat(4, 1fr); }
  .t-grid { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 768px) {
  /* 桌面表格 + 隐藏手机记录卡 */
  .p-recs { display: none !important; }
}

@media (max-width: 767px) {
  /* 手机：记录卡替代表格，消灭横滚 */
  .p-fold .p-table-wrap { display: none; }
  .p-recs { display: block; }
}

@media (min-width: 960px) {
  .p-grid-2 { grid-template-columns: 1fr 1fr; }
  .p-wrap { gap: 26px; }
}
