/* Choice practice — 主题挂在 html[data-cp-theme]，默认玻璃，贴近全站导航 */
html.page--choice_practice {
  --cp-paper: #f4f5f7;
  --cp-card: #ffffff;
  --cp-ink: #09090b;
  --cp-muted: #71717a;
  --cp-faint: #a1a1aa;
  --cp-line: rgba(15, 23, 42, 0.08);
  --cp-theme-accent: #2563eb;
  --cp-on-accent: #ffffff;
  --cp-accent: var(--cp-theme-accent);
  --cp-accent-soft: rgba(37, 99, 235, 0.08);
  --cp-ok: #16a34a;
  --cp-ok-soft: #f0fdf4;
  --cp-bad: #dc2626;
  --cp-bad-soft: #fef2f2;
  --cp-warn: #d97706;
  --cp-warn-soft: #fffbeb;
  --cp-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  --cp-shadow-lg: 0 8px 24px rgba(15, 23, 42, 0.08);
  --cp-radius: 10px;
  --cp-font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--cp-paper);
  color: var(--cp-ink);
}
html.page--choice_practice[data-theme="dark"][data-cp-theme="glass"],
html.page--choice_practice.theme--dark:not([data-theme="light"])[data-cp-theme="glass"],
html.page--choice_practice[data-theme="dark"]:not([data-cp-theme]),
html.page--choice_practice.theme--dark:not([data-theme="light"]):not([data-cp-theme]) {
  --cp-paper: #0d1117;
  --cp-card: #161b22;
  --cp-ink: #fafafa;
  --cp-muted: #a1a1aa;
  --cp-faint: #71717a;
  --cp-line: rgba(255, 255, 255, 0.08);
  --cp-theme-accent: #60a5fa;
  --cp-accent-soft: rgba(96, 165, 250, 0.14);
  --cp-ok: #4ade80;
  --cp-ok-soft: #052e16;
  --cp-bad: #f87171;
  --cp-bad-soft: #450a0a;
  --cp-warn: #fbbf24;
  --cp-warn-soft: #422006;
  --cp-shadow: none;
  --cp-shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.4);
}
html.page--choice_practice body,
html.page--choice_practice .main,
html.page--choice_practice .section,
html.page--choice_practice .section__body,
html.page--choice_practice .main-content {
  background: var(--cp-paper);
  color: var(--cp-ink);
}
/* 题库 accent 写在壳子的 inline style 上，主题色必须压过它 */
html.page--choice_practice #cp-shell {
  --cp-accent: var(--cp-theme-accent) !important;
}
.cp-theme {
  font-family: var(--cp-font);
  color: var(--cp-ink);
  box-sizing: border-box;
}
.cp-theme *,
.cp-theme *::before,
.cp-theme *::after { box-sizing: border-box; }

.cp-shell {
  max-width: 1120px;
  width: min(92%, 1120px);
  margin: 0 auto 48px;
  padding: 12px 0 72px;
  min-height: 64vh;
}

.cp-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  position: sticky;
  top: 0;
  z-index: 8;
  padding: 10px 0 12px;
  background: color-mix(in srgb, var(--cp-paper) 86%, transparent);
  backdrop-filter: blur(14px);
}
.cp-back-ps {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
  background: var(--cp-card); color: var(--cp-muted); text-decoration: none;
  border: 1px solid var(--cp-line); cursor: pointer; padding: 0;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.cp-back-ps:hover { color: var(--cp-ink); border-color: var(--cp-line); background: var(--cp-accent-soft); }
.cp-cover {
  width: 36px; height: 36px; border-radius: 8px; object-fit: cover;
  flex-shrink: 0; border: 1px solid var(--cp-line);
}
.cp-top-copy { flex: 1; min-width: 0; }
.cp-page-title-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 12px; }
.cp-page-title { font-size: 18px; margin: 0; font-weight: 650; letter-spacing: -0.02em; color: var(--cp-ink); }
.cp-page-sub { font-size: 13px; font-weight: 450; color: var(--cp-muted); line-height: 1.4; }
.cp-total-badge {
  font-size: 12px; color: var(--cp-muted); background: var(--cp-card);
  border: 1px solid var(--cp-line); padding: 4px 10px; border-radius: 999px;
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.cp-hero {
  display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center;
  background: var(--cp-card); border: 1px solid var(--cp-line); border-radius: var(--cp-radius);
  padding: 16px 18px; box-shadow: var(--cp-shadow); margin-bottom: 14px;
}
.cp-ring { position: relative; display: grid; place-items: center; flex-shrink: 0; }
.cp-ring svg { display: block; transform: rotate(-90deg); }
.cp-ring-track { fill: none; stroke: var(--cp-line); }
.cp-ring-value { fill: none; stroke: var(--cp-accent) !important; stroke-linecap: round; transition: stroke-dasharray 0.6s ease; }
.cp-ring-label {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; pointer-events: none;
}
.cp-ring-pct { font-size: 20px; font-weight: 750; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; line-height: 1; }
.cp-ring-pct-sm { font-size: 11px; font-weight: 700; }
.cp-ring-hint { font-size: 10px; color: var(--cp-faint); margin-top: 2px; }
.cp-hero-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; position: relative; }
.cp-hero-stat {
  padding: 10px 8px; border-radius: 8px; text-align: center;
  background: var(--cp-paper);
  border: 1px solid var(--cp-line);
}
.cp-hero-stat-val { font-size: 22px; font-weight: 650; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.cp-hero-stat-lbl { font-size: 12px; color: var(--cp-muted); margin-top: 4px; }

.cp-home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.cp-cat-card {
  position: relative; background: var(--cp-card); border-radius: var(--cp-radius);
  padding: 14px 14px 12px; box-shadow: var(--cp-shadow); cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  border: 1px solid var(--cp-line); overflow: hidden; display: flex; gap: 12px;
  align-items: center; min-height: 84px;
}
.cp-cat-card::before { display: none; }
.cp-cat-card:hover {
  border-color: color-mix(in srgb, var(--cp-accent) 35%, var(--cp-line));
  background: color-mix(in srgb, var(--cp-accent-soft) 65%, var(--cp-card));
}
.cp-cat-card:active { transform: none; }
.cp-cat-card:focus-visible { outline: 2px solid var(--cp-accent); outline-offset: 2px; }
.cp-cat-copy { flex: 1; min-width: 0; }
.cp-cat-icon {
  width: 28px; height: 28px; border-radius: 7px; display: flex; align-items: center;
  justify-content: center; flex-shrink: 0; margin-bottom: 0;
  background: var(--cp-accent-soft) !important; color: var(--cp-accent) !important;
}
.cp-cat-icon svg { width: 16px; height: 16px; display: block; }
.cp-cat-name { font-size: 14px; font-weight: 620; color: var(--cp-ink); margin-bottom: 2px; }
.cp-cat-count { font-size: 12px; color: var(--cp-muted); }
.cp-cat-count strong { color: var(--cp-ink); font-variant-numeric: tabular-nums; }
.cp-cat-acc { font-size: 11px; color: var(--cp-faint); margin-top: 2px; }
.cp-cat-tooltip {
  position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%);
  background: var(--cp-ink); color: var(--cp-card); font-size: 12px; line-height: 1.5;
  padding: 8px 12px; border-radius: 8px; width: max-content; max-width: 240px;
  pointer-events: none; opacity: 0; transition: opacity 0.18s; z-index: 10;
}
.cp-cat-card:hover .cp-cat-tooltip { opacity: 1; }
.cp-empty-home {
  text-align: center; padding: 48px 20px; color: var(--cp-muted);
  background: var(--cp-card); border: 1px dashed var(--cp-line); border-radius: var(--cp-radius);
}

