/* =========================================================
   mquery user frontend theme
   - 默认：按时间自动（6:00-18:00 浅色，18:00-6:00 深色）
   - 手动：light / dark
   - 作用域：html[data-theme="dark"]，不加载本文件的页面（管理端）不受影响
   ========================================================= */

/* ---------- 主题切换组件（浅色/深色共用结构） ---------- */
.theme-switch {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--line, #e2e6ec);
    border-radius: 10px;
    background: var(--panel-2, #f5f7fa);
    white-space: nowrap;
}

.theme-switch button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: 0;
    border-radius: 7px;
    padding: 5px 8px;
    background: transparent;
    color: var(--muted, #666);
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    transition: background-color .18s ease, color .18s ease;
}

.theme-switch button svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.theme-switch button:hover {
    color: var(--ink, #12171d);
    background: rgba(148, 163, 184, .12);
}

.theme-switch button.is-active {
    background: var(--panel, #fff);
    color: var(--yellow, #04a79d);
    box-shadow: 0 1px 3px rgba(15, 23, 42, .08);
}

.theme-switch.is-compact button {
    padding: 6px;
}

.theme-switch.is-compact button span {
    display: none;
}

.wx-dropdown-theme {
    padding: 9px 12px 8px;
    border-bottom: 1px solid var(--line);
}

.wx-dropdown-theme > span {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 11px;
}

.wx-dropdown-theme .theme-switch {
    width: 100%;
    justify-content: space-between;
}

.sidebar-theme {
    padding: 8px 12px 10px;
    border-top: 1px solid var(--line);
}

.sidebar-theme > span {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 11px;
}

.sidebar-theme .theme-switch {
    width: 100%;
    justify-content: space-between;
}

.member-theme-action {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: default;
}

.member-theme-action .member-action-main {
    flex: 1;
}

.member-theme-action .theme-switch {
    flex-shrink: 0;
}

/* ---------- 深色变量 ---------- */
html[data-theme="dark"] {
    --bg: #0B1120;
    --cream: #0B1120;
    --tan: #111827;
    --panel: #111827;
    --panel-2: #172033;
    --panel-3: #1B263B;
    --white: #111827;
    --soft: #172033;
    --line: #263449;
    --ink: #F1F5F9;
    --ink-2: #E2E8F0;
    --muted: #94A3B8;
    --muted-2: #64748B;
    --yellow: #2DD4BF;
    --yellow-deep: #14B8A6;
    --yellow-pale: rgba(45, 212, 191, .14);
    --orange: #FBBF24;
    --green: #34D399;
    --red: #FB7185;
    --blue: #38BDF8;
    --shadow: 0 12px 32px rgba(2, 6, 23, .45);
    color-scheme: dark;
}

/* ---------- 全局 ---------- */
html[data-theme="dark"] {
    background: var(--bg);
}

html[data-theme="dark"] body {
    background: var(--bg) !important;
    color: var(--ink-2) !important;
}

html[data-theme="dark"] .wx-back {
    background: var(--panel-2) !important;
    border-color: var(--line) !important;
    color: var(--ink-2) !important;
}

html[data-theme="dark"] .co-service {
    background: var(--panel) !important;
    border-color: var(--line) !important;
}

html[data-theme="dark"] .co-service-desc {
    color: var(--muted) !important;
}

html[data-theme="dark"] .co-service-meta b {
    color: var(--ink-2) !important;
}

html[data-theme="dark"] .co-service button.is-active {
    background: var(--panel-2) !important;
    border-color: var(--line) !important;
    color: var(--ink) !important;
}

html[data-theme="dark"] .co-segment {
    background: #0F172A !important;
}

html[data-theme="dark"] .co-segment button {
    background: transparent !important;
    color: var(--muted) !important;
}

html[data-theme="dark"] .co-segment button.is-active {
    background: var(--panel-3) !important;
    color: var(--yellow) !important;
    box-shadow: none !important;
}

html[data-theme="dark"] .co-detail {
    background: var(--panel-2) !important;
    border: 1px solid var(--line) !important;
    color: var(--ink) !important;
}

html[data-theme="dark"] .co-detail * {
    color: var(--ink) !important;
}

html[data-theme="dark"] #orderInput {
    background: #0F172A !important;
    border-color: #334155 !important;
    color: var(--ink) !important;
}

html[data-theme="dark"] textarea.whiteip-textarea {
    background: #0F172A !important;
    border-color: #334155 !important;
    color: var(--ink) !important;
}

html[data-theme="dark"] .wx-page,
html[data-theme="dark"] .ws-app,
html[data-theme="dark"] .page-wrapper,
html[data-theme="dark"] .main-container,
html[data-theme="dark"] .wx-shell,
html[data-theme="dark"] .ws-main,
html[data-theme="dark"] .ws-wrap,
html[data-theme="dark"] .wx-container {
    background-color: var(--bg);
}

html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] h5,
html[data-theme="dark"] h6,
html[data-theme="dark"] .wx-page-title,
html[data-theme="dark"] .wx-card-title,
html[data-theme="dark"] .ws-service-name,
html[data-theme="dark"] .ws-brand,
html[data-theme="dark"] .member-action-title,
html[data-theme="dark"] .order-service-name,
html[data-theme="dark"] .order-page-title,
html[data-theme="dark"] .charge-title,
html[data-theme="dark"] .help-title,
html[data-theme="dark"] .whiteip-label {
    color: var(--ink);
}

html[data-theme="dark"] p,
html[data-theme="dark"] .wx-page-sub,
html[data-theme="dark"] .ws-service-desc,
html[data-theme="dark"] .ws-service-meta,
html[data-theme="dark"] .member-action-desc,
html[data-theme="dark"] .member-meta-line,
html[data-theme="dark"] .order-time-label,
html[data-theme="dark"] .record-time,
html[data-theme="dark"] .batch-progress-hint,
html[data-theme="dark"] .whiteip-desc,
html[data-theme="dark"] .help-desc,
html[data-theme="dark"] .charge-desc-row {
    color: var(--muted);
}

html[data-theme="dark"] ::selection {
    background: rgba(45, 212, 191, .28);
    color: #F8FAFC;
}

html[data-theme="dark"] ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

html[data-theme="dark"] ::-webkit-scrollbar-track {
    background: #0B1120;
}

html[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #263449;
    border-radius: 6px;
}

/* ---------- 顶栏 ---------- */
html[data-theme="dark"] .wx-topbar,
html[data-theme="dark"] .wx-topbar.is-scrolled,
html[data-theme="dark"] .ws-header,
html[data-theme="dark"] .ws-header.is-scrolled {
    background: #0F172A !important;
    border-color: var(--line) !important;
    box-shadow: 0 8px 24px rgba(2, 6, 23, .35);
}

html[data-theme="dark"] .wx-topbar-nav a,
html[data-theme="dark"] .ws-topbar-nav a {
    color: #CBD5E1 !important;
}

html[data-theme="dark"] .wx-topbar-nav a:hover,
html[data-theme="dark"] .ws-topbar-nav a:hover {
    color: var(--ink) !important;
}

html[data-theme="dark"] .wx-brand,
html[data-theme="dark"] .wx-brand strong,
html[data-theme="dark"] .ws-brand,
html[data-theme="dark"] .ws-brand strong {
    color: #F4F7F8 !important;
}

html[data-theme="dark"] .wx-icon-btn,
html[data-theme="dark"] .wx-user-trigger,
html[data-theme="dark"] .ws-icon-btn,
html[data-theme="dark"] .ws-user-trigger {
    color: var(--ink-2) !important;
}

html[data-theme="dark"] .wx-user-dropdown,
html[data-theme="dark"] .ws-user-dropdown,
html[data-theme="dark"] .uk-dropdown,
html[data-theme="dark"] .uk-dropdown-nav {
    background: var(--panel-3) !important;
    border-color: var(--line) !important;
    color: var(--ink-2) !important;
    box-shadow: var(--shadow);
}

html[data-theme="dark"] .wx-user-dropdown a,
html[data-theme="dark"] .ws-user-dropdown a,
html[data-theme="dark"] .uk-dropdown a {
    color: var(--ink-2) !important;
}

html[data-theme="dark"] .wx-user-dropdown a:hover,
html[data-theme="dark"] .ws-user-dropdown a:hover,
html[data-theme="dark"] .uk-dropdown a:hover {
    background: var(--panel-2) !important;
    color: var(--yellow) !important;
}

html[data-theme="dark"] .wx-user-dropdown .is-logout,
html[data-theme="dark"] .ws-user-dropdown .is-logout {
    color: var(--red) !important;
}

html[data-theme="dark"] .wx-dropdown-theme {
    border-color: var(--line);
}

html[data-theme="dark"] .theme-switch {
    background: #0F172A;
    border-color: var(--line);
}

html[data-theme="dark"] .theme-switch button {
    color: var(--muted);
}

html[data-theme="dark"] .theme-switch button.is-active {
    background: var(--panel-3);
    color: var(--yellow);
    box-shadow: none;
}

/* ---------- 侧栏 ---------- */
html[data-theme="dark"] .wx-sidebar,
html[data-theme="dark"] .ws-sidebar {
    background: #0F172A !important;
    border-color: var(--line) !important;
}

html[data-theme="dark"] .wx-shell-main,
html[data-theme="dark"] .ws-main {
    background: var(--bg) !important;
}

html[data-theme="dark"] .wx-sidebar-profile,
html[data-theme="dark"] .ws-sidebar-profile,
html[data-theme="dark"] .wx-sidebar-package,
html[data-theme="dark"] .ws-package,
html[data-theme="dark"] .wx-sidebar-balance,
html[data-theme="dark"] .ws-balance {
    background: var(--panel) !important;
    border-color: var(--line) !important;
    color: var(--ink-2);
}

html[data-theme="dark"] .wx-sidebar-meta strong,
html[data-theme="dark"] .ws-sidebar-meta strong {
    color: var(--ink-2) !important;
}

html[data-theme="dark"] .wx-sidebar-meta span,
html[data-theme="dark"] .ws-sidebar-meta span {
    color: var(--muted) !important;
}

html[data-theme="dark"] .wx-sidebar-package {
    background: rgba(45, 212, 191, .06) !important;
    border-color: rgba(45, 212, 191, .18) !important;
}

html[data-theme="dark"] .wx-sidebar-package strong {
    color: var(--ink-2) !important;
}

html[data-theme="dark"] .wx-sidebar-package-time {
    color: var(--muted) !important;
}

html[data-theme="dark"] .wx-sidebar-package-label {
    color: var(--yellow) !important;
}

html[data-theme="dark"] .wx-side-link,
html[data-theme="dark"] .ws-side-link,
html[data-theme="dark"] .ws-nav-item,
html[data-theme="dark"] .wx-sidebar-label,
html[data-theme="dark"] .ws-nav-label,
html[data-theme="dark"] .wx-sidebar-package-label,
html[data-theme="dark"] .ws-package-label {
    color: var(--muted) !important;
}

html[data-theme="dark"] .wx-side-link:hover,
html[data-theme="dark"] .ws-side-link:hover,
html[data-theme="dark"] .ws-nav-item:hover {
    background: var(--panel-2) !important;
    color: var(--ink) !important;
}

html[data-theme="dark"] .wx-side-link.is-active,
html[data-theme="dark"] .ws-side-link.is-active,
html[data-theme="dark"] .ws-nav-item.is-active {
    background: var(--panel-3) !important;
    color: var(--yellow) !important;
}

html[data-theme="dark"] .wx-sidebar-toggle,
html[data-theme="dark"] .ws-sidebar-toggle {
    color: var(--muted);
    border-color: var(--line);
}

html[data-theme="dark"] .sidebar-theme {
    border-color: var(--line);
}

html[data-theme="dark"] .wx-sidebar-balance a,
html[data-theme="dark"] .ws-balance a,
html[data-theme="dark"] .ws-charge-btn,
html[data-theme="dark"] .member-charge-btn {
    background: var(--yellow) !important;
    color: #042F2E !important;
    border-color: var(--yellow) !important;
}

/* ---------- 卡片/面板 ---------- */
html[data-theme="dark"] .ws-service-card,
html[data-theme="dark"] .ws-panel,
html[data-theme="dark"] .ws-categories,
html[data-theme="dark"] .ws-tabs-row,
html[data-theme="dark"] .wx-card,
html[data-theme="dark"] .member-hero,
html[data-theme="dark"] .member-action,
html[data-theme="dark"] .member-logs,
html[data-theme="dark"] .charge-card,
html[data-theme="dark"] .charge-section,
html[data-theme="dark"] .help-card,
html[data-theme="dark"] .help-grid,
html[data-theme="dark"] .order-panel,
html[data-theme="dark"] .order-item,
html[data-theme="dark"] .record-card,
html[data-theme="dark"] .bill-tabs,
html[data-theme="dark"] .whiteip-desc,
html[data-theme="dark"] .whiteip-hint,
html[data-theme="dark"] .batch-stat,
html[data-theme="dark"] .batch-progress-card,
html[data-theme="dark"] .batch-services,
html[data-theme="dark"] .batch-workspace,
html[data-theme="dark"] .batch-toolbar,
html[data-theme="dark"] .batch-service-search,
html[data-theme="dark"] .batch-export-cols,
html[data-theme="dark"] .batch-modal,
html[data-theme="dark"] .order-detail-modal,
html[data-theme="dark"] .order-search-modal,
html[data-theme="dark"] .wx-modal,
html[data-theme="dark"] .auth-card,
html[data-theme="dark"] .login-card,
html[data-theme="dark"] .register-card {
    background: var(--panel) !important;
    border-color: var(--line) !important;
    color: var(--ink-2) !important;
}

html[data-theme="dark"] .ws-service-card:hover,
html[data-theme="dark"] .wx-card:hover,
html[data-theme="dark"] .member-action:hover,
html[data-theme="dark"] .order-item:hover,
html[data-theme="dark"] .order-row:hover,
html[data-theme="dark"] .batch-service-item:hover,
html[data-theme="dark"] .batch-btn:hover,
html[data-theme="dark"] .order-tab:hover {
    background: var(--panel-2) !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .ws-service-price,
html[data-theme="dark"] .ws-service-id,
html[data-theme="dark"] .charge-price,
html[data-theme="dark"] .record-amount {
    color: var(--yellow) !important;
}

html[data-theme="dark"] .ws-service-head,
html[data-theme="dark"] .ws-service-bottom,
html[data-theme="dark"] .member-action + .member-action,
html[data-theme="dark"] .charge-section + .charge-section,
html[data-theme="dark"] .order-row + .order-row {
    border-color: var(--line) !important;
}

/* 服务分类 */
html[data-theme="dark"] .ws-filter-row,
html[data-theme="dark"] .ws-tabs,
html[data-theme="dark"] .ws-tabs-row {
    background: transparent !important;
    border-color: var(--line) !important;
}

html[data-theme="dark"] .ws-cat,
html[data-theme="dark"] .ws-tab {
    background: transparent !important;
    border-color: transparent !important;
    color: var(--muted) !important;
}

html[data-theme="dark"] .ws-cat.is-active,
html[data-theme="dark"] .ws-tab.is-active {
    background: var(--panel-3) !important;
    color: var(--yellow) !important;
    border-color: var(--line) !important;
}

html[data-theme="dark"] .ws-cat-search,
html[data-theme="dark"] .ws-cat-search-box {
    background: #0F172A !important;
    border-color: var(--line) !important;
    color: var(--ink-2) !important;
}

html[data-theme="dark"] .ws-cat-search-box input {
    background: transparent !important;
    color: var(--ink) !important;
}

html[data-theme="dark"] .ws-empty,
html[data-theme="dark"] .order-empty,
html[data-theme="dark"] .wx-empty,
html[data-theme="dark"] .batch-services-empty {
    color: var(--muted-2) !important;
}

/* ---------- 表单 ---------- */
html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
html[data-theme="dark"] textarea,
html[data-theme="dark"] select,
html[data-theme="dark"] .wx-input,
html[data-theme="dark"] .order-input,
html[data-theme="dark"] .order-select,
html[data-theme="dark"] .order-search-textarea,
html[data-theme="dark"] .whiteip-textarea {
    background: #0F172A !important;
    border-color: #334155 !important;
    color: var(--ink) !important;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
    color: var(--muted-2) !important;
}

html[data-theme="dark"] input:focus,
html[data-theme="dark"] textarea:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] .wx-input:focus,
html[data-theme="dark"] .order-input:focus {
    border-color: var(--yellow) !important;
    box-shadow: 0 0 0 3px rgba(45, 212, 191, .16) !important;
}

/* 覆盖 wechat-theme.css 中 #app main 的强制白底 */
html[data-theme="dark"] #app main input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
html[data-theme="dark"] #app main textarea,
html[data-theme="dark"] #app main select {
    background: #0F172A !important;
    border-color: #334155 !important;
    color: var(--ink) !important;
}

html[data-theme="dark"] #app main input::placeholder,
html[data-theme="dark"] #app main textarea::placeholder {
    color: var(--muted-2) !important;
}

