/* ============================================================
   Vintage Collage / Scrapbook Theme
   米白纸张 · 深红印章 · 撕纸边缘 · 胶带 · 拍立得 · 手写标注
   ============================================================ */

/* ===== Design Tokens ===== */
:root {
  --bg: #efe8d8;
  --bg-2: #e7ddc8;
  --surface: #faf5e9;
  --surface-solid: #faf5e9;
  --text: #2b2318;
  --text-secondary: #7c7160;
  --accent: #b03a2e;
  --accent-2: #8c2b22;
  --accent-rgb: 176, 58, 46;
  --pink-note: #f3ddd3;
  --border: rgba(74, 56, 36, 0.22);
  --border-strong: rgba(74, 56, 36, 0.4);
  --shadow: rgba(74, 56, 36, 0.18);
  --tape: rgba(214, 192, 142, 0.62);
  --footer-bg: #a93529;
  --code-bg: #2b2318;
  --max-width: 1160px;
  --radius: 14px;
  --radius-sm: 8px;

  /* 旧变量别名（后台页面仍在使用） */
  --bg-primary: var(--bg);
  --bg-secondary: var(--bg-2);
  --bg-card: var(--surface);
  --border-color: var(--border);
  --text-primary: var(--text);
  --text-muted: var(--text-secondary);
  --accent-soft: rgba(var(--accent-rgb), .14);
  --shadow-xl: 0 18px 44px rgba(74, 56, 36, .2);
  --font: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --serif: "Noto Serif SC", "Songti SC", "STSong", serif;
  --hand: "Caveat", "Ma Shan Zheng", cursive;
  --hand-cn: "Ma Shan Zheng", "Caveat", cursive;
  --mono: "SF Mono", "Fira Code", "JetBrains Mono", Consolas, monospace;

  /* 纸张纹理 */
  --paper-noise: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='180' height='180' filter='url(%23n)' opacity='0.55'/></svg>");
  /* 手绘波浪线 */
  --squiggle: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='36' height='6' viewBox='0 0 36 6'><path d='M0 3 Q 4.5 0.5 9 3 T 18 3 T 27 3 T 36 3' fill='none' stroke='%23b03a2e' stroke-width='2' stroke-linecap='round'/></svg>");
  /* 撕纸边缘 */
  --torn-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='26' preserveAspectRatio='none'><path d='M0 26 L0 13 L8 5 L15 15 L23 3 L31 12 L38 7 L47 16 L55 4 L63 12 L71 8 L80 15 L88 3 L96 13 L104 6 L113 16 L121 9 L129 4 L138 14 L146 7 L155 12 L163 5 L172 15 L180 8 L189 16 L197 6 L206 13 L214 4 L223 12 L231 8 L240 15 L248 5 L257 11 L265 3 L274 14 L282 9 L291 13 L300 6 L300 26 Z' fill='black'/></svg>");
}

/* 夜读模式：牛皮纸夜色 */
[data-theme="dark"] {
  --bg: #1e1913;
  --bg-2: #18130e;
  --surface: #292117;
  --surface-solid: #292117;
  --text: #efe5cf;
  --text-secondary: #a3967f;
  --accent: #d4604c;
  --accent-2: #e07b5f;
  --accent-rgb: 212, 96, 76;
  --pink-note: #3a2a22;
  --border: rgba(239, 229, 207, 0.16);
  --border-strong: rgba(239, 229, 207, 0.3);
  --shadow: rgba(0, 0, 0, 0.5);
  --tape: rgba(214, 192, 142, 0.28);
  --footer-bg: #571d15;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  color-scheme: light;
}

html[data-theme="dark"] { color-scheme: dark; }

body {
  margin: 0;
  font-family: var(--font);
  background:
    radial-gradient(ellipse at 18% 8%, rgba(176, 58, 46, 0.05), transparent 42%),
    radial-gradient(ellipse at 85% 90%, rgba(176, 58, 46, 0.045), transparent 40%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background .25s, color .25s;
}

/* 纸张颗粒 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: var(--paper-noise);
  background-size: 180px 180px;
  opacity: .16;
  mix-blend-mode: multiply;
  pointer-events: none;
  z-index: 2147483000;
}

[data-theme="dark"] body::before {
  mix-blend-mode: soft-light;
  opacity: .1;
}

/* 复古照片底纹（保留站点原有背景图） */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: url('/assets/hero-bg.jpg') center / cover no-repeat;
  opacity: .12;
  filter: sepia(.45) saturate(.85);
  pointer-events: none;
  z-index: -1;
}

[data-theme="dark"] body::after {
  opacity: .14;
  filter: sepia(.4) saturate(.7) brightness(.5);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity .2s, color .2s;
}

a:hover { opacity: .85; }

img { max-width: 100%; display: block; }

.container {
  width: min(var(--max-width), 92%);
  margin: 0 auto;
}

/* ===== 手写 & 印章工具类 ===== */
.hand {
  font-family: var(--hand-cn);
  color: var(--accent);
  letter-spacing: .02em;
}

.hand-en {
  font-family: var(--hand);
  color: var(--accent);
}

/* 胶带 */
.tape {
  position: absolute;
  width: 88px;
  height: 24px;
  background: var(--tape);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .1);
  clip-path: polygon(2% 10%, 97% 0%, 100% 22%, 98% 52%, 100% 80%, 96% 100%, 3% 94%, 0% 70%, 2% 42%);
  pointer-events: none;
  z-index: 3;
}

.tape-t { top: -11px; left: 50%; transform: translateX(-50%) rotate(-2.5deg); }
.tape-tl { top: -10px; left: 26px; transform: rotate(-6deg); }
.tape-tr { top: -10px; right: 26px; transform: rotate(5deg); }
.tape-sm { width: 64px; height: 19px; }

/* 撕纸边（用于红色区块顶部） */
.torn {
  height: 26px;
  background: var(--footer-bg);
  -webkit-mask: var(--torn-mask) repeat-x bottom;
  mask: var(--torn-mask) repeat-x bottom;
  -webkit-mask-size: 300px 26px;
  mask-size: 300px 26px;
  pointer-events: none;
}

/* 涂鸦装饰 */
.doodle {
  position: absolute;
  pointer-events: none;
  background-repeat: no-repeat;
  background-size: contain;
  z-index: 0;
}

