/* ==========================================================================
   nphy.top 全站样式
  浅蓝白简约风 · 左侧信息栏 + 卡片流 · CSS 变量换肤（亮色 / 暗色）
   ========================================================================== */

/* ==========================================================================
   视觉主题（皮肤）：默认 + 科技 / 动漫 / 复古 / 风景 / 自然
   一套页面适配全部皮肤 —— 只换 CSS 变量 + 一层背景 + 一点动效
   ========================================================================== */

/* 背景层容器（默认皮肤是空的，各主题自己上色） */
.skin-layer,
.skin-scenery-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.skin-scenery-bg {
  background-position: 40% 50%;
  background-size: cover;
  animation: skinBgMove 34s ease-in-out infinite alternate;
}

@keyframes skinBgMove {
  from { background-position: 38% 50%; }
  to   { background-position: 62% 50%; }
}

/* ---------- 1. 科技：深蓝黑 + 霓虹青蓝 + 网格流动 ---------- */
body.theme-tech {
  --bg: #080c1a;
  --bg-2: #0b1222;
  --bg-3: #0f1830;
  --panel: rgba(18, 28, 52, .82);
  --panel-2: rgba(14, 22, 42, .78);
  --border: #1f4b7a;
  --border-soft: #17324f;
  --text: #cfefff;
  --text-dim: #9fd0e8;
  --muted: #6f93ad;
  --accent: #38e0ff;
  --accent-deep: #7ef0ff;
  --accent-soft: rgba(56, 224, 255, .14);
  --accent-2: #2277ff;
  --accent-2-soft: rgba(34, 119, 255, .2);
  --pink: #ff6ec7;
  --pink-soft: rgba(255, 110, 199, .16);
  --green: #3ee6a8;
  --danger: #ff6b81;
  --shadow: 0 8px 26px rgba(20, 120, 255, .22);
  --shadow-lg: 0 18px 46px rgba(20, 120, 255, .3);
  --code-bg: #0a1428;
  background: var(--bg);
}

body.theme-tech .skin-layer {
  background-image:
    radial-gradient(rgba(56, 224, 255, .5) 1px, transparent 1px),
    radial-gradient(circle at 50% 0%, rgba(34, 119, 255, .22), transparent 60%);
  background-size: 30px 30px, 100% 100%;
  opacity: .35;
  animation: skinGridMove 22s linear infinite;
}

body.theme-tech .skin-layer::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 30vh;
  background: linear-gradient(180deg, transparent, rgba(56, 224, 255, .10), transparent);
  animation: skinScan 7s ease-in-out infinite;
}

@keyframes skinGridMove {
  from { background-position: 0 0, 0 0; }
  to   { background-position: 30px 30px, 0 0; }
}

@keyframes skinScan {
  0%   { top: -30vh; }
  100% { top: 100vh; }
}

/* ---------- 2. 动漫：粉紫渐变 + 星光 + 卡片上浮 ---------- */
body.theme-anime {
  --bg: #ffeaf5;
  --bg-2: #f4ecff;
  --bg-3: #ffe0f0;
  --panel: rgba(255, 255, 255, .8);
  --panel-2: rgba(255, 246, 252, .86);
  --border: #f8c8e0;
  --border-soft: #fbe0ee;
  --text: #3a2a44;
  --text-dim: #6b5378;
  --muted: #a58cb4;
  --accent: #ff9ecb;
  --accent-deep: #e4679e;
  --accent-soft: rgba(255, 158, 203, .18);
  --accent-2: #9f8dff;
  --accent-2-soft: rgba(159, 141, 255, .2);
  --pink: #ff7eb6;
  --pink-soft: rgba(255, 126, 182, .18);
  --green: #6fd6a8;
  --danger: #ff7a90;
  --shadow: 0 8px 24px rgba(220, 140, 200, .22);
  --shadow-lg: 0 16px 40px rgba(220, 140, 200, .3);
  --code-bg: #fdf3fa;
  background: linear-gradient(135deg, #ffe8f4, #e0e8ff);
}

body.theme-anime .skin-layer {
  background-image: radial-gradient(rgba(255, 255, 255, .95) 2px, transparent 2px);
  background-size: 80px 80px;
  opacity: .5;
  animation: skinStar 16s ease-in-out infinite;
}

@keyframes skinStar {
  0%, 100% { opacity: .35; transform: translateY(0); }
  50%      { opacity: .6;  transform: translateY(8px); }
}

body.theme-anime .post-card:hover,
body.theme-anime .side-card:hover,
body.theme-anime .category-card:hover {
  transform: translateY(-4px);
}

/* ---------- 3. 复古：牛皮纸 + 轻微晃动 ---------- */
body.theme-retro {
  --bg: #f4e9d8;
  --bg-2: #f8f0e2;
  --bg-3: #efe1cd;
  --panel: #fff8e8;
  --panel-2: #fdf4e3;
  --border: #c9b496;
  --border-soft: #e2d4bb;
  --text: #483520;
  --text-dim: #6b5236;
  --muted: #9c8465;
  --accent: #a8763c;
  --accent-deep: #8a5c28;
  --accent-soft: rgba(168, 118, 60, .15);
  --accent-2: #c69a5a;
  --accent-2-soft: rgba(198, 154, 90, .2);
  --pink: #b5745f;
  --pink-soft: rgba(181, 116, 95, .16);
  --green: #6f8f52;
  --danger: #b4523f;
  --shadow: 0 6px 18px rgba(120, 80, 40, .18);
  --shadow-lg: 0 14px 36px rgba(120, 80, 40, .24);
  --code-bg: #f5ead6;
  background: #f4e9d8;
}

body.theme-retro .skin-layer {
  background-image:
    repeating-linear-gradient(90deg, rgba(120, 85, 45, .05) 0 1px, transparent 1px 6px),
    radial-gradient(circle at 20% 20%, rgba(160, 120, 70, .18), transparent 55%),
    radial-gradient(circle at 80% 70%, rgba(140, 100, 60, .14), transparent 60%);
  opacity: .9;
  animation: skinPaper 9s ease-in-out infinite;
}

@keyframes skinPaper {
  0%, 100% { transform: rotate(.1deg); }
  50%      { transform: rotate(-.1deg); }
}

/* ---------- 4. 风景：全屏大图 + 磨砂卡片（.skin-scenery-bg 由 JS/PHP 提供） ---------- */
body.theme-scenery {
  --bg: #446688;
  --bg-2: rgba(255, 255, 255, .12);
  --bg-3: rgba(255, 255, 255, .18);
  --panel: rgba(255, 255, 255, .78);
  --panel-2: rgba(255, 255, 255, .68);
  --border: rgba(255, 255, 255, .5);
  --border-soft: rgba(255, 255, 255, .35);
  --text: #14212e;
  --text-dim: #33475b;
  --muted: #5c7488;
  --accent: #2f89c5;
  --accent-deep: #1f6ea3;
  --accent-soft: rgba(47, 137, 197, .16);
  --accent-2: #2f6f4f;
  --accent-2-soft: rgba(47, 111, 79, .18);
  --shadow: 0 8px 26px rgba(10, 30, 50, .28);
  --shadow-lg: 0 18px 44px rgba(10, 30, 50, .34);
  --code-bg: rgba(255, 255, 255, .72);
  background: #446688;
}

body.theme-scenery .side-card,
body.theme-scenery .card,
body.theme-scenery .post-card,
body.theme-scenery .admin-panel,
body.theme-scenery .chart-card,
body.theme-scenery .comment-section {
  backdrop-filter: blur(10px) saturate(140%);
}

body.theme-scenery .site-header { background: rgba(255, 255, 255, .62); }
body.theme-scenery .bg-deco { display: none; }

/* ---------- 5. 自然：淡绿渐变 + 光晕呼吸 ---------- */
body.theme-nature {
  --bg: #eaf6e8;
  --bg-2: #f3faf1;
  --bg-3: #dcefd8;
  --panel: rgba(255, 255, 255, .82);
  --panel-2: rgba(246, 252, 244, .86);
  --border: #a9c9a4;
  --border-soft: #d3e6ce;
  --text: #1f3825;
  --text-dim: #3f5c45;
  --muted: #7b9a7f;
  --accent: #7dbb78;
  --accent-deep: #4f8f4a;
  --accent-soft: rgba(125, 187, 120, .18);
  --accent-2: #e6c76a;
  --accent-2-soft: rgba(230, 199, 106, .22);
  --pink: #d98fa8;
  --pink-soft: rgba(217, 143, 168, .16);
  --green: #4f9d63;
  --danger: #c85a4a;
  --shadow: 0 6px 20px rgba(60, 120, 70, .16);
  --shadow-lg: 0 16px 40px rgba(60, 120, 70, .22);
  --code-bg: #eef7ec;
  background: linear-gradient(140deg, #eaf6e8, #d4e9d0);
}

body.theme-nature .skin-layer {
  background-image:
    radial-gradient(ellipse at 30% 20%, rgba(125, 187, 120, .35) 0%, transparent 60%),
    radial-gradient(ellipse at 75% 70%, rgba(230, 199, 106, .28) 0%, transparent 62%);
  animation: skinBreathe 8s ease-in-out infinite;
}

@keyframes skinBreathe {
  0%, 100% { opacity: .45; transform: scale(1); }
  50%      { opacity: .8;  transform: scale(1.04); }
}

/* 深色主题与皮肤冲突时，皮肤优先 */
[data-theme="dark"] body.theme-anime,
[data-theme="dark"] body.theme-retro,
[data-theme="dark"] body.theme-scenery,
[data-theme="dark"] body.theme-nature { color-scheme: light; }

/* 首页横幅：默认与风景皮肤用插画，其余皮肤直接用主题底色 + 柔和暗角（白字才看得清） */
body.theme-tech .hero-bg,
body.theme-anime .hero-bg,
body.theme-retro .hero-bg,
body.theme-nature .hero-bg { display: none; }

body.theme-tech .hero-veil {
  background:
    radial-gradient(circle at 50% 35%, rgba(56, 224, 255, .18), transparent 60%),
    linear-gradient(180deg, rgba(4, 10, 24, .62), rgba(6, 14, 30, .88));
}
body.theme-anime .hero-veil {
  background: linear-gradient(180deg, rgba(120, 70, 130, .5), rgba(90, 60, 120, .72));
}
body.theme-retro .hero-veil {
  background: linear-gradient(180deg, rgba(80, 52, 24, .55), rgba(60, 38, 16, .78));
}
body.theme-nature .hero-veil {
  background: linear-gradient(180deg, rgba(24, 66, 34, .52), rgba(16, 48, 26, .76));
}

/* 主题下 hero 里的头像 / 徽章也换成半透明玻璃质感 */
body.theme-tech .hero-badge,
body.theme-anime .hero-badge,
body.theme-retro .hero-badge,
body.theme-nature .hero-badge {
  background: rgba(0, 0, 0, .34);
  border-color: rgba(255, 255, 255, .42);
}

/* 低配设备 / 关闭动效：背景动画全部停掉 */
@media (prefers-reduced-motion: reduce) {
  .skin-layer,
  .skin-layer::after,
  .skin-scenery-bg { animation: none !important; }
}

/* ==========================================================================
   主题切换器（头部 🎨）
   ========================================================================== */

.skin-picker { position: relative; }

.skin-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 264px;
  z-index: 80;
  padding: 12px;
  border-radius: var(--r-lg);
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  animation: skinMenuIn .18s ease both;
}

.skin-menu[hidden] { display: none; }

@keyframes skinMenuIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}

.sm-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  padding: 2px 4px 10px;
}

.sm-head span { font-size: 11.5px; font-weight: 400; color: var(--muted); }

.sm-list { display: flex; flex-direction: column; gap: 4px; }

.skin-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: transparent;
  color: var(--text-dim);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background var(--t-base), border-color var(--t-base), transform var(--t-base);
}

.skin-item:hover { background: var(--accent-soft); border-color: var(--accent); transform: translateX(2px); }
.skin-item.is-on { border-color: var(--accent); background: var(--accent-soft); }

.si-swatch { display: flex; gap: 2px; flex: 0 0 auto; }
.si-swatch i { width: 9px; height: 18px; border-radius: var(--r-xs); display: block; }

.si-text { flex: 1 1 auto; min-width: 0; }
.si-text b { display: block; font-size: 13px; color: var(--text); }
.si-text em { display: block; font-style: normal; font-size: 11.5px; color: var(--muted); }

.si-check { flex: 0 0 auto; color: var(--accent); font-size: 13px; opacity: 0; }
.skin-item.is-on .si-check { opacity: 1; }

.sm-foot {
  margin-top: 8px;
  padding: 8px 4px 0;
  border-top: 1px dashed var(--border-soft);
  font-size: 11.5px;
  color: var(--muted);
}

.sm-foot a { color: var(--accent-deep); }

@media (max-width: 640px) {
  .skin-menu { right: -60px; width: 250px; }
}

/* 个人中心里的主题选择（大一点的色块卡片） */
.skin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 12px;
  margin-top: 4px;
}

.skin-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--border);
  background: var(--panel);
  cursor: pointer;
  transition: border-color var(--t-base), transform var(--t-base), box-shadow var(--t-base);
}

.skin-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.skin-card.is-on { border-color: var(--accent); box-shadow: var(--ring); }
.skin-card input { position: absolute; opacity: 0; pointer-events: none; }

.sc-swatch { display: flex; gap: 4px; }
.sc-swatch i { width: 22px; height: 12px; border-radius: var(--r-xs); display: block; }
.skin-card b { font-size: 13.5px; color: var(--text); }
.skin-card em { font-style: normal; font-size: 11.5px; color: var(--muted); line-height: 1.6; }

:root {
  --bg: #e9f4fd;
  --bg-2: #f6fbff;
  --bg-3: #dff0fb;
  --panel: #ffffff;
  --panel-2: #f7fcff;
  --border: #d5ebf8;
  --border-soft: #e8f4fb;
  --text: #33475b;
  --text-dim: #5c7488;
  --muted: #8ba6bb;
  --accent: #3fb6dd;
  --accent-deep: #2196c4;
  --accent-soft: rgba(63, 182, 221, .12);
  --accent-2: #ffc857;
  --accent-2-soft: rgba(255, 200, 87, .18);
  --pink: #ff8fb1;
  --pink-soft: rgba(255, 143, 177, .14);
  --green: #4cc79a;
  --danger: #ff7b7b;
  --radius: 16px;
  --radius-sm: 11px;

  /*
   * 设计规范（v1.67.0）
   * ---------------------------------------------------------------------
   * 收敛之前：圆角 32 种取值、过渡时长 53 种、阴影 90 种、gap 21 种，
   * 而且 11 / 12 / 13、14 / 15 / 16 这些彼此差 1px 的值混着用 ——
   * 单看每一处都合理，放在一起就显得不精致。
   *
   * 现在只认下面这一套，新增样式一律从这里取值：
   */
  --r-xs: 4px;      /* 极小元素：favicon 托盘、滚动条滑块 */
  --r-sm: 8px;      /* 小控件：标签、迷你按钮、缩略图 */
  --r-md: 12px;     /* 交互件：按钮、输入框、小卡片 */
  --r-lg: 16px;     /* 卡片（最常用） */
  --r-xl: 20px;     /* 面板、大卡片、抽屉 */
  --r-2xl: 24px;    /* 首页横幅、弹窗、大块容器 */
  --r-pill: 999px;  /* 胶囊 */

  /* 过渡只留四档时长（原来 12 种，差 0.02s 谁也看不出来，但叠加起来就是"不齐"） */
  --t-fast: .14s;    /* 颜色、描边这类微反馈 */
  --t-base: .18s;    /* 按钮、卡片悬浮（最常用） */
  --t-slow: .28s;    /* 展开、位移 */
  --t-slower: .42s;  /* 抽屉、大范围移动 */

  /* 键盘聚焦与选中态统一用这一枚环 */
  --ring: 0 0 0 3px var(--accent-soft);

  --radius: var(--r-lg);     /* 老名字：等价 --r-lg（16px，数值未变） */
  --radius-sm: var(--r-md);  /* 老名字：等价 --r-md（12px，原来 11px） */
  --shadow: 0 6px 20px rgba(96, 160, 200, .12);
  --shadow-lg: 0 14px 38px rgba(96, 160, 200, .18);
  --mono: "JetBrains Mono", "Cascadia Code", Consolas, "SFMono-Regular", Menlo, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --maxw: 1240px;
  --code-bg: #f3f8fc;
}

[data-theme="dark"] {
  --bg: #10161d;
  --bg-2: #151d26;
  --bg-3: #1a232e;
  --panel: #172029;
  --panel-2: #1b2530;
  --border: #26323f;
  --border-soft: #202a35;
  --text: #e6eef6;
  --text-dim: #a8bccd;
  --muted: #7b93a6;
  --accent: #4fc3e8;
  --accent-deep: #7fd6f2;
  --accent-soft: rgba(79, 195, 232, .14);
  --accent-2: #ffc857;
  --accent-2-soft: rgba(255, 200, 87, .14);
  --pink: #ff9dbb;
  --pink-soft: rgba(255, 157, 187, .14);
  --green: #5ad3a6;
  --danger: #ff8989;
  --shadow: 0 6px 20px rgba(0, 0, 0, .3);
  --shadow-lg: 0 14px 38px rgba(0, 0, 0, .42);
  --code-bg: #0e141b;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; transition: color var(--t-base); }
a:hover { color: var(--accent); }

img { max-width: 100%; }

code, pre, kbd { font-family: var(--mono); }

/* 背景装饰：柔光云朵 */
.bg-deco {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(620px 380px at 8% -4%, rgba(120, 205, 240, .40), transparent 68%),
    radial-gradient(560px 340px at 94% 2%, rgba(255, 200, 87, .22), transparent 66%),
    radial-gradient(720px 420px at 60% 100%, rgba(255, 143, 177, .16), transparent 70%);
}

[data-theme="dark"] .bg-deco {
  background:
    radial-gradient(620px 380px at 8% -4%, rgba(79, 195, 232, .16), transparent 68%),
    radial-gradient(560px 340px at 94% 2%, rgba(255, 200, 87, .08), transparent 66%);
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

/* ---------------- 顶部导航 ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}

[data-theme="dark"] .site-header { background: rgba(18, 25, 33, .88); }

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 62px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  white-space: nowrap;
  flex: 0 0 auto;
}
.brand img {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: var(--shadow);
  display: block;
}
.brand-name { color: var(--text); }
.brand-name span { color: var(--accent); }

.main-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1 1 auto;
  flex-wrap: wrap;
  min-width: 0;
}

.nav-link {
  padding: 6px 10px;
  border-radius: var(--r-pill);
  font-size: 14px;
  color: var(--text-dim);
  white-space: nowrap;
  transition: background .18s, color .18s, box-shadow .18s;
}
.nav-link:hover { background: var(--accent-soft); color: var(--accent-deep); }
.nav-link.is-active { background: var(--accent); color: #fff; font-weight: 600; box-shadow: var(--shadow); }

/* ---------- 一级分组 + 悬停下拉 ---------- */
.nav-group { position: relative; display: flex; align-items: center; }
.nav-parent {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
}
.nav-caret {
  width: 0;
  height: 0;
  margin-top: 2px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid currentColor;
  opacity: .55;
  transition: transform .18s ease, opacity .18s;
}
.nav-group:hover > .nav-parent,
.nav-group.is-open > .nav-parent { background: var(--accent-soft); color: var(--accent-deep); }
.nav-group:hover .nav-caret,
.nav-group.is-open .nav-caret { transform: rotate(180deg); opacity: .9; }
.nav-group.is-active > .nav-parent {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  box-shadow: var(--shadow);
}

.nav-drop {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 99;
  min-width: 140px;
  padding: 6px;
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-sm);
  box-shadow: 0 2px 12px rgba(0, 0, 0, .08);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
}

/* 浮层与一级之间留了 8px 空隙，用一块透明区域搭个桥，鼠标移过去不会闪断 */
.nav-drop::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -10px;
  height: 10px;
}

.nav-group:hover .nav-drop,
.nav-group:focus-within .nav-drop,
.nav-group.is-open .nav-drop {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nd-item {
  display: block;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  color: var(--text-dim);
  white-space: nowrap;
  transition: background var(--t-base), color var(--t-base);
}
.nd-item:hover,
.nd-item:focus-visible { background: rgba(120, 160, 190, .12); color: var(--accent-deep); }
.nd-item.is-active { background: var(--accent-soft); color: var(--accent-deep); font-weight: 600; }

/* 首页横幅那种透明顶栏上，下拉里的字仍然是深色（浮层是白底） */
body.has-hero .site-header:not(.is-solid) .nav-group:hover > .nav-parent { background: rgba(255, 255, 255, .18); color: #fff; }
body.has-hero .site-header:not(.is-solid) .nav-group.is-active > .nav-parent {
  background: rgba(255, 255, 255, .24);
  color: #fff;
  box-shadow: none;
}

/* 窄屏展开面板里的「快捷工具」区：宽屏不显示，图标由 main.js 搬进来 */
.nav-extras { display: none; }
.ne-label { display: block; }

.header-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.icon-btn {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text-dim);
  border-radius: 50%;
  cursor: pointer;
  font-size: 15px;
  transition: .18s;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-1px); }

.icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: inline; }

.nav-toggle { display: none; }

