@charset "UTF-8";
/* ==========================================================================
   Snowfall — 飘雪博客主题设计系统
   Design tokens / Base / Layout / Components / Pages / Utilities
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */
:root {
  /* 纸面层 */
  --paper: #FAFBFD;
  --paper-tint: #EAF2FA;
  --surface: #FFFFFF;
  --surface-2: #F5F8FC;
  --surface-3: #EEF3F9;

  /* 墨色层 */
  --ink: #0F151C;
  --ink-2: #39434F;
  --ink-3: #737E8B;
  --ink-4: #A3ADB8;

  /* 线 */
  --line: #E4EAF1;
  --line-2: #EFF3F8;

  /* 冰蓝主色 */
  --accent: #2E6BA8;
  --accent-strong: #1E4E7B;
  --accent-2: #6FA8DC;
  --accent-soft: #EAF2FA;
  --accent-mist: rgba(110, 168, 220, 0.14);

  /* 落雪（纯背景装饰）。深色底上必须换近白，否则冰蓝会糊进背景里 */
  --snow-ink: #6FA8DC;
  --snow-halo: rgba(111, 168, 220, 0.5);

  /* 语义色 */
  --ok: #2F855A;
  --warn: #B7791F;
  --danger: #C53030;

  /* 阴影 */
  --shadow-xs: 0 1px 2px rgba(16, 34, 54, 0.04);
  --shadow-sm: 0 1px 2px rgba(16, 34, 54, 0.05), 0 2px 8px -4px rgba(16, 34, 54, 0.08);
  --shadow-md: 0 4px 14px -6px rgba(16, 34, 54, 0.12), 0 2px 6px -2px rgba(16, 34, 54, 0.06);
  --shadow-lg: 0 20px 48px -22px rgba(16, 34, 54, 0.22), 0 6px 16px -8px rgba(16, 34, 54, 0.10);
  --ring: 0 0 0 3px rgba(110, 168, 220, 0.28);

  /* 圆角 */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-pill: 999px;

  /* 版心 */
  --maxw: 1180px;
  --gutter: 28px;
  --sidebar-w: 322px;

  /* 字体 */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei",
    "Source Han Sans SC", "Noto Sans SC", sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia,
    "Source Han Serif SC", "Noto Serif SC", "Songti SC", STSong, serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", "Courier New", monospace;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

html[data-theme="dark"] {
  --paper: #0B0F14;
  --paper-tint: #14212E;
  --surface: #111821;
  --surface-2: #16202B;
  --surface-3: #1B2734;

  --ink: #E9EFF6;
  --ink-2: #B9C4D0;
  --ink-3: #8693A2;
  --ink-4: #5E6B7A;

  --line: #212D3A;
  --line-2: #18222D;

  --accent: #7CB3E8;
  --accent-strong: #A6CDF0;
  --accent-2: #4E86BC;
  --accent-soft: #16283A;
  --accent-mist: rgba(124, 179, 232, 0.16);

  --snow-ink: #CBE1F8;
  --snow-halo: rgba(124, 179, 232, 0.55);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 2px 8px -4px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 6px 18px -8px rgba(0, 0, 0, 0.7), 0 2px 6px -2px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 22px 52px -24px rgba(0, 0, 0, 0.85), 0 6px 16px -8px rgba(0, 0, 0, 0.6);
  --ring: 0 0 0 3px rgba(124, 179, 232, 0.25);
}

/* --------------------------------------------------------------------------
   2. Reset & base
   -------------------------------------------------------------------------- */
* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(1100px 520px at 50% -260px, var(--paper-tint) 0%, rgba(0, 0, 0, 0) 72%),
    radial-gradient(680px 380px at 92% 4%, var(--accent-mist) 0%, rgba(0, 0, 0, 0) 64%);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: tabular-nums;
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease);
}

img { max-width: 100%; height: auto; border: 0; vertical-align: middle; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 700; line-height: 1.35; }
p { margin: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }

:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-xs); }

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

/* 细雪花分隔线 */
.hairline {
  height: 1px;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0) 0%, var(--line) 12%, var(--line) 88%, rgba(0, 0, 0, 0) 100%);
}

/* --------------------------------------------------------------------------
   3. Layout
   -------------------------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--sidebar-w);
  gap: 40px;
  align-items: start;
  padding: 44px 0 80px;
}

.layout--full { grid-template-columns: minmax(0, 1fr); }

.page-head { padding: 40px 0 8px; }

/* --------------------------------------------------------------------------
   4. Header / navigation
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.site-header::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 38%, rgba(110, 168, 220, 0) 100%);
  opacity: 0.85;
}

.header-row {
  display: flex;
  align-items: center;
  gap: 22px;
  height: 70px;
}

/* 品牌 */
.brand { display: flex; align-items: center; gap: 11px; flex: 0 0 auto; }

.brand-mark {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(150deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transition: transform 0.6s var(--ease-out), box-shadow 0.3s var(--ease);
}
.brand:hover .brand-mark { transform: rotate(180deg) scale(1.04); box-shadow: var(--shadow-sm); }
html[data-theme="dark"] .brand-mark { box-shadow: var(--shadow-xs); }

.brand-mark svg { width: 21px; height: 21px; display: block; color: var(--accent); }

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ink);
}
.brand-sub {
  font-family: var(--font-serif);
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-top: 2px;
}

/* 主导航 */
.main-nav { flex: 1 1 auto; min-width: 0; }
.nav-list { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav-list > li > a {
  position: relative;
  display: inline-block;
  padding: 9px 13px;
  font-size: 14.5px;
  color: var(--ink-2);
  border-radius: var(--r-sm);
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.nav-list > li > a::after {
  content: "";
  position: absolute;
  left: 13px;
  right: 13px;
  bottom: 4px;
  height: 1.5px;
  border-radius: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.32s var(--ease-out);
}
.nav-list > li > a:hover { color: var(--accent); background: var(--accent-soft); }
.nav-list > li > a:hover::after,
.nav-list > li > a.is-active::after { transform: scaleX(1); }
.nav-list > li > a.is-active { color: var(--accent); font-weight: 600; }

/* 头部工具区 */
.header-tools { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

.icon-btn {
  position: relative;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  color: var(--ink-2);
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease),
    border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.icon-btn:hover { color: var(--accent); background: var(--accent-soft); border-color: var(--line); }
.icon-btn:active { transform: scale(0.95); }
.icon-btn svg { width: 18px; height: 18px; display: block; }

/* 登录 / 后台入口（恢复 thinkno 的登录链接） */
.login-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 13px;
  font-size: 13.5px;
  color: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease),
    box-shadow 0.2s var(--ease), background-color 0.2s var(--ease);
}
.login-link:hover {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  box-shadow: var(--shadow-sm);
}
.login-link svg { width: 15px; height: 15px; }
.login-link .login-label { white-space: nowrap; }

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

/* 移动端菜单按钮 */
.nav-toggle { display: none; }
.nav-toggle .icon-close { display: none; }
body.nav-open .nav-toggle .icon-menu { display: none; }
body.nav-open .nav-toggle .icon-close { display: block; }

/* 头部搜索 */
.header-search { position: relative; }
.header-search .search-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 12px);
  width: 320px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease), visibility 0.22s;
}
.header-search.open .search-panel { opacity: 1; visibility: visible; transform: translateY(0); }