.doodle-sprig {
  width: 110px; height: 110px;
  opacity: .5;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120' fill='none' stroke='%23b03a2e' stroke-width='2' stroke-linecap='round'><path d='M60 112 C 58 84 52 60 34 18'/><path d='M52 62 C 40 58 32 48 30 36 C 44 40 52 50 52 62 Z' fill='%23b03a2e' fill-opacity='.14' stroke-opacity='.7'/><path d='M44 38 C 34 34 28 24 28 14 C 40 18 46 28 44 38 Z' fill='%23b03a2e' fill-opacity='.14' stroke-opacity='.7'/><path d='M58 84 C 70 82 78 74 80 62 C 66 66 58 74 58 84 Z' fill='%23b03a2e' fill-opacity='.14' stroke-opacity='.7'/></svg>");
}

.doodle-star {
  width: 34px; height: 34px;
  opacity: .55;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40' fill='none' stroke='%23b03a2e' stroke-width='2.4' stroke-linecap='round'><path d='M20 4 V36 M4 20 H36 M9 9 L31 31 M31 9 L9 31'/></svg>");
}

.doodle-butterfly {
  width: 64px; height: 56px;
  opacity: .6;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='70' height='60' viewBox='0 0 70 60' fill='none' stroke='%232b2318' stroke-width='2' stroke-linecap='round'><path d='M35 30 C 25 8 5 8 8 24 C 10 36 26 38 35 30 Z' fill='%23b03a2e' fill-opacity='.1'/><path d='M35 30 C 45 8 65 8 62 24 C 60 36 44 38 35 30 Z' fill='%23b03a2e' fill-opacity='.1'/><path d='M35 30 C 27 40 18 52 26 55 C 32 57 35 44 35 32'/><path d='M35 30 C 43 40 52 52 44 55 C 38 57 35 44 35 32'/><path d='M35 28 V14 M35 14 L30 8 M35 14 L40 8'/></svg>");
}

[data-theme="dark"] .doodle-butterfly {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='70' height='60' viewBox='0 0 70 60' fill='none' stroke='%23efe5cf' stroke-width='2' stroke-linecap='round'><path d='M35 30 C 25 8 5 8 8 24 C 10 36 26 38 35 30 Z' fill='%23d4604c' fill-opacity='.12'/><path d='M35 30 C 45 8 65 8 62 24 C 60 36 44 38 35 30 Z' fill='%23d4604c' fill-opacity='.12'/><path d='M35 30 C 27 40 18 52 26 55 C 32 57 35 44 35 32'/><path d='M35 30 C 43 40 52 52 44 55 C 38 57 35 44 35 32'/><path d='M35 28 V14 M35 14 L30 8 M35 14 L40 8'/></svg>");
}

/* ===== Header ===== */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px dashed var(--border-strong);
  transition: background .25s, border-color .25s;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 66px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-family: var(--hand);
  font-weight: 700;
  font-size: 1.4rem;
  transform: rotate(-1deg);
}

/* 红色印章 logo */
.logo-mark {
  width: 30px;
  height: 30px;
  border-radius: 6px 9px 7px 8px;
  background: var(--accent);
  box-shadow: inset 0 0 0 2px var(--surface), inset 0 0 0 3.5px var(--accent);
  transform: rotate(-3deg);
}

.main-nav {
  display: flex;
  gap: 4px;
}

.nav-link {
  position: relative;
  padding: 7px 14px;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: .95rem;
  border-radius: 4px;
}

.nav-link:hover {
  color: var(--text);
  opacity: 1;
}

.nav-link.active {
  color: var(--accent);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 2px;
  height: 6px;
  background: var(--squiggle) repeat-x center / 36px 6px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 10px 4px 11px 5px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 1.05rem;
  line-height: 1;
  transition: transform .2s, border-color .2s, color .2s;
}

.theme-toggle:hover {
  transform: rotate(-6deg);
  border-color: var(--accent);
  color: var(--accent);
}

.theme-icon-light { display: none; }
[data-theme="light"] .theme-icon-dark { display: none; }
[data-theme="light"] .theme-icon-light { display: inline; }

.lang-toggle {
  width: 36px;
  height: 36px;
  border-radius: 4px 11px 5px 10px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: .78rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: .02em;
  text-decoration: none;
  font-family: var(--font-hand, 'Caveat', cursive);
  transition: transform .2s, border-color .2s, color .2s;
}

.lang-toggle:hover {
  transform: rotate(4deg) scale(1.05);
  border-color: var(--accent);
  color: var(--accent);
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text);
  border-radius: 2px;
  transition: transform .25s, opacity .25s;
}

@media (max-width: 780px) {
  .main-nav {
    position: fixed;
    inset: 66px 0 auto 0;
    flex-direction: column;
    background: var(--surface-solid);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    gap: 8px;
    transform: translateY(-120%);
    opacity: 0;
    transition: transform .3s, opacity .3s;
    pointer-events: none;
  }
  .main-nav.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .menu-toggle { display: flex; }
}

/* ===== Buttons（印章式） ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 12px 5px 13px 6px;
  font-weight: 700;
  font-size: .95rem;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s, background .2s;
}

.btn:hover { transform: translateY(-2px) rotate(-.5deg); opacity: 1; }

.btn-primary {
  background: var(--accent);
  color: #fdf6e9;
  box-shadow: 3px 4px 0 rgba(var(--accent-rgb), .35);
}

.btn-primary:hover {
  box-shadow: 4px 6px 0 rgba(var(--accent-rgb), .4);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-danger {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}

.btn-danger:hover {
  background: rgba(var(--accent-rgb), .1);
  border-color: var(--accent-2);
}

.btn-sm { padding: 7px 14px; font-size: .85rem; }

/* Pen icon button (admin entry) — 印章样式 */
.btn-icon-pen {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 15px;
  border-radius: 11px 5px 12px 6px;
  font-size: .86rem;
  font-weight: 700;
  color: #fdf6e9;
  background: var(--accent);
  border: 1.5px solid var(--accent-2);
  box-shadow: 2px 3px 0 rgba(var(--accent-rgb), .35);
  transition: all .25s ease;
}

.btn-icon-pen svg { transition: transform .3s ease; }

.btn-icon-pen:hover {
  transform: translateY(-1px) rotate(-1deg);
  box-shadow: 3px 5px 0 rgba(var(--accent-rgb), .45);
  opacity: 1;
}

.btn-icon-pen:hover svg { transform: rotate(-12deg) scale(1.1); }

