/*!
 * Mizhi Blog - 主样式表
 * 设计基调：浅灰底 + 白色圆角卡片 + 薄荷绿主色
 * 支持深色模式（html[data-theme="dark"]）
 */

/* ============================================================
   1. 设计变量
   ============================================================ */
:root {
  --bg: #f5f6fa;
  --bg-soft: #eef1f7;
  --card: #ffffff;
  --card-hover: #ffffff;
  --border: #e8ecf3;
  --border-strong: #dbe1ec;

  --text: #1f2430;
  --text-2: #5b6473;
  --text-3: #8a93a3;

  --accent: #39c5bb;
  --accent-strong: #25a79d;
  --accent-soft: rgba(57, 197, 187, 0.12);
  --accent-soft-2: rgba(57, 197, 187, 0.22);

  --warn: #f0a24b;
  --danger: #e8554a;
  --star: #f7c948;

  --shadow-xs: 0 1px 3px rgba(31, 36, 48, 0.05);
  --shadow-sm: 0 3px 10px rgba(31, 36, 48, 0.05);
  --shadow: 0 8px 24px rgba(31, 36, 48, 0.07);
  --shadow-lg: 0 18px 46px rgba(31, 36, 48, 0.14);

  --radius-lg: 18px;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-pill: 999px;

  --header-h: 66px;
  --wrap: 1200px;
  --sidebar-w: 300px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
  --font-mono: "JetBrains Mono", Consolas, "Courier New", monospace;
}

html[data-theme="dark"] {
  --bg: #171a21;
  --bg-soft: #1c2029;
  --card: #22262f;
  --card-hover: #262b35;
  --border: #333947;
  --border-strong: #3d4453;

  --text: #e8ecf3;
  --text-2: #a8b1c1;
  --text-3: #7a8699;

  --accent: #46d3c8;
  --accent-strong: #39c5bb;
  --accent-soft: rgba(70, 211, 200, 0.14);
  --accent-soft-2: rgba(70, 211, 200, 0.24);

  --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 3px 12px rgba(0, 0, 0, 0.32);
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.52);
}

/* ============================================================
   2. 基础重置
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

body.nav-open,
body.search-open {
  overflow: hidden;
}

img {
  max-width: 100%;
  height: auto;
  border: 0;
  vertical-align: middle;
}

a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.18s ease;
}

a:hover {
  color: var(--accent-strong);
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

p {
  margin: 0 0 1em;
}

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
}

::selection {
  background: var(--accent-soft-2);
  color: var(--text);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 22px;
}

.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 999;
  width: auto;
  height: auto;
  padding: 10px 18px;
  clip: auto;
  background: var(--card);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

/* 滚动条 */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border: 3px solid var(--bg);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-3);
}

/* ============================================================
   3. 顶部导航
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .site-header {
    background: var(--bg);
  }
}

.site-header.is-stuck {
  border-bottom-color: var(--border);
  box-shadow: 0 6px 20px rgba(31, 36, 48, 0.05);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 22px;
  height: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand img,
.brand .custom-logo {
  height: 32px;
  width: auto;
  border-radius: 9px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent) 0%, #48b8f7 100%);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  box-shadow: 0 6px 14px var(--accent-soft-2);
}

.main-nav {
  flex: 1 1 auto;
  min-width: 0;
}

.main-nav ul {
  display: flex;
  align-items: center;
  gap: 4px;
}

.main-nav li {
  position: relative;
}

.main-nav a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease;
}

.main-nav a:hover {
  color: var(--text);
  background: var(--bg-soft);
}

.main-nav .current-menu-item > a,
.main-nav .current-cat > a,
.main-nav .current_page_item > a,
.main-nav .current-menu-parent > a,
.main-nav .current-menu-ancestor > a {
  color: var(--accent-strong);
  background: var(--accent-soft);
  font-weight: 600;
}

/* 下拉菜单 */
.main-nav .children,
.main-nav .sub-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 176px;
  padding: 8px;
  display: block;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: all 0.2s ease;
}

.main-nav li:hover > .sub-menu,
.main-nav li:hover > .children,
.main-nav li:focus-within > .sub-menu,
.main-nav li:focus-within > .children {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.main-nav .sub-menu li,
.main-nav .children li {
  display: block;
}

.main-nav .sub-menu a,
.main-nav .children a {
  display: block;
  height: auto;
  padding: 8px 12px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 500;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  color: var(--text-2);
  border: 1px solid transparent;
  transition: all 0.18s ease;
}

.icon-btn:hover {
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-color: var(--accent-soft-2);
}

.icon-btn svg {
  width: 19px;
  height: 19px;
}

.menu-toggle {
  display: none;
}

/* 菜单按钮图标切换 */
.menu-toggle .icon-close { display: none; }
.menu-toggle.is-open .icon-menu { display: none; }
.menu-toggle.is-open .icon-close { display: block; }

/* 主题切换图标 */
.theme-toggle .icon-moon { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

/* ============================================================
   4. 搜索浮层
   ============================================================ */
.search-layer {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 14vh 20px 20px;
  background: rgba(18, 22, 30, 0.42);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.search-layer.is-open {
  opacity: 1;
  visibility: visible;
}

.search-panel {
  width: 100%;
  max-width: 620px;
  padding: 22px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  transform: translateY(-14px) scale(0.985);
  transition: transform 0.24s cubic-bezier(0.22, 0.8, 0.3, 1);
}

.search-layer.is-open .search-panel {
  transform: none;
}

.search-form {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px 6px 16px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-form:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.search-form input[type="search"],
.search-form input[type="text"] {
  flex: 1;
  min-width: 0;
  height: 42px;
  border: 0;
  background: transparent;
  font-size: 15.5px;
  outline: none;
}

.search-form button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 42px;
  padding: 0 20px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #fff;
  font-size: 14.5px;
  font-weight: 600;
  transition: background 0.18s ease, transform 0.18s ease;
}

.search-form button:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
}

.search-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  font-size: 12.5px;
  color: var(--text-3);
}

.search-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.search-tags a {
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-2);
}

.search-tags a:hover {
  color: var(--accent-strong);
  border-color: var(--accent-soft-2);
  background: var(--accent-soft);
}

kbd {
  display: inline-block;
  padding: 1px 6px;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--bg-soft);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-2);
}

/* ============================================================
   5. 主体布局
   ============================================================ */
.site-main {
  padding: 26px 0 60px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--sidebar-w);
  gap: 26px;
  align-items: start;
}

.layout--full {
  grid-template-columns: minmax(0, 1fr);
}

.content-col {
  min-width: 0;
}

/* ============================================================
   6. 首页 Hero
   ============================================================ */
.hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 22px;
  padding: 40px 38px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background:
    radial-gradient(760px 300px at 88% -30%, var(--accent-soft-2), transparent 70%),
    radial-gradient(520px 260px at 4% 120%, rgba(72, 184, 247, 0.16), transparent 72%),
    var(--card);
  box-shadow: var(--shadow-sm);
}

.hero::after {
  content: "";
  position: absolute;
  right: -70px;
  top: -70px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  border: 26px solid var(--accent-soft);
  pointer-events: none;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 14px;
  padding: 5px 13px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.hero-eyebrow .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft-2);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.78); opacity: 0.65; }
}

.hero h1 {
  position: relative;
  max-width: 640px;
  font-size: clamp(24px, 3.1vw, 34px);
  line-height: 1.32;
  letter-spacing: -0.025em;
}

.hero h1 em {
  font-style: normal;
  background: linear-gradient(120deg, var(--accent) 0%, #48b8f7 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-desc {
  position: relative;
  max-width: 560px;
  margin: 12px 0 0;
  font-size: 14.5px;
  color: var(--text-2);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 40px;
  padding: 0 20px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-size: 14.5px;
  font-weight: 600;
  transition: all 0.18s ease;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 20px var(--accent-soft-2);
}

.btn-primary:hover {
  background: var(--accent-strong);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 10px 24px var(--accent-soft-2);
}

.btn-ghost {
  background: var(--card);
  border-color: var(--border);
  color: var(--text-2);
}

.btn-ghost:hover {
  color: var(--accent-strong);
  border-color: var(--accent-soft-2);
  background: var(--accent-soft);
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px dashed var(--border-strong);
}

.hero-stats .num {
  display: block;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hero-stats .lbl {
  font-size: 12.5px;
  color: var(--text-3);
}

/* ============================================================
   7. 区块标题
   ============================================================ */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 6px 0 16px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-title::before {
  content: "";
  width: 4px;
  height: 17px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--accent), #48b8f7);
}

.section-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--text-3);
}

.section-more:hover {
  color: var(--accent-strong);
}

/* ============================================================
   8. 文章卡片
   ============================================================ */
.post-grid {
  display: grid;
  /* 后台「首页每行文章数」控制，默认 2，最多 3 */
  grid-template-columns: repeat(var(--grid-cols, 2), minmax(0, 1fr));
  gap: 22px;
}

.post-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  transition: transform 0.26s cubic-bezier(0.22, 0.8, 0.3, 1),
    box-shadow 0.26s ease, border-color 0.26s ease;
}

.post-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}

/* 封面：默认按图片原始比例自适应（--cover-ratio: auto），
   超过 --cover-max 高度才裁切；也可在后台固定为 16:9 / 4:3 / 1:1。 */
.post-cover {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--bg-soft);
}

