﻿/* light-theme.css - KulvAi 创作校样台浅色系统 v2.1.4 */
html[data-theme="light"] {
  color-scheme: light;
}

html[data-theme="light"] body.logged-in {
  --brand-primary: #171a1e;
  --brand-hover: #050607;
  --brand-soft: #edf0f2;
  --brand-line: rgba(23, 26, 30, 0.28);
  --brand-accent: #171a1e;
  --brand-accent-deep: #050607;
  --brand-accent-rgb: 23, 26, 30;
  --brand-accent-deep-rgb: 5, 6, 7;
  --surface-0: #f2f4f5;
  --surface-1: #ffffff;
  --surface-2: #f8f9fa;
  --surface-3: #e8ecef;
  --ui-canvas: #f2f4f5;
  --ui-surface: #ffffff;
  --ui-surface-raised: #f8f9fa;
  --ui-surface-hover: #edf0f2;
  --ui-line: rgba(23, 25, 28, 0.12);
  --ui-line-strong: rgba(23, 25, 28, 0.22);
  --ui-text: #17191c;
  --ui-text-secondary: #68717a;
  --home-void: #0b0d10;
  --home-device: #ffffff;
  --home-device-raised: #f4f6f7;
  --home-line: #dfe3e6;
  --home-line-strong: #aeb6bd;
  --home-silver: #68717a;
  --home-frost: #17191c;
  --glass-bg: rgba(255, 255, 255, 0.9);
  --glass-border: rgba(23, 25, 28, 0.1);
  --glass-shadow: 0 18px 44px rgba(23, 25, 28, 0.08);
  --border-subtle: #dfe3e6;
  --border-strong: rgba(23, 25, 28, 0.28);
  --primary: var(--brand-primary);
  --primary-hover: var(--brand-hover);
  --text-primary: #17191c;
  --text-secondary: #68717a;
  --text-muted: #818991;
  background: var(--surface-0);
  color: var(--text-primary);
}

html[data-theme="light"] body.logged-in,
html[data-theme="light"] body.logged-in button,
html[data-theme="light"] body.logged-in input,
html[data-theme="light"] body.logged-in select,
html[data-theme="light"] body.logged-in textarea {
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

html[data-theme="light"] body.logged-in ::-webkit-scrollbar-thumb {
  background: rgba(68, 63, 70, 0.22);
}

html[data-theme="light"] body.logged-in ::-webkit-scrollbar-thumb:hover {
  background: rgba(68, 63, 70, 0.34);
}

/* 页面底色与顶栏 */
html[data-theme="light"] body.logged-in .aurora-bg {
  opacity: 1;
  background:
    radial-gradient(ellipse at 14% 0%, rgba(242, 242, 242, 0.14), transparent 36rem),
    radial-gradient(ellipse at 92% 18%, rgba(189, 189, 189, 0.09), transparent 34rem),
    #f2f5f7;
}

html[data-theme="light"] body.logged-in .top-bar {
  background: rgba(255, 255, 255, 0.9);
  border-bottom-color: #dfe3e9;
  box-shadow: 0 8px 28px rgba(43, 38, 44, 0.06);
}

html[data-theme="light"] body.logged-in .top-bar-brand {
  color: var(--brand-primary);
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  -webkit-text-fill-color: currentColor;
}

html[data-theme="light"] body.logged-in .top-bar-brand-mark {
  border-color: #d8dce2;
  box-shadow: 0 5px 14px rgba(48, 42, 49, 0.1);
}

html[data-theme="light"] body.logged-in .search-wrapper input,
html[data-theme="light"] body.logged-in #global-search {
  color: var(--text-primary);
  background: #f1f3f6;
  border-color: #d8dde4;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

html[data-theme="light"] body.logged-in #global-search::placeholder {
  color: #8a909a;
}

html[data-theme="light"] body.logged-in .search-icon {
  color: #6d727c;
}

html[data-theme="light"] body.logged-in .search-results,
html[data-theme="light"] body.logged-in .user-dropdown {
  color: var(--text-primary);
  background: #ffffff;
  border-color: #dce0e6;
  box-shadow: 0 22px 48px rgba(45, 39, 46, 0.13);
}

html[data-theme="light"] body.logged-in .search-result-item,
html[data-theme="light"] body.logged-in .user-dropdown a {
  color: var(--text-primary);
  border-color: #eceef2;
}

html[data-theme="light"] body.logged-in .search-result-item:hover,
html[data-theme="light"] body.logged-in .user-dropdown a:hover {
  color: var(--brand-primary);
  background: var(--brand-soft);
}

html[data-theme="light"] body.logged-in .search-result-item .sri-category,
html[data-theme="light"] body.logged-in .search-result-item .sri-action,
html[data-theme="light"] body.logged-in .user-dropdown .dropdown-header {
  color: var(--text-secondary);
}

html[data-theme="light"] body.logged-in .user-dropdown .dropdown-divider {
  background: #e4e7ec;
}

html[data-theme="light"] body.logged-in .top-bar-icon-btn,
html[data-theme="light"] body.logged-in .user-avatar {
  color: #514c54;
  background: #f7f8fa;
  border-color: #d9dde4;
}

html[data-theme="light"] body.logged-in .top-bar-icon-btn:hover,
html[data-theme="light"] body.logged-in .user-avatar:hover {
  color: var(--brand-primary);
  background: var(--brand-soft);
  border-color: var(--brand-line);
}

html[data-theme="light"] body.logged-in .top-bar-canvas-btn {
  color: var(--ui-text);
  background: #ffffff;
  border: 1px solid var(--ui-line);
  box-shadow: 0 4px 12px rgba(23, 25, 28, 0.06);
}

html[data-theme="light"] body.logged-in .top-bar-canvas-btn:hover {
  color: var(--ui-text);
  background: var(--ui-surface-hover);
  border-color: var(--ui-line-strong);
  box-shadow: 0 6px 16px rgba(23, 25, 28, 0.09);
}

html[data-theme="light"] body.logged-in .top-bar-quick-experience {
  color: var(--ui-text-secondary);
  background: var(--ui-surface-raised);
  border-color: var(--ui-line);
  box-shadow: 0 4px 12px rgba(23, 25, 28, 0.055);
}

html[data-theme="light"] body.logged-in .top-bar-quick-experience strong {
  color: var(--ui-text);
}

html[data-theme="light"] body.logged-in .top-bar-quick-experience:hover {
  color: var(--ui-text);
  background: var(--ui-surface-hover);
  border-color: var(--ui-line-strong);
  box-shadow: 0 6px 16px rgba(23, 25, 28, 0.085);
}

.theme-toggle {
  width: 36px;
  height: 34px;
  padding: 0;
  justify-content: center;
}

.theme-toggle .ui-icon {
  width: 18px;
  height: 18px;
}

html[data-theme="dark"] .theme-icon-dark,
html[data-theme="light"] .theme-icon-light {
  display: none;
}

html[data-theme="dark"] .theme-icon-light,
html[data-theme="light"] .theme-icon-dark {
  display: block;
}

/* 首页与模型卡片 */
html[data-theme="light"] body.logged-in .home-quick-start {
  position: relative;
  overflow: hidden;
  background: #ffffff;
  border-color: #ded6dc;
  box-shadow: 0 18px 44px rgba(55, 46, 54, 0.09);
}

html[data-theme="light"] body.logged-in .home-quick-start::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--brand-primary);
}

html[data-theme="light"] body.logged-in .category-header {
  border-bottom-color: #dde1e7;
}

html[data-theme="light"] body.logged-in .category-header .arrow,
html[data-theme="light"] body.logged-in .home-quick-copy span,
html[data-theme="light"] body.logged-in .home-goal-link-copy span,
html[data-theme="light"] body.logged-in .home-hero-copy p,
html[data-theme="light"] body.logged-in .home-section-heading p {
  color: var(--text-secondary);
}

html[data-theme="light"] body.logged-in .home-eyebrow,
html[data-theme="light"] body.logged-in .home-hero-title-accent,
html[data-theme="light"] body.logged-in .home-section-action,
html[data-theme="light"] body.logged-in .home-quick-arrow,
html[data-theme="light"] body.logged-in .home-goal-link-arrow {
  color: var(--brand-primary);
  -webkit-text-fill-color: currentColor;
}

html[data-theme="light"] body.logged-in .home-hero-title-accent {
  background: none;
  text-shadow: none;
}

html[data-theme="light"] body.logged-in .home-hero-copy > .home-eyebrow::before,
html[data-theme="light"] body.logged-in .home-hero-title-accent::before {
  color: var(--brand-primary);
}

html[data-theme="light"] body.logged-in .home-hero-title-accent::after {
  background: var(--brand-primary);
  box-shadow: none;
}

html[data-theme="light"] body.logged-in .home-intent-icon {
  color: var(--brand-primary);
  background: var(--brand-soft);
}

html[data-theme="light"] body.logged-in .home-intent-icon-content,
html[data-theme="light"] body.logged-in .home-intent-icon-notes,
html[data-theme="light"] body.logged-in .home-intent-icon-script {
  color: #526d86;
  background: #e7eef5;
}

html[data-theme="light"] body.logged-in .home-intent-icon-collab,
html[data-theme="light"] body.logged-in .home-intent-icon-chat,
html[data-theme="light"] body.logged-in .home-intent-icon-video {
  color: #327765;
  background: #e4f1ed;
}