[data-theme="light"] .btn-icon-pen:hover { color: #fdf6e9; }

/* ===== Home Layout ===== */
.home-layout {
  position: relative;
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 54px;
  max-width: 1280px;
  margin: 0 auto;
  width: 92%;
  padding: 130px 0 70px;
}

.home-sidebar {
  position: relative;
  padding: 40px 30px 34px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px 14px 8px 16px;
  box-shadow:
    0 1px 2px rgba(0,0,0,.06),
    0 14px 34px rgba(74, 56, 36, .14);
  transform: rotate(-.4deg);
}

/* 卡纸双层边框 */
.home-sidebar::before {
  content: '';
  position: absolute;
  inset: 9px;
  border: 1px dashed var(--border-strong);
  border-radius: 4px 10px 6px 12px;
  pointer-events: none;
}

.sidebar-deco { display: none; }

.sidebar-sticky {
  position: sticky;
  top: 96px;
  z-index: 1;
}

/* 拍立得头像 */
.polaroid {
  position: relative;
  width: 168px;
  margin: 6px auto 30px;
  padding: 10px 10px 12px;
  background: #fdfaf2;
  border: 1px solid var(--border);
  box-shadow: 0 8px 22px rgba(74, 56, 36, .2);
  transform: rotate(-2.4deg);
  transition: transform .3s;
}

[data-theme="dark"] .polaroid { background: #3a3225; }

.polaroid:hover { transform: rotate(-.6deg) scale(1.02); }

.polaroid .hero-avatar {
  width: 100%;
  height: 148px;
  object-fit: cover;
  border-radius: 2px;
  border: none;
  filter: sepia(.14) saturate(.92);
}

[data-theme="dark"] .polaroid .hero-avatar { filter: sepia(.1) brightness(.94); }

.polaroid-caption {
  display: block;
  text-align: center;
  margin-top: 8px;
  font-family: var(--hand-cn);
  font-size: 1.15rem;
  color: var(--text-secondary);
}

.hero-title {
  font-family: var(--hand);
  font-size: clamp(2.7rem, 5.6vw, 3.9rem);
  font-weight: 700;
  line-height: 1.02;
  margin: 0 0 16px;
  color: var(--text);
  transform: rotate(-1.2deg);
  position: relative;
  padding-bottom: 14px;
}

.hero-title::after {
  content: '';
  position: absolute;
  left: 4%;
  bottom: 0;
  width: 72%;
  height: 7px;
  background: var(--squiggle) repeat-x center / 36px 6px;
  transform: rotate(-.6deg);
}

/* 文字轮播：红墨手写 */
.text-loop {
  height: 36px;
  overflow: hidden;
  margin: 0 0 10px;
  position: relative;
}

.text-loop-inner {
  display: flex;
  flex-direction: column;
  animation: text-loop-scroll 10s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

.text-loop-inner span {
  height: 36px;
  line-height: 36px;
  font-family: var(--hand-cn);
  font-size: 1.25rem;
  color: var(--accent);
  letter-spacing: .05em;
}

@keyframes text-loop-scroll {
  0%   { transform: translateY(0); }
  16%  { transform: translateY(0); }
  20%  { transform: translateY(-36px); }
  36%  { transform: translateY(-36px); }
  40%  { transform: translateY(-72px); }
  56%  { transform: translateY(-72px); }
  60%  { transform: translateY(-108px); }
  76%  { transform: translateY(-108px); }
  80%  { transform: translateY(-144px); }
  96%  { transform: translateY(-144px); }
  100% { transform: translateY(-180px); }
}

.hero-tagline {
  font-family: var(--serif);
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 12px;
}

.hero-welcome {
  color: var(--text-secondary);
  font-size: .95rem;
  margin: 0 0 26px;
  line-height: 1.75;
}

.hero-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

.hero-links a {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 9px 4px 10px 5px;
  border: 1.5px solid var(--border-strong);
  color: var(--text-secondary);
  font-size: .86rem;
  font-weight: 600;
  background: transparent;
  transition: color .2s, border-color .2s, transform .2s;
}

.hero-links a:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px) rotate(-1deg);
  opacity: 1;
}

.hero-stats {
  display: flex;
  gap: 30px;
  color: var(--text-secondary);
  font-size: .88rem;
  margin-bottom: 30px;
  font-family: var(--serif);
}

.hero-stats strong {
  font-family: var(--hand);
  font-size: 1.7rem;
  color: var(--accent);
  margin-right: 6px;
}

.sidebar-cats {
  border-top: 1px dashed var(--border-strong);
  padding-top: 22px;
}

.sidebar-cats-title {
  font-family: var(--hand-cn);
  font-size: 1.15rem;
  color: var(--accent);
  margin-bottom: 12px;
}

.sidebar-cats-list {
  display: flex;
  flex-direction: column;
}

.sidebar-cats-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 0;
  color: var(--text-secondary);
  font-size: .93rem;
  font-weight: 500;
  transition: color .2s, padding-left .2s;
}

.sidebar-cats-list a:hover {
  color: var(--accent);
  padding-left: 6px;
  opacity: 1;
}

.sidebar-cats-list em {
  font-style: normal;
  font-family: var(--hand);
  font-size: .95rem;
  color: var(--accent);
  border-bottom: 2px solid rgba(var(--accent-rgb), .35);
}

/* ===== Sidebar tags ===== */
.sidebar-tags {
  border-top: 1px dashed var(--border-strong);
  padding-top: 22px;
  margin-top: 22px;
}

.sidebar-tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sidebar-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 12px;
  border-radius: 8px 3px 9px 4px;
  font-size: .84rem;
  color: var(--text-secondary);
  border: 1px dashed var(--border-strong);
  background: transparent;
  transition: color .2s, border-color .2s, transform .2s;
}

.sidebar-tag-pill em {
  font-style: normal;
  font-family: var(--hand);
  font-size: .82rem;
  color: var(--accent);
  opacity: .8;
}

.sidebar-tag-pill:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px) rotate(-1deg);
  opacity: 1;
}

.home-main {
  min-width: 0;
  position: relative;
}

.showcase { margin-bottom: 48px; }

@media (max-width: 900px) {
  .home-layout {
    grid-template-columns: 1fr;
    padding-top: 104px;
  }
  .sidebar-sticky { position: static; }
}

/* ===== Sections ===== */
.section { padding: 70px 0; }

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 30px;
  gap: 14px;
  flex-wrap: wrap;
}

.section-title {
  font-family: var(--serif);
  font-weight: 900;
  font-size: 1.75rem;
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 14px;
  position: relative;
}

/* 红色印章方块标题符 */
.section-title::before {
  content: '';
  align-self: center;
  width: 14px;
  height: 14px;
  background: var(--accent);
  border-radius: 3px 5px 2px 6px;
  box-shadow: inset 0 0 0 2px var(--surface), inset 0 0 0 3px var(--accent);
  transform: rotate(4deg);
  flex-shrink: 0;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: .95rem;
}

.section-more {
  font-family: var(--hand-cn);
  font-size: 1.2rem;
  color: var(--accent);
  border-bottom: 2px solid rgba(var(--accent-rgb), .35);
  padding-bottom: 2px;
}