.post-cover img {
  display: block;
  width: 100%;
  height: auto;
  max-height: var(--cover-max, 320px);
  aspect-ratio: var(--cover-ratio, 16 / 9);
  object-fit: cover;
  object-position: center;
  transition: transform 0.5s cubic-bezier(0.22, 0.8, 0.3, 1);
}

.post-card:hover .post-cover img {
  transform: scale(1.045);
}

.post-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(16, 20, 27, 0) 52%, rgba(16, 20, 27, 0.42));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.post-card:hover .post-cover::after {
  opacity: 1;
}

/* 纯文字文章：随机渐变色封面（颜色由文章 ID 决定，刷新不会变） */
.post-cover--color {
  aspect-ratio: var(--cover-ratio, 16 / 9);
  background-color: var(--bg-soft);
}

.post-cover--color .cover-mark {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: clamp(26px, 5vw, 40px);
  font-weight: 800;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.94);
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.22);
}

/* 角标 */
.card-badges {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  display: flex;
  gap: 6px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 9px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1;
  backdrop-filter: blur(8px);
}

.pill-pin {
  background: rgba(232, 85, 74, 0.92);
  color: #fff;
}

.pill-rec {
  background: rgba(247, 201, 72, 0.95);
  color: #6b4d00;
}

.pill svg {
  width: 11px;
  height: 11px;
  stroke-width: 2;
}

.pill-cat {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  background: rgba(23, 26, 33, 0.6);
  color: #fff;
  font-weight: 500;
}

.post-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  padding: 16px 18px 15px;
}

.post-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 16.5px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: -0.015em;
}

.post-title a {
  color: var(--text);
}

.post-card:hover .post-title a {
  color: var(--accent-strong);
}

.post-abstract {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 8px 0 0;
  font-size: 13.5px;
  line-height: 1.68;
  color: var(--text-2);
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 7px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--text-2);
  transition: all 0.16s ease;
}

.tag-chip:hover {
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-color: var(--accent-soft-2);
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: auto;
  padding-top: 14px;
  font-size: 12px;
  color: var(--text-3);
}

.card-meta .meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.card-meta svg {
  width: 13px;
  height: 13px;
  opacity: 0.85;
}

.card-meta .dot-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--border-strong);
}

/* 横向卡片列表（带缩略图） */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.post-row {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 18px;
  padding: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
}

.post-row:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.post-row .post-cover {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-sm);
}

.post-row .post-cover img {
  height: 100%;
  max-height: none;
  aspect-ratio: auto;
}

.post-row .post-body {
  padding: 2px 4px 2px 0;
  justify-content: center;
}

.post-row .post-title {
  font-size: 16.5px;
}

/* ============================================================
   9. 精选横排（Deck）
   ============================================================ */
.deck-card {
  padding: 8px 6px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
}

.deck-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  transition: background 0.18s ease;
}

.deck-item + .deck-item {
  border-top: 1px dashed var(--border);
}

.deck-item:hover {
  background: var(--bg-soft);
}

.deck-index {
  flex: 0 0 auto;
  width: 24px;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-3);
  text-align: center;
}

.deck-item:nth-child(1) .deck-index { color: #e8554a; }
.deck-item:nth-child(2) .deck-index { color: #f0a24b; }
.deck-item:nth-child(3) .deck-index { color: #f7c948; }

.deck-main {
  flex: 1 1 auto;
  min-width: 0;
}

.deck-title {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.deck-abstract {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--text-3);
}

.deck-date {
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   10. 侧栏
   ============================================================ */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: calc(var(--header-h) + 18px);
}

.aside-card {
  padding: 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
}

.aside-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.aside-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
}

.aside-title::before {
  content: "";
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: var(--accent);
}

.aside-more {
  font-size: 12px;
  color: var(--text-3);
}

/* 作者卡 */
.author-card {
  text-align: center;
}

.author-avatar {
  width: 74px;
  height: 74px;
  margin: 2px auto 12px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--card);
  box-shadow: 0 0 0 2px var(--accent-soft-2), var(--shadow-sm);
}

.author-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.author-name {
  font-size: 16px;
  font-weight: 700;
}

.author-bio {
  margin: 8px 0 0;
  font-size: 12.8px;
  line-height: 1.7;
  color: var(--text-2);
}

.author-social {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}

.author-social a {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text-2);
  transition: all 0.18s ease;
}

.author-social a:hover {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.author-social svg {
  width: 16px;
  height: 16px;
}

.author-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}

.author-stats b {
  display: block;
  font-size: 16px;
  font-weight: 700;
}

.author-stats span {
  font-size: 11.5px;
  color: var(--text-3);
}

/* 热门文章 */
.rank-list li + li {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}

.rank-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.rank-no {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border-radius: 6px;
  background: var(--bg-soft);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.rank-list li:nth-child(1) .rank-no { background: #fdecea; color: #e8554a; }
.rank-list li:nth-child(2) .rank-no { background: #fdf1e3; color: #e08a2b; }
.rank-list li:nth-child(3) .rank-no { background: #fdf7e0; color: #c9a227; }

html[data-theme="dark"] .rank-list li:nth-child(1) .rank-no { background: rgba(232, 85, 74, 0.18); }
html[data-theme="dark"] .rank-list li:nth-child(2) .rank-no { background: rgba(224, 138, 43, 0.18); }
html[data-theme="dark"] .rank-list li:nth-child(3) .rank-no { background: rgba(201, 162, 39, 0.18); }

.rank-title {
  display: block;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.55;
  color: var(--text);
}

.rank-meta {
  display: block;
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--text-3);
}

/* 标签云 */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-cloud a {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border-radius: 9px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-2);
  transition: all 0.16s ease;
}

.tag-cloud a:hover {
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-color: var(--accent-soft-2);
  transform: translateY(-1px);
}

.tag-cloud .count {
  margin-left: 5px;
  font-size: 11px;
  color: var(--text-3);
}

/* 可点击月份/归档列表 */
.mini-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  font-size: 13.5px;
  color: var(--text-2);
  border-bottom: 1px dashed var(--border);
}

.mini-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.mini-list li a {
  color: var(--text-2);
}

.mini-list li a:hover {
  color: var(--accent-strong);
}

.mini-list .num {
  font-size: 12px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

/* 侧栏 CTA 卡 */
.aside-cta {
  position: relative;
  overflow: hidden;
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--accent-soft-2);
  background:
    radial-gradient(280px 140px at 100% 0%, var(--accent-soft-2), transparent 70%),
    var(--card);
}

.aside-cta h3 {
  font-size: 15.5px;
}

.aside-cta p {
  margin: 6px 0 14px;
  font-size: 12.8px;
  color: var(--text-2);
}

/* ============================================================
   11. 归档 / 列表页头
   ============================================================ */
.page-head {
  margin-bottom: 20px;
  padding: 24px 26px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
}

.page-head h1 {
  font-size: 23px;
  letter-spacing: -0.02em;
}

.page-head .desc {
  margin: 6px 0 0;
  font-size: 13.5px;
  color: var(--text-2);
}

.page-head .count {
  margin-left: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  font-size: 12.5px;
  color: var(--text-3);
}

.breadcrumb a {
  color: var(--text-3);
}

.breadcrumb a:hover {
  color: var(--accent-strong);
}

.breadcrumb .sep {
  opacity: 0.6;
}

/* 筛选条 */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.filter-bar select {
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  font-size: 13px;
  color: var(--text-2);
}

/* ============================================================
   12. 单篇文章
   ============================================================ */
.article {
  padding: 30px 34px 34px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
}

.article-header {
  margin-bottom: 22px;
}

.article-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.article-cats a {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 11px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 600;
}

.article-title {
  font-size: clamp(22px, 2.7vw, 30px);
  line-height: 1.36;
  letter-spacing: -0.028em;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-top: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
  font-size: 12.8px;
  color: var(--text-3);
}

.article-meta .meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.article-meta svg {
  width: 14px;
  height: 14px;
}

.article-cover {
  margin: 0 0 24px;
  overflow: hidden;
  border-radius: var(--radius-sm);
}

.article-cover img {
  width: 100%;
  display: block;
}

/* 正文排版 */
.entry-content {
  font-size: 15.5px;
  line-height: 1.95;
  color: var(--text);
  word-break: break-word;
}

.entry-content > *:first-child {
  margin-top: 0;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
  position: relative;
  margin: 2em 0 0.7em;
  scroll-margin-top: calc(var(--header-h) + 20px);
}

.entry-content h2 {
  font-size: 22px;
  padding-left: 14px;
}

.entry-content h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.24em;
  bottom: 0.24em;
  width: 4px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--accent), #48b8f7);
}

.entry-content h3 {
  font-size: 18.5px;
}

.entry-content h4 {
  font-size: 16.5px;
}

.entry-content p {
  margin: 0 0 1.15em;
}

.entry-content a {
  color: var(--accent-strong);
  border-bottom: 1px solid var(--accent-soft-2);
  transition: border-color 0.18s ease, background 0.18s ease;
}

.entry-content a:hover {
  border-bottom-color: var(--accent);
  background: var(--accent-soft);
}

.entry-content ul,
.entry-content ol {
  margin: 0 0 1.15em;
  padding-left: 1.4em;
}

.entry-content ul { list-style: disc; }
.entry-content ol { list-style: decimal; }

.entry-content li {
  margin-bottom: 0.4em;
}

.entry-content li::marker {
  color: var(--accent);
}

.entry-content blockquote {
  position: relative;
  margin: 1.4em 0;
  padding: 16px 20px 16px 22px;
  background: var(--bg-soft);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-2);
  font-size: 14.8px;
}

