html { background: var(--bg1); }
html.admin-mode { background: var(--bg2); }

/* ============================================================
   yunshen-life · 中性科技风主题（深色前台 + 浅色后台）
   灵感：现代技术博客布局与动效；后台对标主流管理后台
   ============================================================ */

:root {
  /* 前台深色主题（默认） */
  --bg0: #070d1a;
  --bg1: #0b1424;
  --bg2: #101b30;
  --panel: #0f1930;
  --card: #121e36;
  --card-hi: #16233e;
  --line: #1f2d4a;
  --line-hi: #2b3d63;
  --text: #e8eef9;
  --text2: #a7b4cd;
  --muted: #78879f;
  --faint: #55627a;
  --accent: #3b82f6;
  --accent2: #38bdf8;
  --accent-dim: rgba(59, 130, 246, 0.14);
  --ok: #2dd4a7;
  --warn: #f5b04c;
  --bad: #f4586e;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 10px 30px rgba(2, 8, 22, 0.55);
  --shadow-sm: 0 4px 14px rgba(2, 8, 22, 0.4);
  --grad: linear-gradient(135deg, #3b82f6, #38bdf8);
  --font: "Space Grotesk", "Noto Sans SC", -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
}

/* 白天主题（前台切换，html.light；后台保持 admin-mode 浅色不受影响） */
html.light {
  --bg0: #f2f5fa;
  --bg1: #f6f8fc;
  --bg2: #eef2f8;
  --panel: #ffffff;
  --card: #ffffff;
  --card-hi: #f3f6fb;
  --line: #e3e9f2;
  --line-hi: #c9d4e6;
  --text: #101828;
  --text2: #475467;
  --muted: #64748b;
  --faint: #98a2b3;
  --accent: #2563eb;
  --accent2: #0284c7;
  --accent-dim: rgba(37, 99, 235, 0.08);
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.09);
  --shadow-sm: 0 3px 10px rgba(15, 23, 42, 0.07);
}

/* 后台浅色模式（body.admin-mode 时切换内容区变量） */
body.admin-mode {
  --bg0: #eef2f7;
  --bg1: #f1f5f9;
  --bg2: #f8fafc;
  --panel: #ffffff;
  --card: #ffffff;
  --card-hi: #fbfdff;
  --line: #e2e8f0;
  --line-hi: #cbd5e1;
  --text: #0f172a;
  --text2: #475569;
  --muted: #64748b;
  --faint: #94a3b8;
  --accent: #2563eb;
  --accent2: #0ea5e9;
  --accent-dim: rgba(37, 99, 235, 0.08);
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --shadow-sm: 0 3px 10px rgba(15, 23, 42, 0.07);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(56, 189, 248, 0.10), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(59, 130, 246, 0.08), transparent 55%),
    linear-gradient(180deg, var(--bg0), var(--bg1) 45%, var(--bg0));
  background-attachment: fixed;
  transition: background 0.3s;
}
body.admin-mode {
  background: var(--bg2);
}
body.light {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(56, 189, 248, 0.10), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(37, 99, 235, 0.06), transparent 55%),
    linear-gradient(180deg, var(--bg0), var(--bg1) 45%, var(--bg0));
}
body.light .nav { background: rgba(255, 255, 255, 0.82); }
::selection { background: rgba(56, 189, 248, 0.28); }
a { color: var(--accent2); text-decoration: none; }
a:hover { color: #7cc5ff; }
body.admin-mode a { color: var(--accent); }
body.admin-mode a:hover { color: var(--accent2); }

/* subtle grid texture on hero areas */
.hero, .adm-content {
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
  background-size: 28px 28px;
}

/* ---------- scroll progress ---------- */
#scrollbar {
  position: fixed; top: 0; left: 0; right: 0; height: 3px;
  z-index: 999; background: transparent; pointer-events: none;
}
#scrollbar i {
  display: block; height: 100%; width: 0;
  background: var(--grad); box-shadow: 0 0 12px rgba(56, 189, 248, 0.8);
}

/* ---------- layout ---------- */
.container { max-width: 1120px; margin: 0 auto; padding: 88px 24px 70px; min-height: calc(100vh - 140px); }

/* ---------- nav ---------- */
/* 导航条通栏：背景铺满视口宽度，内部内容与正文栏（1120px - 24px 内边距）**逐像素对齐** ——
   以前整条背景只有 1120px 而卡片是 1072px，看起来就是"上宽下窄"。 */
