/* ============================================================
   山海手记 · 拾光集同款视觉皮肤
   保留原页面的布局骨架与交互类名，整层替换视觉风格：
   奶油纸面 / 宋体标题 / 陶土色强调 / 磨砂玻璃导航
   ============================================================ */

/* 说明：不用 @view-transition { navigation: auto }。
   移动端（尤其 iOS Safari / 部分 Android WebView）在导航过渡动画期间
   连续点击会重复触发 view transition 捕获，导致页面卡死 / 白屏。
   改为 JS 在 site.js 里按需手动 startViewTransition，且加了幂等保护。 */


:root {
  color-scheme: light;

  /* 冷调纸面（对齐竞品配色，不再偏暖） */
  --page: #f4f6f3;
  --surface: #ffffff;
  --surface-soft: #edf1ec;
  --text: #26302d;
  --muted: #717d76;
  --line: rgba(38, 48, 45, 0.095);
  --accent: #a31f34;
  --accent-soft: rgba(163, 31, 52, 0.08);
  --sage: #527667;
  --blue: #4c7183;
  --shadow: 0 1px 2px rgba(37, 51, 44, 0.05), 0 10px 30px rgba(37, 51, 44, 0.06);
  --shadow-lift: 0 12px 36px rgba(37, 51, 44, 0.12);
  --navbar: rgba(255, 255, 255, 0.86);

  /* 微对比色阶：主文→次文→弱文→分隔线，四档递进，弱化硬对比 */
  --ink-1: #26302d;
  --ink-2: #4b5651;
  --ink-3: #6d7973;
  --line-soft: rgba(38, 48, 45, 0.055);
  --line-strong: rgba(38, 48, 45, 0.17);
  --focus-ring: rgba(163, 31, 52, 0.14);

  /* 现代清晰字栈：西文 Inter / Segoe UI，中文苹方 / MiSans / 雅黑
     弃用 Windows 下回退到 SimSun 的宋体栈（点阵渲染发虚），标题与正文统一字形 */
  --font-sans: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "MiSans", "HarmonyOS Sans SC", "Hiragino Sans GB",
    "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", sans-serif;
  --font-serif: var(--font-sans);
  --font-mono: "SF Mono", "JetBrains Mono", "Cascadia Code", ui-monospace, Consolas, monospace;

  /* 字重阶梯：暗色模式整体降一档，见下方 html[data-theme="dark"] */
  --fw-1: 400;
  --fw-2: 500;
  --fw-3: 600;
  --fw-4: 700;

  --radius: 18px;
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --page: #1c2220;
  --surface: #242b28;
  --surface-soft: #2b3430;
  --text: #e6e9e5;
  --muted: #a0aaa3;
  --line: rgba(230, 233, 229, 0.105);
  --accent: #d2707f;
  --accent-soft: rgba(210, 112, 127, 0.14);
  --sage: #9bb7a8;
  --blue: #9ebcca;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px rgba(0, 0, 0, 0.3);
  --shadow-lift: 0 14px 40px rgba(0, 0, 0, 0.45);
  --navbar: rgba(31, 38, 35, 0.9);

  /* 暗色微对比色阶 */
  --ink-1: #e6e9e5;
  --ink-2: #c8cfc9;
  --ink-3: #a9b4ad;
  --line-soft: rgba(230, 233, 229, 0.06);
  --line-strong: rgba(230, 233, 229, 0.19);
  --focus-ring: rgba(210, 112, 127, 0.18);

  /* 全站字重整体降一档；正文 400 保持，避免中文细体发虚 */
  --fw-1: 400;
  --fw-2: 400;
  --fw-3: 500;
  --fw-4: 600;
}



* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 86px; }

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.8;
  -webkit-font-smoothing: auto;
  text-rendering: optimizeLegibility;
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease);
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }
img { display: block; max-width: 100%; }

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

.icon {
  width: 18px; height: 18px; display: block; flex: 0 0 auto;
  fill: none; stroke: currentColor; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round;
}
.icon.small { width: 14px; height: 14px; }
.icon.tiny { width: 11px; height: 11px; }
.icon.large { width: 20px; height: 20px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

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

/* ---------- 首屏 ---------- */
.hero {
  position: relative;
  display: grid;
  min-height: 100vh;
  place-items: center;
  overflow: hidden;
  background: transparent;
  color: #fff;
}

.hero-media {
  position: absolute;
  inset: 0;
  will-change: transform;
  transform: scale(1.16);
  animation: scene-in 1.8s var(--ease);
  -webkit-mask-image: linear-gradient(180deg, #000 78%, rgba(0, 0, 0, 0.55) 90%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 78%, rgba(0, 0, 0, 0.55) 90%, transparent 100%);
}

.hero-image,
.hero-image-blur {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 46%;
}

/* 滚动时叠加的模糊层：透明度渐变比逐帧 blur 便宜得多 */
.hero-image-blur {
  filter: blur(18px) saturate(1.05);
  opacity: 0;
  will-change: opacity;
  pointer-events: none;
}

@keyframes scene-in {
  from { transform: scale(1.2); }
  to { transform: scale(1.16); }
}

.hero-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 66% 56% at 50% 42%, rgba(16, 14, 18, 0.58) 0%, rgba(16, 14, 18, 0.28) 62%, transparent 88%),
    linear-gradient(180deg, rgba(16, 14, 18, 0.52) 0%, rgba(16, 14, 18, 0.06) 34%, rgba(16, 14, 18, 0.12) 66%, rgba(16, 14, 18, 0.42) 94%),
    linear-gradient(180deg, transparent 72%, rgba(16, 14, 18, 0.18) 100%);
}

:root[data-theme="dark"] .hero-image,
:root[data-theme="dark"] .hero-image-blur {
  filter: brightness(0.62) saturate(0.9);
}

:root[data-theme="dark"] .hero-image-blur {
  filter: blur(18px) brightness(0.62) saturate(0.9);
}

