/* =====================================================================
   FredLiu · 个人站点样式
   排版参考 boxmoe.com（Lolimeow 主题）：深藏青底 / 紫色主色 / 卡片列表
   ===================================================================== */

/* ---------- 0. 设计令牌 ---------- */
:root {
  /* 品牌色（参考站取色） */
  --purple: #f43f5e;
  --purple-2: #fb7185;
  --cyan: #f59e0b;
  --red: #db1436;
  --amber: #ffc107;
  --green: #00c853;

  /* 浅色主题 */
  --bg: #f4f5fa;
  --bg-soft: #eaecf6;
  --card: #ffffff;
  --card-2: #fbfbfe;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --border: rgba(15, 23, 42, .09);
  --border-2: rgba(15, 23, 42, .05);
  --primary: #f43f5e;
  --primary-soft: rgba(244, 63, 94, .1);
  --hover: rgba(15, 23, 42, .04);

  --grad: linear-gradient(120deg, #f43f5e 0%, #fb7185 45%, #f59e0b 100%);
  --grad-2: linear-gradient(120deg, #f43f5e 0%, #8b5cf6 100%);
  --grad-text: linear-gradient(120deg, #f43f5e 5%, #f59e0b 95%);

  --shadow: 0 20px 44px -20px rgba(15, 23, 42, .28);
  --shadow-soft: 0 10px 30px -18px rgba(15, 23, 42, .22);
  --code-bg: #0f172a;
  --code-text: #e2e8f0;

  --radius: 18px;
  --radius-sm: 12px;
  --header-h: 66px;
  --maxw: 1220px;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: "JetBrains Mono", "Fira Code", "Cascadia Code", ui-monospace, SFMono-Regular,
    Consolas, "Liberation Mono", Menlo, monospace;

  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #020617;
  --bg-soft: #0b1020;
  --card: #0f172a;
  --card-2: #131c31;
  --text: #e2e8f0;
  --text-2: #cbd5e1;
  --muted: #8b98b0;
  --border: rgba(244, 63, 94, .16);
  --border-2: rgba(148, 163, 184, .12);
  --primary: #fb7185;
  --primary-soft: rgba(244, 63, 94, .18);
  --hover: rgba(148, 163, 184, .07);
  --grad-text: linear-gradient(120deg, #fb7185 5%, #f59e0b 95%);

  --shadow: 0 20px 44px -20px rgba(0, 0, 0, .75);
  --shadow-soft: 0 10px 30px -18px rgba(0, 0, 0, .6);
  --code-bg: #05080f;
  --code-text: #dbe4f0;

  color-scheme: dark;
}

/* ---------- 1. 基础重置 ---------- */
*, *::before, *::after { box-sizing: border-box; }

* { -webkit-tap-highlight-color: transparent; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  transition: background-color .35s ease, color .35s ease;
}

body::before {
  /* 全局氛围背景 */
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(640px 420px at 8% -6%, var(--primary-soft), transparent 68%),
    radial-gradient(560px 380px at 96% 4%, rgba(245, 158, 11, .12), transparent 66%);
}

img { max-width: 100%; display: block; }

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

button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }

ul, ol { margin: 0; padding: 0; list-style: none; }

h1, h2, h3, h4, h5 { line-height: 1.35; margin: 0; font-weight: 700; }

p { margin: 0; }

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

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--purple), var(--cyan));
  border-radius: 20px;
  border: 2px solid var(--bg);
}

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

/* ---------- 2. 布局工具 ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

.row { display: flex; gap: 32px; }
.main-col { flex: 1 1 0; min-width: 0; }
.side-col { flex: 0 0 322px; display: flex; flex-direction: column; gap: 22px; }

.d-flex { display: flex; }
.d-none { display: none !important; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }

.text-gradient {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.dot { color: var(--muted); opacity: .55; padding: 0 2px; flex: none; }

.hr-grad {
  border: 0;
  height: 1px;
  margin: 0;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

/* 渐变描边卡片（对应原站 .blog-border） */
.blog-border {
  border: 1px solid transparent;
  background:
    linear-gradient(var(--card), var(--card)) padding-box,
    linear-gradient(130deg, rgba(244, 63, 94, .42), rgba(245, 158, 11, .3) 46%, rgba(139, 92, 246, .3)) border-box;
}

.blog-border:hover {
  background:
    linear-gradient(var(--card), var(--card)) padding-box,
    linear-gradient(130deg, rgba(244, 63, 94, .85), rgba(245, 158, 11, .7) 46%, rgba(139, 92, 246, .6)) border-box;
}

