/* ==========================================================================
   余白 · Personal Blog
   0. Tokens
   1. Reset & base
   2. Layout helpers
   3. Header / nav
   4. Hero
   5. Feature card
   6. Post grid & cards
   7. Tags / buttons / forms
   8. Newsletter
   9. Footer
   10. Article page
   11. Archive page
   12. About page
   13. Motion & responsive
   ========================================================================== */

/* ---------- 0. Tokens ---------- */
:root {
  color-scheme: light;

  --bg: #faf9f6;
  --bg-elev: #ffffff;
  --bg-subtle: #f2efe9;
  --ink: #191613;
  --ink-soft: #3d3832;
  --muted: #7a736b;
  --line: rgba(25, 22, 19, 0.09);
  --line-strong: rgba(25, 22, 19, 0.18);

  --accent: #d24d28;
  --accent-ink: #ffffff;
  --accent-soft: rgba(210, 77, 40, 0.09);
  --accent-line: rgba(210, 77, 40, 0.28);

  --shadow-sm: 0 1px 2px rgba(25, 22, 19, 0.05), 0 8px 20px -14px rgba(25, 22, 19, 0.35);
  --shadow-lg: 0 2px 6px rgba(25, 22, 19, 0.05), 0 32px 64px -30px rgba(25, 22, 19, 0.45);

  --radius: 20px;
  --radius-sm: 12px;
  --radius-pill: 999px;

  --max: 1140px;
  --gutter: clamp(20px, 5vw, 48px);
  --gap: clamp(20px, 2.6vw, 34px);

  --font-display: ui-serif, "New York", "Iowan Old Style", "Songti SC", "Noto Serif SC", Georgia, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "Helvetica Neue", "Noto Sans SC", Inter, system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;

  --ease: cubic-bezier(0.22, 0.68, 0.28, 1);
}

[data-theme="dark"] {
  color-scheme: dark;

  --bg: #0f0e0d;
  --bg-elev: #171614;
  --bg-subtle: #1e1c19;
  --ink: #f1eee9;
  --ink-soft: #cdc6bd;
  --muted: #928a80;
  --line: rgba(241, 238, 233, 0.10);
  --line-strong: rgba(241, 238, 233, 0.22);

  --accent: #ff7148;
  --accent-ink: #1a0e09;
  --accent-soft: rgba(255, 113, 72, 0.13);
  --accent-line: rgba(255, 113, 72, 0.34);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.45), 0 8px 20px -14px rgba(0, 0, 0, 0.8);
  --shadow-lg: 0 2px 8px rgba(0, 0, 0, 0.5), 0 32px 64px -30px rgba(0, 0, 0, 0.9);
}

/* ---------- 1. Reset & base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    radial-gradient(60rem 32rem at 85% -12%, var(--accent-soft), transparent 62%);
  background-repeat: no-repeat;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16.5px;
  line-height: 1.72;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
}

/* 细颗粒噪点，让大片留白不那么"数码" */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: overlay;
  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.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.18;
  color: var(--ink);
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input { font: inherit; color: inherit; }

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

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

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--bg);
  border-radius: var(--radius-sm);
  z-index: 10000;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 14px; }

/* ---------- 2. Layout helpers ---------- */
.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--accent);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}
.section-head h2 {
  font-size: clamp(1.4rem, 2.4vw, 1.85rem);
}
.section-head p {
  color: var(--muted);
  font-size: 0.93rem;
  margin-top: 6px;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--ink-soft);
  padding-bottom: 2px;
  border-bottom: 1px solid var(--line-strong);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
  white-space: nowrap;
}
.link-arrow span {
  transition: transform 0.25s var(--ease);
}
.link-arrow:hover { color: var(--accent); border-color: var(--accent-line); }
.link-arrow:hover span { transform: translateX(4px); }

main { display: block; }