html[data-theme="dark"] #app main button.is-active {
    background: var(--panel-2) !important;
    border-color: var(--line) !important;
    color: var(--ink) !important;
}

html[data-theme="dark"] input[type="checkbox"],
html[data-theme="dark"] input[type="radio"],
html[data-theme="dark"] input[type="range"] {
    accent-color: var(--yellow);
}

html[data-theme="dark"] .order-form-label,
html[data-theme="dark"] .whiteip-label,
html[data-theme="dark"] .member-form label,
html[data-theme="dark"] .wx-field label {
    color: var(--muted) !important;
}

html[data-theme="dark"] .datetimepicker,
html[data-theme="dark"] .datetimepicker-dropdown,
html[data-theme="dark"] .datetimepicker table,
html[data-theme="dark"] .bootstrap-datetimepicker-widget {
    background: var(--panel-3) !important;
    color: var(--ink-2) !important;
    border-color: var(--line) !important;
}

/* ---------- 按钮 ---------- */
html[data-theme="dark"] .wx-btn,
html[data-theme="dark"] .batch-btn,
html[data-theme="dark"] .order-tool-btn,
html[data-theme="dark"] .order-page-btn,
html[data-theme="dark"] .order-bulk-exit,
html[data-theme="dark"] .ws-icon-btn,
html[data-theme="dark"] .wx-icon-btn {
    border-color: var(--line) !important;
    color: var(--ink-2) !important;
}

