:root {
  --bg: #06080c;
  --panel: #0a0e14;
  --line: #1b2634;
  --line-hi: rgba(88,166,255,.45);
  --txt: #eaf2ff;
  --dim: #93a3b8;
  --accent: #58a6ff;
  --accent-2: #6ff0c8;
  --mono: ui-monospace, "JetBrains Mono", "Cascadia Mono", Consolas, Menlo, monospace;
  --max: 1080px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--bg);
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--txt);
  isolation: isolate;
  font: 16px/1.72 "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC",
        "HarmonyOS Sans SC", "Source Han Sans SC", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

/* 细网格底纹 + 顶部冷光 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(120,180,255,.055) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(120,180,255,.055) 1px, transparent 1px),
    radial-gradient(900px 520px at 12% -12%, rgba(88,166,255,.10), transparent 62%),
    radial-gradient(760px 420px at 92% 4%, rgba(111,240,200,.07), transparent 60%);
  background-size: 44px 44px, 44px 44px, 100% 100%, 100% 100%;
}

#fx {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 40;
}

/* ---------- 导航 ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(6,8,12,.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 15px clamp(20px, 5vw, 56px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-weight: 600;
  letter-spacing: .1em;
  font-size: 14px;
  text-transform: uppercase;
}
.brand::before {
  content: "";
  width: 7px; height: 7px;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(88,166,255,.9);
}
.brand .dot { color: var(--accent); }
.nav nav { display: flex; gap: 24px; }
.nav a {
  position: relative;
  color: var(--dim);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  transition: color .2s;
}
.nav a::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -6px; height: 1px;
  background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform .25s;
}
.nav a:hover { color: var(--accent); }
.nav a:hover::after { transform: scaleX(1); }

/* ---------- 版式 ---------- */
main {
  position: relative;
  z-index: 10;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 56px) 120px;
}

section { padding: clamp(62px, 11vh, 130px) 0; }

h1 {
  font-size: clamp(40px, 7.4vw, 80px);
  line-height: 1.06;
  letter-spacing: -.035em;
  margin: 12px 0 22px;
  font-weight: 700;
}
.grad {
  background: linear-gradient(104deg, var(--accent) 0%, var(--accent-2) 76%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
h2 {
  position: relative;
  font-size: clamp(24px, 3vw, 34px);
  margin: 0 0 24px;
  letter-spacing: -.015em;
  font-weight: 700;
  padding-top: 18px;
}
h2::before {
  content: "";
  position: absolute; left: 0; top: 0;
  width: 34px; height: 2px;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(88,166,255,.7);
}
h3 { margin: 4px 0 8px; font-size: 17px; letter-spacing: -.01em; }

.eyebrow {
  display: inline-block;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .26em;
  text-transform: uppercase;
  margin: 0;
  padding-left: 12px;
  border-left: 2px solid var(--accent);
  line-height: 1.3;
}
.lede { color: var(--dim); font-size: clamp(15px, 1.5vw, 17px); max-width: 46ch; }
section p { color: #c3d0e0; max-width: 62ch; }

/* ---------- 按钮 ---------- */
.actions { display: inline-flex; gap: 12px; flex-wrap: wrap; margin-top: 30px; }
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 0;
  text-decoration: none;
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--txt);
  transition: color .2s, border-color .2s, background .2s, box-shadow .25s;
}
.btn::after {
  content: "▸";
  opacity: .5;
  transition: transform .2s, opacity .2s;
}
.btn:hover::after { transform: translateX(3px); opacity: 1; }
.btn.primary {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(88,166,255,.07);
}
.btn.primary:hover {
  background: rgba(88,166,255,.16);
  box-shadow: 0 0 0 1px rgba(88,166,255,.5), 0 0 24px rgba(88,166,255,.25);
}
.btn.ghost:hover {
  border-color: var(--accent-2);
  color: var(--accent-2);
  background: rgba(111,240,200,.06);
}

/* ---------- 列表 ---------- */
.facts { list-style: none; padding: 0; margin: 32px 0 0; display: grid; gap: 10px; }
.facts li {
  border-left: 1px solid rgba(88,166,255,.42);
  padding: 2px 0 2px 16px;
  color: var(--dim);
  font-size: 15px;
}
.facts b {
  color: var(--txt);
  font-weight: 600;
  margin-right: 10px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .1em;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  margin-top: 6px;
}
.card {
  position: relative;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.022), rgba(255,255,255,0));
  transition: border-color .25s, background .25s;
}
.card::before,
.card::after {
  content: "";
  position: absolute;
  width: 10px; height: 10px;
  border: 1px solid rgba(88,166,255,.35);
  transition: border-color .25s;
  pointer-events: none;
}
.card::before { left: -1px; top: -1px; border-right: 0; border-bottom: 0; }
.card::after { right: -1px; bottom: -1px; border-left: 0; border-top: 0; }
.card:hover {
  border-color: rgba(88,166,255,.35);
  background: linear-gradient(180deg, rgba(88,166,255,.07), rgba(255,255,255,0));
}
.card:hover::before,
.card:hover::after { border-color: var(--accent); }
.card p { color: #aebccd; font-size: 14px; margin: 0; }
.tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent-2);
  border: 1px solid rgba(111,240,200,.32);
  border-radius: 0;
  padding: 3px 8px;
  margin-bottom: 14px;
}