html[data-theme="light"] body.logged-in .card,
html[data-theme="light"] body.logged-in .home-quick-card,
html[data-theme="light"] body.logged-in .home-goal-group,
html[data-theme="light"] body.logged-in .home-goal-link,
html[data-theme="light"] body.logged-in .home-all-tools,
html[data-theme="light"] body.logged-in .home-last-used-action,
html[data-theme="light"] body.logged-in .home-output-item,
html[data-theme="light"] body.logged-in .home-workbench-card,
html[data-theme="light"] body.logged-in .home-picker-card,
html[data-theme="light"] body.logged-in .home-picker-task-card {
  color: var(--text-primary);
  background: #ffffff;
  border-color: #dde1e7;
  box-shadow: 0 9px 26px rgba(46, 40, 47, 0.055);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

html[data-theme="light"] body.logged-in .card::before {
  display: none;
}

html[data-theme="light"] body.logged-in .card:hover,
html[data-theme="light"] body.logged-in .home-quick-card:hover,
html[data-theme="light"] body.logged-in .home-goal-link:hover,
html[data-theme="light"] body.logged-in .home-last-used-action:hover,
html[data-theme="light"] body.logged-in .home-output-item:hover,
html[data-theme="light"] body.logged-in .home-workbench-card:hover,
html[data-theme="light"] body.logged-in .home-picker-card:hover,
html[data-theme="light"] body.logged-in .home-picker-task-card:hover {
  border-color: var(--brand-line);
  background: #ffffff;
  box-shadow: 0 15px 34px rgba(70, 52, 64, 0.11);
  transform: translateY(-2px);
}

html[data-theme="light"] body.logged-in .home-quick-card::after,
html[data-theme="light"] body.logged-in .home-workbench-card::after {
  background: var(--brand-primary);
}

html[data-theme="light"] body.logged-in .home-all-tools > summary,
html[data-theme="light"] body.logged-in .home-all-tools-body,
html[data-theme="light"] body.logged-in .home-workbench-heading {
  border-color: #e1e4e9;
}

html[data-theme="light"] body.logged-in .home-workbench-grid .sv2-home-cta,
html[data-theme="light"] body.logged-in .home-workbench-grid .nv2-home-cta {
  color: #ffffff;
  background: var(--brand-primary);
  border-color: var(--brand-primary);
}

html[data-theme="light"] body.logged-in .home-workbench-phase {
  color: var(--brand-primary);
  background: var(--brand-soft);
  border-color: rgba(48, 53, 58, 0.24);
}

html[data-theme="light"] body.logged-in .home-intent-picker,
html[data-theme="light"] body.logged-in .km-overlay,
html[data-theme="light"] body.logged-in .km-editor-overlay,
html[data-theme="light"] body.logged-in .modal-overlay {
  background: rgba(38, 34, 40, 0.32);
  backdrop-filter: blur(8px);
}

html[data-theme="light"] body.logged-in .home-picker-panel {
  color: var(--text-primary);
  background: #ffffff;
  border-color: #dce0e6;
  box-shadow: 0 28px 70px rgba(47, 40, 48, 0.18);
}

/* 通用生成页、表单与结果 */
html[data-theme="light"] body.logged-in #work-view {
  background: transparent;
}

html[data-theme="light"] body.logged-in #work-view.standard-generation-view {
  --generation-panel: #ffffff;
  --generation-panel-strong: #f7f8fa;
  --generation-line: #dde1e7;
  --generation-line-accent: rgba(48, 53, 58, 0.34);
  --generation-copy-muted: #737985;
}

html[data-theme="light"] body.logged-in #work-view.standard-generation-view > #back-btn {
  color: #65606a;
  background: #ffffff;
  border-color: #d9dde4;
  box-shadow: 0 5px 15px rgba(46, 40, 47, 0.07);
}

html[data-theme="light"] body.logged-in #work-view.standard-generation-view > #back-btn:hover {
  color: var(--brand-primary);
  background: var(--brand-soft);
  border-color: var(--brand-line);
}

html[data-theme="light"] body.logged-in #work-view.standard-generation-view .generation-workspace-header,
html[data-theme="light"] body.logged-in #work-view.standard-generation-view .input-panel,
html[data-theme="light"] body.logged-in #work-view.standard-generation-view .result-panel {
  color: var(--text-primary);
  background: #ffffff;
  border-color: #dde1e7;
  box-shadow: 0 14px 36px rgba(46, 40, 47, 0.075);
}

html[data-theme="light"] body.logged-in #work-view.standard-generation-view .generation-workspace-header {
  background:
    linear-gradient(110deg, rgba(48, 53, 58, 0.075), transparent 34%),
    #ffffff;
}

html[data-theme="light"] body.logged-in #work-view.standard-generation-view .generation-workspace-mark {
  color: var(--brand-primary);
  background: var(--brand-soft);
  border-color: rgba(48, 53, 58, 0.28);
}

html[data-theme="light"] body.logged-in #work-view.standard-generation-view .generation-model-chip {
  color: #615c65;
  background: #f7f8fa;
  border-color: #d9dde4;
}

html[data-theme="light"] body.logged-in #work-view.standard-generation-view .generation-panel-header {
  background: #fafbfc;
  border-bottom-color: #e1e4e9;
}

html[data-theme="light"] body.logged-in #work-view.standard-generation-view .generation-field-heading span {
  color: var(--brand-primary);
  background: var(--brand-soft);
}

html[data-theme="light"] body.logged-in #work-view.standard-generation-view .generation-prompt-field,
html[data-theme="light"] body.logged-in #work-view.standard-generation-view .advanced-params,
html[data-theme="light"] body.logged-in #work-view.standard-generation-view .upload-area {
  background: #f7f8fa;
  border-color: #d7dce3;
}

html[data-theme="light"] body.logged-in #work-view.standard-generation-view .generation-prompt-field {
  background: #ffffff;
}

html[data-theme="light"] body.logged-in #work-view.standard-generation-view input,
html[data-theme="light"] body.logged-in #work-view.standard-generation-view select,
html[data-theme="light"] body.logged-in #work-view.standard-generation-view textarea {
  color-scheme: light;
  color: var(--text-primary);
  background: #ffffff;
  border-color: #d7dce3;
}

html[data-theme="light"] body.logged-in #work-view.standard-generation-view select option,
html[data-theme="light"] body.logged-in #work-view.standard-generation-view select optgroup {
  color: var(--text-primary);
  background: #ffffff;
}

html[data-theme="light"] body.logged-in #work-view.standard-generation-view input:focus,
html[data-theme="light"] body.logged-in #work-view.standard-generation-view select:focus,
html[data-theme="light"] body.logged-in #work-view.standard-generation-view textarea:focus {
  color: var(--text-primary);
  background: #ffffff;
  border-color: var(--brand-primary);
}

html[data-theme="light"] body.logged-in #work-view.standard-generation-view .generation-prompt-field textarea {
  color: var(--text-primary);
  background: transparent;
}

html[data-theme="light"] body.logged-in #work-view.standard-generation-view .generation-assets-section,
html[data-theme="light"] body.logged-in #work-view.standard-generation-view .generation-params-section {
  border-top-color: #e1e4e9;
}

html[data-theme="light"] body.logged-in #work-view.standard-generation-view .advanced-toggle {
  color: #615c65;
  background: #ffffff;
  border-color: #d7dce3;
}

html[data-theme="light"] body.logged-in #work-view.standard-generation-view .generation-primary-actions {
  background: rgba(255, 255, 255, 0.94);
  border-color: #d9dde4;
  box-shadow: 0 10px 26px rgba(46, 40, 47, 0.1);
}

html[data-theme="light"] body.logged-in #work-view.standard-generation-view .generation-result-stage {
  background:
    linear-gradient(rgba(77, 71, 81, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(77, 71, 81, 0.045) 1px, transparent 1px),
    #f6f7f9;
  background-size: 28px 28px;
}

html[data-theme="light"] body.logged-in #work-view.standard-generation-view .generation-empty-mark {
  background: var(--brand-soft);
  border-color: rgba(48, 53, 58, 0.34);
}

html[data-theme="light"] body.logged-in #work-view.standard-generation-view .generation-empty-mark i {
  border-color: rgba(48, 53, 58, 0.76);
  box-shadow: 14px -10px 0 -6px var(--brand-primary), -13px 11px 0 -6px #6b7075;
}

html[data-theme="light"] body.logged-in .input-panel,
html[data-theme="light"] body.logged-in .result-panel,
html[data-theme="light"] body.logged-in .notes-card,
html[data-theme="light"] body.logged-in .task-item,
html[data-theme="light"] body.logged-in .generating-bar,
html[data-theme="light"] body.logged-in .xhs-task-card,
html[data-theme="light"] body.logged-in .history-item.text-card {
  color: var(--text-primary);
  background: #ffffff;
  border-color: #dde1e7;
  box-shadow: 0 12px 32px rgba(46, 40, 47, 0.065);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

html[data-theme="light"] body.logged-in .result-panel {
  background: #f8f9fb;
}

html[data-theme="light"] body.logged-in .input-panel::after,
html[data-theme="light"] body.logged-in .result-panel::after {
  background: var(--brand-primary);
}

html[data-theme="light"] body.logged-in .form-group label,
html[data-theme="light"] body.logged-in .notes-title,
html[data-theme="light"] body.logged-in .history-section h3,
html[data-theme="light"] body.logged-in .history-preview h3,
html[data-theme="light"] body.logged-in .progress-text {
  color: var(--text-secondary);
}

html[data-theme="light"] body.logged-in input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
html[data-theme="light"] body.logged-in select,
html[data-theme="light"] body.logged-in textarea {
  color-scheme: light;
  color: var(--text-primary);
  background: #f7f8fa;
  border-color: #d7dce3;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

html[data-theme="light"] body.logged-in input::placeholder,
html[data-theme="light"] body.logged-in textarea::placeholder {
  color: #9298a2;
}

html[data-theme="light"] body.logged-in input:focus,
html[data-theme="light"] body.logged-in select:focus,
html[data-theme="light"] body.logged-in textarea:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(48, 53, 58, 0.14);
}

html[data-theme="light"] body.logged-in select option {
  color: var(--text-primary);
  background: #ffffff;
}

html[data-theme="light"] body.logged-in #run-btn,
html[data-theme="light"] body.logged-in #generate-script-btn,
html[data-theme="light"] body.logged-in .km-btn-primary,
html[data-theme="light"] body.logged-in .modal-btn.confirm {
  color: #ffffff;
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  box-shadow: 0 8px 20px rgba(48, 53, 58, 0.2);
}

html[data-theme="light"] body.logged-in #run-btn:hover,
html[data-theme="light"] body.logged-in #generate-script-btn:hover,
html[data-theme="light"] body.logged-in .km-btn-primary:hover,
html[data-theme="light"] body.logged-in .modal-btn.confirm:hover {
  color: #ffffff;
  background: var(--brand-hover);
  box-shadow: 0 11px 25px rgba(48, 53, 58, 0.26);
}

html[data-theme="light"] body.logged-in #reset-btn,
html[data-theme="light"] body.logged-in #reset-lipsync-btn,
html[data-theme="light"] body.logged-in #reset-sf-btn,
html[data-theme="light"] body.logged-in #reset-script-btn,
html[data-theme="light"] body.logged-in .btn-outline,
html[data-theme="light"] body.logged-in .modal-btn.cancel,
html[data-theme="light"] body.logged-in .km-btn-ghost {
  color: #514c54;
  background: #ffffff;
  border-color: #d4d9e0;
}

html[data-theme="light"] body.logged-in #reset-btn:hover,
html[data-theme="light"] body.logged-in #reset-lipsync-btn:hover,
html[data-theme="light"] body.logged-in #reset-sf-btn:hover,
html[data-theme="light"] body.logged-in #reset-script-btn:hover,
html[data-theme="light"] body.logged-in .btn-outline:hover,
html[data-theme="light"] body.logged-in .modal-btn.cancel:hover,
html[data-theme="light"] body.logged-in .km-btn-ghost:hover {
  color: var(--brand-primary);
  background: var(--brand-soft);
  border-color: var(--brand-line);
}

html[data-theme="light"] body.logged-in .btn-replicate {
  color: var(--brand-primary);
  background: var(--brand-soft);
  border-color: var(--brand-primary);
}

html[data-theme="light"] body.logged-in .btn-replicate:hover {
  color: #ffffff;
  background: var(--brand-primary);
}

html[data-theme="light"] body.logged-in .upload-area {
  color: var(--text-secondary);
  background: #f7f8fa;
  border-color: #cfd5dd;
}

html[data-theme="light"] body.logged-in .upload-area:hover,
html[data-theme="light"] body.logged-in .upload-area.dragover {
  color: var(--brand-primary);
  background: var(--brand-soft);
  border-color: var(--brand-primary);
}

html[data-theme="light"] body.logged-in .upload-area span,
html[data-theme="light"] body.logged-in .notes-count {
  color: var(--text-secondary);
}

html[data-theme="light"] body.logged-in .progress-bar,
html[data-theme="light"] body.logged-in .xhs-task-progress-bar-bg {
  background: #e1e5ea;
}

html[data-theme="light"] body.logged-in .progress-fill,
html[data-theme="light"] body.logged-in .xhs-task-progress-bar {
  background: var(--brand-primary);
}

/* 对话与历史 */
html[data-theme="light"] body.logged-in .chat-container,
html[data-theme="light"] body.logged-in .chat-main-area,
html[data-theme="light"] body.logged-in .chat-container-inner,
html[data-theme="light"] body.logged-in .session-list {
  color: var(--text-primary);
  background: transparent;
}

html[data-theme="light"] body.logged-in .chat-msg-user {
  color: #ffffff;
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  box-shadow: 0 8px 18px rgba(48, 53, 58, 0.17);
}

html[data-theme="light"] body.logged-in .chat-msg-assistant,
html[data-theme="light"] body.logged-in .session-item {
  color: var(--text-primary);
  background: #ffffff;
  border-color: #dde1e7;
  box-shadow: 0 8px 22px rgba(46, 40, 47, 0.055);
}

html[data-theme="light"] body.logged-in .session-item:hover,
html[data-theme="light"] body.logged-in .session-item.active {
  background: var(--brand-soft);
  border-color: var(--brand-line);
}

html[data-theme="light"] body.logged-in .chat-msg-assistant pre,
html[data-theme="light"] body.logged-in .chat-msg-assistant code:not(pre code) {
  color: #35313a;
  background: #eef1f4;
  border-color: #d9dee5;
}

html[data-theme="light"] body.logged-in .chat-copy-btn,
html[data-theme="light"] body.logged-in .chat-regenerate-btn {
  color: var(--text-secondary);
  background: #ffffff;
  border-color: #d8dde4;
}

html[data-theme="light"] body.logged-in .history-item {
  border-color: #d8dde4;
  background: #ffffff;
}

html[data-theme="light"] body.logged-in .history-item:hover {
  border-color: var(--brand-primary);
  box-shadow: 0 8px 20px rgba(48, 53, 58, 0.14);
}

/* AI 对话工作台：覆盖专属深色变量与高优先级组件规则 */
html[data-theme="light"] body.logged-in #work-view.chat-workbench-view {
  --chat-panel: #ffffff;
  --chat-panel-raised: #ffffff;
  --chat-panel-soft: #f2f6f8;
  --chat-line: #dde1e7;
  --chat-line-strong: #ccd2da;
  --chat-accent: #30353a;
  --chat-accent-soft: #e3f4f7;
  --chat-accent-line: rgba(48, 53, 58, 0.38);
  --chat-signal: #526b78;
  --chat-signal-soft: rgba(48, 53, 58, 0.1);
  --chat-select-option: #ffffff;
  --chat-danger: #b74755;
  --chat-danger-soft: #f9e8ea;
  color: var(--text-primary);
  background:
    radial-gradient(circle at 68% -20%, rgba(48, 53, 58, 0.09), transparent 34%),
    #f3f5f7;
}

