/* 平芜 · 像素青绿山水 */

@font-face {
  font-family: "Fusion Pixel";
  src: url("fonts/fusion-pixel-12px-zh_hans.woff2") format("woff2");
  font-display: swap;
}

:root {
  /* 豆青绢本：浅豆绿为底（不用纯白，减少眩光）、墨绿灰为字、黛青为辅，朱磦印章只作点睛 */
  --paper: #e6eedf;
  --paper-2: #d5e2cc;
  --paper-3: #f2f6ec;
  --ink: #2f3b33;
  --ink-2: #4b584f;
  --muted: #74827a;
  --line: rgba(47, 59, 51, 0.14);
  --frame: #71867a;
  --dai: #4b665f;
  --seal: #a8493b;
  --seal-dark: #87382d;
  --stone-blue: #527b80;
  --stone-green: #5d8a6a;
  --gold: #9c8752;
  --shadow: 6px 6px 0 rgba(47, 59, 51, .08);
  --pixel-font: "Fusion Pixel", "Zpix", monospace;
  --body-font: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --menubar-h: 56px;
  --dock-h: 52px;
  --wrap: 1160px;
  /* 绢纹：带一点青的低对比噪点 */
  --paper-grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.20 0 0 0 0 0.32 0 0 0 0 0.24 0 0 0 .07 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--menubar-h) + 24px); }

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--body-font);
  font-size: 15px;
  line-height: 1.8;
  background: var(--paper) var(--paper-grain);
}

a { color: inherit; }
::selection { color: var(--paper-3); background: var(--seal); }
#main:focus { outline: none; }
main { min-height: calc(100vh - 160px); }
body[data-view="home"] main { min-height: 0; }

.px, h1, h2, h3, .menubar, .btn, .chip, .pill, .filter, .dock, .win-bar, .sec-no, .sec-en, .block-no, .card-title, .more, .back,
.hero-now, .hero-name, .post-meta, .work-pinyin, .work-quote, .stats, .year-title, .timeline time, .tl-cat, .friend-host,
.profile-name, .status b, .avatar, .badge, .tax-label, .siteinfo dt, .copy, .loading, .empty-title, .footer, .toast, .lead {
  font-family: var(--pixel-font);
  -webkit-font-smoothing: none;
  font-smooth: never;
  font-weight: normal;
}

.skip { position: absolute; left: -999px; top: 8px; z-index: 100; padding: 6px 12px; color: var(--paper-3); background: var(--seal); }
.skip:focus { left: 8px; }

/* ---------- 顶栏 ---------- */
.menubar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--menubar-h);
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 max(24px, calc((100vw - var(--wrap)) / 2 + 24px));
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--ink);
  transition: background-color .3s steps(4), box-shadow .3s steps(4);
}
.menubar.is-solid {
  background: rgba(230, 238, 223, 0.94);
  box-shadow: 0 1px 0 var(--line);
  backdrop-filter: blur(6px);
}
.menubar a { text-decoration: none; }
.menubar-brand { display: inline-flex; align-items: center; gap: 10px; font-size: 24px; letter-spacing: 4px; }
.brand-seal {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  font-size: 12px;
  letter-spacing: 0;
  color: var(--paper-3);
  background: var(--seal);
  box-shadow: inset 0 0 0 2px var(--seal), inset 0 0 0 3px rgba(242, 246, 236, .55);
}
.menubar-nav { display: flex; gap: 4px; }
.menubar-nav a { position: relative; padding: 6px 12px; transition: color .2s, background-color .2s; }
.menubar-nav a:hover, .menubar-nav a:focus-visible { color: var(--paper-3); background: var(--dai); outline: none; }
.menubar-nav a.is-on { color: var(--seal); }
.menubar-nav a.is-on::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 2px; background: var(--seal); }
.menubar-nav a.is-on:hover { color: var(--paper-3); }
.menubar-tools { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.icon-btn { display: grid; place-items: center; width: 32px; height: 32px; color: var(--ink-2); transition: color .15s, background-color .15s; }
.icon-btn:hover, .icon-btn:focus-visible { color: var(--paper-3); background: var(--dai); outline: none; }
.icon-btn svg, .pill svg, .btn svg, .profile-handle svg { width: 16px; height: 16px; flex: none; }
.menubar-clock { margin-left: 10px; font-size: 24px; letter-spacing: 2px; }

/* ---------- 卷首（只在首页） ---------- */
.hero {
  position: relative;
  height: clamp(520px, 76vh, 760px);
  overflow: hidden;
  background: var(--paper-2);
}
body:not([data-view="home"]) .hero { display: none; }
body:not([data-view="home"]) main { padding-top: calc(var(--menubar-h) + 40px); }
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; transition: opacity .18s steps(3); }
.hero-canvas.is-switching { opacity: .15; }
.hero-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(230, 238, 223, .55), transparent 18%),
    linear-gradient(to top, var(--paper), rgba(230, 238, 223, 0) 20%);
}