.user-menu { display: flex; align-items: center; gap: 8px; }
.user-avatar {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #8fd6f0);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}
.user-name { font-size: 13px; color: var(--text-dim); max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  background: var(--panel);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: .18s;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.btn-primary {
  background: linear-gradient(135deg, #56c8e8, #33aed8);
  color: #fff;
  box-shadow: var(--shadow);
}
.btn-primary:hover { color: #fff; filter: brightness(1.05); }
.btn-warm { background: linear-gradient(135deg, #ffd479, #ffc857); color: #7a5a12; box-shadow: 0 4px 14px rgba(255, 200, 87, .35); }
.btn-warm:hover { color: #6d4f0d; }
.btn-ghost { background: var(--panel); border-color: var(--border); color: var(--text-dim); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-deep); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: rgba(224, 86, 86, .12); color: var(--danger); }

/* 后台里的按钮再收一点，行内操作不显得笨重 */
.admin-main .btn { font-size: 13.5px; }
.admin-main .btn-sm,
.admin-main .btn.mini { padding: 5px 12px; font-size: 12.5px; }
.admin-main .btn:focus-visible,
.admin-main .ne-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------------- 主体布局：左栏 + 内容 ---------------- */
.layout {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  padding: 22px 20px 8px;
}

.content { min-width: 0; }
.layout.no-side { grid-template-columns: minmax(0, 1fr); }

.sidebar {
  position: sticky;
  top: 78px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.side-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.side-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14.5px;
  font-weight: 700;
  margin: 0 0 14px;
  color: var(--text);
}
.side-title::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: var(--ring);
}

/* 个人信息卡 */
.profile-card { text-align: center; padding-top: 24px; }
.profile-avatar {
  width: 88px; height: 88px;
  margin: 0 auto 12px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid #fff;
  box-shadow: var(--shadow-lg);
  background: var(--bg-3);
}
.profile-avatar img { width: 100%; height: 100%; display: block; object-fit: cover; }
.profile-name { font-size: 17px; font-weight: 700; margin: 0 0 4px; }
.profile-sign { font-size: 13px; color: var(--muted); margin: 0 0 14px; }

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px dashed var(--border);
  border-bottom: 1px dashed var(--border);
  padding: 12px 0;
  margin-bottom: 14px;
}
.profile-stats .ps { text-align: center; }
.profile-stats b { display: block; font-size: 17px; color: var(--accent-deep); font-family: var(--mono); }
.profile-stats span { font-size: 12px; color: var(--muted); }

.follow-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 22px;
  border-radius: var(--r-pill);
  background: linear-gradient(135deg, #ff9dbb, #ff8fb1);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 5px 16px rgba(255, 143, 177, .38);
  margin-bottom: 14px;
}
.follow-btn:hover { color: #fff; filter: brightness(1.05); }

.social-row { display: flex; justify-content: center; gap: 10px; }
.social-btn {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 13px;
  transition: .18s;
}
.social-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; transform: translateY(-2px); }
.social-btn svg { width: 17px; height: 17px; fill: currentColor; }

/* 最近更新 */
.side-list { display: flex; flex-direction: column; gap: 12px; }
.side-item { display: flex; gap: 10px; align-items: center; }
.side-thumb {
  flex: 0 0 58px; height: 44px;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--bg-3);
  border: 1px solid var(--border-soft);
}
.side-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.side-info { min-width: 0; }
.side-info a {
  display: block;
  font-size: 13.5px;
  line-height: 1.45;
  font-weight: 600;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.side-info span { font-size: 11.5px; color: var(--muted); font-family: var(--mono); }

/* 标签云 */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-cloud a {
  font-size: 12.5px;
  padding: 4px 11px;
  border-radius: var(--r-pill);
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  transition: .18s;
}
.tag-cloud a:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-deep); transform: translateY(-2px); }
.tag-cloud a .cnt { color: var(--muted); font-size: 11.5px; margin-left: 3px; }
.tag-cloud a:nth-child(3n+2) { background: var(--pink-soft); border-color: #ffd7e4; }
.tag-cloud a:nth-child(3n+2):hover { color: var(--pink); }
.tag-cloud a:nth-child(5n) { background: var(--accent-2-soft); border-color: #ffe6b0; }

/* ---------------- 欢迎框 / 归档 / 分类 ---------------- */
.welcome-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-radius: var(--radius);
  background: linear-gradient(120deg, #eaf8ff, #f7fdff);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 14px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
[data-theme="dark"] .welcome-box { background: linear-gradient(120deg, #16212b, #1a2632); }
.welcome-box .wave { font-size: 18px; }
.welcome-box b { color: var(--accent-deep); }

.archive-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.archive-btn {
  flex: 0 0 auto;
  min-width: 96px;
  padding: 14px 20px;
  border-radius: var(--r-md);
  text-align: center;
  font-weight: 700;
  font-size: 14.5px;
  border: 1px solid var(--border);
  background: var(--panel);
  transition: .18s;
}
.archive-btn small { display: block; font-size: 11.5px; font-weight: 400; color: var(--muted); margin-top: 2px; }
.archive-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.archive-btn.is-cyan { background: linear-gradient(135deg, #e8f8ff, #d6f1fd); color: var(--accent-deep); border-color: #bfe6f7; }
.archive-btn.is-warm { background: linear-gradient(135deg, #fff7e2, #ffefc9); color: #a3771a; border-color: #ffe3ab; }
.archive-btn.is-pink { background: linear-gradient(135deg, #fff0f5, #ffe3ec); color: #c9547e; border-color: #ffd2e0; }
.archive-btn.is-green { background: linear-gradient(135deg, #eefaf3, #dcf5e7); color: #2f8f63; border-color: #c6ecd8; }

.chip-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.chip {
  padding: 5px 15px;
  border-radius: var(--r-pill);
  background: var(--panel);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-dim);
  transition: var(--t-base);
}
.chip:hover { border-color: var(--accent); color: var(--accent-deep); }
.chip.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------------- 区块 ---------------- */
.section { margin-bottom: 26px; }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.section-title {
  font-size: 16.5px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title::before {
  content: "";
  width: 5px; height: 16px;
  border-radius: var(--r-xs);
  background: linear-gradient(180deg, var(--accent), #9fe0f5);
}
.section-sub { color: var(--muted); font-size: 13px; margin: 4px 0 0; }
.section-more { font-size: 13px; color: var(--muted); }
.section-more:hover { color: var(--accent); }

/* ---------------- 专题卡片 ---------------- */
.topic-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(206px, 1fr));
  gap: 14px;
}
.topic-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--t-base);
  display: flex;
  flex-direction: column;
}
.topic-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: #c4e6f7; }
.topic-cover { height: 112px; overflow: hidden; background: var(--bg-3); position: relative; }
.topic-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.topic-cover .topic-tag {
  position: absolute;
  left: 10px; bottom: 10px;
  padding: 2px 10px;
  border-radius: var(--r-pill);
  font-size: 11.5px;
  background: rgba(255, 255, 255, .9);
  color: var(--accent-deep);
  font-weight: 600;
}
.topic-body { padding: 12px 14px 14px; }
.topic-body h3 { font-size: 14.5px; margin: 0 0 5px; line-height: 1.5; }
.topic-body p { margin: 0; font-size: 12.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------------- 文章卡片（带封面） ---------------- */
.post-list { display: flex; flex-direction: column; gap: 14px; }

.post-card {
  display: flex;
  gap: 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  transition: var(--t-base);
}
.post-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: #c4e6f7; }
.post-card:nth-child(even) { flex-direction: row-reverse; }

.post-cover {
  flex: 0 0 216px;
  height: 138px;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--bg-3);
}
.post-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: var(--t-slow); }
.post-card:hover .post-cover img { transform: scale(1.04); }

.post-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.post-title { font-size: 17px; font-weight: 700; line-height: 1.5; margin: 0; }
.post-card:hover .post-title { color: var(--accent-deep); }
.post-excerpt {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-dim);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--muted);
  margin-top: auto;
}
.post-meta .m { display: inline-flex; align-items: center; gap: 4px; }
.post-meta .m-i { color: var(--accent); font-size: 12px; }

.badge {
  font-size: 11.5px;
  padding: 1px 9px;
  border-radius: var(--r-sm);
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-weight: 600;
}
.badge-top { background: var(--pink-soft); color: #d1628c; }
.badge-daily { background: rgba(76, 199, 154, .16); color: #2f9d74; }
.badge-ver { background: var(--accent-2-soft); color: #a3771a; }

.tag-list { display: flex; gap: 6px; flex-wrap: wrap; }
.tag {
  font-size: 11.5px;
  color: var(--text-dim);
  background: var(--panel-2);
  border: 1px solid var(--border-soft);
  padding: 1px 9px;
  border-radius: var(--r-pill);
  transition: var(--t-base);
}
.tag:hover { color: var(--accent); border-color: var(--accent); }

/* ---------------- 通用卡片 / 网格 ---------------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  transition: var(--t-base);
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow);
}
.card:hover { border-color: #c4e6f7; transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.card-title { font-size: 16px; font-weight: 650; line-height: 1.5; margin: 0; }
.card:hover .card-title { color: var(--accent-deep); }
.card-excerpt { color: var(--text-dim); font-size: 13.5px; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; flex-wrap: wrap; }
.card-meta { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }

/* ---------------- 页头 ---------------- */
.page-head {
  padding: 24px 24px;
  margin-bottom: 18px;
  border-radius: var(--radius);
  background: linear-gradient(120deg, #eaf8ff, #f9fdff);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
[data-theme="dark"] .page-head { background: linear-gradient(120deg, #16212b, #1a2632); }
.page-head h1 { font-size: 22px; margin: 0 0 6px; }
.page-head p { color: var(--muted); margin: 0; font-size: 13.5px; }

/* ---------------- 工具栏 ---------------- */
.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin: 0 0 18px;
  padding: 13px 15px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.input, .select, .textarea {
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 9px 15px;
  outline: none;
  transition: .18s;
  width: 100%;
}

/*
 * 工具栏里的下拉框 / 输入框不该各占一整行 —— .input/.select 默认 width:100%，
 * 直接放进 .toolbar 会被撑成一条一条，整个筛选区变得又高又空。
 * 用子选择器限定，避免影响到 .search-box 里那个本来就该撑满的输入框。
 */
.toolbar > .select,
.toolbar > .input { width: auto; min-width: 132px; }
.textarea { border-radius: var(--r-md); resize: vertical; min-height: 110px; line-height: 1.7; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: var(--ring); }
.select { cursor: pointer; }

.search-box { position: relative; flex: 1; min-width: 200px; }
.search-box .input { padding-left: 36px; padding-right: 44px; }

/* 键盘快捷键提示：按 / 直接定位搜索框 */
.search-box .search-kbd {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  padding: 1px 7px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--panel);
  color: var(--muted);
  font-family: inherit;
  font-size: 12px;
  line-height: 1.5;
  pointer-events: none;
}

@media (max-width: 640px) {
  .search-box .input { padding-right: 14px; }
  .search-box .search-kbd { display: none; }
}

.search-box::before {
  content: "⌕";
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-52%);
  color: var(--muted);
  font-size: 16px;
}

/* 列表行（随笔 / 搜索结果） */
.article-list { display: flex; flex-direction: column; gap: 14px; }
.list-item {
  display: flex;
  gap: 16px;
  padding: 16px 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: var(--t-base);
}
.list-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: #c4e6f7; }
.list-item .li-main { flex: 1; min-width: 0; }
.list-item h3 { margin: 0 0 6px; font-size: 16px; font-weight: 650; line-height: 1.5; }
.list-item:hover h3 { color: var(--accent-deep); }
.list-item p { margin: 0 0 8px; color: var(--text-dim); font-size: 13.5px; }
.list-item .li-side {
  font-size: 12px;
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: center;
  font-family: var(--mono);
}

/* ---------------- 文章详情 ---------------- */
.article-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 30px 30px;
  box-shadow: var(--shadow);
}
.article-banner {
  height: 220px;
  border-radius: var(--r-md);
  overflow: hidden;
  margin-bottom: 20px;
  background: var(--bg-3);
}
.article-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.article-cover-credit {
  margin: -12px 0 16px;
  text-align: right;
  font-size: 11.5px;
  color: var(--text-dim);
  opacity: .85;
}
.article-cover-credit a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.article-cover-credit a:hover { color: var(--accent); }
.article-head { margin-bottom: 22px; }
.article-head h1 { font-size: clamp(22px, 3.4vw, 29px); line-height: 1.4; margin: 10px 0 14px; }
.article-meta {
  display: flex; gap: 14px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--muted);
  padding-bottom: 18px; border-bottom: 1px dashed var(--border);
}

.article-body { font-size: 15.5px; color: var(--text-dim); }
.article-body h2 { font-size: 20px; color: var(--text); margin: 32px 0 12px; }
.article-body h3 { font-size: 17px; color: var(--text); margin: 26px 0 10px; }
.article-body p { margin: 0 0 15px; }
.article-body a { color: var(--accent-deep); border-bottom: 1px dashed currentColor; }
.article-body ul, .article-body ol { padding-left: 22px; margin: 0 0 15px; }
.article-body li { margin-bottom: 6px; }
.article-body blockquote {
  margin: 18px 0;
  padding: 10px 18px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  color: var(--text-dim);
}
.article-body code {
  font-size: 13.5px;
  background: var(--accent-soft);
  padding: 1px 7px;
  border-radius: var(--r-sm);
  color: var(--accent-deep);
}
.article-body img { border-radius: var(--radius); border: 1px solid var(--border); }

/* 正文里的更多排版元素（编辑器可以产出这些标签） */
.article-body h4 { font-size: 15.5px; color: var(--text); margin: 22px 0 8px; }
.article-body hr {
  height: 0;
  margin: 26px 0;
  border: 0;
  border-top: 1px dashed var(--border);
}
.article-body figure { margin: 20px 0; }
.article-body figure img { display: block; width: 100%; }
.article-body figcaption {
  margin-top: 8px;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
}
.article-body table {
  width: 100%;
  margin: 18px 0;
  border-collapse: collapse;
  font-size: 14px;
}
.article-body th,
.article-body td {
  padding: 9px 12px;
  border: 1px solid var(--border);
  text-align: left;
}
.article-body th { background: var(--accent-soft); color: var(--text); font-weight: 600; }
.article-body tbody tr:nth-child(even) { background: var(--panel-2); }
.article-body pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  color: inherit;
  font-size: 13px;
}

pre {
  position: relative;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px 18px;
  overflow-x: auto;
  margin: 18px 0;
  font-size: 13.5px;
  line-height: 1.75;
}
pre code { background: none; padding: 0; color: var(--text); font-size: inherit; }

.tok-key { color: #7b5cd6; }
.tok-string { color: #c07a2c; }
.tok-comment { color: #93a7b8; font-style: italic; }
.tok-num { color: #d9663f; }
.tok-var { color: #2f86c8; }
[data-theme="dark"] .tok-key { color: #b39ddb; }
[data-theme="dark"] .tok-string { color: #e0b072; }
[data-theme="dark"] .tok-var { color: #7fc4ee; }

.code-copy {
  position: absolute;
  top: 9px; right: 9px;
  font-size: 11.5px;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  opacity: 0;
  transition: .18s;
}
pre:hover .code-copy { opacity: 1; }
.code-copy:hover { color: var(--accent-deep); border-color: var(--accent); }
.code-copy.is-done { color: var(--green); border-color: var(--green); opacity: 1; }

.article-foot {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px dashed var(--border);
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.prev-next { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; }
.pn-item {
  padding: 14px 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: .18s;
}
.pn-item:hover { border-color: var(--accent); transform: translateY(-2px); }
.pn-item span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.pn-item strong { font-weight: 600; font-size: 14px; }
.pn-item.is-empty { opacity: .5; }

/* ---------------- 分页 ---------------- */
.pager { display: flex; align-items: center; gap: 8px; justify-content: center; margin: 26px 0 8px; flex-wrap: wrap; }
.pager-btn, .pager-num {
  font-size: 13px;
  padding: 7px 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text-dim);
  transition: var(--t-base);
}
.pager-btn:hover, .pager-num:hover { border-color: var(--accent); color: var(--accent-deep); }
.pager-num.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.pager-btn.is-disabled { opacity: .4; pointer-events: none; }
.pager-total { font-size: 12.5px; color: var(--muted); margin-left: 6px; }

/* ---------------- 留言板 ---------------- */
.message-form { padding: 20px 22px; }
.message-form .form-row { margin-bottom: 12px; }
.message-form label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }

.msg-list { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }
.msg-item {
  display: flex;
  gap: 14px;
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.msg-avatar {
  width: 40px; height: 40px; flex: 0 0 40px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #cfeeff, #a9e2f7);
  color: var(--accent-deep);
  font-weight: 700;
  font-size: 15px;
}
.msg-body { flex: 1; min-width: 0; }
.msg-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; flex-wrap: wrap; }
.msg-name { font-weight: 650; font-size: 14px; }
.msg-time { font-size: 12px; color: var(--muted); }
.msg-text { margin: 0; color: var(--text-dim); font-size: 14px; white-space: pre-wrap; word-break: break-word; }

.notice {
  padding: 13px 18px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  border: 1px solid #bfe6f7;
  color: var(--text-dim);
  font-size: 14px;
  margin: 0 0 18px;
}
.notice-warn { background: var(--accent-2-soft); border-color: #ffe3ab; }
.notice-error { background: rgba(255, 123, 123, .12); border-color: #ffcdcd; }
.notice-success { background: rgba(76, 199, 154, .14); border-color: #b8ecd7; }

/* ---------------- 相册 ---------------- */
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.album-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform var(--t-base) ease, box-shadow var(--t-base) ease, border-color var(--t-base) ease;
  animation: albumIn .45s ease both;
  cursor: zoom-in;
}
.album-card:nth-child(2) { animation-delay: .06s; }
.album-card:nth-child(3) { animation-delay: .12s; }
.album-card:nth-child(4) { animation-delay: .18s; }
.album-card:nth-child(5) { animation-delay: .24s; }
.album-card:nth-child(6) { animation-delay: .30s; }

@keyframes albumIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

.album-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--accent-soft); }

.album-cover { position: relative; height: 172px; overflow: hidden; background: var(--bg-3); }

.album-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity var(--t-slower) ease, transform .6s ease;
}

.album-cover img.is-in { opacity: 1; transform: none; }
.album-card:hover .album-cover img { transform: scale(1.07); transition-duration: var(--t-slower); }

/* 悬停时从底部浮出的提示条 */
.album-zoom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 30px 14px 10px;
  background: linear-gradient(to top, rgba(12, 32, 52, .66), rgba(12, 32, 52, 0));
  color: #fff;
  font-size: 12.5px;
  text-align: center;
  letter-spacing: .3px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--t-base) ease, transform var(--t-base) ease;
  pointer-events: none;
}

.album-card:hover .album-zoom { opacity: 1; transform: none; }

/* 宽屏时每 5 张来一张横跨两列的大图，避免整页一样大的方块 */
@media (min-width: 720px) {
  .album-grid .album-card:nth-child(5n + 1) { grid-column: span 2; }
  .album-grid .album-card:nth-child(5n + 1) .album-cover { height: 240px; }
}

.album-body { padding: 12px 16px 15px; }
.album-body h3 { margin: 0 0 4px; font-size: 15px; }
.album-body p { margin: 0; font-size: 12.5px; color: var(--muted); }
.album-body time { display: block; margin-top: 7px; font-size: 11.5px; color: var(--muted); font-family: var(--mono); }

/* 相册大图预览 */
.lightbox {
  position: fixed;
  inset: 0;
  /* 必须盖住顶部导航（导航 z-index 700）与回到顶部按钮，否则关闭按钮会被挡住 */
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
  background: rgba(10, 24, 38, .8);
  backdrop-filter: blur(6px);
  animation: lbFade .2s ease both;
}

.lightbox[hidden] { display: none; }
body.lb-open { overflow: hidden; }

@keyframes lbFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.lb-stage {
  position: relative;
  max-width: min(1080px, 100%);
  margin: 0;
  text-align: center;
  animation: lbZoom .26s cubic-bezier(.2, .8, .3, 1) both;
}

@keyframes lbZoom {
  from { opacity: 0; transform: scale(.94); }
  to   { opacity: 1; transform: none; }
}

.lb-stage img {
  max-width: 100%;
  max-height: 74vh;
  border-radius: var(--r-lg);
  background: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .45);
  transition: opacity var(--t-base) ease, transform var(--t-base) ease;
}

.lb-stage img.is-swap { opacity: .3; transform: scale(.99); }

.lb-loading {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 7px 16px;
  border-radius: var(--r-pill);
  background: rgba(0, 0, 0, .45);
  color: #fff;
  font-size: 13px;
}

.lb-loading[hidden] { display: none; }

.lb-cap {
  margin-top: 14px;
  color: #fff;
  text-align: center;
}

.lb-cap b { display: block; font-size: 15.5px; font-weight: 600; }
.lb-cap p { margin: 6px auto 0; max-width: 640px; font-size: 13px; line-height: 1.7; color: rgba(255, 255, 255, .78); }
.lb-cap p[hidden] { display: none; }

.lb-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 8px;
  font-size: 12px;
  color: rgba(255, 255, 255, .7);
  font-family: var(--mono);
}

.lb-count {
  padding: 1px 9px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .16);
}

.lb-btn {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: background var(--t-base), transform var(--t-base), border-color var(--t-base);
}

.lb-btn:hover { background: rgba(255, 255, 255, .28); border-color: rgba(255, 255, 255, .5); }
.lb-prev { left: 18px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 18px; top: 50%; transform: translateY(-50%); }
.lb-prev:hover { transform: translateY(-50%) scale(1.06); }
.lb-next:hover { transform: translateY(-50%) scale(1.06); }
.lb-close { right: 18px; top: 18px; width: 38px; height: 38px; font-size: 13px; }

@media (max-width: 640px) {
  .lightbox { padding: 14px 12px 78px; align-items: center; }
  .lb-btn { width: 40px; height: 40px; }
  .lb-prev { left: 12px; }
  .lb-next { right: 12px; }
  .lb-close { right: 10px; top: 10px; }
  .lb-stage img { max-height: 62vh; }
  .lb-cap b { font-size: 14.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .album-card, .lb-stage { animation: none; }
}

/* ---------------- 友链 ---------------- */
.link-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.link-card {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 15px 17px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: .18s;
}
.link-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: #c4e6f7; }
.link-avatar {
  width: 46px; height: 46px; flex: 0 0 46px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-3);
  border: 2px solid #fff;
  box-shadow: var(--shadow);
}
.link-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.link-info { min-width: 0; }
.link-info b { display: block; font-size: 14.5px; }
.link-info span { display: block; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------- 日志 ---------------- */
.log-list { display: flex; flex-direction: column; gap: 14px; }
.log-item {
  position: relative;
  padding: 18px 20px 18px 22px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.log-item::before {
  content: "";
  position: absolute;
  left: 0; top: 18px; bottom: 18px;
  width: 4px;
  border-radius: 0 var(--r-xs) var(--r-xs) 0;
  background: linear-gradient(180deg, var(--accent), #a9e2f7);
}
.log-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.log-head h3 { margin: 0; font-size: 15.5px; }
.log-date { font-size: 12.5px; color: var(--muted); font-family: var(--mono); }
.log-content { color: var(--text-dim); font-size: 14px; }
.log-content p { margin: 0 0 8px; }
.log-content p:last-child { margin-bottom: 0; }

/* 前台日志只给一句话概括，细节收进「展开详情」——默认列表更短、更好扫 */
.log-brief {
  margin: 0;
  color: var(--text-dim);
  font-size: 13.5px;
  line-height: 1.75;
}

.log-more { margin-top: 10px; }

.log-more > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.log-more > summary::-webkit-details-marker { display: none; }
.log-more > summary::before { content: "▾"; font-size: 11.5px; }

.log-more > summary:hover {
  color: var(--accent-deep);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.log-more[open] > summary::before { content: "▴"; }

.log-more .lm-close { display: none; }
.log-more[open] .lm-open { display: none; }
.log-more[open] .lm-close { display: inline; }

.log-more .log-content {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  font-size: 13.5px;
}

/* ---------------- 统计 ---------------- */

/* ---------------- 赞赏支持页 ---------------- */

/* ---------------- 道历（道教月历） ---------------- */
.daoli-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  align-items: start;
}

.daoli-cal {
  padding: 18px 20px 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.dc-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.dc-title { font-size: 17px; color: var(--text); }
.dc-nav, .dc-today {
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  font-size: 12.5px;
  color: var(--text-dim);
}

.dc-nav:hover, .dc-today:hover {
  border-color: var(--accent);
  color: var(--accent-deep);
  background: var(--accent-soft);
}

.dc-today { margin-left: auto; }

.dc-week,
.dc-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.dc-week span {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  padding-bottom: 4px;
}

.dc-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 66px;
  padding: 6px 2px 5px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  color: var(--text-dim);
  transition: border-color var(--t-base), transform var(--t-base), background var(--t-base);
}

.dc-cell.is-empty { background: transparent; border-color: transparent; }

a.dc-cell:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.dc-d { font-size: 15px; font-weight: 600; font-family: var(--mono); color: var(--text); }
.dc-l { font-size: 11.5px; color: var(--muted); }

.dc-cell.has-term .dc-l { color: var(--accent-deep); font-weight: 600; }
.dc-cell.is-wu { border-color: var(--pink-soft); }

.dc-cell.is-today {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent-soft);
}

.dc-cell.is-today .dc-d { color: var(--accent-deep); }

.dc-cell.is-sel {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: var(--shadow);
}

.dc-tag {
  font-size: 11.5px;
  font-style: normal;
  line-height: 1.5;
  padding: 0 5px;
  border-radius: var(--r-pill);
  white-space: nowrap;
}

.dc-tag.is-term { background: var(--accent-soft); color: var(--accent-deep); }
.dc-tag.is-fest { background: var(--accent-2-soft); color: #a3771a; }
.dc-tag.is-wu   { background: var(--pink-soft); color: #d1628c; }

.dc-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 14px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.dc-legend .lg { display: inline-flex; align-items: center; gap: 6px; }

.lg-dot {
  width: 10px; height: 10px;
  border-radius: var(--r-xs);
  border: 1px solid var(--border);
  background: var(--panel-2);
}

.lg-dot.is-term { background: var(--accent-soft); border-color: var(--accent); }
.lg-dot.is-fest { background: var(--accent-2-soft); border-color: #e8c169; }
.lg-dot.is-wu   { background: var(--pink-soft); border-color: var(--pink); }
.lg-dot.is-today { background: var(--accent); border-color: var(--accent); }

.daoli-side { display: flex; flex-direction: column; gap: 16px; }
.daoli-side .side-card { padding: 18px 20px; }

.dl-kv {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--border-soft);
  font-size: 13.5px;
}

.dl-kv:last-of-type { border-bottom: none; }
.dl-kv span { color: var(--muted); flex: 0 0 auto; }
.dl-kv b { color: var(--text); text-align: right; }

.dl-actions { display: flex; gap: 8px; margin-top: 14px; }

@media (max-width: 1000px) {
  .daoli-wrap { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .dc-cell { min-height: 58px; }
  .dc-tag { font-size: 11.5px; padding: 0 3px; }
  .dc-l { font-size: 11.5px; }
  .dc-head { flex-wrap: wrap; }
  .dc-today { margin-left: 0; }
}
.support-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(232px, 1fr));
  gap: 18px;
  margin: 4px 0 20px;
}

.support-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 18px 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.support-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: var(--shadow-lg);
}

.sc-pic {
  position: relative;
  width: 100%;
  max-width: 232px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: #fff;
  border: 1px solid var(--border-soft);
}

.sc-pic img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--r-sm);
}

.sc-name { font-size: 15px; color: var(--text); }
.sc-note { font-size: 12.5px; color: var(--muted); }

.support-mobile-hint {
  margin: 0 0 18px;
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
}

.support-tips {
  padding: 20px 22px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.support-tips-title {
  margin: 0 0 12px;
  font-size: 16px;
  color: var(--text);
}

.support-tips .about-list { margin: 0; padding-left: 20px; }
.support-tips .about-list li { margin-bottom: 7px; font-size: 13.5px; color: var(--text-dim); line-height: 1.8; }
.support-tips .about-list li:last-child { margin-bottom: 0; }

.support-foot {
  margin-top: 18px;
  font-size: 13.5px;
  color: var(--text-dim);
  line-height: 1.9;
}

.support-foot p { margin: 0; }
.support-foot-dim { margin-top: 6px !important; font-size: 12.5px; color: var(--muted); }

@media (max-width: 640px) {
  .support-grid { grid-template-columns: 1fr; gap: 14px; }
  .sc-pic { max-width: 100%; }
}
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
  box-shadow: var(--shadow);
}
.stat-box b { display: block; font-size: 24px; font-family: var(--mono); color: var(--accent-deep); }
.stat-box span { font-size: 12.5px; color: var(--muted); }

.bar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; font-size: 13.5px; }
.bar-label { flex: 0 0 108px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { flex: 1; height: 9px; border-radius: var(--r-pill); background: var(--bg-3); overflow: hidden; }
.bar-fill { height: 100%; border-radius: var(--r-pill); background: linear-gradient(90deg, #7fd6f2, var(--accent)); }
.bar-value { flex: 0 0 54px; text-align: right; color: var(--muted); font-size: 12.5px; font-family: var(--mono); }

/* 宽度按内容走（min-width 顶满容器），超出时由 .table-wrap 横向滚动，
   这样短列（状态、类型）不会被压成竖排文字；长内容列仍按自身的 max-width 换行 */
table.data { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }

table.data th,
table.data td {
  padding: 12px 13px;
  text-align: left;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
}

table.data th {
  background: var(--panel-2);
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: .3px;
  border-bottom: 1px solid var(--border);
}

table.data tbody tr { transition: background .14s; }
table.data tbody tr:nth-child(even) td { background: var(--panel-2); }
table.data tbody tr:hover td { background: var(--accent-soft); }
table.data tbody tr:last-child td { border-bottom: 0; }

/* 表格里的按钮：保持一行、间距均匀，但不让操作列把别的列挤扁 */
table.data .actions { white-space: nowrap; }
table.data .actions form { margin: 0; display: inline; }
table.data .actions .btn { margin: 2px 4px 2px 0; vertical-align: middle; }

/* 表格里的行内按钮再紧凑些，四五个按钮也能排下 */
table.data .btn.mini,
table.data .btn-sm.mini { padding: 4px 10px; font-size: 12px; margin-right: 3px; }
table.data td:last-child,
table.data th:last-child { padding-right: 16px; }

/* ---------------- Demo ---------------- */
.demo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.demo-card { display: flex; flex-direction: column; gap: 10px; padding: 0; overflow: hidden; }
.demo-cover { height: 132px; overflow: hidden; background: var(--bg-3); }
.demo-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.demo-body { padding: 4px 18px 18px; display: flex; flex-direction: column; gap: 10px; }
.demo-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.demo-name { font-size: 16px; font-weight: 700; margin: 0; }
.demo-desc { color: var(--text-dim); font-size: 13.5px; margin: 0; flex: 1; }
.demo-actions { display: flex; gap: 10px; margin-top: 4px; flex-wrap: wrap; }

.modal {
  position: fixed; inset: 0; z-index: 200;
  display: none;
  align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(30, 55, 75, .6);
  backdrop-filter: blur(4px);
}
.modal.is-open { display: flex; }
.modal-box {
  width: min(760px, 100%);
  max-height: 82vh;
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow-lg);
}
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.modal-head h3 { margin: 0; font-size: 16.5px; }

/* ---------------- 工具页 ---------------- */
.tool-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 18px; }
.tool-tab {
  font-size: 13.5px;
  padding: 8px 16px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text-dim);
  cursor: pointer;
  font-family: inherit;
  transition: .18s;
}
.tool-tab:hover { border-color: var(--accent); color: var(--accent-deep); }
.tool-tab.is-active { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: var(--shadow); }

.tool-panel { display: none; }
.tool-panel.is-active { display: block; animation: fadeUp .26s ease; }

.tool-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow);
}
.tool-card h2 { margin: 0 0 6px; font-size: 17px; }
.tool-card .tip { color: var(--muted); font-size: 13px; margin: 0 0 18px; }
.tool-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tool-row > div { display: flex; flex-direction: column; gap: 8px; }
.tool-row label { font-size: 13px; color: var(--muted); }
.tool-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; align-items: center; }
.mono-out {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 13px 15px;
  min-height: 46px;
  word-break: break-all;
  white-space: pre-wrap;
  color: var(--text-dim);
}
.stat-chips { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.stat-chip {
  font-size: 13px;
  padding: 8px 15px;
  border-radius: var(--r-pill);
  background: var(--panel-2);
  border: 1px solid var(--border);
}
.stat-chip b { color: var(--accent-deep); font-family: var(--mono); }

#qrCanvas { background: #fff; border-radius: var(--r-md); padding: 12px; display: block; border: 1px solid var(--border); }

/* ---------------- 登录页 ---------------- */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 40px 20px; }

/* 账号页嵌在站点布局里时的容器（注册/登录/验证/找回密码） */
.auth-embed { display: flex; justify-content: center; padding: 26px 0 14px; }
.auth-embed .auth-card { width: min(452px, 100%); }
.auth-title { font-size: 20px; margin: 0 0 6px; }
.field-hint { font-size: 12px; color: var(--muted); margin-top: 5px; }

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  color: var(--text-dim);
  margin: 4px 0 18px;
  cursor: pointer;
  line-height: 1.6;
}
.checkbox-row input { margin-top: 3px; accent-color: var(--accent); }
.checkbox-row em { font-style: normal; color: var(--muted); font-size: 12px; }

.link-row { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 10px; }
.link-row a { color: var(--accent-deep); font-size: 13.5px; }
.link-row a:hover { text-decoration: underline; }

/* 顶部提示条：3 秒自动消失 */
.toast-wrap {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
  width: max-content;
  max-width: calc(100% - 32px);
}
.toast {
  padding: 10px 20px;
  border-radius: var(--r-pill);
  font-size: 13.5px;
  box-shadow: var(--shadow-lg);
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
  animation: toastIn .26s ease;
  transition: opacity var(--t-slow), transform var(--t-slow);
}
.toast.is-ok { background: #eefaf3; border-color: #b8ecd7; color: #2f9d74; }
.toast.is-err { background: #fff1f1; border-color: #ffcdcd; color: #d15555; }
.toast.is-out { opacity: 0; transform: translateY(-8px); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: none; }
}
.auth-card {
  width: min(430px, 100%);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 34px 32px 26px;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
}
.auth-brand { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.auth-brand img { width: 40px; height: 40px; border-radius: 50%; border: 2px solid #fff; box-shadow: var(--shadow); }
.auth-sub { color: var(--muted); font-size: 13px; margin: 0 0 24px; }
.auth-field { margin-bottom: 16px; }
.auth-field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 7px; }
.auth-field .input { padding: 12px 16px; font-size: 15px; }
.code-row { display: flex; gap: 10px; }
.code-row .input { flex: 1; letter-spacing: 6px; font-family: var(--mono); font-size: 18px; text-align: center; }
.code-row .btn { white-space: nowrap; min-width: 116px; }
.auth-actions { margin-top: 22px; }
.auth-actions .btn { padding: 12px; font-size: 15.5px; }
.auth-msg { margin-top: 14px; font-size: 13px; min-height: 20px; }
.auth-msg.ok { color: var(--green); }
.auth-msg.err { color: var(--danger); }

/* 提交状态行：常驻显示，避免「点了没反应」的错觉 */
.form-status {
  margin-top: 12px;
  font-size: 13.5px;
  text-align: center;
  min-height: 20px;
  color: var(--muted);
}
.form-status.is-ing { color: var(--accent-deep); }
.form-status.is-ok { color: #2f9d74; }
.form-status.is-err { color: #d15555; }
.form-status:not(:empty) {
  padding: 9px 14px;
  border-radius: var(--r-sm);
  background: var(--panel-2);
  border: 1px dashed var(--border);
}
.auth-foot { margin-top: 22px; padding-top: 16px; border-top: 1px dashed var(--border); font-size: 12.5px; color: var(--muted); line-height: 1.85; }

/* ---------------- 页脚 ---------------- */
.site-footer {
  margin-top: 36px;
  padding: 26px 0 34px;
  background: var(--panel);
  border-top: 1px solid var(--border);
}
.footer-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: 12px;
  padding-bottom: 22px;
  border-bottom: 1px dashed var(--border);
}
.stat { text-align: center; }
.stat-num { display: block; font-size: 19px; font-weight: 700; color: var(--accent-deep); font-family: var(--mono); }
.stat-label { font-size: 12px; color: var(--muted); }
.footer-bottom { padding-top: 18px; display: flex; flex-direction: column; gap: 6px; }
.footer-copy, .footer-icp, .footer-tech { margin: 0; font-size: 13px; color: var(--muted); }
.dot-sep { margin: 0 7px; opacity: .5; }
.footer-tech { font-size: 12px; opacity: .85; }

/* 页脚信息区：备案 → 版权 → 标语 → 运行时长 → 徽章条 → 站内链接（参考 chortle 那种排法） */
.footer-bottom { gap: 8px; }

.footer-police {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: .2px;
}

.footer-police a { color: var(--muted); }
.footer-police a:hover { color: var(--accent-deep); }

.footer-copy { font-size: 13.5px; }
.footer-icp-inline { color: var(--muted); }

.footer-slogan {
  margin: 0;
  font-size: 13px;
  font-style: italic;
  color: var(--muted);
  opacity: .9;
}

.footer-runtime {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}

.footer-runtime b {
  color: var(--accent-deep);
  font-family: var(--mono);
  font-size: 13px;
  padding: 0 1px;
}

/* 徽章条：一个挨一个的小胶囊 */
.footer-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 4px;
}

.fb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--bg-2);
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.6;
  text-decoration: none;
  transition: border-color var(--t-base), color var(--t-base), transform var(--t-base), background var(--t-base);
}

a.fb:hover {
  border-color: var(--accent);
  color: var(--accent-deep);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.fb-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  font-size: 12.5px;
  line-height: 1;
  opacity: .95;
}

/* 徽章图标用的是各站点真实 favicon（assets/img/badges/） */
.fb-ico img {
  display: block;
  width: 16px;
  height: 16px;
  object-fit: contain;
  border-radius: var(--r-xs);
}

.footer-links { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.footer-links a { color: var(--text-dim); }
.footer-links a:hover { color: var(--accent-deep); }

@media (max-width: 640px) {
  .footer-badges { gap: 6px; }
  .fb { padding: 4px 9px; font-size: 11.5px; }
  .footer-copy, .footer-links { font-size: 12.5px; }
}

.to-top {
  position: fixed;
  right: 22px; bottom: 22px;
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text-dim);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: var(--t-base);
  z-index: 60;
  box-shadow: var(--shadow);
}
.to-top.is-show { opacity: 1; pointer-events: auto; }
.to-top:hover { color: var(--accent); border-color: var(--accent); }

.empty { text-align: center; padding: 48px 20px; color: var(--muted); font-size: 14px; background: var(--panel); border: 1px dashed var(--border); border-radius: var(--radius); }
.empty .emoji { font-size: 32px; display: block; margin-bottom: 10px; opacity: .8; }

/* 入场动画（仅在启用 JS 时隐藏内容） */
html.js .reveal { opacity: 0; transform: translateY(14px); transition: var(--t-slower) ease; }
html.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------------- 后台 ---------------- */
.admin-body { background: var(--bg-2); }
.admin-layout { display: flex; min-height: 100vh; }
.admin-side {
  width: 236px;
  flex: 0 0 236px;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border-right: 1px solid var(--border);
  padding: 18px 14px 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  scrollbar-width: thin;
}

/* 侧栏顶部：头像 + 站点名 + 版本 */
.admin-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 8px 16px;
  border-bottom: 1px dashed var(--border);
  margin-bottom: 8px;
}

.admin-brand img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex: 0 0 36px;
}

.ab-text { min-width: 0; }
.ab-text b { display: block; font-size: 14.5px; letter-spacing: .3px; }
.ab-text span { font-size: 11.5px; color: var(--muted); }

.admin-nav { display: flex; flex-direction: column; gap: 2px; }

.admin-nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  color: var(--text-dim);
  transition: background var(--t-base), color var(--t-base), transform var(--t-base);
}

.admin-nav a .ni {
  width: 20px;
  flex: 0 0 20px;
  text-align: center;
  font-style: normal;
  font-size: 14px;
  opacity: .85;
}

.admin-nav a:hover {
  background: var(--accent-soft);
  color: var(--accent-deep);
  transform: translateX(2px);
}

.admin-nav a.is-active {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
}

.admin-nav a.is-active .ni { opacity: 1; }

.admin-nav a.is-active::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 var(--r-xs) var(--r-xs) 0;
  background: var(--accent);
}

/* 分组：标题可点击折叠，菜单 35 项也能一屏看全 */
.admin-nav .nav-sec { display: flex; flex-direction: column; gap: 2px; }

.admin-nav .nav-sec-body {
  display: none;
  flex-direction: column;
  gap: 2px;
}

.admin-nav .nav-sec.is-open > .nav-sec-body { display: flex; }

.admin-nav .nav-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 16px 12px 6px;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 1px;
  text-align: left;
  cursor: pointer;
}

.admin-nav .nav-group:hover { color: var(--accent-deep); }

.ng-caret {
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid currentColor;
  opacity: .6;
  transition: transform .18s ease;
}

.admin-nav .nav-sec.is-open .ng-caret { transform: rotate(180deg); }

/* 筛选菜单时把命中的分组临时展开（见 admin.js 的 initNavFilter） */
.admin-nav .nav-sec.is-forced > .nav-sec-body { display: flex; }

/* 侧栏底部：当前管理员 */
.admin-user {
  margin-top: auto;
  padding: 14px 10px 4px;
  border-top: 1px solid var(--border-soft);
}

.au-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }

.au-avatar {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.au-text { min-width: 0; }
.au-text b { display: block; font-size: 13px; }
.au-text span { font-size: 11.5px; color: var(--muted); }
.au-actions { display: flex; gap: 8px; }
.au-actions .btn { flex: 1 1 0; text-align: center; }

.admin-mask { display: none; }
.admin-burger { display: none; }

/* ==========================================================================
   后台详情弹窗 + 长文本折叠
   ========================================================================== */

/* 单行截断 + 「查看」链接，用在表格里放不下的长内容上 */
.text-clip {
  display: block;
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-more {
  display: inline-block;
  margin-top: 5px;
  padding: 1px 9px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  font-size: 11.5px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color var(--t-base), color var(--t-base);
}

.cell-more:hover { border-color: var(--accent); color: var(--accent-deep); }

.np-modal-src { display: none; }

.np-modal {
  position: fixed;
  inset: 0;
  z-index: 700;
  display: grid;
  place-items: center;
  padding: 26px 18px;
}

.np-modal[hidden] { display: none; }

.np-modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(5, 16, 28, .58);
  backdrop-filter: blur(3px);
  animation: modalFade .18s ease both;
}

.np-modal-panel {
  position: relative;
  width: min(680px, 100%);
  max-height: 84vh;
  display: flex;
  flex-direction: column;
  border-radius: var(--r-lg);
  background: var(--bg);
  border: 1px solid var(--border);
  box-shadow: 0 26px 60px rgba(0, 0, 0, .32);
  overflow: hidden;
  animation: modalIn .22s cubic-bezier(.16, 1, .3, 1) both;
}

@keyframes modalFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px) scale(.985); }
  to   { opacity: 1; transform: none; }
}