.links { list-style: none; padding: 0; margin: 4px 0 0; }
.links li { border-bottom: 1px solid var(--line); position: relative; }
.links a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 17px 2px;
  color: var(--txt);
  text-decoration: none;
  font-size: 16px;
  transition: padding .25s, color .25s;
}
.links button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 17px 2px;
  color: var(--txt);
  background: none;
  border: 0;
  font: inherit;
  font-size: 16px;
  text-align: left;
  cursor: pointer;
  transition: padding .25s, color .25s;
}
.links button .hint { color: var(--accent); font-family: var(--mono); font-size: 12px; letter-spacing: .1em; transition: opacity .25s; }
.links button:hover { padding-left: 12px; color: var(--accent); }
.links button.copied .hint { opacity: .9; }
.links a span { color: var(--accent); transition: transform .25s; }
.links a:hover { padding-left: 12px; color: var(--accent); }
.links a:hover span { transform: translateX(4px); }

footer {
  position: relative;
  z-index: 10;
  text-align: center;
  color: #5b687c;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .1em;
  padding: 38px 20px 56px;
  border-top: 1px solid var(--line);
}

/* ---------- 滚动构建：被光标「框出来」后蹦出来 ---------- */
[data-piece] {
  opacity: 0;
  will-change: opacity, transform;
}
[data-piece].in {
  opacity: 1;
  animation: piece-pop .18s cubic-bezier(.2,.9,.2,1) both;
}
@keyframes piece-pop {
  0%   { opacity: 0; transform: translateY(4px) scale(.985); }
  100% { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  [data-piece] { opacity: 1 !important; animation: none !important; }
  html { scroll-behavior: auto; }
}

/* 右下角：时钟 + 自动漫游开关 */
.hud {
  position: fixed;
  right: var(--sbw, 0px);
  bottom: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-right: 0;
  border-bottom: 0;
  border-radius: 0;
  background: rgba(8,11,16,.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--txt);
  user-select: none;
}
.hud-time {
  padding: 9px 14px;
  letter-spacing: .08em;
  font-variant-numeric: tabular-nums;
  border-right: 1px solid var(--line);
}
.hud-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--dim);
  font: inherit;
  font-size: 11.5px;
  letter-spacing: .08em;
  cursor: pointer;
  transition: color .2s, background .2s;
}
.hud-btn .led {
  width: 6px; height: 6px;
  background: #39424f;
  transition: background .2s, box-shadow .2s;
}
.hud-btn[aria-pressed="true"] { color: var(--accent-2); background: rgba(111,240,200,.06); }
.hud-btn[aria-pressed="true"] .led { background: var(--accent-2); box-shadow: 0 0 8px var(--accent-2); }
.hud-btn:hover { color: var(--txt); }

body.away .tower-slit { opacity: 1; }