html[data-theme="light"] body.logged-in #chat-overlay[data-chat-kind="gpt"] {
  --chat-signal: #596f9c;
  --chat-signal-soft: rgba(89, 111, 156, 0.1);
}

html[data-theme="light"] body.logged-in #chat-overlay[data-chat-kind="kimi"] {
  --chat-signal: #327765;
  --chat-signal-soft: rgba(50, 119, 101, 0.1);
}

html[data-theme="light"] body.logged-in #work-view.chat-workbench-view .chat-workbench-header {
  background: rgba(255, 255, 255, 0.9);
  border-bottom-color: var(--chat-line);
  box-shadow: 0 8px 26px rgba(46, 40, 47, 0.05);
}

html[data-theme="light"] body.logged-in #chat-overlay #chat-session-sidebar {
  background: #ffffff;
  border-right-color: var(--chat-line);
}

html[data-theme="light"] body.logged-in #chat-overlay .chat-main-area,
html[data-theme="light"] body.logged-in #chat-overlay .chat-container-inner,
html[data-theme="light"] body.logged-in #chat-overlay #chat-messages {
  color: var(--text-primary);
  background: transparent;
}

html[data-theme="light"] body.logged-in #chat-overlay #chat-model-select {
  color-scheme: light;
}

html[data-theme="light"] body.logged-in #chat-overlay #chat-session-search,
html[data-theme="light"] body.logged-in #chat-overlay #chat-advanced-panel input[type="number"] {
  color: var(--text-primary);
  background: #f7f8fa;
  border-color: var(--chat-line);
}

html[data-theme="light"] body.logged-in #chat-overlay .session-item {
  color: var(--text-primary);
  background: transparent;
  box-shadow: none;
}

html[data-theme="light"] body.logged-in #chat-overlay .session-item:hover,
html[data-theme="light"] body.logged-in #chat-overlay .session-item:focus-within,
html[data-theme="light"] body.logged-in #chat-overlay .session-item.active {
  background: var(--chat-accent-soft);
  border-color: var(--chat-accent-line);
}

html[data-theme="light"] body.logged-in #chat-overlay .chat-msg-user {
  color: var(--text-primary);
  background: var(--chat-accent-soft);
  border-color: var(--chat-accent-line);
  box-shadow: none;
}

html[data-theme="light"] body.logged-in #chat-overlay .chat-msg-assistant {
  color: var(--text-primary);
  background: transparent;
  border-left-color: var(--chat-signal-soft);
  box-shadow: none;
}

html[data-theme="light"] body.logged-in #chat-overlay .chat-msg-assistant pre {
  color: #35313a;
  background: #eef1f4;
  border-color: #d9dee5;
}

html[data-theme="light"] body.logged-in #chat-overlay .chat-msg-assistant code:not(pre code) {
  color: var(--chat-accent);
  background: var(--chat-accent-soft);
}

html[data-theme="light"] body.logged-in #chat-overlay .chat-inline-file {
  background: #f7f8fa;
  border-color: var(--chat-line);
}

html[data-theme="light"] body.logged-in #chat-overlay #chat-input-area {
  background: linear-gradient(180deg, transparent, rgba(243, 245, 247, 0.96) 22%);
}

html[data-theme="light"] body.logged-in #chat-overlay #chat-input-area.drag-over::before {
  color: var(--chat-accent);
  background: rgba(255, 255, 255, 0.96);
  border-color: var(--chat-accent);
}

html[data-theme="light"] body.logged-in #chat-overlay #chat-advanced-panel,
html[data-theme="light"] body.logged-in #chat-overlay .chat-file-tag,
html[data-theme="light"] body.logged-in #chat-overlay #chat-input-row,
html[data-theme="light"] body.logged-in #chat-overlay #chat-loading {
  color: var(--text-primary);
  background: #ffffff;
  border-color: var(--chat-line);
}

html[data-theme="light"] body.logged-in #chat-overlay #chat-input-row {
  box-shadow: 0 14px 34px rgba(46, 40, 47, 0.1);
}

html[data-theme="light"] body.logged-in #chat-overlay #chat-input-row:focus-within {
  border-color: var(--chat-accent-line);
  box-shadow: 0 14px 34px rgba(46, 40, 47, 0.12), 0 0 0 2px var(--chat-accent-soft);
}

html[data-theme="light"] body.logged-in #chat-overlay #chat-send-btn {
  color: #ffffff;
  background: var(--chat-accent);
  border-color: var(--chat-accent);
}

html[data-theme="light"] body.logged-in .chat-confirm-dialog {
  color: var(--text-primary);
  background: #ffffff;
  border-color: #d9dde4;
  box-shadow: 0 26px 70px rgba(45, 39, 46, 0.2);
}

/* 小红书工作流：一个共享外壳覆盖爆款主图、稿件改写等全部工作流 */
html[data-theme="light"] body.logged-in #work-view.xhs-workflow-view {
  --xhs-panel: #ffffff;
  --xhs-panel-strong: #f7f8fa;
  --xhs-surface-raised: #ffffff;
  --xhs-line: #dde1e7;
  --xhs-line-strong: #cbd2da;
  --xhs-coral: #30353a;
  --xhs-coral-soft: #e3f4f7;
  --xhs-coral-line: rgba(48, 53, 58, 0.38);
  --xhs-amber: #526d86;
  --xhs-amber-soft: #e7eef5;
  --xhs-muted: #747b87;
  color: var(--text-primary);
  background: transparent;
}

html[data-theme="light"] body.logged-in #work-view.xhs-workflow-view > #back-btn,
html[data-theme="light"] body.logged-in #work-view.xhs-workflow-view .generation-model-chip {
  color: var(--text-secondary);
  background: #f7f8fa;
  border-color: var(--xhs-line);
}

html[data-theme="light"] body.logged-in #work-view.xhs-workflow-view .generation-workspace-header {
  background:
    linear-gradient(110deg, rgba(48, 53, 58, 0.075), transparent 30%),
    #ffffff;
  border-color: var(--xhs-line);
  box-shadow: 0 16px 38px rgba(46, 40, 47, 0.08);
}

html[data-theme="light"] body.logged-in #work-view.xhs-workflow-view .generation-workspace-mark {
  color: var(--xhs-coral);
  background: var(--xhs-coral-soft);
  border-color: var(--xhs-coral-line);
}

html[data-theme="light"] body.logged-in #work-view.xhs-workflow-view .input-panel,
html[data-theme="light"] body.logged-in #work-view.xhs-workflow-view .result-panel {
  color: var(--text-primary);
  background: #ffffff;
  border-color: var(--xhs-line);
  box-shadow: 0 16px 38px rgba(46, 40, 47, 0.08);
}

html[data-theme="light"] body.logged-in #work-view.xhs-workflow-view .xhs-workflow-panel-header {
  background: linear-gradient(110deg, rgba(48, 53, 58, 0.045), transparent 60%);
  border-color: var(--xhs-line);
}

html[data-theme="light"] body.logged-in #work-view.xhs-workflow-view input:not([type="checkbox"]),
html[data-theme="light"] body.logged-in #work-view.xhs-workflow-view select,
html[data-theme="light"] body.logged-in #work-view.xhs-workflow-view textarea {
  color: var(--text-primary);
  background: #f7f8fa;
  border-color: var(--xhs-line);
  color-scheme: light;
}