.np-modal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}

.np-modal-head b { flex: 1 1 auto; font-size: 15px; }

.np-modal-x {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
  transition: border-color var(--t-base), color var(--t-base);
}

.np-modal-x:hover { border-color: var(--danger); color: var(--danger); }

.np-modal-body {
  padding: 18px 20px 22px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.85;
  color: var(--text-dim);
  background: var(--panel);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.np-modal-body .mrow {
  display: flex;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--border-soft);
}

.np-modal-body .mrow:last-child { border-bottom: 0; }
.np-modal-body .mrow span { flex: 0 0 88px; color: var(--muted); font-size: 12.5px; }
.np-modal-body .mrow b { font-weight: 600; color: var(--text); }
.np-modal-body .mblock {
  margin-top: 6px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--panel-2);
  border: 1px solid var(--border-soft);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--text);
}
.np-modal-body .mactions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }

.admin-main {
  flex: 1;
  min-width: 0;
  padding: 24px 28px 64px;
  /* 只做位移不做淡入：整页级别的 opacity 动画一旦没走完，后台会整片发灰（低配/奇怪的渲染环境下踩过），
     淡入交给下面 .admin-main > * 的分层动效和组件自己的动画去做 */
  animation: adminIn .35s ease both;
}

@keyframes adminIn {
  from { transform: translateY(6px); }
  to   { transform: none; }
}

.admin-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.admin-top h1 {
  font-size: 21px;
  margin: 0;
  padding-left: 12px;
  position: relative;
}

.admin-top h1::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 4px;
  border-radius: var(--r-xs);
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
}

.admin-top p { margin: 5px 0 0 12px; color: var(--muted); font-size: 13px; }

.at-meta { display: flex; align-items: center; gap: 10px; }

.at-chip {
  padding: 6px 13px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text-dim);
  font-size: 12.5px;
  transition: border-color var(--t-base), color var(--t-base), transform var(--t-base);
}

.at-chip:hover { border-color: var(--accent); color: var(--accent-deep); transform: translateY(-1px); }

.at-time {
  font-size: 12.5px;
  color: var(--muted);
  font-family: var(--mono);
}

.admin-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(164px, 1fr)); gap: 14px; margin-bottom: 22px; }
.admin-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.admin-card b { display: block; font-size: 22px; font-family: var(--mono); color: var(--accent-deep); margin-bottom: 2px; }
.admin-card span { font-size: 12.5px; color: var(--muted); }

.admin-panel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px 24px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  transition: border-color var(--t-base), box-shadow var(--t-base);
}

.admin-panel:hover { border-color: var(--accent-soft); box-shadow: var(--shadow-lg); }

.admin-panel h2 {
  font-size: 16.5px;
  margin: 0 0 16px;
  padding-left: 11px;
  position: relative;
}

.admin-panel h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  bottom: 5px;
  width: 3px;
  border-radius: var(--r-xs);
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
}

.admin-panel > h2 ~ .section-sub { margin-top: -8px; }

.table-wrap {
  overflow-x: auto;
  border-radius: var(--r-md);
  scrollbar-width: thin;
}
table.data td.actions { white-space: nowrap; }
table.data .mini { font-size: 12.5px; padding: 4px 11px; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.form-item { display: flex; flex-direction: column; gap: 8px; }
.form-item label { font-size: 13px; font-weight: 600; color: var(--text-dim); }
.form-item .hint { font-size: 12px; color: var(--muted); }
.form-item.full { grid-column: 1 / -1; }

.form-item .input:focus,
.form-item .select:focus,
.form-item .textarea:focus { border-color: var(--accent); box-shadow: var(--ring); outline: 0; }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 40px 20px; }
.login-box {
  width: min(400px, 100%);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 32px 30px;
  box-shadow: var(--shadow-lg);
}
.login-box h1 { font-size: 19px; margin: 0 0 6px; }
.login-box .sub { color: var(--muted); font-size: 13px; margin: 0 0 22px; }

.alert {
  position: relative;
  padding: 12px 18px 12px 40px;
  border-radius: var(--r-md);
  font-size: 13.5px;
  margin-bottom: 16px;
  border-left-width: 3px;
  animation: adminIn .3s ease both;
}

.alert::before {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
}

.alert-error { background: rgba(255, 123, 123, .12); color: #d15555; border: 1px solid #ffcdcd; border-left: 3px solid #d15555; }
.alert-error::before { content: "⚠"; }
.alert-success { background: rgba(76, 199, 154, .14); color: #2f9d74; border: 1px solid #b8ecd7; border-left: 3px solid #2f9d74; }
.alert-success::before { content: "✓"; }
.alert-info { background: var(--accent-soft); color: var(--accent-deep); border: 1px solid #bfe6f7; border-left: 3px solid var(--accent); }
.alert-info::before { content: "i"; font-family: Georgia, serif; font-weight: 700; }
.alert-warn { background: rgba(217, 147, 15, .12); color: #a8710a; border: 1px solid #f2ddb0; border-left: 3px solid #d9930f; }
.alert-warn::before { content: "!"; font-weight: 700; }

/* 后台的空状态也更精致一点 */
.admin-main .empty {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border-radius: var(--r-md);
  padding: 42px 20px;
}

/* 后台滚动条 */
.admin-side::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar { width: 8px; height: 8px; }
.admin-side::-webkit-scrollbar-thumb,
.table-wrap::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--r-sm);
}
.admin-side::-webkit-scrollbar-track,
.table-wrap::-webkit-scrollbar-track { background: transparent; }

/* ---------------- 关于页 ---------------- */
.about-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(258px, 1fr)); gap: 16px; }
.about-list { margin: 0; padding-left: 20px; color: var(--text-dim); font-size: 14px; }
.about-list li { margin-bottom: 7px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--border-soft); font-size: 14px; }
.kv:last-child { border-bottom: none; }
.kv span { color: var(--muted); font-size: 13px; }
.kv b { font-weight: 600; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1000px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .side-order { order: 2; }
  .post-card, .post-card:nth-child(even) { flex-direction: row; }
}

/* ---------- 小屏顶栏：次要图标收进 ☰ 面板，顶栏保持单行 ---------- */
@media (max-width: 620px) {
  .header-inner { gap: 10px; }
  .header-actions { gap: 6px; }
  .header-actions .icon-btn { width: 30px; height: 30px; font-size: 14px; }
  .brand img { width: 28px; height: 28px; }
  .brand-name { font-size: 15px; }
  .header-actions .btn-sm { padding: 6px 10px; font-size: 12px; }

  /* 无 JS 时的兜底：这几个图标先隐藏，由 main.js 搬进 ☰ 面板
     （搬走后就不再匹配 .header-actions，会自动恢复显示） */
  .header-actions [data-nav-extra] { display: none; }

  .nav-extras {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    /* 放到导航列表最前面，不用滚到面板底部才能点到 */
    order: -1;
    margin: 0 0 8px;
    padding: 0 0 10px;
    border-top: 0;
    border-bottom: 1px dashed var(--border);
  }
  .nav-extras .ne-label { flex: 0 0 100%; font-size: 12px; color: var(--muted); }
  .nav-extras .icon-btn { width: 38px; height: 38px; font-size: 16px; }
  .nav-extras .btn { width: 100%; justify-content: center; }
}

/* 超小屏：只留站点头像，避免顶栏被撑到第二行 */
@media (max-width: 370px) {
  .brand-name { display: none; }
}

@media (max-width: 900px) {
  .nav-toggle { display: grid; }
  .main-nav {
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 2px;
    padding: 12px 16px 18px;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    overscroll-behavior: contain;
    display: none;
  }
  .main-nav.is-open { display: flex; }
  .nav-link { padding: 10px 14px; border-radius: var(--r-sm); }

  /* 抽屉里：分组标题占一行，子项缩进成竖列表；浮层的边框阴影都去掉 */
  .nav-group { display: block; position: static; }
  .nav-parent { width: 100%; justify-content: space-between; text-align: left; }
  .nav-drop {
    position: static;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    margin: 0 0 4px;
    padding: 0 0 2px 12px;
    border: 0;
    background: transparent;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: none;
  }
  .nav-drop::before { display: none; }
  .nd-item { padding: 9px 14px; border-radius: var(--r-sm); font-size: 14px; }

  /* 有 JS 时把分组折起来，点一级标题展开（没 JS 就全部展开，照样能用） */
  .main-nav.is-accordion .nav-group .nav-drop { display: none; }
  .main-nav.is-accordion .nav-group.is-open .nav-drop { display: flex; }
  .main-nav.is-accordion .nav-group.is-active > .nav-parent { background: var(--accent-soft); color: var(--accent-deep); font-weight: 600; }

  /* 首页横幅页的顶栏是透明白字，但 ☰ 展开的面板是白底
     —— 面板里的文字/图标必须换回深色，否则白底白字看不见 */
  body.has-hero .site-header .main-nav { background: var(--panel); }
  body.has-hero .site-header:not(.is-solid) .main-nav .nav-link { color: var(--text-dim); }
  body.has-hero .site-header:not(.is-solid) .main-nav .nav-link:hover { background: var(--accent-soft); color: var(--accent-deep); }
  body.has-hero .site-header:not(.is-solid) .main-nav .nav-link.is-active { background: var(--accent); color: #fff; box-shadow: none; }
  body.has-hero .site-header:not(.is-solid) .main-nav .icon-btn {
    color: var(--text-dim);
    border-color: var(--border);
    background: var(--panel);
  }
  body.has-hero .site-header:not(.is-solid) .main-nav .btn-ghost {
    color: var(--text-dim);
    border-color: var(--border);
  }
  body.has-hero .site-header:not(.is-solid) .main-nav .ne-label { color: var(--muted); }

  .user-name { display: none; }
  .tool-row { grid-template-columns: 1fr; }

  /* 后台：侧栏变抽屉，顶栏出现汉堡按钮 */
  .admin-burger {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: var(--r-md);
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--text-dim);
    font-size: 16px;
    cursor: pointer;
  }
  .admin-burger:hover { border-color: var(--accent); color: var(--accent-deep); }

  .admin-top { align-items: flex-start; }
  .admin-top .at-text { flex: 1 1 auto; }
  .admin-top h1 { font-size: 18px; }
  .at-meta { width: 100%; justify-content: space-between; }

  .admin-side {
    position: fixed;
    z-index: 60;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100vh;
    width: 250px;
    flex: none;
    transform: translateX(-100%);
    transition: transform var(--t-slow) cubic-bezier(.4, 0, .2, 1);
    box-shadow: 0 18px 50px rgba(0, 0, 0, .28);
  }
  .admin-side.is-open { transform: none; }
  .admin-nav { flex-direction: column; }
  .admin-nav a { padding: 10px 12px; }
  .admin-nav a.is-active::before { display: none; }
  .admin-user { margin-top: 18px; }

  .admin-mask {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(6, 20, 34, .5);
    backdrop-filter: blur(2px);
  }
  .admin-mask[hidden] { display: none; }

  .admin-main { padding: 18px 16px 56px; }
  .admin-panel { padding: 18px 16px; border-radius: var(--r-md); }
  .form-grid { gap: 14px; }
  table.data .actions { flex-wrap: wrap; }
}

/* 后台用浅色主题时也保持同样的层次 */
[data-theme="light"] .admin-side { background: linear-gradient(180deg, #ffffff, #f6fbff); }
[data-theme="light"] .admin-brand img { border-color: #e6f4fd; }

@media (max-width: 640px) {
  .post-card, .post-card:nth-child(even) { flex-direction: column; }
  .post-cover { flex: none; width: 100%; height: 168px; }
  .card-grid, .demo-grid, .album-grid, .link-grid { grid-template-columns: 1fr; }
  .list-item { flex-direction: column; gap: 10px; }
  .list-item .li-side { flex-direction: row; text-align: left; gap: 14px; }
  .prev-next { grid-template-columns: 1fr; }
  .admin-main { padding: 18px 16px 50px; }
  .footer-stats { grid-template-columns: repeat(3, 1fr); }
  .article-card { padding: 20px 18px; }
  .archive-btn { flex: 1 1 40%; }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* ==========================================================================
   阅读体验增强：顶部阅读进度条 / 文章目录 / 目录高亮
   ========================================================================== */

/* ---------------- 订阅页：可视化分类选择 ---------------- */
.topic-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.topic-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
  transition: .18s;
  user-select: none;
}

.topic-chip:hover {
  border-color: var(--accent);
  color: var(--accent-deep);
  transform: translateY(-1px);
}

.topic-chip input {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  margin: 0;
  border: 1.5px solid var(--border);
  border-radius: var(--r-xs);
  background: #fff;
  position: relative;
  cursor: pointer;
  transition: var(--t-base);
}

.topic-chip input:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.topic-chip input:checked::after {
  content: "✓";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -54%);
  color: #fff;
  font-size: 11.5px;
  line-height: 1;
}

.topic-chip.is-on {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-weight: 600;
}

/* 文章页 / 侧边栏的订阅按钮 */
.subscribe-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ---------------- 通知铃铛（导航栏） ---------------- */
.notify-bell {
  position: relative;
  font-size: 15px;
  text-decoration: none;
}

.notify-dot {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: var(--r-pill);
  background: var(--danger);
  color: #fff;
  font-size: 11.5px;
  line-height: 17px;
  text-align: center;
  font-family: var(--mono);
  box-shadow: 0 0 0 2px var(--bg);
}

.user-menu a.user-name:hover,
.user-menu a.user-avatar:hover { color: var(--accent-deep); }

/* ==========================================================================
   留言板：弹幕墙 + 留言区
   ========================================================================== */

.barrage-hero {
  position: relative;
  height: 460px;
  overflow: hidden;
  border-radius: var(--r-2xl);
  margin: 18px 0 24px;
  background: var(--bg-3);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.02);
  z-index: 0;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(12, 26, 42, .45), rgba(12, 26, 42, .68));
}

.hero-title {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  color: rgba(255, 255, 255, .92);
  font-size: 18px;
  letter-spacing: 6px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .5);
  pointer-events: none;
  white-space: nowrap;
}

.hero-count {
  font-size: 13px;
  letter-spacing: 0;
  color: rgba(255, 255, 255, .75);
  margin-left: 8px;
}

.barrage-layer {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

/* 单条弹幕 */
.barrage-chip {
  position: absolute;
  left: 110%;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 13px 5px 5px;
  background: rgba(0, 0, 0, .38);
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: var(--r-xl);
  font-size: 13px;
  color: #fff;
  white-space: nowrap;
  backdrop-filter: blur(3px);
  animation-name: barrageFloat;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  animation-fill-mode: both;
  will-change: transform, left;
}

.bc-avatar {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: 1.5px solid rgba(255, 255, 255, .5);
  font-size: 11.5px;
  font-weight: 700;
}

.bc-name { font-size: 12px; font-weight: 600; opacity: .95; }
.bc-text {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

@keyframes barrageFloat {
  0%   { left: 110%; opacity: 0; }
  8%   { opacity: 1; }
  92%  { opacity: 1; }
  100% { left: -30%; opacity: 0; }
}

.hero-input-area {
  position: absolute;
  bottom: 34px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  width: min(320px, 82%);
}

.hero-input-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 3px 3px 16px;
  border: 1px solid rgba(255, 255, 255, .42);
  border-radius: var(--r-xl);
  background: rgba(0, 0, 0, .22);
  transition: border-color var(--t-base), background var(--t-base);
}

.hero-input-wrap:focus-within {
  border-color: rgba(255, 255, 255, .8);
  background: rgba(255, 255, 255, .12);
}

.hero-input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  font-size: 13px;
  padding: 7px 0;
  font-family: inherit;
}

.hero-input::placeholder { color: rgba(255, 255, 255, .62); }

.hero-send {
  background: rgba(255, 255, 255, .26);
  border: 0;
  border-radius: var(--r-lg);
  padding: 7px 18px;
  color: #fff;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background var(--t-base), transform var(--t-base);
  white-space: nowrap;
}

.hero-send:hover { background: rgba(255, 255, 255, .42); transform: scale(1.04); color: #fff; }
.hero-send:disabled { opacity: .6; cursor: not-allowed; }

.comment-section {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.comment-rules {
  display: flex;
  gap: 14px;
  padding: 14px 20px;
  background: linear-gradient(135deg, #fff8e1, #fdf1cf);
  border-bottom: 1px solid #f5e3b0;
}

[data-theme="dark"] .comment-rules {
  background: linear-gradient(135deg, #2b2a20, #33301f);
  border-bottom-color: #4a442c;
}

.rules-icon {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #f0b429, #d99413);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
}

.rules-content { flex: 1; }
.rules-title { font-size: 13px; font-weight: 600; color: #8a6417; margin-bottom: 2px; }
[data-theme="dark"] .rules-title { color: #e3c886; }
.rules-list { margin: 0; padding-left: 18px; font-size: 12.5px; color: #9d7a2c; line-height: 1.75; }
[data-theme="dark"] .rules-list { color: #c9b47a; }
.rules-list li { margin-bottom: 2px; }

.comment-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 24px;
}

.ch-title { margin: 0; font-size: 16px; font-weight: 600; color: var(--accent-deep); }
.ch-divider { color: var(--border); }
.ch-count { font-size: 13px; color: var(--muted); }

.comment-input-area {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  background: var(--accent-soft);
  border-bottom: 1px solid var(--border-soft);
  flex-wrap: wrap;
}

/* 留言前的隐私告知（合规提示） */
.privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  padding: 10px 24px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--border-soft);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
}

.privacy-note .pn-icon { flex: 0 0 auto; font-size: 13px; line-height: 1.5; }
.privacy-note a { color: var(--accent-deep); text-decoration: underline; }
.privacy-note a:hover { color: var(--accent); }

.cia-avatar { width: 36px; height: 36px; flex: 0 0 36px; }
.cia-avatar.anon { background: var(--panel-2); color: var(--muted); }

.cia-input {
  flex: 1;
  min-width: 180px;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: var(--r-xl);
  padding: 9px 16px;
  font-size: 14px;
  color: var(--text);
  outline: 0;
  font-family: inherit;
  transition: border-color var(--t-base), box-shadow var(--t-base);
}

.cia-input:focus { border-color: var(--accent); box-shadow: var(--ring); }
.cia-count { font-size: 12px; color: var(--muted); font-family: var(--mono); }

.cia-submit, .cia-login-btn {
  border: 0;
  border-radius: var(--r-lg);
  padding: 9px 22px;
  font-size: 13.5px;
  font-weight: 500;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  box-shadow: 0 2px 10px var(--accent-soft);
  transition: transform var(--t-base), filter var(--t-base);
}

.cia-submit:hover, .cia-login-btn:hover { filter: brightness(1.06); transform: translateY(-1px); color: #fff; }
.cia-submit:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.comment-list { padding: 0; }

.comment-item {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-soft);
  transition: background var(--t-base);
}

.comment-item:hover { background: var(--panel-2); }
.comment-item:last-child { border-bottom: 0; }
.comment-item.is-hidden { display: none; }

.comment-item.is-new, .cir-row.is-new { animation: msgIn .45s ease both; }

@keyframes msgIn {
  from { opacity: 0; transform: translateY(-8px) scale(.99); }
  to   { opacity: 1; transform: none; }
}

.ci-main { display: flex; gap: 14px; }
.ci-avatar { width: 40px; height: 40px; flex: 0 0 40px; }
.ci-body { flex: 1; min-width: 0; }
.ci-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.ci-name { font-size: 14px; font-weight: 600; color: var(--accent-deep); }

.ci-pin-badge {
  font-size: 11.5px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #ff6b6b, #e04b4b);
  padding: 1px 8px;
  border-radius: var(--r-sm);
  letter-spacing: 1px;
}

.ci-location {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
  background: var(--panel-2);
  border: 1px solid var(--border-soft);
  padding: 2px 8px;
  border-radius: var(--r-sm);
}

.ci-location.small { font-size: 11.5px; padding: 1px 6px; }
.ci-loc-icon { font-size: 11.5px; color: var(--accent-2); }
.ci-time { font-size: 12px; color: var(--muted); }
.ci-spacer { flex: 1; }

.ci-reply-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #b45309;
  background: rgba(255, 200, 87, .18);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  padding: 3px 10px;
  cursor: pointer;
  transition: var(--t-base);
}

.ci-reply-btn:hover { background: rgba(255, 200, 87, .32); }

.ci-reply-badge {
  font-size: 12px;
  color: var(--accent-deep);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 3px 10px;
  cursor: pointer;
  transition: var(--t-base);
}

.ci-reply-badge:hover { background: var(--accent-soft); }

.ci-content {
  font-size: 14.5px;
  color: var(--text-dim);
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--panel-2);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  margin-top: 6px;
}

.ci-reply-box {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(255, 200, 87, .12);
  border: 1px solid rgba(255, 200, 87, .3);
  border-radius: var(--r-sm);
}

.ci-reply-input {
  flex: 1;
  min-width: 120px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 7px 12px;
  font-size: 13.5px;
  background: var(--panel);
  color: var(--text);
  outline: 0;
  font-family: inherit;
}

.ci-reply-input:focus { border-color: #e0a51f; }

.ci-reply-send {
  border: 0;
  border-radius: var(--r-sm);
  padding: 7px 16px;
  font-size: 13px;
  color: #fff;
  background: linear-gradient(135deg, #f0b429, #d99413);
  cursor: pointer;
  font-family: inherit;
}

.ci-reply-cancel { font-size: 13px; color: var(--muted); cursor: pointer; }
.ci-reply-cancel:hover { color: var(--text-dim); }

.ci-replies {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
  padding: 10px;
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  background: var(--panel-2);
}

.cir-row { display: flex; gap: 10px; }
.cir-body { flex: 1; min-width: 0; }
.cir-head { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; flex-wrap: wrap; }
.cir-name { font-size: 13px; font-weight: 600; color: var(--accent-deep); }
.cir-time { font-size: 12px; color: var(--muted); }
.cir-content {
  font-size: 13.5px;
  color: var(--text-dim);
  line-height: 1.7;
  background: var(--panel);
  border-radius: var(--r-sm);
  padding: 8px 12px;
  word-break: break-word;
  white-space: pre-wrap;
}

.load-more-wrap { display: flex; justify-content: center; padding: 20px 0; }

.load-more-btn {
  border: 0;
  border-radius: var(--r-xl);
  padding: 9px 32px;
  font-size: 13.5px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 2px 10px var(--accent-soft);
  transition: transform var(--t-base), filter var(--t-base);
}

.load-more-btn:hover { transform: translateY(-1px); filter: brightness(1.06); }

@media (max-width: 640px) {
  .barrage-hero { height: 360px; border-radius: var(--r-xl); }
  .hero-input-area { width: 88%; bottom: 28px; }
  .comment-section { border-radius: var(--r-xl); }
  .comment-item, .comment-header, .comment-rules, .comment-input-area, .privacy-note { padding-left: 16px; padding-right: 16px; }
  .bc-text { max-width: 150px; }
  .comment-input-area { gap: 8px; }
}

.read-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 120;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--pink));
  transition: width var(--t-fast) linear;
  pointer-events: none;
}

.toc-card {
  margin: 0 0 22px;
  padding: 14px 18px;
  background: var(--panel-2);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}

.toc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.toc-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: .5px;
}

.toc-title::before {
  content: "☰";
  margin-right: 7px;
  color: var(--accent);
  font-size: 13px;
}

.toc-toggle {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
  font-family: inherit;
  padding: 2px 6px;
}
.toc-toggle:hover { color: var(--accent-deep); }

.toc-list {
  margin: 10px 0 0;
  padding: 0 0 0 4px;
  list-style: none;
  max-height: 40vh;
  overflow-y: auto;
}
.toc-card.is-collapsed .toc-list { display: none; }

.toc-item a {
  display: block;
  padding: 4px 8px;
  border-left: 2px solid transparent;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: 13.5px;
  color: var(--text-dim);
  transition: var(--t-base);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.toc-item a:hover { background: var(--accent-soft); color: var(--accent-deep); }
.toc-item.is-lv3 a { padding-left: 22px; font-size: 13px; color: var(--muted); }
.toc-item a.is-current {
  border-left-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-weight: 600;
}

/* ------------------------------------------------------------------ *
 * 文章目录移到右侧：宽屏 sticky 跟随，窄屏回到文章上方
 * ------------------------------------------------------------------ */
.article-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

/*
 * 阅读页隐藏了左侧信息栏（article.php 里 $show_sidebar = false），
 * 这时如果不限制宽度，正文会横跨 1160px —— 一行放二十多个字，读起来很累。
 * 这里把「正文 + 目录」这一整块收窄居中：正文约 780px，是中文长文比较舒服的宽度。
 */
.layout.no-side .article-wrap {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
}

@media (min-width: 1081px) {
  .article-wrap.has-toc { grid-template-columns: minmax(0, 1fr) 236px; }
}

.toc-side {
  position: sticky;
  top: 84px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 118px);
  margin: 0;
  padding: 14px 16px 12px;
  background: var(--panel-2);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.toc-side .toc-list {
  flex: 1;
  max-height: none;
  overflow-y: auto;
  margin: 10px 0 0;
}

.toc-progress {
  height: 3px;
  margin-top: 10px;
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  overflow: hidden;
}

.toc-progress i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--accent), var(--pink));
  transition: width var(--t-base) linear;
}

