/* ============================================================
   SanS 三石记账 — Design System v3.0
   极简商务 · 科技深空
   ============================================================ */

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    overflow-x: hidden;
    font-size: 0.9rem;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
/* 按钮统一字体：Windows 11 Chrome 默认用 Segoe UI Variable（可变字体，字宽与 Edge/普通 Segoe UI 不同）。
   这里强制指定普通 Segoe UI + 固定行高，避免 Edge/Chrome 按钮大小/间距渲染差异 */
.btn {
    font-family: "Segoe UI", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
    font-feature-settings: normal;
    font-variant-ligatures: none;
    line-height: 1.428571429;  /* Bootstrap 默认值，强制一致 */
}
    -moz-osx-font-smoothing: grayscale;
}

html { overflow-x: hidden; }

/* ============================================================
   DESIGN TOKENS v3 — 极简商务 + 深空侧栏
   ============================================================ */

/* ── 日间模式 ── */
:root {
    /* 背景层 — 极简浅灰 */
    --bg-body: #f7f8fa;
    --bg-card: rgba(255, 255, 255, 0.82);
    --bg-sidebar: rgba(255, 255, 255, 0.96);
    --bg-navbar: rgba(255, 255, 255, 0.97);
    --bg-glass: rgba(255, 255, 255, 0.65);
    --bg-glass-hover: rgba(255, 255, 255, 0.9);

    /* 文字层 — 深炭 + 暖灰 */
    --text-main: #111827;
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    --text-on-accent: #ffffff;

    /* 边框 — 极轻量化 */
    --border-light: rgba(17, 24, 39, 0.06);
    --border-medium: rgba(17, 24, 39, 0.12);
    --border-strong: rgba(17, 24, 39, 0.22);

    /* 主色调 — 松石绿（科技感+人文温度） */
    --accent: #0d9488;
    --accent-hover: #0f766e;
    --accent-subtle: rgba(13, 148, 136, 0.08);
    --accent-subtle-hover: rgba(13, 148, 136, 0.15);

    /* 功能色 */
    --color-income: #059669;
    --color-expense: #dc2626;
    --color-warning: #d97706;

    /* 阴影 — 轻盈多层 */
    --shadow-sm: 0 1px 3px rgba(17, 24, 39, 0.06), 0 1px 2px rgba(17, 24, 39, 0.04);
    --shadow-md: 0 4px 12px rgba(17, 24, 39, 0.08), 0 2px 4px rgba(17, 24, 39, 0.04);
    --shadow-lg: 0 8px 28px rgba(17, 24, 39, 0.1), 0 3px 8px rgba(17, 24, 39, 0.06);
    --shadow-glass: 0 4px 20px rgba(17, 24, 39, 0.07), 0 1px 3px rgba(17, 24, 39, 0.04);
    --shadow-glass-hover: 0 10px 36px rgba(17, 24, 39, 0.12), 0 3px 8px rgba(17, 24, 39, 0.06);

    /* 侧边栏 — 浅灰商务（与内容区协调，简约统一） */
    --sidebar-bg: #f1f5f9;
    --sidebar-bg-hover: rgba(241, 245, 249, 0.9);
    --sidebar-bg-active: rgba(13, 148, 136, 0.12);
    --sidebar-border: rgba(17, 24, 39, 0.08);
    --sidebar-text: #4b5563;
    --sidebar-text-active: #0d9488;
    --sidebar-hover-bg: rgba(13, 148, 136, 0.06);
    --sidebar-active-bg: rgba(13, 148, 136, 0.1);
    --sidebar-active-border: #0d9488;
    --sidebar-icon: #94a3b8;
    --sidebar-icon-active: #0d9488;
    --sidebar-section: rgba(75, 85, 99, 0.45);

    /* Bootstrap 变量 */
    --bs-body-bg: var(--bg-body);
    --bs-body-color: var(--text-primary);
    --bs-border-color: var(--border-light);
    --bs-link-color: var(--accent);
    --bs-link-hover-color: var(--accent-hover);
    --bs-secondary-color: var(--text-secondary);
    --bs-secondary-bg: var(--bg-body);
    --bs-tertiary-bg: var(--bg-body);
    --bs-heading-color: var(--text-primary);
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-primary);
    --bs-table-striped-bg: rgba(17, 24, 39, 0.03);
    --bs-table-striped-color: var(--text-primary);
    --bs-emphasis-color: var(--text-primary);
    --bs-emphasis-subtle-color: var(--text-secondary);
}

/* ── 暗黑模式 ── */
body.theme-dark {
    --bg-body: #0b0f1a;
    --bg-card: rgba(15, 23, 42, 0.75);
    --bg-sidebar: rgba(10, 14, 26, 0.98);
    --bg-navbar: rgba(10, 14, 26, 0.97);
    --bg-glass: rgba(20, 30, 55, 0.65);
    --bg-glass-hover: rgba(25, 35, 60, 0.88);

    --text-main: #e2e8f0;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #94a3b8;
    --text-on-accent: #ffffff;

    --border-light: rgba(148, 163, 184, 0.08);
    --border-medium: rgba(148, 163, 184, 0.16);
    --border-strong: rgba(148, 163, 184, 0.28);

    --accent: #2dd4bf;
    --accent-hover: #5eead4;
    --accent-subtle: rgba(45, 212, 191, 0.1);
    --accent-subtle-hover: rgba(45, 212, 191, 0.2);

    --color-income: #34d399;
    --color-expense: #f87171;
    --color-warning: #fbbf24;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 28px rgba(0, 0, 0, 0.5);
    --shadow-glass: 0 4px 20px rgba(0, 0, 0, 0.35);
    --shadow-glass-hover: 0 10px 36px rgba(0, 0, 0, 0.5);

    --sidebar-bg: #060a14;
    --sidebar-bg-hover: rgba(20, 28, 50, 0.8);
    --sidebar-bg-active: rgba(13, 148, 136, 0.12);
    --sidebar-border: rgba(51, 65, 85, 0.5);
    --sidebar-text: #64748b;
    --sidebar-text-active: #f1f5f9;
    --sidebar-hover-bg: rgba(255, 255, 255, 0.05);
    --sidebar-active-bg: rgba(45, 212, 191, 0.12);
    --sidebar-active-border: #2dd4bf;
    --sidebar-icon: #475569;
    --sidebar-icon-active: #2dd4bf;
    --sidebar-section: rgba(71, 85, 105, 0.6);
}

