/* ==========================================================================
   Nebula Theme for Typecho
   Author: Nebula
   Version: 1.0.0
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 设计变量 / 基础
   -------------------------------------------------------------------------- */
:root {
  --bg: #eef1f7;
  --card: #ffffff;
  --card-2: #f6f8fc;
  --text: #1a1f2e;
  --text-2: #5c6780;
  --text-3: #8f9ab1;
  --border: #e4e9f2;
  --code-bg: #1e2430;
  --code-text: #e8edf7;
  --brand: #4f7cff;
  --brand-2: #8b5cf6;
  --brand-rgb: 79, 124, 255;
  --brand-soft: rgba(79, 124, 255, .10);
  --brand-glow: rgba(79, 124, 255, .30);
  --accent: #ff6b81;
  --shadow: 0 4px 18px rgba(24, 35, 64, .06);
  --shadow-lg: 0 12px 36px rgba(24, 35, 64, .10);
  --radius: 16px;
  --topbar-bg: rgba(255, 255, 255, .80);
  --glow1: rgba(79, 124, 255, .13);
  --glow2: rgba(139, 92, 246, .11);
  --mask: rgba(10, 14, 22, .5);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --left-width: 250px;
  --right-width: 300px;
  --topbar-height: 64px;
}

[data-theme="dark"] {
  --bg: #0b0e14;
  --card: #141922;
  --card-2: #1a202b;
  --text: #e8edf7;
  --text-2: #9aa6bd;
  --text-3: #69748a;
  --border: #222a38;
  --code-bg: #0d1117;
  --code-text: #c9d1d9;
  --brand: #5b8bff;
  --brand-2: #9a7bff;
  --brand-rgb: 91, 139, 255;
  --brand-soft: rgba(91, 139, 255, .12);
  --brand-glow: rgba(91, 139, 255, .32);
  --accent: #ff7a8e;
  --shadow: 0 4px 18px rgba(0, 0, 0, .38);
  --shadow-lg: 0 12px 36px rgba(0, 0, 0, .5);
  --topbar-bg: rgba(11, 14, 20, .82);
  --glow1: rgba(91, 139, 255, .10);
  --glow2: rgba(154, 123, 255, .09);
  --mask: rgba(0, 0, 0, .7);
}

* { box-sizing: border-box; }
html { margin: 0; padding: 0; scroll-behavior: smooth; }
body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background .35s ease, color .35s ease;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(720px 420px at 10% -8%, var(--glow1), transparent 70%),
    radial-gradient(720px 420px at 90% -2%, var(--glow2), transparent 70%);
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; border: 0; }
button, input, textarea, select { font: inherit; }
button { color: inherit; border: none; background: none; padding: 0; cursor: pointer; }
input, textarea { color: var(--text); }
svg { display: inline-block; vertical-align: -.12em; }
.svg-sprite { display: none !important; }
[hidden] { display: none !important; }
::selection { background: var(--brand); color: #fff; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}
mark.search-hit {
  background: rgba(255, 193, 7, .30);
  color: inherit;
  padding: 0 2px;
  border-radius: 3px;
}
[data-theme="dark"] mark.search-hit { background: rgba(255, 193, 7, .22); color: #ffe8a3; }

#pjax-container { display: flex; flex-direction: column; flex: 1 0 auto; }

/* --------------------------------------------------------------------------
   2. 顶栏 / 品牌 / 移动端抽屉 / 搜索弹窗
   -------------------------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  width: 100%;
  background: var(--topbar-bg);
  -webkit-backdrop-filter: blur(16px) saturate(1.6);
  backdrop-filter: blur(16px) saturate(1.6);
  border-bottom: 1px solid var(--border);
  transition: background .35s ease, border-color .35s ease;
}
.topbar-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
  height: var(--topbar-height);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}
.top-left { display: flex; align-items: center; gap: 10px; justify-self: start; min-width: 0; }
.brand {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 40vw;
  font-weight: 750;
  font-size: 17px;
  letter-spacing: .2px;
  white-space: nowrap;
}
.brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-logo {
  width: 34px; height: 34px;
  flex: 0 0 34px;
  border-radius: 11px;
  color: #fff;
  font-size: 15px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: grid;
  place-items: center;
  font-weight: 800;
  box-shadow: 0 6px 16px var(--brand-glow);
  overflow: hidden;
}
.brand-logo-img { object-fit: cover; background: var(--card); }
.topnav { display: flex; gap: 4px; }
.topnav a {
  padding: 7px 14px;
  border-radius: 10px;
  font-size: 14px;
  color: var(--text-2);
  transition: .2s;
  font-weight: 500;
  white-space: nowrap;
}
.topnav a:hover { background: var(--card-2); color: var(--text); }
.topnav a.active { color: var(--brand); background: var(--brand-soft); }
.top-actions { justify-self: end; display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 38px; height: 38px;
  flex: 0 0 38px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-2);
  display: grid;
  place-items: center;
  transition: .25s;
  font-size: 18px;
  line-height: 1;
}
.icon-btn:hover { color: var(--brand); border-color: var(--brand); transform: translateY(-1px); }
.icon-btn svg { width: 18px; height: 18px; fill: currentColor; }
.menu-btn { display: none; }
.theme-icon-moon { display: none; }
[data-theme="dark"] .theme-icon-sun { display: none; }
[data-theme="dark"] .theme-icon-moon { display: block; }
#themeToggle svg { transition: transform .5s cubic-bezier(.4, 1.6, .5, 1); }
[data-theme="dark"] #themeToggle svg { transform: rotate(360deg); }

.drawer-mask {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: var(--mask);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s, visibility .3s;
}
.drawer-mask.open { opacity: 1; visibility: visible; }
.drawer {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  width: 310px;
  max-width: 86vw;
  overflow-y: auto;
  background: var(--bg);
  padding: 16px;
  transform: translateX(-105%);
  transition: transform .34s cubic-bezier(.4, 0, .2, 1);
  box-shadow: 12px 0 40px rgba(0, 0, 0, .22);
}
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 14px; font-size: 15px; font-weight: 700; }
.drawer-body { display: flex; flex-direction: column; gap: 14px; }
.drawer-body .panel + .panel { margin-top: 0; }
.drawer-login { padding: 2px; }
.no-scroll { overflow: hidden !important; }

.search-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 20px 20px;
  background: var(--mask);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s, visibility .25s;
}
.search-modal.open { opacity: 1; visibility: visible; }
.search-modal-body {
  width: 100%;
  max-width: 620px;
  padding: 34px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
  position: relative;
  transform: translateY(-14px) scale(.98);
  transition: transform .28s cubic-bezier(.2, .8, .2, 1);
}
.search-modal.open .search-modal-body { transform: translateY(0) scale(1); }
.search-close { position: absolute; top: 16px; right: 16px; }
.search-kicker, .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 1.8px;
  color: var(--brand);
  text-transform: uppercase;
}
.eyebrow svg, .search-kicker svg { width: 12px; height: 12px; flex: 0 0 12px; fill: currentColor; }
.copy-protected .article-content { user-select: none; -webkit-user-select: none; }
.copy-protected .article-content pre,
.copy-protected .article-content code { user-select: text; -webkit-user-select: text; }
.search-kicker { margin-bottom: 8px; }
.search-modal-body h2 { margin: 0 0 18px; font-size: 24px; letter-spacing: -.5px; }
.search-tip { margin: 12px 0 0; font-size: 12px; color: var(--text-3); }

/* 前台登录弹窗 */
.login-modal {
  position: fixed;
  inset: 0;
  z-index: 145;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .28s ease, visibility .28s ease;
}
.login-modal.open { opacity: 1; visibility: visible; }
.login-modal-mask {
  position: absolute;
  inset: 0;
  background: var(--mask);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.login-dialog {
  position: relative;
  z-index: 2;
  width: min(900px, 100%);
  min-height: 470px;
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 30px 90px rgba(4, 9, 22, .36);
  transform: translateY(18px) scale(.975);
  transition: transform .32s cubic-bezier(.2, .85, .25, 1);
}
.login-modal.open .login-dialog { transform: none; }
.login-visual {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: 38px;
  color: #fff;
  background: linear-gradient(145deg, #426df0 0%, #6a68fb 48%, #9a6cff 100%);
}
.login-visual::before {
  content: "";
  position: absolute;
  width: 330px; height: 330px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .11);
  right: -170px; top: -140px;
}
.login-visual::after {
  content: "";
  position: absolute;
  width: 240px; height: 240px;
  border: 1px solid rgba(255, 255, 255, .21);
  border-radius: 50%;
  left: -120px; bottom: -150px;
}
.login-orbit { position: absolute; border: 1px solid rgba(255, 255, 255, .18); border-radius: 50%; pointer-events: none; }
.login-orbit-one { width: 170px; height: 170px; right: -60px; bottom: 40px; }
.login-orbit-two { width: 90px; height: 90px; right: 45px; bottom: -30px; background: rgba(255, 255, 255, .06); }
.login-visual-inner { position: relative; z-index: 2; }
.login-logo {
  width: 58px; height: 58px;
  border-radius: 17px;
  display: grid;
  place-items: center;
  font-size: 25px;
  font-weight: 800;
  background: rgba(255, 255, 255, .20);
  border: 1px solid rgba(255, 255, 255, .30);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 26px rgba(20, 25, 80, .18);
}
.login-kicker { display: block; margin: 25px 0 9px; font-size: 9.5px; font-weight: 800; letter-spacing: 2.2px; color: rgba(255, 255, 255, .62); }
.login-visual h2 { margin: 0 0 9px; color: #fff; font-size: 27px; line-height: 1.3; letter-spacing: -.5px; }
.login-visual p { margin: 0; max-width: 280px; color: rgba(255, 255, 255, .78); font-size: 13px; line-height: 1.75; }
.login-visual-foot { display: flex; align-items: center; gap: 8px; margin-top: 34px; color: rgba(255, 255, 255, .65); font-size: 11px; }
.login-visual-foot span { width: 22px; height: 1px; background: rgba(255, 255, 255, .45); }
.login-form-panel { position: relative; padding: 38px 42px; display: flex; flex-direction: column; justify-content: center; }
.login-close {
  position: absolute; top: 16px; right: 16px;
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--text-3);
  background: var(--card-2);
  transition: .2s;
}
.login-close:hover { color: var(--text); transform: rotate(90deg); }
.login-close svg { width: 16px; height: 16px; fill: currentColor; }
.login-form-panel h2 { margin: 5px 0 3px; font-size: 24px; letter-spacing: -.4px; }
.login-sub { margin: 0 0 20px; color: var(--text-3); font-size: 12.5px; }
.login-form { display: flex; flex-direction: column; gap: 12px; }
.login-field { display: flex; flex-direction: column; gap: 5px; }
.login-field > span { font-size: 11.5px; font-weight: 600; color: var(--text-2); }
.login-field input {
  width: 100%;
  height: 43px;
  padding: 0 13px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card-2);
  color: var(--text);
  outline: none;
  font-size: 13px;
  transition: .2s;
}
.login-field input:focus { border-color: var(--brand); background: var(--card); box-shadow: 0 0 0 3px var(--brand-soft); }
.login-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 1px 0 2px; }
.login-remember, .login-secure { display: inline-flex; align-items: center; gap: 5px; color: var(--text-3); font-size: 11.5px; }
.login-remember input { width: 13px; height: 13px; accent-color: var(--brand); }
.login-secure svg { width: 12px; height: 12px; fill: currentColor; }
.login-submit {
  width: 100%;
  height: 44px;
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 8px 20px var(--brand-glow);
  transition: .22s;
}
.login-submit:hover { transform: translateY(-2px); box-shadow: 0 12px 26px var(--brand-glow); }
.login-submit:disabled { opacity: .55; cursor: wait; transform: none; }
.login-error {
  padding: 9px 11px;
  border-radius: 8px;
  border: 1px solid rgba(239, 68, 68, .22);
  background: rgba(239, 68, 68, .08);
  color: #dc2626;
  font-size: 11.5px;
  line-height: 1.5;
}
.login-hint { margin: 14px 0 0; text-align: center; font-size: 10.5px; color: var(--text-3); }

/* --------------------------------------------------------------------------
   3. 布局 / 面板 / 通用控件
   -------------------------------------------------------------------------- */
.layout {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px;
  width: 100%;
  flex: 1 0 auto;
  display: grid;
  grid-template-columns: var(--left-width) minmax(0, 1fr) var(--right-width);
  gap: 24px;
  align-items: start;
}
.no-right-sidebar .layout { grid-template-columns: var(--left-width) minmax(0, 1fr); }
.no-left-sidebar .layout { grid-template-columns: minmax(0, 1fr) var(--right-width); }
.no-left-sidebar.no-right-sidebar .layout { grid-template-columns: minmax(0, 1fr); }
.sidebar-left,
.sidebar-right {
  position: sticky;
  top: calc(var(--topbar-height) + 24px);
  max-height: calc(100vh - var(--topbar-height) - 48px);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  padding-bottom: 8px;
}
.sidebar-left::-webkit-scrollbar,
.sidebar-right::-webkit-scrollbar { width: 4px; }
.sidebar-left::-webkit-scrollbar-thumb,
.sidebar-right::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.sidebar-right { display: flex; flex-direction: column; gap: 16px; overscroll-behavior: contain; }
.sidebar-right > * { flex: 0 0 auto; min-width: 0; }
.sidebar-right .panel + .panel { margin-top: 0; }
.sidebar-ad-wrap { min-width: 0; }

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
  transition: background .35s, border-color .35s, box-shadow .25s, transform .25s;
}
.panel + .panel { margin-top: 16px; }
.panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .2px;
}
.panel-head .bar {
  width: 4px;
  height: 15px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--brand), var(--brand-2));
  flex: 0 0 4px;
}
.panel-head .live { margin-left: auto; font-size: 10.5px; font-weight: 700; color: #22c55e; display: flex; align-items: center; gap: 5px; letter-spacing: .5px; }
.panel-head .head-more { margin-left: auto; font-size: 9.5px; letter-spacing: 1.5px; color: var(--text-3); font-weight: 800; }
.live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, .6);
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); }
  70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.input, .search-form input, .comment-form input, .comment-form textarea, .hidden-form input {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--card-2);
  border-radius: 12px;
  padding: 11px 14px;
  outline: none;
  transition: .2s;
}
.input:focus, .search-form input:focus, .comment-form input:focus, .comment-form textarea:focus, .hidden-form input:focus {
  border-color: var(--brand);
  background: var(--card);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.search-form { display: flex; gap: 8px; min-width: 0; }
.search-form input { min-width: 0; flex: 1; }
.search-form button {
  flex: 0 0 44px;
  width: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 6px 16px var(--brand-glow);
  transition: .22s;
}
.search-form button:hover { transform: translateY(-2px); box-shadow: 0 10px 22px var(--brand-glow); }
.search-form button svg { width: 18px; height: 18px; fill: currentColor; }

/* 左侧栏 */
.profile-cover {
  height: 96px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(120deg, var(--brand) 0%, var(--brand-2) 100%);
  background-size: cover;
  background-position: center;
}
.profile-cover.has-image { background-color: var(--card-2); }
.profile-cover.has-image::before,
.profile-cover.has-image::after { display: none; }
.profile-cover.has-image::before {
  display: block;
  inset: 0;
  width: auto;
  height: auto;
  border-radius: 0;
  background: linear-gradient(180deg, rgba(10, 16, 30, .04), rgba(10, 16, 30, .20));
}
.profile-cover::before {
  content: "";
  position: absolute;
  width: 150px; height: 150px;
  border-radius: 50%;
  right: -46px; top: -70px;
  background: rgba(255, 255, 255, .22);
}
.profile-cover::after {
  content: "";
  position: absolute;
  width: 96px; height: 96px;
  border-radius: 50%;
  left: -30px; bottom: -56px;
  background: rgba(255, 255, 255, .14);
}
.avatar-wrap { position: relative; z-index: 2; width: 78px; margin: -39px auto 0; }
.avatar {
  width: 78px; height: 78px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  font-size: 28px;
  font-weight: 800;
  display: grid;
  place-items: center;
  border: 4px solid var(--card);
  box-shadow: 0 8px 22px var(--brand-glow);
  transition: border-color .35s;
  object-fit: cover;
}
.avatar-img { object-fit: cover; }
.avatar-status {
  position: absolute; right: 2px; bottom: 3px;
  width: 15px; height: 15px; border-radius: 50%;
  background: #22c55e;
  border: 3px solid var(--card);
}
.profile-body { padding: 10px 18px 20px; text-align: center; }
.profile-body h3 { margin: 8px 0 3px; font-size: 16.5px; letter-spacing: .2px; }
.profile-role {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 2px 10px;
  border-radius: 20px;
  margin-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-role svg { width: 11px; height: 11px; flex: 0 0 11px; fill: currentColor; }
.profile-url span { overflow: hidden; text-overflow: ellipsis; }
.profile-url:hover { color: var(--brand-2); }
.profile-body p { margin: 0; font-size: 12.5px; color: var(--text-3); line-height: 1.6; }
.profile-socials { display: flex; justify-content: center; gap: 8px; margin-top: 13px; flex-wrap: wrap; }
.profile-socials a {
  width: 30px; height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  border: 1px solid var(--border);
  color: var(--text-2);
  background: var(--card-2);
  transition: .2s;
}
.profile-socials a:hover { color: #fff; background: var(--brand); border-color: var(--brand); transform: translateY(-2px); }
.profile-socials svg { width: 15px; height: 15px; fill: currentColor; }

.nav-list { list-style: none; margin: 0; padding: 8px; }
.nav-list li a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 11px;
  font-size: 14px;
  color: var(--text-2);
  font-weight: 500;
  transition: .2s;
}
.nav-list li a svg { width: 17px; height: 17px; fill: currentColor; opacity: .85; flex: 0 0 17px; }
.nav-list li a:hover { background: var(--card-2); color: var(--text); transform: translateX(2px); }
.nav-list li a.active {
  background: linear-gradient(90deg, var(--brand-soft), rgba(139, 92, 246, .07));
  color: var(--brand);
  font-weight: 600;
}
.left-login { padding: 2px; margin-top: 16px; }
.drawer-login { padding: 2px; }
.login-btn {
  display: block;
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 6px 16px var(--brand-glow);
  transition: .25s;
  text-align: center;
}
.login-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 22px var(--brand-glow); }

/* --------------------------------------------------------------------------
   4. 首页：轮播 / Banner / Head / Tab / 卡片 / 广告 / 分页
   -------------------------------------------------------------------------- */
.content { display: flex; flex-direction: column; gap: 18px; min-width: 0; width: 100%; }

.carousel {
  position: relative;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--card);
  touch-action: pan-y;
}
.c-track { display: flex; transition: transform .6s cubic-bezier(.4, 0, .2, 1); will-change: transform; }
.c-slide {
  flex: 0 0 100%;
  min-height: 238px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: 30px 42px;
  color: #fff;
  background: linear-gradient(120deg, var(--g1, #4f7cff), var(--g2, #8b5cf6));
}
.c-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
.c-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg, rgba(8, 12, 24, .70), rgba(8, 12, 24, .18) 70%, rgba(8, 12, 24, .05));
}
.c-slide::before {
  content: "";
  position: absolute;
  width: 280px; height: 280px;
  border-radius: 50%;
  right: -80px; top: -120px;
  background: rgba(255, 255, 255, .14);
  z-index: 1;
}
.c-slide::after {
  content: "";
  position: absolute;
  width: 190px; height: 190px;
  border-radius: 50%;
  right: 110px; bottom: -110px;
  background: rgba(255, 255, 255, .09);
  z-index: 1;
}
.c-inner { position: relative; z-index: 2; max-width: 620px; }
.c-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 1.2px;
  padding: 4px 10px;
  border-radius: 7px;
  margin-bottom: 11px;
  background: rgba(255, 255, 255, .20);
  border: 1px solid rgba(255, 255, 255, .32);
  backdrop-filter: blur(5px);
}
.c-tag svg { width: 12px; height: 12px; fill: currentColor; }
.c-inner h2 { margin: 0 0 8px; font-size: 25px; line-height: 1.32; letter-spacing: -.5px; text-shadow: 0 2px 16px rgba(0, 0, 0, .22); }
.c-inner p { margin: 0 0 17px; font-size: 13.5px; opacity: .92; line-height: 1.6; text-shadow: 0 1px 10px rgba(0, 0, 0, .18); }
.c-more {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  background: #fff;
  color: #26304a;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .2);
  transition: .25s;
}
.c-more svg { width: 14px; height: 14px; fill: currentColor; }
.c-more:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0, 0, 0, .28); }
.c-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .35);
  background: rgba(255, 255, 255, .18);
  color: #fff;
  font-size: 19px;
  line-height: 1;
  display: grid;
  place-items: center;
  backdrop-filter: blur(8px);
  transition: .22s;
  opacity: 0;
}
.carousel:hover .c-nav, .carousel:focus-within .c-nav { opacity: 1; }
.c-nav:hover { background: rgba(255, 255, 255, .38); transform: translateY(-50%) scale(1.08); }
.c-nav.prev { left: 14px; }
.c-nav.next { right: 14px; }
.c-autoplay {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 6;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .28);
  background: rgba(8, 12, 24, .24);
  color: rgba(255, 255, 255, .82);
  font-size: 9px;
  line-height: 1;
  backdrop-filter: blur(6px);
  transition: .2s;
}
.c-autoplay:hover, .c-autoplay.is-paused { color: #fff; background: rgba(8, 12, 24, .44); }
.c-dots { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 5; display: flex; gap: 7px; }
.c-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, .45); transition: .28s; padding: 0; }
.c-dot.active { width: 22px; border-radius: 5px; background: #fff; }

.home-banner { min-height: 260px; display: flex; align-items: flex-end; position: relative; border: 1px solid var(--border); }
.home-banner-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.home-banner-mask { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10, 14, 26, .72), rgba(10, 14, 26, .1)); }
.home-banner-body { position: relative; z-index: 2; padding: 34px; color: #fff; max-width: 650px; }
.home-banner-body h1 { margin: 8px 0; font-size: 29px; letter-spacing: -.6px; }
.home-banner-body p { margin: 0; font-size: 14px; opacity: .9; }
.home-banner .c-tag { margin-bottom: 0; }

.home-heading { padding: 4px 4px 0; }
.home-heading h1 { margin: 5px 0 3px; font-size: 25px; letter-spacing: -.6px; }
.home-heading > div > p { margin: 0; color: var(--text-2); font-size: 13.5px; }
.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 15px;
  background: var(--card);
}
.stats-strip-item {
  padding: 13px 8px;
  text-align: center;
  border-right: 1px solid var(--border);
}
.stats-strip-item:last-child { border-right: 0; }
.stats-strip-item strong {
  display: block;
  font-size: 19px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -.4px;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(100deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stats-strip-item span { font-size: 11px; color: var(--text-3); }

.category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 5px;
  scrollbar-width: none;
}
.category-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
  flex: 0 0 auto;
  padding: 8px 15px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  transition: .2s;
  white-space: nowrap;
}
.cat-tab span { margin-left: 5px; font-size: 10px; opacity: .55; }
.cat-tab:hover { color: var(--brand); border-color: var(--brand); }
.cat-tab.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 6px 16px var(--brand-glow);
}