.toc-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  font-size: 12px;
  color: var(--muted);
}

.toc-foot a {
  margin-left: auto;
  color: var(--accent-deep);
  text-decoration: none;
  white-space: nowrap;
}

.toc-foot a:hover { text-decoration: underline; }

/* 窄屏：目录挪回文章上方，不再吸顶 */
@media (max-width: 1080px) {
  .article-wrap.has-toc { display: flex; flex-direction: column; }
  .toc-side {
    order: -1;
    position: static;
    max-height: none;
    width: 100%;
  }
  .toc-side .toc-list { max-height: 40vh; }
}

/* 正文里的 h2/h3 锚点跳转留出顶栏高度 */
.article-body h2[id], .article-body h3[id] { scroll-margin-top: 84px; }

@media (max-width: 640px) {
  .toc-list { max-height: none; }
  .toc-item a { white-space: normal; }
}

/* ==========================================================================
   数据统计页：统计卡片 + 指标 + 原生 SVG 图表
   ========================================================================== */

.charts-page { display: block; }

.charts-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.charts-head-text h1 { margin: 0 0 4px; font-size: 24px; letter-spacing: .5px; }
.charts-head-text p { margin: 0; color: var(--muted); font-size: 13px; }
.charts-head-text .dot-sep { margin: 0 6px; color: var(--border); }

.charts-head-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 12.5px;
}

.charts-updated { color: var(--muted); }

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, .55);
  animation: livePulse 1.8s infinite;
}

@keyframes livePulse {
  0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, .5); }
  70%  { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* ---------------- 顶部两栏：站点统计 / 访问统计 ---------------- */

.charts-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
  gap: 18px;
  margin-bottom: 18px;
}

.charts-col {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px 18px 18px;
  box-shadow: var(--shadow);
}

.col-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
}

.col-header h3 { margin: 0; font-size: 15px; }
.col-header span { font-size: 12px; color: var(--muted); }

.stat-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 15px;
  border-radius: var(--r-md);
  background: var(--panel);
  border: 1px solid var(--border-soft);
  transition: transform .18s, box-shadow .18s, border-color .18s;
  animation: cardIn .5s ease both;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow-lg);
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.stat-icon-box {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: var(--r-md);
  display: grid;
  place-items: center;
  font-size: 20px;
  line-height: 1;
}

.stat-info { min-width: 0; }
.stat-value {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  font-family: var(--mono);
}
.stat-label { font-size: 12px; color: var(--muted); margin-top: 2px; }

.indicator-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.indicator-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: var(--r-md);
  background: var(--panel);
  border: 1px solid var(--border-soft);
  transition: transform .18s, border-color .18s;
  animation: cardIn .5s ease both;
}

.indicator-card:hover { transform: translateY(-2px); border-color: var(--accent); }

.ind-icon {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  font-size: 14px;
  line-height: 1;
}

.ind-body { min-width: 0; }
.ind-value {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  font-family: var(--mono);
  color: var(--text);
}
.ind-label { font-size: 11.5px; color: var(--muted); white-space: nowrap; }

/* ---------------- 图表卡片 ---------------- */

.chart-section { margin-bottom: 18px; }
.chart-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.chart-row .chart-section { margin-bottom: 0; }

.section-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}

.section-header h3 { margin: 0; font-size: 15.5px; }
.section-header h3::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 14px;
  margin-right: 8px;
  border-radius: var(--r-xs);
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  vertical-align: -2px;
}
.section-header span { font-size: 12px; color: var(--muted); }

.chart-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: 16px 18px;
}

.chart-box { position: relative; width: 100%; }
.chart-box.has-legend { display: flex; gap: 12px; }
.chart-box.has-legend .chart-body { flex: 1 1 auto; min-width: 0; }
.chart-body { position: relative; width: 100%; }

.chart-empty {
  display: grid;
  place-items: center;
  min-height: 160px;
  color: var(--muted);
  font-size: 13px;
  background: var(--panel-2);
  border: 1px dashed var(--border);
  border-radius: var(--r-md);
}

.chart-note {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.8;
}

/* SVG 元素 */
.grid-line { stroke: var(--border-soft); stroke-width: 1; stroke-dasharray: 4 4; }
.axis-label { fill: var(--muted); font-size: 11.5px; font-family: var(--mono); }
.bar-value-label { fill: var(--text-dim); font-size: 11.5px; font-weight: 700; font-family: var(--mono); transition: opacity var(--t-slow); }
.hover-line { stroke: var(--accent); stroke-width: 1; stroke-dasharray: 3 3; }
.line-path { stroke-linecap: round; stroke-linejoin: round; }
.bar-path, .rose-path { transition: opacity .18s; }
.rose-path:hover { opacity: .85; }
.rose-path.is-dim { opacity: .28; }
.rose-center { fill: var(--text); font-size: 20px; font-weight: 700; font-family: var(--mono); }
.rose-center-label { fill: var(--muted); font-size: 11.5px; }

/* 图例 */
.chart-legend { flex: 0 0 138px; max-height: 300px; overflow-y: auto; }
.chart-legend:empty { display: none; }

.legend-row { display: flex; gap: 14px; flex-wrap: wrap; justify-content: flex-end; flex: none; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.legend-item i { width: 12px; height: 7px; border-radius: var(--r-xs); }

.legend-row-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 5px 7px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-dim);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: background var(--t-base);
}

.legend-row-item:hover { background: var(--accent-soft); }
.legend-row-item i { width: 9px; height: 9px; border-radius: var(--r-xs); flex: 0 0 9px; }
.legend-row-item .lg-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend-row-item b { font-family: var(--mono); font-weight: 600; }
.legend-row-item em { font-style: normal; color: var(--muted); font-size: 11.5px; min-width: 30px; text-align: right; }

/* 提示气泡 */
.chart-tip {
  position: absolute;
  z-index: 6;
  min-width: 96px;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  font-size: 12px;
  color: var(--text-dim);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-base), transform var(--t-base);
  transform: translateY(3px);
}

.chart-tip.is-on { opacity: 1; transform: none; }
.chart-tip .tip-title { font-weight: 600; color: var(--text); margin-bottom: 5px; font-family: var(--mono); }
.chart-tip .tip-row { display: flex; align-items: center; gap: 6px; margin-top: 3px; white-space: nowrap; }
.chart-tip .tip-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; }
.chart-tip .tip-name { color: var(--muted); }
.chart-tip .tip-val { margin-left: auto; color: var(--text); font-family: var(--mono); }

/* 深色主题：把浅色图标底色翻成深色，保留色相 */
[data-theme="dark"] .stat-icon-box,
[data-theme="dark"] .ind-icon {
  filter: invert(1) hue-rotate(180deg) saturate(.9);
}

@media (max-width: 1000px) {
  .charts-top { grid-template-columns: minmax(0, 1fr); }
  .chart-row { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .charts-head-text h1 { font-size: 20px; }
  .stat-cards { grid-template-columns: minmax(0, 1fr); }
  .indicator-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chart-card { padding: 14px 12px; border-radius: var(--r-lg); }
  .chart-box.has-legend { flex-direction: column; }
  .chart-legend { flex: none; max-height: 190px; }
  .chart-body { height: 240px !important; }
  .stat-value { font-size: 19px; }
}

/* ==========================================================================
   后台「监测防护」页
   ========================================================================== */

.sec-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 16px;
  margin-bottom: 18px;
  border-radius: var(--r-md);
  background: rgba(34, 197, 94, .10);
  border: 1px solid rgba(34, 197, 94, .35);
  font-size: 13px;
  line-height: 1.85;
  color: var(--text-dim);
}

.sec-note b {
  flex: 0 0 auto;
  padding: 1px 9px;
  border-radius: var(--r-pill);
  background: #22c55e;
  color: #fff;
  font-size: 12px;
  white-space: nowrap;
}

.sec-note strong { color: var(--text); }

.sec-cards {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.sec-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 15px;
  border-radius: var(--r-md);
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.sc-label { font-size: 12px; color: var(--muted); }
.sc-value { font-size: 22px; font-family: var(--mono); line-height: 1.3; }
.sc-sub { font-size: 11.5px; color: var(--muted); }

.sec-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 18px;
  margin-bottom: 18px;
}

.sec-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.sec-panel-head h2 { margin: 0; font-size: 15.5px; }
.sec-panel-head span { font-size: 12px; color: var(--muted); }

.sec-feed { list-style: none; margin: 0; padding: 0; max-height: 300px; overflow-y: auto; }

.sec-feed-item {
  padding: 9px 11px;
  margin-bottom: 8px;
  border-radius: var(--r-sm);
  background: var(--panel-2);
  border-left: 3px solid var(--border);
}

.sec-feed-item.lv-high { border-left-color: #ef4444; }
.sec-feed-item.lv-mid { border-left-color: #f59e0b; }
.sec-feed-item.lv-low { border-left-color: var(--accent); }

.sf-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.sf-title { font-size: 13px; font-weight: 600; }
.sf-time { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.sf-detail { font-size: 12px; color: var(--text-dim); margin-top: 3px; word-break: break-all; }
.sf-meta { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.sf-meta a { color: var(--accent-deep); }

.sec-trace-form,
.sec-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.sec-trace-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.sec-trace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 16px;
}

.sec-sub-title { margin: 0 0 8px; font-size: 13.5px; color: var(--text-dim); }

.sec-path {
  max-width: 380px;
  word-break: break-all;
  font-family: var(--mono);
  font-size: 12px;
}

.sec-ua {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: var(--muted);
}

.mono { font-family: var(--mono); font-size: 12px; }

/* ==========================================================================
   后台控制台：问候条 / 指标卡 / 待办 / 两栏面板
   ========================================================================== */

/* ---------- 内容管理页：概览卡 + 批量操作条 ---------- */
.al-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.al-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 13px 44px 13px 14px;
  border-radius: var(--r-md);
  background: var(--panel);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: transform .18s, border-color .18s;
}

.al-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.al-card.is-on { border-color: var(--accent); background: var(--accent-soft); }
.al-card.is-static { cursor: default; }
.al-card.is-static:hover { transform: none; border-color: var(--border); }

.al-emoji {
  position: absolute;
  top: 12px;
  right: 13px;
  font-size: 18px;
  line-height: 1;
}
.al-card b { font-size: 20px; line-height: 1.15; font-family: var(--mono); color: var(--text); }
.al-card span:last-child { font-size: 12px; color: var(--muted); white-space: nowrap; }

.al-batch {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px dashed var(--border-soft);
}

.al-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.al-batch-hint { font-size: 12.5px; color: var(--muted); font-family: var(--mono); }

/* 编辑器：标题右侧的字数 / 阅读时长 */
.ed-counter {
  float: right;
  font-size: 12.5px;
  font-weight: 400;
  color: var(--muted);
  font-family: var(--mono);
}

/* ==========================================================================
   后台正文编辑器（admin/includes/editor.php + assets/js/editor.js）
   ========================================================================== */

.np-editor-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 10px;
  margin-bottom: 10px;
  border-radius: var(--r-md);
  background: var(--panel-2);
  border: 1px solid var(--border);
}

/* hidden 属性优先级要高于上面的 display，否则初始状态会全部露出来 */
.np-editor-toolbar[hidden],
.np-editor[hidden],
.ne-preview[hidden],
#content[hidden] { display: none !important; }

.ne-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding-right: 8px;
  border-right: 1px solid var(--border-soft);
}

.ne-group:last-child { border-right: 0; padding-right: 0; }
.ne-right { margin-left: auto; }

.ne-btn {
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  background: var(--panel);
  color: var(--text-dim);
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--t-base), color var(--t-base), border-color var(--t-base);
}

.ne-btn:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-deep); }
.ne-btn.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.ne-bold { font-weight: 800; }
.ne-italic { font-style: italic; font-family: Georgia, serif; }
.ne-under { text-decoration: underline; }
.ne-strike { text-decoration: line-through; }

.ne-select {
  height: 30px;
  padding: 0 8px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text-dim);
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
}

.ne-color {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--panel);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  overflow: hidden;
}

.ne-color input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  border: 0;
  padding: 0;
}

.ne-color.ne-bg { font-weight: 400; }

.np-editor {
  min-height: 420px;
  max-height: 72vh;
  overflow-y: auto;
  padding: 18px 20px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.8;
  outline: 0;
}

.np-editor:focus { border-color: var(--accent); box-shadow: var(--ring); }
.np-editor h2 { font-size: 20px; margin: 22px 0 10px; color: var(--text); }
.np-editor h3 { font-size: 17px; margin: 18px 0 8px; color: var(--text); }
.np-editor h4 { font-size: 15.5px; margin: 16px 0 6px; color: var(--text); }
.np-editor p { margin: 0 0 12px; }
.np-editor ul, .np-editor ol { padding-left: 22px; margin: 0 0 12px; }
.np-editor blockquote {
  margin: 14px 0;
  padding: 8px 16px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}
.np-editor code {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--accent-soft);
  padding: 1px 6px;
  border-radius: var(--r-sm);
  color: var(--accent-deep);
}
.np-editor pre {
  margin: 14px 0;
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: var(--code-bg);
  border: 1px solid var(--border);
  overflow-x: auto;
}
.np-editor pre code { background: none; padding: 0; color: inherit; }
.np-editor img { max-width: 100%; border-radius: var(--r-sm); }
.np-editor table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 14px 0; }
.np-editor th, .np-editor td { border: 1px solid var(--border); padding: 8px 10px; }
.np-editor hr { border: 0; border-top: 1px dashed var(--border); margin: 20px 0; }
.np-editor:empty::before {
  content: "在这里写正文…";
  color: var(--muted);
}

/* 全屏写作 */
body.ne-fullscreen { overflow: hidden; }
.ne-fullscreen .np-editor-toolbar {
  position: fixed;
  left: 16px;
  right: 16px;
  top: 12px;
  z-index: 620;
  box-shadow: var(--shadow);
}
.ne-fullscreen .np-editor {
  position: fixed;
  left: 16px;
  right: 16px;
  top: 66px;
  bottom: 16px;
  z-index: 610;
  max-height: none;
  box-shadow: var(--shadow);
}

/* 预览浮层 */
.ne-preview {
  position: fixed;
  inset: 0;
  z-index: 640;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(6, 20, 34, .55);
  backdrop-filter: blur(3px);
}

.ne-preview-panel {
  width: min(860px, 100%);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  border-radius: var(--r-lg);
  background: var(--bg);
  border: 1px solid var(--border);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .3);
  overflow: hidden;
}

.ne-preview-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}

.ne-preview-head b { font-size: 14.5px; }
.ne-preview-hint { font-size: 12px; color: var(--muted); margin-right: auto; }

.ne-preview-body {
  padding: 22px 24px 30px;
  overflow-y: auto;
  background: var(--panel);
}

.np-editor-tip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}
.np-editor-tip .dot-sep { color: var(--border); }

/* ---------------- 图片上传组件（后台复用） ---------------- */

.np-upload {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--panel-2);
  outline: 0;
}

.np-upload:focus { border-color: var(--accent); box-shadow: var(--ring); }

.nu-thumb {
  flex: 0 0 176px;
  width: 176px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: var(--r-md);
  border: 1px dashed var(--border);
  background: var(--panel);
}

.nu-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nu-empty { font-size: 12px; color: var(--muted); }

.nu-main { flex: 1 1 auto; min-width: 0; }
.nu-label { font-size: 13px; font-weight: 600; margin-bottom: 8px; }

.nu-drop {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-radius: var(--r-md);
  border: 1.5px dashed var(--border);
  background: var(--panel);
  font-size: 12.5px;
  color: var(--muted);
  transition: border-color var(--t-base), background var(--t-base);
}

.nu-drop b { color: var(--text-dim); font-size: 13px; }
.nu-drop.is-over { border-color: var(--accent); background: var(--accent-soft); }
.nu-drop.is-busy { opacity: .7; }
.nu-limit { font-size: 11.5px; color: var(--muted); }
.nu-pick { cursor: pointer; }

.nu-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.nu-row .input { flex: 1 1 auto; font-size: 12.5px; font-family: var(--mono); }
.nu-row .btn { flex: 0 0 auto; white-space: nowrap; }

.nu-status { margin-top: 8px; font-size: 12px; color: var(--muted); }
.nu-status.is-ok { color: #16a34a; }
.nu-status.is-err { color: #dc2626; }

.nu-progress {
  height: 5px;
  margin-top: 8px;
  border-radius: var(--r-xs);
  background: var(--panel);
  overflow: hidden;
}

.nu-progress i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: var(--r-xs);
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width var(--t-base);
}

@media (max-width: 640px) {
  .np-upload { flex-direction: column; }
  .nu-thumb { flex: none; width: 100%; max-width: 240px; }
}

/* 文章页：分享按钮 */
.article-share {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 13px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text-dim);
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  transition: transform var(--t-base), border-color var(--t-base), color var(--t-base);
}

.share-btn:hover { border-color: var(--accent); color: var(--accent-deep); transform: translateY(-1px); }
.share-btn.is-done { border-color: #22c55e; color: #16a34a; background: rgba(34, 197, 94, .1); }

/* 正文阅读工具：字号调节 */
.read-tools {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  padding: 4px 6px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--panel);
}

.read-tools .rt-label {
  padding: 0 6px 0 4px;
  font-size: 12.5px;
  color: var(--muted);
}

.rt-btn {
  min-width: 34px;
  padding: 4px 8px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--text-dim);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--t-base), color var(--t-base);
}

.rt-btn:hover { background: var(--accent-soft); color: var(--accent-deep); }
.rt-btn.is-on { background: var(--accent); color: #fff; }

/* 字号档位（写在小屏幕上也能用） */
.article-body[data-read-size="s"]  { font-size: 14.5px; }
.article-body[data-read-size="m"]  { font-size: 15.5px; }
.article-body[data-read-size="l"]  { font-size: 17.5px; }
.article-body[data-read-size="xl"] { font-size: 19.5px; line-height: 1.85; }
.article-body[data-read-size="l"] h2,
.article-body[data-read-size="xl"] h2 { font-size: 22px; }
.article-body[data-read-size="l"] h3,
.article-body[data-read-size="xl"] h3 { font-size: 19px; }

.con-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.con-hello h2 { margin: 0; font-size: 19px; }
.con-hello p { margin: 5px 0 0; font-size: 13px; color: var(--muted); }
.con-hello p b { color: var(--text); font-family: var(--mono); }
.con-hello .dot-sep { margin: 0 6px; color: var(--border); }

.con-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.con-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.con-kpi {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 15px;
  border-radius: var(--r-md);
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: transform .18s, border-color .18s, box-shadow .18s;
  animation: cardIn .5s ease both;
}

.con-kpi:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: var(--shadow-lg);
}

.ck-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: var(--r-md);
  display: grid;
  place-items: center;
  font-size: 19px;
  line-height: 1;
}

.ck-body { min-width: 0; }
.ck-value { display: block; font-size: 21px; font-family: var(--mono); line-height: 1.2; color: var(--text); }
.ck-label { font-size: 12px; color: var(--muted); }

.con-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 18px;
  margin-bottom: 18px;
}

.con-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.con-head h2 { margin: 0; font-size: 15.5px; }
.con-more { font-size: 12px; color: var(--muted); text-decoration: none; }
a.con-more:hover { color: var(--accent-deep); }

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

.con-todo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  margin-bottom: 8px;
  border-radius: var(--r-sm);
  background: var(--panel-2);
  border-left: 3px solid var(--border);
}

.con-todo.is-warn  { border-left-color: #f59e0b; background: rgba(245, 158, 11, .09); }
.con-todo.is-error { border-left-color: #ef4444; background: rgba(239, 68, 68, .09); }
.con-todo.is-info  { border-left-color: var(--accent); }
.con-todo.is-ok    { border-left-color: #22c55e; background: rgba(34, 197, 94, .08); }

.ct-text { min-width: 0; }
.ct-text b { display: block; font-size: 13px; }
.ct-text span { font-size: 11.5px; color: var(--muted); }

.con-clear {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 14px;
  border-radius: var(--r-md);
  background: rgba(34, 197, 94, .09);
  border: 1px dashed rgba(34, 197, 94, .4);
}

.con-clear span { font-size: 20px; }
.con-clear p { margin: 0; font-size: 13px; color: var(--text-dim); }

.con-title {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.con-logs li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border-soft);
  font-size: 13.5px;
}

.con-logs li:last-child { border-bottom: 0; }
.cl-ver {
  flex: 0 0 auto;
  padding: 1px 8px;
  border-radius: var(--r-sm);
  background: var(--accent-2-soft);
  color: #a3771a;
  font-family: var(--mono);
  font-size: 12px;
}
.cl-title { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-date { flex: 0 0 auto; font-size: 12px; color: var(--muted); font-family: var(--mono); }

.con-details { padding: 0; overflow: hidden; }
.con-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  cursor: pointer;
  font-size: 15.5px;
  font-weight: 600;
  list-style: none;
}
.con-details > summary::-webkit-details-marker { display: none; }
.con-details > summary::after { content: "▾"; color: var(--muted); font-size: 12px; font-weight: 400; }
.con-details[open] > summary::after { content: "▴"; }
.con-details > summary .con-more { margin-left: auto; margin-right: 10px; }
.con-details > p, .con-details > .table-wrap { margin-left: 20px; margin-right: 20px; }
.con-details > .table-wrap:last-child { margin-bottom: 18px; }

/* 深色主题：图标底色翻成深色 */
[data-theme="dark"] .ck-icon { filter: invert(1) hue-rotate(180deg) saturate(.9); }

@media (max-width: 1100px) {
  .con-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .con-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .con-hello h2 { font-size: 17px; }
  .con-title { max-width: 150px; }
}

/* ---------------- 访问地域分布 ---------------- */

.geo-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.geo-chip {
  padding: 5px 12px;
  border-radius: var(--r-pill);
  background: var(--panel-2);
  border: 1px solid var(--border-soft);
  color: var(--text-dim);
  font-size: 12.5px;
}

.geo-heat {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.geo-cell {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 7px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-soft);
  font-size: 12.5px;
  line-height: 1.2;
  transition: transform var(--t-base), box-shadow var(--t-base);
}

.geo-cell:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(14, 165, 233, .25);
}

.geo-cell b { font-family: var(--mono); font-size: 12px; }

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

.geo-rank-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 13px;
}

.gr-no {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  background: var(--panel-2);
  color: var(--muted);
  font-size: 11.5px;
  font-family: var(--mono);
}

.gr-no.is-top { background: rgba(34, 197, 94, .18); color: #22c55e; font-weight: 700; }

.gr-name {
  flex: 0 0 108px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-dim);
}

.gr-bar {
  flex: 1 1 auto;
  height: 6px;
  border-radius: var(--r-xs);
  background: var(--panel-2);
  overflow: hidden;
}

.gr-bar i {
  display: block;
  height: 100%;
  border-radius: var(--r-xs);
  background: linear-gradient(90deg, #22c55e, #4ade80);
}

.gr-val {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 12.5px;
  min-width: 32px;
  text-align: right;
}

.geo-today {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.geo-today li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-sm);
  background: var(--panel-2);
  font-size: 12.5px;
  color: var(--text-dim);
}

.geo-today b { font-family: var(--mono); color: var(--text); }

/* ---------------- 访问地域：气泡地图 ---------------- */

.geo-map {
  margin: 4px 0 16px;
  padding: 10px 12px 12px;
  border-radius: var(--r-lg);
  background: radial-gradient(circle at 50% 40%, rgba(56, 189, 248, .10), transparent 62%), var(--panel-2);
  border: 1px solid var(--border-soft);
}

.geo-map svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 460px;
}

.geo-grid { stroke: var(--border-soft); stroke-width: 1; stroke-dasharray: 3 7; }

.geo-bubble { cursor: default; }
.geo-bubble .geo-halo { fill: #38bdf8; opacity: .12; }
.geo-bubble.is-far .geo-halo { fill: #f59e0b; opacity: .16; }

.geo-bubble circle {
  transition: opacity .18s, transform .18s;
  transform-origin: center;
}

.geo-bubble:hover .geo-halo { opacity: .3; }
.geo-bubble.is-top circle { stroke: rgba(255, 255, 255, .75); stroke-width: 1.6; }

.geo-dot-label {
  fill: #ffffff;
  font-size: 11.5px;
  font-weight: 700;
  text-anchor: middle;
  font-family: var(--sans);
  paint-order: stroke;
  stroke: rgba(6, 30, 50, .45);
  stroke-width: 2.4px;
  pointer-events: none;
}

.geo-dot-count {
  fill: var(--accent-deep);
  font-size: 11.5px;
  font-weight: 700;
  text-anchor: middle;
  font-family: var(--mono);
  pointer-events: none;
}

.geo-map-note {
  margin: 8px 2px 0;
  font-size: 11.5px;
  line-height: 1.8;
  color: var(--muted);
}

.geo-map-note b { color: var(--text-dim); }

/* 海外来源小标签（不画进地图里） */
.cn-map svg { max-height: 520px; }

.cn-region {
  stroke-width: 1;
  transition: opacity var(--t-base), filter var(--t-base);
  cursor: default;
}

.cn-region:hover { filter: brightness(1.08); }
.cn-region.is-inset { stroke: var(--border); stroke-width: .8; }

.cn-inset-box {
  fill: none;
  stroke: var(--border);
  stroke-width: 1;
}

.cn-label {
  fill: #2f4f4a;
  font-size: 11.5px;
  font-weight: 700;
  text-anchor: middle;
  font-family: var(--sans);
  pointer-events: none;
}

.cn-label.is-dark { fill: #ffffff; }

.cn-legend-text {
  fill: var(--muted);
  font-size: 11.5px;
  text-anchor: middle;
  font-family: var(--sans);
}

.geo-far {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-soft);
}

.gf-label {
  font-size: 11.5px;
  color: var(--muted);
  padding: 2px 9px;
  border-radius: var(--r-pill);
  background: rgba(245, 158, 11, .16);
  color: #b45309;
  font-weight: 600;
}

.gf-chip {
  font-size: 12px;
  color: var(--text-dim);
  padding: 2px 10px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-soft);
  background: var(--panel);
}

.gf-chip b { font-family: var(--mono); color: var(--text); }

@media (max-width: 640px) {
  .geo-map { padding: 8px; }
  .geo-map svg { max-height: 320px; }
}

/* ---------------- 标签总览（标签云） ---------------- */

.tag-cloud-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 22px 20px;
}

.tag-cloud-item {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 6px 15px;
  border-radius: var(--r-pill);
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform var(--t-base), box-shadow var(--t-base), filter var(--t-base);
}

.tag-cloud-item:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: var(--shadow-lg);
  filter: saturate(1.08);
}

.tag-cloud-item sup {
  font-size: .55em;
  opacity: .7;
  font-family: var(--mono);
  font-weight: 500;
}

.side-more {
  float: right;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}

.side-more:hover { color: var(--accent-deep); }

/* 深色主题：把浅色标签底翻成深色，保留色相 */
[data-theme="dark"] .tag-cloud-item { filter: invert(1) hue-rotate(180deg); }
[data-theme="dark"] .tag-cloud-item:hover { filter: invert(1) hue-rotate(180deg) saturate(1.08); }

/* ---------------- 归档时间线 ---------------- */

.archive-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}

.archive-jump .chip .cnt {
  margin-left: 4px;
  color: var(--muted);
  font-size: 11.5px;
  font-family: var(--mono);
}

.archive-timeline { position: relative; }

.archive-year { margin-bottom: 22px; }

.archive-year-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--border);
  scroll-margin-top: 84px;
}

.ay-year {
  font-size: 22px;
  font-weight: 700;
  font-family: var(--mono);
  color: var(--accent-deep);
  letter-spacing: 1px;
}

.ay-year::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 9px;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: 3px;
}

.ay-count { font-size: 12.5px; color: var(--muted); }

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

.archive-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border-radius: var(--r-md);
  transition: background var(--t-base);
}

.archive-item:hover { background: var(--panel-2); }

.ai-no {
  flex: 0 0 34px;
  text-align: right;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
}

.ai-thumb { flex: 0 0 auto; line-height: 0; }
.ai-thumb img { width: 60px; height: 42px; border-radius: var(--r-sm); object-fit: cover; }

.ai-body { flex: 1 1 auto; min-width: 0; }

