/**
 * 白天 / 黑夜 · 企业级暗色主题（参考 Ant Design darkAlgorithm / ProLayout dark）
 * 加载顺序：必须在 main.css + theme-ink-desk.css 之后。
 *
 * 设计原则（成功案列共性）：
 * 1. 用 html.dark 重写 Design Token，而不是只改个别元素
 * 2. 侧栏 = dark sider：深底 + 浅字，菜单项透明而非白卡片
 * 3. 内容区 = colorBgLayout / colorBgContainer 分层，卡片略抬高
 * 4. 用 !important 覆盖 ink-desk 中锁死的浅色
 */

/* ========== 顶栏紧凑机械开关 ========== */
.gt-theme-switch {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    margin: 0 4px;
    -webkit-app-region: no-drag;
}

.gt-theme-switch-check {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.gt-theme-switch-label {
    position: relative;
    display: block;
    width: 54px;
    height: 26px;
    border-radius: 30px;
    background: rgba(0, 0, 0, 0.22);
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.35);
    cursor: pointer;
    user-select: none;
}

.gt-theme-switch-label::before,
.gt-theme-switch-label::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 7px;
    height: 7px;
    border-radius: 8px;
    transform: translateY(-50%);
    z-index: 2;
    transition: all 0.2s;
}

.gt-theme-switch-label::before {
    left: 5px;
    background: radial-gradient(circle at 45%, #ff3a3a 0%, #ff7171 100%);
    border: 1px solid #742323;
    box-shadow: 0 1px 3px rgba(255, 67, 48, 0.55);
}

.gt-theme-switch-label::after {
    right: 5px;
    background: radial-gradient(circle at 45%, rgba(60, 60, 60, 0.7) 0%, rgba(160, 160, 160, 0.55) 100%);
    border: 1px solid #111;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

.gt-theme-switch-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 22px;
    height: 18px;
    border-radius: 20px;
    background: linear-gradient(#4f4f4f, #2b2b2b);
    border: 1px solid #1a1a1a;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.12);
    transition: left 0.2s linear;
    z-index: 3;
}

.gt-theme-switch-check:checked + .gt-theme-switch-label .gt-theme-switch-knob {
    left: 26px;
}

.gt-theme-switch-check:checked + .gt-theme-switch-label::before {
    background: radial-gradient(circle at 45%, rgba(60, 60, 60, 0.7) 0%, rgba(151, 151, 151, 0.6) 100%);
    border-color: #111;
    box-shadow: 0 1px 3px rgba(20, 20, 20, 0.5);
}

.gt-theme-switch-check:checked + .gt-theme-switch-label::after {
    background: radial-gradient(circle at 45%, #90ee90 0%, #7cfc00 100%);
    border-color: #004562;
    box-shadow: 0 1px 4px rgba(0, 160, 0, 0.55);
}

.gt-theme-switch-check:focus-visible + .gt-theme-switch-label {
    outline: 2px solid rgba(255, 255, 255, 0.7);
    outline-offset: 2px;
}

/* ========== Ant Design 系暗色 Design Token（必须压过后面的 :root 浅色） ========== */
html.dark,
html[data-theme="dark"] {
    color-scheme: dark;

    /* Seed / Map · 对齐 antd darkAlgorithm，并提高层级对比避免「上白下黑」 */
    --bg-gradient: #1f1f1f;
    --color-background: #1f1f1f;
    --color-bg-soft: #2a2a2a;
    --color-surface: #2a2a2a;
    --color-card: #2a2a2a;
    --color-card-solid: #2a2a2a;
    --color-border: #434343;
    --color-hover: rgba(255, 255, 255, 0.08);
    --color-glass: rgba(42, 42, 42, 0.92);
    --color-input-bg: #141414;
    --color-sidebar: #001529;
    --color-elevated: #323232;

    --color-text: rgba(255, 255, 255, 0.88);
    --color-text-light: rgba(255, 255, 255, 0.65);
    --color-text-lighter: rgba(255, 255, 255, 0.45);

    --color-primary-light: rgba(22, 119, 255, 0.18);
    --header-bg: #141414;
    --header-fg: rgba(255, 255, 255, 0.88);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.45);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.5);
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-card-hover: 0 6px 18px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 0 3px rgba(22, 119, 255, 0.28);
    --shadow-glass: 0 8px 24px rgba(0, 0, 0, 0.4);
}

html.dark body,
html[data-theme="dark"] body {
    background: #141414 !important;
    background-color: #141414 !important;
    color: rgba(255, 255, 255, 0.85) !important;
}

html.dark #splash-screen {
    background: #141414;
    color: rgba(255, 255, 255, 0.85);
}

