:root {
  color-scheme: dark;

  --bg: #05040d;
  --bg-soft: #0a0817;
  --panel: rgba(17, 14, 36, 0.72);
  --panel-solid: #100d24;
  --panel-2: rgba(27, 22, 54, 0.72);
  --text: #f2f0ff;
  --muted: #aaa4cc;
  --muted-2: #837ca8;
  --accent: #9a8cff;
  --accent-strong: #7464ff;
  --accent-soft: rgba(154, 140, 255, 0.13);
  --accent-2: #5cc8ff;
  --border: rgba(154, 140, 255, 0.15);
  --border-strong: rgba(154, 140, 255, 0.3);
  --danger: #ff6b9d;
  --danger-soft: rgba(255, 107, 157, 0.12);
  --warn: #fbbf24;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.55);

  /* 半透明填充：深色模式是"加白"，浅色模式要换成"加黑"，否则按钮/输入框会看不出来 */
  --fill-0: var(--fill-0);
  --fill-1: var(--fill-1);
  --fill-2: rgba(255, 255, 255, 0.035);
  --fill-3: rgba(255, 255, 255, 0.055);
  --fill-4: var(--fill-4);

  /* 背景装饰 / 遮罩 */
  --header-veil: rgba(5, 4, 13, 0.6);
  --overlay: rgba(2, 7, 8, 0.72);
  --overlay-soft: rgba(4, 3, 10, 0.5);
  --grid-line: rgba(154, 140, 255, 0.04);
  --glow-a: rgba(124, 92, 255, 0.24);
  --glow-b: rgba(64, 120, 255, 0.18);
  --glow-opacity: 0.55;
  --selection-text: #070514;

  /* 文本落在半透明彩色底上的颜色（浅色模式下要换成深色） */
  --tint-text: #ffffff;
  --btn-primary-hover: linear-gradient(135deg, #b3a7ff, #8a7cff 55%, #7ad4ff);
  --tab-active-bg: linear-gradient(135deg, rgba(154, 140, 255, 0.28), rgba(92, 200, 255, 0.16));
  --control-active-bg: linear-gradient(135deg, rgba(154, 140, 255, 0.3), rgba(92, 200, 255, 0.18));

  /* 分类徽标 */
  --badge-host: #c4b5fd;
  --badge-vst: #7dd3fc;
  --badge-tools: #f0abfc;

  /* 语音房专用底色 */
  --chrome: rgba(8, 6, 18, 0.72);
  --chrome-soft: rgba(8, 6, 18, 0.55);
  --chip-bg: rgba(8, 6, 18, 0.5);
  --stage-bg: rgba(10, 8, 23, 0.55);
  --option-bg: #12102a;
  --option-text: #f2f0ff;

  /* Logo */
  --logo-plate-1: rgba(154, 140, 255, 0.18);
  --logo-plate-2: rgba(92, 200, 255, 0.06);
  --logo-ring-1: #b3a7ff;
  --logo-ring-2: #9a8cff;
  --logo-ring-3: #5cc8ff;
  --logo-ink-1: #ffffff;
  --logo-ink-2: #c9bcff;
  --logo-ink-3: #6fd0ff;
  --logo-wave-1: #7dd8ff;
  --logo-wave-2: #b3a7ff;
  --logo-glow: rgba(124, 108, 255, 0.5);
  --logo-inner: rgba(255, 255, 255, 0.14);
  --logo-shadow: rgba(12, 6, 40, 0.45);

  --radius: 18px;
  --radius-sm: 12px;
  --maxw: 1180px;
  --font: "Inter", "SF Pro Display", "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", Consolas, monospace;
}

/* 浅色模式：只覆盖颜色 token，所有组件自动跟着变 */
:root[data-theme="light"] {
  color-scheme: light;

  --bg: #f7f6fc;
  --bg-soft: #ffffff;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-solid: #ffffff;
  --panel-2: #f1edff;
  --text: #16122c;
  --muted: #565073;
  --muted-2: #7a7496;
  --accent: #5f45e8;
  --accent-strong: #4b2fd4;
  --accent-soft: rgba(95, 69, 232, 0.1);
  --accent-2: #0b7fa8;
  --border: rgba(74, 52, 160, 0.18);
  --border-strong: rgba(74, 52, 160, 0.34);
  --danger: #cf2a67;
  --danger-soft: rgba(207, 42, 103, 0.08);
  --warn: #a16207;
  --shadow: 0 20px 60px rgba(58, 42, 130, 0.13);

  --fill-0: rgba(46, 30, 110, 0.02);
  --fill-1: rgba(46, 30, 110, 0.035);
  --fill-2: rgba(46, 30, 110, 0.05);
  --fill-3: rgba(46, 30, 110, 0.07);
  --fill-4: rgba(46, 30, 110, 0.09);

  --header-veil: rgba(247, 246, 252, 0.78);
  --overlay: rgba(28, 20, 60, 0.42);
  --overlay-soft: rgba(28, 20, 60, 0.3);
  --grid-line: rgba(78, 58, 170, 0.07);
  --glow-a: rgba(140, 112, 255, 0.24);
  --glow-b: rgba(96, 170, 255, 0.2);
  --glow-opacity: 0.6;
  --selection-text: #ffffff;

  --tint-text: #2a1a6e;
  --btn-primary-hover: linear-gradient(135deg, #7a63f5, #6349ef 55%, #1a93c2);
  --tab-active-bg: linear-gradient(135deg, rgba(95, 69, 232, 0.16), rgba(11, 127, 168, 0.12));
  --control-active-bg: linear-gradient(135deg, rgba(95, 69, 232, 0.18), rgba(11, 127, 168, 0.13));

  --badge-host: #5b3fd6;
  --badge-vst: #0a7a9e;
  --badge-tools: #a62fbb;

  --chrome: rgba(255, 255, 255, 0.86);
  --chrome-soft: rgba(255, 255, 255, 0.74);
  --chip-bg: rgba(255, 255, 255, 0.86);
  --stage-bg: rgba(255, 255, 255, 0.62);
  --option-bg: #ffffff;
  --option-text: #16122c;

  --logo-plate-1: #ffffff;
  --logo-plate-2: #ece6ff;
  --logo-ring-1: #7c5cff;
  --logo-ring-2: #5f45e8;
  --logo-ring-3: #0e8fc4;
  --logo-ink-1: #3a21c4;
  --logo-ink-2: #6b4bf0;
  --logo-ink-3: #0d8dbd;
  --logo-wave-1: #16a3d4;
  --logo-wave-2: #7c5cff;
  --logo-glow: rgba(110, 80, 250, 0.28);
  --logo-inner: rgba(90, 60, 200, 0.14);
  --logo-shadow: rgba(70, 45, 150, 0.22);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

svg {
  display: block;
}

::selection {
  background: var(--accent);
  color: var(--selection-text);
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -3;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 20%, transparent 78%);
}

.bg-glow {
  position: fixed;
  z-index: -2;
  width: 60vw;
  height: 60vw;
  max-width: 900px;
  max-height: 900px;
  border-radius: 50%;
  filter: blur(110px);
  opacity: var(--glow-opacity);
  pointer-events: none;
}

.bg-glow-a {
  top: -22vw;
  left: -12vw;
  background: radial-gradient(circle, var(--glow-a), transparent 65%);
}

.bg-glow-b {
  top: 18vh;
  right: -28vw;
  background: radial-gradient(circle, var(--glow-b), transparent 65%);
}

.site-header,
.admin-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 22px 28px;
  background: var(--header-veil);
  backdrop-filter: blur(18px);
}

.site-header::after,
.admin-header::after {
  content: "";
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  color: var(--accent);
  background: linear-gradient(145deg, rgba(154, 140, 255, 0.16), transparent);
}

.brand-mark svg {
  width: 24px;
  height: 24px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text strong {
  font-size: 15px;
  letter-spacing: 0.02em;
}

.brand-text small {
  margin-top: 3px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-nav a {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13.5px;
  transition: color 0.2s ease, background 0.2s ease;
}

.site-nav a:hover {
  color: var(--text);
  background: var(--fill-2);
}

.site-nav .nav-admin {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  margin-left: 4px;
  border: 1px solid var(--border);
}

.site-nav .nav-admin svg {
  width: 16px;
  height: 16px;
}

main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.85fr);
  gap: 56px;
  align-items: center;
  padding: 74px 0 48px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 18px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.17em;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

.hero h1 {
  margin: 0;
  font-size: clamp(44px, 6.2vw, 78px);
  font-weight: 650;
  line-height: 1.03;
  letter-spacing: -0.045em;
}

.hero h1 em {
  font-style: normal;
  background: linear-gradient(110deg, var(--accent) 5%, var(--accent-2) 95%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-lead {
  max-width: 590px;
  margin: 26px 0 0;
  color: var(--muted);
  font-size: 16.5px;
  line-height: 1.8;
}

.hero-lead strong {
  color: var(--text);
  font-weight: 600;
}

.hero-contact {
  margin: 16px 0 0;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
}

.hero-contact strong {
  color: var(--accent);
  font-weight: 600;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong) 55%, var(--accent-2));
  box-shadow: 0 10px 30px rgba(116, 100, 255, 0.32);
}

.btn-primary:hover {
  background: var(--btn-primary-hover);
}

.btn-ghost {
  color: var(--muted);
  border-color: var(--border);
  background: var(--fill-1);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--fill-3);
}

.btn-sm {
  min-height: 36px;
  padding: 0 13px;
  border-radius: 9px;
  font-size: 12.5px;
}

.btn-danger {
  color: var(--danger);
  border-color: rgba(255, 107, 157, 0.3);
  background: var(--danger-soft);
}

.btn-danger:hover {
  color: #fff;
  background: rgba(255, 107, 157, 0.22);
  border-color: rgba(255, 107, 157, 0.45);
}

.hero-panel {
  position: relative;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(160deg, rgba(154, 140, 255, 0.08), transparent 40%),
    var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(154, 140, 255, 0.08), transparent);
  transform: translateX(-100%);
  animation: sweep 7s ease-in-out infinite;
}

