/* Postprint — Reader Deck 模板
   纸张/油墨气质：暖白纸面 + 印刷油墨色，阅读优先，导出面板贴手。
   不用视频站那种大播放器结构；结果区是「文档」不是「媒体卡片」。 */

:root {
  --paper: #F4F0E7;
  --paper-2: #FBF8F2;
  --surface: #FFFDF9;
  --ink: #17140F;
  --muted: #6E675C;
  --line: #E3DACB;
  --line-strong: #CFC3AE;
  --accent: #C2410C;
  --accent-ink: #FFF6F0;
  --ok: #1F6B4A;
  --warn: #8A5A12;
  --err: #A32B22;
  --shadow: 0 1px 2px rgba(23, 20, 15, .05), 0 8px 24px rgba(23, 20, 15, .06);
  --radius: 14px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Songti SC", "Noto Serif SC", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

html[data-theme="dark"] {
  --paper: #14120F;
  --paper-2: #1A1714;
  --surface: #201C18;
  --ink: #F2EDE3;
  --muted: #A79E8F;
  --line: #322C25;
  --line-strong: #453D33;
  --accent: #EF7A3C;
  --accent-ink: #241408;
  --ok: #5CC38F;
  --warn: #E0B261;
  --err: #F08A80;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }

.skip {
  position: absolute; left: -9999px; top: 0; background: var(--accent); color: var(--accent-ink);
  padding: 10px 14px; border-radius: 0 0 10px 0; z-index: 50;
}
.skip:focus { left: 0; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.bar { display: flex; align-items: center; gap: 18px; min-height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex: 0 0 auto; }
.brand .mark {
  width: 30px; height: 30px; border-radius: 9px; background: var(--ink); color: var(--paper);
  display: grid; place-items: center; font-family: var(--serif); font-weight: 700; font-size: 17px;
}
.brand .bname { font-family: var(--serif); font-size: 19px; font-weight: 700; letter-spacing: .01em; }
.brand .btag {
  color: var(--muted); font-size: 12.5px; border-left: 1px solid var(--line-strong);
  padding-left: 10px; margin-left: 2px; max-width: 320px;
}
.nav { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  color: var(--muted); text-decoration: none; font-size: 14px; padding: 9px 11px;
  border-radius: 9px; white-space: nowrap; min-height: 40px; display: inline-flex; align-items: center;
}
.nav a:hover { color: var(--ink); background: var(--paper-2); }
.topactions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.langs { display: flex; gap: 2px; border: 1px solid var(--line); border-radius: 10px; padding: 2px; background: var(--surface); }
.langs a {
  font-size: 12.5px; padding: 6px 9px; border-radius: 8px; text-decoration: none; color: var(--muted);
}
.langs a[aria-current="true"] { background: var(--ink); color: var(--paper); }
.icon { font-size: 16px; line-height: 1; }

/* ---------- 按钮 ---------- */
button, .btn {
  font: inherit; cursor: pointer;
  min-height: 44px; padding: 10px 16px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none;
}
button:hover, .btn:hover { border-color: var(--muted); }
button:focus-visible, .btn:focus-visible, a:focus-visible, input:focus-visible,
textarea:focus-visible, summary:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px;
}
button.primary, .btn.primary {
  background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 650;
}
button.primary:hover { filter: brightness(1.06); }
button[disabled] { opacity: .55; cursor: progress; }
.ghost { background: transparent; }

/* ---------- Hero 与输入板 ---------- */
.hero { padding: 34px 0 22px; border-bottom: 1px solid var(--line); background:
  radial-gradient(1200px 300px at 82% -40%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 70%); }
.hero-inner { display: grid; gap: 26px; grid-template-columns: 1fr; }
h1 {
  font-family: var(--serif); font-size: clamp(28px, 4.4vw, 46px); line-height: 1.12;
  margin: 0 0 12px; letter-spacing: -.01em;
}
.lede { color: var(--muted); font-size: 17px; margin: 0 0 12px; max-width: 46ch; }
.defaultfmt { color: var(--accent); font-size: 13.5px; font-weight: 600; margin: 0; }

.board {
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px;
}
.field { display: block; font-size: 13px; font-weight: 650; letter-spacing: .04em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
textarea {
  width: 100%; min-height: 96px; resize: vertical; padding: 13px 14px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: var(--paper-2); color: var(--ink);
  font-family: var(--mono); font-size: 15px; line-height: 1.5;
}
.hint { color: var(--muted); font-size: 13px; margin: 8px 0 0; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.actions .primary { margin-left: auto; min-width: 190px; }

.status { margin: 14px 0 0; padding: 10px 12px; border-radius: 10px; font-size: 14px;
  border: 1px dashed var(--line-strong); background: var(--paper-2); }
.status[data-state="ok"] { border-color: var(--ok); color: var(--ok); }
.status[data-state="partial"] { border-color: var(--warn); color: var(--warn); }
.status[data-state="error"] { border-color: var(--err); color: var(--err); }
.spin { display: inline-block; width: 13px; height: 13px; border: 2px solid currentColor;
  border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite;
  vertical-align: -1px; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 工作台 ---------- */
.deck { display: grid; gap: 26px; grid-template-columns: 1fr; padding: 30px 0 10px; align-items: start; }
.col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow);
}
.card h2 { font-family: var(--serif); font-size: 16px; margin: 0 0 12px; letter-spacing: .01em; }

.meta { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 14px; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; overflow-wrap: anywhere; min-width: 0; }
/* 来源链接很长，让它自己占一行；复制按钮另起一行，避免压在链接上 */
.meta dd:has(a) { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.meta dd a { word-break: break-all; }
.meta dd .mini {
  margin-left: auto; flex: 0 0 auto; padding: 4px 10px; font-size: 12.5px; min-height: 30px;
}
.warn { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--paper-2);
  border: 1px dashed var(--line-strong); color: var(--warn); font-size: 13.5px; }

.opts { display: grid; gap: 10px; }
.opt { display: flex; align-items: center; gap: 10px; font-size: 14.5px; min-height: 44px; }
.opt input { width: 18px; height: 18px; accent-color: var(--accent); }

/* 图片挑选 */
.review-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.rev {
  position: relative; border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  background: var(--paper-2); aspect-ratio: 1 / 1; cursor: pointer;
}
.rev img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rev input { position: absolute; top: 6px; left: 6px; width: 18px; height: 18px; accent-color: var(--accent); }
.rev.is-off { opacity: .34; }
.rev .n { position: absolute; bottom: 4px; right: 6px; font-size: 11px; color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,.7); font-variant-numeric: tabular-nums; }
.rev-actions {
  /* 它也是 .review-grid 的子元素，不跨列就会被塞进 84px 的格子里，
     按钮文字会被压成竖排 */
  grid-column: 1 / -1;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 2px;
}
.rev-actions button { min-height: 36px; padding: 6px 12px; font-size: 13px; white-space: nowrap; }
.rev-actions .hint { margin: 0; font-variant-numeric: tabular-nums; }

/* 导出 */
.formats { display: grid; gap: 10px; }
.fmt {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center;
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--paper-2);
}
.fmt .fl { font-weight: 650; font-size: 15px; }
.fmt .fd { color: var(--muted); font-size: 13px; grid-column: 1 / 2; }
.fmt button { grid-row: 1 / 3; grid-column: 2 / 3; min-width: 106px; }
.fmt.is-default { border-color: var(--accent); background: var(--surface); }
.fmt.is-busy { opacity: .7; }

/* ---------- 预览纸面 ---------- */
.paper {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 24px 32px; box-shadow: var(--shadow); min-height: 220px;
}
.pv-head { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
  margin: 0 0 16px; font-family: var(--sans); font-weight: 700; }
.empty { color: var(--muted); font-size: 14.5px; padding: 26px 0; text-align: center;
  border: 1px dashed var(--line-strong); border-radius: 12px; }
.pv { max-width: 68ch; font-size: 16.5px; line-height: 1.78; overflow-wrap: anywhere; }
.pv h1, .pv h2, .pv h3 { font-family: var(--serif); line-height: 1.25; margin: 1.5em 0 .5em; }
.pv h1 { font-size: 27px; } .pv h2 { font-size: 22px; } .pv h3 { font-size: 18.5px; }
.pv p { margin: 0 0 1em; }
.pv blockquote { margin: 1.1em 0; padding: 2px 0 2px 16px; border-left: 3px solid var(--accent);
  color: var(--muted); font-style: italic; }
.pv-fig { margin: 18px 0; }
.pv-fig img { max-width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); display: block; }
.pv-code { background: var(--paper-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px; overflow-x: auto; font-family: var(--mono); font-size: 13.5px; }
.pv-postmeta { font-size: 12.5px; font-weight: 700; color: var(--accent); letter-spacing: .02em;
  margin: 24px 0 6px; }
.pv-note { font-size: 13.5px; color: var(--muted); border-left: 2px solid var(--line-strong);
  padding-left: 12px; }
.pv-list { padding-left: 22px; }
.pv-missing { color: var(--muted); font-size: 13px; font-style: italic; }
.pv-hr { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }

/* ---------- 广告位 ---------- */
.ad { padding: 26px 0 6px; }
.ad-box {
  border: 1px dashed var(--line-strong); border-radius: 12px; min-height: 90px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  color: var(--muted); font-size: 12.5px; background: color-mix(in srgb, var(--paper-2) 60%, transparent);
}
.ad-tag { font-size: 10px; letter-spacing: .1em; border: 1px solid var(--line-strong);
  border-radius: 4px; padding: 1px 5px; }
.card .ad { padding: 16px 0 0; }

/* ---------- 说明区 ---------- */
.blocks { padding: 46px 0 30px; }
.block-grid { display: grid; gap: 26px; grid-template-columns: 1fr; }
.block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; }
.block h2 { font-family: var(--serif); font-size: 19px; margin: 0 0 14px; }
.steps { margin: 0; padding-left: 22px; } .steps li { margin-bottom: 8px; }
.ticks, .dots { list-style: none; margin: 0; padding: 0; }
.ticks li, .dots li { position: relative; padding-left: 26px; margin-bottom: 10px; font-size: 15px; }
.ticks li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 700; }
.dots li::before { content: "—"; position: absolute; left: 0; color: var(--accent); }
.faq { margin-top: 26px; }
.qa { border-top: 1px solid var(--line); padding: 12px 0; }
.qa summary { cursor: pointer; font-weight: 620; font-size: 15.5px; }
.qa p { color: var(--muted); margin: 8px 0 0; font-size: 14.5px; max-width: 72ch; }

