/* ============================================================
   每日语文素养 · 春秋战国故事系列 —— 共用样式
   与 4 页 A4 打印稿同源：米黄纸 #FDF9EF / 朱红 #A23B2E
   ============================================================ */
:root {
  --paper: #FDF9EF;
  --bg: #EDE6D6;
  --ink: #3E2A1A;
  --muted: #8A6A45;
  --red: #A23B2E;
  --red-soft: #F5EDDC;
  --blue: #2E6B8A;
  --line: #D9C7A7;
  --tan: #A98A5F;
  --shadow: 0 2px 14px rgba(62, 42, 26, .10);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Heiti SC", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* ===== 顶栏 ===== */
.topbar {
  background: var(--paper);
  border-bottom: 2px solid var(--red);
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 1px 8px rgba(62,42,26,.06);
}
.topbar .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 58px; flex-wrap: wrap;
}
.brand { display: flex; align-items: baseline; gap: 10px; font-weight: bold; color: var(--red); letter-spacing: 1px; font-size: 16px; }
.brand .small { font-weight: normal; font-size: 12px; color: var(--muted); letter-spacing: 0; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a {
  padding: 6px 13px; border-radius: 6px; font-size: 14px;
  color: var(--muted); transition: .15s;
}
.nav a:hover { background: var(--red-soft); color: var(--red); text-decoration: none; }
.nav a.on { background: var(--red); color: #fff; }
.nav a.on:hover { color: #fff; }

/* ===== Hero ===== */
.hero {
  background:
    radial-gradient(circle at 88% 18%, rgba(162,59,46,.07), transparent 42%),
    var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 46px 0 38px;
}
.hero .kicker { color: var(--red); font-size: 13px; letter-spacing: 3px; margin-bottom: 10px; }
.hero h1 { font-size: 34px; letter-spacing: 3px; line-height: 1.35; }
.hero h1 .thin { font-size: 18px; color: var(--muted); font-weight: normal; letter-spacing: 1px; display: block; margin-top: 6px; }
.hero p.lead { color: #5A4632; margin-top: 16px; max-width: 800px; font-size: 15px; }
.hero .hint { margin-top: 14px; font-size: 13px; color: var(--muted); }

.stats { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.stat {
  background: var(--red-soft); border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 18px; min-width: 116px;
}
.stat b { display: block; font-size: 24px; color: var(--red); line-height: 1.2; }
.stat span { font-size: 12px; color: var(--muted); }

/* ===== 区块 ===== */
.section { padding: 34px 0; }
.section h2 {
  font-size: 21px; color: var(--red); letter-spacing: 1px; margin-bottom: 6px;
  padding-left: 12px; border-left: 4px solid var(--red);
}
.section .sub { color: var(--muted); font-size: 13px; margin-bottom: 20px; padding-left: 16px; }

/* ===== 筛选条 ===== */
.toolbar {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; margin-bottom: 20px; box-shadow: var(--shadow);
}
.toolbar input[type=search], .toolbar select {
  font-family: inherit; font-size: 14px; color: var(--ink);
  background: #FFFDF7; border: 1px solid var(--line); border-radius: 6px;
  padding: 7px 11px; outline: none;
}
.toolbar input[type=search] { flex: 1 1 230px; min-width: 180px; }
.toolbar input:focus, .toolbar select:focus { border-color: var(--red); }
.seg { display: flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg button {
  font-family: inherit; font-size: 13px; cursor: pointer;
  border: 0; background: #FFFDF7; color: var(--muted); padding: 7px 13px;
}
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--red); color: #fff; }
.count { font-size: 13px; color: var(--muted); margin-left: auto; }

/* ===== 讲次卡片 ===== */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
  padding: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column;
  position: relative; overflow: hidden; transition: .18s;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(62,42,26,.14); }
.card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--arc-color, var(--red)); }
.card.planned { background: #F8F4E9; opacity: .86; }
.card-head { display: flex; align-items: flex-start; gap: 12px; }
.no-badge {
  flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%;
  background: var(--red); color: #fff; font-weight: bold; font-size: 17px;
  display: flex; align-items: center; justify-content: center;
}
.card.planned .no-badge { background: #CDBB99; }
.card h3 { font-size: 19px; letter-spacing: 1px; line-height: 1.35; }
.card h3 .py { display: block; font-size: 11px; font-weight: normal; color: var(--muted); letter-spacing: .5px; }
.card .subtitle { font-size: 13px; color: var(--muted); margin-top: 2px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 10px; }
.tag {
  font-size: 11px; padding: 2px 8px; border-radius: 4px;
  background: var(--red-soft); color: #6B4A2A; border: 1px solid var(--line);
}
.tag.arc { color: #fff; border: 0; background: var(--arc-color, var(--red)); }
.tag.state { background: #EAF0F4; color: var(--blue); }
.digest { font-size: 13.5px; color: #5A4632; flex: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin: 12px 0; }
.chip {
  font-size: 11.5px; padding: 2px 8px; border-radius: 10px;
  background: #FFFDF7; border: 1px solid var(--line); color: #6B4A2A;
}
.quote {
  font-size: 13px; color: var(--red); background: var(--red-soft);
  border-left: 3px solid var(--red); padding: 7px 10px; border-radius: 0 5px 5px 0; margin-bottom: 14px;
}
.card-actions { display: flex; gap: 8px; margin-top: auto; }
.btn {
  font-size: 13px; padding: 7px 14px; border-radius: 6px; border: 1px solid var(--red);
  background: var(--red); color: #fff; cursor: pointer; display: inline-block; text-align: center;
}
.btn:hover { text-decoration: none; filter: brightness(1.1); }
.btn.ghost { background: transparent; color: var(--red); }
.btn.ghost:hover { background: var(--red-soft); }
.btn.muted { background: #CDBB99; border-color: #CDBB99; color: #fff; }
.btn.muted:hover { filter: none; }
.empty { grid-column: 1/-1; text-align: center; padding: 40px; color: var(--muted); }

/* ===== 矩阵 ===== */
.matrix-scroll { overflow-x: auto; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
table.matrix { border-collapse: collapse; width: 100%; min-width: 880px; font-size: 13px; }
table.matrix th, table.matrix td { border: 1px solid var(--line); padding: 9px 10px; vertical-align: top; }
table.matrix thead th { background: var(--red); color: #fff; font-weight: normal; font-size: 13px; text-align: center; }
table.matrix thead th:first-child { width: 62px; background: #6B4A2A; }
table.matrix tbody th {
  background: var(--red-soft); color: #6B4A2A; font-weight: bold;
  text-align: center; font-size: 15px; white-space: nowrap;
}
table.matrix td.era-0 { background: #FDF3EC; }
table.matrix td.era-1 { background: #FDF6EA; }
table.matrix td.era-2 { background: #F0F5F8; }
table.matrix td.era-3 { background: #EAF1F6; }
.cell-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.pchip {
  display: inline-block; font-size: 11.5px; padding: 2px 8px; border-radius: 5px;
  border: 1px solid var(--line); background: #FFFDF7; color: #5A4632; white-space: nowrap;
}
a.pchip:hover { text-decoration: none; }
.pchip.done { background: var(--red); border-color: var(--red); color: #fff; font-weight: bold; }
.pchip.plan { border-color: var(--blue); color: var(--blue); }
.pchip.side { border-style: dashed; color: var(--muted); }
.pchip .from { font-size: 10px; opacity: .75; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin: 14px 0 4px; font-size: 12.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.dot { width: 11px; height: 11px; border-radius: 3px; display: inline-block; border: 1px solid var(--line); }
.dot.done { background: var(--red); border-color: var(--red); }
.dot.plan { border-color: var(--blue); }
.dot.side { border-style: dashed; }
.insights { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; margin-top: 22px; }
.insight { background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--red); border-radius: 8px; padding: 14px 16px; }
.insight b { color: var(--red); display: block; margin-bottom: 4px; }
.insight p { font-size: 13px; color: #5A4632; }

/* ===== 记忆主线 ===== */
.lines { display: grid; gap: 16px; }
.line-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
  padding: 18px; box-shadow: var(--shadow); border-left: 5px solid var(--line-color, var(--red));
}
.line-card h3 { font-size: 17px; color: var(--line-color, var(--red)); }
.line-card .tagline { font-size: 13px; color: var(--muted); margin: 2px 0 14px; }
.chain { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.node {
  font-size: 13px; padding: 5px 12px; border-radius: 16px;
  background: #FFFDF7; border: 1px solid var(--line); color: #5A4632;
}
a.node:hover { text-decoration: none; background: var(--red-soft); }
.node.done { background: var(--line-color, var(--red)); border-color: var(--line-color, var(--red)); color: #fff; font-weight: bold; }
.node.event { background: var(--red-soft); border-style: dashed; color: var(--muted); }
.arrow { color: var(--tan); font-size: 14px; }

/* ===== 排期 ===== */
.next-card {
  background: var(--red); color: #fff; border-radius: 10px; padding: 18px 22px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-bottom: 24px;
}
.next-card .lbl { font-size: 12px; letter-spacing: 2px; opacity: .85; }
.next-card .who { font-size: 24px; font-weight: bold; letter-spacing: 2px; }
.next-card .when { font-size: 14px; opacity: .9; }
.next-card .spacer { flex: 1; }
.next-card a { color: var(--red); background: #fff; padding: 8px 16px; border-radius: 6px; font-size: 13px; }
.month { margin-bottom: 22px; }
.month > h3 {
  font-size: 15px; color: var(--red); border-bottom: 1px solid var(--line);
  padding-bottom: 6px; margin-bottom: 8px; letter-spacing: 1px;
}
table.sched { width: 100%; border-collapse: collapse; font-size: 13.5px; background: var(--paper); border: 1px solid var(--line); }
table.sched th { background: var(--red-soft); color: var(--muted); font-weight: normal; text-align: left; padding: 7px 12px; font-size: 12px; }
table.sched td { border-top: 1px solid var(--line); padding: 8px 12px; }
table.sched tr.done { background: #FFF6EE; }
table.sched tr.next { background: #FDF3EC; }
table.sched tr:target { outline: 2px solid var(--red); }
table.sched .num { color: var(--muted); width: 46px; }
table.sched .who { font-weight: bold; }
table.sched .note { color: var(--muted); font-size: 12.5px; }
.pill { font-size: 11px; padding: 1px 8px; border-radius: 10px; background: var(--red); color: #fff; }
.pill.wait { background: #E2D8C2; color: #6B4A2A; }

/* ===== 指南 ===== */
.guide-block { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 20px 22px; margin-bottom: 18px; box-shadow: var(--shadow); }
.guide-block h3 { font-size: 17px; color: var(--red); margin-bottom: 8px; }
.guide-block p, .guide-block li { font-size: 14px; color: #5A4632; }
.guide-block ul, .guide-block ol { margin: 8px 0 8px 22px; }
.guide-block li { margin-bottom: 5px; }
pre {
  background: #3E2A1A; color: #F5EDDC; border-radius: 8px; padding: 14px 16px;
  overflow-x: auto; font-size: 12.5px; line-height: 1.65; margin: 10px 0;
  font-family: Consolas, "Courier New", monospace;
}
code.inline { background: var(--red-soft); color: var(--red); padding: 1px 6px; border-radius: 4px; font-size: 13px; }
.note-box { background: var(--red-soft); border-left: 4px solid var(--red); padding: 12px 16px; border-radius: 0 6px 6px 0; font-size: 13.5px; color: #5A4632; }

/* ===== 页脚 ===== */
.footer {
  border-top: 1px solid var(--line); background: var(--paper);
  margin-top: 30px; padding: 22px 0 30px; font-size: 12.5px; color: var(--muted);
}
.footer .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.footer a { color: var(--red); }

@media (max-width: 720px) {
  .hero { padding: 30px 0 26px; }
  .hero h1 { font-size: 26px; }
  .topbar .wrap { padding: 10px 16px; }
  .nav a { padding: 5px 9px; font-size: 13px; }
  .cards { grid-template-columns: 1fr; }
  .count { margin-left: 0; }
  table.sched .note { display: none; }
}
