/* 深圳中考数学复习讲义 — 样式 v2 */
:root {
  --bg: #f4f1ea;
  --paper: #fffdf8;
  --ink: #1c2430;
  --muted: #5c6672;
  --line: #d9d2c5;
  --accent: #c45c26;
  --accent-soft: #f3e4d8;
  --navy: #243b55;
  --green: #2f6b4f;
  --gold: #b8860b;
  --shadow: 0 10px 30px rgba(28,36,48,.08);
  --radius: 14px;
  --font: "Source Han Serif SC", "Noto Serif SC", "Songti SC", "SimSun", Georgia, serif;
  --sans: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 10%, rgba(196,92,38,.08), transparent 28%),
    radial-gradient(circle at 88% 0%, rgba(36,59,85,.08), transparent 32%),
    var(--bg);
  line-height: 1.75;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
.wrap { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }

.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255,253,248,.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 12px 0;
}
.brand { display: flex; align-items: center; gap: 12px; font-family: var(--font); font-weight: 700; color: var(--navy); }
.brand-mark {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(145deg, var(--accent), #8b3a1a);
  color: #fff; display: grid; place-items: center; font-size: 13px;
}
.brand small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }
.nav { display: flex; flex-wrap: wrap; gap: 8px; }
.nav button {
  border: 1px solid transparent; background: transparent; color: var(--muted);
  padding: 8px 14px; border-radius: 999px; cursor: pointer; font: inherit; font-size: 14px;
}
.nav button.active, .nav button:hover {
  background: var(--accent-soft); color: var(--accent); border-color: #e7c7b2;
}

.hero { padding: 48px 0 20px; display: grid; grid-template-columns: 1.25fr .95fr; gap: 24px; }
.hero h1 { font-family: var(--font); font-size: clamp(30px, 4vw, 44px); line-height: 1.25; margin: 0 0 12px; color: var(--navy); }
.hero p.lead { font-size: 16px; color: var(--muted); margin: 0 0 18px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  background: var(--paper); border: 1px solid var(--line);
  padding: 8px 12px; border-radius: 999px; font-size: 13px; color: var(--navy);
}
.chip strong { color: var(--accent); }
.hero-card {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
}
.hero-card h3 { margin: 0 0 12px; font-family: var(--font); color: var(--navy); }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: var(--accent-soft); border-radius: 12px; padding: 14px; }
.stat .n { font-size: 22px; font-weight: 700; color: var(--accent); }
.stat .t { font-size: 12px; color: var(--muted); }