html[data-theme="dark"] .wx-btn-ghost,
html[data-theme="dark"] .batch-btn,
html[data-theme="dark"] .order-tool-btn,
html[data-theme="dark"] .order-page-btn,
html[data-theme="dark"] .order-bulk-exit,
html[data-theme="dark"] .btn-outline {
    background: var(--panel-2) !important;
}

html[data-theme="dark"] .wx-btn-ghost:hover,
html[data-theme="dark"] .batch-btn:hover,
html[data-theme="dark"] .order-tool-btn:hover,
html[data-theme="dark"] .order-page-btn:hover {
    background: var(--panel-3) !important;
}

html[data-theme="dark"] .wx-btn-dark,
html[data-theme="dark"] .btn,
html[data-theme="dark"] .btn-primary,
html[data-theme="dark"] .btn-yellow,
html[data-theme="dark"] .batch-btn.is-primary,
html[data-theme="dark"] .wx-btn.is-primary {
    background: var(--yellow) !important;
    border-color: var(--yellow) !important;
    color: #042F2E !important;
}

html[data-theme="dark"] .batch-btn.is-warn {
    background: rgba(251, 113, 133, .16) !important;
    border-color: rgba(251, 113, 133, .4) !important;
    color: var(--red) !important;
}

html[data-theme="dark"] .batch-btn:disabled,
html[data-theme="dark"] .wx-btn:disabled,
html[data-theme="dark"] button:disabled {
    opacity: .45 !important;
}