html.dark #splash-screen::before {
    background: #1677ff;
}

/* ========== 壳层：布局底 / 侧栏 / 主区 ========== */
html.dark .app-container,
html.dark .app-body,
html.dark .app-main,
html.dark .content-area,
html.dark #app,
html.dark .app-shell,
html.dark .page-content,
html.dark .main-content {
    background: #141414 !important;
    background-color: #141414 !important;
    color: rgba(255, 255, 255, 0.85) !important;
}

/* 顶栏：暗色下用深灰而非高饱和蓝，贴近 Pro dark header */
html.dark .app-header {
    background: #141414 !important;
    border-bottom: 1px solid #303030 !important;
}

html.dark .app-header .header-search,
html.dark .app-header .header-search input {
    background: rgba(255, 255, 255, 0.08) !important;
    color: rgba(255, 255, 255, 0.85) !important;
    border-color: transparent !important;
}

html.dark .app-header .header-search-kbd {
    background: rgba(255, 255, 255, 0.1) !important;
    color: rgba(255, 255, 255, 0.55) !important;
}

html.dark .app-header .header-icon-btn,
html.dark .app-header .header-user,
html.dark .app-header .sidebar-toggle {
    color: rgba(255, 255, 255, 0.85) !important;
}

html.dark .app-header .header-icon-btn:hover,
html.dark .app-header .header-user:hover,
html.dark .app-header .sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.08) !important;
}

/* ========== 侧栏：ProLayout darkMenu（禁止白卡片） ========== */
html.dark .app-sidebar,
html.dark aside.app-sidebar,
html.dark .sidebar {
    background: #001529 !important;
    background-color: #001529 !important;
    border-right: 1px solid #000c17 !important;
    box-shadow: none !important;
    color: rgba(255, 255, 255, 0.65) !important;
}

html.dark .sidebar-menu {
    background: transparent !important;
}

html.dark .menu-item,
html.dark .app-sidebar .menu-item,
html.dark .sidebar .menu-item,
html.dark .sidebar-footer-item {
    background: transparent !important;
    background-color: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
    color: rgba(255, 255, 255, 0.65) !important;
}

html.dark .menu-item .menu-text,
html.dark .menu-item .menu-icon,
html.dark .sidebar-footer-item {
    color: inherit !important;
}

html.dark .menu-item .menu-icon {
    background: transparent !important;
    color: rgba(255, 255, 255, 0.65) !important;
}

html.dark .menu-item:hover,
html.dark .sidebar-footer-item:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #fff !important;
    transform: none !important;
}

html.dark .menu-item:hover .menu-icon {
    background: transparent !important;
    color: #fff !important;
}

html.dark .menu-item.active,
html.dark .app-sidebar .menu-item.active {
    background: #1677ff !important;
    color: #fff !important;
    border-color: transparent !important;
    box-shadow: none !important;
    font-weight: 600;
}

html.dark .menu-item.active .menu-icon {
    background: transparent !important;
    color: #fff !important;
}

html.dark .sidebar-footer {
    border-top-color: rgba(255, 255, 255, 0.08) !important;
    background: transparent !important;
}

