:root {
  --app-theme-accent: #24C1AE;
  --app-theme-accent-ink: #08786C;
  --app-theme-accent-soft: #E9F7F4;
  --app-theme-accent-hover: #159A8A;
  --app-theme-page: #F2F7F6;
  --app-theme-surface: #FFFFFF;
  --app-theme-subtle: #F7FAF9;
  --app-theme-text: #172C29;
  --app-theme-secondary: #536C66;
  --app-theme-muted: #687D77;
  --app-theme-border: #D6E3DF;
  --app-theme-strong-border: #9CAFA9;
  --app-theme-button-text: #14352F;
  --app-theme-hover-text: #FFFFFF;
  --app-theme-focus: #08786C;
  --semantic-success: #087F50;
  --semantic-warning: #996400;
  --semantic-danger: #C53C43;
  --semantic-info: #3169AA;
  --stage-install: #F87171;
  --stage-purchase: #F59E0B;
  --stage-build: #38BDF8;
  --stage-design: #2DD4BF;
  --stage-service: #34D399;
  --stage-plan: #8B96A8;
}

:root[data-theme="light"][data-app-theme] {
  --c-bg: var(--app-theme-page);
  --c-card: var(--app-theme-surface);
  --c-card-2: var(--app-theme-subtle);
  --c-border: var(--app-theme-border);
  --c-border-hi: var(--app-theme-strong-border);
  --c-primary: var(--app-theme-accent);
  --c-primary-deep: var(--app-theme-accent-ink);
  --c-text: var(--app-theme-text);
  --c-text-2: var(--app-theme-secondary);
  --c-text-3: var(--app-theme-muted);
  --c-info: var(--semantic-info);
  --c-warn: var(--semantic-warning);
  --c-success: var(--semantic-success);
  --c-danger: var(--semantic-danger);
  --theme-primary: var(--app-theme-accent);
}

:root[data-theme="light"][data-app-theme] body,
:root[data-theme="light"][data-app-theme] #content { background-color: var(--app-theme-page); color: var(--app-theme-text); }
:root[data-theme="light"][data-app-theme] .sidebar,
:root[data-theme="light"][data-app-theme] .desktop-topbar,
:root[data-theme="light"][data-app-theme] .card,
:root[data-theme="light"][data-app-theme] .modal,
:root[data-theme="light"][data-app-theme] #tabbar { background-color: var(--app-theme-surface); border-color: var(--app-theme-border); }
:root[data-theme="light"][data-app-theme] .nav-item { color: var(--app-theme-secondary); }
:root[data-theme="light"][data-app-theme] .nav-item.active { background-color: var(--app-theme-accent-soft)!important; color: var(--app-theme-accent-ink)!important; }
@media (min-width:769px) {
  :root[data-theme="light"][data-app-theme] .sidebar .nav-item .icon,
  :root[data-theme="light"][data-app-theme] .sidebar .nav-item .icon svg { background: transparent; border-color: transparent; box-shadow: none; color:currentColor; }
}
:root[data-theme="light"][data-app-theme] .btn-primary { background-color: var(--app-theme-accent)!important; border-color: var(--app-theme-accent)!important; color: var(--app-theme-button-text)!important; }
:root[data-theme="light"][data-app-theme] .btn-primary:hover { background-color: var(--app-theme-accent-hover); color: var(--app-theme-hover-text); }
:root[data-theme="light"][data-app-theme] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
:root[data-theme="light"][data-app-theme] select,
:root[data-theme="light"][data-app-theme] textarea { background-color: var(--app-theme-surface) !important; color: var(--app-theme-text) !important; border-color: var(--app-theme-border) !important; }
:root[data-theme="light"][data-app-theme] input:focus,
:root[data-theme="light"][data-app-theme] select:focus,
:root[data-theme="light"][data-app-theme] textarea:focus { border-color: var(--app-theme-focus) !important; }