/* ===== 侧边抽屉：Pleiades 监视塔（细线蓝图） ===== */
.tower {
  position: fixed;
  right: var(--sbw, 0px);
  top: 50%;
  z-index: 55;
  width: 76px;
  height: min(62vh, 470px);
  margin-top: calc(min(62vh, 470px) / -2);
  pointer-events: none;
  transform: translateX(calc(100% + 24px));
  transition: transform .42s cubic-bezier(.25,.9,.2,1);
}
.tower.in { transform: translateX(0); }
.tower svg { width: 100%; height: 100%; display: block; overflow: visible; }

.tower svg path, .tower svg circle { vector-effect: non-scaling-stroke; }
.tw-body {
  fill: rgba(9,11,15,.96);
  stroke: rgba(224,185,106,.62);
  stroke-width: 1;
}
.tw-dome { fill: rgba(9,11,15,.96); stroke: rgba(224,185,106,.55); stroke-width: 1; }
.tw-spire-line { fill: rgba(9,11,15,.96); stroke: rgba(224,185,106,.62); stroke-width: 1; }
.tw-wing { fill: none; stroke: rgba(224,185,106,.20); stroke-width: 1; }
.tw-hair { stroke: rgba(224,185,106,.22); stroke-width: 1; fill: none; }
.tw-dash { stroke: rgba(224,185,106,.30); stroke-width: 1; stroke-dasharray: 3 4; fill: none; }
.tw-minis { transition: opacity .3s ease; }
.tower:not(.in) .tw-minis { opacity: 0; }
.tw-mini { animation: twFloat 7.5s ease-in-out infinite; }
.tw-mini path {
  fill: rgba(9,11,15,.96);
  stroke: rgba(224,185,106,.50);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.tw-mini-dome { fill: rgba(9,11,15,.96); stroke: rgba(224,185,106,.58); }
.tw-mini .tw-mini-hair { stroke: rgba(224,185,106,.20); fill: none; }
@keyframes twFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-3px); }
}
.tw-tip { fill: #f0d9a8; filter: drop-shadow(0 0 6px rgba(240,217,168,.9)); }

.gate .leaf {
  fill: rgba(8,7,4,.95);
  stroke: rgba(224,185,106,.62);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  transition: transform .34s ease, opacity .34s ease;
}
.gate .lite {
  fill: url(#gateGlow);
  stroke: rgba(224,185,106,.55);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  opacity: 0;
  transition: opacity .3s ease;
}
.tower.open .gate .leaf { transform: translate(0, 24px); opacity: 0; }
.tower.open .gate .lite { opacity: 1; }

/* 收起时贴在屏幕边缘的一道塔影 */
.tower-slit {
  position: fixed; right: var(--sbw, 0px); top: 50%; z-index: 54;
  width: 2px; height: min(62vh, 470px); margin-top: calc(min(62vh, 470px) / -2);
  pointer-events: none;
  opacity: 0; transition: opacity .3s ease;
  background: linear-gradient(180deg, rgba(240,217,168,.55), rgba(240,217,168,.10));
  box-shadow: 0 0 10px rgba(240,200,120,.30);
}
body.away .tower-slit { opacity: 1; }

@media (max-width: 560px) {
  .tower, .tower-slit { display: none; }
}

/* 作品卡片可以点进详情页 */
a.card { text-decoration: none; color: inherit; }
a.card:hover { border-color: rgba(88,166,255,.55); }
a.card .more {
  display: block; margin-top: 14px;
  font: 10.5px/1 ui-monospace, Consolas, monospace;
  letter-spacing: .16em; color: var(--accent); opacity: .7;
}
a.card:hover .more { opacity: 1; }

/* 详情页 */
.article { max-width: 720px; margin: 0 auto; padding: clamp(72px, 10vh, 120px) 24px 96px; }
.article h1 { font-size: clamp(28px, 4.2vw, 46px); line-height: 1.24; margin: 12px 0 18px; }
.article .lede { color: var(--dim); margin-bottom: 34px; }
.article p { color: var(--txt); line-height: 1.95; margin: 0 0 20px; }
.article .back { margin-top: 56px; }
.nav .brand { text-decoration: none; color: inherit; }

/* 跨页过渡（Chrome / Edge 支持时生效，不支持就普通跳转） */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .16s ease both; }
::view-transition-new(root) { animation: vt-in .26s ease both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-8px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px); } }