/* ---------- 法律页 ---------- */
.legalwrap { padding: 34px 0 60px; }
.narrow { max-width: 760px; }
.crumb { margin: 0 0 18px; font-size: 14px; }
.notice { background: var(--paper-2); border: 1px dashed var(--line-strong); border-radius: 10px;
  padding: 12px 14px; color: var(--warn); font-size: 14px; }
.prose p { margin: 0 0 16px; font-size: 16.5px; line-height: 1.78; max-width: 72ch; }

/* ---------- 页脚 ---------- */
.foot { border-top: 1px solid var(--line); background: var(--paper-2); margin-top: 30px; padding: 34px 0 40px; }
.footgrid { display: grid; gap: 24px; grid-template-columns: 1fr; }
.fbrand { font-family: var(--serif); font-weight: 700; font-size: 18px; margin-bottom: 8px; }
.fnote { color: var(--muted); font-size: 13px; max-width: 52ch; margin: 0 0 6px; }
.fhead { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
  margin-bottom: 10px; font-weight: 700; }
.footgrid a { display: block; color: var(--muted); text-decoration: none; font-size: 14px;
  padding: 5px 0; min-height: 32px; }
.footgrid a:hover { color: var(--accent); }
.footbottom { display: flex; justify-content: space-between; align-items: center; gap: 16px;
  flex-wrap: wrap; margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 13px; }