/* ---------- 表格 ---------- */
html[data-theme="dark"] table,
html[data-theme="dark"] .batch-table,
html[data-theme="dark"] .batch-html-result table {
    background: var(--panel) !important;
    color: var(--ink-2) !important;
}

html[data-theme="dark"] th,
html[data-theme="dark"] .batch-table th,
html[data-theme="dark"] .order-list-head {
    background: var(--panel-2) !important;
    color: var(--muted) !important;
    border-color: var(--line) !important;
}

html[data-theme="dark"] td,
html[data-theme="dark"] .batch-table td,
html[data-theme="dark"] .order-row,
html[data-theme="dark"] .order-cell {
    border-color: var(--line) !important;
    color: var(--ink-2) !important;
}

html[data-theme="dark"] tr:hover,
html[data-theme="dark"] .order-row:hover {
    background: var(--panel-2) !important;
}

html[data-theme="dark"] .order-page-info,
html[data-theme="dark"] .order-page-size,
html[data-theme="dark"] .order-total {
    color: var(--muted) !important;
}

html[data-theme="dark"] .order-quick-search,
html[data-theme="dark"] .order-quick-search input,
html[data-theme="dark"] .order-page select,
html[data-theme="dark"] .order-toolbar select,
html[data-theme="dark"] select.order-select {
    background: #0F172A !important;
    border-color: var(--line) !important;
    color: var(--ink-2) !important;
}

