/* ============ 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; }
.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; }
  /* 汉堡菜单里的一级分类：没有悬停，点击展开二级分类 */
  .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 { display: block; }
  .nav-sub::before { display: none; }
  .nav-sub a { padding: 10px 10px !important; }
  .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; }

/* --- 侧边栏分类小工具 --- */
.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; }
}
