html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* =========================================================
   呦鹿微澜 · 三主题样式系统
   主题：ink(水墨,默认) / light(浅色) / dark(深色)，由 body[data-theme] 切换
   所有颜色经 CSS 变量派生；新增页面只需引用本文件即自动适配三主题。

   响应式约定（所有页面 / 以后新增页面通用）：
   - 宽度用 min()/clamp()/minmax(min(Npx,100%),1fr)，保证窄屏不溢出
   - 顶栏/页脚用 flex-wrap；卡片网格 auto-fill 自动折行
   - 断点：720px（平板）与 560px（手机），只在此处收紧间距与字号
   ========================================================= */

/* ---------- 主题变量 ---------- */
:root,
body[data-theme="ink"] {
  --paper: #f5f1e8;
  --paper-deep: #ece6d8;
  --ink: #3f3f3f;
  --ink-soft: #5c5c5c;
  --ink-mist: #8a8a86;
  --ink-rgb: 63, 63, 63;
  --chalk: #fdfaf2;
  --line: rgba(63, 63, 63, .18);

  --card-bg: rgba(255, 255, 255, .55);
  --header-bg: rgba(255, 255, 255, .45);
  --footer-bg: rgba(255, 255, 255, .35);
  --drawer-bg: rgba(255, 255, 255, .40);
  --search-bg: rgba(252, 250, 245, .96);
  --modal-bg: var(--paper);
  --orb-bg: rgba(255, 255, 255, .50);

  --grad-text: linear-gradient(165deg, #3f3f3f 12%, #6a6a6a 45%, #a8a8a4 88%);
  --btn-a: #8a8a8a;
  --btn-b: #5a5a5a;
  --wrench-a: #6e6e6e;
  --wrench-b: #4a4a4a;

  --red: #d43a2a;
  --red-deep: #c22f1f;
  --red-rgb: 212, 58, 42;
  --green: #5c9430;
  --green-hi: #79b640;
  --green-rgb: 106, 168, 52;
  --seal: #9e1b1b;
  --seal-rgb: 158, 27, 27;
}

body[data-theme="light"] {
  --paper: #ffffff;
  --paper-deep: #f2f2f2;
  --ink: #000000;
  --ink-soft: #333333;
  --ink-mist: #7f7f7f;
  --ink-rgb: 0, 0, 0;
  --chalk: #ffffff;
  --line: rgba(0, 0, 0, .14);

  --card-bg: rgba(255, 255, 255, .85);
  --header-bg: rgba(255, 255, 255, .75);
  --footer-bg: rgba(255, 255, 255, .60);
  --drawer-bg: rgba(255, 255, 255, .70);
  --search-bg: rgba(255, 255, 255, .97);
  --modal-bg: #ffffff;
  --orb-bg: rgba(255, 255, 255, .80);

  --grad-text: linear-gradient(165deg, #000000 12%, #333333 45%, #8c8c8c 88%);
  --btn-a: #333333;
  --btn-b: #000000;
  --wrench-a: #333333;
  --wrench-b: #000000;

  --red: #dc2626;
  --red-deep: #b91c1c;
  --red-rgb: 220, 38, 38;
  --green: #16a34a;
  --green-hi: #22c55e;
  --green-rgb: 22, 163, 74;
  --seal: #b91c1c;
  --seal-rgb: 185, 28, 28;
}

body[data-theme="dark"] {
  --paper: #12141a;
  --paper-deep: #0c0e13;
  --ink: #e8e6e1;
  --ink-soft: #c9c7c2;
  --ink-mist: #8f8d88;
  --ink-rgb: 232, 230, 225;
  --chalk: #14161c;
  --line: rgba(232, 230, 225, .16);

  --card-bg: rgba(255, 255, 255, .06);
  --header-bg: rgba(255, 255, 255, .05);
  --footer-bg: rgba(255, 255, 255, .04);
  --drawer-bg: rgba(255, 255, 255, .05);
  --search-bg: rgba(24, 26, 32, .97);
  --modal-bg: #1a1d24;
  --orb-bg: rgba(255, 255, 255, .06);

  --grad-text: linear-gradient(165deg, #f5f3ee 12%, #c9c7c2 45%, #8f8d88 88%);
  --btn-a: #f0eee9;
  --btn-b: #c9c7c2;
  --wrench-a: #e8e6e1;
  --wrench-b: #b9b7b2;

  --red: #ff6b57;
  --red-deep: #e04b38;
  --red-rgb: 255, 107, 87;
  --green: #8fd14f;
  --green-hi: #a3e635;
  --green-rgb: 143, 209, 79;
  --seal: #ff8f8f;
  --seal-rgb: 255, 143, 143;
}

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

html, body { height: 100%; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(1100px 620px at 85% -12%, rgba(var(--ink-rgb), .05), transparent 62%),
    radial-gradient(900px 540px at -12% 112%, rgba(var(--ink-rgb), .06), transparent 62%);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color .5s ease, color .5s ease;
}

.grad-text {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stage {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ---------- 主题化滚动条 ---------- */
* { scrollbar-width: thin; scrollbar-color: rgba(var(--ink-rgb), .35) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(var(--ink-rgb), .30);
  border-radius: 8px;
  border: 2px solid var(--paper);
}
::-webkit-scrollbar-thumb:hover { background: rgba(var(--ink-rgb), .5); }

/* ---------- 视图切换 ---------- */
.hero {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  padding: 0;
  overflow-y: auto;
}
body:not([data-view="home"]) .hero { display: none; }
body[data-view="home"][data-last] .hero { animation: heroFadeIn .55s ease both; }
@keyframes heroFadeOut { to { opacity: 0; transform: translateY(-24px); } }
@keyframes heroFadeIn { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

/* ---------- 首页顶部导航 ---------- */
.home-nav {
  flex: none;
  display: flex; align-items: center; justify-content: space-between;
  gap: .8rem; flex-wrap: wrap;
  padding: 1.6rem clamp(1.1rem, 5vw, 3.4rem);
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.nav-left { display: flex; align-items: center; gap: clamp(1.8rem, 4.5vw, 3.6rem); }
.nav-link, .nav-theme {
  position: relative;
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .3rem 0;
  border: none; background: none;
  color: var(--ink); text-decoration: none;
  font-family: inherit;
  font-size: clamp(.92rem, 1.5vw, 1.02rem);
  letter-spacing: .14em;
  cursor: pointer;
  transition: opacity .25s;
}
.nav-link::after, .nav-theme::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 2px; border-radius: 2px;
  background: currentColor;
  transform: scaleX(0); transform-origin: left;
  transition: transform .3s ease;
}
.nav-link:hover::after, .nav-link:focus-visible::after,
.nav-theme:hover::after, .nav-theme:focus-visible::after { transform: scaleX(1); }
.nav-link:focus-visible, .nav-theme:focus-visible { outline: none; }
.nav-theme-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.05em; height: 1.05em;
  font-size: 1.12em; line-height: 1; opacity: .85;
}
/* 深色模式：实心圆挖去一块，形成饱满的厚月牙 */
.nav-theme-icon[data-icon="dark"] {
  border-radius: 50%;
  background: currentColor;
  opacity: 1;
  -webkit-mask: radial-gradient(circle at 70% 30%, transparent 0 .45em, #000 .47em);
  mask: radial-gradient(circle at 70% 30%, transparent 0 .45em, #000 .47em);
}
/* 主题切换按钮整体向左收一点，避免紧贴导航栏右边缘 */
.nav-theme { margin-right: clamp(.75rem, 4vw, 2.8rem); }

/* ---------- 首页主体：头像 + 站名 + 搜索 ---------- */
.hero-center {
  position: relative;
  /* 不收缩：结果列表变长时整块往下长，山形才跟得到底 */
  flex: 1 0 auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: 2.2rem 1.5rem 9rem;
}

/* ---------- 站点数据项（关于页复用） ---------- */
.stat {
  display: flex; align-items: center;
  gap: .7rem;
  width: 100%;
}
.stat-text {
  flex: 1;
  display: flex; flex-direction: column;
  gap: .2rem;
  min-width: 0;
}
.stat-label {
  font-size: .7rem;
  letter-spacing: .18em;
  color: var(--ink-mist);
  white-space: nowrap;
}
.stat-value {
  font-size: clamp(1.12rem, 1.45vw, 1.4rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: .01em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  white-space: nowrap;
}
.stat-value em {
  font-style: normal;
  font-size: .66rem;
  font-weight: 500;
  letter-spacing: .05em;
  color: var(--ink-soft);
  margin-left: .16rem;
}
.stat-icon {
  flex: none;
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(var(--ink-rgb), .045);
  color: var(--ink-soft);
  transition: background-color .25s, color .25s;
}
.stat-icon svg { width: 16px; height: 16px; display: block; }
.stat:hover .stat-icon { background: rgba(var(--ink-rgb), .1); color: var(--ink); }

.avatar {
  flex: none;
  width: min(148px, 32vw);
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(var(--ink-rgb), .18);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  animation: logoFloat 6s ease-in-out infinite;
}
.logo {
  display: block;
  width: 100%; height: 100%;
  object-fit: cover;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.hero-title {
  white-space: nowrap;
  margin-top: clamp(1.1rem, 3vh, 1.8rem);
  font-size: clamp(2.5rem, 4.8vw, 2.75rem);
  line-height: 1.15;
  letter-spacing: .3em;
  text-indent: .3em;
  font-weight: 800;
}
.hero-sub {
  margin-top: .8rem;
  color: var(--ink-mist);
  letter-spacing: .42em;
  text-indent: .42em;
  font-size: clamp(.82rem, 1.5vw, .95rem);
}
.brush-line {
  width: clamp(110px, 14vw, 150px); height: 3px;
  margin: clamp(1.2rem, 3vh, 1.7rem) 0 clamp(1.6rem, 4vh, 2.3rem);
  background: linear-gradient(90deg, transparent, rgba(var(--ink-rgb), .45), transparent);
  border-radius: 3px;
}

/* ---------- 搜索 ---------- */
.search-area {
  position: relative;
  width: min(700px, 88vw);
}
.search-box {
  position: relative;
  width: 100%;
}
.search-icon {
  position: absolute; left: 1.35rem; top: 0;
  width: 2.1rem; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; line-height: 1;
  transform: translateY(-2px);
  color: var(--ink-mist); pointer-events: none;
}
.search-box input {
  width: 100%;
  height: 72px;
  padding: 0 1.8rem 0 3.7rem;
  font-size: 1.05rem;
  font-family: inherit;
  letter-spacing: .04em;
  color: var(--ink);
  background: var(--search-bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  outline: none;
  transition: border-color .25s, box-shadow .25s, background-color .5s;
}
.search-box input::placeholder { color: var(--ink-mist); }
.search-box input:focus {
  border-color: rgba(var(--ink-rgb), .45);
  box-shadow: 0 6px 22px rgba(var(--ink-rgb), .12);
}
.search-results {
  /* 参与排版而不是浮层：结果多时把首页撑长，底部山形才跟得到最底 */
  margin-top: .6rem;
  width: 100%;
  list-style: none;
  background: var(--search-bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 14px 38px rgba(var(--ink-rgb), .18);
  overflow: hidden;
  text-align: left;
}
.search-results li { border-bottom: 1px solid var(--line); }
.search-results li:last-child { border-bottom: none; }
.search-results a {
  display: flex; align-items: center; gap: .7rem;
  padding: .7rem 1rem;
  color: var(--ink); text-decoration: none;
  transition: background-color .2s;
}
.search-results a:hover { background: rgba(var(--ink-rgb), .06); }
.sr-kind {
  flex: none;
  font-size: .68rem; letter-spacing: .1em;
  color: var(--ink-mist);
  border: 1px solid var(--line);
  padding: .12rem .45rem; border-radius: 6px;
}
.sr-body { min-width: 0; }
.sr-title { font-size: .92rem; font-weight: 600; }
.sr-desc {
  font-size: .78rem; color: var(--ink-mist);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sr-desc mark {
  background: rgba(var(--seal-rgb), .16);
  color: var(--ink);
  padding: 0 .12em;
  border-radius: 3px;
}
.sr-empty { padding: .85rem 1rem; font-size: .85rem; color: var(--ink-mist); }

/* ---------- 首页装饰 ---------- */
.mountains {
  --mtn-h: 180px;
  /* sticky + 负边距：内容放得下时贴屏底，列表变长时跟着正文走到底 */
  position: sticky; bottom: 0; z-index: -1;
  display: block; flex: none;
  width: 100%; height: var(--mtn-h);
  margin-top: calc(-1 * var(--mtn-h));
  pointer-events: none;
}
.mountains path:nth-child(1) { fill: rgba(var(--ink-rgb), .10); }
.mountains path:nth-child(2) { fill: rgba(var(--ink-rgb), .18); }
.mountains path:nth-child(3) { fill: rgba(var(--ink-rgb), .30); }

/* ---------- 博客栏：通缉令 + 贡献榜 ---------- */
.orbs {
  position: absolute; inset: 0;
  display: none;
  flex-direction: column;
  /* 子项通栏伸展：work-head 与资源站同宽、分割线通到两缘 */
  align-items: stretch;
  justify-content: flex-start;
  padding: 0 0 2rem;
  overflow-y: auto;
}
body[data-view="orbs"] .orbs { display: flex; animation: fadeIn .5s ease both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
/* 博客栏顶栏与资源站完全同源（work-head / back-btn / work-label），不做任何覆盖 */

/* 主体：flex · 左通缉令区 · 右贡献榜（榜贴右缘 · 纵向拉满） */
.op-stage {
  display: flex;
  /* stretch：纵向堆叠（窄屏）时子项也占满整宽，不被压缩到内容宽度 */
  align-items: stretch;
  width: calc(100% - 3rem);
  max-width: 1440px;
  margin: 1.8rem auto 0;
  min-height: 78vh;
}
.op-posters {
  flex: 0 0 62%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(28px, 3vw, 46px) clamp(22px, 2.4vw, 36px);
  margin-right: clamp(18px, 1.8vw, 28px);
  margin-left: clamp(20px, 2vw, 32px);
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .07);
  box-sizing: border-box;
  position: relative;
  perspective: 1500px;
}
.op-poster-track {
  position: relative;
  width: 100%;
  max-width: 342px;
  aspect-ratio: 1 / 1.3;
  display: flex;
  align-items: center;
  justify-content: center;
}
.op-poster-track .op-poster {
  position: absolute !important;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0 !important;
  margin: 0 !important;
  font-size: clamp(7px, 1vw, 10.5px);
  opacity: 0 !important;
  transition: opacity .4s ease, transform .4s ease;
  transform: scale(.96);
  pointer-events: none;
  animation: none !important;
}
.op-poster-track .op-poster.active {
  opacity: 1 !important;
  transform: scale(1);
  pointer-events: auto;
}
.op-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card-bg);
  color: var(--ink);
  font-size: 1.8rem;
  line-height: 42px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,.1);
  transition: background .2s, transform .2s, opacity .2s;
  -webkit-tap-highlight-color: transparent;
}
.op-arrow:hover { background: var(--paper); transform: translateY(-50%) scale(1.08); }
.op-arrow[hidden] { display: none; }
.op-arrow-left { left: calc(50% - 296px); }
.op-arrow-right { right: calc(50% - 296px); }
.op-thumbs {
  display: flex;
  gap: 10px;
  margin-top: 28px;
  justify-content: center;
}
.op-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: var(--card-bg);
  cursor: pointer;
  padding: 0;
  overflow: hidden;
  transition: transform .2s, border-color .2s, box-shadow .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  font-weight: 700;
  font-family: "STKaiti", "KaiTi", "楷体", serif;
  -webkit-tap-highlight-color: transparent;
}
.op-thumb img { display: none; }
.op-thumb::after { content: attr(data-idx); }
.op-thumb:hover { transform: translateY(-2px); }
.op-thumb.active { border-color: var(--ink); box-shadow: 0 3px 10px rgba(0,0,0,.15); transform: translateY(-2px); }
.op-posters-title {
  position: absolute;
  top: -1.05rem;
  left: 50%;
  transform: translateX(-50%);
  padding: .35rem 1.4rem;
  font-size: 1.7rem;
  font-weight: 800;
  font-family: "STKaiti", "KaiTi", "楷体", "Noto Serif SC", "Songti SC", "STSong", Georgia, serif;
  letter-spacing: .18em;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
}
[data-theme="dark"] .op-posters {
  background: rgba(255, 255, 255, .045);
  border-color: rgba(232, 230, 225, .13);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .32);
}
.op-side {
  flex: 0 0 clamp(308px, 26.4%, 440px);
  margin-left: auto;      /* 靠右：右侧不留大片空白 */
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* 通缉令卡片：参照黑胡子悬赏令（浅羊皮纸 · 长方形头像框 · 3 : 4 竖向） */
.op-poster {
  position: relative;
  display: block;
  width: 100%;
  margin: 0;
  padding: 0 0 130%;
  font-size: clamp(5.5px, 0.88vw, 9.2px);
  border: 1.5px solid rgba(43, 29, 20, .26);
  border-radius: 2px;
  background:
    radial-gradient(ellipse at 50% 42%, #fcf9f2 0%, #f8f2e6 54%, #f1e8d8 100%);
  box-shadow: inset 0 0 30px rgba(120, 95, 45, .07), 0 12px 26px rgba(var(--ink-rgb), .14);
  color: #2b1d14;
  cursor: pointer;
  font-family: inherit;
  overflow: hidden;
  transform: rotateX(0deg) rotateY(0deg);
  transform-origin: 50% 58%;
  transform-style: preserve-3d;
  transition: transform .3s ease, box-shadow .3s ease;
  -webkit-tap-highlight-color: transparent;
}
.op-poster::after {
  content: "";
  position: absolute; inset: 5px;
  border: 1px solid rgba(255, 250, 238, .55);
  pointer-events: none;
}
/* 斜面上的受光渐变：让纸片看起来是有厚度的实体 */
.op-poster::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, .4) 0%, rgba(255, 255, 255, 0) 38%, rgba(90, 70, 40, .04) 70%, rgba(90, 70, 40, .14) 100%);
  z-index: 1;
}
.op-poster:hover {
  transform: rotateX(0deg) rotateY(0deg) translateY(-5px);
  box-shadow: inset 0 0 30px rgba(120, 95, 45, .09), 0 18px 38px rgba(var(--ink-rgb), .2);
}
/* WANTED：顶部超大衬线 · 纯黑 · 字距略开 */
.op-wanted {
  position: absolute; left: 0; right: 0; top: 4.6%;
  text-align: center;
  font-family: "Noto Serif SC", "Songti SC", "STSong", Georgia, serif;
  font-size: 3.6em;
  font-weight: 900;
  letter-spacing: .12em;
  text-indent: .12em;
  line-height: 1;
  color: #111;
}
/* 头像：正中间长方形黑框，约一半宽度，img 填满 */
.avatar-box {
  position: absolute; top: 19.5%; left: 25%; width: 50%; height: 0; padding-bottom: 46%;
  box-sizing: border-box;
  background: #1a1a1a;
  border: 3px solid #111;
  overflow: hidden;
}
.avatar-box img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
/* DEAD OR ALIVE：头像正下方 · 衬线 · 两侧细饰线 */
.op-dead {
  position: absolute; left: 21%; right: 21%; top: 71.6%;
  text-align: center;
  font-style: normal;
  font-family: "Noto Serif SC", "Songti SC", "STSong", Georgia, serif;
  font-size: 1.15em;
  font-weight: 700;
  letter-spacing: .22em;
  text-indent: .22em;
  color: #111;
}
/* 姓名：大号加粗衬线 · 两侧细饰线 */
.op-name {
  position: absolute; left: 8%; right: 8%; top: 76.6%;
  text-align: center;
  font-family: "Noto Serif SC", "Songti SC", "STSong", Georgia, serif;
  font-size: 1.95em;
  font-weight: 900;
  letter-spacing: .04em;
  line-height: 1.15;
  color: #111;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 两侧花纹：DEAD OR ALIVE 与姓名左右的波浪细线（简化点缀） */
.op-dead::before, .op-dead::after,
.op-name::before, .op-name::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 16%;
  height: 4px;
  transform: translateY(-50%);
  background:
    radial-gradient(circle, rgba(43, 29, 20, .55) 0 1px, transparent 1.4px) 0 50% / 7px 4px repeat-x;
  opacity: .75;
  pointer-events: none;
}
.op-dead::before, .op-name::before { left: -21%; }
.op-dead::after, .op-name::after { right: -21%; }
/* 悬赏金：฿ 符号 + 数字 + 尾缀 "-" · 字号略小 */
.op-bounty {
  position: absolute; left: 0; right: 0; top: 83.4%;
  display: flex;
  align-items: baseline;
  justify-content: center;
  color: #111;
}
.op-berry { font-size: 1.35em; font-weight: 900; margin-right: .12em; }
.op-amount { font-size: 1.7em; font-weight: 800; letter-spacing: .02em; }
.op-bounty::after { content: "-"; font-size: 1.7em; font-weight: 800; margin-left: .04em; }
/* 签名：头像正下方 · 居中 · 三行小字（字比之前大） */
.op-sign {
  position: absolute; left: 18%; right: 18%; top: 58.6%;
  font-size: 1.05em;
  line-height: 1.35;
  letter-spacing: .04em;
  color: rgba(43, 29, 20, .62);
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.op-marine {
  position: absolute; right: 7%; bottom: 4.5%;
  font-style: normal;
  font-family: "Noto Serif SC", "Songti SC", "STSong", Georgia, serif;
  font-size: 1.8em;
  font-weight: 900;
  letter-spacing: .06em;
  line-height: 1;
  color: #111;
}

/* 窄屏：贡献榜移到海报下方，海报保持两列 */
@media (max-width: 860px) {
  .op-stage { flex-direction: column; min-height: 0; }
  .op-side { flex: 0 0 auto; margin: 1.4rem 0 0; }
  .op-board { position: static; top: auto; }
}
/* 贡献榜：拉满高度 · 淡边框 */
.op-board {
  position: sticky;
  top: 76px;
  align-self: stretch;
  flex: 1 1 auto;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.15rem 1.25rem 1rem;
}

/* 贡献榜内容（边框 / 圆角 / 吸顶见上方专属规则） */
.op-board {
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .07);
}
/* 暗色主题：降低面板透白、去掉浅色阴影的光晕 */
[data-theme="dark"] .op-board {
  background: rgba(255, 255, 255, .045);
  border-color: rgba(232, 230, 225, .13);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .32);
}
.op-board-title { margin: 0 0 .55rem; font-size: .95rem; font-weight: 800; letter-spacing: .22em; }
.op-board-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.op-board-item {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .62rem .5rem;
  border-radius: 10px;
  border-bottom: 1px dashed var(--line);
  cursor: pointer;
  transition: background .2s ease;
}
.op-board-item:hover,
.op-board-item:focus-visible {
  background: rgba(var(--ink-rgb), .06);
  outline: none;
}
.op-board-item:last-child { border-bottom: none; }
.op-rank { font-family: "Noto Serif SC", "Songti SC", "STSong", serif; font-weight: 900; font-size: .95rem; color: var(--ink-mist); width: 1.7em; }
.op-ava { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); flex: none; }
.op-board-name { flex: 1; min-width: 0; font-weight: 700; letter-spacing: .05em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.op-contri { font-weight: 800; color: var(--ink); letter-spacing: .04em; white-space: nowrap; }
.op-contri small { font-weight: 600; color: var(--ink-mist); margin-left: .25rem; letter-spacing: .08em; }
.op-rule {
  margin: auto 0 0;
  padding-top: .8rem;
  border-top: 1px solid var(--line);
  font-size: .74rem;
  line-height: 1.8;
  color: var(--ink-mist);
  letter-spacing: .04em;
}

/* 海报与榜单入场（仅透明度，避免 fill 占住 transform 影响悬停） */
body[data-view="orbs"] .op-poster { animation: opFade .6s ease .08s both; }
body[data-view="orbs"] .op-side { animation: opFade .6s ease .2s both; }
@keyframes opFade { from { opacity: 0; } to { opacity: 1; } }

/* 点击通缉令：其余元素柔和淡出，海报本体被风卷走（动画由 JS 驱动） */
body.orb-fly .work-head,
body.orb-fly .home-nav,
body.orb-fly .op-side,
body.orb-fly .op-poster:not(.flying) { opacity: 0; transition: opacity .5s ease; }
.op-poster.flying {
  position: relative;
  z-index: 8;
  cursor: default;
  will-change: transform;
  backface-visibility: visible;
  transform-style: preserve-3d;
}
/* 飞行时不受博客栏滚动容器裁剪（纸片可以飞出边界） */
body.orb-fly .orbs { overflow: visible; }

/* 通缉令卷起 / 卷落（JS 动态创建的克隆层与卷边圆筒） */
.roll-layer {
  position: fixed;
  z-index: 90;
  pointer-events: none;
  overflow: hidden;
  isolation: isolate;
  contain: paint;
}
.roll-layer > .op-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  transform: none;
  cursor: default;
  box-shadow: 0 18px 36px rgba(0, 0, 0, .2);
}
.roll-shade {
  position: absolute;
  left: 0; right: 0;
  top: 0;
  height: 120px;
  z-index: 4;
  pointer-events: none;
  background: linear-gradient(to top, rgba(60, 45, 25, .5) 0%, rgba(60, 45, 25, .16) 42%, rgba(60, 45, 25, 0) 100%);
  opacity: 0;
  will-change: transform, opacity;
}
.page-fade {
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  background: var(--paper);
  opacity: 0;
}
.roll-bar {
  position: fixed;
  height: 8px;
  border-radius: 4px;
  transform-origin: 50% 50%;
  background: linear-gradient(to bottom, rgba(255, 255, 255, .95), #efe4cf 45%, #c8b590 100%);
  box-shadow: 0 3px 9px rgba(0, 0, 0, .28), inset 0 -1px 0 rgba(0, 0, 0, .1);
  z-index: 91;
  pointer-events: none;
  opacity: 0;
  will-change: transform, opacity;
}

/* ---------- 博客详情 ---------- */
.blog { position: absolute; inset: 0; display: none; flex-direction: column; }
body[data-view="blog"] .blog { display: flex; animation: fadeIn .45s ease both; }
.blog-head, .forum-head {
  flex: none;
  display: flex; align-items: center; gap: .8rem; flex-wrap: wrap;
  padding: .8rem clamp(1rem, 4vw, 2.4rem);
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.blog-body {
  flex: 1; min-width: 0; min-height: 0; overflow-y: auto;
  padding: 2rem clamp(1rem, 4vw, 2.4rem) 3rem;
}

/* ---------- 博客详情：左侧目录侧栏 ---------- */
.blog-main { flex: 1; min-height: 0; display: flex; }

/* 博客头：头像 + 名字 / 个性签名 */
.blog-profile {
  display: flex; align-items: center;
  gap: clamp(1.2rem, 2.6vw, 1.7rem);
}
.blog-avatar {
  flex: none;
  width: clamp(66px, 8vw, 86px);
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 10px 24px rgba(var(--ink-rgb), .16);
}
.blog-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.blog-profile-text { min-width: 0; }
.blog-profile-text .page-desc { margin-top: .7rem; line-height: 1.75; max-width: 38em; }

.blog-tree-btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .3rem 0;
  border: 0;
  background: none;
  color: var(--ink);
  font-family: inherit;
  font-size: .9rem;
  letter-spacing: .1em;
  cursor: pointer;
  transition: color .25s;
}
.blog-tree-btn:hover { color: var(--ink-soft); }
.blog-tree-btn:focus-visible {
  outline: 2px solid rgba(var(--ink-rgb), .35);
  outline-offset: 3px;
  border-radius: 4px;
}
.blog-tree-icon { display: inline-flex; align-items: center; justify-content: center; }
.blog-tree-icon svg { width: 18px; height: 18px; display: block; }

.blog-side {
  flex: none;
  width: 0;
  padding: 0;
  overflow: hidden;
  visibility: hidden;
  border-right: 1px solid transparent;
  background: rgba(var(--ink-rgb), .025);
  transition: width .3s ease, padding .3s ease, border-color .3s ease, visibility 0s linear .3s;
}
.blog.tree-open .blog-side {
  width: clamp(210px, 22vw, 260px);
  padding: 2rem 1.2rem;
  overflow-y: auto;
  visibility: visible;
  border-right-color: var(--line);
  transition: width .3s ease, padding .3s ease, border-color .3s ease;
}
.blog-side-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: .8rem;
  margin-bottom: 1rem;
  padding-bottom: .7rem;
  border-bottom: 1px solid var(--line);
}
.blog-side-title { font-size: .8rem; font-weight: 700; letter-spacing: .18em; }
.blog-side-sub { font-size: .62rem; letter-spacing: .16em; color: var(--ink-mist); }
#blogTreeList { margin: 0; padding: 0; list-style: none; }
#blogTreeList li + li { margin-top: .15rem; }
#blogTreeList a {
  display: flex; align-items: baseline; gap: .55rem;
  padding: .5rem .4rem;
  border-radius: 8px;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: .84rem;
  line-height: 1.55;
  transition: background-color .2s, color .2s;
}
#blogTreeList a::before {
  content: '»';
  flex: none;
  font-size: .9em;
  color: var(--ink-mist);
}
#blogTreeList a:hover,
#blogTreeList a:focus-visible {
  background: rgba(var(--ink-rgb), .08);
  color: var(--ink);
  outline: none;
}
#blogTreeList a.active {
  background: rgba(var(--ink-rgb), .1);
  color: var(--ink);
  font-weight: 700;
}
#blogTreeList a.tree-folder::after { content: '▾'; margin-left: auto; font-size: .72em; color: var(--ink-mist); }
#blogTreeList ul.tree-kids {
  list-style: none;
  margin: .1rem 0 .35rem;
  padding-left: .95rem;
  border-left: 1px dashed var(--line);
}
#blogTreeList ul.tree-kids li + li { margin-top: .1rem; }
#blogTreeList ul.tree-kids a { font-size: .78rem; padding: .35rem .4rem; }
.blog-crumb {
  display: flex; align-items: center; flex-wrap: wrap; gap: .3rem;
  margin: 0 0 1.1rem;
  font-size: .82rem; letter-spacing: .06em;
}
.blog-crumb button {
  font: inherit;
  color: var(--ink-soft);
  background: none; border: none; border-radius: 6px;
  padding: .15rem .3rem;
  cursor: pointer;
  transition: color .2s, background-color .2s;
}
.blog-crumb button:hover { color: var(--ink); background: rgba(var(--ink-rgb), .07); }
.blog-crumb .crumb-here { color: var(--ink); font-weight: 700; padding: .15rem .3rem; }
.blog-crumb .crumb-sep { color: var(--ink-mist); }