/* ---------- 3. 图标 ---------- */
.icon {
  width: 1em;
  height: 1em;
  flex: none;
  stroke-width: 2;
  vertical-align: -0.16em;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 17px;
  border: 1px solid transparent;
  transition: .25s ease;
}
.icon-btn:hover {
  color: #fff;
  background: var(--grad);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -8px var(--purple);
}

/* ---------- 4. 顶部导航 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 76%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--border-2);
  transition: box-shadow .3s ease, border-color .3s ease;
}
.site-header.is-scrolled {
  box-shadow: 0 12px 32px -20px rgba(15, 23, 42, .5);
  border-bottom-color: var(--border);
}

.navbar {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 22px;
}

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

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--grad);
  color: #fff;
  font-weight: 800;
  font-size: 19px;
  box-shadow: 0 8px 20px -8px var(--purple);
  position: relative;
  overflow: hidden;
}
.brand-logo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255, 255, 255, .35), transparent 55%);
}

.brand > span:not(.brand-logo) {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.brand-name { font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
.brand-name em { font-style: normal; font-weight: 500; }
.brand-sub {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .04em;
  line-height: 1.3;
  margin-top: -1px;
}

/* 主导航 */
.nav-menu { display: flex; align-items: center; gap: 4px; }

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  font-size: 15px;
  color: var(--text-2);
  border-radius: 10px;
  font-weight: 500;
  transition: color .22s ease, background .22s ease;
}
.nav-link .icon { font-size: 15px; opacity: .8; }
.nav-link:hover { color: var(--text); background: var(--hover); }
.nav-link.is-active { color: var(--purple); }
.nav-link.is-active::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--grad);
}

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

/* 导航内搜索框 */
.search-box { position: relative; display: flex; align-items: center; }
.search-box .search-input {
  width: 44px;
  height: 38px;
  padding: 0 36px 0 13px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--card-2);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: width .32s cubic-bezier(.4, 0, .2, 1), border-color .22s, box-shadow .22s;
}
.search-box .search-input::placeholder { color: var(--muted); }
.search-box .search-input:focus {
  width: 200px;
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.search-box .search-input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search-box .search-go {
  position: absolute;
  right: 5px;
  width: 29px;
  height: 29px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 14px;
  pointer-events: none;
  transition: color .2s;
}
.search-box .search-input:focus ~ .search-go { color: var(--purple); }

/* 主题切换 */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 132px;
  padding: 6px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(.98);
  transform-origin: top right;
  transition: .22s ease;
  z-index: 120;
}
.dropdown.is-open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 11px;
  border-radius: 9px;
  font-size: 14px;
  color: var(--text-2);
  text-align: left;
  transition: .18s;
}
.dropdown-item .icon { font-size: 15px; }
.dropdown-item:hover { background: var(--hover); color: var(--text); }
.dropdown-item.is-active { background: var(--primary-soft); color: var(--purple); }

/* 汉堡按钮 */
.nav-toggler { display: none; }

/* ---------- 5. 移动端抽屉 ---------- */
.offcanvas {
  position: fixed;
  inset: 0 auto 0 -320px;
  width: 288px;
  max-width: 84vw;
  z-index: 200;
  background: var(--card);
  border-right: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  transition: transform .36s cubic-bezier(.4, 0, .2, 1);
}
.offcanvas.is-open { transform: translateX(320px); }
.offcanvas-head { display: flex; align-items: center; justify-content: space-between; }
.offcanvas-body { display: flex; flex-direction: column; gap: 4px; }
.offcanvas .nav-link { padding: 12px 14px; font-size: 16px; }
.offcanvas-mask {
  position: fixed;
  inset: 0;
  z-index: 190;
  background: rgba(2, 6, 23, .55);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: .3s;
}
.offcanvas-mask.is-open { opacity: 1; visibility: visible; }