/* 点卡片：卡片刻拉成全屏（用 transform 缩放，不动布局） */
.page-zoom {
  position: fixed;
  left: 0; top: 0;
  width: 100vw; height: 100vh;
  z-index: 38;
  overflow: hidden;
  transform-origin: 0 0;
  will-change: transform;
  background: #0a0d12;
  border: 1px solid rgba(88,166,255,.45);
  transition: transform .5s cubic-bezier(.22,.82,.28,1), border-color .5s ease;
}
.page-zoom.grow {
  transform: translate(0, 0) scale(1) !important;
  border-color: rgba(88,166,255,.18);
}

/* 放大层里的卡片壳：吃掉边框和底色，只留排版 */
.page-zoom > .card {
  width: 100%; height: 100%; margin: 0;
  border: 0; background: none; box-shadow: none;
}
.page-zoom > .card::before,
.page-zoom > .card::after { display: none; }

/* ===== 可点击元素：统一的可点感 ===== */
a, button { cursor: pointer; }
a:focus-visible, button:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; }

/* 导航 */
.nav a { padding: 6px 0; }
.nav a:hover { text-shadow: 0 0 14px rgba(88,166,255,.5); }

/* 按钮：悬浮抬一点，按下回弹 */
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn.primary:hover { box-shadow: 0 0 0 1px rgba(88,166,255,.55), 0 10px 30px -14px rgba(88,166,255,.6); }

/* 链接行：整行可点 —— 左侧竖条 + 背景扫过 */
.links li { position: relative; }
.links li::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: var(--accent); transform: scaleY(0); transition: transform .22s;
}
.links li:hover::before, .links li:focus-within::before { transform: scaleY(1); }
.links a, .links button { transition: padding .25s, color .25s, background .22s; }
.links a:hover, .links button:hover { background: linear-gradient(90deg, rgba(88,166,255,.10), transparent 65%); }

/* 卡片：抬高阴影（不改 transform，避开 piece-pop 动画） */
a.card { transition: border-color .25s, box-shadow .25s, background .25s; }
a.card:hover { box-shadow: 0 16px 44px -26px rgba(88,166,255,.9), inset 0 0 0 1px rgba(88,166,255,.14); }
a.card:hover .more { text-decoration: underline; text-underline-offset: 3px; }

/* HUD 开关 */
.hud-btn:hover { background: rgba(255,255,255,.045); }

