/* ob-blog v2 — 对齐 Trilium/Ankia 审美:主色 #5986D1,仪表盘首页,徽章文章卡,下拉分类 */
:root {
  --primary: #5986D1;
  --primary-dark: #3d6cb8;
  --grad: linear-gradient(135deg, #5986D1, #667eea);
  --grad-deep: linear-gradient(135deg, #5986D1, #764ba2);
  --bg: #f4f6fb;
  --card: #ffffff;
  --border: #e6e9f0;
  --text: #23272f;
  --text-secondary: #69707d;
  --text-tertiary: #9aa3b2;
  --shadow: 0 2px 12px rgba(60, 80, 130, 0.08);
  --shadow-hover: 0 10px 28px rgba(60, 80, 130, 0.16);
  --radius: 12px;
  --cat-color-0: #5986D1; --cat-color-1: #1D9E75; --cat-color-2: #D85A30;
  --cat-color-3: #7F77DD; --cat-color-4: #378ADD; --cat-color-5: #BA7517;
  --cat-color-6: #D4537E; --cat-color-7: #639922;
  --fab-size: 46px;
  --fab-right: 22px;
  --fab-bottom: 26px;
  --fab-gap: 20px;
  --chat-size: 56px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
::selection { background: rgba(89,134,209,0.22); color: inherit; }
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 200;
  background: var(--primary); color: #fff; padding: 0.4rem 0.9rem;
  border-radius: 8px; text-decoration: none; font-size: 0.85rem;
}
.skip-link:focus { top: 10px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
body {
  margin: 0;
  font-family: "LXGW WenKai Screen", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
}

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1080px; margin: 0 auto; padding: 0 1.5rem;
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: 1rem; height: 62px;
}
.logo {
  font-weight: 700; font-size: 1.12rem; color: var(--text);
  text-decoration: none; display: flex; align-items: center; gap: 9px; white-space: nowrap;
  justify-self: start;
}
.logo-mark {
  width: 28px; height: 28px; border-radius: 8px;
  display: block; flex-shrink: 0; object-fit: contain;
  background: #fff; box-shadow: 0 0 0 1px rgba(89,134,209,0.16);
}
.logo-dot {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--grad-deep); box-shadow: 0 0 10px rgba(89,134,209,0.55);
}
.nav { display: flex; gap: 0.15rem; align-items: center; justify-content: center; }
.nav > a, .nav-drop {
  padding: 0.38rem 0.7rem; border-radius: 9px;
  color: var(--text-secondary); text-decoration: none; font-size: 0.93rem; white-space: nowrap;
  transition: all 0.2s; cursor: pointer;
}
.nav > a:hover, .nav-drop:hover { color: var(--primary); background: rgba(89,134,209,0.08); }
.nav > a.active, .nav-drop.active { color: var(--primary); background: rgba(89,134,209,0.12); font-weight: 500; }
.nav-drop { position: relative; display: flex; align-items: center; gap: 4px; }
.nav-drop-label { display: flex; align-items: center; gap: 4px; }
/* hover 桥:覆盖触发器与面板间的空隙,防止移动鼠标时 :hover 断掉 */
.nav-drop::after {
  content: ""; position: absolute; top: 100%; left: -8px; right: -8px; height: 14px;
}
.drop-panel {
  position: absolute; top: calc(100% + 10px); left: 0; min-width: 200px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-hover); padding: 0.45rem; display: none; flex-direction: column;
}
.nav-drop:hover .drop-panel { display: flex; }
.drop-panel::before {
  content: ""; position: absolute; top: -6px; left: 24px; width: 10px; height: 10px;
  background: var(--card); border-left: 1px solid var(--border); border-top: 1px solid var(--border);
  transform: rotate(45deg);
}
.drop-panel a {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 0.45rem 0.8rem; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 0.9rem;
}
.drop-panel a:hover { background: rgba(89,134,209,0.08); color: var(--primary); }
.drop-panel em { font-style: normal; font-size: 0.78rem; color: var(--text-secondary); }
.drop-panel a:hover em { color: var(--primary); }

.search-box { position: relative; justify-self: end; }
.search-box input {
  width: 170px; padding: 0.42rem 0.95rem; border: 1px solid var(--border);
  border-radius: 18px; font-size: 0.88rem; outline: none; background: var(--bg);
  transition: all 0.25s; font-family: inherit;
}
.search-box input:focus { width: 230px; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(89,134,209,0.14); background: var(--card); }
/* ---------- 搜索下拉 ---------- */
.search-drop {
  position: absolute; top: calc(100% + 8px); right: 0; width: 340px;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14); overflow: hidden;
  animation: sd-in 0.15s ease;
}
@keyframes sd-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.sd-item {
  display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0.9rem;
  color: var(--text); text-decoration: none; font-size: 0.88rem; transition: background 0.12s;
}
.sd-item:hover, .sd-item.sd-on { background: rgba(89,134,209,0.08); }
.sd-item.sd-on { box-shadow: inset 3px 0 0 var(--primary); }
.sd-title mark {
  background: rgba(250, 219, 132, 0.7); color: inherit; padding: 0 0.1em; border-radius: 2px;
}
.sd-loading { letter-spacing: 0.04em; }
.sd-ico { flex: none; font-size: 0.85rem; opacity: 0.75; }
.sd-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sd-badge {
  flex: none; font-size: 0.7rem; color: var(--primary); background: rgba(89,134,209,0.1);
  padding: 0.08rem 0.5rem; border-radius: 9px;
}
.sd-empty { padding: 0.9rem 1rem; font-size: 0.85rem; color: var(--text-secondary); text-align: center; }
.sd-full {
  display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 0.9rem;
  color: var(--primary); text-decoration: none; font-size: 0.88rem; font-weight: 500;
  border-top: 1px solid var(--border); background: rgba(89,134,209,0.05);
}
.sd-full:hover, .sd-full.sd-on { background: rgba(89,134,209,0.12); }
.sd-enter { margin-left: auto; font-size: 0.7rem; color: var(--text-tertiary); font-weight: 400; }

/* ---------- layout ---------- */
.container { max-width: 1080px; margin: 0 auto; padding: 1.5rem; }
.section { margin: 2.2rem 0; }
.section-title { font-size: 1.28rem; font-weight: 700; margin: 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 1.1rem; }
.more-link { color: var(--text-secondary); text-decoration: none; font-size: 0.86rem; }
.more-link:hover { color: var(--primary); }

/* ---------- 首页仪表盘 ---------- */
.home-dash {
  display: flex; gap: 18px; margin: 0.6rem auto 2rem auto;
  max-width: 100%; height: 300px;
}
.dash-left { flex: 1; min-width: 0; }
.dash-right { width: 270px; display: flex; flex-direction: column; gap: 14px; }

