/* ============================================================
   服务中心管理系统 — 5 套可选配色主题
   默认: A(经典蓝) | B(暖阳橙) C(晴空蓝) D(新芽绿) E(暗夜黑金)
   切换: <html data-theme="A|B|C|D|E"> + <html data-bs-theme="light|dark">
   ── 本文件同时桥接自定义 --theme-* 与 Bootstrap 5.3 --bs-*
      变量，确保主题切换覆盖全站（含所有 iframe 子页面/小模块）。
   ============================================================ */

/* ─── 基础变量（被各主题覆盖） ─── */
:root {
    color-scheme: light;
    /* 自定义主题变量 */
    --theme-sidebar-bg:         #fff;
    --theme-sidebar-hover:      #F5F5F5;
    --theme-sidebar-active-bg:  #E6F7FF;
    --theme-sidebar-active-txt: #1890FF;
    --theme-sidebar-border:     #F0F0F0;
    --theme-navbar-bg:          #fff;
    --theme-navbar-text:        #262626;
    --theme-navbar-shadow:      0 2px 8px rgba(0,0,0,0.08);
    --theme-body-bg:            #F0F2F5;
    --theme-card-bg:            #fff;
    --theme-card-shadow:        0 2px 8px rgba(0,0,0,0.06);
    --theme-stat-bg:            #fff;
    --theme-stat-shadow:        0 1px 4px rgba(0,0,0,0.05);
    --theme-table-header-bg:    #FAFAFA;
    --theme-table-border:       #F0F0F0;
    --theme-table-hover:        #FAFAFA;
    --theme-badge-default-bg:   #F5F5F5;
    --theme-badge-default-txt:  #595959;
    --theme-input-bg:           #fff;
    --theme-input-border:       #D9D9D9;
    --theme-dropdown-bg:        #fff;
    --theme-primary:            #1890FF;
    --theme-primary-dark:       #096DD9;
    --theme-primary-shadow:     rgba(24,144,255,0.3);
    --theme-text-primary:       #262626;
    --theme-text-secondary:     #8C8C8C;
    --theme-section-color:      #8C8C8C;
    --theme-brand-text:         #262626;
    --theme-border:             #F0F0F0;

    /* Bootstrap 5.3 桥接（让所有 BS 组件跟随主题） */
    --bs-body-bg:               #F0F2F5;
    --bs-body-color:            #262626;
    --bs-emphasis-color:        #262626;
    --bs-secondary-color:       rgba(0,0,0,.55);
    --bs-border-color:          #F0F0F0;
    --bs-border-color-translucent: rgba(0,0,0,.125);
    --bs-secondary-bg:          #FAFAFA;
    --bs-tertiary-bg:           #F0F2F5;
    --bs-primary:               #1890FF;
    --bs-primary-rgb:           24,144,255;
    --bs-primary-text-emphasis: #096DD9;
    --bs-primary-bg-subtle:     #E6F7FF;
    --bs-link-color:            #1890FF;
    --bs-link-hover-color:      #096DD9;
    --bs-success:               #52C41A; --bs-success-rgb: 82,196,26;
    --bs-danger:                #FF4D4F; --bs-danger-rgb: 255,77,79;
    --bs-warning:               #FAAD14; --bs-warning-rgb: 250,173,20;
    --bs-info:                  #1890FF; --bs-info-rgb: 24,144,255;
}

/* ─── 硬覆盖：CSS变量应用到各元素 ─── */
body { background: var(--theme-body-bg); color: var(--theme-text-primary); }

.navbar-top {
    background: var(--theme-navbar-bg);
    box-shadow: var(--theme-navbar-shadow);
}
.navbar-brand-custom { color: var(--theme-navbar-text); }