html.dark .sidebar-title {
    color: rgba(255, 255, 255, 0.85) !important;
}

html.dark .sidebar-subtitle {
    color: rgba(255, 255, 255, 0.45) !important;
}

/* ========== 表单 / 表格 / 弹层 ========== */
html.dark .form-control,
html.dark input.form-control,
html.dark select.form-control,
html.dark textarea.form-control,
html.dark .modal input,
html.dark .modal select,
html.dark .modal textarea,
html.dark .settings-page .form-control,
html.dark .workflow-center input,
html.dark .workflow-center select,
html.dark .workflow-center textarea,
html.dark input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
html.dark select,
html.dark textarea {
    background: #141414 !important;
    color: rgba(255, 255, 255, 0.85) !important;
    border-color: #424242 !important;
}

html.dark .form-control:disabled,
html.dark input:disabled,
html.dark select:disabled,
html.dark textarea:disabled {
    background: #1f1f1f !important;
    color: rgba(255, 255, 255, 0.35) !important;
}

html.dark th,
html.dark thead th,
html.dark .operation-log-table th,
html.dark .workflow-table th {
    background: #1f1f1f !important;
    color: rgba(255, 255, 255, 0.65) !important;
    border-color: #303030 !important;
}

html.dark td,
html.dark .operation-log-table td,
html.dark .workflow-table td {
    border-color: #303030 !important;
    color: rgba(255, 255, 255, 0.85);
}

html.dark tr:hover td {
    background: rgba(255, 255, 255, 0.04) !important;
}

html.dark .modal-overlay .modal,
html.dark .modal-content,
html.dark .modal .modal-box,
html.dark [class*="modal"] .card,
html.dark .toast,
html.dark .empty-state {
    background: #1f1f1f !important;
    color: rgba(255, 255, 255, 0.85) !important;
    border-color: #303030 !important;
}

/* ========== 业务卡片 / 面板（覆盖 ink-desk 白底） ========== */
html.dark .settings-page,
html.dark .settings-page .card,
html.dark .settings-status,
html.dark .settings-actions,
html.dark .business-hub-page,
html.dark .business-hub-card,
html.dark .business-hub-section,
html.dark .workflow-panel,
html.dark .workflow-stat,
html.dark .workflow-document,
html.dark .workflow-portal-card,
html.dark .operator-workbench-main,
html.dark .operator-workbench-side,
html.dark .simple-guide-panel,
html.dark .simple-guide-card,
html.dark .page-guide-banner,
html.dark .smart-assistant-card,
html.dark .desktop-analysis-card,
html.dark .debt-detail,
html.dark .recent-activity,
html.dark .yearly-summary,
html.dark .warehouse-panel,
html.dark .snapshot-page .card,
html.dark .dashboard-page .card,
html.dark .ops-visual-card,
html.dark .balance-card,
html.dark .tax-task-card,
html.dark .tax-stat-card,
html.dark .settings-card,
html.dark .settings-panel,
html.dark .content-card,
html.dark .panel-card,
html.dark .kpi-card,
html.dark .stat-card,
html.dark .dash-card,
html.dark .quick-entry,
html.dark .quick-action,
html.dark .workbench-card,
html.dark .boss-kpi-card,
html.dark .operator-workbench,
html.dark .operator-task-list,
html.dark .operator-task-row,
html.dark .operator-completed-row,
html.dark .smart-alert-card,
html.dark .smart-follow-card,
html.dark .dashboard-section,
html.dark .dashboard-block,
html.dark .page-card,
html.dark .ink-card,
html.dark .card {
    background: #1f1f1f !important;
    color: rgba(255, 255, 255, 0.85) !important;
    border-color: #303030 !important;
    box-shadow: none !important;
}

html.dark .page-guide-banner,
html.dark .page-guide-banner.is-soft {
    background: rgba(22, 119, 255, 0.12) !important;
    border-color: rgba(22, 119, 255, 0.35) !important;
}