/* ---------- 3. Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid transparent;
  background: color-mix(in srgb, var(--bg) 76%, transparent);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.site-header.is-stuck {
  border-bottom-color: var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.16rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.brand-mark {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  transform: rotate(12deg);
  transition: transform 0.4s var(--ease);
}
.brand:hover .brand-mark { transform: rotate(132deg); }

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-inline-start: auto;
  margin-inline-end: 12px;
}
.nav a {
  position: relative;
  padding: 8px 13px;
  font-size: 0.9rem;
  color: var(--muted);
  border-radius: var(--radius-pill);
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.nav a:hover { color: var(--ink); background: var(--bg-subtle); }
.nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 1px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateX(-50%);
}

.header-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  background: color-mix(in srgb, var(--bg-elev) 60%, transparent);
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease),
    transform 0.2s var(--ease), background-color 0.2s var(--ease);
}
.icon-btn:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  transform: translateY(-1px);
}
.icon-btn svg { width: 17px; height: 17px; }

/* 深浅色图标切换 */
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

.nav-toggle { display: none; }

/* 移动端抽屉 */
@media (max-width: 780px) {
  .nav-toggle { display: inline-grid; }

  .nav {
    position: fixed;
    inset: 68px 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    margin: 0;
    padding: 14px var(--gutter) 24px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s var(--ease), transform 0.2s var(--ease),
      visibility 0.2s var(--ease);
  }
  .nav.is-open { visibility: visible; opacity: 1; transform: none; }
  .nav a { padding: 12px 4px; font-size: 1rem; border-radius: 0; }
  .nav a + a { border-top: 1px solid var(--line); }
  .nav a[aria-current="page"]::after { display: none; }
}

/* ---------- 4. Hero ---------- */
.hero {
  padding-block: clamp(56px, 9vw, 108px) clamp(40px, 6vw, 72px);
  position: relative;
}
.hero .eyebrow { margin-bottom: 22px; }

.hero h1 {
  font-size: clamp(2.5rem, 6.4vw, 4.5rem);
  line-height: 1.06;
  letter-spacing: -0.035em;
  max-width: 16ch;
}
.hero h1 em {
  font-style: italic;
  color: var(--accent);
  position: relative;
  white-space: nowrap;
}
.hero h1 em::after {
  content: "";
  position: absolute;
  left: 0.04em;
  right: 0.04em;
  bottom: 0.06em;
  height: 0.085em;
  background: var(--accent);
  opacity: 0.18;
  border-radius: 2px;
}

.hero-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-top: 34px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}
.hero-lede {
  max-width: 46ch;
  color: var(--ink-soft);
  font-size: 1.02rem;
}
.hero-stats {
  display: flex;
  gap: 30px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-transform: uppercase;
}
.hero-stats b {
  display: block;
  font-family: var(--font-display);
  font-size: 1.6rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-weight: 600;
}

/* ---------- 5. Feature card ---------- */
.feature {
  display: grid;
  grid-template-columns: 1.08fr 1fr;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 6px);
  background: var(--bg-elev);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.4s var(--ease), transform 0.4s var(--ease),
    border-color 0.4s var(--ease);
}
.feature:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--line-strong);
}

.feature-art {
  position: relative;
  min-height: 340px;
  overflow: hidden;
  isolation: isolate;
}
.feature-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    115deg,
    rgba(255, 255, 255, 0.14) 0 1px,
    transparent 1px 22px
  );
  mix-blend-mode: soft-light;
}
.feature-art .art-glyph {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-size: clamp(7rem, 15vw, 11rem);
  font-weight: 600;
  letter-spacing: -0.05em;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 12px 40px rgba(60, 20, 0, 0.28);
  line-height: 1;
  transition: transform 0.7s var(--ease);
}
.feature:hover .art-glyph { transform: translate(-50%, -50%) scale(1.05) rotate(-2deg); }

.feature-badge {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 2;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(8px);
  color: #1b1512;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.feature-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  padding: clamp(26px, 3.4vw, 46px);
}
.feature-body h2 {
  font-size: clamp(1.55rem, 2.7vw, 2.1rem);
  line-height: 1.22;
}
.feature-body h2 a { transition: color 0.2s var(--ease); }
.feature-body h2 a:hover { color: var(--accent); }
.feature-body .excerpt {
  color: var(--muted);
  font-size: 0.97rem;
  max-width: 42ch;
}
.feature-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.feature-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--muted); }

