/* Danmu Core 深色主题。仅覆盖颜色与表面，不改动业务布局。 */
html[data-theme="dark"] {
  --ink: #edf2fb;
  --muted: #9ba7ba;
  --line: #2a3446;
  --surface: #161d29;
  --soft: #1b2433;
  --blue: #8295ff;
  --blue-dark: #657cff;
  --violet: #b397ff;
  --cyan: #55ddd5;
  --green: #3ac78a;
  --red: #ff7b8d;
  --navy: #080d18;
  --shadow: 0 26px 75px rgba(0,0,0,.46);
  --up-grad: linear-gradient(135deg,#7387ff 0%,#a06df1 100%);
  --up-grad-soft: linear-gradient(135deg,rgba(115,135,255,.18),rgba(160,109,241,.16));
  --up-shadow-sm: 0 9px 28px rgba(0,0,0,.24);
  --up-shadow-md: 0 20px 52px rgba(0,0,0,.32);
  --up-shadow-lg: 0 34px 90px rgba(0,0,0,.42);
  --up-line: rgba(255,255,255,.09);
  color-scheme: dark;
}

html[data-theme="dark"],
html[data-theme="dark"] body { background: #0b1019; color: var(--ink); }
html[data-theme="dark"] ::selection { color: #fff; background: rgba(126,147,255,.38); }

/* 主页 */
html[data-theme="dark"] .site-page {
  background: radial-gradient(circle at 15% -10%,rgba(92,111,255,.14),transparent 34%),#0b1019;
}
html[data-theme="dark"] .site-page::before {
  background: radial-gradient(900px 480px at 90% 0,rgba(151,91,234,.13),transparent 60%);
}
html[data-theme="dark"] .site-header {
  color: #d8e0ef; border-bottom-color: rgba(255,255,255,.07);
  background: rgba(12,18,29,.76); box-shadow: 0 12px 36px rgba(0,0,0,.24);
}
html[data-theme="dark"] .site-nav { color: #c2ccdc; }
html[data-theme="dark"] .site-nav a:hover { color: #fff; }
html[data-theme="dark"] .brand em { color: #93a3ff; }
html[data-theme="dark"] .eyebrow,
html[data-theme="dark"] .button-ghost,
html[data-theme="dark"] .float-pill,
html[data-theme="dark"] .marquee-strip {
  color: #d8e0ef; border-color: rgba(255,255,255,.1); background: rgba(255,255,255,.055);
}
html[data-theme="dark"] .hero h1 { color: #f3f6fc; }
html[data-theme="dark"] .hero h1 span {
  color: transparent; background: linear-gradient(95deg,#93a8ff 0%,#c6a6ff 75%);
  -webkit-background-clip: text; background-clip: text;
}
html[data-theme="dark"] .hero-lead,
html[data-theme="dark"] .section-heading > p,
html[data-theme="dark"] .workflow-card p,
html[data-theme="dark"] .platform-card p,
html[data-theme="dark"] .playground-copy > p,
html[data-theme="dark"] .playground-copy ul { color: #a8b3c5; }
html[data-theme="dark"] .hero-trust strong,
html[data-theme="dark"] .hero-trust span { color: #dce4f2; }
html[data-theme="dark"] .hero-trust > i { background: rgba(255,255,255,.1); }
html[data-theme="dark"] .terminal-window,
html[data-theme="dark"] .api-card { border-color: rgba(255,255,255,.08); background: linear-gradient(155deg,#111a2e,#090f1d); }
html[data-theme="dark"] .request-line { border-color: rgba(255,255,255,.07); }
html[data-theme="dark"] .workflow-card,
html[data-theme="dark"] .playground-card,
html[data-theme="dark"] .public-format-grid article {
  color: #e9eef8; border-color: rgba(255,255,255,.08); background: #151c28;
  box-shadow: 0 16px 46px rgba(0,0,0,.2);
}
html[data-theme="dark"] .workflow-card.featured { background: linear-gradient(150deg,#1b2440,#151c28 72%); }
html[data-theme="dark"] .icon-box { background: rgba(125,145,255,.12); }
html[data-theme="dark"] .playground-section,
html[data-theme="dark"] .api-section,
html[data-theme="dark"] .site-footer { background: #0f151f; }
html[data-theme="dark"] .url-field,
html[data-theme="dark"] .empty-result,
html[data-theme="dark"] .demo-result-grid,
html[data-theme="dark"] .demo-error {
  color: #dce4f2; border-color: rgba(255,255,255,.09); background: #111824;
}
html[data-theme="dark"] .url-field input { color: #edf2fb; }
html[data-theme="dark"] .site-footer .site-shell { color: #aeb9cb; }

/* 主题按钮与移动导航 */
html[data-theme="dark"] .theme-switch,
html[data-theme="dark"] .nav-menu-toggle {
  color: #dce4f2; border-color: rgba(255,255,255,.1); background: rgba(255,255,255,.06);
  box-shadow: 0 8px 22px rgba(0,0,0,.24);
}
html[data-theme="dark"] .theme-switch:hover { background: rgba(255,255,255,.1); }
html[data-theme="dark"] .nav-menu-toggle i { background: #dce4f2; }

/* 管理端、用户端公共表面 */
html[data-theme="dark"] .admin-page,
html[data-theme="dark"] .user-page,
html[data-theme="dark"] .admin-main,
html[data-theme="dark"] .user-main { background: #0d131d; }
html[data-theme="dark"] .admin-sidebar,
html[data-theme="dark"] .user-sidebar { background: linear-gradient(180deg,#0c1220,#10182a); }
html[data-theme="dark"] .admin-topbar,
html[data-theme="dark"] .user-topbar {
  border-bottom-color: rgba(255,255,255,.07); background: rgba(15,22,34,.82);
  box-shadow: 0 8px 30px rgba(0,0,0,.2); backdrop-filter: blur(18px);
}
html[data-theme="dark"] .admin-topbar h1,
html[data-theme="dark"] .user-topbar h1 {
  color: #eef3fb; background: none; -webkit-background-clip: initial; background-clip: initial;
}
html[data-theme="dark"] .topbar-link,
html[data-theme="dark"] .user-topbar-actions > a { color: #9eacff; }
html[data-theme="dark"] .admin-nav a:hover,
html[data-theme="dark"] .admin-nav a.active,
html[data-theme="dark"] .user-side-nav a:hover,
html[data-theme="dark"] .user-side-nav a.active { color: #fff; background: rgba(121,140,255,.15); }
html[data-theme="dark"] .sidebar-status,
html[data-theme="dark"] .sidebar-account,
html[data-theme="dark"] .user-side-account { border-color: rgba(255,255,255,.07); background: rgba(255,255,255,.035); }

html[data-theme="dark"] .admin-panel,
html[data-theme="dark"] .user-card,
html[data-theme="dark"] .metric-card,
html[data-theme="dark"] .user-stat-grid article,
html[data-theme="dark"] .traffic-stat-grid article,
html[data-theme="dark"] .admin-traffic-stats > div,
html[data-theme="dark"] .quick-links a,
html[data-theme="dark"] .quick-admin-links a,
html[data-theme="dark"] .platform-health-grid > div,
html[data-theme="dark"] .admin-platform-grid article,
html[data-theme="dark"] .config-card {
  color: #e7edf7; border-color: rgba(255,255,255,.08); background: #151c28;
  box-shadow: 0 12px 38px rgba(0,0,0,.18);
}
html[data-theme="dark"] .dashboard-intro h2,
html[data-theme="dark"] .panel-heading h3,
html[data-theme="dark"] .user-card-heading h2,
html[data-theme="dark"] .metric-card strong,
html[data-theme="dark"] .user-stat-grid strong,
html[data-theme="dark"] .traffic-stat-grid strong,
html[data-theme="dark"] .quick-links b,
html[data-theme="dark"] .quick-admin-links b,
html[data-theme="dark"] .platform-health-grid strong,
html[data-theme="dark"] .package-admin-card h3,
html[data-theme="dark"] .package-user-card h3,
html[data-theme="dark"] .package-price strong { color: #eef3fb; }
html[data-theme="dark"] .dashboard-intro p,
html[data-theme="dark"] .panel-meta,
html[data-theme="dark"] .runtime-list span,
html[data-theme="dark"] .user-card-heading p,
html[data-theme="dark"] .user-stat-grid span,
html[data-theme="dark"] .user-stat-grid small,
html[data-theme="dark"] .traffic-stat-grid span,
html[data-theme="dark"] .traffic-stat-grid small,
html[data-theme="dark"] .quick-links span,
html[data-theme="dark"] .quick-admin-links span,
html[data-theme="dark"] .platform-health-grid small,
html[data-theme="dark"] .config-description,
html[data-theme="dark"] .package-user-card > p { color: #9da9bc; }

/* 表格、表单、代码区域 */
html[data-theme="dark"] .billing-table,
html[data-theme="dark"] .user-table,
html[data-theme="dark"] .logs-table { background: transparent; }
html[data-theme="dark"] .billing-table th,
html[data-theme="dark"] .user-table th { color: #8f9bae; border-bottom-color: rgba(255,255,255,.08); }
html[data-theme="dark"] .billing-table td,
html[data-theme="dark"] .user-table td { color: #d7dfed; border-bottom-color: rgba(255,255,255,.06); }
html[data-theme="dark"] .billing-table tbody tr:hover,
html[data-theme="dark"] .user-table tbody tr:hover { background: rgba(255,255,255,.025); }
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .input-with-icon,
html[data-theme="dark"] .login-input,
html[data-theme="dark"] .api-cell code,
html[data-theme="dark"] .endpoint-box,
html[data-theme="dark"] .runtime-list > div,
html[data-theme="dark"] .pipeline,
html[data-theme="dark"] .test-placeholder,
html[data-theme="dark"] .test-summary > div,
html[data-theme="dark"] .fallback-list > div,
html[data-theme="dark"] .api-create-row,
html[data-theme="dark"] .account-tab-panel dl div {
  color: #e1e8f4; border-color: rgba(255,255,255,.09); background: #101722;
}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder { color: #69758a; }
html[data-theme="dark"] .api-cell button,
html[data-theme="dark"] .admin-secondary-button,
html[data-theme="dark"] .copy-command button {
  color: #aebaff; border-color: rgba(255,255,255,.1); background: rgba(255,255,255,.045);
}
html[data-theme="dark"] .traffic-bar-stack { background: #252e43; }
html[data-theme="dark"] .traffic-chart { border-bottom-color: rgba(255,255,255,.08); }
html[data-theme="dark"] .result-details,
html[data-theme="dark"] .result-details summary { color: #bbc5d5; border-color: rgba(255,255,255,.08); background: #101722; }

/* 套餐、配置与提示 */
html[data-theme="dark"] .package-user-hero { background: linear-gradient(135deg,#435bd3,#7a4fc6); }
html[data-theme="dark"] .package-create-form label,
html[data-theme="dark"] .config-form label,
html[data-theme="dark"] .account-form label,
html[data-theme="dark"] .billing-setting-form > label { color: #b1bbcc; }
html[data-theme="dark"] .admin-alert.success { border-color: rgba(52,199,135,.22); background: rgba(32,164,108,.09); }
html[data-theme="dark"] .admin-alert.error,
html[data-theme="dark"] .user-notice.error { border-color: rgba(255,103,124,.22); background: rgba(211,66,88,.09); }
html[data-theme="dark"] .user-notice.success { border-color: rgba(52,199,135,.22); background: rgba(32,164,108,.09); }

/* 登录页、认证弹窗、账号弹窗 */
html[data-theme="dark"] .login-page {
  background: radial-gradient(circle at 15% 20%,rgba(99,117,255,.14),transparent 30%),#0b1019;
}
html[data-theme="dark"] .login-shell { border-color: rgba(255,255,255,.09); background: #121925; box-shadow: 0 34px 90px rgba(0,0,0,.42); }
html[data-theme="dark"] .login-story { background: linear-gradient(145deg,#111a31,#0b1120); }
html[data-theme="dark"] .login-form-panel,
html[data-theme="dark"] .login-form-wrap { background: #121925; }
html[data-theme="dark"] .login-heading h2,
html[data-theme="dark"] .auth-form h2,
html[data-theme="dark"] .auth-dialog-brand strong,
html[data-theme="dark"] .account-profile h2 { color: #eef3fb; }
html[data-theme="dark"] .login-heading p,
html[data-theme="dark"] .auth-form > p,
html[data-theme="dark"] .auth-dialog-brand small,
html[data-theme="dark"] .account-profile p { color: #9ba7ba; }
html[data-theme="dark"] .login-form > label,
html[data-theme="dark"] .auth-form label { color: #b2bdcf; }
html[data-theme="dark"] .auth-dialog,
html[data-theme="dark"] .account-modal-dialog { color: #e7edf7; border-color: rgba(255,255,255,.1); background: #151c28; }
html[data-theme="dark"] .auth-close,
html[data-theme="dark"] .account-modal-close { color: #b8c2d2; background: #222b3b; }
html[data-theme="dark"] .auth-tabs,
html[data-theme="dark"] .account-modal-tabs { background: #101722; }
html[data-theme="dark"] .auth-tabs button,
html[data-theme="dark"] .account-modal-tabs button { color: #9da9bc; }
html[data-theme="dark"] .auth-tabs button.active,
html[data-theme="dark"] .account-modal-tabs button.active { color: #bdc7ff; background: #222b3b; }

@media (max-width: 820px) {
  html[data-theme="dark"] .site-nav {
    color: #dbe3f0; border-color: rgba(255,255,255,.09); background: rgba(15,22,34,.97);
    box-shadow: 0 24px 60px rgba(0,0,0,.45);
  }
  html[data-theme="dark"] .site-nav > a:not(.nav-console):hover { background: rgba(126,145,255,.12); }
}
