/* ============ Y Blog · Aurora 视觉体系 ============ */
:root {
  --bg: #f5f6fa;
  --bg-soft: #ffffff;
  --bg-hover: #f0f2f7;
  --glass: rgba(255, 255, 255, .72);
  --glass-strong: rgba(255, 255, 255, .88);
  --glass-border: rgba(255, 255, 255, .65);
  --text: #17181c;
  --text-2: #4d5359;
  --text-3: #9096a0;
  --border: rgba(20, 22, 40, .09);
  --accent: #6366f1;
  --accent-2: #0ea5e9;
  --accent-3: #d946ef;
  --accent-soft: rgba(99, 102, 241, .1);
  --grad: linear-gradient(120deg, #6366f1 0%, #0ea5e9 50%, #d946ef 100%);
  --shadow: 0 2px 6px rgba(23, 25, 60, .05), 0 16px 40px -16px rgba(23, 25, 60, .14);
  --shadow-lg: 0 6px 18px rgba(23, 25, 60, .08), 0 32px 64px -20px rgba(23, 25, 60, .22);
  --code-bg: #14161d;
  --code-color: #e6e8ee;
  --radius: 20px;
  --radius-sm: 12px;
}
[data-theme="dark"] {
  --bg: #09090f;
  --bg-soft: #12141c;
  --bg-hover: #1a1d28;
  --glass: rgba(22, 24, 36, .6);
  --glass-strong: rgba(18, 20, 30, .82);
  --glass-border: rgba(255, 255, 255, .08);
  --text: #eceef4;
  --text-2: #a4aab8;
  --text-3: #6b7280;
  --border: rgba(255, 255, 255, .08);
  --accent: #8b8df8;
  --accent-2: #38bdf8;
  --accent-3: #e879f9;
  --accent-soft: rgba(139, 141, 248, .13);
  --shadow: 0 2px 6px rgba(0, 0, 0, .35), 0 20px 48px -16px rgba(0, 0, 0, .55);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, .45), 0 36px 72px -24px rgba(0, 0, 0, .65);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
::selection { background: var(--accent); color: #fff; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg); color: var(--text);
  line-height: 1.85; font-size: 16px;
  transition: background .4s, color .4s;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; transition: color .25s; }
a:hover { color: var(--accent-2); }
img { max-width: 100%; border-radius: var(--radius-sm); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--text-3) 45%, transparent); border-radius: 99px; border: 2.5px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }
.wrap { max-width: 900px; margin: 0 auto; padding: 0 22px; }
.wrap-wide { max-width: 1120px; margin: 0 auto; padding: 0 22px; }

/* ============ 阅读进度条 ============ */
/* 放在 .site-head 内部：Safari 对 backdrop-filter 头部外的 fixed 进度条存在合成层遮盖 bug */
.progress-bar {
  position: absolute; top: 0; left: 0; height: 3px; width: 100%;
  transform: scaleX(0); transform-origin: 0 50%; z-index: 20;
  background: var(--grad); pointer-events: none;
  will-change: transform;
}

/* ============ 顶部导航 ============ */
.site-head {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 62%, transparent);
  backdrop-filter: blur(20px) saturate(1.5); -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.logo { display: flex; flex-direction: column; justify-content: center; gap: 1px; color: var(--text); min-width: 0; }