@keyframes sweep {
  0%, 55% { transform: translateX(-100%); }
  75%, 100% { transform: translateX(100%); }
}

.meter-head,
.meter-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
}

.live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
}

.live i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  animation: blink 1.8s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

.wave {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 150px;
  margin: 20px 0;
  padding: 0 4px;
}

.wave span {
  flex: 1;
  height: var(--h);
  min-height: 8px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent-2), rgba(154, 140, 255, 0.22));
  opacity: 0.75;
  animation: breathe 2.8s ease-in-out infinite;
}

.wave span:nth-child(3n) { animation-delay: -0.7s; opacity: 0.5; }
.wave span:nth-child(3n + 1) { animation-delay: -1.4s; opacity: 0.9; }
.wave span:nth-child(4n) { animation-delay: -2.1s; opacity: 0.6; }

@keyframes breathe {
  0%, 100% { transform: scaleY(0.72); }
  50% { transform: scaleY(1.08); }
}

/* --- Logo：XH 字母组合 + 信号波形 ------------------------------------------- */
.logo-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 420px;
  padding: 40px 28px 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    radial-gradient(80% 90% at 50% 15%, rgba(154, 140, 255, 0.13), transparent 68%),
    var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* 慢慢扫过的高光，让卡片不那么呆 */