/* ---------- 博客栏：站内阅读 ---------- */
.blog-reader { display: none; max-width: 46em; margin: 0 auto; }
.blog-body.reading .blog-profile,
.blog-body.reading #blogArticles { display: none; }
.blog-body.reading .blog-reader { display: block; animation: readerIn .45s ease both; }
.reader-title { font-size: clamp(1.3rem, 4.5vw, 1.7rem); letter-spacing: .15em; }
.reader-meta { margin: .6rem 0 1.6rem; font-size: .84rem; color: var(--ink-mist); }
#blogArticles.in { animation: readerIn .4s ease both; }
@keyframes readerIn {
  from { opacity: 0; transform: translateY(1.1rem); }
  to   { opacity: 1; transform: none; }
}

@media (max-width: 720px) {
  .blog-main { position: relative; }
  .blog-profile { gap: 1.1rem; align-items: flex-start; }
  .blog-avatar { width: 62px; }
  .blog-profile .page-title {
    font-size: clamp(1.15rem, 5vw, 1.5rem);
    letter-spacing: .12em;
    text-indent: .12em;
  }
  .blog-side {
    position: absolute; top: 0; bottom: 0; left: 0;
    z-index: 6;
    background: var(--search-bg);
  }
  .blog.tree-open .blog-side {
    width: min(78vw, 300px);
    box-shadow: 16px 0 40px rgba(var(--ink-rgb), .18);
  }
  /* 站内阅读：窄屏通栏，正文行距收紧 */
  .blog-reader { max-width: none; }
  /* 正文表格：GFM 渲染样式（宽表可横向滚动） */
.article-content table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin: .9rem 0;
  font-size: .92rem;
}
.article-content th, .article-content td {
  border: 1px solid rgba(var(--ink-rgb), .18);
  padding: .5rem .75rem;
  text-align: left;
}
.article-content th {
  background: rgba(var(--ink-rgb), .07);
  font-weight: 700;
  white-space: nowrap;
}
.article-content tbody tr:nth-child(even) { background: rgba(var(--ink-rgb), .04); }