/* ── 全局文字颜色映射 ── */
body { color: var(--text-primary); }
.text-primary   { color: var(--text-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted     { color: var(--text-muted) !important; }

/* 暗色模式：Bootstrap 的 .text-success/.text-danger 默认深绿(#198754)/深红(#dc3545)，
   在深色卡片背景上对比度极低几乎看不见。改用主题亮色变量（income/expense 暗色下为浅绿/浅红） */
body.theme-dark .text-success { color: var(--color-income) !important; }
body.theme-dark .text-danger  { color: var(--color-expense) !important; }

/* 暗色模式全局兜底：内联样式里硬编码的“深色文字”在暗色下自动切换为浅色文字。
   命中规则后统一落到主题文字变量：浅色主题≈原深色，暗色主题自动变浅色，保证可读性。 */
body.theme-dark [style*="color:#111827"],
body.theme-dark [style*="color: #111827"],
body.theme-dark [style*="color:#0f172a"],
body.theme-dark [style*="color: #0f172a"],
body.theme-dark [style*="color:#212529"],
body.theme-dark [style*="color: #212529"],
body.theme-dark [style*="color:#1e293b"],
body.theme-dark [style*="color: #1e293b"],
body.theme-dark [style*="color:#1f2937"],
body.theme-dark [style*="color: #1f2937"],
body.theme-dark [style*="color:#18181b"],
body.theme-dark [style*="color: #18181b"],
body.theme-dark [style*="color:#0d0d0d"],
body.theme-dark [style*="color: #0d0d0d"],
body.theme-dark [style*="color:#343a40"],
body.theme-dark [style*="color: #343a40"],
body.theme-dark [style*="color:#212121"],
body.theme-dark [style*="color: #212121"],
body.theme-dark [style*="color:#263238"],
body.theme-dark [style*="color: #263238"],
body.theme-dark [style*="color:#333333"],
body.theme-dark [style*="color: #333333"],
body.theme-dark [style*="color:#333"],
body.theme-dark [style*="color: #333"],
body.theme-dark [style*="color:#000000"],
body.theme-dark [style*="color: #000000"],
body.theme-dark [style*="color:#000"],
body.theme-dark [style*="color: #000"],
body.theme-dark [style*="color:black"],
body.theme-dark [style*="color: black"] {
    color: var(--text-primary) !important;
}
body.theme-dark [style*="color:#374151"],
body.theme-dark [style*="color: #374151"],
body.theme-dark [style*="color:#495057"],
body.theme-dark [style*="color: #495057"],
body.theme-dark [style*="color:#444444"],
body.theme-dark [style*="color: #444444"],
body.theme-dark [style*="color:#666666"],
body.theme-dark [style*="color: #666666"] {
    color: var(--text-secondary) !important;
}
body.theme-dark [style*="color:#334155"],
body.theme-dark [style*="color: #334155"],
body.theme-dark [style*="color:#475569"],
body.theme-dark [style*="color: #475569"],
body.theme-dark [style*="color:#4b5563"],
body.theme-dark [style*="color: #4b5563"],
body.theme-dark [style*="color:#6b7280"],
body.theme-dark [style*="color: #6b7280"],
body.theme-dark [style*="color:#64748b"],
body.theme-dark [style*="color: #64748b"] {
    color: var(--text-secondary) !important;
}
/* Bootstrap 工具类里的“深色文字”同样切换 */
body.theme-dark .text-dark,
body.theme-dark .text-body,
body.theme-dark .text-body-secondary { color: var(--text-primary) !important; }

/* ── 背景：极简微光（极克制） ── */
body.theme-light {
    background: var(--bg-body) !important;
}

body.theme-dark {
    background: var(--bg-body) !important;
}

/* ============================================================
   侧边栏 — 深空科技风格
   ============================================================ */
.sidebar {
    background-color: var(--sidebar-bg) !important;
    border-right: 1px solid var(--sidebar-border) !important;
    transition: width 0.25s ease;
    overflow-y: auto;
    overflow-x: hidden;
    width: 220px;
}

/* 深空顶部 Logo 区 */
.sidebar-header {
    background: transparent;
    color: var(--text-primary);
    padding: 18px 16px 14px !important;
    border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-header .fw-bold {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);  /* 跟随主题：light 深色、dark 浅色 */
    letter-spacing: 0.3px;
}

.sidebar-header svg {
    width: 100%;
    height: 100%;
}

.sidebar-menu {
    padding: 6px 0 12px;
}

/* ── 菜单项 — 深空配色 ── */
.sidebar-menu .list-group-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 7px 14px !important;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: 0 !important;
    border: none !important;
    transition: background 0.15s ease, color 0.15s ease;
    position: relative;
    font-size: 0.875rem;
    font-weight: 400;
    background: transparent !important;
}

.sidebar-menu .list-group-item:hover {
    background-color: var(--sidebar-hover-bg) !important;
    color: var(--sidebar-text-active);
}

.sidebar-menu .list-group-item.active,
.sidebar-menu .list-group-item.router-active {
    background-color: var(--sidebar-active-bg) !important;
    color: var(--sidebar-text-active);
    font-weight: 500;
}

.sidebar-menu .list-group-item.active::before,
.sidebar-menu .list-group-item.router-active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 5px;
    bottom: 5px;
    width: 2.5px;
    background: var(--sidebar-active-border);
    border-radius: 0 2px 2px 0;
}