html[data-theme="dark"] .order-quick-search {
    border: 1px solid var(--line);
    border-radius: 8px;
}

html[data-theme="dark"] .order-expand {
    background: var(--panel) !important;
    border-color: rgba(45, 212, 191, .35) !important;
}

html[data-theme="dark"] .order-expand-meta {
    color: var(--muted) !important;
}

html[data-theme="dark"] .order-expand-meta b {
    color: var(--ink-2) !important;
}

html[data-theme="dark"] .order-detail-result {
    background: var(--panel-2) !important;
    border-color: var(--line) !important;
}

html[data-theme="dark"] .order-detail-result pre {
    color: var(--ink-2) !important;
}

html[data-theme="dark"] .order-result-head {
    color: var(--muted) !important;
}

html[data-theme="dark"] .order-service-name,
html[data-theme="dark"] .order-service-id {
    color: var(--ink-2) !important;
}

html[data-theme="dark"] .order-service-id {
    color: var(--yellow) !important;
}

html[data-theme="dark"] .order-quick-search input {
    border: 0 !important;
}

html[data-theme="dark"] .ws-cat-search-toggle {
    background: transparent !important;
    border-color: transparent !important;
    color: var(--muted) !important;
}

/* ---------- 状态 ---------- */
html[data-theme="dark"] .wx-badge-gray,
html[data-theme="dark"] .is-wait {
    background: rgba(148, 163, 184, .14) !important;
    color: #94A3B8 !important;
}