.entry-content blockquote p:last-child {
  margin-bottom: 0;
}

.entry-content code {
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 13.2px;
  color: var(--accent-strong);
}

.entry-content pre {
  position: relative;
  margin: 1.4em 0;
  padding: 18px 20px;
  overflow-x: auto;
  border-radius: var(--radius-sm);
  background: #1c2029;
  border: 1px solid #2b3140;
  color: #d7dee9;
  font-family: var(--font-mono);
  font-size: 13.2px;
  line-height: 1.72;
}

.entry-content pre code {
  padding: 0;
  background: none;
  border: 0;
  color: inherit;
  font-size: inherit;
}

.entry-content img {
  border-radius: var(--radius-sm);
  display: block;
  margin: 1.4em auto;
}

.entry-content figure {
  margin: 1.4em 0;
}

.entry-content figcaption {
  margin-top: 8px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-3);
}

.entry-content table {
  width: 100%;
  margin: 1.4em 0;
  border-collapse: collapse;
  font-size: 14px;
}

.entry-content th,
.entry-content td {
  padding: 10px 14px;
  border: 1px solid var(--border);
  text-align: left;
}

.entry-content th {
  background: var(--bg-soft);
  font-weight: 600;
}

.entry-content hr {
  margin: 2em 0;
  border: 0;
  border-top: 1px dashed var(--border-strong);
}

.entry-content iframe,
.entry-content video {
  max-width: 100%;
  border-radius: var(--radius-sm);
}

/* 文末标签与分享 */
.article-footer {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* 上下篇 */
.post-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.post-nav a {
  display: block;
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  transition: all 0.2s ease;
}

.post-nav a:hover {
  border-color: var(--accent-soft-2);
  background: var(--accent-soft);
  transform: translateY(-2px);
}

.post-nav .dir {
  display: block;
  margin-bottom: 5px;
  font-size: 11.5px;
  color: var(--text-3);
}

.post-nav .ttl {
  display: block;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.55;
  color: var(--text);
}

.post-nav .next {
  text-align: right;
}

/* 作者名片 */
.author-box {
  display: flex;
  gap: 16px;
  margin-top: 18px;
  padding: 22px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
}

.author-box .author-avatar {
  width: 58px;
  height: 58px;
  margin: 0;
  flex: 0 0 auto;
}

.author-box .author-bio {
  margin: 4px 0 0;
  font-size: 13.2px;
}

/* 目录 */
.toc-card {
  margin-bottom: 18px;
}

.toc-list li {
  padding: 5px 0;
  font-size: 13.2px;
  line-height: 1.6;
  color: var(--text-2);
  border-bottom: 1px dashed transparent;
}

.toc-list li.lvl-3 {
  padding-left: 14px;
  font-size: 12.6px;
  color: var(--text-3);
}

.toc-list a {
  color: inherit;
}

.toc-list a:hover,
.toc-list a.is-active {
  color: var(--accent-strong);
}

/* 阅读进度 */
.read-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--accent), #48b8f7);
  transition: width 0.1s linear;
}

/* ============================================================
   13. 评论
   ============================================================ */
.comments-area {
  margin-top: 18px;
  padding: 26px 28px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
}

.comments-title,
.comment-reply-title {
  font-size: 16.5px;
  font-weight: 700;
}

.comments-title {
  margin-bottom: 18px;
}

.comment-list {
  margin-bottom: 22px;
}

.comment-list .children {
  margin-left: 22px;
  padding-left: 16px;
  border-left: 1px dashed var(--border-strong);
}

.comment-body {
  position: relative;
  padding: 14px 0;
}

.comment-list > li + li > .comment-body {
  border-top: 1px dashed var(--border);
}

.comment-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.comment-author .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border);
}

.comment-author-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}

.comment-time {
  font-size: 11.5px;
  color: var(--text-3);
}

.comment-content {
  padding-left: 46px;
  font-size: 14px;
  color: var(--text-2);
}

.comment-content p:last-child {
  margin-bottom: 0;
}

.comment-reply-link {
  font-size: 12px;
  color: var(--text-3);
}

.comment-reply-link::after {
  content: " →";
}

.reply {
  padding-left: 46px;
}

.comment-list .comment-respond {
  margin-top: 10px;
}

.comment-form {
  display: grid;
  gap: 12px;
}

.comment-form p {
  margin: 0;
}

.comment-form label {
  display: block;
  margin-bottom: 5px;
  font-size: 12.5px;
  color: var(--text-2);
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  padding: 10px 13px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.comment-form input:focus,
.comment-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: var(--card);
}

.comment-form textarea {
  min-height: 120px;
  resize: vertical;
}

.comment-form .form-submit input,
.comment-form input[type="submit"],
.wp-block-button__link,
.entry-content .wp-block-button__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 22px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 18px var(--accent-soft-2);
  transition: all 0.18s ease;
}

.comment-form input[type="submit"]:hover,
.wp-block-button__link:hover {
  background: var(--accent-strong);
  color: #fff;
  transform: translateY(-1px);
}

.comment-form .comment-form-cookies-consent {
  display: flex;
  align-items: center;
  gap: 8px;
}

.comment-form .comment-form-cookies-consent label {
  margin: 0;
}

/* ============================================================
   14. 分页
   ============================================================ */
.pagination {
  display: flex;
  justify-content: center;
  margin-top: 26px;
}

.pagination .nav-links,
.pagination .page-numbers {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card);
  font-size: 13.5px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  transition: all 0.16s ease;
}

.page-numbers:hover {
  color: var(--accent-strong);
  border-color: var(--accent-soft-2);
  background: var(--accent-soft);
}

.page-numbers.current {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 6px 16px var(--accent-soft-2);
}

.page-numbers.dots {
  border: 0;
  background: none;
}

.posts-navigation {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
}

/* ============================================================
   15. 空状态 / 404
   ============================================================ */
.empty-state,
.error-404 {
  padding: 56px 28px;
  text-align: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
}

.empty-mark {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin: 0 auto 18px;
  border-radius: 22px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 30px;
  font-weight: 800;
}

.empty-state h2,
.error-404 h1 {
  font-size: 21px;
}

.empty-state p,
.error-404 p {
  max-width: 420px;
  margin: 8px auto 20px;
  font-size: 13.8px;
  color: var(--text-2);
}

.error-404 .code {
  font-size: clamp(58px, 12vw, 96px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.05em;
  background: linear-gradient(120deg, var(--accent), #48b8f7);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ============================================================
   16. 页脚
   ============================================================ */
.site-footer {
  margin-top: 40px;
  padding: 44px 0 0;
  background: var(--card);
  border-top: 1px solid var(--border);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1.2fr;
  gap: 34px;
  padding-bottom: 34px;
}

.footer-brand .brand {
  margin-bottom: 12px;
}

.footer-brand p {
  max-width: 320px;
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-2);
}

.footer-col h4 {
  margin-bottom: 13px;
  font-size: 13.5px;
  font-weight: 700;
}

.footer-col li {
  margin-bottom: 9px;
  font-size: 13px;
}

.footer-col a {
  color: var(--text-2);
}

.footer-col a:hover {
  color: var(--accent-strong);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 18px 0 22px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-3);
}

.footer-bottom a {
  color: var(--text-3);
}

.footer-bottom a:hover {
  color: var(--accent-strong);
}

.footer-bottom .icp {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.footer-social {
  display: flex;
  gap: 8px;
}

.footer-social a {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text-2);
}

.footer-social a:hover {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.footer-social svg {
  width: 15px;
  height: 15px;
}

/* 回到顶部 */
.to-top {
  position: fixed;
  right: 24px;
  bottom: 26px;
  z-index: 80;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text-2);
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.24s ease;
}

.to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.to-top:hover {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.to-top svg {
  width: 18px;
  height: 18px;
}

/* 移动端底部导航 */
.mobile-dock {
  display: none;
}

/* ============================================================
   17. 动效
   ============================================================ */
/* 默认可见；仅当 JS 确认可用（html.reveal-ready）时才隐藏待入场元素，
   避免脚本失败 / 观察器不可用时正文整块不可见。 */
.reveal {
  transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.22, 0.8, 0.3, 1);
}

html.reveal-ready .reveal:not(.is-in) {
  opacity: 0;
  transform: translateY(14px);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ============================================================
   18. WP 对齐 / 工具类
   ============================================================ */
.alignleft {
  float: left;
  margin: 0.4em 1.4em 1em 0;
}

.alignright {
  float: right;
  margin: 0.4em 0 1em 1.4em;
}

.aligncenter {
  display: block;
  margin: 1.4em auto;
}

.wp-caption {
  max-width: 100%;
}

.wp-caption-text {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--text-3);
  text-align: center;
}

.sticky-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 8px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 600;
}

/* ============================================================
   19. 响应式
   ============================================================ */
@media (max-width: 1080px) {
  :root {
    --sidebar-w: 280px;
  }
  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
  .footer-col:last-child {
    grid-column: span 3;
  }
}

