/* ============================================================
   栖迟 · 设计系统
   手写 CSS · 双主题 · 无框架
   ============================================================ */

:root {
  --font-serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "STSong", "SimSun", "Times New Roman", serif;
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", -apple-system, "Segoe UI", "Helvetica Neue", sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", "Fira Code", "SFMono-Regular", Consolas, Menlo, monospace;

  --radius: 14px;
  --radius-sm: 9px;
  --container: 1120px;
  --measure: 700px;
  --header-h: 66px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f3ea;
  --bg-2: #efe8d9;
  --surface: #fffdf6;
  --surface-2: #f3ede0;
  --ink: #211d15;
  --ink-2: #4b4434;
  --muted: #877d67;
  --line: rgba(33, 29, 21, .12);
  --line-strong: rgba(33, 29, 21, .22);
  --accent: #b5402a;
  --accent-ink: #fff6ef;
  --accent-soft: rgba(181, 64, 42, .10);
  --accent-2: #2e5d4f;
  --accent-2-soft: rgba(46, 93, 79, .10);
  --code-bg: #23201a;
  --code-ink: #e9e2d2;
  --code-line: rgba(255, 255, 255, .07);
  --shadow: 0 18px 40px -22px rgba(40, 30, 12, .35);
  --shadow-sm: 0 8px 24px -14px rgba(40, 30, 12, .28);
  --grain-opacity: .5;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #15120e;
  --bg-2: #1c1813;
  --surface: #1d1913;
  --surface-2: #262119;
  --ink: #ece5d4;
  --ink-2: #c6bda6;
  --muted: #8d8370;
  --line: rgba(236, 229, 212, .12);
  --line-strong: rgba(236, 229, 212, .24);
  --accent: #dd6b4a;
  --accent-ink: #211510;
  --accent-soft: rgba(221, 107, 74, .16);
  --accent-2: #79b0a0;
  --accent-2-soft: rgba(121, 176, 160, .14);
  --code-bg: #100e0b;
  --code-ink: #e6dfcd;
  --code-line: rgba(255, 255, 255, .06);
  --shadow: 0 22px 48px -24px rgba(0, 0, 0, .7);
  --shadow-sm: 0 10px 26px -16px rgba(0, 0, 0, .6);
  --grain-opacity: .32;
}

/* ---------------- 基础 ---------------- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16.5px;
  line-height: 1.85;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 85% -10%, var(--accent-soft), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, var(--accent-2-soft), transparent 55%);
  background-attachment: fixed;
  transition: background-color .45s var(--ease), color .45s var(--ease);
  overflow-x: hidden;
}

/* 纸纹颗粒 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.06'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}
:root[data-theme="dark"] body::before { mix-blend-mode: overlay; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink);
  letter-spacing: .01em;
  text-wrap: balance;
}

a { color: inherit; text-decoration: none; }

img, video, svg { max-width: 100%; height: auto; display: block; }

::selection { background: var(--accent); color: var(--accent-ink); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  padding: 10px 18px; background: var(--accent); color: var(--accent-ink);
  border-radius: 0 0 10px 0; font-size: 14px;
}
.skip-link:focus { left: 0; }

/* 滚动条 */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 8px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ---------------- 头部 ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
.site-header__inner { display: flex; align-items: center; gap: 22px; min-height: var(--header-h); padding: 6px 0; flex-wrap: wrap; }


.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); }
.brand__mark-wrap { display: grid; place-items: center; width: 40px; height: 40px; color: var(--accent); }
.brand__mark { width: 38px; height: 38px; }
.brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.brand__name { font-family: var(--font-serif); font-weight: 700; font-size: 20px; letter-spacing: .12em; }
.brand__sub { font-family: var(--font-mono); font-size: 10px; letter-spacing: .22em; color: var(--muted); margin-top: 3px; }

.site-nav { display: flex; gap: 4px; margin-left: auto; }
.nav-link {
  position: relative;
  padding: 8px 14px;
  font-size: 15px;
  color: var(--ink-2);
  border-radius: 8px;
  transition: color .25s, background .25s;
}
.nav-link:hover { color: var(--ink); background: var(--surface-2); }
.nav-link.is-active { color: var(--accent); font-weight: 600; }
.nav-link.is-active::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 3px;
  height: 2px; background: var(--accent); border-radius: 2px;
}

.site-actions { display: flex; gap: 6px; }
.icon-btn {
  display: grid; place-items: center;
  width: 38px; height: 38px;
  border: 1px solid var(--line); border-radius: 10px;
  background: transparent; color: var(--ink-2); cursor: pointer;
  transition: all .25s var(--ease);
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); transform: translateY(-1px); }
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn .i-moon { display: none; }
:root[data-theme="dark"] .icon-btn .i-sun { display: none; }
:root[data-theme="dark"] .icon-btn .i-moon { display: block; }

/* 阅读进度条 */
.reading-bar {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 200;
  pointer-events: none;
}
.reading-bar i {
  display: block; height: 100%; width: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform-origin: 0 50%;
  transform: scaleX(0);
  transition: transform .1s linear;
}

/* ---------------- 首页 Hero ---------------- */
.hero { padding: 88px 0 56px; max-width: 860px; }
.hero__eyebrow {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .34em;
  color: var(--accent);
  text-transform: uppercase;
  margin: 0 0 30px;
  display: flex; align-items: center; gap: 14px;
}
.hero__eyebrow::before { content: ""; width: 46px; height: 1px; background: var(--accent); }
.hero__title {
  font-size: clamp(46px, 8.5vw, 92px);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: .03em;
  margin: 0 0 26px;
}
.hero__title em {
  font-style: normal;
  color: var(--accent);
  position: relative;
}
.hero__title em::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 4px; height: 10px;
  background: var(--accent-soft);
  z-index: -1;
  border-radius: 3px;
}
.hero__sub { max-width: 36em; font-size: 17px; color: var(--ink-2); margin: 0 0 40px; }
.hero__name { color: var(--accent); font-weight: 600; }
.hero__stats { display: flex; gap: 44px; margin: 0 0 44px; }
.hero__stat b {
  display: block; font-family: var(--font-serif); font-size: 34px; font-weight: 700;
  color: var(--ink); line-height: 1;
}
.hero__stat span { font-size: 13px; color: var(--muted); letter-spacing: .08em; }
.hero__scroll a {
  font-size: 14.5px; color: var(--muted); letter-spacing: .1em;
  transition: color .25s;
}
.hero__scroll a:hover { color: var(--accent); }

/* ---------------- 区块 ---------------- */
.section { padding: 40px 0 64px; }
.section__head { display: flex; align-items: baseline; gap: 18px; margin-bottom: 34px; }
.section__title { font-size: clamp(24px, 3.4vw, 32px); margin: 0; white-space: nowrap; }
.section__rule { flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-strong), transparent); transform: translateY(-5px); }
.section__more { font-size: 14px; color: var(--muted); white-space: nowrap; transition: color .25s; }
.section__more:hover { color: var(--accent); }

