/* ============================================================
   巨天工作室 · 编辑排版样式
   纸感底 / 细线分隔 / 衬线标题 / 强网格
   ============================================================ */

:root {
  --wrap: 1120px;

  --paper: #f7f4ee;
  --paper-2: #efebe1;
  --paper-3: #fbf9f4;
  --ink: #26221c;
  --ink-2: #57503f;
  --ink-3: #857c69;
  --rule: #d3ccbc;
  --rule-2: #e3ddd0;
  --accent: #a8452c;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Songti SC", "Noto Serif SC", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

[data-theme="dark"] {
  --paper: #1b1916;
  --paper-2: #232019;
  --paper-3: #201d18;
  --ink: #ddd6c7;
  --ink-2: #a49c8c;
  --ink-3: #7a7365;
  --rule: #3d382f;
  --rule-2: #2e2a24;
  --accent: #cf9070;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.82;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 650; line-height: 1.24; letter-spacing: -.01em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
table { border-collapse: collapse; width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: var(--accent); color: var(--paper); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 26px; }
.label { font-family: var(--mono); font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-3); }

/* ============================ 页眉 ============================ */
.head { position: sticky; top: 0; z-index: 100; background: var(--paper); border-bottom: 1px solid var(--rule); }
.head-inner { display: flex; align-items: center; gap: 24px; height: 62px; }
.brand { display: flex; align-items: baseline; gap: 10px; flex: none; }
.brand b { font-family: var(--serif); font-size: 19px; font-weight: 700; letter-spacing: .02em; }
.brand span { font-family: var(--mono); font-size: 10px; letter-spacing: .2em; color: var(--ink-3); }

.nav { display: flex; gap: 20px; margin-left: auto; }
.nav a { font-size: 13.5px; color: var(--ink-2); padding: 4px 0; border-bottom: 1px solid transparent; }
.nav a:hover { color: var(--ink); border-bottom-color: var(--accent); }
.nav a.on { color: var(--ink); border-bottom-color: var(--accent); }

.head-tools { display: flex; align-items: center; gap: 10px; flex: none; }
.tools-link { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; color: var(--ink-2); border: 1px solid var(--rule); padding: 6px 10px; }
.tools-link:hover { border-color: var(--ink); color: var(--ink); }
.theme-btn { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--rule); color: var(--ink-2); }
.theme-btn:hover { border-color: var(--ink); color: var(--ink); }
.theme-btn svg:last-child { display: none; }
[data-theme="dark"] .theme-btn svg:first-child { display: none; }
[data-theme="dark"] .theme-btn svg:last-child { display: block; }

.burger { display: none; width: 32px; height: 32px; border: 1px solid var(--rule); place-items: center; }
.burger i { display: block; width: 14px; height: 1px; background: var(--ink); position: relative; }
.burger i::before, .burger i::after { content: ""; position: absolute; left: 0; width: 14px; height: 1px; background: var(--ink); }
.burger i::before { top: -4px; }
.burger i::after { top: 4px; }

/* ============================ HERO ============================ */
.hero { padding: 64px 0 0; }
.hero-meta { display: flex; gap: 30px; flex-wrap: wrap; padding-bottom: 20px; }
.hero-meta div { display: flex; flex-direction: column; gap: 2px; }
.hero-meta dt { font-family: var(--mono); font-size: 10px; letter-spacing: .18em; color: var(--ink-3); text-transform: uppercase; }
.hero-meta dd { margin: 0; font-size: 13.5px; color: var(--ink); }

.hero-title {
  font-family: var(--serif); font-weight: 700; font-size: clamp(44px, 8.6vw, 100px);
  line-height: .98; letter-spacing: -.025em; padding: 26px 0 28px; border-top: 1px solid var(--rule);
}
.hero-title small {
  display: block; font-family: var(--mono); font-size: 11px; font-weight: 400;
  letter-spacing: .3em; color: var(--ink-3); margin-top: 18px; text-transform: uppercase;
}

.hero-body { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; padding-bottom: 40px; }
.hero-lede { font-size: 16.5px; color: var(--ink-2); max-width: 62ch; }
.hero-lede + .hero-lede { margin-top: 14px; }
.hero-aside { border-left: 1px solid var(--rule); padding-left: 24px; }
.hero-aside p { font-size: 13.5px; color: var(--ink-2); }
.hero-aside .label { display: block; margin-bottom: 8px; }

.toc { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 18px 0; }
.toc-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 4px 28px; }
.toc-list a { display: flex; gap: 12px; font-size: 13.5px; color: var(--ink-2); padding: 3px 0; }
.toc-list a:hover { color: var(--accent); }
.toc-list i { font-style: normal; font-family: var(--mono); font-size: 11px; color: var(--ink-3); }

/* ============================ SECTION ============================ */
.section { padding: 54px 0 0; }
.sec-head { display: grid; grid-template-columns: 240px 1fr; gap: 32px; border-top: 1px solid var(--ink); padding-top: 16px; margin-bottom: 28px; }
.sec-head h2 { font-family: var(--serif); font-size: 30px; letter-spacing: -.015em; }
.sec-head .sec-note { font-size: 13.5px; color: var(--ink-2); }
.sec-num { font-family: var(--mono); font-size: 11px; letter-spacing: .2em; color: var(--accent); display: block; margin-bottom: 8px; }

.pull {
  font-family: var(--serif); font-size: clamp(20px, 2.8vw, 28px); line-height: 1.44;
  padding: 32px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); letter-spacing: -.01em;
}
.pull cite { display: block; font-style: normal; font-family: var(--mono); font-size: 11px; letter-spacing: .18em; color: var(--ink-3); margin-top: 14px; }

