/* pinfenglou.club — 羊皮纸 / 石墨蓝 / 黄铜 */

:root {
  --bg: #f4f1ea;
  --surface: #fbfaf6;
  --surface-2: #eae7dd;
  --text: #23282f;
  --text-muted: #5a636d;
  --text-faint: #7b838c;
  --accent: #14405e;
  --accent-ink: #f4f1ea;
  --brass: #8a6117;
  --brass-soft: #c9a961;
  --border: #d9d3c5;
  --border-strong: #b7b0a0;
  --ring: #8a6117;
  --ok: #2c6a4c;
  --warn: #8a5a0c;
  --danger: #9b2f2b;
  --cta-bg: #141f29;
  --cta-ink: #f6f3ec;

  --font-head: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", system-ui, sans-serif;
  --font-body: "Songti SC", "STSong", "SimSun", "Source Han Serif SC", Georgia, serif;
  --font-num: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  --fs-h1: 34px;
  --fs-h2: 25px;
  --fs-h3: 19px;
  --fs-body: 17px;
  --fs-small: 14px;
  --fs-micro: 12px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  --radius-sm: 3px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --shadow-1: 0 1px 0 rgba(35, 40, 47, .05);
  --shadow-2: 0 2px 10px rgba(35, 40, 47, .07);
  --shadow-3: 0 12px 34px rgba(20, 31, 41, .16);
  --ease: cubic-bezier(.32, .72, .32, 1);
  --dur: 160ms;

  --container: 1120px;
  --container-wide: 1320px;
  --container-text: 700px;
  --cta-clearance: 132px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: var(--fs-body)/1.85 var(--font-body);
  padding-bottom: var(--cta-clearance);
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-decoration: underline; text-decoration-color: color-mix(in oklab, var(--brass) 55%, transparent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--brass); text-decoration-thickness: 2px; }
a:focus-visible, summary:focus-visible, .tw:focus-visible, label:focus-visible {
  outline: 3px solid var(--ring); outline-offset: 2px; border-radius: var(--radius-sm);
}

h1, h2, h3 { font-family: var(--font-head); color: var(--text); margin: 0; }
h1 { font-size: var(--fs-h1); line-height: 1.25; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: var(--fs-h2); line-height: 1.3; font-weight: 700; }
h3 { font-size: var(--fs-h3); line-height: 1.45; font-weight: 700; }
p { margin: 0 0 var(--space-4); }
strong { font-weight: 700; }

.shell { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--space-5); }

.skip { position: absolute; left: -9999px; top: 0; background: var(--surface); padding: var(--space-3) var(--space-4); z-index: 90; }
.skip:focus { left: var(--space-4); top: var(--space-2); }

/* ---------------------------------------------------------------- 顶部 */

.util { background: var(--text); color: var(--accent-ink); }
.util-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); min-height: 32px; }
.util-tag, .util-links { margin: 0; font-family: var(--font-num); font-size: var(--fs-micro); letter-spacing: .04em; }
.util-tag { color: color-mix(in oklab, var(--accent-ink) 78%, transparent); }
.util-links { display: flex; gap: var(--space-2); align-items: center; white-space: nowrap; }
.util-links a { color: var(--brass-soft); text-decoration-color: transparent; }
.util-links a:hover { text-decoration-color: var(--brass-soft); }
.util-links span { color: color-mix(in oklab, var(--accent-ink) 40%, transparent); }

.site-head { position: sticky; top: 0; z-index: 40; background: var(--surface); border-bottom: 1px solid var(--border); }
.head-row { display: flex; align-items: center; gap: var(--space-5); min-height: 64px; }
.brand { display: flex; align-items: center; gap: var(--space-3); text-decoration: none; }
.brand img { width: 120px; height: 45px; object-fit: contain; }
.brand-name { font-family: var(--font-head); font-weight: 700; font-size: var(--fs-h3); color: var(--text); }