.logo-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 36%, rgba(255, 255, 255, 0.06) 48%, transparent 60%);
  transform: translateX(-70%);
  animation: logo-sweep 9s ease-in-out infinite;
  pointer-events: none;
}

/* 背后的光晕 + 缓慢旋转的轨道 */
.logo-glow {
  position: absolute;
  width: min(320px, 78vw);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, var(--logo-glow), transparent 68%);
  filter: blur(14px);
  animation: logo-halo 7s ease-in-out infinite;
  pointer-events: none;
}

.logo-orbit {
  position: absolute;
  width: min(298px, 74vw);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px dashed var(--border-strong);
  opacity: 0.7;
  animation: logo-spin 26s linear infinite;
  pointer-events: none;
}

.logo-orbit::before {
  content: "";
  position: absolute;
  inset: -1.5px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    var(--accent) 44deg,
    var(--accent-2) 88deg,
    transparent 132deg
  );
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
}

.logo-badge {
  position: relative;
  z-index: 2;
  width: min(228px, 58vw);
  height: auto;
  filter: drop-shadow(0 18px 34px var(--logo-shadow));
}

.badge-plate {
  fill: url(#xhPlate);
}

.badge-sheen {
  fill: url(#xhSheen);
}

.badge-frame {
  fill: none;
  stroke: url(#xhRing);
  stroke-width: 1.4;
  opacity: 0.75;
}

.badge-inner {
  fill: none;
  stroke: var(--logo-inner);
  stroke-width: 1;
  opacity: 0.8;
}

/* XH 用路径画，不依赖系统字体，任何设备都一致 */
.badge-mono path {
  fill: none;
  stroke: url(#xhInk);
  stroke-width: 15;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.badge-wave {
  fill: none;
  stroke: url(#xhWave);
  stroke-width: 7;
  stroke-linecap: round;
}

.stop-plate-1 { stop-color: var(--logo-plate-1); }
.stop-plate-2 { stop-color: var(--logo-plate-2); }
.stop-ring-1 { stop-color: var(--logo-ring-1); }
.stop-ring-2 { stop-color: var(--logo-ring-2); }
.stop-ring-3 { stop-color: var(--logo-ring-3); }
.stop-ink-1 { stop-color: var(--logo-ink-1); }
.stop-ink-2 { stop-color: var(--logo-ink-2); }
.stop-ink-3 { stop-color: var(--logo-ink-3); }
.stop-wave-1 { stop-color: var(--logo-wave-1); }
.stop-wave-2 { stop-color: var(--logo-wave-2); }
.stop-sheen { stop-color: var(--logo-inner); }

.logo-wordmark {
  position: relative;
  z-index: 1;
  margin-top: 26px;
  text-align: center;
}

.logo-wordmark::before {
  content: "";
  display: block;
  width: 46px;
  height: 1px;
  margin: 0 auto 16px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.logo-wordmark strong {
  display: block;
  color: var(--text);
  font-size: clamp(23px, 2.8vw, 31px);
  font-weight: 650;
  line-height: 1.1;
  letter-spacing: 0.2em;
  text-indent: 0.2em;
}

.logo-wordmark span {
  display: block;
  margin-top: 10px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 400;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  text-transform: uppercase;
}

@keyframes logo-sweep {
  0%, 52% { transform: translateX(-70%); }
  82%, 100% { transform: translateX(70%); }
}

@keyframes logo-spin {
  to { transform: rotate(360deg); }
}

@keyframes logo-halo {
  0%, 100% { transform: scale(0.94); opacity: 0.7; }
  50% { transform: scale(1.06); opacity: 1; }
}

@media (max-width: 1100px) {
  .logo-hero {
    width: min(560px, 100%);
    margin: 0 auto;
  }
}

@media (max-width: 560px) {
  .logo-hero {
    min-height: 360px;
    padding: 32px 16px 28px;
  }

  .logo-badge {
    width: min(190px, 52vw);
  }

  .logo-wordmark {
    margin-top: 22px;
  }

  .logo-wordmark strong {
    font-size: 22px;
    letter-spacing: 0.16em;
    text-indent: 0.16em;
  }
}

.meter-foot {
  align-items: flex-end;
  letter-spacing: 0.08em;
}

.meter-foot div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.meter-foot .label {
  color: var(--muted-2);
  font-size: 8.5px;
}

.meter-foot strong {
  color: var(--text);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.voice-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin: 26px 0 18px;
  padding: 26px 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    radial-gradient(100% 150% at 100% 0%, rgba(92, 200, 255, 0.1), transparent 60%),
    radial-gradient(100% 150% at 0% 0%, rgba(154, 140, 255, 0.1), transparent 60%),
    var(--panel);
}

.voice-cta h2 {
  margin: 6px 0 7px;
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 620;
  letter-spacing: -0.03em;
}

.voice-cta p {
  max-width: 660px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.voice-cta .btn {
  flex-shrink: 0;
}

.site-footer a {
  color: var(--accent-2);
}

@media (max-width: 760px) {
  .voice-cta {
    flex-direction: column;
    align-items: flex-start;
    padding: 22px;
  }

  .voice-cta .btn {
    width: 100%;
  }
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 12px 0 72px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--border);
  overflow: hidden;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 22px 24px;
  background: var(--bg-soft);
}

.stat-value {
  color: var(--text);
  font-family: var(--mono);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.stat-label {
  color: var(--muted-2);
  font-size: 12px;
}

.stat-note .stat-value {
  color: var(--accent);
}

.files-section {
  padding: 8px 0 80px;
  scroll-margin-top: 90px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.section-head h2,
.about h2 {
  margin: 0;
  font-size: clamp(28px, 3.2vw, 38px);
  font-weight: 620;
  letter-spacing: -0.035em;
}

.search {
  display: flex;
  align-items: center;
  gap: 9px;
  width: min(300px, 100%);
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--fill-1);
  color: var(--muted-2);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.search:focus-within {
  border-color: var(--border-strong);
  background: var(--fill-2);
}

.search svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 13.5px;
}

.search input::placeholder {
  color: var(--muted-2);
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}

.category-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: var(--fill-1);
  font-size: 12px;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.category-tab:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--fill-3);
}

.category-tab.active {
  color: var(--tint-text);
  border-color: rgba(154, 140, 255, 0.5);
  background: var(--tab-active-bg);
}

.category-tab .count {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9.5px;
}

.category-tab.active .count {
  color: var(--accent);
}

.category-badge {
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.04em;
}

.category-badge.host {
  color: var(--badge-host);
  border-color: rgba(154, 140, 255, 0.3);
  background: rgba(154, 140, 255, 0.1);
}

.category-badge.vst {
  color: var(--badge-vst);
  border-color: rgba(92, 200, 255, 0.3);
  background: rgba(92, 200, 255, 0.09);
}

.category-badge.tools {
  color: var(--badge-tools);
  border-color: rgba(240, 171, 252, 0.28);
  background: rgba(240, 171, 252, 0.08);
}

.category-badge.other {
  color: var(--muted-2);
  background: var(--fill-2);
}

.upload-options {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--fill-1);
}

.upload-options label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
}

.upload-options select,
.category-select {
  min-height: 34px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: 0;
  color: var(--text);
  background: var(--fill-2);
  font-size: 12px;
}

.upload-options select:focus,
.category-select:focus {
  border-color: var(--accent);
}

.upload-options .hint {
  color: var(--muted-2);
  font-size: 11px;
}

.category-select {
  min-height: 30px;
  padding: 0 7px;
  font-size: 11px;
}

.category-admin {
  margin-top: 14px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--fill-1);
}

.category-admin-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.category-admin-head .eyebrow {
  margin-bottom: 7px;
}

.category-admin-head h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.category-add {
  display: flex;
  align-items: center;
  gap: 8px;
}

.category-add input {
  width: min(260px, 46vw);
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: 0;
  color: var(--text);
  background: var(--fill-2);
  font-size: 12px;
}

.category-add input:focus {
  border-color: var(--accent);
}

.category-admin > .form-error {
  min-height: 18px;
  margin: 8px 0 0;
  font-size: 12px;
}

.category-admin-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.category-admin-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 7px 0 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--fill-1);
}

.category-admin-item .count {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9px;
}

.category-admin-item .icon-btn {
  width: 26px;
  height: 26px;
  border-radius: 7px;
}

@media (max-width: 760px) {
  .category-admin-head {
    align-items: stretch;
  }

  .category-add {
    width: 100%;
  }

  .category-add input {
    flex: 1;
    width: auto;
  }
}

.file-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--panel);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.file-row:hover {
  border-color: var(--border-strong);
  background: var(--panel-2);
  transform: translateY(-1px);
}