:root[data-theme="dark"] .hero-shade {
  background:
    radial-gradient(ellipse 72% 58% at 50% 44%, rgba(10, 15, 26, 0.72) 0%, rgba(10, 15, 26, 0.52) 52%, transparent 88%),
    linear-gradient(180deg, rgba(10, 15, 26, 0.7) 0%, rgba(10, 15, 26, 0.1) 30%),
    linear-gradient(180deg, transparent 80%, var(--page) 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(100% - 40px, 880px);
  padding: 90px 0 120px;
  text-align: center;
  transform: translateY(-3vh);
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  padding: 7px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: rgba(255, 255, 255, 0.88);
  font-size: 11px;
  font-weight: var(--fw-2);
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.hero-kicker::before,
.hero-kicker::after { display: none; }

.hero h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(2.9rem, 7vw, 5rem);
  font-weight: var(--fw-3);
  line-height: 1.15;
  letter-spacing: 0.09em;
  text-shadow: 0 2px 14px rgba(10, 8, 12, 0.55), 0 12px 60px rgba(10, 8, 12, 0.5);
}

.hero-subtitle {
  margin: 22px auto 0;
  max-width: 32ch;
  color: rgba(255, 255, 255, 0.92);
  font-size: clamp(0.95rem, 1.5vw, 1.1rem);
  line-height: 1.9;
  letter-spacing: 0.08em;
  text-shadow: 0 1px 10px rgba(10, 8, 12, 0.65), 0 8px 30px rgba(10, 8, 12, 0.45);
}



@keyframes rise {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-bottom {
  position: absolute;
  z-index: 2;
  right: max(28px, calc((100vw - 1240px) / 2));
  bottom: 108px;
  left: max(28px, calc((100vw - 1240px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hero-socials { display: flex; align-items: center; gap: 8px; }

.hero-socials a,
.scroll-cue {
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.32);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #fff;
  font-size: 11px;
  letter-spacing: 0.06em;
  transition: background-color 0.25s var(--ease), transform 0.25s var(--ease);
}

.hero-socials a:hover,
.scroll-cue:hover { transform: translateY(-2px); background: rgba(255, 255, 255, 0.26); }

.scroll-cue { width: 46px; height: 46px; cursor: pointer; }

/* ---------- 导航 ---------- */
.navbar {
  position: fixed;
  z-index: 20;
  top: 0;
  right: 0;
  left: 0;
  height: 72px;
  color: #fff;
  transition: color 0.3s var(--ease), background-color 0.3s var(--ease),
    box-shadow 0.3s var(--ease), backdrop-filter 0.3s var(--ease);
}

.navbar.scrolled {
  color: var(--text);
  background: var(--navbar);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  box-shadow: 0 1px 0 var(--line), 0 10px 40px rgba(20, 16, 12, 0.06);
}

.navbar-inner {
  display: flex;
  width: min(100% - 48px, 1240px);
  height: 100%;
  align-items: center;
  justify-content: space-between;
  margin: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: var(--fw-3);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.brand-mark {
  display: block;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 9px;
  background: transparent;
  box-shadow: 0 4px 12px rgba(10, 20, 17, 0.22);
}

.nav-right { display: flex; align-items: center; gap: 26px; }

.nav-links { display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; list-style: none; }

.nav-links a {
  position: relative;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: var(--fw-2);
  letter-spacing: 0.02em;
  color: var(--muted);
  transition: color 0.25s var(--ease), background-color 0.25s var(--ease);
}

.nav-links a::after { display: none; }

.nav-links a:hover { color: var(--text); background: var(--accent-soft); }

.navbar:not(.scrolled) .nav-links a { color: rgba(255, 255, 255, 0.84); }
.navbar:not(.scrolled) .nav-links a:hover { color: #fff; background: rgba(255, 255, 255, 0.16); }
.navbar:not(.scrolled) .icon-button { color: rgba(255, 255, 255, 0.9); }
.navbar:not(.scrolled) .icon-button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.24);
}

.nav-actions { display: flex; align-items: center; gap: 4px; }

.icon-button {
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: 0.25s var(--ease);
}

.icon-button:hover {
  color: var(--text);
  background: var(--surface);
  border-color: var(--line);
}

.menu-button { display: none; }
.mobile-drawer { display: none; }

/* ---------- 主体 ---------- */
.page-main { position: relative; z-index: 1; background: var(--page); }

.page-wrap {
  display: grid;
  width: min(100% - 40px, 1440px);
  grid-template-columns: 300px minmax(0, 1fr) 110px;
  gap: 32px;
  margin: 0 auto;
  padding: 52px 0 76px;
}

/* 右侧日期导航：置顶文章不参与 */
/* 日期导航外层：sticky 提到这层，凸起装饰层才能盖在滚动容器之外不被裁掉 */
.date-nav-wrap {
  position: sticky; top: 92px; align-self: start;
}

.date-nav {
  max-height: calc(100vh - 120px); overflow-y: auto; overscroll-behavior: contain;
  padding: 4px 14px 12px 0;
  border-right: 1px solid var(--line);
  text-align: right;
}
/* 凸起装饰层接管竖线时（.has-peak），隐藏 CSS 边框：否则直线与鼓起的曲线会并存 */
.date-nav-wrap.has-peak .date-nav { border-right-color: transparent; }

/* 侧栏凸起（归档时间轴 / 首页日期导航共用）：绝对定位装饰层，不参与布局 */
.ooji-peak {
  position: absolute; top: 6px; bottom: 8px; left: -20px; width: 44px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.42s var(--ease);
  will-change: opacity;
}
.ooji-peak.on { opacity: 1; }
/* 朝右的版本：贴在容器右缘，向页面外侧隆起（首页日期导航用） */
.ooji-peak.is-right { left: auto; right: -16px; width: 34px; }
/* 由装饰层接管轴线时：整条常显，只有填充与弯曲在悬停时出现 */
.ooji-peak.is-line { top: 0; bottom: 0; opacity: 1; }
.ooji-peak.is-line .pk-fill { opacity: 0; transition: opacity 0.42s var(--ease); }
.ooji-peak.is-line.on .pk-fill { opacity: 1; }
/* 静止时等效于原来的 1px 分隔线，悬停时变成隆起边缘的描边 */
.ooji-peak.is-line .pk-crest {
  stroke: var(--line); stroke-width: 1; opacity: 1;
  transition: stroke 0.3s var(--ease), stroke-width 0.3s var(--ease), opacity 0.3s var(--ease);
}
.ooji-peak.is-line.on .pk-crest { stroke: var(--sage); stroke-width: 1.5; opacity: 0.72; }
.ooji-peak svg { display: block; width: 100%; height: 100%; overflow: visible; }
.ooji-peak stop { stop-color: var(--sage); }
.ooji-peak .pk-crest {
  fill: none; stroke: var(--sage); stroke-width: 1.5;
  stroke-linecap: round; opacity: 0.72;
}
html[data-theme="dark"] .ooji-peak .pk-fill { opacity: 0.7; }
html[data-theme="dark"] .ooji-peak .pk-crest { opacity: 0.62; }
.date-nav h3 {
  margin: 0 0 10px; color: var(--muted);
  font-size: 10.5px; letter-spacing: 0.22em; text-transform: uppercase;
}
.date-nav a {
  display: block; padding: 4px 0; color: var(--muted);
  font-size: 12px; text-decoration: none; white-space: nowrap;
  transition: color 0.18s var(--ease);
}
.date-nav a:hover, .date-nav a.active { color: var(--accent); }

@media (max-width: 1180px) {
  .page-wrap { grid-template-columns: 300px minmax(0, 1fr); }
  .date-nav-wrap { display: none; }
}

.sidebar { position: sticky; top: 92px; align-self: start; }

.side-block {
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.profile { padding: 26px 20px 20px; text-align: center; }

.avatar {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  margin: 0 auto 14px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(150deg, var(--accent), var(--sage));
  color: #fff;
  font-family: var(--font-serif);
  font-size: 26px;
  position: relative;
}

.avatar::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px dashed var(--line);
  animation: spin 26s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.profile h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: var(--fw-3);
  letter-spacing: 0.04em;
}

.profile p { margin: 6px 0 18px; color: var(--muted); font-size: 12.5px; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  padding-top: 15px;
}

.stat strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: var(--fw-3);
  line-height: 1.3;
  color: var(--accent);
}

.stat span { color: var(--muted); font-size: 10.5px; letter-spacing: 0.12em; }

.side-nav { padding: 8px; }

.side-nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease);
}

.side-nav a:hover,
.side-nav a.active { background: var(--accent-soft); color: var(--accent); }

.side-heading {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: var(--fw-2);
  letter-spacing: 0.22em;
}

.side-tags { padding: 18px 18px 17px; }

.tag-list { display: flex; flex-wrap: wrap; gap: 7px; }

.tag-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  padding: 4px 9px;
  color: var(--muted);
  font-size: 11.5px;
  cursor: pointer;
  transition: 0.25s var(--ease);
}

.tag-button:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.side-note {
  padding: 17px 18px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.9;
}

.side-note strong {
  display: block;
  margin-bottom: 5px;
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 14px;
  letter-spacing: 0.04em;
}

/* ---------- 内容区 ---------- */
.content { min-width: 0; }

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 10.5px;
  font-weight: var(--fw-2);
  letter-spacing: 0.26em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.eyebrow::before {
  content: "";
  width: 20px;
  height: 1px;
  background: var(--accent);
}

.section-heading h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 2.4vw, 2rem);
  font-weight: var(--fw-3);
  line-height: 1.3;
  letter-spacing: 0.04em;
}

.section-count { color: var(--muted); font-size: 11.5px; white-space: nowrap; letter-spacing: 0.06em; }

.search-panel { display: none; margin: -4px 0 18px; }
.search-panel.open { display: block; }

.search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 11px 14px;
}

.search-field .icon { color: var(--muted); }

.search-field input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 14px;
}

.search-field input::placeholder { color: var(--muted); }
/* 只用面板里那颗 ×，别让 WebKit 给 type=search 再画一个（两个 X 容易点错） */
.search-field input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }

.filter-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  padding: 6px 15px;
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
  transition: 0.25s var(--ease);
}

.filter-button:hover { border-color: var(--line); color: var(--text); background: var(--accent-soft); }

.filter-button[aria-pressed="true"] {
  border-color: var(--text);
  background: var(--text);
  color: var(--page);
}

/* 卡片 */
.post-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }

.post-card {
  min-width: 0;
  overflow: hidden;
  /* 卡片边缘彻底无线：border 与 1px 外描边都会在封面图四周显出白边，
     只靠柔和阴影与页面背景区分层次 */
  border: 0;
  border-radius: 26px;
  background: var(--surface);
  box-shadow:
    0 1px 2px rgba(37, 51, 44, 0.04),
    0 14px 36px rgba(37, 51, 44, 0.07);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

.post-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 44px rgba(37, 51, 44, 0.12);
}

.post-card.featured { grid-column: 1 / -1; }

.post-image {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--surface-soft);
}

.post-card.featured .post-image { aspect-ratio: 16 / 8; }