.nav-desktop { margin-left: auto; }
.nav-list { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-5); list-style: none; margin: 0; padding: 0; }
.nav-list a { display: inline-flex; align-items: center; min-height: 44px; font-family: var(--font-head); font-size: var(--fs-small); color: var(--text-muted); text-decoration: none; }
.nav-list a:hover { color: var(--text); text-decoration: underline; text-decoration-color: var(--brass); }
.nav-list a[aria-current="page"] { color: var(--text); font-weight: 700; box-shadow: inset 0 -2px 0 var(--brass); }

.drawer { display: none; margin-left: auto; }
.drawer-btn { list-style: none; cursor: pointer; display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--space-4); border: 1px solid var(--border-strong); border-radius: var(--radius-md); font-family: var(--font-head); font-size: var(--fs-small); background: var(--bg); }
.drawer-btn::-webkit-details-marker { display: none; }
.drawer-panel {
  position: fixed; inset: auto 0 0 0; z-index: 60; background: var(--surface);
  border-top: 1px solid var(--border-strong); box-shadow: var(--shadow-3);
  padding: var(--space-4) var(--space-5) calc(var(--space-5) + env(safe-area-inset-bottom));
  max-height: 78vh; overflow-y: auto;
  transform: translateY(101%); visibility: hidden; transition: transform var(--dur) var(--ease), visibility var(--dur);
}
.drawer[open] .drawer-panel { transform: translateY(0); visibility: visible; }
.drawer-head { font-family: var(--font-num); font-size: var(--fs-micro); letter-spacing: .08em; color: var(--text-faint); margin: 0 0 var(--space-3); }
.drawer-list { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: var(--space-5); }
.drawer-list li { break-inside: avoid; }
.drawer-list a { display: flex; align-items: center; min-height: 44px; font-family: var(--font-head); font-size: var(--fs-small); text-decoration: none; border-bottom: 1px solid var(--border); }
.drawer-foot { margin: var(--space-4) 0 0; font-size: var(--fs-micro); color: var(--text-faint); }

/* ---------------------------------------------------------------- 面包屑 */

.crumbs { max-width: var(--container); margin: 0 auto; padding: var(--space-4) var(--space-5) 0; }
.crumbs ol { display: flex; flex-wrap: wrap; gap: var(--space-2); list-style: none; margin: 0; padding: 0; font-size: var(--fs-small); color: var(--text-faint); }
.crumbs li + li::before { content: "/"; margin-right: var(--space-2); color: var(--border-strong); }
.crumbs a { color: var(--text-muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); text-decoration: underline; }

/* ---------------------------------------------------------------- 首屏 */

.lede { padding: var(--space-7) 0 var(--space-6); border-bottom: 1px solid var(--border); }
.lede-inner { max-width: var(--container-text); }
.kicker { font-family: var(--font-num); font-size: var(--fs-micro); letter-spacing: .12em; text-transform: uppercase; color: var(--brass); margin: 0 0 var(--space-4); }
.lede h1 { margin-bottom: var(--space-4); }
.lede .standfirst { font-size: 19px; line-height: 1.75; color: var(--text); }
.lede .standfirst strong { box-shadow: inset 0 -8px 0 color-mix(in oklab, var(--brass-soft) 34%, transparent); }
.lede .standfirst .hl { font-style: normal; box-shadow: inset 0 -8px 0 color-mix(in oklab, var(--brass-soft) 34%, transparent); }

/* 字段台 */
.docket { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1px; margin: var(--space-6) 0 0; padding: 1px; list-style: none; background: var(--border); border: 1px solid var(--border-strong); border-radius: var(--radius-md); }
.docket li { background: var(--surface); padding: var(--space-3) var(--space-3) var(--space-4); display: flex; flex-direction: column; gap: var(--space-1); }
.dk-n { font-family: var(--font-num); font-size: var(--fs-micro); color: var(--brass); }
.dk-k { font-family: var(--font-head); font-size: var(--fs-small); font-weight: 700; }
.dk-v { font-size: var(--fs-micro); color: var(--text-muted); line-height: 1.6; }

/* ---------------------------------------------------------------- 区块 */