/* ---------- 6. 首页 Banner ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 72px 0 0;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(58% 62% at 14% 12%, rgba(244, 63, 94, .3), transparent 62%),
    radial-gradient(50% 55% at 88% 6%, rgba(245, 158, 11, .24), transparent 62%),
    radial-gradient(46% 50% at 68% 88%, rgba(139, 92, 246, .16), transparent 64%);
}
.hero-grid {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--border-2) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-2) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .55), transparent 78%);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .55), transparent 78%);
}
.hero-inner {
  position: relative;
  max-width: 780px;
  padding-bottom: 40px;
}
.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--purple);
  background: var(--primary-soft);
  border: 1px solid var(--border);
  margin-bottom: 20px;
}
.hero-kicker .pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(0, 200, 83, .6);
  animation: pulse 2.2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(0, 200, 83, .55); }
  70% { box-shadow: 0 0 0 9px rgba(0, 200, 83, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 200, 83, 0); }
}
.hero-title {
  font-size: clamp(2.1rem, 5.4vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -.028em;
  line-height: 1.16;
  margin-bottom: 18px;
}
.hero-title .text-gradient { position: relative; }
.hero-title .spark { color: var(--amber); display: inline-block; animation: spin 8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.hero-desc {
  font-size: 17px;
  color: var(--muted);
  max-width: 600px;
  margin-bottom: 28px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 22px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  transition: .25s ease;
}
.btn .icon { font-size: 16px; }
.btn-primary {
  color: #fff;
  background: var(--grad);
  background-size: 150% 100%;
  box-shadow: 0 12px 26px -12px var(--purple);
}
.btn-primary:hover {
  transform: translateY(-2px);
  background-position: 90% 0;
  box-shadow: 0 18px 32px -14px var(--purple);
}
.btn-ghost {
  color: var(--text-2);
  background: var(--card);
  border: 1px solid var(--border);
}
.btn-ghost:hover { transform: translateY(-2px); border-color: var(--purple); color: var(--purple); }

/* 波浪分隔 */
.hero-waves { display: block; width: 100%; height: 62px; margin-bottom: -1px; }
.hero-waves svg { width: 100%; height: 100%; display: block; }
.hero-waves .w1 { fill: var(--primary); opacity: .1; }
.hero-waves .w2 { fill: var(--cyan); opacity: .09; }
.hero-waves .w3 { fill: var(--bg); }

/* ---------- 7. 面包屑 / 分节标题 ---------- */
.section { padding: 34px 0 60px; }

.breadcrumb-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-2);
}
.breadcrumb-head .bc-title { font-size: 15px; font-weight: 700; }
.breadcrumb-head .bc-sub { font-size: 13px; color: var(--muted); }

.sec-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.sec-title { display: flex; align-items: center; gap: 12px; font-size: 21px; font-weight: 800; }
.sec-title .bar {
  width: 5px;
  height: 22px;
  border-radius: 3px;
  background: var(--grad);
}

/* 分类过滤条 */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 24px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--border);
  transition: .22s;
}
.chip:hover { color: var(--purple); border-color: var(--purple); transform: translateY(-1px); }
.chip.is-active {
  color: #fff;
  background: var(--grad);
  border-color: transparent;
  box-shadow: 0 8px 18px -10px var(--purple);
}
.chip .count {
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--hover);
  font-weight: 700;
}
.chip.is-active .count { background: rgba(255, 255, 255, .24); color: #fff; }

/* ---------- 8. 文章卡片 ---------- */
.post-list {
  display: grid;
  grid-template-columns: 296px 1fr;
  gap: 26px;
  align-items: stretch;
  padding: 18px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  transition: transform .3s cubic-bezier(.4, 0, .2, 1), box-shadow .3s ease;
}
.post-list:hover { transform: translateY(-4px); box-shadow: var(--shadow-soft); }

.post-list-img { min-width: 0; }
.zoom-img {
  margin: 0;
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--bg-soft);
}
.zoom-img .cover {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  transition: transform .55s cubic-bezier(.4, 0, .2, 1);
}
.zoom-img .cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 24% 30%, rgba(255, 255, 255, .22), transparent 44%),
    linear-gradient(135deg, rgba(255, 255, 255, .1), transparent 52%);
}
.zoom-img .cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .11) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .11) 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: .55;
}
.post-list:hover .zoom-img .cover { transform: scale(1.06); }
.cover-emoji {
  font-size: 54px;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, .3));
  transition: transform .5s ease;
}
.post-list:hover .cover-emoji { transform: scale(1.12) rotate(-4deg); }
.cover-grad-text {
  position: absolute;
  left: 12px;
  bottom: 8px;
  z-index: 1;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  color: rgba(255, 255, 255, .82);
  text-shadow: 0 1px 6px rgba(0, 0, 0, .4);
}

.badge-pin {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(120deg, var(--red), #ff6b81);
  box-shadow: 0 6px 14px -6px var(--red);
}

.post-list-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.post-tags { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 9px; }
.tagfa {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 7px;
  color: var(--purple);
  background: var(--primary-soft);
  transition: .2s;
}
.tagfa::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.tagfa:hover { background: var(--purple); color: #fff; transform: translateY(-1px); }

.post-title {
  font-size: 19.5px;
  font-weight: 700;
  line-height: 1.42;
  margin-bottom: 10px;
  transition: color .22s;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-list:hover .post-title { color: var(--purple); }

.post-content {
  font-size: 14.5px;
  color: var(--muted);
  line-height: 1.78;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 13px;
  border-top: 1px solid var(--border-2);
  font-size: 13px;
  color: var(--muted);
}
.post-meta .meta-item { display: inline-flex; align-items: center; gap: 5px; }
.post-meta .meta-item .icon { font-size: 14px; }
.post-author { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); font-weight: 600; }
.post-author .avatar {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  background: var(--grad);
}
.meta-spacer { flex: 1; }

/* 列表视图（紧凑） */
.view-toggle { display: flex; gap: 4px; padding: 4px; border-radius: 11px; background: var(--card); border: 1px solid var(--border); }
.view-toggle button {
  width: 32px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 15px;
  transition: .2s;
}
.view-toggle button.is-active { background: var(--primary-soft); color: var(--purple); }

/* ---------- 9. 侧边栏 ---------- */
.widget {
  padding: 20px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--border);
  transition: border-color .25s, box-shadow .25s;
}
.widget:hover { box-shadow: var(--shadow-soft); }

.widget-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
}
.widget-title .w-ico {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 14px;
  color: #fff;
  background: var(--grad);
}
.widget-title .w-line { flex: 1; height: 1px; background: var(--border-2); }