/* ── 菜单图标 ── */
.menu-icon {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    stroke-width: 2;
    color: var(--sidebar-icon);
    transition: color 0.15s ease;
}

.sidebar-menu .list-group-item:hover .menu-icon {
    color: var(--sidebar-icon-active);
}

.sidebar-menu .list-group-item.active .menu-icon,
.sidebar-menu .list-group-item.router-active .menu-icon {
    color: var(--sidebar-icon-active);
}

/* ── 分组标题 ── */
.sidebar-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px 5px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--sidebar-section);
    cursor: pointer;
    user-select: none;
    transition: color 0.15s ease;
    border-top: 1px solid var(--sidebar-border);
    margin-top: 8px;
    text-transform: uppercase;
}

.sidebar-section-header:first-child {
    border-top: none;
    margin-top: 0;
}

.sidebar-section-header:hover {
    color: var(--sidebar-text);
}

/* ── 侧栏底部版权文字（日间/夜间深空侧栏下均可见） ── */
.sidebar .text-muted {
    color: #e2e8f0 !important;
}

.sidebar .mt-auto .small {
    color: #cbd5e1 !important;
}

.sidebar .border-top {
    border-color: var(--sidebar-border) !important;
}

.section-arrow {
    font-size: 0.6rem;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.5;
}

.sidebar-section-header:hover .section-arrow {
    opacity: 1;
}

/* ── 底部版本信息 ── */
.sidebar > .mt-auto {
    border-top: 1px solid var(--sidebar-border) !important;
    background-color: rgba(0, 0, 0, 0.2);
    padding: 10px 16px !important;
    font-size: 0.72rem;
}

/* ============================================================
   悬浮子菜单
   ============================================================ */
.sidebar-flyout-trigger {
    position: relative;
}

.sidebar-flyout-trigger > .sidebar-section-header {
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 400;
    letter-spacing: normal;
    color: var(--sidebar-text);
    padding: 9px 16px;
    border-top: none;
    margin-top: 0;
    text-transform: none;
}

.sidebar-flyout-trigger > .sidebar-section-header .section-arrow {
    transition: transform 0.2s ease;
    font-size: 0.6rem;
    opacity: 0.6;
}

.sidebar-flyout-trigger:hover > .sidebar-section-header {
    background-color: var(--sidebar-hover-bg);
    color: var(--sidebar-text-active);
}

.sidebar-flyout-trigger:hover > .sidebar-section-header .section-arrow {
    opacity: 1;
}

.sidebar-flyout {
    display: none;
    position: fixed;
    min-width: 196px;
    /* 日间：跟随侧栏深空背景；暗黑：更深墨蓝 */
    background: var(--sidebar-bg);
    border: 1px solid var(--sidebar-border);
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 99999;
    padding: 6px 0;
}

body.theme-light .sidebar-flyout {
    background: #f8fafc;
    border-color: rgba(17, 24, 39, 0.1);
    box-shadow: 0 12px 40px rgba(17, 24, 39, 0.12), 0 4px 12px rgba(17, 24, 39, 0.06);
}

body.theme-dark .sidebar-flyout {
    background: #060a14;
    border-color: rgba(51, 65, 85, 0.5);
}

.sidebar-flyout .flyout-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.875rem;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease;
    border-left: 2.5px solid transparent;
}

.sidebar-flyout .flyout-item:hover {
    background: var(--sidebar-hover-bg);
    color: var(--sidebar-text-active);
    border-left-color: var(--sidebar-active-border);
}

.sidebar-flyout .flyout-item.active,
.sidebar-flyout .flyout-item.router-active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-text-active);
    font-weight: 500;
    border-left-color: var(--sidebar-active-border);
}

.sidebar-flyout .flyout-item .menu-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--sidebar-icon);
}

.sidebar-flyout .flyout-item:hover .menu-icon,
.sidebar-flyout .flyout-item.active .menu-icon {
    color: var(--sidebar-icon-active);
}

/* ============================================================
   通用组件 — 暗黑模式全面覆盖
   ============================================================ */
body.theme-dark .text-muted,
body.theme-dark .form-text {
    color: var(--text-muted) !important;
}

body.theme-dark .bg-white,
body.theme-dark .bg-light {
    background-color: var(--bg-body) !important;
}

body.theme-dark .navbar.bg-white,
body.theme-dark .navbar {
    background-color: var(--bg-navbar) !important;
    border-bottom: 1px solid var(--border-light) !important;
}

body.theme-dark .card,
body.theme-dark .card-body,
body.theme-dark .card-footer,
body.theme-dark .card-header {
    background-color: var(--bg-card) !important;
    border-color: var(--border-medium) !important;
}

body.theme-dark .border-0 {
    border-color: transparent !important;
}