@media (max-width: 960px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .post-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sidebar {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
  .main-nav {
    display: none;
  }
  .menu-toggle {
    display: grid;
  }
  .header-actions .search-btn {
    display: none;
  }
  .hero {
    padding: 30px 26px;
  }
}

@media (max-width: 720px) {
  :root {
    --header-h: 58px;
  }
  body {
    font-size: 14.5px;
  }
  .wrap {
    padding: 0 15px;
  }
  .site-main {
    padding: 16px 0 40px;
  }
  .post-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
  .hero {
    padding: 26px 20px;
    border-radius: var(--radius);
  }
  .hero-stats {
    gap: 20px;
  }
  .post-row {
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 12px;
    padding: 10px;
  }
  .post-row .post-abstract {
    display: none;
  }
  .post-row .post-body {
    padding: 0;
  }
  .post-row .card-tags {
    display: none;
  }
  .post-row .card-meta {
    padding-top: 8px;
  }
  .sidebar {
    grid-template-columns: minmax(0, 1fr);
  }
  .article {
    padding: 20px 18px 24px;
  }
  .article-title {
    font-size: 21px;
  }
  .entry-content {
    font-size: 15px;
    line-height: 1.85;
  }
  .entry-content h2 {
    font-size: 19.5px;
  }
  .entry-content h3 {
    font-size: 17px;
  }
  .comments-area {
    padding: 20px 18px;
  }
  .comment-content {
    padding-left: 0;
    margin-top: 8px;
  }
  .reply {
    padding-left: 0;
  }
  .post-nav {
    grid-template-columns: minmax(0, 1fr);
  }
  .post-nav .next {
    text-align: left;
  }
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
  }
  .footer-brand,
  .footer-col:last-child {
    grid-column: span 2;
  }
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .to-top {
    right: 14px;
    bottom: 76px;
  }
  .page-head {
    padding: 18px 18px;
  }
  .author-box {
    padding: 16px;
  }

  /* 移动端抽屉导航 */
  .mobile-nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    z-index: 95;
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
    padding: 14px 16px 22px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.22s ease;
  }

  body.nav-open .mobile-nav {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .mobile-nav ul {
    display: block;
  }

  .mobile-nav a {
    display: block;
    padding: 11px 12px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    color: var(--text-2);
  }

  .mobile-nav a:hover,
  .mobile-nav .current-menu-item > a {
    background: var(--accent-soft);
    color: var(--accent-strong);
  }

  .mobile-nav .sub-menu {
    padding-left: 14px;
    border-left: 1px dashed var(--border-strong);
    margin-left: 12px;
  }

  .mobile-nav .sub-menu a {
    font-size: 14px;
    padding: 8px 12px;
  }
}

@media (min-width: 721px) {
  .mobile-nav {
    display: none;
  }
}

@media (max-width: 400px) {
  .hero h1 {
    font-size: 21px;
  }
  .post-row {
    grid-template-columns: 100px minmax(0, 1fr);
  }
}

/* 打印 */
@media print {
  .site-header,
  .sidebar,
  .site-footer,
  .to-top,
  .post-nav,
  .comments-area {
    display: none !important;
  }
  .article {
    border: 0;
    box-shadow: none;
    padding: 0;
  }
  body {
    background: #fff;
  }
}

/* ============================================================
   20. 组件细节
   ============================================================ */
.muted {
  font-weight: 500;
  color: var(--text-3);
}

.brand-text {
  max-width: 42vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-form > svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: var(--text-3);
}

.page-numbers svg {
  width: 15px;
  height: 15px;
}

.meta-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  margin-right: 1px;
}

.article-meta a.meta-item {
  color: var(--text-3);
}

.article-meta a.meta-item:hover {
  color: var(--accent-strong);
}

.sticky-badge svg {
  width: 11px;
  height: 11px;
}

/* 文末分享 */
.article-share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
}

.share-label {
  margin-right: 2px;
  font-size: 12.5px;
  color: var(--text-3);
}

.btn-sm {
  height: 32px;
  padding: 0 14px;
  font-size: 12.8px;
  border-radius: var(--radius-pill);
}

.btn-sm svg {
  width: 14px;
  height: 14px;
}

.btn svg {
  width: 15px;
  height: 15px;
}

/* 分页链接（正文内） */
.page-links {
  margin: 22px 0;
  font-size: 13px;
  color: var(--text-3);
}

.page-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  margin-left: 4px;
  padding: 0 8px;
  border-radius: 7px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
}

/* 上一篇 / 下一篇箭头 */
.post-nav .dir {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.post-nav .dir svg {
  width: 13px;
  height: 13px;
}

.post-nav .next .dir {
  justify-content: flex-end;
}

/* 页脚右侧 */
.footer-bottom-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.footer-bottom .icp svg {
  width: 13px;
  height: 13px;
}

.footer-empty {
  font-size: 12.5px;
  color: var(--text-3);
}

/* 评论区辅助 */
.comment-notes,
.no-comments {
  font-size: 12.8px;
  color: var(--text-3);
}

.comment-notes {
  margin-bottom: 12px;
}

.comment-form .required {
  color: var(--danger);
}

.comment-form .comment-form-author,
.comment-form .comment-form-email,
.comment-form .comment-form-url {
  display: grid;
  gap: 4px;
}

.edit-link {
  font-size: 12.5px;
  color: var(--text-3);
}

/* 搜索结果高亮 */
mark {
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--accent-soft-2);
  color: var(--text);
}

/* 小工具通用 */
.widget ul {
  list-style: none;
}

.widget .aside-card + .aside-card {
  margin-top: 18px;
}

.widget_tag_cloud .tagcloud a {
  display: inline-flex;
  align-items: center;
  height: 28px;
  margin: 0 6px 7px 0;
  padding: 0 11px;
  border-radius: 9px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  font-size: 12.5px !important;
  color: var(--text-2);
}

.widget_tag_cloud .tagcloud a:hover {
  color: var(--accent-strong);
  border-color: var(--accent-soft-2);
  background: var(--accent-soft);
}

.widget_recent_entries li,
.widget_archive li,
.widget_categories li,
.widget_pages li,
.widget_meta li,
.widget_nav_menu li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 0;
  font-size: 13.2px;
  color: var(--text-2);
  border-bottom: 1px dashed var(--border);
}

.widget li:last-child {
  border-bottom: 0;
}

.widget_recent_entries a,
.widget_archive a,
.widget_categories a,
.widget_pages a,
.widget_meta a,
.widget_nav_menu a {
  color: var(--text-2);
}

.widget_recent_entries a:hover,
.widget_archive a:hover,
.widget_categories a:hover,
.widget_pages a:hover,
.widget_meta a:hover,
.widget_nav_menu a:hover {
  color: var(--accent-strong);
}

.widget_recent_entries .post-date {
  display: block;
  font-size: 11.5px;
  color: var(--text-3);
}

.footer-col .widget {
  margin-bottom: 22px;
}

/* 归档页列表 */
.archive-list li {
  border-bottom: 1px dashed var(--border);
}

.archive-list li:last-child {
  border-bottom: 0;
}

.archive-list a {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 6px;
  border-radius: 9px;
  transition: background 0.16s ease;
}

.archive-list a:hover {
  background: var(--bg-soft);
}

.archive-list .a-date {
  font-size: 12.5px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.archive-list .a-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.archive-list a:hover .a-title {
  color: var(--accent-strong);
}

.archive-list .a-cat {
  font-size: 11.5px;
  color: var(--text-3);
}

@media (max-width: 720px) {
  .post-nav .next .dir {
    justify-content: flex-start;
  }
  .archive-list a {
    grid-template-columns: 46px minmax(0, 1fr);
  }
  .archive-list .a-cat {
    display: none;
  }
}

/* ============================================================
   21. 小工具兼容（经典小工具 + 区块小工具）
   ============================================================ */
.widget .wp-block-heading,
.widget h4 {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
}

/* 搜索小工具 */
.widget .search-form,
.widget .searchform,
.wp-block-search__inside-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
}

.widget .search-form input[type="search"],
.widget .search-form input[type="text"],
.widget .searchform input[type="text"],
.wp-block-search__input {
  flex: 1;
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  font-size: 13.5px;
  outline: none;
}

.widget .search-form button,
.widget .searchform input[type="submit"],
.wp-block-search__button {
  flex: 0 0 auto;
  height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease;
}

.widget .search-form button:hover,
.widget .searchform input[type="submit"]:hover,
.wp-block-search__button:hover {
  background: var(--accent-strong);
}

.wp-block-search__label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
}

/* 通用列表型小工具 */
.widget .wp-block-latest-posts,
.widget .wp-block-archives,
.widget .wp-block-categories,
.widget .wp-block-latest-comments,
.widget .wp-block-page-list,
.widget .wp-block-navigation__container {
  margin: 0;
  padding: 0;
  list-style: none;
}

.widget .wp-block-latest-posts li,
.widget .wp-block-archives li,
.widget .wp-block-categories li,
.widget .wp-block-latest-comments li,
.widget .wp-block-page-list li,
.widget ul.menu li,
.widget .menu li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 0;
  font-size: 13.2px;
  line-height: 1.6;
  color: var(--text-2);
  border-bottom: 1px dashed var(--border);
}

.widget .wp-block-latest-posts li:last-child,
.widget .wp-block-archives li:last-child,
.widget .wp-block-categories li:last-child,
.widget .wp-block-latest-comments li:last-child,
.widget ul.menu li:last-child {
  border-bottom: 0;
}

.widget .wp-block-latest-posts a,
.widget .wp-block-archives a,
.widget .wp-block-categories a,
.widget .wp-block-latest-comments a,
.widget ul.menu a {
  color: var(--text-2);
}

.widget .wp-block-latest-posts a:hover,
.widget .wp-block-archives a:hover,
.widget .wp-block-categories a:hover,
.widget .wp-block-latest-comments a:hover,
.widget ul.menu a:hover {
  color: var(--accent-strong);
}