html[data-theme="dark"] .wx-badge-green,
html[data-theme="dark"] .is-done,
html[data-theme="dark"] .is-accept {
    background: rgba(52, 211, 153, .14) !important;
    color: var(--green) !important;
}

html[data-theme="dark"] .wx-badge-red,
html[data-theme="dark"] .is-reject,
html[data-theme="dark"] .is-cancel {
    background: rgba(251, 113, 133, .14) !important;
    color: var(--red) !important;
}

html[data-theme="dark"] .wx-badge-yellow,
html[data-theme="dark"] .is-processing {
    background: rgba(56, 189, 248, .14) !important;
    color: var(--blue) !important;
}

/* ---------- 弹窗/遮罩 ---------- */
html[data-theme="dark"] .wx-modal-mask,
html[data-theme="dark"] .order-detail-mask,
html[data-theme="dark"] .batch-modal-mask,
html[data-theme="dark"] .auth-result-mask,
html[data-theme="dark"] .uk-modal-background {
    background: rgba(2, 6, 23, .72) !important;
}

html[data-theme="dark"] .wx-modal-title,
html[data-theme="dark"] .order-detail-title,
html[data-theme="dark"] .batch-modal-title {
    color: var(--ink) !important;
}

html[data-theme="dark"] .wx-modal-tip,
html[data-theme="dark"] .order-detail-meta,
html[data-theme="dark"] .batch-hint {
    color: var(--muted) !important;
}