html[data-theme="light"] body.logged-in #work-view.xhs-workflow-view .compare-text-input {
  color: var(--text-primary);
  background: #f7f8fa;
  border-color: var(--xhs-line);
}

html[data-theme="light"] body.logged-in #work-view.xhs-workflow-view input:not([type="checkbox"]):focus,
html[data-theme="light"] body.logged-in #work-view.xhs-workflow-view select:focus,
html[data-theme="light"] body.logged-in #work-view.xhs-workflow-view textarea:focus {
  border-color: var(--xhs-coral-line);
  box-shadow: 0 0 0 3px rgba(48, 53, 58, 0.13);
}

html[data-theme="light"] body.logged-in #work-view.xhs-workflow-view .upload-area {
  color: var(--text-secondary);
  background:
    linear-gradient(135deg, rgba(48, 53, 58, 0.035), transparent 52%),
    #f7f8fa;
  border-color: var(--xhs-line-strong);
}

html[data-theme="light"] body.logged-in #work-view.xhs-workflow-view .upload-area:hover,
html[data-theme="light"] body.logged-in #work-view.xhs-workflow-view .upload-area.dragover {
  color: var(--xhs-coral);
  background: var(--xhs-coral-soft);
  border-color: var(--xhs-coral-line);
}

html[data-theme="light"] body.logged-in #work-view.xhs-workflow-view .xhs-workflow-key-hint {
  color: var(--xhs-coral) !important;
  background: var(--xhs-coral-soft);
  border-color: var(--xhs-coral-line);
}

html[data-theme="light"] body.logged-in #work-view.xhs-workflow-view .xhs-workflow-actions {
  background: rgba(255, 255, 255, 0.94);
  border-color: var(--xhs-line);
  box-shadow: 0 10px 26px rgba(46, 40, 47, 0.08);
}

html[data-theme="light"] body.logged-in #work-view.xhs-workflow-view .xhs-workflow-actions #reset-btn {
  color: var(--text-secondary);
  background: #f7f8fa;
  border-color: var(--xhs-line);
}

html[data-theme="light"] body.logged-in #work-view.xhs-workflow-view .xhs-workflow-result-stage .workspace-history-panel {
  color: var(--text-primary);
  background: #ffffff;
  border: 1px solid var(--xhs-line);
  box-shadow: 0 12px 30px rgba(46, 40, 47, 0.07);
}

html[data-theme="light"] body.logged-in #work-view.xhs-workflow-view .xhs-workflow-actions #run-btn {
  color: #ffffff;
  background: var(--xhs-coral);
  box-shadow: 0 10px 24px rgba(48, 53, 58, 0.18);
}

html[data-theme="light"] body.logged-in #work-view.xhs-workflow-view #run-btn.xhs-icon-label > .xhs-inline-icon {
  color: #ffffff;
}

html[data-theme="light"] body.logged-in #work-view.xhs-workflow-view .xhs-workflow-result-stage {
  background:
    linear-gradient(rgba(91, 98, 109, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(91, 98, 109, 0.045) 1px, transparent 1px),
    #f8f9fb;
  background-size: 28px 28px;
}

html[data-theme="light"] body.logged-in #work-view.xhs-workflow-view .xhs-workflow-empty-state h3,
html[data-theme="light"] body.logged-in #work-view.xhs-workflow-view .history-section h3 {
  color: var(--text-primary);
}

html[data-theme="light"] body.logged-in #work-view.xhs-workflow-view .xhs-workflow-empty-mark {
  color: var(--xhs-coral);
  background: var(--xhs-coral-soft);
  border-color: var(--xhs-coral-line);
}

html[data-theme="light"] body.logged-in #work-view.xhs-workflow-view .btn-replicate,
html[data-theme="light"] body.logged-in #work-view.xhs-workflow-view .btn-outline,
html[data-theme="light"] body.logged-in #work-view.xhs-workflow-view .history-item,
html[data-theme="light"] body.logged-in #work-view.xhs-workflow-view .compare-history-item,
html[data-theme="light"] body.logged-in #work-view.xhs-workflow-view .compare-table-wrapper {
  color: var(--text-primary);
  background: #ffffff !important;
  border-color: var(--xhs-line) !important;
}

html[data-theme="light"] body.logged-in #work-view.xhs-workflow-view #replicate-prompt-display,
html[data-theme="light"] body.logged-in #work-view.xhs-workflow-view #scene-prompt-display {
  color: var(--text-secondary) !important;
  background: #f7f8fa !important;
  border-color: var(--xhs-line) !important;
}

html[data-theme="light"] body.logged-in #work-view.xhs-workflow-view #compare-summary:not(:empty) {
  color: var(--xhs-coral) !important;
}

html[data-theme="light"] body.logged-in #work-view.xhs-workflow-view .compare-table thead th {
  color: var(--text-primary);
  background: var(--xhs-coral-soft);
  border-color: var(--xhs-line);
}

html[data-theme="light"] body.logged-in #work-view.xhs-workflow-view button.xhs-icon-only {
  color: var(--xhs-coral) !important;
  background: #ffffff !important;
  border-color: var(--xhs-line) !important;
  box-shadow: 0 4px 12px rgba(46, 40, 47, 0.1);
}

/* 密钥、弹窗和旧管理组件 */
html[data-theme="light"] body.logged-in .km-modal,
html[data-theme="light"] body.logged-in .km-editor-card,
html[data-theme="light"] body.logged-in .modal-card {
  color: var(--text-primary);
  background: #ffffff;
  border-color: #d9dde4;
  box-shadow: 0 28px 74px rgba(45, 39, 46, 0.2);
}

html[data-theme="light"] body.logged-in .km-header,
html[data-theme="light"] body.logged-in .km-footer,
html[data-theme="light"] body.logged-in .modal-header {
  border-color: #e1e4e9;
}

html[data-theme="light"] body.logged-in .km-search,
html[data-theme="light"] body.logged-in .km-input-wrap input {
  color: var(--text-primary);
  background: #f5f7f9;
  border-color: #d6dbe2;
}

html[data-theme="light"] body.logged-in .km-section {
  border-color: #e0e4e9;
}

html[data-theme="light"] body.logged-in .km-group-row:hover,
html[data-theme="light"] body.logged-in .km-sub-row:hover {
  background: #f2f6f8;
}

html[data-theme="light"] body.logged-in .km-department-managed {
  color: var(--brand-primary);
  background: var(--brand-soft);
  border-color: rgba(48, 53, 58, 0.22);
}

html[data-theme="light"] body.logged-in .km-close,
html[data-theme="light"] body.logged-in .modal-close {
  color: #6c6870;
}

/* 管理控制台 */
html[data-theme="light"] body.logged-in .admin-console {
  --admin-bg: #f3f5f7;
  --admin-sidebar: #e9edf2;
  --admin-panel: #ffffff;
  --admin-panel-raised: #ffffff;
  --admin-panel-soft: #f7f8fa;
  --admin-line: #dde1e7;
  --admin-line-strong: #cbd1d9;
  --admin-accent: #30353a;
  --admin-accent-soft: #e3f4f7;
  --admin-text: #242229;
  --admin-text-secondary: #667080;
  --admin-text-muted: #7d838d;
  --admin-danger: #c84f5b;
  --admin-success: #247d69;
  --admin-warning: #9a6718;
  color: var(--admin-text);
  background: var(--admin-bg);
}

html[data-theme="light"] body.logged-in .admin-console-sidebar {
  background: #e9edf2;
  border-color: #d7dce3;
}

html[data-theme="light"] body.logged-in .admin-console-brand-mark {
  color: var(--admin-accent);
  background: var(--admin-accent-soft);
  border-color: rgba(48, 53, 58, 0.28);
}

html[data-theme="light"] body.logged-in .admin-tab.active {
  color: var(--admin-accent);
  background: #ffffff;
  border-color: var(--admin-line);
  box-shadow: inset 3px 0 0 var(--admin-accent), 0 6px 18px rgba(46, 40, 47, 0.06);
}

html[data-theme="light"] body.logged-in .admin-tab:hover,
html[data-theme="light"] body.logged-in .admin-state,
html[data-theme="light"] body.logged-in .admin-console-security {
  background: rgba(255, 255, 255, 0.66);
}

html[data-theme="light"] body.logged-in .admin-header,
html[data-theme="light"] body.logged-in .admin-section,
html[data-theme="light"] body.logged-in .admin-panel,
html[data-theme="light"] body.logged-in .upstream-config-card,
html[data-theme="light"] body.logged-in .provider-directory-card,
html[data-theme="light"] body.logged-in .department-card,
html[data-theme="light"] body.logged-in .department-routing-card {
  color: var(--admin-text);
  background: #ffffff;
  border-color: var(--admin-line);
  box-shadow: 0 10px 28px rgba(46, 40, 47, 0.055);
}

html[data-theme="light"] body.logged-in .admin-table th {
  color: var(--admin-text-secondary);
  background: #f1f3f6;
}

html[data-theme="light"] body.logged-in .admin-table td,
html[data-theme="light"] body.logged-in .admin-table th {
  border-color: #e0e4e9;
}

html[data-theme="light"] body.logged-in .admin-table tr:hover td {
  background: #f7f4f6;
}

html[data-theme="light"] body.logged-in .admin-content select {
  color: var(--admin-text) !important;
  background: #ffffff !important;
  color-scheme: light;
}

html[data-theme="light"] body.logged-in .admin-content select option,
html[data-theme="light"] body.logged-in .admin-content select optgroup {
  color: var(--admin-text) !important;
  background: #ffffff !important;
}

html[data-theme="light"] body.logged-in .admin-content input:focus,
html[data-theme="light"] body.logged-in .admin-content select:focus,
html[data-theme="light"] body.logged-in .admin-content textarea:focus {
  color: var(--admin-text) !important;
  background: #ffffff !important;
  border-color: rgba(48, 53, 58, 0.48) !important;
  box-shadow: 0 0 0 3px rgba(48, 53, 58, 0.12) !important;
}

html[data-theme="light"] body.logged-in .admin-content input::placeholder,
html[data-theme="light"] body.logged-in .admin-content textarea::placeholder {
  color: var(--admin-text-muted);
}

html[data-theme="light"] body.logged-in .admin-dialog-overlay {
  background: rgba(38, 34, 40, 0.32);
}

html[data-theme="light"] body.logged-in .admin-dialog {
  color: var(--text-primary);
  background:
    linear-gradient(145deg, rgba(48, 53, 58, 0.055), transparent 45%),
    #ffffff;
  border-color: #dce0e6;
  box-shadow: 0 28px 70px rgba(47, 40, 48, 0.18);
}

html[data-theme="light"] body.logged-in .admin-dialog-close,
html[data-theme="light"] body.logged-in .admin-dialog-cancel {
  color: var(--text-secondary);
  background: #f7f8fa;
  border-color: #dce0e6;
}