.post-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease);
}

.post-card:hover .post-image img { transform: scale(1.035); }

.post-image-label {
  position: absolute;
  z-index: 1;
  top: 14px;
  left: 14px;
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 4px;
  background: rgba(20, 27, 24, 0.46);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  padding: 4px 8px;
  color: #fff;
  font-size: 10px;
  letter-spacing: 0.02em;
}

.post-body { padding: 22px 24px 22px; }

.post-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  color: var(--muted);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.post-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--line); }

/* 卡片上的点赞数：与评论数同层，图标跟着文字基线对齐 */
.post-like-count { display: inline-flex; align-items: center; gap: 4px; }
.post-like-count .icon { flex: 0 0 auto; opacity: 0.8; }

.post-category { color: var(--accent); font-weight: var(--fw-2); letter-spacing: 0.1em; }

.post-title {
  margin: 12px 0 8px;
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: var(--fw-3);
  line-height: 1.6;
  letter-spacing: 0.02em;
}

.featured .post-title { font-size: 25px; }

.post-title button,
.post-title a {
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.25s var(--ease);
}

.post-title button:hover,
.post-title a:hover { color: var(--accent); }

.post-excerpt {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.9;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.featured .post-excerpt { -webkit-line-clamp: 2; }

.post-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.post-tags { display: flex; flex-wrap: wrap; gap: 6px; }

.post-tags span {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 10.5px;
  line-height: 1.4;
  white-space: nowrap;
}

.read-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  padding: 3px 0;
  color: var(--accent);
  text-decoration: none;
  font-size: 12px;
  font-weight: var(--fw-2);
  white-space: nowrap;
  cursor: pointer;
}

.read-link .icon { transition: transform 0.25s var(--ease); }
.read-link:hover .icon { transform: translateX(4px); }

.no-results {
  display: none;
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 40px 20px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.no-results.visible { display: block; }

/* 归档 / 关于 */
.below-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 24px; margin-top: 56px; }