/* ---------- 登录页 ---------- */
html[data-theme="dark"] .page-auth,
html[data-theme="dark"] .auth-main {
    background: var(--bg) !important;
}

html[data-theme="dark"] .auth-panel,
html[data-theme="dark"] .login-card,
html[data-theme="dark"] .register-card {
    background: var(--panel) !important;
    border-color: var(--line) !important;
    color: var(--ink-2) !important;
}

html[data-theme="dark"] .auth-overlay {
    background: #0F172A !important;
    border-color: var(--line) !important;
}

html[data-theme="dark"] .panel-head,
html[data-theme="dark"] .brand-text,
html[data-theme="dark"] .intro,
html[data-theme="dark"] .login-card h3,
html[data-theme="dark"] .register-card h3 {
    color: var(--ink) !important;
}

html[data-theme="dark"] .auth-tabs,
html[data-theme="dark"] .tab-switch {
    background: var(--panel-2) !important;
    border-color: var(--line) !important;
}

html[data-theme="dark"] .tab-btn {
    color: var(--muted) !important;
}

html[data-theme="dark"] .tab-btn.is-active {
    background: var(--panel-3) !important;
    color: var(--yellow) !important;
}

html[data-theme="dark"] .field input,
html[data-theme="dark"] .input-wrap {
    background: #0F172A !important;
    border-color: #334155 !important;
    color: var(--ink) !important;
}

html[data-theme="dark"] .field-icon,
html[data-theme="dark"] .eyebrow,
html[data-theme="dark"] .footer,
html[data-theme="dark"] .footer-copy,
html[data-theme="dark"] .footer-links,
html[data-theme="dark"] .qr-tip,
html[data-theme="dark"] .qr-sub,
html[data-theme="dark"] .register-line {
    color: var(--muted) !important;
}

html[data-theme="dark"] .qr-frame,
html[data-theme="dark"] .mini-stats,
html[data-theme="dark"] .stat {
    background: var(--panel-2) !important;
    border-color: var(--line) !important;
}

html[data-theme="dark"] .topbar {
    background: #0F172A !important;
    border-color: var(--line) !important;
}

/* ---------- 批量查询 ---------- */
html[data-theme="dark"] .batch-stats,
html[data-theme="dark"] .batch-progress-card,
html[data-theme="dark"] .batch-services,
html[data-theme="dark"] .batch-workspace,
html[data-theme="dark"] .batch-toolbar {
    border-color: var(--line) !important;
}

html[data-theme="dark"] .batch-progress-track {
    background: #0F172A !important;
}

html[data-theme="dark"] .batch-service-item.is-active,
html[data-theme="dark"] .batch-cat.is-active {
    background: var(--panel-2) !important;
    color: var(--yellow) !important;
}

html[data-theme="dark"] .batch-service-search input {
    background: transparent !important;
}