html.dark .simple-guide-panel,
html.dark .operator-today-totals > span,
html.dark .operator-task-row:hover,
html.dark .operator-completed-row:hover {
    background: #141414 !important;
}

html.dark .data-center-pill,
html.dark .display-adjustment-pill,
html.dark .db-status-pill,
html.dark .sync-status-pill {
    background: rgba(255, 255, 255, 0.08) !important;
    color: rgba(255, 255, 255, 0.65) !important;
    border-color: transparent !important;
}

html.dark .operator-task-dismiss,
html.dark .operator-task-retry,
html.dark .operator-view-all,
html.dark .smart-report-btn {
    background: #141414 !important;
    color: #69b1ff !important;
    border-color: #303030 !important;
}

html.dark .operator-danger,
html.dark .smart-danger {
    background: rgba(255, 77, 79, 0.12) !important;
}

html.dark .operator-warning,
html.dark .smart-warning {
    background: rgba(250, 173, 20, 0.12) !important;
}

html.dark .operator-sync-summary.is-success {
    background: rgba(82, 196, 26, 0.12) !important;
    border-color: rgba(82, 196, 26, 0.35) !important;
}

html.dark .operator-sync-summary.is-warning {
    background: rgba(250, 173, 20, 0.12) !important;
    border-color: rgba(250, 173, 20, 0.35) !important;
}

html.dark .operator-sync-summary.is-error {
    background: rgba(255, 77, 79, 0.12) !important;
    border-color: rgba(255, 77, 79, 0.35) !important;
}

/* 首页快捷入口等硬编码浅色 */
html.dark .dashboard-page,
html.dark .boss-home,
html.dark .ops-home {
    background: #141414 !important;
    color: rgba(255, 255, 255, 0.85) !important;
}

html.dark .dashboard-page h1,
html.dark .dashboard-page h2,
html.dark .dashboard-page h3,
html.dark .dashboard-page .section-title,
html.dark .page-title {
    color: rgba(255, 255, 255, 0.85) !important;
}

html.dark .dashboard-page .muted,
html.dark .dashboard-page .text-muted,
html.dark .dashboard-page small,
html.dark .color-text-light {
    color: rgba(255, 255, 255, 0.45) !important;
}

html.dark a,
html.dark .settings-cross-link,
html.dark .workflow-link {
    color: #69b1ff;
}

html.dark a:hover,
html.dark .settings-cross-link:hover,
html.dark .workflow-link:hover {
    color: #91caff;
}

html.dark .app-body .app-sidebar {
    background: #001529 !important;
}

html.dark .app-main,
html.dark .page-container {
    background: #141414 !important;
}

html.dark .app-footer {
    background: #1f1f1f !important;
    color: rgba(255, 255, 255, 0.45) !important;
}

html.dark .btn-secondary {
    background: #1f1f1f !important;
    color: #69b1ff !important;
    border-color: #424242 !important;
}

html.dark .btn-icon,
html.dark .ink-icon-btn,
html.dark .menu-item .menu-icon,
html.dark .sidebar-footer-item .footer-icon {
    background: transparent !important;
    color: inherit !important;
    border-color: transparent !important;
    box-shadow: none !important;
}

/* 滚动条 */
html.dark ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2) !important;
}

html.dark ::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.35) !important;
}

/* ========== v2 颜色对称：压白抬暗（antd elevated 层级） ========== */
html.dark body,
html[data-theme="dark"] body,
html.dark .app-container,
html.dark .app-body,
html.dark .app-main,
html.dark .page-container,
html.dark .content-area,
html.dark .dashboard-page,
html.dark .business-hub-page {
    background: #1f1f1f !important;
    background-color: #1f1f1f !important;
    color: rgba(255, 255, 255, 0.88) !important;
}

