/* ============================================================
   全站唯一样式表。纯 CSS、无外部字体/图标/CDN，配合 CSP style-src 'self'。
   结构：设计变量 -> 基础 -> 布局 -> 组件 -> 工具类 -> 响应式 -> 深色模式
   ============================================================ */

:root {
  color-scheme: light dark;
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-soft: #ebebf0;
  --text: #1d1d1f;
  --text-soft: #515154;
  --text-muted: #86868b;
  --line: #d9d9de;
  --accent: #0071e3;
  --accent-soft: #e8f1fd;
  --accent-2: #5e5ce6;
  --focus: #0a84ff;
  --radius: 18px;
  --radius-sm: 11px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  --max: 1200px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  --font-display: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", serif;
}

/* 主题优先级：手动 data-theme > 系统 prefers-color-scheme > 默认浅色 */
:root[data-theme="dark"] {
  --bg: #0a0a0c;
  --surface: #1c1c1e;
  --surface-soft: #2c2c2e;
  --text: #f5f5f7;
  --text-soft: #c7c7cc;
  --text-muted: #98989d;
  --line: #38383d;
  --accent: #0a84ff;
  --accent-soft: #262c40;
  --accent-2: #64d2ff;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.55);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0a0c;
    --surface: #1c1c1e;
    --surface-soft: #2c2c2e;
    --text: #f5f5f7;
    --text-soft: #c7c7cc;
    --text-muted: #98989d;
    --line: #38383d;
    --accent: #0a84ff;
    --accent-soft: #262c40;
    --accent-2: #64d2ff;
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.55);
  }
}

/* ------------------------------ 基础 ------------------------------ */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

/* 根治横向溢出（如 Hero 光晕的负边距）：右侧不再出现黑色空白条 */
html, body { overflow-x: clip; }

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.3; letter-spacing: -0.01em; }
/* 宋黑混排：标题用衬线（宋体）出文气，正文/界面保持黑体易读 */
h1, h2 { font-family: var(--font-display); }
::selection { background: var(--accent); color: #fff; }
h1 { font-size: clamp(2rem, 5vw, 2.9rem); margin: 0 0 0.6em; }
h2 { font-size: clamp(1.35rem, 3vw, 1.7rem); margin: 0 0 0.7em; }
h3 { font-size: 1.12rem; margin: 0 0 0.45em; }
p { margin: 0 0 1.1em; }
ul { padding-left: 1.3em; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--surface-soft);
  padding: 0.12em 0.4em;
  border-radius: 4px;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 3px;
}

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

.muted { color: var(--text-muted); font-size: 0.9rem; }
.eyebrow {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 0.8em;
}
.lede { font-size: 1.08rem; color: var(--text-soft); max-width: 62ch; }
.note {
  color: var(--text-soft);
  background: var(--surface-soft);
  border-left: 3px solid var(--accent-2);
  padding: 0.8em 1em;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.94rem;
}
.note-block { margin: 2.5rem 0 0; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--surface);
  color: var(--text);
  padding: 0.7em 1.1em;
  border: 2px solid var(--accent);
  border-radius: var(--radius-sm);
}
.skip-link:focus { left: 12px; top: 12px; }

/* ------------------------------ 头部 / 导航 ------------------------------ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 50%, transparent);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand img { border-radius: 7px; }
.brand span { font-family: var(--font-display); font-size: 1.08rem; letter-spacing: 0.02em; }

.site-nav { display: flex; align-items: center; gap: 4px; }
.nav-link {
  color: var(--text-soft);
  padding: 8px 13px;
  border-radius: 8px;
  font-size: 0.94rem;
  white-space: nowrap;
}
.nav-link:hover { background: var(--surface-soft); text-decoration: none; color: var(--text); }
.nav-link.is-active { color: var(--accent); background: var(--accent-soft); font-weight: 700; }

.nav-toggle {
  display: none;
  width: 42px;
  height: 38px;
  padding: 9px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  margin: 4px 0;
  background: var(--text);
  border-radius: 2px;
}

/* ------------------------------ 主体 / 页脚 ------------------------------ */

main { flex: 1 0 auto; padding-top: 40px; padding-bottom: 72px; }
.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0;
  color: var(--text-soft);
  font-size: 0.9rem;
  background: var(--surface);
}
.site-footer p { margin: 0 0 0.35em; }

.section { margin-top: 64px; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 24px;
}
.section-head h2 { margin: 0; }
.more-link { font-size: 0.9rem; font-weight: 600; white-space: nowrap; }

.page-head { padding: 18px 0 12px; }
.page-head .lede { margin-bottom: 0.5em; }
.not-found { padding: 36px 0 64px; }

/* ------------------------------ 首页 Hero ------------------------------ */