.hero-inscription {
  position: absolute;
  top: calc(var(--menubar-h) + 6vh);
  right: max(24px, calc((100vw - var(--wrap)) / 2 + 24px));
  z-index: 2;
  display: flex;
  flex-direction: row-reverse;
  align-items: flex-start;
  gap: 18px;
  color: var(--ink);
}
/* 竖排：第一句在右、第二句在左 */
.hero-poem { margin: 0; writing-mode: vertical-rl; font-size: 36px; line-height: 1; letter-spacing: 14px; text-shadow: 0 0 10px rgba(242, 246, 236, .9); }
.poem-col { display: block; min-height: 7.6em; }
.poem-col + .poem-col { margin-right: 18px; }
.poem-col.is-typing::after { content: "▌"; font-size: .7em; color: var(--gold); animation: blink .9s steps(1) infinite; }
.hero-seal {
  margin-top: 6.6em;
  display: grid;
  grid-template-rows: 1fr 1fr;
  place-items: center;
  width: 56px;
  height: 104px;
  padding: 6px 0;
  font-family: var(--pixel-font);
  font-size: 36px;
  line-height: 1;
  color: var(--paper-3);
  background: var(--seal);
  box-shadow: inset 0 0 0 3px var(--seal), inset 0 0 0 5px rgba(242, 246, 236, .7);
  transform: rotate(-2deg);
  opacity: 0;
  animation: seal-stamp .5s steps(4) 3.4s forwards;
  clip-path: polygon(0 3%, 4% 0, 30% 2%, 52% 0, 80% 1%, 100% 0, 98% 30%, 100% 62%, 99% 100%, 70% 98%, 40% 100%, 6% 99%, 0 96%, 2% 60%);
}
@keyframes seal-stamp { 0% { opacity: 0; transform: rotate(-2deg) scale(1.6); } 100% { opacity: 1; transform: rotate(-2deg) scale(1); } }

.hero-caption {
  position: absolute;
  top: calc(var(--menubar-h) + 7vh);
  left: max(24px, calc((100vw - var(--wrap)) / 2 + 24px));
  z-index: 2;
  max-width: 460px;
  color: var(--ink);
}
.hero-now { margin: 0 0 16px; font-size: 12px; letter-spacing: 4px; color: var(--muted); }
.hero-now, .hero-sub { text-shadow: 0 0 6px rgba(242, 246, 236, .95), 0 0 2px rgba(242, 246, 236, .95); }
.hero-name { text-shadow: 0 0 10px rgba(242, 246, 236, .9), 3px 3px 0 rgba(47, 59, 51, .1) !important; }
.hero-name { margin: 0; font-size: 72px; line-height: 1; letter-spacing: 18px; text-shadow: 3px 3px 0 rgba(47, 59, 51, .1); }
.hero-name span { display: block; margin-top: 14px; font-size: 12px; letter-spacing: 12px; color: var(--gold); text-shadow: none; }
.hero-sub { margin: 18px 0 24px; font-size: 14px; letter-spacing: 2px; color: var(--ink-2); }
.hero-links { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-poem-line { display: none; }
.footer-credit span { white-space: nowrap; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  font-size: 12px;
  letter-spacing: 2px;
  text-decoration: none;
  color: var(--ink);
  background: rgba(242, 246, 236, .82);
  border: 2px solid var(--frame);
  box-shadow: 3px 3px 0 rgba(47, 59, 51, .1);
  transition: background-color .15s steps(2), color .15s steps(2), transform .1s steps(2);
}
.pill:hover, .pill:focus-visible { color: var(--paper-3); background: var(--dai); border-color: var(--dai); outline: none; }
.pill:active { transform: translate(1px, 1px); }

@keyframes blink { 50% { opacity: 0; } }
.blink { animation: blink .9s steps(1) infinite; }

/* 四时切换条 */
.scene-switch {
  position: absolute;
  right: max(24px, calc((100vw - var(--wrap)) / 2 + 24px));
  bottom: 40px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 8px;
  font-family: var(--pixel-font);
  -webkit-font-smoothing: none;
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--ink-2);
  background: rgba(242, 246, 236, .86);
  border: 2px solid var(--frame);
  box-shadow: 4px 4px 0 rgba(47, 59, 51, .1);
}
.scene-switch-group { display: flex; align-items: center; gap: 2px; }
.scene-switch-label { margin-right: 6px; color: var(--muted); }
.scene-btn { padding: 4px 8px; font: inherit; letter-spacing: inherit; color: inherit; background: transparent; border: 0; cursor: pointer; transition: background-color .15s steps(2), color .15s steps(2); }
.scene-btn:hover { color: var(--seal); }
.scene-btn:focus-visible { outline: 2px dashed var(--seal); outline-offset: 1px; }
.scene-btn[aria-pressed="true"] { color: var(--paper-3); background: var(--seal); }
.scene-btn-now { margin-left: 2px; padding-left: 12px; border-left: 1px solid var(--line); }
.scene-btn-now[aria-pressed="true"] { color: var(--seal); background: transparent; }