/* 搜索输入 */
.search-input {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 42px;
  padding: 0 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.search-input:focus-within {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: var(--surface);
  box-shadow: var(--ring);
}
.search-input svg { width: 16px; height: 16px; color: var(--ink-4); flex: 0 0 auto; }
.search-input input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: none;
  outline: none;
  font-size: 14.5px;
}
.search-input input::placeholder { color: var(--ink-4); }

/* 移动端抽屉 */
.nav-drawer {
  display: none;
  position: fixed;
  inset: 70px 0 0 0;
  z-index: 55;
  padding: 22px var(--gutter) 40px;
  background: var(--surface);
  border-top: 1px solid var(--line);
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.26s var(--ease), transform 0.26s var(--ease), visibility 0.26s;
}
body.nav-open .nav-drawer { opacity: 1; visibility: visible; transform: translateY(0); }
.nav-drawer .nav-list { display: block; }
.nav-drawer .nav-list > li > a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 4px;
  font-size: 16px;
  border-bottom: 1px solid var(--line-2);
  border-radius: 0;
}
.nav-drawer .nav-list > li > a::after { display: none; }
.nav-drawer .drawer-foot { margin-top: 26px; display: grid; gap: 10px; }

/* 遮罩 */
.mask {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(12, 20, 30, 0.35);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.26s var(--ease), visibility 0.26s;
}
body.nav-open .mask { opacity: 1; visibility: visible; }

/* --------------------------------------------------------------------------
   5. Hero（首页头部区）
   -------------------------------------------------------------------------- */
.hero { padding: 56px 0 8px; }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 306px;
  gap: 44px;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-serif);
  font-size: 11.5px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), rgba(0, 0, 0, 0));
}

.hero-title {
  font-size: clamp(30px, 4.6vw, 46px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.24;
  color: var(--ink);
  text-wrap: balance;
}
.hero-title em {
  font-style: normal;
  background: linear-gradient(100deg, var(--accent) 0%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-lead {
  margin-top: 20px;
  font-size: 16.5px;
  line-height: 1.9;
  color: var(--ink-3);
  max-width: 42em;
  text-wrap: pretty;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

/* 个人卡片 */
.profile-card {
  position: relative;
  padding: 26px 24px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  text-align: center;
}
.profile-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 74px;
  background:
    radial-gradient(circle at 22% 0%, var(--accent-mist) 0%, rgba(0, 0, 0, 0) 70%),
    linear-gradient(180deg, var(--surface-2), var(--surface));
  border-bottom: 1px solid var(--line-2);
}
.profile-card > * { position: relative; }

.avatar {
  width: 92px;
  height: 92px;
  margin: 24px auto 0;
  border-radius: 50%;
  background: linear-gradient(150deg, var(--surface-2), var(--surface-3));
  border: 3px solid var(--surface);
  box-shadow: var(--shadow-sm), 0 0 0 1px var(--line);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar svg { width: 46px; height: 46px; color: var(--accent); }

.profile-name { margin-top: 14px; font-size: 18px; font-weight: 700; letter-spacing: 0.02em; }
.profile-bio {
  margin-top: 7px;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--ink-3);
}
.profile-stats {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line-2);
  padding-top: 16px;
}
.profile-stats div { position: relative; }
.profile-stats div + div::before {
  content: "";
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 1px;
  background: var(--line-2);
}
.profile-stats b {
  display: block;
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.01em;
}
.profile-stats span { font-size: 11.5px; color: var(--ink-4); letter-spacing: 0.08em; }

/* 数据条（首页统计带） */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin-top: 46px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.stat-strip > div {
  padding: 22px 18px;
  text-align: center;
  position: relative;
}
.stat-strip > div + div::before {
  content: "";
  position: absolute;
  left: 0; top: 22px; bottom: 22px;
  width: 1px;
  background: var(--line);
}
.stat-strip b {
  display: block;
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 600;
  color: var(--ink);
}
.stat-strip span { font-size: 12px; color: var(--ink-4); letter-spacing: 0.14em; }

/* --------------------------------------------------------------------------
   6. 公告条
   -------------------------------------------------------------------------- */
.notice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  margin-bottom: 24px;
  background: linear-gradient(100deg, var(--accent-soft) 0%, var(--surface) 88%);
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  border-radius: var(--r-md);
  font-size: 14px;
  color: var(--ink-2);
}
.notice .badge {
  flex: 0 0 auto;
  font-family: var(--font-serif);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}
.notice a { color: var(--ink); border-bottom: 1px solid var(--line); transition: border-color 0.2s; }
.notice a:hover { border-color: var(--accent); color: var(--accent); }

/* --------------------------------------------------------------------------
   7. 区块标题
   -------------------------------------------------------------------------- */
.sec-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 22px;
}
.sec-head h2 {
  font-size: 19px;
  letter-spacing: -0.01em;
  position: relative;
  padding-left: 14px;
}
.sec-head h2::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 15px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
}
.sec-head .sec-line {
  flex: 1 1 auto;
  height: 1px;
  background: linear-gradient(90deg, var(--line) 0%, rgba(0, 0, 0, 0) 100%);
}
.sec-head .sec-more {
  flex: 0 0 auto;
  font-size: 13px;
  color: var(--ink-4);
  transition: color 0.2s var(--ease), transform 0.2s var(--ease);
}
.sec-head .sec-more:hover { color: var(--accent); transform: translateX(2px); }

/* 归档页头 */
.archive-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 20px;
  margin-bottom: 26px;
  border-bottom: 1px solid var(--line);
}
.archive-head .kicker {
  font-family: var(--font-serif);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}
.archive-head h1 { font-size: 25px; letter-spacing: -0.015em; }
.archive-head .count { font-size: 13px; color: var(--ink-4); }

/* --------------------------------------------------------------------------
   8. 文章卡片
   -------------------------------------------------------------------------- */
.post-list { display: grid; gap: 18px; }

.post-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  padding: 24px 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-xs);
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease),
    border-color 0.3s var(--ease);
}
.post-card::after {
  content: "";
  position: absolute;
  left: 0; top: 16px; bottom: 16px;
  width: 2px;
  border-radius: 0 2px 2px 0;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}
.post-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 34%, var(--line));
  box-shadow: var(--shadow-md);
}
.post-card:hover::after { opacity: 1; }

.post-card.has-thumb { grid-template-columns: minmax(0, 1fr) 208px; }

.post-card h2 { font-size: 19.5px; letter-spacing: -0.012em; line-height: 1.5; }
.post-card h2 a { transition: color 0.2s var(--ease); }
.post-card h2 a:hover { color: var(--accent); }

.post-card .excerpt {
  margin-top: 11px;
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--ink-3);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-wrap: pretty;
}

.thumb {
  border-radius: var(--r-sm);
  overflow: hidden;
  background: linear-gradient(150deg, var(--surface-2), var(--surface-3));
  border: 1px solid var(--line-2);
  aspect-ratio: 16 / 10;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.6s var(--ease-out); }