/* ============================ 条目 ============================ */
.entry { display: grid; grid-template-columns: 240px 1fr; gap: 32px; border-top: 1px solid var(--rule); padding: 32px 0; }
.entry:last-child { border-bottom: 1px solid var(--rule); }
.entry-side { position: sticky; top: 92px; align-self: start; }
.entry-name { font-family: var(--serif); font-size: 22px; font-weight: 700; margin: 10px 0 12px; }
.entry-state { display: inline-block; font-family: var(--mono); font-size: 10px; letter-spacing: .14em; padding: 3px 8px; border: 1px solid var(--accent); color: var(--accent); }
.entry-state.soon { border-color: var(--ink-3); color: var(--ink-3); }
.entry-spec { margin-top: 16px; }
.entry-spec div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dotted var(--rule); font-size: 12.5px; }
.entry-spec dt { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; color: var(--ink-3); text-transform: uppercase; }
.entry-spec dd { margin: 0; color: var(--ink); text-align: right; }

.entry-body p { font-size: 15px; color: var(--ink-2); max-width: 68ch; }
.entry-body p + p { margin-top: 12px; }
.entry-sub { font-family: var(--serif); font-size: 17px; color: var(--ink); margin: 0 0 12px; }
.points { margin: 16px 0 0; border-top: 1px solid var(--rule-2); }
.points li { display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--rule-2); font-size: 14px; color: var(--ink-2); }
.points li i { font-style: normal; font-family: var(--mono); font-size: 11px; color: var(--accent); }
.entry-links { display: flex; gap: 18px; margin-top: 18px; flex-wrap: wrap; }
.tlink { font-size: 13.5px; color: var(--ink); border-bottom: 1px solid var(--accent); padding-bottom: 2px; display: inline-flex; gap: 7px; align-items: center; }
.tlink:hover { color: var(--accent); }

/* ============================ 表格 ============================ */
.tbl-wrap { overflow-x: auto; }
table.tbl { font-size: 13.5px; min-width: 560px; }
table.tbl th {
  text-align: left; font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-3); font-weight: 400;
  padding: 10px 16px 10px 0; border-bottom: 1px solid var(--ink);
}
table.tbl td { padding: 12px 16px 12px 0; border-bottom: 1px solid var(--rule-2); color: var(--ink-2); vertical-align: top; }
table.tbl td:first-child { color: var(--ink); }
table.tbl tr:hover td { background: var(--paper-3); }
td .tag { font-family: var(--mono); font-size: 11px; padding: 2px 7px; border: 1px solid var(--rule); color: var(--ink-3); }

/* ============================ 编号列表 ============================ */
.numlist { border-top: 1px solid var(--rule); }
.numlist li { display: grid; grid-template-columns: 44px 240px 1fr; gap: 24px; padding: 20px 0; border-bottom: 1px solid var(--rule-2); }
.numlist .n { font-family: var(--mono); font-size: 11px; color: var(--accent); letter-spacing: .1em; padding-top: 3px; }
.numlist h3 { font-family: var(--serif); font-size: 18px; }
.numlist p { font-size: 14px; color: var(--ink-2); }

/* ============================ 时间线 ============================ */
.log { border-top: 1px solid var(--rule); }
.log li { display: grid; grid-template-columns: 110px 1fr; gap: 24px; padding: 16px 0; border-bottom: 1px solid var(--rule-2); }
.log time { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); letter-spacing: .06em; padding-top: 3px; }
.log h3 { font-size: 15px; margin-bottom: 4px; font-weight: 600; }
.log p { font-size: 13.5px; color: var(--ink-2); }

/* ============================ FAQ ============================ */
.faq { border-top: 1px solid var(--rule); }
.faq details { border-bottom: 1px solid var(--rule-2); }
.faq summary { list-style: none; cursor: pointer; display: flex; gap: 14px; align-items: baseline; padding: 16px 0; font-size: 15px; font-weight: 550; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "+"; font-family: var(--mono); color: var(--accent); font-size: 15px; }
.faq details[open] summary::before { content: "–"; }
.faq .a { padding: 0 0 18px 28px; font-size: 14px; color: var(--ink-2); max-width: 72ch; }
.faq .a p + p { margin-top: 10px; }

/* ============================ 联系 ============================ */
.contact-grid { display: grid; grid-template-columns: 240px 1fr; gap: 32px; border-top: 1px solid var(--ink); padding-top: 18px; }
.contact-grid p { max-width: 62ch; color: var(--ink-2); font-size: 15px; }
.contact-grid p + p { margin-top: 12px; }
.contact-rows { margin-top: 20px; border-top: 1px solid var(--rule-2); }
.contact-rows div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--rule-2); font-size: 14px; }
.contact-rows dt { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; color: var(--ink-3); text-transform: uppercase; }
.contact-rows dd { margin: 0; text-align: right; }
.contact-rows a { border-bottom: 1px solid var(--accent); }
.contact-rows a:hover { color: var(--accent); }

/* ============================ 页脚 ============================ */
.foot { margin-top: 68px; border-top: 1px solid var(--ink); padding: 26px 0 56px; }
.foot-top { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 32px; padding-bottom: 26px; }
.foot h5 { font-family: var(--mono); font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-3); font-weight: 400; margin-bottom: 10px; }
.foot li { font-size: 13.5px; padding: 3px 0; }
.foot li a:hover { color: var(--accent); }
.foot-brand { font-family: var(--serif); font-size: 20px; font-weight: 700; }
.foot-brand span { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: .2em; color: var(--ink-3); margin-top: 4px; font-weight: 400; }
.foot-note { border-top: 1px solid var(--rule-2); padding-top: 16px; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; font-family: var(--mono); font-size: 11px; letter-spacing: .06em; color: var(--ink-3); }