.section-more:hover { opacity: .8; }

/* ===== Post Cards（信纸卡片） ===== */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 30px;
}

.post-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px 13px 7px 15px;
  overflow: visible;
  box-shadow: 0 10px 26px rgba(74, 56, 36, .13);
  transition: transform .28s cubic-bezier(.25,.46,.45,.94), box-shadow .28s;
  display: flex;
  flex-direction: column;
  transform: rotate(-.5deg);
}

.post-grid .post-card:nth-child(even) { transform: rotate(.6deg); }

.post-card:hover {
  transform: rotate(0) translateY(-6px);
  box-shadow: 0 20px 44px rgba(74, 56, 36, .2);
}

.post-card .tape {
  width: 74px;
  height: 22px;
}

.post-card-cover {
  margin: 14px 14px 0;
  height: 200px;
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-2);
}

.post-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: sepia(.12) saturate(.95);
  transition: transform .5s, filter .5s;
}

.post-card:hover .post-card-cover img {
  transform: scale(1.05);
  filter: sepia(0) saturate(1.05);
}

.post-card-body {
  padding: 20px 24px 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  font-size: .82rem;
  color: var(--text-secondary);
}

.post-date {
  white-space: nowrap;
  font-family: var(--hand);
  font-size: 1rem;
  color: var(--accent);
}

.post-cats {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* 邮戳式分类标签 */
.cat-pill, .tag-pill {
  display: inline-block;
  padding: 2px 11px;
  border-radius: 8px 3px 9px 4px;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  font-size: .78rem;
  font-weight: 700;
  background: transparent;
  transform: rotate(-1deg);
}

.tag-pill {
  border-color: var(--border-strong);
  color: var(--text-secondary);
  transform: rotate(.5deg);
}

.post-card h3 {
  font-family: var(--serif);
  font-weight: 900;
  margin: 0 0 8px;
  font-size: 1.35rem;
  line-height: 1.35;
}

.post-card h3 a { color: var(--text); }
.post-card h3 a:hover { color: var(--accent); opacity: 1; }

.post-subtitle {
  margin: 0 0 14px;
  color: var(--text-secondary);
  font-size: .95rem;
  line-height: 1.55;
}

.post-summary {
  margin: 0 0 18px;
  color: var(--text-secondary);
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.post-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .82rem;
  color: var(--text-secondary);
  border-top: 1px dashed var(--border-strong);
  padding-top: 14px;
}

.read-link {
  font-family: var(--hand-cn);
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--accent);
}

/* ===== Featured ===== */
.featured-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.featured-card {
  position: relative;
  border-radius: 5px 13px 7px 15px;
  overflow: hidden;
  min-height: 240px;
  display: flex;
  align-items: flex-end;
  padding: 20px;
  background-size: cover;
  background-position: center;
  border: 1px solid var(--border);
  box-shadow: 0 10px 26px rgba(74, 56, 36, .15);
}

.featured-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(20, 14, 8, .78), transparent 60%);
}

.featured-card h4 {
  position: relative;
  z-index: 1;
  margin: 0;
  color: #fdf6e9;
  font-family: var(--serif);
  font-size: 1.1rem;
}

@media (max-width: 860px) {
  .featured-grid { grid-template-columns: 1fr; }
}

/* ===== Showcase ===== */
.section-tight { padding-top: 0; }

.container-narrow { max-width: 760px; }

.showcase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.showcase-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px 11px 6px 12px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(74, 56, 36, .1);
  transition: transform .25s, box-shadow .25s, border-color .25s;
}

.showcase-card:hover {
  transform: translateY(-5px) rotate(-.5deg);
  box-shadow: 0 14px 34px rgba(74, 56, 36, .18);
  border-color: var(--accent);
  opacity: 1;
}

.showcase-thumb {
  height: 130px;
  background-size: cover;
  background-position: center;
}

.showcase-title {
  display: block;
  padding: 12px 14px;
  font-size: .9rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

/* ===== Post List（信纸长卡片） ===== */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 38px;
}

.post-item {
  position: relative;
  padding: 36px 40px 30px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px 14px 7px 16px;
  box-shadow: 0 10px 28px rgba(74, 56, 36, .12);
  overflow: visible;
  transition: transform .35s cubic-bezier(.4,0,.2,1), box-shadow .35s;
  transform: rotate(-.35deg);
}

.post-list .post-item:nth-child(even) { transform: rotate(.4deg); }

.post-item:hover {
  transform: rotate(0) translateY(-4px);
  box-shadow: 0 18px 40px rgba(74, 56, 36, .2);
}

/* 横线信纸效果 */
.post-item::before {
  content: '';
  position: absolute;
  inset: 12px;
  border: 1px dashed var(--border);
  border-radius: 4px 10px 5px 12px;
  pointer-events: none;
  opacity: .7;
}

.post-item-banner {
  display: block;
  margin: 16px 0 18px;
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-2);
}

.post-item-banner img {
  width: 100%;
  height: auto;
  max-height: 280px;
  object-fit: cover;
  display: block;
  filter: sepia(.12) saturate(.95);
  transition: transform .35s, filter .35s;
}

.post-item:hover .post-item-banner img {
  transform: scale(1.03);
  filter: sepia(0) saturate(1.05);
}

.post-item-title {
  font-family: var(--serif);
  font-weight: 900;
  margin: 0 0 6px;
  font-size: 1.55rem;
  line-height: 1.3;
}

.post-item-title a { color: var(--text); }
.post-item-title a:hover { color: var(--accent); opacity: 1; }

.post-item-subtitle {
  margin: 0 0 12px;
  color: var(--text-secondary);
  font-size: .98rem;
}

.post-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: .85rem;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.meta-sep { color: var(--text-secondary); opacity: .6; }

.post-cats { display: inline-flex; gap: 6px; flex-wrap: wrap; }

.cat-link {
  color: var(--accent);
  font-weight: 600;
  border-bottom: 2px solid rgba(var(--accent-rgb), .3);
}

.cat-link:hover { text-decoration: none; border-bottom-color: var(--accent); opacity: 1; }

.post-item-stat {
  font-size: .85rem;
  font-family: var(--hand);
  font-size: .98rem;
}

.post-item-summary {
  margin: 0 0 16px;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* ===== Pagination（邮戳翻页） ===== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 44px;
  padding-top: 24px;
  border-top: 1px dashed var(--border-strong);
}

.pagination a {
  padding: 7px 18px;
  border-radius: 10px 4px 11px 5px;
  font-size: .92rem;
  font-weight: 600;
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  color: var(--text);
  transition: all .2s;
}