.hero {
  position: relative;
  padding: 44px 0 8px;
  border-bottom: 1px solid var(--line);
}
/* 暮色光晕：左右铺满整个视口宽度（50vw 负边距），主光在右上、辅光在左中，明暗主题都成立 */
.hero::before {
  content: ''; position: absolute; top: -80px; bottom: 0;
  left: calc(50% - 50vw); right: calc(50% - 50vw);
  pointer-events: none;
  background:
    radial-gradient(46% 78% at 84% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 72%),
    radial-gradient(34% 58% at 10% 24%, color-mix(in srgb, var(--accent-2) 12%, transparent), transparent 72%);
}
.hero > * { position: relative; }
.hero h1 {
  font-size: clamp(2.6rem, 8vw, 4.2rem); margin-bottom: 0.25em;
  background: linear-gradient(118deg, var(--text) 58%, var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-dot { color: var(--accent); }
.hero-tagline {
  font-size: clamp(1.1rem, 2.6vw, 1.45rem);
  color: var(--text-soft);
  max-width: 46ch;
  margin-bottom: 1.4em;
}
.hero-bio { max-width: 66ch; color: var(--text-soft); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 36px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.94rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}
.btn:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 5px 16px color-mix(in srgb, var(--accent) 30%, transparent); }
.btn-primary:hover { background: var(--accent); color: #fff; opacity: 0.9; }
.btn-small { padding: 7px 14px; font-size: 0.86rem; margin-top: 0.6em; }

.hero-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 28px;
  padding: 18px 0 0;
  border-top: 1px solid var(--line);
}
.hero-meta div { min-width: 0; }
.hero-meta dt { color: var(--text-muted); font-size: 0.8rem; }
.hero-meta dd { margin: 2px 0 0; font-size: 1.1rem; font-weight: 700; }

/* ------------------------------ 卡片 / 网格 ------------------------------ */

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.card-grid-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card-grid-single { grid-template-columns: 1fr; gap: 12px; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px; }

.about-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 44px; align-items: start; }
.about-bio { max-width: 64ch; }
.about-contact {
  padding: 26px 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.about-contact h2 { margin-top: 0; font-size: 1.25rem; }
.about-email { margin: 14px 0 10px; }
.about-email a { font-size: 1.18rem; font-weight: 700; word-break: break-all; color: var(--accent); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 160ms ease, border-color 160ms ease;
}
.card:hover { transform: translateY(-3px); border-color: var(--accent); }
.card-media { display: block; aspect-ratio: 3 / 2; overflow: hidden; background: var(--surface-soft); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 300ms ease; }
.card:hover .card-media img { transform: scale(1.04); }
.card-body { padding: 18px 20px 20px; }
.card-body h3 a { color: var(--text); }
.card-body h3 a:hover { color: var(--accent); }
.card-meta { color: var(--text-muted); font-size: 0.8rem; margin: 0 0 0.5em; }
.card-summary { color: var(--text-soft); font-size: 0.93rem; margin: 0; }
.card-text { box-shadow: none; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 14px 0 0; }
.tag {
  font-size: 0.76rem;
  color: var(--accent-2);
  background: var(--surface-soft);
  border-radius: 999px;
  padding: 3px 10px;
}

/* ------------------------------ 图文 / 文章 ------------------------------ */

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.photo-tile { margin: 0; }
.photo-tile img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}
.photo-tile figcaption {
  margin-top: 8px;
  color: var(--text-soft);
  font-size: 0.86rem;
  line-height: 1.55;
}
.photo-set { margin-top: 48px; }
.photo-set-head { margin-bottom: 20px; }
.photo-set-head .lede { font-size: 1rem; }

.article, .tool-page { max-width: 760px; margin: 0 auto; }
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  color: var(--text-muted);
  margin-bottom: 28px;
}
.article-head { margin-bottom: 30px; }
.article-head .lede { font-size: 1.15rem; }
.article-cover {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  margin-bottom: 32px;
}
.prose { font-size: 1.02rem; }
.prose h2 { margin-top: 2em; }
.prose h3 { margin-top: 1.6em; }
.prose figure { margin: 2em 0; }
.prose figure img { border-radius: var(--radius-sm); border: 1px solid var(--line); }
.prose figcaption { color: var(--text-muted); font-size: 0.86rem; margin-top: 8px; text-align: center; }
.prose blockquote {
  margin: 1.8em 0;
  padding: 0.6em 1.2em;
  border-left: 3px solid var(--accent);
  background: var(--surface-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text);
  font-size: 1.06rem;
}
.prose blockquote p { margin: 0; }
.prose li { margin-bottom: 0.4em; }
.prose pre {
  margin: 1.8em 0;
  padding: 1em 1.2em;
  overflow-x: auto;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  line-height: 1.6;
}
.prose pre code { background: none; padding: 0; font-size: 0.88rem; }
.article-foot { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); }

/* ------------------------------ 工具演示 ------------------------------ */