.widget .wp-block-latest-posts__post-date,
.widget .wp-block-latest-comments__comment-date,
.widget .wp-block-latest-posts__post-author {
  display: block;
  font-size: 11.5px;
  color: var(--text-3);
}

.widget .wp-block-latest-comments__comment-excerpt p {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--text-3);
}

/* 下拉类小工具 */
.widget select {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  font-size: 13.2px;
  color: var(--text-2);
}

.widget label {
  display: block;
  margin-bottom: 6px;
  font-size: 12.5px;
  color: var(--text-3);
}

/* 日历小工具 */
.widget_calendar table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.widget_calendar th,
.widget_calendar td {
  padding: 4px 2px;
  text-align: center;
  border: 0;
}

.widget_calendar caption {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
}

/* 段落 / 文本 / 图片小工具 */
.widget .textwidget,
.widget .wp-block-paragraph {
  font-size: 13.2px;
  line-height: 1.8;
  color: var(--text-2);
}

.widget img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
}

.widget .wp-block-tag-cloud a,
.widget .tagcloud a {
  display: inline-flex;
  align-items: center;
  height: 27px;
  margin: 0 6px 7px 0;
  padding: 0 11px;
  border-radius: 9px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  font-size: 12.5px !important;
  color: var(--text-2);
}

.widget .wp-block-tag-cloud a:hover,
.widget .tagcloud a:hover {
  color: var(--accent-strong);
  border-color: var(--accent-soft-2);
  background: var(--accent-soft);
}

/* 本地首字母头像 */
.avatar-initial {
  display: grid;
  place-items: center;
  width: var(--av-size, 36px);
  height: var(--av-size, 36px);
  flex: 0 0 auto;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, #48b8f7 100%);
  color: #fff;
  font-weight: 700;
  font-size: calc(var(--av-size, 74px) * 0.38);
  line-height: 1;
  letter-spacing: 0;
  user-select: none;
}

.author-box .author-avatar .avatar-initial {
  border-radius: 50%;
}

/* 区块对齐兜底，避免宽图撑破版心 */
.entry-content .alignwide,
.entry-content .alignfull {
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
}

.entry-content .wp-block-image img {
  border-radius: var(--radius-sm);
}

.entry-content .wp-block-quote {
  border-left: 4px solid var(--accent);
}

.entry-content .wp-block-code,
.entry-content .wp-block-preformatted {
  border-radius: var(--radius-sm);
}

/* 评论回复链接对齐正文 */
.comment-body > .comment-reply-link {
  display: inline-block;
  margin: 2px 0 0 46px;
  font-size: 12px;
  color: var(--text-3);
}

.comment-body > .comment-reply-link:hover {
  color: var(--accent-strong);
}

/* 作者名片里的社交按钮左对齐 */
.author-box .author-social {
  justify-content: flex-start;
  margin-top: 10px;
}

@media (max-width: 720px) {
  .comment-body > .comment-reply-link {
    margin-left: 0;
  }
}


/* ============================================================
   22. 侧栏精选推荐
   ============================================================ */
.pick-list li + li {
  margin-top: 11px;
  padding-top: 11px;
  border-top: 1px dashed var(--border);
}

.pick-item {
  display: flex;
  align-items: center;
  gap: 11px;
}

.pick-thumb {
  position: relative;
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  overflow: hidden;
  border-radius: 11px;
  background: var(--bg-soft);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.pick-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s cubic-bezier(0.22, 0.8, 0.3, 1);
}

.pick-item:hover .pick-thumb img {
  transform: scale(1.08);
}

.pick-mark {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.95);
  font-size: 18px;
  font-weight: 700;
}

.pick-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.pick-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 13.2px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text);
  transition: color 0.16s ease;
}

.pick-item:hover .pick-title {
  color: var(--accent-strong);
}

.pick-meta {
  font-size: 11.5px;
  color: var(--text-3);
}

/* 移动端：封面高度收一点，避免单卡过长 */
@media (max-width: 720px) {
  .post-cover img {
    max-height: 240px;
  }
  .post-cover--color {
    aspect-ratio: 16 / 9;
  }
}

/* 标签芯片内的图标（分类回退时用到，避免 SVG 默认 300×150 撑坏布局） */
.tag-chip svg,
.tag-cloud svg {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  margin-right: 3px;
  opacity: 0.85;
}


/* ============================================================
   23. HTML 文章模式 / 每行三列
   ============================================================ */
.article--html {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.article--html .article-header {
  margin-bottom: 18px;
}

.article--html .entry-content {
  font-size: 15.5px;
}

/* 自定义 HTML 里常用整幅区块，取消主题的圆角裁切干扰 */
.article--html .entry-content > * {
  max-width: 100%;
}

.html-post .site-main {
  padding-top: 18px;
}


/* HTML 文章：去掉主题给标题加的装饰条，完全交给自定义 HTML 控制 */
.article--html .entry-content h2 {
  padding-left: 0;
}

.article--html .entry-content h2::before {
  display: none;
}

.article--html .entry-content h3::before {
  display: none;
}

/* ============================================================
   24. 顶部分类条
   ============================================================ */
.main-nav {
  display: flex;
  justify-content: flex-end;
}

.main-nav > ul,
.main-nav > .menu {
  justify-content: flex-end;
}

.cat-bar {
  position: relative;
  z-index: 60;
  background: color-mix(in srgb, var(--card) 88%, transparent);
  border-bottom: 1px solid var(--border);
}

@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .cat-bar {
    background: var(--card);
  }
}

.cat-bar-inner {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-top: 11px;
  padding-bottom: 11px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.cat-bar-inner::-webkit-scrollbar {
  display: none;
}

.cat-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--bg-soft);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
  transition: all 0.18s ease;
}

.cat-pill:hover {
  color: var(--accent-strong);
  border-color: var(--accent-soft-2);
  background: var(--accent-soft);
}

.cat-pill .n {
  font-size: 11px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.cat-pill.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 6px 16px var(--accent-soft-2);
}

.cat-pill.is-active .n {
  color: rgba(255, 255, 255, 0.8);
}

/* ============================================================
   25. 海报页脚
   ============================================================ */
.poster-footer {
  position: relative;
  margin-top: 48px;
  padding: 0;
  overflow: hidden;
  border-top: 0;
  background: linear-gradient(135deg, #16232b 0%, #0e1a21 55%, #0b141a 100%);
  color: #fff;
}

.poster-footer .footer-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.02);
}

.poster-footer .footer-mask {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(9, 13, 18, 0.5) 0%, rgba(9, 13, 18, 0.78) 62%, rgba(9, 13, 18, 0.9) 100%);
}

.poster-footer .footer-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 24px;
  min-height: 330px;
  padding-top: 62px;
  padding-bottom: 0;
  text-align: center;
}

.footer-site {
  font-size: 12.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}

.footer-slogan {
  font-size: clamp(21px, 3.2vw, 32px);
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: #fff;
  text-shadow: 0 3px 24px rgba(0, 0, 0, 0.4);
}

.footer-days {
  margin: 10px 0 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.68);
}

.footer-days b {
  margin: 0 3px;
  font-size: 16px;
  color: #fff;
}

.poster-footer .footer-bottom {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 16px 0 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.6);
}

.poster-footer .footer-bottom a {
  color: rgba(255, 255, 255, 0.72);
}

.poster-footer .footer-bottom a:hover {
  color: #fff;
}

.poster-footer .footer-social {
  display: flex;
  gap: 8px;
  margin-left: 4px;
}

.poster-footer .footer-social a {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
  transition: all 0.18s ease;
}

.poster-footer .footer-social a:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  transform: translateY(-2px);
}

/* 关闭卡片动画 */
body.no-animate .reveal,
body.no-animate .reveal:not(.is-in) {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

/* 移动端分类条与页脚 */
@media (max-width: 720px) {
  .cat-bar-inner {
    padding-top: 9px;
    padding-bottom: 9px;
    gap: 7px;
  }

  .cat-pill {
    height: 30px;
    padding: 0 12px;
    font-size: 12.5px;
  }

  .poster-footer .footer-inner {
    min-height: 280px;
    padding-top: 48px;
    padding-bottom: 28px;
    gap: 18px;
  }

  .poster-footer .footer-bottom {
    flex-direction: column;
    gap: 8px;
    padding-bottom: 22px;
  }
}

/* 移动端：新增的 flex 规则会覆盖隐藏，这里补回来 */
@media (max-width: 960px) {
  .main-nav {
    display: none;
  }
}

/* ============================================================
   26. 页头：Logo 左右布局 / 菜单驱动的分类条 / 紧凑导航
   ============================================================ */
.site-header.logo-right .main-nav {
  order: 1;
  flex: 0 1 auto;
  justify-content: flex-start;
}

.site-header.logo-right .header-actions {
  order: 2;
  margin-left: auto;
}

.site-header.logo-right .brand {
  order: 3;
}

.site-header.logo-right .main-nav > ul,
.site-header.logo-right .main-nav > .menu {
  justify-content: flex-start;
}

/* 导航更紧凑，永远单行 */
.main-nav a {
  height: 34px;
  padding: 0 11px;
  font-size: 14px;
}

.main-nav > ul,
.main-nav > .menu {
  flex-wrap: nowrap;
}

.brand .custom-logo {
  display: block;
  width: auto;
  max-width: 220px;
  max-height: 38px;
  object-fit: contain;
}

/* 分类条（由菜单输出） */
.cat-bar-inner {
  overflow: visible;
}

.cat-menu {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
  white-space: nowrap;
}

.cat-menu li {
  position: relative;
  flex: 0 0 auto;
}

.cat-menu > li > a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--bg-soft);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
  transition: all 0.18s ease;
}