.post-card:hover .thumb img { transform: scale(1.045); }

/* 元信息行 */
.post-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 15px;
  font-size: 12.5px;
  color: var(--ink-4);
}
.post-meta .dot {
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--ink-4);
  opacity: 0.55;
}
.cat {
  display: inline-flex;
  align-items: center;
  height: 23px;
  padding: 0 10px;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line));
  border-radius: var(--r-pill);
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}
.cat:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

.tag-pin {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 9px;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--warn);
  background: color-mix(in srgb, var(--warn) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--warn) 24%, transparent);
  border-radius: var(--r-pill);
}
.tag-pin--top { color: var(--accent); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 22%, transparent); }

/* 置顶卡片微区分 */
.post-card.is-top { border-color: color-mix(in srgb, var(--accent) 26%, var(--line)); }
.post-card.is-top::after { opacity: 0.75; }

/* --------------------------------------------------------------------------
   9. 按钮 / 徽标
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 22px;
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  box-shadow: var(--shadow-xs);
  transition: transform 0.2s var(--ease), box-shadow 0.25s var(--ease),
    background-color 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); color: var(--ink); }
.btn:active { transform: translateY(0); }
.btn svg { width: 16px; height: 16px; }

.btn-primary {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(100deg, var(--accent) 0%, var(--accent-2) 100%);
  box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--accent) 70%, transparent);
}
html[data-theme="dark"] .btn-primary { color: #0B0F14; }
.btn-primary:hover { color: #fff; box-shadow: 0 10px 26px -10px color-mix(in srgb, var(--accent) 80%, transparent); }
html[data-theme="dark"] .btn-primary:hover { color: #0B0F14; }

.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn-ghost:hover { background: var(--accent-soft); color: var(--accent); box-shadow: none; }

.btn-sm { height: 34px; padding: 0 15px; font-size: 13px; }

.badge-soft {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
}

/* --------------------------------------------------------------------------
   10. 侧栏
   -------------------------------------------------------------------------- */
.sidebar { display: grid; gap: 20px; position: sticky; top: 92px; }

.widget {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}
.widget-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 15px 18px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line-2);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
}
.widget-title svg { width: 14px; height: 14px; color: var(--accent-2); flex: 0 0 auto; }
.widget-body { padding: 8px 18px 16px; }

/* 热门文章 */
.hot-list { display: grid; }
.hot-list li { border-bottom: 1px dashed var(--line-2); }
.hot-list li:last-child { border-bottom: 0; }
.hot-list a {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  padding: 12px 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-2);
  transition: color 0.2s var(--ease);
}
.hot-list a:hover { color: var(--accent); }
.hot-list .rank {
  font-family: var(--font-serif);
  font-size: 14px;
  font-style: italic;
  color: var(--ink-4);
  text-align: center;
  line-height: 1.6;
}
.hot-list li:nth-child(1) .rank,
.hot-list li:nth-child(2) .rank,
.hot-list li:nth-child(3) .rank { color: var(--accent); }
.hot-list small {
  display: block;
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--ink-4);
}

/* 标签 */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-cloud a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 29px;
  padding: 0 12px;
  font-size: 12.5px;
  color: var(--ink-2);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  transition: all 0.2s var(--ease);
}
.tag-cloud a:hover {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  background: var(--accent-soft);
  transform: translateY(-1px);
}
.tag-cloud a .n { font-family: var(--font-serif); font-size: 11px; color: var(--ink-4); }
.tag-cloud a:hover .n { color: var(--accent-2); }

/* 最新评论 */
.comm-list { display: grid; gap: 14px; padding-top: 8px; }
.comm-item { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 10px; }
.comm-item .avatar-sm {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(150deg, var(--surface-2), var(--surface-3));
  border: 1px solid var(--line);
  display: grid; place-items: center;
  font-family: var(--font-serif);
  font-size: 13px;
  color: var(--accent);
}
.comm-item .who { font-size: 12.5px; color: var(--ink-4); }
.comm-item .who b { color: var(--ink-2); font-weight: 600; }
.comm-item .what {
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 归档列表 */
.arch-list { display: grid; }
.arch-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  font-size: 13.5px;
  color: var(--ink-2);
  border-bottom: 1px dashed var(--line-2);
  transition: color 0.2s var(--ease), padding-left 0.2s var(--ease);
}
.arch-list a:last-child { border-bottom: 0; }
.arch-list a:hover { color: var(--accent); padding-left: 4px; }
.arch-list .n { font-family: var(--font-serif); font-size: 12px; color: var(--ink-4); }

/* 关于块 */
.about-mini { text-align: center; padding: 22px 18px; }
.about-mini .avatar { margin: 0 auto; width: 74px; height: 74px; }
.about-mini .name { margin-top: 12px; font-weight: 700; font-size: 15.5px; }
.about-mini .desc { margin-top: 6px; font-size: 13px; color: var(--ink-3); line-height: 1.75; }
.about-mini .socials { margin-top: 14px; display: flex; justify-content: center; gap: 8px; }

/* --------------------------------------------------------------------------
   11. 分页
   -------------------------------------------------------------------------- */
.pagebar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 34px;
  flex-wrap: wrap;
}
.pagebar a, .pagebar span {
  min-width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  font-size: 13.5px;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  transition: all 0.2s var(--ease);
}
.pagebar a:hover {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  transform: translateY(-1px);
  box-shadow: var(--shadow-xs);
}
.pagebar .current {
  color: #fff;
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--accent) 70%, transparent);
}
html[data-theme="dark"] .pagebar .current { color: #0B0F14; }
.pagebar .disabled { color: var(--ink-4); opacity: 0.6; }

/* --------------------------------------------------------------------------
   12. 文章页
   -------------------------------------------------------------------------- */
.reading-bar {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0;
  z-index: 80;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.12s linear;
}

.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--ink-4);
  flex-wrap: wrap;
}
.crumbs a { transition: color 0.2s var(--ease); }
.crumbs a:hover { color: var(--accent); }
.crumbs .sep { color: var(--ink-4); opacity: 0.5; }

.article-head { padding-bottom: 26px; border-bottom: 1px solid var(--line); }
.article-head h1 {
  margin-top: 16px;
  font-size: clamp(24px, 3.4vw, 34px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.34;
  text-wrap: balance;
}

.byline {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
  flex-wrap: wrap;
}
.byline .avatar-sm {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(150deg, var(--surface-2), var(--surface-3));
  border: 1px solid var(--line);
  display: grid; place-items: center;
  color: var(--accent);
  font-family: var(--font-serif);
  font-size: 15px;
}
.byline .who { font-size: 14px; font-weight: 600; }
.byline .who span { display: block; font-size: 12px; font-weight: 400; color: var(--ink-4); margin-top: 1px; }
.byline .stats { display: flex; gap: 14px; margin-left: auto; font-size: 12.5px; color: var(--ink-4); }
.byline .stats i { font-style: normal; display: inline-flex; align-items: center; gap: 5px; }
.byline .stats svg { width: 13px; height: 13px; }

.article-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }

/* 正文排版 */
.article-content {
  padding: 34px 0 8px;
  font-size: 17px;
  line-height: 1.95;
  color: var(--ink-2);
  letter-spacing: 0.004em;
}
.article-content > * + * { margin-top: 22px; }
.article-content p { text-wrap: pretty; }
.article-content > p:first-of-type {
  font-size: 17.5px;
  color: var(--ink);
}
.article-content h2 {
  position: relative;
  margin-top: 46px;
  padding-left: 0;
  font-size: 22px;
  letter-spacing: -0.012em;
  color: var(--ink);
  scroll-margin-top: 96px;
}
.article-content h2::after {
  content: "";
  display: block;
  width: 42px;
  height: 2px;
  margin-top: 12px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.article-content h3 {
  margin-top: 34px;
  font-size: 18px;
  color: var(--ink);
  scroll-margin-top: 96px;
}
.article-content h3::before {
  content: "";
  display: inline-block;
  width: 5px; height: 5px;
  margin-right: 9px;
  vertical-align: middle;
  background: var(--accent-2);
  transform: rotate(45deg);
  border-radius: 1px;
}
.article-content ul, .article-content ol { padding-left: 4px; }
.article-content ul > li, .article-content ol > li {
  position: relative;
  padding-left: 24px;
  margin-top: 10px;
}
.article-content ul > li::before {
  content: "";
  position: absolute;
  left: 7px; top: 0.82em;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent-2);
}
.article-content ol { counter-reset: li; }
.article-content ol > li::before {
  counter-increment: li;
  content: counter(li);
  position: absolute;
  left: 0; top: 0.15em;
  font-family: var(--font-serif);
  font-size: 13px;
  color: var(--accent);
}
.article-content a {
  color: var(--accent);
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 34%, transparent);
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.article-content a:hover { border-color: var(--accent); background: var(--accent-soft); }

.article-content blockquote {
  position: relative;
  margin: 30px 0;
  padding: 18px 24px 18px 26px;
  background: linear-gradient(100deg, var(--surface-2) 0%, var(--surface) 92%);
  border-left: 2px solid var(--accent);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: 16px;
  color: var(--ink-2);
}
.article-content blockquote p + p { margin-top: 12px; }
.article-content blockquote cite { display: block; margin-top: 10px; font-size: 12.5px; color: var(--ink-4); font-style: normal; }

.article-content img {
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  display: block;
  margin-left: auto;
  margin-right: auto;
  cursor: zoom-in;
}
.article-content figure { margin: 28px 0; }
.article-content figcaption {
  margin-top: 10px;
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-4);
  letter-spacing: 0.02em;
}

.article-content code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  padding: 2px 6px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 14%, var(--line));
  border-radius: var(--r-xs);
}
html[data-theme="dark"] .article-content code { color: var(--accent); }

.article-content pre {
  position: relative;
  margin: 28px 0;
  padding: 44px 20px 18px;
  background: #0E1620;
  border: 1px solid #1C2836;
  border-radius: var(--r-md);
  overflow-x: auto;
  box-shadow: var(--shadow-md);
}
.article-content pre code {
  display: block;
  padding: 0;
  border: 0;
  background: none;
  color: #D5E1ED;
  font-size: 13.5px;
  line-height: 1.8;
  white-space: pre;
}
.article-content pre::before {
  content: "";
  position: absolute;
  left: 18px; top: 17px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #FF5F57;
  box-shadow: 16px 0 0 #FEBC2E, 32px 0 0 #28C840;
}
.code-lang {
  position: absolute;
  right: 62px; top: 12px;
  font-family: var(--font-serif);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #6C7E90;
}
.code-copy {
  position: absolute;
  right: 12px; top: 8px;
  height: 26px;
  padding: 0 10px;
  font-size: 11.5px;
  color: #90A3B6;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--r-xs);
  transition: all 0.2s var(--ease);
}
.code-copy:hover { color: #E9F0F7; background: rgba(255, 255, 255, 0.11); }
.code-copy.done { color: #7DD3A0; border-color: rgba(125, 211, 160, 0.4); }

/* 代码着色（预览用；线上由 highlight.js 输出同名类） */
.tok-key { color: #C792EA; }
.tok-str { color: #9AD39A; }
.tok-num { color: #F0A868; }
.tok-com { color: #63758A; font-style: italic; }
.tok-fn { color: #7FB6F0; }
.tok-var { color: #E4EDF6; }

.article-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  overflow: hidden;
}
.article-content thead th {
  background: var(--surface-2);
  font-weight: 600;
  color: var(--ink);
  text-align: left;
}
.article-content th, .article-content td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-2);
}
.article-content tbody tr:last-child td { border-bottom: 0; }

/* 版权框 */
.license {
  display: flex;
  gap: 12px;
  margin-top: 34px;
  padding: 16px 18px;
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--ink-3);
  background: var(--surface-2);
  border: 1px dashed var(--line);
  border-radius: var(--r-md);
}
.license svg { width: 17px; height: 17px; flex: 0 0 auto; margin-top: 3px; color: var(--accent-2); }
.license a { color: var(--accent); }

/* 上下篇 */
.post-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 40px;
}
.post-nav a {
  display: block;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  transition: transform 0.25s var(--ease-out), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.post-nav a:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 34%, var(--line));
  box-shadow: var(--shadow-sm);
}
.post-nav a span {
  display: block;
  font-family: var(--font-serif);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-bottom: 7px;
}
.post-nav a strong {
  display: block;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.6;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-nav a:hover strong { color: var(--accent); }
.post-nav .next { text-align: right; }

/* 相关文章 */
.related-list { display: grid; gap: 2px; }
.related-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  font-size: 14px;
  color: var(--ink-2);
  border-bottom: 1px dashed var(--line-2);
  transition: color 0.2s var(--ease), padding-left 0.2s var(--ease);
}
.related-list a:last-child { border-bottom: 0; }
.related-list a:hover { color: var(--accent); padding-left: 4px; }
.related-list .count { flex: 0 0 auto; font-family: var(--font-serif); font-size: 11.5px; color: var(--ink-4); }

/* 目录 */
.toc-list { display: grid; padding: 4px 0 6px; }
.toc-list a {
  display: block;
  padding: 7px 14px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-3);
  border-left: 2px solid var(--line);
  transition: all 0.22s var(--ease);
}
.toc-list a:hover { color: var(--accent); border-left-color: var(--accent-2); background: var(--surface-2); }
.toc-list a.is-active {
  color: var(--accent);
  font-weight: 600;
  border-left-color: var(--accent);
  background: var(--accent-soft);
}
.toc-list .lv3 a { padding-left: 28px; font-size: 12.8px; }

/* --------------------------------------------------------------------------
   13. 评论
   -------------------------------------------------------------------------- */
.comments { margin-top: 48px; }
.comment-form {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-xs);
}
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; color: var(--ink-3); margin-bottom: 7px; letter-spacing: 0.04em; }
.field input[type="text"], .field input[type="email"], .field input[type="url"], .field textarea {
  width: 100%;
  padding: 11px 14px;
  font-size: 14.5px;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  outline: none;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.field textarea { min-height: 116px; resize: vertical; line-height: 1.8; }
.field input:focus, .field textarea:focus {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: var(--surface);
  box-shadow: var(--ring);
}
.field-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }

.comment-list { display: grid; gap: 18px; margin-top: 30px; }
.comment {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-2);
}
.comment:last-child { border-bottom: 0; }
.comment .avatar-sm {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(150deg, var(--surface-2), var(--surface-3));
  border: 1px solid var(--line);
  display: grid; place-items: center;
  font-family: var(--font-serif);
  color: var(--accent);
}
.comment .head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.comment .head b { font-size: 14px; }
.comment .head .time { font-size: 12px; color: var(--ink-4); }
.comment .head .reply {
  margin-left: auto;
  font-size: 12.5px;
  color: var(--ink-4);
  transition: color 0.2s var(--ease);
}
.comment .head .reply:hover { color: var(--accent); }
.comment .body { margin-top: 7px; font-size: 14.5px; line-height: 1.85; color: var(--ink-2); }
.comment .foot { margin-top: 9px; display: flex; gap: 14px; font-size: 12px; color: var(--ink-4); }

/* --------------------------------------------------------------------------
   14. 空状态 / 404
   -------------------------------------------------------------------------- */
.empty {
  padding: 62px 24px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
}
.empty svg { width: 74px; height: 74px; color: var(--accent-2); opacity: 0.42; margin-bottom: 18px; }
.empty h2 { font-size: 18px; margin-bottom: 9px; }
.empty p { font-size: 14px; color: var(--ink-3); max-width: 34em; margin: 0 auto; }
.empty .actions { margin-top: 24px; display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }

.err-code {
  font-family: var(--font-serif);
  font-size: clamp(80px, 15vw, 150px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
  background: linear-gradient(150deg, var(--accent) 0%, var(--accent-2) 62%, var(--ink-4) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* --------------------------------------------------------------------------
   15. 页脚
   -------------------------------------------------------------------------- */
.link-block {
  margin-top: 56px;
  padding: 26px 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-xs);
}
.link-block h3 {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-bottom: 15px;
}
.link-block .links { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.link-block a {
  font-size: 13.5px;
  color: var(--ink-2);
  transition: color 0.2s var(--ease);
}
.link-block a:hover { color: var(--accent); }

.site-footer {
  margin-top: 64px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0), var(--surface-2));
}
.footer-main {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 40px;
  padding: 44px 0 34px;
}
.footer-brand .brand { margin-bottom: 14px; }
.footer-brand p { font-size: 13.5px; line-height: 1.85; color: var(--ink-3); max-width: 28em; }
.footer-col h4 {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-bottom: 14px;
}
.footer-col li { margin-bottom: 9px; }
.footer-col a { font-size: 13.5px; color: var(--ink-2); transition: color 0.2s var(--ease); }
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px 0;
  border-top: 1px solid var(--line-2);
  font-size: 12.5px;
  color: var(--ink-4);
}
.footer-bottom a { color: var(--ink-3); transition: color 0.2s var(--ease); }
.footer-bottom a:hover { color: var(--accent); }

/* 返回顶部 */
.to-top {
  position: fixed;
  right: 24px;
  bottom: 26px;
  z-index: 45;
  width: 44px; height: 44px;
  display: grid;
  place-items: center;
  color: var(--ink-2);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 50%;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s var(--ease-out);
}
.to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.to-top svg { width: 17px; height: 17px; }

/* 灯箱 */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 32px;
  background: rgba(9, 15, 22, 0.86);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s var(--ease), visibility 0.28s;
}
.lightbox.open { opacity: 1; visibility: visible; }
.lightbox img {
  max-width: min(1120px, 94vw);
  max-height: 88vh;
  border-radius: var(--r-md);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.8);
}
.lightbox .close {
  position: absolute;
  top: 22px; right: 26px;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
}
.lightbox .close:hover { background: rgba(255, 255, 255, 0.12); }

/* --------------------------------------------------------------------------
   16. 导航页（dh）专用
   -------------------------------------------------------------------------- */
.dh-hero {
  position: relative;
  padding: 54px 0 40px;
  overflow: hidden;
}
.dh-hero .flakes { position: absolute; inset: 0; pointer-events: none; opacity: 0.5; }
.dh-hero .inner { position: relative; text-align: center; }
.dh-hero h1 {
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 800;
  letter-spacing: -0.015em;
}
.dh-hero p {
  margin-top: 12px;
  font-size: 14.5px;
  color: var(--ink-3);
}
.dh-search {
  max-width: 620px;
  margin: 26px auto 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}
.dh-search .search-input { height: 46px; background: var(--surface); box-shadow: var(--shadow-sm); }

.dh-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 26px auto 0;
  max-width: 900px;
}
.dh-tabs button {
  height: 32px;
  padding: 0 15px;
  font-size: 13px;
  color: var(--ink-3);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  transition: all 0.2s var(--ease);
}
.dh-tabs button:hover { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.dh-tabs button.is-active {
  color: #fff;
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  border-color: transparent;
  font-weight: 500;
}
html[data-theme="dark"] .dh-tabs button.is-active { color: #0B0F14; }

/* ---- 分组卡片布局 ----
   病因：CSS Grid 按行排版时，一整行的高度由该行最高的卡片决定。
   「工具」42 条把行高撑到 700px，同行的「学习 / 购物」下面必然空出一大片。
   align-items:start 只能阻止卡片被拉伸，挡不住"空位"。
   解法两层：
     ① 无 JS 兜底：条目多的分组横跨整行，内部自己铺成多列（高度骤降）。
     ② JS 接管：外层换成「列容器 + 最矮列优先」，彻底把空白填掉。 */
.dh-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 18px;
  padding: 12px 0 80px;
}
.dh-group.dh-wide { grid-column: 1 / -1; }
.dh-group.dh-wide .dh-links { grid-template-columns: repeat(auto-fill, minmax(162px, 1fr)); }

/* JS 模式：外层退化为普通块，列结构由 .dh-cols 承担 */
html.js .dh-grid { display: block; }
html.js .dh-group.dh-wide { grid-column: auto; }

.dh-cols {
  display: grid;
  grid-template-columns: repeat(var(--dh-cols, 3), minmax(0, 1fr));
  align-items: start;
  gap: 18px;
}
.dh-col {
  display: grid;
  gap: 18px;
  align-content: start;
  min-width: 0;
}
/* 桌面端只剩一个分组可见时，卡片内部铺开成多列，别变成一条细长条 */
.dh-cols.is-single .dh-links { grid-template-columns: repeat(auto-fill, minmax(162px, 1fr)); }
.dh-group {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}
.dh-group:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--accent) 26%, var(--line));
}
.dh-group-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line-2);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
}
.dh-group-icon {
  width: 32px; height: 32px;
  flex: 0 0 auto;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  background: var(--accent-soft);
  color: var(--accent);
}
.dh-group-icon svg { width: 16px; height: 16px; }
.dh-group-head h3 { font-size: 14.5px; letter-spacing: 0.02em; }
.dh-group-head .n {
  margin-left: auto;
  font-family: var(--font-serif);
  font-size: 11.5px;
  color: var(--ink-4);
}
.dh-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 12px;
}
.dh-links a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  font-size: 13.5px;
  color: var(--ink-2);
  border-radius: var(--r-xs);
  border: 1px solid transparent;
  overflow: hidden;
  transition: all 0.18s var(--ease);
}
.dh-links a span {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.dh-links a::before {
  content: "";
  width: 5px; height: 5px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--ink-4);
  opacity: 0.55;
  transition: background-color 0.18s var(--ease), transform 0.18s var(--ease);
}
.dh-links a:hover {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 26%, transparent);
}
.dh-links a:hover::before { background: var(--accent); transform: scale(1.5); }
.dh-group.hide, .dh-links a.hide { display: none; }