/* 站名：也是链接，给点反馈 */
.nav .brand { transition: color .2s, text-shadow .2s; }
.nav .brand:hover { color: #fff; text-shadow: 0 0 16px rgba(88,166,255,.55); }

/* ===== 随手记：书架 ===== */
.shelf-wrap { margin-top: 46px; }
.shelf-title {
  font-size: clamp(20px, 2.4vw, 26px);
  margin: 0 0 10px;
  letter-spacing: .04em;
}
.shelf-title::before {
  content: ""; display: inline-block; width: 22px; height: 1px;
  margin-right: 12px; vertical-align: middle; background: var(--accent);
  box-shadow: 0 0 10px rgba(88,166,255,.7);
}
.shelf-lede { color: var(--dim); margin: 0 0 26px; font-size: 14.5px; }

.shelf { position: relative; padding-bottom: 20px; }
.shelf-row {
  list-style: none; margin: 0; padding: 0 4px;
  display: flex; align-items: flex-end; gap: 7px; flex-wrap: wrap;
  min-height: 212px;
}
.shelf-item { display: flex; align-items: flex-end; height: 212px; }

/* 书脊 */
.spine {
  position: relative;
  width: 44px; height: var(--h, 168px);
  padding: 12px 6px;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  border: 1px solid rgba(224,185,106,.42);
  border-bottom: 0;
  background: linear-gradient(180deg, rgba(224,185,106,.13), rgba(224,185,106,.03) 60%, rgba(0,0,0,0));
  color: #d9c49a;
  font: 12px/1.15 ui-monospace, Consolas, "Microsoft YaHei", monospace;
  cursor: pointer;
  transition: transform .22s ease, border-color .22s, background .22s, color .22s, box-shadow .22s;
}
.spine-t { writing-mode: vertical-rl; text-orientation: mixed; letter-spacing: .18em; }
.spine-d { writing-mode: vertical-rl; font-size: 9.5px; opacity: .5; letter-spacing: .1em; }
.spine:hover {
  transform: translateY(-8px);
  border-color: rgba(224,185,106,.85);
  color: #fff;
  box-shadow: 0 10px 26px -16px rgba(224,185,106,.8);
}
.spine.is-active {
  transform: translateY(-10px);
  border-color: rgba(224,185,106,1);
  background: linear-gradient(180deg, rgba(224,185,106,.26), rgba(224,185,106,.05));
  color: #fff;
  box-shadow: 0 12px 30px -16px rgba(224,185,106,.9);
}

/* 图片板 */
.plate {
  height: 178px; width: 148px; padding: 6px; margin-bottom: 6px;
  border: 1px solid rgba(224,185,106,.4);
  background: #0b0e14;
  cursor: pointer;
  transition: transform .22s, border-color .22s, box-shadow .22s;
}
.plate img { height: 100%; width: 100%; display: block; object-fit: cover; }
.is-plate { flex-direction: column; align-items: center; justify-content: flex-end; gap: 0; }
.is-plate .plate { margin-bottom: 0; border-bottom-color: rgba(224,185,106,.65); }

/* 图片板底座：台口 + 柱身 + 台脚，三段平色，不用渐变 */
.plate-base {
  margin-top: 0;
  display: flex; flex-direction: column; align-items: center;
  position: relative; z-index: 1;
}
.plate-base .cap-cap {
  width: 166px; height: 7px;
  background: #12161f;
  border: 1px solid rgba(224,185,106,.55);
  border-bottom: 0;
}
.plate-base .cap-die {
  width: 148px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  background: #0d1017;
  border-left: 1px solid rgba(224,185,106,.55);
  border-right: 1px solid rgba(224,185,106,.55);
}
.plate-base .cap-foot {
  width: 176px; height: 7px;
  background: #12161f;
  border: 1px solid rgba(224,185,106,.55);
}
.is-plate:has(.plate.is-active) .plate-base .cap-cap,
.is-plate:has(.plate.is-active) .plate-base .cap-die,
.is-plate:has(.plate.is-active) .plate-base .cap-foot { border-color: #e0b96a; }
.is-plate:has(.plate.is-active) .plate-cap { color: #f0d9a8; }
.plate-cap { color: #f0d9a8; }
.plate-cap {
  margin: 0; max-width: 140px; font: 11px/1.3 ui-monospace, Consolas, "Microsoft YaHei", monospace;
  color: var(--dim); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: color .2s;
}

.plate:hover, .plate.is-active {
  transform: translateY(-8px);
  border-color: rgba(224,185,106,.95);
  box-shadow: 0 12px 30px -16px rgba(224,185,106,.85);
}

/* 架板 */
.shelf-board {
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(224,185,106,.55) 12%, rgba(224,185,106,.75) 50%, rgba(224,185,106,.55) 88%, transparent);
  box-shadow: 0 0 20px rgba(224,185,106,.35);
}

/* 阅读区 */
.reader { margin-top: 44px; border-top: 1px solid var(--line); padding-top: 30px; }
.note-meta {
  font: 10.5px/1 ui-monospace, Consolas, monospace;
  letter-spacing: .16em; color: var(--dim); margin: 0 0 12px;
}
.note h2 { font-size: clamp(22px, 3vw, 30px); margin: 0 0 10px; }
.note-sum { color: var(--accent-2); margin: 0 0 22px; }
.note p { color: #c6d2e1; }
.note figure { margin: 22px 0; }
.note img { max-width: 100%; border: 1px solid var(--line); display: block; }