.file-badge {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 1px solid var(--border);
  border-radius: 13px;
  color: var(--accent);
  background: linear-gradient(150deg, rgba(154, 140, 255, 0.14), rgba(154, 140, 255, 0.03));
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.file-badge.audio {
  color: var(--accent-2);
  background: linear-gradient(150deg, rgba(92, 200, 255, 0.15), rgba(92, 200, 255, 0.03));
}

.file-main {
  min-width: 0;
}

.file-name {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  font-weight: 560;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 5px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.03em;
}

.file-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--muted);
  background: var(--fill-1);
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.icon-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--fill-3);
}

.icon-btn svg {
  width: 17px;
  height: 17px;
}

/* --- 深色 / 浅色切换 -------------------------------------------------------- */
.theme-toggle {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.site-nav .theme-toggle {
  margin-left: 4px;
  border-radius: 999px;
}

.admin-header-actions .theme-toggle {
  margin-left: 2px;
}

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--fill-2);
  transform: translateY(-1px);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-toggle svg {
  width: 16px;
  height: 16px;
}

/* 深色模式显示太阳（点了变亮），浅色模式显示月亮（点了变暗） */
.theme-toggle .icon-moon {
  display: none;
}

:root[data-theme="light"] .theme-toggle .icon-sun {
  display: none;
}