.mySwiper {
  width: 100%; height: 100%;
  border-radius: 14px; box-shadow: var(--shadow-hover);
}
.swiper-slide { position: relative; overflow: hidden; display: block; text-decoration: none; color: inherit; }
.slide-cover {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.swiper-slide.has-cover .slide-info {
  background: linear-gradient(to top, rgba(10, 20, 45, 0.88), rgba(10, 20, 45, 0.18) 62%, transparent);
}
.slide-deco {
  position: absolute; inset: 0; opacity: 0.16;
  background-image: radial-gradient(circle at 18% 25%, #fff 0, transparent 38%),
                    radial-gradient(circle at 82% 75%, #fff 0, transparent 42%);
}
.slide-info {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 1.4rem 1.6rem;
  background: linear-gradient(to top, rgba(10, 20, 45, 0.72), transparent);
  color: #fff;
}
.slide-cat {
  display: inline-block; font-size: 0.75rem; padding: 0.1rem 0.6rem;
  background: rgba(255,255,255,0.22); border-radius: 10px; margin-bottom: 0.4rem;
  backdrop-filter: blur(4px);
}
.slide-info h2 { margin: 0 0 0.3rem; font-size: 1.25rem; font-weight: 700; line-height: 1.4; color: #fff; }
.slide-info p {
  margin: 0; font-size: 0.85rem; opacity: 0.92;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.swiper-pagination-bullet-active { background: #fff !important; }

.widget {
  background: var(--card); border-radius: 14px; border: 1px solid var(--border);
  box-shadow: var(--shadow); padding: 1rem 1.1rem; flex: 1;
  display: flex; flex-direction: column; justify-content: center;
  text-decoration: none; color: var(--text); transition: all 0.25s;
}
.widget:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.widget.welcome { flex-direction: row; align-items: center; gap: 12px; }
.w-avatar {
  width: 56px; height: 56px; border-radius: 50%; flex-shrink: 0;
  object-fit: cover; display: block;
  box-shadow: 0 0 0 1px rgba(89,134,209,0.18);
  background: #111;
}
.w-text { display: flex; flex-direction: column; min-width: 0; }
.w-text strong { font-size: 0.95rem; }
.w-text span {
  font-size: 0.78rem; color: var(--text-secondary);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.widget.stats { flex-direction: row; text-align: center; padding: 0.9rem 0.5rem; }
.widget.stats .stat { flex: 1; display: flex; flex-direction: column; }
.widget.stats strong { font-size: 1.3rem; color: var(--primary); }
.widget.stats span { font-size: 0.75rem; color: var(--text-secondary); }
.widget.sign { flex-direction: row; align-items: center; justify-content: center; padding: 0.55rem 0.4rem; }
.widget.sign:hover { transform: none; }
.sign-links { display: flex; align-items: center; justify-content: center; gap: 6px; }
.sign-link {
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); transition: color 0.18s, background 0.18s;
}
.sign-link svg { width: 20px; height: 20px; display: block; }
.sign-link:hover { color: var(--primary); background: rgba(89,134,209,0.1); }
.sign-links-foot { margin-top: 0.7rem; gap: 2px; }
.sign-links-foot .sign-link { width: 32px; height: 32px; }
.sign-links-foot .sign-link svg { width: 17px; height: 17px; }

/* ---------- 徽章文章卡 ---------- */
.post-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.post-card {
  background: var(--card); border-radius: 14px; padding: 1.05rem 1.3rem;
  border: 1px solid var(--border); box-shadow: var(--shadow);
  transition: all 0.25s; cursor: pointer;
  text-decoration: none; color: inherit; display: block;
}
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: rgba(89,134,209,0.45); }
.post-card:hover .pc-title { color: var(--primary); }
.pc-meta { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.35rem; }
.badge {
  font-size: 0.74rem; padding: 0.08rem 0.6rem; border-radius: 10px;
  background: rgba(89,134,209,0.12); color: var(--primary); text-decoration: none;
}
a:not(.post-card) > .badge:hover, a.badge:hover { background: var(--primary); color: #fff; }
.badge-guide { background: rgba(15, 110, 86, 0.12); color: #0F6E56; }
.pc-date, .pc-words { font-size: 0.76rem; color: var(--text-secondary); }
.pc-title {
  display: block; font-weight: 600; font-size: 1.02rem; color: var(--text);
  text-decoration: none; margin-bottom: 0.25rem; line-height: 1.45;
}
.pc-title:hover { color: var(--primary); }
.pc-excerpt {
  margin: 0; font-size: 0.84rem; color: var(--text-secondary); line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ---------- 页头 hero(分类/归档/标签) ---------- */
.cat-hero {
  border-radius: 16px; padding: 2rem 1.8rem; color: #fff; margin-bottom: 1.4rem;
  box-shadow: var(--shadow-hover); position: relative; overflow: hidden;
}
.cat-hero::after {
  content: ""; position: absolute; inset: 0; opacity: 0.16;
  background-image: radial-gradient(circle at 12% 20%, #fff 0, transparent 38%),
                    radial-gradient(circle at 92% 80%, #fff 0, transparent 42%);
  pointer-events: none;
}
.cat-hero-inner { position: relative; z-index: 1; }
.cat-hero h1 { margin: 0 0 0.7rem; font-size: 1.7rem; font-weight: 700; letter-spacing: 0.01em; }
.cat-hero p { margin: 0; opacity: 0.92; font-size: 0.92rem; }
.cat-hero-meta { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.cat-hero-meta span {
  display: inline-flex; align-items: center;
  background: rgba(255,255,255,0.18); border: 1px solid rgba(255,255,255,0.22);
  padding: 0.18rem 0.7rem; border-radius: 999px; font-size: 0.8rem;
}

/* ---------- 列表页桅杆(替代整幅色块) ---------- */
.page-mast {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1.2rem; flex-wrap: wrap;
  margin: 0.35rem 0 1.5rem; padding: 1.15rem 1.4rem 1.15rem 1.55rem;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.page-mast::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px;
  background: var(--mast-accent, var(--grad));
}
.page-kicker {
  margin: 0 0 0.18rem; font-size: 0.7rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--text-tertiary); font-weight: 700;
}
.page-kicker a { color: inherit; text-decoration: none; }
.page-kicker a:hover { color: var(--primary); }
.page-mast h1 { margin: 0; font-size: 1.55rem; font-weight: 700; letter-spacing: 0.01em; }
.page-mast-stats {
  display: flex; align-items: center; gap: 0; flex-wrap: wrap;
}
.page-mast-stats > div {
  min-width: 76px; padding: 0 1.05rem; text-align: center;
  border-left: 1px solid var(--border);
}
.page-mast-stats > div:first-child { border-left: none; }
.page-mast-stats strong {
  display: block; font-size: 1.32rem; color: var(--primary); line-height: 1.15;
}
.page-mast-stats span { font-size: 0.74rem; color: var(--text-secondary); }
.page-mast-link {
  margin-left: 0.6rem; padding: 0.4rem 0.8rem; border-radius: 999px;
  font-size: 0.8rem; color: var(--primary); text-decoration: none;
  background: rgba(89,134,209,0.1);
}
.page-mast-link:hover { background: var(--primary); color: #fff; }
.day-nav-inline { display: flex; flex-direction: column; gap: 0.2rem; text-align: right; min-width: auto; }
.day-nav-inline a {
  color: var(--primary); text-decoration: none; font-size: 0.78rem; white-space: nowrap;
}
.day-nav-inline a:hover { text-decoration: underline; }

/* ---------- 分类页系列拼贴 ---------- */
.series-jump {
  display: flex; flex-wrap: wrap; gap: 0.45rem; margin: -0.4rem 0 1.25rem;
}
.series-jump a {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.28rem 0.7rem; border-radius: 999px;
  background: var(--card); border: 1px solid var(--border);
  color: var(--text); text-decoration: none; font-size: 0.82rem;
  box-shadow: var(--shadow);
}
.series-jump a:hover { border-color: var(--accent, var(--primary)); color: var(--accent, var(--primary)); }
.series-jump em {
  font-style: normal; font-size: 0.7rem; color: var(--text-tertiary);
}
.series-mosaic {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
}
.series-tile {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column;
  scroll-margin-top: 80px;
}
.st-head {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.95rem 1.05rem 0.85rem;
  border-top: 3px solid var(--accent, var(--primary));
  background: linear-gradient(to right, color-mix(in srgb, var(--accent, var(--primary)) 10%, #fff), transparent 70%);
}
.st-idx {
  font-size: 1.35rem; font-weight: 700; letter-spacing: -0.04em;
  color: color-mix(in srgb, var(--accent, var(--primary)) 45%, transparent);
  line-height: 1; flex-shrink: 0;
}
.st-head-main { min-width: 0; flex: 1; display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; }
.st-head-main h2 { margin: 0; font-size: 1.02rem; }
.st-head-main h2 a { color: var(--text); text-decoration: none; }
.st-head-main h2 a:hover { color: var(--accent, var(--primary)); }
.sc-intro {
  font-size: 0.75rem; color: var(--primary); text-decoration: none;
  background: rgba(89,134,209,0.1); padding: 0.08rem 0.5rem; border-radius: 999px;
}
.sc-intro:hover { background: var(--primary); color: #fff; }
.sc-count {
  flex-shrink: 0; font-size: 0.78rem; color: var(--primary);
  background: rgba(89,134,209,0.1); padding: 0.2rem 0.7rem; border-radius: 999px;
}
.st-notes { padding: 0.15rem 0.65rem 0.55rem 0.85rem; }
.st-note {
  display: flex; justify-content: space-between; align-items: center; gap: 0.7rem;
  padding: 0.52rem 0.4rem; text-decoration: none; color: var(--text);
  font-size: 0.88rem; border-bottom: 1px solid var(--border);
}
.st-note:last-of-type { border-bottom: none; }
.st-note:hover { color: var(--accent, var(--primary)); }
.st-note span {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.st-note time {
  color: var(--text-tertiary); font-size: 0.74rem; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.sc-more {
  display: block; padding: 0.5rem 0.4rem 0.3rem; font-size: 0.82rem;
  color: var(--primary); text-decoration: none;
}
.sc-more:hover { text-decoration: underline; }

/* ---------- 归档 ---------- */
.archive-dash {
  display: grid; grid-template-columns: 168px minmax(0, 1fr);
  gap: 1.2rem; align-items: start;
}
.year-rail {
  position: sticky; top: 78px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 0.7rem 0.55rem; box-shadow: var(--shadow);
}
.year-rail a {
  display: grid; grid-template-columns: 2.8rem minmax(0, 1fr) auto;
  align-items: center; gap: 0.4rem;
  padding: 0.42rem 0.4rem; border-radius: 8px;
  text-decoration: none; color: var(--text); font-size: 0.84rem;
}
.year-rail a:hover { background: rgba(89,134,209,0.08); }
.year-rail b { font-weight: 700; color: var(--primary-dark); }
.year-rail em { font-style: normal; font-size: 0.72rem; color: var(--text-tertiary); }
.yr-bar {
  height: 6px; background: var(--bg); border-radius: 99px; overflow: hidden;
}
.yr-bar i { display: block; height: 100%; background: var(--primary); border-radius: 99px; }
.year-panel {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow); padding: 1rem 1.15rem 0.7rem;
  margin-bottom: 1.1rem; scroll-margin-top: 80px;
}
.year-panel-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 0.65rem;
}
.year-panel-head h2 { margin: 0; font-size: 1.25rem; color: var(--primary-dark); }
.year-panel-head span { font-size: 0.78rem; color: var(--text-secondary); }
.month-bars {
  display: flex; align-items: flex-end; gap: 5px; height: 78px;
  margin: 0 0 1.1rem; padding: 0.55rem 0.5rem 0.35rem;
  background: linear-gradient(to top, rgba(89,134,209,0.07), transparent);
  border-radius: 10px;
}
.mb {
  flex: 1; min-width: 0; height: 100%;
  display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px;
  text-decoration: none; color: var(--text-tertiary); font-size: 0.64rem;
}
.mb i {
  display: block; width: 100%; max-width: 26px; min-height: 6px;
  border-radius: 5px 5px 2px 2px; background: var(--primary); opacity: 0.82;
}
.mb:hover i { opacity: 1; }
.month-block { margin-bottom: 0.85rem; scroll-margin-top: 80px; }
.month-block h3 {
  margin: 0 0 0.2rem; font-size: 0.86rem; color: var(--text-secondary); font-weight: 600;
  display: flex; align-items: center; gap: 0.45rem;
}
.month-block h3 em {
  font-style: normal; font-size: 0.7rem; color: var(--text-tertiary);
  background: var(--bg); padding: 0.05rem 0.4rem; border-radius: 999px;
}
.archive-list { padding: 0.05rem 0; }
.ar-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center; gap: 0.85rem; padding: 0.5rem 0.35rem;
  border-radius: 8px;
}
.ar-row:hover { background: rgba(89,134,209,0.06); }
.ar-date {
  min-width: 2.1rem; font-size: 0.8rem; color: var(--text-tertiary); white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.ar-title {
  min-width: 0; color: var(--text); text-decoration: none; font-size: 0.94rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ar-title:hover { color: var(--primary); }
.ar-cat {
  font-size: 0.72rem; color: var(--primary); text-decoration: none; white-space: nowrap;
  background: rgba(89,134,209,0.08); padding: 0.12rem 0.55rem; border-radius: 999px;
}
.ar-cat:hover { background: var(--primary); color: #fff; }
.ar-words { font-size: 0.75rem; color: var(--text-secondary); white-space: nowrap; }
.day-nav { display: flex; gap: 0.5rem; }
.day-nav a {
  color: #fff; text-decoration: none; font-size: 0.75rem;
  background: rgba(255,255,255,0.16); border: 1px solid rgba(255,255,255,0.3);
  padding: 0.3rem 0.7rem; border-radius: 9px; white-space: nowrap;
}
.day-nav a:hover { background: rgba(255,255,255,0.3); }
/* 热力图可点击格子 */
a.hm-cell { cursor: pointer; outline: 1px solid transparent; transition: transform 0.12s, outline-color 0.12s; }
a.hm-cell:hover { transform: scale(1.35); outline-color: var(--primary); }

/* ---------- 标签云 ---------- */
.tag-cloud-v2 {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  align-content: space-evenly; gap: 0.95rem 1.05rem;
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow); padding: 2rem 1.8rem;
}
body.page-tags {
  min-height: 100dvh; display: flex; flex-direction: column;
}
body.page-tags .container {
  flex: 1; display: flex; flex-direction: column; width: 100%;
}
body.page-tags .tag-cloud-v2 { flex: 1; }
body.page-tags .site-footer { margin-top: 1.2rem; }
.tag-bubble {
  display: inline-flex; align-items: baseline; gap: 0.35rem;
  color: var(--text-secondary); text-decoration: none; font-weight: 500;
  padding: 0.22rem 0.55rem; border-radius: 999px;
  transition: color 0.15s, transform 0.15s, background 0.15s;
}
.tag-bubble em {
  font-style: normal; font-size: 0.68em; color: var(--text-tertiary); font-weight: 500;
}
.tag-bubble.lv-1 { color: var(--text); }
.tag-bubble.lv-2 { color: var(--primary-dark); font-weight: 600; }
.tag-bubble.lv-3 {
  color: #0F6E56; font-weight: 700;
  background: rgba(15, 110, 86, 0.08); padding: 0.28rem 0.72rem;
}
.tag-bubble:hover {
  color: var(--primary); background: rgba(89,134,209,0.1);
  transform: translateY(-1px);
}

/* ---------- 创作热力图 ---------- */
.heat-card { margin-top: 0.4rem; }
.hm-wrap { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 1.1rem 1.3rem 0.9rem; box-shadow: var(--shadow); }
/* 月份行+格子行打包居中;窄屏时整体横滑而不撑破卡片。
   hm-body/hm-grid 必须 max-content/visible:否则 grid 在 flex 内收缩自行滚动,
   与 months(固定 776px)两层滚动不同步导致月份与格子错位。
   fit-content:宽屏=776 居中;窄屏被 max-width 压到容器宽,内部横滑 */
.hm-main { width: fit-content; max-width: 100%; margin: 0 auto; overflow-x: auto; padding-bottom: 2px; }
.hm-body { display: flex; gap: 8px; width: max-content; }
.hm-rows { display: grid; grid-template-rows: repeat(7, 11px); gap: 3px; margin-top: 0; font-size: 0.62rem; color: var(--text-secondary); text-align: right; width: 26px; flex: none; }
.hm-rows span { line-height: 11px; }
.hm-grid { display: grid; grid-template-rows: repeat(7, 11px); grid-auto-flow: column; grid-auto-columns: 11px; gap: 3px; flex: none; }
.hm-cell { width: 11px; height: 11px; border-radius: 2.5px; background: #ebedf0; flex: none; }
.hm-cell.hm-pad { background: transparent; }
.hm-l0 { background: #ebedf0; }
.hm-l1 { background: #b7e3b9; }
.hm-l2 { background: #6fcb78; }
.hm-l3 { background: #3aa64c; }
.hm-l4 { background: #1f7a33; }
.hm-l5 { background: #e5534b; }
.hm-months { display: grid; grid-template-columns: repeat(53, 14px); width: max-content; margin-left: 34px; font-size: 0.68rem; color: var(--text-secondary); margin-bottom: 4px; }
.hm-legend { display: flex; align-items: center; gap: 4px; justify-content: flex-end; margin-top: 0.5rem; font-size: 0.68rem; color: var(--text-secondary); }
.hm-legend .hm-cell { width: 10px; height: 10px; }

/* ---------- 笔记地图入口 ---------- */
.graph-entry {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  background: rgba(255,255,255,0.16); border: 1px solid rgba(255,255,255,0.35);
  border-radius: 12px; padding: 0.55rem 1rem; text-decoration: none;
  color: #fff; font-weight: 700; font-size: 0.95rem; white-space: nowrap;
  transition: all 0.2s;
}
.graph-entry span { font-size: 0.68rem; font-weight: 400; opacity: 0.85; }
.graph-entry:hover { background: rgba(255,255,255,0.28); transform: translateY(-2px); }

/* ---------- 文章页(三栏:左侧导航 | 正文 | 右侧目录) ---------- */
/* 显式列号:aside 收起(display:none)后不占位,center/toc 仍落在指定列 */
.post-aside { grid-column: 1; }
.post-center { grid-column: 2; }
.toc-float { grid-column: 3; }
.post-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 1.8rem; align-items: start; max-width: 1240px; margin: 0 auto; }
/* 正文在列内视觉居中;width:100% 显式宽度防止 margin:auto grid item 的
   fit-content 以 min-content(长代码行)为下限撑破窄屏 */
.post-center { width: 100%; max-width: 840px; margin: 0 auto; min-width: 0; }
.post-layout.aside-hidden { grid-template-columns: 0 minmax(0, 1fr); gap: 0; }
.post-layout.aside-hidden .post-aside { display: none; }
.post-main {
  background: var(--card); border-radius: 16px; padding: 2rem 2.4rem;
  border: 1px solid var(--border); box-shadow: var(--shadow); min-width: 0;
}
/* 侧栏收起/展开控制 */
.aside-toggle {
  display: inline-flex; align-items: center; gap: 4px; float: right;
  font-size: 0.78rem; color: var(--text-secondary); background: none;
  border: 1px solid var(--border); border-radius: 8px; padding: 0.25rem 0.6rem;
  cursor: pointer; font-family: inherit; margin: -0.4rem -0.6rem 0 0;
  transition: all 0.2s;
}
.aside-toggle:hover { color: var(--primary); border-color: var(--primary); }
/* 右下角悬浮球:侧栏收起后重新展开(Chatway 之上,回顶之下再留一格) */
.aside-fab {
  position: fixed; right: var(--fab-right);
  bottom: calc(var(--fab-bottom) + var(--fab-size) + var(--chat-size) + var(--fab-gap) * 2);
  z-index: 60; width: var(--fab-size); height: var(--fab-size); padding: 0;
  border-radius: 50%; border: none; cursor: pointer;
  background: var(--primary); color: #fff; font-size: 1.15rem; line-height: 1;
  box-shadow: 0 6px 18px rgba(89,134,209,0.45); display: none;
  align-items: center; justify-content: center;
}
.aside-fab:hover { transform: translateY(-2px); }
.post-layout.aside-hidden ~ .aside-fab { display: flex; }
.post-breadcrumb { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 0.6rem; }
.post-breadcrumb a { color: var(--primary); text-decoration: none; }
.post-title {
  margin: 0 0 0.8rem; font-size: 1.65rem; font-weight: 700; line-height: 1.4;
  padding-bottom: 0.6rem; border-bottom: 3px solid var(--primary);
}
.post-meta { display: flex; flex-wrap: wrap; gap: 0.9rem; font-size: 0.85rem; color: var(--text-secondary); align-items: center; }
.tag-chip {
  color: var(--primary); text-decoration: none; background: rgba(89,134,209,0.1);
  padding: 0.1rem 0.55rem; border-radius: 10px; font-size: 0.8rem;
}
.tag-chip:hover { background: var(--primary); color: #fff; }
.raw-link { color: var(--text-secondary); text-decoration: none; font-size: 0.8rem; margin-left: auto; }
.raw-link + .raw-link { margin-left: 0; }
.raw-link:hover { color: var(--primary); }

.toc-box {
  margin: 1.4rem 0; background: linear-gradient(135deg, #f6f8fc, #eef2f8);
  border-radius: var(--radius); border: 1px solid var(--border); padding: 0.8rem 1.2rem;
}
.toc-box summary { cursor: pointer; font-weight: 700; color: var(--primary); }
.toc-list { margin: 0.5rem 0 0.2rem; padding: 0; list-style: none; max-height: 40vh; overflow-y: auto; }
.toc-list li { padding: 0.12rem 0; }
.toc-list li.toc-l3 { padding-left: 1.2rem; font-size: 0.9rem; }
.toc-list a { color: var(--text); text-decoration: none; }
.toc-list a:hover { color: var(--primary); }
.toc-list a.toc-active {
  color: var(--primary); font-weight: 500;
  box-shadow: inset 3px 0 0 var(--primary);
  padding-left: 0.45rem; margin-left: -0.45rem;
}

/* ---------- 右侧目录列(≥1350px 作为 grid 第三栏常驻,窄屏隐藏) ---------- */
.toc-float {
  display: none; position: sticky; top: 78px; align-self: start;
  max-height: calc(100vh - 100px); overflow-y: auto;
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow); padding: 0.7rem 0.9rem;
}
@media (min-width: 1350px) {
  /* 三栏需要更宽的舞台:仅文章页放宽容器 */
  body.wide-post .container { max-width: 1440px; }
  .post-layout.has-toc { grid-template-columns: 270px minmax(0, 1fr) 220px; max-width: 1420px; }
  .post-layout.has-toc.aside-hidden { grid-template-columns: 0 minmax(0, 1fr) 220px; }
  .has-toc .toc-float { display: block; }
  /* 右侧目录常驻时隐藏正文内折叠目录,避免重复 */
  .has-toc .toc-box { display: none; }
}
.toc-float .tf-title {
  font-weight: 700; font-size: 0.85rem; color: var(--primary);
  padding-bottom: 0.4rem; margin-bottom: 0.35rem; border-bottom: 1px solid var(--border);
}
.toc-float .toc-list { max-height: none; font-size: 0.86rem; }

/* ---------- 回到顶部按钮 ---------- */
#backTop {
  position: fixed; right: var(--fab-right); bottom: var(--fab-bottom); z-index: 70;
  width: var(--fab-size); height: var(--fab-size); padding: 0;
  border-radius: 50%; border: none; cursor: pointer;
  background: var(--primary); color: #fff; font-size: 1.2rem; line-height: 1;
  box-shadow: 0 6px 18px rgba(89,134,209,0.45);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.25s, transform 0.2s;
}
#backTop.show { opacity: 1; visibility: visible; pointer-events: auto; }
#backTop:hover { transform: translateY(-3px); }

/* Chatway 默认贴在回顶/侧栏球上,强制插进中间那一格 */
.chatway--trigger-container {
  right: var(--fab-right) !important;
  bottom: calc(var(--fab-bottom) + var(--fab-size) + var(--fab-gap)) !important;
}
.chatway--frame-container,
.chatway--quick--reply--container {
  right: var(--fab-right) !important;
  bottom: calc(var(--fab-bottom) + var(--fab-size) + var(--chat-size) + var(--fab-gap) * 2) !important;
}
.chatway-launcher {
  animation: none !important;
}

/* ---------- 正文元素 ---------- */
.post-content h2 { font-size: 1.3rem; margin: 2rem 0 0.8rem; color: var(--primary-dark); }
.post-content h3 { font-size: 1.12rem; margin: 1.6rem 0 0.6rem; }
.post-content a { color: var(--primary); }
.post-content a:hover { color: var(--primary-dark); }
.post-content blockquote {
  margin: 1rem 0; padding: 0.7rem 1.2rem; border-left: 4px solid var(--primary);
  background: linear-gradient(135deg, #f6f8fc, #e9edf5); border-radius: 0 8px 8px 0; color: var(--text-secondary);
}
.post-content code:not(pre code) {
  background: rgba(89,134,209,0.1); color: var(--primary-dark);
  padding: 0.12rem 0.4rem; border-radius: 5px; font-size: 0.88em;
}
.post-content pre.hljs {
  border-radius: var(--radius); padding: 1.1rem 1.3rem; overflow-x: auto;
  background: #f6f8fa; border: 1px solid var(--border); font-size: 0.87rem; line-height: 1.6;
}
.post-content img.ob-img, .post-content img {
  max-width: 100%; border-radius: var(--radius);
  box-shadow: 0 4px 15px rgba(0,0,0,0.08); margin: 0.5rem 0;
  transition: transform 0.2s, box-shadow 0.2s;
}
.post-content img:hover { box-shadow: 0 8px 22px rgba(0,0,0,0.12); }
.post-content table { border-collapse: collapse; width: 100%; margin: 1rem 0; font-size: 0.92rem; display: block; overflow-x: auto; }
.post-content th, .post-content td { border: 1px solid var(--border); padding: 0.55rem 0.9rem; text-align: left; }
.post-content th { background: rgba(89,134,209,0.08); font-weight: 500; }
.post-content tr:nth-child(even) td { background: rgba(89,134,209,0.03); }
.post-content .math-display,
.post-content .katex-display {
  overflow-x: auto; overflow-y: hidden; max-width: 100%; margin: 0.85rem 0;
}
.post-content .katex { font-size: 1.06em; }

/* callout */
.callout {
  margin: 1.1rem 0; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--bg); overflow: hidden;
}
.callout summary {
  cursor: pointer; padding: 0.65rem 1.1rem; font-weight: 500;
  background: linear-gradient(135deg, rgba(89,134,209,0.12), rgba(102,126,234,0.12));
}
.callout-icon { margin-right: 0.5rem; }
.callout-body { padding: 0.7rem 1.2rem; }
.callout-warning { border-left: 4px solid #d97706; }
.callout-danger, .callout-error { border-left: 4px solid #dc2626; }
.callout-tip, .callout-hint { border-left: 4px solid #059669; }
.callout-note, .callout-info { border-left: 4px solid var(--primary); }

/* OB 高亮 ==text== */
.post-content mark {
  background: linear-gradient(to bottom, rgba(250, 219, 132, 0.4), rgba(250, 219, 132, 0.6));
  color: inherit; padding: 0.05rem 0.3rem; border-radius: 4px;
}

/* OB 任务清单 */
.post-content .cb {
  display: inline-block; width: 1.05em; height: 1.05em; vertical-align: -0.15em;
  border: 2px solid var(--primary); border-radius: 4px; margin-right: 0.45em;
  background: var(--card); line-height: 1; text-align: center; font-size: 0.9em;
}
.post-content .cb-on { background: var(--primary); color: #fff; }

/* wikilink 状态 */
.wikilink-missing { color: #9ca3af; border-bottom: 1px dashed #d1d5db; }

/* 笔记嵌入(![[note]] 递归渲染) */
.embed-note {
  margin: 1.1rem 0; border: 1px solid var(--border); border-left: 4px solid var(--primary);
  border-radius: var(--radius); background: var(--bg); padding: 0.9rem 1.2rem; overflow: hidden;
}
.embed-note-title { font-weight: 700; font-size: 0.92rem; margin-bottom: 0.4rem; color: var(--primary-dark); }
.embed-note-title a { color: var(--primary); text-decoration: none; }
.embed-note .post-content { font-size: 0.93rem; }
.embed-note .post-content h2, .embed-note .post-content h3 { font-size: 1.02rem; margin: 0.8rem 0 0.4rem; }

.wikilink-missing { color: #9ca3af; border-bottom: 1px dashed #d1d5db; }
.embed-card {
  display: block; padding: 0.8rem 1.1rem; margin: 0.8rem 0; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--bg); text-decoration: none; color: var(--text);
}
.embed-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.embed-missing { color: #b91c1c; font-size: 0.85rem; background: #fef2f2; padding: 0.2rem 0.6rem; border-radius: 6px; }

/* 系列/上下篇 */
.series-nav { margin-top: 2.5rem; padding: 1.2rem 1.5rem; border-radius: var(--radius); background: linear-gradient(135deg, #f6f8fc, #e9ecef); }
.series-nav h3 { margin: 0 0 0.7rem; color: var(--primary-dark); }
.series-nav ol { margin: 0; padding-left: 1.4rem; }
.series-nav li { padding: 0.15rem 0; }
.series-nav li.current a { font-weight: 700; color: var(--primary); }
.series-nav a { color: var(--text); text-decoration: none; }
.series-nav a:hover { color: var(--primary); }

.prev-next { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1.4rem; }
.pn-link {
  flex: 1; max-width: 48%; padding: 0.8rem 1.1rem; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--border); text-decoration: none; color: var(--text);
  display: flex; flex-direction: column; gap: 0.2rem; transition: all 0.2s; min-width: 0;
}
.pn-link:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-2px); }
.pn-link span { font-size: 0.78rem; color: var(--text-secondary); }
.pn-link strong { font-size: 0.92rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pn-next { text-align: right; margin-left: auto; }
.pn-empty { flex: 1; max-width: 48%; }

.comments { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px dashed var(--border); }

.copy-btn {
  position: absolute; top: 8px; right: 8px; padding: 0.25rem 0.7rem;
  border: 1px solid var(--border); border-radius: 8px; background: var(--card);
  color: var(--text-secondary); font-size: 0.78rem; cursor: pointer; opacity: 0;
  transition: all 0.2s; font-family: inherit;
}
pre.hljs:hover .copy-btn { opacity: 1; }
.copy-btn:hover { color: var(--primary); border-color: var(--primary); }
.copy-btn.copied { opacity: 1; color: #0F6E56; border-color: #1D9E75; }
@media (hover: none) {
  .copy-btn { opacity: 1; }
}

#readProg {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 180;
  background: var(--grad); transform: scaleX(0); transform-origin: left center;
  pointer-events: none;
}

.lb-hint {
  position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,0.72); font-size: 0.78rem; letter-spacing: 0.04em;
  pointer-events: none;
}

/* ---------- 图片灯箱 ---------- */
.img-lightbox {
  position: fixed; inset: 0; z-index: 200; cursor: zoom-out;
  background: rgba(10, 14, 25, 0.88); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  animation: lb-in 0.18s ease;
}
.img-lightbox img {
  max-width: 92vw; max-height: 92vh; border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.img-lightbox.closing { animation: lb-out 0.18s ease forwards; }
@keyframes lb-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes lb-out { from { opacity: 1; } to { opacity: 0; } }

/* ---------- 侧栏 ---------- */
.post-aside { position: sticky; top: 78px; display: flex; flex-direction: column; gap: 1rem; }
.side-card {
  background: var(--card); border-radius: 14px; border: 1px solid var(--border);
  padding: 1rem 1.1rem; box-shadow: var(--shadow); max-height: 70vh; overflow-y: auto;
}
.side-title { font-weight: 700; font-size: 0.88rem; color: var(--text-secondary); margin-bottom: 0.5rem; }
.side-link {
  display: block; padding: 0.4rem 0.6rem; border-radius: 8px; font-size: 0.88rem;
  color: var(--text); text-decoration: none; line-height: 1.45;
}
.side-link:hover { background: rgba(89,134,209,0.08); color: var(--primary); }
.side-link.active { background: var(--grad); color: #fff; font-weight: 500; }
.side-link.side-intro { color: var(--primary); font-weight: 500; }
.side-count { float: right; color: var(--text-secondary); font-size: 0.78rem; }
.side-link.active .side-count { color: rgba(255,255,255,0.85); }

/* ---------- footer ---------- */
.site-footer {
  margin-top: 3rem; padding: 1.5rem; text-align: center; color: var(--text-secondary);
  font-size: 0.85rem; border-top: 1px solid var(--border); background: var(--card);
}
.site-footer a { color: var(--primary); text-decoration: none; }
.site-footer .sign-link { color: var(--text-secondary); }
.site-footer .sign-link:hover { color: var(--primary); background: rgba(89,134,209,0.1); }

/* ---------- 404 ---------- */
.error-hero { text-align: center; padding: 4rem 0; }
.error-hero h1 { margin: 0; font-size: 3.2rem; letter-spacing: 0.08em; }
.error-hero p { margin: 0.6rem 0 0; }
.error-actions { display: flex; justify-content: center; gap: 0.8rem; margin-top: 1.2rem; flex-wrap: wrap; }
.error-actions a {
  display: inline-block; padding: 0.5rem 1.4rem; background: rgba(255,255,255,0.2);
  border-radius: 20px; color: #fff; text-decoration: none; border: 1px solid rgba(255,255,255,0.28);
}
.error-actions a:hover { background: rgba(255,255,255,0.32); }

.empty-hint {
  text-align: center; padding: 2.4rem 1rem; color: var(--text-secondary);
  background: var(--card); border: 1px dashed var(--border); border-radius: 12px;
}
kbd {
  font: 0.78em ui-monospace, SFMono-Regular, Menlo, monospace;
  padding: 0.05em 0.4em; border-radius: 4px;
  background: rgba(255,255,255,0.22); border: 1px solid rgba(255,255,255,0.35);
}

/* ---------- 搜索页 v2 ---------- */
.search-form-v2 {
  display: flex; gap: 0.6rem; margin-bottom: 1.6rem;
}
.search-form-v2 input {
  flex: 1; padding: 0.8rem 1.2rem; border: 2px solid var(--border);
  border-radius: 12px; font-size: 1rem; font-family: inherit; outline: none;
  transition: border-color 0.2s;
}
.search-form-v2 input:focus { border-color: var(--primary); }
.search-form-v2 button {
  padding: 0 1.6rem; border: none; border-radius: 12px; cursor: pointer;
  background: var(--primary); color: #fff; font-size: 0.95rem; font-family: inherit;
}
.search-form-v2 button:hover { opacity: 0.9; }
.result-list { display: flex; flex-direction: column; gap: 0.8rem; }
.result-card {
  display: block; background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 1rem 1.3rem; text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
}
.result-card:hover {
  transform: translateY(-2px); box-shadow: var(--shadow-hover);
  border-color: var(--primary);
}
.rc-meta { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.4rem; }
.badge-vault { background: rgba(29,158,117,0.1); color: #0F6E56; }
.rc-date { font-size: 0.8rem; color: var(--text-tertiary); }
.rc-title { font-weight: 600; color: var(--text); font-size: 1.02rem; }
.result-card:hover .rc-title { color: var(--primary); }
.rc-excerpt {
  margin: 0.35rem 0 0; font-size: 0.88rem; color: var(--text-secondary);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.rc-excerpt mark, .rc-title mark {
  background: rgba(250, 219, 132, 0.65); color: inherit; padding: 0 0.12em; border-radius: 2px;
}
.search-form-v2 button:active { transform: translateY(1px); }
.section-head .more-link + .more-link { margin-left: 1rem; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .home-dash { flex-direction: column; height: auto; }
  /* 列方向下 flex:1 的 basis:0% 会压过 height,必须一并重置 */
  .dash-left { flex: none; height: 240px; }
  /* 单列后右侧卡片组拉满宽度(基础规则固定 270px) */
  .dash-right { width: 100%; }
  .post-layout { grid-template-columns: minmax(0, 1fr); }
  .post-layout.aside-hidden { grid-template-columns: minmax(0, 1fr); }
  /* 单列下取消显式列号,否则会创建隐式列 */
  .post-aside, .post-center, .toc-float { grid-column: auto; }
  /* 单列时正文优先,侧栏(DOM 中在首位)排到正文后面 */
  .post-aside { position: static; order: 2; }
  .post-main { padding: 1.4rem 1.2rem; max-width: 100%; }

  /* 头部两行化:第一行 logo+搜索,第二行导航横滑 */
  .header-inner {
    display: flex; flex-wrap: wrap; height: auto; min-height: 56px;
    padding: 0.55rem 1rem; gap: 0.6rem; row-gap: 0;
  }
  .logo { font-size: 1.02rem; }
  .search-box { margin-left: auto; justify-self: auto; }
  .nav {
    order: 3; width: calc(100% + 2rem); margin: 0 -1rem; padding: 0.3rem 1rem;
    flex: none; justify-content: center; overflow-x: auto; -webkit-overflow-scrolling: touch;
    border-top: 1px solid var(--border); scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }
  /* 触屏没有 hover:点击由 enhance.js 切 .open 类 */
  .nav-drop.open .drop-panel, .nav-drop.open:hover .drop-panel { display: flex; }
  .drop-panel {
    position: fixed; top: auto; left: 0.8rem; right: 0.8rem; min-width: 0; z-index: 99;
    box-shadow: 0 12px 30px rgba(0,0,0,0.18);
  }
  .drop-panel::before { left: 20px; }
  .search-box input { width: 130px; }
  .search-box input:focus { width: 170px; }
  .cat-hero { padding: 1.6rem 1.2rem; }
  .page-mast { align-items: flex-start; padding: 1rem 1.1rem 1rem 1.25rem; }
  .page-mast-stats > div { padding: 0 0.7rem; min-width: 64px; }
  .archive-dash { grid-template-columns: 1fr; }
  .year-rail {
    position: static; display: flex; gap: 0.35rem; overflow-x: auto;
    padding: 0.55rem;
  }
  .year-rail a { grid-template-columns: auto auto; flex: none; }
  .yr-bar { display: none; }
  .series-mosaic { grid-template-columns: 1fr; }
  .ar-row { grid-template-columns: auto minmax(0, 1fr); }
  .ar-cat { display: none; }
  .prev-next { flex-direction: column; }
  .pn-link, .pn-empty { max-width: 100%; }
  :root {
    --fab-size: 42px;
    --fab-right: 16px;
    --fab-bottom: 18px;
  }
}


/* --------------------------------------------------------------------------
   Zwww / 个人札记视觉重构
   旧组件选择器仍保留以兼容内页，以下是统一的编辑手记主题。
   -------------------------------------------------------------------------- */
:root {
  --paper: #f4f1e9;
  --paper-deep: #ebe7dc;
  --sheet: #fcfaf5;
  --ink: #242922;
  --muted: #70756a;
  --line: #d7d7cb;
  --forest: #25493c;
  --forest-soft: #dce7df;
  --vermilion: #b65336;
  --primary: var(--forest);
  --primary-dark: #19362d;
  --bg: var(--paper);
  --card: var(--sheet);
  --border: var(--line);
  --text: var(--ink);
  --text-secondary: var(--muted);
  --shadow: 0 8px 24px rgba(36,41,34,.06);
  --shadow-hover: 0 12px 30px rgba(36,41,34,.12);
  --radius: 4px;
}

html { background: var(--paper); }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.78;
}
a { color: var(--forest); }
.site-header {
  background: rgba(244,241,233,.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.header-inner { max-width: 1180px; height: 72px; padding: 0 1.5rem; grid-template-columns: auto minmax(0, 1fr); }
.logo { gap: 10px; color: var(--ink); font-family: Georgia, "Songti SC", serif; font-size: 1.05rem; }
.logo-mark { border-radius: 50%; box-shadow: none; }
.logo-type { display: flex; flex-direction: column; line-height: 1.05; }
.logo-caption { margin-top: 4px; color: var(--muted); font: 500 .58rem/1 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .14em; }
.logo-monogram { display: grid; place-items: center; width: 27px; height: 27px; border: 1px solid var(--forest); border-radius: 50%; color: var(--forest); font: 600 .78rem/1 Georgia, serif; }
.logo-monogram > span { color: var(--vermilion); font-size: .58rem; }
.nav-toggle { display: none; }
.header-nav { display: flex; align-items: center; justify-self: end; gap: 1.3rem; min-width: 0; }
.category-menu { position: relative; }
.category-summary { cursor: pointer; list-style: none; }
.category-summary::-webkit-details-marker { display: none !important; }
.category-summary::marker { display: none; content: ''; }
.category-menu[open] > .drop-panel { display: flex; }
.category-summary svg { transition: transform .18s ease; }
.category-menu[open] .category-summary svg { transform: rotate(180deg); }
.nav { gap: .2rem; }
.nav > a, .nav-drop, .nav-drop summary { color: var(--muted); border-radius: 2px; font-size: .88rem; }
.nav > a:hover, .nav-drop:hover, .nav > a.active, .nav-drop.active { color: var(--forest); background: transparent; }
.nav > a.active { box-shadow: inset 0 -2px 0 var(--vermilion); }
.nav-drop summary { cursor: pointer; list-style: none; padding: .38rem .7rem; }
.nav-drop summary::-webkit-details-marker { display: none; }
.drop-panel { border: 1px solid var(--line); border-radius: 3px; background: var(--sheet); box-shadow: var(--shadow-hover); }
.drop-panel a { color: var(--ink); }
.search-box { display: flex; align-items: center; gap: .45rem; width: 245px; }
.search-icon { flex: none; color: var(--forest); }
.search-box input { width: auto; min-width: 0; flex: 1; border: 1px solid var(--line); border-radius: 2px; background: transparent; color: var(--ink); }
.search-box input:focus { width: auto; border-color: var(--forest); box-shadow: 0 0 0 3px rgba(37,73,60,.1); }
.search-key { color: var(--muted); background: transparent; border-color: var(--line); }
.search-box { margin-left: .35rem; }
.container { max-width: 1180px; padding: 2rem 1.5rem 4rem; }

/* 首页：先让作者和内容出现，再展示统计 */
.home-intro { display: grid; grid-template-columns: minmax(0,1fr) 260px; gap: 3rem; padding: 4.5rem 0 4rem; border-bottom: 1px solid var(--line); }
.eyebrow, .section-kicker, .page-kicker { color: var(--vermilion); font: 600 .7rem/1.3 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .16em; text-transform: uppercase; }
.intro-title { max-width: 760px; margin: .7rem 0 1.25rem; color: var(--ink); font: 600 clamp(2.9rem, 7vw, 6.5rem)/1.05 Georgia, "Songti SC", "STSong", serif; letter-spacing: -.04em; }
.intro-title em { color: var(--forest); font-style: normal; }
.intro-desc { max-width: 560px; margin: 0; color: var(--muted); font-size: 1.05rem; }
.intro-links { display: flex; gap: 1.1rem; margin-top: 2rem; flex-wrap: wrap; }
.text-link { color: var(--forest); font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--forest); }
.text-link:hover { color: var(--vermilion); border-color: var(--vermilion); }
.intro-note { align-self: center; justify-self: end; max-width: 245px; border-left: 2px solid var(--vermilion); padding: 1rem 1rem 1rem 1.2rem; color: var(--muted); background: rgba(252,250,245,.42); font-family: Georgia, "Songti SC", serif; }
.intro-note-label { display: block; color: var(--ink); font-size: 1.05rem; }
.intro-note-stamp { display: block; margin-top: .7rem; color: var(--vermilion); font: .7rem ui-monospace, monospace; letter-spacing: .08em; }
.intro-note-sign { display: block; margin-top: .8rem; color: var(--muted); font-size: .78rem; }
.feature-section { padding-top: 3.5rem; }
.section-head { align-items: end; margin-bottom: 1.4rem; }
.section-title { color: var(--ink); font: 600 1.75rem/1.2 Georgia, "Songti SC", serif; }
.feature-grid { display: grid; grid-template-columns: minmax(0,1.3fr) minmax(260px,.7fr); gap: 1rem; }
.feature-card { position: relative; min-height: 260px; display: flex; overflow: hidden; border: 1px solid var(--line); background: var(--sheet); color: var(--ink); text-decoration: none; }
.feature-card:hover { border-color: var(--forest); box-shadow: var(--shadow); }
.feature-card-main { min-height: 340px; }
.feature-art { position: absolute; inset: 0; overflow: hidden; background: var(--forest); }
.feature-art img { width: 100%; height: 100%; object-fit: cover; opacity: .58; filter: saturate(.7) sepia(.12); }
.feature-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, rgba(20,45,36,.9), rgba(20,45,36,.2) 75%); }
.feature-art-type { background: linear-gradient(135deg, var(--forest) 0 52%, var(--vermilion) 52%); }
.feature-copy { position: relative; z-index: 1; align-self: end; max-width: 620px; padding: 2rem; color: var(--sheet); }
.feature-card:not(.feature-card-main) .feature-copy { align-self: stretch; padding: 1.35rem; color: var(--ink); }
.feature-card:not(.feature-card-main) .feature-art { position: absolute; height: 7px; bottom: 0; top: auto; background: var(--vermilion); }
.feature-card:not(.feature-card-main) .feature-art::after { display: none; }
.feature-number { display: block; margin-bottom: 1rem; color: var(--vermilion); font: .7rem ui-monospace, monospace; letter-spacing: .12em; }
.feature-meta, .note-meta { color: var(--muted); font: .72rem ui-monospace, monospace; letter-spacing: .02em; }
.feature-title { display: block; margin: .55rem 0; font: 600 clamp(1.3rem,2.7vw,2.25rem)/1.2 Georgia, "Songti SC", serif; }
.feature-card:not(.feature-card-main) .feature-title { font-size: 1.28rem; }
.feature-excerpt { margin: .8rem 0 0; opacity: .82; }
.feature-read { display: inline-block; margin-top: 1.2rem; font-size: .82rem; }
.home-content { display: grid; grid-template-columns: minmax(0,1fr) 280px; gap: 4rem; padding-top: 4rem; }
.note-list { border-top: 1px solid var(--line); }
.note-row { display: grid; grid-template-columns: 92px minmax(0,1fr) 26px; gap: 1.2rem; align-items: start; padding: 1.25rem 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.note-row:hover .note-title { color: var(--vermilion); }
.note-date { color: var(--muted); font: .72rem ui-monospace, monospace; }
.note-date time strong, .note-date time span { display: block; }
.note-date time strong { color: var(--ink); font-weight: 500; }
.note-title { display: block; margin: .25rem 0; color: var(--ink); font: 600 1.15rem/1.35 Georgia, "Songti SC", serif; transition: color .18s; }
.note-excerpt { margin: .2rem 0 0; color: var(--muted); font-size: .88rem; }
.note-arrow { color: var(--vermilion); font-size: 1.4rem; line-height: 1; }
.home-sidebar { display: flex; flex-direction: column; gap: 2.3rem; }
.side-section { border-top: 2px solid var(--forest); padding-top: .8rem; }
.side-heading { margin: 0 0 .8rem; color: var(--ink); font: 600 .95rem Georgia, "Songti SC", serif; }
.topic-list, .guide-list { display: grid; gap: .35rem; }
.topic-link, .guide-link { display: flex; justify-content: space-between; gap: 1rem; padding: .38rem 0; border-bottom: 1px dotted var(--line); color: var(--ink); font-size: .84rem; text-decoration: none; }
.topic-link:hover, .guide-link:hover { color: var(--vermilion); }
.topic-count { color: var(--muted); font: .7rem ui-monospace, monospace; }
.explore-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
.explore-links a { display: flex; align-items: center; justify-content: space-between; gap: .35rem; padding: .65rem .7rem; border: 1px solid var(--line); color: var(--forest); background: rgba(252,250,245,.58); font-size: .8rem; text-decoration: none; transition: border-color .18s, color .18s, transform .18s; }
.explore-links a:hover { border-color: var(--vermilion); color: var(--vermilion); transform: translateY(-1px); }
.sidebar-travel { display: block; padding: 1.15rem 1.15rem 1.05rem; border: 1px solid var(--vermilion); color: var(--forest); background: rgba(252,250,245,.56); text-decoration: none; overflow: hidden; }
.sidebar-travel .section-kicker { display: block; white-space: nowrap; }
.sidebar-travel strong { display: block; margin: .42rem 0 .72rem; color: var(--forest); font: 600 1.18rem/1.35 Georgia, "Songti SC", serif; }
.sidebar-travel strong span { display: block; white-space: nowrap; }
.sidebar-travel-meta { display: block; color: var(--forest); font-size: .8rem; line-height: 1.5; }
.sidebar-travel-meta i { font-style: normal; font-size: 1rem; }
.author-card { padding: 1.1rem; border: 1px solid var(--line); background: rgba(252,250,245,.5); }
.author-avatar { width: 58px; height: 58px; border-radius: 50%; object-fit: cover; filter: saturate(.8); }
.author-identity { display: grid; grid-template-columns: 58px minmax(0, 1fr); align-items: center; column-gap: .95rem; color: var(--ink); text-decoration: none; min-width: 0; }
.author-identity > span { display: block; min-width: 0; }
.author-greeting { display: block; color: var(--forest); font-size: .98rem; line-height: 1.25; }
.author-name { display: block; margin-top: .7rem; font: 600 1.25rem Georgia, "Songti SC", serif; }
.author-identity .author-name { margin-top: .18rem; white-space: nowrap; }
.author-bio { color: var(--muted); font-size: .82rem; }
.author-signature { color: var(--vermilion); font: .78rem Georgia, serif; }
.heat-card { margin-top: 4rem; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: transparent; box-shadow: none; }
.heat-heading { display: flex; justify-content: space-between; align-items: baseline; }
.hm-cell { border-radius: 1px; }
.hm-l1 { background: #b9cbbd; }.hm-l2 { background: #86a991; }.hm-l3 { background: #557e68; }.hm-l4,.hm-l5 { background: var(--forest); }

/* 文章与通用页面 */
.post-main { background: var(--sheet); border: 1px solid var(--line); box-shadow: none; }
.post-title { color: var(--ink); font: 600 clamp(2.2rem,5vw,4rem)/1.1 Georgia, "Songti SC", serif; letter-spacing: -.025em; }
.post-content { color: var(--ink); font-size: 1.05rem; line-height: 1.95; }
.post-content h2, .post-content h3 { color: var(--forest); font-family: Georgia, "Songti SC", serif; }
.post-content blockquote { border-left-color: var(--vermilion); background: #f5eee8; }
.tag-chip, .badge { border-radius: 2px; color: var(--forest); background: var(--forest-soft); }
.page-mast, .cat-hero { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent !important; color: var(--ink); box-shadow: none; }
.page-mast::before { background: var(--vermilion); }
.cat-hero::after { display: none; }
.page-mast h1, .cat-hero h1 { color: var(--ink); font: 600 clamp(2rem,5vw,4rem)/1.1 Georgia, "Songti SC", serif; }
.page-mast-stats strong { color: var(--forest); }
.page-mast-link, .more-link { color: var(--forest); }
.post-card, .result-card, .series-tile, .side-card, .toc-box { border-color: var(--line); border-radius: 2px; background: rgba(252,250,245,.62); box-shadow: none; }
.post-card:hover, .result-card:hover, .series-tile:hover { border-color: var(--forest); box-shadow: var(--shadow); }
.site-footer { margin-top: 4rem; padding: 2.5rem 1.5rem 1.7rem; border-top: 1px solid var(--line); background: var(--paper-deep); }
.footer-inner { max-width: 1180px; display: flex; justify-content: space-between; align-items: start; gap: 2rem; margin: 0 auto; }
.footer-brand { color: var(--ink); font: 600 1.05rem Georgia, "Songti SC", serif; }
.footer-note, .footer-links, .footer-bottom { color: var(--muted); }
.footer-note { margin: .4rem 0 0; font-size: .82rem; font-weight: 400; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .8rem 1.2rem; font-size: .82rem; }
.footer-bottom { max-width: 1180px; margin: 2rem auto 0; padding-top: 1rem; border-top: 1px solid rgba(215,215,203,.8); display: flex; justify-content: space-between; gap: 1rem; align-items: center; font-size: .76rem; }

#readProg { background: var(--vermilion) !important; }
.side-link.active { background: var(--forest); color: var(--sheet); font-weight: 600; }
.side-link.active .side-count { color: rgba(252,250,245,.82); }
.side-link:hover { background: var(--forest-soft); color: var(--forest); }
.post-content pre.hljs { background: #f1f4f1; border-color: var(--line); color: var(--ink); }
.post-meta { gap: .45rem .7rem; }
.post-meta .raw-link { margin-left: 0; }

@media (max-width: 900px) {
  .header-inner { display: flex; flex-wrap: nowrap; height: 62px; min-height: 62px; padding: 0 1rem; gap: .7rem; }
  .logo { min-width: 0; }
  .logo-type { min-width: 0; }
  .logo-type strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav-toggle { display: inline-flex; }
  .nav-toggle { margin-left: auto; width: 42px; height: 38px; padding: 0; align-items: center; justify-content: center; gap: 0; border: 1px solid var(--line); border-radius: 4px; background: var(--sheet); color: var(--forest); cursor: pointer; font: inherit; }
  .nav-toggle > span:first-child { display: none; }
  .nav-toggle-lines { display: flex; flex-direction: column; gap: 4px; width: 18px; }
  .nav-toggle-lines i { display: block; width: 100%; height: 1.5px; background: currentColor; transition: transform .18s ease, opacity .18s ease; }
  .nav-open .nav-toggle-lines i:first-child { transform: translateY(2.75px) rotate(45deg); }
  .nav-open .nav-toggle-lines i:last-child { transform: translateY(-2.75px) rotate(-45deg); }
  .header-nav { display: none; position: absolute; left: .75rem; right: .75rem; top: 70px; padding: .7rem; border: 1px solid var(--line); border-radius: 8px; background: var(--sheet); box-shadow: 0 16px 34px rgba(36,41,34,.14); }
  .nav-open .header-nav { display: flex; flex-direction: column; align-items: stretch; gap: .65rem; }
  .nav-open .header-nav .nav { order: 0; width: 100%; margin: 0; padding: 0; border: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .25rem; }
  .nav-open .header-nav .nav > a, .nav-open .header-nav .category-menu > summary { display: flex; align-items: center; justify-content: center; min-height: 42px; padding: .55rem .35rem; border: 1px solid transparent; border-radius: 4px; }
  .nav-open .header-nav .nav > a.active { background: var(--forest-soft); box-shadow: none; }
  .nav-open .header-nav .category-menu[open] > .drop-panel { position: static; min-width: 0; margin: .15rem 0 .3rem; box-shadow: none; border-radius: 4px; }
  .nav-open .header-nav .category-menu { min-width: 0; }
  .nav-open .header-nav .search-box { order: 2; width: 100%; margin: .15rem 0 0; }
  .nav-open .header-nav .search-box input { width: 100%; height: 42px; }
  .search-box input { width: 120px; }
  .container { padding: 1rem 1rem 3rem; }
  .home-intro { grid-template-columns: 1fr; gap: 2rem; padding: 3rem 0 2.5rem; }
  .intro-title { font-size: clamp(2.8rem, 14vw, 4.6rem); }
  .intro-note { justify-self: start; }
  .search-box { width: 150px; flex: 0 0 150px; }
  .search-key { display: none; }
  .feature-grid, .home-content { grid-template-columns: 1fr; gap: 2rem; }
  .feature-card-main { min-height: 300px; }
  .home-sidebar { order: 2; }
  .note-row { grid-template-columns: 70px minmax(0,1fr) 16px; gap: .7rem; }
  .note-title { font-size: 1.05rem; }
  .note-excerpt { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .footer-inner, .footer-bottom { flex-direction: column; align-items: flex-start; }
  .footer-links { justify-content: flex-start; }
}

/* 移动端导航收口：菜单是页头的延伸，分类展开不再被第三个格子压窄。 */
@media (max-width: 900px) {
  .nav-open .header-nav .nav { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .header-nav,
  .nav-open .header-nav {
    left: 0 !important;
    right: 0 !important;
    top: 62px !important;
    width: auto !important;
    justify-self: stretch;
    max-height: calc(100vh - 62px);
    overflow-y: auto;
    border-left: 0;
    border-right: 0;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 12px 28px rgba(36,41,34,.12);
  }
  .nav-open .header-nav .category-menu { position: static; }
  .nav-open .header-nav .category-menu[open] > .drop-panel {
    position: absolute;
    top: 6rem;
    left: 1rem;
    right: 1rem;
    width: auto;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .2rem .55rem;
    margin: 0;
    padding: .55rem;
    max-height: 52vh;
    overflow-y: auto;
    border-radius: 6px;
    box-shadow: 0 8px 22px rgba(36,41,34,.12);
  }
  .nav-open .header-nav .category-menu[open] > .drop-panel::before { display: none; }
  .nav-open .header-nav .category-menu[open] > .drop-panel a { min-height: 38px; padding: .45rem .55rem; }
}