/* 侧边搜索 */
.search-wrap { position: relative; display: flex; gap: 8px; }
.search-wrap .search-input {
  flex: 1;
  height: 42px;
  padding: 0 14px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: .22s;
}
.search-wrap .search-input:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.search-submit {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 16px;
  background: var(--grad);
  flex: none;
  transition: .22s;
}
.search-submit:hover { transform: translateY(-2px); box-shadow: 0 10px 20px -10px var(--purple); }

/* 分类列表 */
.cat-list { display: flex; flex-direction: column; gap: 4px; }
.cat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 10px;
  font-size: 14px;
  color: var(--text-2);
  transition: .2s;
}
.cat-item:hover { background: var(--hover); color: var(--purple); transform: translateX(3px); }
.cat-item.is-active { background: var(--primary-soft); color: var(--purple); font-weight: 600; }
.cat-item .cat-ico { font-size: 15px; opacity: .75; }
.cat-item .cat-name { flex: 1; }
.cat-item .cat-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--hover);
}
.cat-item.is-active .cat-count { background: var(--purple); color: #fff; }

/* 标签云 */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-cloud a {
  padding: 4px 11px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--muted);
  background: var(--hover);
  border: 1px solid var(--border-2);
  transition: .2s;
}
.tag-cloud a:hover {
  color: #fff;
  background: var(--grad);
  border-color: transparent;
  transform: translateY(-2px);
}

/* 随机阅读 */
.widget-post {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border-2);
  transition: .2s;
}
.widget-post:last-child { border-bottom: 0; padding-bottom: 2px; }
.widget-post:first-child { padding-top: 0; }
.widget-post:hover { transform: translateX(3px); }
.widget-post .thumb {
  width: 74px;
  height: 52px;
  border-radius: 10px;
  flex: none;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  position: relative;
  box-shadow: 0 6px 14px -8px rgba(0, 0, 0, .5);
}
.widget-post .right { min-width: 0; }
.widget-post .title {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 5px;
  transition: color .2s;
}
.widget-post:hover .title { color: var(--purple); }
.widget-post time { font-size: 12px; color: var(--muted); font-family: var(--mono); }

/* 关于卡 */
.about-card { text-align: center; }
.about-card .avatar-big {
  width: 78px;
  height: 78px;
  border-radius: 22px;
  margin: 2px auto 14px;
  display: grid;
  place-items: center;
  font-size: 34px;
  font-weight: 800;
  color: #fff;
  background: var(--grad);
  box-shadow: 0 14px 30px -14px var(--purple);
}
.about-card .about-name { font-size: 17px; font-weight: 800; margin-bottom: 3px; }
.about-card .about-bio { font-size: 13.5px; color: var(--muted); line-height: 1.7; margin-bottom: 14px; }
.social-row { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }

/* ---------- 10. 分页 ---------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 34px;
  flex-wrap: wrap;
}
.page-btn {
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--card);
  border: 1px solid var(--border);
  transition: .22s;
}
.page-btn:hover:not(:disabled) { border-color: var(--purple); color: var(--purple); transform: translateY(-2px); }
.page-btn.is-active { color: #fff; background: var(--grad); border-color: transparent; box-shadow: 0 8px 18px -10px var(--purple); }
.page-btn:disabled { opacity: .42; cursor: not-allowed; }
.page-ellipsis { color: var(--muted); padding: 0 4px; }

/* ---------- 11. 文章详情 ---------- */
.article-card {
  padding: clamp(22px, 4vw, 44px);
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.article-head { margin-bottom: 26px; padding-bottom: 24px; border-bottom: 1px solid var(--border-2); }
.article-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.article-title {
  font-size: clamp(1.6rem, 3.6vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.3;
  margin-bottom: 18px;
}
.article-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); }
.article-meta .meta-item { display: inline-flex; align-items: center; gap: 6px; }