/* 原文件嵌入查看器（PDF 直接显示原版式） */
.xj-embed { margin: 1rem 0; }
.xj-embed-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  padding: .45rem .8rem;
  background: rgba(var(--ink-rgb), .06);
  border: 1px solid rgba(var(--ink-rgb), .18);
  border-bottom: none;
  border-radius: 12px 12px 0 0;
  color: var(--ink-2);
  font-size: .8rem;
  letter-spacing: .05em;
}
.xj-embed-open { color: var(--xj-primary); font-weight: 700; text-decoration: none; }
.xj-embed-open:hover { text-decoration: underline; }
.xj-embed-pages {
  min-height: 200px;
  background: rgba(var(--ink-rgb), .04);
  border-radius: 0 0 12px 12px;
}
.xj-embed-page { margin: 0 0 .6rem; }
.xj-embed-page:last-child { margin-bottom: 0; }
.xj-embed-loading { padding: 2.5rem 1rem; text-align: center; color: var(--ink-mist); font-size: .85rem; }
.xj-embed-stage { padding: 1.6rem 1rem; text-align: center; color: var(--ink-mist); font-size: .8rem; letter-spacing: .05em; }
.xj-embed-err { padding: 1.2rem 1rem; text-align: center; color: var(--ink-mist); font-size: .85rem; }
.xj-embed-err a { color: var(--xj-primary); font-weight: 700; }
.xj-embed-frame {
  display: block;
  width: 100%;
  height: 82vh;
  border: 1px solid rgba(var(--ink-rgb), .18);
  border-top: none;
  border-radius: 0 0 12px 12px;
  background: #fff;
}