.plain-section {
  min-width: 0;
  padding: 26px 26px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.plain-section .section-heading { margin-bottom: 20px; }
.plain-section .section-heading h2 { font-size: 19px; }

.timeline { position: relative; margin-left: 4px; padding-left: 22px; }

.timeline::before {
  position: absolute;
  top: 6px;
  bottom: 8px;
  left: 3px;
  width: 1px;
  background: var(--line);
  content: "";
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 10px;
  padding: 0 0 18px;
  color: var(--muted);
  font-size: 12.5px;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-item::before {
  position: absolute;
  top: 8px;
  left: -22px;
  width: 7px;
  height: 7px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
  content: "";
}

.timeline-item time { color: var(--muted); font-family: var(--font-mono); font-size: 11.5px; }
.timeline-item a { color: var(--text); transition: color 0.2s var(--ease); }
.timeline-item a:hover { color: var(--accent); }

.about-copy { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 2; }

.about-signature {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.about-signature .avatar { width: 40px; height: 40px; margin: 0; font-size: 17px; }
.about-signature .avatar::after { inset: -4px; }
.about-signature strong { display: block; font-size: 13px; }
.about-signature span { color: var(--muted); font-size: 11px; }

/* ---------- 页脚 ---------- */
.footer { border-top: 1px solid var(--line); background: var(--surface-soft); }

.footer-inner {
  display: flex;
  width: min(100% - 48px, 1240px);
  min-height: 84px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: auto;
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: 0.04em;
}

.footer-links { display: flex; gap: 18px; }
.footer-links a { transition: color 0.2s var(--ease); }
.footer-links a:hover { color: var(--accent); }

.to-top {
  position: fixed;
  z-index: 9;
  right: 24px;
  bottom: 24px;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}

.to-top.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }

/* ---------- 阅读弹窗 ---------- */
dialog {
  width: min(680px, calc(100% - 28px));
  max-height: min(84vh, 800px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  padding: 0;
  color: var(--text);
  box-shadow: 0 30px 90px rgba(20, 14, 10, 0.35);
}

dialog::backdrop {
  background: rgba(20, 16, 14, 0.46);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

/* 打开时的过渡：面板轻微上浮 + 背景渐暗，避免「啪」地一下出现 */
dialog[open] {
  animation: dialog-pop 0.34s cubic-bezier(0.2, 0.7, 0.3, 1);
}
dialog[open]::backdrop {
  animation: dialog-fade 0.34s ease;
}
@keyframes dialog-pop {
  from { opacity: 0; transform: translateY(16px) scale(0.99); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes dialog-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.dialog-head {
  position: sticky;
  z-index: 1;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  padding: 10px 14px;
}

.dialog-content { padding: 10px 36px 40px; }

.dialog-content h2 {
  margin: 16px 0 10px;
  font-family: var(--font-serif);
  font-size: 27px;
  font-weight: var(--fw-3);
  line-height: 1.5;
  letter-spacing: 0.02em;
}

.dialog-content #dialogBody > .article-meta:first-child { display: none; }

.dialog-content .article-meta {
  margin-bottom: 26px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.06em;
}

.dialog-content h3 {
  margin: 30px 0 10px;
  padding-left: 14px;
  border-left: 3px solid var(--accent);
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: var(--fw-3);
  line-height: 1.6;
  letter-spacing: 0.03em;
}

.dialog-content p { margin: 1em 0; color: var(--text); font-size: 14.5px; line-height: 2; }

.dialog-content blockquote {
  margin: 24px 0;
  border-left: 2px solid var(--accent);
  border-radius: 0 12px 12px 0;
  background: var(--accent-soft);
  padding: 16px 20px;
  color: var(--muted);
  font-family: var(--font-serif);
  font-size: 14.5px;
}

/* ---------- 入场动效 ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
  transition-delay: var(--d, 0ms);
}

[data-reveal].is-visible { opacity: 1; transform: none; }

/* ---------- 响应式 ---------- */
@media (max-width: 920px) {
  .page-wrap { grid-template-columns: 210px minmax(0, 1fr); gap: 24px; }
  .post-grid { gap: 16px; }
  .post-body { padding: 18px; }
  .post-title { font-size: 17.5px; }
  .featured .post-title { font-size: 21px; }
}

@media (max-width: 700px) {
  html { scroll-padding-top: 68px; }
  .navbar { height: 62px; }
  .navbar-inner { width: min(100% - 32px, 1280px); }
  .brand { font-size: 15px; }
  .brand-mark { width: 26px; height: 26px; }
  .nav-right { gap: 6px; }
  .nav-links { display: none; }
  .menu-button { display: inline-flex; }
  .mobile-drawer {
    position: absolute;
    top: 62px;
    right: 0;
    left: 0;
    border-top: 1px solid var(--line);
    background: var(--navbar);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    padding: 8px 16px 14px;
    box-shadow: var(--shadow);
  }
  .mobile-drawer.open { display: grid; }
  .mobile-drawer a { padding: 12px 8px; border-bottom: 1px solid var(--line); font-size: 14px; color: var(--text); }
  .mobile-drawer a:last-child { border-bottom: 0; }
  .hero-content { width: min(100% - 34px, 600px); padding-top: 88px; }
  .hero h1 { font-size: 38px; }
  .hero-subtitle { font-size: 14.5px; }
  .hero-bottom { right: 18px; bottom: 92px; left: 18px; }
  .page-wrap { display: flex; width: min(100% - 30px, 570px); flex-direction: column; gap: 24px; padding: 30px 0 48px; }
  .sidebar { position: static; display: grid; grid-template-columns: 1fr 1fr; align-items: start; gap: 11px; }
  .side-block { margin: 0; }
  .profile { padding: 16px 12px 14px; }
  .avatar { width: 52px; height: 52px; margin-bottom: 8px; font-size: 22px; }
  .profile h2 { font-size: 15px; }
  .profile p { margin: 3px 0 12px; font-size: 11px; }
  .stat strong { font-size: 16px; }
  .stat span { font-size: 9px; }
  .side-nav { display: none; }
  .side-tags, .side-note { display: none; }
  .section-heading h2 { font-size: 22px; }
  .filters { gap: 6px; margin-bottom: 16px; }
  .post-grid { grid-template-columns: 1fr; gap: 14px; }
  .post-card.featured { grid-column: auto; }
  .post-card.featured .post-image,
  .post-card .post-image { aspect-ratio: 16 / 9; }
  .post-body { padding: 16px 17px 17px; }
  .post-title, .featured .post-title { font-size: 18px; }
  .post-excerpt { font-size: 12.5px; }
  .below-grid { grid-template-columns: 1fr; gap: 14px; margin-top: 36px; }
  .plain-section { padding: 20px 18px; }
  .footer-inner { width: min(100% - 30px, 570px); min-height: 76px; flex-wrap: wrap; justify-content: center; padding: 14px 0; text-align: center; }
  .to-top { right: 14px; bottom: 14px; width: 38px; height: 38px; }
  .dialog-content { padding: 6px 22px 28px; }
  .dialog-content h2 { font-size: 22px; }
}

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

/* 「Congratulations」是个长单词，撑不下就只能缩字号（换行会很难看） */
@media (max-width: 520px) {
  .hero h1 { font-size: min(38px, calc((100vw - 58px) / 9.4)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
}

/* ---------- 页面背景：封面照片的模糊版 ---------- */
body { position: relative; }

body::before {
  content: "";
  position: fixed;
  inset: -6%;
  z-index: -1;
  background-image: url("../img/shanhai-hero.jpg");
  background-size: cover;
  background-position: center 46%;
  filter: blur(52px) saturate(1.12) brightness(1.26);
  opacity: 0.2;
  pointer-events: none;
}

:root[data-theme="dark"] body::before {
  filter: blur(52px) saturate(0.75) brightness(0.3);
  opacity: 0.5;
}

.page-main { position: relative; z-index: 1; background: transparent; }

/* ---------- 首屏副标题：打字机 ---------- */
.hero-subtitle {
  min-height: 4em;
  white-space: pre-line;
}

.type-caret {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  margin-left: 3px;
  vertical-align: -0.15em;
  background: rgba(255, 255, 255, 0.85);
  animation: caret-blink 1s steps(1) infinite;
}

.type-caret.is-done { animation: caret-blink 1.1s steps(1) 3 forwards; }

@keyframes caret-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* ---------- 启动遮罩（Redefine 式字母跳动） ---------- */
.boot {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: var(--page);
  transition: opacity 0.2s ease-in-out;
}

.boot.is-done { opacity: 0; pointer-events: none; }

.boot-inner { position: relative; text-align: center; }
.boot-kicker {
  margin: 0 0 20px;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 11.5px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  opacity: 0;
}

.boot-title {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 4.4vw, 3.2rem);
  font-weight: var(--fw-2);
  line-height: 1;
  letter-spacing: -1px;
  color: var(--text);
}

.boot-title .letter {
  display: inline-block;
  line-height: 1em;
  will-change: transform, opacity, filter;
}

body.is-booting { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .boot { display: none; }
  .type-caret { display: none; }
  .hero-subtitle { min-height: 0; }
}

/* ============================================================
   新增：品牌化后的组件（头像 / 双语 / 写文章 / 空状态）
   ============================================================ */

.boot-title { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 0 0.32em; }
.boot-title .word { display: inline-flex; }

.avatar { overflow: hidden; padding: 0; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.small { width: 40px; height: 40px; }
.avatar.small::after { display: none; }

.lang-btn {
  width: auto;
  min-width: 36px;
  padding: 0 8px;
  font-size: 11.5px;
  font-weight: var(--fw-3);
  letter-spacing: 0.08em;
}

.heading-actions { display: flex; align-items: center; gap: 12px; }

.write-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 15px;
  border: 1px solid var(--text);
  border-radius: 999px;
  background: var(--text);
  color: var(--page);
  font-size: 12.5px;
  cursor: pointer;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}
.write-btn:hover { opacity: 0.86; transform: translateY(-1px); }
.write-btn .icon { width: 14px; height: 14px; }

/* 无封面时的渐变封面 */
.cover-glyph {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  background: linear-gradient(145deg, var(--surface-soft), var(--accent-soft));
  color: var(--accent);
  font-family: var(--font-serif);
  font-size: 44px;
  letter-spacing: 0.06em;
}

.card-actions { display: flex; align-items: center; gap: 4px; }
.icon-button.tiny { width: 26px; height: 26px; border-radius: 8px; }
.icon-button.tiny:hover { color: var(--accent); }
.icon-button.tiny[data-pinned="1"] { color: var(--accent); background: var(--accent-soft); }

/* 置顶徽标：实色底 + 反白字，和旁边灰色「文字」徽标拉开层次 */
.pin-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--page);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.5;
  box-shadow: 0 2px 6px rgba(163, 31, 52, 0.22);
}
html[data-theme="dark"] .pin-badge,
:root[data-theme="dark"] .pin-badge {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.30);
}

/* 空状态 */
.empty-state {
  display: none;
  padding: 64px 24px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
}
.empty-mark {
  width: 46px;
  height: 46px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 20px;
}
.empty-state h3 { margin: 0 0 6px; font-family: var(--font-serif); font-size: 18px; }
.empty-state p { margin: 0; color: var(--muted); font-size: 13px; }

/* 最近写入 */
.side-recent { padding: 18px 18px 14px; }
.recent-list { display: flex; flex-direction: column; gap: 2px; }
.recent-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 6px 2px;
  border: 0;
  border-bottom: 1px dashed var(--line);
  background: none;
  color: var(--text);
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
  transition: color 0.2s var(--ease);
}
.recent-item:last-child { border-bottom: 0; }
.recent-item:hover { color: var(--accent); }
.recent-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-item time { flex: none; color: var(--muted); font-size: 10.5px; font-family: var(--font-mono); }
.recent-empty { margin: 0; color: var(--muted); font-size: 12px; }

.archive-year {
  margin: 14px 0 8px;
  color: var(--muted);
  font-family: var(--font-serif);
  font-size: 15px;
  letter-spacing: 0.12em;
}
.archive-year:first-child { margin-top: 0; }

/* 写文章弹窗 */
.editor {
  width: min(680px, calc(100% - 28px));
  max-height: min(88vh, 860px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  padding: 0;
  color: var(--text);
  box-shadow: 0 30px 90px rgba(20, 14, 10, 0.35);
}
.editor[open] { display: flex; flex-direction: column; }
.editor-form { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
.editor-head {
  position: relative;
  flex: 0 0 auto;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.editor-head h2 { margin: 0; font-family: var(--font-serif); font-size: 18px; letter-spacing: 0.04em; }

.editor-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { color: var(--muted); font-size: 11.5px; letter-spacing: 0.1em; }
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--page);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  line-height: 1.7;
  outline: none;
  transition: border-color 0.2s var(--ease);
}
.field input:focus,
.field select:focus,
.field textarea:focus { border-color: var(--accent); }
.field textarea { resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.editor-actions {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.btn-ghost, .btn-solid {
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  transition: opacity 0.2s var(--ease);
}
.btn-ghost { border: 1px solid var(--line); background: transparent; color: var(--muted); }
.btn-solid { border: 1px solid var(--text); background: var(--text); color: var(--page); }
.btn-solid:hover { opacity: 0.88; }

/* 深色模式微调 */
:root[data-theme="dark"] body::before { opacity: 0.34; filter: blur(52px) saturate(0.7) brightness(0.28); }
:root[data-theme="dark"] .cover-glyph { background: linear-gradient(145deg, #2b3430, rgba(210, 112, 127, 0.16)); }
:root[data-theme="dark"] .empty-mark { background: rgba(210, 112, 127, 0.2); color: #f0aab5; }
:root[data-theme="dark"] .field input,
:root[data-theme="dark"] .field select,
:root[data-theme="dark"] .field textarea { background: var(--surface-soft); }

@media (max-width: 700px) {
  .write-btn span { display: none; }
  .write-btn { padding: 8px 10px; }
  .field-row { grid-template-columns: 1fr; }
}

/* ---------- 个人介绍页（about-me.html） ---------- */
.profile-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 18px 0 8px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.profile-hero .avatar { flex: 0 0 auto; margin: 0; }
.profile-hero h2 { margin: 0 0 4px; font-size: 24px; }
.profile-role { margin: 0; color: var(--muted); font-size: 12.5px; letter-spacing: 0.06em; }
.profile-section { margin-top: 30px; }
.profile-section h3 { margin-top: 0; }
.profile-section p { margin: 0 0 14px; line-height: 1.9; }
.profile-list { margin: 0; padding-left: 18px; }
.profile-list li { margin-bottom: 9px; line-height: 1.8; }
.pdoc { text-align: left; }
.pdoc blockquote {
  margin: 20px 0 0;
  padding: 12px 16px;
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  background: var(--accent-soft);
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 15px;
  letter-spacing: 0.02em;
}
.pdoc a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--accent-soft); }
.pdoc a:hover { border-bottom-color: var(--accent); }

/* ---------- 登录 / 上传 / 提示（接入服务端后新增） ---------- */
[hidden] { display: none !important; }

.login-dialog { width: min(400px, calc(100% - 28px)); }
.login-error { margin: 0; min-height: 16px; color: var(--accent); font-size: 12.5px; }

.cover-row { display: flex; gap: 8px; align-items: stretch; }
.cover-row input { flex: 1 1 auto; min-width: 0; }
.upload-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.upload-btn:hover { color: var(--accent); border-color: var(--accent); }
.upload-hint { margin: 2px 0 0; color: var(--muted); font-size: 11.5px; }
.upload-progress {
  position: relative; height: 6px; margin-top: 8px;
  border-radius: 999px; background: var(--surface-soft); overflow: hidden;
}
.upload-progress[hidden] { display: none; }
.upload-progress i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--accent), #d4556c);
  transition: width 0.18s ease;
}
.cover-preview { margin-top: 8px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; }
.cover-preview img { display: block; width: 100%; max-height: 150px; object-fit: cover; }

.check { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; cursor: pointer; }
.check input { width: 15px; height: 15px; accent-color: var(--accent); }

.draft-badge {
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10.5px;
  letter-spacing: 0.08em;
}

.toast {
  position: fixed;
  z-index: 90;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 14px);
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  box-shadow: var(--shadow-lift);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s var(--ease), transform 0.24s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  .toast { transition: none; }
}

/* ---------- 关于我 / 个人介绍 ---------- */

/* ---------- 顶部「关于」下拉 ---------- */
.nav-about { position: relative; }
.nav-about-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13.5px;
  font-weight: var(--fw-2);
  line-height: inherit;      /* button 默认 normal，不继承会让文字比 <a> 高一截 */
  letter-spacing: 0.02em;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  transition: color 0.25s var(--ease), background-color 0.25s var(--ease);
}
.nav-about-btn:hover,
.nav-about.open .nav-about-btn { color: var(--text); background: var(--accent-soft); }
.nav-about-btn .icon { transition: transform 0.22s var(--ease); }
.nav-about.open .nav-about-btn .icon { transform: rotate(180deg); }

.nav-dropdown {
  position: absolute;
  z-index: 40;
  top: calc(100% + 10px);
  left: 50%;
  display: flex;
  flex-direction: column;
  min-width: 152px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-lift);
  opacity: 0;
  transform: translate(-50%, -6px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}
.nav-about.open .nav-dropdown {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
  pointer-events: auto;
}
.nav-dropdown a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border-radius: 9px;
  color: var(--text);
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.16s var(--ease), color 0.16s var(--ease);
}
.nav-dropdown a:hover { background: var(--accent-soft); color: var(--accent); }
.nav-dropdown a .icon { flex: 0 0 auto; color: var(--muted); }
.nav-dropdown a:hover .icon { color: var(--accent); }

/* 下拉挂在 .nav-links 里，会吃到「首屏导航白字」那条规则，
   不显式盖回来就是白底白字 */
.navbar:not(.scrolled) .nav-links .nav-dropdown a { color: var(--text); }
.navbar:not(.scrolled) .nav-links .nav-dropdown a:hover { color: var(--accent); background: var(--accent-soft); }
.navbar:not(.scrolled) .nav-links .nav-dropdown a .icon { color: var(--muted); }
.navbar:not(.scrolled) .nav-links .nav-dropdown a:hover .icon { color: var(--accent); }

/* 去掉区块标题后的紧凑头部 */
.section-heading.is-compact { align-items: center; justify-content: flex-end; margin-bottom: 18px; }

/* ---------- 归档排序与标签筛选 ---------- */
.sort-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: 0.22s var(--ease);
}
.sort-toggle:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.sort-toggle .sort-arrow { transition: transform 0.22s var(--ease); }

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}
.tag-row:empty { display: none; }