html[data-theme="light"] body.logged-in .admin-dialog-copy > span {
  color: var(--brand-primary);
}

html[data-theme="light"] body.logged-in .admin-dialog-copy h3 {
  color: var(--text-primary);
}

html[data-theme="light"] body.logged-in .admin-dialog-copy > p,
html[data-theme="light"] body.logged-in .admin-dialog-input {
  color: var(--text-secondary);
}

html[data-theme="light"] body.logged-in .admin-dialog-detail {
  color: var(--text-secondary);
  background: #f7f8fa;
  border-color: #dde1e7;
}

html[data-theme="light"] body.logged-in .admin-dialog-input input {
  color: var(--text-primary);
  background: #f7f8fa;
  border-color: #d7dce3;
  color-scheme: light;
}

html[data-theme="light"] body.logged-in .admin-dialog-input input:focus {
  background: #ffffff;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(48, 53, 58, 0.12);
}

html[data-theme="light"] body.logged-in .upstream-route-rail,
html[data-theme="light"] body.logged-in .upstream-test-result,
html[data-theme="light"] body.logged-in .upstream-history-item,
html[data-theme="light"] body.logged-in .provider-model-row,
html[data-theme="light"] body.logged-in .department-member-row,
html[data-theme="light"] body.logged-in .department-route-row {
  color: var(--admin-text);
  background: #f7f8fa;
  border-color: #dde1e7;
}

/* 脚本工作台 V2 */
html[data-theme="light"] body.logged-in #script-v2-view,
html[data-theme="light"] body.logged-in .sv2-home-spotlight,
html[data-theme="light"] body.logged-in .sv2-review-console,
html[data-theme="light"] body.logged-in .sv2-rule-confirm-layer {
  --sv2-bg: #f3f5f7;
  --sv2-panel: #ffffff;
  --sv2-panel-strong: #f7f8fa;
  --sv2-panel-raised: #e9edf2;
  --sv2-line: #dde1e7;
  --sv2-line-accent: rgba(48, 53, 58, 0.42);
  --sv2-accent-soft: #e3f4f7;
  --sv2-accent-faint: #f0f8fa;
  --sv2-text: #242229;
  --sv2-text-secondary: #667080;
  --sv2-muted: #7d838d;
  --sv2-success: #247d69;
  --sv2-success-soft: #e5f3ef;
  --sv2-danger: #c84f5b;
  --sv2-danger-soft: #fae9eb;
  --sv2-shadow: 0 14px 36px rgba(46, 40, 47, 0.08);
}

html[data-theme="light"] body.logged-in #script-v2-view {
  color: var(--sv2-text);
  background: #f3f5f7;
}

html[data-theme="light"] body.logged-in .sv2-stage.is-active,
html[data-theme="light"] body.logged-in .sv2-button-primary {
  color: #ffffff;
  background: var(--brand-primary);
  border-color: var(--brand-primary);
}

/* 笔记工作台 V2 */
html[data-theme="light"] body.logged-in #note-v2-view {
  --nv2-bg: #f3f5f7;
  --nv2-panel: #ffffff;
  --nv2-panel-solid: #f7f8fa;
  --nv2-line: #dde1e7;
  --nv2-accent: #30353a;
  --nv2-accent-hover: #181b1f;
  --nv2-text: #242229;
  --nv2-muted: #667080;
  --nv2-added: #247d69;
  --nv2-removed: #c84f5b;
  color: var(--nv2-text);
  background: #f3f5f7;
}

html[data-theme="light"] body.logged-in .nv2-panel,
html[data-theme="light"] body.logged-in .nv2-result-editor,
html[data-theme="light"] body.logged-in .nv2-version-card {
  background: #ffffff;
  border-color: #dde1e7;
  box-shadow: 0 10px 28px rgba(46, 40, 47, 0.055);
}

html[data-theme="light"] body.logged-in .nv2-button.is-primary,
html[data-theme="light"] body.logged-in .nv2-stage.is-active {
  color: #ffffff;
  background: var(--brand-primary);
  border-color: var(--brand-primary);
}

/* 参数表工作台 */
html[data-theme="light"] body.logged-in #param-table-hybrid-view {
  --pth-bg: #f3f5f7;
  --pth-panel: #ffffff;
  --pth-panel-soft: #f7f8fa;
  --pth-surface: #e9edf2;
  --pth-line: #dde1e7;
  --pth-line-strong: rgba(48, 53, 58, 0.42);
  --pth-primary: #30353a;
  --pth-primary-soft: #e3f4f7;
  --pth-text: #242229;
  --pth-muted: #667080;
  --pth-success: #247d69;
  color: var(--pth-text);
  background: #f3f5f7;
}

html[data-theme="light"] body.logged-in.param-table-hybrid-open {
  background: #f3f5f7;
}

html[data-theme="light"] body.logged-in .pth-panel,
html[data-theme="light"] body.logged-in .pth-header,
html[data-theme="light"] body.logged-in .pth-template-card {
  background: #ffffff;
  border-color: #dde1e7;
  box-shadow: 0 10px 28px rgba(46, 40, 47, 0.055);
}

html[data-theme="light"] body.logged-in .pth-header {
  background:
    linear-gradient(105deg, rgba(48, 53, 58, 0.075), transparent 34%),
    #ffffff;
}

html[data-theme="light"] body.logged-in .pth-header::before {
  background: var(--pth-primary);
}

html[data-theme="light"] body.logged-in .pth-back,
html[data-theme="light"] body.logged-in .pth-icon-button,
html[data-theme="light"] body.logged-in .pth-button {
  color: #514c54;
  background: #ffffff;
  border-color: #d7dce3;
}

html[data-theme="light"] body.logged-in .pth-back:hover,
html[data-theme="light"] body.logged-in .pth-icon-button:hover,
html[data-theme="light"] body.logged-in .pth-button:hover:not(:disabled),
html[data-theme="light"] body.logged-in .pth-generation-mode:hover,
html[data-theme="light"] body.logged-in .pth-template-option:hover {
  color: var(--pth-primary);
  border-color: rgba(48, 53, 58, 0.46);
}

html[data-theme="light"] body.logged-in .pth-stage.is-active,
html[data-theme="light"] body.logged-in .pth-label {
  color: var(--pth-text);
}

html[data-theme="light"] body.logged-in .pth-stage-line {
  background: rgba(48, 53, 58, 0.3);
}

html[data-theme="light"] body.logged-in .pth-upload:hover,
html[data-theme="light"] body.logged-in .pth-upload.is-dragging {
  background: var(--pth-primary-soft);
  border-color: rgba(48, 53, 58, 0.54);
}

html[data-theme="light"] body.logged-in .pth-upload-icon,
html[data-theme="light"] body.logged-in .pth-empty-icon {
  color: var(--pth-primary);
  background: var(--pth-primary-soft);
  border-color: rgba(48, 53, 58, 0.24);
}

html[data-theme="light"] body.logged-in .pth-textarea:focus,
html[data-theme="light"] body.logged-in .pth-input:focus {
  border-color: var(--pth-primary);
  box-shadow: 0 0 0 3px rgba(48, 53, 58, 0.13);
}

html[data-theme="light"] body.logged-in .pth-segment.is-active,
html[data-theme="light"] body.logged-in .pth-generation-mode.is-active,
html[data-theme="light"] body.logged-in .pth-template-option.is-active {
  color: var(--pth-text);
  background: var(--pth-primary-soft);
  border-color: rgba(48, 53, 58, 0.58);
  box-shadow: inset 0 0 0 1px rgba(48, 53, 58, 0.12);
}

html[data-theme="light"] body.logged-in .pth-mode-notice,
html[data-theme="light"] body.logged-in .pth-field-help.is-warning {
  color: #7d5a28;
  background: #f7f1e8;
  border-color: #e4d2b8;
}

html[data-theme="light"] body.logged-in .pth-button.is-primary {
  color: #ffffff;
  background: var(--pth-primary);
  border-color: var(--pth-primary);
}

html[data-theme="light"] body.logged-in .pth-button.is-primary:hover:not(:disabled) {
  color: #ffffff;
  background: var(--brand-hover);
}

html[data-theme="light"] body.logged-in .pth-button.is-secondary {
  color: var(--pth-primary);
  background: var(--pth-primary-soft);
  border-color: rgba(48, 53, 58, 0.32);
}

/* 花字工作台：界面变浅，中央素材画布保持中性深色 */
html[data-theme="light"] body.logged-in .dtw-view {
  --dt-surface: #f3f5f7;
  --dt-panel: #ffffff;
  --dt-panel-strong: #f7f8fa;
  --dt-line: #dde1e7;
  --dt-line-strong: rgba(48, 53, 58, 0.42);
  --dt-muted: #667080;
  --dt-danger: #c84f5b;
  --dt-success: #247d69;
  --dt-canvas: #141418;
  --dt-checker-a: #222228;
  --dt-checker-b: #1b1b20;
  color: #242229;
  background: #f3f5f7;
}

html[data-theme="light"] body.logged-in .dtw-dashboard,
html[data-theme="light"] body.logged-in .dtw-editor-bar,
html[data-theme="light"] body.logged-in .dtw-dashboard-bar,
html[data-theme="light"] body.logged-in .dtw-sidebar,
html[data-theme="light"] body.logged-in .dtw-property-panel,
html[data-theme="light"] body.logged-in .dtw-project-card,
html[data-theme="light"] body.logged-in .dtw-upload-card {
  color: #242229;
  background: #ffffff;
  border-color: #dde1e7;
}

html[data-theme="light"] body.logged-in .dtw-canvas-stage,
html[data-theme="light"] body.logged-in .dtw-canvas-wrap,
html[data-theme="light"] body.logged-in .dtw-canvas {
  color-scheme: dark;
  background-color: var(--dt-canvas);
}

/* 登录粒子页始终保持现有深色体系 */
html[data-theme="light"] #login-overlay {
  color-scheme: dark;
  --primary: #f2f2f2;
  --primary-hover: #bdbdbd;
  --text-primary: #f2f7f9;
  --text-secondary: #aab6c1;
  --glass-bg: rgba(17, 24, 32, 0.78);
  --glass-border: rgba(242, 247, 249, 0.08);
}

/* 无限画布与画布模式顶栏始终保持现有深色体系 */
html[data-theme="light"] body.logged-in #canvas-view {
  color-scheme: dark;
  --primary: #f2f2f2;
  --primary-hover: #bdbdbd;
  --text-primary: #f2f7f9;
  --text-secondary: #aab6c1;
  --text-muted: #7f8d99;
  --surface-0: #080b0f;
  --surface-1: rgba(17, 24, 32, 0.9);
  --surface-2: rgba(23, 34, 43, 0.96);
  --surface-3: rgba(31, 45, 56, 0.98);
  --glass-bg: rgba(17, 24, 32, 0.78);
  --glass-border: rgba(242, 247, 249, 0.08);
  --border-subtle: rgba(242, 247, 249, 0.08);
  --border-strong: rgba(242, 242, 242, 0.34);
  color: #f2f7f9;
  background: rgba(8, 11, 15, 0.98);
}