.cat-menu > li > a:hover {
  color: var(--accent-strong);
  border-color: var(--accent-soft-2);
  background: var(--accent-soft);
}

.cat-menu > li.current-menu-item > a,
.cat-menu > li.current-menu-parent > a,
.cat-menu > li.current-menu-ancestor > a {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 6px 16px var(--accent-soft-2);
}

/* 子菜单下拉 */
.cat-menu .sub-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 80;
  display: none;
  min-width: 156px;
  padding: 7px;
  margin: 0;
  list-style: none;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 13px;
  box-shadow: var(--shadow);
}

.cat-menu li:hover > .sub-menu,
.cat-menu li:focus-within > .sub-menu {
  display: block;
}

.cat-menu .sub-menu a {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12.8px;
  color: var(--text-2);
}

.cat-menu .sub-menu a:hover {
  background: var(--bg-soft);
  color: var(--accent-strong);
}

/* 页脚可编辑内容 */
.footer-content {
  max-width: 780px;
  margin: 16px auto 0;
  font-size: 13px;
  line-height: 1.9;
  color: rgba(255, 255, 255, 0.74);
}

.footer-content p {
  margin: 0 0 0.7em;
}

.footer-content p:last-child {
  margin-bottom: 0;
}

.footer-content a {
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
}

.footer-content a:hover {
  border-bottom-color: #fff;
}

@media (max-width: 960px) {
  .cat-bar-inner {
    overflow-x: auto;
  }

  .brand .custom-logo {
    max-width: 150px;
    max-height: 32px;
  }
}

/* 有 Logo 图片时只显示图片，避免和站点名重复 */
.brand.has-logo .brand-text {
  display: none;
}

.brand .custom-logo {
  max-height: 40px;
}

/* ============================================================
   27. 紧凑双栏页头：细顶栏 + Logo/菜单一行
   ============================================================ */
.site-header.layout-stacked {
  background: var(--card);
}

.layout-stacked .topbar {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
}

.layout-stacked .topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  height: 34px;
}

.layout-stacked .topbar-note {
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.layout-stacked .topbar .header-actions {
  gap: 2px;
  margin: 0;
}

.layout-stacked .topbar .icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

.layout-stacked .topbar .icon-btn svg {
  width: 16px;
  height: 16px;
}

.layout-stacked .brandbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.layout-stacked .brandbar-inner {
  display: flex;
  align-items: center;
  gap: 22px;
  height: 56px;
}

.layout-stacked .brand {
  flex: 0 0 auto;
  gap: 9px;
}

.layout-stacked .brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  font-size: 15px;
}

.layout-stacked .brand-text {
  font-size: 17px;
}

.layout-stacked .main-nav {
  margin-left: auto;
  justify-content: flex-end;
}

.layout-stacked .main-nav > ul,
.layout-stacked .main-nav > .menu {
  justify-content: flex-end;
  gap: 2px;
}

.layout-stacked .main-nav a {
  height: 32px;
  padding: 0 10px;
  font-size: 13.5px;
}

/* 经典布局下顶栏不存在，保持原样 */
@media (max-width: 960px) {
  .layout-stacked .brandbar-inner {
    height: 56px;
  }

  .layout-stacked .topbar-inner {
    height: 36px;
  }
}

/* ============================================================
   28. 代码块：窗口化 + 高亮
   ============================================================ */
.code-window {
  margin: 1.7em 0;
  overflow: hidden;
  background: #1b1f27;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 13px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.16);
}

.code-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 13px;
  background: #151920;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.code-dots {
  display: inline-flex;
  gap: 6px;
}

.code-dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ff5f57;
}

.code-dots i:nth-child(2) {
  background: #febc2e;
}

.code-dots i:nth-child(3) {
  background: #28c840;
}

.code-lang {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.42);
}

.code-copy {
  margin-left: auto;
  height: 24px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.72);
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.16s ease;
}

.code-copy:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.code-body {
  display: flex;
  align-items: flex-start;
  background: #1b1f27;
}

.code-gutter {
  flex: 0 0 auto;
  padding: 15px 10px 15px 14px;
  text-align: right;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.28);
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  user-select: none;
  -webkit-user-select: none;
}

.code-gutter span {
  display: block;
  height: 22.75px;
  font-variant-numeric: tabular-nums;
}

.code-window pre,
.code-window pre[class*="language-"] {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0 !important;
  padding: 15px 17px !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  overflow: auto;
  font-size: 13px;
  line-height: 22.75px;
  tab-size: 2;
}

.code-window code,
.code-window code[class*="language-"] {
  display: block;
  padding: 0 !important;
  background: none !important;
  border: 0 !important;
  font-size: inherit;
  white-space: pre;
  text-shadow: none !important;
}

.code-window ::-webkit-scrollbar {
  height: 8px;
}

.code-window ::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 8px;
}

/* 行内代码保持浅色小药丸 */
.entry-content :not(pre) > code {
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.92em;
}

/* 深色模式下窗口与页面过渡更自然 */
html[data-theme="dark"] .code-window {
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
}

/* ============================================================
   29. 友情链接页
   ============================================================ */