.post-feed { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.post {
  display: flex;
  gap: 18px;
  padding: 14px 16px;
  overflow: hidden;
  align-items: center;
  width: 100%;
}
.post:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: rgba(var(--brand-rgb), .35); }
.post.is-hidden-by-filter { display: none !important; }
.post.is-sticky { border-color: rgba(var(--brand-rgb), .35); }
.pin-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #ff8a5b, #ff5e7e);
  box-shadow: 0 4px 10px rgba(255, 94, 126, .26);
}
.pin-badge svg { width: 10px; height: 10px; fill: currentColor; }
.post-badges {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100% - 20px);
}
.post-badges .pin-badge {
  position: static;
  height: 22px;
  min-width: 56px;
  box-sizing: border-box;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  color: #fff;
}
.post-badges .pin-badge { box-shadow: 0 4px 10px rgba(255, 94, 126, .26); }
.post-cover .post-cover-new {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 3;
  width: auto;
  min-width: 0;
  height: 17px;
  margin: 0;
  padding: 0 5px;
  border-radius: 5px;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: .5px;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(16, 185, 129, .26);
}
.post-cover {
  flex: 0 0 122px;
  height: 122px;
  border-radius: 14px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--c1, #5b87ff), var(--c2, #8b6cff));
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.post-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(circle at 75% 15%, rgba(255, 255, 255, .25), transparent 55%),
    linear-gradient(180deg, transparent 60%, rgba(0, 0, 0, .16));
}
.post-cover img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.post:hover .post-cover img { transform: scale(1.05); }
.post-cover-shade { position: absolute; inset: 0; z-index: 0; }
.post-cover-fallback {
  position: relative;
  z-index: 1;
  color: #fff;
  font-weight: 800;
  font-size: 28px;
  letter-spacing: 1px;
  text-shadow: 0 3px 12px rgba(0, 0, 0, .2);
}
.post-main { min-width: 0; flex: 1; display: flex; flex-direction: column; justify-content: center; }
.post-title {
  margin: 0 0 5px;
  font-size: 17.5px;
  line-height: 1.45;
  font-weight: 750;
  letter-spacing: -.2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-title a { color: var(--text); transition: color .2s; }
.post:hover .post-title a { color: var(--brand); }
.post-cat {
  display: inline-block;
  align-self: flex-start;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 6px;
  margin-bottom: 9px;
  color: var(--brand);
  background: var(--brand-soft);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.post-excerpt {
  margin: 0 0 11px;
  font-size: 13.5px;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
#postFeed .post-excerpt {
  -webkit-line-clamp: 1;
}
.post-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--text-3); }
.post-meta i { font-style: normal; opacity: .5; }
.post-author { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.post-author-avatar {
  position: relative;
  width: 21px;
  height: 21px;
  flex: 0 0 21px;
  border-radius: 50%;
  overflow: hidden;
  display: inline-grid;
  place-items: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .14);
}
.post-author-avatar .avatar-sm { position: absolute; inset: 0; width: 100%; height: 100%; box-shadow: none; }
.avatar-sm-img {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.avatar-sm-fallback { position: relative; z-index: 1; }
.avatar-sm-img.is-broken { display: none; }
.avatar-sm {
  width: 21px; height: 21px;
  border-radius: 50%;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  font-style: normal;
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 2px 6px rgba(0, 0, 0, .14);
}
.post-meta-item { display: inline-flex; align-items: center; gap: 4px; color: var(--text-3); }
.post-meta-item svg { width: 13px; height: 13px; fill: currentColor; opacity: .8; }

/* 广告 */
.ad-card {
  position: relative;
  border: 1px dashed rgba(var(--brand-rgb), .28);
  background:
    linear-gradient(135deg, rgba(var(--brand-rgb), .035), transparent 45%),
    var(--card);
  border-radius: var(--radius);
  padding: 17px;
  min-width: 0;
  overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
}
.ad-card:hover { border-color: rgba(var(--brand-rgb), .55); box-shadow: var(--shadow); }
.ad-badge {
  position: absolute;
  top: 9px;
  right: 10px;
  z-index: 6;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.2px;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--text-3);
  color: #fff;
  opacity: .75;
  border: 1px solid rgba(255, 255, 255, .15);
  backdrop-filter: blur(4px);
}
[data-theme="dark"] .ad-badge { background: #374151; color: #e5e7eb; opacity: .9; }
.ad-slot { min-width: 0; width: 100%; }
.ad-slot img { max-width: 100%; height: auto; }
.ad-slot iframe { max-width: 100%; }
.ad-structured-link { display: flex; align-items: center; gap: 13px; color: inherit; text-decoration: none; }
.ad-structured-link:hover { color: var(--brand); }
.ad-structured-img { width: 104px; max-width: 38%; height: 68px; flex: 0 0 auto; object-fit: cover; border-radius: 9px; background: var(--card-2); }
.ad-structured-text { min-width: 0; color: var(--text-2); font-size: 12px; line-height: 1.65; }
.ad-sidebar .ad-structured-link, .ad-card.ad-sidebar .ad-structured-link { flex-direction: column; align-items: stretch; gap: 9px; }
.ad-card.ad-sidebar .ad-structured-img { width: 100%; max-width: 100%; height: 110px; }
.ad-page .ad-structured-link, .ad-global .ad-structured-link { max-width: 760px; }
.post-feed > .ad-card { margin: 0; }
.article-ad { margin: 0 0 20px; }
.article-ad-bottom, .article-ad-page { margin-top: 24px; }
.sidebar-right .ad-card { margin: 0; }
.global-ad-wrap { max-width: 1440px; margin: 4px auto 0; padding: 0 24px 20px; width: 100%; }
.global-ad-wrap .ad-card { margin: 0; }

/* 分页 */
.pager { display: flex; justify-content: center; width: 100%; padding: 6px 0 4px; }
.page-navigator {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 0;
}
.page-navigator li { display: inline-flex; }
.page-navigator li a,
.page-navigator li span,
.page-navigator li.current a {
  min-width: 38px;
  height: 38px;
  padding: 0 13px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text-2);
  transition: .2s;
}
.page-navigator li a:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-2px); }
.page-navigator li.current a,
.page-navigator li.current span,
.page-navigator li a.active {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 20px var(--brand-glow);
}
.page-navigator li.disabled a,
.page-navigator li.disabled span { opacity: .4; pointer-events: none; }

/* 空状态 */
.empty-state { padding: 44px 24px; text-align: center; }
.empty-icon {
  width: 58px; height: 58px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: var(--brand-soft);
  color: var(--brand);
}
.empty-icon svg { width: 26px; height: 26px; fill: currentColor; }
.empty-state h2 { margin: 0 0 5px; font-size: 19px; }
.empty-state p { margin: 0 0 16px; color: var(--text-3); font-size: 13.5px; }
.empty-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 10px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 6px 16px var(--brand-glow);
  transition: .22s;
}
.empty-action:hover { transform: translateY(-2px); box-shadow: 0 10px 22px var(--brand-glow); }
.empty-action svg { width: 15px; height: 15px; fill: currentColor; }
.filter-empty { padding: 28px; text-align: center; color: var(--text-3); font-size: 13.5px; }
.filter-empty p { margin: 0; }

/* --------------------------------------------------------------------------
   5. 文章 / 独立页面
   -------------------------------------------------------------------------- */
.breadcrumbs {
  font-size: 13px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  padding: 0 4px;
  min-width: 0;
}
.breadcrumbs a { display: inline-flex; align-items: center; gap: 4px; transition: color .2s; }
.breadcrumbs a:hover { color: var(--brand); }
.breadcrumbs i { font-style: normal; opacity: .5; }
.breadcrumbs span[aria-current] { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.breadcrumbs svg { width: 13px; height: 13px; fill: currentColor; }

.article-main { padding: 24px 28px; }
.article-header { margin-bottom: 14px; }
.article-title {
  margin: 0 0 12px;
  font-size: 30px;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -.6px;
  overflow-wrap: anywhere;
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  color: var(--text-3);
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.meta-item { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.meta-item svg { width: 14px; height: 14px; fill: currentColor; opacity: .8; }
.meta-author { gap: 7px; }
.meta-avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  object-fit: cover;
}
.meta-category { color: var(--brand); font-weight: 600; }
.page-meta { border-bottom: 0; padding-bottom: 0; }

.article-hero-img {
  width: 100%;
  height: 320px;
  border-radius: 14px;
  margin: 22px 0;
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--c1, #5b87ff), var(--c2, #8b6cff));
}
.article-hero-img img { width: 100%; height: 100%; object-fit: cover; }
.article-hero-img::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 75% 15%, rgba(255, 255, 255, .18), transparent 55%),
    linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, .10));
}
.article-hero-fallback span {
  position: relative;
  z-index: 2;
  color: #fff;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 3px;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .2);
}

.timeliness-note {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(245, 166, 35, .09);
  border: 1px solid rgba(245, 166, 35, .22);
  color: #a16207;
  margin-bottom: 22px;
  font-size: 13px;
}
[data-theme="dark"] .timeliness-note { color: #fbbf24; }
.timeliness-note > svg { width: 18px; height: 18px; flex: 0 0 18px; fill: currentColor; margin-top: 2px; }
.timeliness-note strong { display: block; font-size: 13px; margin-bottom: 1px; }
.timeliness-note p { margin: 0; line-height: 1.6; }

.article-summary {
  margin: 4px 0 22px;
  padding: 15px 18px 16px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand);
  border-radius: 0 10px 10px 0;
  background: var(--card-2);
}
.article-summary-head { display: flex; align-items: center; gap: 7px; margin-bottom: 7px; }
.article-summary-mark { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; color: var(--brand); background: var(--brand-soft); }
.article-summary-mark svg { width: 12px; height: 12px; fill: currentColor; }
.article-summary-head strong { color: var(--text-2); font-size: 12px; font-weight: 800; }
.article-summary-head em { margin-left: 1px; color: var(--text-3); font-size: 8px; font-style: normal; font-weight: 800; letter-spacing: 1.4px; }
.article-summary p { margin: 0; color: var(--text-2); font-size: 13px; line-height: 1.8; }
@media (max-width: 620px) {
  .article-summary { margin-bottom: 18px; padding: 13px 14px 14px; }
  .article-summary p { font-size: 12.5px; line-height: 1.75; }
}

.article-content {
  font-size: 15.5px;
  line-height: 1.82;
  color: var(--text);
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.article-content > :first-child { margin-top: 0; }
.article-content p { margin: 0 0 1.5em; }
.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5 {
  margin: 1.8em 0 .8em;
  font-weight: 750;
  color: var(--text);
  line-height: 1.4;
  scroll-margin-top: calc(var(--topbar-height) + 18px);
}
.article-content h2 { font-size: 1.4em; border-left: 4px solid var(--brand); padding-left: 11px; }
.article-content h3 { font-size: 1.2em; }
.article-content h4 { font-size: 1.05em; }
.article-content a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.article-content a:hover { opacity: .85; }
.article-content img { max-width: 100%; height: auto; border-radius: 10px; margin: 1.5em auto; box-shadow: var(--shadow); cursor: zoom-in; }
.article-content figure { margin: 1.5em 0; }
.article-content figure img { margin: 0 auto; }
.article-content figcaption { text-align: center; font-size: 12px; color: var(--text-3); margin-top: 7px; }
.article-content blockquote {
  margin: 1.5em 0;
  padding: 15px 20px;
  background: var(--card-2);
  border-left: 4px solid var(--brand);
  border-radius: 0 8px 8px 0;
  color: var(--text-2);
  font-style: italic;
}
.article-content blockquote p:last-child { margin-bottom: 0; }
.article-content ul, .article-content ol { margin: 0 0 1.5em; padding-left: 1.5em; }
.article-content li { margin-bottom: .45em; }
.article-content li::marker { color: var(--brand); }
.article-content hr { border: 0; border-top: 1px dashed var(--border); margin: 2em 0; }
.article-content code {
  background: var(--card-2);
  padding: 2px 6px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: .9em;
  color: var(--brand-2);
  border: 1px solid var(--border);
}
.article-content pre {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 18px 20px;
  border-radius: 12px;
  overflow-x: auto;
  margin: 0 0 1.5em;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
  font-size: 13.5px;
  line-height: 1.65;
  position: relative;
  tab-size: 4;
}
.article-content pre code {
  background: transparent;
  padding: 0;
  color: inherit;
  font-size: inherit;
  border: 0;
  white-space: pre;
}
.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.5em;
  font-size: 13.5px;
}
.article-content th, .article-content td { border: 1px solid var(--border); padding: 9px 12px; text-align: left; }
.article-content th { background: var(--card-2); font-weight: 700; }
.article-content iframe, .article-content video { max-width: 100%; border-radius: 10px; }
.article-content audio { max-width: 100%; }
.article-content .table-wrap { width: 100%; overflow-x: auto; margin-bottom: 1.5em; }
.article-content .table-wrap table { margin-bottom: 0; }