.sec { padding: var(--space-8) 0; border-bottom: 1px solid var(--border); }
.sec:last-of-type { border-bottom: 0; }
.sec .shell > h2 { max-width: var(--container-text); margin-bottom: var(--space-5); }
.sec .shell > p, .sec .shell > .numlist, .sec .shell > .factlist, .sec .shell > .judgelist, .sec .shell > .ranklist { max-width: var(--container-text); }
.sec .shell > .prose-lead { max-width: var(--container-text); }
.close-line { color: var(--text-muted); border-top: 1px solid var(--border); padding-top: var(--space-4); margin-top: var(--space-5); }

.numlist, .ranklist, .judgelist, .idxgrid { list-style: none; margin: 0; padding: 0; }
.numlist li { padding: var(--space-5) 0; border-top: 1px solid var(--border); }
.numlist li:first-child { border-top: 0; padding-top: 0; }
.numlist h3 { display: flex; gap: var(--space-3); align-items: baseline; margin-bottom: var(--space-2); }
.num { font-family: var(--font-num); font-size: var(--fs-small); color: var(--brass); flex: none; }
.numlist p { margin: 0; color: var(--text-muted); }

.ranklist li { display: flex; gap: var(--space-4); padding: var(--space-4) 0; border-top: 1px solid var(--border); }
.ranklist li:first-child { border-top: 0; }
.rank { font-family: var(--font-num); font-size: var(--fs-small); color: var(--brass); flex: none; width: 24px; padding-top: 2px; }
.ranklist h3 { margin-bottom: var(--space-1); }
.ranklist p { margin: 0; color: var(--text-muted); font-size: var(--fs-small); }

.factlist { margin: 0; }
.fact { display: flex; gap: var(--space-5); padding: var(--space-4) 0; border-top: 1px solid var(--border); }
.fact:first-child { border-top: 0; }
.fact dt { flex: none; width: 158px; font-family: var(--font-head); font-weight: 700; font-size: var(--fs-small); }
.fact dd { margin: 0; color: var(--text-muted); }

.judgelist li { display: flex; gap: var(--space-4); align-items: flex-start; padding: var(--space-4) 0; border-top: 1px solid var(--border); }
.judgelist li:first-child { border-top: 0; }
.judgelist p { margin: 0; }
.judge-item > p:last-child { color: var(--text-muted); }
.tag { flex: none; font-family: var(--font-head); font-size: var(--fs-micro); padding: 2px var(--space-2); border-radius: var(--radius-sm); border: 1px solid var(--border-strong); white-space: nowrap; }
.tag-ok { color: var(--ok); border-color: color-mix(in oklab, var(--ok) 45%, transparent); }
.tag-warn { color: var(--warn); border-color: color-mix(in oklab, var(--warn) 45%, transparent); }
.tag-danger { color: var(--danger); border-color: color-mix(in oklab, var(--danger) 45%, transparent); }

.idxgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-3); }
.idxgrid a { display: block; height: 100%; padding: var(--space-4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); text-decoration: none; color: inherit; }
.idxgrid a:hover { border-color: var(--border-strong); }
.idxgrid a:hover h3 { color: var(--accent); }
.idxgrid h3 { font-size: var(--fs-body); margin-bottom: var(--space-2); }
.idxgrid p { margin: 0; font-size: var(--fs-small); color: var(--text-muted); line-height: 1.7; }

.side-wrap { display: grid; grid-template-columns: minmax(0, var(--container-text)) 260px; gap: var(--space-7); align-items: start; }
.side-aside { background: var(--surface-2); border-radius: var(--radius-md); padding: var(--space-4); }
.side-aside h3 { font-size: var(--fs-small); margin-bottom: var(--space-2); }
.side-aside p { font-size: var(--fs-small); color: var(--text-muted); margin-bottom: var(--space-3); }
.side-aside p:last-child { margin-bottom: 0; }

.tw { overflow-x: auto; border: 1px solid var(--border-strong); border-radius: var(--radius-md); background: var(--surface); }
table { border-collapse: collapse; width: 100%; min-width: 640px; font-size: var(--fs-small); }
th, td { text-align: left; padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-family: var(--font-head); font-size: var(--fs-micro); letter-spacing: .04em; background: var(--surface-2); white-space: nowrap; }
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }
td:first-child { font-family: var(--font-head); font-weight: 700; }