/* ---------- 提示条 ---------- */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 22px; z-index: 40;
  background: var(--ink); color: var(--paper); padding: 11px 18px; border-radius: 999px;
  font-size: 14px; box-shadow: var(--shadow); opacity: 0; pointer-events: none;
  transition: opacity .22s ease;
}
.toast.on { opacity: 1; }

/* ---------- 热门内容：栏目页 ---------- */
.hero.slim { padding: 26px 0 20px; }
.sechead {
  font-family: var(--serif); font-size: 22px; margin: 34px 0 16px;
  padding-bottom: 10px; border-bottom: 1px solid var(--line);
}
.tgrid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(288px, 1fr)); }
.tcard {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 18px 16px; box-shadow: var(--shadow);
  text-decoration: none; color: var(--ink);
  transition: transform .16s ease, border-color .16s ease;
}
.tcard:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.tbadge {
  align-self: flex-start; font-size: 11px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border-radius: 999px; padding: 2px 9px;
}
.ttitle {
  font-family: var(--serif); font-size: 19px; line-height: 1.32; margin: 0;
  letter-spacing: -.005em; overflow-wrap: anywhere;
}
.tcard:hover .ttitle { color: var(--accent); }
.tintro { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.6; overflow-wrap: anywhere; }
.tmeta {
  margin: auto 0 0; padding-top: 10px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums;
}
.empty-note {
  grid-column: 1 / -1; margin: 0; padding: 30px 0; text-align: center;
  color: var(--muted); font-size: 14.5px;
  border: 1px dashed var(--line-strong); border-radius: 12px;
}
.scope-note { max-width: 76ch; margin-top: 10px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 26px 0 6px; flex-wrap: wrap; }
.pager-btn { text-decoration: none; font-size: 14.5px; padding: 9px 14px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); min-height: 40px;
  display: inline-flex; align-items: center; }