.site-card {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 18px;
  margin: 8px 0 6px;
  background: var(--bg-soft);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.site-card-main {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
  flex: 1 1 auto;
}

.site-card-avatar {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  overflow: hidden;
  border-radius: 13px;
  background: var(--card);
}

.site-card-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.site-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.site-card-info b {
  font-size: 14.5px;
  color: var(--text);
}

.site-card-info span {
  overflow: hidden;
  font-size: 12px;
  color: var(--text-3);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.links-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.link-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.18s ease;
}

.link-card:hover {
  border-color: var(--accent-soft-2);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.link-avatar {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  overflow: hidden;
  border-radius: 12px;
  background: var(--bg-soft);
}

.link-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.link-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.link-name {
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-card:hover .link-name {
  color: var(--accent-strong);
}

.link-desc {
  overflow: hidden;
  font-size: 12px;
  color: var(--text-3);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.links-empty {
  padding: 34px 20px;
  text-align: center;
  background: var(--bg-soft);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.links-empty-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.links-empty h3 {
  margin: 0 0 6px;
  font-size: 15px;
}

.links-empty p {
  margin: 0;
  font-size: 12.8px;
  color: var(--text-3);
}

.apply-card {
  margin-top: 26px;
  padding: 20px 22px;
  background: linear-gradient(135deg, var(--accent-soft), transparent 70%);
  border: 1px solid var(--accent-soft-2);
  border-radius: var(--radius);
}

.apply-card h3 {
  margin: 0 0 10px;
  font-size: 15.5px;
}

.apply-card ul {
  margin: 0 0 16px;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.9;
  color: var(--text-2);
}

.apply-card li {
  margin-bottom: 2px;
}

@media (max-width: 720px) {
  .links-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* 双栏页头是两行结构，取消固定高度，避免与下方内容重叠 */
.site-header.layout-stacked {
  height: auto;
  --header-h: 90px;
}

@media (max-width: 960px) {
  .site-header.layout-stacked {
    --header-h: 92px;
  }
}

/* ============================================================
   30. 双栏页头 v2：顶栏主导航 + 品牌行分类
   ============================================================ */
.layout-stacked .topbar-inner {
  gap: 16px;
}

.layout-stacked .top-nav {
  min-width: 0;
  margin-right: auto;
}

.layout-stacked .top-nav > ul,
.layout-stacked .top-nav > .menu {
  display: flex;
  align-items: center;
  gap: 1px;
  flex-wrap: nowrap;
  margin: 0;
  padding: 0;
  list-style: none;
}

.layout-stacked .top-nav a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 9px;
  border-radius: 7px;
  font-size: 12.5px;
  color: var(--text-3);
  white-space: nowrap;
}

.layout-stacked .top-nav a:hover {
  background: var(--card);
  color: var(--accent-strong);
}

.layout-stacked .top-nav .current-menu-item > a {
  background: var(--card);
  color: var(--text);
  font-weight: 600;
}

.layout-stacked .top-nav .sub-menu {
  position: absolute;
  z-index: 90;
  display: none;
  min-width: 140px;
  margin: 6px 0 0;
  padding: 6px;
  list-style: none;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.layout-stacked .top-nav li {
  position: relative;
}

.layout-stacked .top-nav li:hover > .sub-menu {
  display: block;
}

/* 品牌行：Logo 左，分类右 */
.layout-stacked .brandbar .cat-nav {
  margin-left: auto;
  min-width: 0;
}

.layout-stacked .brandbar .cat-menu {
  display: flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.layout-stacked .brandbar .cat-menu::-webkit-scrollbar {
  display: none;
}

.layout-stacked .brandbar .cat-menu > li > a {
  height: 30px;
  padding: 0 12px;
  font-size: 12.5px;
  border-color: transparent;
  background: transparent;
}

.layout-stacked .brandbar .cat-menu > li > a:hover {
  background: var(--bg-soft);
  border-color: var(--border);
}

.layout-stacked .brandbar .cat-menu > li.current-menu-item > a,
.layout-stacked .brandbar .cat-menu > li.current-menu-parent > a {
  background: var(--accent-soft);
  border-color: var(--accent-soft-2);
  color: var(--accent-strong);
  box-shadow: none;
  font-weight: 600;
}

@media (max-width: 960px) {
  .layout-stacked .top-nav {
    display: none;
  }

  .layout-stacked .brandbar .cat-nav {
    display: none;
  }
}

/* 移动菜单里的分类 */
.mobile-cats {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.mobile-cats-title {
  display: block;
  margin-bottom: 8px;
  font-size: 11.5px;
  letter-spacing: 0.12em;
  color: var(--text-3);
  text-transform: uppercase;
}

.mobile-cats .cat-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ============================================================
   31. 3D 标签球
   ============================================================ */
.tag-sphere {
  position: relative;
  height: 252px;
  margin: 4px 0 2px;
  overflow: hidden;
  touch-action: pan-y;
}

.tag-sphere > a {
  position: absolute;
  top: 50%;
  left: 50%;
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--tag-bg, var(--bg-soft));
  border: 1px solid var(--tag-line, var(--border));
  color: var(--tag-fg, var(--text-2));
  font-size: 12px;
  line-height: 1.5;
  white-space: nowrap;
  will-change: transform, opacity;
  transform: translate(-50%, -50%);
  transition: background 0.18s ease, color 0.18s ease;
}

.tag-sphere > a:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* 关掉 JS 时退化成普通标签云 */
.tag-sphere:not(.is-sphere) {
  height: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  overflow: visible;
}

.tag-sphere:not(.is-sphere) > a {
  position: static;
  transform: none;
  opacity: 1;
}

@media (max-width: 720px) {
  .tag-sphere {
    height: 214px;
  }
}

/* ============================================================
   32. 评论：头像回退 / 三列表单 / 开关 / 来源设备
   ============================================================ */
.avatar-wrap {
  position: relative;
  display: inline-block;
  overflow: hidden;
  border-radius: 50%;
  background: var(--bg-soft);
  vertical-align: middle;
}

.avatar-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-wrap.is-fallback {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent) 0%, #48b8f7 100%);
  color: #fff;
  font-weight: 700;
  font-size: calc(var(--av-size, 36px) * 0.4);
  line-height: 1;
}

.comment-ua {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--bg-soft);
  font-size: 11px;
  color: var(--text-3);
}

/* 名称 / 邮箱 / 网站 同一行 */
.comment-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 12px;
}

.comment-form > p {
  margin: 0 0 14px;
}

.comment-form .comment-form-comment,
.comment-form .comment-notes,
.comment-form .comment-form-cookies-consent,
.comment-form .comment-form-gate,
.comment-form .form-submit,
.comment-form .logged-in-as,
.comment-form .comment-form-title {
  grid-column: 1 / -1;
}

.comment-form-author,
.comment-form-email,
.comment-form-url {
  min-width: 0;
}

/* 评论开关 */
.comment-form-gate .gate {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-size: 13px;
  color: var(--text-2);
  transition: all 0.18s ease;
}

.comment-form-gate .gate:hover {
  border-color: var(--accent-soft-2);
  background: var(--accent-soft);
}

.comment-form-gate input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.gate-track {
  position: relative;
  flex: 0 0 auto;
  width: 40px;
  height: 23px;
  border-radius: 999px;
  background: var(--border);
  transition: background 0.2s ease;
}

.gate-track i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
  transition: transform 0.2s ease;
}

.comment-form-gate input:checked + .gate-track {
  background: var(--accent);
}

.comment-form-gate input:checked + .gate-track i {
  transform: translateX(17px);
}

.comment-form-gate input:focus-visible + .gate-track {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.comment-form .submit[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

@media (max-width: 720px) {
  .comment-form {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* 「全部友链」这类链接右侧小箭头（避免 SVG 默认尺寸把文字挤成竖排） */
.section-more svg {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
}

.section-more {
  white-space: nowrap;
  flex: 0 0 auto;
}

.comment-form-gate {
  margin-top: 4px;
}

/* ============================================================
   33. 评论 Emoji 选择器
   ============================================================ */
.comment-form-comment {
  position: relative;
}

.emoji-wrap {
  position: relative;
  display: inline-block;
  margin-top: 8px;
}

.emoji-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-soft);
  font-size: 12.5px;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.16s ease;
}

.emoji-toggle:hover {
  border-color: var(--accent-soft-2);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.emoji-panel {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  width: 288px;
  max-height: 208px;
  overflow-y: auto;
  padding: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.emoji-panel[hidden] {
  display: none;
}

.emoji-item {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.12s ease, transform 0.12s ease;
}

.emoji-item:hover {
  background: var(--bg-soft);
  transform: scale(1.15);
}

/* ============================================================
   34. 首页友链：一行标签，自动换行
   ============================================================ */
.link-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 10px;
}

.link-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--card);
  font-size: 13px;
  color: var(--text-2);
  transition: all 0.16s ease;
}

.link-chip:hover {
  border-color: var(--accent-soft-2);
  background: var(--accent-soft);
  color: var(--accent-strong);
  transform: translateY(-1px);
}

.link-chip-avatar {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--bg-soft);
}

.link-chip-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.link-chip-avatar .avatar-initial {
  width: 24px;
  height: 24px;
  font-size: 11px;
}

.link-chip-name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* ============================================================
   35. 写作组件（短代码）
   ============================================================ */
.mz-notice {
  margin: 1.6em 0;
  padding: 14px 18px;
  border-radius: 12px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
}

.mz-notice-title {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
  color: var(--text);
}

.mz-notice-body > :last-child {
  margin-bottom: 0;
}

.mz-notice--success {
  border-left-color: #2fbf71;
  background: rgba(47, 191, 113, 0.1);
}

.mz-notice--warn {
  border-left-color: #f0a93b;
  background: rgba(240, 169, 59, 0.12);
}

.mz-notice--error {
  border-left-color: #ee5a52;
  background: rgba(238, 90, 82, 0.1);
}

.mz-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #fff !important;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 6px 16px var(--accent-soft-2);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.mz-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px var(--accent-soft-2);
  color: #fff;
}

.mz-btn--ghost {
  background: var(--bg-soft);
  color: var(--text) !important;
  box-shadow: none;
  border: 1px solid var(--border);
}

.mz-btn--ghost:hover {
  border-color: var(--accent-soft-2);
  color: var(--accent-strong) !important;
}

.mz-download {
  margin: 1.8em 0;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.mz-download-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.mz-download-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.mz-download-meta {
  font-size: 12px;
  color: var(--text-3);
}

.mz-download-desc {
  margin: 8px 0 14px;
  font-size: 13px;
  color: var(--text-2);
}

.mz-download-desc > :last-child {
  margin-bottom: 0;
}

.mz-collapse {
  margin: 1.6em 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
}

.mz-collapse-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 16px;
  border: 0;
  background: var(--bg-soft);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}

.mz-collapse-head i {
  width: 8px;
  height: 8px;
  border-right: 1.8px solid var(--text-3);
  border-bottom: 1.8px solid var(--text-3);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.mz-collapse-head[aria-expanded="true"] i {
  transform: rotate(-135deg);
}

.mz-collapse-body {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
}

.mz-collapse-body > :last-child {
  margin-bottom: 0;
}

.mz-mark {
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(240, 169, 59, 0.28);
  color: inherit;
}

/* 提示框标题图标 */
.mz-notice-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mz-notice-title::before {
  content: "i";
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  font-style: normal;
  line-height: 1;
}

.mz-notice--success .mz-notice-title::before {
  content: "✓";
  background: #2fbf71;
}

.mz-notice--warn .mz-notice-title::before {
  content: "!";
  background: #f0a93b;
}

.mz-notice--error .mz-notice-title::before {
  content: "×";
  background: #ee5a52;
}

/* 评论区头像固定 36px 显示，字号跟着收，避免首字被裁切 */
.comment-author .avatar,
.comment-author .avatar-wrap {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
}

.comment-author .avatar-initial {
  width: 36px;
  height: 36px;
  font-size: 15px;
  line-height: 1;
}

.comment-author .avatar-wrap.is-fallback {
  font-size: 15px;
}

/* 隐藏内容 / 密码 / 视频 */
.mz-locked,
.mz-password {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 1.6em 0;
  padding: 16px 18px;
  border: 1px dashed var(--accent-soft-2);
  border-radius: var(--radius);
  background: var(--accent-soft);
  font-size: 13.5px;
  color: var(--text-2);
}

.mz-locked-icon {
  font-size: 16px;
}

.mz-password input[type="text"] {
  flex: 1 1 160px;
  min-width: 0;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--card);
  font-size: 13px;
}

.mz-password-tip {
  color: #ee5a52;
  font-size: 12px;
}

.mz-revealed {
  margin: 1.4em 0;
  padding: 2px 0;
  border-left: 3px solid var(--accent);
  padding-left: 14px;
}

.mz-video {
  position: relative;
  margin: 1.6em 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
}

.mz-video iframe,
.mz-video video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
}

/* 评论：来源设备图标 + IP 归属地 */
.comment-ua {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.comment-ua svg {
  width: 12px;
  height: 12px;
  opacity: 0.75;
}

.comment-ip {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--bg-soft);
  font-size: 11px;
  color: var(--text-3);
}

/* ============================================================
   36. 知更鸟式内容组件：展开、下载按钮、图集、广告位
   ============================================================ */
.show-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 8px 0;
  padding: 7px 18px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  border: 1px dashed var(--accent-soft-2);
  color: var(--accent-strong);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.16s ease;
}