/* 字段轨（无脚本可切换） */
.rail { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: var(--space-6); align-items: start; }
.rail-radio { position: absolute; opacity: 0; pointer-events: none; }
.rail-col { display: flex; flex-direction: column; border-top: 1px solid var(--border); }
.rail-item { display: flex; align-items: center; min-height: 44px; padding-left: var(--space-3); border-bottom: 1px solid var(--border); border-left: 2px solid transparent; font-family: var(--font-head); font-size: var(--fs-small); color: var(--text-muted); cursor: pointer; }
.rail-item:hover { color: var(--text); border-left-color: var(--border-strong); }
.rail-panel { display: none; max-width: var(--container-text); }
.rail-panels { min-width: 0; }

/* ---------------------------------------------------------------- FAQ */

.faq details.q { border-top: 1px solid var(--border); }
.faq details.q:first-of-type { border-top: 0; }
.faq summary { display: flex; align-items: center; gap: var(--space-3); min-height: 56px; cursor: pointer; font-family: var(--font-head); font-size: var(--fs-body); font-weight: 700; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "＋"; font-family: var(--font-num); color: var(--brass); flex: none; }
.faq details[open] > summary::before { content: "－"; }
.q-body { max-width: var(--container-text); padding: 0 0 var(--space-5); color: var(--text-muted); }
.q-body p { margin: 0 0 var(--space-3); }
.q-body p:last-child { margin-bottom: 0; }

/* ---------------------------------------------------------------- 底部 */

.site-foot { background: var(--surface); border-top: 1px solid var(--border-strong); padding: var(--space-7) 0; margin-top: var(--space-8); }
.foot-top { padding-bottom: var(--space-5); border-bottom: 1px solid var(--border); }
.fb-name { font-family: var(--font-head); font-size: var(--fs-h3); font-weight: 700; text-decoration: none; color: var(--text); }
.fb-name:hover { color: var(--accent); text-decoration: underline; text-decoration-color: var(--brass); }
.foot-pos { margin: var(--space-2) 0 0; font-size: var(--fs-small); color: var(--text-muted); }
.foot-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-6); padding: var(--space-5) 0; }
.foot-col h2 { font-size: var(--fs-micro); letter-spacing: .1em; color: var(--text-faint); margin-bottom: var(--space-3); }
.foot-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.foot-col a { font-size: var(--fs-small); color: var(--text-muted); text-decoration: none; }
.foot-col a:hover { color: var(--accent); text-decoration: underline; }
.foot-base { margin: 0; padding-top: var(--space-5); border-top: 1px solid var(--border); font-size: var(--fs-micro); color: var(--text-faint); }

/* ---------------------------------------------------------------- CTA */