.pager-btn:hover { border-color: var(--muted); }
.pager-info { color: var(--muted); font-size: 13.5px; font-variant-numeric: tabular-nums; }

/* ---------- 热门内容：详情页 ---------- */
.prefilled { margin: 8px 0 0; font-size: 13px; color: var(--ok); font-weight: 600; }
.block.wide { grid-column: 1 / -1; }
.prose-p { margin: 0; font-size: 16.5px; line-height: 1.78; max-width: 78ch; }
h3.sub {
  font-family: var(--serif); font-size: 15px; margin: 20px 0 10px;
  color: var(--muted); font-weight: 700;
}
.dlist { margin: 0; display: grid; gap: 0; }
.drow {
  display: grid; grid-template-columns: 1fr; gap: 2px;
  padding: 10px 0; border-top: 1px solid var(--line);
}
.drow:first-child { border-top: 0; padding-top: 0; }
.drow dt { color: var(--muted); font-size: 12.5px; letter-spacing: .03em; text-transform: uppercase; }
.drow dd { margin: 0; font-size: 14.5px; overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px;
  font-size: 13px; color: var(--muted); background: var(--paper-2);
  font-variant-numeric: tabular-nums;
}
.chip b { color: var(--ink); font-weight: 700; }
.chipnote { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); }
.rellist { list-style: none; margin: 0; padding: 0; }
.rellist li {
  display: flex; gap: 12px; align-items: baseline; justify-content: space-between;
  padding: 11px 0; border-top: 1px solid var(--line); font-size: 15px;
}
.rellist li:first-child { border-top: 0; }
.rellist a { overflow-wrap: anywhere; }
.rmeta { color: var(--muted); font-size: 12.5px; flex: 0 0 auto; white-space: nowrap; }
.faq > p:last-child { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0 0; }

/* ---------- 响应式 ---------- */
@media (min-width: 780px) {
  .block-grid { grid-template-columns: repeat(3, 1fr); }
  .footgrid { grid-template-columns: 1.6fr 1fr 1fr; }
  .drow { grid-template-columns: minmax(96px, auto) 1fr; gap: 4px 16px; align-items: baseline; }
  .drow dt { text-transform: none; font-size: 13px; }
}
@media (min-width: 1000px) {
  .hero-inner { grid-template-columns: 1.05fr 1.25fr; align-items: center; gap: 40px; }
  .deck { grid-template-columns: minmax(340px, 400px) minmax(0, 1fr); }
  .col.left { position: sticky; top: 78px; }
  .paper { padding: 40px 46px 50px; }
}
@media (max-width: 999px) {
  .brand .btag { display: none; }
  .bar { gap: 10px; }
  /* 窄屏改成换行，不要横向滚动 —— 滚动的结果是最后一个词被切成半截，
     看起来像坏掉了，而且没人知道右边还有内容 */
  .nav {
    order: 3;
    flex-basis: 100%;
    margin: 0;
    padding-bottom: 2px;
    flex-wrap: wrap;
    overflow: visible;
    row-gap: 2px;
  }
  .bar { flex-wrap: wrap; padding-top: 8px; padding-bottom: 6px; }
  .topactions { margin-left: auto; }
}
@media (max-width: 520px) {
  .actions .primary { min-width: 0; width: 100%; order: -1; }
  .fmt { grid-template-columns: 1fr; }
  .fmt button { grid-row: 3; grid-column: 1; width: 100%; }
  .paper { padding: 20px 16px 24px; }
  .langs a { padding: 6px 7px; font-size: 12px; }
  /* 手机上把导航收起来（页脚里有一份），换行成三行会把顶栏撑得太高 */
  .nav { display: none; }
  .bar { min-height: 56px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media print {
  .topbar, .foot, .ad, .blocks, .hero-copy, .actions, .toast { display: none !important; }
  .deck { display: block; }
  .paper { border: 0; box-shadow: none; }
}