.sidebar { background: var(--theme-sidebar-bg); }
.sidebar-item { color: var(--theme-text-primary); }
.sidebar-item:hover { background: var(--theme-sidebar-hover); color: var(--theme-primary); }
.sidebar-item.active {
    background: var(--theme-sidebar-active-bg);
    color: var(--theme-sidebar-active-txt);
    border-left-color: var(--theme-primary);
}
.sidebar-section { color: var(--theme-section-color); }
.sidebar-brand { border-bottom-color: var(--theme-sidebar-border); }
.sidebar-brand span { color: var(--theme-brand-text); }

.card-v1 { background: var(--theme-card-bg); box-shadow: var(--theme-card-shadow); }
.card-v1 .card-header-v1 {
    background: var(--theme-card-bg);
    border-bottom-color: var(--theme-sidebar-border);
}
.stat-card { background: var(--theme-stat-bg); box-shadow: var(--theme-stat-shadow); }
.stat-card .stat-number { color: var(--theme-text-primary); }
.stat-card .stat-label  { color: var(--theme-text-secondary); }

.table-v1 { background: var(--theme-card-bg); }
.table-v1 thead th {
    background: var(--theme-table-header-bg);
    border-bottom-color: var(--theme-table-border);
    color: var(--theme-text-secondary);
}
.table-v1 tbody td {
    border-bottom-color: var(--theme-sidebar-border);
    color: var(--theme-text-primary);
}
.table-v1 tbody tr:hover { background: var(--theme-table-hover); }

.badge-default { background: var(--theme-badge-default-bg); color: var(--theme-badge-default-txt); }
.btn-primary-v1 { background: var(--theme-primary); }
.btn-primary-v1:hover {
    background: var(--theme-primary-dark);
    box-shadow: 0 4px 12px var(--theme-primary-shadow);
}
.navbar-brand-custom i { color: var(--theme-primary); }
.navbar-actions .btn-icon { color: var(--theme-text-secondary); }
.navbar-actions .btn-icon:hover { background: var(--theme-body-bg); color: var(--theme-text-primary); }
.info-row .info-label { color: var(--theme-text-secondary); }
.info-row .info-value { color: var(--theme-text-primary); }
.form-control, .form-select {
    background: var(--theme-input-bg);
    border-color: var(--theme-input-border);
    color: var(--theme-text-primary);
}
.dropdown-menu { background: var(--theme-dropdown-bg); }


/* ══════════════════════════════════════════════════════
   THEME A — 经典蓝（默认，:root 已定义）
   ══════════════════════════════════════════════════════ */


/* ══════════════════════════════════════════════════════
   THEME B — 暖阳（橙暖 + 奶油白）
   ══════════════════════════════════════════════════════ */
[data-theme="B"] {
    color-scheme: light;
    --theme-sidebar-bg:         #FFFAF0;
    --theme-sidebar-hover:      #FFF3D6;
    --theme-sidebar-active-bg:  #FFE7BA;
    --theme-sidebar-active-txt: #D46B08;
    --theme-sidebar-border:     #FFE0B2;
    --theme-navbar-bg:          #FFF7E6;
    --theme-navbar-text:        #5C3D1A;
    --theme-navbar-shadow:      0 2px 8px rgba(250,140,22,0.12);
    --theme-body-bg:            #FFFBE8;
    --theme-card-bg:            #FFFEFA;
    --theme-card-shadow:        0 2px 8px rgba(250,140,22,0.06);
    --theme-stat-bg:            #FFFEFA;
    --theme-stat-shadow:        0 1px 4px rgba(250,140,22,0.05);
    --theme-table-header-bg:    #FFF4E0;
    --theme-table-border:       #FFE0B2;
    --theme-table-hover:        #FFF8EC;
    --theme-badge-default-bg:   #FFF4E0;
    --theme-badge-default-txt:  #AD6800;
    --theme-input-bg:           #FFFEFA;
    --theme-input-border:       #FFD591;
    --theme-dropdown-bg:        #FFFEFA;
    --theme-primary:            #FA8C16;
    --theme-primary-dark:       #D46B08;
    --theme-primary-shadow:     rgba(250,140,22,0.3);
    --theme-text-primary:       #5C3D1A;
    --theme-text-secondary:     #AD8B5A;
    --theme-section-color:      #AD8B5A;
    --theme-brand-text:         #5C3D1A;
    --theme-border:             #FFE0B2;

    --bs-body-bg:               #FFFBE8;
    --bs-body-color:            #5C3D1A;
    --bs-emphasis-color:        #5C3D1A;
    --bs-secondary-color:       rgba(92,61,26,.55);
    --bs-border-color:          #FFE0B2;
    --bs-border-color-translucent: rgba(212,107,8,.15);
    --bs-secondary-bg:          #FFF4E0;
    --bs-tertiary-bg:           #FFFBE8;
    --bs-primary:               #FA8C16;
    --bs-primary-rgb:           250,140,22;
    --bs-primary-text-emphasis: #D46B08;
    --bs-primary-bg-subtle:     #FFE7BA;
    --bs-link-color:            #D46B08;
    --bs-link-hover-color:      #AD6800;
}