.article-content { line-height: 1.9; }
  .comments-head { flex-wrap: wrap; }
  .comments-note { font-size: .72rem; }
}

/* ---------- 留言板占位 ---------- */
.forum { position: absolute; inset: 0; display: none; flex-direction: column; }
body[data-view="forum"] .forum { display: flex; animation: fadeIn .45s ease both; }
.forum-body {
  flex: 1; min-height: 0; overflow-y: auto;
  display: flex; align-items: center; justify-content: center;
  padding: 2.6rem clamp(1rem, 4vw, 2.4rem) 3rem;
}
.forum-empty {
  display: flex; flex-direction: column; align-items: center;
  gap: .9rem;
  width: min(520px, 100%);
  padding: 2.4rem clamp(1.2rem, 6vw, 3rem);
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 16px 38px rgba(var(--ink-rgb), .12);
  text-align: center;
}
.forum-seal {
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  background: var(--seal); color: #fff;
  font-size: 1.1rem; font-weight: 700;
  transform: rotate(-8deg);
  box-shadow: 0 8px 18px rgba(var(--seal-rgb), .35);
}
.forum-empty .page-desc { max-width: 26em; line-height: 1.75; }
.forum-home {
  margin-top: .4rem;
  padding: .5rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft); text-decoration: none;
  font-size: .88rem; letter-spacing: .1em;
  transition: background-color .25s, color .25s;
}
.forum-home:hover { background: rgba(var(--ink-rgb), .08); color: var(--ink); }
/* 顶栏标识：尺寸与资源站的管理按钮一致，保证两个视图顶栏布局相同 */
.forum-badge {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, var(--wrench-a), var(--wrench-b));
  color: var(--chalk);
  transform: rotate(-6deg);
  box-shadow: 0 4px 10px rgba(var(--ink-rgb), .14);
}
.forum-badge svg { width: 17px; height: 17px; display: block; }

/* ---------- 工具站工作区 ---------- */
.work {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  overflow-y: auto;
  opacity: 0; pointer-events: none;
  transition: opacity .4s ease;
}
body[data-view="tools"] .work { opacity: 1; pointer-events: auto; }