.tool-root { margin: 28px 0 0; }
.tool-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.tool-label { display: block; font-weight: 700; margin-bottom: 8px; }
.tool-input {
  width: 100%;
  min-height: 132px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.98rem;
  line-height: 1.7;
  resize: vertical;
}
.tool-input:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.tool-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.tool-result {
  margin-top: 20px;
  padding: 18px 20px;
  border: 1px dashed var(--accent);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  min-height: 64px;
}
.tool-result-title { display: block; font-size: 0.8rem; color: var(--text-soft); margin-bottom: 4px; }
.tool-result-value { font-size: 1.3rem; font-weight: 700; color: var(--text); overflow-wrap: anywhere; }
.tool-hint { font-size: 0.84rem; color: var(--text-muted); margin: 12px 0 0; }
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-top: 18px;
}
.stat {
  background: var(--surface-soft);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.stat-value { display: block; font-size: 1.5rem; font-weight: 700; line-height: 1.2; }
.stat-label { display: block; font-size: 0.8rem; color: var(--text-soft); margin-top: 4px; }

/* ------------------------------ 响应式 ------------------------------ */

@media (max-width: 860px) {
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-col { grid-template-columns: 1fr; gap: 24px; }
  .about-layout { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 720px) {
  .container { padding: 0 18px; }
  main { padding-top: 26px; padding-bottom: 52px; }
  .section { margin-top: 48px; }
  .header-inner { min-height: 60px; flex-wrap: wrap; position: relative; }
  .nav-toggle { display: block; }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px 18px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
  }
  .site-nav.is-open { display: flex; }
  .nav-link { padding: 11px 12px; font-size: 1rem; }
  .hero { padding-top: 20px; }
  .hero-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .card-grid, .card-grid-two, .photo-grid { grid-template-columns: 1fr; }
  .section-head { flex-wrap: wrap; gap: 4px; }
  .tool-panel { padding: 16px; }
  .article-head .lede { font-size: 1.05rem; }
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn-primary,
  :root:not([data-theme="light"]) .btn-primary:hover { color: #fff; }
}
:root[data-theme="dark"] .btn-primary,
:root[data-theme="dark"] .btn-primary:hover { color: #fff; }

/* ------------------------------ 主题切换 ------------------------------ */
.theme-toggle {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-soft);
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  font-size: 0.84rem;
  cursor: pointer;
  white-space: nowrap;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--text); }
.header-inner { gap: 10px; }

/* ------------------------------ 文章目录 ------------------------------ */
.toc {
  margin: 0 0 32px;
  padding: 16px 20px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.toc-title { margin: 0 0 8px; font-size: 0.85rem; color: var(--text-muted); letter-spacing: 0.04em; }
.toc-list { list-style: none; margin: 0; padding: 0; }
.toc-list li { margin: 4px 0; }
.toc-list a { color: var(--text-soft); font-size: 0.94rem; }
.toc-list .toc-h3 { padding-left: 1.2em; font-size: 0.88rem; }
.toc-list .toc-h3::before { content: "↳ "; color: var(--text-muted); }
.prose h2, .prose h3 { scroll-margin-top: 80px; }

/* ------------------------------ 分类相册 ------------------------------ */
.gallery-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 28px; }
.filter-btn {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-soft);
  border-radius: 999px;
  padding: 7px 16px;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}
.filter-btn:hover { border-color: var(--accent); }
.filter-btn.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.gallery-group { margin-bottom: 44px; }
.gallery-group[hidden] { display: none; }
/* 瀑布流：图片按原始比例完整显示（竖图不裁、横图不裁，混排自动错落） */
.gallery-grid { columns: 3 240px; column-gap: 16px; }
.gallery-tile { margin: 0 0 16px; break-inside: avoid; }
.lightbox-trigger {
  display: block; width: 100%; padding: 0; border: 0; background: none;
  cursor: zoom-in; border-radius: var(--radius-sm); overflow: hidden;
  border: 1px solid var(--line);
}
.lightbox-trigger img { display: block; width: 100%; height: auto; }
.gallery-tile figcaption { color: var(--text-muted); font-size: 0.86rem; margin-top: 8px; }
.note-block { padding: 12px 16px; background: var(--surface-soft); border-radius: var(--radius-sm); }