/* 引言 */
.preface {
  position: relative;
  margin: 0 0 30px;
  padding: 18px 22px 18px 26px;
  border-radius: 14px;
  background:
    linear-gradient(120deg, var(--primary-soft), transparent 72%),
    var(--card-2);
  border: 1px solid var(--border);
  font-size: 15.5px;
  color: var(--text-2);
  line-height: 1.9;
}
.preface::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 3px;
  background: var(--grad);
}
.preface .pf-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--purple);
  margin-bottom: 8px;
  font-family: var(--mono);
}

/* 正文排版 */
.article-body { font-size: 16.5px; line-height: 1.95; color: var(--text); }
.article-body > * + * { margin-top: 1.05em; }
.article-body h2 {
  font-size: 1.42em;
  font-weight: 700;
  letter-spacing: -.015em;
  margin-top: 1.9em !important;
  padding-left: 14px;
  border-left: 4px solid transparent;
  border-image: linear-gradient(var(--purple), var(--cyan)) 1;
  scroll-margin-top: calc(var(--header-h) + 24px);
}
.article-body h3 { font-size: 1.18em; font-weight: 700; margin-top: 1.7em !important; scroll-margin-top: calc(var(--header-h) + 24px); }
.article-body h4 { font-size: 1.02em; font-weight: 700; margin-top: 1.5em !important; scroll-margin-top: calc(var(--header-h) + 24px); }
.article-body h2, .article-body h3, .article-body h4 { position: relative; }
.article-body a {
  color: var(--purple);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--primary-soft);
  text-underline-offset: 3px;
  transition: .2s;
}
.article-body a:hover { text-decoration-color: var(--purple); }
.article-body strong { font-weight: 700; color: var(--text); }
.article-body code {
  font-family: var(--mono);
  font-size: .86em;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--purple);
}
.article-body blockquote {
  position: relative;
  margin: 1.4em 0;
  padding: 14px 18px;
  border-left: 3px solid var(--purple);
  border-radius: 0 12px 12px 0;
  background: var(--hover);
  color: var(--text-2);
}
.article-body blockquote p + p { margin-top: .6em; }
.article-body ul, .article-body ol { padding-left: 1.5em; }
.article-body ul { list-style: disc; }
.article-body ol { list-style: decimal; }
.article-body li { margin: .34em 0; }
.article-body li::marker { color: var(--purple); font-weight: 700; }
.article-body hr {
  border: 0;
  height: 1px;
  margin: 2em 0;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}
.article-body img {
  border-radius: 14px;
  margin: 1.4em 0;
  box-shadow: var(--shadow-soft);
}
.article-body figure { margin: 1.4em 0; text-align: center; }
.article-body figcaption { font-size: .82em; color: var(--muted); margin-top: 8px; }
.article-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: .92em;
  margin: 1.4em 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}
.article-body th, .article-body td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border-2); }
.article-body th { background: var(--bg-soft); font-weight: 700; font-size: .95em; }
.article-body tr:last-child td { border-bottom: 0; }
.article-body .task-list { list-style: none; padding-left: .2em !important; }
.article-body .task-list li { display: flex; align-items: flex-start; gap: 9px; }
.article-body .task-item { list-style: none; }
.article-body .task-item input[type="checkbox"] {
  width: 15px;
  height: 15px;
  margin: .22em 0 0;
  flex: 0 0 auto;
  accent-color: var(--purple);
  cursor: default;
}
.article-body .task-item input[type="checkbox"]:checked + *,
.article-body .task-item input:checked { accent-color: var(--cyan); }