.work-head {
  flex: none;
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: .8rem; flex-wrap: wrap;
  padding: .8rem clamp(1rem, 4vw, 2.4rem);
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.back-btn, .done-btn, .manage-cancel, .manage-delete {
  font-family: inherit;
  font-size: .88rem; letter-spacing: .08em;
  padding: .5rem 1.05rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer; text-decoration: none;
  transition: background-color .25s, color .25s, border-color .25s;
}
.back-btn:hover, .manage-cancel:hover { background: rgba(var(--ink-rgb), .08); color: var(--ink); }
.done-btn { display: none; background: var(--green); border-color: var(--green); color: #fff; }
.done-btn:hover { filter: brightness(1.08); }
.manage-bar { display: none; align-items: center; gap: .6rem; }
.manage-delete { background: var(--red); border-color: var(--red); color: #fff; }
.manage-delete:hover:not(:disabled) { filter: brightness(1.08); }
.manage-delete:disabled { opacity: .45; cursor: not-allowed; }
.head-right { margin-left: auto; display: flex; align-items: center; gap: .7rem; }
.wrench-btn {
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, var(--wrench-a), var(--wrench-b));
  color: var(--chalk);
  cursor: pointer;
  transition: transform .25s, box-shadow .25s;
}
.wrench-btn svg { width: 20px; height: 20px; }
.wrench-btn:hover { transform: rotate(-14deg) scale(1.06); box-shadow: 0 8px 18px rgba(var(--ink-rgb), .3); }
.work-label { font-size: .95rem; font-weight: 700; letter-spacing: .25em; text-indent: .25em; }

body[data-manage="delete"] .manage-bar { display: flex; }
body[data-manage="delete"] #btnHome,
body[data-manage="delete"] #btnWrench { display: none; }
body[data-manage="edit"] .done-btn { display: inline-block; }
body[data-manage="edit"] #btnHome,
body[data-manage="edit"] #btnWrench { display: none; }

.work-body { flex: 1; min-height: 0; display: flex; }
.pane {
  flex: 1; min-width: 0;
  overflow-y: auto;
  padding: 2rem clamp(1rem, 4vw, 2.4rem) 3rem;
}
.pane-tools { display: none; }
body[data-view="tools"] .pane-tools { display: block; }

.page-head { margin-bottom: 1.6rem; }
.page-title { font-size: clamp(1.5rem, 3.5vw, 2.1rem); letter-spacing: .25em; text-indent: .25em; font-weight: 800; }
.page-desc { margin-top: .5rem; color: var(--ink-mist); font-size: .9rem; letter-spacing: .1em; }

/* ---------- 文章 / 专题列表 ---------- */
.topic-list { display: flex; flex-direction: column; gap: 1rem; }
.topic-item {
  display: flex; align-items: center; gap: 1.1rem;
  padding: 1.1rem 1.3rem;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--ink); text-decoration: none;
  transition: transform .25s, box-shadow .25s, border-color .25s, background-color .5s;
}
.topic-item:hover {
  transform: translateX(6px);
  border-color: rgba(var(--ink-rgb), .35);
  box-shadow: 0 12px 28px rgba(var(--ink-rgb), .14);
}
/* 搜索跳进目录时，命中的那一篇淡淡晕一下 */
.topic-item.topic-hit {
  border-color: rgba(var(--ink-rgb), .45);
  box-shadow: 0 0 0 3px rgba(var(--ink-rgb), .10), 0 12px 28px rgba(var(--ink-rgb), .14);
  animation: topicHit 2.2s ease both;
}
@keyframes topicHit {
  0% { background: rgba(var(--ink-rgb), .18); }
  55% { background: rgba(var(--ink-rgb), .09); }
  100% { background: var(--card-bg); }
}
.topic-index {
  flex: none;
  font-size: 1.15rem; font-weight: 700;
  color: var(--ink-mist);
  width: 2.2rem; text-align: center;
}
.topic-body { min-width: 0; flex: 1; }
.topic-body h3 { font-size: 1.02rem; letter-spacing: .05em; }
.topic-body p { margin-top: .35rem; font-size: .82rem; color: var(--ink-mist); line-height: 1.55; }
.topic-count { flex: none; font-size: .78rem; color: var(--ink-mist); letter-spacing: .08em; }
/* 目录页把列表放进 .article-content 里，压住正文排版对卡片的影响 */
.article-content .topic-list { line-height: 1.55; }
.article-content .topic-body h3 { margin: 0; font-size: 1.02rem; letter-spacing: .05em; }
.article-content .topic-body p { margin: .35rem 0 0; }

/* ---------- 工具卡片 ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr));
  gap: 1rem;
}
.card {
  position: relative;
  display: flex; flex-direction: column; gap: .6rem;
  padding: 1.3rem 1.3rem 1.2rem;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--ink); text-decoration: none;
  box-shadow: 0 8px 22px rgba(var(--ink-rgb), .1);
  transition: transform .25s, box-shadow .25s, border-color .25s, background-color .5s;
}
.card:hover { transform: translateY(-5px); box-shadow: 0 18px 40px rgba(var(--ink-rgb), .2); border-color: rgba(var(--ink-rgb), .35); }
.card-name { font-size: 1.08rem; font-weight: 700; letter-spacing: .04em; }
.card-desc { font-size: .84rem; color: var(--ink-mist); line-height: 1.6; flex: 1; }
.card-link { font-size: .76rem; color: var(--ink-soft); letter-spacing: .06em; word-break: break-all; }
.card h3 { font-size: 1.08rem; font-weight: 700; letter-spacing: .04em; }
.card p { font-size: .84rem; color: var(--ink-mist); line-height: 1.6; flex: 1; }
.card-check, .card-del, .card-pen {
  position: absolute;
  width: 26px; height: 26px;
  border-radius: 50%;
  display: none; align-items: center; justify-content: center;
  font-size: .8rem;
  border: 1px solid var(--line);
}
.card-check { top: .7rem; left: .7rem; background: var(--card-bg); color: transparent; }
.card-del { top: -.6rem; right: -.6rem; background: var(--red); color: #fff; border-color: var(--red); cursor: pointer; }
.card-pen { top: -.65rem; right: -.65rem; background: var(--green); color: #fff; border-color: var(--green); cursor: pointer; }
.card-pen svg { width: 14px; height: 14px; }

body[data-manage="delete"] .card-check { display: flex; }
body[data-manage="delete"] .card-del { display: flex; }
body[data-manage="delete"] .card { cursor: pointer; }
body[data-manage="delete"] .card.sel { border-color: var(--red); box-shadow: 0 0 0 2px rgba(var(--red-rgb), .35); }
body[data-manage="delete"] .card.sel .card-check { background: var(--red); border-color: var(--red); color: #fff; }
body[data-manage="edit"] .card-pen { display: flex; }
body[data-view="tools"] .card { animation: cardIn .5s ease both; }
@keyframes cardIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
/* 管理模式：卡片柔和慢速的晃动 + 微抖（须置于 cardIn 之后，同特异性下覆盖入场动画） */
body[data-manage="delete"] .card,
body[data-manage="edit"] .card { animation: jiggle .6s ease-in-out infinite; }
/* 相位错开：每张卡片各自独立晃，不整体同步 */
body[data-manage="delete"] .card:nth-child(3n+2),
body[data-manage="edit"] .card:nth-child(3n+2) { animation-delay: -.2s; }
body[data-manage="delete"] .card:nth-child(3n),
body[data-manage="edit"] .card:nth-child(3n) { animation-delay: -.4s; }
@keyframes jiggle {
  0% { transform: translateX(-1.5px) rotate(-.5deg); }
  25% { transform: translateX(1.2px) rotate(.4deg); }
  50% { transform: translateX(-1px) rotate(-.3deg); }
  75% { transform: translateX(1.5px) rotate(.5deg); }
  100% { transform: translateX(-1.5px) rotate(-.5deg); }
}
.card.card-new { border-color: var(--green); box-shadow: 0 0 0 3px rgba(var(--green-rgb), .35), 0 18px 40px rgba(var(--ink-rgb), .2); }
.grid-empty { padding: 2rem; text-align: center; color: var(--ink-mist); font-size: .95rem; letter-spacing: .1em; }
#marquee {
  position: fixed;
  z-index: 40;
  display: none;
  border: 1px solid rgba(var(--red-rgb), .7);
  background: rgba(var(--red-rgb), .12);
  border-radius: 6px;
  pointer-events: none;
}
#marquee.show { display: block; }

/* ---------- 管理抽屉 ---------- */
.manage-drawer {
  flex: none;
  width: 0;
  overflow: hidden;
  background: var(--drawer-bg);
  border-left: 1px solid transparent;
  transition: width .5s cubic-bezier(.22, .9, .3, 1), border-color .5s, background-color .5s;
}
body[data-view="tools"][data-drawer="on"] .manage-drawer { border-left-color: var(--line); }
.drawer-inner {
  padding: 1rem .6rem 1.4rem;
  display: flex; flex-direction: column; gap: 1rem;
}
.drawer-head {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  padding-bottom: .7rem;
  border-bottom: 1px solid var(--line);
}
.drawer-title { font-size: .95rem; font-weight: 700; letter-spacing: .3em; text-indent: .3em; text-align: center; }
.drawer-x {
  position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px;
  border: none; background: transparent;
  color: var(--ink-mist); font-size: 1.1rem;
  cursor: pointer; border-radius: 8px;
  transition: background-color .2s, color .2s;
}
.drawer-x:hover { background: rgba(var(--ink-rgb), .1); color: var(--ink); }
.manage-actions { display: grid; grid-template-columns: 1fr; gap: .7rem; }
.manage-act {
  display: flex; flex-direction: column; align-items: center; gap: .4rem;
  padding: .8rem .4rem;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink-soft);
  font-family: inherit;
  cursor: pointer;
  transition: background-color .25s, color .25s, border-color .25s, transform .2s;
}
.manage-act:hover { background: rgba(var(--ink-rgb), .07); color: var(--ink); transform: translateY(-2px); }
.manage-act.active { border-color: rgba(var(--ink-rgb), .45); background: rgba(var(--ink-rgb), .09); color: var(--ink); }
.act-icon { width: 26px; height: 26px; }
.act-icon svg { width: 100%; height: 100%; }
.act-text { font-size: .82rem; letter-spacing: .2em; text-indent: .2em; }

