/* ============================================================
   高考真题库 · 专业版样式
   ============================================================ */
:root {
  --bg: #f4f6f9;
  --bg-card: #ffffff;
  --bg-soft: #eef1f6;
  --navy: #0f2d52;
  --navy-2: #1a4a85;
  --text: #1f2937;
  --text-dim: #6b7280;
  --line: #e5e8ee;
  --primary: #2563eb;
  --primary-soft: #e8f0fe;
  --primary-d: #1d4ed8;
  --ok: #16a34a;
  --ok-soft: #e7f6ec;
  --warn: #b45309;
  --warn-soft: #fdf2e2;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 2px 8px rgba(16,24,40,.05);
  --shadow-lg: 0 12px 32px rgba(16,24,40,.12);
}
html[data-theme="dark"] {
  --bg: #0e131b;
  --bg-card: #161c26;
  --bg-soft: #1e2632;
  --navy: #0a1c33;
  --navy-2: #143b6b;
  --text: #e6ebf2;
  --text-dim: #98a3b3;
  --line: #283341;
  --primary: #60a5fa;
  --primary-soft: #1b2c47;
  --primary-d: #3b82f6;
  --ok: #4ade80;
  --ok-soft: #182e22;
  --warn: #fbbf24;
  --warn-soft: #2e2516;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 2px 10px rgba(0,0,0,.35);
  --shadow-lg: 0 14px 36px rgba(0,0,0,.55);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font: 15px/1.65 -apple-system, BlinkMacSystemFont, "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 22px; }

/* ---------- 顶栏 ---------- */
.topbar {
  background: linear-gradient(120deg, var(--navy), var(--navy-2));
  color: #fff; position: sticky; top: 0; z-index: 50;
  box-shadow: 0 2px 14px rgba(8,20,40,.22);
}
.topbar-in {
  display: flex; align-items: center; gap: 18px;
  min-height: 60px; height: auto; padding: 8px 0; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; text-decoration: none; color: #fff; }
.logo {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, #ff5a4d, #ff8a3d);
  display: grid; place-items: center; font-size: 20px; font-weight: 700;
  font-family: "Songti SC", "STSong", serif;
  box-shadow: 0 4px 12px rgba(255,90,77,.4);
}
.brand-txt h1 { font-size: 18px; font-weight: 700; letter-spacing: .5px; }
.brand-txt span { font-size: 11.5px; color: #aec4e4; letter-spacing: .3px; }
.tabs { display: flex; gap: 6px; margin-left: auto; }
.tab {
  background: rgba(255,255,255,.08); border: 0; color: #d8e2f1; cursor: pointer;
  padding: 9px 18px; border-radius: 9px; font-size: 14.5px; font-family: inherit;
  transition: .16s; font-weight: 500;
}
.tab:hover { background: rgba(255,255,255,.16); color: #fff; }
.tab.active { background: #fff; color: var(--navy); font-weight: 600; box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.theme-btn {
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25);
  color: #fff; width: 36px; height: 36px; border-radius: 9px; cursor: pointer;
  font-size: 16px; transition: .16s; flex-shrink: 0;
}
.theme-btn:hover { background: rgba(255,255,255,.22); }

/* ---------- Hero + 统计 ---------- */
.hero { background: var(--bg-card); border-bottom: 1px solid var(--line); }
.hero-in {
  display: flex; align-items: center; justify-content: space-between;
  gap: 32px; padding: 34px 22px; flex-wrap: wrap;
}
.hero-txt { max-width: 560px; }
.hero-txt h2 { font-size: 27px; font-weight: 700; color: var(--navy); letter-spacing: .5px; line-height: 1.3; }
html[data-theme="dark"] .hero-txt h2 { color: #eaf1fb; }
.hero-txt p { margin-top: 12px; font-size: 14.5px; color: var(--text-dim); line-height: 1.8; }
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; flex: 1; min-width: 320px; }
.stat {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 10px; text-align: center; transition: .18s;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat b {
  display: block; font-size: 24px; font-weight: 750; color: var(--primary-d);
  font-variant-numeric: tabular-nums; letter-spacing: -.3px; line-height: 1.2;
}
.stat span { font-size: 12.5px; color: var(--text-dim); margin-top: 4px; display: block; }

/* ---------- 布局 ---------- */
.panel { display: none; padding: 26px 0 48px; }
.panel.active { display: block; }
.layout { display: grid; grid-template-columns: 248px 1fr; gap: 22px; align-items: start; }
.side {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; position: sticky; top: 76px; box-shadow: var(--shadow);
}
.filter-toggle { display: none; }
.side-block { margin-bottom: 20px; }
.side-block:last-of-type { margin-bottom: 16px; }
.side-title {
  font-size: 12px; font-weight: 700; color: var(--text-dim); letter-spacing: .8px;
  margin-bottom: 10px; text-transform: uppercase;
}
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chips.col { flex-direction: column; }
.chips.scroll { max-height: 200px; overflow-y: auto; padding-right: 4px; }
.chips.scroll::-webkit-scrollbar { width: 6px; }
.chips.scroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }

.chip {
  border: 1px solid var(--line); background: var(--bg-card); color: var(--text);
  padding: 5px 12px; border-radius: 20px; font-size: 12.5px; cursor: pointer;
  transition: .14s; font-family: inherit; white-space: nowrap; line-height: 1.4;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.chips.col .chip { border-radius: var(--radius-sm); text-align: left; padding: 8px 12px; font-size: 13.5px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.chips.col .chip em { font-style: normal; opacity: .7; font-size: 12px; background: var(--bg-soft); padding: 1px 7px; border-radius: 10px; }
.chip.on em { background: rgba(255,255,255,.22); opacity: .9; }

.input, .select {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); font-size: 14px; font-family: inherit;
  background: var(--bg-card); color: var(--text); outline: none; transition: .14s;
}
.input:focus, .select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.select { width: auto; min-width: 112px; cursor: pointer; }

.sw { display: flex; align-items: center; gap: 8px; font-size: 13.5px; padding: 5px 0; cursor: pointer; }
.sw input { accent-color: var(--primary); width: 16px; height: 16px; cursor: pointer; }

.reset {
  width: 100%; padding: 9px; border: 1px solid var(--line); background: var(--bg-soft);
  color: var(--text-dim); border-radius: var(--radius-sm); cursor: pointer; font-size: 13px;
  font-family: inherit; transition: .14s;
}
.reset:hover { background: #fde8e6; color: #dc2626; border-color: #f3c4bf; }

.content { min-width: 0; }
.bar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.bar-info { font-size: 14px; color: var(--text-dim); }
.bar-info b { color: var(--primary-d); font-size: 16px; }
.bar-right { margin-left: auto; }
.src-tip { font-size: 12.5px; color: var(--text-dim); }

/* ---------- 试卷列表 ---------- */
.list { display: flex; flex-direction: column; gap: 10px; }
.pcard {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; display: flex; align-items: center; gap: 14px;
  transition: .15s; box-shadow: var(--shadow);
}
.pcard:hover { border-color: var(--primary); box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.pyear {
  font-size: 16px; font-weight: 750; color: var(--primary-d); font-variant-numeric: tabular-nums;
  min-width: 48px; letter-spacing: -.3px; flex-shrink: 0;
}
.pmain { flex: 1; min-width: 0; }
.pname { font-size: 14.5px; line-height: 1.5; margin-bottom: 7px; word-break: break-word; font-weight: 500; }
.ptags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag {
  font-size: 11.5px; padding: 2px 9px; border-radius: 5px; background: var(--bg-soft);
  color: var(--text-dim); white-space: nowrap;
}
.tag.subj { background: var(--primary-soft); color: var(--primary-d); font-weight: 600; }
.tag.kind-答案 { background: var(--ok-soft); color: var(--ok); }
.tag.kind-解析 { background: var(--warn-soft); color: var(--warn); }
.psize { font-size: 12.5px; color: var(--text-dim); font-variant-numeric: tabular-nums; min-width: 56px; text-align: right; flex-shrink: 0; }
.dl {
  border: 1px solid var(--primary); background: var(--primary-soft); color: var(--primary-d);
  padding: 7px 15px; border-radius: var(--radius-sm); font-size: 13px; cursor: pointer;
  text-decoration: none; white-space: nowrap; font-family: inherit; transition: .14s; font-weight: 600;
  flex-shrink: 0;
}
.dl:hover { background: var(--primary); color: #fff; }
.dl.disabled { border-color: var(--line); background: var(--bg-soft); color: var(--text-dim); cursor: not-allowed; }

/* ---------- 题目卡片 ---------- */
.qlist { display: flex; flex-direction: column; gap: 14px; }
.qcard {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow); scroll-margin-top: 80px;
}
.qhead {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  margin-bottom: 11px; padding-bottom: 10px; border-bottom: 1px dashed var(--line);
}
.qstem { font-size: 15px; line-height: 1.85; white-space: pre-wrap; word-break: break-word; }
.qstem .katex { font-size: 1.04em; }
.qpassage {
  font-size: 13.5px; line-height: 1.8; color: var(--text-dim); background: var(--bg-soft);
  padding: 12px 14px; border-radius: 9px; margin-bottom: 12px; white-space: pre-wrap;
  max-height: 280px; overflow-y: auto; border: 1px solid var(--line);
}
.qpassage::-webkit-scrollbar { width: 6px; }
.qpassage::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
.qpassage::before { content: "原文材料"; display: block; font-size: 11px; color: var(--primary-d); margin-bottom: 6px; letter-spacing: 1px; font-weight: 600; }

.opts { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.opt {
  display: flex; gap: 10px; padding: 9px 13px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); cursor: pointer; font-size: 14px; line-height: 1.65;
  transition: .13s; background: var(--bg-card); text-align: left;
  font-family: inherit; color: var(--text); width: 100%;
}
.opt:hover { border-color: var(--primary); background: var(--primary-soft); }
.opt .k { font-weight: 700; color: var(--primary-d); flex-shrink: 0; }
.opt.pick { border-color: var(--primary); background: var(--primary-soft); }
.opt.right { border-color: var(--ok); background: var(--ok-soft); }
.opt.right .k { color: var(--ok); }
.opt.wrong { border-color: #dc2626; background: #fdeaea; }
.opt.wrong .k { color: #dc2626; }
.opt.locked { cursor: default; }

.ansbox {
  margin-top: 13px; padding: 13px 15px; background: var(--bg-soft);
  border-radius: 9px; font-size: 14px; line-height: 1.8; border-left: 3px solid var(--ok);
}
.ansbox.hidden-body > div { display: none; }
.ansbox .lbl { font-weight: 700; color: var(--ok); margin-bottom: 5px; }
.ansbox .lbl.b { color: var(--primary-d); margin-top: 11px; }
.ansbox pre { white-space: pre-wrap; font-family: inherit; font-size: 14px; line-height: 1.85; }
.qfoot { display: flex; align-items: center; gap: 10px; margin-top: 13px; }
.btn {
  border: 1px solid var(--line); background: var(--bg-card); color: var(--text);
  padding: 6px 15px; border-radius: var(--radius-sm); font-size: 13px; cursor: pointer;
  font-family: inherit; transition: .14s;
}
.btn:hover { border-color: var(--primary); color: var(--primary-d); }
.btn.pri { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); font-weight: 600; }
.btn.pri:hover { background: var(--ok); color: #fff; }
.verdict { font-size: 13.5px; font-weight: 650; }
.verdict.ok { color: var(--ok); }
.verdict.no { color: #dc2626; }

/* ---------- 分页 ---------- */
.pager { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 24px; flex-wrap: wrap; }
.pg {
  min-width: 36px; height: 36px; border: 1px solid var(--line); background: var(--bg-card);
  color: var(--text); border-radius: var(--radius-sm); cursor: pointer; font-size: 13.5px;
  font-family: inherit; transition: .13s; padding: 0 10px;
}
.pg:hover:not(:disabled) { border-color: var(--primary); color: var(--primary-d); }
.pg.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.pg:disabled { opacity: .4; cursor: not-allowed; }
.pg.gap { border: 0; background: none; cursor: default; }

/* ---------- 其他 ---------- */
.empty { text-align: center; padding: 64px 20px; color: var(--text-dim); }
.empty b { display: block; font-size: 16px; margin-bottom: 7px; color: var(--text); }
.loading { text-align: center; padding: 56px; color: var(--text-dim); }
.foot { border-top: 1px solid var(--line); padding: 26px 0; color: var(--text-dim); font-size: 13px; background: var(--bg-card); margin-top: 20px; }
.foot-in { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.foot-l { display: flex; flex-direction: column; gap: 4px; max-width: 720px; }
.foot-l strong { color: var(--text); font-size: 14px; }
.foot-r { max-width: 420px; line-height: 1.7; }

.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: var(--text); color: var(--bg-card); padding: 10px 20px; border-radius: 10px;
  font-size: 13.5px; opacity: 0; transition: .25s; pointer-events: none; z-index: 99;
  box-shadow: var(--shadow-lg);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
  .stats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .side {
    position: static; display: none;
    box-shadow: var(--shadow); margin-bottom: 4px;
  }
  .side.open { display: block; }
  .filter-toggle {
    display: block; width: 100%; padding: 11px; margin-bottom: 14px;
    border: 1px solid var(--primary); background: var(--primary-soft); color: var(--primary-d);
    border-radius: var(--radius-sm); cursor: pointer; font-size: 14px; font-weight: 600;
    font-family: inherit;
  }
  .hero-in { padding: 26px 22px; }
  .hero-txt h2 { font-size: 23px; }
  .stats { grid-template-columns: repeat(2, 1fr); min-width: 0; }
  .topbar-in { gap: 12px; }
  .tab { padding: 8px 13px; font-size: 14px; }
  .brand-txt span { display: none; }
  .pcard { flex-wrap: wrap; }
  .psize { min-width: auto; }
  .dl { margin-left: auto; }
}
@media (max-width: 480px) {
  .wrap { padding: 0 15px; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat { padding: 12px 6px; }
  .stat b { font-size: 20px; }
  .hero-txt h2 { font-size: 20px; }
  .qcard { padding: 14px; }
}