.site-cta {
  position: fixed; bottom: calc(var(--space-4) + env(safe-area-inset-bottom)); left: 50%;
  z-index: 50; display: flex; align-items: center; justify-content: center;
  min-height: 58px; width: min(480px, 34vw); padding: var(--space-3) var(--space-6);
  background: var(--cta-bg); color: var(--cta-ink);
  font-family: var(--font-head); font-size: 17px; font-weight: 700; letter-spacing: .02em;
  text-decoration: none; border: 1px solid var(--brass-soft); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-3);
  transform: translateX(-50%);
  animation: breathe 3.6s var(--ease) infinite;
}
.site-cta:hover { background: #1c2b38; border-color: var(--brass-soft); color: var(--cta-ink); text-decoration: none; transform: translateX(-50%) translateY(-2px); }
.site-cta:active { transform: translateX(-50%) translateY(0); }
.site-cta:focus-visible { outline: 3px solid var(--brass-soft); outline-offset: 3px; }
@keyframes breathe {
  0%, 100% { box-shadow: 0 12px 34px rgba(20, 31, 41, .16), 0 0 0 0 rgba(201, 169, 97, .34); }
  50% { box-shadow: 0 12px 34px rgba(20, 31, 41, .22), 0 0 0 8px rgba(201, 169, 97, 0); }
}

/* ---------------------------------------------------------------- 断点 */

@media (max-width: 1279px) {
  .idxgrid { grid-template-columns: repeat(3, 1fr); }
  .docket { grid-template-columns: repeat(4, 1fr); }
  .site-cta { width: min(460px, 44vw); }
}

@media (max-width: 899px) {
  :root { --fs-h1: 27px; --fs-h2: 22px; }
  .nav-desktop { display: none; }
  .drawer { display: block; }
  .sec { padding: var(--space-7) 0; }
  .idxgrid { grid-template-columns: repeat(2, 1fr); }
  .side-wrap { grid-template-columns: minmax(0, 1fr); gap: var(--space-5); }
  .rail { grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
  .rail-col { flex-direction: row; flex-wrap: wrap; gap: var(--space-2); border-top: 0; }
  .rail-item { border: 1px solid var(--border); border-left-width: 2px; border-radius: var(--radius-sm); padding: 0 var(--space-3); }
  .rail-panel { max-width: none; }
  .foot-cols { grid-template-columns: repeat(2, 1fr); }
  .site-cta { width: auto; }
}

@media (max-width: 639px) {
  :root { --fs-h1: 25px; --fs-h2: 21px; --fs-body: 16.5px; --cta-clearance: 118px; }
  .shell { padding: 0 var(--space-4); }
  .docket { grid-template-columns: repeat(2, 1fr); }
  .idxgrid { grid-template-columns: minmax(0, 1fr); }
  .foot-cols { grid-template-columns: minmax(0, 1fr); }
  .fact { flex-direction: column; gap: var(--space-1); }
  .fact dt { width: auto; }
  .util-tag { display: none; }
  .lede .standfirst { font-size: 17px; }
  .site-cta {
    left: var(--space-4); right: var(--space-4); width: auto; min-height: 56px;
    transform: none; font-size: 16px; padding: var(--space-3) var(--space-4);
  }
  .site-cta:hover, .site-cta:active { transform: translateY(-2px); }
  .site-cta:active { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .site-cta { animation: none; box-shadow: var(--shadow-3); }
  .site-cta:hover, .site-cta:active { transform: translateX(-50%); }
  .drawer-panel { transition: none; }
  * { transition-duration: 1ms !important; }
}

/* 字段轨选中态（无脚本可用） */
.rail input:nth-of-type(1):checked ~ .rail-panels > .rail-panel:nth-child(1),
.rail input:nth-of-type(2):checked ~ .rail-panels > .rail-panel:nth-child(2),
.rail input:nth-of-type(3):checked ~ .rail-panels > .rail-panel:nth-child(3),
.rail input:nth-of-type(4):checked ~ .rail-panels > .rail-panel:nth-child(4),
.rail input:nth-of-type(5):checked ~ .rail-panels > .rail-panel:nth-child(5),
.rail input:nth-of-type(6):checked ~ .rail-panels > .rail-panel:nth-child(6),
.rail input:nth-of-type(7):checked ~ .rail-panels > .rail-panel:nth-child(7),
.rail input:nth-of-type(8):checked ~ .rail-panels > .rail-panel:nth-child(8) { display: block; }
.rail input:nth-of-type(1):checked ~ .rail-col > label:nth-of-type(1),
.rail input:nth-of-type(2):checked ~ .rail-col > label:nth-of-type(2),
.rail input:nth-of-type(3):checked ~ .rail-col > label:nth-of-type(3),
.rail input:nth-of-type(4):checked ~ .rail-col > label:nth-of-type(4),
.rail input:nth-of-type(5):checked ~ .rail-col > label:nth-of-type(5),
.rail input:nth-of-type(6):checked ~ .rail-col > label:nth-of-type(6),
.rail input:nth-of-type(7):checked ~ .rail-col > label:nth-of-type(7),
.rail input:nth-of-type(8):checked ~ .rail-col > label:nth-of-type(8) { color: var(--text); font-weight: 700; border-left-color: var(--brass); }