/* 代码块工具条 */
.code-block { position: relative; margin: 0 0 1.5em; }
.code-block pre { margin: 0; padding-top: 38px; }
.code-toolbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 9px 0 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .09);
  background: rgba(255, 255, 255, .025);
  color: #94a3b8;
  font-family: var(--font-mono);
  font-size: 10.5px;
  z-index: 2;
  border-radius: 12px 12px 0 0;
}
.code-lang { letter-spacing: .8px; text-transform: uppercase; opacity: .8; }
.code-copy {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #cbd5e1;
  font-family: var(--font-sans);
  font-size: 11px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 6px;
  padding: 3px 8px;
  transition: .2s;
}
.code-copy:hover { color: #fff; border-color: rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .08); }
.code-copy svg { width: 12px; height: 12px; fill: currentColor; }
.code-copy.copied { color: #86efac; border-color: rgba(134, 239, 172, .35); }

/* 隐藏内容 */
.hidden-block {
  margin: 1.6em 0;
  padding: 20px;
  border-radius: 12px;
  border: 1px dashed rgba(var(--brand-rgb), .35);
  background: rgba(var(--brand-rgb), .045);
}
.hidden-unlocked { border-style: solid; border-color: var(--border); background: var(--card-2); }
.hidden-lock-title { display: flex; align-items: center; gap: 7px; font-weight: 700; font-size: 14px; margin-bottom: 5px; }
.hidden-lock-title svg { width: 16px; height: 16px; fill: var(--brand); }
.hidden-block > p { margin: 0 0 12px; font-size: 13px; color: var(--text-2); }
.hidden-block > p:last-child { margin-bottom: 0; }
.hidden-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 5px 14px var(--brand-glow);
  text-decoration: none !important;
}
.article-content .hidden-action,
.hidden-block .hidden-action { color: #fff !important; }
.article-content .hidden-action:hover,
.hidden-block .hidden-action:hover { color: #fff !important; opacity: .92; }
.hidden-form { display: flex; gap: 8px; flex-wrap: wrap; }
.hidden-form input { flex: 1; min-width: 150px; padding: 9px 12px; }
.hidden-form button {
  padding: 9px 18px;
  border-radius: 9px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}
.hidden-error { color: #ef4444 !important; font-size: 12.5px !important; }
.article-content .hidden-block .hidden-unlocked > :last-child { margin-bottom: 0; }

/* 文末标签 / 版权 / 打赏 */
.article-footer { margin-top: 28px; padding-top: 22px; border-top: 1px dashed var(--border); }
.article-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.article-tags a {
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 8px;
  background: var(--card-2);
  color: var(--text-2);
  transition: .2s;
}
.article-tags a:hover { background: var(--brand); color: #fff; }
.copyright-box {
  margin-top: 22px;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 17px 18px;
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.75;
}
.copyright-head { display: flex; align-items: center; gap: 7px; color: var(--text); margin-bottom: 6px; font-size: 13.5px; }
.copyright-head svg { width: 15px; height: 15px; fill: var(--brand); }
.copyright-box p { margin: 2px 0; overflow-wrap: anywhere; }
.copyright-box a { color: var(--brand); }
.copyright-box a:hover { text-decoration: underline; }
.article-tools { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 24px; padding-top: 18px; border-top: 1px dashed var(--border); }
.reward-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: 11px;
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 6px 16px var(--brand-glow);
  transition: .22s;
}
.reward-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px var(--brand-glow); }
.reward-btn svg { width: 15px; height: 15px; fill: currentColor; }
.article-tools-tip { font-size: 12px; color: var(--text-3); }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 4px; }
.post-nav-item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 16px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow);
  transition: .25s;
  min-width: 0;
}
.post-nav-item:hover { background: var(--card-2); border-color: var(--brand); transform: translateY(-2px); }
.post-nav-item.next { text-align: right; align-items: flex-end; }
.post-nav-item span { font-size: 12px; color: var(--text-3); margin-bottom: 6px; display: inline-flex; align-items: center; gap: 4px; }
.post-nav-item span svg { width: 12px; height: 12px; fill: currentColor; }
.post-nav-item strong {
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.post-nav-item.disabled { opacity: .6; pointer-events: none; box-shadow: none; }

/* 打赏弹窗 */
.reward-modal {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--mask);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: .25s;
}
.reward-modal.open { opacity: 1; visibility: visible; }
.reward-dialog {
  width: 100%;
  max-width: 380px;
  padding: 28px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow-lg);
  text-align: center;
  position: relative;
  transform: translateY(12px) scale(.97);
  transition: .28s cubic-bezier(.2, .8, .2, 1);
}
.reward-modal.open .reward-dialog { transform: none; }
.reward-close { position: absolute; top: 13px; right: 13px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--card-2); color: var(--text-2); }
.reward-close svg { width: 16px; height: 16px; fill: currentColor; }
.reward-dialog h2 { margin: 7px 0 3px; font-size: 22px; }
.reward-dialog > p { margin: 0 0 18px; font-size: 12.5px; color: var(--text-3); }
.reward-tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 10px; background: var(--card-2); margin-bottom: 14px; }
.reward-tab { padding: 6px 18px; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.reward-tab.active { background: var(--card); color: var(--brand); box-shadow: var(--shadow); }
.reward-panel { display: none; }
.reward-panel.active { display: block; }
.reward-panel img { width: 220px; max-width: 100%; margin: 0 auto; border-radius: 10px; }

/* 富文本独立区 */
.rich-intro { padding: 22px 26px; font-size: 14px; line-height: 1.8; color: var(--text-2); }
.rich-intro > :first-child { margin-top: 0; }
.rich-intro > :last-child { margin-bottom: 0; }
.rich-intro img { max-width: 100%; height: auto; border-radius: 10px; margin: 1em auto; }
.rich-intro a { color: var(--brand); }
.rich-intro p { margin: 0 0 1em; }
.rich-intro h2, .rich-intro h3 { color: var(--text); }

/* --------------------------------------------------------------------------
   6. 评论
   -------------------------------------------------------------------------- */
.comments-section { margin-top: 0; }
.comments-head { justify-content: flex-start; }
.comments-count { margin-left: auto; font-size: 11.5px; color: var(--text-3); font-weight: 500; }
.comments-empty { padding: 28px 22px; text-align: center; color: var(--text-3); font-size: 13px; }
.comments-empty svg { width: 26px; height: 26px; fill: var(--text-3); opacity: .5; margin: 0 auto 8px; }
.comments-empty p { margin: 0; }
.comment-list-wrap { padding: 20px; }
.comment-list, .comment-child-list { list-style: none; margin: 0; padding: 0; }
.comment-item { margin-bottom: 22px; }
.comment-item:last-child { margin-bottom: 0; }
.comment-inner { display: flex; gap: 13px; align-items: flex-start; min-width: 0; }
.comment-avatar-wrap {
  position: relative;
  width: 42px; height: 42px;
  flex: 0 0 42px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 4px 10px var(--brand-glow);
}
.comment-avatar-img { width: 100%; height: 100%; object-fit: cover; }
.comment-avatar-fallback {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 15px;
}
.comment-avatar-wrap.is-broken .comment-avatar-img { display: none; }
.comment-avatar-wrap.is-broken .comment-avatar-fallback { display: grid; }
.comment-item.comment-by-author .comment-avatar-wrap { box-shadow: 0 4px 10px rgba(245, 166, 35, .28); }
.comment-body { flex: 1; min-width: 0; }
.comment-header { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; flex-wrap: wrap; }
.comment-author { font-weight: 700; font-size: 13.5px; color: var(--text); }
a.comment-author:hover { color: var(--brand); }
.comment-badge {
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--card-2);
  color: var(--text-3);
  border: 1px solid var(--border);
}
.author-badge { background: rgba(245, 166, 35, .12); color: #d97706; border-color: rgba(245, 166, 35, .25); }
.waiting-badge { background: rgba(239, 68, 68, .10); color: #dc2626; border-color: rgba(239, 68, 68, .2); }
.comment-time { font-size: 11.5px; color: var(--text-3); }
.comment-reply-btn { margin-left: auto; font-size: 11.5px; color: var(--text-3); }
.comment-reply-btn a { color: var(--text-3); transition: color .2s; }
.comment-reply-btn a:hover { color: var(--brand); }
.comment-text {
  font-size: 13.8px;
  color: var(--text-2);
  line-height: 1.72;
  overflow-wrap: anywhere;
}
.comment-text p { margin: 0 0 .7em; }
.comment-text p:last-child { margin-bottom: 0; }
.comment-text a { color: var(--brand); }
.comment-text img { border-radius: 6px; max-width: 100%; }
.comment-images { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.comment-images .nebula-comment-image { display: block; width: auto; max-width: 100%; max-height: 220px; object-fit: cover; border-radius: 8px; cursor: zoom-in; }
.comment-text img.nebula-comment-emoji { display: inline-block; width: 22px; height: 22px; max-width: 22px; max-height: 22px; margin: 0 1px; vertical-align: -4px; object-fit: contain; border-radius: 0; cursor: default; }
.comment-text code { background: var(--card-2); padding: 1px 5px; border-radius: 4px; font-size: .9em; }
.comment-text blockquote { margin: .8em 0; padding: 7px 12px; border-left: 3px solid var(--border); background: var(--card-2); color: var(--text-3); }
.reply-to { color: var(--brand); font-weight: 600; margin-right: 4px; }
.comment-children { margin-top: 15px; margin-left: 10px; padding-left: 17px; border-left: 2px solid var(--border); }
.comment-child-list .comment-item { margin-top: 18px; margin-bottom: 0; }
.comment-child-list .comment-avatar-wrap { width: 34px; height: 34px; flex-basis: 34px; }
.comment-child-list .comment-inner { gap: 10px; }
.comment-child-list .comment-author { font-size: 12.8px; }
.comment-pager { padding: 0 20px 20px; }
.comment-pager .page-navigator { justify-content: flex-start; }
.comment-pager .page-navigator li a, .comment-pager .page-navigator li span { min-width: 31px; height: 31px; font-size: 12px; border-radius: 8px; }

.comment-form-wrap { border-top: 1px solid var(--border); padding: 20px; }
.comment-form-head { display: flex; align-items: center; gap: 8px; margin-bottom: 13px; font-size: 14px; }
.comment-form-head .bar { width: 4px; height: 15px; border-radius: 3px; background: linear-gradient(180deg, var(--brand), var(--brand-2)); }
.comment-form-head .cancel-comment-reply { margin-left: auto; font-size: 11.5px; font-weight: 500; }
.cancel-comment-reply a { color: var(--text-3); }
.cancel-comment-reply a:hover { color: var(--brand); }
.comment-notice {
  display: flex;
  gap: 7px;
  align-items: center;
  padding: 9px 12px;
  border-radius: 9px;
  background: rgba(245, 166, 35, .09);
  border: 1px solid rgba(245, 166, 35, .2);
  color: #a16207;
  font-size: 12px;
  margin-bottom: 14px;
}
[data-theme="dark"] .comment-notice { color: #fbbf24; }
.comment-notice svg { width: 14px; height: 14px; fill: currentColor; flex: 0 0 14px; }
.comment-error { background: rgba(239, 68, 68, .09); border-color: rgba(239, 68, 68, .22); color: #b91c1c; }
[data-theme="dark"] .comment-error { color: #fca5a5; }
.comment-form { display: block; }
.comment-editor-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.comment-editor-user { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-3); }
.comment-editor-user strong { color: var(--text); }
.comment-editor-user a { color: var(--brand); }
.editor-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; background: var(--card-2); }
.comment-policy { font-size: 11px; color: var(--text-3); }
.comment-textarea-wrap { position: relative; }
.comment-form textarea {
  width: 100%;
  min-height: 120px;
  padding: 15px;
  border-radius: 12px;
  background: var(--card-2);
  resize: vertical;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.7;
}
.emoji-picker { position: relative; display: inline-flex; margin-top: 8px; }
.emoji-toggle {
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card-2);
  font-size: 12px;
  color: var(--text-2);
}
.emoji-panel {
  position: absolute;
  z-index: 10;
  left: 0; bottom: 38px;
  width: 286px;
  max-height: 210px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 3px;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  box-shadow: var(--shadow-lg);
}
.emoji-item { font-size: 18px; padding: 4px; border-radius: 6px; }
.emoji-item:hover { background: var(--card-2); }
.comment-inputs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 13px; }
.comment-inputs .input-group label { display: block; font-size: 11px; color: var(--text-3); margin-bottom: 4px; }
.comment-inputs .input-group label em { color: var(--accent); font-style: normal; }
.comment-inputs input { padding: 9px 12px; font-size: 13px; }
.captcha-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 13px; }
.captcha-row label { font-size: 12px; color: var(--text-3); }
.captcha-question { font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: var(--brand); padding: 6px 10px; background: var(--brand-soft); border-radius: 7px; }
.captcha-row input { width: 130px; padding: 8px 10px; font-size: 13px; }
.comment-hp { position: absolute !important; left: -9999px !important; top: auto; width: 1px; height: 1px; overflow: hidden; }
.comment-submit-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.comment-submit-tip { font-size: 11px; color: var(--text-3); }
.btn-submit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: 10px;
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 6px 16px var(--brand-glow);
  transition: .22s;
}
.btn-submit:hover { transform: translateY(-2px); box-shadow: 0 10px 22px var(--brand-glow); }
.btn-submit svg { width: 14px; height: 14px; fill: currentColor; }
.comments-closed { padding: 22px; text-align: center; color: var(--text-3); font-size: 13px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: center; gap: 7px; }
.comments-closed svg { width: 15px; height: 15px; fill: currentColor; }
#comment-form-place-holder { list-style: none; }

/* --------------------------------------------------------------------------
   7. 右侧栏组件 / TOC
   -------------------------------------------------------------------------- */