/* ---------------- 卡片 ---------------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 26px; }

.card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  transition: transform .4s var(--ease), box-shadow .4s var(--ease), border-color .4s var(--ease);
}
.card::before {
  content: "";
  position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: scaleX(0); transform-origin: 0 50%;
  transition: transform .45s var(--ease);
  z-index: 2;
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.card:hover::before { transform: scaleX(1); }
.card__link { display: block; height: 100%; padding: 26px 26px 22px; }
.card__meta {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-mono); font-size: 12px; color: var(--muted);
  margin-bottom: 16px;
}
.card__index { font-family: var(--font-serif); font-size: 22px; font-weight: 700; color: var(--accent); opacity: .55; line-height: 1; }
.card__read { margin-left: auto; }
.card__title { font-size: 21px; margin: 0 0 10px; transition: color .3s; }
.card__link:hover .card__title { color: var(--accent); }
.card__excerpt {
  font-size: 14.5px; color: var(--ink-2); line-height: 1.75; margin: 0 0 18px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card__tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.card__more { font-size: 13.5px; color: var(--muted); letter-spacing: .06em; transition: color .3s, letter-spacing .3s; }
.card__link:hover .card__more { color: var(--accent); letter-spacing: .1em; }

.card--featured { grid-column: 1 / -1; }
.card--featured .card__link { display: grid; grid-template-columns: minmax(260px, 42%) 1fr; gap: 0; padding: 0; }
.card--featured .card__cover { position: relative; min-height: 260px; background: var(--surface-2); }
.card--featured .card__cover-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card--featured .card__body { padding: 34px 34px 30px; display: flex; flex-direction: column; }
.card--featured .card__title { font-size: clamp(24px, 3vw, 30px); }
.card--featured .card__excerpt { -webkit-line-clamp: 4; }
.card--featured .card__flag {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .18em;
  color: var(--accent); border: 1px solid var(--accent); border-radius: 999px; padding: 3px 10px;
}
.card--featured .card__more { margin-top: auto; }

.tag-chip {
  font-family: var(--font-mono); font-size: 12px;
  color: var(--ink-2);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 3px 11px;
  background: var(--surface);
  transition: all .25s var(--ease);
}
.tag-chip:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 12px; max-width: 760px; }
.tag-chip--cloud {
  font-size: calc(13px + var(--tz, 1) * 2.2px);
  padding: calc(6px + var(--tz, 1) * 1px) calc(14px + var(--tz, 1) * 2px);
}
.tag-chip--cloud em { font-style: normal; color: var(--muted); margin-left: 6px; font-size: .78em; }

/* ---------------- 通用页头 ---------------- */
.page-head { padding: 76px 0 44px; }
.page-head__eyebrow {
  font-family: var(--font-mono); font-size: 12.5px; letter-spacing: .34em;
  color: var(--accent); text-transform: uppercase; margin: 0 0 18px;
}
.page-head__title { font-size: clamp(38px, 6vw, 60px); margin: 0 0 16px; }
.page-head__desc { color: var(--ink-2); max-width: 40em; margin: 0; }

/* ---------------- 文章页 ---------------- */
.post { padding: 56px 0 80px; }
.post__head { max-width: var(--measure); margin: 0 auto 56px; }
.post__meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 12.5px; color: var(--muted);
  margin-bottom: 24px;
}
.post__meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--line-strong); }
.post__title { font-size: clamp(32px, 5vw, 50px); line-height: 1.25; margin: 0 0 20px; }
.post__desc { font-size: 17px; color: var(--ink-2); margin: 0 0 24px; line-height: 1.8; }
.post__tags { display: flex; flex-wrap: wrap; gap: 8px; }

.post__layout {
  display: grid;
  grid-template-columns: minmax(0, var(--measure)) 232px;
  gap: 56px;
  justify-content: center;
  align-items: start;
}
.toc-wrap { grid-column: 2; grid-row: 1; }
.prose { grid-column: 1; grid-row: 1; }

/* 目录 */
.toc-wrap { position: sticky; top: calc(var(--header-h) + 28px); max-height: calc(100vh - var(--header-h) - 56px); overflow: auto; padding-right: 4px; }
.toc__toggle {
  display: none;
  font-family: var(--font-serif); font-size: 16px; font-weight: 700;
  color: var(--ink); background: none; border: none; cursor: pointer; padding: 0;
}
.toc__caret { display: inline-block; transition: transform .3s var(--ease); }
.toc.is-open .toc__caret { transform: rotate(180deg); }
.toc__nav ol { list-style: none; margin: 0; padding: 0; }
.toc__nav li { margin: 0; }
.toc__nav a {
  position: relative;
  display: block;
  font-size: 13.5px;
  color: var(--muted);
  padding: 5px 0 5px 14px;
  border-left: 2px solid transparent;
  line-height: 1.5;
  transition: color .25s, border-color .25s, padding-left .25s;
}
.toc__nav a:hover { color: var(--ink); }
.toc__nav a.is-active { color: var(--accent); border-left-color: var(--accent); padding-left: 18px; }
.toc__nav ol ol a { font-size: 12.5px; padding-left: 26px; }

/* ---------------- 正文排版 ---------------- */
.prose { min-width: 0; font-size: 17px; line-height: 1.95; color: var(--ink); }
.prose > :first-child { margin-top: 0; }

.prose p { margin: 1em 0; }
.prose h2, .prose h3, .prose h4, .prose h5, .prose h6 { scroll-margin-top: calc(var(--header-h) + 20px); }

.prose h2 {
  font-size: 27px;
  margin: 2.3em 0 .85em;
  padding-bottom: .35em;
  border-bottom: 1px solid var(--line);
}
.prose h2::before {
  content: "";
  display: inline-block;
  width: .42em; height: .42em;
  background: var(--accent);
  transform: rotate(45deg) translateY(-2px);
  margin-right: .55em;
  border-radius: 2px;
}
.prose h3 { font-size: 21px; margin: 2em 0 .7em; }
.prose h4 { font-family: var(--font-sans); font-size: 17px; margin: 1.8em 0 .6em; }

.prose .anchor {
  display: inline-block;
  margin-left: .45em;
  color: var(--line-strong);
  font-weight: 400;
  opacity: 0;
  transition: opacity .25s, color .25s;
}
.prose h2:hover .anchor, .prose h3:hover .anchor, .prose h4:hover .anchor { opacity: 1; }
.prose .anchor:hover { color: var(--accent); }

.prose a:not(.anchor) {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
  text-underline-offset: 4px;
  text-decoration-thickness: 1.5px;
  transition: text-decoration-color .25s, background .25s;
}
.prose a:not(.anchor):hover { text-decoration-color: var(--accent); background: var(--accent-soft); border-radius: 3px; }