/* ---------- 彩蛋时间线 ---------- */
.egg {
  position: absolute; inset: 0; display: none; overflow-y: auto;
  padding: 3rem clamp(1rem, 4vw, 2.4rem) 3rem;
}
body[data-view="egg"] .egg { display: block; animation: fadeIn .5s ease both; }
.egg-back {
  display: inline-block;
  color: var(--ink-soft); text-decoration: none;
  font-size: .9rem; letter-spacing: .1em;
  border: 1px solid var(--line);
  padding: .45rem 1rem; border-radius: 999px;
  background: var(--header-bg);
  margin-bottom: 1.4rem;
  transition: background-color .25s, color .25s;
}
.egg-back:hover { color: var(--ink); background: rgba(var(--ink-rgb), .08); }
.egg-head { margin-bottom: 3rem; text-align: center; }
.egg-title-row { display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 1.1rem; flex-wrap: wrap; }
/* 站名文字内部：100 条线随节拍律动（canvas 裁剪到字形，见 app.js） */
.wave-title {
  position: relative;
  display: inline-block;
  padding: .15em .1em;
  line-height: 1.15;
}
.wave-title .page-title {
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.wave-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
  pointer-events: none;
}
.music-btn {
  width: 58px; height: 58px;
  border: none; background: transparent; cursor: pointer; padding: 0;
  transition: transform .25s;
}
.music-btn:hover { transform: scale(1.08); }
.music-btn svg { width: 100%; height: 100%; }
.music-btn svg g { stroke: var(--ink); }
.music-btn svg ellipse { fill: var(--paper); stroke: var(--ink); }
.music-btn svg ellipse[fill="rgba(35,35,35,0.25)"] { fill: rgba(var(--ink-rgb), .25); }
.music-btn svg path { stroke: var(--ink); }
.music-btn svg .face-bars rect { fill: var(--ink); }
.music-btn svg .face-play { fill: var(--ink); stroke: none; }
body[data-music="on"] .music-btn svg .face-play { display: none; }
body[data-music="off"] .music-btn svg .face-bars { display: none; }
/* 中轴居中 + 节点左右交替 */
.timeline { position: relative; max-width: 620px; margin: 0 auto; }
.timeline::before {
  content: '';
  position: absolute; left: 50%; top: 0; bottom: 0;
  width: 2px; transform: translateX(-50%);
  background: linear-gradient(180deg, transparent, rgba(var(--ink-rgb), .35), transparent);
}
.tl-item { position: relative; width: 50%; padding-bottom: 4.5rem; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item:nth-child(odd) { padding-right: 2.4rem; text-align: right; }
.tl-item:nth-child(even) { margin-left: 50%; padding-left: 2.4rem; text-align: left; }
.tl-item::before {
  content: '';
  position: absolute; top: .4rem;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 4px rgba(var(--ink-rgb), .12);
}
.tl-item:nth-child(odd)::before { right: -5.5px; }
.tl-item:nth-child(even)::before { left: -5.5px; }
.tl-date { font-size: .8rem; color: var(--ink-mist); letter-spacing: .12em; }
.tl-title { margin-top: .3rem; font-size: 1.05rem; font-weight: 700; }
.tl-desc { margin-top: .4rem; font-size: .88rem; color: var(--ink-soft); line-height: 1.7; }

/* ---------- 页脚 ---------- */
.site-footer {
  flex: none;
  display: flex; flex-direction: column; align-items: center; gap: .35rem;
  padding: .9rem clamp(1rem, 4vw, 2.4rem);
  background: var(--footer-bg);
  border-top: 2px solid rgba(var(--ink-rgb), .32);
  font-size: .78rem; color: var(--ink-mist);
  text-align: center;
}
.site-footer .foot-copy { letter-spacing: .08em; }
.site-footer .beian { letter-spacing: .05em; }
.site-footer a { color: var(--ink-soft); text-decoration: none; }
.site-footer a:hover { color: var(--ink); text-decoration: underline; }
/* 页脚只保留在主页，并只展示备案号 */
body:not([data-view="home"]) .site-footer { display: none; }

/* ---------- 独立子页 ---------- */
.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap;
  padding: 1rem clamp(1rem, 4vw, 2.4rem);
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.root-tag { font-size: 1.25rem; font-weight: 800; letter-spacing: .2em; text-decoration: none; }
.page-main { flex: 1; width: min(880px, 100%); margin: 0 auto; padding: 2.4rem clamp(1rem, 4vw, 2.4rem) 3rem; }

/* ---------- 关于本站顶栏：与资源站视图顶栏同构 ---------- */
.about-head { padding: .8rem clamp(1rem, 4vw, 2.4rem); }
.about-head .work-label { font-size: 1.1rem; }

/* ---------- 关于视图（index #about） ---------- */
.about-view {
  position: absolute; inset: 0;
  z-index: 2;
  display: flex; flex-direction: column;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .4s ease, visibility 0s linear .4s;
}
body[data-view="about"] .about-view {
  opacity: 1; visibility: visible; pointer-events: auto;
  transition: opacity .4s ease;
}
.about-body { flex: 1; min-height: 0; overflow-y: auto; }

/* ---------- 关于本站 ---------- */
.about-main {
  width: 100%;
  padding: clamp(1.3rem, 2vw, 2rem) clamp(1.4rem, 3vw, 2.6rem) clamp(1.8rem, 2.6vw, 2.8rem);
}
.about-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.8rem, 4.5vw, 3.4rem);
  align-items: start;
}
.about-sub {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: .18em;
  margin-bottom: 1.1rem;
}
.about-story p {
  color: var(--ink-soft);
  font-size: .93rem;
  line-height: 2;
  letter-spacing: .01em;
}
.about-story p + p { margin-top: .85rem; }
.about-closer { text-align: right; color: var(--ink-soft); opacity: .75; font-size: .85rem; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(.85rem, 1.2vw, 1.1rem);
  margin: 0; padding: 0;
  list-style: none;
}
.about-stats .stat {
  flex-direction: column;
  align-items: flex-start;
  gap: .8rem;
  padding: clamp(1.1rem, 1.4vw, 1.5rem);
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 18px 34px -28px rgba(var(--ink-rgb), .55);
  transition: transform .25s, border-color .25s;
}
.about-stats .stat:hover {
  transform: translateY(-2px);
  border-color: rgba(var(--ink-rgb), .3);
}
.about-stats .stat-icon {
  width: clamp(34px, 2.6vw, 40px);
  height: clamp(34px, 2.6vw, 40px);
  border-radius: 10px;
  background: rgba(var(--ink-rgb), .05);
}
.about-stats .stat-icon svg { width: 17px; height: 17px; }
.about-stats .stat-label { font-size: .69rem; letter-spacing: .16em; }
.about-stats .stat-value { font-size: clamp(1.35rem, 1.8vw, 1.9rem); }

@media (max-width: 760px) {
  .about-grid { grid-template-columns: 1fr; gap: 2rem; }
}

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0;
  z-index: 50;
  display: none; align-items: center; justify-content: center;
  background: rgba(var(--ink-rgb), .45);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  padding: 1.2rem;
}
.modal-mask.open { display: flex; animation: fadeIn .25s ease both; }
.modal-card {
  position: relative;
  width: min(420px, 100%);
  background: var(--modal-bg);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1.8rem 1.7rem 1.7rem;
  box-shadow: 0 26px 70px rgba(0, 0, 0, .35);
  animation: modalIn .3s cubic-bezier(.2, .9, .3, 1.2) both;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(24px) scale(.96); } to { opacity: 1; transform: none; } }