/* ---------- 布局 ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 40px;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 56px 24px 24px;
}
.layout-side { display: flex; flex-direction: column; gap: 24px; align-self: start; position: sticky; top: calc(var(--menubar-h) + 20px); }
.page { max-width: var(--wrap); margin: 0 auto; padding: 0 24px 40px; }
.page-narrow { max-width: 860px; }

.block { margin-bottom: 64px; }
.block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--frame);
}
.block-head h2 { display: flex; align-items: center; gap: 14px; margin: 0; font-size: 24px; line-height: 1; letter-spacing: 6px; }
.block-no {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  font-size: 24px;
  letter-spacing: 0;
  color: var(--paper-3);
  background: var(--seal);
  box-shadow: inset 0 0 0 2px var(--seal), inset 0 0 0 4px rgba(242, 246, 236, .6);
}
.more { font-size: 12px; letter-spacing: 2px; color: var(--muted); text-decoration: none; }
.more:hover, .more:focus-visible { color: var(--seal); outline: none; }

.page-head {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  margin: 16px 0 36px;
  padding-bottom: 18px;
  border-bottom: 2px solid var(--frame);
}
.page-head h1 { margin: 0; font-size: 48px; line-height: 1; letter-spacing: 12px; }
.sec-no {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  flex: none;
  font-size: 36px;
  color: var(--paper-3);
  background: var(--seal);
  box-shadow: inset 0 0 0 3px var(--seal), inset 0 0 0 5px rgba(242, 246, 236, .6);
}
.sec-en { margin: 10px 0 0; font-size: 12px; letter-spacing: 3px; color: var(--muted); }
.sec-note { margin: 24px 0 0; font-size: 13px; color: var(--muted); }
.lead { margin: 0 0 24px; font-size: 12px; letter-spacing: 2px; color: var(--muted); }
.loading { padding: 32px 4px; font-size: 12px; letter-spacing: 3px; color: var(--muted); list-style: none; }

/* ---------- 卡片 ---------- */
.card {
  padding: 22px 22px 24px;
  background: var(--paper-3);
  border: 2px solid var(--frame);
  box-shadow: var(--shadow);
}
.card-title {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin: 0 0 14px;
  font-size: 12px;
  letter-spacing: 4px;
  color: var(--ink-2);
}
.card-title::before { content: ""; width: 8px; height: 8px; margin-right: 10px; background: var(--seal); }
.card-title .more { margin-left: auto; }

/* 个人卡 */
.profile-top { display: flex; align-items: center; gap: 16px; }
.profile-avatar { width: 72px; height: 72px; flex: none; image-rendering: pixelated; border: 2px solid var(--frame); background: var(--paper-2); }
.profile-name { margin: 0 0 4px; font-size: 24px; line-height: 1.1; letter-spacing: 3px; }
.profile-handle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); text-decoration: none; }
.profile-handle:hover { color: var(--seal); }
.profile-bio { margin: 16px 0 18px; font-size: 14px; line-height: 1.85; color: var(--ink-2); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0 0 18px; border: 1px solid var(--line); background: var(--paper); }
.stats div { padding: 10px 0 8px; text-align: center; }
.stats div + div { border-left: 1px solid var(--line); }
.stats dt { font-size: 12px; letter-spacing: 2px; color: var(--muted); }
.stats dd { margin: 4px 0 0; font-size: 24px; line-height: 1; color: var(--dai); }
.profile-actions { display: flex; gap: 10px; }
.profile-actions .btn { flex: 1; justify-content: center; }