@media (prefers-reduced-motion: reduce) {
  .nav-dropdown, .nav-about-btn .icon, .sort-toggle .sort-arrow { transition: none; }
}

/* 小屏：顶部导航下拉改为贴右展开，避免溢出视口 */
@media (max-width: 700px) {
  .nav-dropdown { left: auto; right: 0; transform: translate(0, -6px) scale(0.98); }
  .nav-about.open .nav-dropdown { transform: translate(0, 0) scale(1); }
}

/* ---------- 首屏（白字态）下「关于」按钮跟随导航 ---------- */
.navbar:not(.scrolled) .nav-about-btn { color: rgba(255, 255, 255, 0.84); }
.navbar:not(.scrolled) .nav-about-btn:hover,
.navbar:not(.scrolled) .nav-about.open .nav-about-btn {
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
}

/* ---------- 英文保持原来的衬线风格，中文用 iOS 无衬线 ---------- */
/* ---------- 页面切换转场 ---------- */
@keyframes page-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
body { animation: page-fade-in 0.34s ease both; }
body.is-leaving { opacity: 0; transition: opacity 0.18s ease; pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  body { animation: none; }
  body.is-leaving { transition: none; }
}

/* ---------- 首页卡片：留白与层级微调 ---------- */
.post-grid { gap: 28px; }
.post-body { padding: 24px 26px; }
.post-title { line-height: 1.5; }
.post-excerpt { line-height: 1.8; }
.post-card:hover { transform: translateY(-3px); }

/* 导航项与「关于」按钮统一盒模型：
   <a> 是 inline、<button> 默认 inline-flex，行高/内容盒算法不同，会差 6px */
.nav-links > li > a,
.nav-about-btn {
  display: inline-flex;
  align-items: center;
  line-height: 1.4;
}

/* ---------- 无封面卡片：文字直接开场 ---------- */
.post-grid { align-items: stretch; }
.post-card { display: flex; flex-direction: column; }
.post-card .post-image { flex: 0 0 auto; }
.post-card .post-body { flex: 1 1 auto; }

.post-card.no-cover .post-body { padding: 30px 28px 26px; }
.post-card.no-cover .post-title { margin-top: 0; font-size: 21px; }
.post-card.no-cover .post-excerpt { -webkit-line-clamp: 3; }
.post-card.no-cover:hover { border-color: var(--accent); }

/* ---------- 首页 AskMate 区块 ---------- */
.askmate-block {
  margin-top: 56px;
  padding: 34px 34px 30px;
  /* 去掉那道生硬的 1px 白边：内描边 + 柔和外阴影，圆角与卡片统一 */
  border: 0;
  border-radius: 26px;
  background: linear-gradient(160deg, var(--surface), var(--accent-soft));
  background-clip: padding-box;
  box-shadow:
    inset 0 0 0 1px rgba(38, 48, 45, 0.055),
    0 14px 38px rgba(37, 51, 44, 0.07);
}
html[data-theme="dark"] .askmate-block,
:root[data-theme="dark"] .askmate-block {
  box-shadow:
    inset 0 0 0 1px rgba(230, 233, 229, 0.10),
    0 14px 38px rgba(0, 0, 0, 0.32);
}
.askmate-head { margin-bottom: 14px; }
.askmate-head h2 { margin: 8px 0 0; font-size: 24px; line-height: 1.45; }
.askmate-lead {
  margin: 0 0 24px;
  max-width: 62ch;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.9;
}
.askmate-points {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 26px;
  margin: 0 0 26px;
  padding: 0;
}
.askmate-points li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-left: 14px;
  border-left: 2px solid var(--accent);
}
.askmate-points strong { font-size: 13.5px; font-weight: var(--fw-3); letter-spacing: 0.01em; }
.askmate-points span { color: var(--muted); font-size: 12.5px; line-height: 1.75; }

.askmate-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.askmate-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: opacity 0.2s var(--ease), background 0.2s var(--ease), color 0.2s var(--ease);
}
.askmate-btn:hover { color: #fff; opacity: 0.88; }
.askmate-btn .icon { transition: transform 0.2s var(--ease); }
.askmate-btn:hover .icon { transform: translateX(3px); }
.askmate-btn.ghost { background: transparent; color: var(--accent); }
.askmate-btn.ghost:hover { background: var(--accent-soft); color: var(--accent); opacity: 1; }
.askmate-note {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: 0.04em;
}

@media (max-width: 760px) {
  .askmate-block { margin-top: 40px; padding: 26px 22px 24px; }
  .askmate-points { grid-template-columns: 1fr; gap: 12px; }
  .askmate-head h2 { font-size: 20px; }
}

/* ---------- 文章区：用首屏那张图做模糊背景 ---------- */
.page-main { isolation: isolate; }
.page-main::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: url("/assets/img/shanhai-hero.jpg");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center 20%;
  filter: blur(52px) saturate(1.25);
  opacity: 0.44;
  pointer-events: none;
}
[data-theme="dark"] .page-main::before { opacity: 0.22; }