.modal-card.shake { animation: shake .4s ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-9px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(4px); }
}
.modal-seal {
  position: absolute; top: -14px; left: 1.6rem;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  background: var(--seal); color: #fff;
  border-radius: 9px;
  font-size: .95rem; font-weight: 700;
  box-shadow: 0 6px 14px rgba(var(--seal-rgb), .4);
}
.modal-x {
  position: absolute; top: .8rem; right: .8rem;
  width: 30px; height: 30px;
  border: none; background: transparent;
  color: var(--ink-mist); font-size: 1.2rem;
  cursor: pointer; border-radius: 9px;
  transition: background-color .2s, color .2s;
}
.modal-x:hover { background: rgba(var(--ink-rgb), .1); color: var(--ink); }
.modal-title { font-size: 1.3rem; letter-spacing: .2em; text-indent: .2em; }
.modal-sub { margin-top: .45rem; font-size: .82rem; color: var(--ink-mist); }
.modal-input {
  width: 100%;
  margin-top: 1rem;
  padding: .75rem .95rem;
  font-size: .95rem; font-family: inherit;
  color: var(--ink);
  background: var(--search-bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  transition: border-color .25s, box-shadow .25s;
}
.modal-input:focus { border-color: rgba(var(--ink-rgb), .45); box-shadow: 0 4px 16px rgba(var(--ink-rgb), .12); }
.modal-field { display: block; margin-top: .9rem; }
.modal-field span { display: block; font-size: .8rem; color: var(--ink-soft); letter-spacing: .1em; margin-bottom: .35rem; }
.modal-field .modal-input { margin-top: 0; }
.modal-err { margin-top: .7rem; font-size: .8rem; color: var(--red); }
.modal-note { margin-top: .6rem; font-size: .72rem; color: var(--ink-mist); }
.modal-btn {
  width: 100%;
  margin-top: 1.2rem;
  padding: .8rem;
  font-size: .98rem; font-family: inherit; letter-spacing: .3em; text-indent: .3em;
  color: var(--chalk);
  background: linear-gradient(160deg, var(--btn-a), var(--btn-b));
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  transition: filter .25s, transform .2s;
}
.modal-btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.modal-stamp {
  position: absolute; inset: 0;
  display: none; align-items: center; justify-content: center;
  background: rgba(var(--ink-rgb), .06);
  border-radius: 20px;
}
.modal-card.passed .modal-stamp { display: flex; }
.modal-stamp span {
  padding: .6rem 1.4rem;
  border: 3px solid var(--seal);
  color: var(--seal);
  font-size: 1.3rem; font-weight: 800; letter-spacing: .3em; text-indent: .3em;
  border-radius: 10px;
  transform: rotate(-12deg);
  animation: stampIn .4s cubic-bezier(.2, 1.4, .4, 1) both;
}
@keyframes stampIn { from { opacity: 0; transform: rotate(-12deg) scale(2); } to { opacity: 1; transform: rotate(-12deg) scale(1); } }

.dup-mask {
  position: absolute; inset: 0;
  display: none; align-items: center; justify-content: center;
  background: rgba(var(--ink-rgb), .35);
  border-radius: 20px;
  padding: 1.2rem;
}
.dup-mask.open { display: flex; animation: fadeIn .2s ease both; }
.dup-card {
  width: min(320px, 100%);
  background: var(--modal-bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.4rem 1.3rem;
  box-shadow: 0 18px 44px rgba(0, 0, 0, .3);
}
.dup-title { font-size: 1.05rem; font-weight: 700; color: var(--red); }
.dup-msg { margin-top: .6rem; font-size: .85rem; color: var(--ink-soft); line-height: 1.6; }
.dup-btns { display: flex; gap: .7rem; margin-top: 1.1rem; }
.dup-cancel, .dup-replace {
  flex: 1;
  padding: .6rem;
  font-size: .88rem; font-family: inherit;
  border-radius: 10px;
  cursor: pointer;
  transition: filter .2s, background-color .2s;
}
.dup-cancel { background: transparent; border: 1px solid var(--line); color: var(--ink-soft); }
.dup-cancel:hover { background: rgba(var(--ink-rgb), .08); }
.dup-replace { background: var(--red); border: 1px solid var(--red); color: #fff; }
.dup-replace:hover { filter: brightness(1.08); }

/* ---------- 响应式 ---------- */
@media (max-width: 720px) {
  .hero-center { padding: 1.8rem 1.2rem 7rem; }
  .home-nav { padding: 1.2rem 1.2rem; }
  /* 触屏点击区加大到 ~38px */
  .nav-link, .nav-theme { padding: .55rem .1rem; }
  .avatar { width: min(124px, 34vw); }
  .mountains { --mtn-h: 130px; }
  .work-head, .blog-head, .forum-head { padding: .7rem 1rem; }
  .drawer-inner { padding: .9rem .5rem 1.2rem; }
  .op-stage { flex-direction: column; }
  .op-posters { flex: none; }
  .op-board { position: static; }
}
@media (max-width: 560px) {
  .hero-title { font-size: clamp(1.9rem, 9vw, 2.4rem); letter-spacing: .12em; text-indent: .12em; }
  .hero-sub { letter-spacing: .3em; text-indent: .3em; font-size: .78rem; }
  .avatar { width: min(104px, 30vw); }
  .nav-left { gap: 1.4rem; }
  .nav-link, .nav-theme { font-size: .9rem; letter-spacing: .1em; }
  .search-box input { height: 58px; padding-left: 3.2rem; font-size: .95rem; }
  .search-icon { left: 1rem; font-size: 1.5rem; }
  .topic-item { gap: .8rem; padding: 1rem; }
  .topic-count { display: none; }
  .site-footer { justify-content: center; text-align: center; }
  /* 彩蛋时间线：窄屏退化为左侧单轴 */
  .timeline { max-width: none; }
  .timeline::before { left: .45rem; transform: none; }
  .tl-item, .tl-item:nth-child(odd), .tl-item:nth-child(even) {
    width: 100%; margin-left: 0;
    padding: 0 0 2rem 1.9rem;
    text-align: left;
  }
  .tl-item::before, .tl-item:nth-child(odd)::before, .tl-item:nth-child(even)::before {
    left: 0; right: auto;
  }
}

/* ---------- 文章详情页 ---------- */
[hidden] { display: none !important; }
.article-col { color: var(--ink-mist); font-size: .85rem; letter-spacing: .3em; margin-bottom: .4rem; }
.article-content { margin-top: 1.8rem; line-height: 2; font-size: .98rem; overflow-wrap: break-word; }
.article-content h2 { font-size: 1.25rem; letter-spacing: .15em; margin: 2rem 0 .8rem; }
.article-content h3 { font-size: 1.08rem; letter-spacing: .1em; margin: 1.6rem 0 .6rem; }
.article-content h4, .article-content h5 { font-size: 1rem; margin: 1.3rem 0 .5rem; }
.article-content p { margin: .8rem 0; }
.article-content blockquote {
  margin: 1rem 0;
  padding: .6rem 1.1rem;
  color: var(--ink-soft);
  border-left: 3px solid rgba(var(--seal-rgb), .55);
  background: var(--card-bg);
  border-radius: 0 12px 12px 0;
}
.article-content ul, .article-content ol { margin: .8rem 0; padding-left: 1.6rem; }
.article-content li { margin: .3rem 0; }
.article-content code {
  padding: .1rem .4rem;
  font-size: .88em;
  background: rgba(var(--ink-rgb), .08);
  border-radius: 6px;
}
.article-content pre {
  margin: 1rem 0;
  padding: .9rem 1.1rem;
  white-space: pre-wrap; /* 宽度够就整行展示、超长自动换行；只有不可断的长串才触发下面的横向滚动 */
  overflow-x: auto;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.article-content pre code { padding: 0; background: none; }
.article-content img { max-width: 100%; border-radius: 12px; border: 1px solid var(--line); }
.article-content hr { border: none; border-top: 1px dashed var(--line); margin: 1.6rem 0; }
.article-content a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.article-local-note {
  margin-top: 1.4rem;
  padding: .8rem 1.1rem;
  color: var(--ink-mist);
  font-size: .85rem;
  border: 1px dashed var(--line);
  border-radius: 12px;
}

/* ---------- 留言区（免登录 · 先审后发） ---------- */
.comments { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.comments-head { display: flex; align-items: center; gap: .9rem; }
.comments-seal {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; flex: none;
  font-size: 1.3rem; font-weight: 800;
  color: var(--chalk);
  background: var(--seal);
  border-radius: 11px;
  transform: rotate(-6deg);
  box-shadow: 0 6px 16px rgba(var(--seal-rgb), .3);
}
.comments-head-text { flex: 1; }
.comments-title { font-size: 1.1rem; letter-spacing: .25em; }
.comments-note { margin-top: .3rem; color: var(--ink-mist); font-size: .78rem; letter-spacing: .05em; }
.comments-count { color: var(--ink-mist); font-size: .85rem; letter-spacing: .1em; }

.comment-list { list-style: none; margin-top: 1.4rem; display: flex; flex-direction: column; gap: .8rem; }
.comment-item {
  padding: .9rem 1.1rem;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.comment-meta { display: flex; align-items: center; flex-wrap: wrap; gap: .3rem .8rem; font-size: .8rem; color: var(--ink-mist); }
.comment-meta b { color: var(--ink); font-size: .92rem; letter-spacing: .05em; }
.comment-local-badge {
  padding: 0 .45rem;
  font-size: .7rem; line-height: 1.5;
  color: var(--seal);
  border: 1px solid rgba(var(--seal-rgb), .4);
  border-radius: 6px;
}
.comment-content { margin-top: .45rem; font-size: .93rem; line-height: 1.9; white-space: pre-wrap; word-break: break-word; }
.comment-actions { display: flex; gap: .9rem; margin-top: .5rem; }
.comment-actions button, .comment-actions a {
  padding: 0;
  font-size: .78rem; font-family: inherit; letter-spacing: .08em;
  color: var(--ink-mist);
  background: none; border: none;
  cursor: pointer;
  text-decoration: none;
}
.comment-actions button:hover, .comment-actions a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.comment-replies { list-style: none; margin-top: .7rem; display: flex; flex-direction: column; gap: .6rem; }
.comment-replies .comment-item { background: rgba(var(--ink-rgb), .04); }
.comment-empty { padding: 1.6rem; text-align: center; color: var(--ink-mist); letter-spacing: .15em; font-size: .9rem; }

.comment-form { margin-top: 1.4rem; }
.comment-reply-tag {
  display: flex; align-items: center; gap: .7rem;
  margin-bottom: .6rem;
  font-size: .84rem; color: var(--ink-soft);
}
.comment-reply-tag button {
  font-size: .78rem; font-family: inherit;
  color: var(--ink-mist);
  background: none; border: 1px solid var(--line); border-radius: 8px;
  padding: .15rem .55rem;
  cursor: pointer;
}
.comment-fields { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.comment-input {
  width: 100%;
  padding: .7rem .95rem;
  font-size: .92rem; font-family: inherit;
  color: var(--ink);
  background: var(--search-bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  transition: border-color .25s, box-shadow .25s;
}
.comment-input:focus { border-color: rgba(var(--ink-rgb), .45); box-shadow: 0 0 0 3px rgba(var(--ink-rgb), .08); }
.comment-textarea { margin-top: .7rem; resize: vertical; line-height: 1.8; }
.comment-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.comment-msg { margin-top: .7rem; font-size: .85rem; color: var(--red); }
.comment-msg.ok { color: var(--green); }
.comment-form-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: .9rem; }
.comment-policy { color: var(--ink-mist); font-size: .74rem; letter-spacing: .03em; }
.comment-submit {
  flex: none;
  padding: .65rem 1.8rem;
  font-size: .92rem; font-family: inherit; letter-spacing: .3em; text-indent: .3em;
  color: var(--chalk);
  background: linear-gradient(160deg, var(--btn-a), var(--btn-b));
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  transition: filter .25s, transform .2s;
}
.comment-submit:hover { filter: brightness(1.12); }
.comment-submit:active { transform: scale(.98); }
.comment-submit:disabled { opacity: .6; cursor: wait; }

@media (max-width: 560px) {
  .comment-fields { grid-template-columns: 1fr; }
  .comment-form-foot { flex-direction: column; align-items: stretch; text-align: center; }
}

/* ---------- 资源站：左一级分类 + 右标题/标签云/卡片 + 字母条 ---------- */
.res-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: .8rem; flex-wrap: wrap;
  margin-bottom: .7rem;
}
.res-title { font-size: 1.05rem; font-weight: 700; letter-spacing: .06em; }

.res-body {
  display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 1.1rem; align-items: start;
  width: 100%; margin: 0;
  padding: 1.2rem clamp(.6rem, 1.5vw, 1.2rem) 3rem;
}
.res-body.has-rail { grid-template-columns: 200px minmax(0, 1fr) 30px; column-gap: 5px; }
.res-body.has-rail .res-side { margin-right: .85rem; }
.res-side {
  position: sticky; top: 60px;
  height: calc(100vh - 140px); min-height: 320px;
  overflow-y: auto;
  padding: 1rem .9rem;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.res-side-head { color: var(--ink-mist); font-size: .74rem; letter-spacing: .2em; margin-bottom: .6rem; }
.res-tree, .res-tree-sub { list-style: none; }
.res-tree-item + .res-tree-item { margin-top: .15rem; }
.res-tree-btn {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  width: 100%; padding: .45rem .6rem;
  font-size: .86rem; font-family: inherit; text-align: left;
  color: var(--ink-soft);
  background: transparent; border: none; border-radius: 8px; cursor: pointer;
}
.res-tree-btn:hover { background: rgba(var(--ink-rgb), .06); }
.res-tree-item.active > .res-tree-btn { color: var(--ink); font-weight: 700; background: rgba(var(--ink-rgb), .08); }
.res-tree-btn.sub { padding-left: 1.3rem; font-size: .8rem; }
.res-tree-sub { margin: .15rem 0 .3rem .5rem; padding-left: .5rem; border-left: 1px dashed var(--line); }
.res-tree-n { color: var(--ink-mist); font-size: .72rem; }

.res-main { min-width: 0; }
.res-tags { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.res-chip {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .25rem .75rem;
  font-size: .8rem; font-family: inherit;
  color: var(--ink-soft);
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}
.res-chip:hover { background: rgba(var(--ink-rgb), .07); }
.res-chip.active {
  color: var(--chalk);
  background: linear-gradient(160deg, var(--btn-a), var(--btn-b));
  border-color: transparent;
}
.res-chip-n { font-size: .7rem; opacity: .75; }
.res-sort { display: inline-flex; align-items: center; gap: .45rem; color: var(--ink-mist); font-size: .82rem; letter-spacing: .08em; }
.res-sort select {
  padding: .35rem .6rem;
  font-size: .84rem; font-family: inherit;
  color: var(--ink);
  background: var(--search-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.card-tags { display: flex; gap: .3rem; flex-wrap: wrap; margin-top: .55rem; }
.card-tag {
  padding: .08rem .5rem;
  font-size: .68rem; letter-spacing: .03em;
  color: var(--ink-mist);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.res-page { width: 100%; margin: 0; padding: 0 clamp(.6rem, 1.5vw, 1.2rem) 3rem; }
.res-page .res-body { width: 100%; padding: 1.2rem 0 0; }

/* 首字母分组行 + 右侧竖排字母条（仅名称排序时出现，独立占列不遮内容） */
.res-letter {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: .6rem;
  font-size: .8rem; font-weight: 700; letter-spacing: .15em;
  color: var(--ink-mist);
  scroll-margin-top: 70px;
}
.res-letter::after { content: ''; flex: 1; border-top: 1px dashed var(--line); }
.res-rail {
  position: sticky; top: 70px;
  display: flex; flex-direction: column; align-items: center; gap: .05rem;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  padding: .45rem .2rem;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.res-rail-btn {
  width: 1.35rem; height: 1.35rem;
  display: flex; align-items: center; justify-content: center;
  font-size: .68rem; font-family: inherit;
  color: var(--ink-mist);
  background: none; border: none; border-radius: 50%;
  cursor: pointer;
}
.res-rail-btn:hover:not(:disabled) { background: rgba(var(--ink-rgb), .08); color: var(--ink); }
.res-rail-btn:disabled { opacity: .32; cursor: default; }

@media (max-width: 720px) {
  .res-body, .res-body.has-rail { grid-template-columns: 1fr; }
  .res-side { position: static; height: auto; min-height: 0; overflow: visible; }
  .res-rail { display: none; }
}

/* ---------- 图片灯箱（js/lightbox.js）：淡墨遮罩 + 缩放查看 ---------- */
.lb-mask {
  position: fixed; inset: 0; z-index: 70;
  display: flex; align-items: center; justify-content: center;
  background: rgba(18, 18, 18, .88);
  animation: lbFade .22s ease both;
}
.lb-mask[hidden] { display: none; }
.lb-stage {
  max-width: 92vw; max-height: 90vh;
  display: flex; flex-direction: column; align-items: center; gap: .55rem;
}
.lb-img {
  max-width: 92vw; max-height: 82vh; display: block;
  border: 1px solid rgba(240, 238, 232, .35); border-radius: 10px;
  background: #141414; cursor: zoom-in; touch-action: none;
  transition: transform .18s ease;
}
.lb-img.zoomed { cursor: grab; }
.lb-img.grabbing { cursor: grabbing; transition: none; }
.lb-cap {
  margin: 0; font-size: .74rem; letter-spacing: .08em;
  color: rgba(240, 238, 232, .62); user-select: none;
}
.lb-close {
  position: absolute; top: 1rem; right: 1.2rem;
  width: 2.4rem; height: 2.4rem; border-radius: 50%;
  border: 1px solid rgba(240, 238, 232, .4); background: transparent;
  color: rgba(240, 238, 232, .85); font-size: 1.3rem; line-height: 1; cursor: pointer;
}
.lb-close:hover { background: rgba(240, 238, 232, .12); }
body.lb-open { overflow: hidden; }
@keyframes lbFade { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 720px) {
  .lb-img { max-height: 74vh; }
  .lb-cap { font-size: .68rem; padding: 0 1rem; text-align: center; }
}
/* HTML 直出内容：主题统一（字体/颜色/背景）+ 限宽 + 自动缩放容器 */
.html-direct { width: 100%; max-width: 100%; overflow-x: hidden; }
.html-direct-inner { width: 100%; transform-origin: top left; }
.html-direct, .html-direct * {
  font-family: inherit !important;
  color: inherit !important;
  background-color: transparent !important;
  box-sizing: border-box;
}
.html-direct a { color: inherit !important; text-decoration: underline; }
.html-direct img, .html-direct table, .html-direct svg, .html-direct canvas { max-width: 100% !important; height: auto !important; }

/* PDF 嵌入容器：绝不撑破正文 */
.pdf-embed { width: 100%; max-width: 100%; overflow-x: hidden; }
.pdf-embed .pdf-page, .pdf-embed .pdf-holder { width: 100%; max-width: 100%; }
.pdf-embed canvas, .pdf-embed img, .pdf-embed svg { max-width: 100% !important; height: auto !important; display: block; }
/* 正文内任何宽元素统一兜底 */
.article-content, #artBody, .xj-paper, .xj-article { max-width: 100%; }
.article-content img, .article-content canvas, .article-content video, .article-content svg,
.article-content table, .article-content pre,
#artBody img, #artBody canvas, #artBody video, #artBody svg, #artBody table, #artBody pre {
  max-width: 100% !important;
}
.article-content pre, #artBody pre { overflow-x: auto; }

/* PDF 画布随主题反色：深色主题下不再刺眼 */
/* PDF 画布随主题反色：深色下纸张压成与卡片同色的冷调深灰，不再刺眼 */
html[data-xj-theme="dark"] [data-pdf] canvas,
body[data-theme="dark"] [data-pdf] canvas,
.theme-dark [data-pdf] canvas, .pdf-embed canvas {
  filter: url(#yj-pdf-dark);
}
/* PDF 容器底色 = 主题卡片底色，避免一圈突兀边框色 */
html[data-xj-theme="dark"] [data-pdf] { background: #181e24 !important; }
body[data-theme="dark"] [data-pdf] { background: #181e24 !important; }

/* HTML 直出硬约束：任何元素都不得撑破卡片宽度 */
.html-direct-inner, .html-direct-inner * { max-width: 100% !important; box-sizing: border-box !important; }
.html-direct-inner p, .html-direct-inner li, .html-direct-inner td, .html-direct-inner th,
.html-direct-inner h1, .html-direct-inner h2, .html-direct-inner h3, .html-direct-inner h4,
.html-direct-inner span, .html-direct-inner a, .html-direct-inner div, .html-direct-inner section {
  overflow-wrap: anywhere; word-break: break-word;
}
.html-direct-inner table { width: 100% !important; table-layout: fixed !important; }
.html-direct-inner pre, .html-direct-inner code { white-space: pre-wrap !important; overflow-wrap: anywhere; }
.html-direct-inner img, .html-direct-inner video, .html-direct-inner svg,
.html-direct-inner canvas, .html-direct-inner iframe { max-width: 100% !important; height: auto !important; }

/* HTML 直出内容用同源 iframe 承接（自成视口，永不撑宽页面） */
.html-frame { width: 100%; max-width: 100%; }
.html-frame > iframe { width: 100%; border: 0; display: block; background: transparent; }

/* 深色主题：PDF 模块整体融入页面背景（条栏、容器、画布同一底色） */
html[data-xj-theme="dark"] .xj-embed, html[data-xj-theme="dark"] .xj-embed-pages,
body[data-theme="dark"] .xj-embed, body[data-theme="dark"] .xj-embed-pages {
  background: #181e24 !important; border-color: rgba(255,255,255,.07) !important; box-shadow: none !important;
}
html[data-xj-theme="dark"] .xj-embed-bar, body[data-theme="dark"] .xj-embed-bar {
  background: #181e24 !important; border-bottom: 1px solid rgba(255,255,255,.07) !important; color: #8a8f98 !important;
}
html[data-xj-theme="dark"] .xj-embed-bar a, body[data-theme="dark"] .xj-embed-bar a { color: #8fc2ff !important; }

/* 浅色主题：纸面略收敛，贴合白卡片 */
html[data-xj-theme="light"] [data-pdf] canvas, body[data-theme="light"] [data-pdf] canvas { filter: url(#yj-pdf-light); }
/* 水墨主题：纸面微暖，贴合米白卡片 */
html[data-xj-theme="ink"] [data-pdf] canvas, body[data-theme="ink"] [data-pdf] canvas { filter: url(#yj-pdf-ink); }
html[data-xj-theme="ink"] [data-pdf], body[data-theme="ink"] [data-pdf] { background: #fdfaf2 !important; }
html[data-xj-theme="ink"] .xj-embed-bar, body[data-theme="ink"] .xj-embed-bar { background: #fdfaf2 !important; border-bottom: 1px solid rgba(0,0,0,.08) !important; }

/* 深色主题：HTML 内嵌内容整体映射到主题色（像 PDF 一样），源网页强调色经反色保留 */
html[data-xj-theme="dark"] .html-frame iframe,
body[data-theme="dark"] .html-frame iframe { filter: url(#yj-pdf-dark); }

/* 深链防闪现：html 级遮罩（主题纸色底），视图确定后淡出 —— 不会再出现白屏/闪主页 */
html.booting::before{content:"";position:fixed;inset:0;z-index:9999;background:var(--paper,#12141a)}
html::before{content:"";position:fixed;inset:0;z-index:9999;background:var(--paper,#12141a);opacity:0;transition:opacity .22s ease;pointer-events:none}
html.booting::before{opacity:1}


/* 系统开启「减弱动态效果」时，收敛全站动画与过渡 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