.theme-preset-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
html body .theme-desktop-settings .theme-preset.btn { display:flex; flex-direction:column; align-items:stretch; gap:7px; min-width:0; height:auto!important; min-height:64px!important; max-height:none!important; padding:8px!important; overflow:visible!important; color:var(--app-theme-secondary); background:var(--app-theme-surface); border-color:var(--app-theme-border); }
.theme-preset.is-active { border-color:var(--app-theme-accent-ink); box-shadow:inset 0 0 0 1px var(--app-theme-accent-ink); }
.theme-preset-swatches { display:flex; width:100%; height:24px; overflow:hidden; border-radius:4px; }
.theme-preset-swatches i { flex:1; }
.theme-preset b { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.theme-desktop-settings .icon-style-current { background:var(--app-theme-accent-soft); border-color:var(--app-theme-border); color:var(--app-theme-accent-ink); }
.theme-desktop-settings .icon-style-sample i { background:transparent!important; border:2px solid currentColor!important; box-shadow:none!important; }
.theme-custom-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.theme-custom-field { background:var(--app-theme-subtle); border-color:var(--app-theme-border); color:var(--app-theme-secondary); }
.theme-save-state { color:var(--app-theme-muted); }
.theme-save-state.error { color:var(--semantic-danger); }
@media (max-width:768px) {
  .theme-desktop-settings { display:none !important; }
}

/* 第一方业务界面颜色映射；只覆盖颜色相关属性。 */
:root[data-theme="light"][data-app-theme] .settings-layout>.card,
:root[data-theme="light"][data-app-theme] .settings-layout>.card>.card-header,
:root[data-theme="light"][data-app-theme] .settings-card-tip,
:root[data-theme="light"][data-app-theme] .settings-advanced { background:var(--app-theme-surface); border-color:var(--app-theme-border); color:var(--app-theme-secondary); }
:root[data-theme="light"][data-app-theme] .settings-layout>.card>.card-header,
:root[data-theme="light"][data-app-theme] .settings-layout .setting-item,
:root[data-theme="light"][data-app-theme] .settings-advanced { border-color:var(--app-theme-border)!important; }
:root[data-theme="light"][data-app-theme] .settings-layout>.card>.card-header h3,
:root[data-theme="light"][data-app-theme] .settings-layout .setting-item .label { color:var(--app-theme-text); }
:root[data-theme="light"][data-app-theme] .settings-layout .setting-item .desc,
:root[data-theme="light"][data-app-theme] .settings-version-row { color:var(--app-theme-muted); }
:root[data-theme="light"][data-app-theme] .settings-desktop-head { background:var(--app-theme-surface); border-color:var(--app-theme-border); }
:root[data-theme="light"][data-app-theme] .settings-desktop-head h2 { color:var(--app-theme-text); }
:root[data-theme="light"][data-app-theme] .settings-desktop-head p { color:var(--app-theme-secondary); }
:root[data-theme="light"][data-app-theme] table,
:root[data-theme="light"][data-app-theme] .data-table,
:root[data-theme="light"][data-app-theme] .quotation-table { color:var(--app-theme-text); border-color:var(--app-theme-border); }
:root[data-theme="light"][data-app-theme] :is(.data-table,.quotation-table,.quote-table,.customer-table,.project-table,.project-device-import-table) th,
:root[data-theme="light"][data-app-theme] .table-head { background-color:var(--app-theme-subtle); color:var(--app-theme-secondary); border-color:var(--app-theme-border); }
:root[data-theme="light"][data-app-theme] :is(.data-table,.quotation-table,.quote-table,.customer-table,.project-table,.project-device-import-table) :is(td,tr) { border-color:var(--app-theme-border); }
:root[data-theme="light"][data-app-theme] :is(.data-table,.quotation-table,.quote-table,.customer-table,.project-table,.project-device-import-table) tbody tr:hover { background-color:var(--app-theme-accent-soft); }
:root[data-theme="light"][data-app-theme] .ui-select-menu,
:root[data-theme="light"][data-app-theme] .ui-choice-dialog,
:root[data-theme="light"][data-app-theme] .sync-center-dialog,
:root[data-theme="light"][data-app-theme] .share-dialog { background-color:var(--app-theme-surface); color:var(--app-theme-text); border-color:var(--app-theme-border); }
:root[data-theme="light"][data-app-theme] .ui-select-option:hover,
:root[data-theme="light"][data-app-theme] .ui-select-option.active { background-color:var(--app-theme-accent-soft); color:var(--app-theme-accent-ink); }
:root[data-theme="light"][data-app-theme] .ec-contract-editor,
:root[data-theme="light"][data-app-theme] .ec-editor-body,
:root[data-theme="light"][data-app-theme] .ec-editor-output,
:root[data-theme="light"][data-app-theme] .contract-quality-dialog,
:root[data-theme="light"][data-app-theme] .contract-start-card,
:root[data-theme="light"][data-app-theme] .contract-template-card,
:root[data-theme="light"][data-app-theme] .floorplan-studio,
:root[data-theme="light"][data-app-theme] .floorplan-panel { background-color:var(--app-theme-surface); color:var(--app-theme-text); border-color:var(--app-theme-border); }
:root[data-theme="light"][data-app-theme] .ec-editor-header-actions,
:root[data-theme="light"][data-app-theme] .ec-layout-ribbon,
:root[data-theme="light"][data-app-theme] .floorplan-toolbar { background-color:var(--app-theme-subtle); color:var(--app-theme-secondary); border-color:var(--app-theme-border); }
:root[data-theme="light"][data-app-theme] .ec-actions button.active,
:root[data-theme="light"][data-app-theme] .ec-layout-active,
:root[data-theme="light"][data-app-theme] .floorplan-tool.active { background-color:var(--app-theme-accent-soft); color:var(--app-theme-accent-ink); border-color:var(--app-theme-accent); }
:root[data-theme="light"][data-app-theme] .login-card,
:root[data-theme="light"][data-app-theme] .mine-card,
:root[data-theme="light"][data-app-theme] .project-card,
:root[data-theme="light"][data-app-theme] .customer-card,
:root[data-theme="light"][data-app-theme] .quotation-card { background-color:var(--app-theme-surface); color:var(--app-theme-text); border-color:var(--app-theme-border); }
:root[data-theme="light"][data-app-theme] .link-button { color:var(--app-theme-accent-ink); }
:root[data-theme="light"][data-app-theme] .quotation-add-customer,
:root[data-theme="light"][data-app-theme] .customer-toolbar-add,
:root[data-theme="light"][data-app-theme] .project-toolbar-add,
:root[data-theme="light"][data-app-theme] .topbar-dashboard-edit,
:root[data-theme="light"][data-app-theme] .settings-layout .btn-primary,
:root[data-theme="light"][data-app-theme] .quote-desk-head button,
:root[data-theme="light"][data-app-theme] .quote-actions .open,
:root[data-theme="light"][data-app-theme] .fp-actions button,
:root[data-theme="light"][data-app-theme] .fp-command-row button.primary,
:root[data-theme="light"][data-app-theme] .fp-empty-blueprint button,
:root[data-theme="light"][data-app-theme] .fp-new-design-modal .modal-footer .btn-primary,
:root[data-theme="light"][data-app-theme] .qw-toolbar .primary,
:root[data-theme="light"][data-app-theme] .qw-bottom .primary,
:root[data-theme="light"][data-app-theme] .qcp-device-dialog>footer button { background:var(--app-theme-accent)!important; border-color:var(--app-theme-accent)!important; color:var(--app-theme-button-text)!important; }
:root[data-theme="light"][data-app-theme] .quotation-add-customer:hover,
:root[data-theme="light"][data-app-theme] .customer-toolbar-add:hover,
:root[data-theme="light"][data-app-theme] .topbar-dashboard-edit:hover { background:var(--app-theme-accent-hover)!important; color:var(--app-theme-hover-text)!important; }
:root[data-theme="light"][data-app-theme] .tabbar-item.active { color:var(--app-theme-accent)!important; }
:root[data-theme="light"][data-app-theme] .tabbar-item.active::before { background:var(--app-theme-accent)!important; }
:root[data-theme="light"][data-app-theme] #mobile-mine .mobile-mine-profile-card,
:root[data-theme="light"][data-app-theme] .mobile-mine-group,
:root[data-theme="light"][data-app-theme] .mobile-mine-row { background-color:var(--app-theme-surface); border-color:var(--app-theme-border); color:var(--app-theme-text); }
:root[data-theme="light"][data-app-theme] .mobile-mine-group>h3,
:root[data-theme="light"][data-app-theme] .mobile-mine-row small { color:var(--app-theme-muted); }
:root[data-theme="light"][data-app-theme] .mobile-mine-icon { background-color:var(--app-theme-accent-soft); color:var(--app-theme-accent-ink); }
:root[data-theme="light"][data-app-theme] .mobile-mine-row:active,
:root[data-theme="light"][data-app-theme] .mobile-mine-profile-main:active { background-color:var(--app-theme-accent-soft); }
:root[data-theme="light"][data-app-theme] .sidebar .nav-item.active { background:linear-gradient(90deg,var(--app-theme-accent-soft),var(--app-theme-surface))!important; border-color:var(--app-theme-border)!important; }
:root[data-theme="light"][data-app-theme] .sidebar .nav-item.active::before { background:var(--app-theme-accent)!important; }
:root[data-theme="light"][data-app-theme] .settings-desktop-head>div>span,
:root[data-theme="light"][data-app-theme] .settings-desktop-head>b,
:root[data-theme="light"][data-app-theme] .settings-version-row button { color:var(--app-theme-accent-ink)!important; }
:root[data-theme="light"][data-app-theme] .settings-desktop-head>b { background:var(--app-theme-accent-soft)!important; border-color:var(--app-theme-border)!important; }
:root[data-theme="light"][data-app-theme] .ops-overview,
:root[data-theme="light"][data-app-theme] .ops-panel,
:root[data-theme="light"][data-app-theme] .ops-metric,
:root[data-theme="light"][data-app-theme] .ops-tile { background:var(--app-theme-surface)!important; border-color:var(--app-theme-border)!important; }
:root[data-theme="light"][data-app-theme] .ops-overview-grid { border-color:var(--app-theme-border)!important; }
:root[data-theme="light"][data-app-theme] .ops-metric { border-color:var(--app-theme-border)!important; }
:root[data-theme="light"][data-app-theme] .ops-overview-title small,
:root[data-theme="light"][data-app-theme] .ops-panel header small,
:root[data-theme="light"][data-app-theme] .ops-metric-value:not(.green):not(.orange):not(.red),
:root[data-theme="light"][data-app-theme] .ops-tile strong:not(.green):not(.orange):not(.red) { color:var(--app-theme-accent-ink)!important; }
:root[data-theme="light"][data-app-theme] .ops-overview-title h2,
:root[data-theme="light"][data-app-theme] .ops-panel header h2 { color:var(--app-theme-text)!important; }
:root[data-theme="light"][data-app-theme] .ops-metric-label,
:root[data-theme="light"][data-app-theme] .ops-tile span { color:var(--app-theme-muted)!important; }
:root[data-theme="light"][data-app-theme] .ops-metric-note { color:var(--app-theme-secondary)!important; }
:root[data-theme="light"][data-app-theme] .ops-panel-icon { background:var(--app-theme-accent-soft)!important; color:var(--app-theme-accent-ink)!important; }
:root[data-theme="light"][data-app-theme] #mobile-mine .profile-entry { background:linear-gradient(135deg,var(--app-theme-accent-soft),var(--app-theme-surface))!important; border-color:var(--app-theme-border)!important; }
:root[data-theme="light"][data-app-theme] .profile-entry-avatar { background:linear-gradient(135deg,var(--app-theme-accent),var(--app-theme-accent-ink))!important; }
:root[data-theme="light"][data-app-theme] .profile-entry-hint { color:var(--app-theme-accent-ink)!important; }