.ai-title {
  display: block;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-title:hover { color: var(--accent-deep); }

.ai-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.ai-tag { color: var(--muted); }
.ai-tag:hover { color: var(--accent-deep); }

.ai-date {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
}

/* ---------------- 分类总览 ---------------- */

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}

.category-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 18px 16px;
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: transform .18s, border-color .18s, box-shadow .18s;
}

.category-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: var(--shadow-lg);
}

.cc-icon { font-size: 26px; line-height: 1; }
.cc-name { font-size: 16px; font-weight: 600; color: var(--text); }
.cc-count { font-size: 12.5px; color: var(--muted); }

.cc-bar {
  display: block;
  height: 5px;
  margin: 6px 0 2px;
  border-radius: var(--r-xs);
  background: var(--panel-2);
  overflow: hidden;
}

.cc-bar i {
  display: block;
  height: 100%;
  border-radius: var(--r-xs);
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.cc-latest {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cc-latest em { font-style: normal; font-family: var(--mono); opacity: .8; }

/* ==========================================================================
   碎碎念时间线（daily.php）
   ========================================================================== */

.daily-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.daily-bar .chip-row { margin: 0; }

.daily-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.daily-search .input { min-width: 180px; max-width: 220px; }

.daily-timeline { position: relative; padding-left: 6px; }

.dt-month {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 22px 0 12px;
  padding-left: 62px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-deep);
}

.dt-month:first-child { margin-top: 4px; }
.dt-month em { font-style: normal; font-size: 12px; color: var(--muted); font-weight: 400; }

.dt-item {
  position: relative;
  display: flex;
  gap: 14px;
  padding-bottom: 18px;
}

.dt-line {
  position: absolute;
  left: 51px;
  top: 6px;
  bottom: -6px;
  width: 2px;
  background: linear-gradient(180deg, var(--accent-soft), var(--border));
  border-radius: var(--r-xs);
}

.dt-item:last-child .dt-line { bottom: auto; height: 26px; }

.dt-date {
  flex: 0 0 44px;
  position: relative;
  text-align: right;
  font-family: var(--mono);
  line-height: 1.25;
}

.dt-date::after {
  content: "";
  position: absolute;
  right: -14px;
  top: 6px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--panel);
  box-shadow: var(--ring);
}

.dt-date b { display: block; font-size: 14px; color: var(--accent-deep); }
.dt-date span { font-size: 11.5px; color: var(--muted); }

.dt-card {
  flex: 1 1 auto;
  min-width: 0;
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: var(--panel);
  border: 1px solid var(--border);
  transition: transform .18s, border-color .18s, box-shadow .18s;
}

.dt-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow-lg);
}

.dt-title {
  display: block;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--text);
}

.dt-title:hover { color: var(--accent-deep); }

.dt-text {
  margin: 6px 0 10px;
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-dim);
}

.dt-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}

.dt-meta .tag { font-size: 11.5px; }

@media (max-width: 640px) {
  .dt-month { padding-left: 0; }
  .dt-item { flex-direction: column; gap: 6px; padding-left: 16px; }
  .dt-line { left: 4px; }
  .dt-date { flex: none; text-align: left; display: flex; align-items: baseline; gap: 6px; }
  .dt-date::after { left: -16px; right: auto; top: 7px; }
  .dt-date b { font-size: 13px; }
  .dt-card { padding: 12px 14px; }
}

@media (max-width: 640px) {
  .archive-item { flex-wrap: wrap; }
  .ai-title { white-space: normal; }
  .ai-thumb img { width: 48px; height: 34px; }
  .category-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

/* ==========================================================================
   首页顶部横幅（Hero）：背景图 + 导航压顶 + 打字机三句话 + 名人名言
   ========================================================================== */

/* ---------- 首页导航先透明压在横幅上，滚过横幅后变回白底 ---------- */
body.has-hero .site-header { position: fixed; left: 0; right: 0; top: 0; }

/* 切换透明/白底时，颜色不要走过渡，否则会有一瞬间「白字白底」看不清 */
body.has-hero .site-header .nav-link,
body.has-hero .site-header .brand-name,
body.has-hero .site-header .icon-btn {
  transition: background .18s ease, border-color .18s ease;
}

body.has-hero .site-header:not(.is-solid) {
  background: transparent;
  border-bottom-color: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

body.has-hero .site-header:not(.is-solid) .brand-name { color: rgba(255, 255, 255, .96); }
body.has-hero .site-header:not(.is-solid) .brand-name span { color: #9fe0ff; }
body.has-hero .site-header:not(.is-solid) .brand img { border-color: rgba(255, 255, 255, .7); }

body.has-hero .site-header:not(.is-solid) .nav-link { color: rgba(255, 255, 255, .88); }
body.has-hero .site-header:not(.is-solid) .nav-link:hover {
  background: rgba(255, 255, 255, .18);
  color: #fff;
}
body.has-hero .site-header:not(.is-solid) .nav-link.is-active {
  background: rgba(255, 255, 255, .24);
  color: #fff;
  box-shadow: none;
}

body.has-hero .site-header:not(.is-solid) .icon-btn {
  color: rgba(255, 255, 255, .92);
  border-color: rgba(255, 255, 255, .35);
  background: rgba(255, 255, 255, .1);
}
body.has-hero .site-header:not(.is-solid) .icon-btn:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, .65);
}
body.has-hero .site-header:not(.is-solid) .user-name { color: rgba(255, 255, 255, .92); }
body.has-hero .site-header:not(.is-solid) .user-avatar {
  background: rgba(255, 255, 255, .88);
  color: #0b3a52;
}
body.has-hero .site-header:not(.is-solid) .btn-ghost {
  color: rgba(255, 255, 255, .92);
  border-color: rgba(255, 255, 255, .38);
}
body.has-hero .site-header:not(.is-solid) .btn-primary { box-shadow: 0 6px 16px rgba(0, 0, 0, .22); }

/* ---------- 滚过横幅后：显式写回白底配色（不依赖默认样式兜底） ---------- */
body.has-hero .site-header.is-solid {
  background: rgba(255, 255, 255, .9);
  border-bottom-color: var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: saturate(160%) blur(14px);
}

[data-theme="dark"] body.has-hero .site-header.is-solid { background: rgba(18, 25, 33, .9); }

body.has-hero .site-header.is-solid .brand-name { color: var(--text); }
body.has-hero .site-header.is-solid .brand-name span { color: var(--accent); }
body.has-hero .site-header.is-solid .brand img { border-color: #fff; }

body.has-hero .site-header.is-solid .nav-link { color: var(--text-dim); }
body.has-hero .site-header.is-solid .nav-link:hover { background: var(--accent-soft); color: var(--accent-deep); }
body.has-hero .site-header.is-solid .nav-link.is-active {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow);
}

body.has-hero .site-header.is-solid .icon-btn {
  color: var(--text-dim);
  border-color: var(--border);
  background: var(--panel);
}
body.has-hero .site-header.is-solid .icon-btn:hover { color: var(--accent); border-color: var(--accent); }
body.has-hero .site-header.is-solid .user-name { color: var(--text-dim); }
body.has-hero .site-header.is-solid .user-avatar { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
body.has-hero .site-header.is-solid .btn-ghost { color: var(--text-dim); border-color: var(--border); }

/* ---------- 横幅本体 ---------- */
.hero {
  position: relative;
  overflow: hidden;
  min-height: 76vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(92px, 14vh, 132px) 20px clamp(110px, 16vh, 150px);
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.03);
  filter: saturate(1.14) contrast(1.04) brightness(1.05);
  /* 多张背景时靠透明度交叉淡化；只有一张时这个过渡也不会碍事 */
  opacity: 0;
  transition: opacity 1.6s ease;
  will-change: opacity;
}

.hero-bg.is-on { opacity: 1; }

/* 右下角「换背景」按钮：和「向下滚动」对称，不抢眼 */
.hero-bg-next {
  position: absolute;
  right: 22px;
  bottom: 26px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px 7px 11px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(255, 255, 255, .28);
  background: rgba(10, 26, 44, .34);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: rgba(255, 255, 255, .88);
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
  opacity: .78;
  transition: opacity var(--t-base), transform var(--t-base), border-color var(--t-base), background var(--t-base);
}

.hero-bg-next svg { fill: currentColor; opacity: .85; }

.hero-bg-next:hover {
  opacity: 1;
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, .5);
  background: rgba(10, 26, 44, .5);
}

@media (max-width: 640px) {
  .hero-bg-next { right: 14px; bottom: 20px; font-size: 12px; }
  .hero-bg-next span { display: none; }   /* 小屏只留图标 */
}

@media (prefers-reduced-motion: reduce) {
  .hero-bg { transition: none; }
}

.hero-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(circle at 50% 38%, rgba(120, 205, 245, .3), rgba(120, 205, 245, 0) 58%),
    radial-gradient(circle at 50% 50%, rgba(5, 20, 36, 0) 42%, rgba(4, 16, 30, .5) 100%),
    linear-gradient(180deg, rgba(6, 22, 40, .42), rgba(5, 20, 36, .74));
}

.hero-wave {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  z-index: 2;
  width: 100%;
  height: 90px;
  fill: var(--bg);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 840px;
  text-align: center;
  color: #fff;
}

.hero-avatar {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .7);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .32), 0 0 0 8px rgba(255, 255, 255, .08);
  object-fit: cover;
  animation: heroRise .8s cubic-bezier(.16, 1, .3, 1) both;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  margin-top: -6px;
  padding: 5px 20px;
  border-radius: var(--r-pill);
  background: rgba(6, 22, 40, .42);
  border: 1px solid rgba(255, 255, 255, .38);
  backdrop-filter: blur(6px);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 2px;
  animation: heroRise .8s cubic-bezier(.16, 1, .3, 1) .08s both;
}

.hero-hi {
  margin: 4px 0 0;
  font-size: 12px;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .72);
  animation: heroRise .8s cubic-bezier(.16, 1, .3, 1) .14s both;
}

/* ---------- 打字机 ---------- */
.hero-typed {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 1.4em;
  margin: 2px 0 4px;
  font-size: clamp(24px, 4.2vw, 46px);
  font-weight: 700;
  letter-spacing: 3px;
  text-shadow: 0 6px 26px rgba(0, 0, 0, .45), 0 0 60px rgba(140, 215, 255, .35);
  animation: heroRise .8s cubic-bezier(.16, 1, .3, 1) .2s both;
}

.ht-caret {
  display: inline-block;
  width: 3px;
  height: 1em;
  border-radius: var(--r-xs);
  background: #fff;
  animation: caretBlink 1s steps(1) infinite;
}

@keyframes caretBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@keyframes heroRise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- 名人名言卡 ---------- */
.hero-quote {
  position: relative;
  width: min(600px, 100%);
  margin-top: 10px;
  padding: 16px 52px 16px 46px;
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, .13);
  border: 1px solid rgba(255, 255, 255, .28);
  backdrop-filter: blur(8px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .18);
  text-align: left;
  transition: opacity .18s ease, transform .18s ease;
  animation: heroRise .8s cubic-bezier(.16, 1, .3, 1) .28s both;
}

.hero-quote::before {
  content: "\201C";
  position: absolute;
  top: -6px;
  left: 14px;
  font-size: 46px;
  line-height: 1;
  font-family: Georgia, "Times New Roman", serif;
  color: rgba(255, 255, 255, .28);
  pointer-events: none;
}

.hero-quote.is-swap { opacity: 0; transform: translateY(4px); }

.hq-text { margin: 0; font-size: 14.5px; line-height: 1.75; }
.hq-author { display: block; margin-top: 6px; font-size: 12px; text-align: right; color: rgba(255, 255, 255, .7); }

.hq-refresh {
  position: absolute;
  top: 50%;
  right: 12px;
  width: 30px;
  height: 30px;
  margin-top: -15px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .35);
  background: rgba(255, 255, 255, .16);
  color: #fff;
  cursor: pointer;
  transition: background var(--t-base), transform var(--t-slower);
}

.hq-refresh svg { fill: currentColor; }
.hq-refresh:hover { background: rgba(255, 255, 255, .32); transform: rotate(180deg); }

.hero-meta {
  margin-top: 12px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, .68);
  animation: heroRise .8s cubic-bezier(.16, 1, .3, 1) .36s both;
}

.hero-meta b { color: #fff; }
.hero-meta .dot-sep { color: rgba(255, 255, 255, .35); }

/* ---------- 向下滚动提示 ---------- */
.hero-scroll {
  position: absolute;
  left: 50%;
  bottom: 96px;
  z-index: 3;
  transform: translateX(-50%);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 12px;
  color: rgba(255, 255, 255, .72);
  text-decoration: none;
}

.hero-scroll svg { fill: currentColor; animation: scrollBob 1.8s ease-in-out infinite; }
.hero-scroll:hover { color: #fff; }

/* 点了「向下滚动」跳到欢迎框时，给固定导航让出高度 */
body.has-hero #welcome { scroll-margin-top: 78px; }

@keyframes scrollBob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(5px); }
}

/* ---------- 窄屏 / 矮屏 ---------- */
@media (max-width: 640px) {
  .hero { min-height: 68vh; padding: 96px 16px 116px; }
  .hero-avatar { width: 68px; height: 68px; }
  .hero-typed { letter-spacing: 2px; }
  .hero-quote { padding: 14px 44px 14px 34px; }
  .hq-text { font-size: 13.5px; }
  .hero-scroll { bottom: 92px; }
  .hero-wave { height: 60px; }
}

@media (max-height: 560px) {
  .hero { min-height: 0; padding: 88px 18px 96px; }
  .hero-avatar { display: none; }
  .hero-meta { display: none; }
  .hero-scroll { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-avatar, .hero-badge, .hero-hi, .hero-typed, .hero-quote, .hero-meta { animation: none; }
  .ht-caret, .hero-scroll svg { animation: none; }
  .ht-caret { opacity: 1; }
}

/* 站内跳转：轻微缩放 + 淡出 */
html.page-leaving .site-header,
html.page-leaving .layout,
html.page-leaving .site-footer {
  opacity: .35;
  transform: scale(.985);
  transform-origin: 50% 30%;
  transition: opacity var(--t-base) ease, transform var(--t-base) ease;
}

@media (prefers-reduced-motion: reduce) {
  html.page-leaving .site-header,
  html.page-leaving .layout,
  html.page-leaving .site-footer { opacity: 1; transform: none; }
}

@media (max-width: 1200px) {
  .sec-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sec-grid, .sec-trace-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .sec-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sec-note { flex-direction: column; }
  .gr-name { flex-basis: 78px; }
}

/* ------------------------------------------------------------------ *
 * 搜索结果高亮 / 无障碍跳转链接
 * ------------------------------------------------------------------ */
mark.hl {
  background: rgba(255, 214, 102, .55);
  color: inherit;
  padding: 0 2px;
  border-radius: var(--r-xs);
  font-weight: inherit;
}

[data-theme="dark"] mark.hl {
  background: rgba(255, 200, 60, .28);
  color: #ffe9a8;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: -70px;
  z-index: 9999;
  padding: 10px 18px;
  background: var(--accent);
  color: #fff;
  border-radius: 0 0 var(--r-md) var(--r-md);
  font-size: 14px;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .18);
  transition: top .18s ease;
}

.skip-link:focus {
  top: 0;
  outline: 2px solid #fff;
  outline-offset: -4px;
}

/* 键盘焦点可见（鼠标点击不显示） */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* ------------------------------------------------------------------ *
 * 侧栏「音乐播放器」：碟片播放时旋转
 * ------------------------------------------------------------------ */
.music-card .side-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.music-card .side-more { font-weight: 400; font-size: 12px; }

.music-player { text-align: center; }

.mp-disc {
  position: relative;
  width: 128px;
  height: 128px;
  margin: 2px auto 12px;
  border-radius: 50%;
  background: #14181d;
  box-shadow: 0 10px 22px rgba(0, 0, 0, .18), inset 0 0 0 6px rgba(255, 255, 255, .16);
}

.mp-disc img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  transform: translateZ(0);
}

.mp-disc.is-playing img { animation: mp-spin 14s linear infinite; }

@keyframes mp-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.mp-hole {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border-radius: 50%;
  background: var(--panel);
  border: 3px solid rgba(0, 0, 0, .12);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .35);
}

.mp-meta { margin-bottom: 10px; }

.mp-song {
  display: block;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--text);
  word-break: break-word;
}

.mp-artist {
  display: block;
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--muted);
}

.mp-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
}

.mp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  transition: color var(--t-base), background var(--t-base), transform var(--t-base);
}

.mp-btn:hover { color: var(--accent-deep); background: var(--accent-soft); }

.mp-btn.is-main {
  width: 40px;
  height: 40px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  box-shadow: 0 6px 16px rgba(79, 140, 255, .35);
}

.mp-btn.is-main:hover {
  background: var(--accent-deep);
  color: #fff;
  transform: translateY(-1px);
}

.mp-bar {
  height: 4px;
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  overflow: hidden;
  cursor: pointer;
}

.mp-bar i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: var(--r-pill);
  background: var(--accent);
  transition: width var(--t-base) linear;
}

.mp-time {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
}

/* 播放目录：高度固定，曲目多时由 JS 加 .is-rolling 让它无缝循环滚动 */
.mp-scroll {
  position: relative;
  max-height: 118px;
  margin-top: 12px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 10px, #000 calc(100% - 10px), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 10px, #000 calc(100% - 10px), transparent 100%);
}

.mp-scroll.is-rolling .mp-track {
  animation: mp-roll var(--mp-roll, 24s) linear infinite;
}

/* 鼠标移上去暂停滚动，方便点歌 */
.mp-scroll.is-rolling:hover .mp-track { animation-play-state: paused; }

@keyframes mp-roll {
  from { transform: translateY(0); }
  to   { transform: translateY(-50%); }
}

.mp-list {
  list-style: none;
  margin: 0;
  padding: 0;
  text-align: left;
}

.mp-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--text-dim);
  cursor: pointer;
  transition: background var(--t-base), color var(--t-base);
}

.mp-item:hover { background: var(--accent-soft); }
.mp-item.is-on { color: var(--accent-deep); font-weight: 600; }

.mp-no {
  flex: 0 0 20px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
}

.mp-item.is-on .mp-no { color: var(--accent-deep); }

.mp-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mp-status {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--danger);
}

/* 音乐来源：播放器底部一行，点了去米兔音乐站内听更多 */
.mp-source {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px dashed var(--border-soft);
  font-size: 12px;
  color: var(--text-dim);
  text-decoration: none;
  transition: color var(--t-base);
}

.mp-source svg {
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
}

.mp-source-go {
  margin-left: auto;
  color: var(--accent);
  opacity: .78;
  transition: opacity var(--t-base);
}

.mp-source:hover,
.mp-source:hover .mp-source-go { color: var(--accent); opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .mp-disc.is-playing img { animation: none; }
}

/* ------------------------------------------------------------------ *
 * 悬浮迷你播放器：开始播放后出现在右下角，滚动页面时一直可见
 * ------------------------------------------------------------------ */
.mp-float {
  position: fixed;
  right: 20px;
  bottom: 82px;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--panel);
  box-shadow: 0 16px 38px rgba(20, 60, 90, .18);
  animation: mpf-in .26s ease both;
}

/* 注意：上面写了 display:flex，会盖掉浏览器对 hidden 属性的 display:none，
   所以必须显式补一条，否则「未播放时隐藏」会失效（悬浮条一直挂在页面上）。 */
.mp-float[hidden] { display: none; }

@keyframes mpf-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

.mpf-progress {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 0;
  height: 3px;
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  overflow: hidden;
}

.mpf-progress i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width var(--t-base) linear;
}

.mpf-cover {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
}

.mp-float.is-playing .mpf-cover { animation: mp-spin 14s linear infinite; }

.mpf-meta {
  flex: 1;
  min-width: 0;
  line-height: 1.35;
}

.mpf-title {
  display: block;
  font-size: 13.5px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mpf-artist {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mpf-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.mpf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1;
  cursor: pointer;
  transition: color var(--t-base), background var(--t-base);
}

.mpf-btn:hover { color: var(--accent-deep); background: var(--accent-soft); }

.mpf-btn.is-main {
  width: 36px;
  height: 36px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  box-shadow: 0 6px 14px rgba(79, 140, 255, .32);
}

.mpf-btn.is-main:hover { background: var(--accent-deep); color: #fff; }
.mpf-btn.is-quiet { font-size: 12px; }
.mpf-btn.is-on { color: var(--accent-deep); background: var(--accent-soft); }

.mpf-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  width: min(340px, calc(100vw - 32px));
  max-height: 260px;
  padding: 10px 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--panel);
  box-shadow: 0 16px 38px rgba(20, 60, 90, .2);
  overflow: hidden;
}

.mpf-panel[hidden] { display: none; }

.mpf-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 12.5px;
  color: var(--muted);
}

.mpf-items {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 212px;
  overflow-y: auto;
}

.mpf-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--text-dim);
  cursor: pointer;
}

.mpf-item:hover { background: var(--accent-soft); }
.mpf-item.is-on { color: var(--accent-deep); font-weight: 600; }

.mpf-item .n {
  flex: 0 0 18px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
}

.mpf-item.is-on .n { color: var(--accent-deep); }

.mpf-item .t {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .mp-float {
    right: 10px;
    left: 10px;
    bottom: 72px;
    width: auto;
    padding: 9px 10px;
  }

  .mpf-panel {
    left: 0;
    right: 0;
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mp-float { animation: none; }
  .mp-float.is-playing .mpf-cover { animation: none; }
}

/* ------------------------------------------------------------------ *
 * 搜索框即时建议
 * ------------------------------------------------------------------ */
.np-suggest-host { position: relative; }

.np-suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 60;
  max-height: 320px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--panel);
  box-shadow: 0 16px 36px rgba(20, 60, 90, .16);
  animation: sgIn .16s ease both;
}

@keyframes sgIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}

.np-sg-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  color: var(--text-dim);
  text-decoration: none;
}

.np-sg-item:hover,
.np-sg-item.is-active { background: var(--accent-soft); color: var(--accent-deep); }

.np-sg-kind {
  flex: 0 0 auto;
  width: 20px;
  text-align: center;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}

.np-sg-item.is-tag .np-sg-kind { color: var(--accent-deep); font-weight: 700; }

.np-sg-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.np-sg-meta { flex: 0 0 auto; font-size: 11.5px; color: var(--muted); }

.np-sg-empty {
  padding: 10px 12px;
  font-size: 13px;
  color: var(--muted);
}

/* 正文里可放大的图片 */
.article-body img.is-zoomable { cursor: zoom-in; transition: opacity var(--t-base); }
.article-body img.is-zoomable:hover { opacity: .92; }

/* ------------------------------------------------------------------ *
 * 点赞按钮 / 键盘翻页提示 / 回到顶部进度环
 * ------------------------------------------------------------------ */
.like-btn { cursor: pointer; }
.like-btn .lb-icon { font-size: 14px; line-height: 1; }
.like-btn.is-on { border-color: #f2a3b8; color: #d1628c; background: rgba(247, 168, 190, .14); }
.like-btn.is-busy { opacity: .65; }

.like-btn.is-pop { animation: likePop .42s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes likePop {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.16); }
  100% { transform: scale(1); }
}

.like-btn.is-shake { animation: likeShake .4s ease; }
@keyframes likeShake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-3px); }
  75%      { transform: translateX(3px); }
}

.prev-next-hint {
  margin: 14px 0 0;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
}

.prev-next-hint kbd,
.search-box kbd {
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--panel);
  font-family: var(--mono);
  font-size: 11.5px;
}

/* 回到顶部：外圈当进度环 */
.to-top {
  background: conic-gradient(var(--accent) var(--p, 0%), var(--panel) 0);
  color: var(--accent-deep);
}

.to-top::before {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--panel);
}

.to-top > * { position: relative; }

/* ------------------------------------------------------------------ *
 * 博文列表：卡片 / 紧凑视图
 * ------------------------------------------------------------------ */
.list-view {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--panel);
}

.lv-btn {
  width: 30px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: background var(--t-base), color var(--t-base);
}

.lv-btn:hover { background: var(--accent-soft); color: var(--accent-deep); }
.lv-btn.is-on { background: var(--accent); color: #fff; }

/* 紧凑模式：隐藏封面，压成一行行的小条目 */
html.list-compact .post-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  padding: 12px 16px;
}

html.list-compact .post-card .post-cover { display: none; }
html.list-compact .post-card .post-body { padding: 0; }
html.list-compact .post-card .post-title { font-size: 15px; margin-bottom: 4px; }
html.list-compact .post-card .post-excerpt {
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
html.list-compact .post-list { gap: 10px; }

/* ------------------------------------------------------------------ *
 * 留言板表情面板
 * ------------------------------------------------------------------ */
.msg-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

.emoji-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--panel);
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
  transition: border-color var(--t-base), color var(--t-base);
}

.emoji-toggle:hover { border-color: var(--accent); color: var(--accent-deep); }

.emoji-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--panel);
  animation: sgIn .16s ease both;
}

.emoji-panel[hidden] { display: none; }

.emoji-panel button {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background .14s, transform .14s;
}

.emoji-panel button:hover { background: var(--accent-soft); transform: scale(1.12); }

/* ------------------------------------------------------------------ *
 * 后台：Ctrl/⌘ + K 全局搜索
 * ------------------------------------------------------------------ */
.np-quick-open { cursor: pointer; font-family: inherit; }
.np-quick-open kbd {
  margin-left: 4px;
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--panel);
  font-family: var(--mono);
  font-size: 11.5px;
}

.np-quick {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 16px 16px;
  background: rgba(12, 26, 40, .45);
  backdrop-filter: blur(3px);
  animation: lbFade .16s ease both;
}

.np-quick[hidden] { display: none; }

.nq-box {
  width: min(620px, 100%);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--panel);
  box-shadow: 0 26px 60px rgba(0, 0, 0, .3);
  overflow: hidden;
  animation: lbZoom .2s ease both;
}

.nq-box input {
  width: 100%;
  padding: 15px 18px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
}

.nq-list { max-height: 46vh; overflow-y: auto; padding: 6px; }

.nq-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  color: var(--text-dim);
  text-decoration: none;
}

.nq-item:hover,
.nq-item.is-active { background: var(--accent-soft); color: var(--accent-deep); }

.nq-icon { flex: 0 0 20px; text-align: center; }
.nq-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nq-meta { flex: 0 0 auto; font-size: 11.5px; color: var(--muted); }

.nq-empty { padding: 16px 14px; color: var(--muted); font-size: 13.5px; }

.nq-tip {
  padding: 9px 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}