body.theme-dark .text-dark,
body.theme-dark .text-body,
body.theme-dark .text-body-secondary,
body.theme-dark .text-secondary {
    color: var(--text-primary) !important;
}

/* 表格 — 暗黑模式完整覆盖 */
body.theme-dark .table {
    color: var(--text-primary);
    --bs-table-bg: transparent;
    --bs-table-accent-bg: transparent;
    --bs-table-hover-bg: rgba(45, 212, 191, 0.06);
    --bs-table-border-color: var(--border-medium);
}

body.theme-dark .table thead,
body.theme-dark .table-light {
    background-color: rgba(15, 23, 42, 0.6) !important;
}

body.theme-dark .table thead th,
body.theme-dark .table-light th {
    color: var(--text-secondary) !important;
    border-bottom-color: var(--border-medium) !important;
    background-color: rgba(15, 23, 42, 0.5) !important;
}

/* 表格行/单元格 — 防止白底穿透 */
body.theme-dark .table > tbody > tr,
body.theme-dark .table > tbody > tr > td,
body.theme-dark .table > tbody > tr > th,
body.theme-dark .table > tfoot > tr > td,
body.theme-dark .table > tfoot > tr > th {
    background-color: transparent !important;
    color: var(--text-primary);
    border-color: var(--border-light) !important;
}

body.theme-dark .table-striped > tbody > tr:nth-of-type(odd) > * {
    --bs-table-accent-bg: rgba(148, 163, 184, 0.04);
    background-color: rgba(148, 163, 184, 0.04) !important;
}

body.theme-dark .table-hover > tbody > tr:hover > * {
    background-color: rgba(45, 212, 191, 0.05) !important;
}

/* 表单 */
body.theme-dark .form-control,
body.theme-dark .form-select,
body.theme-dark input[type="text"],
body.theme-dark input[type="number"],
body.theme-dark input[type="email"],
body.theme-dark input[type="password"],
body.theme-dark input[type="date"],
body.theme-dark input[type="time"],
body.theme-dark textarea {
    background-color: rgba(15, 23, 42, 0.8) !important;
    color: #f1f5f9 !important;
    border: 1px solid var(--border-medium) !important;
}

body.theme-dark .form-control:focus,
body.theme-dark .form-select:focus,
body.theme-dark input:focus {
    background-color: rgba(15, 23, 42, 0.9) !important;
    color: #f1f5f9 !important;
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.15) !important;
}

body.theme-dark .form-control::placeholder {
    color: #64748b;
}

body.theme-dark .form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
    background-color: rgba(15, 23, 42, 0.8) !important;
    color: #f1f5f9 !important;
}

body.theme-dark select.form-select option {
    background-color: #0f172a;
    color: #f1f5f9;
}

/* ============================================================
   日夜模式对比度修复 — 防止切换主题后文字看不见
   ============================================================ */

/* 浅色模式：默认白/浅色字改为深色，避免压在白底上看不见；
   但彩色/深色背景、按钮、徽标、渐变、表格深色行内的白字要保留 */
body.theme-light .text-white,
body.theme-light .text-light {
    color: #0f172a !important;
}
body.theme-light .bg-dark .text-white,
body.theme-light .bg-dark .text-light,
body.theme-light .bg-primary .text-white,
body.theme-light .bg-primary .text-light,
body.theme-light .bg-success .text-white,
body.theme-light .bg-success .text-light,
body.theme-light .bg-danger .text-white,
body.theme-light .bg-danger .text-light,
body.theme-light .bg-warning .text-white,
body.theme-light .bg-warning .text-light,
body.theme-light .bg-info .text-white,
body.theme-light .bg-info .text-light,
body.theme-light .bg-secondary .text-white,
body.theme-light .bg-secondary .text-light,
body.theme-light .bg-gradient .text-white,
body.theme-light .bg-gradient .text-light,
body.theme-light .btn .text-white,
body.theme-light .btn .text-light,
body.theme-light .badge .text-white,
body.theme-light .badge .text-light,
body.theme-light .alert .text-white,
body.theme-light .alert .text-light,
body.theme-light [style*="background"] .text-white,
body.theme-light [style*="background"] .text-light,
body.theme-light [style*="gradient"] .text-white,
body.theme-light [style*="gradient"] .text-light,
body.theme-light .table-dark .text-white,
body.theme-light .table-dark .text-light {
    color: #ffffff !important;
}

/* 深色模式：补齐其余固定色工具类，确保落在深底上是亮字 */
body.theme-dark .text-body-emphasis,
body.theme-dark .text-black-50,
body.theme-dark .text-black,
body.theme-dark .text-white-50 {
    color: var(--text-primary) !important;
}
/* 深色背景下强制亮字（.bg-dark 在两种模式下底色都深） */
body.theme-light .bg-dark,
body.theme-light .bg-dark *,
body.theme-dark .bg-dark,
body.theme-dark .bg-dark * {
    color: #f8fafc !important;
}
/* 深色模式里浅底徽标/卡片翻成深色文字，避免浅底浅字 */
body.theme-dark .badge.bg-white,
body.theme-dark .badge.bg-light,
body.theme-dark .bg-white,
body.theme-dark .bg-light {
    color: var(--text-primary) !important;
}

/* Choices.js */
body.theme-dark .choices__inner {
    background-color: rgba(15, 23, 42, 0.8) !important;
    border-color: var(--border-medium) !important;
    color: #f1f5f9 !important;
    border-radius: 0.375rem;
}

body.theme-dark .choices__list--dropdown,
body.theme-dark .choices__list[aria-expanded] {
    background-color: #0f172a !important;
    border-color: var(--border-medium) !important;
}