/* ══════════════════════════════════════════════════════
   THEME C — 晴空（亮蓝渐变 + 淡蓝底）
   ══════════════════════════════════════════════════════ */
[data-theme="C"] {
    color-scheme: light;
    --theme-sidebar-bg:         #F0F9FF;
    --theme-sidebar-hover:      #E6F7FF;
    --theme-sidebar-active-bg:  #BAE7FF;
    --theme-sidebar-active-txt: #0050B3;
    --theme-sidebar-border:     #BAE7FF;
    --theme-navbar-bg:          linear-gradient(135deg, #1890FF 0%, #36CFC9 100%);
    --theme-navbar-text:        #fff;
    --theme-navbar-shadow:      0 2px 12px rgba(24,144,255,0.2);
    --theme-body-bg:            #F5FAFF;
    --theme-card-bg:            #fff;
    --theme-card-shadow:        0 2px 8px rgba(24,144,255,0.05);
    --theme-stat-bg:            #fff;
    --theme-stat-shadow:        0 1px 4px rgba(24,144,255,0.04);
    --theme-table-header-bg:    #F0F9FF;
    --theme-table-border:       #E6F7FF;
    --theme-table-hover:        #F5FAFF;
    --theme-badge-default-bg:   #F0F9FF;
    --theme-badge-default-txt:  #0050B3;
    --theme-input-bg:           #fff;
    --theme-input-border:       #BAE7FF;
    --theme-dropdown-bg:        #fff;
    --theme-primary:            #1890FF;
    --theme-primary-dark:       #0050B3;
    --theme-primary-shadow:     rgba(24,144,255,0.35);
    --theme-text-primary:       #003A8C;
    --theme-text-secondary:     #7BAED7;
    --theme-section-color:      #7BAED7;
    --theme-brand-text:         #fff;
    --theme-border:             #E6F7FF;

    --bs-body-bg:               #F5FAFF;
    --bs-body-color:            #003A8C;
    --bs-emphasis-color:        #003A8C;
    --bs-secondary-color:       rgba(0,80,179,.55);
    --bs-border-color:          #E6F7FF;
    --bs-border-color-translucent: rgba(24,144,255,.15);
    --bs-secondary-bg:          #F0F9FF;
    --bs-tertiary-bg:           #F5FAFF;
    --bs-primary:               #1890FF;
    --bs-primary-rgb:           24,144,255;
    --bs-primary-text-emphasis: #0050B3;
    --bs-primary-bg-subtle:     #BAE7FF;
    --bs-link-color:            #1890FF;
    --bs-link-hover-color:      #0050B3;
}
/* Theme C 特殊处理：渐变顶栏下的按钮和文字 */
[data-theme="C"] .navbar-actions .btn-icon { color: rgba(255,255,255,0.8); }
[data-theme="C"] .navbar-actions .btn-icon:hover { background: rgba(255,255,255,0.15); color: #fff; }
[data-theme="C"] .theme-switch-btn { color: rgba(255,255,255,0.8); border-color: rgba(255,255,255,0.3); }
[data-theme="C"] .theme-switch-btn:hover { background: rgba(255,255,255,0.15); color: #fff; border-color: rgba(255,255,255,0.6); }


/* ══════════════════════════════════════════════════════
   THEME D — 新芽（浅绿 + 自然感）
   ══════════════════════════════════════════════════════ */
[data-theme="D"] {
    color-scheme: light;
    --theme-sidebar-bg:         #F6FFED;
    --theme-sidebar-hover:      #EEFFD6;
    --theme-sidebar-active-bg:  #D9F7BE;
    --theme-sidebar-active-txt: #389E0D;
    --theme-sidebar-border:     #D9F7BE;
    --theme-navbar-bg:          #fff;
    --theme-navbar-text:        #135200;
    --theme-navbar-shadow:      0 2px 8px rgba(82,196,26,0.12);
    --theme-body-bg:            #F9FFF5;
    --theme-card-bg:            #fff;
    --theme-card-shadow:        0 2px 8px rgba(82,196,26,0.05);
    --theme-stat-bg:            #fff;
    --theme-stat-shadow:        0 1px 4px rgba(82,196,26,0.04);
    --theme-table-header-bg:    #F6FFED;
    --theme-table-border:       #D9F7BE;
    --theme-table-hover:        #F9FFF5;
    --theme-badge-default-bg:   #F6FFED;
    --theme-badge-default-txt:  #237804;
    --theme-input-bg:           #fff;
    --theme-input-border:       #B7EB8F;
    --theme-dropdown-bg:        #fff;
    --theme-primary:            #52C41A;
    --theme-primary-dark:       #389E0D;
    --theme-primary-shadow:     rgba(82,196,26,0.3);
    --theme-text-primary:       #237804;
    --theme-text-secondary:     #8DBF6B;
    --theme-section-color:      #8DBF6B;
    --theme-brand-text:         #135200;
    --theme-border:             #D9F7BE;

    --bs-body-bg:               #F9FFF5;
    --bs-body-color:            #237804;
    --bs-emphasis-color:        #237804;
    --bs-secondary-color:       rgba(35,120,4,.55);
    --bs-border-color:          #D9F7BE;
    --bs-border-color-translucent: rgba(82,196,26,.15);
    --bs-secondary-bg:          #F6FFED;
    --bs-tertiary-bg:           #F9FFF5;
    --bs-primary:               #52C41A;
    --bs-primary-rgb:           82,196,26;
    --bs-primary-text-emphasis: #389E0D;
    --bs-primary-bg-subtle:     #D9F7BE;
    --bs-link-color:            #52C41A;
    --bs-link-hover-color:      #389E0D;
}


/* ══════════════════════════════════════════════════════
   THEME E — 暗夜（深色黑金，护眼专业）
   ══════════════════════════════════════════════════════ */
[data-theme="E"] {
    color-scheme: dark;
    --theme-sidebar-bg:         #1A1D23;
    --theme-sidebar-hover:      #2A2D35;
    --theme-sidebar-active-bg:  #3A3D45;
    --theme-sidebar-active-txt: #FAAD14;
    --theme-sidebar-border:     #2A2D35;
    --theme-navbar-bg:          #1F2229;
    --theme-navbar-text:        #E0E0E0;
    --theme-navbar-shadow:      0 2px 8px rgba(0,0,0,0.3);
    --theme-body-bg:            #14161A;
    --theme-card-bg:            #1F2229;
    --theme-card-shadow:        0 2px 8px rgba(0,0,0,0.2);
    --theme-stat-bg:            #1F2229;
    --theme-stat-shadow:        0 1px 4px rgba(0,0,0,0.15);
    --theme-table-header-bg:    #2A2D35;
    --theme-table-border:       #3A3D45;
    --theme-table-hover:        #252830;
    --theme-badge-default-bg:   #3A3D45;
    --theme-badge-default-txt:  #B0B0B0;
    --theme-input-bg:           #2A2D35;
    --theme-input-border:       #4A4D55;
    --theme-dropdown-bg:        #1F2229;
    --theme-primary:            #FAAD14;
    --theme-primary-dark:       #D48806;
    --theme-primary-shadow:     rgba(250,173,20,0.25);
    --theme-text-primary:       #D0D0D0;
    --theme-text-secondary:     #8A8A8A;
    --theme-section-color:      #8A8A8A;
    --theme-brand-text:         #E0E0E0;
    --theme-border:             #3A3D45;

    --bs-body-bg:               #14161A;
    --bs-body-color:            #D0D0D0;
    --bs-emphasis-color:        #F0F0F0;
    --bs-secondary-color:       rgba(208,208,208,.65);
    --bs-border-color:          #3A3D45;
    --bs-border-color-translucent: rgba(255,255,255,.12);
    --bs-secondary-bg:          #2A2D35;
    --bs-tertiary-bg:           #1F2229;
    --bs-primary:               #FAAD14;
    --bs-primary-rgb:           250,173,20;
    --bs-primary-text-emphasis: #FFD666;
    --bs-primary-bg-subtle:     #3A2E14;
    --bs-link-color:            #FAAD14;
    --bs-link-hover-color:      #FFD666;
    --bs-success:               #73D13D; --bs-success-rgb: 115,209,61;
    --bs-danger:                #FF7875; --bs-danger-rgb: 255,120,117;
    --bs-warning:               #FFC069; --bs-warning-rgb: 255,192,105;
    --bs-info:                  #69C0FF; --bs-info-rgb: 105,192,255;
}
/* Theme E 特殊处理：深色主题下的卡头、表格、表单、菜单、徽标 */
[data-theme="E"] .card-v1 .card-header-v1 { border-bottom-color: var(--theme-table-border); color: var(--theme-text-primary); }
[data-theme="E"] .table-v1 thead th { color: #B0B0B0; }
[data-theme="E"] .table-v1 tbody td { color: #C0C0C0; }
[data-theme="E"] .form-control, [data-theme="E"] .form-select { color: #D0D0D0; }
[data-theme="E"] .dropdown-menu { background: #2A2D35; border: 1px solid #3A3D45; }
[data-theme="E"] .dropdown-item { color: #D0D0D0; }
[data-theme="E"] .dropdown-item:hover { background: #3A3D45; color: #FAAD14; }
[data-theme="E"] .navbar-actions .btn-icon { color: #8A8A8A; }
[data-theme="E"] .navbar-actions .btn-icon:hover { background: #2A2D35; color: #E0E0E0; }
[data-theme="E"] .theme-switch-btn { color: #8A8A8A; border-color: #3A3D45; }
[data-theme="E"] .theme-switch-btn:hover { background: #2A2D35; color: #FAAD14; border-color: #4A4D55; }
[data-theme="E"] .sidebar-brand span { color: #E0E0E0; }
[data-theme="E"] .badge-success { background: #1B3A1B; color: #73D13D; }
[data-theme="E"] .badge-warning { background: #3A2E14; color: #FFC069; }
[data-theme="E"] .badge-danger  { background: #3A1A1A; color: #FF7875; }
[data-theme="E"] .badge-info    { background: #1A2E3A; color: #69C0FF; }

/* Bootstrap 深色变量补全（data-bs-theme=dark 时让表格/卡片/边框彻底转深色） */
[data-bs-theme="dark"] .table { --bs-table-bg: var(--theme-card-bg); --bs-table-color: var(--theme-text-primary); }
[data-bs-theme="dark"] .card { background-color: var(--theme-card-bg); color: var(--theme-text-primary); }
[data-bs-theme="dark"] .modal-content { background-color: var(--theme-card-bg); color: var(--theme-text-primary); }
[data-bs-theme="dark"] .offcanvas { background-color: var(--theme-card-bg); color: var(--theme-text-primary); }