/* 后台仪表盘：内容体检清单 */
.health-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.health-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  background: var(--bg-3, var(--panel));
  font-size: 13px;
}
.health-item a { color: var(--accent-deep); text-decoration: none; }
.health-item a:hover { text-decoration: underline; }
.health-flag { flex: 0 0 auto; padding: 1px 8px; border-radius: var(--r-pill); background: rgba(217, 147, 15, .16); color: #a8710a; font-size: 11.5px; }

/* ------------------------------------------------------------------ *
 * 头像：首字母打底 + 邮箱头像（QQ / Gravatar）盖上来
 * ------------------------------------------------------------------ */
.np-av {
  position: relative;
  overflow: hidden;
}

.np-av .np-av-letter {
  position: relative;
  z-index: 0;
}

.np-av img {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

/* 顶部导航里的用户头像：整块可点，圆形 */
.user-avatar.np-av { overflow: hidden; padding: 0; }

/* 微信分享二维码弹层 */
.share-qr {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(10, 24, 38, .62);
  backdrop-filter: blur(4px);
  animation: lbFade .18s ease both;
}

.share-qr[hidden] { display: none; }

.sq-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 22px 24px 18px;
  border-radius: var(--r-lg);
  background: #fff;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
  animation: lbZoom .22s cubic-bezier(.2, .8, .3, 1) both;
}

.sq-box b { font-size: 15px; color: #1d2b3a; }
.sq-box canvas { border-radius: var(--r-sm); }
.sq-tip { font-size: 12.5px; color: #7d8b99; }

/* ------------------------------------------------------------------ *
 * 首页新增：今日推荐 + 最新更新（两栏卡片）
 * ------------------------------------------------------------------ */
.home-duo {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 26px;
}

.duo-card {
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.duo-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.duo-head .section-title { margin: 0; font-size: 17px; }

.pick-card {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  text-decoration: none;
  transition: opacity var(--t-base) ease;
}

.pick-card:hover .pick-title { color: var(--accent-deep); }
.pick-card.is-swap { opacity: .25; }

.pick-cover {
  width: 132px;
  height: 84px;
  border-radius: var(--r-md);
  object-fit: cover;
  border: 1px solid var(--border);
}

.pick-body { min-width: 0; }

.pick-title {
  margin: 0 0 6px;
  font-size: 15.5px;
  color: var(--text);
  transition: color var(--t-base);
}

.pick-desc {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-dim);
}

.pick-meta { font-size: 12px; color: var(--muted); }

.update-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.update-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--text-dim);
  text-decoration: none;
  transition: background var(--t-base), color var(--t-base);
}

.update-item:hover { background: var(--accent-soft); color: var(--accent-deep); }

.up-ver {
  flex: 0 0 auto;
  padding: 1px 7px;
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-family: var(--mono);
  font-size: 11.5px;
}

.up-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.up-date { flex: 0 0 auto; font-size: 12px; color: var(--muted); }

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

@media (max-width: 520px) {
  .pick-card { grid-template-columns: 96px minmax(0, 1fr); gap: 10px; }
  .pick-cover { width: 96px; height: 64px; }
  .pick-desc { display: none; }
}

/* ==========================================================================
   后台界面动态效果增强（v1.29.0）

   作用范围：只写后台（.admin-body / .login-shell / .np-modal / .np-quick），
   前台页面不加载 assets/js/admin.js，也不会命中这些类名，所以完全不受影响。
   另外所有动画在系统「减少动态效果」下会自动关掉。
   ========================================================================== */

/* ---------- 1. 主区内容分层浮现：进后台不再「啪」地一下全出来 ---------- *
 * 这里只做位移、不动 opacity。
 * 内容「先透明再淡入」好看，但只要动画时钟因任何原因没走完，整页就会一直发灰；
 * 只做位移的话，最坏情况也不过是内容整体偏下几像素，永远是能读的。
 * 淡入效果交给本来就带 fade 的组件（.con-kpi / .alert）自己去做。
 */
.admin-main > * { animation: admRise .42s cubic-bezier(.22, 1, .36, 1) both; }
.admin-main > *:nth-child(1) { animation-delay: .02s; }
.admin-main > *:nth-child(2) { animation-delay: .06s; }
.admin-main > *:nth-child(3) { animation-delay: .10s; }
.admin-main > *:nth-child(4) { animation-delay: .14s; }
.admin-main > *:nth-child(5) { animation-delay: .18s; }
.admin-main > *:nth-child(6) { animation-delay: .22s; }
.admin-main > *:nth-child(n+7) { animation-delay: .26s; }

@keyframes admRise {
  from { transform: translateY(12px); }
  to   { transform: none; }
}

/* ---------- 2. 侧栏：LOGO 轻转、图标微放大、当前项流光 ---------- */
.admin-brand img { transition: transform var(--t-slower) cubic-bezier(.22, 1, .36, 1), box-shadow var(--t-slower); }
.admin-brand:hover img {
  transform: rotate(-6deg) scale(1.06);
  box-shadow: var(--ring);
}

.admin-nav a .ni { transition: transform var(--t-base) ease; }
.admin-nav a:hover .ni { transform: scale(1.16); }

/* 当前所在菜单：背景上扫过一道亮光（background 会被 border-radius 自然裁掉，不会溢出） */
.admin-nav a.is-active {
  background-image:
    linear-gradient(110deg, transparent 28%, rgba(255, 255, 255, .34) 46%, transparent 64%),
    linear-gradient(135deg, var(--accent), var(--accent-deep));
  background-size: 220% 100%, 100% 100%;
  background-position: 220% 0, 0 0;
  background-repeat: no-repeat;
  animation: navSheen 1.15s ease .28s 1 both;
}

@keyframes navSheen {
  from { background-position: -120% 0, 0 0; }
  to   { background-position: 220% 0, 0 0; }
}

/* 左侧那根指示条改成「抽出来」的效果 */
.admin-nav a.is-active::before { animation: navBarIn .42s cubic-bezier(.22, 1, .36, 1) both; }

@keyframes navBarIn {
  from { transform: scaleY(.15); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

.admin-user .au-avatar { transition: transform var(--t-slow) cubic-bezier(.22, 1, .36, 1), box-shadow var(--t-slow); }
.admin-user .au-head:hover .au-avatar {
  transform: scale(1.08);
  box-shadow: var(--ring);
}

/* ---------- 3. 顶栏：滚动时变成一块磨砂玻璃吸在顶部 ---------- */
.admin-top {
  position: sticky;
  top: 8px;
  z-index: 40;
}

.admin-top::after {
  content: "";
  position: absolute;
  inset: -10px -28px -10px;
  border-radius: var(--r-lg);
  background: var(--panel);
  border: 1px solid var(--border-soft);
  box-shadow: 0 10px 26px rgba(30, 80, 120, .13);
  opacity: 0;
  transition: opacity var(--t-slow) ease;
  pointer-events: none;
  z-index: -1;
}

/*
 * 磨砂玻璃只在「真的吸顶」时才挂。
 * backdrop-filter 会强制创建合成层，写在常驻规则里即使 opacity:0 也照样建，
 * 低配/关闭显卡加速的机器上容易让整页发灰，所以放进 is-stuck 里按需启用。
 */
.admin-top.is-stuck::after {
  opacity: 1;
  -webkit-backdrop-filter: blur(12px) saturate(1.15);
  backdrop-filter: blur(12px) saturate(1.15);
}

/* ---------- 4. 统计卡片：悬浮抬升 + 顶部亮线 + 跟着鼠标的光晕 ---------- */
.admin-card {
  position: relative;
  overflow: hidden;
  transition: transform var(--t-base) cubic-bezier(.22, 1, .36, 1), box-shadow var(--t-base), border-color var(--t-base);
}

.admin-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width var(--t-slower) cubic-bezier(.22, 1, .36, 1);
}

.admin-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(130px 80px at var(--mx, 50%) var(--my, 0%), var(--accent-soft), transparent 72%);
  opacity: 0;
  transition: opacity var(--t-slow) ease;
  pointer-events: none;
}

.admin-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-soft);
  box-shadow: var(--shadow-lg);
}

.admin-card:hover::before { width: 100%; }
.admin-card:hover::after { opacity: 1; }

.admin-card b { transition: transform var(--t-base) cubic-bezier(.22, 1, .36, 1); }
.admin-card:hover b { transform: scale(1.07); }

/* 控制台的 KPI 卡片同样跟随鼠标亮一片（它自己已经有上浮动画了） */
.con-kpi { position: relative; overflow: hidden; }

.con-kpi::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(140px 90px at var(--mx, 50%) var(--my, 0%), var(--accent-soft), transparent 72%);
  opacity: 0;
  transition: opacity var(--t-slow) ease;
  pointer-events: none;
}

.con-kpi:hover::after { opacity: 1; }

.ck-value { transition: transform var(--t-base) cubic-bezier(.22, 1, .36, 1); }
.con-kpi:hover .ck-value { transform: scale(1.06); }

/* ---------- 5. 面板：标题前的竖线随悬浮「长高」，整块轻微上抬 ---------- */
.admin-panel { transition: border-color var(--t-base), box-shadow var(--t-base), transform var(--t-base) cubic-bezier(.22, 1, .36, 1); }
.admin-panel:hover { transform: translateY(-2px); }

.admin-panel h2::before { transition: top var(--t-base) ease, bottom var(--t-base) ease; }
.admin-panel:hover h2::before { top: 1px; bottom: 1px; }

/* ---------- 6. 表格：鼠标划过的行左侧亮起一条竖线，前几行逐条淡入 ---------- */
table.data tbody td:first-child { transition: box-shadow var(--t-base); }
table.data tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--accent); }

.admin-main table.data tbody tr:nth-child(-n+12) { animation: rowIn .34s ease both; }
.admin-main table.data tbody tr:nth-child(1) { animation-delay: .03s; }
.admin-main table.data tbody tr:nth-child(2) { animation-delay: .06s; }
.admin-main table.data tbody tr:nth-child(3) { animation-delay: .09s; }
.admin-main table.data tbody tr:nth-child(4) { animation-delay: .12s; }
.admin-main table.data tbody tr:nth-child(5) { animation-delay: .15s; }
.admin-main table.data tbody tr:nth-child(6) { animation-delay: .18s; }
.admin-main table.data tbody tr:nth-child(n+7) { animation-delay: .21s; }

@keyframes rowIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ---------- 7. 提示条：滑入 + 底部倒计时条（鼠标放上去暂停） ---------- */
.alert { overflow: hidden; animation: alertIn .38s cubic-bezier(.22, 1, .36, 1) both; }

@keyframes alertIn {
  from { opacity: 0; transform: translateY(-9px) scale(.995); }
  to   { opacity: 1; transform: none; }
}

.alert.is-out { opacity: 0; transform: translateY(-8px); transition: opacity var(--t-slow), transform var(--t-slow); }

.np-alert-bar {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  background: currentColor;
  opacity: .32;
  transform-origin: left center;
  animation: alertDrain 6s linear forwards;
}

.alert:hover .np-alert-bar { animation-play-state: paused; }

@keyframes alertDrain {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

/* ---------- 8. 按钮 / 胶囊：按下回弹 + 点击水波纹 ---------- */
.admin-body .btn:active,
.login-shell .btn:active,
.admin-body .at-chip:active,
.admin-body .admin-nav a:active { transform: scale(.97); }

.admin-body .btn,
.admin-body .at-chip,
.login-shell .btn { position: relative; overflow: hidden; }

.np-ripple {
  position: absolute;
  border-radius: 50%;
  background: currentColor;
  opacity: .2;
  transform: scale(0);
  animation: npRipple .58s cubic-bezier(.22, 1, .36, 1) forwards;
  pointer-events: none;
}

@keyframes npRipple {
  to { transform: scale(2.6); opacity: 0; }
}

/* 提交中：按钮自带转圈，避免重复点击 */
.btn.is-loading,
.at-chip.is-loading { pointer-events: none; opacity: .75; }

.btn.is-loading::after,
.at-chip.is-loading::after {
  content: "";
  width: 12px;
  height: 12px;
  margin-left: 2px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: transparent;
  animation: npSpin .7s linear infinite;
}

@keyframes npSpin { to { transform: rotate(360deg); } }

/* ---------- 9. 表单：聚焦时整条轻轻抬起 ---------- */
.form-item { transition: transform var(--t-base) ease; }
.form-item:focus-within { transform: translateY(-1px); }

/* ---------- 10. 弹窗 / 全局搜索：关闭时也有个收回去的动作 ---------- */
.np-modal.is-closing .np-modal-mask { animation: modalFadeOut .16s ease both; }
.np-modal.is-closing .np-modal-panel { animation: modalOut .16s ease both; }

@keyframes modalFadeOut { to { opacity: 0; } }
@keyframes modalOut {
  to { opacity: 0; transform: translateY(8px) scale(.985); }
}

/* ---------- 11. 回到顶部 ---------- */
.admin-topbtn {
  position: fixed;
  right: 24px;
  bottom: 26px;
  z-index: 300;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--accent-deep);
  font-size: 17px;
  box-shadow: 0 10px 24px rgba(30, 80, 120, .18);
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px) scale(.88);
  pointer-events: none;
  transition: opacity var(--t-slow) ease, transform var(--t-slow) cubic-bezier(.22, 1, .36, 1), border-color var(--t-base);
}

.admin-topbtn.is-on { opacity: 1; transform: none; pointer-events: auto; }
.admin-topbtn:hover { border-color: var(--accent); }

/* ---------- 12. 移动端抽屉：遮罩淡入 ---------- */
.admin-mask { animation: maskIn .22s ease both; }

@keyframes maskIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ---------- 13. 小屏：顶栏不做吸顶（手机上太高会挡内容） ---------- */
@media (max-width: 900px) {
  .admin-top { position: static; top: auto; }
  .admin-top::after { display: none; }
}

/* ---------- 14. 系统开启「减少动态效果」时全部停掉 ---------- */
@media (prefers-reduced-motion: reduce) {
  .admin-main > *,
  .admin-nav a.is-active,
  .admin-nav a.is-active::before,
  .admin-card,
  .admin-card::before,
  .admin-card::after,
  .con-kpi,
  .con-kpi::after,
  .admin-panel,
  .alert,
  .np-alert-bar,
  .admin-mask,
  .np-modal.is-closing .np-modal-mask,
  .np-modal.is-closing .np-modal-panel,
  .admin-main table.data tbody tr,
  .btn.is-loading::after,
  .at-chip.is-loading::after {
    animation: none !important;
    transition: none !important;
  }
  .admin-card:hover,
  .con-kpi:hover,
  .admin-panel:hover,
  .form-item:focus-within { transform: none !important; }
  .admin-main table.data tbody tr:nth-child(-n+12) { opacity: 1 !important; }
}

/* ==========================================================================
   更多动效（v1.30.0）

   一层是「全站通用」（顶部进度条 / 主题扩散 / 页脚数字），前后台都吃；
   一层是「后台补充」（弹窗、命令面板、表格操作、空状态、上传、侧栏渐隐…）。
   规则同 v1.29.0：新加的入场动效一律只做位移，不动 opacity —— 万一动画时钟没走完，
   最坏也只是内容偏几像素，绝不会让页面发灰看不见。
   ========================================================================== */

/* ---------- 1. 顶部加载进度条（全站） ---------- */
.np-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 99999;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--t-slower) ease;
}

.np-progress.is-on { opacity: 1; }

.np-progress i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 0 var(--r-xs) var(--r-xs) 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent));
  background-size: 220% 100%;
  box-shadow: 0 0 10px rgba(63, 182, 221, .55);
  transition: width var(--t-slow) cubic-bezier(.22, 1, .36, 1);
  animation: npBarFlow 1.1s linear infinite;
}

@keyframes npBarFlow { to { background-position: 220% 0; } }

/* ---------- 2. 主题切换：从点击处圆形扩散（不支持 View Transitions 的浏览器自动忽略） ---------- */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

::view-transition-old(root) { z-index: 1; }

/*
 * 只给「主题切换」用：这个圆形扩散的圆心是点击位置，
 * 页面跳转时没有圆心，套上去会变成一坨莫名其妙的圆圈擦除。
 * 所以加一个 html.np-theme-swap 限定，跳转的过渡交给 premium.css 里的另一套。
 */
html.np-theme-swap ::view-transition-new(root) {
  z-index: 2;
  animation: npThemeReveal .52s cubic-bezier(.22, 1, .36, 1) both;
}

@keyframes npThemeReveal {
  from { clip-path: circle(0 at var(--np-x, 50%) var(--np-y, 0%)); }
  to   { clip-path: circle(var(--np-r, 150%) at var(--np-x, 50%) var(--np-y, 0%)); }
}

/* ---------- 3. 页脚统计数字：落定时轻轻弹一下 ---------- */
.footer-stats .stat-num.is-landed { animation: numPop .38s cubic-bezier(.22, 1, .36, 1); }

@keyframes numPop {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.14); }
  100% { transform: scale(1); }
}

/* ---------- 4. 后台侧栏：当前菜单图标弹一下 ---------- */
.admin-nav a.is-active .ni { animation: navIconPop .5s cubic-bezier(.34, 1.56, .64, 1) both; }

@keyframes navIconPop {
  0%   { transform: scale(.6); }
  60%  { transform: scale(1.16); }
  100% { transform: none; }
}

/* 侧栏内容超出时可上下滚动，滚动条位置的渐变提示（只在大屏的吸顶侧栏上做） */
@media (min-width: 901px) {
  .admin-side { transition: box-shadow var(--t-slow) ease; }
  /* is-hide-above：上方还有内容被挡住 */
  .admin-side.is-hide-above {
    box-shadow: inset 0 16px 16px -16px rgba(30, 80, 120, .45);
  }
  .admin-side.is-hide-both {
    box-shadow: inset 0 16px 16px -16px rgba(30, 80, 120, .45),
                inset 0 -16px 16px -16px rgba(30, 80, 120, .45);
  }
  /* is-hide-below：下方还有内容被挡住 */
  .admin-side.is-hide-below {
    box-shadow: inset 0 -16px 16px -16px rgba(30, 80, 120, .45);
  }
}

/* ---------- 5. 后台面板：鼠标划过扫一道柔光 ---------- */
.admin-panel:hover {
  background-image: linear-gradient(105deg, transparent 40%, var(--accent-soft) 50%, transparent 60%);
  background-size: 250% 100%;
  animation: panelSheen 1s ease;
}

@keyframes panelSheen {
  from { background-position: -150% 0; }
  to   { background-position: 150% 0; }
}

/* ---------- 6. 后台表格：鼠标所在行的操作按钮轻轻抬起 ---------- */
table.data tbody td.actions .btn {
  transition: transform .18s ease, border-color .18s, background .18s, color .18s;
}

table.data tbody tr:hover td.actions .btn { transform: translateY(-1px); }

/* ---------- 7. 后台 KPI 图标：悬停弹跳 ---------- */
.ck-icon { transition: transform var(--t-slow) cubic-bezier(.22, 1, .36, 1); }
.con-kpi:hover .ck-icon { transform: scale(1.12) rotate(-4deg); }

/* 数字滚完时弹一下（admin.js 会给元素加 is-landed） */
.admin-card b.is-landed,
.ck-value.is-landed,
.stat-box b.is-landed { animation: numPop .38s cubic-bezier(.22, 1, .36, 1); }

/* ---------- 8. 后台弹窗：内容一条条滑进来（只做位移，不做淡入） ---------- */
.np-modal-body > * { animation: npSlideIn .3s cubic-bezier(.22, 1, .36, 1) both; }
.np-modal-body > *:nth-child(2) { animation-delay: .04s; }
.np-modal-body > *:nth-child(3) { animation-delay: .08s; }
.np-modal-body > *:nth-child(4) { animation-delay: .12s; }
.np-modal-body > *:nth-child(5) { animation-delay: .16s; }
.np-modal-body > *:nth-child(6) { animation-delay: .20s; }
.np-modal-body > *:nth-child(n+7) { animation-delay: .24s; }

@keyframes npSlideIn {
  from { transform: translateX(-8px); }
  to   { transform: none; }
}

/* ---------- 9. 后台命令面板（Ctrl/⌘ + K）：结果逐条滑入 ---------- */
.nq-item { animation: npSlideIn .26s cubic-bezier(.22, 1, .36, 1) both; }
.nq-item:nth-child(2) { animation-delay: .03s; }
.nq-item:nth-child(3) { animation-delay: .06s; }
.nq-item:nth-child(4) { animation-delay: .09s; }
.nq-item:nth-child(5) { animation-delay: .12s; }
.nq-item:nth-child(n+6) { animation-delay: .15s; }

/* ---------- 10. 空状态：图标慢慢浮动 ---------- */
.empty .emoji { animation: npFloat 3.4s ease-in-out infinite; }

@keyframes npFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-7px); }
}

/* ---------- 11. 后台上传：进度条上走一道流光 ---------- */
.nu-progress i { position: relative; overflow: hidden; }
.nu-progress i::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent);
  transform: translateX(-100%);
  animation: npShimmer 1.1s linear infinite;
}

@keyframes npShimmer { to { transform: translateX(100%); } }

/* ---------- 12. 表单校验没通过：抖一下，指出问题在哪 ---------- */
.np-shake { animation: npShake .38s cubic-bezier(.36, .07, .19, .97) both; }

@keyframes npShake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-5px); }
  40%      { transform: translateX(5px); }
  60%      { transform: translateX(-3px); }
  80%      { transform: translateX(3px); }
}

/* ---------- 13. 复制成功：扩散一圈光圈 ---------- */
.is-done { animation: npDonePop .55s ease; }

@keyframes npDonePop {
  0%   { box-shadow: 0 0 0 0 rgba(76, 199, 154, .55); }
  100% { box-shadow: 0 0 0 12px rgba(76, 199, 154, 0); }
}

/* ---------- 14. 系统开启「减少动态效果」时，这一批也全部停掉 ---------- */
@media (prefers-reduced-motion: reduce) {
  .np-progress i,
  .footer-stats .stat-num.is-landed,
  .admin-nav a.is-active .ni,
  .admin-card b.is-landed,
  .ck-value.is-landed,
  .stat-box b.is-landed,
  .admin-panel:hover,
  .np-modal-body > *,
  .nq-item,
  .empty .emoji,
  .nu-progress i::after,
  .np-shake,
  .is-done {
    animation: none !important;
  }
  ::view-transition-new(root) { animation: none !important; }
}

/* ==========================================================================
   控制台改版（v1.31.0）

   顶部换成「今日概览」chip 行，指标卡多带一句实际情况，
   访问趋势支持 7 / 30 天切换，右侧「系统与安全」升级成带状态的「站点健康」清单。
   ========================================================================== */

/* ---------- 1. 顶部：今日概览 ---------- */
.con-today { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

.ct-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--panel);
  font-size: 12.5px;
  color: var(--text-dim);
  transition: border-color .18s, color .18s, transform .18s;
}

.ct-chip b { font-family: var(--mono); color: var(--text); }
.ct-chip:hover { border-color: var(--accent); color: var(--accent-deep); transform: translateY(-1px); }
.ct-chip.is-plain { border-style: dashed; color: var(--muted); }

.ct-chip.is-alert {
  border-color: rgba(245, 158, 11, .55);
  background: rgba(245, 158, 11, .1);
  color: #a8710a;
}
.ct-chip.is-alert b { color: #a8710a; }

/* 有待处理时闪一下的小圆点 */
.ct-dot {
  width: 6px;
  height: 6px;
  margin-left: 2px;
  border-radius: 50%;
  background: #ef4444;
  animation: ctPulse 1.8s ease-in-out infinite;
}

@keyframes ctPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .35; transform: scale(.7); }
}

/* ---------- 2. 指标卡副信息 ---------- */
.ck-sub {
  display: block;
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- 3. 面板标题右侧：区间切换 ---------- */
.con-head-side { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.con-range {
  display: inline-flex;
  padding: 2px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--panel-2);
}

.con-range button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: background .18s, color .18s;
}

.con-range button:hover { color: var(--accent-deep); }

.con-range button.is-on {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff;
  font-weight: 600;
  box-shadow: var(--shadow);
}

.con-more.is-alert { color: #a8710a; font-weight: 600; }
a.con-more.is-alert:hover { color: #8a5c07; }

/* ---------- 4. 站点健康清单 ---------- */
.hc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }

.hc-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--r-sm);
  background: var(--panel-2);
  font-size: 12.5px;
  transition: background .18s, transform .18s;
}

.hc-item:hover { background: var(--accent-soft); transform: translateX(2px); }
.hc-item b { flex: 0 0 auto; font-weight: 600; color: var(--text-dim); white-space: nowrap; }

.hc-dot {
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, .16);
}

.hc-item.is-warn  .hc-dot { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, .18); }
.hc-item.is-info  .hc-dot { background: var(--accent); box-shadow: var(--ring); }
.hc-item.is-error .hc-dot {
  background: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, .18);
  animation: ctPulse 1.6s ease-in-out infinite;
}

.hc-val {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hc-item.is-warn  .hc-val { color: #a8710a; }
.hc-item.is-error .hc-val { color: #d15555; }

.hc-go {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
  opacity: .5;
  transition: opacity .18s, color .18s, transform .18s;
}

.hc-item:hover .hc-go { opacity: 1; color: var(--accent-deep); transform: translateX(2px); }

/* ---------- 5. 待办列表：图标 + 悬浮位移 ---------- */
.con-todo { transition: background .18s, transform .18s, border-color .18s; }
.con-todo:hover { transform: translateX(2px); }
.con-todo .ct-text { flex: 1 1 auto; }

.ct-icon {
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  background: var(--panel);
  font-size: 13px;
  line-height: 1;
}

/* ---------- 6. 草稿徽章 ---------- */
.badge-draft { background: rgba(123, 142, 163, .2); color: #7b8ea3; }

/* ---------- 7. 小屏收敛 ---------- */
@media (max-width: 900px) {
  .con-today { gap: 6px; }
  .ct-chip { padding: 4px 10px; font-size: 12px; }
  .con-head-side { width: 100%; justify-content: space-between; }
  .hc-val { white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  .ct-dot,
  .hc-item.is-error .hc-dot { animation: none !important; }
  .ct-chip:hover,
  .hc-item:hover,
  .con-todo:hover { transform: none !important; }
}

/* ==========================================================================
   后台 AJAX 交互（v1.32.0）

   列表里的常用操作改成不跳页：按钮转圈 → 顶部提示条 → 只换 .admin-main 的内容。
   ========================================================================== */

/* ---------- 1. 提示条 ----------
   前台那套 toast 是白底 + var(--text)，而后台默认深色底、--text 是浅色，
   直接复用会「白底浅字」看不清，所以这里单独定一套。 */
.admin-body .toast-wrap {
  top: auto;
  bottom: 26px;
  z-index: 9000;
  flex-direction: column-reverse;
}

.admin-body .toast {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .34);
  max-width: min(560px, calc(100vw - 32px));
  text-align: left;
}

.admin-body .toast.is-ok {
  background: rgba(34, 197, 94, .16);
  border-color: rgba(34, 197, 94, .5);
  color: #4ade80;
}

.admin-body .toast.is-err {
  background: rgba(239, 68, 68, .16);
  border-color: rgba(239, 68, 68, .5);
  color: #f98a8a;
}

/* 浅色主题下把绿/红压暗一点，白底上才够对比 */
[data-theme="light"] .admin-body .toast.is-ok { color: #1f8a58; }
[data-theme="light"] .admin-body .toast.is-err { color: #c0392b; }

/* ---------- 2. 局部刷新中：顶部走一条细光条，同时暂时不接受点击 ---------- */
.admin-main.is-swapping { pointer-events: none; }

.admin-main.is-swapping::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 99998;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent-2), transparent);
  background-size: 55% 100%;
  background-repeat: no-repeat;
  animation: swapSweep .9s linear infinite;
}

@keyframes swapSweep {
  from { background-position: -55% 0; }
  to   { background-position: 155% 0; }
}

/* ---------- 3. 小屏收敛 ---------- */
@media (max-width: 900px) {
  .admin-body .toast-wrap { bottom: 16px; }
  .admin-body .toast { font-size: 13px; padding: 9px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .admin-main.is-swapping::before { animation: none !important; }
  .admin-body .toast { animation: none !important; }
}

/* ==========================================================================
   收藏 / 阅读历史 / Markdown 导出（v1.33.0）
   ========================================================================== */

/* ---------- 1. 文章页的收藏按钮（和点赞按钮同一套外壳） ---------- */
.fav-btn { cursor: pointer; }
.fav-btn .fb-icon { font-size: 14px; line-height: 1; }

.fav-btn.is-on {
  border-color: #f0c419;
  color: #a3771a;
  background: rgba(255, 200, 87, .16);
}

.fav-btn.is-busy { opacity: .65; }
.fav-btn.is-pop  { animation: likePop .42s cubic-bezier(.2, 1.6, .4, 1); }
.fav-btn.is-shake { animation: likeShake .4s ease; }

/* 深色主题下把选中态的底色压深一点 */
[data-theme="dark"] .fav-btn.is-on {
  border-color: rgba(255, 200, 87, .5);
  color: #ffd479;
  background: rgba(255, 200, 87, .14);
}

/* ---------- 2. 侧栏「最近看过」 ---------- */
.hist-list { list-style: none; margin: 0; padding: 0; }

.hist-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--border-soft);
  font-size: 13px;
}

.hist-list li:last-child { border-bottom: 0; }

.hist-list a {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--text-dim);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color .18s, transform .18s;
}

.hist-list li:hover a { color: var(--accent-deep); transform: translateX(2px); }

.hist-list em {
  flex: 0 0 auto;
  font-style: normal;
  font-size: 11.5px;
  color: var(--muted);
}

/* ---------- 3. 个人中心「我的收藏」列表 ---------- */
.fav-list { list-style: none; margin: 0; padding: 0; }

.fav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 2px;
  border-bottom: 1px dashed var(--border-soft);
}

.fav-item:last-child { border-bottom: 0; }

.fav-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 14.5px;
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fav-title:hover { color: var(--accent-deep); }

.fav-meta {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

/* ---------- 4. 导出 Markdown 的提示条（后台批量导出用） ---------- */
.md-tip {
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  background: var(--accent-soft);
  border: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-dim);
}

/* ---------- 5. 小屏 ---------- */
@media (max-width: 640px) {
  .fav-item { flex-direction: column; align-items: flex-start; gap: 4px; }
  .fav-title { white-space: normal; }
}

/* ==========================================================================
   全站搜索页（v1.33.0）
   ========================================================================== */

/* ---------- 1. 搜索框 ---------- */
.search-form {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 8px 10px 8px 16px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow);
  transition: border-color var(--t-base), box-shadow var(--t-base);
}

.search-form:focus-within {
  border-color: var(--accent);
  box-shadow: var(--ring);
}

.sf-icon { flex: 0 0 auto; opacity: .7; font-size: 15px; }

.sf-input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  padding: 8px 0;
}

/* 去掉 Safari / Chrome 给 type=search 加的原生叉号，和整体风格不搭 */
.sf-input::-webkit-search-cancel-button { -webkit-appearance: none; }

/* ---------- 2. 结果卡片 ---------- */
.sr-list { display: flex; flex-direction: column; gap: 12px; }

.sr-item {
  display: block;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--panel);
  text-decoration: none;
  transition: transform .18s, border-color .18s, box-shadow .18s;
}

.sr-item:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow-lg);
}

.sr-top { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }

.sr-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 15.5px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sr-item:hover .sr-title { color: var(--accent-deep); }