.show-more:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.section-content {
  margin: 12px 0;
  padding: 14px 16px;
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--bg-soft);
}

.section-content[hidden] {
  display: none;
}

.mz-down {
  margin: 1.5em 0;
  text-align: center;
}

.mz-gallery {
  margin: 1.7em 0;
}

.mz-gallery-inner {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.mz-gallery-inner img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.mz-gallery-count {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-3);
  text-align: right;
}

.mz-ad {
  margin: 1.6em 0;
  text-align: center;
}

.mz-ad img {
  max-width: 100%;
  height: auto;
}

/* fieldset（编辑器里插入的原生标签） */
.entry-content fieldset {
  margin: 1.7em 0;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.entry-content legend {
  padding: 0 8px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--accent-strong);
}

@media (max-width: 720px) {
  .mz-gallery-inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* 文章标题后缀与来源 */
.article-title-suffix {
  margin-left: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-3);
}

.article-source {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--text-3);
}

.article-source a {
  color: var(--accent-strong);
}

/* ============================================================
   37. 首页幻灯横幅
   ============================================================ */
.slide-hero {
  position: relative;
  margin: 0 0 26px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  aspect-ratio: 16 / 7;
  min-height: 260px;
}

.slide-track,
.slide-item {
  position: absolute;
  inset: 0;
}

.slide-item {
  display: block;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.slide-item.is-active {
  opacity: 1;
  visibility: visible;
}

.slide-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.slide-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 48px 26px 20px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.66));
  color: #fff;
}

.slide-title {
  display: block;
  font-size: 20px;
  font-weight: 700;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.slide-desc {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  opacity: 0.85;
}

.slide-dots {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 3;
  display: flex;
  gap: 6px;
}

.slide-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.2s ease;
}

.slide-dots i.is-active {
  width: 20px;
  border-radius: 999px;
  background: #fff;
}

.slide-arrow {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
  opacity: 0;
  visibility: hidden;
  transition: background 0.18s ease, opacity 0.2s ease, visibility 0.2s ease;
}

.slide-hero:hover .slide-arrow,
.slide-hero:focus-within .slide-arrow {
  opacity: 1;
  visibility: visible;
}

.slide-arrow:hover {
  background: rgba(0, 0, 0, 0.55);
}

.slide-prev { left: 14px; }
.slide-next { right: 14px; }

/* ============================================================
   38. 单列列表卡片
   ============================================================ */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.post-list-card {
  display: flex;
  flex-direction: row;
  gap: 16px;
  align-items: stretch;
}

.post-list-cover {
  position: relative;
  flex: 0 0 240px;
  width: 240px;
  aspect-ratio: 16 / 9;
  display: block;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
}

/* 【】文字封面标记：正常换行、居中，字号随文字长度收 */
.cover-mark--bracket {
  font-size: clamp(15px, 2.2vw, 22px) !important;
  letter-spacing: 0.02em !important;
  line-height: 1.5 !important;
  padding: 0 14px;
  text-align: center;
}

/* 列表卡片无图封面也要居中 */
.post-list-cover--color .cover-mark {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.94);
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.22);
  padding: 0 12px;
  text-align: center;
}

.post-list-cover--color .cover-mark--bracket {
  font-size: clamp(14px, 2vw, 18px) !important;
}

.post-list-cover .cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-list-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.post-list-body .post-title {
  font-size: 18px;
}

@media (max-width: 720px) {
  .slide-hero {
    aspect-ratio: 16 / 10;
    min-height: 180px;
  }

  .slide-title { font-size: 16px; }
  .slide-arrow { display: none; }

  .post-list-card {
    flex-direction: column;
  }

  .post-list-cover {
    flex: none;
    width: 100%;
  }
}

/* ============================================================
   39. 相关阅读网格（缩略图上，标题下）
   ============================================================ */
.related-grid {
  display: grid;
  gap: 14px;
}

.related-grid--4,
.related-grid--5 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.related-grid--1 { grid-template-columns: minmax(0, 1fr); }
.related-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.related-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.related-card {
  min-width: 0;
}

.related-cover {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
}

.related-cover .cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.22, 0.8, 0.3, 1);
}

.related-card:hover .related-cover .cover-img {
  transform: scale(1.05);
}

/* 相关阅读无图封面：文字/【】内容居中 */
.related-cover--color .cover-mark {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.94);
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.22);
  padding: 0 10px;
  text-align: center;
  font-size: 15px;
  line-height: 1.5;
}

.related-title {
  margin: 8px 0 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
}

.related-title a {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text);
}

.related-title a:hover {
  color: var(--accent-strong);
}

@media (max-width: 960px) {
  .related-grid--4,
  .related-grid--5 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .related-grid--4,
  .related-grid--5 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* 友链头像：双层结构，favicon 在上、首字母在下 */
.link-avatar {
  position: relative;
  overflow: hidden;
}

.link-avatar .link-initial {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, #48b8f7 100%);
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  line-height: 1;
  user-select: none;
}

.link-avatar .favicon-auto {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #fff;
  border-radius: 12px;
  z-index: 1;
}

/* ============================================================
   40. 图片灯箱
   ============================================================ */
.entry-content img.mizhi-zoomable {
  cursor: zoom-in;
}

.mizhi-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
}

.mizhi-lightbox.is-open {
  display: block;
}

.lb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
}

.lb-stage {
  position: absolute;
  inset: 60px 0 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
}

.lb-img {
  max-width: 60%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.lb-counter {
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
}

.lb-toolbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  pointer-events: none;
}

.lb-toolbar .lb-btn {
  pointer-events: auto;
}

.lb-btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  transition: background 0.16s ease;
}

.lb-btn:hover {
  background: rgba(255, 255, 255, 0.28);
}

.lb-btn svg {
  width: 20px;
  height: 20px;
}

.lb-btn.is-playing {
  background: var(--accent);
}

.lb-browse {
  position: absolute;
  left: 16px;
}

.lb-close {
  position: absolute;
  right: 16px;
}

/* 上一张/下一张：相对灯箱根定位，图片两侧垂直居中，不压图 */
.lb-prev,
.lb-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
}

.lb-prev {
  left: 24px;
}

.lb-next {
  right: 24px;
}

.lb-thumbs {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  overflow-x: auto;
  background: rgba(0, 0, 0, 0.5);
  transform: translateY(100%);
  transition: transform 0.25s ease;
}

.mizhi-lightbox.thumbs-open .lb-thumbs {
  transform: translateY(0);
}

.lb-thumb {
  flex: 0 0 auto;
  width: 60px;
  height: 44px;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0.5;
  border: 2px solid transparent;
}

.lb-thumb.is-active {
  opacity: 1;
  border-color: #fff;
}

/* 评论头像链接 */
.comment-author--link {
  display: inline-block;
  transition: opacity 0.16s ease;
}

.comment-author--link:hover {
  opacity: 0.8;
}

/* Cookie 同意：注意图标 + 文本对齐 */
.comment-form-cookies-consent {
  grid-column: 1 / -1;
  margin: 2px 0 16px;
}

.comment-form-cookies-consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-3);
}

.consent-icon {
  flex: 0 0 auto;
  display: inline-flex;
  margin-top: 1px;
  color: var(--accent);
}

.consent-icon svg {
  width: 15px;
  height: 15px;
}

.consent-text {
  line-height: 1.6;
}

/* 面包屑图标：与文字同高对齐 */
.breadcrumb a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.breadcrumb a svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}


/* ============================================================
   41. 移动端隐藏侧栏（所有小工具）
   ============================================================ */
@media (max-width: 960px) {
  .sidebar,
  .aside-card,
  #sidebar {
    display: none !important;
  }

  .layout {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* ============================================================
   42. 导航 Logo：高度跟随页头，宽度受限
   ============================================================ */
.brand .custom-logo,
.brand img {
  display: block;
  width: auto;
  height: auto;
  max-height: 42px;
  object-fit: contain;
}

.layout-stacked .brand .custom-logo,
.layout-stacked .brand img {
  max-height: 38px;
}

@media (max-width: 960px) {
  .brand .custom-logo,
  .brand img {
    max-height: 32px;
  }
}

@media (max-width: 480px) {
  .brand .custom-logo,
  .brand img {
    max-height: 28px;
    max-width: 140px !important;
  }
}

/* ============================================================
   43. 移动端卡片文字留白优化
   ============================================================ */
@media (max-width: 720px) {
  .post-card .post-body {
    padding: 16px 16px 14px;
  }

  .post-list-card .post-list-body {
    padding: 4px 14px 12px;
  }

  .post-list-cover {
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  }

  .post-title {
    font-size: 16px;
  }

  .post-abstract {
    font-size: 13px;
    margin-top: 6px;
  }

  .section-head {
    padding: 0 2px;
  }
}

/* ============================================================
   44. 版权声明卡片
   ============================================================ */
.copyright-box {
  margin: 22px 0 4px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
}

.copyright-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.copyright-title svg {
  width: 16px;
  height: 16px;
  color: var(--accent);
}

.copyright-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.copyright-list li {
  display: flex;
  gap: 10px;
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-2);
}

.copyright-list li:last-child {
  margin-bottom: 0;
}

.c-label {
  flex: 0 0 auto;
  min-width: 56px;
  font-weight: 600;
  color: var(--text-3);
}

.c-val {
  flex: 1 1 auto;
  min-width: 0;
  word-break: break-all;
}

.c-val a {
  color: var(--accent-strong);
}

.c-val a:hover {
  text-decoration: underline;
}
