/* 比特币正本 bitcoinarche.com — 视觉规范 v2.0 学术档案风
   纸 #f5f2ea / 墨 #1c1a16 / 次 #6b655a / 砖红 #b0202a / 点线 #b9b2a4
   全站衬线；无圆角、无阴影、无渐变；账簿式分隔 */

:root {
  --paper: #f5f2ea;
  --deep: #efe9db;
  --ink: #1c1a16;
  --muted: #6b655a;
  --crimson: #b0202a;
  --rule: #b9b2a4;
  --serif: "Noto Serif SC", "Songti SC", "STSong", Georgia, "Times New Roman", serif;
  --maxw: 700px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

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

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.8;
}

/* 极淡纸纹 */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.42 0 0 0 0 0.39 0 0 0 0 0.34 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}
body > * { position: relative; z-index: 1; }

h1, h2, h3, .serif { font-family: var(--serif); font-weight: 700; letter-spacing: 0.02em; }
h1 { font-size: 2rem; line-height: 1.4; margin: 0 0 0.6em; }
h2 { font-size: 1.35rem; line-height: 1.5; margin: 2em 0 0.7em; }
h3 { font-size: 1.1rem; margin: 1.6em 0 0.5em; }
p { margin: 0 0 1.1em; }

a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--crimson); }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--crimson);
  outline-offset: 3px;
}

/* 正文内链接：账簿式点线下划线 */
.wrap p a, .wrap li a, .wrap dd a, .guide-box a, .fact a, td a {
  border-bottom: 1px dotted var(--rule);
}
.wrap p a:hover, .wrap li a:hover, .wrap dd a:hover, .guide-box a:hover, .fact a:hover, td a:hover {
  border-bottom-color: var(--crimson);
}

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--crimson); color: var(--paper); padding: 0.6em 1em; z-index: 100;
}
.skip-link:focus { left: 0; }

/* —— 刊头 —— */
.site-header { border-bottom: 3px double var(--ink); background: var(--paper); }
.site-header .masthead {
  max-width: 1080px; margin: 0 auto; padding: 26px 32px 18px; text-align: center;
}
.masthead .meta-line {
  font-size: 12px; letter-spacing: 0.35em; text-indent: 0.35em;
  color: var(--muted); margin-bottom: 14px;
}
.brand { display: inline-block; }
.brand:hover { text-decoration: none; }
.brand img { height: 64px; width: auto; display: inline-block; }
.main-nav { margin-top: 16px; font-size: 15px; }
.main-nav ul { list-style: none; margin: 0; padding: 0; }
.main-nav li { display: inline; }
.main-nav a { margin: 0 14px; letter-spacing: 0.12em; }
.main-nav li + li a { border-left: 1px solid var(--rule); padding-left: 28px; margin-left: 0; }
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--crimson); }

/* —— 正文容器 —— */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 2.5rem 1.25rem 4rem; }
.wrap.wide { max-width: 1080px; padding-left: 32px; padding-right: 32px; }

.lede { font-size: 1.08rem; color: var(--muted); }
.meta { color: var(--muted); font-size: 0.88rem; }
.rule, hr.ledger { border: 0; border-top: 1px dotted var(--rule); margin: 2.2rem 0; }