/* 顶部白条：手机入口 / 页面说明条 */
html.dark .mobile-access-bar,
html.dark .dashboard-content > .mobile-access-bar,
html.dark .page-guide-banner,
html.dark .page-guide-banner.is-soft {
    background: #2a2a2a !important;
    border: 1px solid #434343 !important;
    box-shadow: none !important;
    color: rgba(255, 255, 255, 0.65) !important;
}

html.dark .mobile-access-label {
    color: rgba(255, 255, 255, 0.65) !important;
}

html.dark .mobile-access-bar strong,
html.dark .mobile-access-bar #mobile-access-url {
    color: #69b1ff !important;
}

html.dark .mobile-access-bar .btn,
html.dark .mobile-access-bar button {
    background: #323232 !important;
    color: rgba(255, 255, 255, 0.85) !important;
    border: 1px solid #434343 !important;
}

/* 进销存中心白英雄区 */
html.dark .business-hub-hero {
    background: linear-gradient(135deg, #2a2a2a 0%, #323232 55%, #2a2a2a 100%) !important;
    border: 1px solid #434343 !important;
    box-shadow: none !important;
}

html.dark .business-hub-hero > span {
    color: #69b1ff !important;
}

html.dark .business-hub-hero h1,
html.dark .page-title h1,
html.dark .page-title {
    color: rgba(255, 255, 255, 0.88) !important;
}

html.dark .business-hub-hero p,
html.dark .business-hub-section header p,
html.dark .business-hub-note {
    color: rgba(255, 255, 255, 0.55) !important;
}

html.dark .business-hub-section,
html.dark .business-hub-card {
    background: #2a2a2a !important;
    border: 1px solid #434343 !important;
    box-shadow: none !important;
    color: rgba(255, 255, 255, 0.88) !important;
}

html.dark .business-hub-card:hover {
    border-color: #1677ff !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35) !important;
    background: #323232 !important;
}

html.dark .business-hub-card strong,
html.dark .business-hub-card b {
    color: #5cdbd3 !important;
}

html.dark .business-hub-section header h2,
html.dark .business-hub-section header h3 {
    color: rgba(255, 255, 255, 0.88) !important;
}

/* 快捷操作白按钮（录合同等） */
html.dark .operator-action-btn,
html.dark .operator-action-btn.quick-action-btn,
html.dark .quick-action-btn,
html.dark .operator-workbench .operator-action-btn.quick-action-btn,
html.dark .card.quick-action-btn,
html.dark button.operator-action-btn {
    background: #323232 !important;
    border: 1px solid #434343 !important;
    color: #69b1ff !important;
    box-shadow: none !important;
}

html.dark .operator-action-btn:hover,
html.dark .quick-action-btn:hover,
html.dark .operator-action-btn.quick-action-btn:hover {
    background: #3a3a3a !important;
    border-color: #1677ff !important;
    color: #91caff !important;
}

html.dark .operator-action-btn span,
html.dark .operator-action-btn b,
html.dark .quick-action-btn b,
html.dark .quick-action-btn .action-icon {
    color: inherit !important;
    background: transparent !important;
}

html.dark .operator-action-btn:disabled {
    background: #262626 !important;
    color: rgba(255, 255, 255, 0.35) !important;
    border-color: #303030 !important;
}

/* 通用卡片抬高：避免与布局底糊成一片 */
html.dark .card,
html.dark .ops-visual-card,
html.dark .smart-assistant-card,
html.dark .desktop-analysis-card,
html.dark .debt-detail,
html.dark .yearly-summary,
html.dark .safety-status-card,
html.dark .operator-workbench-main,
html.dark .operator-workbench-side,
html.dark .boss-kpi-card,
html.dark .balance-card,
html.dark .content-card,
html.dark .panel-card,
html.dark .settings-card,
html.dark .dashboard-content > .card,
html.dark .dashboard-content > .smart-assistant-card,
html.dark .dashboard-content > .desktop-analysis-card,
html.dark .dashboard-content > .debt-detail,
html.dark .dashboard-content > .yearly-summary {
    background: #2a2a2a !important;
    border: 1px solid #434343 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28) !important;
    color: rgba(255, 255, 255, 0.88) !important;
}

/* 底部提醒 / 任务行：用抬高层 + 色晕，不再近黑 */
html.dark .smart-alert,
html.dark .smart-alert-card {
    background: #323232 !important;
    border: 1px solid #4a4a4a !important;
    color: rgba(255, 255, 255, 0.88) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25) !important;
}

