/* ==========================================================================
   愿心安 · 设计系统
   色板取自 sun-generations-iii 静态工具：Sun Life 红金 + 硬边框扁平卡片 + 彩虹顶条
   差异：正文 17px / 行高 1.85（面向中老年读者），标题用衬线取制度感与权威感
   ========================================================================== */

:root {
  --red: #c8102e;
  --red-d: #a60d26;
  --blue: #1e73be;
  --blue-d: #155a98;
  --orange: #f28c28;
  --green: #2fa36b;
  --yellow: #f5c84c;
  --purple: #7b3fc4;
  --sun: #f5c84c;
  --sun-d: #e0a820;
  --sun-l: #fff8e8;

  --ink: #1a1a1a;
  --ink-d: #111111;
  --line: #2b2b2b;
  --line-2: #c9d3e0;
  --bg: #f7fafe;
  --card: #ffffff;
  --soft: #f2f6fc;
  --soft-2: #edf1f7;
  --muted: #6b7280;
  --muted-2: #9ca3af;

  --radius: 10px;
  --radius-s: 7px;
  --maxw: 1180px;
  --maxw-read: 760px;

  --sans: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Segoe UI", Arial, sans-serif;
  --serif: "Source Han Serif SC", "Noto Serif SC", "Songti SC", "SimSun", Georgia, serif;
  --num: "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--blue-d); text-decoration: none; }
a:hover { color: var(--red); }
h1, h2, h3, h4 { margin: 0; font-weight: 800; line-height: 1.35; }
p { margin: 0 0 1.15em; }
ul, ol { margin: 0 0 1.15em; padding-left: 1.5em; }
li { margin-bottom: .5em; }
hr { border: 0; border-top: 1px solid var(--line-2); margin: 2em 0; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #c9d3e0; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #9aa4b2; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 99;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip:focus { left: 0; }

/* ---------------------------------------------------------------- rainbow */
.rb {
  height: 5px;
  background: linear-gradient(90deg,
    var(--red) 0 16.6%, var(--orange) 16.6% 33.3%, var(--yellow) 33.3% 50%,
    var(--green) 50% 66.6%, var(--blue) 66.6% 83.3%, var(--purple) 83.3% 100%);
}

/* ---------------------------------------------------------------- header */
.site-head { background: #fff; border-bottom: 1px solid var(--line); }
.site-head .bar {
  max-width: var(--maxw); margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.brand:hover { color: var(--ink); }
.logo {
  width: 46px; height: 46px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--red); border: 1.5px solid var(--line);
  color: #fff; font-family: var(--serif); font-weight: 700; font-size: 19px; line-height: 1;
}
.brand .t { font-size: 21px; letter-spacing: 2px; font-weight: 800; line-height: 1.25; }
.brand .s { font-size: 12.5px; color: var(--muted); margin-top: 2px; letter-spacing: .5px; }

.head-side { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.chip {
  display: inline-block; font-size: 13px; padding: 6px 12px; border-radius: var(--radius-s);
  background: #fff; border: 1px solid var(--line); color: var(--ink); font-weight: 600; white-space: nowrap;
}
a.chip:hover { background: #f0f6ff; }
.chip.gold { background: var(--red); border-color: var(--red); color: #fff; }
.chip.gold:hover { background: var(--red-d); border-color: var(--red-d); color: #fff; }
.chip.lib { background: var(--sun-l); border-color: var(--sun-d); font-weight: 700; }
.chip.lib:hover { background: #fff2cf; border-color: var(--red); }

/* ---------------------------------------------------------------- nav */
.nav { background: #fff; border-bottom: 1px solid var(--line); }
.nav .inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 20px;
  display: flex; align-items: stretch; gap: 0; flex-wrap: wrap;
}
.nav a {
  padding: 13px 18px; font-size: 16px; font-weight: 700; color: var(--ink);
  border-bottom: 3px solid transparent; letter-spacing: .5px;
}
.nav a:hover { background: var(--soft); }
.nav a[aria-current="page"] { border-bottom-color: var(--nc, var(--red)); color: var(--nc, var(--red)); }
.nav a .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--nc); margin-right: 7px; vertical-align: 1px; }
.nav .push { margin-left: auto; }
.nav a.sub { font-size: 14px; color: var(--muted); font-weight: 600; border-bottom-width: 3px; padding: 13px 14px; }
.nav a.sub + a.sub { border-left: 1px solid var(--line-2); }
.nav a.sub:hover { color: var(--red); background: var(--soft); }
.nav a.sub[aria-current="page"] { color: var(--red); border-bottom-color: var(--red); }
.nav a.sub.hot { color: var(--ink); font-weight: 800; background: var(--sun-l); border-bottom-color: var(--sun-d); }
.nav a.sub.hot:hover { color: var(--red); background: #fff2cf; border-bottom-color: var(--red); }

/* ---------------------------------------------------------------- layout */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 24px 20px 8px; }
.wrap.read { max-width: var(--maxw-read); }
.two { display: grid; grid-template-columns: minmax(0, 1fr) 316px; gap: 26px; align-items: start; }
.two > * { min-width: 0; }
@media (max-width: 1000px) { .two { grid-template-columns: 1fr; } }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.card > .hd {
  padding: 11px 16px; background: var(--soft); border-bottom: 1px solid var(--line);
  font-size: 15.5px; font-weight: 800; letter-spacing: .5px; display: flex; align-items: center; gap: 8px;
}
.card > .hd .bar-k { width: 4px; height: 15px; background: var(--nc, var(--red)); border-radius: 2px; }
.card > .bd { padding: 16px; }
.card > .bd > :last-child { margin-bottom: 0; }

/* ---------------------------------------------------------------- hero */
.hero { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden; }
.hero .top { padding: 34px 34px 26px; }
.hero .q {
  font-family: var(--serif); font-size: 38px; line-height: 1.3; font-weight: 700;
  letter-spacing: 1px; margin: 0 0 14px;
}
.hero .q em { font-style: normal; color: var(--red); }
.hero .lede { font-size: 17.5px; color: #333; max-width: 60ch; }
.hero .ribbon {
  display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line);
}
.hero .ribbon a {
  padding: 16px 18px; color: var(--ink); border-right: 1px solid var(--line);
  display: block; transition: background .12s;
}
.hero .ribbon a:last-child { border-right: 0; }
.hero .ribbon a:hover { background: var(--sun-l); }
.hero .ribbon a.hot { background: var(--sun-l); box-shadow: inset 0 -3px 0 var(--sun-d); }
.hero .ribbon a.hot:hover { background: #fff2cf; }
.hero .ribbon .n { font-family: var(--num); font-size: 12px; color: var(--muted); letter-spacing: 1.5px; font-weight: 700; }
.hero .ribbon .l { font-size: 17px; font-weight: 800; margin-top: 3px; }
.hero .ribbon .d { font-size: 13.5px; color: var(--muted); margin-top: 4px; line-height: 1.5; }
@media (max-width: 1000px) {
  .hero .ribbon { grid-template-columns: repeat(2, 1fr); }
  .hero .ribbon a { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .hero .ribbon a:nth-child(2n) { border-right: 0; }
  .hero .ribbon a:nth-last-child(-n+2) { border-bottom: 0; }
}
@media (max-width: 760px) {
  .hero .top { padding: 24px 18px 20px; }
  .hero .q { font-size: 27px; }
  .hero .ribbon { grid-template-columns: 1fr; }
  .hero .ribbon a { border-right: 0; border-bottom: 1px solid var(--line); }
}

/* ---------------------------------------------------------------- stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 20px; }
@media (max-width: 860px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 16px 14px; border-top: 4px solid var(--sc, var(--blue)); }
.stat .v { font-family: var(--num); font-size: 30px; font-weight: 800; line-height: 1.1; letter-spacing: -.5px; }
.stat .v span { font-size: 15px; font-weight: 700; margin-left: 3px; }
.stat .k { font-size: 14.5px; font-weight: 700; margin-top: 6px; }
.stat .s { font-size: 12.5px; color: var(--muted); margin-top: 3px; line-height: 1.5; }
.stat .src { font-size: 11.5px; color: var(--muted-2); margin-top: 8px; border-top: 1px dotted var(--line-2); padding-top: 6px; }

/* ---------------------------------------------------------------- section */
.sect { margin: 34px 0 14px; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.sect h2 { font-family: var(--serif); font-size: 25px; letter-spacing: 1px; }
.sect .en { font-family: var(--num); font-size: 12px; letter-spacing: 2px; color: var(--muted-2); text-transform: uppercase; font-weight: 700; }
.sect .more { margin-left: auto; font-size: 14.5px; font-weight: 700; }

/* ---------------------------------------------------------------- lists */
.artlist { list-style: none; margin: 0; padding: 0; }
.artlist li + li { border-top: 1px solid var(--line-2); }
.artlist a { display: flex; gap: 14px; padding: 14px 2px; align-items: flex-start; }
.artlist a:hover { background: var(--soft); }
.artlist .idx {
  font-family: var(--num); font-size: 12px; font-weight: 800; color: #fff; background: var(--nc, var(--ink));
  border-radius: 5px; padding: 2px 7px; margin-top: 5px; flex: none; letter-spacing: .5px;
}
.artlist .tx { min-width: 0; }
.artlist .ti { display: block; font-size: 16.5px; font-weight: 700; line-height: 1.5; }
.artlist a:hover .ti { color: var(--red); }
.artlist .de { display: block; font-size: 13.5px; color: var(--muted); margin-top: 4px; line-height: 1.6; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(292px, 1fr)); gap: 16px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: block; color: var(--ink); }
.tile:hover { border-color: var(--nc, var(--red)); }
.tile:hover .t { color: var(--red); }
.tile .kick { font-size: 12px; font-weight: 800; letter-spacing: 1.5px; color: var(--nc, var(--muted)); text-transform: uppercase; font-family: var(--num); }
.tile .t { font-size: 18px; font-weight: 800; margin-top: 8px; line-height: 1.45; }
.tile .d { font-size: 14px; color: var(--muted); margin-top: 8px; line-height: 1.65; }
.tile .m { font-size: 12.5px; color: var(--muted-2); margin-top: 12px; padding-top: 10px; border-top: 1px dotted var(--line-2); }

/* ---------------------------------------------------------------- column header */
.colhead { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; border-left: 6px solid var(--nc); padding: 24px 26px; }
.colhead .crumb { font-size: 13.5px; color: var(--muted); margin-bottom: 8px; }
.colhead .k { font-family: var(--num); font-size: 12px; letter-spacing: 2px; font-weight: 800; color: var(--nc); text-transform: uppercase; }
.colhead h1 { font-family: var(--serif); font-size: 32px; letter-spacing: 1.5px; margin: 6px 0 12px; }
.colhead .l { font-size: 16.5px; color: #333; max-width: 68ch; margin: 0; }
.subtabs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.subtabs a { font-size: 14px; padding: 7px 13px; border-radius: var(--radius-s); border: 1px solid var(--line); background: #fff; font-weight: 700; }
.subtabs a.on { background: var(--nc); color: #fff; border-color: var(--nc); }

/* ---------------------------------------------------------------- article */
.art { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 32px 38px 30px; }
@media (max-width: 700px) { .art { padding: 22px 18px; } }
.art .tagrow { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 14px; }
.art .tag { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 5px; background: var(--soft-2); color: var(--muted); border: 1px solid var(--line-2); }
.art .tag.col { background: var(--nc); color: #fff; border-color: var(--nc); }
.art h1 { font-family: var(--serif); font-size: 33px; line-height: 1.4; letter-spacing: .5px; margin-bottom: 12px; }
.art .meta { font-size: 13.5px; color: var(--muted); padding-bottom: 16px; border-bottom: 1px solid var(--line-2); display: flex; gap: 16px; flex-wrap: wrap; }
.body { font-size: 17px; line-height: 1.95; }
.body > :first-child { margin-top: 18px; }
.body h2 { font-family: var(--serif); font-size: 23px; margin: 34px 0 12px; padding-left: 12px; border-left: 4px solid var(--nc, var(--red)); letter-spacing: .5px; }
.body h3 { font-size: 18.5px; margin: 26px 0 10px; }
.body h4 { font-size: 16.5px; margin: 20px 0 8px; color: #333; }
.body p { text-align: justify; }
.body .lead { font-size: 18px; color: #222; background: var(--sun-l); border: 1px solid var(--line); border-left: 5px solid var(--sun-d); border-radius: var(--radius-s); padding: 15px 18px; margin: 0 0 24px; line-height: 1.8; }
.body strong { font-weight: 800; }
.body em { font-style: normal; background: linear-gradient(180deg, transparent 62%, var(--sun) 62%); padding: 0 2px; }
.body ul li::marker { color: var(--nc, var(--red)); font-weight: 800; }

blockquote {
  margin: 22px 0; padding: 16px 20px; background: var(--soft);
  border: 1px solid var(--line-2); border-radius: var(--radius-s);
  font-size: 16px; color: #333;
}
blockquote :last-child { margin-bottom: 0; }
blockquote .who { display: block; margin-top: 10px; font-size: 13px; color: var(--muted); font-weight: 700; }

.callout { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin: 22px 0; background: #fff; }
.callout .h { font-size: 14px; font-weight: 800; letter-spacing: .5px; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.callout .h::before { content: ""; width: 10px; height: 10px; border-radius: 2px; background: var(--ck, var(--blue)); flex: none; }
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }
.callout.warn { background: #fff8e8; } .callout.warn { --ck: var(--orange); }
.callout.risk { background: #fdf0f2; } .callout.risk { --ck: var(--red); }
.callout.ok { background: #eefaf3; } .callout.ok { --ck: var(--green); }

.tablewrap { overflow-x: auto; margin: 22px 0; border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 15px; background: #fff; }
th, td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); text-align: left; vertical-align: top; line-height: 1.7; }
th { background: var(--soft); font-weight: 800; font-size: 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num { font-family: var(--num); font-weight: 700; white-space: nowrap; }

.figure { margin: 26px 0; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden; }
.figure .imgbox { padding: 18px; background: var(--soft); }
.figure figcaption { padding: 11px 16px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--muted); }
@media (max-width: 760px) {
  .figure .imgbox { overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 14px; }
  .figure .imgbox > svg, .figure .imgbox > img { width: 760px; max-width: none; }
}

.steps { counter-reset: s; list-style: none; padding: 0; margin: 22px 0; }
.steps li { counter-increment: s; position: relative; padding: 0 0 0 46px; margin-bottom: 16px; }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: 1px;
  width: 32px; height: 32px; border-radius: 8px; background: var(--nc, var(--red)); color: #fff;
  font-family: var(--num); font-weight: 800; font-size: 15px; display: grid; place-items: center;
}
.steps li b { display: block; font-size: 16.5px; }
.steps li span { font-size: 15px; color: #444; }

/* ---------------------------------------------------------------- toc / aside */
.aside { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 16px; }
.toc { font-size: 14.5px; }
.toc a { display: block; padding: 7px 10px; border-left: 3px solid var(--line-2); color: #444; line-height: 1.5; }
.toc a:hover { background: var(--soft); color: var(--red); }
.toc a.lv3 { padding-left: 22px; font-size: 13.5px; color: var(--muted); }
.toc a.on { border-left-color: var(--nc, var(--red)); color: var(--nc, var(--red)); font-weight: 700; background: var(--soft); }

.promo { background: var(--ink); color: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.promo .t { font-family: var(--serif); font-size: 19px; letter-spacing: .5px; }
.promo .d { font-size: 13.5px; color: #c9d3e0; margin-top: 8px; line-height: 1.7; }
.promo .row { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.promo .row span { color: var(--sun); font-weight: 700; }
.promo a.act {
  display: block; text-align: center; margin-top: 14px; background: var(--red); color: #fff;
  border: 1px solid var(--red); border-radius: var(--radius-s); padding: 10px; font-weight: 800; font-size: 15px;
}
.promo a.act:hover { background: var(--red-d); color: #fff; }

.sources { font-size: 13px; color: var(--muted); }
.sources ol { padding-left: 1.3em; margin: 0; }
.sources li { margin-bottom: 7px; line-height: 1.6; word-break: break-all; }
.sources .badge { font-size: 11px; font-weight: 800; padding: 1px 6px; border-radius: 4px; margin-right: 5px; }
.sources .b-official { background: #eefaf3; color: var(--green); border: 1px solid #bfe6d2; }
.sources .b-media { background: #eaf2fb; color: var(--blue-d); border: 1px solid #c5daf0; }
.sources .b-verify { background: #fff8e8; color: #a8791a; border: 1px solid #ecd9a8; }

/* ---------------------------------------------------------------- pager */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; }
@media (max-width: 700px) { .pager { grid-template-columns: 1fr; } }
.pager a { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; color: var(--ink); }
.pager a:hover { border-color: var(--red); }
.pager .n { font-size: 12px; color: var(--muted); font-weight: 700; letter-spacing: 1px; }
.pager .t { font-size: 15.5px; font-weight: 700; margin-top: 4px; line-height: 1.5; }
.pager .next { text-align: right; }

/* ---------------------------------------------------------------- footer */
.site-foot { margin-top: 44px; background: var(--ink); color: #c9d3e0; border-top: 5px solid transparent; position: relative; }
.site-foot::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 5px;
  background: linear-gradient(90deg, var(--red) 0 16.6%, var(--orange) 16.6% 33.3%, var(--yellow) 33.3% 50%, var(--green) 50% 66.6%, var(--blue) 66.6% 83.3%, var(--purple) 83.3% 100%);
}
.site-foot .inner { max-width: var(--maxw); margin: 0 auto; padding: 30px 20px 22px; display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 26px; }
@media (max-width: 860px) { .site-foot .inner { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .site-foot .inner { grid-template-columns: 1fr; } }
.site-foot h4 { color: #fff; font-size: 14px; letter-spacing: 1px; margin-bottom: 12px; }
.site-foot a { color: #c9d3e0; display: block; padding: 4px 0; font-size: 14.5px; }
.site-foot a:hover { color: var(--sun); }
.site-foot .about { font-size: 14px; line-height: 1.8; max-width: 44ch; }
.site-foot .about .nm { font-family: var(--serif); font-size: 19px; color: #fff; letter-spacing: 2px; margin-bottom: 8px; }
.footnote { border-top: 1px solid #333; padding: 16px 20px 26px; max-width: var(--maxw); margin: 0 auto; font-size: 12.5px; line-height: 1.8; color: #8a95a5; }

/* ---------------------------------------------------------------- tools */
.form fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 8px; margin: 0 0 16px; background: #fff; }
.form legend { font-weight: 800; font-size: 15.5px; padding: 0 8px; }
.opt { display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px; border-radius: var(--radius-s); cursor: pointer; }
.opt:hover { background: var(--soft); }
.opt input { margin-top: 6px; width: 17px; height: 17px; accent-color: var(--red); flex: none; }
.opt .lbl { font-size: 15.5px; line-height: 1.6; }
.opt .hint { font-size: 13px; color: var(--muted); }
.result { display: none; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-top: 8px; }
.result.on { display: block; }
.result .verdict { font-family: var(--serif); font-size: 24px; letter-spacing: .5px; }
.scorebar { height: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft-2); overflow: hidden; margin: 12px 0 18px; }
.scorebar i { display: block; height: 100%; background: linear-gradient(90deg, var(--sun-d), var(--green)); }
.btn { font-family: inherit; font-size: 15.5px; font-weight: 800; padding: 11px 22px; border-radius: var(--radius-s); border: 1px solid var(--line); background: var(--red); color: #fff; cursor: pointer; }
.btn:hover { background: var(--red-d); }
.btn.ghost { background: #fff; color: var(--ink); }
.btn.ghost:hover { background: var(--soft); }

.glossary dt { font-weight: 800; font-size: 16px; margin-top: 18px; color: var(--blue-d); }
.glossary dd { margin: 4px 0 0; font-size: 15.5px; line-height: 1.8; }

/* ---------------------------------------------------------------- misc */
.tagline-strip { background: var(--sun-l); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 12px 20px; text-align: center; font-size: 14.5px; }
.tagline-strip b { font-family: var(--serif); letter-spacing: 1px; }
.breadcrumb { font-size: 13.5px; color: var(--muted); margin-bottom: 14px; }
.breadcrumb a { color: var(--muted); }
.updated { font-size: 13px; color: var(--muted-2); }

@media (max-width: 760px) {
  body { font-size: 16.5px; }
  .art h1 { font-size: 26px; }
  .colhead h1 { font-size: 25px; }
  .nav .inner { padding: 0 12px; }
  .nav a { padding: 11px 12px; font-size: 15px; }
  .head-side { display: none; }
  .wrap { padding: 18px 14px 8px; }
}

@media print {
  .site-head, .nav, .site-foot, .aside, .pager, .hero .ribbon, .no-print { display: none !important; }
  body { background: #fff; font-size: 12pt; }
  .wrap, .two { max-width: none; display: block; }
  .art, .card, .colhead { border: 1px solid #999; break-inside: avoid; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; color: #555; }
}

/* ---------------------------------------------------------------- 案例库：场景索引与案例卡片 */
html { scrollbar-width: thin; scrollbar-color: #b9c4d4 var(--soft-2); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--soft-2); }
::-webkit-scrollbar-thumb { background: #b9c4d4; border-radius: 6px; border: 2px solid var(--soft-2); }
::-webkit-scrollbar-thumb:hover { background: #8fa0b8; }

.scenegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin: 18px 0 6px; }
.scenecard {
  display: flex; flex-direction: column; gap: 7px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 16px 14px; color: var(--ink); text-decoration: none;
  transition: border-color .15s ease, transform .15s ease;
}
.scenecard:hover { border-color: var(--sun-d); color: var(--ink); transform: translateY(-2px); }
.scenecard:focus-visible { outline: 2px solid var(--sun-d); outline-offset: 2px; }
.scenecard .sc-code { font-family: var(--num); font-size: 12px; font-weight: 800; letter-spacing: 1.5px; color: var(--sun-d); }
.scenecard .sc-name { font-family: var(--serif); font-size: 17.5px; font-weight: 800; line-height: 1.35; }
.scenecard .sc-pain { font-size: 13px; color: var(--muted); line-height: 1.65; flex: 1; }
.scenecard .sc-stats { font-size: 12.5px; color: var(--muted); border-top: 1px dotted var(--line-2); padding-top: 8px; }
.scenecard .sc-stats b { font-family: var(--num); color: var(--ink); }
.scenecard .sc-meter { display: block; height: 4px; background: var(--soft-2); border-radius: 2px; overflow: hidden; }
.scenecard .sc-meter i { display: block; height: 100%; background: var(--sun-d); }
.scenecard .sc-go { font-size: 13px; font-weight: 800; color: var(--red); }

.libband {
  display: grid; grid-template-columns: minmax(0, 1fr) 336px; margin: 22px 0 6px;
  background: var(--ink-d); color: #e8edf5; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.libband .lb-main { padding: 24px 26px 22px; min-width: 0; }
.libband .lb-kick { font-family: var(--num); font-size: 12px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; color: var(--sun); }
.libband h2 { font-family: var(--serif); font-size: 25px; line-height: 1.4; letter-spacing: 1px; margin: 8px 0 12px; color: #fff; }
.libband p { margin: 0; font-size: 15px; line-height: 1.85; color: #c9d3e0; max-width: 66ch; }
.libband .lb-acts { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.libband a.act { background: var(--sun-d); color: #171717; font-size: 15px; font-weight: 800; padding: 10px 18px; border-radius: var(--radius-s); }
.libband a.act:hover { background: var(--sun); color: #171717; }
.libband a.act.ghost { background: transparent; color: #e8edf5; border: 1px solid #4d4d4d; font-weight: 600; }
.libband a.act.ghost:hover { border-color: var(--sun-d); color: var(--sun); background: transparent; }
.libband .lb-note { margin-top: 16px; padding-top: 12px; border-top: 1px dotted #3a3a3a; font-size: 12.5px; line-height: 1.75; color: #98a4b8; }
.libband .lb-scenes { background: #131313; border-left: 1px solid var(--line); padding: 15px 12px 14px; }
.libband .lb-hd { font-size: 12.5px; font-weight: 800; letter-spacing: 1px; color: var(--sun); padding: 0 6px 9px; }
.libband .lb-list a { display: flex; align-items: baseline; gap: 8px; padding: 8px 6px; font-size: 14px; color: #e8edf5; }
.libband .lb-list a + a { border-top: 1px solid #242424; }
.libband .lb-list a:hover { background: #222; color: var(--sun); }
.libband .lb-list a:focus-visible { outline: 2px solid var(--sun-d); outline-offset: -2px; }
.libband .lb-list .sc { flex: none; width: 26px; font-family: var(--num); font-size: 11px; font-weight: 800; letter-spacing: .5px; color: var(--sun); }
.libband .lb-list .sn { flex: 1; min-width: 0; line-height: 1.45; }
.libband .lb-list .cn { flex: none; font-family: var(--num); font-size: 11.5px; color: #8b97ab; }
@media (max-width: 1000px) {
  .libband { grid-template-columns: 1fr; }
  .libband .lb-scenes { border-left: 0; border-top: 1px solid var(--line); }
  .libband .lb-list { display: grid; grid-template-columns: repeat(2, 1fr); }
  .libband .lb-list a + a { border-top: 1px solid #242424; }
}
@media (max-width: 760px) {
  .libband h2 { font-size: 21px; }
  .libband .lb-main { padding: 20px 18px 18px; }
  .libband .lb-list { grid-template-columns: 1fr; }
}
@media print {
  .libband { display: none; }
}

.statstrip { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 10px; margin: 16px 0 4px; }
.statstrip .st { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px 12px; border-top: 3px solid var(--sun-d); }
.statstrip .st b { display: block; font-family: var(--num); font-size: 20px; line-height: 1.2; }
.statstrip .st span { font-size: 12px; color: var(--muted); }

.casebar {
  position: sticky; top: 8px; z-index: 6; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 8px 10px; margin: 14px 0 12px;
  box-shadow: 0 4px 14px rgba(20, 30, 60, .08);
}
.cb-row { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; }
.cb-more { margin-top: 8px; padding-top: 9px; border-top: 1px dotted var(--line-2); }
.casebar[data-folded] .cb-more { display: none; }
.cb-q { flex: 1 1 220px; min-width: 0; display: flex; align-items: center; gap: 8px; }
.cb-q .lbl { flex: none; font-size: 12.5px; color: var(--muted); }
.cb-q input { flex: 1 1 auto; min-width: 0; }
.cb-sel { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.casebar input, .casebar select {
  font: inherit; font-size: 14px; padding: 6px 9px; border: 1px solid var(--line-2);
  border-radius: 6px; background: #fff; color: var(--ink); min-width: 0;
}
.casebar input:focus, .casebar select:focus { outline: 2px solid var(--sun); outline-offset: 1px; border-color: var(--sun-d); }
.cb-act { display: flex; gap: 8px; flex-wrap: wrap; }
.btn.sm { padding: 7px 12px; font-size: 13px; }
.cb-stat {
  display: flex; gap: 6px 16px; flex-wrap: wrap; margin-left: auto;
  font-size: 12.5px; color: var(--muted);
}
.cb-stat b { font-family: var(--num); color: var(--ink); }

.caselist { display: flex; flex-direction: column; gap: 10px; }
.case { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; scroll-margin-top: 74px; }
.case[hidden] { display: none; }
.case[open] { border-color: var(--sun-d); }
.case summary {
  list-style: none; cursor: pointer; display: grid;
  grid-template-columns: 64px minmax(150px, 1.15fr) minmax(130px, 1fr) minmax(170px, 1.35fr) 92px 20px;
  gap: 12px; align-items: center; padding: 12px 14px;
}
.case summary::-webkit-details-marker { display: none; }
.case summary:hover { background: var(--soft); }
.case[open] summary { background: var(--sun-l); border-bottom: 1px solid var(--line-2); }
.c-id { font-family: var(--num); font-size: 11.5px; font-weight: 800; color: #fff; background: var(--ink); border-radius: 4px; padding: 2px 6px; text-align: center; }
.case summary b { font-weight: 700; font-size: 14.5px; display: block; }
.case summary i { font-style: normal; font-size: 12px; color: var(--muted); display: block; margin-top: 2px; }
.case summary .c-fam { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.c-cost { text-align: right; }
.c-arrow { font-family: var(--num); font-weight: 700; font-size: 16px; color: var(--muted); text-align: center; transition: transform .15s ease; }
.case[open] .c-arrow { transform: rotate(45deg); }
.c-body { padding: 14px 16px 16px; }
.c-title { font-size: 13px; color: var(--muted); margin: 0 0 10px; }
.grp + .grp { margin-top: 12px; }
.grp h4 { font-size: 12px; letter-spacing: 1px; color: var(--sun-d); margin: 0 0 6px; font-weight: 800; }
.grp dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 6px 16px; margin: 0; }
.grp .f { border-bottom: 1px dotted var(--line-2); padding: 3px 0; }
.grp dt { font-size: 11.5px; color: var(--muted-2); }
.grp dd { margin: 1px 0 0; font-size: 13px; line-height: 1.6; }
.c-meta { margin: 12px 0 0; font-size: 12px; color: var(--muted-2); border-top: 1px dotted var(--line-2); padding-top: 8px; }
.c-story { display: inline-flex; align-items: center; gap: 4px; margin-top: 10px; font-size: 12.5px; font-weight: 800; color: var(--sun-d); border-bottom: 1px solid transparent; }
.c-story:hover { border-bottom-color: currentColor; }
.fieldref { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin: 10px 0 18px; overflow: hidden; }
.fieldref summary { cursor: pointer; padding: 13px 16px; font-size: 14px; font-weight: 800; color: var(--ink); list-style: none; display: flex; align-items: center; gap: 8px; }
.fieldref summary::-webkit-details-marker { display: none; }
.fieldref summary::before { content: '＋'; font-family: var(--num); color: var(--sun-d); font-weight: 700; }
.fieldref[open] summary::before { content: '－'; }
.fieldref summary:hover { background: var(--soft); }
.fieldref .c-body { border-top: 1px dotted var(--line-2); }
.case-empty { margin: 16px 0; padding: 22px; text-align: center; color: var(--muted); background: var(--soft); border: 1px dashed var(--line-2); border-radius: var(--radius); }
.casenav { display: flex; justify-content: space-between; gap: 10px; margin: 26px 0 6px; flex-wrap: wrap; }
.casenav a { font-size: 14px; font-weight: 700; }

/* 故事版：首列不折行，避免「基本情 / 况」这类断字 */
.story .body table td:first-child { white-space: nowrap; }
@media (max-width: 640px) {
  /* 窄屏把三/四列表格拆成逐条卡片，列名用 data-l 自动带出 */
  .story .body .tablewrap { overflow: visible; }
  .story .body table, .story .body table tr, .story .body table td { display: block; }
  .story .body table tr { padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
  .story .body table tr:last-child { border-bottom: 0; }
  .story .body table tr:first-child { display: none; }
  .story .body table td { border: 0; padding: 2px 0; }
  .story .body table td:first-child { padding: 0 0 5px; font-weight: 800; font-size: 15px; color: var(--ink); white-space: normal; }
  .story .body table td[data-l]::before { content: attr(data-l) "："; color: var(--muted-2); font-size: 12.5px; font-weight: 600; }
  .story .body table td.num { text-align: left; }
}

@media (max-width: 760px) {
  .scenegrid { grid-template-columns: 1fr; }
  .statstrip { grid-template-columns: repeat(3, 1fr); }
  .casebar { position: static; }
  .cb-stat { margin-left: 0; }
  .case summary {
    grid-template-columns: 52px 1fr 84px 18px;
    grid-template-areas: "id who cost arrow" "fam fam fam fam" "g g g g";
    row-gap: 3px; padding: 11px 12px;
  }
  .c-id { grid-area: id; }
  .c-who { grid-area: who; }
  .c-fam { grid-area: fam; }
  .c-g { grid-area: g; }
  .c-cost { grid-area: cost; }
  .c-arrow { grid-area: arrow; }
  .c-g i { display: inline; margin-left: 6px; }
  .c-body { padding: 12px 12px 14px; }
  .grp dl { grid-template-columns: 1fr; }
}

@media print {
  .casebar, .case-empty, .casenav { display: none !important; }
  .case { break-inside: avoid; border: 1px solid #999; }
  .case .c-body { display: block; }
  .case summary { grid-template-columns: 64px 1fr 1fr 1fr 92px; }
  .scenecard { border: 1px solid #999; break-inside: avoid; }
  .scenecard .sc-go, .scenecard .sc-meter { display: none; }
}