/* —— 首页首屏：双线框 —— */
.hero {
  border: 5px double var(--ink);
  margin: 2.5rem 0; padding: 3.5rem 2.5rem; text-align: center;
  background: rgba(255, 255, 255, 0.28);
}
.hero h1 { font-size: 3.25rem; font-weight: 600; letter-spacing: 0.18em; text-indent: 0.18em; line-height: 1.4; margin-bottom: 0; }
.hero .en { font-size: 15px; letter-spacing: 0.5em; text-indent: 0.5em; color: var(--muted); margin-top: 10px; }
.hero .rule-crimson { width: 120px; border-top: 2px solid var(--crimson); margin: 22px auto; }
.hero .tagline { font-size: 1.25rem; letter-spacing: 0.06em; }
.hero .principle { font-size: 13px; letter-spacing: 0.22em; text-indent: 0.22em; color: var(--muted); margin: 14px 0 1.8em; }
.btn-row { display: flex; gap: 0.9rem; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-block; padding: 0.6em 1.5em;
  border: 1px solid var(--crimson);
  color: var(--crimson); font-size: 0.95rem; background: transparent;
  letter-spacing: 0.1em;
}
.btn:hover { background: var(--crimson); color: var(--paper); }
.btn.solid { background: var(--crimson); color: var(--paper); }
.btn.solid:hover { background: #7c1219; border-color: #7c1219; }

/* —— 区块标题 —— */
.sec-label {
  font-size: 13px; letter-spacing: 0.4em; text-indent: 0.4em;
  color: var(--crimson); text-align: center; margin-bottom: 8px;
}
.sec-title {
  font-size: 1.625rem; font-weight: 600; letter-spacing: 0.14em; text-indent: 0.14em;
  text-align: center; margin: 0 0 1.9rem;
}

/* —— 四大支柱 —— */
.pillars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin: 0 0 2.5rem; }
.pillar { padding: 6px 22px 0; border-left: 1px dotted var(--rule); }
.pillar:first-child { border-left: none; padding-left: 0; }
.pillar .topline { border-top: 2px solid var(--crimson); width: 44px; margin-bottom: 14px; }
.pillar .num { font-size: 14px; color: var(--crimson); letter-spacing: 0.2em; margin-bottom: 6px; }
.pillar h3 { font-size: 1.125rem; font-weight: 600; letter-spacing: 0.1em; margin: 0 0 10px; }
.pillar h3 a { color: var(--ink); }
.pillar h3 a:hover { color: var(--crimson); }
.pillar p { margin: 0; font-size: 0.875rem; color: var(--muted); line-height: 1.9; }