html.dark .smart-alert.smart-danger,
html.dark .smart-danger {
    background: #3a2222 !important;
    border-color: rgba(255, 120, 117, 0.45) !important;
    color: #ff7875 !important;
}

html.dark .smart-alert.smart-warning,
html.dark .smart-warning {
    background: #3a3220 !important;
    border-color: rgba(255, 197, 61, 0.45) !important;
    color: #ffc53d !important;
}

html.dark .smart-alert-body strong {
    color: rgba(255, 255, 255, 0.9) !important;
}

html.dark .smart-alert-body em {
    color: rgba(255, 255, 255, 0.55) !important;
}

html.dark .operator-task-row,
html.dark .operator-completed-row {
    background: #323232 !important;
    border-color: #434343 !important;
    color: rgba(255, 255, 255, 0.88) !important;
}

html.dark .operator-danger {
    background: #3a2222 !important;
    border-color: rgba(255, 120, 117, 0.35) !important;
}

html.dark .operator-warning {
    background: #3a3220 !important;
    border-color: rgba(255, 197, 61, 0.35) !important;
}

html.dark .operator-task-row:hover,
html.dark .operator-completed-row:hover {
    background: #3a3a3a !important;
}

html.dark .operator-task-dismiss,
html.dark .operator-view-all,
html.dark .smart-report-btn,
html.dark .operator-task-retry {
    background: #2a2a2a !important;
    border: 1px solid #434343 !important;
    color: #5cdbd3 !important;
}

html.dark .operator-today-totals > span {
    background: #323232 !important;
    color: rgba(255, 255, 255, 0.65) !important;
    border: 1px solid #434343 !important;
}

html.dark .btn-secondary {
    background: #323232 !important;
    color: #69b1ff !important;
    border-color: #434343 !important;
}

/* ========== v3 全量审查：深色模式表面/文字统一 ========== */
/* 布局 #1f1f1f · 容器 #2a2a2a · 抬高 #323232 · 边框 #434343 */

html.dark .app-main,
html.dark .page-container,
html.dark .content-area {
    background: #1f1f1f !important;
    color: rgba(255, 255, 255, 0.88) !important;
}

html.dark .app-main .card,
html.dark .app-main [class*="-card"],
html.dark .app-main [class*="-panel"],
html.dark .app-main [class*="-box"],
html.dark .app-main [class*="toolbar"],
html.dark .app-main [class*="-toolbar"],
html.dark .app-main [class*="-section"],
html.dark .app-main [class*="selector"],
html.dark .app-main [class*="overview"],
html.dark .app-main .panel,
html.dark .app-main .content-card,
html.dark .app-main .empty-state,
html.dark .app-main .settings-actions {
    background-color: #2a2a2a !important;
    border-color: #434343 !important;
    color: rgba(255, 255, 255, 0.88) !important;
    box-shadow: none !important;
}

html.dark .app-main .btn-primary,
html.dark .app-main .btn.btn-primary {
    background-color: #1677ff !important;
    border-color: #1677ff !important;
    color: #fff !important;
}

html.dark .app-main h1,
html.dark .app-main h2,
html.dark .app-main h3,
html.dark .app-main h4,
html.dark .app-main .page-title h1,
html.dark .app-main .customer-name,
html.dark .app-main .pie-chart-title,
html.dark .app-main strong {
    color: rgba(255, 255, 255, 0.92) !important;
}