.prose strong { color: var(--ink); font-weight: 700; }
.prose em { font-family: var(--font-serif); }

.prose ul, .prose ol { margin: 1em 0; padding-left: 1.6em; }
.prose li { margin: .45em 0; }
.prose li::marker { color: var(--accent); }
.prose ul li::marker { content: "·  "; font-weight: 700; }

.prose .task-list-item { list-style: none; margin-left: -1.4em; display: flex; align-items: baseline; gap: 10px; }
.prose .task-list-item input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;
  width: 17px; height: 17px; margin: 0; flex: none;
  border: 1.6px solid var(--line-strong); border-radius: 5px;
  background: var(--surface);
  display: grid; place-items: center;
  transform: translateY(3px);
}
.prose .task-list-item input[type="checkbox"]::after {
  content: ""; width: 8px; height: 5px;
  border-left: 2px solid var(--accent-ink); border-bottom: 2px solid var(--accent-ink);
  transform: rotate(-45deg) translateY(-1px);
  opacity: 0;
}
.prose .task-list-item input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
.prose .task-list-item input[type="checkbox"]:checked::after { opacity: 1; }
.prose .task-list-item.is-checked { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-strong); }

.prose blockquote {
  margin: 1.8em 0;
  padding: 6px 0 6px 26px;
  border-left: 3px solid var(--accent);
  font-family: var(--font-serif);
  font-size: 18px;
  color: var(--ink-2);
}
.prose blockquote p { margin: .5em 0; }
.prose blockquote blockquote { margin: 1em 0 0; }

/* 提示框 */
.admon {
  margin: 1.9em 0;
  border: 1px solid var(--line);
  border-left-width: 3px;
  border-radius: var(--radius-sm);
  padding: 18px 22px 16px;
  background: var(--surface);
}
.admon__head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.admon__icon { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; color: var(--accent-ink); font-weight: 700; }
.admon__icon svg { width: 15px; height: 15px; }
.admon__title { font-weight: 700; font-size: 15px; }
.admon__body { font-size: 15px; color: var(--ink-2); }
.admon__body p { margin: .4em 0; }
.admon__body :first-child { margin-top: 0; }
.admon__body :last-child { margin-bottom: 0; }

