/* Shared appearance and language controls. The active theme is resolved by preferences.js. */

html[data-theme="light"] { color-scheme: light; }
html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #edf3f7;
  --ink-soft: #c0ccd7;
  --muted: #9aa9b8;
  --muted-dark: #8a9aaa;
  --line: #2b3c4f;
  --paper: #142231;
  --canvas: #0b141e;
  --white: #152535;
  --navy: #091521;
  --navy-2: #102235;
  --shadow: 0 22px 60px rgba(0, 0, 0, .28);
}

html[data-theme="dark"] body { color: var(--ink); background: var(--canvas); }
html[data-theme="dark"] .panel-card,
html[data-theme="dark"] .metric-card,
html[data-theme="dark"] .history-card,
html[data-theme="dark"] .standard-card,
html[data-theme="dark"] .settings-card,
html[data-theme="dark"] .settings-status-card,
html[data-theme="dark"] .settings-scope { border-color: var(--line); background: #142231; box-shadow: var(--shadow); }
html[data-theme="dark"] .topbar,
html[data-theme="dark"] .page-footer { border-color: var(--line); }
html[data-theme="dark"] .breadcrumb,
html[data-theme="dark"] .hero-description,
html[data-theme="dark"] .metric-label,
html[data-theme="dark"] .metric-card small,
html[data-theme="dark"] .field-note,
html[data-theme="dark"] .form-hint,
html[data-theme="dark"] .results-footer,
html[data-theme="dark"] .table-search,
html[data-theme="dark"] .history-row span,
html[data-theme="dark"] .standard-card p,
html[data-theme="dark"] .detail-value,
html[data-theme="dark"] .detail-primary p,
html[data-theme="dark"] .help-content { color: #9eacba; }
html[data-theme="dark"] .breadcrumb strong,
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] .metric-card strong,
html[data-theme="dark"] .standard-card h2,
html[data-theme="dark"] .history-row strong,
html[data-theme="dark"] .detail-primary h3 { color: var(--ink); }
html[data-theme="dark"] .form-field input,
html[data-theme="dark"] .form-field select,
html[data-theme="dark"] .form-field textarea,
html[data-theme="dark"] .table-search input,
html[data-theme="dark"] .crm-form input,
html[data-theme="dark"] .crm-form select,
html[data-theme="dark"] .crm-form textarea,
html[data-theme="dark"] .crm-search input,
html[data-theme="dark"] .crm-table-toolbar select { border-color: #3a4d61; color: var(--ink); background: #0f1d2b; }
html[data-theme="dark"] .form-field input::placeholder,
html[data-theme="dark"] .form-field textarea::placeholder,
html[data-theme="dark"] .table-search input::placeholder,
html[data-theme="dark"] .crm-form input::placeholder,
html[data-theme="dark"] .crm-form textarea::placeholder,
html[data-theme="dark"] .crm-search input::placeholder { color: #718395; }
html[data-theme="dark"] .table-wrap,
html[data-theme="dark"] .history-row,
html[data-theme="dark"] .standard-status,
html[data-theme="dark"] .source-row,
html[data-theme="dark"] .detail-source,
html[data-theme="dark"] .command-preview,
html[data-theme="dark"] .sub-panel { border-color: var(--line); background: #102030; }
html[data-theme="dark"] .results-table th,
html[data-theme="dark"] .results-table td,
html[data-theme="dark"] .crm-table th,
html[data-theme="dark"] .crm-table td { border-color: var(--line); }
html[data-theme="dark"] .results-table th,
html[data-theme="dark"] .crm-table th { color: #91a2b2; }
html[data-theme="dark"] .results-table td,
html[data-theme="dark"] .crm-table td,
html[data-theme="dark"] .cell-stack strong,
html[data-theme="dark"] .detail-pair strong,
html[data-theme="dark"] .detail-pair a { color: #d9e3e9; }
html[data-theme="dark"] .detail-drawer,
html[data-theme="dark"] .help-dialog { border-color: var(--line); background: #122130; }
html[data-theme="dark"] .close-button { color: #afbdc8; background: #223547; }
html[data-theme="dark"] .export-menu { border-color: var(--line); background: #142536; box-shadow: 0 15px 35px rgba(0, 0, 0, .35); }
html[data-theme="dark"] .export-menu button,
html[data-theme="dark"] .page-button { color: #c7d2dc; }
html[data-theme="dark"] .export-menu button:hover,
html[data-theme="dark"] .page-button:hover { background: #20364b; }
html[data-theme="dark"] .crm-card,
html[data-theme="dark"] .crm-metric,
html[data-theme="dark"] .crm-modal-dialog { border-color: var(--line); background: #142536; box-shadow: var(--shadow); }
html[data-theme="dark"] .crm-card-heading p,
html[data-theme="dark"] .crm-metric small,
html[data-theme="dark"] .crm-metric em,
html[data-theme="dark"] .crm-empty p,
html[data-theme="dark"] .crm-table td,
html[data-theme="dark"] .crm-select span,
html[data-theme="dark"] .crm-import-hint { color: #94a4b2; }
html[data-theme="dark"] .crm-card-heading h2,
html[data-theme="dark"] .crm-metric strong,
html[data-theme="dark"] .crm-table td strong,
html[data-theme="dark"] .crm-modal-dialog h2 { color: var(--ink); }
html[data-theme="dark"] .crm-table-wrap,
html[data-theme="dark"] .crm-table-toolbar,
html[data-theme="dark"] .crm-modal-head { border-color: var(--line); }
html[data-theme="dark"] .crm-select-menu,
html[data-theme="dark"] .crm-custom-select { border-color: #3a4d61; background: #102030; }
html[data-theme="dark"] .crm-select-option:hover,
html[data-theme="dark"] .crm-select-option[aria-selected="true"] { background: #20364b; }
html[data-theme="dark"] .crm-select-option { color: #d3dfe6; }
html[data-theme="dark"] .crm-view-pane,
html[data-theme="dark"] .crm-route-loading { color: var(--ink); }
html[data-theme="dark"] .site-header::before { background: #091521; }
html[data-theme="dark"] .site-shell,
html[data-theme="dark"] .site-footer,
html[data-theme="dark"] .trust-strip { color: var(--ink); }
html[data-theme="dark"] .site-brand,
html[data-theme="dark"] .section-heading h2,
html[data-theme="dark"] .workflow-heading h2,
html[data-theme="dark"] .boundary-copy h2,
html[data-theme="dark"] .cta-section h2 { color: var(--ink); }
html[data-theme="dark"] .card-paper,
html[data-theme="dark"] .plan-card:not(.plan-card-pro),
html[data-theme="dark"] .boundary-list > div { border-color: var(--line); background: #142231; }
html[data-theme="dark"] .card-paper h3,
html[data-theme="dark"] .card-paper p,
html[data-theme="dark"] .section-heading > p,
html[data-theme="dark"] .boundary-copy > p,
html[data-theme="dark"] .boundary-list p,
html[data-theme="dark"] .trust-strip small,
html[data-theme="dark"] .site-footer { color: #9eacba; }
html[data-theme="dark"] .hero h1,
html[data-theme="dark"] .plan-card:not(.plan-card-pro) h3,
html[data-theme="dark"] .trust-strip strong { color: var(--ink); }
html[data-theme="dark"] .billing-header,
html[data-theme="dark"] .billing-footer { border-color: var(--line); }
html[data-theme="dark"] .billing-brand,
html[data-theme="dark"] .billing-intro h1,
html[data-theme="dark"] .account-summary strong,
html[data-theme="dark"] .notice strong { color: var(--ink); }
html[data-theme="dark"] .notice,
html[data-theme="dark"] .account-panel,
html[data-theme="dark"] .plan-card:not(.plan-card-pro) { border-color: var(--line); background: #142231; }
html[data-theme="dark"] .account-summary > div { background: #1b2c3c; }
html[data-theme="dark"] .notice p,
html[data-theme="dark"] .billing-intro > p:last-child,
html[data-theme="dark"] .billing-footnote,
html[data-theme="dark"] .metric-label,
html[data-theme="dark"] .metric-hint { color: #9eacba; }
html[data-theme="dark"] .button-secondary { border-color: #3a4d61; color: var(--ink); background: #1a2b3b; }
html[data-theme="dark"] .checkout-panel { background: #102235; }
html[data-theme="light"] body.login-page { color: #203025; background: radial-gradient(circle at 20% 10%, rgba(189, 231, 64, .22), transparent 35%), #f1f4ed; }
html[data-theme="light"] .login-card { border-color: #cad6c5; background: rgba(255, 255, 255, .96); box-shadow: 0 24px 70px rgba(49, 74, 43, .14); }
html[data-theme="light"] .login-card .brand span { color: #667564; }
html[data-theme="light"] .login-card .intro,
html[data-theme="light"] .login-card label,
html[data-theme="light"] .login-card .foot { color: #607060; }
html[data-theme="light"] .login-card input { border-color: #c1cec0; color: #203025; background: #f7faf5; }
html[data-theme="light"] .login-card .login-divider { color: #788878; }
html[data-theme="light"] .login-card .login-divider::before,
html[data-theme="light"] .login-card .login-divider::after { background: #d6e0d4; }
html[data-theme="light"] .login-card .secondary-login { border-color: #b9c9b5; }
html[data-theme="light"] .login-card .home-link { color: #688a2a; }
html[data-theme="dark"] .login-card { border-color: #3a4d4a; background: #16201d; }
html[data-theme="dark"] .login-card .intro,
html[data-theme="dark"] .login-card label,
html[data-theme="dark"] .login-card .foot { color: #b5c0b4; }

/* 深色模式补全：所有页面共享同一套表面、文字和状态层级。 */
html[data-theme="dark"] {
  --lime-deep: #a9cf42;
  --blue: #83a5ff;
  --coral: #ff8a77;
  --surface-1: #142231;
  --surface-2: #102030;
  --surface-3: #0f1d2b;
  --surface-hover: #1b3146;
  --line-strong: #3a5065;
  --text-primary: #edf3f7;
  --text-secondary: #c4d0d9;
  --text-muted: #9eacba;
}

html[data-theme="dark"] :where(button, input, select, textarea) { color-scheme: dark; }
html[data-theme="dark"] ::selection { color: #102030; background: #c9ef52; }
html[data-theme="dark"] :where(input, select, textarea)::placeholder { color: #718395; opacity: 1; }
html[data-theme="dark"] :where(option) { color: var(--text-primary); background: var(--surface-2); }
html[data-theme="dark"] :where(button, a, input, select, textarea):focus-visible { outline-color: #c9ef52; }

/* 官网 */
html[data-theme="dark"] .site-nav,
html[data-theme="dark"] .header-actions,
html[data-theme="dark"] .text-link,
html[data-theme="dark"] .brand-caption { color: #b4c2d0; }
html[data-theme="dark"] .button-ghost {
  color: var(--text-secondary);
  border-color: var(--line-strong);
  background: rgba(20, 34, 49, .92);
}
html[data-theme="dark"] .button-ghost:hover {
  color: var(--text-primary);
  border-color: #60788c;
  background: var(--surface-hover);
}
html[data-theme="dark"] .auth-notice {
  border-color: #754a43;
  color: #f2b0a0;
  background: #2c1f23;
}
html[data-theme="dark"] .auth-notice p strong { color: #ffc3b5; }
html[data-theme="dark"] .auth-notice-action,
html[data-theme="dark"] .inline-link { color: #c9ef52; }
html[data-theme="dark"] .hero .eyebrow,
html[data-theme="dark"] .hero-lede,
html[data-theme="dark"] .hero-note,
html[data-theme="dark"] .download-meta,
html[data-theme="dark"] .download-meta strong,
html[data-theme="dark"] .section-heading > p,
html[data-theme="dark"] .boundary-copy > p,
html[data-theme="dark"] .trust-strip small { color: var(--text-muted); }
html[data-theme="dark"] .capability-card.card-paper,
html[data-theme="dark"] .capability-card.card-paper .card-visual {
  border-color: var(--line);
  background: var(--surface-1);
}
html[data-theme="dark"] .capability-card.card-paper .card-icon.icon-blue {
  color: #a9c2ff;
  background: #20345a;
}
html[data-theme="dark"] .capability-card.card-paper .card-icon.icon-coral {
  color: #ffb0a2;
  background: #4a292b;
}
html[data-theme="dark"] .capability-card.card-paper p,
html[data-theme="dark"] .capability-card.card-paper .search-preview,
html[data-theme="dark"] .capability-card.card-paper .result-field,
html[data-theme="dark"] .capability-card.card-paper .pipeline-preview { color: var(--text-muted); }
html[data-theme="dark"] .capability-card.card-paper .result-field b { color: var(--text-primary); }
html[data-theme="dark"] .capability-card.card-paper .result-status,
html[data-theme="dark"] .capability-card.card-paper .pipeline-active,
html[data-theme="dark"] .plan-tag {
  color: #c8e57b;
  background: #29401f;
}
html[data-theme="dark"] .card-index,
html[data-theme="dark"] .plan-summary,
html[data-theme="dark"] .plan-price span,
html[data-theme="dark"] .plan-note { color: var(--text-muted); }
html[data-theme="dark"] .plan-card:not(.plan-card-pro) .plan-features { color: var(--text-secondary); }
html[data-theme="dark"] .boundary-mark {
  color: #d1ed82;
  background: #29401f;
}
html[data-theme="dark"] .cta-section {
  border: 1px solid var(--line);
  color: var(--text-primary);
  background: #1a3034;
}
html[data-theme="dark"] .cta-section .eyebrow { color: #b7cb8e; }
html[data-theme="dark"] .cta-section h2 { color: var(--text-primary); }
html[data-theme="dark"] .cta-section .button-ghost {
  color: #d6e0e4;
  border-color: #55706b;
  background: rgba(11, 20, 30, .28);
}
html[data-theme="dark"] .cta-section .button-ghost:hover { background: rgba(11, 20, 30, .52); }

/* 检索工作台 */
html[data-theme="dark"] .hero-ornament { color: #d9e5ec; }
html[data-theme="dark"] .hero-ornament .orbit { border-color: #385064; }
html[data-theme="dark"] .hero-ornament .orbit-label { color: #9eafbd; }
html[data-theme="dark"] .metric-card,
html[data-theme="dark"] .panel-card { border-color: var(--line); background: var(--surface-1); }
html[data-theme="dark"] .metric-icon.lime { color: #d2ed82; background: #29401f; }
html[data-theme="dark"] .metric-icon.blue { color: #abc3ff; background: #20345a; }
html[data-theme="dark"] .metric-icon.coral { color: #ffb0a2; background: #4a292b; }
html[data-theme="dark"] .metric-trend { color: #c8e57b; background: #29401f; }
html[data-theme="dark"] .metric-trend.quiet { color: #a5b1bb; background: #233342; }
html[data-theme="dark"] .mode-tabs { background: var(--surface-3); }
html[data-theme="dark"] .mode-tab { color: #9eacba; }
html[data-theme="dark"] .mode-tab:hover { color: var(--text-primary); background: rgba(255, 255, 255, .06); }
html[data-theme="dark"] .mode-tab.is-active {
  color: var(--text-primary);
  background: #1b3044;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .22);
}
html[data-theme="dark"] .tab-icon { color: #a3b1bd; background: #293b4d; }
html[data-theme="dark"] .mode-tab.is-active .tab-icon { color: #d2ed82; background: #29401f; }
html[data-theme="dark"] .mode-tab:nth-child(2).is-active .tab-icon { color: #abc3ff; background: #20345a; }
html[data-theme="dark"] .mode-tab:nth-child(3).is-active .tab-icon { color: #ffb0a2; background: #4a292b; }
html[data-theme="dark"] .mode-tab small,
html[data-theme="dark"] .field-note,
html[data-theme="dark"] .form-hint,
html[data-theme="dark"] .signal-summary span { color: var(--text-muted); }
html[data-theme="dark"] .field-control input,
html[data-theme="dark"] .field-control select,
html[data-theme="dark"] .field-control textarea {
  border-color: var(--line-strong);
  color: var(--text-primary);
  background: var(--surface-3);
}
html[data-theme="dark"] .field-control input:focus,
html[data-theme="dark"] .field-control select:focus,
html[data-theme="dark"] .field-control textarea:focus { border-color: #a9cf42; background: #14283a; }
html[data-theme="dark"] .field-control .select-arrow { color: #91a5b5; }
html[data-theme="dark"] .choice-chip span {
  border-color: var(--line-strong);
  color: #aebbc5;
  background: var(--surface-3);
}
html[data-theme="dark"] .choice-chip input:checked + span { border-color: #617d32; color: #d2ed82; background: #29401f; }
html[data-theme="dark"] .secondary-button,
html[data-theme="dark"] .cancel-search-button {
  border-color: var(--line-strong);
  color: #c4d0d9;
  background: #1a2b3b;
}
html[data-theme="dark"] .secondary-button:hover { border-color: #60788c; color: var(--text-primary); background: var(--surface-hover); }
html[data-theme="dark"] .cancel-search-button { color: #ffb0a2; border-color: #704840; background: #332329; }
html[data-theme="dark"] .cancel-search-button:hover { color: #ffd0c7; border-color: #a46559; background: #472a31; }
html[data-theme="dark"] .ai-badge,
html[data-theme="dark"] .live-pill,
html[data-theme="dark"] .result-status-pill[data-status="updated"] {
  color: #c8e57b;
  background: #29401f;
}
html[data-theme="dark"] .privacy-tag,
html[data-theme="dark"] .result-status-pill[data-status="empty"],
html[data-theme="dark"] .result-status-pill[data-status="idle"] { color: #aebbc5; background: #263643; }
html[data-theme="dark"] .result-status-pill[data-status="loading"] { color: #b7caff; background: #20345a; }
html[data-theme="dark"] .result-status-pill[data-status="failed"],
html[data-theme="dark"] .result-status-pill[data-status="cancelled"] { color: #ffb0a2; background: #4a292b; }
html[data-theme="dark"] .signal-ring { border-color: #385064; }
html[data-theme="dark"] .ring-mid { border-color: #304656; }
html[data-theme="dark"] .ring-small { border-color: #526c39; }
html[data-theme="dark"] .signal-node { color: #b5c3cc; background: #263847; }
html[data-theme="dark"] .signal-empty-label {
  border-color: #52663a;
  color: #c4d39d;
  background: rgba(25, 44, 37, .95);
}
html[data-theme="dark"] .signal-line { background: #405c45; }
html[data-theme="dark"] .signal-note { color: #b8c69f; background: #1d342a; }
html[data-theme="dark"] .source-row { color: #bfccd4; }
html[data-theme="dark"] .source-row strong { color: #c9d5dd; }
html[data-theme="dark"] .source-mark.search { color: #abc3ff; background: #20345a; }
html[data-theme="dark"] .source-mark.video { color: #ffb0a2; background: #4a292b; }
html[data-theme="dark"] .source-mark.event { color: #d2ed82; background: #29401f; }
html[data-theme="dark"] .table-search,
html[data-theme="dark"] .table-search kbd {
  border-color: var(--line-strong);
  color: #aebbc5;
  background: var(--surface-3);
}
html[data-theme="dark"] .table-search kbd { background: #1b3044; }
html[data-theme="dark"] .table-wrap { background: var(--surface-2); }
html[data-theme="dark"] .results-table th { color: #a7b7c3; background: #17293a; }
html[data-theme="dark"] .results-table td { color: #d0dbe2; border-color: var(--line); }
html[data-theme="dark"] .results-table tbody tr:hover { background: #1b3440; }
html[data-theme="dark"] .record-avatar { color: #b9ceff; background: #20345a; }
html[data-theme="dark"] .record-avatar.coral { color: #ffb0a2; background: #4a292b; }
html[data-theme="dark"] .record-avatar.lime { color: #d2ed82; background: #29401f; }
html[data-theme="dark"] .cell-stack small,
html[data-theme="dark"] .subtle,
html[data-theme="dark"] .empty-state p,
html[data-theme="dark"] .page-ellipsis { color: var(--text-muted); }
html[data-theme="dark"] .source-link { color: #a9c2ff; }
html[data-theme="dark"] .source-link:hover { color: #d1dcff; }
html[data-theme="dark"] .source-favicon { color: #b7caff; background: #20345a; }
html[data-theme="dark"] .score-bar { background: #2b3f4e; }
html[data-theme="dark"] .score-cell strong { color: #c8e57b; }
html[data-theme="dark"] .score-cell.review strong { color: #f2c06f; }
html[data-theme="dark"] .status-badge.verified { color: #c8e57b; background: #29401f; }
html[data-theme="dark"] .status-badge.review { color: #f2c06f; background: #4a3821; }
html[data-theme="dark"] .empty-icon { color: #6f8950; }
html[data-theme="dark"] .page-button.is-current,
html[data-theme="dark"] .page-button.is-active { color: var(--text-primary); background: #29401f; }
html[data-theme="dark"] .history-type { color: #d2ed82; background: #29401f; }
html[data-theme="dark"] .history-type.comments { color: #abc3ff; background: #20345a; }
html[data-theme="dark"] .history-type.events { color: #ffb0a2; background: #4a292b; }
html[data-theme="dark"] .standard-status { color: #c8e57b; background: #29401f; }

/* 账户设置、详情抽屉和弹层 */
html[data-theme="dark"] .toggle-setting {
  border-color: #52663a;
  color: var(--text-primary);
  background: #1d342a;
}
html[data-theme="dark"] .settings-grid .toggle-setting.compact { border-color: var(--line); background: #182a38; }
html[data-theme="dark"] .toggle-track { background: #506171; }
html[data-theme="dark"] .toggle-track i { background: #e7eef2; }
html[data-theme="dark"] .connection-badge { color: #aebbc5; background: #263643; }
html[data-theme="dark"] .connection-badge.ok { color: #c8e57b; background: #29401f; }
html[data-theme="dark"] .connection-badge.bad { color: #ffb0a2; background: #4a292b; }
html[data-theme="dark"] .status-orb { color: #b3c0c9; background: #263643; }
html[data-theme="dark"] .status-orb.ok { color: #d2ed82; background: #29401f; }
html[data-theme="dark"] .status-orb.bad { color: #ffb0a2; background: #4a292b; }
html[data-theme="dark"] .command-preview { background: #0d1b28; }
html[data-theme="dark"] .command-preview span { color: #8fa2b1; }
html[data-theme="dark"] .command-preview code { color: #c4d0d9; }
html[data-theme="dark"] .settings-note { color: #9eacba; }
html[data-theme="dark"] .settings-note > span { border-color: #647b68; color: #bed595; }
html[data-theme="dark"] .settings-note code { color: #c3d995; }
html[data-theme="dark"] .detail-drawer,
html[data-theme="dark"] .help-dialog { background: #122130; }
html[data-theme="dark"] .detail-source { background: #1c3328; }
html[data-theme="dark"] .detail-source a,
html[data-theme="dark"] .detail-pair a { color: #c8df91; }
html[data-theme="dark"] .detail-source small,
html[data-theme="dark"] .detail-label { color: #92a5b3; }
html[data-theme="dark"] .detail-disclaimer {
  border-color: #655533;
  color: #e2c47e;
  background: #332d1d;
}
html[data-theme="dark"] .help-content { color: #c0ccd5; }
html[data-theme="dark"] .toast { border-color: #52663a; color: #c8d99e; background: #1d342a; }
html[data-theme="dark"] .toast.error { border-color: #704840; color: #ffb0a2; background: #332329; }

/* CRM：导航沿用深色侧栏，业务表面、标签、工作流控件全部转为深色。 */
html[data-theme="dark"] .crm-back-button,
html[data-theme="dark"] .crm-button.secondary,
html[data-theme="dark"] .crm-button.ghost,
html[data-theme="dark"] .crm-close {
  border-color: var(--line-strong);
  color: #c4d0d9;
  background: #1a2b3b;
}
html[data-theme="dark"] .crm-back-button:hover,
html[data-theme="dark"] .crm-button.secondary:hover,
html[data-theme="dark"] .crm-button.ghost:hover,
html[data-theme="dark"] .crm-close:hover { color: var(--text-primary); border-color: #60788c; background: var(--surface-hover); }
html[data-theme="dark"] .crm-metric .metric-icon.lime { color: #d2ed82; background: #29401f; }
html[data-theme="dark"] .crm-metric .metric-icon.blue { color: #abc3ff; background: #20345a; }
html[data-theme="dark"] .crm-metric .metric-icon.coral { color: #ffb0a2; background: #4a292b; }
html[data-theme="dark"] .crm-metric .metric-icon.gold { color: #f2c06f; background: #4a3821; }
html[data-theme="dark"] .crm-import-summary { border-color: #52663a; color: #c8d99e; background: #1d342a; }
html[data-theme="dark"] .crm-search,
html[data-theme="dark"] .crm-select,
html[data-theme="dark"] .crm-table th { background: var(--surface-3); }
html[data-theme="dark"] .crm-search,
html[data-theme="dark"] .crm-select { border-color: var(--line-strong); color: #aebbc5; }
html[data-theme="dark"] .crm-table th { color: #a7b7c3; }
html[data-theme="dark"] .crm-table td { color: #d0dbe2; border-color: var(--line); }
html[data-theme="dark"] .crm-table tbody tr:hover,
html[data-theme="dark"] .crm-table tbody tr.is-selected { background: #1b3440; }
html[data-theme="dark"] .metric-link:hover { border-color: #617d32; background: #1b3146; }
html[data-theme="dark"] .customer-avatar { color: #d2ed82; background: #29401f; }
html[data-theme="dark"] .contact-avatar { color: #d2ed82; background: #29401f; }
html[data-theme="dark"] .stage-lead,
html[data-theme="dark"] .q-unreviewed { color: #b4c1ca; background: #293a48; }
html[data-theme="dark"] .stage-qualified,
html[data-theme="dark"] .q-qualified { color: #d2ed82; background: #29401f; }
html[data-theme="dark"] .stage-opportunity,
html[data-theme="dark"] .q-contacted { color: #b9ceff; background: #20345a; }
html[data-theme="dark"] .stage-customer { color: #9de0cd; background: #1e403a; }
html[data-theme="dark"] .stage-nurture,
html[data-theme="dark"] .q-nurture { color: #f2c06f; background: #4a3821; }
html[data-theme="dark"] .stage-lost,
html[data-theme="dark"] .q-disqualified { color: #ffb0a2; background: #4a292b; }
html[data-theme="dark"] .score-cell > span { background: #2b3f4e; }
html[data-theme="dark"] .crm-count-pill,
html[data-theme="dark"] .crm-badge { color: #c8e57b; background: #29401f; }
html[data-theme="dark"] .crm-badge.warning { color: #f2c06f; background: #4a3821; }
html[data-theme="dark"] .crm-footer { color: #9eacba; }
html[data-theme="dark"] .crm-small-empty { color: #9eacba; }
html[data-theme="dark"] .reminder-row,
html[data-theme="dark"] .contact-row,
html[data-theme="dark"] .task-row,
html[data-theme="dark"] .outreach-page-row,
html[data-theme="dark"] .recording-page-row,
html[data-theme="dark"] .flow-steps a { border-color: var(--line); }
html[data-theme="dark"] .crm-select-trigger {
  border-color: var(--line-strong);
  color: var(--text-primary);
  background: var(--surface-3);
}
html[data-theme="dark"] .crm-select-trigger:hover,
html[data-theme="dark"] .crm-custom-select.is-open .crm-select-trigger { border-color: #a9cf42; }
html[data-theme="dark"] .crm-select-arrow { border-color: #91a5b5; }
html[data-theme="dark"] .crm-select-option { color: #c4d0d9; background: transparent; }
html[data-theme="dark"] .crm-select-option:hover,
html[data-theme="dark"] .crm-select-option:focus,
html[data-theme="dark"] .crm-select-option[aria-selected="true"] { color: #d2ed82; background: #29401f; }
html[data-theme="dark"] .flow-step-marker,
html[data-theme="dark"] .flow-steps a > span { color: #b4c1ca; background: #293a48; }
html[data-theme="dark"] .flow-steps a:first-child > span,
html[data-theme="dark"] .flow-steps a:first-child .flow-step-marker { color: #d2ed82; background: #29401f; }
html[data-theme="dark"] .flow-note { color: #c8d99e; background: #1d342a; }
html[data-theme="dark"] .workflow-action > span,
html[data-theme="dark"] .task-icon { color: #d2ed82; background: #29401f; }
html[data-theme="dark"] .task-row.is-overdue .task-icon { color: #ffb0a2; background: #4a292b; }
html[data-theme="dark"] .workflow-action-icon { color: #d2ed82; background: #29401f; }
html[data-theme="dark"] .timeline-row:not(:last-child)::before { background: #385064; }
html[data-theme="dark"] .timeline-dot { box-shadow: 0 0 0 3px #29401f; }
html[data-theme="dark"] .timeline-dot.coral { box-shadow: 0 0 0 3px #4a292b; }
html[data-theme="dark"] .mini-action,
html[data-theme="dark"] .mini-approve { border-color: #52663a; color: #c8e57b; background: #1d342a; }
html[data-theme="dark"] .mini-action:hover,
html[data-theme="dark"] .mini-approve:hover { color: #102030; background: #c9ef52; }
html[data-theme="dark"] .workflow-selector,
html[data-theme="dark"] .customer-context,
html[data-theme="dark"] .workflow-actions { border-color: var(--line); background: var(--surface-1); }
html[data-theme="dark"] .customer-search,
html[data-theme="dark"] .workflow-selector select {
  border-color: var(--line-strong);
  color: var(--text-primary);
  background: var(--surface-3);
}
html[data-theme="dark"] .customer-search button { color: #c4d0d9; background: #263b4d; }
html[data-theme="dark"] .customer-search button:hover { color: var(--text-primary); background: #34516a; }
html[data-theme="dark"] .outreach-mode-switch { border-color: var(--line); background: var(--surface-3); }
html[data-theme="dark"] .outreach-mode-button { color: #9eacba; }
html[data-theme="dark"] .outreach-mode-button:hover { color: var(--text-primary); }
html[data-theme="dark"] .outreach-mode-button.is-active { color: #d2ed82; background: #29401f; }
html[data-theme="dark"] .outreach-batch-picker,
html[data-theme="dark"] .outreach-ai-preview,
html[data-theme="dark"] .outreach-ai-preview-item {
  border-color: var(--line);
  background: var(--surface-2);
}
html[data-theme="dark"] .outreach-batch-option { color: #c4d0d9; background: #17293a; }
html[data-theme="dark"] .outreach-batch-option:hover,
html[data-theme="dark"] .outreach-batch-option:focus-visible,
html[data-theme="dark"] .outreach-batch-option[aria-checked="true"] { border-color: #617d32; background: #29401f; }
html[data-theme="dark"] .outreach-batch-check { border-color: #6b7d8a; background: #102030; }
html[data-theme="dark"] .outreach-batch-option[aria-checked="true"] .outreach-batch-check { border-color: #a9cf42; background: #87ad22; }
html[data-theme="dark"] .outreach-batch-summary { border-color: #52663a; color: #d2ed82; background: #1d342a; }
html[data-theme="dark"] .outreach-ai-preview-item.is-failed { border-color: #704840; background: #332329; }
html[data-theme="dark"] .outreach-ai-preview-item p,
html[data-theme="dark"] .outreach-ai-preview-item small,
html[data-theme="dark"] .outreach-ai-preview-head small { color: #b6c3cc; }
html[data-theme="dark"] .outreach-ai-status.is-loading { border-color: #52663a; color: #c8d99e; background: #1d342a; }
html[data-theme="dark"] .outreach-ai-status.is-success { border-color: #52663a; color: #c8e57b; background: #29401f; }
html[data-theme="dark"] .outreach-ai-status.is-error { border-color: #704840; color: #ffb0a2; background: #332329; }
html[data-theme="dark"] .form-hint-box,
html[data-theme="dark"] .next-page-link { color: #b9c99e; background: #1d342a; }
html[data-theme="dark"] .form-hint-box { border: 1px solid #52663a; }
html[data-theme="dark"] .next-page-link { color: #c8e57b; }
html[data-theme="dark"] .qualification-result { border-color: #52663a; color: #c8d99e; background: #1d342a; }
html[data-theme="dark"] .qualification-result.success { border-color: #52663a; background: #29401f; }
html[data-theme="dark"] .qualification-result.danger { border-color: #704840; color: #ffb0a2; background: #332329; }
html[data-theme="dark"] .qualification-result.pending { border-color: var(--line); color: #b7c5cf; background: #1b3044; }
html[data-theme="dark"] .workflow-page:has(#outreachForm) .outreach-batch-picker { border-color: #52663a; background: #1d342a; }
html[data-theme="dark"] .workflow-page:has(#outreachForm) .outreach-batch-picker-head small { color: #b9c99e; }
html[data-theme="dark"] .workflow-page:has(#outreachForm) .outreach-batch-option[aria-checked="true"] { border-color: #617d32; background: #29401f; }
html[data-theme="dark"] .workflow-page:has(#outreachForm) .outreach-batch-summary { border-color: #617d32; color: #d2ed82; background: #29401f; }
html[data-theme="dark"] .workflow-page:has(#outreachForm) .outreach-default-content-hint,
html[data-theme="dark"] .workflow-page:has(#outreachForm) #outreachCustomerHint,
html[data-theme="dark"] .workflow-page:has(#outreachForm) .form-hint-box { border-color: #52663a; color: #c8d99e; background: #1d342a; }
html[data-theme="dark"] .workflow-page:has(#outreachBatchCustomer:not([hidden])) .outreach-target-field { border-color: #617d32; background: #29401f; }
html[data-theme="dark"] .workflow-page:has(#outreachForm) #outreachForm .form-row.end {
  border-top-color: var(--line);
  background: var(--surface-1);
  box-shadow: 0 -10px 18px rgba(20, 34, 49, .96);
}
html[data-theme="dark"] .workflow-page:has(#outreachForm) .outreach-batch-queue-actions:not(:empty) { border-color: #52663a; background: #1d342a; }
html[data-theme="dark"] .workflow-page:has(#outreachForm) .outreach-batch-queue-actions .crm-button {
  color: #c8e57b;
  border-color: #617d32;
  background: #29401f;
}
html[data-theme="dark"] .workflow-page:has(#outreachForm) #outreachCount {
  border-color: #617d32;
  color: #d2ed82;
  background: #29401f;
}
html[data-theme="dark"] .workflow-page:has(#outreachForm) .outreach-status { border-color: var(--line-strong); color: #b9c6cf; background: #263643; }
html[data-theme="dark"] .workflow-page:has(#outreachForm) .outreach-status.pending_approval { color: #f2c06f; border-color: #69552f; background: #4a3821; }
html[data-theme="dark"] .workflow-page:has(#outreachForm) .outreach-status.queued,
html[data-theme="dark"] .workflow-page:has(#outreachForm) .outreach-status.sending { color: #b9ceff; border-color: #465d88; background: #20345a; }
html[data-theme="dark"] .workflow-page:has(#outreachForm) .outreach-status.sent,
html[data-theme="dark"] .workflow-page:has(#outreachForm) .outreach-status.delivered,
html[data-theme="dark"] .workflow-page:has(#outreachForm) .outreach-status.read,
html[data-theme="dark"] .workflow-page:has(#outreachForm) .outreach-status.received { color: #c8e57b; border-color: #52663a; background: #29401f; }
html[data-theme="dark"] .workflow-page:has(#outreachForm) .outreach-status.awaiting_provider,
html[data-theme="dark"] .workflow-page:has(#outreachForm) .outreach-status.failed,
html[data-theme="dark"] .workflow-page:has(#outreachForm) .outreach-page-row em,
html[data-theme="dark"] .workflow-page:has(#outreachForm) .outreach-ai-status.is-error { color: #ffb0a2; border-color: #704840; background: #332329; }
html[data-theme="dark"] .workflow-page:has(#outreachForm) .outreach-status.cancelled { color: #b4c1ca; border-color: var(--line); background: #263643; }
html[data-theme="dark"] .crm-toast { border-color: var(--line-strong); color: #c4d0d9; background: #17293a; }
html[data-theme="dark"] .crm-toast.success { border-color: #52663a; color: #c8e57b; background: #1d342a; }
html[data-theme="dark"] .crm-toast.error { border-color: #704840; color: #ffb0a2; background: #332329; }
html[data-theme="dark"] .workflow-page:has(#outreachForm) .outreach-ai-status.is-loading { border-color: #52663a; color: #c8d99e; background: #1d342a; }
html[data-theme="dark"] .workflow-page:has(#outreachForm) .outreach-ai-status.is-success { border-color: #52663a; color: #c8e57b; background: #29401f; }
html[data-theme="dark"] .workflow-page:has(#outreachForm) .outreach-ai-status.is-error { border-color: #704840; color: #ffb0a2; background: #332329; }
html[data-theme="dark"] .crm-portal-nav a { color: #aebbc5; }
html[data-theme="dark"] .crm-portal-nav a:hover { color: var(--text-primary); background: #1b3146; }
html[data-theme="dark"] .crm-portal-nav a.is-active { color: #d2ed82; border-color: #52663a; background: #29401f; }

/* 套餐、额度和登录页 */
html[data-theme="dark"] .billing-brand small,
html[data-theme="dark"] .billing-intro .eyebrow,
html[data-theme="dark"] .billing-footer,
html[data-theme="dark"] .billing-footnote,
html[data-theme="dark"] .section-label,
html[data-theme="dark"] .metric-label,
html[data-theme="dark"] .metric-hint { color: var(--text-muted); }
html[data-theme="dark"] .notice-info { border-color: #52663a; background: #1d342a; }
html[data-theme="dark"] .notice-success { border-color: #52663a; background: #29401f; }
html[data-theme="dark"] .notice-error { border-color: #704840; background: #332329; }
html[data-theme="dark"] .plan-badge { color: #c8e57b; background: #29401f; }
html[data-theme="dark"] .plan-card:not(.plan-card-pro) > p,
html[data-theme="dark"] .plan-card:not(.plan-card-pro) .plan-price span,
html[data-theme="dark"] .plan-card:not(.plan-card-pro) ul { color: var(--text-secondary); }
html[data-theme="dark"] .plan-card li::before { color: #c8e57b; }
html[data-theme="dark"] .account-panel,
html[data-theme="dark"] .plan-card:not(.plan-card-pro),
html[data-theme="dark"] .notice { box-shadow: var(--shadow); }
html[data-theme="dark"] .checkout-panel { border: 1px solid var(--line); background: #102235; }
html[data-theme="dark"] body.login-page {
  color: #edf3f7;
  background: radial-gradient(circle at 20% 10%, rgba(189, 231, 64, .12), transparent 35%), #0b141e;
}
html[data-theme="dark"] .login-card { border-color: #3a5065; background: #142231; }
html[data-theme="dark"] .login-card input { border-color: #52667a; color: #edf3f7; background: #0f1d2b; }
html[data-theme="dark"] .login-card .secondary-login { border-color: #52667a; color: #c9ef52; }
html[data-theme="dark"] .login-card .login-divider::before,
html[data-theme="dark"] .login-card .login-divider::after { background: #304454; }

.crmai-preferences-anchor { position: relative; display: inline-flex; align-items: center; }
.crmai-preferences-anchor.is-floating { position: fixed; z-index: 100; top: 18px; right: 18px; }
.crmai-preferences-trigger { display: inline-flex; min-height: 34px; align-items: center; gap: 7px; padding: 0 10px; border: 1px solid rgba(127, 146, 162, .42); border-radius: 8px; color: #738499; background: rgba(255, 255, 255, .52); font-size: 12px; font-weight: 700; transition: border-color .2s ease, color .2s ease, background .2s ease; }
.crmai-preferences-trigger:hover { border-color: var(--lime-deep); color: var(--ink); background: rgba(255, 255, 255, .82); }
.crmai-preferences-icon { display: inline-flex; width: 16px; height: 16px; align-items: center; justify-content: center; color: var(--lime-deep); font-size: 17px; line-height: 1; }
html[data-theme="dark"] .crmai-preferences-trigger { border-color: #40566b; color: #b4c2ce; background: rgba(20, 37, 53, .9); }
html[data-theme="dark"] .crmai-preferences-trigger:hover { border-color: var(--lime); color: #f0f5f7; background: #20364b; }
.crmai-preferences-panel { position: absolute; top: calc(100% + 10px); right: 0; z-index: 120; display: grid; width: min(300px, calc(100vw - 28px)); gap: 15px; padding: 17px; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); background: var(--paper, #fff); box-shadow: 0 18px 45px rgba(18, 35, 56, .18); }
.crmai-preferences-panel[hidden] { display: none; }
.crmai-preferences-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.crmai-preferences-head > div { display: grid; gap: 4px; }
.crmai-preferences-kicker { color: var(--muted, #8490a2); font-family: var(--mono, monospace); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.crmai-preferences-head strong { font-size: 15px; }
.crmai-preferences-close { display: inline-flex; width: 26px; height: 26px; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: 6px; color: var(--muted, #8490a2); background: transparent; font-size: 18px; line-height: 1; }
.crmai-preferences-close:hover { background: rgba(127, 146, 162, .14); }
.crmai-preferences-field { display: grid; grid-template-columns: 1fr 150px; gap: 12px; align-items: center; color: var(--ink); font-size: 13px; font-weight: 700; }
.crmai-preferences-field select { min-height: 34px; padding: 0 9px; border: 1px solid var(--line); border-radius: 7px; outline: 0; color: var(--ink); background: transparent; font-size: 12px; }
.crmai-preferences-field select:focus { border-color: var(--lime-deep); box-shadow: 0 0 0 3px rgba(155, 197, 35, .14); }
.crmai-preferences-summary { display: flex; justify-content: space-between; gap: 10px; margin: 0; padding-top: 3px; color: var(--muted, #8490a2); font-size: 11px; }
.crmai-preferences-summary span:last-child { color: var(--ink); font-weight: 700; }

@media (max-width: 620px) {
  .crmai-preferences-panel { position: fixed; top: 64px; right: 14px; }
  .crmai-preferences-anchor.is-floating .crmai-preferences-panel { top: 46px; right: -4px; }
  .crmai-preferences-trigger { min-height: 32px; padding: 0 8px; }
  .crmai-preferences-trigger > span:last-child { display: none; }
}
