/* 《大墙内外》分析文档 - 共用样式 */
:root {
  --ink: #2b2b2b;
  --accent: #8c1f28;
  --accent-light: #b3454e;
  --paper: #faf7f2;
  --card: #ffffff;
  --line: #e2d9cc;
  --muted: #7a7267;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Noto Serif SC", "Songti SC", "SimSun", serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.85;
}
header.site-header {
  background: linear-gradient(135deg, #3d1114 0%, #8c1f28 60%, #a93a44 100%);
  color: #fff;
  padding: 48px 20px 36px;
  text-align: center;
}
header.site-header h1 { font-size: 2.2em; letter-spacing: .15em; margin-bottom: 8px; }
header.site-header p.subtitle { opacity: .85; font-size: 1.02em; letter-spacing: .08em; }
nav.top-nav {
  background: #2b2b2b;
  display: flex; justify-content: center; flex-wrap: wrap; gap: 4px;
  position: sticky; top: 0; z-index: 50;
}
nav.top-nav a {
  color: #eee; text-decoration: none; padding: 12px 22px; font-size: .98em; letter-spacing: .05em;
}
nav.top-nav a:hover, nav.top-nav a.active { background: var(--accent); color: #fff; }
main { max-width: 980px; margin: 0 auto; padding: 36px 18px 80px; }
h2.section-title {
  font-size: 1.5em; color: var(--accent);
  border-left: 6px solid var(--accent);
  padding-left: 14px; margin: 48px 0 18px; letter-spacing: .06em;
}
h2.section-title:first-of-type { margin-top: 10px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 22px 26px; margin-bottom: 18px;
  box-shadow: 0 1px 4px rgba(60,40,20,.05);
}
.card h3 { color: var(--accent); font-size: 1.18em; margin-bottom: 6px; letter-spacing: .04em; }
.card h3 .tag {
  display: inline-block; font-size: .68em; font-weight: normal; vertical-align: 3px;
  background: #f3e8e9; color: var(--accent); border: 1px solid #e0c3c6;
  border-radius: 999px; padding: 1px 10px; margin-left: 10px; letter-spacing: .05em;
}
.card p { margin: 8px 0; text-align: justify; }
.card p b { color: #5a4632; }
.meta { color: var(--muted); font-size: .92em; margin-bottom: 6px; }
.timeline { border-left: 3px solid var(--line); margin-left: 8px; padding-left: 26px; }
.timeline .t-item { position: relative; margin-bottom: 28px; }
.timeline .t-item::before {
  content: ""; position: absolute; left: -34px; top: 10px;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--accent); border: 3px solid var(--paper);
}
.timeline h4 { color: var(--accent); font-size: 1.08em; margin-bottom: 6px; }
table.minor {
  width: 100%; border-collapse: collapse; background: var(--card);
  border: 1px solid var(--line); font-size: .95em;
}
table.minor th, table.minor td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; vertical-align: top; }
table.minor th { background: #f5eee3; color: #5a4632; white-space: nowrap; }
/* 剧本页 */
.sc {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 18px 24px; margin-bottom: 14px;
  box-shadow: 0 1px 4px rgba(60,40,20,.05);
}
.sc h4 { color: var(--accent); font-size: 1.02em; letter-spacing: .05em; margin-bottom: 10px; }
.sc h4 .sc-no { display: inline-block; min-width: 2.2em; color: #b9a99c; font-weight: normal; }
.act { color: #5a5248; margin: 7px 0; text-align: justify; }
.act::before { content: "△ "; color: #b9a99c; }
.dlg { margin: 7px 0 7px 1.2em; text-align: justify; }
.dlg b { color: var(--accent); }
.dlg .os { color: var(--muted); font-weight: normal; font-size: .9em; }
.ep-meta { color: var(--muted); font-size: .93em; line-height: 2; }
.act-break {
  text-align: center; color: var(--muted); letter-spacing: .4em;
  margin: 34px 0 22px; font-size: .95em;
}
.act-break::before, .act-break::after { content: "——"; color: var(--line); }
.note {
  background: #fdf6e9; border: 1px solid #ecd9b0; border-radius: 8px;
  padding: 14px 18px; color: #6b5732; font-size: .95em; margin: 18px 0;
}
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.index-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 26px; text-decoration: none; color: var(--ink); display: block;
  transition: transform .15s ease, box-shadow .15s ease;
}
.index-card:hover { transform: translateY(-3px); box-shadow: 0 6px 18px rgba(60,40,20,.12); }
.index-card h3 { color: var(--accent); margin-bottom: 8px; }
footer { text-align: center; color: var(--muted); font-size: .88em; padding: 30px 10px 40px; }
.toc { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 18px 24px; margin-bottom: 26px; }
.toc a { color: var(--accent); text-decoration: none; margin-right: 18px; white-space: nowrap; line-height: 2.1; }
.toc a:hover { text-decoration: underline; }
/* 导航抽屉（js/nav.js 生成）：原顶部导航与目录卡片归入抽屉后隐藏 */
nav.top-nav.nav-merged { display: none; }
.toc.toc-hidden { display: none; }
#nav-toggle {
  position: fixed; top: 14px; right: 14px; z-index: 200;
  width: 44px; height: 44px; border-radius: 12px;
  border: none; cursor: pointer;
  background: rgba(43,43,43,.82); color: #fff;
  font-size: 19px; line-height: 44px; text-align: center;
  box-shadow: 0 3px 12px rgba(0,0,0,.28);
  backdrop-filter: blur(3px);
  transition: opacity .2s;
}
#nav-toggle.hide { opacity: 0; pointer-events: none; }
#nav-mask {
  position: fixed; inset: 0; z-index: 210;
  background: rgba(0,0,0,.45);
  opacity: 0; visibility: hidden;
  transition: opacity .25s, visibility .25s;
}
#nav-mask.show { opacity: 1; visibility: visible; }
#nav-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 220;
  width: min(78vw, 320px);
  background: var(--paper);
  box-shadow: -6px 0 24px rgba(0,0,0,.25);
  transform: translateX(100%);
  transition: transform .28s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 30px;
}
#nav-drawer.open { transform: translateX(0); }
#nav-drawer .nd-head {
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(135deg, #3d1114, #8c1f28);
  color: #fff; padding: 16px 18px;
  font-size: 1.05em; letter-spacing: .3em;
}
#nav-drawer .nd-head button {
  border: none; background: none; color: #fff;
  font-size: 17px; cursor: pointer; padding: 4px 6px; line-height: 1;
}
#nav-drawer .nd-group {
  color: var(--muted); font-size: .8em; letter-spacing: .15em;
  padding: 18px 20px 6px;
}
#nav-drawer .nd-links a {
  display: block;
  color: var(--ink); text-decoration: none;
  font-size: .96em; line-height: 1.5;
  padding: 10px 20px;
  border-left: 3px solid transparent;
}
#nav-drawer .nd-links a:active { background: #f3e8e9; }
#nav-drawer .nd-links a.current {
  color: var(--accent); font-weight: 600;
  border-left-color: var(--accent); background: #f3e8e9;
}
#nav-drawer .nd-sections a { color: #5a5248; font-size: .92em; }
#back-to-top {
  position: fixed; right: 18px; bottom: 24px; z-index: 100;
  width: 46px; height: 46px; border-radius: 50%;
  border: none; cursor: pointer;
  background: var(--accent); color: #fff;
  font-size: 20px; line-height: 46px; text-align: center;
  box-shadow: 0 4px 14px rgba(60, 20, 24, .35);
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: opacity .25s ease, transform .25s ease, visibility .25s;
}
#back-to-top.show { opacity: .92; visibility: visible; transform: translateY(0); }
#back-to-top:hover { opacity: 1; }
@media (max-width: 600px) {
  #back-to-top { right: 14px; bottom: 20px; width: 44px; height: 44px; line-height: 44px; }
  header.site-header h1 { font-size: 1.6em; }
  .card { padding: 16px 16px; }
  main { padding: 24px 14px 60px; }
  nav.top-nav a { padding: 12px 14px; }
  .toc { padding: 14px 16px; }
  .toc a { white-space: normal; margin-right: 14px; }
  /* 宽表格：改为横向滚动，避免第三列被挤成竖排单字 */
  table.minor { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table.minor td:nth-child(1) { white-space: nowrap; }
  table.minor td:nth-child(2) { min-width: 10em; }
  table.minor td:nth-child(3) { min-width: 16em; }
}