:root[data-theme="light"] .theme-toggle .icon-moon {
  display: block;
}

/* 没有 header 的页面（登录页 / 语音房加入页）用浮在右上角的版本 */
.theme-toggle-floating {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 60;
  background: var(--panel-solid);
  box-shadow: 0 8px 24px rgba(16, 8, 48, 0.18);
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 220px;
  padding: 32px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted-2);
  text-align: center;
}

.empty-state p {
  margin: 0;
  font-size: 13.5px;
}

.spinner {
  width: 26px;
  height: 26px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.about {
  display: block;
  padding: 0 0 88px;
  scroll-margin-top: 90px;
}

.about-card {
  padding: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(154, 140, 255, 0.1), transparent 55%),
    var(--panel);
}

.about-card > p:not(.eyebrow) {
  max-width: 620px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.85;
}

.about-list {
  display: grid;
  gap: 12px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
}

.about-list li {
  display: flex;
  gap: 14px;
  color: var(--muted);
  font-size: 13.5px;
}

.about-list span {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
}

.about-side {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.info-block {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--panel);
}

.info-block .label {
  display: block;
  margin-bottom: 9px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
}

.info-block strong {
  display: block;
  font-size: 17px;
  font-weight: 600;
}

.info-block p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 26px 28px 38px;
  border-top: 1px solid var(--border);
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
}