.pagination a:hover:not(.disabled) {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px) rotate(-1deg);
  opacity: 1;
}

.pagination a.disabled {
  opacity: .4;
  cursor: not-allowed;
  color: var(--text-secondary);
}

.pagination-info {
  font-family: var(--hand);
  font-size: 1.15rem;
  color: var(--accent);
}

/* ===== Article Page ===== */
.article-hero {
  padding: 120px 0 46px;
  text-align: center;
}

.article-hero h1 {
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(1.8rem, 5vw, 3rem);
  margin: 0 auto 16px;
  max-width: 820px;
  line-height: 1.25;
}

.article-hero h1::after {
  content: '';
  display: block;
  width: 140px;
  height: 7px;
  margin: 14px auto 0;
  background: var(--squiggle) repeat-x center / 36px 6px;
}

.article-subtitle {
  color: var(--text-secondary);
  font-size: 1.15rem;
  margin: 0 auto 24px;
  max-width: 720px;
}

.article-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--text-secondary);
  font-size: .9rem;
}

.article-meta time {
  font-family: var(--hand);
  font-size: 1.05rem;
  color: var(--accent);
}

.article-tags {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.article-tags .tag-pill {
  font-size: .82rem;
  padding: 4px 14px;
  text-decoration: none;
  transition: transform .2s;
}

.article-tags .tag-pill:hover {
  transform: translateY(-2px) rotate(-1deg);
  opacity: 1;
}

.article-cover {
  margin: 32px auto 0;
  max-width: 860px;
  position: relative;
  padding: 12px 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 14px 36px rgba(74, 56, 36, .18);
  transform: rotate(-.6deg);
}

.article-cover img {
  width: 100%;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 760px) 280px;
  gap: 50px;
  justify-content: center;
  padding: 46px 0 90px;
}

@media (max-width: 980px) {
  .article-layout { grid-template-columns: 1fr; }
  .toc-wrap { display: none; }
}

/* ===== Prose（稿纸排版） ===== */
.prose {
  font-size: 1.05rem;
  line-height: 1.9;
  color: var(--text);
}

.prose h2, .prose h3, .prose h4 {
  font-family: var(--serif);
  font-weight: 900;
  margin-top: 2.2em;
  margin-bottom: .8em;
  line-height: 1.3;
  scroll-margin-top: 90px;
}

.prose h2 {
  font-size: 1.7rem;
  padding-bottom: 8px;
  background: var(--squiggle) repeat-x left bottom / 36px 6px;
}

.prose h3 { font-size: 1.35rem; }

.prose p { margin: 0 0 1.2em; }

.prose a {
  color: var(--accent);
  border-bottom: 1.5px solid rgba(var(--accent-rgb), .4);
}
.prose a:hover { border-bottom-color: var(--accent); opacity: 1; }

.prose img {
  border-radius: 3px;
  margin: 1.5em 0;
  border: 1px solid var(--border);
  box-shadow: 0 8px 22px rgba(74, 56, 36, .14);
}

.prose video {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.5em 0;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 22px rgba(74, 56, 36, .14);
  background: #000;
}

.prose ul, .prose ol { padding-left: 1.6em; margin: 0 0 1.2em; }
.prose li { margin: .35em 0; }

/* 便签式引用 */
.prose blockquote {
  position: relative;
  margin: 1.8em 0;
  padding: 20px 24px 18px;
  background: var(--pink-note);
  border: 1px solid var(--border);
  border-radius: 3px 10px 4px 12px;
  color: var(--text-secondary);
  box-shadow: 0 6px 16px rgba(74, 56, 36, .1);
  transform: rotate(-.4deg);
}

.prose blockquote::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  width: 70px;
  height: 18px;
  background: var(--tape);
  clip-path: polygon(2% 10%, 97% 0%, 100% 22%, 98% 52%, 100% 80%, 96% 100%, 3% 94%, 0% 70%, 2% 42%);
}

.prose blockquote p:last-child { margin-bottom: 0; }

.prose code {
  font-family: var(--mono);
  font-size: .88em;
  background: rgba(var(--accent-rgb), .08);
  border: 1px solid rgba(var(--accent-rgb), .18);
  padding: 2px 7px;
  border-radius: 4px;
  color: var(--accent);
}

.prose pre {
  background: var(--code-bg);
  border-radius: 8px 4px 9px 5px;
  padding: 20px;
  overflow-x: auto;
  margin: 1.6em 0;
  box-shadow: 0 10px 26px rgba(74, 56, 36, .2), inset 0 0 0 1px rgba(255, 244, 220, .08);
  transform: rotate(-.2deg);
}

[data-theme="dark"] .prose pre {
  box-shadow: inset 0 0 0 1px rgba(255, 244, 220, .1);
}

.prose pre code {
  background: transparent;
  padding: 0;
  color: inherit;
  font-size: .9rem;
  line-height: 1.65;
}

/* ---------- 代码块卡片：一键复制 + 过长折叠 ---------- */
.code-block {
  position: relative;
  background: var(--code-bg);
  border-radius: 10px 6px 11px 7px;
  margin: 1.6em 0;
  box-shadow: 0 10px 26px rgba(74, 56, 36, .2), inset 0 0 0 1px rgba(255, 244, 220, .08);
  transform: rotate(-.2deg);
  overflow: hidden;
}
[data-theme="dark"] .code-block {
  box-shadow: inset 0 0 0 1px rgba(255, 244, 220, .1);
}
.code-block__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 12px;
  background: rgba(255, 244, 220, .05);
  border-bottom: 1px solid rgba(255, 244, 220, .08);
  font-size: .8rem;
}
.code-block__lang {
  font-family: var(--mono);
  letter-spacing: .04em;
  color: rgba(232, 217, 189, .7);
  text-transform: lowercase;
  user-select: none;
}
.code-block__actions { display: flex; gap: 8px; }
.code-block__btn {
  font-family: inherit;
  font-size: .76rem;
  line-height: 1;
  color: rgba(232, 217, 189, .85);
  background: rgba(255, 244, 220, .08);
  border: 1px solid rgba(255, 244, 220, .14);
  border-radius: 5px;
  padding: 5px 9px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.code-block__btn:hover {
  background: rgba(var(--accent-rgb), .25);
  border-color: rgba(var(--accent-rgb), .5);
  color: #fff;
}
.code-block__btn:active { transform: translateY(1px); }
.code-block__body { position: relative; }
/* 卡片内部淡去 pre 自身的背景/外框，统一由卡片承载 */
.prose .code-block__body pre,
.code-block__body pre {
  margin: 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  transform: none;
}
.code-block--collapsed .code-block__body {
  max-height: 18em;
  overflow-y: auto;
  transition: max-height .3s ease;
}
.code-block__fade {
  display: none;
}

.md-figure { margin: 1.8em 0; }
.md-figure img { margin: 0; border-radius: 3px; }
.md-figure figcaption {
  text-align: center;
  font-family: var(--hand-cn);
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-top: 8px;
}

/* ===== TOC（手绘便签目录） ===== */
.toc-wrap { position: relative; }

.toc {
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 150px);
  overflow-y: auto;
  background-color: var(--pink-note);
  background-image: var(--paper-noise);
  background-blend-mode: multiply;
  border: 1px solid var(--border);
  border-radius: 4px 12px 6px 14px;
  padding: 24px 20px 18px;
  box-shadow: 0 10px 26px rgba(74, 56, 36, .16);
  transform: rotate(-1.1deg);
  transition: transform .3s ease, box-shadow .3s ease;
}