@media (max-width: 760px) {
  .page-main::before { filter: blur(40px) saturate(1.1); opacity: 0.26; }
}


/* ---------- 次级按钮：中性描边，避免红框红字看着像异常状态 ---------- */
.askmate-btn.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}
.askmate-btn.ghost:hover {
  background: var(--surface);
  border-color: var(--muted);
  color: var(--text);
  opacity: 1;
}

/* ---------- 编辑器：正文多图片 / 视频 ---------- */
.media-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.media-bar small { color: var(--muted); font-size: 11.5px; letter-spacing: 0.02em; }
.media-preview { display: flex; flex-wrap: wrap; gap: 8px; }
.media-preview:empty { display: none; }
.media-thumb {
  width: 72px; height: 72px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}
.media-thumb img,
.media-thumb video { display: block; width: 100%; height: 100%; object-fit: cover; }

/* ---------- 无封面卡片：内容垂直分布，避免文字挤顶部留大片空白 ---------- */
.post-card.no-cover {
  background: linear-gradient(160deg, var(--surface), var(--accent-soft));
}
.post-card.no-cover .post-body {
  display: flex;
  flex-direction: column;
}
/* 把底部操作区推到底，留白落在摘要与操作区之间 */
.post-card.no-cover .post-footer { margin-top: auto; padding-top: 22px; }
/* 卡片 hover 与次级按钮统一走中性色，不再整圈变红 */
.post-card:hover,
.post-card.no-cover:hover { border-color: var(--muted); }

/* ---------- 卡片统一白底 + 无封面卡片用大标题/标签补白 ---------- */
.post-card.no-cover { background: var(--surface); }
.post-card.no-cover .post-title {
  margin-top: 16px;
  font-size: 27px;
  line-height: 1.4;
  letter-spacing: 0.01em;
}
/* 卡片标签只保留底部 .post-tags 这一组圆形胶囊，不再生成重复标签块 */
@media (max-width: 760px) {
  .post-card.no-cover .post-title { font-size: 23px; }
}