.footer-note {
  color: var(--muted-2);
}

/* --- preview dialog ------------------------------------------------------- */
.preview-dialog {
  width: min(560px, calc(100vw - 32px));
  padding: 22px;
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  color: var(--text);
  background: var(--panel-solid);
  box-shadow: var(--shadow);
}

.preview-dialog::backdrop {
  background: var(--overlay);
  backdrop-filter: blur(6px);
}

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

.preview-head .label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
}

.preview-head strong {
  display: block;
  max-width: 420px;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-dialog audio {
  width: 100%;
  height: 44px;
}

/* --- admin login ---------------------------------------------------------- */
.admin-body {
  min-height: 100vh;
}

.auth-shell {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 40px 20px;
}

.auth-card {
  width: min(560px, 100%);
  padding: 42px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(154, 140, 255, 0.11), transparent 55%),
    var(--panel);
  box-shadow: var(--shadow);
}

.auth-brand {
  display: flex;
  width: fit-content;
  margin-bottom: 36px;
}

.auth-card h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 48px);
  font-weight: 640;
  letter-spacing: -0.04em;
}

.auth-lead {
  max-width: 440px;
  margin: 12px 0 28px;
  color: var(--muted);
  font-size: 14px;
}

.auth-form label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.password-row {
  display: flex;
  gap: 10px;
}

.password-row input {
  flex: 1;
  min-width: 0;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 11px;
  outline: 0;
  background: var(--fill-2);
  color: var(--text);
  font-size: 14px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.password-row input:focus {
  border-color: var(--accent);
  background: rgba(154, 140, 255, 0.06);
}

.form-error {
  min-height: 20px;
  margin: 10px 0 0;
  color: var(--danger);
  font-size: 12.5px;
}

.back-link {
  display: inline-block;
  margin-top: 26px;
  color: var(--muted-2);
  font-size: 12.5px;
  transition: color 0.2s ease;
}

.back-link:hover {
  color: var(--text);
}

/* --- admin dashboard ------------------------------------------------------ */
.admin-header {
  position: static;
  max-width: 1280px;
}

.admin-header-actions {
  display: flex;
  gap: 8px;
}

.admin-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 28px 80px;
}

.admin-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  padding: 42px 0 30px;
}

.admin-hero h1 {
  margin: 0;
  font-size: clamp(34px, 4.4vw, 54px);
  font-weight: 640;
  letter-spacing: -0.04em;
}