.toc:hover {
  transform: rotate(0deg) translateY(-3px);
  box-shadow: 0 18px 40px rgba(74, 56, 36, .2);
}

.toc-tape {
  position: absolute;
  top: -13px;
  left: 50%;
  width: 94px;
  height: 25px;
  transform: translateX(-50%) rotate(-4deg);
  background: var(--tape);
  clip-path: polygon(3% 0, 97% 5%, 100% 95%, 2% 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35);
  pointer-events: none;
}

.toc-title {
  display: inline-block;
  font-family: var(--hand-cn);
  font-size: 1.3rem;
  margin: 0 0 14px;
  color: var(--accent);
}

.toc-title::after {
  content: "";
  display: block;
  height: 5px;
  margin-top: 3px;
  background: var(--squiggle) repeat-x;
  background-size: 36px 6px;
  opacity: .85;
}

.toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: .88rem;
}

.toc li { margin: 9px 0; }

.toc li a {
  display: flex;
  gap: 8px;
  align-items: baseline;
  padding: 2px 6px;
  margin: 0 -6px;
  border-radius: 6px;
  color: var(--text-secondary);
  transition: color .2s, background .2s;
}

.toc li a:hover {
  color: var(--accent);
  background: rgba(176, 58, 46, .09);
  opacity: 1;
}

.toc-num {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: .7rem;
  color: var(--accent);
  opacity: .55;
}

.toc-text { position: relative; }

.toc li a:hover .toc-text::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 5px;
  background: var(--squiggle) repeat-x;
  background-size: 30px 5px;
  opacity: .9;
}

.toc .toc-h3 { padding-left: 12px; }
.toc .toc-h4 { padding-left: 24px; }

.article-layout--no-toc { grid-template-columns: minmax(0, 860px); }

/* ===== Categories & Tags ===== */
.cat-grid, .tag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 26px;
}

.cat-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px 13px 7px 15px;
  padding: 26px;
  box-shadow: 0 8px 24px rgba(74, 56, 36, .12);
  transition: transform .25s, box-shadow .25s;
  transform: rotate(-.4deg);
}

.cat-grid .cat-card:nth-child(even) { transform: rotate(.5deg); }

.cat-card:hover {
  transform: rotate(0) translateY(-5px);
  box-shadow: 0 16px 38px rgba(74, 56, 36, .18);
}

.cat-card h3 {
  font-family: var(--serif);
  font-weight: 900;
  margin: 0 0 8px;
  font-size: 1.2rem;
}

.cat-card p { margin: 0; color: var(--text-secondary); font-size: .9rem; }

.cat-card .count {
  display: inline-block;
  margin-top: 14px;
  font-family: var(--hand);
  font-size: 1.05rem;
  color: var(--accent);
  border-bottom: 2px solid rgba(var(--accent-rgb), .35);
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.tag-cloud a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: 9px 4px 10px 5px;
  border: 1.5px dashed var(--border-strong);
  color: var(--text-secondary);
  font-size: .9rem;
  background: transparent;
  transition: transform .2s, border-color .2s, color .2s;
}

.tag-cloud a:hover {
  transform: translateY(-3px) rotate(-1deg);
  border-color: var(--accent);
  color: var(--accent);
}

.tag-count {
  font-family: var(--hand);
  font-size: .95rem;
  color: var(--accent);
}

/* ===== Archive（时间轴 = 细麻绳挂照片） ===== */
.archive-timeline {
  position: relative;
  padding-left: 28px;
}

.archive-timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: repeating-linear-gradient(180deg, var(--border-strong) 0 7px, transparent 7px 12px);
}

.archive-year {
  position: relative;
  margin-bottom: 32px;
}

.archive-year h3 {
  font-family: var(--hand);
  font-size: 1.7rem;
  color: var(--accent);
  margin: 0 0 16px;
}

.archive-year h3::before {
  content: '';
  position: absolute;
  left: -28px;
  top: 12px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--bg);
}

.archive-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.archive-list li {
  margin: 10px 0;
  display: flex;
  gap: 16px;
  align-items: baseline;
}

.archive-list time {
  font-family: var(--hand);
  color: var(--text-secondary);
  font-size: .98rem;
  min-width: 64px;
}

.archive-list a {
  color: var(--text);
  font-weight: 600;
  font-family: var(--serif);
}

.archive-list a:hover { color: var(--accent); opacity: 1; }

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-secondary);
}

.empty-state h2 {
  font-family: var(--serif);
  color: var(--text);
  margin-bottom: 10px;
}

/* ===== Footer（红色撕纸块） ===== */
.site-footer {
  background: var(--footer-bg);
  color: #f6e7d4;
  padding: 52px 0 40px;
  position: relative;
}

.footer-inner { text-align: center; }

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--hand);
  font-size: 1.5rem;
  margin-bottom: 12px;
}

.footer-brand .logo-mark {
  background: #f6e7d4;
  box-shadow: inset 0 0 0 2px var(--footer-bg), inset 0 0 0 3.5px #f6e7d4;
}

.footer-desc {
  color: rgba(246, 231, 212, .75);
  max-width: 480px;
  margin: 0 auto 18px;
  font-size: .95rem;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-bottom: 24px;
}

.social-links a {
  display: inline-block;
  padding: 4px 16px;
  border: 1.5px dashed rgba(246, 231, 212, .55);
  border-radius: 9px 4px 10px 5px;
  color: #f6e7d4;
  font-size: .88rem;
  font-weight: 600;
  transition: border-color .2s, transform .2s;
}

.social-links a:hover {
  border-color: #f6e7d4;
  transform: translateY(-2px) rotate(-1deg);
  opacity: 1;
}

.copyright {
  font-size: .82rem;
  color: rgba(246, 231, 212, .6);
  margin: 0;
}