/* 此刻 */
.status { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 10px; }
.status-dot { width: 10px; height: 10px; background: var(--stone-green); box-shadow: 0 0 0 3px rgba(93, 138, 106, .25); animation: pulse 2s steps(2) infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px rgba(93, 138, 106, .08); } }
.status b { font-size: 24px; line-height: 1.2; letter-spacing: 3px; }
.status-note { grid-column: 2; font-size: 13px; color: var(--muted); }

/* 标签 */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.chip { display: inline-block; padding: 1px 8px; font-size: 12px; line-height: 20px; color: var(--ink-2); text-decoration: none; border: 1px solid var(--line); background: var(--paper); }
a.chip:hover, a.chip:focus-visible { color: var(--paper-3); background: var(--dai); border-color: var(--dai); outline: none; }
.chip sup, .filter sup { margin-left: 4px; font-size: 10px; color: var(--muted); }
.tax-label { margin: 0 0 8px; font-size: 12px; letter-spacing: 2px; color: var(--muted); }
.tax-label ~ .tax-label { margin-top: 14px; }

/* 侧栏友链 */
.mini-links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; padding: 0; list-style: none; }
.mini-links a { display: flex; align-items: center; gap: 8px; padding: 6px; font-size: 13px; text-decoration: none; color: var(--ink-2); border: 1px solid transparent; }
.mini-links a span:last-child { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mini-links a:hover, .mini-links a:focus-visible { border-color: var(--frame); background: var(--paper); outline: none; }

/* 像素字头像 */
.avatar {
  display: grid;
  place-items: center;
  flex: none;
  overflow: hidden;
  color: var(--paper-3);
  background: var(--dai);
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .08), inset 0 0 0 3px rgba(242, 246, 236, .35);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.has-img { background: var(--paper-2); }
.avatar-sm { width: 26px; height: 26px; font-size: 12px; }
.avatar-md { width: 56px; height: 56px; font-size: 24px; }

/* ---------- 札记列表 ---------- */
.post-list { margin: 0; padding: 0; list-style: none; }
.post + .post { border-top: 1px dashed var(--line); }
.post-link { display: block; padding: 22px 16px; text-decoration: none; transition: background-color .2s steps(2), box-shadow .2s steps(2); }
.post-link:hover, .post-link:focus-visible { background: var(--paper-3); box-shadow: inset 3px 0 0 var(--seal); outline: none; }
.post-meta { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 12px; letter-spacing: 2px; color: var(--muted); }
.badge { padding: 0 6px; font-size: 12px; color: var(--paper-3); background: var(--seal); }
.post-title { margin: 0 0 6px; font-family: var(--body-font); font-size: 20px; font-weight: 600; line-height: 1.5; letter-spacing: .5px; -webkit-font-smoothing: antialiased; }
.post-excerpt { margin: 0; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* 空状态：一片平芜 */
.empty {
  padding: 36px 32px 34px;
  text-align: center;
  background: var(--paper-3);
  border: 2px dashed var(--frame);
}
.empty-art { position: relative; width: 168px; height: 56px; margin: 0 auto 18px; border-bottom: 4px solid var(--stone-green); }
.empty-art i { position: absolute; bottom: 0; width: 0; height: 0; border-left: 24px solid transparent; border-right: 24px solid transparent; border-bottom: 34px solid var(--stone-blue); }
.empty-art i:nth-child(1) { left: 16px; border-bottom-color: #8fa99a; }
.empty-art i:nth-child(2) { left: 56px; border-left-width: 34px; border-right-width: 34px; border-bottom-width: 52px; }
.empty-art i:nth-child(3) { left: 112px; border-bottom-color: #9cb5a5; border-bottom-width: 26px; }
.empty-title { margin: 0 0 8px; font-size: 24px; letter-spacing: 6px; }
.empty-text { margin: 0 auto; max-width: 34em; color: var(--muted); }
.empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 20px; }
.empty-actions:empty { display: none; }

/* 归档 */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.filters:empty { display: none; }
.filter { padding: 4px 12px; font-size: 12px; letter-spacing: 2px; color: var(--ink-2); background: var(--paper-3); border: 1px solid var(--line); cursor: pointer; }
.filter:hover { border-color: var(--frame); }
.filter[aria-pressed="true"] { color: var(--paper-3); background: var(--dai); border-color: var(--dai); }
.filter[aria-pressed="true"] sup { color: var(--paper-2); }
.year { margin-bottom: 40px; }
.year-title { display: flex; align-items: baseline; gap: 14px; margin: 0 0 12px; font-size: 36px; letter-spacing: 4px; color: var(--dai); }
.year-title span { font-size: 12px; letter-spacing: 2px; color: var(--muted); }
.timeline { margin: 0; padding: 0 0 0 18px; list-style: none; border-left: 2px solid var(--paper-2); }
.timeline li { position: relative; }
.timeline li::before { content: ""; position: absolute; left: -24px; top: 21px; width: 10px; height: 10px; background: var(--paper); border: 2px solid var(--frame); }
.timeline a { display: flex; align-items: baseline; gap: 18px; padding: 12px 12px; text-decoration: none; }
.timeline a:hover, .timeline a:focus-visible { background: var(--paper-3); outline: none; }
.timeline a:hover .tl-title { color: var(--seal); }
.timeline time { flex: none; font-size: 12px; letter-spacing: 2px; color: var(--muted); }
.tl-title { flex: 1; min-width: 0; font-size: 16px; }
.tl-cat { flex: none; font-size: 12px; color: var(--muted); }

/* ---------- 作品 ---------- */
.works { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 28px; }
.works-wide { gap: 36px; }
.work {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--paper-3);
  border: 2px solid var(--frame);
  box-shadow: 8px 8px 0 rgba(47, 59, 51, .08);
  transition: transform .18s steps(3), box-shadow .18s steps(3);
}
.work:hover { transform: translate(-3px, -3px); box-shadow: 11px 11px 0 rgba(47, 59, 51, .13); }
.work-art { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-bottom: 2px solid var(--frame); background: var(--paper-2); }
.work-art canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.work-art-tag { position: absolute; top: 12px; left: 12px; padding: 2px 8px; font-family: var(--pixel-font); font-size: 12px; letter-spacing: 2px; color: var(--paper-3); background: rgba(75, 102, 95, .78); }
.work-body { display: flex; flex: 1; flex-direction: column; gap: 12px; padding: 22px 24px 24px; }
.work-title { display: flex; align-items: baseline; gap: 14px; }
.work-title h3 { margin: 0; font-size: 36px; line-height: 1; letter-spacing: 8px; }
.works-wide .work-title h3 { font-size: 48px; letter-spacing: 10px; }
.work-pinyin { font-size: 12px; letter-spacing: 4px; color: var(--muted); }
.work-quote { margin: 0; font-size: 12px; line-height: 2; letter-spacing: 1px; color: var(--seal-dark); }
.work-quote cite { font-style: normal; color: var(--muted); }
.work-desc { margin: 0; color: var(--ink-2); }
.work-actions { display: flex; gap: 12px; margin-top: auto; padding-top: 6px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  font-size: 12px;
  letter-spacing: 4px;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid var(--frame);
  transition: background-color .15s steps(2), color .15s steps(2), transform .1s steps(2);
}
.btn:active { transform: translate(1px, 1px); }
.btn:focus-visible { outline: 2px dashed var(--seal); outline-offset: 3px; }
.btn-primary { color: var(--paper-3); background: var(--dai); border-color: var(--dai); }
.btn-primary:hover { background: var(--seal); border-color: var(--seal); }
.btn-ghost { color: var(--ink); background: transparent; }
.btn-ghost:hover { color: var(--paper-3); background: var(--dai); border-color: var(--dai); }

/* ---------- 友链 ---------- */
.friends { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; margin: 0 0 64px; padding: 0; list-style: none; }
.friend {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 100%;
  padding: 16px;
  text-decoration: none;
  background: var(--paper-3);
  border: 2px solid var(--frame);
  box-shadow: 5px 5px 0 rgba(47, 59, 51, .07);
  transition: transform .15s steps(3), box-shadow .15s steps(3);
}
.friend:hover, .friend:focus-visible { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 rgba(47, 59, 51, .12); outline: none; }
.friend:hover b { color: var(--seal); }
.friend-text { display: flex; flex-direction: column; min-width: 0; }
.friend-text b { font-size: 16px; line-height: 1.5; }
.friend-desc { font-size: 13px; line-height: 1.6; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.friend-host { margin-top: 4px; font-size: 12px; letter-spacing: 1px; color: var(--muted); }

.siteinfo { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 20px; }
.siteinfo-list { margin: 0; }
.siteinfo-row { display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 12px; padding: 8px 0; }
.siteinfo-row + .siteinfo-row { border-top: 1px dashed var(--line); }
.siteinfo dt { font-size: 12px; letter-spacing: 2px; color: var(--muted); }
.siteinfo dd { display: flex; align-items: center; gap: 10px; margin: 0; min-width: 0; }
.siteinfo code { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-family: "JetBrains Mono", Consolas, monospace; font-size: 13px; }
.copy { flex: none; padding: 2px 10px; font-size: 12px; letter-spacing: 2px; color: var(--ink-2); background: var(--paper); border: 1px solid var(--line); cursor: pointer; }
.copy:hover, .copy:focus-visible { color: var(--paper-3); background: var(--dai); border-color: var(--dai); outline: none; }
.rules { margin: 0; padding: 0 0 0 1.4em; color: var(--ink-2); }
.rules li { padding: 4px 0; }
.rules li::marker { font-family: var(--pixel-font); color: var(--seal); }
.rules a { color: var(--stone-blue); }

/* ---------- 关于 ---------- */
.colophon {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 48px;
  align-items: end;
  padding: 40px 44px;
  background: var(--paper-3);
  border: 2px solid var(--frame);
  box-shadow: var(--shadow);
}
.colophon-text p { margin: 0 0 14px; font-size: 16px; line-height: 2; }
.colophon-text p:first-child { font-family: var(--pixel-font); font-size: 24px; letter-spacing: 3px; }
.colophon-sign { display: flex; flex-direction: column; align-items: center; gap: 12px; font-family: var(--pixel-font); font-size: 12px; letter-spacing: 3px; color: var(--muted); }
.mini-seal {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  padding: 6px;
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
  color: var(--paper-3);
  background: var(--seal);
  box-shadow: inset 0 0 0 2px var(--seal), inset 0 0 0 4px rgba(242, 246, 236, .6);
  transform: rotate(3deg);
}
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 28px; }
.about-grid p { margin: 0 0 14px; color: var(--ink-2); }
.about-grid .chips { margin-bottom: 18px; }
.facts { margin: 0; padding: 0; list-style: none; }
.facts li { display: grid; grid-template-columns: 56px 1fr; gap: 12px; padding: 8px 0; color: var(--ink-2); }
.facts li + li { border-top: 1px dashed var(--line); }
.facts b { font-family: var(--pixel-font); font-weight: normal; font-size: 12px; letter-spacing: 2px; color: var(--muted); }

/* ---------- 阅读 ---------- */
.back { display: inline-block; margin: 8px 0 20px; font-size: 12px; letter-spacing: 2px; color: var(--muted); text-decoration: none; }
.back:hover { color: var(--seal); }
.reader { padding: 44px clamp(22px, 6vw, 64px) 52px; background: var(--paper-3); border: 2px solid var(--frame); box-shadow: var(--shadow); }
.reader-title { margin: 0 0 14px; font-family: var(--body-font); font-size: 32px; font-weight: 700; line-height: 1.4; letter-spacing: .5px; overflow-wrap: anywhere; -webkit-font-smoothing: antialiased; }
.reader-meta { margin: 0 0 32px; padding-bottom: 18px; font-family: var(--pixel-font); font-size: 12px; letter-spacing: 2px; color: var(--muted); border-bottom: 1px solid var(--line); }
.reader-content { font-size: 16px; line-height: 2; color: var(--ink-2); overflow-wrap: anywhere; }
.reader-content h1, .reader-content h2, .reader-content h3 { font-family: var(--body-font); font-weight: 700; line-height: 1.45; color: var(--ink); margin: 1.8em 0 .7em; overflow-wrap: anywhere; }
.reader-content h2 { font-size: 22px; padding-left: 14px; border-left: 4px solid var(--seal); }
.reader-content h3 { font-size: 18px; }
.reader-content a { color: var(--stone-blue); text-underline-offset: 3px; }
.reader-content img { max-width: 100%; height: auto; border: 2px solid var(--frame); }
.reader-content pre { overflow: auto; padding: 18px; color: var(--ink); background: var(--paper-2); border: 1px solid var(--line); }
.reader-content code { font-family: "JetBrains Mono", Consolas, monospace; font-size: .88em; }
.reader-content :not(pre) > code { padding: 1px 6px; background: var(--paper-2); }
.reader-content blockquote { margin: 1.2em 0; padding: 10px 18px; color: var(--muted); background: var(--paper); border-left: 4px solid var(--stone-green); }
.reader-content table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.reader-content th, .reader-content td { padding: 6px 12px; border: 1px solid var(--line); }
.reader-footer { margin-top: 44px; }

/* ---------- 页脚 ---------- */
.footer { padding: 32px 24px 56px; text-align: center; font-size: 12px; letter-spacing: 1px; line-height: 2.2; color: var(--muted); border-top: 2px solid var(--paper-2); }
.footer p { margin: 0; }
.footer a { color: var(--ink-2); text-decoration: none; }
.footer a:hover { color: var(--seal); }
.footer b { font-weight: normal; color: var(--seal); }
.footer-links { margin-bottom: 6px !important; letter-spacing: 3px; }
.footer-credit { font-size: 12px; opacity: .85; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 90;
  padding: 8px 18px;
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--paper-3);
  background: var(--dai);
  box-shadow: 4px 4px 0 rgba(47, 59, 51, .2);
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s steps(3), transform .2s steps(3);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 窗口 ---------- */
.window-layer { position: fixed; inset: var(--menubar-h) 0 0 0; z-index: 60; pointer-events: none; }
.win {
  position: absolute;
  display: flex;
  flex-direction: column;
  min-width: 320px;
  min-height: 240px;
  background: var(--paper-3);
  border: 2px solid var(--frame);
  box-shadow: 12px 12px 0 rgba(47, 59, 51, .12), 0 24px 60px rgba(47, 59, 51, .16);
  pointer-events: auto;
  animation: win-open .2s steps(4);
}
@keyframes win-open { from { opacity: 0; transform: translateY(12px) scale(.97); } }
.win.is-minimized { display: none; }
.win-bar { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 8px 0 14px; font-size: 12px; letter-spacing: 2px; color: var(--paper-3); background: var(--dai); cursor: move; touch-action: none; user-select: none; }
.win.is-inactive .win-bar { color: var(--ink-2); background: var(--paper-2); }
.win-dot { width: 10px; height: 10px; flex: none; background: var(--seal); }
.win-title { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.win-actions { display: inline-flex; gap: 4px; }
.win-action { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; font-family: var(--pixel-font); font-size: 12px; color: inherit; background: transparent; border: 0; cursor: pointer; text-decoration: none; }
.win-action:hover, .win-action:focus-visible { color: var(--paper-3); background: var(--seal); outline: none; }
.win-body { position: relative; flex: 1; min-height: 0; background: var(--paper-3); }
.win-body iframe { display: block; width: 100%; height: 100%; border: 0; background: var(--paper-3); }
.window-layer.is-dragging iframe { pointer-events: none; }
.win-loading { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 18px; font-family: var(--pixel-font); font-size: 12px; letter-spacing: 4px; color: var(--muted); background: var(--paper-3); }
.win-loading-bar { width: 200px; height: 8px; background: var(--paper-2); }
.win-loading-bar i { display: block; height: 100%; background: var(--seal); animation: loading 1.4s steps(10) infinite; }
@keyframes loading { from { width: 0; } to { width: 100%; } }
.win-resize { position: absolute; right: 0; bottom: 0; width: 18px; height: 18px; cursor: nwse-resize; touch-action: none; background: linear-gradient(135deg, transparent 0 55%, var(--frame) 55% 65%, transparent 65% 78%, var(--frame) 78% 88%, transparent 88%); }

.dock { position: fixed; left: 50%; bottom: 14px; z-index: 70; display: flex; gap: 6px; max-width: calc(100vw - 28px); padding: 6px; overflow-x: auto; transform: translateX(-50%); background: rgba(75, 102, 95, .94); box-shadow: 0 10px 30px rgba(47, 59, 51, .22); }
.dock-btn { flex: none; max-width: 220px; padding: 6px 14px; font-family: var(--pixel-font); font-size: 12px; letter-spacing: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--paper-2); background: transparent; border: 0; cursor: pointer; }
.dock-btn.is-active { color: var(--paper-3); background: var(--seal); }
.dock-btn:hover { color: var(--paper-3); }
.dock-btn:focus-visible { outline: 2px dashed var(--gold); outline-offset: -2px; }

/* ---------- 响应式 ---------- */
@media (max-width: 1020px) {
  .layout { grid-template-columns: 1fr; }
  .layout-side { position: static; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
}
@media (max-width: 760px) {
  :root { --menubar-h: 52px; }
  .menubar { gap: 10px; padding: 0 12px; }
  .menubar-brand > span:last-child { display: none; }
  .menubar-nav { gap: 0; overflow-x: auto; }
  .menubar-nav a { padding: 6px 7px; white-space: nowrap; }
  .menubar-nav a.is-on::after { left: 7px; right: 7px; }
  .menubar-clock, .menubar-tools [data-icon="rss"] { display: none; }
  /* 手机：卷首改为「标题区 → 横幅山水 → 四时切换」上下排列，文字不再压在画上 */
  .hero { height: auto; display: flex; flex-direction: column; padding-top: var(--menubar-h); overflow: visible; background: transparent; }
  .hero-vignette, .hero-inscription { display: none; }
  .hero-caption { position: static; order: 1; max-width: none; padding: 28px 16px 22px; }
  .hero-now { margin-bottom: 12px; }
  .hero-name { font-size: 48px; letter-spacing: 12px; text-shadow: 3px 3px 0 rgba(47, 59, 51, .1) !important; }
  .hero-name span { margin-top: 10px; }
  .hero-sub { margin: 14px 0 6px; text-shadow: none; }
  .hero-poem-line { display: block; margin: 0 0 18px; font-family: var(--pixel-font); -webkit-font-smoothing: none; font-size: 12px; letter-spacing: 3px; color: var(--seal-dark); }
  .hero-links { gap: 8px; }
  .pill { padding: 6px 12px; }
  .hero-canvas {
    position: relative;
    order: 2;
    inset: auto;
    height: auto;
    aspect-ratio: 16 / 10;
    border-top: 2px solid var(--frame);
    -webkit-mask-image: linear-gradient(to bottom, #000 82%, transparent);
    mask-image: linear-gradient(to bottom, #000 82%, transparent);
  }
  .scene-switch { position: static; order: 3; align-self: center; flex-wrap: wrap; justify-content: center; gap: 4px 10px; margin: 4px 12px 0; padding: 5px 6px; }
  .scene-switch-label { margin-right: 2px; }
  .scene-switch-group:first-child { order: 1; }
  .scene-btn-now { order: 2; }
  .scene-switch-group:nth-child(2) { order: 3; width: 100%; justify-content: center; padding-top: 4px; border-top: 1px dashed var(--line); }
  .scene-btn { padding: 3px 6px; }
  .scene-btn-now { margin-left: 0; padding-left: 10px; }
  .friends { gap: 12px; }
  .friend { padding: 12px 14px; gap: 12px; }
  .friend .avatar-md { width: 44px; height: 44px; font-size: 18px; }
  .colophon-text p:first-child { font-size: 18px; letter-spacing: 2px; line-height: 1.6; }
  .footer { padding: 26px 16px 40px; }
  .layout { padding: 36px 14px 16px; gap: 28px; }
  .page { padding: 0 14px 32px; }
  .page-head h1 { font-size: 36px; letter-spacing: 8px; }
  .sec-no { width: 52px; height: 52px; font-size: 24px; }
  .works { grid-template-columns: 1fr; }
  .works-wide .work-title h3, .work-title h3 { font-size: 36px; }
  .post-link { padding: 18px 8px; }
  .timeline a { flex-wrap: wrap; gap: 4px 12px; }
  .tl-title { flex-basis: 100%; order: 3; }
  .siteinfo { grid-template-columns: 1fr; }
  .colophon { grid-template-columns: 1fr; padding: 28px 22px; gap: 24px; }
  .colophon-sign { align-items: flex-end; }
  .about-grid { grid-template-columns: 1fr; }
  .reader { padding: 28px 18px 36px; }
  .reader-title { font-size: 24px; }
  .win { left: 0 !important; top: 0 !important; width: 100% !important; height: calc(100% - var(--dock-h) - 14px) !important; }
  .win-resize { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .hero-seal { opacity: 1; }
  html { scroll-behavior: auto; }
}