body.theme-dark .choices__list--dropdown .choices__item--selectable {
    color: #f1f5f9 !important;
}

body.theme-dark .choices__list--dropdown .choices__item--selectable.is-highlighted {
    background-color: rgba(45, 212, 191, 0.1) !important;
    color: #2dd4bf !important;
}

body.theme-dark .choices__placeholder {
    color: #334155 !important;
}

body.theme-dark .choices__input {
    background-color: rgba(6, 10, 20, 0.9) !important;
    border-color: var(--border-light) !important;
    color: #f1f5f9 !important;
}

/* 复选框 */
body.theme-dark .form-check-input {
    background-color: rgba(15, 23, 42, 0.8);
    border-color: var(--border-medium);
}

body.theme-dark .form-check-input:checked {
    background-color: var(--accent);
    border-color: var(--accent);
}

body.theme-dark .form-check-label {
    color: var(--text-primary);
}

/* 标题 */
body.theme-dark h1, body.theme-dark h2, body.theme-dark h3,
body.theme-dark h4, body.theme-dark h5, body.theme-dark h6,
body.theme-dark .h1, body.theme-dark .h2, body.theme-dark .h3,
body.theme-dark .h4, body.theme-dark .h5, body.theme-dark .h6 {
    color: var(--text-primary) !important;
}

body.theme-dark .fw-bold,
body.theme-dark strong {
    color: var(--text-primary) !important;
}

body.theme-dark .input-group-text {
    background-color: rgba(15, 23, 42, 0.8);
    border-color: var(--border-medium);
    color: var(--text-secondary);
}

body.theme-dark .nav-tabs .nav-link {
    color: var(--text-muted);
}

body.theme-dark .nav-tabs .nav-link.active {
    color: var(--text-primary);
    background-color: var(--bg-body);
    border-color: var(--border-medium) var(--border-medium) var(--bg-body);
}

body.theme-dark .alert {
    border-color: var(--border-medium);
}

/* ============================================================
   自定义组件 — 暗黑模式补充覆盖
   覆盖页面内联 <style> 硬编码白底的自定义 class
   （.bank-section / .loan-card / .mall-card / .store-item 等）
   ============================================================ */
body.theme-dark .bank-section,
body.theme-dark .loan-card,
body.theme-dark .card-sm,
body.theme-dark .mall-card,
body.theme-dark .pv-card,
body.theme-dark .store-item,
body.theme-dark .emp-row,
body.theme-dark .cat-card,
body.theme-dark .thread-item {
    background-color: var(--bg-card) !important;
    border-color: var(--border-medium) !important;
    color: var(--text-primary) !important;
}

/* 列表项分隔线 */
body.theme-dark .emp-row,
body.theme-dark .cat-card {
    border-bottom-color: var(--border-light) !important;
}

/* 已购商城卡片保留绿色语义 */
body.theme-dark .mall-card.bought {
    background-color: rgba(34, 197, 94, 0.12) !important;
    border-color: rgba(34, 197, 94, 0.4) !important;
}

/* 列表项 hover 适配 */
body.theme-dark .thread-item:hover {
    background-color: rgba(45, 212, 191, 0.05) !important;
    border-color: var(--accent) !important;
}

/* 次要文字在暗色下提亮 */
body.theme-dark .pv-meta { color: var(--text-secondary) !important; }

/* 弹窗内容（如 easytodo 分类弹窗）暗色适配 */
body.theme-dark .category-modal-content {
    background-color: #0f172a !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-medium);
}

/* 毛玻璃卡片内表格透明 */
.glass-card .table,
.glass-card .table thead,
.glass-card .table tbody,
.glass-card .table tr,
.glass-card .table td,
.glass-card .table th {
    background: transparent !important;
}

/* ============================================================
   按钮系统
   ============================================================ */

/* 统一按钮尺寸：全局统一为「标准」档，不过分小，消除页面间大小不一 */
.btn {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
    border-radius: 8px;
}
.btn-lg {
    font-size: 0.875rem !important;
    padding: 0.375rem 0.75rem !important;
    border-radius: 8px !important;
}
.btn-sm {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    border-radius: 7px;
}

/* 图标尺寸全局统一：覆盖内联 width/height，消除按钮图标大小不一（统一 15px） */
.btn svg,
.btn-glass svg,
.btn-icon svg,
.tx-action-btn svg,
.input-group .btn svg,
.btn-check svg,
.dropdown-item svg,
.nav-link svg {
    width: 15px !important;
    height: 15px !important;
    flex-shrink: 0;
}

/* 主按钮 — 松石绿 */
.btn-primary {
    background-color: var(--accent) !important;
    border-color: var(--accent) !important;
    color: var(--text-on-accent) !important;
    border-radius: 8px !important;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--accent-hover) !important;
    border-color: var(--accent-hover) !important;
    color: var(--text-on-accent) !important;
}