.logo-text { display: flex; flex-direction: column; }
.logo-text b {
  font-weight: 900; font-size: 19px; letter-spacing: -.4px; line-height: 1.25;
  background: var(--grad); background-size: 200% 200%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: gradShift 8s ease infinite;
}
.logo-text small { color: var(--text-3); font-size: 11.5px; line-height: 1.3; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logo:hover .logo-text b { filter: brightness(1.12); }
.logo-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--grad); background-size: 200% 200%;
  animation: gradShift 6s ease infinite;
  box-shadow: 0 0 0 5px var(--accent-soft), 0 0 18px var(--accent);
}
@keyframes gradShift { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.nav-links { display: flex; align-items: center; gap: 2px; }
/* 导航项必须是同一行的 flex 子项：靠基线对齐时 a / div / button 的基线不同，会出现高低错落 */
.nav-menu { display: flex; align-items: center; gap: 2px; }
.nav-menu > * { flex: 0 0 auto; }
.nav-menu a { display: inline-flex; align-items: center; gap: 6px; }
.nav-ico { opacity: .72; flex: 0 0 auto; }
.nav-menu a.on .nav-ico { opacity: 1; }
.nav-links a {
  color: var(--text-2); padding: 7px 14px; border-radius: 10px; font-size: 15px; font-weight: 500;
  transition: all .25s; position: relative;
}
.nav-links a:hover { color: var(--text); background: var(--bg-hover); }
.nav-links a.on { color: var(--accent); font-weight: 600; }
.nav-links a.on::after {
  content: ''; position: absolute; left: 14px; right: 14px; bottom: 2px; height: 2px;
  border-radius: 2px; background: var(--grad);
}
.theme-btn {
  margin-left: 8px; width: 36px; height: 36px; border: 1px solid var(--border);
  border-radius: 11px; background: var(--glass); color: var(--text-2); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; transition: all .3s;
  backdrop-filter: blur(8px);
}
.theme-btn:hover { color: var(--accent); border-color: var(--accent); transform: rotate(20deg) scale(1.08); }
[data-theme=""] .ico-moon { display: block; } [data-theme=""] .ico-sun { display: none; }
[data-theme="dark"] .ico-sun { display: block; } [data-theme="dark"] .ico-moon { display: none; }

/* ============ 极光背景（全页固定层） ============ */
.aurora {
  position: fixed; inset: 0; overflow: hidden; z-index: 0; pointer-events: none;
}
.aurora::after {
  content: ''; position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: .05; mix-blend-mode: overlay;
}
.blob {
  position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5;
  animation: drift 22s ease-in-out infinite alternate;
}
.blob-1 { width: 680px; height: 680px; top: -260px; left: -180px; background: radial-gradient(circle, rgba(99,102,241,.75), transparent 65%); }
.blob-2 { width: 620px; height: 620px; top: -140px; right: -220px; background: radial-gradient(circle, rgba(14,165,233,.65), transparent 65%); animation-delay: -7s; }
.blob-3 { width: 600px; height: 600px; bottom: -300px; left: 28%; background: radial-gradient(circle, rgba(217,70,239,.5), transparent 65%); animation-delay: -14s; }
[data-theme="dark"] .blob { opacity: .34; }
@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(70px, 40px) scale(1.15); }
  100% { transform: translate(-40px, -30px) scale(.92); }
}
/* 首页图片轮播（自动取最新带封面文章） */
.layout-home { margin-top: 4px; }
.slider {
  position: relative; overflow: hidden; border-radius: var(--radius);
  box-shadow: var(--shadow); background: var(--bg-hover);
  aspect-ratio: 16 / 7; min-height: 230px;
}
.slider-track { position: absolute; inset: 0; }
.slide {
  position: absolute; inset: 0; display: flex; align-items: flex-end;
  background-size: cover; background-position: center;
  opacity: 0; transform: scale(1.05); pointer-events: none;
  transition: opacity .7s ease, transform 7s linear;
}
.slide.on { opacity: 1; transform: scale(1); pointer-events: auto; }
.slide::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,14,30,0) 32%, rgba(10,14,30,.55) 68%, rgba(10,14,30,.82));
}
.slide-inner { position: relative; z-index: 2; padding: 24px 30px 26px; color: #fff; width: 100%; opacity: 0; transition: opacity .35s ease; }
.slide.on .slide-inner { opacity: 1; transition-delay: .3s; }
.slide-inner h2 {
  font-size: clamp(18px, 2.5vw, 27px); font-weight: 800; letter-spacing: -.5px;
  line-height: 1.35; margin: 10px 0 7px; text-shadow: 0 3px 18px rgba(0,0,0,.4);
}
.slide-inner small { font-size: 12.5px; opacity: .88; }
.slider-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 38px; height: 38px; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; padding: 0 0 3px;
  font-size: 22px; line-height: 1; color: #fff;
  background: rgba(12,17,35,.34); border: 1px solid rgba(255,255,255,.28);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .3s, background .3s, transform .3s;
}
.slider:hover .slider-nav, .slider-nav:focus-visible { opacity: 1; }
.slider-nav:hover { background: rgba(12,17,35,.62); }
.slider-nav.prev { left: 14px; }
.slider-nav.next { right: 14px; }
.slider-dots { position: absolute; right: 20px; bottom: 20px; z-index: 3; display: flex; gap: 7px; }
.slider-dots button {
  width: 8px; height: 8px; padding: 0; border: 0; border-radius: 99px; cursor: pointer;
  background: rgba(255,255,255,.45); transition: width .3s, background .3s;
}
.slider-dots button.on { width: 24px; background: #fff; }

/* ============ 文章卡片（玻璃） ============ */
.main-area { position: relative; z-index: 1; padding: 20px 22px 70px; min-height: calc(100vh - 220px); }
.section-label {
  display: flex; align-items: center; gap: 14px;
  margin: 30px 0 20px; color: var(--text-3); font-size: 13px; font-weight: 700;
  letter-spacing: 2.5px; text-transform: uppercase;
}
.section-label::before { content: ''; width: 26px; height: 3px; border-radius: 3px; background: var(--grad); }

.post-list { display: flex; flex-direction: column; gap: 20px; }
.post-card {
  position: relative; display: flex;
  background: color-mix(in srgb, var(--bg-soft) 82%, transparent);
  backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: transform .35s cubic-bezier(.2,.8,.3,1), box-shadow .35s;
}
.post-card::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: var(--grad); opacity: 0; transition: opacity .35s;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}
.post-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.post-card:hover::before { opacity: .8; }
.pc-cover {
  flex: 0 0 128px; display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden; text-decoration: none;
}
.pc-cover::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 25%, rgba(255,255,255,.35), transparent 55%);
}
.pc-char {
  font-size: 44px; font-weight: 900; color: rgba(255,255,255,.95);
  text-shadow: 0 4px 18px rgba(0,0,0,.25); transition: transform .4s;
}
.post-card:hover .pc-char { transform: scale(1.18) rotate(-6deg); }
.pc-body { flex: 1; padding: 20px 26px 18px; min-width: 0; }
.pc-meta { display: flex; align-items: center; gap: 8px; color: var(--text-3); font-size: 13px; flex-wrap: wrap; }
.dot { opacity: .6; }
.badge {
  display: inline-block; padding: 2px 11px; border-radius: 99px; font-size: 12px; font-weight: 500;
  background: var(--bg-hover); color: var(--text-2); border: 1px solid var(--border);
  transition: all .25s;
}
a.badge:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.badge-cat { color: #fff; border-color: transparent; background: var(--grad); font-weight: 600; }
.badge-pin { color: #d97706; background: rgba(217,119,6,.13); border-color: transparent; font-weight: 700; }
.badge-ok { color: #059669; background: rgba(5,150,105,.1); border-color: transparent; }
.badge-warn { color: #d97706; background: rgba(217,119,6,.12); border-color: transparent; }
.badge-light { background: rgba(255,255,255,.24); color: #fff; border-color: rgba(255,255,255,.35); backdrop-filter: blur(6px); }
.pc-title { margin: 9px 0 7px; font-size: 20px; line-height: 1.45; letter-spacing: -.3px; }
.pc-title a { color: var(--text); }
.pc-title a:hover { color: var(--accent); }
.pc-excerpt {
  color: var(--text-2); font-size: 14.5px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pc-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 13px; }
.pc-tags { display: flex; gap: 11px; flex-wrap: wrap; font-size: 13px; }
.pc-tags a { color: var(--text-3); font-weight: 500; }
.pc-tags a:hover { color: var(--accent); }
.pc-views { color: var(--text-3); font-size: 13px; white-space: nowrap; }

/* ============ 分页 ============ */
.pager { display: flex; justify-content: center; align-items: center; gap: 9px; margin-top: 40px; flex-wrap: wrap; }
.pg-btn {
  min-width: 38px; height: 38px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 12px; background: var(--bg-soft);
  color: var(--text-2); font-size: 14px; font-weight: 500; box-shadow: var(--shadow);
  transition: all .25s;
}
.pg-btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.pg-btn.on {
  background: var(--grad); background-size: 200% 200%; color: #fff;
  border-color: transparent; font-weight: 700; animation: gradShift 6s ease infinite;
}
.pg-gap { color: var(--text-3); }

/* ============ 文章详情 ============ */
.post-full { margin: 0; }
.pf-head {
  position: relative; margin: 22px 0 0; padding: 64px 48px;
  text-align: center; color: #fff; overflow: hidden;
  border-radius: var(--radius);  /* 与下方正文卡片同款圆角 */
  box-shadow: var(--shadow);
}
.pf-head::before {
  content: ''; position: absolute; inset: 0;
  background: inherit; filter: blur(0);
  box-shadow: inset 0 0 0 9999px rgba(13, 18, 38, .32);  /* 深色底衬，保证白字可读 */
}
.pf-head::after {
  content: ''; position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: .07; mix-blend-mode: overlay;
}
.pf-head-inner { position: relative; z-index: 1; max-width: 840px; margin: 0 auto; }
.pf-head .pc-meta {
  justify-content: center; gap: 10px;
  color: rgba(255,255,255,.92); font-size: 13.5px;
  align-items: center; line-height: 1;
  text-shadow: 0 1px 6px rgba(0,0,0,.35);
}
.pf-head .pc-meta time, .pf-head .pc-meta > span { display: inline-flex; align-items: center; }
.pf-head .badge-light { padding: 4px 14px; font-size: 12.5px; line-height: 1.4; text-shadow: none; }
.pf-head h1 {
  font-size: clamp(26px, 5vw, 42px); margin-top: 18px; letter-spacing: -1px; line-height: 1.32;
  font-weight: 900; text-shadow: 0 4px 24px rgba(0,0,0,.35);
}
.pf-layout { display: flex; gap: 30px; margin: 0 auto; padding: 22px 0 60px; }
.pf-body {
  flex: 1; min-width: 0;
  background: color-mix(in srgb, var(--bg-soft) 88%, transparent);
  backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 40px clamp(22px, 4.5vw, 52px); box-shadow: var(--shadow);
}
.page-title { margin-bottom: 22px; font-size: 30px; font-weight: 900; letter-spacing: -.8px; }
.pf-tags { display: flex; gap: 11px; flex-wrap: wrap; margin-top: 34px; padding-top: 26px; border-top: 1px dashed var(--border); }
.tag-chip {
  padding: 5px 16px; border-radius: 99px; font-size: 13.5px; font-weight: 600;
  background: var(--accent-soft); color: var(--accent); transition: all .25s;
}
.tag-chip:hover { background: var(--accent); color: #fff; transform: translateY(-2px); box-shadow: 0 6px 16px -6px var(--accent); }
.pf-nav { display: flex; gap: 16px; margin-top: 30px; }
.pf-nav > span { flex: 1; }
.pf-nav-item {
  flex: 1; padding: 16px 20px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); transition: all .3s; min-width: 0; position: relative; overflow: hidden;
}
.pf-nav-item::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--grad); opacity: 0; transition: opacity .3s;
}
.pf-nav-item:hover { border-color: transparent; box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.pf-nav-item:hover::before { opacity: 1; }
.pf-nav-item small { display: block; color: var(--text-3); font-size: 12px; font-weight: 600; }
.pf-nav-item b { color: var(--text); font-size: 14px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-nav-item.next { text-align: right; }
.pf-nav-item.next::before { left: auto; right: 0; }

/* ============ 目录 ============ */
.pf-toc {
  flex: 0 0 230px; position: sticky; top: 96px; align-self: flex-start;
  max-height: calc(100vh - 130px); overflow-y: auto; font-size: 13.5px;
  padding: 18px 16px; background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow);
}
.pf-toc h4 {
  color: var(--text-3); font-size: 11.5px; text-transform: uppercase; letter-spacing: 2px;
  margin-bottom: 10px; display: flex; align-items: center; gap: 7px;
}
.pf-toc h4::before { content: ''; width: 14px; height: 3px; border-radius: 3px; background: var(--grad); }
.pf-toc nav { border-left: 2px solid var(--border); }
.pf-toc a {
  display: block; color: var(--text-2); padding: 4px 0 4px 14px;
  border-left: 2px solid transparent; margin-left: -2px; transition: all .25s;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-radius: 0 8px 8px 0;
}
.pf-toc a:hover, .pf-toc a.on { color: var(--accent); border-left-color: var(--accent); background: var(--accent-soft); }
.pf-toc .toc-3 { padding-left: 28px; }

/* ============ Markdown 正文 ============ */
.markdown { font-size: 16.5px; word-break: break-word; }
.markdown h1, .markdown h2, .markdown h3, .markdown h4 { letter-spacing: -.4px; margin: 1.8em 0 .75em; line-height: 1.4; font-weight: 800; scroll-margin-top: 90px; }
.markdown h1 { font-size: 27px; }
.markdown h2 { font-size: 22px; position: relative; padding-left: 16px; }
.markdown h2::before {
  content: ''; position: absolute; left: 0; top: .18em; bottom: .18em; width: 4px; border-radius: 4px;
  background: var(--grad);
}
.markdown h3 { font-size: 18.5px; } .markdown h4 { font-size: 16.5px; color: var(--text-2); }
.markdown p { margin: .9em 0; color: var(--text); }
.markdown blockquote {
  margin: 1.4em 0; padding: 16px 22px; border-left: none;
  background: var(--accent-soft); border-radius: 4px var(--radius-sm) var(--radius-sm) 4px;
  color: var(--text-2); position: relative;
}
.markdown blockquote::before {
  content: '“'; position: absolute; left: 10px; top: -4px; font-size: 44px; font-weight: 900;
  color: var(--accent); opacity: .25; font-family: Georgia, serif;
}
.markdown ul, .markdown ol { padding-left: 1.6em; margin: .9em 0; }
.markdown li { margin: .4em 0; }
.markdown li::marker { color: var(--accent); }
.markdown code {
  background: var(--accent-soft); padding: 2px 8px; border-radius: 7px;
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace; font-size: .87em; color: var(--accent);
}
.markdown pre {
  background: var(--code-bg); border-radius: var(--radius-sm);
  padding: 18px 22px; overflow-x: auto; margin: 1.4em 0; line-height: 1.7;
  box-shadow: var(--shadow); position: relative;
}
.markdown pre::before {
  content: ''; position: sticky; display: block;
}
.markdown pre code { background: none; padding: 0; color: var(--code-color); font-size: 14px; }
.copy-btn {
  position: absolute; top: 10px; right: 12px; padding: 4px 13px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.08);
  color: #aeb4c4; font-size: 12px; cursor: pointer; opacity: 0; transition: all .25s;
  font-family: inherit;
}
.markdown pre:hover .copy-btn { opacity: 1; }
.copy-btn:hover { color: #fff; border-color: rgba(255,255,255,.35); }
.markdown table { border-collapse: separate; border-spacing: 0; width: 100%; margin: 1.4em 0; font-size: 14.5px; display: block; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.markdown th, .markdown td { border-bottom: 1px solid var(--border); padding: 10px 16px; text-align: left; }
.markdown th { background: var(--bg-hover); font-weight: 700; border-bottom: 2px solid var(--border); }
.markdown tr:last-child td { border-bottom: none; }
.markdown tr:nth-child(2n) td { background: color-mix(in srgb, var(--bg-hover) 45%, transparent); }
.markdown hr { border: none; height: 1px; background: linear-gradient(90deg, transparent, var(--border), transparent); margin: 2.2em 0; }
.markdown a { border-bottom: 1px dashed var(--accent); }
.markdown a:hover { border-bottom-style: solid; }
.markdown img { box-shadow: var(--shadow); }

/* ============ 评论 ============ */
.comments { margin-top: 46px; border-top: 1px solid var(--border); padding-top: 32px; }
.sec-title { font-size: 20px; margin-bottom: 18px; letter-spacing: -.4px; font-weight: 800; }
.sec-title small { color: var(--text-3); font-weight: 500; font-size: 14px; }
.comment { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px dashed var(--border); }
.c-avatar {
  flex: 0 0 42px; height: 42px; border-radius: 50%; color: #fff; font-weight: 800;
  display: flex; align-items: center; justify-content: center; font-size: 17px;
  box-shadow: var(--shadow);
}
.c-main { flex: 1; min-width: 0; }
.c-head { display: flex; gap: 10px; align-items: baseline; font-size: 14.5px; }
.c-head time { color: var(--text-3); font-size: 12.5px; }
.c-main p { font-size: 14.5px; color: var(--text-2); margin-top: 3px; word-break: break-word; }
.c-form-wrap {
  margin-top: 28px; background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 24px;
}
.c-form-wrap h4 { margin-bottom: 15px; font-weight: 800; }
.c-form-row { display: flex; gap: 13px; }
.c-form input, .c-form textarea, .post-form input, .post-form textarea, .post-form select,
.search-form input, .login-card input, .inline-add input {
  width: 100%; padding: 11px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-soft); color: var(--text); font-size: 14.5px; font-family: inherit;
  transition: border-color .25s, box-shadow .25s;
}
.c-form input:focus, .c-form textarea:focus, .post-form input:focus, .post-form textarea:focus, .post-form select:focus,
.search-form input:focus, .login-card input:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft);
}
.c-form .c-form-row { margin-bottom: 13px; }
.c-form textarea { margin-bottom: 13px; resize: vertical; }
.hp-field { position: absolute; left: -9999px; height: 0; opacity: 0; }
.flash-msg {
  padding: 12px 18px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 14.5px; font-weight: 500;
  background: var(--accent-soft); color: var(--accent); border: 1px solid transparent;
  animation: slideDown .4s cubic-bezier(.2,.8,.3,1);
}
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.flash-msg.err { background: rgba(220,38,38,.08); color: #dc2626; }
.flash-msg.ok { background: rgba(5,150,105,.08); color: #059669; }

/* ============ 按钮 ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 22px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg-soft); color: var(--text); font-size: 14.5px; cursor: pointer;
  font-family: inherit; font-weight: 500; transition: all .25s; text-decoration: none;
}
.btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.btn-primary {
  background: var(--grad); background-size: 200% 200%;
  color: #fff; border-color: transparent; font-weight: 700;
  box-shadow: 0 8px 20px -8px var(--accent);
  animation: gradShift 6s ease infinite;
}
.btn-primary:hover { color: #fff; opacity: .93; transform: translateY(-2px); box-shadow: 0 12px 26px -8px var(--accent); }
.btn-danger { color: #dc2626; } .btn-danger:hover { border-color: #dc2626; background: rgba(220,38,38,.06); color: #dc2626; }
.btn-block { width: 100%; }
.btn-sm { padding: 5px 13px; font-size: 13px; }

/* ============ 列表头 / 归档 / 搜索 ============ */
.list-head { padding: 20px 0 10px; }
.list-head h1 { font-size: 32px; font-weight: 900; letter-spacing: -1px; }
.list-head p { color: var(--text-3); margin-top: 6px; font-size: 14.5px; }
.archive { margin-top: 16px; }
.ar-year { display: flex; align-items: baseline; gap: 14px; margin: 34px 0 10px; }
.ar-year-num {
  font-size: 30px; font-weight: 900; letter-spacing: -1px;
  background: var(--grad); background-size: 200% 200%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: gradShift 8s ease infinite;
}
.ar-year-count { color: var(--text-3); font-size: 13.5px; }
.ar-list { list-style: none; }
.ar-list li a {
  display: flex; gap: 18px; align-items: baseline; padding: 10px 16px; border-radius: var(--radius-sm);
  color: var(--text); font-weight: 500; transition: all .25s; border: 1px solid transparent;
}
.ar-list li a:hover {
  background: var(--bg-soft); box-shadow: var(--shadow); transform: translateX(6px);
  border-color: var(--border);
}
.ar-list time { color: var(--text-3); font-size: 13.5px; font-family: ui-monospace, Menlo, monospace; flex: 0 0 44px; }
.ar-list span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-form { display: flex; gap: 12px; margin: 16px 0 8px; }
.search-count { color: var(--text-2); margin: 12px 0 18px; font-size: 14.5px; }

/* ============ 空状态 ============ */
.empty-state { text-align: center; padding: 90px 20px; }
.empty-emoji { font-size: 56px; margin-bottom: 16px; animation: floaty 3.5s ease-in-out infinite; display: inline-block; }
@keyframes floaty { 0%,100% { transform: translateY(0);} 50% { transform: translateY(-10px);} }
.empty-state h2 { font-size: 22px; margin-bottom: 8px; font-weight: 800; }
.empty-state p { color: var(--text-2); }

/* ============ 页脚 ============ */
.site-foot {
  position: relative; z-index: 1; border-top: 1px solid var(--border); margin-top: 40px;
  padding: 34px 0 38px; overflow: hidden;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
}
.site-foot::before {
  content: ''; position: absolute; top: -120px; left: 50%; transform: translateX(-50%);
  width: 600px; height: 180px; border-radius: 50%;
  background: radial-gradient(ellipse, var(--accent-soft), transparent 70%);
  pointer-events: none;
}
.site-foot p { color: var(--text-3); font-size: 13.5px; text-align: center; position: relative; }
.foot-links { margin-top: 6px; }
.foot-links a { color: var(--text-3); }
.foot-links a:hover { color: var(--accent); }

/* ============ 登录页 ============ */
.login-body {
  display: flex; align-items: center; justify-content: center; min-height: 100vh;
  background: var(--bg); position: relative; overflow: hidden;
}
.login-body .blob { opacity: .35; }
.login-card {
  position: relative; z-index: 1;
  width: min(400px, 92vw); background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  border-radius: 26px; padding: 42px 36px; box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px);
}
.login-card h1 { font-size: 22px; text-align: center; font-weight: 900; }
.login-sub { text-align: center; color: var(--text-3); margin: 5px 0 24px; font-size: 14px; }
.login-card input { margin-bottom: 14px; }
.login-back { text-align: center; margin-top: 20px; font-size: 13.5px; }
.login-back a { color: var(--text-3); }

/* ============ 后台 ============ */
/* 顶栏 */
.admin-topbar {
  position: sticky; top: 0; z-index: 60; height: 54px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 20px;
  background: color-mix(in srgb, var(--bg) 74%, transparent);
  backdrop-filter: blur(20px) saturate(1.5); -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border-bottom: 1px solid var(--border);
}
.at-logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 16px; color: var(--text); letter-spacing: -.3px; white-space: nowrap; }
.at-logo:hover { color: var(--text); }
.at-tag { font-size: 11.5px; font-weight: 700; color: var(--accent); background: var(--accent-soft); border-radius: 99px; padding: 2px 9px; }
.at-right { display: flex; align-items: center; gap: 4px; }
.at-right > a {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 11px;
  font-size: 13.8px; font-weight: 500; color: var(--text-2); white-space: nowrap; transition: background .2s, color .2s;
}
.at-right > a:hover { color: var(--text); background: var(--bg-hover); }
.at-user { color: var(--text) !important; font-weight: 600 !important; }
.at-user .nav-avatar { width: 24px; height: 24px; font-size: 11.5px; }
.at-logout:hover { color: #ef4444 !important; background: color-mix(in srgb, #ef4444 13%, transparent) !important; }

/* 外壳：左侧竖向菜单 + 内容区 */
.admin-shell { display: grid; grid-template-columns: 214px minmax(0, 1fr); align-items: start; }
.admin-side {
  position: sticky; top: 54px; height: calc(100vh - 54px); overflow-y: auto;
  padding: 16px 12px 26px; border-right: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-soft) 48%, transparent);
}
.admin-menu { display: flex; flex-direction: column; gap: 3px; }
.am-item {
  display: flex; align-items: center; gap: 11px; padding: 8.5px 12px; border-radius: 11px;
  font-size: 14.5px; font-weight: 500; color: var(--text-2); position: relative; white-space: nowrap;
  transition: background .2s, color .2s;
}
.am-item:hover { background: var(--bg-hover); color: var(--text); }
.am-item.on { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.am-item.on::before {
  content: ''; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 0 3px 3px 0; background: var(--grad);
}
.am-ico { flex: 0 0 auto; opacity: .82; }
.am-item.on .am-ico { opacity: 1; }
.am-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.am-item .pending-badge { margin-left: 0; flex: 0 0 auto; }
.side-note { margin-top: 18px; padding: 13px 14px; border-radius: 13px; background: var(--accent-soft); border: 1px solid var(--border); }
.side-note b { display: block; font-size: 13px; margin-bottom: 5px; }
.side-note p { font-size: 12px; color: var(--text-3); line-height: 1.65; }
@media (max-height: 840px) { .side-note { display: none; } }
.admin-main { padding: 28px 32px 72px; max-width: 1260px; margin: 0 auto; width: 100%; }
.sec-bar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; }
.stat-card {
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; text-align: center; box-shadow: var(--shadow); transition: transform .3s;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.stat-card b {
  display: block; font-size: 30px; font-weight: 900; letter-spacing: -1px;
  background: var(--grad); background-size: 200% 200%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: gradShift 8s ease infinite;
}
.stat-card span { color: var(--text-3); font-size: 13.5px; }
.admin-list { background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.admin-row {
  display: flex; align-items: center; gap: 10px; padding: 13px 20px;
  border-bottom: 1px solid var(--border); flex-wrap: wrap; transition: background .2s;
}
.admin-row:last-child { border-bottom: none; }
.admin-row:hover { background: var(--bg-hover); }
.ar-title { color: var(--text); font-weight: 500; flex: 1; min-width: 160px; }
.ar-title:hover { color: var(--accent); }
.admin-row time { color: var(--text-3); font-size: 13px; }
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form input { width: auto; padding: 5px 11px; font-size: 13.5px; }
.post-form label { display: block; font-size: 14px; color: var(--text-2); margin-bottom: 16px; font-weight: 500; }
.post-form input, .post-form textarea, .post-form select { margin-top: 7px; font-size: 15px; }
.post-form textarea#mdEditor { font-family: "SF Mono", ui-monospace, Menlo, monospace; font-size: 14px; line-height: 1.75; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; }
.check-line { display: flex !important; align-items: center; gap: 8px; }
.check-line input { width: auto !important; margin: 0 !important; }
.form-actions { display: flex; gap: 11px; }
.inline-add { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.inline-add input { width: auto; flex: 1; min-width: 140px; }
.comment-row { align-items: flex-start; }
.comment-detail { flex: 1; min-width: 240px; font-size: 14.5px; }
.comment-detail time { color: var(--text-3); font-size: 12.5px; }
.comment-detail p { color: var(--text-2); margin: 4px 0; }
.comment-detail small { color: var(--text-3); }
.row-actions { display: flex; gap: 8px; flex-direction: column; }
.pending-badge {
  background: #d97706; color: #fff; border-radius: 99px; font-size: 11px;
  padding: 0 6px; margin-left: 2px; vertical-align: middle;
}
#mdPreview { border: 1px dashed var(--border); border-radius: var(--radius-sm); padding: 22px; margin-top: 10px; background: var(--bg); }

/* ============ 滚动进场动画 ============ */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s cubic-bezier(.2,.8,.3,1), transform .7s cubic-bezier(.2,.8,.3,1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .blob, .logo-dot { animation: none; }
}

/* ============ 响应式 ============ */
@media (max-width: 900px) {
  .pf-toc { display: none; }
  .pf-layout { padding: 26px 0 46px; }
}
@media (max-width: 640px) {
  .post-card { flex-direction: column; }
  .pc-cover { flex: 0 0 88px; }
  .pc-body { padding: 16px 20px 15px; }
  .pf-nav { flex-direction: column; }
  .pf-nav-item.next { text-align: left; }
  .nav-links a { padding: 6px 9px; font-size: 14px; }
  .slider { aspect-ratio: 4 / 3; min-height: 200px; }
  .slider-nav { display: none; }
  .slide-inner { padding: 18px 20px 20px; }
  .slider-dots { right: 16px; bottom: 16px; }
  .c-form-row { flex-direction: column; gap: 13px; }
  .pf-head { padding: 48px 24px; }
  .post-full { margin: 0; }
  .pf-body { padding: 28px 22px; }
}

/* ==================================================================
   v4 · WordPress 功能对齐样式
   ================================================================== */

/* ---------- 无障碍跳转 ---------- */
.skip-link { position: fixed; left: -999px; top: 8px; z-index: 200; background: var(--accent); color: #fff; padding: 8px 16px; border-radius: 10px; }
.skip-link:focus { left: 12px; }

/* ---------- 导航头像 / 移动菜单 ---------- */
.nav-avatar { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; color: #fff; font-weight: 800; font-size: 13px; }
.nav-login { font-weight: 600; }
.nav-toggle { display: none; }

/* ---------- 两栏布局 ---------- */
.layout-2col { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 34px; align-items: start; }
.col-main { min-width: 0; }
.sidebar { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 86px; }
.widget {
  background: color-mix(in srgb, var(--bg-soft) 84%, transparent);
  backdrop-filter: blur(16px) saturate(1.35); -webkit-backdrop-filter: blur(16px) saturate(1.35);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow);
}
.wg-title { font-size: 14.5px; font-weight: 800; letter-spacing: -.2px; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px dashed var(--border); }
.widget-search { padding: 12px; }
.widget-search form { display: flex; gap: 8px; }
.widget-search input { flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: 12px; padding: 9px 14px; background: var(--bg); color: var(--text); font-size: 14px; }
.widget-search button { border: none; background: var(--grad); color: #fff; border-radius: 12px; width: 40px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.wg-hot { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.wg-hot li { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; line-height: 1.6; }
.wg-hot a { color: var(--text-2); }
.wg-hot a:hover { color: var(--accent); }
.wg-rank { flex: 0 0 20px; height: 20px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; margin-top: 3px; }
.wg-hot li:nth-child(1) .wg-rank { background: var(--grad); color: #fff; }
.wg-cmts { list-style: none; display: flex; flex-direction: column; gap: 12px; font-size: 14px; }
.wg-cmts li b { color: var(--accent); font-size: 13px; }
.wg-cmts li a { display: block; color: var(--text-2); line-height: 1.6; margin: 2px 0; }
.wg-cmts li small { color: var(--text-3); font-size: 12px; }
.wg-list { list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 14.5px; }
.wg-list li { display: flex; justify-content: space-between; align-items: center; }
.wg-list a { color: var(--text-2); }
.wg-list a:hover { color: var(--accent); }
.wg-list span { color: var(--text-3); font-size: 12.5px; background: var(--bg-hover); padding: 1px 9px; border-radius: 99px; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.tag-cloud a { color: var(--text-2); padding: 2px 10px; border-radius: 99px; background: var(--bg-hover); line-height: 1.8; }
.tag-cloud a:hover { background: var(--accent-soft); color: var(--accent); }
.ws-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; text-align: center; }
.ws-grid div { background: var(--bg-hover); border-radius: 12px; padding: 10px 4px; }
.ws-grid b { display: block; font-size: 18px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ws-grid span { font-size: 12px; color: var(--text-3); }

/* ---------- 面包屑 ---------- */
.crumbs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13.5px; color: var(--text-3); padding: 18px 0 6px; }
.crumbs i { font-style: normal; opacity: .5; }
.crumbs a { color: var(--text-3); }
.crumbs a:hover { color: var(--accent); }
.crumbs span { color: var(--text-2); }

/* ---------- 文章卡片增强 ---------- */
.pc-cover.has-img { background-size: cover !important; background-position: center; }
.pc-cover.has-img::after { background: radial-gradient(circle at 30% 25%, rgba(255,255,255,.16), transparent 60%); }
.pc-stats { display: inline-flex; gap: 10px; color: var(--text-3); font-size: 12.5px; white-space: nowrap; }
.pc-avatar { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; color: #fff; font-weight: 800; font-size: 15px; flex: 0 0 auto; }
.pc-avatar.lg { width: 46px; height: 46px; font-size: 20px; }
.pc-avatar.xl { width: 76px; height: 76px; font-size: 32px; }

/* ---------- 文章头作者 / 点赞分享 ---------- */
.pf-author {
  display: inline-flex; align-items: center; gap: 9px; margin-top: 20px;
  padding: 5px 16px 5px 5px; border-radius: 99px; font-size: 13.5px; font-weight: 600;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.26);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  text-shadow: 0 1px 6px rgba(0,0,0,.3);
}
.pf-author .pc-avatar { width: 26px; height: 26px; font-size: 12.5px; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.pf-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 30px; padding-top: 22px; border-top: 1px dashed var(--border); }
.like-btn {
  border: 1px solid var(--border); background: var(--bg-soft); color: var(--text-2);
  padding: 9px 20px; border-radius: 99px; font-size: 14.5px; font-weight: 600; cursor: pointer; transition: all .25s;
}
.like-btn:hover { border-color: var(--accent-3); color: var(--accent-3); transform: translateY(-2px); }
.like-btn.on { background: linear-gradient(120deg, #f43f5e, #d946ef); color: #fff; border-color: transparent; }
.like-heart { font-size: 15px; }
.share-box { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13.5px; }
.share-label { color: var(--text-3); }
.sh { padding: 6px 14px; border-radius: 99px; background: var(--bg-hover); color: var(--text-2); border: 1px solid transparent; cursor: pointer; font-size: 13.5px; font-family: inherit; }
.sh:hover { background: var(--accent-soft); color: var(--accent); }

/* ---------- 作者卡 ---------- */
.author-box { display: flex; gap: 16px; align-items: flex-start; margin-top: 30px; padding: 22px; border-radius: var(--radius); background: var(--accent-soft); border: 1px solid var(--border); }
.author-box b { font-size: 16px; }
.author-box p { color: var(--text-2); font-size: 14px; margin: 4px 0 6px; }
.author-box a { font-size: 13.5px; }
.author-hero { display: flex; gap: 22px; align-items: center; padding: 34px; margin: 12px 0 26px; border-radius: var(--radius);
  background: color-mix(in srgb, var(--bg-soft) 85%, transparent); border: 1px solid var(--border); box-shadow: var(--shadow); }
.author-hero h1 { font-size: 26px; letter-spacing: -.6px; }
.author-hero p { color: var(--text-2); margin: 6px 0; }

/* ---------- 相关文章 ---------- */
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.rel-card { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border-radius: var(--radius-sm); background: var(--bg-hover); border: 1px solid transparent; transition: all .25s; }
.rel-card b { font-size: 14.8px; color: var(--text); line-height: 1.55; }
.rel-card small { color: var(--text-3); font-size: 12.5px; }
.rel-card:hover { border-color: var(--accent); transform: translateY(-3px); }

/* ---------- 评论（楼中楼） ---------- */
.c-list { display: flex; flex-direction: column; gap: 18px; margin-bottom: 30px; }
.comment { display: flex; gap: 13px; }
.c-children { margin: 14px 0 0 22px; padding-left: 18px; border-left: 2px solid var(--border); display: flex; flex-direction: column; gap: 14px; }
.comment.is-reply .c-avatar { width: 30px; height: 30px; font-size: 13px; }
.c-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.c-head b { font-size: 14.5px; }
.c-site { font-size: 12px; opacity: .7; }
.c-head time { color: var(--text-3); font-size: 12.5px; }
.c-reply { margin-left: auto; border: 1px solid var(--border); background: transparent; color: var(--text-3); font-size: 12.5px; padding: 3px 12px; border-radius: 99px; cursor: pointer; font-family: inherit; }
.c-reply:hover { border-color: var(--accent); color: var(--accent); }
.c-body { font-size: 15px; color: var(--text-2); }
.markdown-mini p { margin: .35em 0; }
.markdown-mini a { text-decoration: underline; }
.c-empty { color: var(--text-3); text-align: center; padding: 22px 0; }
.c-pager { display: flex; gap: 7px; justify-content: center; margin: 6px 0 22px; flex-wrap: wrap; }
.c-pager a { min-width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; border: 1px solid var(--border); color: var(--text-2); font-size: 13.5px; }
.c-pager a.on { background: var(--grad); color: #fff; border-color: transparent; font-weight: 700; }
.reply-hint { font-size: 13px; color: var(--accent); background: var(--accent-soft); padding: 7px 14px; border-radius: 10px; display: flex; justify-content: space-between; gap: 10px; }
.reply-hint button { border: none; background: none; color: var(--text-3); cursor: pointer; font-size: 13px; }
[data-theme="dark"] .markdown-mini img { opacity: .92; }

/* ---------- 密码保护文章 ---------- */
.pass-box { text-align: center; padding: 50px 20px; }
.pass-box .empty-emoji { font-size: 46px; }
.pass-box h3 { margin: 12px 0 20px; font-size: 20px; }
.pass-box form { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.pass-box input { border: 1px solid var(--border); border-radius: 12px; padding: 11px 18px; background: var(--bg); color: var(--text); min-width: 220px; }
.pass-err { color: #ef4444; margin-bottom: 12px; }

/* ---------- 友链 ---------- */
.links-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.link-card { display: flex; gap: 14px; align-items: center; padding: 18px; border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--bg-soft) 85%, transparent); border: 1px solid var(--border); box-shadow: var(--shadow); transition: all .25s; }
.link-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.link-card img, .link-avatar { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; }
.link-card p { color: var(--text-3); font-size: 13px; line-height: 1.6; }

/* ---------- 前台登录/注册 ---------- */
/* 登录/注册页：body 纵向 flex（header/footer 保持正常流），只让 main 里的卡片绝对居中 */
.auth-body { display: flex; flex-direction: column; min-height: 78vh; }
.auth-body .main-area { margin: auto; }
.auth-card {
  width: 100%; max-width: 420px; padding: 38px 34px; border-radius: var(--radius);
  background: color-mix(in srgb, var(--bg-soft) 82%, transparent); backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid var(--border); box-shadow: var(--shadow-lg);
}
.auth-card h1 { font-size: 26px; letter-spacing: -.8px; }
.auth-sub { color: var(--text-3); font-size: 14px; margin: 8px 0 22px; }
.auth-card label { display: block; margin-bottom: 14px; font-size: 14px; color: var(--text-2); }
.auth-card input { width: 100%; margin-top: 7px; border: 1px solid var(--border); border-radius: 12px; padding: 11px 15px; background: var(--bg); color: var(--text); font-size: 15px; }
.auth-foot { text-align: center; margin-top: 18px; font-size: 13.5px; color: var(--text-3); }

/* ---------- 灯箱 / 回到顶部 ---------- */
.markdown img { cursor: zoom-in; }
.lightbox { position: fixed; inset: 0; z-index: 300; background: rgba(6, 8, 15, .9); display: flex; align-items: center; justify-content: center; padding: 30px; backdrop-filter: blur(6px); }
.lightbox[hidden] { display: none !important; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 14px; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.lb-close { position: absolute; top: 18px; right: 26px; font-size: 40px; line-height: 1; color: #fff; cursor: pointer; opacity: .8; }
.lb-close:hover { opacity: 1; }
.to-top {
  position: fixed; right: 24px; bottom: 26px; z-index: 80; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--glass-strong); color: var(--text-2); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; backdrop-filter: blur(12px);
  opacity: 0; pointer-events: none; transform: translateY(14px); transition: all .3s;
}
.to-top.show { opacity: 1; pointer-events: auto; transform: none; }
.to-top:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- 页脚四栏 ---------- */
.foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.1fr; gap: 30px; padding-bottom: 26px; }
.foot-brand b { font-size: 17px; }
.foot-brand p { color: var(--text-3); font-size: 13.5px; margin-top: 8px; }
.foot-social { display: flex; gap: 12px; flex-wrap: wrap; }
.foot-col { display: flex; flex-direction: column; gap: 7px; font-size: 13.5px; }
.foot-col h5 { font-size: 13px; letter-spacing: .6px; text-transform: uppercase; color: var(--text-3); margin-bottom: 3px; }
.foot-col a, .foot-col span { color: var(--text-2); }
.foot-col a:hover { color: var(--accent); }
.foot-bottom { border-top: 1px solid var(--border); padding-top: 18px; text-align: center; color: var(--text-3); font-size: 13px; }

/* ---------- 后台：编辑页布局 ---------- */
[data-theme="dark"] .admin-body { --bg: #09090f; }
.edit-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.edit-main { min-width: 0; }
.title-input { font-size: 22px !important; font-weight: 800; letter-spacing: -.5px; }
.edit-side { display: flex; flex-direction: column; gap: 16px; }
.side-card { background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 18px; box-shadow: var(--shadow); }
.side-card h4 { font-size: 14px; font-weight: 800; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px dashed var(--border); }
.side-card h4 small { color: var(--text-3); font-weight: 500; }
.side-card label { display: block; margin-bottom: 12px; font-size: 13.5px; color: var(--text-2); }
.side-card input, .side-card select, .side-card textarea { width: 100%; margin-top: 6px; border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; background: var(--bg); color: var(--text); font-size: 14px; font-family: inherit; }
.cover-pick img { width: 100%; border-radius: 10px; margin-bottom: 10px; aspect-ratio: 16/9; object-fit: cover; }
.rev-list { list-style: none; display: flex; flex-direction: column; gap: 10px; font-size: 12.5px; }
.rev-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; background: var(--bg-hover); border-radius: 10px; }
.rev-list small { color: var(--text-3); }

/* ---------- 后台：批量 / 筛选 / 统计 ---------- */
.bulk-bar, .filter-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.bulk-bar { background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 16px; }
.bulk-all { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--text-2); }
.bulk-bar select, .filter-bar select, .filter-bar input { border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; background: var(--bg); color: var(--text); font-size: 13.5px; }
.row-check, .row-check-c { width: 17px; height: 17px; accent-color: var(--accent); flex: 0 0 auto; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 26px; align-items: start; }
.quick-links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.qlink { padding: 14px 16px; border-radius: var(--radius-sm); background: var(--bg-soft); border: 1px solid var(--border); color: var(--text-2); font-size: 14px; box-shadow: var(--shadow); transition: all .25s; }
.qlink:hover { transform: translateY(-2px); border-color: var(--accent); color: var(--accent); }
.chart { display: flex; align-items: flex-end; gap: 6px; height: 190px; padding: 18px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 26px; overflow-x: auto; }
.chart .bar { flex: 1 0 18px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; }
.chart .bar-fill { width: 100%; border-radius: 6px 6px 3px 3px; background: var(--grad); opacity: .85; transition: opacity .2s; }
.chart .bar:hover .bar-fill { opacity: 1; }
.chart .bar span { font-size: 10px; color: var(--text-3); margin-top: 6px; white-space: nowrap; }

/* ---------- 后台：媒体库 ---------- */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.media-item { background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow); }
.media-thumb { aspect-ratio: 4/3; background: var(--bg-hover); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.media-thumb img { width: 100%; height: 100%; object-fit: cover; }
.media-item figcaption { padding: 12px; font-size: 12.5px; }
.media-item figcaption b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-item figcaption small { color: var(--text-3); }
.media-actions { display: flex; gap: 6px; margin-top: 9px; }
.reply-form { flex: 1 1 240px; display: flex; gap: 6px; }
.reply-form input { flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: 10px; padding: 7px 12px; background: var(--bg); color: var(--text); font-size: 13.5px; }
.reply-to { color: var(--accent); }

/* ---------- 响应式（v4） ---------- */
@media (max-width: 1080px) {
  .layout-2col { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
  .edit-grid, .dash-grid { grid-template-columns: minmax(0, 1fr); }
  .foot-grid { grid-template-columns: 1fr 1fr; }
}
/* --- 窄屏：导航折叠为汉堡菜单（断点要高于「一级分类直显」所需的宽度，避免菜单项换行） --- */
@media (max-width: 960px) {
  .nav-menu { position: fixed; inset: 66px 0 auto 0; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--glass-strong); backdrop-filter: blur(20px); border-bottom: 1px solid var(--border);
    padding: 10px 16px 18px; display: none; }
  .nav-menu.open { display: flex; }
  .nav-menu a { padding: 12px 10px; border-radius: 10px; }
  .nav-menu a.on::after { display: none; }
  .nav-toggle { display: inline-flex; }
  .foot-grid { grid-template-columns: 1fr; }
  .c-children { margin-left: 8px; padding-left: 12px; }
  .chart { height: 150px; }
  #oml2d-stage { width: 230px !important; height: 230px !important; }
  #oml2d-tips { font-size: 15px !important; }
}

/* ---------- 后台响应式：小屏时侧栏转为顶部横向滚动条 ---------- */
@media (max-width: 960px) {
  .admin-shell { grid-template-columns: minmax(0, 1fr); }
  .admin-side {
    position: static; height: auto; overflow-x: auto; overflow-y: hidden;
    border-right: none; border-bottom: 1px solid var(--border); padding: 10px 12px;
  }
  .admin-menu { flex-direction: row; gap: 6px; padding-bottom: 2px; }
  .am-item { flex: 0 0 auto; padding: 8px 13px; }
  .am-item.on::before { display: none; }
  .side-note { display: none; }
  .admin-main { padding: 20px 16px 60px; max-width: none; }
}
@media (max-width: 560px) {
  .at-logo { font-size: 15px; }
  .at-logo .at-tag { display: none; }
  .at-right > a { padding: 6px 9px; font-size: 13px; }
  .at-user .am-label, .at-user { max-width: 90px; overflow: hidden; }
}

/* ============ 二级分类（一 / 二级层级） ============ */
/* --- 顶部导航：一级分类直显，悬停弹出二级分类 --- */
/* 注意：必须是 inline-flex，否则块级的 div 会在导航里独占一行导致整条导航换行错位 */
.nav-drop { position: relative; display: inline-flex; align-items: center; vertical-align: middle; }
.nav-drop-btn {
  display: inline-flex; align-items: center; gap: 6px; font-family: inherit;
  color: var(--text-2); padding: 7px 14px; border-radius: 10px; font-size: 15px; font-weight: 500;
  background: none; border: none; cursor: pointer; transition: all .25s; position: relative;
  line-height: inherit;   /* button 的 UA 默认 line-height:normal 会让它比相邻 a 矮 3px */
}
.nav-drop:hover .nav-drop-btn, .nav-drop.open .nav-drop-btn { color: var(--text); background: var(--bg-hover); }
.nav-drop.on .nav-drop-btn { color: var(--accent); font-weight: 600; }
.nav-drop.on .nav-drop-btn::after {
  content: ''; position: absolute; left: 14px; right: 14px; bottom: 2px; height: 2px;
  border-radius: 2px; background: var(--grad);
}
.nav-caret {
  width: 7px; height: 7px; border-right: 1.7px solid currentColor; border-bottom: 1.7px solid currentColor;
  transform: rotate(45deg) translate(-2px, -2px); opacity: .55; transition: transform .25s; margin-left: 1px;
}
.nav-drop:hover .nav-caret, .nav-drop.open .nav-caret { transform: rotate(-135deg) translate(-2px, -2px); }
.nav-sub {
  position: absolute; top: calc(100% + 12px); left: 50%; transform: translateX(-50%) translateY(-8px);
  min-width: 172px; max-width: 300px; padding: 8px; z-index: 60;
  background: var(--glass-strong); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transition: opacity .22s, transform .22s, visibility .22s;
  max-height: 66vh; overflow-y: auto;
}
.nav-drop:hover .nav-sub, .nav-drop.open .nav-sub { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.nav-sub::before { content: ''; position: absolute; top: -12px; left: 0; right: 0; height: 12px; }
.nav-sub-row + .nav-sub-row { margin-top: 3px; border-top: 1px dashed var(--border); padding-top: 5px; }
.nav-sub a {
  display: flex !important; align-items: center; justify-content: space-between; gap: 12px;
  padding: 7px 10px !important; border-radius: 9px; color: var(--text-2); font-size: 14px; font-weight: 500;
  background: none; white-space: nowrap;
}
.nav-sub a:hover { color: var(--accent); background: var(--accent-soft); }
.nav-sub a.on { color: var(--accent); background: var(--accent-soft); }
.nav-sub a.on::after { display: none; }
.nav-sub a i { font-style: normal; font-size: 11.5px; color: var(--text-3); background: var(--bg-hover); padding: 0 8px; border-radius: 99px; line-height: 1.7; }
.nav-sub a:hover i { background: var(--accent-soft); color: var(--accent); }
.nav-sub-all { margin-bottom: 5px; padding-bottom: 8px !important; border-bottom: 1px dashed var(--border); font-weight: 600; color: var(--text) !important; }
.nav-sub-lv1 { font-weight: 600; color: var(--text); }
.nav-sub-lv2 { padding-left: 10px; margin-left: 11px; border-left: 1.5px solid var(--border); }
.nav-sub-lv2 a { font-size: 13.5px; }

/* 汉堡菜单里的一级分类：没有悬停，点击展开二级分类
   （必须放在上面的基础样式之后，否则会被同权重的 .nav-sub 基础规则覆盖） */
@media (max-width: 960px) {
  .nav-drop { display: block; width: 100%; }
  .nav-drop-btn { width: 100%; justify-content: space-between; padding: 12px 10px; border-radius: 10px; font-size: 15px; }
  .nav-drop.on .nav-drop-btn::after { display: none; }
  .nav-caret { margin-left: auto; }
  .nav-sub {
    display: none; position: static; transform: none; opacity: 1; visibility: visible;
    box-shadow: none; background: var(--bg-hover); border: none; border-radius: 12px;
    min-width: 0; max-width: none; max-height: none; padding: 6px; margin: 2px 0 6px;
  }
  .nav-drop.open .nav-sub, .nav-drop:hover .nav-sub { display: block; transform: none; }
  .nav-sub::before { display: none; }
  .nav-sub a { padding: 10px 10px !important; }
}

/* --- 侧边栏分类小工具 --- */
.wg-cats .wg-lv1 > a { font-weight: 600; color: var(--text); }
.wg-cats .wg-lv2 { padding-left: 17px; position: relative; }
.wg-cats .wg-lv2::before { content: '└'; position: absolute; left: 1px; color: var(--text-3); font-size: 11.5px; opacity: .8; }
.wg-cats .wg-lv2 a { font-size: 13.5px; }
.foot-sub { padding-left: 9px; font-size: 13px; color: var(--text-3); }

/* --- 分类页：子分类筛选条 --- */
.cat-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 2px 0 20px; }
.cat-chips .chip-lead { font-size: 12.5px; color: var(--text-3); letter-spacing: .05em; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 13px; border-radius: 99px;
  border: 1px solid var(--border); background: var(--bg-soft); color: var(--text-2);
  font-size: 13.5px; font-weight: 500; transition: all .22s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.chip.on { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 6px 18px -8px var(--accent); }
.chip i { font-style: normal; font-size: 11.5px; padding: 0 6px; border-radius: 99px; background: color-mix(in srgb, var(--text-3) 18%, transparent); }
.chip.on i { background: rgba(255, 255, 255, .24); }

/* --- 后台分类管理 --- */
.sec-hint { font-size: 13px; color: var(--text-3); margin: -6px 0 16px; line-height: 1.75; }
.sec-hint b { color: var(--accent); font-weight: 600; }
.cat-row.is-child { padding-left: 36px; position: relative; }
.cat-row.is-child::before {
  content: '└'; position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
  color: var(--text-3); font-size: 13px; opacity: .75;
}
.cat-tag { flex: 0 0 auto; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; padding: 2px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); }
.cat-tag-2 { background: rgba(14, 165, 233, .13); color: var(--accent-2); }
.cat-row select { width: auto; max-width: 200px; padding: 5px 10px; font-size: 13.5px; border-radius: 9px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-family: inherit; }
.cat-row select:disabled { opacity: .55; cursor: not-allowed; }
.inline-add select { width: auto; padding: 8px 12px; font-size: 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-family: inherit; }

@media (max-width: 700px) {
  /* 手机端没有悬停：一级分类点一下展开二级（手风琴） */
  .nav-drop { width: 100%; display: block; }
  .nav-drop-btn { width: 100%; justify-content: space-between; padding: 12px 10px; border-radius: 10px; font-size: 15px; }
  .nav-drop.on .nav-drop-btn::after, .nav-drop:hover .nav-drop-btn::after { display: none; }
  .nav-caret { margin-left: auto; }
  .nav-sub { display: none; }
  .nav-drop.open .nav-sub {
    display: block; position: static; transform: none; opacity: 1; visibility: visible;
    box-shadow: none; background: var(--bg-hover); border: none; border-radius: 12px;
    min-width: 0; max-width: none; max-height: none; padding: 6px; margin: 2px 0 4px;
  }
  .nav-sub::before { display: none; }
  .nav-sub a { padding: 10px 10px !important; }
  .cat-chips { gap: 6px; }
  .chip { font-size: 12.5px; padding: 4px 11px; }
}

/* ===== 「+」折叠组件（导航/归档/页脚）v=22 ===== */

/* 归档：年折叠 + 月分组 */
.ar-year { cursor: default; }
.ar-x {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 26px; height: 26px; padding: 0;
  font-family: inherit; font-size: 15px; font-weight: 600; line-height: 1;
  color: var(--text-3); background: var(--bg-hover); border: none; border-radius: 8px;
  cursor: pointer; transition: all .2s; align-self: center;
}
.ar-x:hover { color: var(--accent); background: var(--accent-soft); }
.ar-year.open .ar-x { color: #fff; background: var(--accent); }
.ar-year.open .ar-x:hover { opacity: .85; }
.ar-months { display: none; flex-basis: 100%; }
.ar-year.open .ar-months { display: block; }
.ar-month { font-size: 13px; font-weight: 600; color: var(--text-3); margin: 14px 0 4px; letter-spacing: .4px; }

/* 页脚分类折叠 */
.foot-cat-row { position: relative; padding-right: 22px; }
.foot-cat-row > a { display: block; }
.foot-x {
  position: absolute; top: -1px; right: 0;
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; padding: 0;
  font-family: inherit; font-size: 12px; font-weight: 600; line-height: 1;
  color: var(--text-3); background: var(--bg-hover); border: none; border-radius: 5px;
  cursor: pointer; transition: all .2s;
}
.foot-x:hover { color: var(--accent); background: var(--accent-soft); }
.foot-cat-row.open .foot-x { color: #fff; background: var(--accent); }
.foot-cat-row.open .foot-x:hover { opacity: .85; }
.foot-sub-wrap { display: none; }
.foot-cat-row.open .foot-sub-wrap { display: block; }

/* ===== 侧栏分类折叠（一级 + 加号展开）v=22 ===== */
.wg-cats .wg-lv1 { flex-wrap: wrap; }
.wg-x {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 20px; height: 20px; padding: 0; margin-left: 6px;
  font-family: inherit; font-size: 13px; font-weight: 600; line-height: 1;
  color: var(--text-3); background: var(--bg-hover); border: none; border-radius: 6px;
  cursor: pointer; transition: all .2s;
}
.wg-x:hover { color: var(--accent); background: var(--accent-soft); }
.wg-lv1.open .wg-x { color: #fff; background: var(--accent); }
.wg-lv1.open .wg-x:hover { opacity: .85; }
.wg-lv2-wrap { display: none; flex-basis: 100%; margin-top: 2px; }
.wg-lv1.open .wg-lv2-wrap { display: block; }
.wg-cats .wg-lv2 { padding-left: 17px; position: relative; }
.wg-cats .wg-lv2::before { content: '└'; position: absolute; left: 1px; color: var(--text-3); font-size: 11.5px; opacity: .8; }

/* ===== 侧栏归档年份折叠 v=22 ===== */
.wg-archive .wg-lv1 { flex-wrap: wrap; }
.wg-archive .wg-year { font-weight: 600; color: var(--text); }
.wg-archive .wg-lv1 > .wg-cnt { margin-left: auto; background: none; padding: 1px 0; }
.wg-archive .wg-lv2 { padding-left: 17px; position: relative; }
.wg-archive .wg-lv2::before { content: '└'; position: absolute; left: 1px; color: var(--text-3); font-size: 11.5px; opacity: .8; }

/* ===== 页脚重设计 v3 (2026-10-15) ===== */
.site-foot {
  margin-top: 56px; padding: 0; border-top: none;
  background:
    radial-gradient(900px 320px at 88% -80px, rgba(99, 102, 241, .12), transparent 60%),
    radial-gradient(700px 280px at 6% 120%, rgba(14, 165, 233, .10), transparent 60%),
    color-mix(in srgb, var(--bg-soft) 55%, var(--bg));
}
.site-foot::before { display: none; }
.site-foot::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--grad); opacity: .6;
}
.site-foot p { text-align: left; }
.foot-wrap { padding-top: 46px; }
.foot-grid { grid-template-columns: 1.5fr .8fr 1.15fr 1fr; gap: 40px; padding-bottom: 36px; }
.foot-logo { display: flex; align-items: center; gap: 13px; }
.foot-logo-mark {
  flex: none; width: 46px; height: 46px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--grad); color: #fff; font-size: 21px; font-weight: 800;
  box-shadow: 0 8px 18px -8px rgba(99, 102, 241, .55);
}
.foot-logo-txt b { display: block; font-size: 17px; letter-spacing: .2px; }
.foot-logo-txt small { display: block; margin-top: 2px; color: var(--text-3); font-size: 12.5px; }
.foot-social { margin-top: 18px; gap: 9px; }
.foot-social a {
  padding: 6px 14px; border-radius: 999px; font-size: 12.5px; color: var(--text-2);
  background: var(--glass); border: 1px solid var(--border); transition: all .2s;
}
.foot-social a:hover {
  color: #fff; background: var(--grad); border-color: transparent;
  transform: translateY(-2px); box-shadow: 0 6px 14px -6px rgba(99, 102, 241, .5);
}
.foot-col { gap: 0; }
.foot-col h5 {
  font-size: 12.5px; letter-spacing: 1px; color: var(--text-3);
  margin: 0 0 12px; padding-bottom: 9px; position: relative;
}
.foot-col h5::after {
  content: ''; position: absolute; left: 0; bottom: 0; width: 24px; height: 2px;
  border-radius: 2px; background: var(--grad);
}
.foot-col > a {
  display: flex; align-items: center; color: var(--text-2);
  font-size: 13.5px; padding: 5px 0; transition: all .2s;
}
.foot-col > a:hover { color: var(--accent); padding-left: 3px; }
.foot-cat-row { display: flex; align-items: center; flex-wrap: wrap; padding: 2px 0; }
.foot-cat-row > a {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px;
  color: var(--text-2); font-size: 13.5px; padding: 3px 0; transition: color .2s;
}
.foot-cat-row > a:hover { color: var(--accent); }
.fc-n {
  flex: none; font-style: normal; font-size: 10.5px; line-height: 1; color: var(--text-3);
  background: var(--bg-hover); border: 1px solid var(--border); border-radius: 999px; padding: 3px 7px;
  transition: all .2s;
}
.foot-cat-row.open .fc-n { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.foot-sub-wrap { flex-basis: 100%; margin: 2px 0 4px; display: none; flex-direction: column; gap: 1px; }
.foot-cat-row.open .foot-sub-wrap { display: flex; }
.foot-sub {
  display: flex; align-items: center; gap: 8px; position: relative;
  margin-left: 13px; padding: 3px 0 3px 12px;
  font-size: 13px; color: var(--text-3); transition: color .2s;
}
.foot-sub span { color: inherit; }
.foot-sub::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 5px; height: 5px; border-radius: 50%; background: var(--accent-2); opacity: .65;
}
.foot-sub:hover { color: var(--accent); }
.fs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.fs-item {
  background: var(--glass); border: 1px solid var(--border); border-radius: 12px;
  padding: 9px 12px; transition: all .2s;
}
.fs-item:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.fs-item b { display: block; font-size: 15px; color: var(--accent); line-height: 1.25; }
.fs-item span { display: block; margin-top: 1px; font-size: 11.5px; color: var(--text-3); }
.foot-bottom {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  border-top: 1px solid var(--border); padding: 15px 0 20px; margin: 0;
  color: var(--text-3); font-size: 12.5px; text-align: left;
}
.foot-bottom .fb-links { display: inline-flex; align-items: center; gap: 8px; }
.foot-bottom .fb-links i { font-style: normal; opacity: .5; }
.foot-bottom a { color: var(--text-3); transition: color .2s; }
.foot-bottom a:hover { color: var(--accent); }
@media (max-width: 980px) {
  .foot-grid { grid-template-columns: 1fr 1fr; gap: 30px; }
}
@media (max-width: 620px) {
  .foot-grid { grid-template-columns: 1fr; gap: 26px; }
  .foot-bottom { justify-content: center; text-align: center; }
}
/* 底栏给左下角看板猫留出空间 */
@media (min-width: 768px) {
  .foot-bottom { padding-left: 96px; }
}

/* 修复：展开时子列表 flex-basis 可被压缩，导致父项文字竖排 */
.foot-sub-wrap, .wg-cats .wg-lv2-wrap, .wg-archive .wg-lv2-wrap { flex: 0 0 100%; }

/* 页脚分类：头行+下方子列表 稳健结构 */
.foot-cat { margin: 1px 0; }
.foot-cat-head { display: flex; align-items: center; gap: 8px; }
.foot-cat-head > a {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px;
  color: var(--text-2); font-size: 13.5px; padding: 4px 0; transition: color .2s;
}
.foot-cat-head > a:hover { color: var(--accent); }
.foot-cat.open .fc-n { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.foot-cat .foot-sub-wrap { display: none; flex-direction: column; gap: 1px; margin: 0 0 4px; }
.foot-cat.open .foot-sub-wrap { display: flex; }
/* 修复：旧版 .foot-x 绝对定位残留，改回文档流 */
.foot-cat .foot-x { position: static; flex: none; }
.foot-cat.open .foot-x { color: #fff; background: var(--accent); }
.foot-cat.open .foot-x:hover { opacity: .85; }

/* ===== 2026-10-15 微调：文章头顺序 / 页脚按钮贴合 ===== */
/* 文章头：标题在上，分类·时间行紧随标题下方 */
.pf-head .pf-head-inner > h1:first-child { margin-top: 0; }
.pf-head .pf-head-inner > h1 + .pc-meta { margin-top: 14px; }
/* 页脚分类：展开按钮紧贴分类名（不要被推到最右） */
.foot-cat-head { justify-content: flex-start; gap: 6px; }
.foot-cat-head > a { flex: 0 1 auto; }
.foot-cat-head > a span { white-space: nowrap; }

/* ===== 2026-10-15 后台评论行布局修复 ===== */
/* 根因：.row-actions 为纵向 flex，.reply-form 的 flex-basis:240px 在纵向被当成高度，每条评论多出 240px 空白 */
.comment-row { align-items: flex-start; padding: 14px 18px; row-gap: 8px; }
.comment-row .comment-detail { flex: 1 1 380px; min-width: 0; }
.comment-row .row-actions {
  flex: 1 1 100%; display: flex; flex-direction: row; flex-wrap: wrap; align-items: center;
  gap: 8px; padding-top: 9px; margin-top: 1px; border-top: 1px dashed var(--border);
}
.comment-row .row-actions .inline-form { flex: none; }
.comment-row .row-actions .reply-form { flex: 1 1 260px; max-width: 520px; margin-left: auto; }
.sec-bar .row-actions { flex-direction: row; align-items: center; gap: 8px; }

/* ===== 2026-10-15 写文章页：标签选择器 ===== */
.side-card .side-field { margin-bottom: 14px; }
.side-card .sf-label { display: block; font-size: 13.5px; color: var(--text-2); margin-bottom: 7px; }
.side-card .sf-label small { color: var(--text-3); font-size: 11.5px; font-weight: 400; }
.tag-picker { border: 1px solid var(--border); border-radius: 10px; background: var(--bg); padding: 9px 11px 8px; transition: border-color .25s, box-shadow .25s; }
.tag-picker:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.tp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tp-chip { display: inline-flex; align-items: center; gap: 5px; background: var(--accent-soft); color: var(--accent); border: 1px solid rgba(99,102,241,.24); border-radius: 999px; padding: 2px 5px 2px 11px; font-size: 12.5px; line-height: 1.75; }
.tp-chip b { cursor: pointer; width: 17px; height: 17px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; font-size: 13px; font-weight: 700; opacity: .7; transition: background .2s, color .2s; }
.tp-chip b:hover { background: var(--accent); color: #fff; opacity: 1; }
.tp-input-wrap { position: relative; }
.tag-picker input#tpInput { width: 100%; margin: 8px 0 0; padding: 4px 2px; border: 0; background: transparent; color: var(--text); font-size: 13.5px; line-height: 1.6; }
.tag-picker input#tpInput:focus { border: 0; box-shadow: none; outline: none; }
.tp-sug { position: absolute; left: -11px; right: -11px; top: calc(100% + 8px); z-index: 60; max-height: 232px; overflow-y: auto; padding: 5px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); }
.tp-sug-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 10px; border-radius: 8px; font-size: 13px; cursor: pointer; color: var(--text); }
.tp-sug-item:hover { background: var(--accent-soft); color: var(--accent); }
.tp-sug-item i { font-style: normal; font-size: 11.5px; color: var(--text-3); }
.tp-sug-item.tp-new { color: var(--accent); font-weight: 700; }
.tp-hot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; padding-top: 9px; border-top: 1px dashed var(--border); }
.tp-hot-label { font-size: 11.5px; color: var(--text-3); }
.tp-hot-item { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border: 1px solid var(--border); border-radius: 999px; background: var(--bg-soft); color: var(--text-2); font-size: 12px; font-family: inherit; cursor: pointer; transition: all .2s; }
.tp-hot-item:hover { border-color: var(--accent); color: var(--accent); }
.tp-hot-item i { font-style: normal; font-size: 11px; color: var(--text-3); }
.tp-hot-item[disabled] { opacity: .38; cursor: default; }
.tp-hot-item[disabled]:hover { border-color: var(--border); color: var(--text-2); }
.tp-hint { display: block; margin-top: 8px; font-size: 11.5px; line-height: 1.7; color: var(--text-3); }

/* ===== 2026-10-15 编辑页自动保存提示 ===== */
.autosave-tip { position: fixed; right: 18px; bottom: 18px; z-index: 400; display: flex; align-items: center; gap: 8px;
  padding: 8px 15px; border-radius: 999px; background: var(--bg-soft); border: 1px solid var(--border);
  box-shadow: var(--shadow-lg); font-size: 12.5px; color: var(--text-2); }
.autosave-tip[hidden] { display: none; }
.autosave-tip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); flex: none; }
.autosave-tip.ok::before { background: #22c55e; }
.autosave-tip.saving::before { background: var(--accent); animation: asPulse 1.1s ease-in-out infinite; }
.autosave-tip.err::before { background: #ef4444; }
@keyframes asPulse { 0%, 100% { opacity: 1; } 50% { opacity: .2; } }

.restore-bar { position: fixed; left: 50%; transform: translateX(-50%); top: 16px; z-index: 500;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center;
  padding: 11px 16px; border-radius: 14px; background: var(--bg-soft); border: 1px solid var(--border);
  box-shadow: var(--shadow-lg); font-size: 13.5px; color: var(--text); max-width: min(720px, 92vw); }
.restore-bar span { color: var(--text-2); }

/* ===== 2026-10-15 前台会员中心（/user 系列） ===== */
.nav-me { position: relative; display: inline-flex; align-items: center; }
.nav-badge { position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: #ef4444; color: #fff; font-size: 10.5px; font-style: normal; line-height: 17px; text-align: center; }
.nav-avatar-img { overflow: hidden; padding: 0 !important; }
.nav-avatar-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nav-console { display: inline-flex !important; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border); color: var(--text-2); }
.nav-console:hover { color: var(--accent); border-color: var(--accent); }

.mbr { display: grid; grid-template-columns: 262px minmax(0, 1fr); gap: 22px; align-items: start; padding: 26px 0 70px; position: relative; z-index: 1; }
.mbr-side { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 14px; }
.mbr-card { background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.mbr-me { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; margin-bottom: 10px; border-bottom: 1px dashed var(--border); }
.mbr-av { display: inline-flex; align-items: center; justify-content: center; flex: none; border-radius: 50%; overflow: hidden; color: #fff; font-weight: 600; letter-spacing: .5px; }
.mbr-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mbr-me-txt { min-width: 0; }
.mbr-me-txt b { display: block; font-size: 15px; color: var(--text); }
.mbr-me-txt small { display: block; margin-top: 2px; font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mbr-menu { display: flex; flex-direction: column; gap: 2px; }
.mbr-menu a { display: flex; align-items: center; gap: 9px; padding: 9px 11px; border-radius: var(--radius-sm); font-size: 14px; color: var(--text-2); transition: background .2s, color .2s; }
.mbr-menu a:hover { background: var(--bg-hover); color: var(--text); }
.mbr-menu a.on { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.mbr-ico { flex: none; opacity: .85; }
.mbr-dot { margin-left: auto; padding: 0 6px; border-radius: 999px; background: #ef4444; color: #fff; font-size: 11px; font-style: normal; line-height: 1.7; }
.mbr-apply b { font-size: 13.5px; color: var(--text); }
.mbr-apply p { margin: 6px 0 12px; font-size: 12.5px; line-height: 1.75; color: var(--text-3); }
.mbr-back { text-align: center; font-size: 13px; }

.mbr-main { min-width: 0; }
.mbr-head h1 { font-size: 22px; margin: 0 0 6px; color: var(--text); }
.mbr-head p { margin: 0 0 18px; font-size: 13px; color: var(--text-3); }
.mbr-flash { margin-bottom: 16px; padding: 11px 15px; border-radius: var(--radius-sm); font-size: 13.5px; border: 1px solid transparent; }
.mbr-flash.ok { background: rgba(34, 197, 94, .12); border-color: rgba(34, 197, 94, .3); color: #15803d; }
.mbr-flash.err { background: rgba(239, 68, 68, .1); border-color: rgba(239, 68, 68, .3); color: #b91c1c; }
[data-theme="dark"] .mbr-flash.ok { color: #6ee7a8; }
[data-theme="dark"] .mbr-flash.err { color: #fca5a5; }

.mbr-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 12px; margin-bottom: 20px; }
.mbr-stat { display: block; padding: 15px 16px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.mbr-stat b { display: block; font-size: 25px; line-height: 1.15; color: var(--accent); }
.mbr-stat span { display: block; margin-top: 4px; font-size: 12.5px; color: var(--text-3); }
.mbr-stat:hover { border-color: var(--accent); }

.mbr-block { margin-bottom: 18px; padding: 18px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.mbr-block-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.mbr-block-head h2 { margin: 0; font-size: 15.5px; color: var(--text); }
.mbr-block-head a { font-size: 12.5px; color: var(--accent); }
.mbr-kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px 22px; }
.mbr-kv li { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 8px; border-bottom: 1px dashed var(--border); font-size: 13px; }
.mbr-kv span { color: var(--text-3); }
.mbr-kv b { color: var(--text); font-weight: 500; }
.mbr-bio { margin: 0; font-size: 13.5px; line-height: 1.8; color: var(--text-2); }

.mbr-rows li { display: flex; align-items: flex-start; gap: 14px; padding: 12px 0; border-bottom: 1px dashed var(--border); }
.mbr-rows li:last-child { border-bottom: 0; }
.mbr-row-main { flex: 1; min-width: 0; }
.mbr-row-title { font-size: 14.5px; font-weight: 500; color: var(--text); }
.mbr-row-title:hover { color: var(--accent); }
.mbr-rows p { margin: 5px 0 0; font-size: 13px; line-height: 1.7; color: var(--text-2); }
.mbr-meta { font-size: 12px !important; color: var(--text-3) !important; }
.mbr-row-side { display: flex; flex: none; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.mbr-inline { display: inline; }
.mbr-badge { padding: 2px 9px; border-radius: 999px; background: var(--bg-hover); color: var(--text-2); font-size: 11.5px; white-space: nowrap; }
.mbr-badge.ok { background: rgba(34, 197, 94, .14); color: #15803d; }
.mbr-badge.warn { background: rgba(245, 158, 11, .16); color: #b45309; }
[data-theme="dark"] .mbr-badge.ok { color: #6ee7a8; }
[data-theme="dark"] .mbr-badge.warn { color: #fcd34d; }
.mbr-notifs li.unread { background: var(--accent-soft); border-radius: var(--radius-sm); padding-left: 12px; padding-right: 12px; }

.mbr-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 16px; }
.mbr-tabs a { padding: 6px 13px; border: 1px solid var(--border); border-radius: 999px; background: var(--bg-soft); font-size: 13px; color: var(--text-2); }
.mbr-tabs a.on { background: var(--accent); border-color: transparent; color: #fff; }
.mbr-tabs i { font-style: normal; font-size: 11.5px; opacity: .72; }
.mbr-tabs-add { margin-left: auto; border-color: var(--accent) !important; color: var(--accent) !important; }

.mbr-form .mbr-field { display: block; margin-bottom: 14px; }
.mbr-field > span { display: block; margin-bottom: 6px; font-size: 13px; color: var(--text-2); }
.mbr-field > span small { font-weight: 400; color: var(--text-3); font-size: 11.5px; }
.mbr-field small { display: block; margin-top: 6px; font-size: 11.5px; color: var(--text-3); }
.mbr-field input, .mbr-field select, .mbr-field textarea, .mbr-md-raw {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text); font: inherit; font-size: 14px;
}
.mbr-field input:focus, .mbr-field select:focus, .mbr-field textarea:focus, .mbr-md-raw:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft);
}
.mbr-field input:disabled { opacity: .6; cursor: not-allowed; }
.mbr-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.mbr-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 4px 0 30px; }
.mbr-actions-sticky { position: sticky; bottom: 14px; margin-top: 6px; padding: 12px 14px; background: var(--glass-strong); backdrop-filter: blur(12px); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.mbr-hint { font-size: 12px; color: var(--text-3); }
.mbr-avatar-edit { display: flex; gap: 16px; align-items: flex-start; }
.mbr-avatar-edit input[type="file"] { font-size: 12.5px; color: var(--text-2); }
.mbr-check { display: block; margin-top: 8px; font-size: 12.5px; color: var(--text-2); }

.mbr-editor .mbr-block { padding: 18px 18px 20px; }
.mbr-md-raw { min-height: 280px; line-height: 1.75; resize: vertical; font-family: var(--font-mono, ui-monospace, monospace); }
.mbr-md-hidden { display: none !important; }
.mbr-vditor { margin-top: 4px; }
.mbr-vditor .vditor { border-radius: var(--radius-sm); }
.mbr-vditor:empty { display: none; }

.mbr-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.mbr-pcard { display: flex; overflow: hidden; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.mbr-pcard:hover { border-color: var(--accent); }
.mbr-pcard-img { width: 86px; flex: none; background-size: cover; background-position: center; }
.mbr-pcard-body { padding: 12px 12px 12px 12px; min-width: 0; }
.mbr-pcard-body b { display: block; font-size: 14px; line-height: 1.5; color: var(--text); }
.mbr-pcard-body small { display: block; margin-top: 5px; font-size: 11.5px; color: var(--text-3); }
.mbr-empty { padding: 34px 20px; background: var(--bg-soft); border: 1px dashed var(--border); border-radius: var(--radius); text-align: center; font-size: 13.5px; line-height: 1.9; color: var(--text-3); }

@media (max-width: 980px) {
  .mbr { grid-template-columns: 1fr; gap: 16px; padding-top: 18px; }
  .mbr-side { position: static; }
  .mbr-grid2 { grid-template-columns: 1fr; }
  .mbr-row-side { width: 100%; justify-content: flex-start; }
  .mbr-rows li { flex-wrap: wrap; }
  .mbr-actions-sticky { position: static; }
}

/* ============ 后台概览页（Dashboard v2 · 清爽版） ============ */
.db-hero {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px;
  padding: 22px 26px; margin-bottom: 18px;
  border-radius: var(--radius); border: 1px solid var(--border);
  background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 9%, var(--bg-soft)) 0%, var(--bg-soft) 55%, color-mix(in srgb, var(--accent-2) 8%, var(--bg-soft)) 100%);
  box-shadow: var(--shadow);
}
.db-hero-txt h2 { font-size: 22px; font-weight: 800; letter-spacing: -.4px; margin-bottom: 2px; }
.db-hero-txt p { color: var(--text-3); font-size: 13.5px; }
.db-hero-txt b { color: var(--accent); }
.db-hero-act { display: flex; gap: 10px; flex-wrap: wrap; }
.db-ghost { background: transparent; }

.db-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 18px; }
.db-metric {
  position: relative; display: flex; align-items: center; gap: 13px;
  padding: 16px 18px; border-radius: var(--radius-sm);
  background: var(--bg-soft); border: 1px solid var(--border); box-shadow: var(--shadow);
  transition: transform .22s, box-shadow .22s, border-color .22s;
}
.db-metric:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow-lg); }
.db-metric.nohref { cursor: default; }
.db-metric.nohref:hover { transform: none; border-color: var(--border); }
.db-ico {
  flex: 0 0 auto; width: 42px; height: 42px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.i-doc { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.i-cmt { background: linear-gradient(135deg, #0ea5e9, #06b6d4); }
.i-eye { background: linear-gradient(135deg, #f59e0b, #f97316); }
.i-usr { background: linear-gradient(135deg, #10b981, #059669); }
.db-m-body b { display: block; font-size: 22px; font-weight: 800; line-height: 1.25; letter-spacing: -.5px; }
.db-m-body span { color: var(--text-3); font-size: 12.5px; }
.db-m-sub { margin-left: auto; text-align: right; font-style: normal; color: var(--text-3); font-size: 12px; line-height: 1.5; }
.db-m-sub.hot { color: #d97706; font-weight: 700; }

.db-todo { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; margin-bottom: 18px; }
.db-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 14px; align-items: start; margin-bottom: 18px; }
.db-side { display: grid; gap: 14px; }
.db-card {
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 4px 16px 8px; overflow: hidden;
}
.db-card-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 2px 10px; margin-bottom: 4px; border-bottom: 1px dashed var(--border);
}
.db-card-head h4 { font-size: 14px; font-weight: 800; }
.db-card-head a { font-size: 12.5px; color: var(--text-3); }
.db-card-head a:hover { color: var(--accent); }
.db-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 2px; border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
  font-size: 13.5px;
}
.db-row:last-child { border-bottom: none; }
.db-row-t { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.db-row-t:hover { color: var(--accent); }
.db-row-meta { margin-left: auto; color: var(--text-3); font-size: 12px; white-space: nowrap; }
.db-view { color: var(--text-3); font-size: 13px; }
.db-view:hover { color: var(--accent); }
.db-rank {
  flex: 0 0 auto; width: 20px; height: 20px; border-radius: 6px; text-align: center; line-height: 20px;
  font-size: 11.5px; font-weight: 700; color: var(--text-3); background: var(--bg-hover);
}
.db-row:first-of-type .db-rank, .db-row:nth-of-type(2) .db-rank, .db-row:nth-of-type(3) .db-rank {
  color: #fff; background: var(--grad);
}
.db-ava {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700;
}
.db-cmt { min-width: 0; }
.db-cmt p { font-size: 13.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-cmt p b { color: var(--text); margin-right: 8px; }
.db-cmt small { font-size: 12px; color: var(--text-3); }
.db-cmt small a:hover { color: var(--accent); }

.db-panel {
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); padding: 14px 18px 6px; margin-bottom: 18px;
}
.db-panel-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.db-panel-head h4 { font-size: 14px; font-weight: 800; }
.db-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.db-chips span {
  font-size: 12px; color: var(--text-3); background: var(--bg-hover);
  border: 1px solid var(--border); border-radius: 99px; padding: 3px 11px;
}
.db-chips b { color: var(--accent); font-weight: 700; }
.chart .bar .bar-fill.today { background: var(--grad); }
.chart .bar .bar-fill { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 65%, transparent), color-mix(in srgb, var(--accent) 25%, transparent)); }

.db-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; padding: 10px 0 12px; }
.db-quick a {
  padding: 10px 13px; border-radius: 10px; font-size: 13px; color: var(--text-2);
  background: var(--bg-hover); border: 1px solid var(--border); transition: all .2s;
}
.db-quick a:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.db-sys { list-style: none; padding: 8px 0 10px; }
.db-sys li {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 7px 2px; font-size: 13px; border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}
.db-sys li:last-child { border-bottom: none; }
.db-sys span { color: var(--text-3); }
.db-sys b { font-weight: 600; color: var(--text); text-align: right; }

@media (max-width: 1080px) {
  .db-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .db-hero { padding: 18px; }
  .db-hero-act { width: 100%; }
  .db-hero-act .btn { flex: 1; justify-content: center; }
  .db-m-sub { display: none; }
  .db-chips { display: none; }
}

/* ==================== 编辑器：插入媒体工具条 ==================== */
.ed-media-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; margin: 10px 0; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.emb-label { font-size: 12.5px; color: var(--text-3); }
.emb-btn { font: inherit; font-size: 12.5px; padding: 5px 11px; border: 1px solid var(--border); background: var(--bg); color: var(--text); border-radius: 999px; cursor: pointer; transition: .15s; }
.emb-btn:hover { border-color: var(--accent); color: var(--accent); }
.emb-btn:disabled { opacity: .55; cursor: default; }
.emb-hint { margin-left: auto; font-size: 12px; color: var(--text-3); }
.emb-prog { font-size: 12px; color: var(--accent); }

/* ==================== 媒体库：分类 / 搜索 / 类型缩略图 ==================== */
.media-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin: 14px 0 4px; }
.media-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.mtab { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; font-size: 13px; color: var(--text-2); background: var(--bg-soft); }
.mtab i { font-style: normal; font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--bg-hover); color: var(--text-3); }
.mtab:hover { border-color: var(--accent); }
.mtab.on { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.media-search { display: flex; gap: 6px; align-items: center; }
.media-search input[type="search"] { padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); color: var(--text); font: inherit; font-size: 13px; min-width: 180px; }
.media-count { font-size: 12.5px; color: var(--text-3); margin: 6px 0 10px; }
.media-thumb { position: relative; }
.media-thumb video { width: 100%; height: 100%; object-fit: cover; }
.mt-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 26px; color: #fff; text-shadow: 0 2px 10px rgba(0, 0, 0, .55); pointer-events: none; }
.mt-icon { font-size: 34px; line-height: 1; }
.mt-ext { position: absolute; bottom: 8px; right: 8px; font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; background: rgba(0, 0, 0, .55); color: #fff; }
.media-item.kind-audio .media-thumb, .media-item.kind-archive .media-thumb, .media-item.kind-doc .media-thumb, .media-item.kind-other .media-thumb { flex-direction: column; gap: 6px; color: var(--text-3); background: var(--bg-hover); }
.media-item.kind-video .media-thumb { background: #000; }

/* ==================== 正文里的多媒体 / 附件 ==================== */
.markdown video, .markdown audio, .markdown iframe { max-width: 100%; border-radius: var(--radius-sm); display: block; margin: 16px 0; }
.markdown audio { width: 100%; }
.markdown a[download] { text-decoration: underline; }
@media (max-width: 720px) {
  .media-toolbar { flex-direction: column; align-items: stretch; }
  .media-search input[type="search"] { flex: 1; min-width: 0; }
  .emb-hint { margin-left: 0; width: 100%; }
}
/* ==================== 媒体预览灯箱 ==================== */
.media-lightbox { position: fixed; inset: 0; background: rgba(8, 9, 14, .84); display: none; align-items: center; justify-content: center; z-index: 999; padding: 4vh 4vw; }
.media-lightbox.on { display: flex; }
.media-lightbox .mlb-inner { max-width: 92vw; max-height: 88vh; }
.media-lightbox img, .media-lightbox video { max-width: 92vw; max-height: 88vh; border-radius: var(--radius-sm); display: block; }
.media-lightbox audio { width: min(640px, 84vw); }
.mlb-close { position: absolute; top: 18px; right: 22px; width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer; font-size: 16px; background: rgba(255, 255, 255, .16); color: #fff; }
.mlb-close:hover { background: rgba(255, 255, 255, .28); }

/* Safari 兼容：文件输入框视觉隐藏但保留可点击性（display:none 会让 Safari 忽略 .click()） */
.vh-file{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0}

/* 编辑器工具栏上传提示（顶栏 toast） */
.yb-up-toast{position:fixed;top:14px;right:16px;z-index:9999;background:#1f2328;color:#fff;padding:8px 14px;border-radius:8px;font-size:13px;box-shadow:0 4px 16px rgba(0,0,0,.18);opacity:0;transform:translateY(-8px);transition:.22s;pointer-events:none}
.yb-up-toast.on{opacity:1;transform:none}
.yb-up-toast.err{background:#c62828}

/* 侧边菜单底部分隔线（工具/统计/日志/设置 自成一组） */
.am-sep { height: 1px; background: var(--border); margin: 6px 12px; }
@media (max-width: 960px) { .am-sep { display: none; } }

/* ===== 统计页 v2 ===== */
.st-range .btn { border-radius: 999px; }
.st-note { font-size: 12.5px; color: var(--text-3); }

.i-pv { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.i-uv { background: linear-gradient(135deg, #0ea5e9, #06b6d4); }
.i-avg { background: linear-gradient(135deg, #f59e0b, #f97316); }
.i-today { background: linear-gradient(135deg, #10b981, #059669); }
.i-read { background: linear-gradient(135deg, #3b82f6, #6366f1); }

.st-chart-card { margin-bottom: 18px; }
.st-chart { padding: 4px 2px 0; overflow-x: auto; color: var(--accent); }
.st-chart svg { display: block; width: 100%; min-width: 600px; height: auto; }
.st-chart .gl { stroke: var(--border); stroke-width: 1; }
.st-chart .ax { fill: var(--text-3); font-size: 11.5px; font-family: inherit; }
.st-chart .area { fill: url(#stArea); }
.st-chart .line-pv { fill: none; stroke: var(--accent); stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round; }
.st-chart .line-uv { fill: none; stroke: var(--accent-2); stroke-width: 1.9; stroke-dasharray: 6 5; stroke-linejoin: round; stroke-linecap: round; }
.st-chart .dot { fill: var(--bg-soft); stroke: var(--accent); stroke-width: 2; }
.st-chart .dot.today { fill: var(--accent); stroke: var(--bg-soft); }
.st-chart .hot { fill: transparent; }
.st-chart .hot:hover { fill: color-mix(in srgb, var(--accent) 9%, transparent); }

.st-legend { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; font-size: 12.5px; color: var(--text-3); padding: 12px 6px 4px; }
.st-legend i { display: inline-block; width: 11px; height: 11px; border-radius: 4px; margin-right: 7px; vertical-align: -1px; }
.st-legend .lg-pv { background: var(--accent); }
.st-legend .lg-uv { background: var(--accent-2); }
.st-legend .st-note { margin-left: auto; }

.st-delta { display: inline-block; font-weight: 700; font-size: 11.5px; padding: 1px 7px; border-radius: 999px; }
.st-delta.up { color: #dc2626; background: rgba(220, 38, 38, .1); }
.st-delta.down { color: #059669; background: rgba(5, 150, 105, .1); }
.st-delta.flat { color: var(--text-3); background: var(--bg-hover); }

.st-bars { display: grid; gap: 11px; padding: 10px 0 16px; }
.st-bar { display: grid; grid-template-columns: 1fr auto; gap: 5px 10px; align-items: center; }
.st-bar a { font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.st-bar a:hover { color: var(--accent); }
.st-bar em { font-style: normal; font-size: 12px; color: var(--text-3); white-space: nowrap; }
.st-track { grid-column: 1 / -1; height: 7px; border-radius: 999px; background: var(--bg-hover); overflow: hidden; }
.st-fill { display: block; height: 100%; border-radius: 999px; background: var(--grad); transition: width .5s ease; }
.st-fill.c2 { background: linear-gradient(90deg, var(--accent-2), var(--accent-3)); }

.st-ov-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 12px; padding: 12px 0 16px; }
.st-ov { background: var(--bg-hover); border-radius: 12px; padding: 12px 14px; }
.st-ov b { display: block; font-size: 19px; font-weight: 800; letter-spacing: -.3px; }
.st-ov span { font-size: 12px; color: var(--text-3); }
.st-ov em { display: block; font-style: normal; font-size: 11.5px; color: var(--text-3); margin-top: 4px; }
.st-ov em.hot { color: #d97706; font-weight: 700; }

.st-tbl-wrap { max-height: 420px; overflow: auto; border-radius: var(--radius-sm); border: 1px solid var(--border); }
table.st-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.st-tbl thead th { position: sticky; top: 0; z-index: 1; background: var(--bg-soft); color: var(--text-3); font-weight: 600; font-size: 12px; text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.st-tbl th.num, .st-tbl td.num { text-align: right; font-variant-numeric: tabular-nums; }
.st-tbl td { padding: 9px 14px; border-bottom: 1px solid var(--border); color: var(--text-2); }
.st-tbl tbody tr:last-child td { border-bottom: none; }
.st-tbl tbody tr:hover { background: var(--bg-hover); }
.st-mini { display: block; height: 6px; border-radius: 999px; background: var(--grad); min-width: 2px; }
.st-today-tag { font-size: 11px; color: var(--accent); background: var(--accent-soft); padding: 1px 6px; border-radius: 999px; margin-left: 6px; }

@media (max-width: 720px) {
  .st-ov-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .st-legend .st-note { display: none; }
  .st-tbl-wrap { max-height: 340px; }
  .st-tbl thead th, .st-tbl td { padding: 8px 10px; }
}

/* ===== 统计页 v2.1 ===== */
.db-grid.st-eq { align-items: stretch; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.db-grid.st-eq > .db-card { display: flex; flex-direction: column; min-width: 0; }
.db-grid.st-eq .db-row { min-height: 40px; }
.db-grid.st-eq .st-tagrow .db-row-t { flex: 0 1 auto; max-width: 44%; }
.st-tagbar { flex: 1 1 auto; height: 7px; min-width: 40px; border-radius: 999px; background: var(--bg-hover); overflow: hidden; }
.st-tagbar .st-fill { height: 100%; }

@media (max-width: 900px) {
  .db-grid.st-eq { grid-template-columns: minmax(0, 1fr); }
}

/* ===== 后台视觉统一 v1（全部对齐概览页 / 统计页） ===== */

/* --- 1) 列表卡片：与 .db-card 完全同款（圆角 12px、内边距 4/16/8、行 padding 11px 2px） --- */
.admin-main .admin-list { border-radius: var(--radius-sm); padding: 4px 16px 8px; }
.admin-main .admin-row {
  padding: 11px 2px; gap: 10px; font-size: 13.5px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}
.admin-main .admin-row:last-child { border-bottom: none; }
.admin-main .comment-row { padding: 12px 2px; }
.admin-main .admin-list.scroll-yx { max-height: 68vh; overflow: auto; }

/* --- 2) 页内区块标题降级（页级标题统一用 .db-hero） --- */
.admin-main .sec-title { font-size: 14px; font-weight: 800; letter-spacing: -.2px; margin: 0 0 12px; }
.admin-main .sec-title small { font-size: 12.5px; color: var(--text-3); font-weight: 500; margin-left: 6px; }

/* --- 3) 两栏栅格：比例与间距对齐 .db-grid --- */
.dash-grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; }
.edit-grid { gap: 16px; }

/* --- 4) 卡片内边距对齐（左右 16px，与 .db-card 一致） --- */
.admin-main .side-card { padding: 16px 16px 8px; }

/* --- 5) 输入控件：圆角与底色统一 --- */
.admin-main .filter-bar select, .admin-main .filter-bar input,
.admin-main .bulk-bar select, .admin-main .bulk-bar input,
.admin-main .inline-add select {
  border-radius: var(--radius-sm); background: var(--bg-soft);
}
.admin-main .inline-add {
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 16px; box-shadow: var(--shadow); margin-bottom: 18px;
}
.admin-main .inline-add input, .admin-main .inline-add select { background: var(--bg); }
.admin-main .cat-row select { border-radius: var(--radius-sm); }
.admin-main .post-form input, .admin-main .post-form textarea, .admin-main .post-form select { border-radius: var(--radius-sm); }

/* --- 6) 垂直节奏统一 18px --- */
.admin-main > .admin-list, .admin-main > .db-card, .admin-main > .dash-grid, .admin-main > .edit-grid,
.admin-main > .media-grid, .admin-main > .inline-add, .admin-main > .quick-links { margin-bottom: 18px; }
.admin-main .bulk-bar, .admin-main .filter-bar { margin-bottom: 16px; }
.admin-main .sec-hint { margin: 0 0 16px; }

/* --- 7) 提示文字与间距工具类（替代散落的内联样式） --- */
.mt-10 { margin-top: 10px; }
.mt-12 { margin-top: 12px; }
.mb-18 { margin-bottom: 18px !important; }
.w-70 { width: 70px; }
.w-80 { width: 80px; }
.list-tools { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.list-tools input[type="search"] {
  flex: 1; max-width: 320px; padding: 8px 14px; font-size: 13.5px; font-family: inherit;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-soft); color: var(--text);
}
.list-tools .tip { font-size: 12.5px; color: var(--text-3); }

/* --- 8) 统计页范围按钮回归全站统一圆角 --- */
.st-range .btn { border-radius: var(--radius-sm); }

@media (max-width: 720px) {
  .admin-main .side-card { padding: 14px 14px 6px; }
  .admin-main .admin-list { padding: 4px 12px 6px; }
}

/* ===== 全站卡片对齐 v1（同行等高 + 栅格统一，与统计页一致） ===== */
.db-grid:not(.st-eq),
.dash-grid { align-items: stretch; gap: 16px; margin-bottom: 18px; }
.dash-grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.edit-grid { gap: 16px; }
/* 列表行高全站统一 */
.db-row { min-height: 40px; }

/* 栅格内包裹层拉伸（保险） */
.dash-grid > div:not([class]), .db-grid:not(.st-eq) > div:not([class]) { display: flex; flex-direction: column; }
.dash-grid > div:not([class]) > *, .db-grid:not(.st-eq) > div:not([class]) > * { flex: 1; }

/* 邮箱验证横幅与徽标 */
.mbr-vbanner { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin-bottom: 14px; padding: 12px 16px; border: 1px solid rgba(240,195,109,.55); background: rgba(240,195,109,.12); border-radius: 12px; font-size: 13.5px; }
.mbr-vbanner form { margin-left: auto; }
.badge-ok { background: rgba(52,199,123,.15); color: #2f9e63; }
[data-theme="dark"] .mbr-vbanner { border-color: rgba(240,195,109,.35); background: rgba(240,195,109,.08); }
[data-theme="dark"] .badge-ok { color: #4ade80; }

/* ===== 设置页测试邮件结果 ===== */
.mt-result{margin-top:8px;padding:8px 10px;border-radius:8px;font-size:13px;line-height:1.5;word-break:break-all}
.mt-result.ok{background:rgba(46,160,67,.12);color:var(--c-ok,#1a7f37)}
.mt-result.err{background:rgba(218,54,51,.12);color:var(--c-err,#cf222e)}
.mt-result.saving{background:rgba(120,120,140,.12);color:inherit}
[data-theme="dark"] .mt-result.ok{color:#3fb950}
[data-theme="dark"] .mt-result.err{color:#f85149}

/* 概览页铺满窗口宽度（最近评论/热门文章等卡片随窗口拉伸） */
.admin-main:has(.db-hero) { max-width: none; }
/* 概览卡片内容填满：行均匀分布填满卡片高度 */
.db-grid > .db-card { display: flex; flex-direction: column; }
.db-grid > .db-card > .db-card-head { flex: 0 0 auto; }
.db-grid > .db-card > .db-row { flex: 1 1 auto; }
.db-side { grid-template-rows: auto minmax(0, 1fr); }
.db-side > .db-card:last-child { display: flex; flex-direction: column; }
.db-side > .db-card:last-child .db-sys { flex: 1; display: flex; flex-direction: column; justify-content: space-evenly; margin: 0; }

/* 用户编辑弹窗 + 行内操作按钮 */
.modal-mask { position: fixed; inset: 0; background: rgba(10,10,16,.45); backdrop-filter: blur(3px); z-index: 300; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-mask[hidden] { display: none; }
.modal-box { width: min(440px, 100%); max-height: 86vh; overflow: auto; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); padding: 18px 20px 20px; }
.modal-box h4 { font-size: 15px; font-weight: 800; margin: 0 0 12px; }
.ur-act { display: flex; gap: 6px; align-items: center; flex-direction: row; }
.ur-act .inline-form { margin: 0; }