/* ---------- 首页左侧留言板 ---------- */
.guestbook-card { padding: 15px 15px 14px; }
/* 移动端专用「去留言板」入口：桌面隐藏，窄屏由下方 media 打开 */
.gb-entry { display: none; }
.gb-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.gb-head h3 { margin: 0; font-size: 13px; font-weight: var(--fw-3); letter-spacing: 0.06em; }
.gb-count { color: var(--muted); font-size: 11px; }
.gb-list {
  display: flex; flex-direction: column; gap: 11px; margin-top: 11px;
  max-height: 330px; overflow-y: auto; overscroll-behavior: contain;
  padding-right: 5px;
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.gb-list::-webkit-scrollbar { width: 6px; }
.gb-list::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; }
.gb-list::-webkit-scrollbar-track { background: transparent; }
.gb-item { cursor: pointer; border-radius: 9px; padding: 4px 5px; transition: background-color .18s var(--ease); }
.gb-item:hover { background: var(--accent-soft); }
.gb-thumb {
  display: block; width: 100%; max-height: 92px; margin-top: 6px;
  object-fit: cover; border-radius: 8px; border: 1px solid var(--line);
}
.gb-img-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.gb-img-pick {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px;
  border: 1px solid var(--line); border-radius: 999px;
  font-size: 12px; color: var(--muted); cursor: pointer;
}
.gb-img-pick:hover { border-color: var(--accent); color: var(--accent); }
.gb-preview { position: relative; display: inline-flex; }
.gb-preview[hidden] { display: none; }
.gb-preview img { width: 46px; height: 46px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.gb-preview button {
  position: absolute; top: -6px; right: -6px; width: 18px; height: 18px;
  border: 0; border-radius: 50%; background: var(--accent); color: #fff;
  font-size: 12px; line-height: 1; cursor: pointer;
}
.gb-view-body { display: flex; flex-direction: column; gap: 10px; overflow-y: auto; max-height: 56vh; }
.gb-view-body .gb-ava { width: 30px; height: 30px; }
.gb-view-body p { margin: 0; font-size: 14px; line-height: 1.85; white-space: pre-wrap; word-break: break-word; }
.gb-view-img { display: block; max-width: 100%; max-height: 46vh; object-fit: contain; border-radius: 10px; border: 1px solid var(--line); }
.gb-reply {
  border: 0; background: transparent; color: var(--muted);
  font: inherit; font-size: 11.5px; cursor: pointer; padding: 2px 4px;
}
.gb-reply:hover { color: var(--accent); }
.gb-reply-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 10px; margin-bottom: 8px;
  background: var(--accent-soft); border-radius: 8px;
  font-size: 12px; color: var(--muted);
}
.gb-reply-bar b { color: var(--accent); }
.gb-reply-cancel {
  margin-left: auto; border: 0; background: transparent;
  color: var(--muted); font-size: 16px; line-height: 1; cursor: pointer;
}
.gb-empty { margin: 8px 0 2px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.gb-item { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
.gb-ava {
  width: 26px; height: 26px; flex: 0 0 auto; border-radius: 50%;
  display: grid; place-items: center; overflow: hidden;
  background: var(--accent-soft); color: var(--accent);
  font-size: 11px; font-weight: var(--fw-3); object-fit: cover;
}
.gb-body { min-width: 0; flex: 1 1 auto; }
.gb-meta { display: flex; align-items: baseline; gap: 6px; font-size: 11.5px; min-width: 0; }
.gb-meta b { font-weight: var(--fw-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gb-meta time { color: var(--muted); font-size: 10.5px; white-space: nowrap; }
.gb-body p {
  margin: 2px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65;
  word-break: break-word; overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.gb-write {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; margin-top: 13px; padding: 8px;
  border: 1px dashed var(--line); border-radius: 10px; background: transparent;
  color: var(--muted); font: inherit; font-size: 12px; cursor: pointer;
  transition: 0.2s var(--ease);
}
.gb-write:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.gb-dialog {
  width: min(540px, calc(100% - 28px)); max-height: 84vh;
  padding: 0; border: 0; border-radius: 20px; background: transparent; overflow: visible;
}
.gb-dialog::backdrop { background: rgba(12, 18, 16, 0.52); backdrop-filter: blur(3px); }
.gb-box {
  display: flex; flex-direction: column; max-height: 84vh;
  padding: 22px 22px 18px; border: 1px solid var(--line); border-radius: 20px;
  background: var(--surface); box-shadow: var(--shadow-lift);
}
.gb-dialog-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.gb-dialog-head h3 { margin: 0; font-size: 18px; font-weight: var(--fw-3); }
.gb-dialog-list {
  flex: 1 1 auto; max-height: 46vh; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 14px; padding-right: 4px;
}
/* 弹窗打开时锁住背景滚动，避免滚轮带着整页一起动 */
body:has(dialog[open]) { overflow: hidden; }
.gb-dialog-list .gb-ava { width: 30px; height: 30px; }
.gb-dialog-list .gb-body p { -webkit-line-clamp: unset; color: var(--text); font-size: 13px; }
.gb-del {
  margin-left: auto; padding: 0; border: 0; background: transparent;
  color: var(--accent); font: inherit; font-size: 11.5px; cursor: pointer;
}
.gb-form { flex: 0 0 auto; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.gb-guest-row { margin-bottom: 8px; }
.gb-input, .gb-textarea {
  width: 100%; box-sizing: border-box; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft);
  color: var(--text); font: inherit; font-size: 13px; outline: none;
}
.gb-textarea { resize: vertical; min-height: 64px; line-height: 1.7; }
.gb-input:focus, .gb-textarea:focus { border-color: var(--accent); }
.gb-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.gb-hint { color: var(--muted); font-size: 11.5px; line-height: 1.6; }
.gb-send {
  padding: 8px 20px; border: 0; border-radius: 999px;
  background: var(--accent); color: #fff; font: inherit; font-size: 13px; cursor: pointer;
}
.gb-send:disabled { opacity: 0.5; cursor: not-allowed; }

@media (max-width: 920px) {
  /* flex column 下 align-self:start 会让侧栏宽度塌缩成内容宽度，必须显式撑满 */
  .sidebar { align-self: stretch; width: 100%; }
  /* 移动端留言板已拆到独立页 /guestbook（导航「菜单」里有入口），首页侧栏不再重复一份 */
  .guestbook-card { display: none; }
  /* 侧栏空出来的位置补一张轻量跳转卡片，直接进留言板 */
  .gb-entry {
    display: flex; grid-column: 1 / -1;
    align-items: center; gap: 12px;
    padding: 13px 14px; text-decoration: none; color: var(--text);
    transition: border-color .2s var(--ease);
  }
  .gb-entry:hover, .gb-entry:focus-visible { border-color: var(--accent); }
  .gb-entry-mark {
    flex: 0 0 auto; width: 36px; height: 36px; border-radius: 12px;
    display: grid; place-items: center;
    background: var(--accent-soft); color: var(--accent);
  }
  .gb-entry-mark .icon { width: 18px; height: 18px; }
  .gb-entry-copy { min-width: 0; flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; }
  .gb-entry-copy b { font-size: 13px; font-weight: var(--fw-3); }
  .gb-entry-copy small {
    color: var(--muted); font-size: 11.5px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .gb-entry-arrow { flex: 0 0 auto; color: var(--muted); }
  /* 移动端列表改成跟手的惯性滚动；允许滚动链，避免手指在留言板上划不动整页 */
  .gb-list {
    max-height: 46vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: auto;
    touch-action: pan-y;
  }
}

@media (max-width: 700px) {
  .flip-digit { width: 22px; height: 30px; font-size: 17px; border-radius: 7px; }
  .flip-num { gap: 4px; }
}

/* ---------- 站内消息悬浮球 ---------- */
.msg-ball {
  position: fixed; right: 24px; bottom: 24px; z-index: 120;
  width: 54px; height: 54px; border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(145deg, var(--accent), #7d1626);
  color: #fff; cursor: grab; touch-action: none;
  box-shadow: 0 10px 26px rgba(163, 31, 52, 0.35), 0 2px 6px rgba(0, 0, 0, 0.15);
  animation: msgFloat 4.5s ease-in-out infinite;
  transition: box-shadow 0.2s var(--ease);
}
.msg-ball:active { cursor: grabbing; }
.msg-ball svg { width: 24px; height: 24px; }
.msg-ball:hover { box-shadow: 0 14px 32px rgba(163, 31, 52, 0.45), 0 2px 8px rgba(0, 0, 0, 0.2); }
.msg-ball.jelly { animation: msgJelly 0.66s cubic-bezier(0.2, 0.7, 0.3, 1); }
@keyframes msgFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-6px) scale(1.02); }
}
@keyframes msgJelly {
  0% { transform: scale(1, 1); }
  22% { transform: scale(1.2, 0.8); }
  42% { transform: scale(0.86, 1.14); }
  62% { transform: scale(1.1, 0.92); }
  80% { transform: scale(0.96, 1.04); }
  100% { transform: scale(1, 1); }
}
.msg-dot {
  position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px;
  padding: 0 5px; border-radius: 999px; background: #fff; color: var(--accent);
  font-size: 10.5px; font-weight: var(--fw-4); line-height: 18px; text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}
.msg-panel {
  position: fixed; right: 24px; bottom: 92px; z-index: 121;
  width: min(330px, calc(100vw - 32px)); max-height: 60vh;
  display: none; flex-direction: column;
  border: 1px solid var(--line); border-radius: 18px;
  background: var(--surface); box-shadow: var(--shadow-lift);
  overflow: hidden;
}
.msg-panel.open { display: flex; }
.msg-head {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
}
.msg-head h3 { margin: 0; font-size: 15px; font-weight: var(--fw-3); }
.msg-read {
  margin-left: auto; border: 0; background: transparent; color: var(--accent);
  font: inherit; font-size: 11.5px; cursor: pointer;
}
.msg-close {
  border: 0; background: transparent; color: var(--muted);
  font-size: 20px; line-height: 1; cursor: pointer;
}
.msg-list { overflow-y: auto; overscroll-behavior: contain; padding: 6px; }
.msg-empty { margin: 18px 12px; color: var(--muted); font-size: 12.5px; line-height: 1.8; text-align: center; }
.msg-empty a { color: var(--accent); }
.msg-item {
  display: block; padding: 10px 11px; border-radius: 10px;
  text-decoration: none; color: var(--text);
}
.msg-item:hover { background: var(--surface-soft); }
.msg-item.unread { background: var(--accent-soft); }
.msg-item-head { display: flex; align-items: baseline; gap: 8px; }
.msg-item-head b { font-size: 12.5px; font-weight: var(--fw-3); flex: 1 1 auto; }
.msg-item-head time { color: var(--muted); font-size: 10.5px; white-space: nowrap; }
.msg-item p { margin: 3px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.msg-item.kind-reply .msg-item-head b::before { content: "↩ "; color: var(--blue); }
.msg-item.kind-mention .msg-item-head b::before { content: "@ "; color: var(--accent); }
.msg-item.kind-post .msg-item-head b::before { content: "✎ "; color: var(--sage); }
@media (max-width: 700px) {
  .msg-ball { right: 16px; bottom: 18px; width: 50px; height: 50px; }
  .msg-panel { right: 12px; bottom: 80px; max-height: 56vh; }
}

/* ---------- 首页访客翻牌器（单独一行） ---------- */
.hero-visitors {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin: 16px 0 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 14px; letter-spacing: 0.04em;
  opacity: 0; transform: translateY(6px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.hero-visitors.show { opacity: 1; transform: translateY(0); }
.flip-face { display: block; transform-origin: 50% 0%; }
.flip-face.flip { animation: flipFace 0.34s cubic-bezier(0.22, 0.68, 0.24, 1.02); }
@keyframes flipFace {
  0%   { transform: rotateX(-88deg); opacity: 0.2; filter: brightness(1.55); }
  55%  { transform: rotateX(10deg);  opacity: 1;   filter: brightness(1.12); }
  100% { transform: rotateX(0deg);   opacity: 1;   filter: brightness(1); }
}
@media (max-width: 700px) {
  .hero-visitors { font-size: 13px; margin-top: 12px; }
}

.flip-num { display: inline-flex; gap: 5px; vertical-align: middle; margin: 0 3px; }
.flip-digit {
  position: relative; display: inline-grid; place-items: center;
  width: 27px; height: 36px; border-radius: 8px;
  /* 上下半区微明暗 + 内高光，做出机械翻牌的立体玻璃质感 */
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(180deg,
    rgba(22, 30, 27, 0.58) 0%,
    rgba(16, 24, 21, 0.52) 49%,
    rgba(9, 15, 13, 0.66) 51%,
    rgba(8, 13, 11, 0.74) 100%);
  color: #fff; font-size: 21px; font-weight: 600; line-height: 1;
  font-variant-numeric: tabular-nums lining-nums;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.45);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -1px 0 rgba(0, 0, 0, 0.30),
    0 4px 12px rgba(0, 0, 0, 0.20);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  perspective: 220px;
  animation: flipIn 0.55s cubic-bezier(0.2, 0.7, 0.3, 1) both;
  transform-origin: 50% 100%;
}
.flip-digit::after {
  /* 铰链缝：细暗线 + 下沿一丝高光，替代原来横切数字的白色线 */
  content: ""; position: absolute; left: 1px; right: 1px; top: 50%;
  height: 1px; pointer-events: none;
  background: linear-gradient(90deg,
    rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.42) 18%,
    rgba(0, 0, 0, 0.52) 50%, rgba(0, 0, 0, 0.42) 82%,
    rgba(0, 0, 0, 0) 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.07);
}
@keyframes flipIn {
  0%   { transform: rotateX(-88deg); opacity: 0.12; filter: brightness(1.5); }
  60%  { transform: rotateX(8deg);   opacity: 1;    filter: brightness(1.1); }
  100% { transform: rotateX(0deg);   opacity: 1;    filter: brightness(1); }
}
@media (prefers-reduced-motion: reduce) {
  .flip-digit { animation: none; }
  .flip-face.flip { animation: none; }
}

/* ---------- 文章三态标识：文字 / 图文 / 视频 ---------- */
.kind-badge {
  display: inline-flex; align-items: center;
  padding: 1px 7px; border-radius: 999px;
  font-size: 10.5px; font-weight: var(--fw-3); letter-spacing: 0.02em;
  white-space: nowrap;
}
.kind-text { background: rgba(116, 128, 121, 0.12); color: var(--muted); }
.kind-image { background: rgba(76, 113, 131, 0.12); color: var(--blue); }
.kind-video { background: var(--accent-soft); color: var(--accent); }

/* ---------- 站内图片灯箱：点击图片原地放大，不跳新标签 ---------- */
.img-lightbox {
  position: fixed; inset: 0; z-index: 300;
  display: none; align-items: center; justify-content: center;
  box-sizing: border-box; width: 100%; height: 100%;
  padding: 24px; margin: 0; border: 0; max-width: none; max-height: none;
  background: rgba(10, 14, 12, 0.88); backdrop-filter: blur(6px);
}
.img-lightbox.open, .img-lightbox[open] { display: flex; }
/* dialog 版灯箱自带半透明底，::backdrop 透明，避免叠加成纯黑 */
.img-lightbox::backdrop { background: transparent; }
.img-lightbox img {
  max-width: min(100%, 1100px); max-height: 86vh; object-fit: contain;
  border-radius: 12px; box-shadow: 0 24px 90px rgba(0, 0, 0, 0.55);
}
.img-lightbox-close {
  position: absolute; top: 16px; right: 18px; width: 38px; height: 38px;
  border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.14); color: #fff;
  font-size: 22px; line-height: 1; cursor: pointer;
}
.img-lightbox-close:hover { background: rgba(255, 255, 255, 0.26); }
.img-lightbox-hint {
  position: absolute; bottom: 18px; left: 0; right: 0; text-align: center;
  margin: 0; color: rgba(255, 255, 255, 0.55); font-size: 12px;
}
body.lightbox-open { overflow: hidden; }
img[data-zoom] { cursor: zoom-in; }

/* ---------- 挂钩称号：18 秒内完成游戏成绩的用户，留言 / 评论 / 个人中心同步显示 ---------- */
.cheat-slot { display: inline-flex; align-items: center; vertical-align: middle; }
.cheat-slot:empty { display: none; }
.cheat-tag {
  display: inline-flex; align-items: center;
  margin-left: 5px; padding: 1px 6px 2px;
  border-radius: 4px; background: linear-gradient(180deg, #ff3b3b 0%, #c00000 100%);
  color: #fff; white-space: nowrap;
  font: 900 italic 10.5px/1.5 "Arial Black", "Impact", "Microsoft YaHei", sans-serif;
  letter-spacing: .08em; text-shadow: 0 1px 0 rgba(0, 0, 0, .45);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .32) inset, 0 2px 9px rgba(200, 0, 0, .55);
  animation: cheatBeat 1.4s ease-in-out infinite;
}
@keyframes cheatBeat {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 1px rgba(255,255,255,.32) inset, 0 2px 9px rgba(200,0,0,.5); }
  50% { transform: scale(1.06); box-shadow: 0 0 0 1px rgba(255,255,255,.6) inset, 0 2px 16px rgba(255,40,40,.95); }
}
@media (prefers-reduced-motion: reduce) { .cheat-tag { animation: none; } }
.me-cheat-slot { margin-bottom: 6px; }

@media (max-width: 700px) {
  .gb-dialog-list { max-height: 40vh; }
  .gb-box { padding: 18px 16px 14px; }
}

/* ============================================================
   2026-11-06 视觉微调
   微对比色阶 / 双环聚焦 / 数字等宽 / 水墨晕染打字 / 消息球 Q 弹
   ============================================================ */

/* 1. 微对比色阶落地：次级文字与分隔线接入四档阶梯 */
.field > span, .gb-hint, .msg-empty, .msg-item p, .msg-item-head time {
  color: var(--ink-3);
}
.msg-head { border-bottom-color: var(--line-soft); }
.gb-form { border-top-color: var(--line-soft); }

/* 2. 数字等宽锁死：所有元素（含伪元素计数）统一表格数字 + 等高大写数字 */
body, body *, body *::before, body *::after {
  font-variant-numeric: tabular-nums lining-nums !important;
}
/* 不用 font-feature-settings 全局覆盖：会关掉字体默认 kern / liga，字形易发虚 */

/* 3. 其它输入框沿用 10:39 版的双环；评论/留言输入框在下方单独定制 */
.field input, .field select, .field textarea,
.gb-input, .gb-textarea, .search-field input, #loginPassword {
  transition: border-color 0.2s var(--ease), box-shadow 0.28s var(--ease);
}
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not(.gb-input):focus,
textarea:not(.gb-textarea):focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow:
    0 0 0 1px var(--accent),
    0 0 0 5px var(--focus-ring),
    0 6px 18px rgba(163, 31, 52, 0.10);
}
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not(.gb-input):focus-visible,
textarea:not(.gb-textarea):focus-visible, select:focus-visible { outline: none; }

/* 4. 评论 / 留言输入框：亮光双环 + 去掉红色高亮
   作用域仅 .gb-input / .gb-textarea（首页留言板）与 .comment-compose textarea（文章评论框），
   不作用于窗口容器、按钮、链接，也不影响关于我等其它页面 */
/* 输入框聚焦：亮光环 + 分层柔影 + 内高光，浅色/深色各一套 */
:root {
  --cmt-inner: rgba(255, 255, 255, 0.95);
  --cmt-outer: rgba(255, 255, 255, 0.62);
  --cmt-glow:  rgba(255, 255, 255, 0.52);
  --cmt-shade: rgba(20, 30, 25, 0.16);
  --cmt-shade-soft: rgba(20, 30, 25, 0.10);
  --cmt-inset: rgba(255, 255, 255, 0.85);
}
html[data-theme="dark"], :root[data-theme="dark"] {
  --cmt-inner: rgba(240, 246, 242, 0.62);
  --cmt-outer: rgba(240, 246, 242, 0.24);
  --cmt-glow:  rgba(240, 246, 242, 0.20);
  --cmt-shade: rgba(0, 0, 0, 0.45);
  --cmt-shade-soft: rgba(0, 0, 0, 0.30);
  --cmt-inset: rgba(240, 246, 242, 0.08);
}
.gb-input:focus, .gb-textarea:focus,
.gb-input:focus-visible, .gb-textarea:focus-visible,
.comment-compose textarea:focus, .comment-compose textarea:focus-visible {
  outline: none;
  border-color: var(--line-strong);
  box-shadow:
    0 0 0 1px var(--cmt-inner),
    0 0 0 5px var(--cmt-outer),
    0 0 18px 3px var(--cmt-glow),
    0 10px 26px var(--cmt-shade),
    0 2px 6px var(--cmt-shade-soft),
    inset 0 1px 2px var(--cmt-inset);
}

/* 4. 水墨晕染式打字：墨点由模糊浓晕收束成清晰字形 */
.type-target .ink-char {
  display: inline-block;
  white-space: pre;
  animation: ink-bloom 0.66s cubic-bezier(0.16, 0.8, 0.3, 1) both;
}
@keyframes ink-bloom {
  0% {
    opacity: 0; filter: blur(8px);
    transform: translateY(4px) scale(1.16);
    text-shadow: 0 0 18px currentColor, 0 0 6px currentColor;
  }
  42% {
    opacity: 0.7; filter: blur(3px);
    transform: translateY(1px) scale(1.06);
    text-shadow: 0 0 10px currentColor;
  }
  100% {
    opacity: 1; filter: blur(0);
    transform: none;
    text-shadow: 0 0 0 transparent;
  }
}
.boot-title .letter { will-change: transform, opacity, filter, text-shadow; }
@media (prefers-reduced-motion: reduce) {
  .type-target .ink-char { animation: none; filter: none; }
}

/* 5. 消息球拖动 Q 弹：跟手软胶拉伸 + 松手过冲回弹 */
.msg-ball.is-dragging {
  animation: none;
  transform: scale(var(--drag-sx, 1), var(--drag-sy, 1)) rotate(var(--tilt, 0deg));
  transition: transform 0.12s cubic-bezier(0.2, 0.9, 0.25, 1.25);
  box-shadow: 0 16px 38px rgba(163, 31, 52, 0.42), 0 0 0 5px rgba(163, 31, 52, 0.10);
  z-index: 130;
}
.msg-ball.rebound { animation: msgRebound 0.68s cubic-bezier(0.2, 0.7, 0.3, 1) both; }
@keyframes msgRebound {
  0%   { transform: scale(1.22, 0.78); }
  32%  { transform: scale(0.86, 1.16); }
  56%  { transform: scale(1.10, 0.92); }
  78%  { transform: scale(0.96, 1.04); }
  100% { transform: scale(1, 1); }
}
@media (prefers-reduced-motion: reduce) {
  .msg-ball.is-dragging { transform: none; transition: none; }
  .msg-ball.rebound { animation: none; }
}