.section { padding: 26px 0 8px; }
.section-title { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.section-title h2 { margin: 0; font-family: var(--font); font-size: 28px; color: var(--navy); }
.section-title p { margin: 0; color: var(--muted); font-size: 14px; }

.chapter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.chapter-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; cursor: pointer; transition: .18s ease;
}
.chapter-card:hover { transform: translateY(-3px); border-color: #e0b89a; box-shadow: var(--shadow); }
.chapter-card .parent { font-size: 12px; letter-spacing: .06em; color: var(--accent); }
.chapter-card h3 { margin: 8px 0 6px; font-size: 18px; color: var(--navy); }
.chapter-card p { margin: 0; color: var(--muted); font-size: 13px; min-height: 42px; }
.chapter-card .meta { margin-top: 12px; display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.count-pill { background: var(--navy); color: #fff; border-radius: 999px; padding: 3px 10px; }

.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.filters select, .filters input {
  border: 1px solid var(--line); background: var(--paper);
  border-radius: 10px; padding: 10px 12px; font: inherit; color: var(--ink); min-width: 130px;
}
.table-wrap {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: auto; box-shadow: var(--shadow);
}
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 11px 13px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: #efe8dc; color: var(--navy); font-weight: 700; position: sticky; top: 0; }
tr:hover td { background: #fbf7f0; }
.tag {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 12px; margin: 0 4px 4px 0; white-space: nowrap;
}
.tag.d-yi { background: #e4f2ea; color: var(--green); }
.tag.d-zhong { background: #fff1d6; color: #9a6b00; }
.tag.d-nan { background: #fde8e4; color: #a33b2b; }
.tag.chapter { background: var(--accent-soft); color: var(--accent); }
.tag.tag-sub { background: #e7efe9; color: var(--green); font-size: 12px; }
.muted { color: var(--muted); font-size: 13px; }

.detail {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 18px; padding: 26px; box-shadow: var(--shadow);
}
.detail-header {
  display: flex; justify-content: space-between; gap: 16px; align-items: start;
  margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line);
}
.detail-header h2 { margin: 0 0 6px; font-family: var(--font); font-size: 30px; color: var(--navy); }
.knowledge-list { display: grid; gap: 12px; }
.kn { border-left: 4px solid var(--accent); background: #faf6ef; padding: 14px 16px; border-radius: 0 12px 12px 0; }
.kn h4 { margin: 0 0 6px; color: var(--navy); }
.kn p { margin: 0; color: var(--muted); }

.q-card {
  border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 18px; margin: 12px 0; background: #fff;
}
.q-card .q-head {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px dashed var(--line);
}
.q-card .q-id { font-weight: 700; color: var(--navy); }
.q-body { font-size: 15px; }
.q-body p { margin: 8px 0; }
.q-body img {
  display: block; margin: 10px auto; max-height: 360px; width: auto;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 6px;
}
.thinking {
  background: #eef3f8; border-radius: 10px; padding: 10px 12px; margin: 10px 0;
  color: var(--navy); font-size: 14px;
}
.solution {
  background: #f3f8f2; border-radius: 10px; padding: 10px 12px;
  color: var(--green); font-size: 14px;
}
.answer-box {
  margin-top: 8px; border-top: 1px dashed var(--line); padding-top: 10px; display: none;
}
.answer-box.open { display: block; }
.btn {
  border: 1px solid var(--accent); color: var(--accent); background: transparent;
  border-radius: 999px; padding: 8px 14px; cursor: pointer; font: inherit; font-size: 13px;
}
.btn:hover { background: var(--accent); color: #fff; }
.btn.solid { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.solid:hover { background: #16283c; }

/* Analysis module */
.analysis-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.metric {
  background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 16px;
}
.metric .k { font-size: 12px; color: var(--muted); }
.metric .v { font-size: 28px; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }
.metric .s { font-size: 12px; color: var(--accent); }
.bar-list { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 140px 1fr 70px; gap: 10px; align-items: center; font-size: 13px; }
.bar-track { background: #ebe4d7; height: 12px; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent), #e0894c); border-radius: 999px; }
.bar-row .val { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.trend-list { display: grid; gap: 10px; }
.trend-item {
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; color: var(--ink);
}
.key-table td:first-child { font-weight: 700; color: var(--navy); white-space: nowrap; }
.alert-box {
  background: linear-gradient(135deg, #fff4e8, #fde8d8);
  border: 1px solid #efc4a4; border-radius: 14px; padding: 18px;
}
.alert-box h3 { margin: 0 0 8px; color: var(--accent); font-family: var(--font); }

.site-footer {
  margin: 40px 0 24px; padding: 18px 0 8px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 13px; text-align: center;
}

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .header-inner { flex-direction: column; align-items: stretch; }
  .detail { padding: 16px; }
  .bar-row { grid-template-columns: 100px 1fr 56px; }
}
.hidden { display: none !important; }

.q-fig { margin: 12px auto; text-align: center; }
.q-fig img {
  max-width: min(520px, 100%);
  max-height: 380px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 8px;
  box-shadow: 0 4px 16px rgba(28,36,48,.06);
}
.q-fig figcaption {
  font-size: 12px; color: var(--muted); margin-top: 6px;
}

.toggle-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.toggle-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.q-card .answer-box {
  margin-top: 8px;
  border-top: 1px dashed var(--line);
  padding-top: 10px;
}

/* 题干内 Markdown 表格 */
.q-card table.q-table,
.detail table.q-table {
  width: 100%; margin: 10px 0; border-collapse: collapse; font-size: 14px;
  background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
}
.q-card table.q-table th,
.q-card table.q-table td,
.detail table.q-table th,
.detail table.q-table td {
  padding: 8px 10px; border: 1px solid var(--line); text-align: left; vertical-align: top;
}
.q-card table.q-table th,
.detail table.q-table th {
  background: #efe8dc; color: var(--navy); font-weight: 700; position: static;
}
.q-card table.q-table tr:hover td,
.detail table.q-table tr:hover td { background: #fbf7f0; }
.q-body p:has(table), .solution p:has(table) { margin: 0; }

/* 知识点例题 */
.ex-card {
  margin: 14px 0 18px;
  padding: 14px 16px;
  background: #fffaf5;
  border: 1px solid #e7c7b2;
  border-left: 3px solid var(--accent);
  border-radius: 10px;
}
.ex-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.ex-badge {
  background: var(--accent); color: #fff;
  font-size: 12px; font-weight: 700;
  padding: 2px 10px; border-radius: 999px;
}
.ex-id { font-weight: 700; color: var(--navy); font-size: 13px; }
.ex-link, .ex-think {
  font-size: 14px; line-height: 1.7; margin: 6px 0;
  color: var(--ink);
}
.ex-link { background: var(--accent-soft); padding: 8px 10px; border-radius: 8px; }
.ex-think { color: var(--muted); }
.ex-think strong, .ex-link strong { color: var(--navy); }
.ex-card .q-body { margin-top: 8px; }
.kn .ex-card + .ex-card { margin-top: 12px; }