html.dark .app-main label,
html.dark .app-main .settings-field-hint,
html.dark .app-main .settings-section-lead,
html.dark .app-main .settings-hint,
html.dark .app-main .desktop-analysis-sub,
html.dark .app-main .pie-chart-desc,
html.dark .app-main .donut-legend-label,
html.dark .app-main small,
html.dark .app-main .customer-contact,
html.dark .app-main .customer-phone {
    color: rgba(255, 255, 255, 0.55) !important;
}

html.dark .app-main input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]),
html.dark .app-main select,
html.dark .app-main textarea,
html.dark .app-main .form-control {
    background: #141414 !important;
    color: rgba(255, 255, 255, 0.88) !important;
    border-color: #434343 !important;
}

html.dark .app-main input::placeholder,
html.dark .app-main textarea::placeholder {
    color: rgba(255, 255, 255, 0.35) !important;
}

html.dark .app-main table,
html.dark .app-main .table,
html.dark .app-main .data-table {
    background: #2a2a2a !important;
    color: rgba(255, 255, 255, 0.88) !important;
}

html.dark .app-main th,
html.dark .app-main thead th {
    background: #323232 !important;
    color: rgba(255, 255, 255, 0.65) !important;
    border-color: #434343 !important;
}

html.dark .app-main td {
    background: #2a2a2a !important;
    color: rgba(255, 255, 255, 0.88) !important;
    border-color: #434343 !important;
}

html.dark .app-main tr:nth-child(even) td {
    background: #262626 !important;
}

html.dark .app-main tr:hover td {
    background: #3a3a3a !important;
}

/* 首页收支构成 / 饼图 / 税票 */
html.dark .desktop-analysis-card,
html.dark .desktop-analysis-card .donut-chart-container,
html.dark .pie-chart-card {
    background: #2a2a2a !important;
    border-color: #434343 !important;
}

html.dark .tax-invoice-panel > div {
    background: #323232 !important;
    border: 1px solid #434343 !important;
    color: rgba(255, 255, 255, 0.88) !important;
    box-shadow: none !important;
}

html.dark .donut-legend-item,
html.dark .donut-legend-value,
html.dark .donut-legend-pct,
html.dark .donut-chart-center .center-value,
html.dark .donut-chart-center .center-label {
    color: rgba(255, 255, 255, 0.85) !important;
}

html.dark .ops-visual-head span,
html.dark .safety-status-card span {
    color: rgba(255, 255, 255, 0.55) !important;
}

html.dark .ops-visual-head strong {
    color: #5cdbd3 !important;
}

/* 设置：打印模板与风控 */
html.dark .settings-print-risk-panel,
html.dark .settings-info-item {
    background: #2a2a2a !important;
    border: 1px solid #434343 !important;
    color: rgba(255, 255, 255, 0.88) !important;
}

html.dark .settings-print-risk-panel header h4,
html.dark .settings-print-risk-panel .input-group label,
html.dark .settings-actions .input-group label,
html.dark .settings-toggle-copy strong {
    color: rgba(255, 255, 255, 0.9) !important;
}

html.dark .settings-print-risk-panel header p,
html.dark .settings-toggle-copy small {
    color: rgba(255, 255, 255, 0.55) !important;
}

html.dark .settings-toggle-row {
    background: rgba(22, 119, 255, 0.12) !important;
    border-color: rgba(22, 119, 255, 0.28) !important;
}

/* 客户管理 */
html.dark .customer-type-tabs {
    background: #323232 !important;
    border-color: #434343 !important;
}

html.dark .customer-type-tabs button {
    background: transparent !important;
    color: rgba(255, 255, 255, 0.65) !important;
}

html.dark .customer-type-tabs button.active {
    background: #1677ff !important;
    color: #fff !important;
    box-shadow: none !important;
}