.nav-wrap {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50; padding: 0;
  background: rgba(10, 17, 31, 0.72);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav {
  /* 内容栏：与 .container 同宽同内边距（1120px / 左右 24px），两者内容边缘对齐 */
  max-width: 1120px; margin: 0 auto; display: flex; align-items: center; gap: 12px;
  padding: 0 24px; height: 60px;
}
body.admin-mode .nav-wrap { background: rgba(255, 255, 255, 0.85); border-bottom-color: var(--line); }
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; flex: none; white-space: nowrap; }
.brand-logo { width: 32px; height: 32px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line-hi); }
.brand-name { font-size: 16px; font-weight: 700; color: var(--text); letter-spacing: 0.2px; white-space: nowrap; }
.brand-sub { font-size: 11px; color: var(--faint); margin-top: 2px; display: none; }
.nav-links { display: flex; gap: 2px; align-items: center; min-width: 0; flex-wrap: nowrap; }
.nav-links a {
  color: var(--text2); padding: 8px 7px; border-radius: 7px; font-size: 14px;
  transition: all 0.18s; white-space: nowrap;
  /* 图标 + 文字（参考站的做法：多一项也不乱） */
  display: inline-flex; align-items: center; gap: 4px; position: relative;
}
.nav-links a .ni { opacity: .72; flex: none; transition: opacity .18s; }
.nav-links a:hover .ni { opacity: 1; }
.nav-links { gap: 2px; }
/* 当前页：强调色 + 下方小圆点（不再用整块药丸底色） */
.nav-links a.active, .nav-more-btn.active {
  color: var(--accent2); background: transparent; font-weight: 600;
}
.nav-links a.active::after {
  content: ""; position: absolute; left: 50%; bottom: 1px; width: 4px; height: 4px;
  margin-left: -2px; border-radius: 50%; background: var(--accent2);
}
.nav-links a.active .ni { opacity: 1; }
/* RSS：文字标签（与其它导航项同款内边距；曾为省宽度换成图标，分层后有空间了） */
.nav-rss { display: inline-flex; align-items: center; }
/* 「更多」下拉：主项 7 个之外的次要项放这里，加点东西也不会把导航挤爆 */
.nav-more { position: relative; }
.nav-more-btn {
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
  color: var(--text2); background: transparent; border: none; cursor: pointer;
  padding: 8px 7px; border-radius: 7px; font-size: 14px; font-family: var(--font);
  transition: all 0.18s; position: relative;
}
.nav-more-btn .ni { opacity: .72; flex: none; }
.nav-more-btn:hover, .nav-more.open .nav-more-btn { color: var(--text); }
.nav-more-btn:hover .ni, .nav-more.open .nav-more-btn .ni { opacity: 1; }
/* 当前页落在「更多」里的某一项时，按钮也点亮 + 小圆点 */
.nav-more-btn.active::after {
  content: ""; position: absolute; left: 50%; bottom: 1px; width: 4px; height: 4px;
  margin-left: -8px; border-radius: 50%; background: var(--accent2);
}
.nav-more-menu {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 128px; z-index: 60;
  display: none; flex-direction: column; gap: 2px; padding: 6px;
  background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 12px;
  box-shadow: var(--shadow); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  animation: riseIn .16s ease both;
}
.nav-more.open .nav-more-menu { display: flex; }
.nav-more-menu a { padding: 8px 10px; border-radius: 8px; display: flex; align-items: center; gap: 7px; }
.nav-more-menu a .ni { opacity: .7; }
.nav-links a:hover:not(.active) { color: var(--text); background: var(--accent-dim); }
/* 当前页高亮见下方「强调色 + 小圆点」*/
/* 导航项偏多：默认就收紧；再窄就交给汉堡菜单 */
.nav-links { gap: 0; }
.brand-name { font-size: 15px; }
.nav-user { flex: none; gap: 6px; }
.nav-user > * { white-space: nowrap; }
body.admin-mode .nav-links a.active { color: var(--accent); }
.nav-links .nav-write {
  color: #fff; background: var(--grad); margin-left: 6px;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}
.nav-links .nav-write:hover { transform: translateY(-1px); color: #fff; background: var(--grad); }
.nav-user { display: flex; align-items: center; gap: 8px; }
.theme-btn {
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line-hi);
  background: var(--panel); color: var(--text2); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.18s; flex: none;
}
.theme-btn:hover { border-color: var(--accent); color: var(--accent2); background: var(--accent-dim); }

.avatar {
  width: 32px; height: 32px; border-radius: 8px; object-fit: cover;
  background: var(--grad); color: #fff; display: inline-flex; align-items: center;
  justify-content: center; font-weight: 700; font-size: 13px; overflow: hidden;
  border: 1px solid var(--line-hi); flex: none;
}

/* ---------- buttons / forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; cursor: pointer; border-radius: 8px; padding: 9px 18px;
  font-size: 14px; font-weight: 600; color: #fff; background: var(--grad);
  font-family: var(--font);
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3); transition: all 0.18s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 7px 20px rgba(59, 130, 246, 0.42); filter: brightness(1.06); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn.ghost { background: transparent; color: var(--text2); border: 1px solid var(--line-hi); box-shadow: none; }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent2); background: var(--accent-dim); }
body.admin-mode .btn.ghost:hover { color: var(--accent); }
.btn.soft { background: var(--accent-dim); color: var(--accent2); box-shadow: none; }
.btn.soft:hover { background: rgba(59, 130, 246, 0.22); color: #7cc5ff; }
body.admin-mode .btn.soft { color: var(--accent); }
body.admin-mode .btn.soft:hover { color: var(--accent); }
.btn.danger { background: linear-gradient(135deg, #ef4444, #f4586e); }
.btn.sm { padding: 5px 11px; font-size: 12.5px; border-radius: 6px; }
.btn.block { width: 100%; }

.input, textarea.input, select.input {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 9px 13px;
  font-size: 14px; color: var(--text); background: var(--panel); outline: none;
  transition: border 0.18s, box-shadow 0.18s; font-family: var(--font);
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.input::placeholder { color: var(--faint); }
textarea.input { resize: vertical; min-height: 90px; line-height: 1.8; }
select.input { appearance: auto; }
label.field { display: block; margin-bottom: 14px; }
label.field .lbl { display: block; font-size: 13px; color: var(--text2); margin-bottom: 6px; font-weight: 600; }
.hint { font-size: 12.5px; color: var(--faint); margin-top: 5px; line-height: 1.7; }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.card.pad { padding: 22px 24px; }

/* ---------- hero ---------- */
.hero { display: flex; align-items: center; gap: 48px; padding: 60px 8px 40px; flex-wrap: wrap; min-height: 340px; }
.hero-text { flex: 1 1 420px; min-width: 300px; }
.hero-badge {
  display: inline-block; font-family: var(--mono); font-size: 12px; color: var(--accent2);
  background: var(--accent-dim); border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 3px 10px; border-radius: 6px; margin: 0 0 16px; letter-spacing: 0.4px;
}
.hero-title {
  font-size: 38px; line-height: 1.2; color: var(--text); margin: 0 0 12px;
  font-weight: 800; letter-spacing: -0.5px;
}
.hero-title .grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { color: var(--text2); font-size: 15.5px; line-height: 1.9; margin: 0 0 24px; max-width: 520px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-term { flex: 0 1 430px; min-width: 300px; overflow: hidden; padding: 0; animation: riseIn 0.6s ease both; }
.term-bar {
  display: flex; align-items: center; gap: 6px; padding: 9px 13px;
  background: var(--card-hi); border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: 11.5px; color: var(--muted);
}
.term-bar i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.term-bar i:nth-child(1) { background: #f4586e; }
.term-bar i:nth-child(2) { background: #f5b04c; }
.term-bar i:nth-child(3) { background: #2dd4a7; }
.term-bar span { margin-left: 6px; }
.hero-term pre {
  margin: 0; padding: 18px 20px; font-family: var(--mono); font-size: 13px; line-height: 1.9;
  color: var(--text2); white-space: pre-wrap; word-break: break-all;
}
.hero-term pre .c { color: var(--muted); }
.hero-term pre .k { color: #7cc5ff; }
.cursor { display: inline-block; width: 8px; height: 15px; background: var(--accent2); vertical-align: -2px; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@keyframes riseIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- article cards ---------- */
.section-title { display: flex; align-items: baseline; gap: 10px; margin: 34px 0 16px; }
.section-title h2 { margin: 0; font-size: 19px; color: var(--text); font-weight: 700; }
.section-title .more { margin-left: auto; font-size: 13px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }

/* ---------- 首页两栏：左侧分类/标签 + 右侧最新文章 ---------- */
/* 侧栏 sticky 的 top 必须大于固定导航高度(60px) */
.home-layout { display: grid; grid-template-columns: 262px minmax(0, 1fr); gap: 22px; align-items: start; }
.home-layout.no-side { grid-template-columns: minmax(0, 1fr); }
.home-layout.no-side .home-side { display: none; }
.home-main { min-width: 0; }
.home-main > .section-title:first-child { margin-top: 0; }
.home-side { position: sticky; top: 74px; display: flex; flex-direction: column; gap: 16px; }
.side-block { padding: 16px 18px; }
.side-title { margin: 0 0 12px; font-size: 14.5px; color: var(--text2); font-weight: 700; }
@media (max-width: 980px) {
  /* 窄屏堆叠：把文章提到最前，导航类内容放后面 */
  .home-layout { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .home-side { position: static; order: 2; }
}

/* ---------- 关于页 / 联系页：左侧名片栏 + 右侧正文（与首页同构） ---------- */
/* 这两页以前正文都是 560~760px 的居中窄卡片，比上面铺满容器的 banner 窄一大截、
   左右边缘全错位，两侧大片空白。现在铺满容器宽度，左栏放名片/入口/友链。 */
.rail-layout { display: grid; grid-template-columns: 262px minmax(0, 1fr); gap: 22px; align-items: start; margin-top: 20px; }
.rail-side { position: sticky; top: 74px; display: flex; flex-direction: column; gap: 16px; }
.rail-main { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.rail-card { text-align: center; }
.rail-avatar {
  width: 76px; height: 76px; border-radius: 50%; object-fit: cover; display: block;
  margin: 2px auto 12px; background: var(--panel);
  border: 2px solid var(--glass-border); box-shadow: var(--shadow-sm);
}
.rail-name { margin: 0 0 6px; font-size: 17px; font-weight: 800; color: var(--text); }
.rail-bio { margin: 0 0 14px; font-size: 12.5px; line-height: 1.8; color: var(--text2); }
.rail-stats { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.rail-stats span {
  flex: 1 1 58px; padding: 8px 4px 7px; border-radius: 10px;
  background: var(--panel); border: 1px solid var(--line);
  font-size: 11.5px; color: var(--faint); line-height: 1.4;
}
.rail-stats b { display: block; font-size: 16px; color: var(--text); margin-bottom: 1px; }
.rail-links { display: flex; flex-direction: column; gap: 2px; }
.rail-links a {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 8px;
  font-size: 13.5px; color: var(--text2); transition: background .15s, color .15s;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rail-links a:hover { background: var(--accent-dim); color: var(--accent2); }
.rail-links a svg { flex: none; opacity: .8; }
.rail-friends a { display: block; padding: 7px 2px; border-bottom: 1px dashed var(--line); }
.rail-friends a:last-child { border-bottom: none; }
.rail-friends b { display: block; font-size: 13.5px; color: var(--text); font-weight: 600; }
.rail-friends span { font-size: 11.5px; color: var(--faint); }
@media (max-width: 980px) {
  /* 窄屏：先正文后侧栏（同首页） */
  .rail-layout { grid-template-columns: minmax(0, 1fr); gap: 14px; margin-top: 14px; }
  .rail-side { position: static; order: 2; }
  .about-main { padding: 20px 18px; }
}

/* ---------- 联系页：写信卡 + 联系方式行 + 友链申请 + 打赏 ---------- */
.contact-mail .cm-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.contact-mail .cm-badge {
  width: 46px; height: 46px; flex: none; border-radius: 13px; display: flex;
  align-items: center; justify-content: center; color: #fff;
  background: linear-gradient(135deg, #38bdf8, #6366f1); box-shadow: var(--shadow-sm);
}
.contact-mail .cm-title { margin: 0 0 3px; font-size: 17px; font-weight: 800; color: var(--text); }
.contact-mail .cm-sub { margin: 0; font-size: 12.5px; color: var(--text2); line-height: 1.7; }
.contact-mail .cm-addr {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line);
}
.contact-mail .cm-email {
  flex: 1 1 220px; min-width: 0; font-family: var(--mono); font-size: 14px;
  color: var(--accent2); word-break: break-all;
}
.cm-card-title { margin: 0 0 12px; font-size: 15.5px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; }
.cm-note { margin: 0 0 14px; font-size: 13px; line-height: 1.9; color: var(--text2); }
.cm-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.cm-qr { display: block; max-width: 190px; border-radius: 12px; border: 1px solid var(--line); }
.cm-fallback { margin: 12px 0 0; font-size: 12.5px; color: var(--faint); }
.contact-rows { display: flex; flex-direction: column; gap: 6px; }
.cr-row {
  display: flex; align-items: center; gap: 13px; width: 100%; text-align: left;
  padding: 11px 13px; border-radius: 12px; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line);
  color: var(--text2); font-family: var(--font); font-size: 13.5px;
  transition: transform .18s, border-color .18s, background .18s;
}
.cr-row:hover { transform: translateY(-2px); border-color: var(--line-hi); background: var(--glass-bg); }
.cr-badge {
  width: 34px; height: 34px; flex: none; border-radius: 9px; display: flex;
  align-items: center; justify-content: center; color: #fff; font-size: 13px; font-weight: 700;
}
.cr-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cr-body b { font-weight: 700; color: var(--text); }
.cr-body span { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-arrow { flex: none; color: var(--faint); }

/* 关于页正文（简历式 Markdown）：分节标题、居中箴言、技术栈徽章 */
.about-main { padding: 26px 30px; }
.about-md > :first-child { margin-top: 0; }
.about-md h2 {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  margin: 34px 0 14px; padding: 7px 14px; font-size: 18.5px;
  border-left: 3px solid var(--accent); border-radius: 8px;
  background: linear-gradient(90deg, var(--accent-dim), transparent 72%);
}
.about-md h3 { margin: 22px 0 8px; font-size: 16px; }
.about-md ul { padding-left: 22px; margin: 10px 0; }
.about-md li { margin: 6px 0; line-height: 1.9; }
.about-md hr { margin: 30px 0; opacity: .55; }
/* 顶部居中简介块（内容里的 <div align="center">）：箴言框居中、去掉左竖线 */
.about-md div[align="center"] h1 { font-size: 27px; margin: 4px 0 16px; letter-spacing: .2px; }
.about-md div[align="center"] blockquote {
  display: inline-block; text-align: center; margin: 0 auto; padding: 14px 22px;
  border-left: none; border-radius: 12px;
  background: linear-gradient(180deg, var(--accent-dim), rgba(56, 189, 248, .04));
  border: 1px solid var(--glass-border);
}
/* 技术栈徽章图：给一层浅底衬，避免图标直接漂在深色背景上 */
.about-md p[align="center"] img {
  background: rgba(255, 255, 255, .05); padding: 12px 16px; margin: 6px 0;
  border-radius: 14px; border: 1px solid var(--line);
}
body.light .about-md p[align="center"] img { background: rgba(15, 23, 42, .04); }
.acard { overflow: hidden; display: flex; flex-direction: column; transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s; cursor: pointer; border-radius: var(--radius); }
.acard:hover { transform: translateY(-4px); border-color: var(--line-hi); box-shadow: var(--shadow); }
.acard-cover { width: 100%; height: 164px; object-fit: cover; display: block; background: var(--bg2); }
.acard-noimg {
  width: 100%; height: 164px; display: flex; align-items: center; justify-content: center;
  font-size: 30px; color: rgba(148, 163, 184, 0.5);
  background:
    linear-gradient(rgba(56, 189, 248, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.05) 1px, transparent 1px),
    var(--bg2);
  background-size: 22px 22px;
}
.acard-body { padding: 15px 17px 15px; flex: 1; display: flex; flex-direction: column; }
.acard-title { font-size: 15.5px; font-weight: 700; color: var(--text); line-height: 1.5; margin: 0 0 8px; }
.acard-sum { color: var(--text2); font-size: 13px; line-height: 1.75; flex: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.acard-meta { display: flex; align-items: center; gap: 10px; margin-top: 12px; color: var(--faint); font-size: 12px; flex-wrap: wrap; }
.acard-meta .who { display: flex; align-items: center; gap: 6px; color: var(--text2); }
.acard-meta .dot { opacity: 0.6; }
/* 首页只有一篇文章时：整行横向「精选」卡片，避免右侧大片留白 */
.grid-single { grid-template-columns: minmax(0, 1fr); }
.grid-single .acard { flex-direction: row; }
.grid-single .acard-cover,
.grid-single .acard-noimg { flex: 0 0 300px; width: 300px; height: auto; min-height: 176px; }
.grid-single .acard-body { min-width: 0; justify-content: center; }
@media (max-width: 720px) {
  .grid-single .acard { flex-direction: column; }
  .grid-single .acard-cover,
  .grid-single .acard-noimg { flex: none; width: 100%; height: 164px; min-height: 0; }
}

.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 6px; background: var(--accent-dim); color: var(--accent2); font-size: 11.5px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
body.admin-mode .pill { color: var(--accent); }
.pill.pink { background: rgba(245, 176, 76, 0.12); color: #f5b04c; }
.pill.lock { background: rgba(56, 189, 248, 0.10); color: var(--accent2); border-color: rgba(56, 189, 248, 0.25); }
.pill.gray { background: rgba(120, 135, 159, 0.12); color: var(--muted); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 5px 14px; border-radius: 7px; background: var(--panel); border: 1px solid var(--line); color: var(--text2); font-size: 12.5px; cursor: pointer; transition: all 0.16s; }
.chip:hover { border-color: var(--accent); color: var(--accent2); }
.chip.active { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35); }

/* ---------- article detail ---------- */
.art-head { padding: 28px 32px; animation: riseIn 0.4s ease both; }
.art-cover {
  display: block; width: calc(100% + 64px); max-height: 420px; object-fit: cover;
  margin: -28px -32px 22px; border-radius: var(--radius) var(--radius) 0 0;
  border-bottom: 1px solid var(--line); background: var(--bg2);
}
@media (max-width: 720px) {
  .art-cover { width: calc(100% + 36px); margin: -28px -18px 18px; }
}
.art-title { font-size: 26px; line-height: 1.45; margin: 10px 0 12px; font-weight: 800; }
.art-info { display: flex; align-items: center; gap: 14px; color: var(--faint); font-size: 12.5px; flex-wrap: wrap; }
.art-info .who { display: flex; align-items: center; gap: 8px; color: var(--text2); }
.art-actions { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.art-content { padding: 28px 32px 32px; }
.md { font-size: 15px; line-height: 2; color: var(--text2); word-break: break-word; }
.md h1, .md h2, .md h3, .md h4 { color: var(--text); margin: 1.5em 0 0.6em; line-height: 1.5; font-weight: 700; }
.md h1 { font-size: 23px; } .md h2 { font-size: 20px; } .md h3 { font-size: 17px; }
.md img { max-width: 100%; border-radius: 10px; border: 1px solid var(--line); }
.md blockquote { margin: 14px 0; padding: 12px 18px; border-left: 3px solid var(--accent); background: var(--accent-dim); border-radius: 0 8px 8px 0; color: var(--text2); }
.md code { background: var(--panel); padding: 2px 7px; border-radius: 6px; font-size: 0.88em; color: #7cc5ff; font-family: var(--mono); }
/* 浅色主题下 #7cc5ff 在白底上对比度约 1.8:1，必须加深 */
html.light .md code, body.light .md code { color: #0369a1; }
.md pre { background: #0a1222; color: #d7e2f6; padding: 16px 18px; border-radius: 10px; overflow: auto; font-size: 13px; line-height: 1.7; border: 1px solid var(--line); }
.md pre code { background: transparent; padding: 0; color: inherit; }
.md table { border-collapse: collapse; width: 100%; margin: 14px 0; font-size: 13.5px; }
.md th, .md td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.md th { background: var(--panel); }
.md hr { border: none; border-top: 1px dashed var(--line-hi); margin: 26px 0; }
.md a { font-weight: 600; }
/* hljs theme (dark pre) */
.hljs-comment,.hljs-quote{color:#5b6b8c}.hljs-keyword,.hljs-selector-tag,.hljs-subst{color:#7cc5ff}.hljs-number,.hljs-literal,.hljs-variable,.hljs-template-variable,.hljs-tag .hljs-attr{color:#f8a5b0}.hljs-string,.hljs-doctag{color:#8fe3c1}.hljs-title,.hljs-section,.hljs-selector-id{color:#b6a7f5}.hljs-type,.hljs-class .hljs-title{color:#f5cb8c}.hljs-tag,.hljs-name,.hljs-attribute{color:#9ed0ff}.hljs-regexp,.hljs-link{color:#f6a6c9}.hljs-symbol,.hljs-bullet{color:#b9e6ff}.hljs-built_in,.hljs-builtin-name{color:#ffcba8}.hljs-meta{color:#7cc5ff}.hljs-deletion{background:#4c1d2e}.hljs-addition{background:#1c4a44}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:bold}

/* ---------- lock box ---------- */
.lock-box { padding: 44px 30px; text-align: center; }
.lock-icon { font-size: 46px; margin-bottom: 12px; }
.lock-box h3 { margin: 0 0 8px; }
.lock-box p { color: var(--text2); margin: 0 0 18px; font-size: 14px; }
.lock-form { max-width: 360px; margin: 0 auto; display: flex; gap: 10px; }

/* ---------- comments ---------- */
.comments { margin-top: 24px; padding: 24px 30px; }
.cmt { display: flex; gap: 13px; margin-bottom: 20px; }
.cmt-body { flex: 1; min-width: 0; }
.cmt-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; flex-wrap: wrap; }
.cmt-name { font-weight: 700; color: var(--text); font-size: 13.5px; }
.cmt-time { color: var(--faint); font-size: 12px; }
.cmt-content { color: var(--text2); font-size: 14px; line-height: 1.8; white-space: pre-wrap; word-break: break-word; }
.cmt-children { margin: 12px 0 0 46px; padding: 10px 16px 0; border-left: 2px dashed var(--line-hi); }
.cmt-ops { display: flex; gap: 12px; margin-top: 5px; font-size: 12.5px; }
.cmt-ops button { border: none; background: none; color: var(--faint); cursor: pointer; padding: 2px 4px; font-family: var(--font); }
.cmt-ops button:hover { color: var(--accent2); }
.cmt-ops button.red:hover { color: var(--bad); }

/* ---------- pagination ---------- */
.pager { display: flex; gap: 6px; justify-content: center; margin: 32px 0 10px; flex-wrap: wrap; }
.pager button { min-width: 36px; height: 36px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--text2); cursor: pointer; font-size: 13.5px; transition: all 0.15s; font-family: var(--font); }
.pager button:hover { border-color: var(--accent); color: var(--accent2); }
.pager button.cur { background: var(--grad); color: #fff; border-color: transparent; font-weight: 700; }
.pager button:disabled { opacity: 0.4; cursor: default; }

/* ---------- auth ---------- */
.auth-wrap { max-width: 430px; margin: 40px auto; padding: 34px 32px; animation: riseIn 0.4s ease both; }
.auth-wrap h1 { font-size: 22px; margin: 0 0 6px; font-weight: 800; }
.auth-sub { color: var(--text2); font-size: 13px; margin: 0 0 22px; }
.oauth-row { display: flex; gap: 10px; margin: 18px 0 6px; flex-wrap: wrap; }
.oauth-btn { flex: 1; min-width: 78px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); font-size: 12px; color: var(--text2); cursor: pointer; transition: all 0.18s; }
.oauth-btn:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--shadow-sm); }
.oauth-btn .oi { font-size: 20px; }
.oauth-btn .icon-github { color: #e8eef9; }
.oauth-btn .icon-google { color: #ea4335; }
.oauth-btn .icon-qq { color: #12b7f5; }
.oauth-btn .icon-wechat { color: #07c160; }

/* ---------- editor ---------- */
.editor-wrap { padding: 24px 28px; animation: riseIn 0.4s ease both; }
.editor-top { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ed { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 14px; }
.ed .pane { min-width: 0; }
.ed .pane-label { font-size: 12px; color: var(--faint); margin-bottom: 6px; display: flex; justify-content: space-between; align-items: center; }
.ed textarea { width: 100%; min-height: 480px; border: 1px solid var(--line); border-radius: 10px; padding: 16px; font-family: var(--mono); font-size: 13.2px; line-height: 1.8; resize: vertical; background: #0a1222; color: var(--text); }
.ed textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.ed .preview { min-height: 480px; max-height: 640px; overflow: auto; border: 1px dashed var(--line-hi); border-radius: 10px; padding: 16px 20px; background: var(--panel); }
.toolbar { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.toolbar button { border: 1px solid var(--line); background: var(--panel); border-radius: 8px; min-width: 36px; height: 33px; padding: 0 10px; cursor: pointer; font-size: 13.5px; color: var(--text2); transition: all 0.15s; white-space: nowrap; font-family: var(--font); }
.toolbar button:hover { background: var(--accent-dim); border-color: var(--accent); color: var(--accent2); }
.ed-meta { display: flex; gap: 16px; margin: 14px 0 0; flex-wrap: wrap; align-items: center; }
.ed-meta > * { flex: 1; min-width: 200px; }

/* ---------- tables ---------- */
/* ============================================================
   后台表格：行卡片化
   与站点"卡片 + 圆角 + 柔和阴影 + 强调色点缀"的语言保持一致
   （border-collapse: separate + border-spacing 让每一行成为独立小卡片）
   ============================================================ */
.tbl-wrap { overflow-x: auto; border: none; background: transparent; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0 10px; font-size: 13.5px; }

/* 表头：极轻，像"标签"而不是"标题栏" */
.tbl th {
  text-align: left; padding: 0 16px 2px; background: transparent; color: var(--muted);
  font-weight: 600; font-size: 12px; letter-spacing: .04em; white-space: nowrap; border: none;
}

/* 行 = 一张卡片：上下边框 + 首尾列圆角 */
.tbl tbody td {
  background: var(--card); padding: 14px 16px; vertical-align: middle;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  transition: background .16s, border-color .16s;
}
.tbl tbody td:first-child {
  border-left: 1px solid var(--line); border-radius: 14px 0 0 14px;
  box-shadow: inset 3px 0 0 transparent; transition: box-shadow .18s, background .16s;
}
.tbl tbody td:last-child { border-right: 1px solid var(--line); border-radius: 0 14px 14px 0; }

/* hover：整行染色 + 左侧强调色竖条（站点的主色语言） */
.tbl tbody tr:hover td { background: var(--accent-dim); border-color: var(--line-hi); }
.tbl tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
/* 置顶行：左侧琥珀色竖条，一眼可辨 */
.tbl tbody tr.is-pinned td:first-child { box-shadow: inset 3px 0 0 #f5b04c; }

/* —— 标题列：主信息加重，标签下沉为次级 —— */
.tbl .t-title { display: flex; align-items: center; gap: 7px; font-weight: 600; font-size: 14px; line-height: 1.45; }
.tbl .t-title a { color: var(--text); transition: color .15s; }
.tbl .t-title a:hover { color: var(--accent2); }
.tbl .t-pin {
  display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 700;
  color: #b26a00; background: rgba(245, 176, 76, .18); padding: 2px 8px; border-radius: 999px;
}
.tbl .t-lock { color: var(--faint); display: inline-flex; }
.tbl .t-sub { margin-top: 7px; display: flex; gap: 6px; flex-wrap: wrap; }
/* 标签：更轻的胶囊 */
.tbl .t-sub .tag { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 1px 9px; font-size: 11.5px; }

/* —— 作者列：头像 + 名字 —— */
.tbl .t-who { display: inline-flex; align-items: center; gap: 8px; color: var(--text2); white-space: nowrap; }
.tbl .t-who .avatar { border-radius: 50%; }

/* —— 数字与时间：等宽字体，视觉整齐 —— */
.tbl .col-stat, .tbl .col-time { font-family: var(--mono); font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.tbl .col-stat svg { opacity: .6; vertical-align: -2px; }
.tbl tbody tr:hover .col-stat { color: var(--text2); }
.tbl .col-stat .sep { opacity: .35; margin: 0 2px; }
.tbl .col-id { font-family: var(--mono); font-size: 12px; color: var(--faint); width: 1%; }

/* 状态/操作列：不换行、列宽收缩到刚好够，剩余宽度让给标题列 */
.tbl .col-status { white-space: nowrap; width: 1%; }
/* 状态徽章：加个小圆点，更"活" */
.status-badge { display: inline-flex; align-items: center; gap: 6px; }
.status-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* —— 操作列 ——
   注意：后台的行结构是 `<td class="ops">`（class 直接写在 td 上），
   所以**绝不能**在这里写 display:flex —— 那会让 td 不再是 table-cell，
   整行的单元格会错位（线上表现为卡片右侧"缺一块"）。
   这里只用行内按钮 + 右对齐，垂直居中交给 td 的 vertical-align: middle。 */
.tbl td.ops { white-space: nowrap; width: 1%; text-align: right; vertical-align: middle; }
.tbl td.ops .btn { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; font-size: 12.5px; border-radius: 999px; }
.tbl td.ops .btn + .btn { margin-left: 6px; }
.tbl td.ops .btn.ghost { border-color: transparent; background: var(--panel); }
.tbl td.ops .btn.ghost:hover { border-color: var(--accent); background: var(--accent-dim); color: var(--accent2); }
.tbl td.ops .btn.danger-o {
  background: transparent; color: var(--bad); border: 1px solid rgba(244, 88, 110, .35); box-shadow: none;
}
.tbl td.ops .btn.danger-o:hover { background: rgba(244, 88, 110, .1); border-color: var(--bad); }

/* —— 窄屏：隐藏低优先列（ID / 作者 / 创建） —— */
@media (max-width: 900px) {
  .tbl .col-id, .tbl .col-author, .tbl .col-time { display: none; }
  .tbl tbody td, .tbl th { padding-left: 10px; padding-right: 10px; }
}

.status-badge { display: inline-block; padding: 3px 10px; border-radius: 6px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.st-approved { background: rgba(45, 212, 167, 0.15); color: #2dd4a7; }
.st-pending { background: rgba(245, 176, 76, 0.15); color: #f5b04c; }
.st-rejected { background: rgba(244, 88, 110, 0.15); color: #f4586e; }
.st-draft { background: rgba(120, 135, 159, 0.15); color: var(--muted); }
body.admin-mode .st-approved { color: #0d9668; }
body.admin-mode .st-pending { color: #b45309; }
body.admin-mode .st-rejected { color: #dc2643; }

/* ============================================================
   Admin layout (professional back-office)
   ============================================================ */
.admin-layout { display: block; }
.admin-side { display: none; } /* replaced by .adm-side */

.adm { display: grid; grid-template-columns: 232px 1fr; gap: 0; align-items: stretch; min-height: calc(100vh - 0px); }
.adm-side {
  background: #0f172a; color: #cbd5e1; display: flex; flex-direction: column;
  position: sticky; top: 0; height: calc(100vh);
  border-right: 1px solid rgba(148, 163, 184, 0.12);
}
.adm-logo { padding: 20px 18px 14px; display: flex; align-items: center; gap: 10px; }
.adm-logo img { width: 30px; height: 30px; border-radius: 8px; }
.adm-logo b { font-size: 15px; color: #f1f5f9; font-weight: 800; }
.adm-logo span { display: block; font-size: 10.5px; color: #64748b; font-weight: 400; letter-spacing: 1px; }
.adm-nav { flex: 1; padding: 4px 10px; overflow-y: auto; }
.adm-group { font-size: 10.5px; color: #475569; letter-spacing: 1.2px; margin: 16px 8px 6px; font-weight: 600; }
.adm-nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px;
  color: #94a3b8; font-size: 13.5px; transition: all 0.15s; margin-bottom: 2px;
}
.adm-nav a:hover { background: rgba(255, 255, 255, 0.06); color: #e2e8f0; }
.adm-nav a.active { background: var(--grad); color: #fff; font-weight: 600; box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4); }
.adm-nav a .ico { width: 18px; text-align: center; font-size: 14px; }
.adm-nav .badge-count {
  margin-left: auto; background: #f4586e; color: #fff; font-size: 10.5px;
  padding: 1px 7px; border-radius: 99px; font-weight: 700;
}
.adm-side-foot { padding: 14px 18px 18px; font-size: 11px; color: #475569; border-top: 1px solid rgba(148, 163, 184, 0.12); }

.adm-main { display: flex; flex-direction: column; min-width: 0; }
.adm-topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 16px;
  padding: 0 24px; height: 54px; background: var(--card);
  border-bottom: 1px solid var(--line);
}
.adm-crumb { font-size: 13.5px; color: var(--muted); }
.adm-crumb b { color: var(--text); font-weight: 600; }
.adm-crumb .sep { margin: 0 8px; color: var(--faint); }
.adm-user { margin-left: auto; position: relative; }
.adm-user-btn {
  display: flex; align-items: center; gap: 8px; background: none; border: none;
  color: var(--text); cursor: pointer; font-family: var(--font); padding: 6px 8px; border-radius: 8px;
}
.adm-user-btn:hover { background: var(--accent-dim); }
.adm-user-btn .caret { color: var(--faint); font-size: 10px; }
.adm-drop {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 170px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow); padding: 6px; display: none;
}
.adm-drop.open { display: block; }
.adm-drop a, .adm-drop button {
  display: block; width: 100%; text-align: left; padding: 8px 12px; border-radius: 7px;
  font-size: 13px; color: var(--text2); border: none; background: none; cursor: pointer; font-family: var(--font);
}
.adm-drop a:hover, .adm-drop button:hover { background: var(--accent-dim); color: var(--text); }
.adm-drop .logout { color: var(--bad); }
.adm-drop .logout:hover { background: rgba(244, 88, 110, 0.1); color: var(--bad); }
.adm-content { padding: 24px; min-width: 0; animation: riseIn 0.3s ease both; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.stat-card { padding: 18px; text-align: left; border-radius: var(--radius); transition: transform 0.18s, border-color 0.18s; }
.stat-card:hover { transform: translateY(-2px); border-color: var(--line-hi); }
.stat-card .num { font-size: 26px; font-weight: 800; color: var(--accent2); font-family: var(--mono); }
body.admin-mode .stat-card .num { color: var(--accent); }
.stat-card .lbl { color: var(--muted); font-size: 12.5px; margin-top: 4px; }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.tabs .tab { padding: 7px 16px; border-radius: 7px; background: var(--panel); border: 1px solid var(--line); cursor: pointer; font-size: 13px; color: var(--text2); font-family: var(--font); }
.tabs .tab.active { background: var(--grad); color: #fff; border-color: transparent; }

/* ---------- toast / modal ---------- */
#toast-root { position: fixed; top: 72px; left: 50%; transform: translateX(-50%); z-index: 999; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.toast {
  padding: 10px 20px; border-radius: 9px; background: rgba(15, 23, 42, 0.95); color: #e2e8f0;
  font-size: 13.5px; border: 1px solid var(--line-hi);
  box-shadow: 0 10px 30px rgba(2, 8, 22, 0.5); animation: slideDown 0.25s ease; max-width: 90vw;
}
.toast.ok { border-color: rgba(45, 212, 167, 0.4); background: rgba(10, 45, 35, 0.95); color: #8fe3c1; }
.toast.err { border-color: rgba(244, 88, 110, 0.4); background: rgba(60, 15, 28, 0.95); color: #f8a5b0; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px);} to { opacity: 1; transform: translateY(0);} }
.modal-mask { position: fixed; inset: 0; background: rgba(2, 8, 22, 0.6); backdrop-filter: blur(4px); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; animation: fadeIn 0.16s; }
.modal { width: 100%; max-width: 520px; padding: 24px 26px; border-radius: 14px; box-shadow: var(--shadow); animation: popIn 0.2s; }
.modal h3 { margin: 0 0 14px; font-size: 17px; color: var(--text); font-weight: 700; }
.modal-body { color: var(--text2); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: scale(0.95);} }

/* ---------- misc ---------- */
.empty { text-align: center; color: var(--faint); padding: 48px 20px; font-size: 14px; }
.empty .ei { font-size: 38px; display: block; margin-bottom: 10px; opacity: 0.8; }
.loading { text-align: center; color: var(--faint); padding: 50px; font-size: 13.5px; }
.spin { display: inline-block; width: 20px; height: 20px; border: 3px solid var(--line-hi); border-top-color: var(--accent2); border-radius: 50%; animation: rot 0.8s linear infinite; vertical-align: middle; }
@keyframes rot { to { transform: rotate(360deg); } }
.tag { display: inline-block; padding: 1px 8px; background: var(--accent-dim); color: var(--accent2); border-radius: 6px; font-size: 11.5px; margin: 2px 4px 2px 0; }
body.admin-mode .tag { color: var(--accent); }
.divider { height: 1px; background: var(--line); margin: 8px 0; }
.mt0 { margin-top: 0; } .mt1 { margin-top: 10px; } .mt2 { margin-top: 20px; } .mt3 { margin-top: 30px; }
.mb2 { margin-bottom: 20px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.row { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; }

/* ---------- footer ---------- */
.foot { padding: 24px 20px 30px; text-align: center; color: var(--faint); font-size: 12.5px; border-top: 1px solid var(--line); margin-top: 40px; }
.foot-inner { max-width: 1120px; margin: 0 auto; }
.foot-line1 { display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap; }
.foot-title { color: var(--text2); font-size: 14px; font-weight: 700; }
.foot-line2 { margin-top: 8px; }
.foot a { color: var(--faint); }
.foot a:hover { color: var(--accent2); }

/* ---------- setup wizard ---------- */
.setup-wrap { max-width: 640px; margin: 24px auto; padding: 32px 34px; }
.setup-steps { display: flex; align-items: center; gap: 6px; margin-bottom: 24px; }
.setup-step { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--faint); }
.setup-step .dot { width: 24px; height: 24px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: var(--panel); border: 1px solid var(--line); font-weight: 700; font-size: 11.5px; }
.setup-step.active { color: var(--accent2); font-weight: 700; }
.setup-step.active .dot { background: var(--grad); border-color: transparent; color: #fff; }
.setup-step.done .dot { background: var(--ok); border-color: transparent; color: #04121c; }
.setup-line { flex: 1 1 20px; height: 2px; background: var(--line); border-radius: 2px; }
.setup-line.done { background: var(--ok); }

/* ============================================================
   Pet widget (bottom-right)
   ============================================================ */
#pet-root { position: fixed; right: 18px; bottom: 16px; z-index: 300; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
#pet-bubble {
  display: none; max-width: 230px; background: var(--card); border: 1px solid var(--line-hi);
  color: var(--text); border-radius: 10px 10px 2px 10px; padding: 9px 13px;
  font-size: 12.5px; line-height: 1.7; box-shadow: var(--shadow);
  animation: popIn 0.2s;
}
#pet-bubble.show { display: block; }
#pet-btn {
  position: relative; width: 64px; height: 64px; border-radius: 16px; cursor: pointer; border: 1px solid var(--line-hi);
  background: radial-gradient(120px 120px at 30% 25%, rgba(56, 189, 248, 0.35), transparent 60%), var(--card);
  box-shadow: var(--shadow); transition: transform 0.2s, box-shadow 0.2s; display: flex; align-items: center; justify-content: center;
}
#pet-btn:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(2, 8, 22, 0.6); }
#pet-btn svg { width: 46px; height: 46px; }
#pet-btn .tail { transform-origin: 80% 80%; animation: tailWag 2.4s ease-in-out infinite; }
@keyframes tailWag { 0%,100% { transform: rotate(0deg);} 50% { transform: rotate(14deg);} }
#pet-btn .ear { transform-origin: 50% 100%; animation: earTwitch 5s ease-in-out infinite; }
#pet-btn .ear.r { animation-delay: 2.4s; }
@keyframes earTwitch { 0%, 90%, 100% { transform: rotate(0);} 94% { transform: rotate(-10deg);} 97% { transform: rotate(6deg);} }
#pet-min { display: none; width: 30px; height: 30px; border-radius: 50%; background: var(--card); border: 1px solid var(--line-hi); color: var(--text2); cursor: pointer; font-size: 15px; box-shadow: var(--shadow-sm); }
#pet-root.mini #pet-btn { display: none; }
#pet-root.mini #pet-min { display: flex; align-items: center; justify-content: center; }
#pet-root.mini #pet-bubble { display: none !important; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .adm { grid-template-columns: 1fr; }
  .adm-side { position: static; height: auto; flex-direction: column; }
  .adm-nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .adm-nav .adm-group { width: 100%; margin: 10px 8px 2px; }
  .adm-side-foot { display: none; }
}
@media (max-width: 720px) {
  .container { padding: 76px 14px 50px; }
  .hero { padding-top: 24px; gap: 24px; }
  .hero-title { font-size: 28px; }
  .brand-sub { display: none; }
  .nav-links a { padding: 7px 9px; font-size: 13px; }
  .ed { grid-template-columns: 1fr; }
  .editor-top { grid-template-columns: 1fr; }
  .art-head, .art-content, .comments { padding-left: 18px; padding-right: 18px; }
  .cmt-children { margin-left: 14px; }
  .adm-content { padding: 14px; }
  .adm-topbar { padding: 0 14px; }
}

/* ---------- admin 模式：隐藏站点外壳，后台全屏 ---------- */
body.admin-mode .nav-wrap,
body.admin-mode .foot { display: none; }
body.admin-mode .container { padding: 0; max-width: none; min-height: 100vh; }

/* 小屏（<1180px）导航整体换成汉堡菜单，.nav-links 会 display:none，
   所以这里不需要横向滚动的兜底 —— 而且给 .nav-links 加 overflow 会把里面的
   「更多」下拉裁掉（参见文件末尾的说明）。 */

/* ============================================================
   Mobile 优化（≤960px 折叠导航 + 排版 + 安全区）
   ============================================================ */

#nav-burger {
  display: none; width: 36px; height: 36px; border-radius: 8px;
  align-items: center; justify-content: center; border: 1px solid var(--line-hi);
  background: var(--panel); color: var(--text2); cursor: pointer; flex: none;
}
#nav-burger:hover { border-color: var(--accent); color: var(--accent2); }
.nav { position: relative; }

@media (max-width: 1180px) {
  /* —— 折叠导航 ——
     导航与正文栏同宽（1120px），视口再窄就该折叠而不是硬挤 */
  #nav-burger { display: inline-flex; }
  .nav-links {
    position: absolute; top: 62px; left: 12px; right: 12px;
    display: none; flex-direction: column; gap: 2px;
    background: rgba(10, 17, 31, 0.97);
    border: 1px solid var(--line-hi); border-radius: 12px;
    box-shadow: 0 18px 44px rgba(2, 8, 22, 0.6);
    padding: 10px; z-index: 60;
  }
  body.light .nav-links { background: rgba(255, 255, 255, 0.98); border-color: var(--line); box-shadow: 0 18px 44px rgba(15, 23, 42, 0.18); }
  .nav.open .nav-links { display: flex; }
  .nav-links a { padding: 12px 14px; font-size: 15px; border-radius: 9px; }
  /* 折叠态：把「更多」里的项平铺出来，不做二级菜单 */
  .nav-more { position: static; }
  .nav-more-btn { display: none; }
  .nav-more-menu {
    position: static; display: flex; min-width: 0; padding: 0; border: none;
    background: transparent; box-shadow: none; backdrop-filter: none; animation: none;
  }
  .nav-links .nav-write { justify-content: center; margin: 4px 0 0; }
  /* 注意：这里**不要**再给 .theme-btn 写 align-self / margin-top。
     曾经的一条 `.theme-btn { align-self: flex-start; margin: 6px 0 0 4px; }` 是主题按钮
     还塞在折叠菜单（.nav-links，flex 列）里时的排版。工具按钮搬到 .nav-user（flex 行）
     之后它就成了错位来源：按钮被顶到行首、又压了 6px 上边距，于是比旁边的语言按钮低
     3px，同时把这一行撑高 6px（38px）。行里交给 .nav-user 的 align-items: center 居中
     即可，什么都不用加（移动端截图里的「两个按钮没对齐」就是这条造成的）。 */

  /* —— 排版 —— */
  .container { padding: 72px 14px 46px; }
  .hero { padding-top: 18px; gap: 20px; min-height: 0; }
  .hero-badge { font-size: 11px; }
  .hero-title { font-size: 26px; }
  .hero-sub { font-size: 14px; line-height: 1.85; }
  .hero-term pre { font-size: 12px; padding: 14px 16px; }
  .section-title h2 { font-size: 17px; }
  .acard-title { font-size: 15px; }
  .acard-meta { font-size: 11.5px; }
  .md { font-size: 16px; line-height: 1.95; }          /* ≥16px 防 iOS 聚焦缩放 */
  .md h1 { font-size: 21px; } .md h2 { font-size: 19px; } .md h3 { font-size: 16.5px; }
  .md pre { font-size: 12.5px; }
  .art-title { font-size: 22px; }
  .art-info { font-size: 12px; }
  .auth-wrap { margin: 20px auto; padding: 26px 22px; }
  .editor-wrap { padding: 18px 16px; }
  .ed textarea, .ed .preview { min-height: 320px; font-size: 15px; }
  .tbl th, .tbl td { padding: 9px 10px; }
  .foot { font-size: 12px; }

  /* iOS 输入框 ≥16px，避免聚焦时页面被自动放大 */
  .input, textarea.input, select.input { font-size: 16px; }

  /* —— 后台 —— */
  .adm-topbar { padding: 0 12px; height: 50px; }
  .adm-crumb { font-size: 12.5px; }
  .adm-user-btn span { display: none; }                 /* 小屏只留头像 */
  .adm-content { padding: 12px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-card .num { font-size: 22px; }
  .adm-side { height: auto; }
  .adm-logo { padding: 14px 14px 8px; }
  .adm-nav { flex-wrap: wrap; }
  .adm-nav a { padding: 8px 10px; font-size: 12.5px; }

  /* —— 宠物 —— */
  #pet-root { right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); }
  #pet-btn { width: 54px; height: 54px; border-radius: 14px; }
  #pet-btn svg { width: 38px; height: 38px; }
  #pet-bubble { max-width: 190px; font-size: 12px; }

  /* 评论 */
  .cmt { gap: 10px; }
  .cmt-children { margin-left: 8px; padding-left: 10px; }
  .cmt-content { font-size: 14px; }
}
/* ---------- 窄屏导航：把右侧控件收进屏幕内 ----------
   折叠态下右侧是「主题 + 界面语言 + 头像 + 后台 + 退出 + 通知铃铛」6 个控件。中文全标签
   实测需要 568px，登录后在 390px 手机上「后台」被裁掉一半、退出和铃铛整个在屏幕外（用户
   截图）。这里 ≤720px 收紧：
     · 内边距与 .container 的移动端 14px 对齐（原来还是桌面的 24px，两者内容栏错开）
     · 账号按钮收成纯图标（都带 title，信息不丢），按钮间距略收
   ≤480px 再只留 logo，把宽度让给控件。 */
@media (max-width: 720px) {
  .nav { padding: 0 14px; gap: 10px; }
  .nav-user { gap: 6px; }
  /* 只收「带图标」的账号按钮（.btn-ico）：登录/注册是纯文字，字号归零会变成空按钮
     （法语下正是如此，见文件末尾同一处规则）。 */
  .nav-user > .btn-ico { font-size: 0; gap: 0; padding: 8px 9px; }
  .nav-user > .btn-ico svg { width: 15px; height: 15px; }
}
@media (max-width: 480px) {
  .brand-name { display: none; }
}

/* 极窄屏（≤380px：iPhone SE / 多数安卓）：再省一点点，保证右侧控件不被裁。
   法语最紧（登录按钮是纯文字，Connexion / S'inscrire 比中文长得多）。 */
@media (max-width: 380px) {
  .nav { padding: 0 12px; }
  .nav-user { gap: 5px; }
  /* 分隔线连着它的 10px 外边距一起去掉：汉堡与工具按钮之间的间距已经够分辨了。
     这里多写一个 .nav 前缀是为了压过文件末尾那条 `.nav-user > .theme-btn`（同权重时
     后者在后，会赢）。 */
  .nav .nav-user > .theme-btn { margin-left: 0; }
  .nav-user > .theme-btn::before { display: none; }
  /* 纯文字账号按钮（登录/注册）内边距再收一点；带图标的按钮不受影响 */
  .nav-user > .btn:not(.btn-ico) { padding: 6px 9px; }
  .hero-title { font-size: 23px; }
  .btn { padding: 9px 14px; font-size: 13.5px; }
}

/* ---------- 通知铃铛 ---------- */
.notify-wrap { position: relative; }
.notify-btn {
  position: relative; width: 32px; height: 32px; border-radius: 8px;
  border: 1px solid var(--line-hi); background: var(--panel); color: var(--text2);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.notify-btn:hover { border-color: var(--accent); color: var(--accent2); background: var(--accent-dim); }
.notify-dot {
  position: absolute; top: -5px; right: -6px; min-width: 15px; height: 15px; padding: 0 3px;
  background: #f4586e; color: #fff; border-radius: 99px; font-size: 9.5px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(244, 88, 110, .45);
}
.notify-panel {
  position: absolute; right: 0; top: calc(100% + 8px); width: 300px; max-height: 420px;
  overflow: auto; background: var(--card); border: 1px solid var(--line-hi);
  border-radius: 12px; box-shadow: var(--shadow); padding: 8px; z-index: 80;
}
.notify-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 8px 8px; font-size: 13.5px; }
.notify-actions { display: flex; align-items: center; gap: 8px; }
.notify-all { border: none; background: none; color: var(--accent2); font-size: 12.5px; cursor: pointer; font-family: var(--font); }
.notify-all:hover { text-decoration: underline; }
.notify-all:disabled { opacity: 0.5; cursor: wait; text-decoration: none; }
.notify-item { padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.notify-item:hover { background: var(--accent-dim); }
.notify-item.unread { background: rgba(56, 189, 248, 0.08); }
.notify-item.unread:hover { background: rgba(56, 189, 248, 0.14); }
.notify-text { font-size: 13px; line-height: 1.7; color: var(--text); }
.notify-time { font-size: 11px; color: var(--faint); margin-top: 3px; }

/* ---------- 首页一言 ---------- */
.hero-say {
  display: flex; align-items: flex-start; gap: 10px; margin: 20px 0 0; max-width: 520px;
  padding: 12px 16px; border-left: 2px solid var(--accent);
  background: var(--accent-dim); border-radius: 0 8px 8px 0;
  color: var(--text2); font-size: 14px; line-height: 1.9;
}
.hero-say svg { flex: none; margin-top: 5px; }
.say-body { display: block; }
.hero-say .clamp {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden; word-break: break-word;
}
.say-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.say-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.say-more { display: inline-block; color: var(--accent2); font-size: 12px; white-space: nowrap; }
.say-more:hover { text-decoration: underline; }

/* ---------- 文章目录 TOC ---------- */
#article-toc { margin-bottom: 22px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); overflow: hidden; }
.toc-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; font-size: 13.5px; color: var(--text2);
  border-bottom: 1px solid var(--line); cursor: pointer; user-select: none;
}
.toc-collapse { color: var(--accent2); font-size: 12px; }
.toc-list { padding: 8px; }
.toc-list a {
  display: block; padding: 6px 10px; border-radius: 7px; color: var(--muted);
  font-size: 13px; line-height: 1.6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  border-left: 2px solid transparent;
}
.toc-list a:hover { color: var(--accent2); background: var(--accent-dim); }
.toc-list a.active { color: var(--accent2); background: var(--accent-dim); border-left-color: var(--accent); font-weight: 600; }
.md h1, .md h2, .md h3, .md h4 { scroll-margin-top: 84px; }

/* ---------- 文章页两栏：左侧常驻目录（sticky）+ 右侧正文 ---------- */
/* 导航是 fixed 且高 60px，sticky 的 top 必须大于它，否则目录会被压在导航下面 */
.art-layout { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 20px; align-items: start; }
.art-layout.no-toc { grid-template-columns: minmax(0, 1fr); }
.art-layout.no-toc .art-side { display: none; }
.art-side { position: sticky; top: 74px; }
.art-main { min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.art-side #article-toc { margin-bottom: 0; }
/* 目录过长时自身滚动，避免撑出视口 */
.toc-list { max-height: calc(100vh - 210px); overflow-y: auto; }
/* 两栏布局下 .comments 的 margin-top 会与 flex gap 叠加 */
.art-main .comments { margin-top: 0; }
@media (max-width: 980px) {
  /* 窄屏改为上下堆叠，目录不再吸附 */
  .art-layout { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .art-side { position: static; }
  .toc-list { max-height: none; }
}

/* ---------- 上一篇/下一篇 ---------- */
.adj-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 30px; }
.adj-card {
  display: flex; flex-direction: column; gap: 5px; padding: 13px 16px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel);
  text-decoration: none; transition: border-color .18s, transform .18s; min-width: 0;
}
.adj-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.adj-card.right { text-align: right; }
.adj-dir { font-size: 12px; color: var(--faint); }
.adj-title { font-size: 13.5px; color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adj-card.empty-side { visibility: hidden; }
@media (max-width: 720px) {
  .adj-row { grid-template-columns: 1fr; }
  .adj-card.empty-side { display: none; }
}

/* 一言切换按钮 */
.hero-say { align-items: flex-start; }
.say-text { flex: 1; }
.say-ops { display: flex; gap: 5px; flex: none; align-self: flex-start; }
.say-btn {
  width: 24px; height: 24px; border-radius: 6px; border: 1px solid var(--line-hi);
  background: var(--panel); color: var(--text2); cursor: pointer; font-size: 14px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; transition: all .15s;
  font-family: var(--font);
}
.say-btn:hover { border-color: var(--accent); color: var(--accent2); background: var(--accent-dim); }

/* ---------- 自定义光标（后台可切换：猫爪/箭头/系统；Safari 不支持 SVG 时自动降级） ---------- */
:root {
  --cursor-default: url("/static/assets/cursor-paw.svg") 10 12, auto;
  --cursor-pointer: url("/static/assets/cursor-pointer.svg") 14 14, pointer;
}
body,
body.admin-mode {
  cursor: var(--cursor-default);
}
a, button, select, label:has(input[type="checkbox"]), .chip, .pill, .acard, .avatar,
.notify-btn, .say-btn, .adj-card, .toc-list a, .adm-nav a, .tabs .tab, .oauth-btn,
.toolbar button, .theme-btn, input[type="checkbox"], input[type="file"] {
  cursor: var(--cursor-pointer);
}
input, textarea, .ed textarea, .md code, .md pre {
  cursor: text;
}

/* ---------- 联系/友链结构化编辑器 ---------- */
.le-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.le-row { display: grid; grid-template-columns: 1.1fr 1.6fr 1.2fr auto; gap: 8px; align-items: center; }
.le-row .le-del { padding: 8px 10px; }
.le-add { display: flex; gap: 8px; align-items: center; }
.le-add select { width: auto; flex: none; }
@media (max-width: 720px) {
  .le-row { grid-template-columns: 1fr 1fr; }
  .le-row .le-url { grid-column: 1 / -1; }
  .le-row .le-desc { grid-column: 1 / -1; }
  .le-row .le-del { width: 100%; }
}

/* ---------- 图片灯箱 ---------- */
.lightbox-mask {
  position: fixed; inset: 0; z-index: 500; background: rgba(4, 8, 18, 0.92);
  display: none; align-items: center; justify-content: center; backdrop-filter: blur(4px);
}
.lightbox-mask .lb-img {
  max-width: 90vw; max-height: 84vh; border-radius: 12px; object-fit: contain;
  box-shadow: 0 20px 60px rgba(0,0,0,.6); animation: popIn .18s;
}
.lightbox-mask .lb-count {
  position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
  color: #9aa5c4; font-size: 13px; font-family: var(--mono);
}
.lightbox-mask button {
  position: absolute; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid rgba(148,163,184,.35); background: rgba(15,23,42,.6);
  color: #e2e8f0; font-size: 20px; cursor: pointer; transition: all .15s;
  display: flex; align-items: center; justify-content: center;
}
.lightbox-mask button:hover { background: rgba(56,189,248,.25); border-color: var(--accent2); color: #fff; }
.lightbox-mask .lb-close { top: 22px; right: 22px; }
.lightbox-mask .lb-prev { left: 24px; top: 50%; transform: translateY(-50%); }
.lightbox-mask .lb-next { right: 24px; top: 50%; transform: translateY(-50%); }

/* ---------- 代码复制按钮 ---------- */
.md pre .pre-copy {
  position: absolute; top: 8px; right: 10px; padding: 3px 10px; border-radius: 7px;
  border: 1px solid rgba(148,163,184,.35); background: rgba(15,23,42,.75); color: #a7b4cd;
  font-size: 11.5px; cursor: pointer; font-family: var(--font); opacity: 0; transition: opacity .18s;
}
.md pre:hover .pre-copy { opacity: 1; }
.md pre .pre-copy:hover { color: #fff; border-color: var(--accent2); background: rgba(56,189,248,.25); }

/* ---------- 视频嵌入 ---------- */
.embed { position: relative; margin: 16px 0; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.embed iframe { display: block; width: 100%; aspect-ratio: 16/9; border: none; background: #000; }

/* ---------- 音乐播放器 ---------- */
#music-root { position: fixed; left: 18px; bottom: 16px; z-index: 290; }
#music-mini {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 8px;
  background: var(--card); border: 1px solid var(--line-hi); border-radius: 14px;
  box-shadow: var(--shadow); max-width: 250px;
}
#music-toggle, #music-list-btn {
  width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line-hi);
  background: var(--panel); color: var(--text2); cursor: pointer; font-size: 13px; flex: none;
  display: inline-flex; align-items: center; justify-content: center; transition: all .15s;
}
#music-toggle:hover, #music-list-btn:hover { border-color: var(--accent); color: var(--accent2); background: var(--accent-dim); }
#music-meta { cursor: pointer; min-width: 0; }
#music-title { font-size: 12.5px; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#music-artist { font-size: 11px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#music-panel {
  position: absolute; left: 0; bottom: 58px; width: 260px; max-height: 300px; overflow: auto;
  background: var(--card); border: 1px solid var(--line-hi); border-radius: 12px;
  box-shadow: var(--shadow); padding: 8px; display: none;
}
#music-panel.open { display: block; }
.mp-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 8px 8px; font-size: 13px; font-weight: 700; color: var(--text); }
.mp-head button { border: none; background: none; color: var(--faint); cursor: pointer; }
.mp-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px;
  cursor: pointer; font-size: 12.5px; color: var(--text2);
}
.mp-item:hover { background: var(--accent-dim); }
.mp-item.playing { background: var(--accent-dim); color: var(--accent2); }
.mp-num { width: 18px; text-align: center; color: var(--faint); font-family: var(--mono); font-size: 11px; flex: none; }
.mp-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.mp-artist { color: var(--faint); font-size: 11px; flex: none; }
@media (max-width: 720px) {
  #music-root { left: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); }
  #music-mini { max-width: 190px; }
}

/* ---------- 留言板 ---------- */
.msg-item { display: flex; gap: 12px; padding: 14px 8px; border-bottom: 1px dashed var(--line); }
.msg-item:last-child { border-bottom: none; }
.msg-ava {
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: none;
  background: var(--grad); color: #fff; font-weight: 700; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center;
}
.msg-bodymin { min-width: 0; flex: 1; }
.msg-head { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--faint); }
.msg-head b { color: var(--text2); font-size: 13.5px; }
.msg-del { border: none; background: none; color: var(--faint); cursor: pointer; font-size: 12px; margin-left: auto; }
.msg-del:hover { color: var(--bad); }
.msg-content { color: var(--text2); font-size: 14px; line-height: 1.85; margin-top: 4px; white-space: pre-wrap; word-break: break-word; }

/* ---------- BGM 条 / 投票 / 足迹墙 / 在线 ---------- */
.bgm-bar {
  display: flex; align-items: center; gap: 12px; margin: 4px 0 14px; padding: 8px 12px;
  background: var(--accent-dim); border: 1px solid rgba(56,189,248,.25); border-radius: 10px;
  color: var(--text2); font-size: 13px;
}
.bgm-play {
  width: 36px; height: 36px; border-radius: 10px; border: none; cursor: pointer;
  background: var(--grad); color: #fff; font-size: 14px;
}
.poll-btns { display: flex; flex-direction: column; gap: 10px; }
.poll-btn {
  display: grid; grid-template-columns: 130px 1fr auto; gap: 10px; align-items: center;
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel);
  color: var(--text2); cursor: pointer; text-align: left; font-family: var(--font); transition: all .15s;
}
.poll-btn:hover { border-color: var(--accent); }
.poll-btn.mine { border-color: var(--accent2); background: rgba(56,189,248,.1); }
.poll-label { font-size: 13.5px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.poll-bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.poll-bar i { display: block; height: 100%; background: var(--grad); border-radius: 99px; transition: width .4s; }
.poll-pct { font-size: 12px; color: var(--faint); white-space: nowrap; font-family: var(--mono); }
@media (max-width: 720px) { .poll-btn { grid-template-columns: 1fr; } .poll-bar { order: 3; } .poll-pct { order: 2; font-size: 11px; } }

.foot-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; text-align: center; }
.foot-grid .num { font-size: 26px; font-weight: 800; color: var(--accent2); font-family: var(--mono); }
.foot-grid .lbl { font-size: 12px; color: var(--faint); margin-top: 4px; }
@media (max-width: 720px) { .foot-grid { grid-template-columns: repeat(2, 1fr); } }
.guest-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; }
.guest-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px;
  display: flex; flex-direction: column; gap: 6px; transition: transform .15s, border-color .15s;
}
.guest-card:hover { transform: translateY(-2px); border-color: var(--line-hi); }
.g-name { font-size: 12px; font-weight: 700; color: var(--text); }
/* 头像条用 aspect-ratio 定高：父容器高度由内容决定，用百分比高度会形成循环，
   卡片会被撑出边界导致底部文字被裁切 */
.g-face {
  width: 100%; aspect-ratio: 5 / 3; border-radius: 10px;
  display: block; position: relative; overflow: hidden;
}
.g-meta { font-size: 10.5px; color: var(--faint); }
.g-region { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-region.muted { color: var(--faint); opacity: .7; }
/* 访客分布地图 */
.g-map { height: min(60vh, 420px); border-radius: 10px; overflow: hidden; background: #0e1626; }
.g-map-empty { height: auto; min-height: 90px; display: flex; align-items: center; justify-content: center;
  color: var(--faint); font-size: 13px; border: 1px dashed var(--line); border-radius: 10px; }
html.light .g-map { background: #eef2f8; }
/* 地图上的地区名标签（Leaflet tooltip 定制） */
.g-map-label {
  background: rgba(10, 18, 34, .82); color: #e8eef9; border: none; border-radius: 6px;
  padding: 1px 7px; font-size: 11px; font-weight: 600; line-height: 1.6;
  box-shadow: 0 2px 8px rgba(2, 8, 22, .35);
}
.g-map-label::before { display: none; } /* 去掉指向箭头，避免遮挡 */
html.light .g-map-label { background: rgba(255, 255, 255, .92); color: #1f2d4a; }
.hero-live { display: flex; align-items: center; gap: 7px; margin-top: 14px; font-size: 12.5px; color: var(--muted); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #2dd4a7; box-shadow: 0 0 8px rgba(45,212,167,.8); animation: livePulse 1.6s ease-in-out infinite; }
@keyframes livePulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* ---------- 编辑器上传进度卡片 ---------- */
.ed-prog {
  margin: 10px 0; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--panel);
}
.ed-prog-top { display: flex; align-items: center; gap: 10px; }
.ed-prog-name { flex: 1; font-size: 13px; color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-prog-x {
  border: none; background: transparent; color: var(--faint); cursor: pointer; font-size: 13px; line-height: 1;
}
.ed-prog-x:hover { color: #f56fa8; }
.ed-prog-bar { height: 6px; border-radius: 99px; background: rgba(148,163,184,.16); margin: 8px 0 6px; overflow: hidden; }
.ed-prog-bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width .18s; }
.ed-prog-sub { font-size: 12px; color: var(--faint); font-family: var(--mono); }

.pw-head { margin: 4px 0 18px; }
.pw-head h1 { margin: 0 0 6px; font-size: 26px; }
.pw-head p { margin: 0; color: var(--muted); font-size: 13px; }

/* ---------- 照片墙 ---------- */
.pw-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
/* 上传进度卡片 */
.pw-prog {
  margin: 0 0 14px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--card); box-shadow: var(--shadow-sm);
}
.pw-prog-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--text2); }
.pw-prog-top span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pw-prog-top b { font-family: var(--mono); color: var(--accent2); }
.pw-prog-bar { height: 6px; border-radius: 99px; background: rgba(148,163,184,.16); margin: 9px 0 7px; overflow: hidden; }
.pw-prog-bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--grad, linear-gradient(90deg, var(--accent), var(--accent2))); transition: width .18s; }
.pw-prog-sub { font-size: 12px; color: var(--muted); font-family: var(--mono); }

.pw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.pw-card {
  position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--line);
  background: var(--panel); cursor: zoom-in; transition: transform .18s, border-color .18s;
}
.pw-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.pw-card .pw-img { display: block; width: 100%; height: 180px; object-fit: cover; background: rgba(148,163,184,.08); }
.pw-card .pw-ph {
  height: 180px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  color: var(--faint); font-size: 12px; background: repeating-linear-gradient(45deg, rgba(148,163,184,.06) 0 12px, transparent 12px 24px);
}
.pw-card .pw-ph b { color: var(--text2); font-size: 13px; }
/* 卡片角上的删除。手机没有 hover：必须始终可见（32px 点击区），桌面才收起来等 hover，
   否则一排红图标太吵，看图本身才是这里的主业。 */
.pw-del {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  width: 32px; height: 32px; padding: 0; border-radius: 10px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #fff; background: rgba(15,23,42,.6); border: 1px solid rgba(255,255,255,.18);
  backdrop-filter: blur(4px); transition: background .15s, opacity .15s;
}
.pw-del:hover { background: var(--bad, #f4586e); border-color: transparent; }
@media (hover: hover) and (pointer: fine) {
  .pw-del { opacity: 0; }
  .pw-card:hover .pw-del, .pw-del:focus-visible { opacity: 1; }
}
.pw-meta { padding: 8px 12px; font-size: 12px; color: var(--faint); font-family: var(--mono); display: flex; justify-content: space-between; gap: 8px; }
.pw-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pw-view { position: fixed; inset: 0; z-index: 400; background: rgba(4,8,18,.96); display: flex; flex-direction: column; }
.pw-view-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 18px; color: var(--text2); font-size: 13px;
  border-bottom: 1px solid rgba(148,163,184,.18);
}
.pw-view-bar .grow { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pw-stage { flex: 1; overflow: auto; display: flex; align-items: center; justify-content: center; padding: 18px; }
.pw-stage img { max-width: none; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.55); }
.pw-stage.pan img { cursor: grab; }
.pw-hint { text-align: center; color: var(--faint); font-size: 12px; padding: 6px 0 12px; }

/* ---------- 评论表情回应 ---------- */
.cmt-reacts { display: flex; gap: 5px; margin-top: 6px; flex-wrap: wrap; align-items: center; position: relative; }
.react-btn {
  border: 1px solid var(--line); background: var(--panel); color: var(--text2);
  border-radius: 99px; padding: 2px 9px; font-size: 14px; line-height: 1.7; cursor: pointer; font-family: var(--font);
  transition: border-color .15s, background .15s, transform .15s;
}
.react-btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.react-btn .r-count { font-size: 11px; color: var(--faint); font-family: var(--mono); margin-left: 3px; vertical-align: 1px; }
.react-btn.active { border-color: var(--accent2); background: rgba(56,189,248,.14); color: var(--accent2); }
.react-btn .r-count.active { color: var(--accent2); }
/* 「添加表情」入口：没表情时只留它一个小圆钮，不再把 6 个表情全摆出来 */
.react-add {
  width: 30px; height: 30px; flex: none; display: inline-flex; align-items: center; justify-content: center;
  border: 1px dashed var(--line-hi); background: transparent; border-radius: 999px;
  color: var(--faint); cursor: pointer; transition: color .15s, border-color .15s, background .15s;
}
.react-add:hover { color: var(--accent2); border-color: var(--accent); background: var(--accent-dim); }
/* 表情选择面板（Telegram 风格网格）：挂在 #modal-root 的固定定位浮层，
   left/top 由 JS 按按钮位置算（下方放不下会翻到上方），不被评论卡片裁剪 */
.react-picker {
  position: fixed; z-index: 120; top: 0; left: 0;
  display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px;
  padding: 8px; width: max-content; max-width: min(320px, calc(100vw - 16px));
  background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 14px;
  box-shadow: var(--shadow); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  animation: riseIn .16s ease both;
}
.react-picker button {
  width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent; border-radius: 9px; font-size: 19px; line-height: 1;
  cursor: pointer; transition: background .12s, transform .12s;
}
.react-picker button:hover { background: var(--panel); transform: scale(1.18); }
.react-picker button.active { background: rgba(56,189,248,.18); box-shadow: inset 0 0 0 1px var(--accent2); }
@media (max-width: 520px) {
  .react-picker { grid-template-columns: repeat(6, 1fr); }
}

/* ---------- 访客面孔 ---------- */
.guest-card { position: relative; }

/* ---------- 倒计时 ---------- */
.countdown-card {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 14px;
  padding: 8px 16px; border-radius: 10px; border: 1px dashed rgba(245,176,76,.5);
  background: rgba(245,176,76,.08); color: var(--text2); font-size: 13px;
}
.countdown-card b { color: #f5b04c; font-size: 14px; font-family: var(--mono); }

/* ---------- 投票选项编辑器 ---------- */
#ed-poll-editor { display: flex; flex-direction: column; gap: 8px; }
.poll-opt-row { display: flex; gap: 8px; align-items: center; }
.poll-opt-row .poll-opt-input { flex: 1; }
.poll-opt-row .poll-opt-del { flex: none; padding: 8px 10px; }

/* ---------- 摘抄 / 语录 ---------- */
/* 摘抄墙用瀑布流（CSS columns）：卡片按自身高度排布，互不拉伸、不留大空白 */
.quote-grid { column-gap: 18px; }
.quote-item { position: relative; display: flex; flex-direction: column; gap: 10px; break-inside: avoid; margin-bottom: 18px; animation: riseIn .4s ease both; }
@media (min-width: 900px) { .quote-grid { columns: 3; } }
@media (min-width: 600px) and (max-width: 899px) { .quote-grid { columns: 2; } }
@media (max-width: 599px) { .quote-grid { columns: 1; } }
.quote-item .q-head { display: flex; align-items: center; gap: 8px; }
.quote-item .q-body {
  font-size: 15.5px; line-height: 1.9; color: var(--text);
  white-space: pre-wrap; word-break: break-word;
}
.quote-item .q-foot { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-top: auto; }
.quote-item .q-src { color: var(--accent2); font-size: 13px; }
.quote-item a.q-src:hover { text-decoration: underline; }
.quote-item .q-time { color: var(--faint); font-size: 12px; margin-left: auto; }
.quote-item .q-ops { display: inline-flex; gap: 6px; margin-left: 12px; }
.quote-item .q-note {
  margin-top: 2px; padding: 8px 12px; border-left: 2px solid var(--accent-dim);
  background: var(--accent-dim); border-radius: 0 8px 8px 0;
  color: var(--text2); font-size: 12.5px; line-height: 1.7;
}

/* ===================== 磨砂玻璃背景（Glassmorphism） =====================
   在后台「站点设置 → 背景」配置后启用；全部留空则完全不渲染，保持原有纯色暗背景。 */

:root {
  --glass-bg: rgba(16, 23, 38, 0.55);        /* 暗色玻璃面板底色 */
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-hi: rgba(255, 255, 255, 0.05);
  --bg-frost-opacity: 0.42;                  /* 底层壁纸透出强度 */
  --bg-frost-dim: 0.62;                      /* 壁纸上的压暗（保证文字可读） */
  --bg-frost-blur: 10px;                     /* 壁纸自身磨砂 */
  --glass-blur: 12px;                        /* 面板玻璃磨砂 */
}
body.light {
  --glass-bg: rgba(255, 255, 255, 0.62);
  --glass-border: rgba(15, 23, 42, 0.08);
  --glass-hi: rgba(255, 255, 255, 0.75);
  --bg-frost-dim: 0.22;
}

/* 底层壁纸：固定、磨砂、低通透 + 压暗。放在 fx 特效层之下、正文之上。 */
#bg-frost {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-size: cover; background-position: center;
  filter: blur(var(--bg-frost-blur)) saturate(1.15);
  transform: scale(1.05);                    /* 抹平 blur 造成的边缘 */
  opacity: var(--bg-frost-opacity);
  transition: opacity .5s;
}
#bg-frost::after {
  content: ""; position: absolute; inset: 0;
  background: rgba(7, 13, 26, var(--bg-frost-dim));
}
body.light #bg-frost::after { background: rgba(242, 245, 250, var(--bg-frost-dim)); }
#bg-frost.off { opacity: 0; }
body.admin-mode #bg-frost { display: none; }
/* 开启背景时让 body 自身底色透明，否则会盖住 z-index:-1 的壁纸层（html 底色仍作兜底） */
body.bg-on:not(.admin-mode) { background: transparent; }

/* 开启背景时：玻璃化公共区域的卡片/弹窗/页脚（admin 保持不透明、不受影响） */
body.bg-on:not(.admin-mode) .card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.2);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.2);
  border-color: var(--glass-border);
  box-shadow: 0 10px 30px rgba(2, 8, 22, 0.35);
}
body.bg-on:not(.admin-mode) .modal {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.2);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.2);
  border: 1px solid var(--glass-border);
}
body.bg-on:not(.admin-mode) .foot {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.2);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.2);
}
body.bg-on:not(.admin-mode) .hero-term { background: var(--glass-bg); }
/* 一言块也玻璃化：hero 背景图较花时保证可读 */
body.bg-on:not(.admin-mode) .hero-say {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.2);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.2);
}

/* 小屏降级：去掉实时模糊（backdrop-filter 在移动端/低端机滚动很贵），
   改用更实的半透明底保证可读性 */
@media (max-width: 720px) {
  body.bg-on:not(.admin-mode) .card,
  body.bg-on:not(.admin-mode) .modal,
  body.bg-on:not(.admin-mode) .foot,
  body.bg-on:not(.admin-mode) .hero-say {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(16, 23, 38, 0.84);
  }
  body.light.bg-on:not(.admin-mode) .card,
  body.light.bg-on:not(.admin-mode) .modal,
  body.light.bg-on:not(.admin-mode) .foot,
  body.light.bg-on:not(.admin-mode) .hero-say {
    background: rgba(255, 255, 255, 0.88);
  }
}

/* 无障碍：减少动态效果时不做壁纸淡入过渡 */
@media (prefers-reduced-motion: reduce) {
  #bg-frost { transition: none; }
}

/* 首页 hero 横幅（配置了 hero 图时由 JS 加 .has-bg + --hero-img） */
.hero { position: relative; }
.hero.has-bg {
  border-radius: var(--radius); overflow: hidden;
  background-image:
    linear-gradient(180deg, rgba(7, 13, 26, 0.30), rgba(7, 13, 26, 0.90)),
    var(--hero-img, none);
  background-size: cover; background-position: center;
}
.hero.has-bg > * { position: relative; z-index: 1; }

/* 各内容页顶部 banner（pageBanner 复用） */
.page-banner {
  position: relative; margin: 20px 0 8px; min-height: 150px; border-radius: var(--radius);
  overflow: hidden; display: flex; align-items: flex-end; padding: 18px 22px;
  background-size: cover; background-position: center;
  border: 1px solid var(--glass-border); box-shadow: var(--shadow-sm);
}
.page-banner::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(7, 13, 26, 0.35), rgba(7, 13, 26, 0.88));
}
body.light .page-banner::before {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.30), rgba(255, 255, 255, 0.82));
}
.page-banner .pb-title { position: relative; font-size: 22px; font-weight: 800; color: var(--text); display: flex; align-items: baseline; gap: 12px; }
.page-banner .pb-title .pb-sub { font-size: 13px; color: var(--text2); font-weight: 400; }
/* banner 已经是页面标题时，隐藏紧随其后重复的 section-title 标题（保留右侧操作按钮） */
.page-banner + .section-title h2 { display: none; }
/* 同理：隐藏 banner 之后卡片里重复的首个标题（关于/联系页） */
.page-banner + .card > h2:first-child { display: none; }
/* 小屏 banner 更紧凑 */
@media (max-width: 720px) {
  .page-banner { min-height: 110px; padding: 14px 16px; }
  .page-banner .pb-title { font-size: 18px; }
}

/* 登录/注册/404 全屏氛围背景 */
.bg-hero {
  position: relative; min-height: calc(100vh - 140px); border-radius: var(--radius); overflow: hidden;
}
.bg-hero::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background-size: cover; background-position: center; filter: blur(3px) saturate(1.1);
  background-image: var(--bg-hero-img, none);
}
.bg-hero::after {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: rgba(7, 13, 26, 0.66);
}
body.light .bg-hero::after { background: rgba(242, 245, 250, 0.78); }
.bg-hero > * { position: relative; z-index: 1; }

/* 省流量模式（prefers-reduced-data）：不下载背景图，回退纯色底 */
@media (prefers-reduced-data: reduce) {
  #bg-frost { display: none; }
  .hero.has-bg,
  .page-banner { background-image: none !important; }
  .bg-hero::before { background-image: none; }
}

/* ---------- 后台「背景图」表单：字段 + 上传/随机/转存按钮 + 缩略图 ---------- */
.bg-sect { margin-bottom: 14px; }
.bg-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.bg-sect-title { font-size: 13px; color: var(--text2); font-weight: 600; }
.bg-toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; color: var(--text2); }
.bg-field { display: block; margin-bottom: 14px; }
.bg-field .bg-lbl { display: block; font-size: 13px; color: var(--text2); margin-bottom: 6px; font-weight: 600; }
/* 窄屏时按钮换行，输入框优先占满整行 */
.bg-field .bg-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bg-field .bg-row .input { flex: 1 1 240px; min-width: 0; }
.bg-field .bg-rand, .bg-field .bg-localize { white-space: nowrap; }
.bg-src { width: auto; max-width: 200px; padding-top: 6px; padding-bottom: 6px; }
/* 缩略图外面包一层「看原图」链接，点击在新标签页打开大图 */
.bg-thumb-link { display: block; flex: none; line-height: 0; border-radius: 8px; }
.bg-thumb-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.bg-thumb {
  width: 40px; height: 40px; flex: none; border-radius: 8px; object-fit: cover;
  border: 1px solid var(--line); background: var(--panel);
}

/* 首页倒计时：节日 / 节气 类型标签 */
.cd-tag {
  display: inline-block; padding: 1px 7px; border-radius: 5px; margin-right: 6px;
  font-size: 11px; font-weight: 700; vertical-align: 1px;
}
.cd-tag.fest { background: rgba(245, 176, 76, 0.16); color: #f5b04c; }
.cd-tag.term { background: rgba(45, 212, 167, 0.16); color: #2dd4a7; }

/* ---------- AI 翻译：后台配置面板 ---------- */
/* 顶部状态条：一眼看出"开没开、前台会怎样"。绿点=已开启，灰点=未开启。 */
.ai-status { display: flex; align-items: center; gap: 16px; justify-content: space-between; margin-bottom: 14px; }
.ai-status-main { display: flex; align-items: center; gap: 12px; }
.ai-status-main > div { display: flex; flex-direction: column; gap: 3px; }
.ai-status-main b { font-size: 14.5px; }
.ai-status-main span { font-size: 12.5px; color: var(--faint); }
.ai-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--faint); }
.ai-status.ok .ai-dot { background: var(--ok); box-shadow: 0 0 0 4px rgba(45, 212, 167, .16); }
.ai-status.ok .ai-status-main b { color: var(--ok); }

/* 开关（状态条右侧） */
.ai-toggle { position: relative; flex: none; display: inline-flex; align-items: center; cursor: pointer; }
.ai-toggle input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.ai-knob {
  width: 46px; height: 25px; border-radius: 999px; background: var(--line-hi);
  transition: background .18s; position: relative; display: inline-block;
}
.ai-knob::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 19px; height: 19px;
  border-radius: 50%; background: #fff; transition: transform .18s; box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
.ai-toggle input:checked + .ai-knob { background: var(--accent); }
.ai-toggle input:checked + .ai-knob::after { transform: translateX(21px); }
.ai-toggle input:focus-visible + .ai-knob { outline: 2px solid var(--accent2); outline-offset: 2px; }

/* 服务商胶囊：点一下把服务地址填好 */
.ai-presets { display: flex; flex-wrap: wrap; gap: 8px; }
.ai-preset {
  border: 1px solid var(--line); background: var(--panel); color: var(--text2);
  border-radius: 999px; padding: 7px 14px; font-size: 13px; cursor: pointer; transition: .16s;
}
.ai-preset:hover { border-color: var(--line-hi); color: var(--text); }
.ai-preset.on { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); font-weight: 600; }

/* 模型：输入框 + 拉取按钮 + 结果胶囊 */
.ai-model-row { display: flex; gap: 8px; align-items: center; }
.ai-model-row .input { flex: 1; min-width: 0; }
.ai-model-row .btn { flex: none; white-space: nowrap; }
.ai-model-list {
  margin-top: 10px; max-height: 190px; overflow: auto; padding: 10px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel);
  display: flex; flex-wrap: wrap; gap: 6px;
}
.ai-model-tip { font-size: 12.5px; color: var(--faint); width: 100%; }
.ai-model-tip.err { color: var(--bad); }
.ai-model {
  font-family: var(--mono); font-size: 12px; padding: 4px 9px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--text2); cursor: pointer;
}
.ai-model:hover { border-color: var(--accent); color: var(--accent); }

/* 保存 / 测试 */
.ai-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; }

/* 高级设置：默认收起，协议 / 免认证 / 自定义要求都藏在这里 */
.ai-advanced { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.ai-advanced > summary {
  cursor: pointer; font-size: 13.5px; color: var(--text2); font-weight: 600;
  list-style: none; display: flex; align-items: center; gap: 6px;
}
.ai-advanced > summary::-webkit-details-marker { display: none; }
.ai-advanced > summary::before { content: "▸"; font-size: 11px; color: var(--faint); transition: transform .16s; }
.ai-advanced[open] > summary::before { transform: rotate(90deg); }
.ai-advanced-body { padding: 14px 0 2px; }

/* 复选行 */
.ai-check { display: flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13.5px; color: var(--text2); }
.ai-check + .ai-check { margin-top: 10px; }

/* 语言多选：定宽芯片，选中即高亮（宽度写死，避免"中文"与"English"卡片一大一小） */
.ai-langs { display: flex; gap: 8px; flex-wrap: wrap; }
.ai-lang {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; flex: none;
  border: 1px solid var(--line); border-radius: 999px; height: 40px;
  padding: 0 16px 0 12px; background: var(--panel); transition: .16s;
}
.ai-lang input { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); }
.ai-lang > span { font-size: 13.5px; line-height: 1; white-space: nowrap; }
.ai-lang i { font-size: 11px; color: var(--faint); font-style: normal; margin-left: 6px; }
.ai-lang:hover { border-color: var(--line-hi); }
.ai-lang:has(input:checked) { border-color: var(--accent); background: var(--accent-dim); color: var(--accent); }
.ai-lang:has(input:checked) i { color: var(--accent); opacity: .7; }

/* ---------- AI 翻译：文章页语言切换 ---------- */
/* 一个紧凑的分段控件（地球图标 + 语言项），与文章标签明确区分开：
   标签是扁平的圆角小片，这里是带边框的浅底控件、选中项才有强调底。 */
.tr-wrap {
  display: inline-flex; align-items: center; flex: none;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); overflow: hidden; height: 28px;
}
.tr-wrap .tr-lead {
  display: inline-flex; align-items: center; padding: 0 7px 0 10px;
  color: var(--muted); line-height: 0;   /* line-height:0 保证图标不被行高挤出基线 */
}
.tr-wrap .tr-lead svg { display: block; }
.tr-btn {
  display: inline-flex; align-items: center; border: 0; background: transparent;
  color: var(--muted); font-size: 12px; line-height: 1; padding: 0 10px; height: 100%;
  cursor: pointer; white-space: nowrap; transition: background .16s, color .16s;
}
.tr-btn:hover { color: var(--text); background: var(--accent-dim); }
.tr-btn.on { background: var(--accent-dim); color: var(--accent); font-weight: 600; }
.tr-btn[disabled] { opacity: .55; cursor: progress; }
/* 语言项之间的细分隔线；选中项两侧不画，免得跟底色打架 */
.tr-btn + .tr-btn { box-shadow: inset 1px 0 0 var(--line); }
.tr-btn.on + .tr-btn, .tr-btn.on { box-shadow: none; }
.tr-note { font-size: 12.5px; color: var(--faint); margin: 10px 0 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tr-note .spin { width: 12px; height: 12px; border-width: 2px; }
.tr-note .tr-back {
  border: 1px solid var(--line); background: transparent; color: var(--text2);
  border-radius: 999px; padding: 3px 10px; font-size: 12px; cursor: pointer;
}
.tr-note .tr-back:hover { border-color: var(--accent); color: var(--accent); }
/* 译文提示条：贴在正文上方，绿色细边，明确「这不是原文」 */
.tr-banner {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  border-left: 3px solid var(--ok); background: rgba(45, 212, 167, .08);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 9px 14px; margin-bottom: 12px; font-size: 13px; color: var(--text2);
}
.tr-banner b { color: var(--ok); }
/* 窄屏：允许换行，但控件本身仍然是一个整体 */
@media (max-width: 720px) {
  .tr-btn { padding: 0 8px; font-size: 11.5px; }
  .tr-wrap { height: 26px; }
}

/* ---------- AI 翻译：长文进度 ---------- */
.tr-prog-label { font-variant-numeric: tabular-nums; }
.tr-prog-bar {
  display: inline-block; width: 150px; height: 5px; border-radius: 999px;
  background: var(--line); overflow: hidden; vertical-align: middle;
}
.tr-prog-bar > i {
  display: block; height: 100%; background: var(--accent);
  border-radius: 999px; transition: width .3s ease;
}
@media (max-width: 720px) {
  .tr-prog-bar { width: 90px; }
}

/* ---------- AI 翻译：后台用量面板 ---------- */
.ai-usage-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.ai-usage-cell {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 14px; background: var(--panel);
}
.ai-usage-cell .n { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ai-usage-cell .l { font-size: 12px; color: var(--faint); margin-top: 4px; }
.ai-usage-cell.hi .n { color: var(--accent); }
.ai-spark { display: flex; align-items: flex-end; gap: 6px; height: 56px; margin-top: 10px; }
.ai-spark > span {
  flex: 1; background: var(--accent-dim); border: 1px solid var(--accent);
  border-radius: 4px 4px 0 0; min-height: 3px; position: relative;
}
.ai-spark > span i {
  position: absolute; top: -17px; left: 0; right: 0; text-align: center;
  font-size: 10.5px; color: var(--faint); font-style: normal;
}
.ai-spark-x { display: flex; gap: 6px; margin-top: 4px; }
.ai-spark-x > span { flex: 1; text-align: center; font-size: 10.5px; color: var(--faint); }

/* ---------- 界面语言切换器（导航右侧，与主题按钮同排） ---------- */
.lang-wrap { position: relative; display: inline-flex; }
/* 与主题按钮同款：32×32 方形描边按钮，两个工具按钮成对出现 */
.lang-btn {
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line-hi);
  background: var(--panel); color: var(--text2); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.18s; flex: none;
}
.lang-btn:hover { border-color: var(--accent); color: var(--accent2); background: var(--accent-dim); }
.lang-wrap.open .lang-btn { border-color: var(--accent); color: var(--accent2); background: var(--accent-dim); }
/* 菜单挂在浮层（body/#modal-root）里，用 fixed 定位：导航容器是 overflow 滚动容器，
   absolute 会被裁剪（表现为「点了没反应」） */
.lang-menu {
  position: fixed; z-index: 120;
  min-width: 132px; padding: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  /* 面板只在打开时创建（挂到浮层），所以这里直接 flex，不需要 display:none */
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px;
}
.lang-menu button {
  display: block; width: 100%; text-align: left;
  background: transparent; border: 0; color: var(--text2);
  padding: 7px 10px; border-radius: 6px; font-size: 13px; cursor: pointer;
}
.lang-menu button:hover { background: var(--accent-dim); color: var(--accent); }
.lang-menu button.on { color: var(--accent); font-weight: 600; }


/* ---------- 关于页：AI 翻译这一页 ---------- */
.about-head { display: flex; justify-content: flex-end; margin-bottom: 10px; }
.about-head:empty, .about-head:has(.tr-wrap:empty) { display: none; }

/* ---------- 摘抄：单句翻译 ---------- */
/* 顶部目标语言选择条：复用 .tr-wrap 胶囊按钮，前面挂一个小字标签说明它管的是翻译 */
.q-tr-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: -4px 0 14px; }
.q-tr-bar:empty { display: none; }
.q-tr-bar-label { font-size: 12.5px; color: var(--faint); }
.q-tr {
  display: inline-flex; align-items: center; gap: 5px;
  background: transparent; border: 1px solid var(--line); color: var(--muted);
  border-radius: 999px; padding: 3px 10px; font-size: 11.5px; cursor: pointer;
  transition: .16s; margin-left: auto;
}
.q-tr:hover { border-color: var(--accent); color: var(--accent); }
.q-tr.on { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.q-tr[disabled] { opacity: .6; cursor: progress; }
.q-tr-slot:empty { display: none; }
.q-tr-body {
  margin: 10px 0 2px; padding: 10px 12px;
  border-left: 3px solid var(--accent2); background: var(--accent-dim);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.q-tr-text { font-size: 14px; line-height: 1.9; color: var(--text2); }
.q-tr-tag {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 6px; font-size: 11px; color: var(--faint);
}


/* ---------- 长标签语言下的导航紧凑化 ----------
   法语/日语/韩语的导航词比中文长不少，法语最宽（实测比中文宽约 180px）。导航容器
   固定 1120px，放不下时 flex 不换行会让最后几项**覆盖到右侧的登录按钮上**（用户截图）。
   这里按 <html lang> 收紧内边距与字号，实测能省下约 90px，法语也能放下。 */
html:not([lang^="zh"]) .nav-links a { padding: 8px 3px; font-size: 13px; gap: 3px; }
html:not([lang^="zh"]) .nav-links { gap: 0; }
html:not([lang^="zh"]) .nav-more-btn { padding: 8px 3px; font-size: 13px; }
/* 注意：这里**不要**给 .nav-links 加 overflow 裁剪（auto/hidden/scroll）。
   它里面还有「更多」的下拉菜单（position: absolute），一旦成为滚动/裁剪容器，
   菜单就会被裁掉 —— 表现为「点了没反应」（语言菜单已经因此搬到浮层，更多菜单同理）。
   宽度靠标签长度与内边距控制（见下方「长标签语言下的导航紧凑化」）。 */
.nav-user { flex: none; }


/* ---------- 导航右侧「工具」组（主题 / 界面语言）----------
   两个图标按钮原本紧挨在 RSS 后面，看起来和导航项混在一起、彼此也分不开。
   这里把它们与导航项用一条细竖线隔开，两个按钮之间也留出间距。 */
/* 工具按钮放在右侧用户区的最前面；分隔线画在它左边，把「导航项」与「工具 + 账号」分开 */
.nav-user > .theme-btn { position: relative; margin-left: 14px; }
.nav-user > .theme-btn::before {
  content: ""; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  width: 1px; height: 18px; background: var(--line-hi); border-radius: 1px;
}
.nav-user > .lang-wrap { margin-left: 0; }
/* 悬停/键盘聚焦时给出清晰的反馈（之前只有淡淡的底色） */
.lang-btn:focus-visible, .theme-btn:focus-visible { outline: 2px solid var(--accent2); outline-offset: 2px; }
/* 非中文界面：RSS 收成纯图标（法语/日语标签更长，省下的宽度留给导航项） */
html:not([lang^="zh"]) .nav-rss { font-size: 0; padding: 8px 6px; }
html:not([lang^="zh"]) .nav-rss svg { width: 15px; height: 15px; }


/* 非中文界面（法语/日语等标签更长）：账号按钮收成纯图标 + 工具按钮略小。
   登录状态下右侧是「工具 ×2 + 头像 + 后台 + 退出 + 铃铛」，法语下总宽会把导航顶到
   贴边（120px 左右），表现为按钮挤在一起。图标 + tooltip 既省宽度也不丢信息。
   注意：只收带图标的账号按钮（.btn-ico）。登录/注册是纯文字按钮，早先这条写成
   `.nav-user > .btn`，把它们的文字也归零了 —— 法语下未登录访客看到的是两个空按钮。 */
html:not([lang^="zh"]) .nav-user > .btn-ico { font-size: 0; gap: 0; padding: 8px 9px; }
html:not([lang^="zh"]) .nav-user > .btn-ico svg { width: 15px; height: 15px; }
html:not([lang^="zh"]) .nav-user > .theme-btn,
html:not([lang^="zh"]) .nav-user > .lang-wrap .lang-btn { width: 28px; height: 28px; }
html:not([lang^="zh"]) .nav-user { gap: 6px; }