html[data-theme="dark"] .batch-html-result,
html[data-theme="dark"] .batch-html-result th,
html[data-theme="dark"] .batch-html-result td {
    color: var(--ink-2) !important;
    border-color: var(--line) !important;
}

html[data-theme="dark"] .batch-stats {
    background: var(--panel) !important;
    border-color: var(--line) !important;
}

html[data-theme="dark"] .batch-stat + .batch-stat {
    border-left-color: var(--line) !important;
}

html[data-theme="dark"] .batch-service-item {
    color: var(--muted) !important;
}

html[data-theme="dark"] .batch-service-item:hover {
    background: var(--panel-2) !important;
}

html[data-theme="dark"] .batch-service-item.is-active {
    background: rgba(45, 212, 191, .12) !important;
    color: var(--yellow) !important;
}

html[data-theme="dark"] .batch-service-item.is-active .batch-service-tag,
html[data-theme="dark"] .batch-service-item.is-active em {
    color: var(--yellow) !important;
}

html[data-theme="dark"] .batch-services-foot {
    background: var(--panel) !important;
    border-color: var(--line) !important;
    color: var(--ink-2) !important;
}

html[data-theme="dark"] .batch-services-foot em {
    color: var(--yellow) !important;
}

html[data-theme="dark"] .batch-progress-head {
    color: var(--muted) !important;
}

html[data-theme="dark"] .batch-progress-total strong {
    color: var(--ink) !important;
}

html[data-theme="dark"] .batch-progress-total span {
    color: var(--muted) !important;
}

html[data-theme="dark"] .batch-table th,
html[data-theme="dark"] .batch-th-index {
    color: #A8B6C8 !important;
}

html[data-theme="dark"] .batch-progress-track {
    background: #0F172A !important;
}

html[data-theme="dark"] .wx-bottom {
    background: #0F172A !important;
    border-color: var(--line) !important;
    color: var(--muted) !important;
}

html[data-theme="dark"] .wx-bottom a {
    color: var(--muted) !important;
}

html[data-theme="dark"] .wx-bottom a.is-active {
    color: var(--yellow) !important;
}

html[data-theme="dark"] .wx-bottom-ico {
    color: inherit;
}

/* ---------- 移动端 ---------- */
html[data-theme="dark"] .wx-bottom-bar,
html[data-theme="dark"] .wx-mobile-nav,
html[data-theme="dark"] .ws-mobile-nav,
html[data-theme="dark"] .ws-mobile-info,
html[data-theme="dark"] .ws-mobile-package {
    background: #0F172A !important;
    border-color: var(--line) !important;
    color: var(--muted) !important;
}

html[data-theme="dark"] .wx-bottom-bar a.is-active,
html[data-theme="dark"] .wx-mobile-nav a.is-active,
html[data-theme="dark"] .ws-mobile-nav a.is-active {
    color: var(--yellow) !important;
}

/* ---------- Toast ---------- */
html[data-theme="dark"] .uk-notification-message,
html[data-theme="dark"] .bw-toast,
html[data-theme="dark"] .toast {
    background: var(--panel-3) !important;
    border-color: var(--line) !important;
    color: var(--ink-2) !important;
    box-shadow: var(--shadow);
}

/* ---------- 过渡 ---------- */
html.theme-ready body,
html.theme-ready .wx-card,
html.theme-ready .ws-service-card,
html.theme-ready .ws-panel,
html.theme-ready .ws-sidebar,
html.theme-ready .wx-sidebar,
html.theme-ready .wx-topbar,
html.theme-ready .ws-header,
html.theme-ready .wx-input,
html.theme-ready .batch-btn,
html.theme-ready .order-tool-btn,
html.theme-ready .member-action,
html.theme-ready .theme-switch button {
    transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}

@media (prefers-reduced-motion: reduce) {
    html.theme-ready body,
    html.theme-ready *,
    html.theme-ready *::before,
    html.theme-ready *::after {
        transition: none !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}