html[data-theme="light"] body.logged-in .top-bar.canvas-mode {
  --primary: #f2f2f2;
  --primary-hover: #bdbdbd;
  --text-primary: #f2f7f9;
  --text-secondary: #aab6c1;
  color: #f2f7f9;
  background: rgba(8, 11, 15, 0.96);
  border-bottom-color: rgba(255, 255, 255, 0.06);
  box-shadow: none;
}

html[data-theme="light"] body.logged-in .top-bar.canvas-mode .top-bar-brand {
  color: #f2f2f2;
  -webkit-text-fill-color: currentColor;
}

html[data-theme="light"] body.logged-in .top-bar.canvas-mode .top-bar-icon-btn,
html[data-theme="light"] body.logged-in .top-bar.canvas-mode .user-avatar {
  color: #cccccc;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="light"] body.logged-in .top-bar.canvas-mode .theme-toggle {
  display: none;
}

/* 首页模型首屏保留深色舞台，列表内容跟随浅色纸面 */
html[data-theme="light"] body.logged-in .home-model-hero {
  --brand-frost: #f2f7f9;
  --text-secondary: #aab6c1;
  --text-muted: #7f8d99;
  --border-subtle: rgba(242, 247, 249, 0.08);
  --surface-1: #111820;
  color-scheme: dark;
}

html[data-theme="light"] body.logged-in .home-model-card-copy strong {
  color: var(--text-primary);
}

html[data-theme="light"] body.logged-in .home-model-card-copy p,
html[data-theme="light"] body.logged-in .home-model-card-arrow,
html[data-theme="light"] body.logged-in .home-model-collection-count {
  color: var(--text-muted);
}

html[data-theme="light"] body.logged-in .home-model-card-media {
  background: #e8eef2;
}

@media (prefers-reduced-motion: reduce) {
  html[data-theme="light"] body.logged-in *,
  html[data-theme="light"] body.logged-in *::before,
  html[data-theme="light"] body.logged-in *::after {
    transition-duration: 0.01ms !important;
  }
}

/* ========== 创作校样台 v2：当前首页与应用外壳 ========== */
html[data-theme="light"] body.logged-in .aurora-bg {
  background:
    radial-gradient(circle at 50% -12%, rgba(255, 255, 255, 0.96), transparent 42rem),
    linear-gradient(180deg, #f7f8f9 0, var(--ui-canvas) 18rem);
}

html[data-theme="light"] body.logged-in .top-bar {
  background: rgba(255, 255, 255, 0.92);
  border-bottom-color: var(--ui-line);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.84), 0 12px 32px rgba(23, 25, 28, 0.055);
}

html[data-theme="light"] body.logged-in .top-bar-product-menu {
  color-scheme: light;
  background: rgba(255, 255, 255, 0.98);
  border-color: var(--ui-line);
  box-shadow: 0 28px 70px rgba(23, 25, 28, 0.16);
}

html[data-theme="light"] body.logged-in .top-bar-product-menu-trigger,
html[data-theme="light"] body.logged-in .top-bar-agent-btn,
html[data-theme="light"] body.logged-in .top-bar-product-item,
html[data-theme="light"] body.logged-in .top-bar-product-label {
  color: var(--ui-text);
}

html[data-theme="light"] body.logged-in .top-bar-product-menu-trigger:hover,
html[data-theme="light"] body.logged-in .top-bar-product-menu-trigger[aria-expanded="true"],
html[data-theme="light"] body.logged-in .top-bar-agent-btn:hover,
html[data-theme="light"] body.logged-in .top-bar-agent-btn.active,
html[data-theme="light"] body.logged-in .top-bar-product-item:hover,
html[data-theme="light"] body.logged-in .top-bar-product-item:focus-visible {
  background: var(--ui-surface-hover);
}

html[data-theme="light"] body.logged-in .top-bar-product-item-icon {
  color: var(--ui-text-secondary);
  background: var(--ui-surface-raised);
  border-color: var(--ui-line);
}

html[data-theme="light"] body.logged-in .top-bar-product-item-copy span,
html[data-theme="light"] body.logged-in .top-bar-product-nav > span {
  color: var(--ui-text-secondary);
}

html[data-theme="light"] body.logged-in .home-route-stage,
html[data-theme="light"] body.logged-in .home-model-registry {
  border-color: var(--home-line);
}

html[data-theme="light"] body.logged-in .home-route-intro::before {
  background: linear-gradient(180deg, transparent, var(--home-line-strong) 22%, var(--home-line-strong) 78%, transparent);
}

html[data-theme="light"] body.logged-in .home-route-actions button:hover,
html[data-theme="light"] body.logged-in .home-route-actions button[aria-pressed="true"] {
  background: var(--home-device);
  border-color: var(--home-line);
  box-shadow: 0 12px 30px rgba(23, 25, 28, 0.07);
}

html[data-theme="light"] body.logged-in .home-route-marker {
  color: #ffffff;
  background: var(--home-void);
  border-color: var(--home-void);
  box-shadow: 0 5px 12px rgba(11, 13, 16, 0.12);
}

html[data-theme="light"] body.logged-in .home-stage-preview {
  --home-device: #101214;
  --home-device-raised: #171a1e;
  --home-line: #292d31;
  --home-line-strong: #41474e;
  --home-silver: #aeb5bc;
  --home-frost: #f5f7f8;
  color-scheme: dark;
  background: var(--home-device);
  border-color: var(--home-line-strong);
  box-shadow: 0 32px 64px rgba(23, 25, 28, 0.18);
}

html[data-theme="light"] body.logged-in .home-stage-slide,
html[data-theme="light"] body.logged-in .home-stage-indexes {
  background: var(--home-device);
}

html[data-theme="light"] body.logged-in .home-stage-index[aria-current="true"] {
  background: var(--home-device-raised);
}

html[data-theme="light"] body.logged-in .home-model-lane,
html[data-theme="light"] body.logged-in .home-task-index,
html[data-theme="light"] body.logged-in .home-workflow-tile {
  background: var(--home-device);
  border-color: var(--home-line);
  box-shadow: 0 16px 34px rgba(23, 25, 28, 0.055);
}

html[data-theme="light"] body.logged-in .home-model-card,
html[data-theme="light"] body.logged-in .home-model-card-copy,
html[data-theme="light"] body.logged-in .home-model-lane-heading {
  background: var(--home-device);
}

html[data-theme="light"] body.logged-in .home-model-card:hover,
html[data-theme="light"] body.logged-in .home-model-card:hover .home-model-card-copy {
  background: var(--home-device-raised);
}

html[data-theme="light"] body.logged-in .home-model-card .home-model-card-media,
html[data-theme="light"] body.logged-in .home-workflow-media {
  background: var(--home-void);
}

html[data-theme="light"] body.logged-in .home-model-card-grid,
html[data-theme="light"] body.logged-in .home-model-lane-rows,
html[data-theme="light"] body.logged-in .home-task-index-list,
html[data-theme="light"] body.logged-in .home-goal-link,
html[data-theme="light"] body.logged-in .home-model-card.is-compact {
  border-color: var(--home-line);
}

html[data-theme="light"] body.logged-in .home-task-index-list .home-goal-link:hover {
  color: var(--home-frost);
  background: var(--home-device-raised);
}

html[data-theme="light"] body.logged-in .home-model-registry .home-model-pill {
  color: var(--home-frost);
  background: rgba(255, 255, 255, 0.94);
  border-color: var(--home-line);
  box-shadow: 0 7px 18px rgba(23, 25, 28, 0.045);
}

html[data-theme="light"] body.logged-in .home-model-registry .home-model-pill:hover,
html[data-theme="light"] body.logged-in .home-model-registry .home-model-pill:focus-visible {
  background: var(--home-device-raised);
  border-color: var(--home-line-strong);
}

html[data-theme="light"] body.logged-in .home-model-registry .home-model-pill-icon {
  color: var(--home-silver);
  background: var(--home-device-raised);
  border-color: var(--home-line);
}

html[data-theme="light"] body.logged-in .home-workflow-tile:first-child {
  --home-frost: #f5f7f8;
  --home-silver: #b5bbc1;
  background: var(--home-void);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 28px 58px rgba(23, 25, 28, 0.16);
}

html[data-theme="light"] body.logged-in .home-workflow-tile:not(:first-child):hover {
  background: var(--home-device-raised);
  border-color: var(--home-line-strong);
}

html[data-theme="light"] body.logged-in .home-all-tools,
html[data-theme="light"] body.logged-in .home-picker-panel {
  color: var(--ui-text);
  background: var(--ui-surface);
  border-color: var(--ui-line);
  box-shadow: var(--glass-shadow);
}

html[data-theme="light"] body.logged-in .home-picker-card,
html[data-theme="light"] body.logged-in .home-picker-task-card,
html[data-theme="light"] body.logged-in .home-all-tools-body {
  color: var(--ui-text);
  background: var(--ui-surface-raised);
  border-color: var(--ui-line);
}

html[data-theme="light"] body.logged-in :is(.home-stage-preview, .home-model-lane, .home-task-index, .home-model-pill, .home-workflow-tile):focus-within {
  outline: 2px solid rgba(23, 25, 28, 0.42);
  outline-offset: 3px;
}

/* 工作台令牌统一到同一套矿物白 / 石墨灰，不再各自发蓝。 */
html[data-theme="light"] body.logged-in #work-view.standard-generation-view {
  --generation-panel: var(--ui-surface);
  --generation-panel-strong: var(--ui-surface-raised);
  --generation-line: var(--ui-line);
  --generation-line-accent: var(--brand-line);
  --generation-copy-muted: var(--ui-text-secondary);
  background: var(--ui-canvas);
}

html[data-theme="light"] body.logged-in #work-view.chat-workbench-view,
html[data-theme="light"] body.logged-in #chat-overlay[data-chat-kind] {
  --chat-panel: var(--ui-surface);
  --chat-panel-raised: var(--ui-surface);
  --chat-panel-soft: var(--ui-surface-raised);
  --chat-line: var(--ui-line);
  --chat-line-strong: var(--ui-line-strong);
  --chat-accent: var(--brand-primary);
  --chat-accent-soft: var(--brand-soft);
  --chat-accent-line: var(--brand-line);
  --chat-signal: var(--ui-text-secondary);
  --chat-signal-soft: rgba(23, 26, 30, 0.08);
  background-color: var(--ui-canvas);
  background-image: none;
}