/* 渐变主按钮 */
.btn-primary-gradient {
    background: linear-gradient(135deg, var(--accent), #0891b2) !important;
    border: none !important;
    color: #ffffff !important;
}

.btn-primary-gradient:hover {
    background: linear-gradient(135deg, var(--accent-hover), #0e7490) !important;
    color: #ffffff !important;
}

/* 描边按钮 */
.btn-outline-primary {
    border-color: var(--accent) !important;
    color: var(--accent) !important;
    background-color: transparent !important;
    border-radius: 8px !important;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background-color: var(--accent-subtle) !important;
    border-color: var(--accent-hover) !important;
    color: var(--accent-hover) !important;
}

.btn-outline-secondary {
    border-color: var(--border-medium) !important;
    color: var(--text-secondary) !important;
    background-color: transparent !important;
    border-radius: 8px !important;
}

.btn-outline-secondary:hover {
    background-color: var(--accent-subtle) !important;
    border-color: var(--accent) !important;
    color: var(--accent) !important;
}

.btn-outline-danger {
    border-color: rgba(220, 38, 38, 0.4) !important;
    color: var(--color-expense) !important;
    background-color: transparent !important;
    border-radius: 8px !important;
}

.btn-outline-danger:hover {
    background-color: rgba(220, 38, 38, 0.1) !important;
    border-color: var(--color-expense) !important;
    color: #fca5a5 !important;
}

.btn-outline-success {
    border-color: rgba(5, 150, 105, 0.4) !important;
    color: var(--color-income) !important;
    background-color: transparent !important;
    border-radius: 8px !important;
}

.btn-outline-success:hover {
    background-color: rgba(5, 150, 105, 0.1) !important;
    border-color: var(--color-income) !important;
    color: #6ee7b7 !important;
}

/* btn-check 选中高亮：覆盖描边按钮的 background-color:transparent !important */
.btn-check:checked + .btn-outline-secondary,
.btn-check:active + .btn-outline-secondary,
.btn-check:checked + .btn-outline-primary,
.btn-check:active + .btn-outline-primary {
    background-color: var(--accent) !important;
    border-color: var(--accent) !important;
    color: var(--text-on-accent) !important;
}
body.theme-dark .btn-check:checked + .btn-outline-secondary,
body.theme-dark .btn-check:active + .btn-outline-secondary,
body.theme-dark .btn-check:checked + .btn-outline-primary,
body.theme-dark .btn-check:active + .btn-outline-primary {
    color: #0f172a !important;
}

/* 暗黑主按钮 */
body.theme-dark .btn-primary {
    background-color: var(--accent) !important;
    border-color: var(--accent) !important;
    color: #0f172a !important;
}

body.theme-dark .btn-primary:hover {
    background-color: var(--accent-hover) !important;
    border-color: var(--accent-hover) !important;
}

body.theme-dark .btn-primary-gradient {
    background: linear-gradient(135deg, var(--accent), #0891b2) !important;
    border: none !important;
    color: #0f172a !important;
}

/* 徽章 */
.badge.bg-primary { background-color: var(--accent) !important; }
.badge.bg-success { background-color: var(--color-income) !important; }
.badge.bg-danger  { background-color: var(--color-expense) !important; }
.badge.bg-warning { background-color: var(--color-warning) !important; }

body.theme-dark .badge.bg-primary-subtle {
    background-color: rgba(45, 212, 191, 0.15) !important;
    color: #2dd4bf !important;
}

body.theme-dark .badge.bg-secondary-subtle {
    background-color: rgba(148, 163, 184, 0.12) !important;
    color: #94a3b8 !important;
}

body.theme-dark .badge.bg-success-subtle {
    background-color: rgba(52, 211, 153, 0.15) !important;
    color: #34d399 !important;
}

body.theme-dark .badge.bg-danger-subtle {
    background-color: rgba(248, 113, 113, 0.15) !important;
    color: #f87171 !important;
}

/* ============================================================
   主题切换按钮
   ============================================================ */
.btn-theme-toggle {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 0.85rem;
    line-height: 1;
    border-width: 1px;
    border-style: solid;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

body.theme-light .btn-theme-toggle {
    background-color: #ffffff;
    color: #0f172a;
    border-color: #cbd5e1;
}

body.theme-dark .btn-theme-toggle {
    background-color: #1e293b;
    color: #f1f5f9;
    border-color: #334155;
}

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

body.theme-light .btn-theme-toggle:hover {
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.2);
    border-color: var(--accent);
}

body.theme-dark .btn-theme-toggle:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    border-color: #475569;
}

/* ============================================================
   通用卡片
   ============================================================ */
.card {
    border-radius: 14px;
    box-shadow: var(--shadow-glass);
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: var(--bg-glass) !important;
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}

.card:hover {
    box-shadow: var(--shadow-glass-hover);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.5);
}

/* 毛玻璃卡片 */
.glass-card {
    position: relative;
    background: var(--bg-glass) !important;
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    border-radius: 12px;
    box-shadow: var(--shadow-glass);
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.glass-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    z-index: 1;
}

.glass-card:hover {
    background: var(--bg-glass-hover) !important;
    box-shadow: var(--shadow-glass-hover);
    transform: translateY(-2px);
}

.glass-card .card-body {
    background: transparent !important;
}

body.theme-dark .glass-card {
    background: var(--bg-glass) !important;
    backdrop-filter: blur(16px) saturate(110%);
    -webkit-backdrop-filter: blur(16px) saturate(110%);
    border: 1px solid rgba(148, 163, 184, 0.12) !important;
}

body.theme-dark .glass-card:hover {
    background: var(--bg-glass-hover) !important;
    border-color: rgba(148, 163, 184, 0.2) !important;
}

/* 毛玻璃 border-start 颜色 */
.glass-card.border-start { border-left-style: solid !important; }
body.theme-dark .glass-card.border-start.border-primary { border-left-color: rgba(45, 212, 191, 0.4) !important; }
body.theme-dark .glass-card.border-start.border-success { border-left-color: rgba(52, 211, 153, 0.4) !important; }
body.theme-dark .glass-card.border-start.border-danger   { border-left-color: rgba(248, 113, 113, 0.4) !important; }
body.theme-dark .glass-card.border-start.border-warning  { border-left-color: rgba(251, 191, 36, 0.4) !important; }
body.theme-dark .glass-card.border-start.border-info     { border-left-color: rgba(45, 212, 191, 0.4) !important; }

/* ============================================================
   下拉选择框
   ============================================================ */
select.form-select {
    border-radius: 8px !important;
    border: 1.5px solid var(--border-medium) !important;
    font-size: 0.86rem;
    padding: 0.4rem 2.2rem 0.4rem 0.75rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.8' d='m2 5 6 6 6-6'/%3e%3c/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.65rem center !important;
    background-size: 14px !important;
    transition: border-color 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

select.form-select:hover {
    border-color: var(--accent) !important;
}

select.form-select:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px var(--accent-subtle) !important;
    outline: none;
}

/* ============================================================
   玻璃按钮
   ============================================================ */
.btn-glass {
    background: var(--bg-glass) !important;
    backdrop-filter: blur(8px) saturate(120%);
    -webkit-backdrop-filter: blur(8px) saturate(120%);
    border: 1.5px solid var(--border-medium) !important;
    border-radius: 8px !important;
    color: var(--text-secondary) !important;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.btn-glass:hover {
    background: var(--bg-glass-hover) !important;
    border-color: var(--accent) !important;
    color: var(--accent) !important;
    box-shadow: var(--shadow-md);
}

/* 毛玻璃描边按钮（btn-outline-*）和浅色按钮（btn-light）——苹果风格半透明+模糊 */
[class*="btn-outline-"], .btn-light {
    backdrop-filter: blur(8px) saturate(130%);
    -webkit-backdrop-filter: blur(8px) saturate(130%);
    background: rgba(255, 255, 255, 0.35) !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    border-radius: 8px !important;
    transition: all 0.2s ease;
}
[class*="btn-outline-"]:hover, .btn-light:hover {
    background: rgba(255, 255, 255, 0.55) !important;
    border-color: rgba(255, 255, 255, 0.6) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
/* 日间模式：半透明白底在浅灰页面上几乎隐形，改用更深背景+边框保证可见性 */
body.theme-light [class*="btn-outline-"], body.theme-light .btn-light {
    background: rgba(255, 255, 255, 0.7) !important;
    border-color: rgba(17, 24, 39, 0.18) !important;
}
body.theme-light [class*="btn-outline-"]:hover, body.theme-light .btn-light:hover {
    background: rgba(255, 255, 255, 0.9) !important;
    border-color: var(--accent) !important;
}
body.theme-dark [class*="btn-outline-"], body.theme-dark .btn-light {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}
body.theme-dark [class*="btn-outline-"]:hover, body.theme-dark .btn-light:hover {
    background: rgba(255, 255, 255, 0.15) !important;
}-light:hover {
    background: rgba(255, 255, 255, 0.15) !important;
}

/* 顶部导航栏毛玻璃 */
.navbar {
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    background: rgba(255, 255, 255, 0.65) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}
body.theme-dark .navbar {
    background: rgba(15, 23, 42, 0.65) !important;
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

/* ============================================================
   弹窗
   ============================================================ */
.modal-content {
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 6px 20px rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.72) !important;
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

body.theme-dark .modal-content {
    background: rgba(15, 23, 42, 0.82) !important;
    border-color: rgba(255, 255, 255, 0.1);
}

body.theme-dark .modal-header,
body.theme-dark .modal-footer {
    border-color: var(--border-medium);
}

body.theme-dark .modal-title {
    color: var(--text-primary);
}

body.theme-dark .btn-close {
    filter: invert(1) grayscale(0.5);
}

/* 管理弹窗 */
.mgmt-modal .modal-content {
    background: var(--bg-glass);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
}

.mgmt-modal .modal-header {
    border-bottom: 1px solid var(--border-light);
    background: transparent;
}

.mgmt-modal .modal-body { background: transparent; }

body.theme-dark .mgmt-modal .modal-content {
    background: var(--bg-glass);
    border-color: var(--border-medium);
}

body.theme-dark .mgmt-modal .modal-header {
    border-bottom-color: var(--border-medium);
}

/* ============================================================
   通用图标
   ============================================================ */
.tx-icon-cell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    vertical-align: middle;
    overflow: hidden;
    border-radius: 6px;
    background: var(--accent-subtle);
}

.tx-icon-cell img {
    width: 20px;
    height: 20px;
    object-fit: cover;
    border-radius: 3px;
}

.tx-icon-cell svg {
    width: 15px;
    height: 15px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.btn-icon svg {
    width: 15px;
    height: 15px;
    display: block;
}

/* 账户列表操作列图标按钮 */
.tx-action-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.tx-action-btn svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}


.tx-action-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(17, 24, 39, 0.15);
}

.btn-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(17, 24, 39, 0.15);
}

body.theme-dark .tx-action-btn:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.theme-dark .btn-icon:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
/* 操作列图标间距（非标准工具类补全） */
.gap-4px {
    gap: 4px;
}

/* ============================================================
   表格
   ============================================================ */
tbody tr:hover > * {
    background-color: var(--accent-subtle) !important;
}

body.theme-dark .table-hover > tbody > tr:hover > * {
    background-color: rgba(45, 212, 191, 0.05) !important;
}

/* ============================================================
   订阅页导航
   ============================================================ */
.subscriptions-nav .nav-link {
    border-radius: 0;
    margin-right: 1.25rem;
    padding: 0.35rem 0;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: color 0.15s, border-color 0.15s;
}

.subscriptions-nav .nav-link:hover {
    color: var(--text-primary);
    border-bottom-color: var(--accent-subtle);
    background-color: transparent;
}

.subscriptions-nav .nav-link.active {
    color: var(--text-primary);
    border-bottom-color: var(--accent);
    background-color: transparent;
    font-weight: 500;
}

/* ============================================================
   账目表单
   ============================================================ */
.tx-form-card {
    border-radius: 14px;
    background: var(--bg-glass);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, 0.35);
}