/* —— 档案目录式列表（账簿式） —— */
.archive { list-style: none; margin: 0; padding: 0; }
.archive li { padding: 1.05rem 0.25rem; border-bottom: 1px dotted var(--rule); }
.archive li:first-child { border-top: 1px dotted var(--rule); }
.archive .t { font-size: 1.05rem; font-weight: 600; letter-spacing: 0.03em; }
.archive .t a { color: var(--ink); }
.archive .t a:hover { color: var(--crimson); }
.archive .m { font-size: 0.85rem; color: var(--muted); margin: 0.25em 0 0.35em; letter-spacing: 0.06em; }
.archive .d { font-size: 0.95rem; color: var(--ink); margin: 0 0 0.3em; }
.archive .s { font-size: 0.85rem; color: var(--muted); }
.archive .s a { color: var(--muted); }
.badge {
  display: inline-block; font-size: 0.75rem; color: var(--crimson);
  border: 1px solid var(--crimson);
  padding: 0.1em 0.55em; margin-right: 0.5em; vertical-align: 0.1em;
  letter-spacing: 0.1em; white-space: nowrap;
}
.badge.warn { color: #8A6D1B; border-color: #C9A227; }
.badge.closed { color: #7A7A72; border-color: #C4C4B8; }
.badge.done { color: #2F6B4F; border-color: #9DBFAE; }

/* —— 名言 —— */
.quote { margin: 0 0 1.6em; padding-left: 1.1em; border-left: 2px solid var(--crimson); }
.quote blockquote { margin: 0 0 0.4em; font-size: 1.02rem; }
.quote .qsrc { font-size: 0.85rem; color: var(--muted); }

/* —— 表格 —— */
table.data { width: 100%; border-collapse: collapse; font-size: 0.93rem; margin: 1.2em 0; }
table.data th, table.data td {
  text-align: left; padding: 0.55em 0.7em;
  border-bottom: 1px dotted var(--rule); vertical-align: top;
}
table.data th {
  font-family: var(--serif);
  color: var(--ink); border-bottom: 2px solid var(--ink);
  white-space: nowrap; font-weight: 700;
}
table.data td.muted { color: var(--muted); }

/* BIP 索引表：墨底白字表头 */
table.bip-table thead th {
  background: var(--ink); color: var(--paper);
  border-bottom: none; font-weight: 600; letter-spacing: 0.2em; text-indent: 0.1em;
}
table.bip-table td.num, table.bip-table th:first-child { white-space: nowrap; }
table.bip-table td { vertical-align: middle; }
table.bip-table td.status .badge { display: inline-block; white-space: nowrap; padding: 0.1em 0.7em; }
table.bip-table td.status .date {
  display: block; color: var(--muted);
  font-size: 0.82em; margin-top: 0.3em; white-space: nowrap;
}
table.bip-table .zh { font-size: 0.88em; color: var(--muted); }

/* —— 白皮书全文 —— */
.paper { margin: 1rem 0 0; }
.paper-title { font-size: 1.45rem; text-align: center; margin: 1.2em 0 0.4em; }
.paper-author { text-align: center; color: var(--muted); font-size: 0.92rem; margin: 0 0 2em; }
.paper h3 { margin-top: 2.2em; }
.paper figure { margin: 1.8em 0; text-align: center; }
.paper figure img {
  max-width: 100%; height: auto; background: #fff;
  padding: 0.6em; border: 1px solid var(--rule);
}
.paper figcaption { color: var(--muted); font-size: 0.85rem; margin-top: 0.6em; }
.formula { margin: 1.1em 0 1.1em 1.2em; font-size: 1.02rem; }
.formula.pieces { display: flex; align-items: center; gap: 0.45em; }
.formula.pieces .br { font-size: 2.1em; line-height: 1.05; }
pre.code {
  background: var(--deep); border: 1px solid var(--rule);
  padding: 1em 1.2em; overflow-x: auto; font-size: 0.83rem; line-height: 1.6;
}
ol.refs li { margin-bottom: 0.5em; font-size: 0.92rem; }
ol.steps li { margin-bottom: 0.4em; }

/* —— 状态说明 —— */
.status-defs { margin: 1.2em 0 2em; }
.status-defs dt { margin: 1em 0 0.25em; }
.status-defs dd { margin: 0 0 0.6em; }

/* —— 导读框：矩形细线框 + 砖红标题线 —— */
.guide-box {
  border: 1px solid var(--ink);
  background: rgba(255, 255, 255, 0.28);
  padding: 1.3rem 1.5rem 1rem;
  margin: 1.4em 0 2.4em;
  font-size: 0.92rem;
}
.guide-box .guide-lede { font-size: 1rem; margin-bottom: 1em; }
.guide-box h3 { font-size: 1rem; margin: 1.3em 0 0.5em; border-top: 2px solid var(--crimson); padding-top: 0.6em; }
.guide-box h3:first-of-type { margin-top: 0.4em; }
.guide-box p:last-child { margin-bottom: 0.5em; }

/* —— 固定提示 —— */
.notice {
  border: 1px solid var(--rule); background: rgba(255, 255, 255, 0.28);
  padding: 0.9rem 1.2rem; font-size: 0.9rem; color: var(--muted);
  margin: 2.5rem 0 0;
}
.notice strong { color: var(--ink); font-weight: 600; }

/* —— 页脚（原版样式） —— */
.site-footer { border-top: 1px solid var(--rule); margin-top: 3rem; }
.site-footer .inner {
  max-width: 980px; margin: 0 auto; padding: 2rem 1.25rem;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem 2rem;
  font-size: 0.88rem; color: var(--muted);
}
.site-footer .brand-line { color: var(--ink); margin-bottom: 0.4em; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.1rem; flex-wrap: wrap; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--crimson); }

/* —— 正文内引用与注释 —— */
blockquote.pull {
  margin: 1.4em 0; padding: 0.2em 0 0.2em 1.1em;
  border-left: 2px solid var(--crimson); color: var(--ink);
}
.fact { background: rgba(255, 255, 255, 0.28); border: 1px solid var(--rule); padding: 1rem 1.2rem; margin: 1.4em 0; }
.fact .k { font-size: 0.82rem; color: var(--muted); letter-spacing: 0.12em; margin-bottom: 0.4em; }
.fact-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.fact-table th, .fact-table td { text-align: left; padding: 0.35em 0.6em 0.35em 0; vertical-align: top; border: none; }
.fact-table th { color: var(--muted); font-weight: 400; white-space: nowrap; width: 6em; }
.crumb { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.4em; }
.crumb a { color: var(--muted); }
.view-label { font-size: 0.82rem; color: var(--muted); letter-spacing: 0.12em; }

ul.tight li, ol.tight li { margin-bottom: 0.5em; }

@media (max-width: 760px) {
  .pillars { grid-template-columns: 1fr 1fr; }
  .pillar { border-left: none; padding-left: 0; margin-bottom: 20px; }
  .hero { padding: 2.6rem 1.5rem 2rem; }
  .hero h1 { font-size: 2rem; }
  .main-nav a { margin: 0 8px; }
  .main-nav li + li a { padding-left: 16px; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .pillars { grid-template-columns: 1fr; }
  .wrap { padding-top: 1.8rem; }
  .wrap.wide { padding-left: 1.25rem; padding-right: 1.25rem; }
  table.data { font-size: 0.85rem; display: block; overflow-x: auto; }
}

/* ---- Hugo shortcode 兼容 ---- */
.guide-box > p:first-of-type { font-size: 1rem; }
.notice p { margin: 0; }
.archive .d p, .archive .m p, .archive .s p { margin: 0; }
.fact ul { margin: 0; padding-left: 1.2em; }
.fact li { margin-bottom: 0.5em; }
.fact table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.fact table th, .fact table td { text-align: left; padding: 0.35em 0.6em 0.35em 0; vertical-align: top; }
.fact table th { color: var(--muted); font-weight: 400; white-space: nowrap; }

/* —— 白皮书双语 —— */
.lang-nav { text-align: center; font-size: 0.9rem; color: var(--muted); margin: 0 0 1.6rem; }
.lang-nav a { color: var(--crimson); }
.paper .translator { color: var(--muted); font-size: 0.9rem; margin-bottom: 1.4rem; }

/* —— 邮件归档（矩形信封框） —— */
.mail-box { border: 1px solid var(--ink); margin: 0 0 2.2rem; }
.mail-head { border-bottom: 1px solid var(--ink); padding: 0.85rem 1.2rem; background: rgba(255, 255, 255, 0.28); }
.mail-head .row { display: flex; gap: 1rem; padding: 0.18rem 0; font-size: 0.92rem; }
.mail-head .k { width: 4.2em; flex-shrink: 0; color: var(--muted); }
.mail-head .v { color: var(--ink); }
.mail-head a { color: var(--crimson); }
.mail-body { padding: 1.2rem 1.4rem; }
.mail-body p { margin-bottom: 0.9em; }
.mail-body blockquote { margin: 0.8em 0; padding: 0.2em 0 0.2em 1.1em; border-left: 2px solid var(--rule); color: var(--muted); }
.mail-body details { margin-top: 1rem; }
.mail-body details summary { cursor: pointer; color: var(--muted); font-size: 0.9rem; }
.mail-body details summary:hover { color: var(--crimson); }

/* —— 邮件总表 —— */
.table-frame { border: 1px solid var(--ink); padding: 0.3rem 1.2rem; overflow-x: auto; }
.table-frame table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.table-frame th, .table-frame td { text-align: left; padding: 0.5em 0.9em 0.5em 0; border-bottom: 1px dotted var(--rule); vertical-align: top; }
.table-frame thead th { color: var(--muted); font-weight: 400; white-space: nowrap; border-bottom: 1px solid var(--ink); }
.table-frame tbody td:first-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.table-frame tbody td:nth-child(3) { color: var(--muted); white-space: nowrap; }
.table-frame tbody tr:last-child td { border-bottom: none; }
.table-frame a:hover { color: var(--crimson); }
/* —— 单封邮件上下导航 —— */
.mail-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2.5rem; border-top: 1px dotted var(--rule); padding-top: 1.1rem; font-size: 0.9rem; }
.mail-nav .prev { margin-right: auto; }
.mail-nav .next { margin-left: auto; text-align: right; }
.mail-nav a { color: var(--ink); }
.mail-nav a:hover { color: var(--crimson); }
