/* 舒缓的深色与暖白浅色主题；保持消息和操作状态的语义颜色。 */
html[data-theme="dark"] {
  --bg: #111820;
  --panel: #19232e;
  --panel-2: #202c38;
  --line: #ffffff26;
  --ink: #e5ebeb;
  --muted: #a6b4ba;
  --cyan: #83d2d0;
  --violet: #c4b7eb;
  --green: #87d7ad;
  --danger: #f19ba4;
  color-scheme: dark;
}
html[data-theme="dark"] .workspace { background: var(--bg); }
html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .runtime-bar,
html[data-theme="dark"] .connection-progress { background: #17212b; }
html[data-theme="dark"] .chat-header { background: #17212bf5; }
html[data-theme="dark"] .quick-compose,
html[data-theme="dark"] .usage-card,
html[data-theme="dark"] .project-card,
html[data-theme="dark"] .chat-compose,
html[data-theme="dark"] .auth-card,
html[data-theme="dark"] .modal { background: #1c2733; }
html[data-theme="dark"] .quick-compose.daily-chat { background: #242637; }
html[data-theme="dark"] .message.user .message-text { background: #202a35; }
html[data-theme="dark"] .activity-entry pre,
html[data-theme="dark"] .approval-card pre { background: #111a23; }

html[data-theme="light"] {
  --bg: #f4f5ef;
  --panel: #fffef9;
  --panel-2: #eff2ec;
  --line: #cbd6d1;
  --ink: #253439;
  --muted: #56686e;
  --cyan: #08747b;
  --violet: #65538d;
  --green: #1b7653;
  --danger: #b13f50;
  color-scheme: light;
}
html[data-theme="light"] .workspace { background: var(--bg); }
html[data-theme="light"] .sidebar,
html[data-theme="light"] .chat-header,
html[data-theme="light"] .runtime-bar,
html[data-theme="light"] .connection-progress { background: #f8f9f4; }
html[data-theme="light"] .quick-compose,
html[data-theme="light"] .usage-card,
html[data-theme="light"] .project-card,
html[data-theme="light"] .stat-strip,
html[data-theme="light"] .chat-compose,
html[data-theme="light"] .auth-card,
html[data-theme="light"] .modal { background: var(--panel); box-shadow: 0 10px 26px #354b3f0b; }
html[data-theme="light"] .quick-compose.daily-chat { background: #f4f1f8; }
html[data-theme="light"] .usage-card { border-color: #d5d0e2; }
html[data-theme="light"] .quick-compose { border-color: #a7cfcd; }
html[data-theme="light"] .project-card { border-color: var(--line); }
html[data-theme="light"] .chat-compose { border-color: #aacdca; }
html[data-theme="light"] .conversation-row:hover,
html[data-theme="light"] .conversation-row.active { background: #e6f1ed; }
html[data-theme="light"] .message.user .message-text,
html[data-theme="light"] .context-banner,
html[data-theme="light"] .process-group,
html[data-theme="light"] .approval-card,
html[data-theme="light"] .notice-message { background: #eef2ec; }
html[data-theme="light"] .message-avatar,
html[data-theme="light"] .runtime-bar select,
html[data-theme="light"] .conversation-search,
html[data-theme="light"] .auth-card input,
html[data-theme="light"] .modal input { background: #fffefa; color: var(--ink); border-color: var(--line); }
html[data-theme="light"] .activity-entry pre,
html[data-theme="light"] .approval-card pre { background: #e9eee9; color: #33464c; }
html[data-theme="light"] .usage-meter { background: #dbe3df; }
html[data-theme="light"] .message-skeleton>span { background: linear-gradient(90deg,#e6ebe6,#f8faf6,#e6ebe6) 0 0/220% 100%; }
html[data-theme="light"] .modal-backdrop { background: #25343b80; }
html[data-theme="light"] .toast { color: #8e3440; background: #fff2ef; }
html[data-theme="light"] .toast.success { color: #146243; background: #e8f5ea; }
html[data-theme="light"] .pending-preview { background: #f0f3ef; }
html[data-theme="light"] .security-note { background: #eaf4e8; }
html[data-theme="light"] .connection-progress.warning { background: #fff6e6; color: #805b1a; }

html[data-theme="light"] .account-actions button,
html[data-theme="light"] .usage-card>header button,
html[data-theme="light"] .usage-actions button,
html[data-theme="light"] .secondary-button,
html[data-theme="light"] .load-older,
html[data-theme="light"] .voice-button,
html[data-theme="light"] .command-access-button,
html[data-theme="light"] .speech-toggle,
html[data-theme="light"] .approval-actions button,
html[data-theme="light"] .connection-chip { background: #f3f6f1; color: #3c565a; border-color: var(--line); }
html[data-theme="light"] .usage-actions .reset-credit { color: #604483; background: #f1ecf8; }
html[data-theme="light"] .quick-compose button,
html[data-theme="light"] .chat-compose .send-button { color: #fff; }
html[data-theme="light"] .command-access-button.enabled { color: #8d421b; background: #fff1e6; border-color: #dca377; }
html[data-theme="light"] .stop-button { color: #9a3141; background: #fff0ef; }
html[data-theme="light"] .jump-to-latest { color: #075e66; background: #e8f4f2; }

html[data-theme="light"] .usage-window>div:first-child>span,
html[data-theme="light"] .usage-window>div:first-child>strong small,
html[data-theme="light"] .usage-window>small,
html[data-theme="light"] .usage-meta,
html[data-theme="light"] .conversation-copy small,
html[data-theme="light"] .conversation-open time,
html[data-theme="light"] .project-copy p,
html[data-theme="light"] .status-pill,
html[data-theme="light"] .runtime-bar small,
html[data-theme="light"] .connection-progress time,
html[data-theme="light"] .message-body header time,
html[data-theme="light"] .delivery-pending,
html[data-theme="light"] .process-group>summary small,
html[data-theme="light"] .process-reasoning header time,
html[data-theme="light"] .approval-content small,
html[data-theme="light"] .compose-actions>span { color: #5a6e72; }
html[data-theme="light"] .usage-window>div:first-child>strong,
html[data-theme="light"] .usage-meta strong,
html[data-theme="light"] .sidebar-title,
html[data-theme="light"] .conversation-copy strong,
html[data-theme="light"] .connection-progress strong,
html[data-theme="light"] .context-banner strong,
html[data-theme="light"] .message-text,
html[data-theme="light"] .history-state strong,
html[data-theme="light"] .process-group>summary strong,
html[data-theme="light"] .process-reasoning header,
html[data-theme="light"] .process-reasoning p,
html[data-theme="light"] .approval-content p,
html[data-theme="light"] .upload-button { color: var(--ink); }
html[data-theme="light"] .sidebar-footer button,
html[data-theme="light"] .connection-progress,
html[data-theme="light"] .context-banner,
html[data-theme="light"] .process-group>summary,
html[data-theme="light"] .activity-entry>summary,
html[data-theme="light"] .auth-card label,
html[data-theme="light"] .modal label { color: var(--muted); }
html[data-theme="light"] .quick-compose textarea::placeholder,
html[data-theme="light"] .conversation-search::placeholder { color: #67787c; }
html[data-theme="light"] .quick-compose select { color: var(--ink); }
html[data-theme="light"] .sidebar-title small { background: #e4ebe6; }
html[data-theme="light"] .connection-progress b { color: #78898c; }
html[data-theme="light"] .context-banner code { color: #4d666b; }
html[data-theme="light"] .message-avatar { color: #4c6269; }
html[data-theme="light"] .notice-message { color: #536970; }
html[data-theme="light"] .error-message { color: #a43846; background: #fff0ef; }
html[data-theme="light"] .sidebar-footer button:hover { color: var(--ink); background: #e7efe9; }
html[data-theme="light"] .conversation-delete { color: #9b4652; }
html[data-theme="light"] .message-files span,
html[data-theme="light"] .chat-file-panel span { background: #e9f0ea !important; }
html[data-theme="light"] button[aria-label="撤回这条消息"] { background: #eef3ed !important; color: #35545a !important; border-color: var(--line) !important; }

/* 命令权限弹层使用内联样式，浅色主题需要明确覆盖。 */
html[data-theme="light"] [id^="command-risk-"] { background: #fffef9 !important; color: var(--ink) !important; border-color: var(--line) !important; box-shadow: 0 16px 40px #344b4126 !important; }
html[data-theme="light"] [id^="command-risk-"] p,
html[data-theme="light"] [id^="command-risk-"] small { color: var(--muted) !important; }
html[data-theme="light"] [id^="command-risk-"] button { background: #edf3ee !important; color: var(--ink) !important; border-color: var(--line) !important; }

.account-actions .theme-toggle,
.employee-theme-toggle { white-space: nowrap; color: var(--ink); }
.brand-row { flex-wrap: wrap; }
.brand-row .account-actions { flex: 1 0 100%; justify-content: flex-end; margin-left: 0; }
html[data-theme="dark"] .account-actions button { color: var(--muted); }
.theme-toggle::after,
.employee-theme-toggle::after { content: " · 深色"; color: var(--muted); }
html[data-theme="light"] .theme-toggle::after,
html[data-theme="light"] .employee-theme-toggle::after { content: " · 浅色"; }
button:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* 员工管理页共用同一主题选择。 */
html[data-theme="dark"] body.employee-page { background: var(--bg); color: var(--ink); }
html[data-theme="light"] body.employee-page { background: var(--bg); color: var(--ink); }
html[data-theme="light"] body.employee-page section { background: var(--panel); border-color: var(--line); }
html[data-theme="light"] body.employee-page p,
html[data-theme="light"] body.employee-page small,
html[data-theme="light"] body.employee-page .employee span,
html[data-theme="light"] body.employee-page .check { color: var(--muted); }
html[data-theme="light"] body.employee-page label { color: var(--ink); }
html[data-theme="light"] body.employee-page input:not([type=checkbox]),
html[data-theme="light"] body.employee-page select,
html[data-theme="light"] body.employee-page button { background: #f8faf6; color: var(--ink); border-color: var(--line); }
html[data-theme="light"] body.employee-page button.primary { background: var(--cyan); color: #fff; }
html[data-theme="light"] body.employee-page fieldset,
html[data-theme="light"] body.employee-page .conversation-list,
html[data-theme="light"] body.employee-page .transcript,
html[data-theme="light"] body.employee-page .message { border-color: var(--line); }
html[data-theme="light"] body.employee-page .conversation-item.active { background: #e7f2ec; border-color: var(--cyan); }
html[data-theme="light"] body.employee-page .message summary { color: var(--cyan); }
html[data-theme="light"] body.employee-page .notice.error { color: #9e3445; }
html[data-theme="light"] body.employee-page .notice { color: var(--green); }
html[data-theme="light"] body.employee-page a { color: var(--cyan); }