.sr-kind {
  flex: 0 0 auto;
  padding: 1px 9px;
  border-radius: var(--r-sm);
  font-size: 11.5px;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.sr-kind.is-daily { background: var(--pink-soft); color: #d1628c; }
.sr-kind.is-demo  { background: var(--accent-2-soft); color: #a3771a; }
.sr-kind.is-log   { background: rgba(76, 199, 154, .16); color: #2f9d74; }
.sr-kind.is-album { background: rgba(124, 58, 237, .14); color: #7c3aed; }
.sr-kind.is-link  { background: rgba(14, 165, 233, .14); color: #0284c7; }

.sr-snippet {
  margin: 0 0 8px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text-dim);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sr-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}

.sr-tag { color: var(--accent-deep); opacity: .8; }

/* 命中关键词的高亮 */
.sr-item mark,
.search-page mark {
  background: rgba(255, 200, 87, .38);
  color: inherit;
  border-radius: var(--r-xs);
  padding: 0 2px;
}

[data-theme="dark"] .sr-item mark { background: rgba(255, 200, 87, .26); color: #ffe6a8; }

/* ---------- 3. 「其它类型」小组 ---------- */
.sr-side { margin-top: 22px; }

.sr-side-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.sr-side-head h2 { margin: 0; font-size: 16px; }

.sr-item.is-compact { padding: 11px 16px; }
.sr-item.is-compact .sr-snippet { margin-bottom: 0; -webkit-line-clamp: 1; }

.sr-meta-inline { flex: 0 0 auto; font-size: 12px; color: var(--muted); }

/* ---------- 4. 小屏 ---------- */
@media (max-width: 640px) {
  .search-form { padding: 6px 8px 6px 14px; }
  .search-form .btn { padding: 8px 14px; font-size: 13px; }
  .sr-title { white-space: normal; }
  .sr-top { flex-wrap: wrap; }
}

/* ==========================================================================
   站点公告条（v1.34.0）

   出现在每一页最顶部，多条自动轮播；访客关掉之后只记在本机。
   ========================================================================== */
.np-notice-bar {
  position: relative;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 46px 9px 18px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text);
  background: var(--accent-soft);
  border-bottom: 1px solid var(--border);
}

/* 按公告类型换配色 */
.np-notice-bar[data-level="warn"] {
  background: rgba(245, 158, 11, .14);
  border-bottom-color: rgba(245, 158, 11, .35);
  color: #a8710a;
}

.np-notice-bar[data-level="ok"] {
  background: rgba(34, 197, 94, .13);
  border-bottom-color: rgba(34, 197, 94, .32);
  color: #1f8a58;
}

.np-notice-bar[data-level="hot"] {
  background: linear-gradient(90deg, rgba(255, 110, 199, .16), rgba(56, 224, 255, .16));
  border-bottom-color: var(--border);
}

[data-theme="dark"] .np-notice-bar { color: var(--text); }
[data-theme="dark"] .np-notice-bar[data-level="warn"] { color: #ffd479; }
[data-theme="dark"] .np-notice-bar[data-level="ok"]   { color: #6ee7a8; }

.nn-icon { flex: 0 0 auto; font-size: 15px; }

.nn-viewport {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}

/* 轮播：同一位置上下叠放，只显示 .is-on 的那条 */
.nn-item {
  display: none;
  min-width: 0;
}

.nn-item.is-on {
  display: block;
  animation: nnIn .34s cubic-bezier(.22, 1, .36, 1) both;
}

@keyframes nnIn {
  from { transform: translateY(6px); }
  to   { transform: none; }
}

.nn-item a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.nn-item a:hover { opacity: .82; }

.nn-dots {
  flex: 0 0 auto;
  font-size: 11.5px;
  opacity: .5;
  animation: nnPulse 2.4s ease-in-out infinite;
}

@keyframes nnPulse {
  0%, 100% { opacity: .3; }
  50%      { opacity: .85; }
}

.nn-close {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  opacity: .5;
  font-size: 13px;
  cursor: pointer;
  transition: opacity .18s, background .18s;
}

.nn-close:hover { opacity: 1; background: rgba(127, 127, 127, .16); }

/* 后台「前台效果预览」用的静态样式 */
.np-notice-bar.is-preview {
  position: static;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  padding-right: 18px;
  margin-bottom: 4px;
}

.np-notice-bar.is-preview .nn-text { flex: 1 1 auto; min-width: 0; }

@media (max-width: 640px) {
  .np-notice-bar { padding: 8px 42px 8px 14px; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .nn-item.is-on,
  .nn-dots { animation: none !important; }
}

/* ==========================================================================
   友链申请（v1.34.0）
   ========================================================================== */

/* ---------- 1. 前台表单（links.php） ---------- */
.link-apply-form .form-item { margin-bottom: 12px; }

/* 蜜罐：正常访客看不到，机器人爱填 */
.la-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.la-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.la-msg { font-size: 13px; line-height: 1.6; }
.la-msg.is-ok  { color: #2f9d74; }
.la-msg.is-err { color: #d15555; }

/* 宽屏两列、窄屏一列：整张表短一截，不用从头滚到尾 */
.la-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

[data-theme="dark"] .la-msg.is-ok { color: #6ee7a8; }

/* ---------- 2. 后台审核卡片 ---------- */
.la-item {
  padding: 14px 16px;
  margin-bottom: 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--panel-2);
  transition: border-color .18s, transform .18s;
}

.la-item:hover { border-color: var(--accent-soft); transform: translateX(2px); }

.la-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.la-head b { font-size: 14.5px; }

.la-url {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--accent-deep);
  word-break: break-all;
}

.la-desc { margin: 6px 0 0; font-size: 13.5px; color: var(--text-dim); }

.la-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--muted);
}

.la-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.la-form .input { flex: 1 1 220px; min-width: 150px; }

/* ==========================================================================
   前台阅读辅助（v1.34.0）

   顶栏搜索 / 朗读 / 专注模式 / 字体族 / 继续阅读 / 快捷键面板
   ========================================================================== */

/* ---------- 1. 顶栏搜索 ---------- */
.nav-search { position: relative; display: flex; align-items: center; }

.ns-toggle { display: grid; }

.ns-form {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  display: none;
  align-items: center;
  gap: 6px;
  padding: 6px 8px 6px 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow-lg);
  z-index: 95;
  transition: border-color var(--t-base), box-shadow var(--t-base);
}

.nav-search.is-open .ns-form { display: flex; }

.ns-form:focus-within {
  border-color: var(--accent);
  box-shadow: var(--ring);
}

.ns-form input {
  width: 168px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  padding: 5px 0;
}

.ns-form input::-webkit-search-cancel-button { -webkit-appearance: none; }

.ns-go {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 13px;
  cursor: pointer;
}

.ns-go:hover { background: var(--accent); color: #fff; }

/* 下拉建议 */
.ns-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 6px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow-lg);
  z-index: 95;
}

.ns-panel[hidden] { display: none; }

.ns-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  color: var(--text-dim);
  text-decoration: none;
}

.ns-item:hover,
.ns-item.is-active { background: var(--accent-soft); color: var(--accent-deep); }

.ns-ic { flex: 0 0 18px; text-align: center; opacity: .8; }
.ns-ti { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ns-me { flex: 0 0 auto; font-size: 11.5px; color: var(--muted); }
.ns-empty { padding: 14px 12px; font-size: 13px; color: var(--muted); text-align: center; }

@media (max-width: 900px) {
  .ns-toggle { display: grid; }

  /* 小屏搜索框改成挂在整条顶栏上，否则右对齐到那个 30px 的小圆钮会飘出屏幕 */
  .nav-search { position: static; }

  .ns-form {
    top: calc(100% + 8px);
    right: 0;
    padding: 6px 8px 6px 14px;
  }

  .nav-search.is-open .ns-form { display: flex; }
  .ns-form input { width: 190px; }
  .ns-panel { width: 260px; }
}

/* ---------- 2. 阅读辅助按钮：合成一行，用细线分组 ---------- */
.read-tools {
  flex-wrap: wrap;
  row-gap: 6px;
  padding: 5px 10px;
  border-radius: var(--r-md);
  max-width: 100%;
}

.rt-sep {
  width: 1px;
  height: 16px;
  margin: 0 3px;
  background: var(--border);
  flex: 0 0 1px;
}

.read-tools .rt-btn { min-width: 36px; padding: 4px 9px; font-size: 12.5px; }

@media (max-width: 560px) {
  .rt-sep { display: none; }
}

/* ---------- 3. 字体族 ---------- */
body.read-font-serif .article-body {
  font-family: Georgia, "Songti SC", "Noto Serif SC", "Source Han Serif SC", "SimSun", serif;
  font-size: 16px;
  line-height: 1.95;
}

body.read-font-mono .article-body {
  font-family: var(--mono);
  font-size: 14.5px;
  line-height: 1.9;
}

/* ---------- 4. 专注模式 ---------- */
body.is-focus .sidebar,
body.is-focus .hero,
body.is-focus .site-footer,
body.is-focus .toc-side { display: none !important; }

body.is-focus .layout { grid-template-columns: minmax(0, 1fr) !important; }

body.is-focus .article-card {
  max-width: 860px;
  margin: 0 auto;
}

/* 顶栏淡出但鼠标一碰就回来，方便随时退出 */
body.is-focus .site-header { opacity: .28; transition: opacity var(--t-slow) ease; }
body.is-focus .site-header:hover { opacity: 1; }

/* ---------- 5. 继续阅读提示 ---------- */
.read-resume {
  position: fixed;
  left: 20px;
  bottom: 22px;
  z-index: 120;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 10px 16px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  color: var(--text-dim);
  animation: rrIn .32s cubic-bezier(.22, 1, .36, 1) both;
}

@keyframes rrIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.read-resume b { color: var(--accent-deep); font-family: var(--mono); }

.read-resume button {
  border: 0;
  border-radius: var(--r-pill);
  padding: 5px 14px;
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
}

.read-resume button:hover { filter: brightness(1.06); }

.read-resume i {
  font-style: normal;
  cursor: pointer;
  opacity: .45;
  padding: 0 4px;
}

.read-resume i:hover { opacity: 1; }

@media (max-width: 640px) {
  .read-resume { left: 12px; right: 12px; bottom: 12px; }
}

/* ---------- 6. 快捷键面板 ---------- */
.np-keysheet {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(10, 22, 34, .48);
  backdrop-filter: blur(3px);
}

.np-keysheet[hidden] { display: none; }

.ks-box {
  width: min(420px, 100%);
  padding: 22px 24px 18px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow-lg);
  animation: lbZoom .2s ease both;
}

.ks-box h3 { margin: 0 0 14px; font-size: 16px; }

.ks-box ul { list-style: none; margin: 0; padding: 0; }

.ks-box li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--border-soft);
  font-size: 13.5px;
  color: var(--text-dim);
}

.ks-box li:last-child { border-bottom: 0; }

.ks-box kbd {
  flex: 0 0 108px;
  text-align: center;
  padding: 4px 8px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--panel-2);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
}

.ks-close {
  margin-top: 14px;
  width: 100%;
  padding: 9px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}

.ks-close:hover { border-color: var(--accent); color: var(--accent-deep); }

@media (prefers-reduced-motion: reduce) {
  .read-resume,
  .ks-box { animation: none !important; }
}

/* ---------- 7. 个人中心「我的足迹」时间线 ---------- */
.trail-list { list-style: none; margin: 0; padding: 0; }

.trail-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 2px;
  border-bottom: 1px dashed var(--border-soft);
  font-size: 14px;
}

.trail-item:last-child { border-bottom: 0; }

.trail-ic { flex: 0 0 auto; font-size: 15px; }