.tx-form-grid { row-gap: 0.75rem; }
.tx-form-row { display: flex; align-items: center; gap: 0.5rem; }
.tx-form-label { min-width: 72px; flex: 0 0 auto; color: var(--text-secondary); }
.tx-form-control-wrap { flex: 1 1 auto; }

.tx-form-card .form-control,
.tx-form-card .form-select,
.tx-form-card textarea {
    border-radius: 8px;
    padding-top: 0.3rem;
    padding-bottom: 0.3rem;
    font-size: 0.875rem;
}

.tx-amount-input {
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
    font-size: 1rem;
}

/* ============================================================
   凭证预览
   ============================================================ */
.attachment-hover-preview {
    position: fixed;
    z-index: 1080;
    background-color: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: 8px;
    padding: 4px;
    box-shadow: var(--shadow-lg);
    max-width: 260px;
    max-height: 260px;
}

.attachment-hover-preview img {
    max-width: 252px;
    max-height: 252px;
    display: block;
    object-fit: contain;
}

.attachment-thumb {
    max-width: 60px;
    max-height: 60px;
    border-radius: 5px;
    cursor: zoom-in;
    object-fit: cover;
}

.attachment-modal-img {
    max-width: 100%;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    margin: 0 auto;
}

/* ============================================================
   余额颜色
   ============================================================ */