.admon--note { border-left-color: var(--accent-2); }
.admon--note .admon__icon { background: var(--accent-2); }
.admon--tip { border-left-color: #3f7d4e; }
.admon--tip .admon__icon { background: #3f7d4e; }
.admon--info { border-left-color: #3a6ea5; }
.admon--info .admon__icon { background: #3a6ea5; }
.admon--warn { border-left-color: #b08a2e; }
.admon--warn .admon__icon { background: #b08a2e; }
.admon--danger { border-left-color: var(--accent); }
.admon--danger .admon__icon { background: var(--accent); }
.admon--success { border-left-color: #3f7d4e; }
.admon--success .admon__icon { background: #3f7d4e; }
.admon--question { border-left-color: #7a5ca8; }
.admon--question .admon__icon { background: #7a5ca8; }
.admon--quote { border-left-color: var(--muted); background: var(--surface-2); }
.admon--quote .admon__icon { background: var(--muted); }

/* 行内代码 */
.inline-code {
  font-family: var(--font-mono);
  font-size: .88em;
  color: var(--accent-2);
  background: var(--accent-2-soft);
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid color-mix(in srgb, var(--accent-2) 22%, transparent);
}

/* 代码块 */
.codeblock {
  margin: 1.9em 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--code-bg);
  border: 1px solid var(--code-line);
  box-shadow: var(--shadow-sm);
}
.codeblock__head {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  background: color-mix(in srgb, var(--code-bg) 88%, #fff 4%);
  border-bottom: 1px solid var(--code-line);
  font-family: var(--font-mono); font-size: 12px;
}
.codeblock__head--bare { justify-content: flex-end; border-bottom-color: transparent; }
.codeblock__file { color: var(--code-ink); opacity: .85; font-weight: 600; }
.codeblock__file::before { content: "📄"; margin-right: 7px; opacity: .7; }
.codeblock__lang {
  color: var(--accent);
  letter-spacing: .08em; text-transform: uppercase;
  padding: 2px 9px; border-radius: 6px;
  background: var(--accent-soft);
}
.codeblock__copy {
  margin-left: auto;
  font-family: var(--font-mono); font-size: 12px;
  color: var(--code-ink); opacity: .75;
  background: transparent; border: 1px solid var(--code-line);
  padding: 4px 12px; border-radius: 7px; cursor: pointer;
  transition: all .25s var(--ease);
}
.codeblock__copy:hover { opacity: 1; color: var(--accent); border-color: var(--accent); }
.codeblock__copy.is-copied { color: #7fbf8f; border-color: #7fbf8f; }
.codeblock__pre {
  margin: 0; padding: 16px 0;
  overflow: auto;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--code-ink);
  tab-size: 4;
  scrollbar-width: thin;
}
.cline { display: flex; padding: 0 16px; }
.cline:hover { background: rgba(255,255,255,.035); }
.cline__num {
  flex: none;
  width: 2.6em;
  text-align: right;
  padding-right: 1.2em;
  color: rgba(233, 226, 210, .32);
  user-select: none;
  -webkit-user-select: none;
}
.cline__code { white-space: pre; }
.codeblock__pre:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* 语法配色（基于深色面板） */
.tok--keyword { color: #e98a5f; }
.tok--string { color: #a9c08a; }
.tok--number { color: #d9a86c; }
.tok--comment { color: #8a8271; font-style: italic; }
.tok--function { color: #7fc0b6; }
.tok--builtin { color: #9fb4e8; }
.tok--operator { color: #c9b8a0; }
.tok--punct { color: #a99f8d; }
.tok--tag { color: #e98a5f; }
.tok--attr { color: #9fb4e8; }
.tok--key { color: #9fb4e8; }
.tok--property { color: #d8b57c; }
.tok--variable { color: #e5c07b; }
.tok--preproc { color: #c678dd; }
.tok--decorator { color: #c678dd; }
.tok--type { color: #d19a66; }
.tok--regexp { color: #a9c08a; }
.tok--addition { color: #98c379; }
.tok--deletion { color: #e06c75; }
.tok--meta { color: #61afef; }
.tok--emphasis { color: #e5c07b; font-style: italic; }
.tok--title { color: #61afef; font-weight: 600; }
.tok--bullet { color: #e98a5f; }
.tok--quote { color: #8a8271; }
.tok--link { color: #61afef; }
.tok--url { color: #61afef; }
.tok--color { color: #d9a86c; }
.tok--pseudo { color: #c678dd; }

/* 表格 */
.table-wrap { margin: 1.9em 0; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; }
.prose th, .prose td { padding: 11px 16px; border-bottom: 1px solid var(--line); text-align: left; }
.prose th { font-family: var(--font-sans); font-weight: 700; background: var(--surface-2); white-space: nowrap; }
.prose tr:last-child td { border-bottom: none; }
.prose tbody tr { transition: background .2s; }
.prose tbody tr:hover { background: var(--surface-2); }

/* 图片 */
.prose img:not(.gallery__item img) {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  margin: 1.7em auto;
  box-shadow: var(--shadow-sm);
  cursor: zoom-in;
  transition: transform .4s var(--ease), box-shadow .4s var(--ease);
}
.prose img:not(.gallery__item img):hover { transform: scale(1.01); box-shadow: var(--shadow); }
.prose-figure { margin: 1.8em auto; }
.prose-figure img { border-radius: var(--radius); border: 1px solid var(--line); cursor: zoom-in; }
.prose figcaption {
  text-align: center; font-size: 13.5px; color: var(--muted);
  margin-top: 10px; font-family: var(--font-serif);
}

/* 画廊 */
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin: 1.9em 0; }
.gallery__item { margin: 0; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.gallery__item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; cursor: zoom-in; transition: transform .5s var(--ease); }
.gallery__item:hover img { transform: scale(1.045); }
.gallery__item figcaption { padding: 8px 12px; font-size: 12.5px; color: var(--muted); text-align: center; }

/* 音视频 */
.media { margin: 1.9em 0; position: relative; }
.media audio { width: 100%; height: 48px; accent-color: var(--accent); }
.media--audio { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 8px; background: var(--surface); }
.media--video video, .media--embed .embed { border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow-sm); background: #000; }
.media__badge {
  position: absolute; top: 8px; right: 12px;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .12em;
  color: var(--muted);
}
.embed { position: relative; padding-top: 56.25%; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: var(--radius); }

/* 键帽 */
.kbd-group { display: inline-flex; gap: 6px; align-items: center; vertical-align: middle; }
kbd {
  font-family: var(--font-mono); font-size: 12.5px;
  padding: 3px 9px;
  border: 1px solid var(--line-strong); border-bottom-width: 2.5px;
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink-2);
}
.kbd-group kbd + kbd::before { content: "+"; margin-right: 6px; color: var(--muted); font-size: 11px; }

/* 文件徽章 */
.file-chip {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 13.5px;
  border: 1px dashed var(--line-strong); border-radius: 999px;
  padding: 7px 16px; color: var(--ink-2); background: var(--surface);
  transition: all .25s var(--ease);
}
.file-chip::before { content: "⬇"; color: var(--accent); }
.file-chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* 分割线 */
.prose hr {
  border: none; height: 1px; margin: 3em auto;
  background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
  position: relative; width: 70%;
}
.prose hr::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 7px; height: 7px; transform: translate(-50%, -50%) rotate(45deg);
  background: var(--bg); border: 1.5px solid var(--line-strong);
}

/* 脚注 */
.footnotes {
  margin-top: 3.4em; padding-top: 1.4em;
  border-top: 1px solid var(--line);
  font-size: 14px; color: var(--muted);
}
.footnotes h2 { font-size: 17px; margin: 0 0 10px; border-bottom: none; }
.footnotes h2::before { display: none; }
.footnotes ol { padding-left: 1.4em; }
.footnotes li { margin: .5em 0; }
.fn-ref { line-height: 1; }
.fn-ref a {
  font-family: var(--font-mono); font-size: 12px;
  color: var(--accent); text-decoration: none !important;
  background: var(--accent-soft); border-radius: 4px; padding: 1px 5px; margin: 0 2px;
}
.fn-back { color: var(--accent); font-size: 12px; text-decoration: none !important; }

/* details / summary */
.prose details {
  margin: 1.6em 0;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); overflow: hidden;
}
.prose summary {
  cursor: pointer; padding: 14px 20px;
  font-weight: 700; font-size: 15.5px;
  list-style: none;
  display: flex; align-items: center; gap: 10px;
  transition: color .25s;
}
.prose summary::-webkit-details-marker { display: none; }
.prose summary::before {
  content: ""; width: 9px; height: 9px;
  border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg); transition: transform .3s var(--ease);
  margin-top: -3px;
}
.prose details[open] summary::before { transform: rotate(45deg); margin-top: 3px; }
.prose summary:hover { color: var(--accent); }
.prose details .details-body { padding: 0 20px 16px; font-size: 15px; color: var(--ink-2); }

/* 文章导航 */
.post-nav {
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px;
  max-width: var(--measure); margin: 60px auto 0;
}
.post-nav__item {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 24px; background: var(--surface);
  transition: all .3s var(--ease);
  display: flex; flex-direction: column; gap: 8px;
}
.post-nav__item--next { text-align: right; }
.post-nav__item:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.post-nav__dir { font-family: var(--font-mono); font-size: 12px; color: var(--muted); letter-spacing: .12em; }
.post-nav__title { font-family: var(--font-serif); font-weight: 700; font-size: 17px; line-height: 1.5; }
.post-nav__item:hover .post-nav__title { color: var(--accent); }
.post-nav__item.is-empty { opacity: .5; }
.post-nav__item.is-empty:hover { border-color: var(--line); box-shadow: none; transform: none; }

/* 相关阅读 */
.related { max-width: var(--measure); margin: 56px auto 0; }
.related__title { font-size: 24px; margin: 0 0 22px; }
.cards--related { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.cards--related .card__link { padding: 22px 22px 18px; }
.cards--related .card__title { font-size: 18px; }
.cards--related .card__excerpt { -webkit-line-clamp: 2; }

/* ---------------- 归档 ---------------- */
.arc-year { margin-bottom: 48px; }
.arc-year__title {
  display: flex; align-items: center; gap: 14px;
  font-size: 30px; margin: 0 0 20px;
}
.arc-year__count {
  font-family: var(--font-mono); font-size: 12px; font-weight: 400;
  color: var(--accent); background: var(--accent-soft);
  border-radius: 999px; padding: 2px 10px;
}
.arc-list { list-style: none; margin: 0; padding: 0; }
.arc-item {
  display: grid; grid-template-columns: 120px 1fr auto; gap: 20px; align-items: baseline;
  padding: 15px 6px;
  border-bottom: 1px solid var(--line);
}
.arc-item:first-child { border-top: 1px solid var(--line); }
.arc-item__date { font-family: var(--font-mono); font-size: 13px; color: var(--muted); }
.arc-item__title { font-family: var(--font-serif); font-size: 18.5px; font-weight: 700; transition: color .25s; }
.arc-item__title:hover { color: var(--accent); }
.arc-item__tags { display: flex; gap: 6px; }
.arc-item__tags .tag-chip { font-size: 11px; padding: 2px 8px; }

/* ---------------- 关于 ---------------- */
.about-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 48px; padding-bottom: 70px; }
.about-card {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); padding: 34px 28px; text-align: center;
  align-self: start; position: sticky; top: calc(var(--header-h) + 28px);
}
.about-avatar { width: 132px; margin: 0 auto 20px; }
.about-card__name { font-size: 26px; margin: 0 0 6px; }
.about-card__role { font-size: 13.5px; color: var(--muted); letter-spacing: .1em; margin: 0 0 16px; }
.about-card__bio { font-size: 14.5px; color: var(--ink-2); margin: 0 0 22px; }
.about-card__links { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.about-card__links a {
  font-family: var(--font-mono); font-size: 13px;
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 16px;
  color: var(--ink-2); transition: all .25s var(--ease);
}
.about-card__links a:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.about-body { max-width: 640px; }

/* ---------------- 404 ---------------- */
.notfound { text-align: center; padding: 120px 20px 140px; }
.notfound__code {
  font-family: var(--font-serif); font-size: clamp(90px, 20vw, 170px);
  font-weight: 800; line-height: 1; margin: 0;
  color: transparent;
  -webkit-background-clip: text; background-clip: text;
  background-image: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.notfound__title { font-size: clamp(24px, 4vw, 34px); margin: 26px 0 14px; }
.notfound__desc { color: var(--ink-2); max-width: 30em; margin: 0 auto 34px; }
.notfound__actions { display: flex; gap: 14px; justify-content: center; }

.btn {
  display: inline-block;
  font-size: 15px; font-weight: 600;
  padding: 11px 26px;
  border: 1.5px solid var(--line-strong); border-radius: 999px;
  color: var(--ink); background: transparent;
  transition: all .3s var(--ease);
  cursor: pointer;
}
.btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); color: var(--accent-ink); box-shadow: var(--shadow-sm); }

/* ---------------- 页脚 ---------------- */
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 60px;
  background: var(--surface);
}
.site-footer__grid {
  display: grid; grid-template-columns: 1fr 1.7fr; gap: 44px;
  padding: 52px 24px 40px;
}
.site-footer__meta a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.site-footer__brand { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.brand__mark-wrap--lg { width: 52px; height: 52px; color: var(--accent); }
.brand__mark-wrap--lg .brand__mark { width: 50px; height: 50px; }
.site-footer__name { font-family: var(--font-serif); font-size: 22px; font-weight: 700; margin: 4px 0 0; letter-spacing: .1em; }
.site-footer__latin { font-family: var(--font-mono); font-size: 11px; color: var(--muted); margin-left: 8px; letter-spacing: .2em; }
.site-footer__tag { color: var(--muted); font-size: 14px; margin: 0; }
.site-footer__nav { display: flex; flex-direction: column; gap: 10px; }
.site-footer__nav a { color: var(--ink-2); font-size: 14.5px; width: fit-content; transition: color .25s, transform .25s; }
.site-footer__nav a:hover { color: var(--accent); transform: translateX(3px); }
.site-footer__colophon { font-size: 13.5px; color: var(--muted); line-height: 1.9; }
.site-footer__colophon strong { color: var(--ink-2); font-weight: 600; }
.site-footer__meta { margin: 14px 0 0; font-family: var(--font-mono); font-size: 12px; }

/* ---------------- 回到顶部 ---------------- */
.to-top {
  position: fixed; right: 26px; bottom: 26px; z-index: 90;
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  color: var(--ink-2); font-size: 18px; cursor: pointer;
  opacity: 0; transform: translateY(12px); pointer-events: none;
  transition: all .35s var(--ease);
}
.to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-3px); }

/* ---------------- 灯箱 ---------------- */
.lightbox {
  position: fixed; inset: 0; z-index: 400;
  display: grid; place-items: center;
  background: rgba(12, 10, 7, .9);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  animation: lbFade .25s var(--ease);
}
.lightbox[hidden] { display: none; }
.lightbox__figure { margin: 0; max-width: min(92vw, 1100px); max-height: 92vh; display: flex; flex-direction: column; align-items: center; }
.lightbox__figure img { max-width: 100%; max-height: 84vh; object-fit: contain; border-radius: 10px; box-shadow: 0 30px 80px rgba(0,0,0,.5); animation: lbZoom .3s var(--ease); }
.lightbox__figure figcaption { color: rgba(255,255,255,.75); margin-top: 14px; font-size: 14.5px; font-family: var(--font-serif); }
.lightbox__close, .lightbox__nav {
  position: fixed; z-index: 2;
  background: rgba(255,255,255,.08); color: #fff;
  border: 1px solid rgba(255,255,255,.18); cursor: pointer;
  transition: background .25s;
}
.lightbox__close:hover, .lightbox__nav:hover { background: rgba(255,255,255,.2); }
.lightbox__close { top: 22px; right: 26px; width: 44px; height: 44px; border-radius: 50%; font-size: 16px; }
.lightbox__nav { top: 50%; transform: translateY(-50%); width: 52px; height: 52px; border-radius: 50%; font-size: 26px; }
.lightbox__nav--prev { left: 24px; }
.lightbox__nav--next { right: 24px; }
@keyframes lbFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes lbZoom { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }

/* ---------------- 搜索 ---------------- */
.search-layer {
  position: fixed; inset: 0; z-index: 300;
  display: block;
  background: rgba(12, 10, 7, .55);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  animation: lbFade .22s var(--ease);
}
.search-layer[hidden] { display: none; }
.search-layer__panel {
  max-width: 660px; margin: 12vh auto 0; padding: 0 20px;
}
.search-layer__bar {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  padding: 16px 20px;
  box-shadow: var(--shadow);
}
.search-layer__bar svg { width: 22px; height: 22px; color: var(--accent); flex: none; }
.search-layer__bar input {
  flex: 1; border: none; outline: none; background: transparent;
  font-size: 19px; font-family: var(--font-serif); color: var(--ink);
  min-width: 0;
}
.search-layer__bar input::placeholder { color: var(--muted); }
.search-layer__hint kbd { font-size: 11px; padding: 2px 8px; }
.search-layer__status { color: var(--muted); font-size: 13.5px; padding: 14px 6px 8px; }
.search-layer__results { list-style: none; margin: 0; padding: 6px 0 0; max-height: 52vh; overflow: auto; }
.search-layer__results:empty { display: none; }
.search-result {
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); margin-bottom: 10px;
  transition: all .25s var(--ease);
}
.search-result a { display: block; padding: 15px 18px; }
.search-result.is-current { border-color: var(--accent); box-shadow: var(--shadow-sm); transform: translateX(4px); }
.search-result__head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 5px; }
.search-result__title { font-family: var(--font-serif); font-weight: 700; font-size: 17px; }
.search-result__date { font-family: var(--font-mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
.search-result__tags { display: inline-flex; gap: 6px; margin-left: auto; }
.search-result__tags .tag-chip { font-size: 10.5px; padding: 1px 8px; }
.search-result__snippet { font-size: 13.5px; color: var(--ink-2); line-height: 1.7; }
.search-result__snippet mark { background: var(--accent-soft); color: var(--accent); border-radius: 3px; padding: 0 2px; }

/* ---------------- 滚动显现 ---------------- */
.js .reveal { opacity: 0; transform: translateY(20px); transition: opacity .75s var(--ease), transform .75s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
.js .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 1080px) {
  .card--featured .card__link { grid-template-columns: 1fr; }
  .card--featured .card__cover { min-height: 220px; }
  .post__layout { grid-template-columns: minmax(0, var(--measure)); }
  .toc-wrap { position: static; max-height: none; grid-column: auto; grid-row: auto; }
  .prose { grid-column: auto; grid-row: auto; }
  .toc__toggle { display: inline-flex; align-items: center; gap: 8px; }
  .toc__nav { max-height: 0; overflow: hidden; transition: max-height .4s var(--ease); }
  .toc.is-open .toc__nav { max-height: 420px; overflow: auto; }
  .about-grid { grid-template-columns: 1fr; }
  .about-card { position: static; }
}

@media (max-width: 860px) {
  .site-header__inner { gap: 14px; }
  .brand__sub { display: none; }
  .site-nav { gap: 2px; }
  .nav-link { padding: 8px 10px; font-size: 14px; }
}

@media (max-width: 720px) {
  body { font-size: 16px; }
  .hero { padding: 56px 0 36px; }
  .hero__stats { gap: 26px; }
  .hero__stat b { font-size: 28px; }
  .section { padding: 28px 0 44px; }
  .cards { grid-template-columns: 1fr; }
  .post { padding: 36px 0 56px; }
  .post__head { margin-bottom: 36px; }
  .post-nav { grid-template-columns: 1fr; }
  .arc-item { grid-template-columns: 86px 1fr; }
  .arc-item__tags { display: none; }
  .site-footer__grid { grid-template-columns: 1fr; gap: 30px; padding: 40px 24px 30px; }
  .to-top { right: 16px; bottom: 16px; width: 42px; height: 42px; }
}

/* ---------------- 打印 ---------------- */
@media print {
  .site-header, .site-footer, .toc-wrap, .to-top, .reading-bar, .search-layer, .lightbox, .post-nav, .related { display: none !important; }
  body { background: #fff; color: #000; }
  .prose a { color: inherit; text-decoration: underline; }
  .codeblock { box-shadow: none; }
}


/* ---------------- Toast ---------------- */
.toast {
  position: fixed; left: 50%; bottom: 34px; z-index: 500;
  transform: translateX(-50%) translateY(14px);
  background: var(--ink); color: var(--bg);
  font-size: 13.5px; padding: 10px 20px; border-radius: 999px;
  box-shadow: var(--shadow);
  opacity: 0; pointer-events: none;
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }


/* ============================================================
   Beta：认证 / 评论 / 站内信 / 管理后台
   ============================================================ */

/* ---------- 徽标 / 用户菜单 ---------- */
.badge {
  display: inline-grid; place-items: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--accent); color: var(--accent-ink);
  font-size: 11px; font-weight: 700; line-height: 1;
}
.badge--lg { min-width: 26px; height: 26px; font-size: 13px; margin-left: 12px; vertical-align: middle; }

.user-menu { position: relative; }
.user-menu__trigger {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink-2);
  padding: 5px 14px 5px 6px; cursor: pointer;
  transition: all .25s var(--ease);
  font-size: 14px;
}
.user-menu__trigger:hover { border-color: var(--accent); color: var(--accent); }
.user-menu__avatar {
  display: grid; place-items: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink);
  font-size: 13px; font-weight: 700;
}
.user-menu__name { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu__caret { font-size: 10px; color: var(--muted); }
.user-menu__drop {
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 150px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 12px; box-shadow: var(--shadow);
  display: none; z-index: 120;
}
.user-menu__drop.is-open { display: flex; flex-direction: column; gap: 2px; }
.user-menu__drop a, .user-menu__drop button {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border: none; background: none; cursor: pointer;
  font-size: 14px; color: var(--ink-2); border-radius: 8px; text-align: left;
  width: 100%; transition: all .2s;
}
.user-menu__drop a:hover, .user-menu__drop button:hover { background: var(--accent-soft); color: var(--accent); }

/* ---------- 认证弹窗 ---------- */
.auth-modal {
  position: fixed; inset: 0; z-index: 450;
  display: grid; place-items: center;
  background: rgba(12, 10, 7, .55);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  animation: lbFade .22s var(--ease);
}
.auth-modal[hidden] { display: none; }
.auth-modal__panel {
  width: min(92vw, 420px); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 18px;
  padding: 30px 30px 26px; box-shadow: var(--shadow);
  position: relative;
}
.auth-modal__close {
  position: absolute; top: 14px; right: 16px;
  background: none; border: none; font-size: 20px; color: var(--muted); cursor: pointer;
}
.auth-modal__close:hover { color: var(--accent); }
.auth-modal__tabs { display: flex; gap: 6px; margin-bottom: 22px; }
.auth-modal__tabs button {
  flex: 1; padding: 10px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface-2); color: var(--ink-2); font-size: 15px; cursor: pointer;
  transition: all .25s var(--ease);
}
.auth-modal__tabs button.is-active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form__label { display: flex; flex-direction: column; gap: 7px; font-size: 13.5px; color: var(--ink-2); }
.auth-form__label input {
  padding: 11px 14px; border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--bg); color: var(--ink); font-size: 15px; outline: none;
  transition: border-color .25s;
}
.auth-form__label input:focus { border-color: var(--accent); }
.auth-form__submit { margin-top: 6px; }
.auth-modal__msg { min-height: 20px; margin: 14px 0 0; font-size: 13.5px; color: var(--muted); }
.auth-modal__msg.is-error { color: var(--accent); }

/* ---------- 评论 ---------- */
.comments {
  margin-top: 3.2em; padding-top: 1.6em;
  border-top: 1px solid var(--line);
}
.comments__title { font-size: 22px; margin: 0 0 18px; display: flex; align-items: center; gap: 10px; }
.comments__count {
  font-family: var(--font-mono); font-size: 12px; font-weight: 400;
  color: var(--accent); background: var(--accent-soft);
  border-radius: 999px; padding: 2px 10px;
}
.comment-form {
  margin-bottom: 26px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); padding: 14px;
}
.comment-form textarea {
  width: 100%; border: none; outline: none; background: transparent;
  font-size: 15px; line-height: 1.7; color: var(--ink);
  resize: vertical; min-height: 60px; font-family: inherit;
}
.comment-form__row { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
.comment-form__name {
  flex: 1; padding: 9px 13px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--bg); color: var(--ink); font-size: 14px; outline: none; min-width: 0;
}
.comment-form__name:focus { border-color: var(--accent); }
.comment-form__hint { font-size: 12.5px; color: var(--muted); margin: 10px 0 0; }
.comment-form__who { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.comment-form__who b { color: var(--accent); }
.comment-form--reply { margin: 10px 0 4px; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment { padding: 16px 0; border-bottom: 1px solid var(--line); }
.comment:last-child { border-bottom: none; }
.comment__head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.comment__name { font-weight: 700; font-size: 14.5px; }
.tag-chip--role { font-size: 10.5px; padding: 1px 8px; }
.comment__time { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); margin-left: auto; }
.comment__body { font-size: 15px; line-height: 1.8; color: var(--ink-2); overflow-wrap: anywhere; }
.comment__body a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.comment__acts { display: flex; gap: 10px; margin-top: 8px; }
.comment__act {
  background: none; border: none; padding: 0;
  font-size: 12.5px; color: var(--muted); cursor: pointer;
  transition: color .2s;
}
.comment__act:hover { color: var(--accent); }
.comment__children { list-style: none; margin: 10px 0 0; padding-left: 18px; border-left: 2px solid var(--line); }
.comments__empty { color: var(--muted); font-size: 14.5px; }

/* ---------- 站内信 ---------- */
.msg-layout { display: grid; grid-template-columns: 340px 1fr; gap: 26px; align-items: start; padding-bottom: 60px; }
.msg-compose.card, .msg-inbox.card { padding: 24px 26px; }
.msg-compose h2, .msg-inbox h2 { font-size: 19px; margin: 0 0 16px; }
.msg-form { display: flex; flex-direction: column; gap: 12px; }
.msg-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: var(--ink-2); }
.msg-form input, .msg-form textarea {
  padding: 10px 13px; border: 1px solid var(--line-strong); border-radius: 9px;
  background: var(--bg); color: var(--ink); font-size: 14.5px; outline: none;
}
.msg-form input:focus, .msg-form textarea:focus { border-color: var(--accent); }
.msg-form textarea { resize: vertical; }
.msg-form__msg { font-size: 13px; margin: 0; }
.msg-form__msg.is-ok { color: #3f7d4e; }
.msg-form__msg.is-error { color: var(--accent); }
.msg-list { list-style: none; margin: 0; padding: 0; }
.msg { padding: 14px 4px; border-bottom: 1px solid var(--line); }
.msg.is-unread { background: var(--accent-soft); border-radius: 10px; padding: 14px; }
.msg__head { display: flex; gap: 10px; align-items: baseline; margin-bottom: 4px; }
.msg__from { font-weight: 700; font-size: 14px; }
.msg__head time { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); margin-left: auto; }
.msg__body { font-size: 14.5px; color: var(--ink-2); line-height: 1.75; overflow-wrap: anywhere; }
.msg__acts { display: flex; gap: 12px; margin-top: 8px; }

/* ---------- 管理后台 ---------- */
.admin-nav { display: flex; gap: 12px; margin-bottom: 28px; flex-wrap: wrap; }
.admin-card { padding: 26px 28px; }
.admin-card h2 { font-size: 20px; margin: 0 0 18px; }
.btn--sm { font-size: 13px; padding: 6px 14px; }
.btn--danger { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.btn--danger:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.admin-tbl th { white-space: nowrap; }
.admin-tbl__body { max-width: 340px; overflow: hidden; text-overflow: ellipsis; }
.admin-tbl__acts { white-space: nowrap; }
.admin-tbl__acts .btn + .btn { margin-left: 6px; }
.tag-chip--draft { color: #b08a2e; border-color: #b08a2e; background: rgba(176, 138, 46, .08); }

/* ---------- 编辑器 ---------- */
.editor__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: start; padding-bottom: 70px; }
.editor__label { display: flex; flex-direction: column; gap: 7px; font-size: 13.5px; color: var(--ink-2); margin-bottom: 16px; }
.editor__label input, .editor__label textarea, .editor__label select {
  padding: 10px 13px; border: 1px solid var(--line-strong); border-radius: 9px;
  background: var(--surface); color: var(--ink); font-size: 14.5px; outline: none;
  font-family: inherit;
}
.editor__label input:focus, .editor__label textarea:focus, .editor__label select:focus { border-color: var(--accent); }
.editor__label textarea { resize: vertical; font-family: var(--font-mono); font-size: 13.5px; line-height: 1.7; }
.editor__row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.editor__toolbar {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 10px; margin-bottom: 16px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
}
.editor__toolbar button, .editor__toolbar select {
  padding: 6px 11px; border: 1px solid var(--line); border-radius: 7px;
  background: var(--surface-2); color: var(--ink-2); font-size: 13px; cursor: pointer;
  transition: all .2s;
}
.editor__toolbar button:hover { border-color: var(--accent); color: var(--accent); }
.editor__toolbar select { font-family: var(--font-mono); font-size: 12px; }
.editor__actions { display: flex; gap: 12px; align-items: center; }
.editor__save-msg { font-size: 13.5px; }
.editor__save-msg.is-ok { color: #3f7d4e; }
.editor__save-msg.is-error { color: var(--accent); }
.editor__preview-wrap {
  position: sticky; top: calc(var(--header-h) + 20px);
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); padding: 22px 24px;
  max-height: calc(100vh - var(--header-h) - 40px); overflow: auto;
}
.editor__preview-title { font-size: 15px; margin: 0 0 12px; color: var(--muted); font-weight: 600; }
.editor__preview-title em { font-style: normal; color: var(--accent); font-size: 12.5px; }

@media (max-width: 1080px) {
  .editor__grid { grid-template-columns: 1fr; }
  .editor__preview-wrap { position: static; max-height: none; }
  .msg-layout { grid-template-columns: 1fr; }
}

/* 删除确认（armed） */
.comment__act.is-armed, .btn.is-armed { color: #fff; background: var(--accent); border-color: var(--accent); padding: 2px 8px; border-radius: 6px; }


/* ---------- 头像 ---------- */
.user-menu__avatar--img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.comment__avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex: none; }
.comment__avatar--plain { display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 700; }
.comment__head { align-items: center; }

/* 站内信导航角标 */
.nav-link--msg .badge { margin-left: 5px; vertical-align: 1px; }

/* 认证确认（我们班） */
.auth-new { margin-top: 14px; padding: 12px 14px; border: 1px dashed var(--line-strong); border-radius: 10px; background: var(--accent-soft); }
.auth-new[hidden] { display: none; }
.auth-new__text { margin: 0 0 10px; font-size: 14.5px; color: var(--ink); }
.auth-new__acts { display: flex; gap: 10px; }
.auth-new__acts .btn { padding: 8px 18px; font-size: 14px; }

/* 个人主页 */
.profile-grid { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 26px; align-items: start; padding-bottom: 70px; }
.profile-card { padding: 26px 28px; }
.profile-card h2 { font-size: 18px; margin: 0 0 16px; }
.profile-avatar-wrap { display: grid; place-items: center; margin-bottom: 14px; }
.profile-avatar { width: 160px; height: 160px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line-strong); box-shadow: var(--shadow-sm); }
.profile-avatar--fallback { display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 56px; font-weight: 800; }
.profile-hint { font-size: 12.5px; color: var(--muted); text-align: center; margin: 0 0 14px; }
.profile-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.profile-actions .msg-form__msg { flex-basis: 100%; }
.profile-url { display: flex; gap: 8px; margin-top: 10px; }
.profile-url input { flex: 1; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--bg); color: var(--ink); font-size: 13.5px; outline: none; }
.profile-url input:focus { border-color: var(--accent); }
.profile-line { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14.5px; }
.profile-line span { color: var(--muted); }
.profile-line b { font-weight: 600; }
#pf-bio { width: 100%; padding: 10px 13px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--bg); color: var(--ink); font-size: 14.5px; resize: vertical; font-family: inherit; }
#pf-bio:focus { border-color: var(--accent); outline: none; }

@media (max-width: 860px) {
  .profile-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .user-menu__name { display: none; }
}

/* ---------- 管理员通讯录 ---------- */
.msg-layout--admin { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.msg-contacts { padding: 22px 24px; }
.msg-contacts__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.msg-contacts__head h2 { font-size: 18px; margin: 0; }
.msg-contacts__tools { display: flex; gap: 12px; }
.contacts { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; max-height: 260px; overflow: auto; }
.contact { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; transition: all .2s; }
.contact:hover { border-color: var(--accent); }
.contact:has(.contact__check:checked) { border-color: var(--accent); background: var(--accent-soft); }
.contact__label { display: flex; align-items: center; gap: 9px; padding: 8px 10px; cursor: pointer; }
.contact__ava { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex: none; }
.contact__ava--plain { display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 700; }
.contact__meta { display: flex; flex-direction: column; min-width: 0; }
.contact__meta b { font-size: 13.5px; }
.contact__meta em { font-size: 11px; color: var(--muted); font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact__check { margin-left: auto; accent-color: var(--accent); width: 15px; height: 15px; flex: none; }
.msg-form--broadcast { border-top: 1px solid var(--line); padding-top: 14px; }
.msg-form__row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
@media (max-width: 1080px) {
  .msg-layout--admin { grid-template-columns: 1fr; }
}

/* ---------- 从网页粘贴 ---------- */
.paste-modal {
  position: fixed; inset: 0; z-index: 460;
  display: grid; place-items: center;
  background: rgba(12, 10, 7, .55);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  animation: lbFade .22s var(--ease);
}
.paste-modal[hidden] { display: none; }
.paste-modal__panel {
  width: min(92vw, 640px); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 18px;
  padding: 28px 30px 24px; box-shadow: var(--shadow); position: relative;
}
.paste-modal__close { position: absolute; top: 14px; right: 16px; background: none; border: none; font-size: 20px; color: var(--muted); cursor: pointer; }
.paste-modal__close:hover { color: var(--accent); }
.paste-modal__title { font-size: 19px; margin: 0 0 8px; }
.paste-modal__hint { font-size: 13px; color: var(--muted); margin: 0 0 14px; line-height: 1.7; }
.paste-modal__input {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--bg); color: var(--ink); font-size: 13px; line-height: 1.6;
  font-family: var(--font-mono); resize: vertical; outline: none;
}
.paste-modal__input:focus { border-color: var(--accent); }
.paste-modal__acts { display: flex; gap: 10px; align-items: center; margin-top: 14px; flex-wrap: wrap; }

.about-avatar--brand { display: grid; place-items: center; }
.about-avatar--brand svg { width: 96px; height: 96px; color: var(--accent); }

/* ---------- 页眉天气 ---------- */
.weather { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); padding: 6px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); white-space: nowrap; }
.weather[hidden] { display: none; }
.weather__icon { font-size: 15px; }
.weather__city { color: var(--muted); font-size: 12px; }
@media (max-width: 700px) { .weather__city { display: none; } }

/* ---------- 全站 AI 助手 ---------- */
.ai-widget__fab {
  position: fixed; left: 24px; bottom: 26px; z-index: 95;
  width: 52px; height: 52px; border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-size: 22px; cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .3s var(--ease);
}
.ai-widget__fab:hover { transform: translateY(-3px) scale(1.06); }
.ai-widget__panel {
  position: fixed; left: 24px; bottom: 88px; z-index: 96;
  width: min(360px, calc(100vw - 48px));
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 16px; box-shadow: var(--shadow); padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.ai-widget__panel[hidden] { display: none; }
.ai-widget__head { display: flex; align-items: center; gap: 8px; }
.ai-widget__head b { font-size: 15px; }
.ai-widget__head em { font-style: normal; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-widget__close { margin-left: auto; background: none; border: none; font-size: 18px; color: var(--muted); cursor: pointer; }
.ai-widget__close:hover { color: var(--accent); }
.ai-widget__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ai-widget__actions button { padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-size: 13px; cursor: pointer; transition: all .2s; }
.ai-widget__actions button:hover { border-color: var(--accent); color: var(--accent); }
.ai-widget__input { width: 100%; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--bg); color: var(--ink); font-size: 14px; resize: vertical; font-family: inherit; }
.ai-widget__input:focus { border-color: var(--accent); outline: none; }
.ai-widget__go { align-self: flex-start; }
.ai-widget__out { max-height: 46vh; overflow: auto; font-size: 13.5px; }
.ai-widget__text { white-space: pre-wrap; word-break: break-word; margin: 0; font-family: inherit; color: var(--ink-2); line-height: 1.7; }
@media (max-width: 640px) {
  .ai-widget__fab { left: 16px; bottom: 16px; width: 48px; height: 48px; }
  .ai-widget__panel { left: 12px; bottom: 74px; width: calc(100vw - 24px); }
}

/* ---------- 编辑器 AI 结果盒 ---------- */
.ai-edit-box { border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); padding: 12px 14px; margin-bottom: 16px; }
.ai-edit-out { white-space: pre-wrap; max-height: 300px; overflow: auto; font-size: 13px; line-height: 1.7; margin: 0 0 10px; color: var(--ink-2); font-family: var(--font-mono); }
.ai-edit-box__acts { display: flex; gap: 8px; flex-wrap: wrap; }
.editor__toolbar .editor__ai { border-color: color-mix(in srgb, var(--accent) 40%, transparent); color: var(--accent); }
.editor__hr { border: none; border-top: 1px dashed var(--line); margin: 22px 0; }

.site-footer__ver { color: var(--accent); font-family: var(--font-mono); font-weight: 600; font-size: 12px; }