.trail-kind {
  flex: 0 0 auto;
  padding: 1px 8px;
  border-radius: var(--r-sm);
  font-size: 11.5px;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.trail-item.is-fav .trail-kind { background: rgba(255, 200, 87, .2); color: #a3771a; }
.trail-item.is-msg .trail-kind { background: var(--pink-soft); color: #d1628c; }

.trail-title {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trail-title:hover { color: var(--accent-deep); }

.trail-time { flex: 0 0 auto; font-size: 12px; color: var(--muted); }

@media (max-width: 640px) {
  .trail-item { flex-wrap: wrap; }
  .trail-title { white-space: normal; }
}

/* ==========================================================================
   后台新增页面：搜索热词 / 发布日历 / 运维清理（v1.34.0）
   ========================================================================== */

/* ---------- 1. 搜索热词排行 ---------- */
.sw-list { display: flex; flex-direction: column; gap: 6px; }

.sw-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  background: var(--panel-2);
  font-size: 13px;
  transition: background .18s, transform .18s;
}

.sw-item:hover { background: var(--accent-soft); transform: translateX(2px); }

.sw-no {
  flex: 0 0 22px;
  text-align: center;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.sw-no.is-top { color: var(--accent-deep); font-weight: 700; }

.sw-term {
  flex: 0 0 auto;
  max-width: 190px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sw-term:hover { color: var(--accent-deep); }

.sw-bar {
  flex: 1 1 auto;
  min-width: 60px;
  height: 6px;
  border-radius: var(--r-sm);
  background: var(--border-soft);
  overflow: hidden;
}

.sw-bar i {
  display: block;
  height: 100%;
  border-radius: var(--r-sm);
  background: linear-gradient(90deg, var(--accent), var(--accent-deep));
}

.sw-n { flex: 0 0 auto; font-family: var(--mono); font-size: 13px; }

.sw-zero {
  flex: 0 0 auto;
  padding: 1px 8px;
  border-radius: var(--r-sm);
  background: rgba(217, 147, 15, .16);
  color: #a8710a;
  font-size: 11.5px;
}

.sw-del {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  opacity: .5;
  padding: 2px 6px;
}

.sw-del:hover { opacity: 1; color: var(--danger); }

/* ---------- 2. 发布日历 ---------- */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.cal-head {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  padding: 4px 0;
}

.cal-cell {
  min-height: 84px;
  padding: 6px 8px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-soft);
  background: var(--panel-2);
  transition: border-color .18s, background .18s;
}

.cal-cell.is-empty { background: transparent; border-color: transparent; }
.cal-cell.has-item { border-color: var(--accent-soft); background: var(--panel); }
.cal-cell.has-item:hover { border-color: var(--accent); }

.cal-cell.is-today {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent-soft);
}

.cal-d { font-family: var(--mono); font-size: 12.5px; color: var(--text-dim); }
.cal-cell.is-today .cal-d { color: var(--accent-deep); font-weight: 700; }

.cal-n {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--muted);
}

.cal-list { display: flex; flex-direction: column; gap: 4px; margin-top: 5px; }

.cal-item {
  display: block;
  padding: 2px 6px;
  border-radius: var(--r-xs);
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 11.5px;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cal-item:hover { filter: brightness(.95); }
.cal-item.is-daily { background: var(--pink-soft); color: #d1628c; }
.cal-item.is-draft { background: rgba(123, 142, 163, .2); color: #7b8ea3; }

.cal-more { font-size: 11.5px; color: var(--muted); }

@media (max-width: 900px) {
  .cal-cell { min-height: 60px; padding: 4px 5px; }
  .cal-item { display: none; }
  .cal-cell.has-item::after {
    content: "";
    display: block;
    width: 6px;
    height: 6px;
    margin-top: 5px;
    border-radius: 50%;
    background: var(--accent);
  }
}

/* ---------- 3. 运维清理卡片 ---------- */
.mt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.mt-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--panel-2);
  transition: border-color .18s, transform .18s;
}

.mt-card:hover { border-color: var(--accent-soft); transform: translateY(-2px); }
.mt-card b { font-size: 14px; }
.mt-card span { flex: 1 1 auto; font-size: 12.5px; color: var(--muted); line-height: 1.7; }
.mt-card .btn { align-self: flex-start; }

/* ==========================================================================
   后台细节打磨（v1.35.0）
   ========================================================================== */

/* ---------- 1. 侧栏菜单筛选 ----------
   菜单涨到 20 多项之后，找一项要滚半天，给个边打边筛的输入框。 */
.nav-filter { padding: 0 8px 10px; }

.nav-filter input {
  width: 100%;
  padding: 7px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font-family: inherit;
  font-size: 12.5px;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}

.nav-filter input:focus {
  border-color: var(--accent);
  box-shadow: var(--ring);
}

.nav-filter input::-webkit-search-cancel-button { -webkit-appearance: none; }

/* hidden 属性会被 .admin-nav a 的 display:flex 盖掉，这里必须显式处理 */
.admin-nav a[hidden],
.admin-nav .nav-group[hidden] { display: none !important; }

.admin-nav.is-empty::after {
  content: "没有匹配的菜单项";
  display: block;
  padding: 14px 12px;
  font-size: 12.5px;
  color: var(--muted);
}

/* ---------- 2. 侧栏更紧凑一点，一屏能多放几项 ---------- */
.admin-nav a { padding: 8px 12px; }
.admin-nav .nav-group { padding: 12px 12px 5px; }

/* ---------- 3. 数字卡片：值还没数完时别看起来像 0 ---------- */
.admin-card b,
.ck-value,
.stat-box b {
  font-variant-numeric: tabular-nums;   /* 等宽数字，滚动时不会左右抖 */
}

/* ==========================================================================
   修订历史（v1.36.0）
   ========================================================================== */
.rev-list { list-style: none; margin: 0; padding: 0; }

.rev-item {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 11px 2px;
  border-bottom: 1px dashed var(--border-soft);
  font-size: 13px;
}

.rev-item:last-child { border-bottom: 0; }

.rev-time {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-dim);
}

.rev-meta {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--muted);
}

.rev-diff {
  padding: 0 6px;
  border-radius: var(--r-xs);
  font-family: var(--mono);
  font-size: 11.5px;
}

.rev-diff.is-up   { background: rgba(34, 197, 94, .16); color: #1f8a58; }
.rev-diff.is-down { background: rgba(239, 68, 68, .16); color: #c0392b; }

[data-theme="dark"] .rev-diff.is-up   { color: #6ee7a8; }
[data-theme="dark"] .rev-diff.is-down { color: #f98a8a; }

.rev-title {
  flex: 1 1 200px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-dim);
}

.rev-actions { flex: 0 0 auto; display: inline-flex; gap: 6px; flex-wrap: wrap; }

@media (max-width: 900px) {
  .rev-title { flex-basis: 100%; white-space: normal; }
}

/* ==========================================================================
   打印样式（v1.36.0）

   有人喜欢把文章打印出来看。打印时把导航、侧栏、按钮、弹窗统统拿掉，
   只留正文，并把正文里的外链地址用括号补在文字后面。
   ========================================================================== */
@media print {
  .site-header,
  .main-nav,
  .nav-search,
  .sidebar,
  .side-order,
  .site-footer,
  .hero,
  .page-head,
  .toast-wrap,
  .np-notice-bar,
  .article-share,
  .share-btn,
  .read-tools,
  .toc-side,
  .to-top,
  .read-resume,
  .np-keysheet,
  .np-progress,
  .music-card,
  .comment-form,
  .pager,
  .chip-row,
  .post-list .pager {
    display: none !important;
  }

  html, body {
    background: #fff !important;
    color: #000 !important;
    font-size: 11.5pt;
    line-height: 1.75;
  }

  .container { max-width: none; padding: 0; }
  .layout { display: block !important; }

  .card,
  .article-card,
  .post-card,
  .admin-panel {
    box-shadow: none !important;
    border: 0 !important;
    background: #fff !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .article-body, .article-body * { color: #000 !important; }

  /* 打印时把外链地址补出来，纸上点不了链接 */
  .article-body a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 9.5pt;
    color: #555;
    word-break: break-all;
  }

  .article-body pre,
  .article-body blockquote,
  .article-body table {
    border: 1px solid #bbb !important;
    page-break-inside: avoid;
    background: #fafafa !important;
  }

  .article-body h2,
  .article-body h3,
  .article-body h4 { page-break-after: avoid; }

  .article-body img { max-width: 100% !important; page-break-inside: avoid; }
}

/* ==========================================================================
   SEO 体检（v1.36.0）
   ========================================================================== */
.seo-list { display: flex; flex-direction: column; gap: 10px; }

.seo-item {
  padding: 12px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--panel-2);
  transition: border-color .18s;
}

.seo-item:hover { border-color: var(--accent-soft); }

.seo-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.seo-score {
  flex: 0 0 40px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.seo-score.is-ok   { background: rgba(34, 197, 94, .16);  color: #1f8a58; }
.seo-score.is-warn { background: rgba(245, 158, 11, .18); color: #a8710a; }
.seo-score.is-bad  { background: rgba(239, 68, 68, .16);  color: #c0392b; }

.seo-title {
  flex: 1 1 220px;
  min-width: 0;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seo-title:hover { color: var(--accent-deep); }

.seo-problems { margin: 8px 0 0; padding-left: 20px; }

.seo-problems li {
  margin-bottom: 4px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-dim);
}

.seo-problems li::marker { content: "• "; }
.seo-problems li.is-error { color: #c0392b; }
.seo-problems li.is-warn  { color: #a8710a; }
.seo-problems li.is-info  { color: var(--muted); }

[data-theme="dark"] .seo-problems li.is-error { color: #f98a8a; }
[data-theme="dark"] .seo-problems li.is-warn  { color: #ffd479; }

.seo-ok { margin: 8px 0 0; font-size: 13px; color: #1f8a58; }
[data-theme="dark"] .seo-ok { color: #6ee7a8; }

/* 分类 / 标签页上的 RSS 订阅小图标 */
.rss-ico { font-style: normal; }

/* ==========================================================================
   站点导航页（v1.36.0）
   ========================================================================== */
.map-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  gap: 16px;
}

.map-grid .side-card { margin: 0; }

.map-links { display: flex; flex-wrap: wrap; gap: 8px; }

.map-links a {
  padding: 4px 11px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text-dim);
  font-size: 13px;
  text-decoration: none;
  transition: border-color .18s, color .18s, transform .18s;
}

.map-links a:hover {
  border-color: var(--accent);
  color: var(--accent-deep);
  transform: translateY(-1px);
}

.map-links .cnt { margin-left: 4px; font-size: 11.5px; color: var(--muted); }

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

.map-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border-soft);
  font-size: 13.5px;
}

.map-list li:last-child { border-bottom: 0; }

.map-list a {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--text-dim);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-list a:hover { color: var(--accent-deep); }
.map-list .cnt { flex: 0 0 auto; font-size: 11.5px; color: var(--muted); }

/* ==========================================================================
   文章系列（v1.36.0）
   ========================================================================== */
.series-box {
  margin: 16px 0 20px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: linear-gradient(135deg, var(--accent-soft), transparent 70%);
}

.series-box.is-page { margin-top: 0; }

.series-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.series-ico { font-size: 15px; }
.series-head b { font-size: 15px; color: var(--text); }

.series-progress {
  margin-left: auto;
  font-size: 12.5px;
  color: var(--muted);
  font-family: var(--mono);
}

.series-list { list-style: none; margin: 0; padding: 0; counter-reset: sn; }

.series-list li { margin-bottom: 4px; }

.series-list a {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  color: var(--text-dim);
  text-decoration: none;
  font-size: 13.5px;
  transition: background .18s, color .18s, transform .18s;
}

.series-list a:hover { background: var(--accent-soft); color: var(--accent-deep); transform: translateX(3px); }

.series-list .sn {
  flex: 0 0 20px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  text-align: right;
}

.series-list .st { flex: 1 1 auto; min-width: 0; }
.series-list .sm { flex: 0 0 auto; font-size: 12px; color: var(--muted); }

/* 当前正在读的那一篇 */
.series-list li.is-current a {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

.series-list li.is-current .sn { color: rgba(255, 255, 255, .8); }

.series-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
  gap: 16px;
}

.series-card { margin: 0; text-decoration: none; display: block; }
.series-card:hover { border-color: var(--accent); transform: translateY(-2px); }

.series-card-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.series-card-head b { flex: 1 1 auto; min-width: 0; font-size: 15px; color: var(--text); }
.series-card-head .cnt { font-size: 12px; color: var(--muted); }

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

.series-mini li {
  display: flex;
  gap: 8px;
  padding: 4px 0;
  font-size: 13px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.series-mini .sn { flex: 0 0 16px; text-align: right; font-family: var(--mono); font-size: 11.5px; opacity: .7; }

/* ==========================================================================
   自定义头像（v1.36.0）
   ========================================================================== */
.avatar-setter {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.avatar-preview {
  position: relative;
  flex: 0 0 88px;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 2px solid var(--border);
  background: var(--panel-2);
}

.avatar-preview img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-setter-body { flex: 1 1 260px; min-width: 0; }

.avatar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.avatar-actions .btn { cursor: pointer; }

/* ==========================================================================
   免费接口卡片：每日一句 / 天气 / GitHub（v1.37.0）

   共同原则：拿不到数据时整块不渲染，所以这里的样式只管「有数据」的样子。
   ========================================================================== */
.api-card { position: relative; }

/* ---------- 每日一句 ---------- */
.quote-refresh {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  transition: color .18s;
}

.quote-refresh:hover { color: var(--accent-deep); }
.quote-refresh.is-busy { opacity: .5; }
.quote-refresh.is-shake { animation: likeShake .4s ease; }

.quote-text {
  margin: 0 0 8px;
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--text);
}

.quote-text.is-in { animation: quoteIn .4s cubic-bezier(.22, 1, .36, 1) both; }

@keyframes quoteIn {
  from { transform: translateY(6px); }
  to   { transform: none; }
}

.quote-from {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
}

.quote-src {
  flex: 0 0 auto;
  padding: 1px 8px;
  border-radius: var(--r-sm);
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 11.5px;
}

.quote-holiday {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px dashed var(--border-soft);
  font-size: 12.5px;
  color: var(--pink);
}

[data-theme="dark"] .quote-holiday { color: #ff9dbb; }

/* ---------- 天气 ---------- */
.weather-now {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
}

.weather-now b {
  font-family: var(--mono);
  font-size: 30px;
  line-height: 1;
  color: var(--accent-deep);
}

.weather-now b i { font-size: 15px; font-style: normal; }

.weather-now span { font-size: 13px; color: var(--text-dim); line-height: 1.6; }
.weather-now span em { font-style: normal; font-size: 11.5px; color: var(--muted); }

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

.weather-days li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  border-top: 1px dashed var(--border-soft);
  font-size: 12.5px;
  color: var(--muted);
}

.weather-days li > span:nth-child(2) { flex: 1 1 auto; min-width: 0; }
.wd-temp { font-family: var(--mono); color: var(--text-dim); }
.wd-rain { color: #2f89c5; }

/* 「你所在地」小标记：提示这张卡片是按访客 IP 自动定位的 */
.wx-auto {
  margin-left: 5px;
  padding: 1px 7px;
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-style: normal;
  font-size: 11.5px;
}

/* ---------- GitHub ---------- */
.gh-name {
  display: block;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--accent-deep);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gh-name:hover { text-decoration: underline; }

.gh-desc {
  margin: 6px 0 8px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gh-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12.5px;
  color: var(--text-dim);
  font-family: var(--mono);
}

.gh-lang {
  padding: 1px 8px;
  border-radius: var(--r-sm);
  background: var(--accent-2-soft);
  color: #a3771a;
  font-family: inherit;
}

.api-note {
  margin: 8px 0 0;
  font-size: 11.5px;
  color: var(--muted);
}

/* ---------- 友链最近更新 ---------- */
.friend-feed-panel { margin-top: 20px; }

.ff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
  gap: 14px;
}

.ff-card {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--panel-2);
  transition: border-color .18s, transform .18s;
}

.ff-card:hover { border-color: var(--accent-soft); transform: translateY(-2px); }

.ff-site {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ff-site:hover { color: var(--accent-deep); }

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

.ff-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 0;
  border-top: 1px dashed var(--border-soft);
  font-size: 12.5px;
}

.ff-list li:first-child { border-top: 0; }

.ff-list a {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--text-dim);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ff-list a:hover { color: var(--accent-deep); }
.ff-time { flex: 0 0 auto; font-size: 11.5px; color: var(--muted); font-family: var(--mono); }

/* ==========================================================================
   首页视觉打磨（v1.39.0）

   目标：首屏信息更整齐、卡片层次更统一、两栏不再一高一矮留白。
   全部是外观层，不动任何功能。
   ========================================================================== */

/* ---------- 1. 「今日推荐 / 最新更新」两栏等高，右边不留白 ---------- */
.duo-card {
  display: flex;
  flex-direction: column;
  transition: border-color var(--t-base), box-shadow var(--t-base), transform var(--t-base) cubic-bezier(.22, 1, .36, 1);
}

.duo-card:hover {
  border-color: var(--accent-soft);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

/* 列表撑满卡片高度，三个条目均分，视觉上不再「上面挤下面空」 */
.update-list { flex: 1 1 auto; }
.update-item { flex: 1 1 auto; }

/* ---------- 2. 侧栏卡片统一悬停手感 ---------- */
.side-card { transition: border-color var(--t-base), box-shadow var(--t-base), transform var(--t-base) cubic-bezier(.22, 1, .36, 1); }

.side-card:hover {
  border-color: var(--accent-soft);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

/* 卡片标题前的小圆点跟着放大一点（原来是实心点，改 opacity 看不出来） */
.side-title::before { transition: transform var(--t-base) cubic-bezier(.22, 1, .36, 1); }
.side-card:hover .side-title::before { transform: scale(1.28); }

/* ---------- 3. 欢迎条：左侧一条渐变强调 + 悬停提亮 ---------- */
.welcome-box {
  position: relative;
  overflow: hidden;
  padding-left: 24px;
  transition: box-shadow var(--t-base), transform var(--t-base) cubic-bezier(.22, 1, .36, 1);
}

.welcome-box::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
}

.welcome-box:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}

/* 灯泡轻微浮动，页面看起来是活的 */
.welcome-box .wave { animation: npFloat 3.6s ease-in-out infinite; }

/* ---------- 4. 快捷入口卡片：更柔和的阴影 + 图标动效 ---------- */
.archive-row { gap: 12px; }

.archive-btn {
  transition: transform var(--t-base) cubic-bezier(.22, 1, .36, 1), box-shadow var(--t-base), border-color var(--t-base);
}

.archive-btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

/* 深色主题下这几个彩色卡片的浅色渐变会「炸眼」，换成低饱和的深色版本 */
[data-theme="dark"] .archive-btn.is-cyan {
  background: linear-gradient(135deg, rgba(56, 224, 255, .14), rgba(56, 224, 255, .06));
  border-color: rgba(56, 224, 255, .28);
  color: #7ef0ff;
}
[data-theme="dark"] .archive-btn.is-warm {
  background: linear-gradient(135deg, rgba(255, 200, 87, .16), rgba(255, 200, 87, .06));
  border-color: rgba(255, 200, 87, .28);
  color: #ffd479;
}
[data-theme="dark"] .archive-btn.is-pink {
  background: linear-gradient(135deg, rgba(255, 110, 199, .16), rgba(255, 110, 199, .06));
  border-color: rgba(255, 110, 199, .28);
  color: #ff9dbb;
}
[data-theme="dark"] .archive-btn.is-green {
  background: linear-gradient(135deg, rgba(62, 230, 168, .16), rgba(62, 230, 168, .06));
  border-color: rgba(62, 230, 168, .28);
  color: #6ee7a8;
}
[data-theme="dark"] .archive-btn small { color: inherit; opacity: .62; }

/* ---------- 5. 首屏数据：数字用等宽，竖排分隔更干净 ---------- */
.hero-meta { font-variant-numeric: tabular-nums; }
.hero-meta b {
  font-family: var(--mono);
  font-size: 1.06em;
  color: #fff;
}

/* ---------- 6. 区块标题：小竖条随悬停长高一点 ---------- */
.section-title::before { transition: top var(--t-base) ease, bottom var(--t-base) ease; }

.section-head:hover .section-title::before,
.duo-head:hover .section-title::before { top: 2px; bottom: 2px; }

/* ---------- 7. 分类 chips：间距与悬停更明确 ---------- */
.chip-row { gap: 10px; }

.chip {
  transition: border-color .18s, color .18s, transform .18s, box-shadow .18s;
}

.chip:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

/* ---------- 8. 首屏与正文的衔接：波浪下方别贴太紧 ---------- */
.container.layout { padding-top: 4px; }

@media (max-width: 900px) {
  /* 窄屏下两栏叠起来，取消均分高度免得条目被撑得很高 */
  .update-list { flex: 0 0 auto; }
  .update-item { flex: 0 0 auto; }
}

@media (prefers-reduced-motion: reduce) {
  .welcome-box .wave,
  .duo-card:hover,
  .side-card:hover,
  .welcome-box:hover,
  .archive-btn:hover,
  .chip:hover { animation: none !important; transform: none !important; }
}

/* ==========================================================================
   人机验证弹窗（点「获取验证码」后弹出：先过验证，再发验证码）
   弹窗里默认是本站自己的图形验证码；极验能被渲染出来时自动切过去
   ========================================================================== */

.np-verify {
  position: fixed;
  inset: 0;
  z-index: 99990;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.np-verify[hidden] { display: none; }

.np-verify-mask {
  position: absolute;
  inset: 0;
  background: rgba(9, 20, 34, .58);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.np-verify-box {
  position: relative;
  width: 100%;
  max-width: 352px;
  padding: 22px 20px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-lg);
  animation: npVerifyIn .22s ease;
}

@keyframes npVerifyIn {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to   { opacity: 1; transform: none; }
}

.np-verify-x {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.np-verify-x:hover { background: var(--accent-soft); color: var(--text); }

.np-verify-title { margin: 0 0 4px; font-size: 18px; color: var(--text); }
.np-verify-sub { margin: 0 0 14px; font-size: 13px; color: var(--muted); }

/* 极验内嵌容器：没内容时不占地方 */
.np-verify-gt:empty { display: none; }

.np-verify-imgrow { display: flex; align-items: center; gap: 10px; }

.np-verify-imgrow img {
  display: block;
  width: 156px;
  height: 48px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: #f2f8fd;
}

.np-verify-swap {
  flex: 0 0 auto;
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
}

.np-verify-swap:hover { border-color: var(--accent); color: var(--accent-deep); }

.np-verify-input {
  margin-top: 12px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 5px;
  font-size: 17px;
  font-family: var(--mono);
}

.np-verify-cap .btn-block { margin-top: 12px; }

/* 极验 / 图形验证 互相切换的小链接 */
.np-verify-switch {
  margin: 10px 0 0;
  text-align: center;
}

.np-verify-switch[hidden] { display: none; }

.np-verify-link {
  border: none;
  background: none;
  padding: 2px 4px;
  color: var(--muted);
  font-size: 12.5px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.np-verify-link:hover { color: var(--accent-deep); }

/* 极验控件条在弹窗里居中、留点上下间距 */
.np-verify-gt { display: flex; justify-content: center; margin-bottom: 12px; }

.np-verify-msg {
  min-height: 18px;
  margin: 9px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.np-verify-msg.is-err { color: var(--danger); }

.np-verify-tip {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

.np-verify-tip:empty { display: none; }

body.np-verify-lock { overflow: hidden; }

/* 后台（深色控制台）里也复用这个弹窗时的兜底配色 */
[data-theme="dark"] .np-verify-mask { background: rgba(4, 10, 20, .68); }

/* ==========================================================================
   询问弹窗（注册成功后问「要不要直接登录」）
   和验证弹窗同一套视觉，键位/遮罩点击都能关
   ========================================================================== */

.np-dialog {
  position: fixed;
  inset: 0;
  z-index: 99995;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.np-dialog-mask {
  position: absolute;
  inset: 0;
  background: rgba(9, 20, 34, .58);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.np-dialog-box {
  position: relative;
  width: 100%;
  max-width: 340px;
  padding: 24px 22px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: npVerifyIn .22s ease;
}

.np-dialog-title {
  margin: 0 0 10px;
  font-size: 19px;
  color: var(--text);
}

.np-dialog-text {
  margin: 0 0 20px;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--text-dim);
  text-align: left;
}

.np-dialog-actions {
  display: flex;
  gap: 10px;
}

.np-dialog-actions .btn { flex: 1 1 0; }

/* ---------------- WHOIS 域名查询 ---------------- */
.who-wrap { display: flex; flex-direction: column; gap: 18px; }

/* ---------------- 天气 ---------------- */
.wx-wrap { display: flex; flex-direction: column; gap: 16px; }

.wx-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.wx-place { display: flex; align-items: center; gap: 10px; min-width: 0; }
.wx-dot {
  width: 10px; height: 10px;
  flex: 0 0 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(76, 199, 154, .18);
}
.wx-dot.is-wait { background: var(--accent-2); box-shadow: 0 0 0 4px var(--accent-2-soft); }
.wx-dot.is-wait + .wx-place-text b { color: var(--muted); }
.wx-place-text { min-width: 0; }
.wx-place-text b { display: block; font-size: 16px; }
.wx-place-text span { font-size: 12.5px; color: var(--muted); }
.wx-tools { display: flex; gap: 8px; flex-wrap: wrap; }

.wx-citybox {
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.wx-citybox[hidden] { display: none; }
.wx-city-input { display: flex; gap: 8px; flex-wrap: wrap; }
.wx-city-input input {
  flex: 1 1 240px;
  min-width: 0;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--panel-2);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: 0;
}
.wx-city-input input:focus { border-color: var(--accent); box-shadow: var(--ring); }
.wx-chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; font-size: 13px; }
.wx-chips-label { color: var(--muted); }

.wx-hint { margin: 0 2px; min-height: 18px; }

.wx-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
.wx-card[hidden] { display: none; }
.wx-title { margin: 0 0 14px; font-size: 16px; }

/* 实况 */
.wx-now-main {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.wx-icon { font-size: 52px; line-height: 1; }
.wx-temp { display: flex; flex-direction: column; }
.wx-temp b { font-size: 46px; line-height: 1.05; font-weight: 700; }
.wx-temp b i { font-size: 20px; font-style: normal; font-weight: 400; color: var(--text-dim); }
.wx-temp span { font-size: 15px; color: var(--text-dim); }
.wx-range {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 14px;
  color: var(--text-dim);
  margin-left: auto;
  text-align: right;
}
.wx-range em { font-style: normal; font-size: 12.5px; color: var(--muted); }

.wx-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 10px;
  margin-top: 18px;
}
.wx-fact {
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--panel-2);
  border: 1px solid var(--border-soft);
}
.wx-fact span { display: block; font-size: 12px; color: var(--muted); }
.wx-fact b { font-size: 15px; font-weight: 600; }
.wx-fact.is-aqi b { color: var(--green); }

/* 7 天 */
.wx-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.wx-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 6px;
  border-radius: var(--r-md);
  background: var(--panel-2);
  border: 1px solid var(--border-soft);
  text-align: center;
  transition: .18s;
}
.wx-day:hover { transform: translateY(-2px); border-color: var(--accent); }
.wx-day.is-today { border-color: var(--accent); background: var(--accent-soft); }
.wd-name { font-size: 13px; color: var(--text-dim); white-space: nowrap; }
.wd-icon { font-size: 24px; line-height: 1.2; }
.wd-text { font-size: 12.5px; color: var(--text-dim); min-height: 18px; }
.wd-temp { font-size: 13.5px; font-weight: 600; }
.wd-wind { font-size: 11.5px; color: var(--muted); }

/* 生活指数 */
.wx-zs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.wx-z {
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--panel-2);
  border: 1px solid var(--border-soft);
}
.wz-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wz-name { font-size: 14px; font-weight: 600; }
.wz-hint { font-size: 13px; color: var(--accent-deep); }
.wz-desc { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.7; }

/* 预警 */
.wx-alerts { display: flex; flex-direction: column; gap: 10px; border-color: #ffd28a; background: #fff9ec; }
.wx-alerts[hidden] { display: none; }
[data-theme="dark"] .wx-alerts { background: #2a2318; border-color: #4a3c22; }
.wx-alert b { font-size: 14px; color: #b26a00; }
.wx-alert span {
  margin-left: 8px;
  font-size: 12px;
  padding: 1px 8px;
  border-radius: var(--r-pill);
  background: rgba(255, 167, 38, .22);
  color: #b26a00;
}
.wx-alert p { margin: 6px 0 0; font-size: 13px; color: var(--text-dim); line-height: 1.75; }

.wx-note { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.85; }
.wx-more { color: var(--accent-deep); text-decoration: none; white-space: nowrap; }
.wx-more:hover { text-decoration: underline; }

/* ---------------- 黄历 ---------------- */
.hl-wrap { display: flex; flex-direction: column; gap: 16px; }

.hl-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.hl-bar-mid { display: flex; flex-direction: column; align-items: center; line-height: 1.35; }
.hl-bar-mid b { font-size: 16px; font-family: var(--mono); }
.hl-bar-mid span { font-size: 12.5px; color: var(--muted); }
.hl-date-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hl-date-form input[type="date"] {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--panel-2);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  outline: 0;
}
.hl-date-form input[type="date"]:focus { border-color: var(--accent); box-shadow: var(--ring); }

.hl-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
.hl-title { margin: 0 0 14px; font-size: 16px; }
.hl-title-sub { margin-left: 10px; font-size: 12.5px; font-weight: 400; color: var(--muted); }

/* 主信息 */
.hl-head-card { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.hl-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 132px;
  padding: 14px 18px;
  border-radius: var(--r-lg);
  background: var(--accent-soft);
  border: 1px solid var(--border-soft);
}
.hl-day-num { font-size: 32px; font-weight: 700; color: var(--accent-deep); line-height: 1.15; }
.hl-day-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.hl-meta { flex: 1 1 320px; min-width: 0; }
.hl-meta-line { margin: 0; font-size: 20px; letter-spacing: .5px; }
.hl-meta-line b { color: var(--accent-deep); }
.hl-meta-line em { margin-left: 8px; font-style: normal; font-size: 13px; color: var(--muted); }
.hl-meta-sub { margin: 10px 0 0; font-size: 13px; color: var(--text-dim); }

.hl-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.hl-tag {
  padding: 4px 11px;
  border-radius: var(--r-pill);
  font-size: 12.5px;
  background: var(--panel-2);
  border: 1px solid var(--border-soft);
  color: var(--text-dim);
}
.hl-tag.is-good { background: rgba(76, 199, 154, .16); border-color: transparent; color: #1d9d63; }
.hl-tag.is-bad { background: rgba(255, 123, 123, .16); border-color: transparent; color: #cf5a5a; }
.hl-tag.is-fest { background: var(--accent-2-soft); border-color: transparent; color: #b4761a; }

/* 宜忌两栏 */
.hl-yiji { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.hl-yi, .hl-ji { position: relative; }
.hl-yiji-head { display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.hl-circle {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 19px;
  font-weight: 700;
  color: #fff;
}
.hl-yi .hl-circle { background: linear-gradient(135deg, #5ed3a6, #35b183); box-shadow: 0 4px 14px rgba(76, 199, 154, .35); }
.hl-ji .hl-circle { background: linear-gradient(135deg, #ff9a9a, #f47070); box-shadow: 0 4px 14px rgba(255, 123, 123, .32); }
.hl-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 8px;
}
.hl-list li {
  padding: 7px 4px;
  border-radius: var(--r-sm);
  text-align: center;
  font-size: 13.5px;
  background: var(--panel-2);
  border: 1px solid var(--border-soft);
}
.hl-yi .hl-list li { color: #1d9d63; }
.hl-ji .hl-list li { color: #cf5a5a; }
.hl-list li.is-none { color: var(--muted); }

/* 神煞网格 */
.hl-grid {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  font-size: 14px;
}
.hl-grid dt, .hl-grid dd { margin: 0; padding: 10px 14px; border-bottom: 1px solid var(--border-soft); }
.hl-grid dt { background: var(--panel-2); color: var(--muted); white-space: nowrap; }
.hl-grid dd { color: var(--text); line-height: 1.75; word-break: break-all; }
.hl-grid dd.is-soft { color: var(--text-dim); font-size: 13px; }
.hl-grid dt:last-of-type, .hl-grid dd:last-of-type { border-bottom: 0; }

/* 吉神凶煞 */
.hl-chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 4px 0; }
.hl-chips-label { font-size: 12.5px; color: var(--muted); flex: 0 0 auto; }
.hl-chips-label.is-good { color: #1d9d63; }
.hl-chips-label.is-bad { color: #cf5a5a; }
.hl-chip {
  padding: 4px 12px;
  border-radius: var(--r-pill);
  font-size: 12.5px;
  border: 1px solid transparent;
}
.hl-chip.is-good { background: rgba(76, 199, 154, .14); color: #1d9d63; }
.hl-chip.is-bad { background: rgba(255, 123, 123, .14); color: #cf5a5a; }

/* 十二时辰 */
.hl-times { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.hl-time {
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  background: var(--panel-2);
  overflow: hidden;
}
.hl-time.is-good { border-color: rgba(76, 199, 154, .4); }
.hl-time.is-bad { border-color: rgba(255, 123, 123, .35); }
.hl-time summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  cursor: pointer;
  font-size: 13.5px;
  list-style: none;
}
.hl-time summary::-webkit-details-marker { display: none; }
.hl-t-zhi { font-weight: 600; }
.hl-t-range { font-size: 12px; color: var(--muted); font-family: var(--mono); }
.hl-t-shen { font-size: 12px; color: var(--text-dim); margin-left: auto; }
.hl-t-luck { font-size: 12px; padding: 1px 8px; border-radius: var(--r-pill); }
.hl-time.is-good .hl-t-luck { background: rgba(76, 199, 154, .18); color: #1d9d63; }
.hl-time.is-bad .hl-t-luck { background: rgba(255, 123, 123, .18); color: #cf5a5a; }
.hl-t-body { padding: 0 12px 10px; }
.hl-t-line { margin: 4px 0 0; font-size: 12.5px; line-height: 1.7; color: var(--text-dim); }
.hl-t-line b { margin-right: 6px; font-size: 12px; padding: 1px 7px; border-radius: var(--r-sm); color: #fff; }
.hl-t-line.is-good b { background: #35b183; }
.hl-t-line.is-bad b { background: #f47070; }

.hl-note { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.85; }
.hl-more { color: var(--accent-deep); text-decoration: none; }
.hl-more:hover { text-decoration: underline; }
.dl-more { color: var(--accent-deep); text-decoration: none; }
.dl-more:hover { text-decoration: underline; }

/* ---------------- 热榜聚合（卡片墙） ---------------- */
.hot-head { text-align: center; }
.hot-head h1 { font-size: 24px; }
.hot-auto { color: var(--green); }

.hot-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.hot-stat { font-size: 13px; color: var(--muted); }

.hot-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  align-items: start;
}

.hot-card {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 16px 10px;
  box-shadow: var(--shadow);
  transition: transform .18s, border-color .18s, box-shadow .18s;
}
.hot-card:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--shadow-lg); }
.hot-card.is-loading { opacity: .65; }

.hw-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 9px;
  margin-bottom: 4px;
  border-bottom: 1px dashed var(--border);
}
.hw-name { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; min-width: 0; }
.hw-bar {
  flex: 0 0 3px;
  width: 3px;
  height: 15px;
  border-radius: var(--r-xs);
  background: linear-gradient(180deg, #ffb43a, #ff5a5a);
}
.hw-count { font-size: 12px; color: var(--muted); font-family: var(--mono); white-space: nowrap; }

.hw-list { list-style: none; margin: 0; padding: 0; flex: 1 1 auto; }
.hw-item { display: flex; align-items: baseline; gap: 8px; padding: 6px 2px; border-radius: var(--r-sm); }
.hw-item:hover { background: var(--panel-2); }
.hw-item.is-extra { display: none; }
.hot-card.is-open .hw-item.is-extra { display: flex; }

.hw-rank { flex: 0 0 17px; text-align: right; font-size: 12.5px; font-family: var(--mono); color: var(--muted); }
.hw-rank.is-hot { color: #ff5a5a; font-weight: 700; }

.hw-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
a.hw-title:hover { color: var(--accent-deep); }
.hw-num { flex: 0 0 auto; font-size: 11.5px; color: var(--muted); font-family: var(--mono); }
.hw-empty { padding: 22px 0; text-align: center; color: var(--muted); font-size: 13px; list-style: none; }

.hw-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 8px;
  margin-top: 6px;
  border-top: 1px dashed var(--border-soft);
  font-size: 11.5px;
  color: var(--muted);
}
.hw-more {
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  font-size: 11.5px;
  color: var(--accent-deep);
  cursor: pointer;
}
.hw-more:hover { text-decoration: underline; }
.hw-src { margin-left: auto; color: var(--accent-deep); text-decoration: none; }
.hw-src:hover { text-decoration: underline; }
.hw-err { margin: 6px 0 0; font-size: 11.5px; color: #cf5a5a; }

.hot-note { grid-column: 1 / -1; margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.85; }
.hot-note a { color: var(--accent-deep); text-decoration: none; }
.hot-note a:hover { text-decoration: underline; }

@media (max-width: 700px) {
  .hot-head { text-align: left; }
  .hot-wall { grid-template-columns: 1fr; gap: 12px; }
  .hw-title {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
}

@media (max-width: 700px) {
  .hl-yiji { grid-template-columns: 1fr; }
  .hl-grid { grid-template-columns: 1fr; }
  .hl-grid dt { background: transparent; padding-bottom: 2px; border-bottom: 0; }
  .hl-grid dd { padding-top: 0; padding-bottom: 12px; }
  .hl-head-card { gap: 14px; }
  .hl-meta-line { font-size: 17px; }
}

@media (max-width: 860px) {
  .wx-days {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 96px;
    overflow-x: auto;
    padding-bottom: 6px;
    scroll-snap-type: x proximity;
  }
  .wx-day { scroll-snap-align: start; }
  .wx-range { margin-left: 0; text-align: left; }
}

/* 「工具」页顶上那张入口卡 */
.tool-entries { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-bottom: 18px; }
.tool-entries .who-entry { margin-bottom: 0; }
.who-entry { margin-bottom: 18px; }
.who-entry h2 { margin-top: 0; }

/* 快递查询 */
.kd-wrap { max-width: 880px; }
.kd-card { padding: 22px; }
.kd-form label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--muted);
}
.kd-grid {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 14px;
}
.kd-grid-2 {
  grid-template-columns: 1fr auto;
  align-items: end;
  margin-top: 14px;
}
.kd-submit-wrap { display: flex; align-items: flex-end; }
.kd-submit-wrap .btn { height: 42px; white-space: nowrap; }
.kd-optional { font-size: 11px; font-weight: 400; opacity: .75; }
.kd-detect {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--accent-deep);
}
.kd-detect.is-warn { color: var(--danger); }
.kd-note {
  margin: 14px 0 0;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--muted);
}
.kd-note a { color: var(--accent); }
.kd-result {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed var(--border-soft);
}
.kd-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.kd-summary b { font-size: 16px; }
.kd-number {
  margin-left: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  color: var(--muted);
}
.kd-state {
  flex: 0 0 auto;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 12.5px;
  font-weight: 600;
}
.kd-fetched { margin: 5px 0 16px; font-size: 12px; color: var(--muted); }
.kd-timeline { list-style: none; margin: 0; padding: 0; }
.kd-item { position: relative; display: flex; gap: 12px; padding-bottom: 18px; }
.kd-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 18px;
  bottom: 0;
  width: 2px;
  background: var(--border-soft);
}
.kd-dot {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  border-radius: 50%;
  background: var(--border);
  border: 3px solid var(--panel);
  box-shadow: 0 0 0 1px var(--border);
  z-index: 1;
}
.kd-item.is-latest .kd-dot {
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 0 0 5px var(--accent-soft);
}
.kd-context { margin: 0 0 5px; font-size: 14px; line-height: 1.7; }
.kd-item.is-latest .kd-context { font-weight: 600; color: var(--text); }
.kd-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); }
.kd-msg { margin-top: 14px; }

@media (max-width: 640px) {
  .kd-grid, .kd-grid-2 { grid-template-columns: 1fr; }
  .kd-submit-wrap .btn { width: 100%; }
  .kd-summary { flex-wrap: wrap; }
}

.who-card,
.who-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
.who-panel[hidden] { display: none; }

.who-form { display: flex; align-items: stretch; gap: 10px; flex-wrap: wrap; }
.who-input {
  flex: 1 1 320px;
  min-width: 0;
  display: flex;
  align-items: center;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--panel-2);
  transition: border-color var(--t-base), box-shadow var(--t-base);
}
.who-input:focus-within { border-color: var(--accent); box-shadow: var(--ring); }
.who-scheme { color: var(--muted); font-family: var(--mono); font-size: 14px; user-select: none; }
.who-input input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--mono);
  font-size: 15px;
  padding: 12px 0;
}
.who-form .btn { min-height: 46px; padding: 0 24px; }

.who-quick { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; font-size: 13px; }
.who-quick-label { color: var(--muted); }
.who-chip {
  border: 1px dashed var(--border);
  background: transparent;
  color: var(--text-dim);
  border-radius: var(--r-pill);
  padding: 4px 11px;
  font-size: 13px;
  font-family: var(--mono);
  cursor: pointer;
  transition: .18s;
}
.who-chip:hover { border-color: var(--accent); color: var(--accent-deep); background: var(--accent-soft); }

.who-hint { margin-top: 10px; }

/* 查询结果 */
.who-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.who-title-box { min-width: 0; }
.who-name { margin: 0; font-size: 21px; font-family: var(--mono); word-break: break-all; }
.who-sub { margin: 6px 0 0; font-size: 13.5px; color: var(--text-dim); word-break: break-all; line-height: 1.7; }
.who-badge {
  flex: 0 0 auto;
  padding: 5px 14px;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent-deep);
}
.who-badge.is-on { background: rgba(76, 199, 154, .16); color: #1d9d63; }
.who-badge.is-free { background: rgba(255, 167, 38, .18); color: #c07400; }
.who-badge.is-unknown { background: rgba(140, 160, 180, .16); color: var(--muted); }

.who-loading { display: flex; align-items: center; gap: 10px; margin-top: 14px; color: var(--text-dim); font-size: 14px; }
.who-loading[hidden] { display: none; }
.who-spin {
  width: 15px; height: 15px;
  border-radius: 50%;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  animation: who-spin .8s linear infinite;
}
@keyframes who-spin { to { transform: rotate(360deg); } }

.who-grid {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  margin: 18px 0 0;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  font-size: 14px;
}
.who-grid dt,
.who-grid dd { margin: 0; padding: 10px 14px; border-bottom: 1px solid var(--border-soft); }
.who-grid dt { background: var(--panel-2); color: var(--muted); white-space: nowrap; }
.who-grid dd { color: var(--text); word-break: break-all; line-height: 1.7; }
.who-grid dd.is-mono { font-family: var(--mono); font-size: 13px; white-space: pre-line; }
.who-grid dd.is-warn { color: #d08700; font-weight: 600; }
.who-grid dt:last-of-type,
.who-grid dd:last-of-type { border-bottom: 0; }

.who-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.who-raw { flex: 1 1 100%; }
.who-raw summary { cursor: pointer; font-size: 13px; color: var(--text-dim); padding: 4px 0; }
.who-raw pre {
  margin: 10px 0 0;
  padding: 14px;
  max-height: 340px;
  overflow: auto;
  background: var(--code-bg);
  border-radius: var(--r-md);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--text-dim);
}

/* 最近查询动态 */
.who-feed-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.who-feed-title { margin: 0; font-size: 17px; }
.who-feed-sub { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.who-feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.who-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14.5px; }
.who-text { color: var(--text-dim); }
.who-city {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--r-sm);
  background: linear-gradient(135deg, #ffb43a, #ff9a1f);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 3px 10px rgba(255, 160, 30, .28);
}
.who-domain {
  border: 0;
  background: transparent;
  padding: 0 1px;
  font-family: var(--mono);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
  border-bottom: 2px dotted var(--accent);
  cursor: pointer;
  transition: color .18s;
}
.who-domain:hover { color: var(--accent-deep); }
.who-ago { margin-left: auto; font-size: 12.5px; color: var(--muted); }
.who-count { font-size: 12px; color: var(--accent-deep); background: var(--accent-soft); border-radius: var(--r-pill); padding: 1px 8px; }
.who-empty { margin: 0; font-size: 14px; color: var(--muted); }
.who-note { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.85; }

@media (max-width: 560px) {
  .who-head { flex-wrap: nowrap; align-items: center; }
  .who-name { font-size: 18px; }
  .who-grid { grid-template-columns: 1fr; }
  .who-grid dt { background: transparent; padding-bottom: 2px; border-bottom: 0; }
  .who-grid dd { padding-top: 0; padding-bottom: 12px; }
  .who-form .btn { flex: 1 1 100%; }
  .who-ago { margin-left: 0; flex-basis: 100%; }
}

/* ==========================================================================
   后台专业化升级（v1.69.0）

   四个"专业后台该有、这里之前没有"的东西：
     1. 位置面包屑 —— 40 个页面，得让人随时知道自己在哪一层
     2. 长表单的操作栏吸附在底部 —— 网站配置那种长表单以前要滚到底才能保存
     3. 数据表格：表头吸附 + 限定高度内滚动 —— 49 行的列表不用整页翻
     4. 表单面板不再整体悬浮上浮（鼠标划过整个面板会往上跳，属于误加的效果）
   ========================================================================== */

/* ---------- 1. 面包屑 ---------- */
.at-crumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 6px;
  font-size: 12.5px;
  color: var(--muted);
}

.at-crumb a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color var(--t-base);
}

.at-crumb a:hover { color: var(--accent-deep); }

.at-crumb i {
  font-style: normal;
  opacity: .45;
  user-select: none;
}

.at-crumb b {
  color: var(--text);
  font-weight: 600;
}

/* ---------- 2. 长表单：操作栏吸附在视口底部 ---------- */
.admin-main form.admin-panel > .tool-actions:last-child {
  position: sticky;
  bottom: 10px;
  z-index: 30;

  /* 两层半透明叠起来 ≈ 不透明，避免滚动时下面的文字透出来；
     刻意不用 backdrop-filter —— 后台在低配机上要稳，虚拟主机访客也可能用老设备 */
  background-color: var(--bg-2);
  background-image: linear-gradient(var(--panel), var(--panel));

  margin-top: 24px;
  padding: 12px 16px;
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  box-shadow: 0 -8px 28px rgba(10, 40, 70, .16), var(--shadow);
}

/* 表单有未保存的改动时，操作栏左侧挂一个提示 */
.admin-main form.is-dirty > .tool-actions:last-child::before {
  content: "● 有未保存的修改";
  order: -1;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent-2);
  white-space: nowrap;
}

/* 鼠标划过整个表单面板时不再整体上浮（长表单里这个效果只会让人眼晕） */
form.admin-panel:hover { transform: none !important; }

/* 有吸附操作栏的页面，把右下角「回到顶部」抬到操作栏上方，两个别叠在一起 */
body.has-sticky-bar .admin-topbtn { bottom: 94px; }

/* ---------- 3. 数据表格：表头吸附 + 内部滚动 ---------- */
.admin-main .table-wrap { position: relative; }

@media (min-width: 768px) {
  /* 只有当行数够多时才由脚本挂上 is-scroll，短表格保持原来的自然高度 */
  .admin-main .table-wrap.is-scroll {
    max-height: min(70vh, 760px);
    overflow-y: auto;
    scrollbar-gutter: stable;
    overscroll-behavior: contain;
  }

  .admin-main .table-wrap.is-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 6;
    background-color: var(--bg-2);
    background-image: linear-gradient(var(--panel), var(--panel));
    /* 表格是 border-collapse: separate，吸顶后会盖住原来那条下边框，这里补一条 */
    box-shadow: inset 0 -1px 0 var(--border);
  }

  /* 贴住表头的同时还能保持左侧首列吸附（≤1023px 的那条规则） */
  .admin-main .table-wrap.is-scroll thead th:first-child { z-index: 7; }
}

/* ---------- 4. 表格细节：给「人」看得更省力 ---------- */
.admin-main table.data td,
.admin-main table.data th { padding: 11px 13px; }

.admin-main table.data tbody tr:hover td { background: var(--accent-soft); }

/* 数字列右对齐、用等宽字体，扫一列数字时不会看错位 */
.admin-main table.data th.is-num,
.admin-main table.data td.is-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: var(--mono);
  font-size: 13px;
}