html[data-theme="light"] body.logged-in #work-view.xhs-workflow-view {
  --xhs-panel: var(--ui-surface);
  --xhs-panel-strong: var(--ui-surface-raised);
  --xhs-surface-raised: var(--ui-surface);
  --xhs-line: var(--ui-line);
  --xhs-line-strong: var(--ui-line-strong);
  --xhs-coral: var(--brand-primary);
  --xhs-coral-soft: var(--brand-soft);
  --xhs-coral-line: var(--brand-line);
  --xhs-amber: var(--ui-text-secondary);
  --xhs-amber-soft: var(--ui-surface-hover);
  --xhs-muted: var(--ui-text-secondary);
}

html[data-theme="light"] body.logged-in .admin-console {
  --admin-bg: var(--ui-canvas);
  --admin-sidebar: #e8ecef;
  --admin-panel: var(--ui-surface);
  --admin-panel-raised: var(--ui-surface);
  --admin-panel-soft: var(--ui-surface-raised);
  --admin-line: var(--ui-line);
  --admin-line-strong: var(--ui-line-strong);
  --admin-accent: var(--brand-primary);
  --admin-accent-soft: var(--brand-soft);
  --admin-text: var(--ui-text);
  --admin-text-secondary: var(--ui-text-secondary);
  --admin-text-muted: var(--text-muted);
}

/* Agent 创作工作区完整接入站点浅色主题 */
html[data-theme="light"] body.logged-in #agent-view {
  --agent-bg: var(--ui-canvas);
  --agent-surface-1: var(--ui-surface);
  --agent-surface-2: var(--ui-surface-raised);
  --agent-surface-3: var(--surface-3);
  --agent-border: var(--ui-line);
  --agent-border-strong: var(--ui-line-strong);
  --agent-orange: var(--brand-primary);
  --agent-orange-soft: var(--brand-soft);
  --agent-mauve: var(--ui-text-secondary);
  --agent-mauve-soft: var(--ui-surface-hover);
  --agent-mint: #237a67;
  --agent-mint-soft: #e6f3ef;
  --agent-danger: #b42318;
  --agent-text: var(--ui-text);
  --agent-text-secondary: var(--ui-text-secondary);
  --agent-text-muted: var(--text-muted);
  --agent-shell-glow-1: rgba(23, 26, 30, 0.035);
  --agent-shell-glow-2: rgba(104, 113, 122, 0.055);
  --agent-sidebar-bg: rgba(255, 255, 255, 0.94);
  --agent-toolbar-bg: rgba(255, 255, 255, 0.82);
  --agent-context-bg: rgba(248, 249, 250, 0.94);
  --agent-card-bg: rgba(255, 255, 255, 0.86);
  --agent-panel-bg: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(248, 249, 250, 0.96));
  --agent-composer-bg: linear-gradient(145deg, #ffffff, #f8f9fa);
  --agent-input-area-bg: linear-gradient(180deg, rgba(242, 244, 245, 0.5), rgba(242, 244, 245, 0.98) 30%);
  --agent-user-bg: linear-gradient(135deg, #f1f3f5, #f8f9fa);
  --agent-code-bg: #f5f6f7;
  --agent-code-text: #24282d;
  --agent-control-bg: rgba(23, 25, 28, 0.035);
  --agent-control-hover: rgba(23, 25, 28, 0.075);
  --agent-action-text: #ffffff;
  --agent-shadow: 0 18px 48px rgba(23, 25, 28, 0.1);
  color-scheme: light;
  color: var(--agent-text);
  background:
    radial-gradient(ellipse at 72% -12%, var(--agent-shell-glow-1), transparent 38%),
    radial-gradient(ellipse at 18% 104%, var(--agent-shell-glow-2), transparent 42%),
    var(--agent-bg);
}

html[data-theme="light"] body.logged-in #agent-view .agent-composer textarea {
  color-scheme: light;
  color: var(--agent-text);
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

html[data-theme="light"] body.logged-in #agent-view .agent-composer textarea::placeholder {
  color: var(--agent-text-muted);
}

html[data-theme="light"] body.logged-in #agent-view .agent-send-btn {
  color: #ffffff;
}

html[data-theme="light"] body.logged-in #agent-view .agent-send-btn:hover {
  background: var(--brand-hover);
}

html[data-theme="light"] body.logged-in :is(#script-v2-view, .sv2-home-spotlight, .sv2-review-console, .sv2-rule-confirm-layer) {
  --sv2-bg: var(--ui-canvas);
  --sv2-panel: var(--ui-surface);
  --sv2-panel-strong: var(--ui-surface-raised);
  --sv2-panel-raised: #e8ecef;
  --sv2-line: var(--ui-line);
  --sv2-line-accent: var(--brand-line);
  --sv2-accent-soft: var(--brand-soft);
  --sv2-accent-faint: var(--ui-surface-raised);
  --sv2-text: var(--ui-text);
  --sv2-text-secondary: var(--ui-text-secondary);
  --sv2-muted: var(--text-muted);
}

html[data-theme="light"] body.logged-in #script-v2-view,
html[data-theme="light"] body.logged-in #note-v2-view,
html[data-theme="light"] body.logged-in #param-table-hybrid-view {
  background: var(--ui-canvas);
}

html[data-theme="light"] body.logged-in #note-v2-view {
  --nv2-bg: var(--ui-canvas);
  --nv2-panel: var(--ui-surface);
  --nv2-panel-solid: var(--ui-surface-raised);
  --nv2-line: var(--ui-line);
  --nv2-accent: var(--brand-primary);
  --nv2-accent-hover: var(--brand-hover);
  --nv2-text: var(--ui-text);
  --nv2-muted: var(--ui-text-secondary);
}

html[data-theme="light"] body.logged-in #param-table-hybrid-view {
  --pth-bg: var(--ui-canvas);
  --pth-panel: var(--ui-surface);
  --pth-panel-soft: var(--ui-surface-raised);
  --pth-surface: #e8ecef;
  --pth-line: var(--ui-line);
  --pth-line-strong: var(--ui-line-strong);
  --pth-primary: var(--brand-primary);
  --pth-primary-soft: var(--brand-soft);
  --pth-text: var(--ui-text);
  --pth-muted: var(--ui-text-secondary);
}

/* 素材库在首页与生成工作台中使用浅色目录；画布内素材库仍继承深色画布。 */
html[data-theme="light"] body.logged-in :is(#material-library-view, #workbench-material-library, .workbench-material-dialog-panel) {
  --canvas-bg: var(--ui-canvas);
  --canvas-surface: var(--ui-surface);
  --canvas-surface-raised: var(--ui-surface-raised);
  --canvas-surface-soft: rgba(23, 25, 28, 0.035);
  --canvas-line: var(--ui-line);
  --canvas-line-strong: var(--ui-line-strong);
  --canvas-text: var(--ui-text);
  --canvas-muted: var(--ui-text-secondary);
  --canvas-faint: var(--text-muted);
  --canvas-accent: var(--brand-primary);
  --canvas-accent-soft: var(--brand-soft);
}

html[data-theme="light"] body.logged-in #material-library-view {
  background: transparent;
}

html[data-theme="light"] body.logged-in .workbench-material-dialog-panel {
  color: var(--ui-text);
  background: var(--ui-surface);
  border-color: var(--ui-line);
  box-shadow: 0 28px 80px rgba(23, 25, 28, 0.18);
}

html[data-theme="light"] body.logged-in :is(#material-library-view, #workbench-material-library) .canvas-material-context button {
  color: var(--brand-primary);
  background: var(--brand-soft);
  border-color: var(--brand-line);
}

html[data-theme="light"] body.logged-in :is(#material-library-view, #workbench-material-library) :is(.canvas-material-search, .canvas-material-tabs, .canvas-material-department-filter) {
  background: var(--ui-surface-raised);
  border-color: var(--ui-line);
}

html[data-theme="light"] body.logged-in :is(#material-library-view, #workbench-material-library) .canvas-material-tabs button:is(:hover, .is-active) {
  color: var(--ui-text);
  background: var(--ui-surface-hover);
}

/* ========== 自动混剪：浅色工具壳与深色视频监看面 ========== */
html[data-theme="light"] body.auto-edit-page {
  color-scheme: light;
  --brand-primary: #171a1e;
  --brand-hover: #050607;
  --brand-soft: #edf0f2;
  --brand-line: rgba(23, 26, 30, 0.28);
  --brand-accent: #171a1e;
  --brand-accent-deep: #050607;
  --brand-accent-rgb: 23, 26, 30;
  --brand-accent-deep-rgb: 5, 6, 7;
  --primary: var(--brand-primary);
  --primary-hover: var(--brand-hover);
  --ui-canvas: #f2f4f5;
  --ui-surface: #ffffff;
  --ui-surface-raised: #f8f9fa;
  --ui-surface-hover: #edf0f2;
  --ui-line: rgba(23, 25, 28, 0.12);
  --ui-line-strong: rgba(23, 25, 28, 0.22);
  --ui-text: #17191c;
  --ui-text-secondary: #68717a;
  --text-primary: var(--ui-text);
  --text-secondary: var(--ui-text-secondary);
  --ae-panel: var(--ui-surface);
  --ae-panel-raised: var(--ui-surface-raised);
  --ae-line: var(--ui-line);
  --ae-muted: var(--ui-text-secondary);
  --ae-overlay: rgba(23, 25, 28, 0.42);
  --glass-shadow: 0 18px 44px rgba(23, 25, 28, 0.08);
  background: var(--ui-canvas);
  color: var(--ui-text);
}