/* ============================ 截图 ============================ */
.figure { margin: 0; border: 1px solid var(--rule); background: var(--paper-3); }
.figure img { width: 100%; }
.figure figcaption { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; color: var(--ink-3); padding: 10px 14px; border-top: 1px solid var(--rule-2); }

/* ============================ 响应式 ============================ */
@media (max-width: 900px) {
  .hero-body, .entry, .sec-head, .contact-grid { grid-template-columns: 1fr; gap: 18px; }
  .hero-aside { border-left: 0; padding-left: 0; border-top: 1px solid var(--rule); padding-top: 16px; }
  .entry-side { position: static; }
  .numlist li { grid-template-columns: 34px 1fr; }
  .numlist h3, .numlist p { grid-column: 2; }
  .foot-top { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .nav {
    position: absolute; top: 62px; left: 0; right: 0; flex-direction: column; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--rule); padding: 8px 26px 16px; display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 10px 0; border-bottom: 1px solid var(--rule-2); font-size: 15px; }
  .burger { display: grid; }
  .tools-link { display: none; }
  .hero { padding-top: 42px; }
  .section { padding-top: 42px; }
  .sec-head h2 { font-size: 25px; }
  .foot-top { grid-template-columns: 1fr; }
  .wrap { padding: 0 20px; }
}