/* 代码块 */
.code-block {
  position: relative;
  margin: 1.5em 0;
  border-radius: 14px;
  overflow: hidden;
  background: var(--code-bg);
  border: 1px solid var(--border-2);
  box-shadow: var(--shadow-soft);
}
.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 14px;
  background: rgba(255, 255, 255, .05);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.code-lang {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  color: #94a3b8;
  letter-spacing: .04em;
}
.code-lang::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--grad);
}
.code-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 7px;
  font-size: 12px;
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, .12);
  transition: .2s;
}
.code-copy:hover { color: #fff; background: rgba(255, 255, 255, .1); }
.code-copy.is-done { color: var(--green); border-color: rgba(0, 200, 83, .4); }
.code-block pre {
  margin: 0;
  padding: 16px 18px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--code-text);
}
.code-block pre::-webkit-scrollbar { height: 8px; }
.code-block pre::-webkit-scrollbar-thumb { background: #334155; border-radius: 8px; }

/* 正文标签 + 导航 */
.article-foot { margin-top: 34px; padding-top: 24px; border-top: 1px solid var(--border-2); }
.article-tags-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.article-tags-row .lab { font-size: 13px; color: var(--muted); font-weight: 600; }

.pn-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pn-card {
  padding: 15px 17px;
  border-radius: 14px;
  background: var(--card-2);
  border: 1px solid var(--border);
  transition: .25s;
  display: block;
}
.pn-card:hover { transform: translateY(-3px); border-color: var(--purple); box-shadow: var(--shadow-soft); }
.pn-card .pn-lab { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.pn-card .pn-title { font-size: 14.5px; font-weight: 600; line-height: 1.5; transition: color .2s; }
.pn-card:hover .pn-title { color: var(--purple); }
.pn-card.next { text-align: right; }
.pn-card .pn-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- 12. 目录 ---------- */
.toc {
  position: sticky;
  top: calc(var(--header-h) + 20px);
  padding: 18px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--border);
}
.toc-col { flex: 0 0 216px; }
.toc-title { font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 12px; letter-spacing: .06em; display: flex; align-items: center; gap: 8px; }

/* 目录条目多时列表自身滚动。
   这条很关键：一旦列表撑破视口，滚动条就会退回到页面上，
   JS 里为了「让当前条目可见」做的滚动就会变成滚动整篇文章。 */
.toc-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-left: 2px solid var(--border-2);
  margin-right: -8px;
  padding-right: 8px;
  max-height: calc(100vh - var(--header-h) - 190px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.toc-list::-webkit-scrollbar { width: 4px; }
.toc-list::-webkit-scrollbar-track { background: transparent; }
.toc-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.toc-list a {
  display: block;
  padding: 5px 12px;
  margin-left: -2px;
  border-left: 2px solid transparent;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.5;
  transition: .2s;
}
.toc-list a:hover { color: var(--text); }
.toc-list a.is-active { color: var(--purple); border-left-color: var(--purple); font-weight: 600; }
.toc-list .lv3 { padding-left: 26px; font-size: 12.5px; }

/* ---------- 13. 归档 ---------- */
.archive-group { margin-bottom: 34px; }
.archive-year {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 16px;
}
.archive-year .y-line { flex: 1; height: 1px; background: var(--border-2); }
.archive-year .y-count { font-size: 12px; font-weight: 700; color: var(--muted); padding: 2px 10px; border-radius: 999px; background: var(--hover); }

.archive-timeline { display: flex; flex-direction: column; gap: 2px; position: relative; padding-left: 26px; }
.archive-timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 12px;
  bottom: 12px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(var(--purple), var(--cyan));
  opacity: .5;
}
.archive-item {
  display: grid;
  grid-template-columns: 82px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: .22s;
  position: relative;
}
.archive-item::before {
  content: "";
  position: absolute;
  left: -24px;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--purple);
  transform: translateY(-50%);
  transition: .22s;
}
.archive-item:hover { background: var(--card); border-color: var(--border); box-shadow: var(--shadow-soft); }
.archive-item:hover::before { background: var(--purple); transform: translateY(-50%) scale(1.25); }
.archive-item .a-date { font-family: var(--mono); font-size: 13px; color: var(--muted); font-weight: 600; }
.archive-item .a-title { font-size: 15px; font-weight: 600; transition: color .2s; }
.archive-item:hover .a-title { color: var(--purple); }
.archive-item .a-cat { font-size: 12px; color: var(--muted); padding: 3px 10px; border-radius: 7px; background: var(--hover); }