/* ---------- 6. Post grid ---------- */
.section { padding-block: clamp(40px, 6vw, 72px); }

.posts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
}

.post {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 14px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease),
    transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.post:hover {
  background: var(--bg-elev);
  border-color: var(--line);
  transform: translateY(-4px);
  box-shadow: var(--shadow-sm);
}

.post-art {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-sm);
  overflow: hidden;
  isolation: isolate;
}
.post-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    115deg,
    rgba(255, 255, 255, 0.12) 0 1px,
    transparent 1px 18px
  );
  mix-blend-mode: soft-light;
}
.post-art .art-glyph {
  position: absolute;
  inset: auto 16px 10px auto;
  font-family: var(--font-display);
  font-size: 3.4rem;
  line-height: 1;
  color: rgba(255, 255, 255, 0.85);
  transition: transform 0.5s var(--ease);
}
.post:hover .post-art .art-glyph { transform: translateY(-4px); }

.post-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(6px);
  color: #1b1512;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.post h3 {
  font-size: 1.16rem;
  line-height: 1.32;
  letter-spacing: -0.015em;
}
.post h3 a { transition: color 0.2s var(--ease); }
.post:hover h3 a { color: var(--accent); }

.post-desc {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-meta {
  margin-top: auto;
  padding-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* 卡片封面：同一橙色系的不同明度与光位，不依赖外部图片 */
.art-1 { background: radial-gradient(120% 120% at 18% 12%, #ffd9c4 0%, #ff9b76 38%, #c9431f 100%); }
.art-2 { background: radial-gradient(120% 120% at 78% 18%, #ffc9a8 0%, #e07843 42%, #7d2c12 100%); }
.art-3 { background: radial-gradient(120% 120% at 20% 85%, #ffe6d7 0%, #f3a67b 42%, #9c4522 100%); }
.art-4 { background: radial-gradient(120% 120% at 80% 82%, #ffb68e 0%, #cf6230 45%, #55200e 100%); }
.art-5 { background: radial-gradient(110% 110% at 28% 25%, #f08a5c 0%, #8e3a1c 45%, #1a100b 100%); }
.art-6 { background: radial-gradient(120% 120% at 72% 22%, #ffdcc6 0%, #e08a58 45%, #7d3216 100%); }
.art-7 { background: radial-gradient(110% 110% at 25% 78%, #ffc2a3 0%, #d56b3a 45%, #3d160a 100%); }

/* ---------- 7. Tags / buttons / forms ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  background: transparent;
  transition: all 0.2s var(--ease);
}
.tag:hover { border-color: var(--accent-line); color: var(--accent); background: var(--accent-soft); }

.tag--solid {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--accent);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-weight: 500;
  transition: transform 0.2s var(--ease), background-color 0.2s var(--ease),
    color 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
}
.btn--solid {
  background: var(--ink);
  color: var(--bg);
  border: 1px solid var(--ink);
}
.btn--solid:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.btn--ghost {
  border: 1px solid var(--line-strong);
  color: var(--ink);
}
.btn--ghost:hover { background: var(--bg-subtle); transform: translateY(-2px); }
.btn--accent {
  background: var(--accent);
  color: var(--accent-ink);
  border: 1px solid var(--accent);
}
.btn--accent:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -12px var(--accent); }

/* ---------- 8. Newsletter ---------- */
.newsletter {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 6px);
  background: var(--bg-elev);
  padding: clamp(30px, 4.6vw, 56px);
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: center;
  gap: 36px;
}
.newsletter::before {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  right: -140px;
  top: -180px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft), transparent 68%);
  pointer-events: none;
}
.newsletter h2 { font-size: clamp(1.5rem, 2.8vw, 2rem); }
.newsletter p { color: var(--muted); font-size: 0.94rem; margin-top: 10px; max-width: 40ch; }

.subscribe {
  display: flex;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--bg);
  position: relative;
  z-index: 1;
}
.subscribe input {
  flex: 1;
  min-width: 0;
  padding: 9px 16px;
  border: 0;
  background: transparent;
  font-size: 0.9rem;
  outline: none;
}
.subscribe input::placeholder { color: var(--muted); }
.subscribe .btn { padding: 9px 20px; }
.subscribe-note {
  grid-column: 2;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.06em;
  margin-top: -22px;
}

/* ---------- 9. Footer ---------- */
.site-footer {
  margin-top: clamp(56px, 8vw, 96px);
  border-top: 1px solid var(--line);
  padding-block: 44px 40px;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}
.footer-brand {
  font-family: var(--font-display);
  font-size: 1.05rem;
}
.footer-brand small {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 6px;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 22px; }
.footer-links a {
  font-size: 0.87rem;
  color: var(--muted);
  transition: color 0.2s var(--ease);
}
.footer-links a:hover { color: var(--accent); }

/* ---------- 10. Article page ---------- */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: var(--accent);
  z-index: 200;
  transition: width 0.1s linear;
}

.article-hero {
  padding-block: clamp(44px, 7vw, 80px) 34px;
  border-bottom: 1px solid var(--line);
}
.article-hero .kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.article-hero h1 {
  font-size: clamp(2rem, 4.6vw, 3.25rem);
  line-height: 1.14;
  letter-spacing: -0.03em;
  max-width: 20ch;
}
.article-hero .standfirst {
  margin-top: 20px;
  max-width: 54ch;
  font-size: 1.06rem;
  color: var(--ink-soft);
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  margin-top: 28px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.article-meta .avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ffb894, var(--accent));
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 216px;
  gap: clamp(32px, 5vw, 72px);
  padding-block: clamp(36px, 5vw, 58px);
  align-items: start;
}

.prose {
  max-width: 68ch;
  font-size: 1.02rem;
  line-height: 1.85;
  color: var(--ink-soft);
}
.prose > * + * { margin-top: 1.15em; }
.prose p { margin-bottom: 0; }
.prose h2 {
  font-size: clamp(1.35rem, 2.4vw, 1.6rem);
  margin-top: 2.1em;
  margin-bottom: 0.6em;
  color: var(--ink);
  scroll-margin-top: 96px;
}
.prose h3 {
  font-size: 1.12rem;
  margin-top: 1.8em;
  margin-bottom: 0.4em;
  color: var(--ink);
  scroll-margin-top: 96px;
}
.prose a:not(.btn) {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent-line);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  transition: color 0.2s var(--ease), text-decoration-color 0.2s var(--ease);
}
.prose a:not(.btn):hover { color: var(--accent); text-decoration-color: var(--accent); }

.prose strong { color: var(--ink); font-weight: 600; }
.prose em { font-style: italic; }

.prose blockquote {
  margin: 1.7em 0;
  padding: 4px 0 4px 22px;
  border-left: 2px solid var(--accent);
  font-family: var(--font-display);
  font-size: 1.16rem;
  line-height: 1.6;
  color: var(--ink);
}
.prose blockquote p + p { margin-top: 0.6em; }
.prose blockquote cite {
  display: block;
  margin-top: 10px;
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.prose ul, .prose ol { padding-left: 1.25em; }
.prose li + li { margin-top: 0.45em; }
.prose li::marker { color: var(--accent); }

.prose hr {
  border: 0;
  height: 1px;
  background: var(--line);
  margin: 2.4em 0;
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  padding: 0.15em 0.42em;
  border-radius: 5px;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  color: var(--ink);
}

.code-block {
  position: relative;
  margin: 1.7em 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #14120f;
  overflow: hidden;
}
.code-block figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}
.code-block pre {
  margin: 0;
  padding: 18px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.68;
  color: #e9e4dc;
  tab-size: 2;
}
.code-block code {
  background: none;
  border: 0;
  padding: 0;
  font-size: inherit;
  color: inherit;
}
.tok-key { color: #ff9b76; }
.tok-str { color: #e8b898; }
.tok-com { color: #7d766c; font-style: italic; }
.tok-fn  { color: #f4ece4; }

.copy-btn {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  padding: 3px 8px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.copy-btn:hover { color: #fff; border-color: rgba(255, 255, 255, 0.35); }

.prose .callout {
  margin: 1.7em 0;
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  font-size: 0.95rem;
  color: var(--ink-soft);
}
.prose .callout strong { color: var(--accent); }

.article-foot {
  margin-top: 2.6em;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.article-tags { display: flex; flex-wrap: wrap; gap: 8px; }

/* 目录 */
.toc {
  position: sticky;
  top: 92px;
  font-size: 0.84rem;
}
.toc-title {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}
.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--line);
}
.toc li { margin: 0; }
.toc a {
  display: block;
  padding: 6px 0 6px 14px;
  margin-left: -1px;
  border-left: 1px solid transparent;
  color: var(--muted);
  line-height: 1.5;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.toc a:hover { color: var(--ink); }
.toc a.is-active {
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 500;
}
.toc li.is-sub a { padding-left: 26px; font-size: 0.8rem; }

.prevnext {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 34px;
}
.prevnext a {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease),
    transform 0.2s var(--ease);
}
.prevnext a:hover {
  border-color: var(--line-strong);
  background: var(--bg-elev);
  transform: translateY(-2px);
}
.prevnext span {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.prevnext strong {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.4;
}
.prevnext .next { text-align: right; }

/* Markdown 渲染结果（非 figure 包裹的代码块与表格） */
.prose pre {
  margin: 1.7em 0;
  padding: 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #14120f;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.68;
  color: #e9e4dc;
  tab-size: 2;
}
.prose pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: inherit;
  color: inherit;
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.92rem;
}
.prose th,
.prose td {
  padding: 10px 12px;
  border: 1px solid var(--line);
  text-align: left;
}
.prose th {
  background: var(--bg-subtle);
  color: var(--ink);
  font-weight: 600;
}

/* ---------- 11. Archive page ---------- */
.page-head {
  padding-block: clamp(48px, 7vw, 84px) 30px;
}
.page-head h1 {
  font-size: clamp(2.1rem, 4.8vw, 3.2rem);
  letter-spacing: -0.03em;
  margin-top: 14px;
}
.page-head p {
  margin-top: 14px;
  max-width: 48ch;
  color: var(--muted);
}

.archive-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-block: 20px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}
.filters { display: flex; flex-wrap: wrap; gap: 8px; }

.search {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--bg-elev);
  min-width: 210px;
}
.search svg { width: 15px; height: 15px; color: var(--muted); flex: none; }
.search input {
  border: 0;
  background: transparent;
  outline: none;
  font-size: 0.87rem;
  width: 100%;
}

.year-group { padding-block: 26px; border-bottom: 1px solid var(--line); }
.year-group:last-of-type { border-bottom: 0; }
.year-label {
  display: flex;
  align-items: baseline;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 8px;
}
.year-label b {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-weight: 600;
}

.entry {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 18px;
  padding: 13px 12px;
  margin-inline: -12px;
  border-radius: var(--radius-sm);
  transition: background-color 0.2s var(--ease);
}
.entry:hover { background: var(--bg-elev); }
.entry time {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.entry .title {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  transition: color 0.2s var(--ease);
}
.entry:hover .title { color: var(--accent); }
.entry .sub {
  display: block;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 3px;
  letter-spacing: 0;
}
.entry .read {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
}
.entry.is-hidden { display: none; }

.empty-state {
  display: none;
  padding: 60px 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.94rem;
}
.empty-state.is-visible { display: block; }

/* ---------- 12. About page ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: clamp(30px, 5vw, 64px);
  padding-block: clamp(36px, 5vw, 56px);
  align-items: start;
}
.portrait {
  aspect-ratio: 3 / 4;
  border-radius: var(--radius);
  background: radial-gradient(120% 120% at 30% 20%, #ffdcc9, #e8825c 45%, #8a3a1c 100%);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.portrait::after {
  content: "余";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 5rem;
  color: rgba(255, 255, 255, 0.9);
}

.about-body h2 {
  font-size: 1.3rem;
  margin-top: 2em;
  margin-bottom: 0.5em;
}
.about-body h2:first-child { margin-top: 0; }
.about-body p { color: var(--ink-soft); margin-top: 1em; }
.about-body a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent-line);
  text-underline-offset: 3px;
}
.about-body ul { margin-top: 1em; padding-left: 1.2em; color: var(--ink-soft); }
.about-body li + li { margin-top: 0.4em; }
.about-body li::marker { color: var(--accent); }

.now-card {
  margin-top: 2em;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
}
.now-card dl { display: grid; grid-template-columns: 96px 1fr; gap: 10px 18px; margin: 12px 0 0; }
.now-card dt {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 3px;
}
.now-card dd { margin: 0; font-size: 0.94rem; color: var(--ink-soft); }

/* ---------- 13. Motion & responsive ---------- */
/* 渐进增强：只有 JS 可用时才隐藏，避免脚本失败后内容不可见 */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.js .reveal.is-in { opacity: 1; transform: none; }

@media (max-width: 1000px) {
  .posts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature { grid-template-columns: 1fr; }
  .feature-art { min-height: 240px; }
  .article-layout { grid-template-columns: minmax(0, 1fr); }
  .toc { display: none; }
  .newsletter { grid-template-columns: 1fr; gap: 24px; }
  .subscribe-note { grid-column: 1; margin-top: 0; }
  .about-grid { grid-template-columns: 1fr; }
  .portrait { max-width: 240px; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .posts { grid-template-columns: 1fr; }
  .hero-stats { gap: 22px; }
  .hero h1 { max-width: none; }
  .entry { grid-template-columns: 1fr auto; gap: 6px 12px; }
  .entry time { grid-column: 1 / -1; }
  .entry .read { display: none; }
  .prevnext { grid-template-columns: 1fr; }
  .prevnext .next { text-align: left; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .section-head { align-items: flex-start; flex-direction: column; gap: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .js .reveal { opacity: 1 !important; transform: none !important; }
}

@media print {
  .site-header, .site-footer, .toc, .progress, .prevnext { display: none; }
  body { background: #fff; color: #000; }
}

/* ==========================================================================
   14. Admin & Guestbook
   ========================================================================== */

/* ---------- 14.1 通用后台骨架 ---------- */
.admin-body {
  min-height: 100vh;
  background-image: radial-gradient(50rem 28rem at 100% -10%, var(--accent-soft), transparent 60%);
}

.admin-shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100vh;
  max-width: 1600px;
  margin-inline: auto;
}

.admin-side {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 28px 20px;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-elev) 70%, transparent);
}

.admin-brand {
  gap: 10px;
  font-size: 1.1rem;
}
.admin-brand small {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 2px 8px;
  margin-left: auto;
}

.admin-nav { display: flex; flex-direction: column; gap: 4px; }
.admin-nav a {
  padding: 10px 14px;
  font-size: 0.92rem;
  color: var(--muted);
  border-radius: var(--radius-sm);
  border-left: 2px solid transparent;
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.admin-nav a:hover { color: var(--ink); background: var(--bg-subtle); }
.admin-nav a.is-active {
  color: var(--accent);
  background: var(--accent-soft);
  border-left-color: var(--accent);
}

.admin-side-foot { margin-top: auto; display: grid; gap: 16px; }
.admin-side-foot .link-arrow { font-size: 0.84rem; }

.admin-logout {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.admin-logout:hover { color: var(--accent); border-color: var(--accent-line); }
.danger { color: var(--accent) !important; border-color: var(--accent-line) !important; }

.admin-main { min-width: 0; }
.admin-top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 24px clamp(20px, 4vw, 46px);
  border-bottom: 1px solid var(--line);
}
.admin-top h1 { font-size: 1.5rem; }
.admin-top-note {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.admin-content {
  padding: clamp(20px, 3.4vw, 40px) clamp(20px, 4vw, 46px) 80px;
  display: grid;
  gap: 20px;
}

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  border: 1px solid var(--line);
  background: var(--bg-elev);
}
.alert--ok { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.alert--error { color: var(--accent); border-color: var(--accent-line); }
.alert--accent { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }

/* ---------- 14.2 面板 / 表格 ---------- */
.admin-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
  padding: clamp(18px, 2.4vw, 28px);
}
.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
}
.panel-head h2 { font-size: 1.1rem; }
.panel-head h2 small {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-left: 8px;
  font-weight: 400;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.stat-card {
  display: grid;
  gap: 6px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.stat-card:hover { border-color: var(--accent-line); transform: translateY(-2px); }
.stat-card span { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.12em; color: var(--muted); text-transform: uppercase; }
.stat-card b { font-family: var(--font-display); font-size: 2rem; line-height: 1.1; }
.stat-card small { color: var(--muted); font-size: 0.8rem; }

.quick-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.admin-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.admin-table th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 400;
  padding: 0 12px 12px 0;
  border-bottom: 1px solid var(--line);
}
.admin-table td { padding: 14px 12px 14px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table td a { transition: color 0.2s var(--ease); }
.admin-table td a:hover { color: var(--accent); }
.admin-table td small { display: block; font-family: var(--font-mono); font-size: 10px; color: var(--muted); }
.actions-col { white-space: nowrap; }
.row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.row-actions button {
  font-size: 0.82rem;
  color: var(--muted);
  transition: color 0.2s var(--ease);
}
.row-actions button:hover { color: var(--accent); }

.badge {
  display: inline-flex;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  border: 1px solid var(--line-strong);
  color: var(--muted);
}
.badge--ok { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.badge--warn { color: var(--muted); }

/* ---------- 14.3 表单 ---------- */
.form-row { display: grid; gap: 7px; margin-bottom: 16px; }
.form-row:last-child { margin-bottom: 0; }
.form-row label,
.checkbox-row span {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.form-row label small { text-transform: none; letter-spacing: 0; color: var(--muted); opacity: 0.75; }
.form-row small, .form-row code { font-size: 0.78rem; color: var(--muted); }
.form-row code { font-family: var(--font-mono); color: var(--accent); }
.form-row input,
.form-row textarea,
.form-row select,
.login-form input {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink);
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.form-row textarea { resize: vertical; line-height: 1.6; }
.form-row input:focus,
.form-row textarea:focus,
.form-row select:focus,
.login-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-row input::placeholder, .form-row textarea::placeholder { color: var(--muted); opacity: 0.7; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.field-error { color: var(--accent); font-size: 0.8rem; }
.checkbox-row { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.checkbox-row input { width: 16px; height: 16px; accent-color: var(--accent); }
.checkbox-row span { text-transform: none; letter-spacing: 0; font-size: 0.86rem; color: var(--ink-soft); }

/* ---------- 14.4 Markdown 编辑器 ---------- */
.editor-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.85fr); gap: 18px; align-items: start; }
.editor-main, .editor-side { display: grid; gap: 18px; min-width: 0; }
.editor-panel { padding-bottom: 18px; }
.editor-tools { display: flex; align-items: center; gap: 12px; }
.load-file {
  position: relative;
  overflow: hidden;
  font-size: 0.8rem;
  color: var(--accent);
  cursor: pointer;
  border-bottom: 1px solid var(--accent-line);
}
.load-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }

.md-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  margin-bottom: 10px;
}
.md-toolbar button {
  min-width: 30px;
  height: 28px;
  padding: 0 7px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-soft);
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.md-toolbar button:hover { color: var(--accent); background: var(--accent-soft); }
.toolbar-sep { width: 1px; height: 18px; background: var(--line-strong); margin-inline: 4px; }

.md-input {
  width: 100%;
  min-height: 360px;
  padding: 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.8;
  resize: vertical;
  outline: none;
  tab-size: 2;
}
.md-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.editor-count { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); margin-top: 8px; text-align: right; }

.md-preview {
  min-height: 120px;
  padding: 16px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}
.md-preview > * + * { margin-top: 0.8em; }
.md-preview h2, .md-preview h3 { font-size: 1.05rem; margin-top: 1.4em; }
.md-preview pre { white-space: pre-wrap; }
.md-preview table { font-size: 0.85rem; }

.preview-panel .md-preview { min-height: 200px; }
.preview-hint { font-family: var(--font-mono); font-size: 10px; color: var(--muted); }
.preview-toggle {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--muted);
  border-bottom: 1px solid var(--line-strong);
}
.preview-toggle:hover { color: var(--accent); border-color: var(--accent-line); }

.side-title { font-size: 1rem; margin-bottom: 18px; }
.tag-suggest { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tag-suggest button {
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  color: var(--muted);
}
.tag-suggest button:hover { color: var(--accent); border-color: var(--accent-line); }
.cover-preview { height: 56px; border-radius: var(--radius-sm); margin-top: 8px; }
.editor-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.import-form { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.import-form > input[type="file"] { font-size: 0.8rem; color: var(--muted); max-width: 220px; }
.file-drop { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.file-drop b { display: block; font-size: 0.9rem; font-weight: 500; }
.file-drop small { display: block; font-size: 0.76rem; color: var(--muted); }
.file-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--accent-line);
  color: var(--accent);
  font-size: 1.2rem;
}

/* ---------- 14.5 留言 ---------- */
.guestbook-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); padding-bottom: 30px; }
.guest-form-card, .guest-list { min-width: 0; }
.guest-form-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-elev); padding: clamp(20px, 3vw, 32px); }
.guest-form-card .btn { margin-top: 4px; }
.guest-form-card [data-md-editor] { margin-top: 18px; }
.guest-form-card .md-toolbar button { min-width: 28px; }
.guest-form-card textarea { width: 100%; padding: 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--bg); color: var(--ink); font-family: var(--font-mono); font-size: 0.86rem; line-height: 1.7; resize: vertical; }
.guest-form-card textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.guest-form-card .md-preview { margin-top: 10px; min-height: 80px; font-size: 0.86rem; }
.guest-form-card input { width: 100%; }
.guest-list .guest-item {
  padding: 20px 0;
  border-top: 1px solid var(--line);
}
.guest-list .guest-item:first-of-type { border-top: 0; }
.guest-item-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.guest-avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 0.9rem;
}
.guest-item-head strong { font-size: 0.94rem; }
.guest-item-head time { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); margin-left: auto; }
.guest-list .prose { font-size: 0.92rem; }

.message-list { display: grid; gap: 14px; }
.message-item { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 18px; }
.message-item.is-pending { border-color: var(--accent-line); background: color-mix(in srgb, var(--accent-soft) 40%, transparent); }
.message-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 0.88rem; }
.message-head span:not(.badge), .message-head time { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); }
.message-head .badge { margin-left: auto; }
.message-item .prose { font-size: 0.9rem; }
.message-actions { display: flex; gap: 10px; margin-top: 16px; }
.message-actions .btn { padding: 8px 16px; font-size: 0.8rem; }

/* ---------- 14.6 登录 ---------- */
.login-body { display: grid; place-items: center; padding: 40px 20px; }
.login-card {
  width: min(100%, 420px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
  padding: clamp(26px, 4vw, 40px);
  display: grid;
  gap: 16px;
}
.login-card .admin-brand { margin-bottom: 10px; }
.login-card h1 { font-size: 1.6rem; }
.login-hint { font-size: 0.84rem; color: var(--muted); }
.login-form { display: grid; gap: 4px; }
.login-form .btn { margin-top: 8px; }
.login-back { font-size: 0.84rem; justify-self: start; }

/* ---------- 14.7 响应式 ---------- */
@media (max-width: 1100px) {
  .editor-grid { grid-template-columns: minmax(0, 1fr); }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .guestbook-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 780px) {
  .admin-shell { grid-template-columns: minmax(0, 1fr); }
  .admin-side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 14px; padding: 16px var(--gutter); }
  .admin-nav { flex-direction: row; flex-wrap: wrap; }
  .admin-side-foot { margin-top: 0; width: 100%; display: flex; justify-content: space-between; align-items: center; }
  .admin-table { font-size: 0.82rem; }
}
@media (max-width: 640px) {
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .stat-grid { grid-template-columns: minmax(0, 1fr); }
  .admin-table .actions-col { white-space: normal; }
}