.admin-lead {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.admin-stats {
  display: flex;
  gap: 26px;
}

.admin-stats div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 72px;
}

.admin-stats span {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 600;
}

.admin-stats small {
  color: var(--muted-2);
  font-size: 11px;
}

.dropzone {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 34px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background:
    radial-gradient(80% 140% at 50% 0%, rgba(154, 140, 255, 0.1), transparent 70%),
    var(--panel);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.dropzone:hover,
.dropzone:focus-visible,
.dropzone.dragging {
  border-color: var(--accent);
  background:
    radial-gradient(80% 140% at 50% 0%, rgba(154, 140, 255, 0.17), transparent 70%),
    var(--panel-2);
  outline: 0;
}

.dropzone.dragging {
  transform: scale(1.005);
}

.dropzone-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  flex-shrink: 0;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  color: var(--accent);
  background: rgba(154, 140, 255, 0.12);
}

.dropzone-icon svg {
  width: 26px;
  height: 26px;
}

.dropzone-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.dropzone-copy strong {
  font-size: 16px;
  font-weight: 600;
}

.dropzone-copy span {
  color: var(--muted-2);
  font-size: 12.5px;
}

.upload-queue {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.upload-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 16px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
}

.upload-item .name {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-item .status {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 10px;
}

.upload-item .bar {
  grid-column: 1 / -1;
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--fill-3);
}

.upload-item .bar i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  transition: width 0.2s ease;
}

.upload-item.done .bar i {
  background: var(--accent);
}

.upload-item.error {
  border-color: rgba(255, 107, 157, 0.38);
}

.upload-item.error .status {
  color: var(--danger);
}

.admin-files {
  margin-top: 50px;
}

.table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}

.file-table {
  width: 100%;
  border-collapse: collapse;
}

.file-table th,
.file-table td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.file-table th {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.file-table td {
  color: var(--muted);
  font-size: 12.5px;
}

.file-table tr:last-child td {
  border-bottom: 0;
}

.file-table tr:hover td {
  background: var(--fill-1);
}

.file-table .cell-name {
  max-width: 460px;
}

.file-table .cell-name strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-table .cell-name small {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9.5px;
}

.file-table .right {
  text-align: right;
}

.table-actions {
  display: inline-flex;
  gap: 6px;
  justify-content: flex-end;
}

.table-actions .icon-btn {
  width: 34px;
  height: 34px;
}

.table-actions .icon-btn svg {
  width: 15px;
  height: 15px;
}

.file-table .empty-row {
  color: var(--muted-2);
  text-align: center;
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 38px;
    padding-top: 56px;
  }

  .hero-panel {
    max-width: 560px;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .about {
    grid-template-columns: 1fr;
  }

  .admin-hero {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 700px) {
  .site-header,
  .admin-header {
    padding: 16px 18px;
  }

  .site-header::after,
  .admin-header::after {
    left: 18px;
    right: 18px;
  }

  main,
  .admin-main {
    padding-left: 18px;
    padding-right: 18px;
  }

  .site-nav a:not(.nav-admin) {
    display: none;
  }

  .hero {
    padding: 42px 0 34px;
  }

  .hero-lead {
    font-size: 15px;
  }

  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .search {
    width: 100%;
  }

  .file-row {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 12px;
    padding: 15px;
  }

  .file-badge {
    width: 44px;
    height: 44px;
    border-radius: 11px;
    font-size: 9px;
  }

  .file-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
    padding-top: 4px;
  }

  .stats {
    margin-bottom: 52px;
  }

  .stat {
    padding: 18px;
  }

  .stat-value {
    font-size: 20px;
  }

  .about-card {
    padding: 24px;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    padding: 22px 18px 30px;
  }

  .auth-card {
    padding: 28px;
  }

  .password-row {
    flex-direction: column;
  }

  .dropzone {
    align-items: flex-start;
    flex-direction: column;
    padding: 24px;
  }

  .dropzone .btn {
    width: 100%;
  }

  .file-table th:nth-child(4),
  .file-table td:nth-child(4) {
    display: none;
  }

  .file-table th,
  .file-table td {
    padding: 12px 12px;
  }

  .file-table .cell-name {
    max-width: 220px;
  }

  .admin-stats {
    gap: 18px;
  }
}

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