.dh-empty {
  display: none;
  padding: 56px 24px;
  text-align: center;
  color: var(--ink-3);
}
.dh-empty svg { width: 56px; height: 56px; opacity: 0.4; color: var(--accent-2); margin-bottom: 14px; }

/* 导航页后台管理 mock */
.admin-shell {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  min-height: 100vh;
  background: var(--paper);
}
.admin-side {
  background: #16202B;
  color: #AEBBC9;
  padding: 20px 14px;
}
html[data-theme="dark"] .admin-side { background: #0A0F15; }
.admin-side .brand { margin-bottom: 22px; }
.admin-side .brand-name { color: #F0F5FA; }
.admin-side .brand-sub { color: #6E7F91; }
.admin-side .brand-mark { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.1); }
.admin-nav { display: grid; gap: 2px; }
.admin-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  font-size: 13.5px;
  color: #AEBBC9;
  border-radius: var(--r-sm);
  transition: all 0.18s var(--ease);
}
.admin-nav a:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.admin-nav a.is-active { background: rgba(110, 168, 220, 0.18); color: #fff; font-weight: 500; }
.admin-nav svg { width: 15px; height: 15px; opacity: 0.8; }
.admin-main { padding: 26px 30px 60px; }
.admin-topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 18px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.admin-topbar h1 { font-size: 20px; }
.admin-topbar .sub { font-size: 12.5px; color: var(--ink-4); }
.admin-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-xs);
  margin-bottom: 20px;
  overflow: hidden;
}
.admin-card > header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--line-2);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
}
.admin-card > header h2 { font-size: 14.5px; }
.admin-card > header .tip { font-size: 12px; color: var(--ink-4); margin-left: auto; }
.admin-card .card-body { padding: 18px 20px 22px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.admin-table th {
  text-align: left;
  padding: 9px 10px;
  font-weight: 600;
  color: var(--ink-3);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
  letter-spacing: 0.04em;
}
.admin-table td { padding: 8px 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table input[type="text"] {
  width: 100%;
  padding: 7px 10px;
  font-size: 13px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  outline: none;
}
.admin-table input[type="text"]:focus { border-color: var(--accent); background: var(--surface); box-shadow: var(--ring); }
.admin-table .grip { color: var(--ink-4); cursor: grab; text-align: center; width: 28px; }
.admin-table .row-actions { white-space: nowrap; text-align: right; }
.admin-table .row-actions button { color: var(--danger); font-size: 12.5px; }

/* --------------------------------------------------------------------------
   17. 设计规范页
   -------------------------------------------------------------------------- */
.sg-section { margin-bottom: 52px; }
.sg-section > h2 {
  font-size: 15px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-4);
  padding-bottom: 12px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(146px, 1fr)); gap: 12px; }
.swatch {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--surface);
}
.swatch .chip { height: 62px; }
.swatch .meta { padding: 10px 12px; font-size: 12px; }
.swatch .meta b { display: block; font-size: 12.5px; margin-bottom: 2px; }
.swatch .meta span { font-family: var(--font-mono); font-size: 11px; color: var(--ink-4); }

.type-row { padding: 16px 0; border-bottom: 1px dashed var(--line-2); }
.type-row .tag { font-family: var(--font-mono); font-size: 11px; color: var(--ink-4); margin-bottom: 7px; }

.logo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.logo-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-xs);
  padding: 22px 16px 16px;
  text-align: center;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease);
}
.logo-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.logo-card .stage {
  height: 92px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  border-radius: var(--r-sm);
  background: linear-gradient(150deg, var(--surface-2), var(--surface-3));
}
.logo-card .stage svg { color: var(--accent); }
.logo-card h4 { font-size: 13.5px; margin-bottom: 5px; }
.logo-card p { font-size: 12px; color: var(--ink-4); line-height: 1.65; }
.logo-card .ico-preview { display: flex; align-items: flex-end; gap: 11px; justify-content: center; margin-top: 12px; }
.logo-card .ico-preview i {
  display: grid;
  place-items: center;
  border-radius: var(--r-xs);
  background: linear-gradient(150deg, var(--accent), var(--accent-2));
  color: #fff;
}
html[data-theme="dark"] .logo-card .ico-preview i { color: #0B0F14; }

/* --------------------------------------------------------------------------
   18. 动效
   -------------------------------------------------------------------------- */
@keyframes riseIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* 列表入场：纯 CSS，不依赖 JS，首屏之后的内容也一定可见。
   导航页例外：JS 接管分列后会重建 DOM，切换筛选时动画会被反复触发
   （每敲一个字卡片就闪一下），所以 JS 模式下直接关掉。 */
.post-list > *,
.dh-grid > .dh-group {
  animation: riseIn 0.5s var(--ease-out) both;
}
html.js .dh-grid .dh-group { animation: none; }
.post-list > *:nth-child(1), .dh-grid > .dh-group:nth-child(1) { animation-delay: 0.02s; }
.post-list > *:nth-child(2), .dh-grid > .dh-group:nth-child(2) { animation-delay: 0.06s; }
.post-list > *:nth-child(3), .dh-grid > .dh-group:nth-child(3) { animation-delay: 0.10s; }
.post-list > *:nth-child(4), .dh-grid > .dh-group:nth-child(4) { animation-delay: 0.14s; }
.post-list > *:nth-child(5), .dh-grid > .dh-group:nth-child(5) { animation-delay: 0.18s; }
.post-list > *:nth-child(6), .dh-grid > .dh-group:nth-child(6) { animation-delay: 0.22s; }
.post-list > *:nth-child(7), .dh-grid > .dh-group:nth-child(7) { animation-delay: 0.26s; }

@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}
/* 落雪 ---------------------------------------------------------------------
   置于内容之下（z-index -1）、画布背景之上，只在留白处可见；
   正文都落在不透明卡片上，所以雪花不会压到字。

   三档景深，每片雪花的参数由 JS 通过 --flk-* 变量下发：
     远 → 小圆点（虚焦感）· 中 → 雪花 · 近 → 大雪花 + 柔光
   动画全部留在 CSS 里，JS 一挂只是没有雪，不会影响内容。
   旧版的毛病是 drift 只下落 120px / 20 多秒，雪花全挤在页面顶部一条窄带里，
   基本看不见 —— 现在是走完整屏（-14vh → 112vh）。 */