.cp-cockpit-bar { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; flex-wrap: wrap; }
.cp-cockpit-tag { font-size: 15px; font-weight: 720; letter-spacing: -0.02em; }
.cp-chapter-track {
  flex: 1; min-width: 140px; height: 8px; border-radius: 999px;
  background: var(--cp-line); overflow: hidden;
}
.cp-chapter-fill { height: 100%; width: 0; background: var(--cp-accent); border-radius: inherit; transition: width 0.35s ease; }
.cp-chapter-meta { font-size: 12px; color: var(--cp-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cp-kbd-hint {
  font-size: 12px; color: var(--cp-muted); border: 1px solid var(--cp-line);
  background: var(--cp-card); border-radius: 999px; padding: 4px 10px; cursor: pointer;
}
.cp-kbd-hint kbd { font-family: inherit; font-weight: 700; color: var(--cp-ink); }

.cp-practice-layout { display: flex; gap: 20px; align-items: flex-start; }
.cp-practice-main { flex: 1; min-width: 0; }
.cp-practice-sidebar { width: 300px; flex-shrink: 0; }

.cp-question-card {
  background: var(--cp-card); padding: 26px 28px; border-radius: var(--cp-radius);
  box-shadow: var(--cp-shadow); border: 1px solid var(--cp-line); margin-bottom: 16px; min-height: 280px;
}
/* github-markdown 按系统 prefers-color-scheme / 残留 theme--dark 上色，题面卡片必须跟 --cp-* */
html .cp-theme .markdown-body {
  background-color: transparent;
  color: inherit;
}
html .cp-theme .markdown-body h1,
html .cp-theme .markdown-body h2,
html .cp-theme .markdown-body h3,
html .cp-theme .markdown-body h4,
html .cp-theme .markdown-body h5,
html .cp-theme .markdown-body h6 {
  color: var(--cp-ink) !important;
  border-bottom-color: var(--cp-line);
}
html .cp-theme .markdown-body img {
  background-color: transparent;
}
html .cp-theme .markdown-body table tr {
  background-color: var(--cp-card);
  border-top-color: var(--cp-line);
}
html .cp-theme .markdown-body table tr:nth-child(2n) {
  background-color: var(--cp-paper);
}
.cp-question-top-bar { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.cp-question-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 0; flex: 1; min-width: 0; }
.cp-tag {
  display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px;
  font-weight: 600; line-height: 1.6; background: var(--cp-paper); color: var(--cp-muted);
  border: 1px solid var(--cp-line);
}
.cp-tag-type { background: var(--cp-accent-soft); color: var(--cp-accent); border-color: transparent; }
.cp-tag-diff { background: var(--cp-warn-soft); color: var(--cp-warn); border-color: transparent; }
.cp-tag-knowledge { background: var(--cp-ok-soft); color: var(--cp-ok); border-color: transparent; }
.cp-question-content { font-size: 16px; line-height: 1.8; margin-bottom: 18px; color: var(--cp-ink); }
.cp-options { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.cp-option {
  display: flex !important; flex-direction: row !important; align-items: flex-start; gap: 12px;
  padding: 13px 16px; border: 1.5px solid var(--cp-line); border-radius: 12px; cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.12s, box-shadow 0.15s;
  font-size: 15px; line-height: 1.6; background: var(--cp-card);
}
.cp-option:hover { border-color: color-mix(in srgb, var(--cp-accent) 55%, var(--cp-line)); background: var(--cp-accent-soft); }
.cp-option.selected { border-color: var(--cp-accent); background: var(--cp-accent-soft); box-shadow: 0 0 0 3px var(--cp-accent-soft); }
.cp-option.correct { border-color: var(--cp-ok); background: var(--cp-ok-soft); }
.cp-option.wrong { border-color: var(--cp-bad); background: var(--cp-bad-soft); }
.cp-option input { flex-shrink: 0; width: 16px; height: 16px; margin-top: 4px; cursor: pointer; }
.cp-option-letter {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center;
  font-weight: 750; font-size: 13px; color: var(--cp-muted); background: var(--cp-paper);
  line-height: 1; user-select: none;
}
.cp-option.selected .cp-option-letter { background: var(--cp-accent); color: var(--cp-on-accent, #fff); }
.cp-option .markdown-body { flex: 1; min-width: 0; }
.cp-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.cp-solution-hint {
  position: relative; font-size: 12px; color: var(--cp-faint); cursor: default;
  margin-left: auto; user-select: none;
}
.cp-solution-hint.cp-solution-hint-ready { cursor: pointer; color: var(--cp-accent); }
.cp-solution-hint.cp-solution-hint-locked { cursor: pointer; color: var(--cp-warn); }
.cp-solution-hint.cp-solution-hint-loading { pointer-events: none; opacity: 0.65; }
.cp-solution-hint-tip {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  white-space: nowrap; background: var(--cp-ink); color: var(--cp-card); font-size: 12px;
  padding: 6px 12px; border-radius: 6px; pointer-events: none; opacity: 0; transition: opacity 0.15s;
}
.cp-solution-hint:hover .cp-solution-hint-tip { opacity: 1; }
.cp-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 8px;
  font-size: 13px; font-weight: 600; border: none; cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s; text-decoration: none;
}
.cp-btn-primary {
  background: var(--cp-accent); color: var(--cp-on-accent, #fff);
}
.cp-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.cp-btn-outline { background: var(--cp-card); color: var(--cp-ink); border: 1.5px solid var(--cp-line); }
.cp-btn-outline:hover { border-color: var(--cp-accent); color: var(--cp-accent); }
.cp-btn-outline:disabled { opacity: 0.4; cursor: not-allowed; }

.cp-result { padding: 14px 18px; border-radius: 12px; margin-bottom: 16px; font-size: 15px; font-weight: 650; animation: cp-fade-in 0.28s ease; }
.cp-result-correct { background: var(--cp-ok-soft); color: var(--cp-ok); }
.cp-result-wrong { background: var(--cp-bad-soft); color: var(--cp-bad); }
.cp-solution { background: var(--cp-paper); border: 1px solid var(--cp-line); border-radius: 12px; padding: 16px 20px; margin-bottom: 16px; }
.cp-solution-title { font-size: 12px; font-weight: 700; color: var(--cp-muted); margin-bottom: 10px; letter-spacing: 0.08em; text-transform: uppercase; }
.cp-solution-lock-wrap {
  position: relative; min-height: 100px; border-radius: 8px; overflow: hidden;
  border: 1px dashed var(--cp-warn); background: var(--cp-warn-soft);
}
.cp-solution-lock-blur { position: absolute; inset: 0; background: linear-gradient(to bottom, transparent, var(--cp-card)); pointer-events: none; }
.cp-solution-lock-btn {
  position: relative; z-index: 2; display: block; margin: 28px auto; padding: 10px 24px;
  border-radius: 999px; border: none; background: var(--cp-warn); color: #fff;
  font-size: 14px; font-weight: 700; cursor: pointer;
}
.cp-empty { text-align: center; padding: 50px 20px; color: var(--cp-muted); font-size: 15px; }
.cp-empty svg { margin-bottom: 14px; opacity: 0.4; }

@keyframes cp-fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes cp-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.cp-options.cp-shake { animation: cp-shake 0.32s ease; }
@keyframes cp-shimmer { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }
.cp-skeleton-line {
  height: 14px; border-radius: 6px;
  background: linear-gradient(90deg, var(--cp-line) 25%, var(--cp-paper) 37%, var(--cp-line) 63%);
  background-size: 800px 100%; animation: cp-shimmer 1.6s ease-in-out infinite;
}
.cp-skeleton-line.cp-sk-tag { width: 60px; height: 22px; border-radius: 999px; display: inline-block; }
.cp-skeleton-line.cp-sk-title { width: 80%; height: 18px; margin-bottom: 10px; }
.cp-skeleton-line.cp-sk-text { width: 100%; margin-bottom: 8px; }
.cp-skeleton-line.cp-sk-text-short { width: 60%; margin-bottom: 16px; }
.cp-skeleton-option {
  display: flex; align-items: center; gap: 10px; padding: 13px 14px;
  border: 1.5px solid var(--cp-line); border-radius: 10px; margin-bottom: 8px;
}
.cp-skeleton-option .cp-sk-radio {
  width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(90deg, var(--cp-line) 25%, var(--cp-paper) 37%, var(--cp-line) 63%);
  background-size: 800px 100%; animation: cp-shimmer 1.6s ease-in-out infinite;
}
.cp-skeleton-option .cp-skeleton-line { flex: 1; }
.cp-skeleton-btn {
  width: 100px; height: 38px; border-radius: 999px; display: inline-block;
  background: linear-gradient(90deg, var(--cp-line) 25%, var(--cp-paper) 37%, var(--cp-line) 63%);
  background-size: 800px 100%; animation: cp-shimmer 1.6s ease-in-out infinite;
}
.cp-content-slot { position: relative; margin-bottom: 18px; }
.cp-content-slot > .cp-question-content { margin-bottom: 0; }
.cp-content-skel { display: none; flex-direction: column; }
.cp-tag-skel {
  display: inline-block; height: 22px; padding: 0; border-color: transparent; color: transparent;
  background-image: linear-gradient(90deg, var(--cp-line) 25%, var(--cp-paper) 37%, var(--cp-line) 63%);
  background-size: 800px 100%; animation: cp-shimmer 1.6s ease-in-out infinite;
}
.cp-question-card.is-busy .cp-options,
.cp-question-card.is-busy .cp-actions,
.cp-question-card.is-busy .cp-fav-btn,
.cp-question-card.is-busy .cp-solution-hint { pointer-events: none; }
.cp-question-card.is-busy .cp-actions .cp-btn:disabled,
.cp-question-card.is-busy .cp-fav-btn:disabled { opacity: 1; cursor: not-allowed; }
.cp-question-card.is-busy #cp-result-area { display: none; }
.cp-question-card.is-switching:not(.is-placeholder) .cp-content-slot { display: grid; }
.cp-question-card.is-switching:not(.is-placeholder) .cp-content-slot > .cp-question-content,
.cp-question-card.is-switching:not(.is-placeholder) .cp-content-slot > .cp-content-skel { grid-area: 1 / 1; }
.cp-question-card.is-switching:not(.is-placeholder) .cp-content-skel { display: flex; }
.cp-question-card.is-switching:not(.is-placeholder) .cp-question-content { visibility: hidden; }
.cp-question-card.is-switching:not(.is-placeholder) .cp-tag {
  color: transparent !important;
  border-color: transparent !important;
  background-color: transparent !important;
  background-image: linear-gradient(90deg, var(--cp-line) 25%, var(--cp-paper) 37%, var(--cp-line) 63%) !important;
  background-size: 800px 100% !important;
  animation: cp-shimmer 1.6s ease-in-out infinite;
}
.cp-question-card.is-switching:not(.is-placeholder) .cp-option { pointer-events: none; }
.cp-question-card.is-switching:not(.is-placeholder) .cp-option .markdown-body {
  color: transparent !important;
  border-radius: 6px;
  background-image: linear-gradient(90deg, var(--cp-line) 25%, var(--cp-paper) 37%, var(--cp-line) 63%);
  background-size: 800px 100%;
  animation: cp-shimmer 1.6s ease-in-out infinite;
}
.cp-question-card.is-switching:not(.is-placeholder) .cp-option-letter {
  color: transparent;
  background-image: linear-gradient(90deg, var(--cp-line) 25%, var(--cp-paper) 37%, var(--cp-line) 63%);
  background-size: 800px 100%;
  animation: cp-shimmer 1.6s ease-in-out infinite;
}
.cp-question-card.is-switching:not(.is-placeholder) .cp-option input { opacity: 0; }

.cp-sb-card {
  background: var(--cp-card); border-radius: var(--cp-radius); padding: 16px;
  box-shadow: var(--cp-shadow); border: 1px solid var(--cp-line); margin-bottom: 14px;
}
.cp-sb-title { font-size: 11px; font-weight: 700; color: var(--cp-muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.08em; }
.cp-grid-head {
  display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px;
  position: relative; z-index: 2;
}
.cp-sb-title-wrap { display: inline-flex; align-items: center; gap: 4px; min-width: 0; position: relative; }
.cp-grid-head .cp-sb-title { margin-bottom: 0; }
.cp-grid-head-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.cp-legend-help {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; padding: 0; border: 0; background: none; color: var(--cp-faint);
  cursor: help; border-radius: 999px;
}
.cp-legend-help svg { width: 14px; height: 14px; display: block; }
.cp-legend-help:hover, .cp-legend-help:focus-visible, .cp-legend-help.is-open { color: var(--cp-ink); }
.cp-legend-help:focus-visible { outline: 2px solid var(--cp-accent); outline-offset: 2px; }
.cp-sb-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.cp-sb-chip {
  display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px;
  font-size: 12px; border: 1px solid var(--cp-line); background: var(--cp-card);
  cursor: pointer; transition: 0.12s; user-select: none; color: var(--cp-ink);
}
.cp-sb-chip:hover { border-color: var(--cp-accent); }
.cp-sb-chip.active { background: var(--cp-accent); border-color: var(--cp-accent); color: var(--cp-on-accent, #fff); }
.cp-sb-chip input { display: none; }
.cp-sb-select {
  width: 100%; padding: 6px 8px; border: 1px solid var(--cp-line); border-radius: 8px;
  font-size: 12px; outline: none; background: var(--cp-card); color: var(--cp-ink);
}
.cp-sb-select:focus { border-color: var(--cp-accent); }
.cp-sb-diff-row { display: flex; align-items: center; gap: 6px; }
.cp-sb-diff-row span { font-size: 12px; color: var(--cp-faint); }
.cp-sb-reset {
  margin-top: 8px; width: 100%; padding: 7px 12px; border-radius: 8px;
  border: 1px solid var(--cp-line); background: var(--cp-card); color: var(--cp-muted);
  font-size: 12px; font-weight: 650; cursor: pointer;
}
.cp-sb-reset:hover { border-color: var(--cp-accent); color: var(--cp-accent); }

.cp-qgrid-group + .cp-qgrid-group {
  margin-top: 4px; padding-top: 2px; border-top: 1px solid var(--cp-line);
}
.cp-qgrid-group-label {
  display: flex; align-items: center; gap: 6px; width: 100%;
  margin: 0; padding: 10px 2px 6px; border: 0; background: none; color: var(--cp-muted);
  font-size: 12px; font-weight: 500; letter-spacing: 0.04em; line-height: 1.3; text-align: left;
  font-family: inherit;
}
.cp-qgrid-group:first-child .cp-qgrid-group-label { padding-top: 2px; }
.cp-qgrid-group-name {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cp-qgrid-collapse {
  display: grid; grid-template-rows: 1fr;
  transition: grid-template-rows 0.32s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.24s ease;
}
.cp-qgrid-group.is-collapsed .cp-qgrid-collapse {
  grid-template-rows: 0fr; opacity: 0; pointer-events: none;
}
.cp-qgrid-collapse > .cp-qgrid { min-height: 0; overflow: hidden; }
.cp-qgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: 5px; margin-bottom: 4px; padding: 2px; }
.cp-qcell {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  border-radius: 7px; font-size: 11px; font-weight: 700; cursor: pointer;
  border: 2px solid transparent; background: var(--cp-paper); color: var(--cp-muted);
  transition: 0.12s; user-select: none; position: relative; font-variant-numeric: tabular-nums;
}
.cp-qcell:hover { transform: scale(1.08); border-color: var(--cp-accent); }
.cp-qcell.correct { background: var(--cp-ok-soft); color: var(--cp-ok); }
/* 对错状态不能只靠红绿色相区分（红绿色弱不可辨）：错题加虚线边框，两态右下角加 ✓/✗ 角标 */
.cp-qcell.wrong { background: var(--cp-bad-soft); color: var(--cp-bad); border-style: dashed; border-color: var(--cp-bad); }
.cp-qcell.current { border-color: var(--cp-accent); box-shadow: 0 0 0 3px var(--cp-accent-soft); animation: cp-pulse 1.8s ease-in-out infinite; }
@keyframes cp-pulse {
  0%, 100% { box-shadow: 0 0 0 2px var(--cp-accent-soft); }
  50% { box-shadow: 0 0 0 4px var(--cp-accent-soft); }
}
.cp-qcell.locked { background: var(--cp-paper); color: var(--cp-faint); }
.cp-qcell.locked:hover { border-color: var(--cp-warn); color: var(--cp-warn); }
.cp-qcell.locked .cp-qcell-num { opacity: 0.55; }
.cp-qcell.locked .cp-qcell-lock { position: absolute; right: 1px; bottom: 1px; line-height: 0; color: var(--cp-warn); }
.cp-qcell.locked .cp-qcell-lock svg { display: block; }
.cp-qgrid-legend { display: flex; gap: 10px; margin: 0; font-size: 11px; color: var(--cp-muted); flex-wrap: wrap; }
.cp-legend-help .cp-qgrid-legend {
  display: none; position: absolute; left: 0; top: calc(100% + 8px); z-index: 30;
  width: max-content; max-width: 220px; padding: 8px 10px;
  background: color-mix(in srgb, var(--cp-card) 92%, transparent);
  backdrop-filter: blur(16px);
  border: 1px solid var(--cp-line); border-radius: 10px; box-shadow: var(--cp-shadow-lg);
}
.cp-legend-help:hover .cp-qgrid-legend,
.cp-legend-help:focus-within .cp-qgrid-legend,
.cp-legend-help.is-open .cp-qgrid-legend { display: flex; }
.cp-qgrid-legend-item { display: flex; align-items: center; gap: 3px; }
.cp-qgrid-legend-dot { width: 8px; height: 8px; border-radius: 3px; }
/* 图例升级为迷你格子并带 ✓/✗，与格子的实际呈现一致（色弱下仅靠圆点颜色不可辨） */
.cp-legend-correct, .cp-legend-wrong {
  width: 15px; height: 15px; border-radius: 5px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 900; line-height: 1;
}
.cp-legend-correct { background: var(--cp-ok-soft); border: 1px solid var(--cp-ok); }
.cp-legend-correct::after { content: '✓'; }
.cp-legend-wrong { background: var(--cp-bad-soft); border: 1px dashed var(--cp-bad); }
.cp-legend-wrong::after { content: '✗'; }
.cp-legend-unattempted { background: var(--cp-paper); border: 1px solid var(--cp-line); }
.cp-legend-locked { background: var(--cp-paper); border: 1px solid var(--cp-faint); }
.cp-grid-count { font-size: 11px; color: var(--cp-muted); }
.cp-grid-toggle-btn {
  padding: 2px 8px; border-radius: 6px; border: 1px solid var(--cp-line);
  background: var(--cp-card); color: var(--cp-muted); font-size: 11px; cursor: pointer;
}
.cp-grid-toggle-btn:hover { border-color: var(--cp-accent); color: var(--cp-accent); }
.cp-qgrid-group-collapsible { cursor: pointer; user-select: none; }
.cp-qgrid-group-collapsible:hover { color: var(--cp-ink); background: none; }
.cp-group-chevron {
  width: 14px; height: 14px; flex-shrink: 0; color: var(--cp-faint);
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}
.cp-qgrid-group.is-collapsed .cp-group-chevron { transform: rotate(-90deg); }
.cp-group-current-badge {
  margin-left: auto; flex-shrink: 0; font-size: 10px; font-weight: 600;
  letter-spacing: 0.12em; color: var(--cp-accent); background: none;
}
@media (prefers-reduced-motion: reduce) {
  .cp-qgrid-collapse, .cp-group-chevron { transition: none; }
}

.cp-fav-btn {
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 8px; border: 1.5px solid var(--cp-line);
  background: var(--cp-card); cursor: pointer; color: var(--cp-faint);
}
.cp-fav-btn:hover, .cp-fav-btn.cp-fav-active { border-color: #d4a017; background: var(--cp-warn-soft); color: #d4a017; }
.cp-fav-btn.cp-fav-loading { opacity: 0.5; pointer-events: none; }
.cp-fav-star { display: inline-flex; line-height: 0; }
.cp-fav-star svg { display: block; width: 18px; height: 18px; }
.cp-qcell.favorited::after {
  content: ""; position: absolute; top: -2px; right: -2px; width: 10px; height: 10px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23d4a017'%3E%3Cpath d='M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z'/%3E%3C/svg%3E") center / contain no-repeat;
}
/* 对错角标放右下：correct/wrong 可与 favorited 同格（星标占右上），locked 与 correct/wrong
   互斥故不与锁图标冲突；下方重置 favorited 规则可能带入的定位/尺寸/背景（同特异级，靠书写顺序兜底） */
.cp-qcell.correct::after,
.cp-qcell.wrong::after {
  content: ''; position: absolute; right: 3px; bottom: 2px;
  top: auto; width: auto; height: auto; background: none;
  font-size: 8px; font-weight: 900; line-height: 1; pointer-events: none;
}
.cp-qcell.correct::after { content: '✓'; }
.cp-qcell.wrong::after { content: '✗'; }

.cp-sb-stats { display: flex; gap: 6px; }
.cp-sb-stats-item { flex: 1; text-align: center; padding: 8px 4px; background: var(--cp-paper); border-radius: 8px; }
.cp-sb-stats-val { font-size: 16px; font-weight: 750; color: var(--cp-ink); font-variant-numeric: tabular-nums; }
.cp-sb-stats-lbl { font-size: 10px; color: var(--cp-muted); margin-top: 2px; }

.cp-note-card {
  background: var(--cp-card); padding: 0; border-radius: var(--cp-radius);
  box-shadow: var(--cp-shadow); border: 1px solid var(--cp-line); margin-bottom: 16px;
  overflow: hidden; position: relative;
}
.cp-note-tabs { display: flex; border-bottom: 1px solid var(--cp-line); }
.cp-note-tab {
  padding: 10px 18px; font-size: 13px; font-weight: 650; color: var(--cp-muted);
  cursor: pointer; border: none; background: none; border-bottom: 2px solid transparent;
  display: inline-flex; align-items: center; gap: 6px;
}
.cp-note-tab svg { flex-shrink: 0; width: 16px; height: 16px; }
.cp-note-tab:hover, .cp-note-tab.active { color: var(--cp-accent); }
.cp-note-tab.active { border-bottom-color: var(--cp-accent); }
.cp-note-body { padding: 18px 22px; min-height: 120px; position: relative; }
.cp-note-skeleton { display: none; }
.cp-note-body.is-loading .cp-note-stack,
.cp-note-body.is-loading .cp-ai-pane { visibility: hidden; }
.cp-note-body.is-loading .cp-note-skeleton {
  display: flex; flex-direction: column; gap: 10px; justify-content: center;
  position: absolute; inset: 0; z-index: 2; padding: 18px 22px; background: var(--cp-card);
}
.cp-note-view { min-height: 60px; }
.cp-note-view .markdown-body { font-size: 14px; line-height: 1.7; }
.cp-note-view-empty { color: var(--cp-faint); font-size: 13px; text-align: center; padding: 20px 0; }
.cp-note-editor {
  width: 100%; min-height: 140px; max-height: 400px; border: 1px solid var(--cp-line);
  border-radius: 8px; padding: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px; line-height: 1.6; resize: vertical; outline: none;
  background: var(--cp-paper); color: var(--cp-ink);
}
.cp-note-editor:focus { border-color: var(--cp-accent); background: var(--cp-card); }
.cp-note-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.cp-note-char-count { font-size: 11px; color: var(--cp-faint); }
.cp-note-save-btn {
  padding: 6px 16px; border-radius: 8px; border: none; background: var(--cp-accent);
  color: var(--cp-on-accent, #fff); font-size: 13px; font-weight: 600; cursor: pointer;
}
.cp-note-save-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.cp-note-stack { position: relative; min-height: 120px; }
.cp-ai-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.cp-ai-analyze-btn {
  padding: 8px 22px; border-radius: 999px; border: none;
  background: linear-gradient(135deg, #fb923c, #ea580c); color: #fff;
  font-size: 13px; font-weight: 650; cursor: pointer;
}
.cp-ai-analyze-btn:disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
.cp-ai-meta { font-size: 12px; color: var(--cp-muted); line-height: 1.55; flex: 1; min-width: 120px; }
.cp-ai-meta .cp-ai-meta-vip-link { color: var(--cp-warn); font-weight: 650; text-decoration: underline; }
.cp-ai-meta--wallet, .cp-ai-meta .ai-quota-meta { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.cp-ai-meta .ai-quota-link { display: inline-flex; align-items: center; gap: 4px; color: var(--cp-muted); text-decoration: none; font-size: 12px; }
.cp-ai-meta .ai-quota-link:hover { color: var(--cp-accent); }
.cp-ai-meta .ai-quota-link__value--low, .cp-ai-meta--low .ai-quota-link__value { color: var(--cp-bad); font-weight: 650; }
.cp-ai-meta .ai-quota-link__cool { color: var(--cp-warn); }
.cp-ai-result { border: 1px solid var(--cp-line); border-radius: 10px; padding: 14px 16px; background: var(--cp-paper); }
.cp-ai-placeholder { color: var(--cp-faint); font-size: 13px; text-align: center; padding: 16px 8px; }
.cp-ai-disclaimer { margin-top: auto; text-align: right; font-size: 12px; color: var(--cp-faint); padding: 12px 0 2px; }
.cp-note-mask-overlay { position: absolute; inset: 0; z-index: 5; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.cp-note-mask-blur {
  position: absolute; left: 0; right: 0; bottom: 0; top: 40%;
  background: linear-gradient(to bottom, transparent, var(--cp-card)); pointer-events: all;
}
.cp-note-mask-btn {
  position: relative; z-index: 6; pointer-events: all; padding: 10px 24px; border-radius: 999px;
  border: none; background: var(--cp-warn); color: #fff; font-size: 14px; font-weight: 700;
  cursor: pointer; display: inline-flex; align-items: center; gap: 4px;
}

.cp-dialog-overlay {
  position: fixed; inset: 0; background: rgba(14, 13, 11, 0.48); z-index: 10000;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.cp-dialog {
  background: var(--cp-card); color: var(--cp-ink); border-radius: 18px; padding: 24px 26px;
  max-width: 420px; width: 100%; box-shadow: var(--cp-shadow-lg); border: 1px solid var(--cp-line);
}
.cp-dialog-title { font-size: 17px; font-weight: 750; margin-bottom: 10px; letter-spacing: -0.02em; }
.cp-dialog-body { font-size: 14px; color: var(--cp-muted); line-height: 1.65; margin-bottom: 20px; }
.cp-dialog-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.cp-dialog-pay { width: 400px; max-width: 90vw; text-align: center; }
.cp-dialog-pay .cp-purchase-qr-wrap {
  width: 200px; height: 200px; margin: 0 auto 16px; background: var(--cp-paper);
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
}
@keyframes cp-spin { to { transform: rotate(360deg); } }
.cp-spinner { width: 40px; height: 40px; border: 3px solid var(--cp-line); border-top-color: var(--cp-accent); border-radius: 50%; animation: cp-spin 0.8s linear infinite; }

.cp-toast {
  position: fixed; left: 50%; bottom: 88px; transform: translateX(-50%) translateY(8px);
  background: var(--cp-ink); color: var(--cp-card); padding: 10px 16px; border-radius: 999px;
  font-size: 13px; font-weight: 600; z-index: 10001; opacity: 0; pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.cp-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.cp-kbd-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.cp-kbd-table th, .cp-kbd-table td { text-align: left; padding: 6px 0; border-bottom: 1px solid var(--cp-line); }
.cp-kbd-table kbd {
  display: inline-block; min-width: 22px; padding: 1px 6px; border: 1px solid var(--cp-line);
  border-radius: 6px; background: var(--cp-paper); font-weight: 700; text-align: center;
}

.cp-note-toggle {
  display: none; width: 100%; align-items: center; justify-content: space-between;
  gap: 8px; padding: 8px 12px; margin-top: 8px; border: 1px solid var(--cp-line);
  border-radius: 10px; background: var(--cp-card); color: var(--cp-ink);
  font-size: 13px; font-weight: 650; cursor: pointer;
}
.cp-note-toggle-label { display: inline-flex; align-items: center; gap: 6px; }
.cp-note-toggle::after {
  content: "展开"; font-size: 12px; font-weight: 500; color: var(--cp-muted);
}
.cp-note-wrap:not(.is-collapsed) .cp-note-toggle::after { content: "收起"; }

.cp-mobile-dock {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: color-mix(in srgb, var(--cp-card) 92%, transparent); backdrop-filter: blur(12px);
  border-top: 1px solid var(--cp-line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  gap: 6px; justify-content: space-between;
}
.cp-mobile-dock .cp-btn { flex: 1; justify-content: center; padding: 8px 6px; font-size: 13px; }
.cp-sheet-backdrop { display: none; position: fixed; inset: 0; background: rgba(14, 13, 11, 0.4); z-index: 35; }
.cp-sheet-backdrop.is-open { display: block; }
.cp-mobile-dock[hidden], .cp-sheet-backdrop[hidden] { display: none !important; }

html.page--choice_practice { --cp-chrome-top: 56px; }
html.page--choice_practice .footer,
body:has(.cp-shell) .footer,
html.page--choice_practice .omnibar-toggle,
html.page--choice_practice .omnibar,
body:has(.cp-shell) .omnibar-toggle,
body:has(.cp-shell) .omnibar { display: none !important; }

@media (max-width: 960px) {
  html.page--choice_practice,
  html.page--choice_practice body {
    height: 100%;
    max-height: 100svh;
    overflow: hidden;
    overscroll-behavior: none;
  }
  html.page--choice_practice .main {
    padding: 0 !important;
    margin: 0 !important;
  }
  html.page--choice_practice .section,
  html.page--choice_practice .main-content,
  html.page--choice_practice .container {
    padding: 0 10px !important;
    margin-bottom: 0 !important;
  }

  .cp-shell {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 0 6px;
    min-height: calc(100svh - var(--cp-chrome-top, 56px));
    max-height: calc(100svh - var(--cp-chrome-top, 56px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .cp-shell.cp-is-practice {
    padding-bottom: calc(58px + env(safe-area-inset-bottom));
  }
  .cp-home, .cp-practice {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .cp-home { overflow: auto; -webkit-overflow-scrolling: touch; }

  .cp-top {
    position: static;
    flex-shrink: 0;
    margin-bottom: 8px;
    padding: 4px 0 6px;
    gap: 8px;
  }
  .cp-cover { display: none; }
  .cp-page-sub { display: none; }
  .cp-page-title {
    font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .cp-total-badge { padding: 3px 8px; font-size: 11px; }
  .cp-back-ps { width: 32px; height: 32px; border-radius: 8px; }

  .cp-hero {
    grid-template-columns: auto 1fr;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 10px;
    border-radius: 14px;
    text-align: left;
    justify-items: stretch;
  }
  .cp-hero > .cp-ring svg { width: 64px; height: 64px; }
  .cp-hero .cp-ring-pct { font-size: 14px; }
  .cp-hero .cp-ring-hint { font-size: 9px; }
  .cp-hero-stats { width: auto; gap: 6px; }
  .cp-hero-stat { padding: 6px 4px; border-radius: 10px; }
  .cp-hero-stat-val { font-size: 18px; }
  .cp-hero-stat-lbl { font-size: 10px; margin-top: 1px; }

  .cp-home-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding-bottom: 4px;
  }
  .cp-cat-card {
    min-height: 0;
    padding: 8px 10px;
    gap: 6px;
    border-radius: 12px;
  }
  .cp-cat-card:hover { transform: none; }
  .cp-cat-icon { display: none; }
  .cp-cat-acc { display: none; }
  .cp-cat-name { font-size: 13px; margin-bottom: 1px; }
  .cp-cat-count { font-size: 11px; }
  .cp-cat-card > .cp-ring svg { width: 36px; height: 36px; }
  .cp-cat-tooltip { display: none; }
  .cp-empty-home { padding: 24px 12px; }

  .cp-kbd-hint { display: none !important; }
  .cp-cockpit-bar { flex-shrink: 0; gap: 8px; margin-bottom: 8px; }
  .cp-cockpit-tag { font-size: 13px; }
  .cp-chapter-track { min-width: 80px; height: 6px; }
  .cp-chapter-meta { font-size: 11px; }

  .cp-practice-layout {
    flex: 1; min-height: 0; flex-direction: column; gap: 0; overflow: hidden;
  }
  .cp-practice-main, #cp-question-area {
    flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden;
  }
  .cp-practice-sidebar {
    display: none; position: fixed; left: 0; right: 0; bottom: 0; width: 100%;
    max-height: 70vh; overflow: auto; z-index: 40;
    padding: 12px 12px calc(64px + env(safe-area-inset-bottom));
    background: var(--cp-paper); border-radius: 18px 18px 0 0; box-shadow: var(--cp-shadow-lg);
  }
  .cp-practice-sidebar.is-open { display: block; }
  .cp-mobile-dock:not([hidden]) { display: flex; }

  #cp-question-area > .cp-question-card {
    flex: 1; min-height: 0; overflow: auto; -webkit-overflow-scrolling: touch;
    padding: 12px 12px 10px; margin-bottom: 0; border-radius: 12px;
  }
  .cp-question-card .cp-actions { display: none; }
  .cp-question-top-bar { margin-bottom: 8px; }
  .cp-question-content { font-size: 15px; line-height: 1.55; margin-bottom: 10px; }
  .cp-options { gap: 6px; margin-bottom: 0; }
  .cp-option { padding: 8px 10px; gap: 8px; border-radius: 10px; font-size: 14px; }
  .cp-result { padding: 10px 12px; margin-bottom: 8px; font-size: 14px; }
  .cp-solution { padding: 12px 14px; margin-bottom: 8px; }
  .cp-empty { padding: 28px 12px; }

  .cp-note-wrap { flex-shrink: 0; }
  .cp-note-toggle { display: flex; }
  .cp-note-wrap.is-collapsed .cp-note-card { display: none; }
  .cp-note-wrap:not(.is-collapsed) .cp-note-toggle {
    border-radius: 10px 10px 0 0; border-bottom: none; margin-top: 8px;
  }
  .cp-note-wrap:not(.is-collapsed) .cp-note-card {
    max-height: min(38vh, 280px); overflow: auto; margin-bottom: 0;
    border-radius: 0 0 10px 10px;
  }
  .cp-note-body, .cp-note-stack { min-height: 0; padding: 12px; }
  .cp-note-editor { min-height: 72px; }
  .cp-ai-inner { min-height: 96px !important; }
  .cp-note-view-empty { padding: 12px 0; }
  .cp-toast { bottom: calc(64px + env(safe-area-inset-bottom)); }
}
@media (min-width: 961px) {
  .cp-mobile-dock, .cp-sheet-backdrop, .cp-note-toggle { display: none !important; }
  .cp-note-wrap.is-collapsed .cp-note-card { display: block; }
}

/* 刷题舱比 Hydro 默认栏宽；仅当本页存在 .cp-shell */
body:has(.cp-shell) .section,
body:has(.cp-shell) .main-content,
body:has(.cp-shell) .container {
  max-width: none;
  width: 100%;
}