html[data-theme="light"] body.auto-edit-page .aurora-bg {
  background:
    radial-gradient(circle at 50% -12%, rgba(255, 255, 255, 0.96), transparent 42rem),
    linear-gradient(180deg, #f7f8f9 0, var(--ui-canvas) 18rem);
}

html[data-theme="light"] body.auto-edit-page .ae-header,
html[data-theme="light"] body.auto-edit-page .ae-stepper {
  background: rgba(255, 255, 255, 0.92);
  border-color: var(--ae-line);
  box-shadow: 0 10px 28px rgba(23, 25, 28, 0.055);
}

html[data-theme="light"] body.auto-edit-page .ae-rail,
html[data-theme="light"] body.auto-edit-page .ae-output-rail {
  background: #edf0f2;
  border-color: var(--ae-line);
}

html[data-theme="light"] body.auto-edit-page[data-ae-step="1"] .ae-rail,
html[data-theme="light"] body.auto-edit-page[data-ae-step="2"] .ae-output-rail,
html[data-theme="light"] body.auto-edit-page[data-ae-step="3"] .ae-output-rail {
  background: transparent;
}

html[data-theme="light"] body.auto-edit-page .ae-stage {
  background: var(--ui-canvas);
}

html[data-theme="light"] body.auto-edit-page .ae-script-panel,
html[data-theme="light"] body.auto-edit-page .ae-review-panel,
html[data-theme="light"] body.auto-edit-page .ae-timeline-panel,
html[data-theme="light"] body.auto-edit-page .ae-bgm-library,
html[data-theme="light"] body.auto-edit-page .ae-service-errors,
html[data-theme="light"] body.auto-edit-page .ae-render-blocker,
html[data-theme="light"] body.auto-edit-page .ae-manager-dialog,
html[data-theme="light"] body.auto-edit-page .ae-history-item,
html[data-theme="light"] body.auto-edit-page .ae-preview-dialog,
html[data-theme="light"] body.auto-edit-page .ae-toast,
html[data-theme="light"] body.auto-edit-page .ae-workspace-lead,
html[data-theme="light"] body.auto-edit-page .ae-section,
html[data-theme="light"] body.auto-edit-page .ae-output-panel {
  color: var(--ui-text);
  background: var(--ae-panel);
  border-color: var(--ae-line);
}

html[data-theme="light"] body.auto-edit-page .ae-workspace-lead {
  background: linear-gradient(135deg, #ffffff, #f5f7f8 54%, #eef1f3);
}

html[data-theme="light"] body.auto-edit-page .ae-settings-tabs,
html[data-theme="light"] body.auto-edit-page .ae-setting-callout {
  background: var(--ui-surface-raised);
  border-color: var(--ae-line);
}

html[data-theme="light"] body.auto-edit-page .ae-settings-tabs button[aria-selected="true"] {
  color: #ffffff;
  background: var(--brand-primary);
  box-shadow: none;
}

html[data-theme="light"] body.auto-edit-page .ae-management-disclosure,
html[data-theme="light"] body.auto-edit-page .ae-management-disclosure > summary::after {
  border-color: var(--ae-line);
}

html[data-theme="light"] body.auto-edit-page .ae-management-disclosure > summary {
  color: var(--ui-text);
}

html[data-theme="light"] body.auto-edit-page .ae-material-section .ae-material-drop {
  background: var(--ui-surface-raised);
  border-color: var(--ui-line-strong);
}

html[data-theme="light"] body.auto-edit-page label,
html[data-theme="light"] body.auto-edit-page .ae-file-field,
html[data-theme="light"] body.auto-edit-page .ae-clip-save,
html[data-theme="light"] body.auto-edit-page .ae-output-actions button,
html[data-theme="light"] body.auto-edit-page .ae-history-actions button,
html[data-theme="light"] body.auto-edit-page .ae-bgm-actions button {
  color: var(--ui-text);
}

html[data-theme="light"] body.auto-edit-page input,
html[data-theme="light"] body.auto-edit-page select,
html[data-theme="light"] body.auto-edit-page textarea {
  color-scheme: light;
  color: var(--ui-text);
  background: var(--ui-surface-raised);
  border-color: var(--ae-line);
}

html[data-theme="light"] body.auto-edit-page select option,
html[data-theme="light"] body.auto-edit-page select optgroup {
  color: var(--ui-text);
  background: var(--ui-surface);
}

html[data-theme="light"] body.auto-edit-page input:focus,
html[data-theme="light"] body.auto-edit-page select:focus,
html[data-theme="light"] body.auto-edit-page textarea:focus {
  background: var(--ui-surface);
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(23, 26, 30, 0.12);
}

html[data-theme="light"] body.auto-edit-page .ae-stepper button[aria-current="step"] {
  color: var(--ui-text);
  background: var(--brand-soft);
  border-color: var(--brand-line);
}

html[data-theme="light"] body.auto-edit-page .ae-stepper button[aria-current="step"] > span,
html[data-theme="light"] body.auto-edit-page .ae-primary,
html[data-theme="light"] body.auto-edit-page .ae-confirm button.is-primary {
  color: #ffffff;
  background: var(--brand-primary);
  box-shadow: 0 8px 22px rgba(23, 25, 28, 0.14);
}

html[data-theme="light"] body.auto-edit-page .btn-outline,
html[data-theme="light"] body.auto-edit-page .ae-icon-button,
html[data-theme="light"] body.auto-edit-page .ae-segment-tools button,
html[data-theme="light"] body.auto-edit-page .ae-confirm button.is-ghost,
html[data-theme="light"] body.auto-edit-page .ae-clip-actions button,
html[data-theme="light"] body.auto-edit-page .ae-clip-save,
html[data-theme="light"] body.auto-edit-page .ae-output-actions button,
html[data-theme="light"] body.auto-edit-page .ae-history-actions button {
  color: var(--ui-text);
  background: var(--ui-surface);
  border-color: var(--ae-line);
}

html[data-theme="light"] body.auto-edit-page .ae-segment,
html[data-theme="light"] body.auto-edit-page .ae-rule,
html[data-theme="light"] body.auto-edit-page .ae-library-material,
html[data-theme="light"] body.auto-edit-page .ae-edit-deck,
html[data-theme="light"] body.auto-edit-page .ae-dialog,
html[data-theme="light"] body.auto-edit-page .ae-material,
html[data-theme="light"] body.auto-edit-page .ae-task,
html[data-theme="light"] body.auto-edit-page .ae-clip,
html[data-theme="light"] body.auto-edit-page .ae-hint,
html[data-theme="light"] body.auto-edit-page .ae-history-facts span {
  background: var(--ui-surface-raised);
  border-color: var(--ae-line);
}

html[data-theme="light"] body.auto-edit-page .ae-dialog footer .is-primary {
  color: #ffffff;
  background: var(--brand-primary);
  border-color: var(--brand-primary);
}

html[data-theme="light"] body.auto-edit-page .ae-inline-menu > div,
html[data-theme="light"] body.auto-edit-page .ae-dialog-choice label {
  color: var(--ui-text);
  background: var(--ui-surface);
  border-color: var(--ae-line);
}

html[data-theme="light"] body.auto-edit-page .ae-preview-stage,
html[data-theme="light"] body.auto-edit-page .ae-output-video,
html[data-theme="light"] body.auto-edit-page .ae-material-preview video {
  color-scheme: dark;
  background: #050607;
}

/* Light-theme boundaries: readable admin actions and dark canvas controls. */
html[data-theme="light"] body.logged-in .admin-content .login-btn,
html[data-theme="light"] body.logged-in .admin-content .admin-primary-btn {
  color: #ffffff !important;
}

html[data-theme="light"] body.logged-in .admin-content .login-btn:hover,
html[data-theme="light"] body.logged-in .admin-content .admin-primary-btn:hover {
  color: #ffffff !important;
  background: var(--brand-hover) !important;
  border-color: var(--brand-hover) !important;
}

html[data-theme="light"] body.logged-in #canvas-view .canvas-zoom-slider input[type="range"] {
  color-scheme: dark;
  min-height: 0;
  padding: 0;
  border: 0;
  background: linear-gradient(
    90deg,
    var(--canvas-accent, #f2f2f2) 0 var(--zoom-progress),
    var(--canvas-line-strong, rgba(255, 255, 255, 0.14)) var(--zoom-progress) 100%
  );
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 3px;
  box-shadow: none;
}

html[data-theme="light"] body.logged-in #canvas-view .canvas-zoom-slider input[type="range"]:focus {
  border-color: transparent;
  box-shadow: none;
}

html[data-theme="light"] body.logged-in #canvas-view .node-params-group select,
html[data-theme="light"] body.logged-in #canvas-view .node-params-group input,
html[data-theme="light"] body.logged-in #canvas-view .node-params-group textarea,
html[data-theme="light"] body.logged-in #canvas-view .canvas-floating-panel select,
html[data-theme="light"] body.logged-in #canvas-view .canvas-floating-panel input,
html[data-theme="light"] body.logged-in #canvas-view .canvas-floating-panel textarea {
  color-scheme: dark !important;
  color: #eaeaea !important;
  background: #2a2a2e !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  box-shadow: none !important;
}

html[data-theme="light"] body.logged-in #canvas-view .node-params-group select option,
html[data-theme="light"] body.logged-in #canvas-view .node-params-group select optgroup,
html[data-theme="light"] body.logged-in #canvas-view .canvas-floating-panel select option,
html[data-theme="light"] body.logged-in #canvas-view .canvas-floating-panel select optgroup {
  color: #eaeaea !important;
  background: #2a2a2e !important;
}

html[data-theme="light"] body.logged-in #canvas-view .node-params-group select:focus,
html[data-theme="light"] body.logged-in #canvas-view .node-params-group input:focus,
html[data-theme="light"] body.logged-in #canvas-view .node-params-group textarea:focus,
html[data-theme="light"] body.logged-in #canvas-view .canvas-floating-panel select:focus,
html[data-theme="light"] body.logged-in #canvas-view .canvas-floating-panel input:focus,
html[data-theme="light"] body.logged-in #canvas-view .canvas-floating-panel textarea:focus {
  color: #eaeaea !important;
  background: #2a2a2e !important;
  border-color: var(--canvas-accent, #f2f2f2) !important;
  box-shadow: 0 0 0 2px rgba(242, 242, 242, 0.15) !important;
}

html[data-theme="light"] body.logged-in .canvas-search-dialog {
  color-scheme: dark !important;
}

html[data-theme="light"] body.logged-in .canvas-search-dialog .search-input-wrap input {
  color-scheme: dark !important;
  color: #eeeeee !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  box-shadow: none !important;
}

html[data-theme="light"] body.logged-in .canvas-search-dialog .search-input-wrap input::placeholder {
  color: #999999 !important;
}

html[data-theme="light"] body.logged-in .canvas-search-dialog .search-input-wrap input:focus {
  color: #eeeeee !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: var(--canvas-accent, #f2f2f2) !important;
  box-shadow: 0 0 0 2px rgba(242, 242, 242, 0.12) !important;
}

/* Product menus stay opaque in light mode so the home media never bleeds through. */
html[data-theme="light"] body.logged-in .top-bar-product-menu {
  color-scheme: light;
  background: #ffffff;
  border-color: var(--ui-line);
  box-shadow: 0 28px 70px rgba(23, 25, 28, 0.16);
}

html[data-theme="light"] body.logged-in .top-bar-product-menu .top-bar-product-label {
  color: var(--ui-text-secondary);
}

html[data-theme="light"] body.logged-in .top-bar-product-menu .top-bar-product-item {
  color: var(--ui-text);
}

html[data-theme="light"] body.logged-in .top-bar-product-menu .top-bar-product-item:hover,
html[data-theme="light"] body.logged-in .top-bar-product-menu .top-bar-product-item:focus-visible {
  background: var(--ui-surface-hover);
}

html[data-theme="light"] body.logged-in .top-bar-product-menu .top-bar-product-item-icon {
  color: var(--ui-text-secondary);
  background: var(--ui-surface-raised);
  border-color: var(--ui-line);
}

html[data-theme="light"] body.logged-in .top-bar-product-menu .top-bar-product-item-copy strong {
  color: var(--ui-text);
}

html[data-theme="light"] body.logged-in .top-bar-product-menu .top-bar-product-item-copy span {
  color: var(--ui-text-secondary);
}