/* ---------- 14. 关于页 ---------- */
.about-hero {
  padding: 56px 40px;
  border-radius: var(--radius);
  text-align: center;
  position: relative;
  overflow: hidden;
  margin-bottom: 26px;
}
.about-hero .avatar-hero {
  width: 116px;
  height: 116px;
  border-radius: 34px;
  margin: 0 auto 20px;
  display: grid;
  place-items: center;
  font-size: 52px;
  font-weight: 800;
  color: #fff;
  background: var(--grad);
  box-shadow: 0 22px 44px -18px var(--purple);
  position: relative;
  z-index: 1;
}
.about-hero .avatar-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(120deg, rgba(255,255,255,.35), transparent 58%);
}
.about-hero h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); font-weight: 800; margin-bottom: 10px; position: relative; z-index: 1; }
.about-hero p { color: var(--muted); max-width: 560px; margin: 0 auto; position: relative; z-index: 1; }
.about-hero .hero-bg { opacity: .5; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 26px; }
.stat-card {
  padding: 20px;
  border-radius: var(--radius);
  text-align: center;
  background: var(--card);
  border: 1px solid var(--border);
  transition: .28s;
}
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-soft); }
.stat-card .s-ico {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  font-size: 20px;
  color: #fff;
  background: var(--grad);
}
.stat-card .s-num { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.stat-card .s-lab { font-size: 13px; color: var(--muted); margin-top: 2px; }

.info-list { display: flex; flex-direction: column; gap: 4px; }
.info-row {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  align-items: flex-start;
  transition: .2s;
}
.info-row:hover { background: var(--hover); }
.info-row .i-ico {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 15px;
  color: var(--purple);
  background: var(--primary-soft);
}
.info-row .i-body { min-width: 0; }
.info-row .i-lab { font-size: 12px; color: var(--muted); margin-bottom: 1px; }
.info-row .i-val { font-size: 14.5px; font-weight: 600; }

.skill-row { margin-bottom: 16px; }
.skill-row .s-head { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 7px; }
.skill-row .s-name { font-weight: 600; }
.skill-row .s-pct { color: var(--muted); font-family: var(--mono); font-size: 12.5px; }
.skill-bar { height: 8px; border-radius: 6px; background: var(--hover); overflow: hidden; }
.skill-bar i {
  display: block;
  height: 100%;
  border-radius: 6px;
  background: var(--grad);
  width: 0;
  transition: width 1.1s cubic-bezier(.25, 1, .3, 1);
}

/* 时间线（经历） */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(var(--purple), var(--cyan));
  opacity: .5;
}
.timeline-item { position: relative; padding-bottom: 24px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -27px;
  top: 7px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--card);
  border: 2.5px solid var(--purple);
}
.timeline-item .t-date { font-size: 12.5px; font-family: var(--mono); color: var(--purple); font-weight: 700; }
.timeline-item .t-title { font-size: 15.5px; font-weight: 700; margin: 3px 0 5px; }
.timeline-item .t-desc { font-size: 14px; color: var(--muted); line-height: 1.75; }

/* ---------- 15. 搜索页 ---------- */
.search-hero {
  padding: 46px 0 30px;
  text-align: center;
}
.search-hero h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); font-weight: 800; margin-bottom: 24px; }
.big-search {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 660px;
  margin: 0 auto 20px;
  padding: 7px 7px 7px 22px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  transition: .25s;
}
.big-search:focus-within { border-color: var(--purple); box-shadow: 0 0 0 4px var(--primary-soft), var(--shadow-soft); }
.big-search .bs-ico { color: var(--muted); font-size: 20px; flex: none; }
.big-search input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 17px;
  font-family: inherit;
  color: var(--text);
  padding: 12px 0;
}
.big-search input::placeholder { color: var(--muted); }
.big-search .bs-btn {
  padding: 12px 26px;
  border-radius: 11px;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  background: var(--grad);
  transition: .22s;
}
.big-search .bs-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -10px var(--purple); }

.hot-search { display: flex; flex-wrap: wrap; gap: 9px; justify-content: center; }
.hot-search .hs-lab { color: var(--muted); font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }

.result-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  margin-bottom: 18px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--muted);
}
.result-meta b { color: var(--purple); }

.search-item {
  padding: 18px 20px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  margin-bottom: 14px;
  transition: .25s;
}
.search-item:hover { transform: translateX(4px); border-color: var(--purple); box-shadow: var(--shadow-soft); }
.search-item .si-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.search-item .si-title { font-size: 17px; font-weight: 700; margin-bottom: 8px; transition: color .2s; }
.search-item:hover .si-title { color: var(--purple); }
.search-item .si-snippet { font-size: 14px; color: var(--muted); line-height: 1.8; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.search-item .si-foot { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.search-item mark { background: rgba(255, 193, 7, .32); color: inherit; padding: 0 2px; border-radius: 3px; font-weight: 700; }
.search-item .si-title mark { background: rgba(255, 193, 7, .4); }

/* ---------- 16. 空状态 / 加载 ---------- */
.empty {
  padding: 66px 24px;
  text-align: center;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px dashed var(--border);
}
.empty .e-ico {
  width: 76px;
  height: 76px;
  margin: 0 auto 18px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  font-size: 32px;
  color: var(--purple);
  background: var(--primary-soft);
}
.empty h3 { font-size: 18px; margin-bottom: 8px; }
.empty p { color: var(--muted); font-size: 14.5px; max-width: 420px; margin: 0 auto 18px; }

/* 离线提示里那行启动命令。$ 前缀用 ::before 出，免得再多一个类名 */
.cmd-line {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 20px;
  padding: 10px 16px;
  border-radius: 10px;
  background: #0f172a;
  color: #e2e8f0;
  border: 1px solid var(--border);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Courier New', monospace;
  font-size: 13px;
  text-align: left;
}
.cmd-line::before { content: '$ '; opacity: .5; }

.loading { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 60px; color: var(--muted); font-size: 14px; }
.loading .ldots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--purple);
  animation: bounce 1.2s infinite;
}
.loading .ldots span:nth-child(2) { animation-delay: .15s; }
.loading .ldots span:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(.6); opacity: .45; } 40% { transform: scale(1); opacity: 1; } }