/* 灯箱：hidden 属性控制显隐，不使用内联 style，兼容严格 CSP */
.lightbox[hidden] { display: none; }
.lightbox {
  position: fixed; inset: 0; z-index: 60; padding: 16px;
  background: rgba(18, 19, 18, 0.94);
  display: grid; grid-template-columns: 56px minmax(0, 1fr) 56px;
  grid-template-rows: minmax(0, 1fr) auto; gap: 12px; align-items: center;
}
body.lightbox-open { overflow: hidden; }
.lightbox-img { grid-column: 2; grid-row: 1; max-width: 100%; max-height: 70vh; margin: 0 auto; object-fit: contain; border-radius: var(--radius-sm); }
.lightbox-nav {
  grid-row: 1; width: 48px; height: 48px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.08);
  color: #fff; font-size: 1.6rem; cursor: pointer;
}
.lightbox-prev { grid-column: 1; }
.lightbox-next { grid-column: 3; }
.lightbox-close { position: absolute; top: 12px; right: 16px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.08); color: #fff; font-size: 1.4rem; cursor: pointer; }
.lightbox-info { grid-column: 1 / -1; grid-row: 2; color: #f0eee8; text-align: center; max-width: 720px; margin: 0 auto; }
.lightbox-caption { margin: 0 0 6px; }
.lightbox-counter { color: #b9b5ac; font-size: 0.85rem; }
.exif-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin: 10px 0 0; font-size: 0.84rem; color: #d8d4ca; }
.exif-list div { display: flex; gap: 6px; }
.exif-list dt { color: #9d998f; }
.exif-list dd { margin: 0; }
.exif-empty { color: #9d998f; font-size: 0.84rem; margin: 8px 0 0; }

/* ------------------------------ 项目卡片 ------------------------------ */
.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.project-card { padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.project-card h2 { margin: 0 0 10px; font-size: 1.35rem; }
.project-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.card-stats { margin: 14px 0 0; font-size: .92rem; color: var(--text-muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-stats .cs-star { color: #f5b301; font-weight: 600; letter-spacing: .02em; }
.card-stats .cs-sep { opacity: .45; }
.card-stats .cs-update { color: var(--text-muted); }
.btn.is-disabled { opacity: 0.6; cursor: default; border-style: dashed; }

/* ------------------------------ 专栏 ------------------------------ */
.column-list { display: grid; gap: 22px; }

.column-card {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 160ms ease, border-color 160ms ease;
}
.column-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.column-card-media { display: block; background: var(--surface-soft); }
.column-card-media img { width: 100%; height: 100%; min-height: 208px; object-fit: cover; display: block; }
.column-card-body { padding: 24px 30px 26px; }
.column-card-body h2 { margin: 0 0 12px; font-size: 1.5rem; line-height: 1.35; }
.column-card-body h2 a { color: var(--text); }
.column-card-body h2 a:hover { color: var(--accent); }
.column-no { margin: 0 0 10px; font-size: 0.76rem; font-weight: 700; letter-spacing: 0.16em; color: var(--accent); }
.column-tagline { margin: 0 0 12px; font-size: 1.02rem; color: var(--text); }
.column-meta { margin: 16px 0 0; font-size: 0.84rem; color: var(--text-muted); }

.column-hero { margin-bottom: 8px; }
/*
 * 图组：还原 Word 原稿的排版——第一张通栏，其余两两并排。
 * 两张竖图用同一比例裁切，左右高度才对齐。
 */
.plates {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 0 0 36px;
}
.plates figure { margin: 0; min-width: 0; }
.plates .plate-wide { grid-column: 1 / -1; }
.plates img {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-soft);
}
.plates figure:not(.plate-wide) img { aspect-ratio: 3 / 4; object-fit: cover; }
.plates figcaption {
  margin-top: 9px;
  color: var(--text-muted);
  font-size: 0.84rem;
  line-height: 1.55;
  text-align: center;
}
.prose .plates { margin: 2em 0; }
.column-post .plates-lead { margin-top: 4px; margin-bottom: 40px; }
.column-hero-cover {
  display: block;
  width: 100%;
  aspect-ratio: 21 / 9;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  margin-bottom: 28px;
}
.column-hero h1 { max-width: none; }
.column-hero .column-tagline { font-size: 1.12rem; color: var(--text-soft); }

.post-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.post-row { border-bottom: 1px solid var(--line); }
.post-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 20px;
  align-items: baseline;
  padding: 20px 2px 20px 0;
  color: var(--text);
}
.post-link:hover { text-decoration: none; }
.post-link:hover .post-title { color: var(--accent); }
.post-main { display: block; }
.post-title { display: block; font-size: 1.08rem; font-weight: 600; }
.post-summary { display: block; margin-top: 6px; font-size: 0.92rem; color: var(--text-soft); }
.post-date { font-size: 0.84rem; color: var(--text-muted); white-space: nowrap; }

.column-feature {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  color: var(--text);
  transition: transform 160ms ease, border-color 160ms ease;
}
.column-feature:hover { text-decoration: none; transform: translateY(-2px); border-color: var(--accent); }
.column-feature-media { display: block; background: var(--surface-soft); }
.column-feature-media img { width: 100%; height: 100%; min-height: 200px; object-fit: cover; display: block; }
.column-feature-body { display: flex; flex-direction: column; justify-content: center; gap: 10px; padding: 26px 30px; }
.column-feature-title { font-size: 1.42rem; font-weight: 700; line-height: 1.35; }
.column-feature-tagline { color: var(--text-soft); font-size: 0.96rem; }
.column-feature-latest { margin-top: 4px; font-size: 0.86rem; color: var(--text-muted); }

/* ------------------------------ 评论 ------------------------------ */
.comments { margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--line); }
.comments h2 { font-size: 1.3rem; }
.comments iframe { width: 100%; border: 0; }
.comments-off { color: var(--text-muted); font-size: 0.9rem; }
.comments-hint { margin: 0 0 20px; color: var(--text-soft); font-size: 0.92rem; }

.comment-items { display: grid; gap: 16px; margin: 0 0 28px; padding: 0; list-style: none; }
.comment-item { padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.comment-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; margin: 0 0 8px; font-size: 0.86rem; color: var(--text-muted); }
.comment-name { font-weight: 600; color: var(--text); text-decoration: none; }
.comment-name[href]:hover { color: var(--accent); }
.comment-body { margin: 0; color: var(--text-soft); white-space: pre-wrap; overflow-wrap: anywhere; }

.comment-form { display: grid; gap: 14px; }
.comment-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field { display: grid; gap: 6px; font-size: 0.86rem; color: var(--text-muted); }
.field input, .field textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; font-size: 0.95rem; }
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus-visible, .field textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.comment-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.comment-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.comment-status { margin: 0; font-size: 0.86rem; color: var(--text-muted); }
.comment-status[data-tone="ok"] { color: var(--accent-2); }
.comment-status[data-tone="warn"] { color: var(--accent); }

/* --------------------------- 评论管理（仅站长） --------------------------- */
.admin { max-width: 860px; }
.admin-gate { display: grid; gap: 14px; margin: 22px 0 0; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.admin-gate[hidden], .admin-panel[hidden] { display: none; }
.admin-panel { margin-top: 26px; }
/* 统计清零卡片：与评论管理同页，用危险色按钮 + 二次确认降低误触风险 */
.admin-stats { margin-bottom: 20px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.admin-stats-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.admin-stats-head .eyebrow { margin: 0 0 4px; }
.admin-stats-total { margin: 0; font-size: 1rem; color: var(--text-soft); }
.admin-stats-total strong { font-size: 1.5rem; color: var(--text); font-variant-numeric: tabular-nums; }
.admin-stats-note { margin: 12px 0 0; font-size: 0.85rem; color: var(--text-muted); line-height: 1.6; }
.btn-danger { color: #fff; background: #c0392b; border-color: #c0392b; }
.btn-danger:hover { filter: brightness(1.08); }
:root[data-theme="dark"] .btn-danger { background: #d9483a; border-color: #d9483a; }
.admin-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; padding: 14px 16px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.admin-toolbar .field { flex: 1 1 240px; }
.admin-summary { margin: 16px 0 10px; font-size: 0.86rem; color: var(--text-muted); }
.admin-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.admin-item { padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.admin-item .comment-meta { align-items: center; }
.admin-item .comment-body { margin-bottom: 0; }
.admin-item-actions { display: flex; margin-left: auto; }
.admin-item .btn-small { margin-top: 0; }
.admin-path { color: var(--text-muted); font-size: 0.82rem; text-decoration: none; overflow-wrap: anywhere; }
.admin-path:hover { color: var(--accent); text-decoration: underline; }

/* ------------------------------ 404 ------------------------------ */
/* 卡片化 + 渐变光晕 + 去逛逛链接网格，与仪表盘/关于页视觉统一 */
.nf-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.nf-card::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 120% at 100% 0%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 55%);
}
.nf-art { position: relative; line-height: 0; background: var(--surface-soft); }
.not-found-art { width: 100%; height: auto; display: block; border: 0; border-radius: 0; }
.nf-body { position: relative; padding: 26px 30px 30px; }
.nf-body .eyebrow { margin: 0 0 6px; }
.nf-body h1 { margin: 0 0 12px; font-size: clamp(1.6rem, 4.2vw, 2.2rem); line-height: 1.25; }
.nf-body .lede { max-width: 52ch; margin-bottom: 22px; }
.nf-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.nf-explore { margin-top: 26px; }
.nf-explore h2 { font-size: 1.15rem; margin: 0 0 16px; }
.nf-link-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 12px;
}
.nf-link {
  display: block; text-align: center; padding: 13px 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  color: var(--text); text-decoration: none; font-size: 0.95rem;
  transition: transform 160ms ease, border-color 160ms ease, color 160ms ease;
}
.nf-link:hover { transform: translateY(-2px); border-color: var(--accent); color: var(--accent); text-decoration: none; }
@media (max-width: 560px) {
  .nf-body { padding: 22px 20px 24px; }
  .nf-link-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .gallery-grid, .project-grid { grid-template-columns: 1fr; }
  .comment-fields { grid-template-columns: 1fr; }
  .lightbox { grid-template-columns: 40px minmax(0, 1fr) 40px; }
  .lightbox-nav { width: 36px; height: 36px; font-size: 1.2rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* 专栏的窄屏布局放在文件末尾，确保覆盖前面的两列基础规则 */
@media (max-width: 860px) {
  .column-card { grid-template-columns: 1fr; }
  .column-card-media img { min-height: 0; aspect-ratio: 16 / 9; }
  .column-card-body { padding: 20px 22px 22px; }
  .column-feature { grid-template-columns: 1fr; }
  .column-feature-media img { min-height: 0; aspect-ratio: 16 / 9; }
  .column-feature-body { padding: 20px 22px 22px; }
  .plates { gap: 12px; margin-bottom: 30px; }
  .plates figcaption { font-size: 0.78rem; }
}
/* 手机竖屏太窄，两张竖图上下排列，避免照片被压到看不清 */
@media (max-width: 560px) {
  .plates { grid-template-columns: 1fr; }
  .plates .plate-wide { grid-column: auto; }
}

/* 公开统计页 · 图文仪表盘 */
.dash { display: flex; flex-direction: column; gap: 22px; }
.dash-hero {
  position: relative; display: flex; align-items: center; gap: 26px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 30px; box-shadow: var(--shadow); overflow: hidden;
}
.dash-hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 130% at 100% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%);
}
.dash-ring { position: relative; width: 132px; height: 132px; flex: none; }
.ring-svg { width: 100%; height: 100%; display: block; }
.ring-track { stroke: var(--line); opacity: 0.65; }
.ring-arc { filter: drop-shadow(0 2px 7px color-mix(in srgb, var(--accent) 32%, transparent)); }
.ring-grad-0 { stop-color: var(--accent); }
.ring-grad-1 { stop-color: var(--accent-2); }
.dash-hero-text { position: relative; z-index: 1; }
.dash-total {
  font-size: clamp(2.4rem, 6vw, 3.6rem); font-weight: 800; line-height: 1; margin: 0;
  font-variant-numeric: tabular-nums; letter-spacing: -0.02em;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.dash-total-label { margin: 8px 0 0; color: var(--text-soft); font-size: 0.95rem; white-space: nowrap; }
.dash-live {
  position: absolute; top: 18px; right: 22px; display: inline-flex; align-items: center; gap: 7px;
  font-size: 0.78rem; color: var(--text-soft); background: var(--surface-soft);
  border: 1px solid var(--line); padding: 5px 11px; border-radius: 999px; white-space: nowrap;
}
.dash-live .dot {
  width: 8px; height: 8px; border-radius: 50%; background: #2ec27e;
  box-shadow: 0 0 0 0 rgba(46, 194, 126, 0.6); animation: livePulse 1.8s infinite;
}
@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(46, 194, 126, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(46, 194, 126, 0); }
  100% { box-shadow: 0 0 0 0 rgba(46, 194, 126, 0); }
}

.dash-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
/* 地区分布单独成行：不展示逐页明细后，让环形图与图例横向铺开、不显得空旷 */
.dash-regions .chart-donut { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 28px; }
.dash-regions .donut-legend { width: auto; min-width: 220px; max-width: 420px; flex: 1 1 260px; }
.dash-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); }
.dash-panel h2 { font-size: 1.12rem; margin: 0 0 16px; }

/* 趋势面积图 */
.chart-area svg { width: 100%; height: auto; display: block; }
.area-grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; opacity: 0.5; }
.area-fill { fill: url(#areaGrad); }
.grad-top { stop-color: var(--accent); stop-opacity: 0.30; }
.grad-bottom { stop-color: var(--accent); stop-opacity: 0; }
.area-line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.area-dot { fill: var(--accent); }
.area-label { fill: var(--text-muted); font-size: 11px; }

/* 环形图 */
.chart-donut { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.donut-svg { width: 180px; height: 180px; }
.donut-seg { transition: transform 0.18s ease; transform-origin: center; }
.donut-seg:hover { transform: scale(1.04); }
.donut-center-num { fill: var(--text); font-size: 22px; font-weight: 800; text-anchor: middle; font-variant-numeric: tabular-nums; }
.donut-center-label { fill: var(--text-muted); font-size: 11px; text-anchor: middle; }
.donut-legend { list-style: none; margin: 0; padding: 0; width: 100%; display: flex; flex-direction: column; gap: 7px; }
.donut-legend li { display: flex; align-items: center; gap: 9px; font-size: 0.88rem; }
.donut-legend .sw { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.donut-name { color: var(--text-soft); }
.donut-val { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 600; }

/* 横向条形 */
.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: flex; flex-direction: column; gap: 6px; }
.bar-head { display: flex; justify-content: space-between; gap: 12px; font-size: 0.88rem; }
.bar-k { color: var(--text-soft); word-break: break-all; }
.bar-v { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.bar-track { height: 8px; background: var(--surface-soft); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); width: 0; transition: width 1s cubic-bezier(.2,.7,.2,1); }

.dash-empty { color: var(--text-muted); font-size: 0.9rem; padding: 8px 0; }

@media (max-width: 760px) {
  .dash-cols { grid-template-columns: 1fr; }
  .dash-hero { padding: 20px; gap: 18px; }
  .dash-ring { width: 104px; height: 104px; }
  .dash-live { position: static; align-self: flex-start; margin-top: 14px; }
}

/* --------------------- Apple 风格主题切换动画 --------------------- */
/* View Transitions：点击切换按钮时，新主题画面从按钮位置以圆形涟漪荡开（JS 配合） */
::view-transition-old(root),
::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
/* 不支持 View Transitions 的浏览器：颜色平滑过渡兜底 */
body, .site-header, .site-footer {
  transition: background-color 0.45s ease, color 0.45s ease, border-color 0.45s ease;
}
@media (prefers-reduced-motion: reduce) {
  body, .site-header, .site-footer { transition: none; }
}

/* --------------------- 程序坞式导航（仅桌面端） --------------------- */
/* macOS Dock 意象：毛玻璃胶囊容器；悬停项放大上浮并微微后仰（透视），邻居项被「挤小」 */
@media (min-width: 721px) {
  .site-nav {
    padding: 5px 7px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--surface) 30%, transparent);
    /* 不再叠加第二层 backdrop-filter：顶栏已把背后内容模糊，双层模糊是滚动卡顿主因 */
    border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.07);
    perspective: 600px;
  }
  .nav-link {
    transform-origin: 50% 100%;
    will-change: transform;
    transition:
      transform 240ms cubic-bezier(0.34, 1.56, 0.64, 1),
      background-color 180ms ease,
      color 180ms ease,
      box-shadow 180ms ease;
  }
  .nav-link:hover {
    background: var(--accent-soft);
    box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 18%, transparent);
    transform: translateY(-3px) perspective(420px) rotateX(9deg) scale(1.22);
  }
  /*Dock 的「挤压」感：有项悬停时，其余项整体轻微缩小、变淡 */
  .site-nav:has(.nav-link:hover) .nav-link:not(:hover) {
    transform: scale(0.92);
    opacity: 0.85;
  }
}

/* --------------------- 全站卡片液态玻璃化 --------------------- */
/* 主要面板统一为半透明 + 轻模糊（12px 控制性能开销，避免滚动掉帧） */
.site-footer, .dash-panel, .nf-card, .column-card, .column-feature,
.comment-item, .admin-gate, .tool-panel {
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  backdrop-filter: blur(12px) saturate(160%);
}

/* 页脚补充内容排版 */
.footer-tagline { margin: 0 0 0.4em; font-family: var(--font-display); font-size: 1.02rem; color: var(--text); }
.footer-links a { color: var(--text-soft); }
.footer-links a:hover { color: var(--accent); }

/* 相册滑动虚化：进入视口前轻微模糊下沉，滚动到时渐变聚焦 */
.gallery-tile.is-pending:not(.is-shown) {
  opacity: 0.35;
  filter: blur(14px) saturate(1.1);
  transform: translateY(16px) scale(0.985);
}
.gallery-tile.is-pending {
  transition: opacity 0.7s ease, filter 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}
@media (prefers-reduced-motion: reduce) {
  .gallery-tile.is-pending { opacity: 1; filter: none; transform: none; transition: none; }
}

/* --------------------- 主题切换：磨砂玻璃罩（Safari 等无 View Transitions 浏览器） --------------------- */
/* 一层全屏毛玻璃从按钮位置荡开蒙住屏幕，主题在玻璃下切换，随后玻璃化开——Safari 的 backdrop-filter 原生丝滑 */
.theme-veil {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0;
  background: color-mix(in srgb, var(--bg) 24%, transparent);
  -webkit-backdrop-filter: blur(0px) saturate(120%);
  backdrop-filter: blur(0px) saturate(120%);
  -webkit-mask-image: radial-gradient(circle at var(--veil-x, 90%) var(--veil-y, 24px), #000 0%, transparent 72%);
  mask-image: radial-gradient(circle at var(--veil-x, 90%) var(--veil-y, 24px), #000 0%, transparent 72%);
  -webkit-mask-size: 0% 0%;
  mask-size: 0% 0%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  transition:
    opacity 0.3s ease,
    -webkit-mask-size 0.42s cubic-bezier(0.32, 0.72, 0, 1),
    mask-size 0.42s cubic-bezier(0.32, 0.72, 0, 1),
    -webkit-backdrop-filter 0.3s ease,
    backdrop-filter 0.3s ease;
}
.theme-veil.is-on {
  opacity: 1;
  -webkit-mask-size: 300% 300%;
  mask-size: 300% 300%;
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  backdrop-filter: blur(22px) saturate(160%);
}
.theme-veil.is-lift {
  opacity: 0;
  -webkit-backdrop-filter: blur(0px) saturate(120%);
  backdrop-filter: blur(0px) saturate(120%);
}
@media (prefers-reduced-motion: reduce) {
  .theme-veil { display: none; }
}

/* --------------------- 巡演歌词本（/hxy2/ 全屏播放器） --------------------- */
/* 演出深色氛围：本区域固定深色，不随明暗主题变化 */
.songbook {
  position: relative;
  height: calc(100dvh - 68px);
  margin-top: -40px;
  overflow: hidden;
  border-radius: 0 0 var(--radius) var(--radius);
  background: #0b0b12;
  color: #f2f2f7;
  user-select: none;
  -webkit-user-select: none;
}
.sb-stage { position: absolute; inset: 0; }
.sb-slide {
  position: absolute; inset: 0;
  background-color: #0a0c18;
  background-image:
    radial-gradient(92% 78% at 16% 10%, hsla(var(--sb-h1, 220), 86%, 58%, 0.40), transparent 62%),
    radial-gradient(88% 92% at 86% 22%, hsla(var(--sb-h2, 280), 82%, 55%, 0.34), transparent 64%),
    radial-gradient(120% 100% at 48% 108%, hsla(var(--sb-h3, 40), 76%, 52%, 0.28), transparent 68%),
    linear-gradient(155deg, #090b18, #111527 55%, #080a13);
  opacity: 0; visibility: hidden;
  transform: scale(1.045);
  transition: opacity 0.28s cubic-bezier(0.32, 0.72, 0, 1), transform 0.65s cubic-bezier(0.32, 0.72, 0, 1), visibility 0s linear 0.28s;
}
.sb-slide::before {
  content: ''; position: absolute; inset: -25%; z-index: 0; pointer-events: none;
  background: radial-gradient(closest-side, hsla(var(--sb-h2, 280), 90%, 62%, 0.16), transparent 72%);
}
.sb-slide.is-active::before { animation: sb-drift 20s ease-in-out infinite alternate; }
@keyframes sb-drift {
  from { transform: translate3d(-6%, -4%, 0) scale(1); }
  to   { transform: translate3d(8%, 7%, 0) scale(1.14); }
}
.sb-slide.is-active {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity 0.65s cubic-bezier(0.32, 0.72, 0, 1), transform 0.65s cubic-bezier(0.32, 0.72, 0, 1);
}
.sb-slide.is-prev { transform: scale(0.97); }
.sb-shade {
  position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(180deg, rgba(6, 8, 20, 0.30), rgba(6, 8, 20, 0.10) 45%, rgba(6, 8, 20, 0.46));
}
.sb-body {
  position: relative; z-index: 1;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: clamp(28px, 6vw, 72px) clamp(20px, 6vw, 80px);
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  scrollbar-width: thin;
}
/* margin:auto 垂直居中：内容超高时可正常滚动（justify-content:center 会裁切溢出） */
.sb-inner { margin: auto 0; max-width: 100%; }
.sb-kicker {
  margin: 0 0 14px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.3em;
  text-transform: uppercase; color: #9db8ff;
}
.sb-cover-title {
  margin: 0; font-size: clamp(2.6rem, 9vw, 5.4rem); font-weight: 800; letter-spacing: 0.04em;
  background: linear-gradient(120deg, #ffffff 30%, #a9c8ff 70%, #a29cff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 26px rgba(0, 0, 0, 0.6));
}
.sb-cover-sub { margin: 18px 0 0; font-size: clamp(1rem, 2.4vw, 1.3rem); color: #e5e9fa; text-shadow: 0 2px 16px rgba(0, 0, 0, 0.65); }
.sb-cover-line { margin: 10px 0 0; font-size: 0.85rem; letter-spacing: 0.18em; color: #b0b6d8; text-transform: uppercase; text-shadow: 0 1px 12px rgba(0, 0, 0, 0.6); }
.sb-title { font-size: clamp(1.5rem, 4vw, 2.3rem); margin: 0 0 22px; color: #fff; text-shadow: 0 2px 22px rgba(0, 0, 0, 0.65); }
.sb-song-title {
  margin: 0 0 18px; font-size: clamp(1.7rem, 5vw, 2.9rem); font-weight: 800; color: #fff;
  text-shadow: 0 2px 28px rgba(0, 0, 0, 0.72), 0 1px 3px rgba(0, 0, 0, 0.5);
}
.sb-credit {
  display: inline-block; margin: 0 0 16px; padding: 4px 14px;
  border-radius: 999px; font-size: 0.78rem; letter-spacing: 0.08em;
  border: 1px solid rgba(120, 190, 255, 0.38);
  background: rgba(10, 132, 255, 0.20); color: #deefff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
}
.sb-credit.is-cover {
  border-color: rgba(190, 165, 255, 0.42);
  background: rgba(94, 92, 230, 0.24); color: #eae2ff;
}
.sb-meta {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
  margin: 0 0 20px;
}
.sb-meta span {
  padding: 4px 12px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.07);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font-size: 0.78rem; letter-spacing: 0.04em; color: #eef1fd;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
}
.sb-blurb {
  max-width: 62ch; margin: 0; font-size: clamp(0.95rem, 1.8vw, 1.08rem); line-height: 2;
  color: #f0f1fb; text-shadow: 0 2px 18px rgba(0, 0, 0, 0.72), 0 1px 2px rgba(0, 0, 0, 0.45);
}
.sb-lyrics { max-width: 720px; margin: 0; }
.sb-lyrics p {
  margin: 0 0 0.9em; font-size: clamp(1rem, 2vw, 1.18rem); line-height: 1.85;
  color: #fafbff; text-shadow: 0 2px 18px rgba(0, 0, 0, 0.75), 0 1px 2px rgba(0, 0, 0, 0.5);
}
.sb-lines { max-width: 720px; }
.sb-lines p { margin: 0 0 0.5em; color: #eef0fb; text-shadow: 0 2px 16px rgba(0, 0, 0, 0.7); }
.sb-tracks {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px; width: 100%; max-width: 980px; text-align: left;
}
.sb-track-group {
  background: rgba(10, 12, 24, 0.55); border: 1px solid rgba(140, 160, 255, 0.18);
  border-radius: var(--radius-sm); padding: 16px 18px;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.sb-track-group h3 { margin: 0 0 10px; font-size: 0.92rem; color: #a9c1ff; }
.sb-track-group ul { margin: 0; padding: 0; list-style: none; }
.sb-track-group li { padding: 4px 0; font-size: 0.92rem; color: #e6e8f5; border-bottom: 1px dashed rgba(140, 160, 255, 0.14); }
.sb-track-group li:last-child { border-bottom: 0; }
.sb-progress {
  position: absolute; top: 0; left: 0; right: 0; height: 3px; z-index: 6;
  background: rgba(255, 255, 255, 0.12);
}
.sb-progress span {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, #0a84ff, #8f8aff);
  transition: width 0.5s cubic-bezier(0.32, 0.72, 0, 1);
}
.sb-toolbar {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
  width: max-content; max-width: calc(100% - 24px);
  z-index: 6; display: flex; align-items: center; gap: 10px;
  background: rgba(10, 12, 24, 0.6); border: 1px solid rgba(140, 160, 255, 0.2);
  border-radius: 999px; padding: 6px 12px;
  -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%);
}
.sb-btn {
  background: transparent; border-color: rgba(255, 255, 255, 0.25); color: #eef0fb;
  white-space: nowrap;
}
.sb-btn:hover { border-color: #9dc0ff; color: #cfe0ff; }
.sb-counter { font-size: 0.84rem; color: #c9cdea; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sb-legal {
  max-width: 860px; margin: 24px auto 0; padding: 22px 26px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow);
  font-size: 0.82rem; line-height: 1.85; color: var(--text-soft);
}
.sb-legal h2 { font-size: 1.02rem; margin: 0 0 10px; color: var(--text); }
.sb-legal-lead { margin: 0 0 14px; font-weight: 600; line-height: 1.8; color: var(--text); }
.sb-legal ol { margin: 0 0 14px; padding-left: 1.5em; }
.sb-legal li { margin: 0 0 7px; padding-left: 0.2em; }
.sb-legal li::marker { color: var(--accent); font-variant-numeric: tabular-nums; }
.sb-legal-contact { margin: 0; }
.sb-legal a { color: var(--accent); text-underline-offset: 3px; }
@media (max-width: 720px) {
  .songbook { height: calc(100dvh - 86px); border-radius: 0; margin-top: -26px; }
  .sb-toolbar { bottom: 14px; gap: 6px; padding: 5px 10px; }
  .sb-inner { margin: 24px auto 104px; }
  .sb-legal { margin: 18px 14px 0; padding: 18px; font-size: 0.78rem; }
}
@media (prefers-reduced-motion: reduce) {
  .sb-slide, .sb-progress span { transition: none; }
  .sb-slide.is-active::before { animation: none; }
}