.sidebar-search { padding: 13px; }
.sidebar-search .search-form button { flex-basis: 40px; width: 40px; }
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
}
.stat-item { background: var(--card); padding: 16px 12px; text-align: center; transition: background .25s; }
.stat-item:hover { background: var(--card-2); }
.stat-num {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.5px;
  background: linear-gradient(100deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-variant-numeric: tabular-nums;
}
.stat-label { font-size: 11px; color: var(--text-3); margin-top: 2px; }

.mini-post-list, .hot-list, .category-list { list-style: none; margin: 0; padding: 8px 10px; }
.latest-comments-list { list-style: none; margin: 0; padding: 8px 12px 12px; display: flex; flex-direction: column; gap: 11px; }
.latest-comments-list li { display: flex; gap: 9px; min-width: 0; padding: 0 0 10px; border-bottom: 1px dashed var(--border); }
.latest-comments-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.latest-comment-avatar { position: relative; width: 30px; height: 30px; flex: 0 0 30px; display: block; overflow: hidden; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.latest-comment-avatar img { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; display: block; object-fit: cover; }
.latest-avatar-fallback { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 11px; font-weight: 800; }
.latest-comment-emojis { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 3px; }
.latest-comment-emoji { width: 18px; height: 18px; object-fit: contain; vertical-align: middle; }
.latest-comment-body { min-width: 0; flex: 1; }
.latest-comment-meta { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 10px; line-height: 1.4; }
.latest-comment-meta strong { color: var(--text-2); font-size: 11px; }
.latest-comment-meta span { color: var(--text-3); }
.latest-comment-meta a { color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.latest-comment-meta a:hover { color: var(--brand); }
.latest-comment-meta em { display: inline-flex; align-items: center; gap: 2px; color: #7c3aed; font-style: normal; }
.latest-comment-meta em svg { width: 9px; height: 9px; fill: currentColor; }
.latest-comment-body p { margin: 3px 0 0; color: var(--text-3); font-size: 10.5px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mini-post-list li a {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 9px 8px;
  border-radius: 9px;
  font-size: 13px;
  color: var(--text-2);
  transition: .2s;
  line-height: 1.5;
}
.mini-post-list li a:hover { background: var(--card-2); color: var(--text); }
.mini-post-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mini-post-list time { white-space: nowrap; font-size: 10.5px; color: var(--text-3); margin-top: 2px; }
.mini-empty { padding: 15px 8px; text-align: center; color: var(--text-3); font-size: 12px; }
.hot-list li a { display: flex; gap: 9px; padding: 9px 8px; border-radius: 9px; font-size: 13px; color: var(--text-2); transition: .2s; line-height: 1.5; }
.hot-list li a:hover { background: var(--card-2); color: var(--text); }
.hot-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rank {
  flex: 0 0 20px;
  height: 20px;
  border-radius: 6px;
  margin-top: 1px;
  display: grid;
  place-items: center;
  font-size: 10.5px;
  font-weight: 800;
  background: var(--card-2);
  color: var(--text-3);
}
.rank.top1 { background: linear-gradient(135deg, #ff8a5b, #ff5e7e); color: #fff; }
.rank.top2 { background: linear-gradient(135deg, #7ea6ff, #5b87ff); color: #fff; }
.rank.top3 { background: linear-gradient(135deg, #54d3b0, #2bb693); color: #fff; }
.category-list li a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 9px; border-radius: 8px; font-size: 13px; color: var(--text-2); transition: .2s; }
.category-list li a:hover { background: var(--card-2); color: var(--brand); }
.category-list li a span { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.category-list li a svg { width: 14px; height: 14px; fill: var(--text-3); flex: 0 0 14px; }
.category-list li a em { font-style: normal; font-size: 10.5px; color: var(--text-3); background: var(--card-2); border-radius: 5px; padding: 1px 6px; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 16px; }
.tag-cloud a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  padding: 5px 11px;
  border-radius: 8px;
  background: var(--card-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  transition: .2s;
}
.tag-cloud a span { font-size: 9.5px; opacity: .55; }
.tag-cloud a:hover, .tag-cloud a.active { color: #fff; border-color: transparent; background: linear-gradient(135deg, var(--brand), var(--brand-2)); transform: translateY(-2px); }
.tag-cloud a:hover span, .tag-cloud a.active span { opacity: .8; }
.tag-cloud-large { padding: 18px 20px; gap: 9px; }
.tag-cloud-large a { font-size: 12.5px; padding: 6px 13px; border-radius: 9px; }
.site-info { padding: 6px 18px 16px; }
.site-info div { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; padding: 7px 0; color: var(--text-2); border-bottom: 1px dashed var(--border); }
.site-info div:last-child { border-bottom: none; }
.site-info b { color: var(--text); font-weight: 600; }
.site-info b a { color: var(--brand); }

.toc-panel { display: flex; flex-direction: column; max-height: calc(100vh - var(--topbar-height) - 48px); }
.toc-list { list-style: none; margin: 0; padding: 10px; overflow-y: auto; }
.toc-list li { margin: 1px 0; }
.toc-list a {
  display: block;
  padding: 7px 11px;
  font-size: 12.5px;
  color: var(--text-2);
  border-radius: 7px;
  transition: .2s;
  line-height: 1.5;
  border-left: 2px solid transparent;
}
.toc-list a.toc-level-3 { padding-left: 24px; font-size: 12px; color: var(--text-3); }
.toc-list a:hover { background: var(--card-2); color: var(--text); }
.toc-list a.active { color: var(--brand); font-weight: 600; border-left-color: var(--brand); background: var(--brand-soft); }
.toc-empty { display: block; margin: 0; padding: 14px 18px 18px; color: var(--text-3); font-size: 12px; }
.toc-panel.has-toc .toc-list { display: block; }
.toc-panel.has-toc .toc-empty { display: none; }
.toc-panel.is-empty .toc-list { display: none; }
.toc-panel.is-empty .toc-empty { display: block; }
.toc-mobile-btn {
  display: none;
  position: fixed;
  right: 16px;
  bottom: calc(78px + env(safe-area-inset-bottom));
  z-index: 80;
  align-items: center;
  gap: 5px;
  padding: 9px 13px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-2);
  box-shadow: var(--shadow-lg);
  font-size: 12px;
  font-weight: 600;
}
.toc-mobile-btn svg { width: 15px; height: 15px; fill: currentColor; }
.toc-close-mobile { display: none; margin-left: auto; width: 28px; height: 28px; border-radius: 7px; align-items: center; justify-content: center; color: var(--text-3); }
.toc-close-mobile svg { width: 15px; height: 15px; fill: currentColor; }

/* --------------------------------------------------------------------------
   8. 归档 / 标签 / 友链 / 相册 / 404 / 搜索
   -------------------------------------------------------------------------- */
.archive-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 24px;
  overflow: hidden;
}
.archive-hero::before {
  content: "";
  position: absolute;
  width: 220px; height: 220px;
  right: -70px; top: -100px;
  border-radius: 50%;
  background: var(--brand-soft);
  pointer-events: none;
}
.archive-hero-icon {
  flex: 0 0 58px;
  width: 58px; height: 58px;
  border-radius: 17px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  box-shadow: 0 8px 20px var(--brand-glow);
}
.archive-hero-icon svg { width: 25px; height: 25px; fill: currentColor; }
.archive-hero-body { flex: 1; min-width: 0; position: relative; z-index: 1; }
.archive-hero-body h1 { margin: 2px 0 4px; font-size: 25px; line-height: 1.3; letter-spacing: -.5px; overflow-wrap: anywhere; }
.archive-hero-body p { margin: 0; font-size: 13px; color: var(--text-2); }
.archive-hero-stats { display: flex; gap: 20px; position: relative; z-index: 1; flex: 0 0 auto; }
.archive-hero-stats div { text-align: center; min-width: 50px; }
.archive-hero-stats strong {
  display: block;
  font-size: 21px;
  font-weight: 800;
  line-height: 1.2;
  background: linear-gradient(100deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-variant-numeric: tabular-nums;
}
.archive-hero-stats span { font-size: 10.5px; color: var(--text-3); }
.tag-cloud-panel { margin-top: 0; }
.search-hero .hero-search-form { margin-top: 14px; max-width: 500px; }
.search-hero .search-form button { flex-basis: 42px; width: 42px; }
.search-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 9px; font-size: 12px; color: var(--text-3); }
.search-actions mark { color: var(--brand); background: var(--brand-soft); padding: 1px 5px; border-radius: 4px; }
.search-actions a { color: var(--brand); }
.search-match-label {
  display: inline-block;
  margin-right: 3px;
  padding: 0 5px;
  border-radius: 4px;
  color: var(--brand);
  background: var(--brand-soft);
  font-size: 9.5px;
  font-weight: 700;
  vertical-align: 1px;
}
.new-badge {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  height: 17px;
  padding: 0 6px;
  margin-bottom: 5px;
  border-radius: 5px;
  color: #fff;
  background: linear-gradient(135deg, #34d399, #10b981);
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: .7px;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(16, 185, 129, .18);
}

/* 归档时间线 */
.archive-timeline .timeline-body { padding: 8px 20px 20px; }
.timeline-year { padding: 16px 0; border-bottom: 1px dashed var(--border); }
.timeline-year:last-child { border-bottom: 0; }
.year-label { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.year-label span { font-size: 24px; font-weight: 800; letter-spacing: -.5px; background: linear-gradient(100deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.year-label em { font-size: 9px; font-weight: 800; letter-spacing: 2px; color: var(--text-3); font-style: normal; }
.year-months { padding-left: 8px; border-left: 1px solid var(--border); }
.timeline-month { padding: 7px 0 9px 18px; position: relative; }
.timeline-month::before {
  content: "";
  position: absolute;
  left: -4px; top: 16px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.month-label { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 5px; }
.month-label span { font-size: 10.5px; font-weight: 500; color: var(--text-3); margin-left: 7px; }
.archive-list { list-style: none; margin: 0; padding: 0; }
.archive-list li { display: flex; align-items: baseline; gap: 9px; padding: 4px 0; font-size: 13px; min-width: 0; }
.archive-list time { flex: 0 0 34px; color: var(--text-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.archive-list a { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.archive-list a:hover { color: var(--brand); }
.archive-cat { margin-left: auto; flex: 0 0 auto; font-size: 9.5px; color: var(--text-3); background: var(--card-2); padding: 1px 6px; border-radius: 4px; }
.archive-intro, .links-intro { margin: 0; }
.archive-intro { padding: 22px 26px; }

/* 友链 */
/* 友链标签页与朋友动态 */
.links-tabs { display: flex; align-items: center; gap: 2px; overflow-x: auto; padding: 0 4px; border-bottom: 1px solid var(--border); scrollbar-width: none; }
.links-tabs::-webkit-scrollbar { display: none; }
.links-tab { position: relative; flex: 0 0 auto; padding: 11px 14px 12px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--text-3); font-family: inherit; font-size: 12.5px; font-weight: 600; white-space: nowrap; cursor: pointer; transition: color .18s, border-color .18s; }
.links-tab:hover { color: var(--text); }
.links-tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.links-tab em { margin-left: 3px; padding: 1px 5px; border-radius: 5px; background: var(--card-2); color: var(--text-3); font-size: 9px; font-style: normal; }
.links-tab.active em { background: var(--brand-soft); color: var(--brand); }
.links-tab-panel[hidden] { display: none !important; }
.links-empty { padding: 28px 20px; color: var(--text-3); font-size: 12px; text-align: center; }
.links-feed-panel { padding: 14px; }
.friend-feed-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.friend-feed-card { display: flex; gap: 12px; min-width: 0; padding: 12px; border: 1px solid var(--border); border-radius: 13px; background: var(--card); transition: border-color .18s, box-shadow .18s, transform .18s; }
.friend-feed-card:hover { border-color: rgba(var(--brand-rgb), .38); box-shadow: var(--shadow); transform: translateY(-1px); }
.friend-feed-thumb { width: 132px; height: 96px; flex: 0 0 132px; display: grid; place-items: center; overflow: hidden; border-radius: 9px; background: linear-gradient(135deg, var(--brand-soft), var(--card-2)); color: var(--brand); font-size: 18px; font-weight: 800; }
.friend-feed-thumb img { width: 100%; height: 100%; object-fit: cover; }
.friend-feed-body { min-width: 0; flex: 1; }
.friend-feed-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--text-3); font-size: 10px; }
.friend-feed-meta a { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); font-weight: 600; }
.friend-feed-meta time { flex: 0 0 auto; }
.friend-feed-card h3 { margin: 7px 0 5px; font-size: 14px; line-height: 1.45; }
.friend-feed-card h3 a { color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.friend-feed-card h3 a:hover { color: var(--brand); }
.friend-feed-card p { margin: 0; color: var(--text-3); font-size: 11px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 820px) {
  .friend-feed-grid { grid-template-columns: 1fr; }
  .links-feed-panel { padding: 12px; }
  .friend-feed-thumb { width: 104px; flex-basis: 104px; height: 82px; }
  .links-tab { padding: 10px 11px; font-size: 12px; }
}

.links-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 16px; }
.link-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card-2);
  transition: .22s;
  min-width: 0;
}
.link-card:hover { transform: translateY(-2px); border-color: var(--brand); background: var(--card); box-shadow: var(--shadow); }
.link-avatar {
  width: 44px; height: 44px;
  flex: 0 0 44px;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--c1), var(--c2));
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 17px;
}
.link-avatar img { width: 100%; height: 100%; object-fit: cover; }
.link-info { min-width: 0; flex: 1; }
.link-info strong { display: block; font-size: 13.5px; margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-info p { margin: 0; font-size: 11.5px; color: var(--text-3); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.link-arrow { color: var(--text-3); flex: 0 0 auto; opacity: .6; }
.link-arrow svg { width: 14px; height: 14px; fill: currentColor; }
.link-card:hover .link-arrow { color: var(--brand); opacity: 1; }
.apply-panel { display: flex; gap: 13px; align-items: flex-start; padding: 18px 20px; }
.apply-icon { flex: 0 0 36px; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.apply-icon svg { width: 17px; height: 17px; fill: currentColor; }
.apply-panel strong { display: block; font-size: 13.5px; margin-bottom: 2px; }
.apply-panel p { margin: 0; font-size: 12.5px; color: var(--text-2); line-height: 1.7; }

/* 相册 */
.photo-wall { padding: 14px; }
.masonry { column-count: 2; column-gap: 12px; }
.photo-item { margin: 0 0 12px; break-inside: avoid; border-radius: 12px; overflow: hidden; position: relative; background: var(--card-2); }
.photo-link { display: block; line-height: 0; overflow: hidden; }
.photo-link img { width: 100%; height: auto; transition: transform .45s ease, opacity .25s; }
.photo-link:hover img { transform: scale(1.03); }
.photo-item figcaption { padding: 8px 10px; font-size: 11.5px; color: var(--text-3); line-height: 1.5; background: var(--card); position: relative; z-index: 1; }
.photo-intro img { display: none; }
.photo-intro:empty { display: none; }

/* 404 */
.error-page { padding: 56px 26px; text-align: center; overflow: hidden; }
.error-code {
  font-size: clamp(80px, 18vw, 150px);
  font-weight: 900;
  line-height: .85;
  letter-spacing: -8px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: .9;
  margin-bottom: 18px;
  user-select: none;
}
.error-page h1 { margin: 6px 0; font-size: 25px; letter-spacing: -.5px; }
.error-page > p { margin: 0 auto 20px; color: var(--text-2); font-size: 13.5px; max-width: 420px; }
.error-search { max-width: 380px; margin: 0 auto 18px; }
.error-page .empty-action { margin: 0 auto; }
.error-page .empty-action svg { width: 14px; height: 14px; }
.recent-fallback { margin-top: 0; }

/* --------------------------------------------------------------------------
   9. 页脚 / 悬浮按钮 / 图片灯箱 / 加载 / 进度
   -------------------------------------------------------------------------- */
.footer { width: 100%; background: var(--topbar-bg); border-top: 1px solid var(--border); margin-top: auto; backdrop-filter: blur(16px) saturate(1.6); }
.footer-inner { max-width: 1440px; margin: 0 auto; padding: 24px 24px calc(22px + env(safe-area-inset-bottom, 0px)); }
.footer-main { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.footer-brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.footer-logo {
  width: 36px; height: 36px;
  flex: 0 0 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 6px 15px var(--brand-glow);
}
.footer-brand strong { display: block; font-size: 13.5px; }
.footer-brand p { margin: 2px 0 0; font-size: 11.5px; color: var(--text-3); }
.footer-nav { display: flex; gap: 16px; flex-wrap: wrap; padding-top: 8px; }
.footer-nav a { font-size: 12.5px; color: var(--text-3); transition: color .2s; }
.footer-nav a:hover { color: var(--brand); }
.footer-bottom { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding-top: 14px; font-size: 11.5px; color: var(--text-3); }
.footer-bottom a { color: var(--brand); }
.footer-records { display: flex; align-items: center; justify-content: flex-start; gap: 14px; flex-wrap: wrap; margin-top: 10px; }
.footer-records a { display: inline-flex; align-items: center; gap: 5px; color: var(--text-3); font-size: 10.5px; }
.footer-records a:hover { color: var(--brand); }
.footer-records svg { width: 12px; height: 12px; fill: currentColor; opacity: .75; }
.footer-extra { margin-top: 10px; font-size: 11.5px; color: var(--text-3); text-align: center; }
.footer-extra a { color: var(--brand); }

.fab-toolbar {
  position: fixed;
  right: 30px;
  bottom: calc(30px + env(safe-area-inset-bottom, 0px));
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}
.fab-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--card);
  color: var(--text-2);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  transition: .3s cubic-bezier(.4, 0, .2, 1);
}
.fab-btn:hover { color: var(--brand); border-color: var(--brand); transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.fab-btn svg { width: 20px; height: 20px; fill: currentColor; }
#backToTop { opacity: 0; visibility: hidden; transform: translateY(10px); }
#backToTop.show { opacity: 1; visibility: visible; transform: none; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(5, 8, 14, .92);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: .25s;
}
.lightbox.open { opacity: 1; visibility: visible; }
.lightbox-figure { margin: 0; max-width: 90vw; max-height: 86vh; text-align: center; }
.lightbox-figure img { max-width: 90vw; max-height: 82vh; width: auto; height: auto; border-radius: 6px; margin: 0 auto; box-shadow: 0 18px 60px rgba(0, 0, 0, .4); }
.lightbox-figure figcaption { color: rgba(255, 255, 255, .72); font-size: 12px; margin-top: 10px; }
.lightbox-close {
  position: absolute;
  top: 22px; right: 24px;
  width: 40px; height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .18);
  transition: .2s;
}
.lightbox-close:hover { background: rgba(255, 255, 255, .2); transform: rotate(90deg); }
.lightbox-close svg { width: 18px; height: 18px; fill: currentColor; }
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px; height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .18);
  transition: .2s;
}
.lightbox-nav:hover { background: rgba(255, 255, 255, .2); }
.lightbox-nav.prev { left: 24px; }
.lightbox-nav.next { right: 24px; }
.lightbox-nav svg { width: 20px; height: 20px; fill: currentColor; }

.read-progress {
  position: fixed;
  top: 0; left: 0;
  z-index: 1000;
  height: 3px;
  width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s;
}
.read-progress.visible { opacity: 1; }

.nebula-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  transition: opacity .35s ease, visibility .35s ease;
}
body.has-loader .nebula-loader { display: flex; }
.nebula-loader.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-mark {
  width: 54px; height: 54px;
  border-radius: 17px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 22px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 8px 24px var(--brand-glow);
  position: relative;
  z-index: 2;
}
.loader-ring {
  position: absolute;
  width: 82px; height: 82px;
  border-radius: 50%;
  border: 2px solid var(--border);
  border-top-color: var(--brand);
  animation: nebula-spin .9s linear infinite;
}
@keyframes nebula-spin { to { transform: rotate(360deg); } }

/* 页面切换进度（Pjax） */
.pjax-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  z-index: 1001;
  width: 0;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  opacity: 0;
  transition: width .25s ease, opacity .2s;
  pointer-events: none;
}
.pjax-progress.active { opacity: 1; }
.pjax-progress.finish { width: 100% !important; opacity: 0; transition: width .2s, opacity .3s .12s; }

/* --------------------------------------------------------------------------
   10. 动画 / 可访问性
   -------------------------------------------------------------------------- */
@keyframes nebula-fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.page-transition .content > * { animation: nebula-fade-up .45s both; }
.page-transition .content > *:nth-child(2) { animation-delay: .04s; }
.page-transition .content > *:nth-child(3) { animation-delay: .08s; }
.pjax-loaded .content > * { animation: nebula-fade-up .35s both; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  html { scroll-behavior: auto; }
}

/* --------------------------------------------------------------------------
   11. Prism / KaTeX / Mermaid
   -------------------------------------------------------------------------- */
.article-content pre[class*="language-"] { color: #e6edf3; }
.token.comment, .token.prolog, .token.doctype, .token.cdata { color: #8b949e; }
.token.punctuation { color: #c9d1d9; }
.token.namespace { opacity: .7; }
.token.property, .token.tag, .token.constant, .token.symbol, .token.deleted { color: #ff7b72; }
.token.boolean, .token.number { color: #79c0ff; }
.token.selector, .token.attr-name, .token.string, .token.char, .token.builtin, .token.inserted { color: #a5d6ff; }
.token.operator, .token.entity, .token.url, .language-css .token.string, .style .token.string { color: #d2a8ff; }
.token.atrule, .token.attr-value, .token.keyword { color: #ff7b72; }
.token.function, .token.class-name { color: #d2a8ff; }
.token.regex, .token.important, .token.variable { color: #ffa657; }
.token.important, .token.bold { font-weight: 700; }
.token.italic { font-style: italic; }
.token.entity { cursor: help; }
.prose .token a { color: inherit; }

.article-content .katex-display { overflow-x: auto; overflow-y: hidden; padding: 4px 0 8px; }
.katex { font-size: 1.05em; }
.mermaid-wrap {
  margin: 0 0 1.5em;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card-2);
  overflow-x: auto;
  text-align: center;
}
.mermaid-wrap svg { max-width: 100%; height: auto; margin: 0 auto; }
.mermaid-error {
  margin: 0 0 1.5em;
  padding: 12px 15px;
  border-radius: 10px;
  background: rgba(239, 68, 68, .08);
  color: #dc2626;
  font-size: 12px;
  white-space: pre-wrap;
}
[data-theme="dark"] .mermaid-error { color: #fca5a5; }
.math-error { color: #dc2626; }

/* --------------------------------------------------------------------------
   12. 响应式
   -------------------------------------------------------------------------- */
@media (max-width: 1240px) {
  .topnav a { padding: 7px 10px; }
  .layout { gap: 18px; padding: 20px; --left-width: 232px; --right-width: 284px; }
  .c-slide { padding: 26px 32px; }
}
@media (max-width: 1180px) {
  .layout { grid-template-columns: 232px minmax(0, 1fr); }
  .no-left-sidebar .layout { grid-template-columns: minmax(0, 1fr); }
  .no-right-sidebar .layout { grid-template-columns: 232px minmax(0, 1fr); }
  .no-left-sidebar.no-right-sidebar .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar-left { position: static; max-height: none; overflow: visible; }
  .sidebar-right {
    grid-column: 1 / -1;
    position: static;
    max-height: none;
    overflow: visible;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    padding-bottom: 0;
  }
  .sidebar-right .toc-panel { grid-column: 1 / -1; max-height: none; }
  .sidebar-right .panel + .panel { margin-top: 0; }
  .sidebar-right .toc-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 8px; max-height: 260px; }
  .sidebar-ad-wrap { grid-column: auto; }
  .sidebar-ad-wrap .ad-card { height: 100%; }
  .toc-mobile-btn { display: none; }
  .toc-close-mobile { display: none; }
}
@media (max-width: 980px) {
  .topnav a:nth-child(n+4) { display: none; }
  .article-main { padding: 22px; }
  .article-header-hero { margin: -22px -22px 18px; padding-left: 22px; padding-right: 22px; }
  .article-title { font-size: 26px; }
  .home-heading h1 { font-size: 23px; }
  .links-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  :root { --topbar-height: 58px; }
  .topbar-inner { padding: 0 14px; height: var(--topbar-height); gap: 8px; }
  .topnav { display: none; }
  .menu-btn { display: grid; }
  .brand { font-size: 15.5px; max-width: 60vw; }
  .brand-logo { width: 30px; height: 30px; flex-basis: 30px; border-radius: 9px; font-size: 13px; }
  .top-actions { gap: 7px; }
  .icon-btn { width: 36px; height: 36px; flex-basis: 36px; border-radius: 10px; }
  .layout {
    display: flex;
    flex-direction: column;
    padding: 14px;
    gap: 14px;
    width: 100%;
  }
  .sidebar-left { display: none; }
  .content { gap: 14px; width: 100%; }
  .sidebar-right { display: flex; flex-direction: column; position: static; width: 100%; gap: 14px; }
  .sidebar-right .toc-panel { display: none; }
  .sidebar-right .toc-list { display: block; max-height: none; }
  .toc-mobile-btn { display: inline-flex; }
  body.toc-open { overflow: hidden; }
  body.toc-open .sidebar-right .toc-panel {
    display: flex;
    position: fixed;
    z-index: 140;
    left: 14px;
    right: 14px;
    bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    top: auto;
    max-height: 70vh;
    background: var(--card);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
    border-radius: 16px;
    animation: nebula-fade-up .25s both;
  }
  body.toc-open .toc-panel .toc-list { overflow-y: auto; }
  .toc-close-mobile { display: inline-flex; }
  .sidebar-right .panel + .panel { margin-top: 0; }
  .sidebar-ad-wrap { width: 100%; }

  .c-slide { min-height: 205px; padding: 20px 24px; }
  .c-inner h2 { font-size: 19px; margin-bottom: 7px; }
  .c-inner p { font-size: 12.5px; margin-bottom: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .c-tag { font-size: 9.5px; margin-bottom: 8px; }
  .c-more { padding: 7px 15px; font-size: 12px; }
  .c-nav { display: none; }
  .c-dots { bottom: 11px; }
  .home-banner { min-height: 210px; }
  .home-banner-body { padding: 24px; }
  .home-banner-body h1 { font-size: 22px; }
  .home-heading h1 { font-size: 21px; }
  .stats-strip-item strong { font-size: 17px; }
  .stats-strip-item { padding: 11px 5px; }

  .post { padding: 14px; gap: 13px; align-items: center; }
  .post-cover { flex: 0 0 100px; height: 100px; border-radius: 12px; }
  .post-cover-fallback { font-size: 22px; }
  .post-title { font-size: 15px; line-height: 1.42; margin-bottom: 5px; }
  .post-excerpt { display: none; }
  .post-cat { margin-bottom: 7px; }
  .post-meta { font-size: 11.5px; gap: 6px; }
  .post-author { font-size: 11.5px; }
  .post-author-avatar { width: 18px; height: 18px; flex-basis: 18px; }
  .avatar-sm { width: 18px; height: 18px; font-size: 9px; }
  .post-meta .post-meta-item:last-child { display: none; }
  .pin-badge { top: 8px; right: 8px; font-size: 9px; }
  .ad-card { padding: 14px; border-radius: 14px; }
  .ad-badge { top: 7px; right: 8px; }

  .breadcrumbs { font-size: 12px; gap: 5px; padding: 0 2px; }
  .article-main { padding: 16px 18px; }
  .article-title { font-size: 22px; letter-spacing: -.3px; margin-bottom: 12px; }
  .article-meta { gap: 10px; font-size: 12px; padding-bottom: 15px; }
  .article-hero-img { height: 210px; margin: 17px 0; border-radius: 12px; }
  .article-content { font-size: 15px; line-height: 1.8; }
  .article-content h2 { font-size: 1.28em; }
  .article-content h3 { font-size: 1.13em; }
  .article-content pre { border-radius: 10px; padding: 15px; font-size: 12.5px; }
  .code-block pre { padding-top: 35px; }
  .article-tags a { font-size: 11.5px; }
  .copyright-box { padding: 14px; font-size: 12px; }
  .article-tools { gap: 9px; }
  .post-nav { grid-template-columns: 1fr; gap: 10px; }
  .post-nav-item.next { text-align: left; align-items: flex-start; }
  .post-nav-item { padding: 13px 16px; }
  .article-ad { margin-bottom: 16px; }

  .archive-hero { padding: 18px; gap: 13px; flex-wrap: wrap; }
  .archive-hero-icon { flex-basis: 48px; width: 48px; height: 48px; border-radius: 14px; }
  .archive-hero-icon svg { width: 21px; height: 21px; }
  .archive-hero-body h1 { font-size: 21px; }
  .archive-hero-stats { width: 100%; justify-content: flex-start; gap: 26px; padding-left: 61px; }
  .archive-hero-stats strong { font-size: 18px; }
  .search-hero .hero-search-form { max-width: none; }

  .archive-timeline .timeline-body { padding: 4px 15px 15px; }
  .year-label span { font-size: 21px; }
  .archive-list li { font-size: 12.5px; }
  .archive-list time { flex-basis: 31px; }
  .archive-cat { display: none; }

  .links-grid { grid-template-columns: 1fr; padding: 12px; gap: 10px; }
  .masonry { column-count: 2; column-gap: 9px; }
  .photo-item { margin-bottom: 9px; }
  .photo-wall { padding: 9px; }

  .comment-list-wrap { padding: 16px; }
  .comment-form-wrap { padding: 16px; }
  .comment-form textarea { min-height: 110px; }
  .comment-inputs { grid-template-columns: 1fr; gap: 9px; }
  .comment-submit-row { align-items: flex-start; flex-direction: column; }
  .btn-submit { width: 100%; justify-content: center; }
  .comment-children { margin-left: 4px; padding-left: 11px; }
  .comment-avatar-wrap { width: 36px; height: 36px; flex-basis: 36px; }
  .comment-header { gap: 6px; }
  .comment-reply-btn { margin-left: 0; }
  .comment-editor-head { align-items: center; }
  .comment-policy { display: none; }
  .emoji-panel { width: 264px; }

  .footer-inner { padding: 18px 14px calc(74px + env(safe-area-inset-bottom, 0px)); }
  .footer-main { flex-direction: column; gap: 12px; padding-bottom: 14px; }
  .footer-nav { padding-top: 0; gap: 12px; }
  .footer-bottom { flex-direction: column; gap: 5px; }
  .footer-extra { text-align: left; }
  .fab-toolbar { right: 16px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
  .fab-btn { width: 40px; height: 40px; }
  .fab-btn svg { width: 18px; height: 18px; }
  .global-ad-wrap { padding: 0 14px 14px; }
  .lightbox { padding: 16px; }
  .lightbox-nav { width: 38px; height: 38px; }
  .lightbox-nav.prev { left: 8px; }
  .lightbox-nav.next { right: 8px; }
  .lightbox-figure img { max-width: 94vw; max-height: 78vh; }
  .search-modal { padding-top: 9vh; }
  .search-modal-body { padding: 26px 20px; border-radius: 18px; }
  .search-modal-body h2 { font-size: 21px; }
  .drawer { width: 300px; }
  .reward-dialog { padding: 24px 20px; }
  .login-modal { padding: 12px; }
  .login-dialog {
    grid-template-columns: 1fr;
    min-height: 0;
    max-height: 92vh;
    overflow-y: auto;
    border-radius: 20px;
  }
  .login-visual { padding: 24px 24px 22px; align-items: flex-start; }
  .login-visual::before { width: 240px; height: 240px; right: -130px; top: -110px; }
  .login-visual::after { display: none; }
  .login-orbit { display: none; }
  .login-logo { width: 46px; height: 46px; border-radius: 14px; font-size: 20px; }
  .login-kicker { margin: 17px 0 7px; }
  .login-visual h2 { font-size: 21px; margin-bottom: 5px; }
  .login-visual p { font-size: 12px; line-height: 1.6; }
  .login-visual-foot { display: none; }
  .login-form-panel { padding: 24px 20px calc(24px + env(safe-area-inset-bottom, 0px)); }
  .login-form-panel h2 { font-size: 21px; }
  .login-sub { margin-bottom: 15px; }
  .login-close { top: 12px; right: 12px; }
  .login-hint { margin-top: 11px; }
  .error-page { padding: 42px 20px; }
}
@media (max-width: 480px) {
  .layout { padding: 12px; gap: 12px; }
  .brand { max-width: 48vw; }
  .brand-name { font-size: 14.5px; }
  .top-actions { gap: 6px; }
  .icon-btn { width: 34px; height: 34px; flex-basis: 34px; }
  .icon-btn svg { width: 16px; height: 16px; }
  .c-slide { min-height: 188px; padding: 18px 18px 22px; }
  .c-inner h2 { font-size: 17px; }
  .c-inner p { font-size: 12px; }
  .home-heading > div > p { font-size: 12.5px; }
  .post-cover { flex: 0 0 88px; height: 88px; }
  .post-title { font-size: 14px; }
  .post-meta i { display: none; }
  .post-meta { gap: 4px; }
  .post-meta .post-meta-item { display: none; }
  .post-author { font-size: 11px; }
  .article-main { padding: 14px; }
  .article-title { font-size: 20px; }
  .article-meta .meta-item:nth-child(4) { display: none; }
  .article-content { font-size: 14.5px; }
  .article-hero-img { height: 180px; }
  .stats-strip-item strong { font-size: 15px; }
  .stats-strip-item span { font-size: 10px; }
  .archive-hero-stats { padding-left: 0; }
  .masonry { column-count: 1; }
  .tag-cloud-large a { font-size: 12px; }
  .footer-brand p { font-size: 11px; }
  .lightbox-figure img { max-height: 72vh; }
}

/* 打印：去掉广告与交互层 */
@media print {
  .topbar, .sidebar-left, .sidebar-right, .footer, .fab-toolbar, .ad-card, .ad-badge,
  .toc-mobile-btn, .toc-close-mobile, .nebula-loader, .read-progress, .reward-modal,
  .lightbox, .post-nav, .comments-section, .breadcrumbs, .drawer, .drawer-mask { display: none !important; }
  body { background: #fff; color: #000; }
  .layout { display: block; padding: 0; max-width: 100%; }
  .panel { border: 0; box-shadow: none; }
  .article-main { padding: 0; }
  .article-content a { color: #000; text-decoration: underline; }
  .article-content pre { white-space: pre-wrap; }
}

/* ==========================================================================
   v1.2 additions
   ========================================================================== */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
button, a, input, select, textarea { touch-action: manipulation; }

@font-face {
  font-family: "Twemoji Mozilla";
  src: url("../vendor/twemoji/Twemoji.Mozilla.ttf") format("truetype");
  font-display: swap;
}
.comment-text, .emoji-item, .emoji-group { font-family: "Twemoji Mozilla", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }

/* 登录按钮：更明显的悬浮层次 */
.login-btn {
  box-shadow: 0 10px 24px var(--brand-glow), 0 3px 8px rgba(35, 47, 101, .14);
  border: 1px solid rgba(255, 255, 255, .16);
  background-image: linear-gradient(135deg, var(--brand), var(--brand-2));
}
.login-btn:hover { box-shadow: 0 16px 30px var(--brand-glow), 0 4px 10px rgba(35, 47, 101, .18); }

/* 页脚 Logo 与抽屉固定头 */
.footer-logo { overflow: hidden; }
.footer-logo img { width: 100%; height: 100%; display: block; object-fit: cover; border-radius: inherit; }
.drawer { display: flex; flex-direction: column; }
.drawer-head {
  position: sticky;
  top: 0;
  z-index: 8;
  margin: 0 -2px 10px;
  padding: 14px 15px 13px;
  background: var(--card);
  background: color-mix(in srgb, var(--card) 92%, transparent);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 6px 18px rgba(20, 30, 60, .06);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}
.drawer-body { overflow-y: auto; overscroll-behavior: contain; flex: 1; }
.drawer-category-list li a { justify-content: flex-start; }
.drawer-category-list li a em { margin-left: auto; font-style: normal; font-size: 10.5px; color: var(--text-3); }
.drawer-nav-panel { padding: 10px 14px; }
.drawer-nav-panel .nav-list { padding: 0; }
.drawer-category-panel { padding: 14px; }

/* 分类按钮阴影减淡 */
.cat-tab { box-shadow: none; border-color: var(--border); }
.cat-tab:hover { box-shadow: 0 3px 10px rgba(79, 124, 255, .08); }
.cat-tab.active { box-shadow: none; }

/* 文章标题头图 */
.article-main { overflow: hidden; }
.article-header-inner { position: relative; z-index: 2; }
.article-header-hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 310px;
  margin: -24px -28px 18px;
  padding: 68px 28px 26px;
  color: #fff;
  overflow: hidden;
  border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
  background: #1a2440;
}
.article-hero-bg, .article-hero-shade { position: absolute; inset: 0; }
.article-hero-bg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.article-hero-shade {
  background:
    linear-gradient(90deg, rgba(8, 13, 28, .76) 0%, rgba(8, 13, 28, .46) 55%, rgba(8, 13, 28, .2) 100%),
    linear-gradient(0deg, rgba(8, 13, 28, .72) 0%, rgba(8, 13, 28, .06) 65%);
  z-index: 1;
}
.article-header-hero .article-title {
  max-width: 820px;
  color: #fff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .38);
}
.article-header-hero .article-meta { color: rgba(255, 255, 255, .80); }
.article-header-hero .meta-item { color: rgba(255, 255, 255, .82); }
.article-header-hero .meta-item svg { color: rgba(255, 255, 255, .88); opacity: 1; }
.article-header-hero .meta-author { color: #fff; font-weight: 600; }
.article-header-hero .meta-category {
  color: #fff;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .18);
  padding: 2px 8px;
  border-radius: 6px;
}
.article-header-hero .meta-avatar { box-shadow: 0 0 0 2px rgba(255, 255, 255, .35); }

/* 图片描述、版权水印、相册、音乐、折叠 */
.nebula-image-shell { display: block; position: relative; margin: 1.5em 0; text-align: center; }
.nebula-image-shell img { display: block; margin: 0 auto; }
.nebula-image-watermark {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 3;
  padding: 5px 9px;
  border-radius: 6px;
  color: rgba(255, 255, 255, .85);
  background: rgba(10, 16, 30, .48);
  border: 1px solid rgba(255, 255, 255, .13);
  font-size: 10px;
  line-height: 1.2;
  letter-spacing: .2px;
  pointer-events: none;
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}
.article-image-caption { display: block; margin: -12px 0 1.8em; text-align: center; font-size: 12px; color: var(--text-3); }
.article-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 1.6em 0; }
.article-gallery-item { margin: 0 !important; position: relative; overflow: hidden; border-radius: 10px; background: var(--card-2); }
.article-gallery-item a { display: block; line-height: 0; }
.article-gallery-item img { width: 100%; height: 170px; object-fit: cover; margin: 0 !important; border-radius: 10px !important; transition: transform .3s; }
.article-gallery-item:hover img { transform: scale(1.035); }
.article-gallery-item figcaption { padding: 7px 9px; margin: 0; background: var(--card); font-size: 11px; }
.article-music { display: flex; align-items: center; gap: 12px; margin: 1.6em 0; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--card-2); }
.article-music audio { width: 100%; min-width: 0; }
.article-music-icon { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.article-music-icon svg { width: 17px; height: 17px; fill: currentColor; }
.article-collapse { margin: 1.6em 0; border: 1px solid var(--border); border-radius: 12px; background: var(--card-2); overflow: hidden; }
.article-collapse summary { cursor: pointer; padding: 12px 15px; color: var(--text); font-weight: 700; font-size: 13.5px; list-style: none; }
.article-collapse summary::-webkit-details-marker { display: none; }
.article-collapse summary::after { content: "+"; float: right; color: var(--brand); font-weight: 800; }
.article-collapse[open] summary::after { content: "−"; }
.article-collapse-body { padding: 0 15px 15px; color: var(--text-2); }

/* 模糊懒加载 */
.nebula-lazy-img { filter: blur(16px) saturate(.86); opacity: .62; transform: scale(1.035); transition: filter .55s ease, opacity .55s ease, transform .55s ease; }
.nebula-lazy-img.is-loaded { filter: none; opacity: 1; transform: none; }
.post-cover img.nebula-lazy-img { transition: filter .55s ease, opacity .55s ease, transform .55s ease; }
.post-cover img.nebula-lazy-img.is-loaded { transform: none; }
.post:hover .post-cover img.nebula-lazy-img.is-loaded { transform: scale(1.05); }

/* 首页封面：无彩色占位，统一毛玻璃骨架 */
.post-cover {
  background: linear-gradient(135deg, rgba(255, 255, 255, .78), rgba(224, 231, 243, .48));
  border: 1px solid rgba(255, 255, 255, .72);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .38), 0 4px 14px rgba(40, 58, 95, .06);
}
.post-cover::after {
  background: radial-gradient(circle at 72% 18%, rgba(255, 255, 255, .52), transparent 52%),
    linear-gradient(180deg, transparent 55%, rgba(255, 255, 255, .18));
}
.post-cover-fallback {
  color: var(--text-3);
  background: rgba(255, 255, 255, .28);
  border: 1px solid rgba(255, 255, 255, .45);
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 20px;
  box-shadow: 0 8px 20px rgba(40, 58, 95, .08);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.post-cover img.nebula-lazy-img { opacity: .45; filter: blur(22px) saturate(.8); }
.post-cover img.nebula-lazy-img.is-loaded { opacity: 1; filter: none; }
[data-theme="dark"] .post-cover {
  background: linear-gradient(135deg, rgba(255, 255, 255, .10), rgba(120, 140, 180, .06));
  border-color: rgba(255, 255, 255, .10);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
}
[data-theme="dark"] .post-cover::after {
  background: radial-gradient(circle at 72% 18%, rgba(255, 255, 255, .12), transparent 52%),
    linear-gradient(180deg, transparent 55%, rgba(255, 255, 255, .04));
}
[data-theme="dark"] .post-cover-fallback {
  background: rgba(255, 255, 255, .06);
  border-color: rgba(255, 255, 255, .10);
  box-shadow: none;
}


/* 归档按年折叠 */
.archive-year { list-style: none; }
.archive-year > summary { cursor: pointer; list-style: none; }
.archive-year > summary::-webkit-details-marker { display: none; }
.archive-year .year-label { position: relative; padding-right: 26px; }
.year-label b { margin-left: auto; color: var(--text-3); font-size: 10.5px; font-weight: 500; }
.year-chevron { width: 8px; height: 8px; border-right: 1.5px solid var(--text-3); border-bottom: 1.5px solid var(--text-3); transform: rotate(45deg); transition: transform .2s; margin: 0 7px 4px 12px; }
.archive-year[open] .year-chevron { transform: rotate(225deg); margin-bottom: 0; }
.archive-year:not([open]) .year-months { display: none; }
.archive-year .year-label:hover span { filter: brightness(.8); }

/* 首页 AJAX */
.home-ajax-enabled .pager { display: none; }
.home-ajax-load { display: flex; flex-direction: column; align-items: center; gap: 9px; padding: 8px 0 4px; }
.home-load-more {
  min-width: 190px;
  height: 42px;
  padding: 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow);
  transition: .2s;
}
.home-load-more:hover { color: var(--brand); border-color: var(--brand); transform: translateY(-1px); }
.home-load-more:disabled { opacity: .6; cursor: wait; transform: none; }
.home-load-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); opacity: .45; }
.home-ajax-load.is-loading .home-load-dot { animation: home-load-pulse 1s infinite; opacity: 1; }
@keyframes home-load-pulse { 0%, 100% { transform: scale(.6); opacity: .35; } 50% { transform: scale(1); opacity: 1; } }
.home-load-status { min-height: 15px; margin: 0; font-size: 11.5px; color: var(--text-3); }
.home-ajax-load.is-ended .home-load-more { opacity: .55; }

/* 移动端底部菜单 */
.mobile-dock { display: none; }
@supports (height: 100dvh) {
  .comments-dialog { max-height: 90dvh; }
}

/* 评论弹窗 */
.comments-modal {
  position: fixed;
  inset: 0;
  z-index: 165;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
}
.comments-modal.open { opacity: 1; visibility: visible; }
.comments-modal-mask { position: absolute; inset: 0; background: var(--mask); -webkit-backdrop-filter: blur(9px); backdrop-filter: blur(9px); }
.comments-dialog {
  position: relative;
  z-index: 2;
  width: min(820px, 92vw);
  height: 90vh;
  max-width: 820px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg);
  box-shadow: 0 32px 100px rgba(3, 8, 20, .38);
  transform: translateY(16px) scale(.98);
  transition: transform .28s cubic-bezier(.2, .8, .25, 1), width .25s, height .25s, border-radius .25s;
}
.comments-modal.open .comments-dialog { transform: none; }
.comments-dialog.is-fullscreen { width: 100vw; height: 100vh; max-width: none; border-radius: 0; border: 0; }
.comments-dialog-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}
.comments-dialog-title { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 15px; }
.comments-dialog-title .bar { width: 4px; height: 17px; border-radius: 3px; background: linear-gradient(180deg, var(--brand), var(--brand-2)); }
.comments-dialog-title .comments-count { margin-left: 3px; font-size: 11.5px; color: var(--text-3); font-weight: 500; }
.comments-title-en { color: var(--text-3); font-size: 8.5px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; }
.comments-dialog-actions { display: flex; align-items: center; gap: 6px; }
.comments-close, .comments-fullscreen {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 8px;
  color: var(--text-3);
  background: var(--card-2);
  transition: .2s;
}
.comments-close:hover, .comments-fullscreen:hover { color: var(--text); background: var(--border); }
.comments-close svg, .comments-fullscreen svg { width: 15px; height: 15px; fill: currentColor; }
.comments-fullscreen { display: none; }
.comments-fullscreen.active { color: #fff; background: var(--brand); }
.comments-dialog-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.comments-dialog-body > .comments-section { padding: 22px 24px 28px; }
.comments-section-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.comments-section-intro h2 { margin: 3px 0 0; font-size: 20px; letter-spacing: -.2px; }
.comments-section-hint { color: var(--text-3); font-size: 11.5px; }
.comments-dialog .comment-form-wrap { margin-top: 20px; padding: 18px 0 0; border-top: 1px dashed var(--border); background: transparent; }
.comments-dialog .comment-form-head { margin-bottom: 12px; }
.comments-dialog .comments-empty { padding: 30px 10px; }
.comment-pager .page-navigator { justify-content: center !important; }
.comment-pager { padding: 2px 20px 20px; }
.comment-pager:empty { display: none; }
.comment-load-more-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 2px 20px 20px; }
.comment-load-more-wrap[hidden] { display: none; }
.comment-load-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 700;
}
.comment-load-more svg { width: 12px; height: 12px; fill: currentColor; }
.comment-load-more:hover { color: var(--brand); border-color: var(--brand); background: var(--brand-soft); }
.comment-load-more:disabled { opacity: .55; cursor: wait; }
.comment-load-status { min-height: 14px; margin: 0; color: var(--text-3); font-size: 10px; }
.comments-ajax-loading .comments-dialog-body { cursor: progress; }

/* 评论列表细节 */
.comment-text .reply-to { color: var(--brand); font-weight: 700; margin-right: 3px; white-space: nowrap; }
.comment-location { display: inline-flex; align-items: center; gap: 2px; padding: 2px 6px; border-radius: 5px; background: var(--card-2); color: var(--text-3); font-size: 9px; white-space: nowrap; }
.comment-location svg { width: 9px; height: 9px; fill: currentColor; opacity: .8; }
.comment-like-btn { display: inline-flex; align-items: center; gap: 2px; height: 21px; padding: 0 7px; border: 0; border-radius: 5px; background: var(--card-2); color: var(--text-3); font-family: inherit; font-size: 9.5px; cursor: pointer; transition: color .18s, background .18s; }
.comment-like-btn:hover { color: #e5484d; background: rgba(229, 72, 77, .07); }
.comment-like-btn svg { width: 11px; height: 11px; fill: currentColor; }
.comment-like-btn.is-liked { color: #e5484d; background: rgba(229, 72, 77, .08); }
.comment-badge.friend-badge { color: #0f766e; background: rgba(20, 184, 166, .12); }
.comment-badge.private-badge { display: inline-flex; align-items: center; gap: 3px; color: #7c3aed; background: rgba(124, 58, 237, .1); }
.comment-badge.private-badge svg { width: 10px; height: 10px; fill: currentColor; }
.comment-item.is-private-comment .comment-inner { border-radius: 12px; }
.comment-item.is-private-comment .comment-body {
  padding: 9px 12px 10px;
  border: 1px solid rgba(124, 58, 237, .16);
  border-left: 3px solid rgba(124, 58, 237, .55);
  border-radius: 10px;
  background: rgba(124, 58, 237, .035);
}
.comment-item.is-private-comment .comment-text { color: var(--text-2); }
.comment-item.is-private-locked .comment-text {
  padding: 8px 10px;
  border-radius: 7px;
  background: rgba(124, 58, 237, .07);
}
.comment-item.is-private-locked .comment-text p { margin: 0; color: #7c3aed; font-size: 11.5px; display: flex; align-items: center; gap: 5px; }
.comment-item.is-private-locked .comment-text p::before { content: "🔒"; font-size: 12px; filter: grayscale(1); }
.comment-item.is-private-locked .comment-avatar-img { filter: blur(5px) grayscale(.35); opacity: .55; }
.private-comment-placeholder {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 8px 10px;
  border-radius: 7px;
  color: #7c3aed;
  background: rgba(124, 58, 237, .07);
  font-size: 11.5px;
}
.private-comment-placeholder svg { width: 13px; height: 13px; flex: 0 0 13px; fill: currentColor; }
.comment-children { border-left-color: var(--border); }
.comment-child-list .comment-child-list { border-left: 0; padding-left: 0; margin-left: 0; }
.comment-item[data-flattened="1"] { margin-top: 18px; }
.comment-text img { cursor: zoom-in; }

/* Bilibili 风格评论编辑器 */
.comment-form.bilicomment-form { margin-top: 2px; }
.bili-compose { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 13px; align-items: flex-start; }
.bili-side { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.bili-avatar-btn { position: relative; width: 48px; height: 48px; border-radius: 50%; overflow: visible; padding: 0; background: transparent; flex: 0 0 48px; }
.bili-avatar-btn img { width: 48px; height: 48px; display: block; object-fit: cover; border-radius: 50%; border: 1px solid var(--border); background: var(--card-2); }
.bili-avatar-edit { position: absolute; right: -1px; bottom: -1px; width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--brand); font-size: 12px; line-height: 1; border: 2px solid var(--card); }
.bili-user-name { width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; font-size: 10.5px; color: var(--text-3); }
.bili-user-login { font-size: 9px; color: var(--text-3); text-align: center; line-height: 1.3; }
.bili-user-login a { color: var(--brand); }
.bili-main { min-width: 0; }
.comment-form .bili-main textarea {
  width: 100%;
  min-height: 118px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px 10px 4px 4px;
  background: var(--card-2);
  color: var(--text);
  resize: vertical;
  font-size: 13px;
  line-height: 1.7;
}
.comment-form .bili-main textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); background: var(--card); }
.bili-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 9px; border: 1px solid var(--border); border-top: 0; border-radius: 0 0 9px 9px; background: var(--card-2); }
.bili-tools { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.bili-tool {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  padding: 0 7px;
  border-radius: 6px;
  color: var(--text-3);
  font-size: 11px;
}
.bili-tool:hover, .bili-tool.active { color: var(--brand); background: var(--brand-soft); }
.bili-tool svg { width: 14px; height: 14px; fill: currentColor; }
.bili-toolbar-tip { font-size: 10px; color: var(--text-3); white-space: nowrap; }
.bili-send-wrap { display: flex; flex-direction: column; align-items: center; gap: 4px; padding-top: 1px; }
.bili-submit-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding-left: 71px; flex-wrap: wrap; }
.bili-submit-row .captcha-row { flex: 1 1 auto; margin: 0; padding: 0; min-width: 0; }
.bili-submit-row .bili-send-wrap { flex: 0 0 auto; align-items: flex-end; padding-top: 0; }
.bili-send {
  min-width: 72px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: 9px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 6px 16px var(--brand-glow);
  transition: .2s;
}
.bili-send:hover { transform: translateY(-1px); }
.bili-send svg { width: 14px; height: 14px; fill: currentColor; }
.bili-send.is-sending { opacity: .6; cursor: wait; }
.bili-send-tip { font-size: 9px; color: var(--text-3); white-space: nowrap; }
.bili-form-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; padding-left: 71px; flex-wrap: wrap; }
.bili-form-foot > span:first-child { display: inline-flex; align-items: center; gap: 5px; color: var(--text-3); font-size: 10.5px; }
.bili-form-foot svg { width: 12px; height: 12px; fill: currentColor; }
.bili-upload-status { color: var(--brand); font-size: 10.5px; }
.comment-profile-popover { margin-top: 9px; padding: 13px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); box-shadow: var(--shadow); }
.profile-popover-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; font-size: 12.5px; }
.profile-popover-close { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 5px; color: var(--text-3); }
.profile-popover-close:hover { background: var(--card-2); color: var(--text); }
.profile-popover-close svg { width: 12px; height: 12px; fill: currentColor; }
.profile-popover-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.profile-popover-fields label { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.profile-popover-fields label span { color: var(--text-3); font-size: 10px; }
.profile-popover-fields input { width: 100%; height: 34px; padding: 0 9px; border: 1px solid var(--border); border-radius: 7px; background: var(--card-2); color: var(--text); font-size: 12px; }
.profile-popover-fields input:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.profile-popover-tip { margin: 8px 0 0; color: var(--text-3); font-size: 10px; }

/* Twitter 表情面板 */
.emoji-panel.twemoji-panel { position: relative; width: 100%; max-height: 320px; margin: 9px 0 0; padding: 0; border: 1px solid var(--border); border-radius: 11px; background: var(--card); box-shadow: none; overflow: hidden; }
.emoji-tabs { display: flex; gap: 2px; overflow-x: auto; padding: 7px 8px; border-bottom: 1px solid var(--border); scrollbar-width: none; }
.emoji-tabs::-webkit-scrollbar { display: none; }
.emoji-tab { flex: 0 0 auto; padding: 5px 9px; border-radius: 6px; color: var(--text-3); font-size: 10.5px; }
.emoji-tab:hover, .emoji-tab.active { color: var(--brand); background: var(--brand-soft); font-weight: 600; }
.emoji-groups { max-height: 238px; overflow-y: auto; }
.emoji-group { display: none; grid-template-columns: repeat(12, 1fr); gap: 3px; padding: 9px; }
.emoji-group.active { display: grid; }
.emoji-panel .emoji-item { width: 100%; aspect-ratio: 1; display: grid; place-items: center; border-radius: 6px; font-size: 20px; line-height: 1; }
.emoji-panel .emoji-item:hover { background: var(--brand-soft); transform: scale(1.12); }
.emoji-panel-foot { padding: 6px 10px; border-top: 1px solid var(--border); color: var(--text-3); font-size: 9px; text-align: right; }

/* 评论区的时光机模式 */
.comments-time-section { padding: 0 0 10px; }
.comments-time-section .comments-head { padding-bottom: 12px; }
.comments-time-section .comment-list { display: flex; flex-direction: column; gap: 14px; }
.comments-time-section .comment-list > .comment-item {
  margin: 0;
  padding: 17px 17px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.comments-time-section .comment-avatar-wrap { width: 42px; height: 42px; flex-basis: 42px; }
.comments-time-section .comment-children {
  margin: 12px 0 0 55px;
  padding: 12px 0 0 16px;
  border-top: 1px dashed var(--border);
  border-left: 2px solid var(--border);
}
.comments-time-section .comment-child-list .comment-item { padding: 0; border: 0; box-shadow: none; background: transparent; }
.comments-time-section .comment-child-list .comment-item + .comment-item { margin-top: 11px; padding-top: 10px; border-top: 1px dashed var(--border); }
.comments-time-section .time-post-card { padding: 18px 18px 13px; border-radius: 17px; }
.comments-time-section .time-post-card .comment-avatar-wrap { width: 40px; height: 40px; flex-basis: 40px; }
.comments-time-section .time-post-card .comment-text { margin: 7px 0 0; color: var(--text-2); font-size: 13.5px; line-height: 1.75; }
.comments-time-section .time-post-card .comment-text > p:first-child { color: var(--text); font-weight: 700; }
.comments-time-section .time-post-card .comment-text img { display: inline-block; max-width: 100%; max-height: 240px; object-fit: cover; margin: 4px 5px 2px 0; border-radius: 10px; vertical-align: top; }
.time-post-tag, .time-post-new { display: inline-flex; align-items: center; height: 16px; padding: 0 6px; border-radius: 4px; font-size: 9px; font-weight: 700; line-height: 1; }
.time-post-tag { color: var(--brand); background: var(--brand-soft); }
.time-post-new { color: #fff; background: linear-gradient(135deg, #34d399, #10b981); }
.time-post-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 11px 0 1px; padding-top: 9px; border-top: 1px solid var(--border); }
.time-action { display: inline-flex; align-items: center; gap: 4px; min-height: 25px; padding: 0 9px; border: 0; border-radius: 6px; background: var(--card-2); color: var(--text-3); font-family: inherit; font-size: 10px; cursor: pointer; transition: color .18s, background .18s; }
.time-action:hover { color: var(--brand); background: var(--brand-soft); }
.time-action svg { width: 12px; height: 12px; fill: currentColor; }
.time-action em { margin-left: 1px; font-style: normal; font-weight: 700; }
.time-action-like.is-liked { color: #e5484d; background: rgba(229, 72, 77, .09); }
.time-action-like.is-liked svg { fill: currentColor; }
.comments-time-section .time-post-replies {
  margin: 12px 0 0;
  padding: 7px 12px 9px;
  border: 0;
  border-radius: 11px;
  background: var(--card-2);
  overflow: visible;
  box-sizing: border-box;
}
.comments-time-section .time-post-replies .comment-child-list > .comment-item:first-child { margin-top: 0; }
.comments-time-section .time-post-replies .comment-child-list .comment-item { margin-top: 9px; }
.comments-time-section .time-post-replies .comment-item,
.comments-time-section .time-post-replies .comment-inner,
.comments-time-section .time-post-replies .comment-body { min-width: 0; }
.comments-time-section .time-post-replies .comment-inner { flex-wrap: wrap; }
.comments-time-section .time-post-replies .comment-inner > .respond { max-width: 100%; box-sizing: border-box; }
.comments-time-section .time-post-replies .comment-location,
.comments-time-section .time-post-replies .comment-like-btn {
  background: rgba(148, 163, 184, .14);
  border: 1px solid rgba(148, 163, 184, .18);
}
.comments-time-section .time-post-replies .comment-item .comment-avatar-wrap { width: 29px; height: 29px; flex-basis: 29px; }
.comments-time-section .time-post-replies .comment-author { font-size: 11.5px; }
.comments-time-section .time-post-replies .comment-time { font-size: 9.5px; }
.comments-time-section .time-post-replies .comment-text { margin: 2px 0 0; font-size: 12px; line-height: 1.6; color: var(--text-2); }
.comments-time-section .time-post-replies .comment-text > p:first-child { font-weight: 400; color: var(--text-2); }
.comments-time-section .comment-form-wrap { margin-top: 18px; padding: 18px; border: 1px solid var(--border); border-radius: 14px; background: var(--card); }
.comments-time-section .comment-form-wrap.time-guest-reply-form { display: none; }
.time-page-hero .time-page-desc { margin: 0; color: var(--text-3); }
.time-page-card { padding: 22px 24px; }
.time-page-card .article-content { margin: 0; }
.time-page-header { margin-bottom: 0; }
.time-page-desc { margin: 8px 0 0; color: var(--text-3); font-size: 13px; }
.time-page-content { margin-top: 16px; }
.comments-time-section .comment-reply-btn { color: var(--brand); }

/* 移动端 */
@media (max-width: 820px) {
  input:not([type="checkbox"]):not([type="radio"]), select, textarea { font-size: 16px !important; }
  .article-header-hero {
    min-height: 255px;
    margin: -16px -18px 16px;
    padding: 58px 18px 22px;
    border-radius: calc(var(--radius) - 2px) calc(var(--radius) - 2px) 0 0;
  }
  .article-header-hero .article-title { font-size: 24px; }
  .article-header-hero .article-meta { gap: 9px; font-size: 11px; }
  .article-header-hero .meta-item { background: rgba(0, 0, 0, .16); border-radius: 5px; padding: 1px 5px; }
  .article-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-gallery-item img { height: 135px; }
  .comments-modal { padding: 8px; }
  .comments-dialog { width: 92vw; height: 90dvh; max-height: none; border-radius: 16px; border: 1px solid var(--border); }
  .comments-dialog.is-fullscreen { width: 100vw; height: 100dvh; border-radius: 0; border: 0; }
  .comments-fullscreen { display: grid; }
  .comments-dialog-head { padding: 12px 13px; }
  .comments-dialog-body > .comments-section { padding: 16px 14px 24px; }
  .comments-section-intro { align-items: flex-start; margin-bottom: 13px; }
  .comments-section-intro h2 { font-size: 17px; }
  .comments-section-hint { display: none; }
  .bili-compose { grid-template-columns: 48px minmax(0, 1fr); gap: 9px; }
  .bili-side { gap: 3px; }
  .bili-avatar-btn, .bili-avatar-btn img { width: 42px; height: 42px; flex-basis: 42px; }
  .bili-send-wrap { flex-direction: row; justify-content: flex-end; align-items: center; }
  .bili-submit-row { padding-left: 57px; gap: 8px; }
  .bili-submit-row .captcha-row { flex-wrap: nowrap; gap: 7px; }
  .bili-submit-row .captcha-row input { width: 92px; }
  .bili-send { height: 36px; min-width: 82px; }
  .bili-send-tip { display: none; }
  .bili-toolbar { padding: 5px 6px; }
  .bili-tool { padding: 0 5px; font-size: 10.5px; }
  .bili-toolbar-tip { display: none; }
  .bili-form-foot { padding-left: 0; }
  .bili-submit-row { padding-left: 0; }
  .profile-popover-fields { grid-template-columns: 1fr; }
  .emoji-group { grid-template-columns: repeat(8, 1fr); }
  .emoji-groups { max-height: 240px; }
  .comment-form .bili-main textarea { min-height: 135px; }
  .comment-pager { padding: 2px 0 14px; }
  .comments-time-section .comment-children:not(.time-post-replies) { margin-left: 12px; padding-left: 10px; }
  .comments-time-section .comment-form-wrap { padding: 14px; }
  .article-image-caption { margin-top: -8px; }
  .mobile-dock {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    z-index: 95;
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 6px 4px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--topbar-bg);
    box-shadow: 0 10px 30px rgba(15, 25, 50, .16);
    -webkit-backdrop-filter: blur(16px) saturate(1.6);
    backdrop-filter: blur(16px) saturate(1.6);
  }
  .dock-item { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 2px; border-radius: 9px; color: var(--text-3); font-size: 9.5px; }
  .dock-item svg { width: 18px; height: 18px; fill: currentColor; }
  .dock-item.active, .dock-item:hover { color: var(--brand); background: var(--brand-soft); }
  .dock-item > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
  .dock-item .dock-icon-wrap { overflow: visible; max-width: none; text-overflow: clip; }
  body.has-mobile-dock { padding-bottom: 78px; }
  .fab-toolbar { bottom: calc(88px + env(safe-area-inset-bottom, 0px)); right: 16px; }
  .fab-btn { width: 40px; height: 40px; }
  .drawer-head { padding: 14px 15px 13px; }
  .archive-year .year-label b { margin-left: auto; }
  .article-content img { cursor: default; }
}
@media (max-width: 520px) {
  .article-header-hero { margin: -14px -14px 14px; padding: 50px 14px 19px; }
  .comments-dialog-title { font-size: 14px; }
  .comments-dialog-title .comments-count { display: none; }
  .comments-dialog-body > .comments-section { padding-left: 12px; padding-right: 12px; }
  .emoji-group { grid-template-columns: repeat(7, 1fr); }
  .article-gallery { gap: 6px; }
  .article-gallery-item img { height: 112px; }
  .footer-logo { width: 32px; height: 32px; flex-basis: 32px; }
}

/* ==========================================================================
   v1.2.1 refinements
   ========================================================================== */
/* 抽屉全宽头部与导航标题 */
.drawer { padding: 0; overflow: hidden; }
.drawer-head {
  margin: 0;
  padding: 16px 16px 14px;
  width: 100%;
  border-radius: 0;
  flex: 0 0 auto;
}
.drawer-body { padding: 16px; overflow-y: auto; flex: 1; min-height: 0; }
.drawer-body > * { flex: 0 0 auto; }
.drawer-section-title {
  margin: 0 0 7px;
  padding: 0 4px;
  color: var(--text-3);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}
.drawer-nav-panel { padding: 0; }
.drawer-nav-panel .panel-head { border-radius: var(--radius) var(--radius) 0 0; }
.drawer-nav-panel .nav-list { padding: 8px; }
.drawer-custom-panel { margin-top: 0; }
.drawer-empty-hint { margin: 0; padding: 7px 5px 4px; color: var(--text-3); font-size: 11px; }
.drawer-body .panel + .panel { margin-top: 0; }

/* 按钮阴影收敛 */
.login-btn {
  box-shadow: 0 2px 6px rgba(70, 92, 190, .10);
  border: 0;
}
.login-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(70, 92, 190, .14); }
.cat-tab, .cat-tab:hover, .cat-tab.active { box-shadow: none !important; }
.cat-tab.active { background: linear-gradient(135deg, #537cf0, #8b6cf2); }

/* 轮播图标居中与移动端切换按钮 */
.c-nav { padding: 0; line-height: 0; }
.c-nav svg { width: 17px; height: 17px; display: block; fill: currentColor; }
.c-nav.prev svg { margin-right: 2px; }
.c-nav.next svg { margin-left: 2px; }
.c-autoplay { padding: 0; line-height: 0; }
.c-autoplay > span { display: none; line-height: 0; }
.c-autoplay .c-icon-pause { display: block; }
.c-autoplay.is-paused .c-icon-pause { display: none; }
.c-autoplay.is-paused .c-icon-play { display: block; }
.c-autoplay svg { width: 12px; height: 12px; fill: currentColor; display: block; }
@media (max-width: 820px) {
  .c-nav { display: none !important; }
  .c-autoplay { top: 9px; right: 9px; }
}

/* Emoji 面板修复 */
.emoji-panel.twemoji-panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: 340px;
  overflow: hidden;
  padding: 0;
}
.emoji-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
  font-size: 11.5px;
}
.emoji-panel-head strong { font-weight: 700; }
.emoji-panel-close {
  width: 24px; height: 24px;
  display: grid; place-items: center;
  border-radius: 6px;
  color: var(--text-3);
  background: var(--card-2);
}
.emoji-panel-close:hover { color: var(--text); background: var(--border); }
.emoji-panel-close svg { width: 12px; height: 12px; fill: currentColor; }
.emoji-tabs { flex: 0 0 auto; display: flex; flex-direction: row; align-items: center; gap: 3px; overflow-x: auto; padding: 7px 8px; }
.emoji-tab { flex: 0 0 auto; }
.emoji-groups { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.emoji-group { display: none; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: 3px; padding: 9px; }
.emoji-group.active { display: grid; }
.emoji-panel-foot { flex: 0 0 auto; }
@media (max-width: 820px) {
  .emoji-panel.twemoji-panel { max-height: 300px; }
  .emoji-groups { max-height: 220px; }
  .emoji-group { grid-template-columns: repeat(8, minmax(0, 1fr)); }
}

/* 评论弹窗：一级评论底框包含全部回复 */
.comments-dialog .comment-list-wrap { margin: 0; padding: 12px 0 20px; }
.comments-dialog .comment-list { display: flex; flex-direction: column; gap: 11px; }
.comments-dialog .comment-list > .comment-item {
  margin: 0;
  padding: 14px 16px 12px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--card);
  box-shadow: 0 2px 8px rgba(24, 35, 64, .025);
}
.comments-dialog .comment-list > .comment-item > .comment-inner { gap: 10px; min-width: 0; }
.comments-dialog .comment-list > .comment-item .comment-body { min-width: 0; }
.comments-dialog .comment-list > .comment-item .comment-children {
  margin: 10px 0 0;
  padding: 9px 0 0;
  border-top: 1px dashed var(--border);
  border-left: 0;
}
.comments-dialog .comment-list > .comment-item .comment-child-list .comment-item { margin-top: 9px; margin-bottom: 0; }
.comments-dialog .comment-list > .comment-item .comment-child-list .comment-item + .comment-item { padding-top: 9px; border-top: 1px dashed var(--border); }
.comments-dialog .comment-list > .comment-item .comment-avatar-wrap { width: 38px; height: 38px; flex-basis: 38px; }
.comments-dialog .comment-list > .comment-item .comment-child-list .comment-avatar-wrap { width: 29px; height: 29px; flex-basis: 29px; }
@media (max-width: 620px) {
  .comments-dialog .comment-list > .comment-item { padding: 12px 12px 10px; border-radius: 11px; }
  .comments-dialog .comment-list-wrap { margin: 0; padding: 8px 0 16px; }
  .comments-dialog .comment-list > .comment-item .comment-children { margin-left: 0; padding-left: 0; }
  .comments-dialog .comment-list > .comment-item .comment-avatar-wrap { width: 34px; height: 34px; flex-basis: 34px; }
}


.bilicomment-form.is-private-mode .bili-main textarea,
.bilicomment-form.is-private-mode .bili-toolbar {
  background: #eef1f5 !important;
  border-color: #c7cfdd !important;
}
.bilicomment-form.is-private-mode .bili-main textarea { color: #596474; }
.bilicomment-form.is-private-mode .bili-main textarea::placeholder { color: #7c3aed; opacity: .85; }
.bilicomment-form.is-private-mode .bili-toolbar { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .65); }
.bilicomment-form.is-private-mode .privacy-tool { color: #64748b; background: #e4e9f2; }

/* 评论回复按钮与回复表单 */
.comment-reply-btn a { color: #e5484d !important; font-weight: 600; }
.comment-reply-hidden { display: none !important; }
.comment-reply-btn a:hover { color: #c92a32 !important; }
.comment-inner.has-inline-reply { flex-wrap: wrap; }
.comment-inner.has-inline-reply > .comment-avatar-wrap,
.comment-inner.has-inline-reply > .comment-body { align-self: flex-start; }
.comment-inner > .respond {
  flex: 0 0 100%;
  width: 100%;
  margin-top: 14px;
  padding: 13px !important;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card-2);
}
.comment-inner > .respond .comment-form-head { margin-bottom: 10px; }
.comment-inner > .respond .bili-compose { grid-template-columns: 48px minmax(0, 1fr); gap: 10px; }
.comment-inner > .respond .bili-submit-row { padding-left: 58px; justify-content: space-between; gap: 6px; }
.comment-inner > .respond .captcha-row { flex: 1 1 auto; flex-wrap: nowrap; gap: 5px; min-width: 0; margin-left: 0; }
.comment-inner > .respond .captcha-row label { font-size: 10px; white-space: nowrap; }
.comment-inner > .respond .captcha-question { padding: 4px 6px; font-size: 11px; white-space: nowrap; }
.comment-inner > .respond .captcha-row input { width: 62px; min-width: 0; padding: 5px 6px; font-size: 11px; }
.comment-inner > .respond .bili-send { min-width: 62px; padding: 0 7px; height: 32px; font-size: 11.5px; }
.comment-inner > .respond .bili-send svg { width: 11px; height: 11px; }
.comment-inner > .respond .emoji-panel.twemoji-panel { width: 100%; max-width: 420px; }
.comment-inner > .respond .emoji-panel .emoji-group { grid-template-columns: repeat(auto-fill, minmax(30px, 1fr)); gap: 3px; padding: 9px; }
.comment-inner > .respond .emoji-panel .emoji-item { font-size: 20px; }
.comment-inner > .respond .bili-side { align-self: flex-start; }
.comment-inner > .respond .bili-avatar-btn,
.comment-inner > .respond .bili-avatar-btn img { width: 40px; height: 40px; flex-basis: 40px; }
.comment-inner > .respond .bili-user-login { display: none; }
.comment-inner > .respond .bili-send { min-width: 64px; }
@media (max-width: 820px) {
  .comment-inner > .respond { padding: 11px !important; }
  .comment-inner > .respond .bili-compose { grid-template-columns: 40px minmax(0, 1fr); gap: 8px; }
  .comment-inner > .respond .bili-avatar-btn,
  .comment-inner > .respond .bili-avatar-btn img { width: 34px; height: 34px; flex-basis: 34px; }
  .comment-inner > .respond .bili-send-wrap { flex-direction: row; justify-content: flex-end; }
  .comment-inner > .respond .bili-send { height: 32px; min-width: 58px; }
  .comment-inner > .respond .bili-submit-row { padding-left: 48px; }
  @media (max-width: 620px) {
    .comment-inner > .respond .captcha-row label { display: none; }
    .comment-inner > .respond .captcha-question { padding: 2px 3px; font-size: 9px; }
    .comment-inner > .respond .captcha-row input { width: 30px; padding: 4px 3px; }
    .comment-inner > .respond .bili-submit-row { gap: 3px; }
    .comment-inner > .respond .bili-send { min-width: 46px; padding: 0 4px; font-size: 10px; }
  }
}

/* 全屏评论真正无边距 */
@media (max-width: 820px) {
  .comments-modal { padding: 0; }
  .comments-dialog { width: 92vw; height: 90dvh; }
  .comments-dialog.is-fullscreen {
    width: 100%;
    height: 100%;
    max-width: none;
    border-radius: 0;
    border: 0;
    flex: 0 0 100%;
  }
}

/* 移动端只保留底栏，隐藏悬浮球 */
@media (max-width: 820px) {
  .fab-toolbar { display: none !important; }
}

/* 底栏评论小圆圈 */
.dock-icon-wrap { position: relative; display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.dock-badge {
  position: absolute;
  top: -7px;
  right: -12px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #ef4444;
  color: #fff;
  font-size: 9px;
  font-style: normal;
  line-height: 1;
  border: 1.5px solid var(--card);
  box-shadow: 0 2px 5px rgba(239, 68, 68, .25);
  z-index: 2;
}
.dock-badge-closed { background: #94a3b8; box-shadow: none; padding: 0 3px; }
.dock-badge-closed svg, .fab-badge.is-closed svg { width: 9px; height: 9px; fill: currentColor; }
.fab-badge.is-closed { background: #94a3b8; box-shadow: none; }
.dock-like-badge { background: #e5484d; }
.dock-item.is-liked { color: #e5484d; }
.dock-item.is-liked .dock-icon-wrap svg { fill: currentColor; }
.article-action.is-comments-closed {
  cursor: default;
  color: var(--text-3);
  background: var(--card-2);
  border-style: dashed;
}
.article-action.is-comments-closed:hover { color: var(--text-3); border-color: var(--border); background: var(--card-2); }
.fab-btn { position: relative; }
.fab-badge {
  position: absolute;
  top: -5px;
  right: -6px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #ef4444;
  color: #fff;
  font-size: 9px;
  font-style: normal;
  line-height: 1;
  border: 2px solid var(--card);
  box-shadow: 0 2px 5px rgba(239, 68, 68, .22);
  pointer-events: none;
}

/* 页面评论数量链接 */
.page-comment-count { color: var(--brand); }
.page-comment-count span { color: var(--brand); }

/* 友链申请 */
.friend-apply-panel { overflow: hidden; scroll-margin-top: calc(var(--topbar-height) + 18px); }
.friend-apply-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(110deg, var(--brand-soft), transparent 65%);
}
.friend-apply-icon {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 6px 14px var(--brand-glow);
}
.friend-apply-icon svg { width: 21px; height: 21px; fill: currentColor; }
.friend-apply-heading { min-width: 0; }
.friend-apply-heading .eyebrow { font-size: 9px; letter-spacing: 1.8px; }
.friend-apply-heading h2 { margin: 2px 0 3px; font-size: 19px; letter-spacing: -.2px; }
.friend-apply-heading p { margin: 0; color: var(--text-3); font-size: 11.5px; line-height: 1.6; }
.friend-apply-badge {
  margin-left: auto;
  flex: 0 0 auto;
  padding: 4px 9px;
  border-radius: 20px;
  color: var(--brand);
  background: var(--card);
  border: 1px solid var(--border);
  font-size: 10px;
  font-weight: 700;
}
.friend-apply-body { display: grid; grid-template-columns: 205px minmax(0, 1fr); gap: 22px; padding: 20px 22px 22px; }
.friend-apply-guide { min-width: 0; }
.friend-apply-note { margin: 0 0 12px; padding: 10px 11px; border-left: 3px solid var(--brand); border-radius: 0 7px 7px 0; background: var(--card-2); color: var(--text-2); font-size: 11px; line-height: 1.7; }
.friend-apply-guide ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.friend-apply-guide li { display: flex; gap: 8px; color: var(--text-3); font-size: 11px; line-height: 1.6; }
.friend-apply-guide li span { width: 6px; height: 6px; flex: 0 0 6px; margin-top: 6px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.friend-apply-form-wrap { min-width: 0; }
.friend-apply-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.friend-apply-grid label { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.friend-apply-grid label > span { color: var(--text-3); font-size: 10.5px; font-weight: 700; letter-spacing: .2px; }
.friend-apply-grid label > span em { color: #e5484d; font-style: normal; }
.friend-apply-grid input, .friend-apply-grid textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 38px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-2);
  color: var(--text);
  font-size: 12px;
  transition: .2s;
}
.friend-apply-grid textarea { min-height: 76px; resize: vertical; }
.friend-apply-grid input:focus, .friend-apply-grid textarea:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); background: var(--card); }
.friend-apply-wide { grid-column: 1 / -1; }
.friend-apply-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.friend-apply-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 12px; flex-wrap: wrap; }
.friend-apply-status { min-height: 15px; margin: 7px 0 0; color: var(--brand); font-size: 10.5px; }
.friend-apply-status.is-error { color: #e5484d; }
.friend-apply-foot > span { color: var(--text-3); font-size: 10.5px; }
.friend-apply-foot .btn-submit { box-shadow: none; }
@media (max-width: 1280px) {
  .friend-apply-body { grid-template-columns: 1fr; gap: 14px; }
  .friend-apply-guide ul { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px 12px; }
}
@media (max-width: 760px) {
  .friend-apply-head { padding: 17px; gap: 11px; }
  .friend-apply-icon { width: 40px; height: 40px; flex-basis: 40px; border-radius: 10px; }
  .friend-apply-heading h2 { font-size: 17px; }
  .friend-apply-badge { display: none; }
  .friend-apply-body { grid-template-columns: 1fr; padding: 16px 17px 18px; gap: 14px; }
  .friend-apply-guide ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 12px; }
  .friend-apply-guide li { font-size: 10px; }
}
@media (max-width: 620px) {
  .friend-apply-grid { grid-template-columns: 1fr; }
  .friend-apply-wide { grid-column: auto; }
  .friend-apply-guide ul { grid-template-columns: 1fr; }
  .friend-apply-foot { align-items: flex-start; }
  .friend-apply-foot .btn-submit { width: 100%; justify-content: center; }
}


/* 文章互动：点赞 / 评论 / 分享 */
.article-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin: 22px 0 0;
  padding-top: 18px;
  border-top: 1px dashed var(--border);
}
.article-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--card-2);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  transition: .2s;
}
.article-action svg { width: 15px; height: 15px; fill: currentColor; opacity: .8; }
.article-action em { font-style: normal; font-size: 10.5px; color: var(--text-3); }
.article-action:hover { color: var(--brand); border-color: var(--brand); background: var(--brand-soft); }
.like-btn.active { color: #e5484d; border-color: rgba(229, 72, 77, .35); background: rgba(229, 72, 77, .08); }
.like-btn.active svg { fill: currentColor; opacity: 1; }
.like-btn.active em { color: #e5484d; }
.share-open-btn { margin-left: auto; }

/* 分享弹窗 */
.share-modal {
  position: fixed;
  inset: 0;
  z-index: 175;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: var(--mask);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition: .24s;
}
.share-modal.open { opacity: 1; visibility: visible; }
.share-dialog {
  position: relative;
  width: min(760px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  padding: 30px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--card);
  box-shadow: 0 30px 90px rgba(4, 9, 22, .35);
  transform: translateY(12px) scale(.985);
  transition: transform .25s;
}
.share-modal.open .share-dialog { transform: none; }
.share-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: var(--text-3);
  background: var(--card-2);
}
.share-close:hover { color: var(--text); transform: rotate(90deg); }
.share-close svg { width: 14px; height: 14px; fill: currentColor; }
.share-dialog h2 { margin: 5px 0 4px; font-size: 23px; letter-spacing: -.3px; }
.share-sub { margin: 0 0 18px; color: var(--text-3); font-size: 12.5px; }
.share-body { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 22px; align-items: center; }
.share-qr-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 13px; border: 1px solid var(--border); border-radius: 14px; background: var(--card-2); }
.share-qr-wrap img { width: 150px; height: 150px; object-fit: contain; border-radius: 7px; background: #fff; }
.share-qr-wrap span { color: var(--text-3); font-size: 10.5px; }
.share-link-label { display: block; margin-bottom: 5px; color: var(--text-3); font-size: 10.5px; font-weight: 600; }
#shareLinkInput { width: 100%; height: 38px; padding: 0 11px; border: 1px solid var(--border); border-radius: 8px; background: var(--card-2); color: var(--text-2); font-size: 12px; }
.share-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; }
.share-actions button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--card-2);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 600;
}
.share-actions button:hover { color: var(--brand); border-color: var(--brand); background: var(--brand-soft); }
.share-actions svg { width: 13px; height: 13px; fill: currentColor; }
.share-status { min-height: 15px; margin: 8px 0 0; color: var(--brand); font-size: 10.5px; }
@media (max-width: 620px) {
  .share-dialog { padding: 24px 18px; }
  .share-body { grid-template-columns: 1fr; gap: 14px; }
  .share-qr-wrap { flex-direction: row; justify-content: center; }
  .share-qr-wrap img { width: 108px; height: 108px; }
  .share-open-btn { margin-left: 0; }
  .article-actions { gap: 6px; }
  .article-action { min-height: 34px; padding: 0 9px; }
}

/* 编辑器短代码 */
.article-tip { margin: 1.5em 0; padding: 13px 15px; border-radius: 10px; border: 1px solid transparent; line-height: 1.7; }
.article-tip > :last-child { margin-bottom: 0; }
.article-tip p { margin: 0; }
.article-tip.tip-share { background: #f4f5f7; border-color: #e2e5ea; color: #596474; }
.article-tip.tip-yellow { background: #fff8e1; border-color: #f2df9c; color: #806515; }
.article-tip.tip-red { background: #fff0f0; border-color: #f3c2c2; color: #9d2f35; }
.article-tip.tip-blue { background: #eef5ff; border-color: #c8dcfa; color: #2f5f9d; }
.article-tip.tip-green { background: #eefaf4; border-color: #bfe8d4; color: #226d4d; }
.article-shortcode-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 17px;
  margin: 4px 5px 4px 0;
  border-radius: 8px;
  color: #fff !important;
  background: var(--button-color, var(--brand));
  text-decoration: none !important;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(30, 50, 100, .15);
}
.article-shortcode-button:hover { opacity: .9; transform: translateY(-1px); }
.article-video { position: relative; margin: 1.5em 0; border-radius: 12px; overflow: hidden; background: #0b1020; }
.article-video iframe, .article-video video { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; }
.article-video video { height: auto; max-height: 70vh; }
.article-music-netease iframe { display: block; width: 100%; border: 0; }
.article-blackcard {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  margin: 1.5em 0;
  padding: 16px;
  border-radius: 11px;
  background: #111827;
  color: transparent;
  text-align: center;
  transition: .25s;
  cursor: help;
}
.article-blackcard:hover, .article-blackcard:focus { color: #fff; background: #1f2937; }
.article-blackcard-inner { max-width: 100%; line-height: 1.7; }
.article-login-gate { display: inline-flex; align-items: center; gap: 5px; margin: 8px 0; padding: 6px 9px; border-radius: 7px; background: var(--card-2); color: var(--text-3); font-size: 12px; }
.article-login-gate svg { width: 13px; height: 13px; fill: currentColor; }
.article-login-gate button { color: var(--brand); font-weight: 700; font-size: 12px; }
.article-cid-card { display: flex; align-items: center; gap: 11px; margin: 1.3em 0; padding: 9px; border: 1px solid var(--border); border-radius: 11px; background: var(--card); text-decoration: none !important; }
.article-cid-card:hover { border-color: var(--brand); box-shadow: var(--shadow); }
.cid-card-cover { width: 66px; height: 52px; flex: 0 0 66px; display: grid; place-items: center; overflow: hidden; border-radius: 7px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.cid-card-cover img { width: 100%; height: 100%; object-fit: cover; }
.cid-card-letter { color: #fff; font-weight: 800; font-size: 19px; }
.cid-card-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cid-card-body small { color: var(--text-3); font-size: 10px; }
.cid-card-body strong { color: var(--text); font-size: 13px; line-height: 1.5; }
/* 文章短代码：标签页 */
.article-tabs { margin: 1.5em 0; border: 1px solid var(--border); border-radius: 11px; overflow: hidden; background: var(--card); }
.article-tabs-nav { display: flex; gap: 2px; padding: 6px; border-bottom: 1px solid var(--border); background: var(--card-2); overflow-x: auto; }
.article-tabs-nav button { flex: 0 0 auto; padding: 7px 11px; border-radius: 6px; color: var(--text-3); font-size: 12px; font-weight: 600; }
.article-tabs-nav button.active { color: var(--brand); background: var(--card); box-shadow: var(--shadow-sm); }
.article-tab-panel { display: none; padding: 14px; }
.article-tab-panel.active { display: block; }
.article-tab-panel > :last-child { margin-bottom: 0; }
@media (max-width: 620px) {
  .article-tabs-nav button { padding: 6px 9px; font-size: 11px; }
}

/* 相册：统一两列等尺寸 */
.masonry {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-count: auto;
  gap: 12px;
}
.photo-item { margin: 0; }
.photo-link { display: block; aspect-ratio: 4 / 3; overflow: hidden; }
.photo-link img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 620px) {
  .photo-wall { padding: 9px; }
  .masonry { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .photo-item { border-radius: 9px; }
  .photo-item figcaption { padding: 6px 8px; font-size: 10.5px; }
}

/* 全局 Toast 提示 */
.nebula-toast-host {
  position: fixed;
  top: calc(var(--topbar-height, 64px) + 14px + env(safe-area-inset-top, 0px));
  left: 50%;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(92vw, 420px);
  transform: translateX(-50%);
  pointer-events: none;
}
.nebula-toast {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 100%;
  padding: 10px 11px 10px 13px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--card);
  color: var(--text);
  box-shadow: 0 14px 38px rgba(8, 16, 35, .18);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.45;
  opacity: 0;
  transform: translateY(-8px) scale(.98);
  transition: opacity .22s ease, transform .22s ease;
  pointer-events: auto;
}
.nebula-toast.is-visible { opacity: 1; transform: none; }
.nebula-toast.is-leaving { opacity: 0; transform: translateY(-6px) scale(.98); }
.nebula-toast-icon {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #4f7cff;
}
.nebula-toast-icon svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.nebula-toast-success .nebula-toast-icon { background: #1fbf75; }
.nebula-toast-error .nebula-toast-icon { background: #ef4444; }
.nebula-toast-warning .nebula-toast-icon { background: #f59e0b; }
.nebula-toast-info .nebula-toast-icon { background: #4f7cff; }
.nebula-toast-success { border-color: rgba(31, 191, 117, .25); }
.nebula-toast-error { border-color: rgba(239, 68, 68, .25); }
.nebula-toast-warning { border-color: rgba(245, 158, 11, .3); }
.nebula-toast-text { flex: 1; min-width: 0; }
.nebula-toast-close {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  color: var(--text-3);
  font-size: 16px;
  line-height: 1;
}
.nebula-toast-close:hover { color: var(--text); background: var(--card-2); }
@media (max-width: 620px) {
  .nebula-toast-host { top: calc(var(--topbar-height, 64px) + 10px + env(safe-area-inset-top, 0px)); width: calc(100vw - 28px); }
  .nebula-toast { padding: 9px 10px 9px 11px; font-size: 12px; }
  .bili-user-name, .bili-user-login { display: none; }
  .bili-side { padding-top: 3px; }
  .comment-form .bili-main textarea { min-height: 112px; }
  .comments-dialog .comment-form-wrap { margin-top: 14px; padding-top: 13px; }
  .bili-form-foot { margin-top: 7px; }
  .bili-form-foot > span:first-child { font-size: 9.5px; }
  .bili-send { min-width: 90px; }
  .bili-submit-row { padding-left: 57px; flex-wrap: nowrap; gap: 6px; }
  .bili-submit-row .captcha-row { flex: 1 1 auto; flex-wrap: nowrap; gap: 6px; min-width: 0; }
  .bili-submit-row .captcha-row label { font-size: 11px; white-space: nowrap; }
  .bili-submit-row .captcha-question { padding: 5px 7px; font-size: 12px; white-space: nowrap; }
  .bili-submit-row .captcha-row input { width: 70px; min-width: 0; padding: 7px 6px; font-size: 12px; }
  .bili-submit-row .bili-send { min-width: 76px; padding: 0 9px; }
}

/* 受密码保护文章 */
.post-password-gate {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 54px 24px 58px;
  text-align: center;
  background: radial-gradient(circle at 50% 0, var(--brand-soft), transparent 62%);
}
.post-password-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  border-radius: 17px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 10px 25px var(--brand-glow);
}
.post-password-icon svg { width: 25px; height: 25px; fill: currentColor; }
.post-password-gate h2 { margin: 4px 0 6px; font-size: 22px; letter-spacing: -.3px; }
.post-password-gate > p { margin: 0 0 18px; color: var(--text-3); font-size: 12.5px; }
.post-password-form { width: min(420px, 100%); }
.post-password-form form.protected { margin: 0; }
.post-password-form form.protected .word { display: none; }
.post-password-form form.protected p {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  box-shadow: 0 8px 24px rgba(30, 48, 90, .08);
}
.post-password-form form.protected p:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.post-password-form form.protected input[name="protectPassword"] {
  flex: 1 1 auto;
  min-width: 0;
  height: 40px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: 0;
  background: var(--card-2);
  color: var(--text);
  font-size: 13px;
  box-sizing: border-box;
}
.post-password-form form.protected input[type="submit"] {
  flex: 0 0 auto;
  height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.post-password-hint {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 13px;
  color: var(--text-3);
  font-size: 10px;
}
.post-password-hint svg { width: 12px; height: 12px; fill: currentColor; }
@media (max-width: 520px) {
  .post-password-gate { padding: 40px 16px 46px; }
  .post-password-form form.protected p { flex-direction: column; align-items: stretch; padding: 7px; }
  .post-password-form form.protected input[name="protectPassword"] { flex: 0 0 40px; width: 100%; height: 40px; }
  .post-password-form form.protected input[type="submit"] { width: 100%; }
}
@media (max-width: 820px) {
  .post .post-cat { display: none; }
  .post-cover .post-cover-new { top: 6px; left: 6px; height: 16px; padding: 0 4px; font-size: 8px; }
  .post .post-excerpt {
    display: block;
    margin: 0 0 8px;
    font-size: 12px;
    line-height: 1.55;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
  }
}

/* 归档时间线：日期不换行、圆点与竖线对齐 */
.archive-timeline .timeline-body { padding: 10px 24px 22px 32px; }
.year-months { padding-left: 18px; }
.timeline-month { padding-left: 18px; }
.timeline-month::before { left: -22px; }
.archive-list time { flex: 0 0 42px; white-space: nowrap; font-size: 11.5px; }
@media (max-width: 820px) {
  .archive-timeline .timeline-body { padding: 8px 16px 18px 24px; }
  .year-months { padding-left: 14px; }
  .timeline-month { padding-left: 14px; }
  .timeline-month::before { left: -18px; top: 15px; }
  .archive-list time { flex-basis: 40px; font-size: 10.5px; }
  .archive-list li { gap: 7px; }
  .archive-cat { display: none; }
}

/* 首页公告弹窗 */
body.announce-open { overflow: hidden; }
.announce-modal { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 20px; }
.announce-modal[hidden] { display: none; }
.announce-mask { position: absolute; inset: 0; background: rgba(12, 18, 32, .48); opacity: 0; transition: opacity .22s ease; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.announce-dialog { position: relative; z-index: 1; width: min(440px, 100%); max-height: min(82vh, 620px); overflow-y: auto; padding: 22px 22px 20px; border: 1px solid var(--border); border-radius: 18px; background: var(--card); box-shadow: 0 24px 70px rgba(12, 18, 32, .28); opacity: 0; transform: translateY(12px) scale(.985); transition: opacity .22s ease, transform .22s ease; }
.announce-modal.is-open .announce-mask { opacity: 1; }
.announce-modal.is-open .announce-dialog { opacity: 1; transform: none; }
.announce-close { position: absolute; top: 12px; right: 12px; z-index: 2; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; color: var(--text-3); background: var(--card-2); }
.announce-close:hover { color: var(--text); background: var(--border); }
.announce-close svg { width: 13px; height: 13px; fill: currentColor; }
.announce-head { display: flex; align-items: center; gap: 9px; padding-right: 30px; }
.announce-mark { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; color: var(--brand); background: var(--brand-soft); }
.announce-mark svg { width: 15px; height: 15px; fill: currentColor; }
.announce-head strong { color: var(--text); font-size: 15px; font-weight: 800; }
.announce-body { margin-top: 14px; color: var(--text-2); font-size: 13px; line-height: 1.75; }
.announce-content { display: flex; flex-direction: column; gap: 11px; }
.announce-action { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; margin-top: 14px; padding: 0 15px; border-radius: 8px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-size: 12px; font-weight: 700; box-shadow: 0 6px 16px var(--brand-glow); }
.announce-action:hover { color: #fff; transform: translateY(-1px); }
.announce-action svg { width: 13px; height: 13px; fill: currentColor; }
.announce-image { width: 100%; max-height: 260px; display: block; object-fit: cover; border-radius: 11px; background: var(--card-2); }
.announce-text { white-space: normal; }
.announce-html img { max-width: 100%; height: auto; border-radius: 10px; }
.announce-html p { margin: 0 0 8px; }
.announce-html p:last-child { margin-bottom: 0; }
@media (max-width: 520px) {
  .announce-modal { padding: 14px; }
  .announce-dialog { padding: 19px 17px 17px; border-radius: 15px; max-height: 84vh; }
  .announce-head strong { font-size: 14px; }
  .announce-body { font-size: 12.5px; }
  .announce-image { max-height: 210px; }
}
.search-ajax-load { display: flex; flex-direction: column; align-items: center; gap: 7px; margin: 6px 0 18px; }
.search-load-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 18px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--card);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 700;
  transition: .2s;
}
.search-load-more svg { width: 13px; height: 13px; fill: currentColor; }
.search-load-more:hover { color: var(--brand); border-color: var(--brand); background: var(--brand-soft); }
.search-load-more:disabled { opacity: .55; cursor: wait; }
.search-load-status { min-height: 14px; margin: 0; color: var(--text-3); font-size: 10.5px; }

/* 实时搜索下拉 */
.search-form { position: relative; }
.live-search-pop {
  position: fixed;
  z-index: 9000;
  max-height: min(420px, 60vh);
  overflow-y: auto;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  box-shadow: 0 18px 42px rgba(16, 28, 55, .20);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.live-search-pop[hidden] { display: none; }
.live-search-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 8px 5px;
  color: var(--text-3);
  font-size: 10px;
  font-weight: 700;
}
.live-search-head em { font-style: normal; color: var(--brand); font-size: 9.5px; }
.live-search-loading { display: flex; align-items: center; gap: 7px; padding: 12px 10px; color: var(--text-3); font-size: 11px; }
.live-search-loading span { width: 9px; height: 9px; border: 1.5px solid var(--border); border-top-color: var(--brand); border-radius: 50%; animation: nebula-spin .7s linear infinite; }
.live-search-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 9px;
  border-radius: 8px;
  color: var(--text-2);
  text-decoration: none;
}
.live-search-item:hover, .live-search-item:focus-visible { background: var(--brand-soft); }
.live-search-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 700;
}
.live-search-snippet {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text-3);
  font-size: 10.5px;
  line-height: 1.55;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.live-search-match { margin-right: 4px; padding: 0 4px; border-radius: 3px; color: var(--brand); background: var(--brand-soft); font-style: normal; font-size: 9px; font-weight: 700; }
.live-search-meta { color: var(--text-3); font-size: 10px; }
.live-search-empty { padding: 13px 10px; color: var(--text-3); font-size: 11px; text-align: center; }
.live-search-all {
  display: block;
  margin-top: 3px;
  padding: 8px 9px;
  border-top: 1px solid var(--border);
  color: var(--brand);
  font-size: 10.5px;
  font-weight: 700;
  text-align: center;
}
@media (max-width: 620px) {
  .live-search-pop { max-height: 55vh; }
  .live-search-title { font-size: 12px; }
}