@media print { .head { display: none; } body { background: #fff; } }

/* ============================ 亲民微调 ============================ */
.figure { border-radius: 3px; }
.think-bar, .think-bar button:first-child { border-radius: 3px; }
.think-desc { border-radius: 0 3px 3px 0; }
.hero-meta dd { font-size: 14px; }
.nav a { font-size: 14px; }
.foot-note { line-height: 1.9; }
.to-top {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 14px;
  font-size: 13px; color: var(--ink-2); border-bottom: 1px solid var(--rule);
}
.to-top:hover { color: var(--accent); border-bottom-color: var(--accent); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ============================ 可访问性与细节 ============================ */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.burger.open { border-color: var(--ink); }
.burger.open i { background: transparent; }
.burger.open i::before { top: 0; transform: rotate(45deg); }
.burger.open i::after { top: 0; transform: rotate(-45deg); }
.entry-side > .label { display: block; margin-bottom: 10px; }
.entry-side > .entry-state { margin-bottom: 2px; }
.entry-name { margin-top: 12px !important; }
.figure img { height: auto; }
.tbl-hint { display: none; font-family: var(--mono); font-size: 11px; letter-spacing: .1em; color: var(--ink-3); padding: 8px 0 0; }
@media (max-width: 720px) { .tbl-hint { display: block; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ============================ 风格切换 ============================ */
.mode-switch { display: flex; border: 1px solid var(--rule); }
.mode-switch button {
  padding: 7px 11px; font-family: var(--mono); font-size: 11px; letter-spacing: .08em;
  color: var(--ink-2); border-right: 1px solid var(--rule); white-space: nowrap;
}
.mode-switch button:last-child { border-right: 0; }
.mode-switch button:hover { color: var(--ink); background: var(--paper-2); }
.mode-switch button.on { background: var(--ink); color: var(--paper); }

html[data-mode="neko"] { --accent: #c0658f; }
html[data-mode="neko"][data-theme="dark"] { --accent: #d79fb9; }
html[data-mode="neko"] body {
  font-family: "Yuanti SC", "Hiragino Maru Gothic ProN", "PingFang SC", "Microsoft YaHei", sans-serif;
}
html[data-mode="neko"] .figure,
html[data-mode="neko"] .think-bar { border-radius: 12px; }
html[data-mode="neko"] .think-desc { border-radius: 0 12px 12px 0; }
html[data-mode="neko"] .hero-title { letter-spacing: 0; }

html[data-mode="funny"] { --accent: #a8701f; }
html[data-mode="funny"][data-theme="dark"] { --accent: #d3a962; }
html[data-mode="funny"] .hero-title { transform: rotate(-1.1deg); }
html[data-mode="funny"] .sec-num { letter-spacing: .3em; }

@media (max-width: 720px) {
  .mode-switch button { padding: 6px 8px; font-size: 10px; letter-spacing: .04em; }
}

/* 中等宽度下导航收进菜单，避免和风格切换按钮挤在一起 */
@media (max-width: 1000px) {
  .nav {
    position: absolute; top: 62px; left: 0; right: 0; flex-direction: column; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--rule);
    padding: 8px 26px 16px; display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 11px 0; border-bottom: 1px solid var(--rule-2); font-size: 15px; }
  .nav a.active::after { display: none; }
  .burger { display: grid; }
  .head-inner { gap: 14px; }
  .brand span { display: none; }
}

/* ============================ 风格选择控件 ============================ */
.mode-select {
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em;
  color: var(--ink-2); background: transparent; border: 1px solid var(--rule);
  padding: 6px 8px; border-radius: 0; cursor: pointer;
}
.mode-select:hover { color: var(--ink); border-color: var(--ink); }

/* 自带完整色板的风格隐藏深浅切换，避免点了没反应 */
html[data-mode="terminal"] .theme-btn, html[data-mode="paper"] .theme-btn,
html[data-mode="blueprint"] .theme-btn, html[data-mode="note"] .theme-btn,
html[data-mode="pixel"] .theme-btn { display: none; }

/* ============================ 终端 ============================ */
html[data-mode="terminal"] {
  --paper: #0a0e0b; --paper-2: #101711; --paper-3: #0d130d;
  --ink: #b6f7c1; --ink-2: #7fbb8c; --ink-3: #5d8a67;
  --rule: #223d28; --rule-2: #182b1d; --accent: #5cff8f;
}
html[data-mode="terminal"] body { font-family: var(--mono); font-size: 15px; }
html[data-mode="terminal"] body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.035) 0 1px, transparent 1px 3px);
}
html[data-mode="terminal"] .hero-title { font-family: var(--mono); letter-spacing: 0; font-size: clamp(26px, 5.6vw, 58px); }
html[data-mode="terminal"] .hero-title small { letter-spacing: .14em; }
html[data-mode="terminal"] .sec-head h2::before { content: "$ "; color: var(--accent); font-family: var(--mono); }
html[data-mode="terminal"] .label::before { content: "> "; }
html[data-mode="terminal"] .tlink::before { content: "[ "; color: var(--ink-3); }
html[data-mode="terminal"] .tlink::after { content: " ]"; color: var(--ink-3); }
html[data-mode="terminal"] .tlink { border-bottom: 0; }
html[data-mode="terminal"] .entry-state { border-style: dashed; }

/* ============================ 报纸 ============================ */
html[data-mode="paper"] {
  --paper: #f7f4ea; --paper-2: #efece0; --paper-3: #fbf9f2;
  --ink: #121110; --ink-2: #3a3733; --ink-3: #6b6760;
  --rule: #1a1917; --rule-2: #c8c4b6; --accent: #8c1c13;
}
html[data-mode="paper"] body { font-family: var(--serif); }
html[data-mode="paper"] .hero-title { font-family: "Times New Roman", Times, var(--serif); }
html[data-mode="paper"] .sec-head { border-top: 3px double var(--ink); }
html[data-mode="paper"] .entry { border-top: 1px solid var(--ink); }
html[data-mode="paper"] .entry-body > p:first-of-type::first-letter {
  float: left; font-size: 3.1em; line-height: .86; padding: 6px 8px 0 0; font-weight: 700;
}
@media (min-width: 980px) {
  html[data-mode="paper"] .entry-body > p { column-count: 2; column-gap: 30px; }
}
html[data-mode="paper"] .label { font-family: var(--serif); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; }
html[data-mode="paper"] .pull { border-top: 3px double var(--ink); border-bottom: 3px double var(--ink); }
html[data-mode="paper"] .foot { border-top: 3px double var(--ink); }

/* ============================ 蓝图 ============================ */
html[data-mode="blueprint"] {
  --paper: #0e2c46; --paper-2: #123a58; --paper-3: #11334f;
  --ink: #dcebf7; --ink-2: #a9c7de; --ink-3: #7fa3c0;
  --rule: rgba(255,255,255,.30); --rule-2: rgba(255,255,255,.15); --accent: #ffd479;
}
html[data-mode="blueprint"] body { font-family: var(--mono); }
html[data-mode="blueprint"] body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 80px 80px, 80px 80px, 16px 16px, 16px 16px;
}
html[data-mode="blueprint"] .hero-title { font-family: var(--mono); letter-spacing: .02em; }
html[data-mode="blueprint"] .sec-num { border: 1px solid var(--rule); padding: 3px 7px; display: inline-block; }
html[data-mode="blueprint"] .entry { border: 1px solid var(--rule); padding: 24px; margin-bottom: 14px; }
html[data-mode="blueprint"] .entry:last-child { border-bottom: 1px solid var(--rule); }
html[data-mode="blueprint"] .pull { border: 1px dashed var(--rule); padding: 24px; }
html[data-mode="blueprint"] table.tbl th, html[data-mode="blueprint"] table.tbl td { border-color: var(--rule); }
html[data-mode="blueprint"] .figure { border: 1px solid var(--rule); background: transparent; }

/* ============================ 手账 ============================ */
html[data-mode="note"] {
  --paper: #fffdf4; --paper-2: #fdf7e6; --paper-3: #fffefa;
  --ink: #2e2a21; --ink-2: #57503f; --ink-3: #8a806e;
  --rule: #e2d8bc; --rule-2: #efe8d2; --accent: #c85a3c;
}
html[data-mode="note"] body { font-family: "Kaiti SC", STKaiti, KaiTi, "PingFang SC", var(--sans); }
html[data-mode="note"] body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: radial-gradient(rgba(0,0,0,.075) 1px, transparent 1px);
  background-size: 22px 22px;
}
html[data-mode="note"] .label {
  background: #ffe6a3; color: #6b4a12; border: 1px solid #f0cf7a;
  padding: 3px 9px; display: inline-block; transform: rotate(-1.5deg); border-radius: 2px;
}
html[data-mode="note"] .entry-state { transform: rotate(1.2deg); }
html[data-mode="note"] .hero-title { font-family: "Kaiti SC", STKaiti, var(--serif); }
html[data-mode="note"] .sec-head { border-top: 2px solid var(--accent); }
html[data-mode="note"] .pull { border: 0; padding: 18px 0; background: linear-gradient(transparent 62%, #ffe08a 62%); }
html[data-mode="note"] .figure { border: 2px solid var(--rule); box-shadow: 3px 3px 0 var(--rule-2); }
html[data-mode="note"] .foot { border-top: 2px solid var(--accent); }

/* ============================ 像素 ============================ */
html[data-mode="pixel"] {
  --paper: #1b1b2e; --paper-2: #252540; --paper-3: #20203a;
  --ink: #f4f4f4; --ink-2: #bcbcd4; --ink-3: #8d8daa;
  --rule: #46466e; --rule-2: #32324f; --accent: #ffd23f;
}
html[data-mode="pixel"] body { font-family: var(--mono); letter-spacing: .03em; }
html[data-mode="pixel"] .hero-title {
  font-family: var(--mono); text-transform: uppercase; letter-spacing: 0;
  text-shadow: 4px 4px 0 var(--rule-2);
}
html[data-mode="pixel"] .sec-head { border-top: 4px solid var(--accent); }
html[data-mode="pixel"] .sec-num { background: var(--accent); color: #1b1b2e; padding: 3px 8px; display: inline-block; }
html[data-mode="pixel"] .entry, html[data-mode="pixel"] .figure,
html[data-mode="pixel"] .think-bar, html[data-mode="pixel"] .contact-box,
html[data-mode="pixel"] .pull {
  border: 3px solid var(--rule); background: var(--paper-2); box-shadow: 6px 6px 0 var(--rule-2);
}
html[data-mode="pixel"] .contact-box, html[data-mode="pixel"] .pull { padding: 24px; }
html[data-mode="pixel"] .label { letter-spacing: .22em; }
html[data-mode="pixel"] .tlink { border-bottom-width: 3px; }
html[data-mode="pixel"] table.tbl th { background: var(--rule-2); }
html[data-mode="pixel"] .foot { border-top: 4px solid var(--accent); }

/* ============================ 风格专属装饰 ============================ */
.mode-deco { display: none; }

@keyframes blink { 50% { opacity: 0; } }
@keyframes wiggle { 0%,100% { transform: rotate(-1.2deg); } 50% { transform: rotate(1.2deg); } }

/* ---------- 猫娘：猫耳 + 爱心 ---------- */
html[data-mode="neko"] .mode-deco {
  display: block; position: fixed; top: 64px; right: 22px; z-index: 95;
  width: 90px; height: 42px; pointer-events: none;
}
html[data-mode="neko"] .mode-deco::before,
html[data-mode="neko"] .mode-deco::after {
  content: ""; position: absolute; top: 0; width: 40px; height: 40px;
  background: var(--accent); clip-path: polygon(50% 0, 100% 100%, 0 100%); opacity: .9;
}
html[data-mode="neko"] .mode-deco::before { left: 0; transform: rotate(-15deg); }
html[data-mode="neko"] .mode-deco::after { left: 42px; transform: rotate(15deg); }
html[data-mode="neko"] .sec-head h2::before { content: "♡ "; color: var(--accent); }
html[data-mode="neko"] .hero-title { letter-spacing: .02em; }
html[data-mode="neko"] body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    radial-gradient(circle at 12px 12px, rgba(192,101,143,.16) 3px, transparent 4px),
    radial-gradient(circle at 6px 20px, rgba(192,101,143,.12) 2px, transparent 3px),
    radial-gradient(circle at 18px 20px, rgba(192,101,143,.12) 2px, transparent 3px);
  background-size: 96px 96px;
}
html[data-mode="neko"] .entry-state { border-radius: 10px; }

/* ---------- 搞笑：歪斜便签 + 施工斜纹 + 涂改线 ---------- */
html[data-mode="funny"] .mode-deco {
  display: block; max-width: 300px; margin: 26px auto 0; padding: 13px 18px;
  background: #ffe680; color: #4a3c10; font-family: var(--mono); font-size: 12px; letter-spacing: .06em;
  border: 1px solid #e8cf6a; transform: rotate(-2.4deg);
  box-shadow: 3px 4px 0 rgba(0,0,0,.10);
}
html[data-mode="funny"] .mode-deco::after { content: "注意：本页被人改过，别全信"; }
html[data-mode="funny"] body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: repeating-linear-gradient(45deg, rgba(0,0,0,.035) 0 14px, transparent 14px 28px);
}
html[data-mode="funny"] .sec-head h2 { display: inline-block; }
html[data-mode="funny"] .sec-head h2::after {
  content: ""; display: block; height: 5px; margin-top: 5px; opacity: .45;
  background: repeating-linear-gradient(90deg, var(--accent) 0 7px, transparent 7px 14px);
}
html[data-mode="funny"] .hero-title { transform: rotate(-1.4deg); }
html[data-mode="funny"] .entry:nth-child(even) { transform: rotate(.35deg); }
html[data-mode="funny"] .entry-state { transform: rotate(-3deg); display: inline-block; }

/* ---------- 终端：窗口标题栏 + 闪烁光标 ---------- */
html[data-mode="terminal"] .mode-deco {
  display: flex; align-items: center; gap: 10px; position: sticky; top: 62px; z-index: 95;
  padding: 9px 16px; background: var(--paper-2); border-bottom: 1px solid var(--rule);
  font-family: var(--mono); font-size: 11px; color: var(--ink-3); letter-spacing: .06em;
}
html[data-mode="terminal"] .mode-deco::before { content: "● ● ●"; letter-spacing: 4px; color: var(--rule); }
html[data-mode="terminal"] .mode-deco::after { content: attr(data-name) "  —  bash  —  80×24"; }
html[data-mode="terminal"] .hero-title span[data-v="title"]::after {
  content: "▋"; color: var(--accent); animation: blink 1.1s steps(1) infinite;
}
html[data-mode="terminal"] .entry-state { border-radius: 0; text-transform: uppercase; }
html[data-mode="terminal"] .tlink:hover { background: var(--accent); color: var(--paper); }
html[data-mode="terminal"] .hero-meta dd::before { content: ""; }

/* ---------- 报纸：报头 ---------- */
html[data-mode="paper"] .mode-deco {
  display: block; text-align: center; padding: 20px 0 16px; margin-bottom: 6px;
  border-bottom: 3px double var(--ink); font-family: var(--serif);
}
html[data-mode="paper"] .mode-deco::before {
  content: attr(data-name); display: block; font-size: clamp(28px, 5vw, 44px);
  font-weight: 700; letter-spacing: .16em;
}
html[data-mode="paper"] .mode-deco::after {
  content: "第 001 期  ·  每日发行  ·  定价：免费"; display: block; margin-top: 8px;
  font-size: 11px; letter-spacing: .22em; color: var(--ink-3); font-family: var(--mono);
}
html[data-mode="paper"] .hero-title { font-size: clamp(30px, 5vw, 52px); }
html[data-mode="paper"] .section:first-of-type .sec-head h2::after {
  content: " — 本报讯"; font-size: 15px; color: var(--ink-3); font-family: var(--serif);
}

/* ---------- 蓝图：图框 + 右下标题栏 ---------- */
html[data-mode="blueprint"] body::after {
  content: ""; position: fixed; inset: 14px; z-index: 5; pointer-events: none;
  border: 2px solid rgba(255,255,255,.42);
  outline: 1px solid rgba(255,255,255,.22); outline-offset: 6px;
}
html[data-mode="blueprint"] .mode-deco {
  display: block; position: fixed; right: 16px; bottom: 16px; z-index: 96;
  border: 1px solid var(--rule); background: var(--paper-2);
  font-family: var(--mono); font-size: 10px; color: var(--ink-2);
  padding: 9px 13px; letter-spacing: .12em; line-height: 1.9;
}
html[data-mode="blueprint"] .mode-deco::before { content: attr(data-name) "  /  SCALE 1:1  /  REV.2026"; display: block; }
html[data-mode="blueprint"] .mode-deco::after { content: "DRAWN BY: JUTIAN   |   SHEET 1 OF 1"; display: block; color: var(--ink-3); }
html[data-mode="blueprint"] .hero-title::before { content: "[ "; color: var(--accent); }
html[data-mode="blueprint"] .hero-title::after { content: " ]"; color: var(--accent); }
html[data-mode="blueprint"] .entry-side { border-right: 1px dashed var(--rule); padding-right: 20px; }

/* ---------- 手账：胶带 + 折角 ---------- */
html[data-mode="note"] .mode-deco {
  display: block; height: 28px; max-width: 240px; margin: 0 auto;
  background: rgba(255,224,138,.8);
  border-left: 1px dashed rgba(0,0,0,.14); border-right: 1px dashed rgba(0,0,0,.14);
  transform: rotate(-1.8deg); box-shadow: 0 2px 5px rgba(0,0,0,.07);
}
html[data-mode="note"] .hero-title { text-decoration: underline wavy var(--accent); text-underline-offset: 8px; }
html[data-mode="note"] .entry {
  background: #fffefa; border: 1px solid var(--rule); padding: 26px;
  box-shadow: 2px 3px 0 var(--rule-2), 5px 7px 0 rgba(0,0,0,.03);
}
html[data-mode="note"] .entry + .entry { margin-top: 16px; }
html[data-mode="note"] .pull::first-line { font-weight: 700; }
html[data-mode="note"] .foot { position: relative; }
html[data-mode="note"] .foot::before {
  content: ""; position: absolute; right: 0; top: -2px; width: 34px; height: 34px;
  background: linear-gradient(225deg, var(--paper-2) 50%, transparent 50%);
  border-left: 1px solid var(--rule); border-top: 1px solid var(--rule);
}

/* ---------- 像素：PRESS START + 像素格 + 抖动 ---------- */
html[data-mode="pixel"] .mode-deco {
  display: block; text-align: center; padding: 11px; background: var(--rule-2);
  font-family: var(--mono); font-size: 12px; letter-spacing: .34em; color: var(--accent);
  border-bottom: 3px solid var(--rule); animation: blink 1.5s steps(1) infinite;
}
html[data-mode="pixel"] .mode-deco::after { content: "PRESS START"; }
html[data-mode="pixel"] body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 8px 8px;
}
html[data-mode="pixel"] .hero-title { animation: wiggle 2.6s ease-in-out infinite; }
html[data-mode="pixel"] .tlink:hover { transform: translate(-2px, -2px); text-shadow: 2px 2px 0 var(--rule); }
html[data-mode="pixel"] .entry-state { border: 2px solid var(--accent); color: var(--accent); }
html[data-mode="pixel"] .hero-meta dd { color: var(--accent); }

/* ============================================================
   全局布局重构：每种风格换一套骨架
   ============================================================ */

/* ---------- 猫娘：居中卡片流 ---------- */
html[data-mode="neko"] .wrap { max-width: 980px; }
html[data-mode="neko"] .hero-body { display: block; text-align: center; }
html[data-mode="neko"] .hero-meta { justify-content: center; }
html[data-mode="neko"] .hero-lede { margin-left: auto; margin-right: auto; }
html[data-mode="neko"] .hero-aside { border: 0; padding: 0; margin-top: 22px; text-align: center; }
html[data-mode="neko"] .sec-head { display: block; text-align: center; border-top: 0; }
html[data-mode="neko"] .sec-head .sec-note { text-align: center; }
html[data-mode="neko"] .sec-num { text-align: center; display: block; }
html[data-mode="neko"] .entry {
  display: block; margin: 18px 0; padding: 24px 26px;
  border: 2px solid var(--accent); border-radius: 22px;
  background: var(--paper-3); box-shadow: 0 6px 0 rgba(192,101,143,.18);
}
html[data-mode="neko"] .entry-side { position: static; margin-bottom: 14px; }
html[data-mode="neko"] .entry-spec { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 12px; }
html[data-mode="neko"] .entry-spec div { border: 0; padding: 0; flex-direction: column; gap: 2px; }
html[data-mode="neko"] .entry-spec dd { text-align: left; }
html[data-mode="neko"] .points li { border-radius: 12px; padding: 10px 12px; }
html[data-mode="neko"] .pull { border-radius: 22px; background: var(--paper-3); padding: 26px; text-align: center; }
html[data-mode="neko"] .tlink { border: 1px solid var(--accent); border-radius: 999px; padding: 7px 16px; }
html[data-mode="neko"] .numlist li { grid-template-columns: 1fr; gap: 4px; border-radius: 16px; padding: 18px; }
html[data-mode="neko"] .foot-top { text-align: center; }

/* ---------- 搞笑：东倒西歪 ---------- */
html[data-mode="funny"] .sec-head { display: block; }
html[data-mode="funny"] .sec-head h2 { display: inline-block; background: #ffe680; padding: 2px 10px; transform: rotate(-1.3deg); }
html[data-mode="funny"] .entry { display: block; }
html[data-mode="funny"] .entry-side { position: static; }
html[data-mode="funny"] .entry:nth-of-type(odd) { transform: rotate(-.55deg); }
html[data-mode="funny"] .entry:nth-of-type(even) { transform: rotate(.5deg) translateX(12px); }
html[data-mode="funny"] .hero-meta div:nth-child(2n) { transform: rotate(2.2deg); }
html[data-mode="funny"] .hero-meta div:nth-child(3n) { transform: rotate(-1.8deg); }
html[data-mode="funny"] .numlist li:nth-child(2n) { transform: rotate(-.7deg); }
html[data-mode="funny"] .numlist li:nth-child(3n) { transform: rotate(.6deg); }
html[data-mode="funny"] .tbl-wrap { transform: rotate(.4deg); }
html[data-mode="funny"] .points li:nth-child(even) { font-size: 15.5px; }
html[data-mode="funny"] .points li:nth-child(3n) { padding-left: 6px; }
html[data-mode="funny"] .log li:nth-child(2n) { transform: rotate(-.5deg); }
html[data-mode="funny"] .pull { transform: rotate(-.8deg); }

/* ---------- 终端：单列命令行 ---------- */
html[data-mode="terminal"] .wrap { max-width: 880px; }
html[data-mode="terminal"] .hero-body { display: block; }
html[data-mode="terminal"] .hero-aside { border: 0; border-top: 1px dashed var(--rule); padding: 14px 0 0; margin-top: 18px; }
html[data-mode="terminal"] .hero-lede::before { content: "# "; color: var(--ink-3); }
html[data-mode="terminal"] .sec-head { display: block; border-top: 1px dashed var(--rule); }
html[data-mode="terminal"] .entry { display: block; border-left: 2px solid var(--rule); padding: 14px 0 14px 18px; }
html[data-mode="terminal"] .entry-side { position: static; }
html[data-mode="terminal"] .entry-body > p:first-of-type::before { content: "> "; color: var(--accent); }
html[data-mode="terminal"] .entry-spec div { border-bottom: 0; padding: 2px 0; }
html[data-mode="terminal"] .points li { border: 0; padding: 3px 0; }
html[data-mode="terminal"] .points li i::after { content: ":"; }
html[data-mode="terminal"] table.tbl th { border-bottom: 1px dashed var(--rule); }
html[data-mode="terminal"] table.tbl td { border-bottom: 0; }
html[data-mode="terminal"] .numlist li { grid-template-columns: 1fr; gap: 2px; padding: 12px 0; }
html[data-mode="terminal"] .numlist .n::after { content: " //"; color: var(--ink-3); }
html[data-mode="terminal"] .pull { border-left: 2px solid var(--accent); border-top: 0; border-bottom: 0; padding: 8px 0 8px 18px; }
html[data-mode="terminal"] .log li { grid-template-columns: 1fr; gap: 2px; padding: 8px 0; }
html[data-mode="terminal"] .log time::before { content: "[ "; color: var(--ink-3); }
html[data-mode="terminal"] .log time::after { content: " ]"; color: var(--ink-3); }

/* ---------- 报纸：通栏 + 多栏 ---------- */
html[data-mode="paper"] .wrap { max-width: 1260px; }
html[data-mode="paper"] .hero-body { column-count: 2; column-gap: 36px; }
html[data-mode="paper"] .hero-aside { border-left: 1px solid var(--ink); padding-left: 22px; break-inside: avoid; }
html[data-mode="paper"] .sec-head { grid-template-columns: 1fr; }
html[data-mode="paper"] .sec-head h2 { font-size: clamp(28px, 4vw, 42px); letter-spacing: .02em; }
html[data-mode="paper"] .entry { display: block; }
html[data-mode="paper"] .entry-side {
  position: static; border-bottom: 1px solid var(--ink); padding-bottom: 12px; margin-bottom: 14px;
}
html[data-mode="paper"] .entry-spec { display: flex; gap: 24px; flex-wrap: wrap; margin-top: 10px; }
html[data-mode="paper"] .entry-spec div { border: 0; padding: 0; }
html[data-mode="paper"] .entry-spec dt { font-family: var(--serif); }
html[data-mode="paper"] .log { column-count: 2; column-gap: 34px; }
html[data-mode="paper"] .numlist li { grid-template-columns: 1fr; gap: 6px; }
html[data-mode="paper"] .pull { font-size: clamp(22px, 3.2vw, 32px); }

/* ---------- 蓝图：图纸框 + 角标 ---------- */
html[data-mode="blueprint"] .entry {
  display: block; position: relative; padding: 22px 24px;
  border: 1px solid var(--rule); margin-bottom: 16px;
}
html[data-mode="blueprint"] .entry::before {
  content: ""; position: absolute; left: -1px; top: -1px; width: 12px; height: 12px;
  border-left: 2px solid var(--accent); border-top: 2px solid var(--accent);
}
html[data-mode="blueprint"] .entry::after {
  content: ""; position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px;
  border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
}
html[data-mode="blueprint"] .entry-side {
  position: static; display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap;
  border-right: 0; padding: 0 0 14px; border-bottom: 1px dashed var(--rule); margin-bottom: 14px;
}
html[data-mode="blueprint"] .entry-name { margin: 0; }
html[data-mode="blueprint"] .entry-spec { display: flex; gap: 22px; flex-wrap: wrap; margin: 0; }
html[data-mode="blueprint"] .entry-spec div { border: 0; padding: 0; }
html[data-mode="blueprint"] .entry-spec dt { color: var(--accent); }
html[data-mode="blueprint"] .sec-head { grid-template-columns: 1fr; gap: 10px; border-top: 1px solid var(--rule); }
html[data-mode="blueprint"] .hero-body { display: block; }
html[data-mode="blueprint"] .hero-aside { border-left: 0; border-top: 1px dashed var(--rule); padding: 14px 0 0; margin-top: 18px; }
html[data-mode="blueprint"] .hero-meta div { border: 1px solid var(--rule); padding: 6px 10px; }
html[data-mode="blueprint"] .numlist li { grid-template-columns: 70px 1fr; gap: 18px; border: 1px solid var(--rule-2); padding: 16px; margin-bottom: 10px; }
html[data-mode="blueprint"] table.tbl { border: 1px solid var(--rule); }
html[data-mode="blueprint"] .points li { border-bottom: 1px dashed var(--rule); }
html[data-mode="blueprint"] .log li { border: 1px solid var(--rule-2); padding: 14px 16px; margin-bottom: 10px; }

/* ---------- 手账：跨页笔记 ---------- */
html[data-mode="note"] .hero-body { display: block; }
html[data-mode="note"] .hero-aside {
  border-left: 0; border-top: 2px dashed var(--rule); padding: 14px 0 0; margin-top: 18px;
}
html[data-mode="note"] .sec-head { grid-template-columns: 1fr; gap: 8px; }
html[data-mode="note"] .sec-head h2 {
  display: inline-block; border-bottom: 3px solid var(--accent); padding-bottom: 3px;
}
html[data-mode="note"] .entry { display: block; }
html[data-mode="note"] .entry-side { position: static; margin-bottom: 12px; }
html[data-mode="note"] .entry-spec div { border-bottom: 1px dashed var(--rule); }
html[data-mode="note"] .points li { border-bottom: 1px dashed var(--rule); }
html[data-mode="note"] .numlist li:nth-child(odd) { background: rgba(255,224,138,.28); border-radius: 4px; padding-left: 12px; padding-right: 12px; }
html[data-mode="note"] .log li:nth-child(even) { background: rgba(255,224,138,.18); border-radius: 4px; padding-left: 12px; }
html[data-mode="note"] table.tbl td, html[data-mode="note"] table.tbl th { border-bottom: 1px dashed var(--rule); }
html[data-mode="note"] .hero-meta dd { border-bottom: 2px solid rgba(255,208,138,.9); }
html[data-mode="note"] .toc { border: 2px dashed var(--rule); padding: 14px 18px; border-radius: 6px; }

/* ---------- 像素：游戏对话框 ---------- */
html[data-mode="pixel"] .hero-body { display: block; }
html[data-mode="pixel"] .hero-aside {
  border: 3px solid var(--rule); background: var(--paper-2); padding: 16px; margin-top: 18px;
  box-shadow: 6px 6px 0 var(--rule-2);
}
html[data-mode="pixel"] .hero-meta {
  border: 3px solid var(--rule); background: var(--paper-2); padding: 14px 16px;
  box-shadow: 6px 6px 0 var(--rule-2); gap: 24px;
}
html[data-mode="pixel"] .sec-head { display: block; }
html[data-mode="pixel"] .sec-head h2 {
  font-family: var(--mono); text-transform: uppercase; letter-spacing: .1em; font-size: 24px;
}
html[data-mode="pixel"] .entry { display: block; margin-bottom: 18px; padding: 20px; }
html[data-mode="pixel"] .entry-side { position: static; margin-bottom: 14px; }
html[data-mode="pixel"] .entry-spec div { border-bottom: 2px solid var(--rule-2); }
html[data-mode="pixel"] .points li { border-bottom: 2px solid var(--rule-2); padding: 7px 0; }
html[data-mode="pixel"] .numlist li {
  grid-template-columns: 1fr; gap: 6px; border: 3px solid var(--rule);
  background: var(--paper-2); padding: 16px; margin-bottom: 12px; box-shadow: 6px 6px 0 var(--rule-2);
}
html[data-mode="pixel"] .numlist .n { color: var(--accent); }
html[data-mode="pixel"] .log li {
  grid-template-columns: 1fr; gap: 4px; border: 3px solid var(--rule);
  background: var(--paper-2); padding: 14px 16px; margin-bottom: 12px; box-shadow: 6px 6px 0 var(--rule-2);
}
html[data-mode="pixel"] table.tbl { border: 3px solid var(--rule); }
html[data-mode="pixel"] .toc { border: 3px solid var(--rule); background: var(--paper-2); padding: 14px 18px; }
html[data-mode="pixel"] .foot { background: var(--rule-2); }