html.dark .customer-card {
    background: #2a2a2a !important;
    border-color: #434343 !important;
}

html.dark .customer-card .customer-actions {
    background: #323232 !important;
    border: 1px solid #434343 !important;
}

html.dark .customer-card .customer-actions button,
html.dark .customer-card .customer-actions .btn,
html.dark .customer-card .customer-actions .btn-icon,
html.dark .customer-card .customer-actions .ink-icon-btn {
    background: transparent !important;
    color: rgba(255, 255, 255, 0.75) !important;
    border: 0 !important;
}

html.dark .business-share-toolbar {
    background: #323232 !important;
    border-color: #434343 !important;
    color: rgba(255, 255, 255, 0.75) !important;
}

/* 销售 / 采购 / 费用 */
html.dark .sale-customer-static,
html.dark .sale-customer-item,
html.dark .sale-overview-card,
html.dark .sale-record-form,
html.dark .sale-receivable-popover {
    background: #2a2a2a !important;
    border-color: #434343 !important;
    color: rgba(255, 255, 255, 0.88) !important;
}

html.dark .sale-customer-item:hover {
    background: #323232 !important;
    border-color: #1677ff !important;
}

html.dark .sale-customer-item strong {
    color: rgba(255, 255, 255, 0.92) !important;
}

html.dark .sale-customer-item span {
    color: #69b1ff !important;
}

html.dark .app-main .btn-secondary,
html.dark .app-main .btn.btn-secondary {
    background: #323232 !important;
    color: #69b1ff !important;
    border-color: #434343 !important;
}

html.dark .app-main a:not(.btn) {
    color: #69b1ff !important;
}

html.dark .tax-stat-card {
    background: #2a2a2a !important;
    border-color: #434343 !important;
}

html.dark .tax-stat-card.active {
    background: rgba(22, 119, 255, 0.16) !important;
    border-color: #1677ff !important;
}

html.dark .diag-row {
    background: #323232 !important;
    color: rgba(255, 255, 255, 0.85) !important;
}

html.dark .diag-row.fail {
    background: #3a2222 !important;
}

/* ========== v4 悬停态：禁止白底盖过浅色字 ========== */
html.dark .activity-item:hover,
html.dark .recent-activity .activity-item:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    color: rgba(255, 255, 255, 0.92) !important;
}

html.dark .activity-item:hover .activity-desc,
html.dark .activity-item:hover .activity-time,
html.dark .activity-item:hover .activity-details {
    color: rgba(255, 255, 255, 0.88) !important;
}

html.dark .activity-item:hover .activity-icon {
    background: rgba(22, 119, 255, 0.22) !important;
    color: #69b1ff !important;
}

html.dark .app-main tr:hover td,
html.dark .table tr:hover td,
html.dark .goods-list tr:hover td,
html.dark .warehouse-table tbody tr:hover {
    background: #3a3a3a !important;
    color: rgba(255, 255, 255, 0.88) !important;
}

html.dark .operator-task-row:hover,
html.dark .operator-completed-row:hover,
html.dark .operator-sync-summary:hover,
html.dark .operator-action-btn:hover,
html.dark .quick-action-btn:hover,
html.dark .sale-customer-item:hover,
html.dark .sale-receivable-contract-item:hover,
html.dark .header-apps-item:hover,
html.dark .global-share-button:hover,
html.dark .business-hub-card:hover,
html.dark .smart-alert:hover,
html.dark .card:hover {
    background: #323232 !important;
    border-color: #434343 !important;
    color: rgba(255, 255, 255, 0.88) !important;
}

html.dark .operator-task-dismiss:hover:not(:disabled),
html.dark .operator-sync-summary[aria-disabled="true"]:hover {
    background: #3a3a3a !important;
    border-color: #434343 !important;
    color: #5cdbd3 !important;
}

html.dark .pdf-copy-password-btn:hover {
    background: #323232 !important;
    color: #5cdbd3 !important;
}