/* ============================================================
   radio_net 台网签到系统 — 夜晚模式 theme-night.css v1.0
   生效条件：<html data-bs-theme="dark">（由 theme-init.js / theme-night.js 控制）
   白天模式：本文件所有规则均不匹配，原有外观与功能零影响
   注入位置：theme.css 之后
   ============================================================ */

/* ---------- 1. 夜晚变量（覆盖 theme.css 的 :root 浅色变量） ---------- */
html[data-bs-theme="dark"] {
  --brand-1: #58c6dc;
  --brand-2: #3fd6c0;
  --brand-deep: #a6e6f0;
  --ink: #e8f1f6;
  --muted: #a4bcc8;
  --glass: rgba(17, 31, 41, 0.72);
  --glass-strong: rgba(14, 26, 35, 0.88);
  --line: rgba(120, 205, 225, 0.20);
  --grad: linear-gradient(120deg, #1c6c7e, #17836f);
  --grad-soft: linear-gradient(120deg, rgba(88,198,220,.16), rgba(63,214,192,.14));
  --radius: 14px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.60);
  --font-num: "Bahnschrift", "DIN Alternate", "Segoe UI", Consolas, sans-serif;
  --panel: #101c26;
  --panel-2: #16242f;
  --hairline: rgba(255, 255, 255, 0.10);
  color-scheme: dark;
}