/* ===== Error Page ===== */
.error-page {
  text-align: center;
  padding: 160px 20px;
}

.error-page h1 {
  font-family: var(--hand);
  font-size: 5.5rem;
  margin: 0;
  color: var(--accent);
  transform: rotate(-2deg);
}

/* ===== Custom Highlight.js（纸上深墨代码块用同套配色） ===== */
.hljs { color: #e8d9bd; background: transparent; }

.hljs-keyword, .hljs-selector-tag, .hljs-literal, .hljs-section, .hljs-link { color: #e59a8c; }
.hljs-subst { color: #d98e7d; }
.hljs-string, .hljs-title, .hljs-name, .hljs-type, .hljs-attribute, .hljs-symbol, .hljs-bullet, .hljs-addition, .hljs-variable, .hljs-template-tag, .hljs-template-variable { color: #b7c98a; }
.hljs-comment, .hljs-quote, .hljs-deletion { color: #8d8065; font-style: italic; }
.hljs-meta, .hljs-meta .hljs-string { color: #9cc2b4; }
.hljs-number, .hljs-regexp, .hljs-built_in { color: #dcae7c; }
.hljs-function .hljs-title, .hljs-class .hljs-title { color: #e0b45e; }
.hljs-params { color: #e8d9bd; }

/* ===== Header Icon ===== */
.header-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px 4px 11px 5px;
  color: var(--text-secondary);
  background: transparent;
  border: 1.5px solid var(--border-strong);
  transition: color .2s, border-color .2s, transform .2s;
}

.header-icon:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px) rotate(-2deg);
}

/* ===== Comments ===== */
.comments-section { padding-top: 20px; }

.comment-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px 13px 7px 15px;
  padding: 26px;
  margin-bottom: 32px;
  box-shadow: 0 8px 22px rgba(74, 56, 36, .1);
  position: relative;
}

.comment-form::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 44px;
  width: 76px;
  height: 20px;
  background: var(--tape);
  transform: rotate(-3deg);
  clip-path: polygon(2% 10%, 97% 0%, 100% 22%, 98% 52%, 100% 80%, 96% 100%, 3% 94%, 0% 70%, 2% 42%);
}

.comment-form label {
  display: block;
  margin-bottom: 14px;
}

.comment-form label span {
  display: block;
  font-size: .85rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-secondary);
}

.input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 8px 4px 9px 5px;
  border: 1.5px solid var(--border-strong);
  background: transparent;
  color: var(--text);
  font-size: .95rem;
  font-family: var(--font);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .14);
}

.comment-form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.post-views {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.post-views svg {
  opacity: 0.65;
}


@media (max-width: 640px) {
  .comment-form-row { grid-template-columns: 1fr; }

  .post-item-banner img { max-height: 200px; }
}

.comment-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}

.comment-tip {
  font-family: var(--hand-cn);
  font-size: 1.02rem;
  color: var(--text-secondary);
}

.comment-message {
  min-height: 22px;
  margin-top: 12px;
  font-size: .9rem;
  color: var(--text-secondary);
}

.comment-message.success { color: #6d7d4f; }
.comment-message.error { color: var(--accent); }

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.comment-item {
  display: flex;
  gap: 16px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px 12px 6px 14px;
  box-shadow: 0 6px 16px rgba(74, 56, 36, .1);
  transform: rotate(-.3deg);
}

.comments-list .comment-item:nth-child(even) { transform: rotate(.3deg); }

.comment-avatar {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--border);
  border: 1px solid var(--border-strong);
  padding: 2px;
  background: #fdfaf2;
}

[data-theme="dark"] .comment-avatar { background: #3a3225; }

.comment-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 2px;
}

.comment-body {
  flex: 1;
  min-width: 0;
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.comment-author {
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.comment-author:hover { color: var(--accent); opacity: 1; }

.comment-date {
  font-family: var(--hand);
  font-size: .95rem;
  color: var(--text-secondary);
}

.comment-text {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
}

.comments-empty {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
  background: transparent;
  border: 1.5px dashed var(--border-strong);
  border-radius: 5px 12px 6px 14px;
}

/* ===== Search Page ===== */
.search-form {
  display: flex;
  gap: 12px;
  margin-bottom: 36px;
}

.search-input {
  flex: 1;
  padding: 13px 18px;
  border-radius: 10px 5px 11px 6px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .14);
}

.search-results {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.search-empty {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
}

.search-result-item {
  padding: 22px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px 12px 6px 14px;
  box-shadow: 0 6px 18px rgba(74, 56, 36, .1);
  transition: transform .2s, box-shadow .2s;
  transform: rotate(-.3deg);
}

.search-results .search-result-item:nth-child(even) { transform: rotate(.3deg); }

.search-result-item:hover {
  transform: rotate(0) translateY(-3px);
  box-shadow: 0 12px 30px rgba(74, 56, 36, .16);
}

.search-result-item h3 {
  font-family: var(--serif);
  font-weight: 900;
  margin: 0 0 8px;
  font-size: 1.15rem;
}

.search-result-item h3 a { color: var(--text); }
.search-result-item h3 a:hover { color: var(--accent); opacity: 1; }

.search-result-subtitle {
  margin: 0 0 8px;
  color: var(--text-secondary);
  font-size: .95rem;
}

.search-result-summary {
  margin: 0 0 12px;
  color: var(--text-secondary);
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-result-meta {
  font-size: .82rem;
  color: var(--text-secondary);
}

.search-result-meta span { margin-left: 8px; }

.search-result-item mark {
  background: rgba(var(--accent-rgb), .2);
  color: var(--accent);
  border-radius: 3px;
  padding: 0 2px;
}

/* ===== Links Page ===== */
.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
}

.link-card {
  display: block;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px 13px 7px 15px;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(74, 56, 36, .1);
  transition: transform .2s, box-shadow .2s;
  transform: rotate(-.4deg);
}

.links-grid .link-card:nth-child(even) { transform: rotate(.4deg); }

.link-card:hover {
  transform: rotate(0) translateY(-4px);
  box-shadow: 0 12px 30px rgba(74, 56, 36, .16);
}

.link-card-name {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 6px;
}

.link-card:hover .link-card-name { color: var(--accent); opacity: 1; }

.link-card-desc {
  margin: 0;
  font-size: .9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ===== Lightbox ===== */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  opacity: 0;
  transition: opacity .25s ease;
}

.lightbox-overlay.active { opacity: 1; }

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(24, 18, 10, .88);
  cursor: zoom-out;
}

.lightbox-img {
  position: relative;
  z-index: 1;
  max-width: 92vw;
  max-height: 84vh;
  object-fit: contain;
  background: #fdfaf2;
  padding: 12px 12px 16px;
  border: 1px solid var(--border);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .5);
  cursor: zoom-out;
  transform: scale(.96) rotate(-.5deg);
  transition: transform .25s ease;
}

.lightbox-overlay.active .lightbox-img { transform: scale(1); }

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 22px;
  z-index: 2;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(253, 250, 242, .14);
  color: #fdfaf2;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
}