@keyframes snowFall {
  0%   { transform: translate3d(0, -14vh, 0); }
  100% { transform: translate3d(0, 112vh, 0); }
}
@keyframes snowSway {
  0%   { transform: translate3d(calc(-1 * var(--flk-sway, 18px)), 0, 0) rotate(calc(var(--flk-rot, 0deg) - 13deg)); }
  100% { transform: translate3d(var(--flk-sway, 18px), 0, 0) rotate(calc(var(--flk-rot, 0deg) + 13deg)); }
}
@keyframes spinSlow { to { transform: rotate(360deg); } }

.snowfall-layer {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  color: var(--snow-ink);
  /* 正文所在的中间竖列再压掉一半强度，两侧留白保留全量 ——
     这样「雪花更醒目」和「不影响阅读」可以同时成立。
     不支持 mask 的浏览器直接忽略这两行，雪花照常。 */
  -webkit-mask-image: radial-gradient(ellipse 40% 54% at 50% 30%, rgba(0, 0, 0, 0.62) 0%, #000 100%);
  mask-image: radial-gradient(ellipse 40% 54% at 50% 30%, rgba(0, 0, 0, 0.62) 0%, #000 100%);
}
.snowfall-layer i {
  position: absolute;
  top: 0;
  left: var(--flk-x, 0%);
  display: block;
  opacity: var(--flk-o, 0.5);
  animation: snowFall var(--flk-dur, 22s) linear infinite;
  animation-delay: var(--flk-delay, 0s);
}
/* 远景：不要 SVG，直接一个圆点 —— 又轻又像虚焦的雪粒 */
.snowfall-layer i.is-dot {
  width: var(--flk-size, 10px);
  height: var(--flk-size, 10px);
  border-radius: 50%;
  background: currentColor;
}
.snowfall-layer i svg {
  display: block;
  animation: snowSway var(--flk-sway-dur, 6s) ease-in-out infinite alternate;
  animation-delay: var(--flk-delay, 0s);
}
/* 近景：加一圈柔光，让大雪花的边缘亮起来 */
.snowfall-layer i.has-glow svg {
  filter: drop-shadow(0 0 var(--flk-glow, 5px) var(--snow-halo));
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  html { scroll-behavior: auto; }
  /* 落雪是纯装饰，减弱动效时直接不显示，比冻在半空好看 */
  .snowfall-layer { display: none; }
}

/* --------------------------------------------------------------------------
   19. 响应式
   -------------------------------------------------------------------------- */
@media (max-width: 1080px) {
  :root { --sidebar-w: 288px; --gutter: 22px; }
  .layout { gap: 28px; }
  .hero-grid { grid-template-columns: minmax(0, 1fr) 260px; gap: 30px; }
  .dh-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .main-nav { display: none; }
  .nav-toggle { display: grid; }
  .nav-drawer { display: block; }
  .layout { grid-template-columns: minmax(0, 1fr); padding-top: 32px; }
  .sidebar { position: static; }
  .header-row { gap: 12px; }
  .brand { flex: 1 1 auto; }
  .footer-main { grid-template-columns: 1fr 1fr; gap: 30px; }
  .footer-brand { grid-column: 1 / -1; }
  .post-card.has-thumb { grid-template-columns: minmax(0, 1fr) 168px; }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { display: none; }
}

@media (max-width: 760px) {
  :root { --gutter: 18px; }
  body { font-size: 15.5px; }
  .hero { padding-top: 34px; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .profile-card { max-width: 420px; }
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .stat-strip > div:nth-child(odd)::before { display: none; }
  .stat-strip > div:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .post-card { padding: 20px; }
  .post-card.has-thumb { grid-template-columns: minmax(0, 1fr); }
  .post-card.has-thumb .thumb { order: -1; aspect-ratio: 21 / 9; }
  .post-card h2 { font-size: 17.5px; }
  .post-nav { grid-template-columns: minmax(0, 1fr); }
  .post-nav .next { text-align: left; }
  .field-row { grid-template-columns: minmax(0, 1fr); }
  .article-content { font-size: 16.5px; line-height: 1.92; }
  .article-content h2 { font-size: 20px; margin-top: 38px; }
  .dh-grid { grid-template-columns: minmax(0, 1fr); }
  .dh-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dh-search { grid-template-columns: minmax(0, 1fr); }
  .footer-main { grid-template-columns: 1fr; gap: 26px; }
  .footer-bottom { justify-content: center; text-align: center; }
  .to-top { right: 16px; bottom: 18px; }
  .header-search .search-panel { width: min(320px, calc(100vw - 36px)); }
  .brand-sub { display: none; }
}

@media (max-width: 460px) {
  .header-row { height: 62px; }
  .nav-drawer { inset-block-start: 62px; }
  .brand-name { font-size: 17px; }
  .login-link .login-label { display: none; }
  .login-link { width: 38px; padding: 0; justify-content: center; border-radius: var(--r-sm); }
  .hero-actions .btn { flex: 1 1 auto; }
  .dh-links { grid-template-columns: minmax(0, 1fr); }
  .empty { padding: 46px 18px; }
}

/* 打印 */
@media print {
  .site-header, .sidebar, .to-top, .nav-drawer, .mask, .comments, .snowfall-layer { display: none !important; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  body { background: #fff; }
}


/* ==========================================================================
   20. Z-BlogPHP 适配层
   --------------------------------------------------------------------------
   预览稿里没有的部分：评论嵌套、验证码、内置语法高亮配色、
   后台模块管理拖过来的原生模块样式、以及项数不定时的列数自适应。
   ========================================================================== */

/* 导航页：整宽、不带侧栏 */
.dh-page { display: block; }

/* 嵌套回复 */
.comment-children { margin-top: 14px; display: grid; gap: 14px; }
.comment-children .comment { padding-bottom: 0; border-bottom: 0; }
.comment-children .avatar-sm { width: 32px; height: 32px; font-size: 13px; }
.comment-children .comment .body { font-size: 14px; }

/* 评论表单：验证码 */
.verify-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.verify-row input {
  flex: 0 0 150px;
  padding: 11px 14px;
  font-size: 14.5px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  outline: none;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.verify-row input:focus { border-color: var(--accent-2); box-shadow: var(--ring); }
.verify-row img {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  cursor: pointer;
}

/* 评论提交后的提示条（系统会往 #cmtMsg 里写文字） */
#cmtMsg { margin-bottom: 4px; font-size: 13.5px; line-height: 1.8; color: var(--ink-3); }
#cmtMsg:not(:empty) { padding: 10px 14px; margin-bottom: 14px; background: var(--surface-2);
  border: 1px solid var(--line); border-left: 2px solid var(--accent); border-radius: var(--r-sm); }

/* 后台「模块管理」拖过来的原生模块，内容是没有 class 的裸 HTML，这里兜一下 */
.widget-body ul { padding-left: 0; }
.widget-body li { font-size: 14px; line-height: 1.7; }
.widget-body li + li { margin-top: 8px; }
.widget-body a { color: var(--ink-2); transition: color 0.2s var(--ease); }
.widget-body a:hover { color: var(--accent); }
.widget-body ul ul { padding-left: 16px; margin-top: 6px; }
.widget-body li small, .widget-body li span { color: var(--ink-4); font-size: 12px; }

/* Z-BlogPHP 内置语法高亮（highlight.js）的配色，与预览稿的 .tok-* 保持一致 */
.article-content pre code .hljs-keyword,
.article-content pre code .hljs-built_in,
.article-content pre code .hljs-type,
.article-content pre code .hljs-literal,
.article-content pre code .hljs-meta { color: #C792EA; }
.article-content pre code .hljs-string,
.article-content pre code .hljs-regexp,
.article-content pre code .hljs-attr,
.article-content pre code .hljs-selector-class { color: #9AD39A; }
.article-content pre code .hljs-number { color: #F0A868; }
.article-content pre code .hljs-comment,
.article-content pre code .hljs-quote { color: #63758A; font-style: italic; }
.article-content pre code .hljs-title,
.article-content pre code .hljs-function .hljs-title,
.article-content pre code .hljs-tag,
.article-content pre code .hljs-name { color: #7FB6F0; }
.article-content pre code .hljs-variable,
.article-content pre code .hljs-params,
.article-content pre code .hljs-property { color: #E4EDF6; }
.article-content pre code .hljs-attribute { color: #F0A868; }
.article-content pre code .hljs-subst { color: #D5E1ED; }

/* 项数不定时列数自适应，避免出现空洞
   （后台「首页设置」里统计带可以只填 2 项，个人卡片的统计是分类 + 标签 2 项） */
.stat-strip { grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); }
.profile-stats { grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); }

@media (max-width: 760px) {
  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-strip > div:nth-child(odd)::before { display: none; }
  .stat-strip > div:nth-child(n + 3) { border-top: 1px solid var(--line); }
}


/* ==========================================================================
   21. 日历模块
   --------------------------------------------------------------------------
   主题自己生成的月历（不是 Z-BlogPHP 自带模块）。
   头部用 flex 排：翻月按钮 + 年月 + 当月文章数，比塞进表格第一行更灵活也更整齐。
   有文章的日子 = 浅蓝底 + 主色字 + 底部小圆点；今天 = 主色描边环。两种状态不冲突。
   ========================================================================== */
.cal-body { padding: 14px 14px 12px; }

.calendar-wrap { width: 100%; }

/* ---- 头部 ---- */
.cal-top { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.cal-head { flex: 1 1 auto; min-width: 0; text-align: center; line-height: 1.25; }
.cal-title {
  display: block;
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink);
}
.cal-sub {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-4);
}

.cal-step {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  font-size: 15px;
  line-height: 1;
  color: var(--ink-3);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: color 0.18s var(--ease), background-color 0.18s var(--ease),
    border-color 0.18s var(--ease), transform 0.12s var(--ease);
}
.cal-step:hover {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
}
.cal-step:active { transform: scale(0.9); }
.cal-step:disabled { opacity: 0.32; cursor: not-allowed; }
.cal-step:disabled:hover {
  color: var(--ink-3);
  background: var(--surface);
  border-color: var(--line);
}

/* ---- 表格 ---- */
table.calendar {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}
table.calendar th,
table.calendar td {
  border: 0;
  padding: 0;
  background: none;
  text-align: center;
}

.calendar .cal-week th {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--ink-4);
  padding-bottom: 8px;
}
.calendar .cal-week th:nth-child(6),
.calendar .cal-week th:nth-child(7) { color: var(--accent-2); }

.calendar td { height: 38px; vertical-align: middle; }
.calendar td > * {
  position: relative;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin: 0 auto;
  font-size: 12.5px;
  line-height: 1;
  color: var(--ink-3);
  border-radius: 9px;
  font-variant-numeric: tabular-nums;
  transition: color 0.18s var(--ease), background-color 0.18s var(--ease),
    box-shadow 0.18s var(--ease), transform 0.18s var(--ease);
}
.calendar td > span { color: var(--ink-4); opacity: 0.72; }

/* ---- 有文章的日子 ---- */
.calendar td.has-post > a {
  color: var(--accent);
  font-weight: 700;
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 14%, transparent);
  padding-bottom: 4px;
}
.calendar td.has-post > a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 3px;
  height: 3px;
  margin-left: -1.5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.55;
}
.calendar td.has-post > a:hover {
  color: #fff;
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  box-shadow: 0 4px 12px -4px color-mix(in srgb, var(--accent) 60%, transparent);
  transform: translateY(-1px);
}
html[data-theme="dark"] .calendar td.has-post > a:hover { color: #0B0F14; }

/* ---- 今天 ---- */
.calendar td.is-today > * {
  color: var(--accent);
  font-weight: 700;
  box-shadow: inset 0 0 0 1.5px var(--accent);
}
.calendar td.is-today.has-post > a {
  box-shadow: inset 0 0 0 1.5px var(--accent);
}

/* ---- 回到今天 ---- */
.cal-today {
  display: block;
  width: 100%;
  height: 28px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--ink-3);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  transition: color 0.18s var(--ease), background-color 0.18s var(--ease),
    border-color 0.18s var(--ease);
}
.cal-today:hover {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 34%, var(--line));
}
.cal-today[hidden] { display: none; }

/* ==========================================================================
   22. 留言锚点
   --------------------------------------------------------------------------
   侧栏「最新留言」的头像与用户名指向 文章地址#cmt{ID}。
   这里给目标评论一个明确的落点反馈，否则跳过去会「不知道自己落在哪」。
   ========================================================================== */

/* 评论项做成同一种块，:target 时不用改 padding，所以不会跳动 */
.comment {
  padding: 14px 16px;
  border-bottom: 0;
  border-radius: var(--r-md);
  scroll-margin-top: 96px;
  transition: background-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.comment:hover { background: var(--surface-2); }
.comment:target {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent);
}
.comment:target > .avatar-sm {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.comment-children { margin-top: 12px; }
.comment-children .comment { padding: 12px 14px; }

/* 侧栏留言：头像和用户名都是链接 */
.comm-item .avatar-sm {
  overflow: hidden;
  text-decoration: none;
  transition: box-shadow 0.2s var(--ease);
}
.comm-item .avatar-sm img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.comm-item .avatar-sm:hover { box-shadow: 0 0 0 3px var(--accent-mist); }
.comm-item .who a {
  color: inherit;
  border-bottom: 1px solid transparent;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.comm-item .who a:hover {
  color: var(--accent);
  border-bottom-color: color-mix(in srgb, var(--accent) 42%, transparent);
}

/* 后台拖过来的原生模块里可能有表格，兜一下，别让它撑破侧栏 */
.widget-body table:not(.calendar) { width: 100%; border-collapse: collapse; font-size: 13px; }
.widget-body table:not(.calendar) th, .widget-body table:not(.calendar) td { padding: 5px 6px; border: 0; text-align: center; }


/* ==========================================================================
   23. 文章页主栏的纵向节奏
   --------------------------------------------------------------------------
   .widget 自身没有外边距。在文章页里它夹在「上一篇/下一篇」和评论区中间，
   如果只给 .post-nav 上边距，它下边就会跟相关文章贴在一起。
   这里把 article 的直接子块统一成一个节奏。
   ========================================================================== */
article > .article-head { margin-top: 0; }
article > .widget,
article > .post-nav,
article > .license,
article > .comments { margin-top: 40px; }