option.balance-neg { color: var(--color-expense) !important; }
option.balance-pos { color: var(--accent) !important; }
option.balance-zero { color: var(--text-muted) !important; }

/* ============================================================
   账户管理表格
   ============================================================ */
.table-accounts tbody td {
    padding-top: 0.3rem;
    padding-bottom: 0.3rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.theme-light .table-accounts thead th,
body.theme-light .table-accounts tbody td {
    color: var(--text-primary);
    border-color: var(--border-light);
}

body.theme-dark .table-accounts thead,
body.theme-dark .table-accounts thead th {
    background-color: rgba(15, 23, 42, 0.5) !important;
}

body.theme-dark .table-accounts thead th,
body.theme-dark .table-accounts tbody td {
    color: var(--text-primary) !important;
    border-color: var(--border-medium) !important;
}

/* ============================================================
   移动端适配
   ============================================================ */
@media (max-width: 576px) {
    .card { border-radius: 8px; }
    .sidebar { width: 185px; }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 1040;
        transform: translateX(-100%);
        transition: transform 0.2s ease-out;
        overflow-x: hidden;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        z-index: 1030;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease-out;
    }

    body.sidebar-open .sidebar-overlay {
        opacity: 1;
        pointer-events: auto;
    }

    body.sidebar-open { overflow: hidden; }
}

/* ============================================================
   响应式断点 — 2K / 4K / 折叠屏 / 平板
   ============================================================ */

/* ── 平板 / 折叠屏竖屏（769px - 1024px） ── */
@media (min-width: 769px) and (max-width: 1024px) {
    .sidebar { width: 220px; }
    .sidebar-menu .list-group-item { font-size: 0.82rem; padding: 8px 12px !important; }
    .sidebar-section-header { font-size: 0.7rem; }
    .menu-icon { width: 16px; height: 16px; }
}

/* ── 2K 标准屏（1440px - 2559px） ── */
@media (min-width: 1440px) and (max-width: 2559px) {
    body { font-size: 0.95rem; }
    .sidebar { width: 230px; }
    .sidebar-menu .list-group-item { font-size: 0.92rem; padding: 10px 16px !important; }
    .sidebar-section-header { font-size: 0.75rem; }
    .sidebar-header .fw-bold { font-size: 1rem; }
    .menu-icon { width: 18px; height: 18px; }
    .sidebar-flyout { min-width: 200px; }
    .card { font-size: 0.95rem; }
}

/* ── 4K / 超大屏（≥2560px） ── */
@media (min-width: 2560px) {
    body { font-size: 1.05rem; }
    .sidebar { width: 260px; }
    .sidebar-menu .list-group-item {
        font-size: 1rem;
        padding: 14px 20px !important;
        gap: 14px;
    }
    .sidebar-section-header {
        font-size: 0.82rem;
        padding: 14px 20px 6px;
    }
    .sidebar-header { padding: 22px 20px 16px !important; }
    .sidebar-header .fw-bold { font-size: 1.15rem; }
    .menu-icon { width: 22px; height: 22px; }
    .sidebar-flyout { min-width: 240px; }
    .card { font-size: 1.05rem; }
    .btn-primary, .btn-outline-primary { font-size: 1rem; padding: 10px 20px; }
}

/* ── 折叠屏竖屏展开态 ── */
@media (min-width: 415px) and (max-width: 900px) {
    .mobile-shell { max-width: 100%; padding: 12px; }
    body { font-size: 15px; }
}

/* ── 折叠屏横屏展开 / 小平板 ── */
@media (min-width: 901px) and (max-width: 1200px) and (orientation: landscape) {
    .mobile-shell { max-width: 100%; }
}

/* ── 高 DPI 屏幕优化 ── */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .card, .glass-card {
        box-shadow: 0 1px 4px rgba(17, 24, 39, 0.08);
    }
}