.lightbox-close:hover { background: rgba(253, 250, 242, .28); }

/* ===== Utilities ===== */
.text-center { text-align: center; }
.mt-2 { margin-top: 12px; }
.mt-4 { margin-top: 28px; }

/* ============================================================
   分享组件（转发图标 + 点击展开面板 + 微信二维码弹窗）
   ============================================================ */
.post-share {
  display: flex;
  justify-content: flex-end;
  margin: 22px 0 4px;
}

.share-widget {
  position: relative;
  display: inline-flex;
}

.share-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: .84rem;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s, transform .15s;
}

.share-toggle:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fdfaf2;
  transform: translateY(-1px);
}

.share-toggle[aria-expanded="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fdfaf2;
}

.share-widget--footer .share-toggle {
  width: auto;
  height: auto;
  padding: 6px 14px;
  border-radius: 999px;
  border-color: rgba(253, 250, 242, .45);
  background: transparent;
  color: #fdfaf2;
}

.share-widget--footer .share-toggle:hover {
  background: rgba(253, 250, 242, .16);
  border-color: rgba(253, 250, 242, .7);
  color: #fdfaf2;
}

.share-widget--footer .share-toggle[aria-expanded="true"] {
  background: rgba(253, 250, 242, .2);
  color: #fdfaf2;
}

.social-links .share-widget { align-self: center; }

.share-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  width: 268px;
  padding: 12px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-solid);
  box-shadow: 0 14px 34px rgba(74, 56, 36, .22);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px) scale(.98);
  transform-origin: bottom right;
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
  z-index: 80;
}

.share-panel.open {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.share-link-row {
  display: flex;
  gap: 6px;
}

.share-link-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  color: var(--text-secondary);
  font-family: var(--mono);
  font-size: .74rem;
}

.share-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg-2);
  color: var(--text);
  cursor: pointer;
  transition: background .18s, color .18s, border-color .18s, transform .15s;
}

.share-icon-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fdfaf2;
  transform: translateY(-1px);
}

.share-icon-btn--copy {
  border-color: var(--accent);
  color: var(--accent);
}

.share-channels {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  margin-top: 10px;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface-solid);
  color: var(--text);
  font-family: inherit;
  font-size: .82rem;
  cursor: pointer;
  transition: transform .15s, background .2s, color .2s, border-color .2s;
}

.share-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fdfaf2;
  transform: translateY(-1px);
}

.share-btn--copy { border-color: var(--accent); color: var(--accent); }

.share-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .22s;
}

.share-modal-overlay.active { opacity: 1; }

.share-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(30, 22, 12, .58);
  backdrop-filter: blur(2px);
}

.share-modal {
  position: relative;
  width: min(360px, calc(100vw - 40px));
  padding: 24px 22px 20px;
  border-radius: var(--radius);
  background: var(--surface-solid);
  box-shadow: 0 20px 50px rgba(30, 22, 12, .34);
  text-align: center;
  transform: translateY(10px) scale(.98);
  transition: transform .22s;
}

.share-modal-overlay.active .share-modal { transform: none; }

.share-modal-close {
  position: absolute;
  top: 8px;
  right: 12px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.share-modal-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 14px;
  padding-right: 20px;
}

.share-qr {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 190px;
}

.share-qr-canvas {
  width: 190px;
  height: 190px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.share-qr-fallback {
  font-size: .82rem;
  color: var(--text-secondary);
}

.share-modal-tip {
  margin: 12px 0 10px;
  font-size: .78rem;
  color: var(--text-secondary);
}

.share-modal-link {
  display: flex;
  gap: 6px;
}

.share-modal-link input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  color: var(--text-secondary);
  font-family: var(--mono);
  font-size: .74rem;
}

.share-modal-link .share-btn { padding: 8px 12px; font-size: .78rem; }

.share-toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translate(-50%, 12px);
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(43, 35, 24, .92);
  color: #fdfaf2;
  font-size: .84rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 1300;
}

/* ===== 文章内编辑（笔图标 + 密码 + 编辑器） ===== */
.post-edit-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 4px;
  padding: 2px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-size: .82rem;
  cursor: pointer;
  transition: color .15s ease, background .15s ease, border-color .15s ease;
}
.post-edit-inline:hover {
  color: var(--accent);
  background: rgba(var(--accent-rgb), .12);
  border-color: rgba(var(--accent-rgb), .3);
}
.post-edit-inline.is-active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}
.post-edit-inline svg { width: 15px; height: 15px; }
.post-edit-inline-label { line-height: 1; }

.edit-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.edit-overlay.open { display: flex; }
.edit-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28, 20, 12, .55);
  backdrop-filter: blur(2px);
}
.edit-modal {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 720px;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  background: var(--surface-solid);
  border: 1px solid rgba(255, 244, 220, .12);
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .4);
}
.edit-modal--pwd { max-width: 420px; }
.edit-close {
  position: absolute;
  top: 8px; right: 10px;
  width: 32px; height: 32px;
  border: none; background: transparent;
  color: var(--text-secondary);
  font-size: 1.5rem; line-height: 1;
  cursor: pointer;
  border-radius: 8px;
}
.edit-close:hover { background: rgba(255, 244, 220, .1); color: var(--text); }
.edit-title { margin: 0 0 6px; font-size: 1.2rem; color: var(--text); }
.edit-hint { margin: 0 0 14px; font-size: .85rem; color: var(--text-secondary); }
/* 编辑器用 contenteditable，无 textarea */
.edit-msg { font-size: .82rem; color: #e0736a; }
.edit-msg:empty { display: none; }
.edit-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }

/* 就地编辑：正文直接可编辑（contenteditable），非弹窗、非文本框 */
.article-body.is-editing {
  outline: 2px dashed var(--accent);
  outline-offset: 4px;
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(var(--accent-rgb), .04);
}
.article-body[contenteditable="true"] { cursor: text; }
.inline-editor-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.inline-editor-hint {
  font-family: var(--mono);
  font-size: .82rem;
  color: var(--text-secondary);
}
.inline-editor-actions { display: flex; align-items: center; gap: 10px; }

.share-toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 520px) {
  .share-panel { width: min(268px, calc(100vw - 48px)); }
}