/* ---------- 17. 页脚 ---------- */
.site-footer {
  margin-top: 30px;
  border-top: 1px solid var(--border-2);
  background: var(--bg-soft);
  position: relative;
}
.site-footer::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--grad);
  opacity: .75;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 30px;
  padding: 34px 0 24px;
}
.footer-col h5 {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 15px;
  letter-spacing: .03em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.footer-col h5::before {
  content: "";
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: var(--grad);
}
.footer-desc { font-size: 13.5px; color: var(--muted); line-height: 1.85; max-width: 340px; margin-bottom: 16px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.footer-links a {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  color: var(--muted);
  padding: 4px 0;
  transition: .2s;
}
.footer-links a .icon { font-size: 14px; opacity: .7; }
.footer-links a:hover { color: var(--purple); transform: translateX(4px); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 18px 0;
  border-top: 1px solid var(--border-2);
  font-size: 13px;
  color: var(--muted);
}
.footer-bottom .fb-left { display: flex; align-items: center; gap: 8px; }
.footer-bottom .heart { color: var(--red); animation: heartbeat 1.6s infinite; }
@keyframes heartbeat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.22); } }

/* ---------- 18. 返回顶部 ---------- */
.to-top {
  position: fixed;
  right: calc(26px + env(safe-area-inset-right, 0px));
  bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  z-index: 90;
  width: 46px;
  height: 46px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  font-size: 19px;
  color: #fff;
  background: var(--grad);
  box-shadow: 0 14px 28px -12px var(--purple);
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: .3s ease;
}
.to-top.is-show { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { transform: translateY(-4px); }

/* 阅读进度条 */
.read-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 110;
  height: 3px;
  width: 0;
  background: var(--grad);
  box-shadow: 0 0 10px var(--purple);
  transition: width .1s linear;
}

/* ---------- 19. 入场动画 ---------- */
.fade-up { opacity: 0; transform: translateY(18px); }
.fade-up.in { opacity: 1; transform: translateY(0); transition: opacity .6s ease, transform .6s cubic-bezier(.25, 1, .3, 1); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- 20. 响应式 ---------- */
@media (max-width: 1080px) {
  .side-col { flex-basis: 280px; }
}

/* 正文区变窄时先收起左侧目录，保证正文拿到完整阅读宽度 */
@media (max-width: 1040px) {
  .toc-col { display: none; }
}

@media (max-width: 960px) {
  .row { flex-direction: column; gap: 30px; }
  .side-col { flex: 1 1 auto; }
  .search-box .search-input { width: 170px; }
  .search-box .search-input:focus { width: 200px; }
}

@media (max-width: 860px) {
  .nav-menu { display: none; }
  .nav-toggler { display: grid; }
  .footer-inner { grid-template-columns: 1fr; gap: 24px; }
  .footer-bottom { justify-content: center; text-align: center; }

  /* 720-960 之间先收窄图列，避免 296px 图挤内容 */
  .post-list { grid-template-columns: 220px 1fr; gap: 18px; padding: 14px; }
  .zoom-img { aspect-ratio: 16 / 9; }
}

@media (max-width: 720px) {
  :root { --header-h: 60px; }
  .container { padding: 0 16px; }
  .brand-sub { display: none; }
  .post-list { grid-template-columns: 1fr; gap: 16px; padding: 14px; }
  .zoom-img { aspect-ratio: 16 / 8.4; }
  .cover-emoji { font-size: 42px; }
  .post-title { font-size: 18px; }
  .article-card { padding: 22px 18px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .about-hero { padding: 40px 22px; }
  .archive-item { grid-template-columns: 1fr; gap: 4px; padding: 12px 14px; }
  .archive-item .a-cat { justify-self: start; }
  .pn-nav { grid-template-columns: 1fr; }
  .hero { padding-top: 44px; }
  .hero-actions .btn { flex: 1; justify-content: center; }

  /* 触摸目标 ≥ 44px (Apple HIG) */
  .icon-btn { width: 44px; height: 44px; }
  .view-toggle button { height: 44px; min-width: 40px; }
  .cat-item { min-height: 44px; }

  /* 视觉收紧 */
  .section { padding: 22px 0 36px; }
  .stat-card .s-num { font-size: 22px; }
  .archive-year { font-size: 18px; }
  .sec-title { font-size: 19px; }
  .about-hero .avatar-hero {
    width: 92px; height: 92px;
    border-radius: 28px;
    font-size: 42px;
  }
}

@media (max-width: 480px) {
  .search-box { display: none; }
  .brand-name { font-size: 17px; }
}