/* ---------- 2. 页面底色与背景压暗层 ---------- */
html[data-bs-theme="dark"] body {
  color: var(--ink) !important;
  background-color: #0a1218 !important;
}
html[data-bs-theme="dark"] body::before {
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(1100px 620px at 12% -12%, rgba(35,133,153,.26), transparent 62%),
    radial-gradient(900px 520px at 112% 18%, rgba(40,184,169,.16), transparent 58%),
    linear-gradient(180deg, #050b10, #0a141b 45%, #050a0e);
}
html[data-bs-theme="dark"] body::after {
  background: linear-gradient(180deg, rgba(5,11,16,.90), rgba(5,11,16,.74) 35%, rgba(5,11,16,.92)) !important;
}
html[data-bs-theme="dark"] ::-webkit-scrollbar-track { background: rgba(255,255,255,.05); }
html[data-bs-theme="dark"] ::-webkit-scrollbar-thumb { background: linear-gradient(#2f8ba1, #24705f); }
html[data-bs-theme="dark"] ::selection { background: rgba(88,198,220,.32); }
/* ---------- 3. 文字与链接基线 ---------- */
html[data-bs-theme="dark"] h1, html[data-bs-theme="dark"] h2, html[data-bs-theme="dark"] h3,
html[data-bs-theme="dark"] h4, html[data-bs-theme="dark"] h5, html[data-bs-theme="dark"] h6 { color: var(--ink); }
html[data-bs-theme="dark"] a { color: var(--brand-1); }
html[data-bs-theme="dark"] .text-muted { color: var(--muted) !important; }
html[data-bs-theme="dark"] .text-primary { color: var(--brand-1) !important; }
html[data-bs-theme="dark"] .text-danger { color: #ff938a !important; }
html[data-bs-theme="dark"] .text-success { color: #57d99b !important; }
html[data-bs-theme="dark"] .text-warning { color: #ffc766 !important; }
html[data-bs-theme="dark"] .text-info { color: #6fd6e8 !important; }
html[data-bs-theme="dark"] .text-secondary { color: #a9bcc7 !important; }
html[data-bs-theme="dark"] .text-dark { color: var(--ink) !important; }
html[data-bs-theme="dark"] .text-body-color { color: var(--ink) !important; }
html[data-bs-theme="dark"] .required-star { color: #ff7a6e !important; }
html[data-bs-theme="dark"] .power-error { color: #ff8f86 !important; }
html[data-bs-theme="dark"] .select-placeholder { color: var(--muted) !important; }
html[data-bs-theme="dark"] .footer { color: var(--muted) !important; }
html[data-bs-theme="dark"] .helper-text { color: var(--muted) !important; }
html[data-bs-theme="dark"] .helper-text a { color: var(--brand-1) !important; }
html[data-bs-theme="dark"] .hint-text { color: #c6d7e0 !important; }
html[data-bs-theme="dark"] .relay-hint { color: #c6d7e0 !important; }
html[data-bs-theme="dark"] .section-title { color: var(--ink) !important; }
html[data-bs-theme="dark"] .form-label { color: var(--ink) !important; }
html[data-bs-theme="dark"] .form-text { color: var(--muted) !important; }
html[data-bs-theme="dark"] .form-check-label { color: var(--ink); }
html[data-bs-theme="dark"] ::placeholder { color: rgba(232,241,246,.42) !important; }
html[data-bs-theme="dark"] .dropdown-item { color: #dce8ef; }
html[data-bs-theme="dark"] .dropdown-item:hover { background: rgba(88,198,220,.16); color: var(--brand-1); }
html[data-bs-theme="dark"] .dropdown-divider { border-top-color: var(--hairline); }

/* ---------- 4. 顶部导航 ---------- */
html[data-bs-theme="dark"] .top-header {
  background: linear-gradient(120deg, rgba(4,26,35,.97), rgba(9,48,46,.95)) !important;
  box-shadow: 0 4px 26px rgba(0,0,0,.60) !important;
  color: #fff !important;
}
html[data-bs-theme="dark"] .top-header::before {
  background: linear-gradient(90deg, transparent, #4fe0b0, transparent);
  opacity: .95;
}
html[data-bs-theme="dark"] .header-left-title { color: #fff !important; }
html[data-bs-theme="dark"] .header-center-text { color: rgba(255,255,255,.78) !important; }
html[data-bs-theme="dark"] .header-user-box,
html[data-bs-theme="dark"] .header-user-box .dropdown-toggle { color: #fff !important; }
html[data-bs-theme="dark"] .header-user-box .dropdown-toggle:hover { background: rgba(255,255,255,.16); }
html[data-bs-theme="dark"] .admin-badge {
  background: linear-gradient(120deg, #ffb347, #ff8c42) !important;
  color: #1b1206 !important;
}
html[data-bs-theme="dark"] .rn-live {
  color: rgba(255,255,255,.94);
  background: rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.20);
}
html[data-bs-theme="dark"] .navbar.navbar-dark.bg-primary,
html[data-bs-theme="dark"] .navbar.bg-primary {
  background: linear-gradient(120deg, rgba(4,26,35,.97), rgba(9,48,46,.95)) !important;
  box-shadow: 0 4px 22px rgba(0,0,0,.55);
}

/* ---------- 5. 下拉菜单 / 自动补全 / 面包屑 ---------- */
html[data-bs-theme="dark"] .dropdown-menu {
  background: rgba(12,24,32,.96) !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  box-shadow: 0 16px 40px rgba(0,0,0,.65) !important;
}
html[data-bs-theme="dark"] .autocomplete-list,
html[data-bs-theme="dark"] .dropdown-options {
  background: rgba(12,24,32,.97) !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  box-shadow: 0 10px 30px rgba(0,0,0,.6) !important;
}
html[data-bs-theme="dark"] .autocomplete-list li,
html[data-bs-theme="dark"] .dropdown-options li { color: #dce8ef; }
html[data-bs-theme="dark"] .autocomplete-list li:hover,
html[data-bs-theme="dark"] .dropdown-options li:hover:not(.text-muted) { background: rgba(88,198,220,.18) !important; }
html[data-bs-theme="dark"] .dropdown-options li.text-muted { color: var(--muted) !important; }
html[data-bs-theme="dark"] .breadcrumb {
  background: rgba(255,255,255,.06) !important;
  border: 1px solid var(--hairline);
}
html[data-bs-theme="dark"] .breadcrumb-item a { color: var(--brand-1); }
html[data-bs-theme="dark"] .breadcrumb-item.active { color: var(--muted); }
html[data-bs-theme="dark"] .breadcrumb-item + .breadcrumb-item::before { color: rgba(255,255,255,.35); }
/* ---------- 6. 侧边栏 ---------- */
html[data-bs-theme="dark"] .left-sidebar {
  background: var(--glass) !important;
  border: 1px solid var(--hairline) !important;
  box-shadow: var(--shadow) !important;
}
html[data-bs-theme="dark"] .sidebar-active-top {
  background: var(--grad) !important;
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(0,0,0,.45);
}
html[data-bs-theme="dark"] .sidebar-menu-list li a {
  color: #cfe0e8 !important;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
html[data-bs-theme="dark"] .sidebar-menu-list li a:hover {
  background: rgba(88,198,220,.14) !important;
  color: var(--brand-1) !important;
}

/* ---------- 7. 卡片族 ---------- */
html[data-bs-theme="dark"] .content-card,
html[data-bs-theme="dark"] .table-wrap-card,
html[data-bs-theme="dark"] .stat-card,
html[data-bs-theme="dark"] .card,
html[data-bs-theme="dark"] .card-main,
html[data-bs-theme="dark"] .action-card,
html[data-bs-theme="dark"] .err-card,
html[data-bs-theme="dark"] .recent-sessions,
html[data-bs-theme="dark"] .calendar-container,
html[data-bs-theme="dark"] .loading-box,
html[data-bs-theme="dark"] .master-entry,
html[data-bs-theme="dark"] .session-pick-card,
html[data-bs-theme="dark"] .info-display {
  background: var(--glass) !important;
  border: 1px solid var(--hairline) !important;
  box-shadow: var(--shadow) !important;
  color: var(--ink);
}
html[data-bs-theme="dark"] .content-card-header,
html[data-bs-theme="dark"] .table-title-bar,
html[data-bs-theme="dark"] .card-header,
html[data-bs-theme="dark"] .record-table h5,
html[data-bs-theme="dark"] .master-list-title,
html[data-bs-theme="dark"] .master-card-head,
html[data-bs-theme="dark"] .master-call,
html[data-bs-theme="dark"] .card-body,
html[data-bs-theme="dark"] .content-card h4 {
  color: var(--ink) !important;
}
html[data-bs-theme="dark"] .card-header {
  background: var(--grad-soft) !important;
  border-bottom: 1px solid var(--hairline);
}
html[data-bs-theme="dark"] .content-card-header,
html[data-bs-theme="dark"] .table-title-bar,
html[data-bs-theme="dark"] .record-table h5 {
  border-bottom: 1px dashed var(--line) !important;
}
html[data-bs-theme="dark"] .content-card-header > span:first-child,
html[data-bs-theme="dark"] .table-title-bar > span:first-child {
  background: var(--grad) !important;
  box-shadow: 0 2px 8px rgba(0,0,0,.5);
}
html[data-bs-theme="dark"] .welcome-card {
  background: linear-gradient(130deg, rgba(6,32,42,.96), rgba(10,58,54,.94)) !important;
  color: #fff !important;
  border: 1px solid rgba(255,255,255,.10) !important;
}
html[data-bs-theme="dark"] .welcome-card h2 { color: #fff !important; }
html[data-bs-theme="dark"] .welcome-card p { color: rgba(255,255,255,.82) !important; }
html[data-bs-theme="dark"] .stat-card::before { background: var(--grad); }
html[data-bs-theme="dark"] .stat-card h4, html[data-bs-theme="dark"] .stat-card h5,
html[data-bs-theme="dark"] .stat-text h4, html[data-bs-theme="dark"] .stat-text-info h3 {
  color: var(--muted) !important;
}
html[data-bs-theme="dark"] .stat-card .num, html[data-bs-theme="dark"] .stat-text .num,
html[data-bs-theme="dark"] .stat-text-info .num { color: var(--brand-deep) !important; }
html[data-bs-theme="dark"] .stat-card h5 { border-bottom-color: var(--hairline) !important; }
html[data-bs-theme="dark"] .stat-icon-box {
  background: var(--grad) !important;
  color: #fff !important;
  box-shadow: 0 5px 16px rgba(0,0,0,.45);
}
html[data-bs-theme="dark"] .stat-card:nth-child(1) .stat-icon-box { background: rgba(88,198,220,.18) !important; color: #7fd6ea !important; }
html[data-bs-theme="dark"] .stat-card:nth-child(2) .stat-icon-box { background: rgba(63,214,192,.16) !important; color: #55dcae !important; }
html[data-bs-theme="dark"] .stat-card:nth-child(3) .stat-icon-box { background: rgba(255,193,7,.16) !important; color: #ffc766 !important; }
html[data-bs-theme="dark"] .stat-card:nth-child(4) .stat-icon-box { background: rgba(156,39,176,.20) !important; color: #d9a3e8 !important; }
html[data-bs-theme="dark"] .master-card {
  background: var(--grad-soft) !important;
  border: 1.5px solid rgba(88,198,220,.28) !important;
  color: var(--ink);
}
html[data-bs-theme="dark"] .master-card:hover {
  border-color: rgba(63,214,192,.55) !important;
  box-shadow: var(--shadow-lg) !important;
}
html[data-bs-theme="dark"] .master-card-head { border-bottom: 1px solid var(--hairline) !important; }
html[data-bs-theme="dark"] .master-card-actions { border-top: 1px dashed var(--line) !important; }
html[data-bs-theme="dark"] .master-no {
  background: var(--grad) !important;
  color: #fff !important;
}
html[data-bs-theme="dark"] .master-row .k { color: var(--muted) !important; }
html[data-bs-theme="dark"] .master-row .v { color: var(--ink) !important; }
html[data-bs-theme="dark"] .master-entry { border: 1px dashed rgba(88,198,220,.35) !important; }
html[data-bs-theme="dark"] .auto-filled { background: rgba(63,214,192,.16) !important; }
html[data-bs-theme="dark"] .action-card { color: var(--ink) !important; }
html[data-bs-theme="dark"] .action-card p { color: #c6d7e0 !important; }
html[data-bs-theme="dark"] .action-card .bi { color: var(--brand-1); }
html[data-bs-theme="dark"] .action-card.danger .bi { color: #ff8f86; }
html[data-bs-theme="dark"] .detail-label { color: var(--muted) !important; }
html[data-bs-theme="dark"] .detail-value { color: var(--ink) !important; }
html[data-bs-theme="dark"] .session-date { color: var(--brand-1) !important; }
html[data-bs-theme="dark"] .session-detail { color: var(--muted) !important; }
html[data-bs-theme="dark"] .session-item { background: rgba(255,255,255,.05) !important; }
html[data-bs-theme="dark"] .session-item:hover { background: rgba(88,198,220,.14) !important; }
html[data-bs-theme="dark"] .session-badge {
  background: rgba(63,214,192,.18) !important;
  color: #6fe0cd !important;
}
html[data-bs-theme="dark"] .session-pick-card .pick-title { color: var(--ink); }
html[data-bs-theme="dark"] .session-pick-card .pick-meta { color: #c6d7e0 !important; }
html[data-bs-theme="dark"] .session-pick-card.is-keep {
  border-color: rgba(47,174,125,.7) !important;
  background: rgba(20,60,44,.55) !important;
}
html[data-bs-theme="dark"] .session-pick-card.is-merge {
  border-color: rgba(224,109,90,.7) !important;
  background: rgba(70,26,26,.55) !important;
}
html[data-bs-theme="dark"] .net-count { color: var(--brand-1) !important; }
html[data-bs-theme="dark"] .info-display { border: 1px solid var(--hairline) !important; color: var(--ink); }
html[data-bs-theme="dark"] .current-file { color: var(--brand-deep) !important; }
html[data-bs-theme="dark"] .header h1 { color: var(--brand-deep) !important; }
html[data-bs-theme="dark"] .header p { color: var(--muted) !important; }
/* ---------- 8. 表格 ---------- */
html[data-bs-theme="dark"] .table,
html[data-bs-theme="dark"] .record-table,
html[data-bs-theme="dark"] .inline-edit-table { color: var(--ink); }
html[data-bs-theme="dark"] .table thead th,
html[data-bs-theme="dark"] .inline-edit-table th,
html[data-bs-theme="dark"] .preview-table th {
  background: linear-gradient(120deg, rgba(28,108,126,.95), rgba(23,131,111,.92)) !important;
  color: #f2fbff !important;
}
html[data-bs-theme="dark"] .table tbody tr,
html[data-bs-theme="dark"] .preview-table tr { background: rgba(255,255,255,.045) !important; }
html[data-bs-theme="dark"] .table tbody td,
html[data-bs-theme="dark"] .preview-table td {
  border-color: rgba(255,255,255,.09) !important;
  color: #dce8ef !important;
}
html[data-bs-theme="dark"] .table-hover tbody tr:hover,
html[data-bs-theme="dark"] .table tbody tr:hover,
html[data-bs-theme="dark"] .preview-table tr:hover { background: rgba(88,198,220,.13) !important; }
html[data-bs-theme="dark"] .table-light {
  --bs-table-color: #dce8ef;
  --bs-table-bg: rgba(255,255,255,.06);
  --bs-table-border-color: rgba(255,255,255,.12);
  --bs-table-striped-bg: rgba(255,255,255,.05);
  --bs-table-striped-color: #dce8ef;
  --bs-table-hover-bg: rgba(88,198,220,.13);
  --bs-table-hover-color: #f2fbff;
  color: #dce8ef !important;
  border-color: rgba(255,255,255,.12) !important;
}
html[data-bs-theme="dark"] .preview-table tr:nth-child(even) { background-color: rgba(255,255,255,.05) !important; }
html[data-bs-theme="dark"] .preview-table th,
html[data-bs-theme="dark"] .preview-table td { border: 1px solid rgba(255,255,255,.12) !important; }
html[data-bs-theme="dark"] #csvPreview {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.14) !important;
  color: #cfe0e8;
}
html[data-bs-theme="dark"] .table-wrap-card { background: var(--glass) !important; }
html[data-bs-theme="dark"] .border.rounded.bg-white.shadow-sm {
  background: rgba(255,255,255,.04) !important;
  border-color: rgba(255,255,255,.14) !important;
}

/* ---------- 9. 表单控件 ---------- */
html[data-bs-theme="dark"] .form-control,
html[data-bs-theme="dark"] .form-select,
html[data-bs-theme="dark"] .edit-input,
html[data-bs-theme="dark"] .inline-edit-table .form-control {
  background: rgba(255,255,255,.07) !important;
  border: 1.5px solid rgba(140,205,225,.24) !important;
  color: #eaf4f8 !important;
}
html[data-bs-theme="dark"] .form-control:hover,
html[data-bs-theme="dark"] .form-select:hover { border-color: rgba(140,205,225,.42) !important; }
html[data-bs-theme="dark"] .form-control:focus,
html[data-bs-theme="dark"] .form-select:focus,
html[data-bs-theme="dark"] .edit-input:focus,
html[data-bs-theme="dark"] .inline-edit-table .form-control:focus {
  background: rgba(12,26,34,.96) !important;
  border-color: var(--brand-2) !important;
  color: #f2fbff !important;
  box-shadow: 0 0 0 4px rgba(63,214,192,.18) !important;
}
html[data-bs-theme="dark"] .form-select {
  --bs-form-select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23a4bcc8' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}
html[data-bs-theme="dark"] .inline-edit-table .form-control { border: 1px solid transparent !important; background: rgba(255,255,255,.05) !important; }
html[data-bs-theme="dark"] .inline-edit-table .form-control:hover { border-color: rgba(255,255,255,.28) !important; background: rgba(255,255,255,.10) !important; }
html[data-bs-theme="dark"] .file-selector select {
  background-color: rgba(255,255,255,.07) !important;
  border: 2px solid rgba(140,205,225,.26) !important;
  color: #eaf4f8 !important;
}
html[data-bs-theme="dark"] .file-selector select:focus { border-color: var(--brand-2) !important; }
html[data-bs-theme="dark"] .file-selector label { color: var(--ink) !important; }
html[data-bs-theme="dark"] .form-icon { color: #8fb2c2 !important; }
html[data-bs-theme="dark"] .password-toggle { color: #8fb2c2 !important; }
html[data-bs-theme="dark"] .password-toggle:hover { color: var(--brand-1) !important; }
html[data-bs-theme="dark"] .form-check-input {
  background-color: rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.30);
}
html[data-bs-theme="dark"] .form-check-input:checked { background-color: var(--brand-1); border-color: var(--brand-1); }
html[data-bs-theme="dark"] option { background-color: #101c26; color: #eaf4f8; }

/* ---------- 10. 按钮 ---------- */
html[data-bs-theme="dark"] .btn-edit,
html[data-bs-theme="dark"] .btn-edit-master,
html[data-bs-theme="dark"] .btn-action,
html[data-bs-theme="dark"] .btn-nav,
html[data-bs-theme="dark"] .template-btn {
  background: rgba(255,255,255,.08) !important;
  color: var(--brand-1) !important;
  border: 1.5px solid rgba(140,205,225,.28) !important;
}
html[data-bs-theme="dark"] .btn-edit:hover,
html[data-bs-theme="dark"] .btn-edit-master:hover,
html[data-bs-theme="dark"] .btn-action:hover,
html[data-bs-theme="dark"] .btn-nav:hover,
html[data-bs-theme="dark"] .template-btn:hover {
  background: rgba(88,198,220,.18) !important;
  border-color: var(--brand-2) !important;
  color: #bdeef7 !important;
}
html[data-bs-theme="dark"] .btn-primary,
html[data-bs-theme="dark"] .btn-success,
html[data-bs-theme="dark"] .btn-save,
html[data-bs-theme="dark"] .finish-btn,
html[data-bs-theme="dark"] .btn-play,
html[data-bs-theme="dark"] .control-btn:not(.btn-stop):not(.btn-pause) {
  box-shadow: 0 5px 18px rgba(0,0,0,.55);
}
html[data-bs-theme="dark"] .btn-primary:hover,
html[data-bs-theme="dark"] .btn-success:hover,
html[data-bs-theme="dark"] .btn-save:hover,
html[data-bs-theme="dark"] .finish-btn:hover { filter: brightness(1.14); }
html[data-bs-theme="dark"] .btn-outline-dark { color: #e8f1f6; border-color: rgba(255,255,255,.34); }
html[data-bs-theme="dark"] .btn-outline-dark:hover { background: rgba(255,255,255,.14); color: #fff; }
html[data-bs-theme="dark"] .btn-outline-secondary { color: #cfe0e8; border-color: rgba(255,255,255,.28); }
html[data-bs-theme="dark"] .btn-outline-secondary:hover { background: rgba(255,255,255,.12); color: #fff; }
html[data-bs-theme="dark"] .btn-outline-danger:hover { background: rgba(224,109,90,.18); }
html[data-bs-theme="dark"] .btn:disabled { opacity: .55; }
html[data-bs-theme="dark"] .btn-restart { background-color: #2f7fc4 !important; color: #fff !important; }
html[data-bs-theme="dark"] .btn-restart:hover { background-color: #3a91da !important; }
/* ---------- 11. 提示框 / 徽章 ---------- */
html[data-bs-theme="dark"] .alert {
  background: rgba(255,255,255,.07) !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  color: #e2edf3 !important;
}
html[data-bs-theme="dark"] .alert-success {
  background: rgba(31,138,82,.20) !important;
  color: #7fe0ac !important;
  border-color: rgba(87,217,155,.34) !important;
}
html[data-bs-theme="dark"] .alert-danger,
html[data-bs-theme="dark"] .alert-warning {
  background: rgba(179,54,42,.20) !important;
  color: #ffb0a6 !important;
  border-color: rgba(255,143,134,.32) !important;
}
html[data-bs-theme="dark"] .alert-info {
  background: rgba(28,108,126,.24) !important;
  color: #9fe4f2 !important;
  border-color: rgba(88,198,220,.30) !important;
}
html[data-bs-theme="dark"] .alert-secondary {
  background: rgba(255,255,255,.08) !important;
  color: #cfe0e8 !important;
  border-color: rgba(255,255,255,.16) !important;
}
html[data-bs-theme="dark"] .hint-box {
  background: rgba(31,138,82,.18) !important;
  border-left: 4px solid #2fae7d !important;
  color: #a8e8c6 !important;
}
html[data-bs-theme="dark"] .hint-box:hover { background: rgba(31,138,82,.26) !important; }
html[data-bs-theme="dark"] .warning-box {
  background: rgba(179,54,42,.18) !important;
  border-left: 4px solid #e06d5a !important;
  color: #ffb0a6 !important;
}
html[data-bs-theme="dark"] .warning-box:hover { background: rgba(179,54,42,.26) !important; }
html[data-bs-theme="dark"] .danger-box {
  background: rgba(179,54,42,.16) !important;
  border-left: 4px solid #e06d5a !important;
  color: #ffb0a6 !important;
}
html[data-bs-theme="dark"] .info-box {
  background: rgba(28,108,126,.22) !important;
  border-left: 4px solid var(--brand-1) !important;
  color: #bfe6f0 !important;
}
html[data-bs-theme="dark"] .badge.bg-warning { color: #241a05 !important; }
html[data-bs-theme="dark"] .badge.bg-info { color: #062530 !important; }
html[data-bs-theme="dark"] .badge.bg-light { color: #16242f !important; }
html[data-bs-theme="dark"] .badge.bg-secondary { background-color: #4a5b66 !important; }
html[data-bs-theme="dark"] .badge.bg-dark { background-color: #0b1319 !important; border: 1px solid rgba(255,255,255,.18); }
html[data-bs-theme="dark"] .bg-white { background-color: rgba(255,255,255,.06) !important; }
html[data-bs-theme="dark"] .bg-light { background-color: rgba(255,255,255,.08) !important; color: #dce8ef; }
html[data-bs-theme="dark"] .bg-gray-50 { background-color: #0a1218 !important; }
html[data-bs-theme="dark"] .border { border-color: rgba(255,255,255,.14) !important; }
html[data-bs-theme="dark"] .border-gray-200 { border-color: rgba(255,255,255,.16) !important; }
html[data-bs-theme="dark"] .border-danger { border-color: rgba(255,143,134,.45) !important; }
html[data-bs-theme="dark"] .shadow, html[data-bs-theme="dark"] .shadow-sm { box-shadow: 0 6px 20px rgba(0,0,0,.55) !important; }
html[data-bs-theme="dark"] .dup-keep-text { color: #6fe0a8 !important; }
html[data-bs-theme="dark"] .dup-remove-text { color: #ff9d92 !important; }

/* ---------- 12. 日历（rili.php） ---------- */
html[data-bs-theme="dark"] .calendar-header { color: var(--ink) !important; }
html[data-bs-theme="dark"] .calendar-title { color: var(--ink) !important; }
html[data-bs-theme="dark"] .calendar-weekday {
  color: var(--muted) !important;
  border-bottom: 1px solid rgba(255,255,255,.10) !important;
}
html[data-bs-theme="dark"] .calendar-day { background: rgba(255,255,255,.05) !important; }
html[data-bs-theme="dark"] .calendar-day .day-number { color: #dce8ef !important; }
html[data-bs-theme="dark"] .calendar-day .session-count { color: var(--muted) !important; }
html[data-bs-theme="dark"] .calendar-day .session-info { color: #cfe0e8 !important; }
html[data-bs-theme="dark"] .calendar-day .session-name { color: var(--brand-1) !important; }
html[data-bs-theme="dark"] .calendar-day.empty { background: transparent !important; }
html[data-bs-theme="dark"] .calendar-day.has-session { background: rgba(63,214,192,.16) !important; border: 1px solid rgba(63,214,192,.28); }
html[data-bs-theme="dark"] .calendar-day.today { background: rgba(88,198,220,.20) !important; outline-color: var(--brand-2); }
html[data-bs-theme="dark"] .calendar-day:hover { background: rgba(88,198,220,.14) !important; }
html[data-bs-theme="dark"] .session-dot { background: var(--grad) !important; }
html[data-bs-theme="dark"] .modal-header { border-bottom: 1px solid rgba(255,255,255,.12) !important; }
html[data-bs-theme="dark"] .modal-title { color: var(--ink) !important; }
html[data-bs-theme="dark"] .modal-close { color: var(--muted) !important; }
html[data-bs-theme="dark"] .modal-close:hover { color: #fff !important; }
html[data-bs-theme="dark"] .session-detail-item { border-bottom: 1px solid rgba(255,255,255,.10) !important; }
html[data-bs-theme="dark"] .modal-content { color: var(--ink); }
html[data-bs-theme="dark"] .modal-content .detail-label { color: var(--muted) !important; }
html[data-bs-theme="dark"] .modal-content .detail-value { color: var(--ink) !important; }
html[data-bs-theme="dark"] .btn-close { filter: invert(1) grayscale(100) brightness(1.6); }

/* ---------- 13. 步骤条 / 排名 / 加载 ---------- */
html[data-bs-theme="dark"] .step-number {
  background: rgba(255,255,255,.10) !important;
  color: #cfe0e8 !important;
}
html[data-bs-theme="dark"] .step-name { color: var(--muted) !important; }
html[data-bs-theme="dark"] .step-item.active .step-name { color: var(--brand-1) !important; }
html[data-bs-theme="dark"] .step-item.active .step-number { background: var(--grad) !important; color: #fff !important; }
html[data-bs-theme="dark"] .step-item.completed .step-number { background: #2fae7d !important; color: #fff !important; }
html[data-bs-theme="dark"] .step-item::after { background-color: rgba(255,255,255,.16) !important; }
html[data-bs-theme="dark"] .step-item.completed::after { background-color: #2fae7d !important; }
html[data-bs-theme="dark"] .rank-badge { color: #101c26 !important; }
html[data-bs-theme="dark"] .rank-1 { background: linear-gradient(120deg, #ffd76a, #f0b545) !important; }
html[data-bs-theme="dark"] .rank-2 { background: linear-gradient(120deg, #cfd8e0, #aeb9c4) !important; }
html[data-bs-theme="dark"] .rank-3 { background: linear-gradient(120deg, #e0ab7e, #c88f60) !important; }
html[data-bs-theme="dark"] .rank-other { background: #556773 !important; color: #e8f1f6 !important; }
html[data-bs-theme="dark"] .loader, html[data-bs-theme="dark"] .loading {
  border: 3px solid rgba(255,255,255,.18) !important;
  border-top-color: var(--brand-2) !important;
}
html[data-bs-theme="dark"] .spinner { border: 2px solid rgba(255,255,255,.55) !important; border-top-color: transparent !important; }
html[data-bs-theme="dark"] .loading-overlay { background: rgba(0,0,0,.55) !important; }
html[data-bs-theme="dark"] .modal-overlay { background: rgba(0,0,0,.68) !important; }
html[data-bs-theme="dark"] .toast { background: rgba(12,24,32,.94) !important; color: #e2edf3 !important; border: 1px solid rgba(255,255,255,.14); }
html[data-bs-theme="dark"] .toast-header { background: rgba(255,255,255,.08) !important; color: #e2edf3 !important; border-bottom: 1px solid rgba(255,255,255,.10); }
html[data-bs-theme="dark"] .nav-tabs { border-bottom-color: rgba(255,255,255,.14); }
html[data-bs-theme="dark"] .nav-tabs .nav-link { color: var(--muted); }
html[data-bs-theme="dark"] .nav-tabs .nav-link:hover { color: var(--brand-1); }
html[data-bs-theme="dark"] .nav-tabs .nav-link.active { color: var(--brand-1) !important; border-bottom-color: var(--brand-1) !important; }
/* ---------- 14. 主控练习器（zk.php）播放器面板 ---------- */
html[data-bs-theme="dark"] .player-container {
  background: rgba(14,26,35,.92) !important;
  box-shadow: 0 20px 60px rgba(0,0,0,.7) !important;
  border: 1px solid rgba(255,255,255,.10);
  color: var(--ink);
}
html[data-bs-theme="dark"] .status {
  background-color: rgba(255,255,255,.06) !important;
  border-left: 4px solid var(--brand-1) !important;
}
html[data-bs-theme="dark"] .status p { color: #dce8ef !important; }
html[data-bs-theme="dark"] .progress-bar { background-color: rgba(255,255,255,.14) !important; }
html[data-bs-theme="dark"] .progress { background-color: var(--brand-1) !important; }
html[data-bs-theme="dark"] .time-display { color: var(--muted) !important; }
html[data-bs-theme="dark"] .btn-pause { color: #241a05 !important; }
html[data-bs-theme="dark"] .btn-stop { box-shadow: 0 5px 18px rgba(0,0,0,.5) !important; }

/* ---------- 15. 登录页（login.php / index.php） ---------- */
html[data-bs-theme="dark"] .login-container {
  background: var(--glass-strong) !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  box-shadow: 0 18px 56px rgba(0,0,0,.72) !important;
  color: var(--ink);
}
html[data-bs-theme="dark"] .login-container::before { background: var(--grad); }
html[data-bs-theme="dark"] .radio-logo h1 { color: var(--ink) !important; }
html[data-bs-theme="dark"] .radio-logo p { color: var(--muted) !important; }
html[data-bs-theme="dark"] .radio-logo .icon {
  background: var(--grad) !important;
  color: #fff !important;
  box-shadow: 0 10px 26px rgba(0,0,0,.55);
}
html[data-bs-theme="dark"] .permanent-ban { color: #ffb0a6 !important; }

/* ---------- 16. CW 练习器（cw.php，Tailwind 工具类） ---------- */
html[data-bs-theme="dark"] body.bg-gray-50 { background-color: #0a1218 !important; }
html[data-bs-theme="dark"] .bg-white { color: #dce8ef; }
html[data-bs-theme="dark"] .bg-white h3,
html[data-bs-theme="dark"] .bg-white h1 { color: var(--ink); }
html[data-bs-theme="dark"] .text-gray-800 { color: #e8f1f6 !important; }
html[data-bs-theme="dark"] .text-gray-400 { color: #93a9b5 !important; }
html[data-bs-theme="dark"] .bg-gray-100 { background-color: rgba(255,255,255,.10) !important; color: #e8f1f6 !important; }
html[data-bs-theme="dark"] .bg-gray-200 { background-color: rgba(255,255,255,.16) !important; }
html[data-bs-theme="dark"] .bg-gray-600 { background-color: #3d4d58 !important; }
html[data-bs-theme="dark"] .char-btn { border-color: rgba(255,255,255,.22) !important; color: #dce8ef; }
html[data-bs-theme="dark"] .char-btn:hover { border-color: var(--brand-1) !important; }
html[data-bs-theme="dark"] .char-btn.selected { background: var(--grad) !important; color: #fff !important; border-color: var(--brand-2) !important; }
html[data-bs-theme="dark"] input[type="range"] { accent-color: var(--brand-2) !important; }

/* ---------- 17. Bootstrap 语义色在夜晚下轻微提亮 ---------- */
html[data-bs-theme="dark"] .btn-danger,
html[data-bs-theme="dark"] .btn-del-master,
html[data-bs-theme="dark"] .btn-cancel,
html[data-bs-theme="dark"] .danger-box .btn-primary { filter: brightness(1.06); }
html[data-bs-theme="dark"] .bg-primary { background-color: #14505f !important; }
html[data-bs-theme="dark"] .bg-success { background-color: #1c7a52 !important; }
html[data-bs-theme="dark"] .bg-danger { background-color: #a5382c !important; }
html[data-bs-theme="dark"] .bg-info { background-color: #45b9cf !important; }
html[data-bs-theme="dark"] .card-header.bg-primary { background: var(--grad) !important; }
html[data-bs-theme="dark"] .modal-header.bg-danger { background: linear-gradient(120deg, #8f2f26, #a5382c) !important; }

/* ---------- 18. 主题切换按钮（theme-night.js 注入） ---------- */
.rn-theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; flex: none;
  border-radius: 999px; cursor: pointer;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.24);
  color: #fff; font-size: 16px;
  transition: background .18s ease, transform .18s ease, color .18s ease;
  margin-left: 10px; padding: 0; line-height: 1;
}
.rn-theme-toggle:hover { background: rgba(255,255,255,.22); transform: translateY(-1px); color: #ffe9a8; }
.rn-theme-toggle:active { transform: translateY(0); }
.rn-theme-toggle:focus-visible { outline: 2px solid #4fe0b0; outline-offset: 2px; }
.rn-theme-toggle .bi { pointer-events: none; }

/* 登录页浮动切换按钮 */
.rn-theme-fab {
  position: fixed; top: 18px; right: 18px; z-index: 1200;
  width: 42px; height: 42px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(12,24,32,.72); color: #ffe9a8;
  border: 1px solid rgba(255,255,255,.22);
  box-shadow: 0 6px 20px rgba(0,0,0,.45);
  cursor: pointer; font-size: 18px; padding: 0;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: background .18s ease, transform .18s ease;
}
.rn-theme-fab:hover { background: rgba(12,24,32,.9); transform: translateY(-2px); }

/* 切换时平滑过渡（仅在用户手动切换的那一次启用，避免首屏闪动） */
html.rn-theme-anim, html.rn-theme-anim body,
html.rn-theme-anim .content-card, html.rn-theme-anim .card,
html.rn-theme-anim .form-control, html.rn-theme-anim .form-select,
html.rn-theme-anim .table tbody tr, html.rn-theme-anim .top-header {
  transition: background-color .25s ease, color .25s ease, border-color .25s ease, box-shadow .25s ease;
}

/* 尊重用户系统的深色偏好：未手动选择过主题时，由 JS 自动置 dark，此处仅补充图片亮度 */
html[data-bs-theme="dark"] img.bg-preview,
html[data-bs-theme="dark"] .bg-fallback { filter: brightness(.55) saturate(.9); }

/* 打印时强制回到浅色，避免夜间模式影响导出预览 */
@media print {
  html[data-bs-theme="dark"] body { background: #fff !important; color: #000 !important; }
  html[data-bs-theme="dark"] body::before { display: none !important; }
}