/* @V55-AGENT-LIGHT 智能体工作台·浅色主题完整适配（最后加载，仅浅色生效） */

/* ===== 1. 全屏星空宇宙：深色 -> 浅色柔和星空 ===== */
html[data-theme="light"] .ws-v2 .ws-main.ag-fx-on,
html[data-theme="light"] .ws-v2 .ws-main.re-cosmos-dock{
  background:#edf0f7 !important;
}
html[data-theme="light"] .ws-main.ag-fx-on > #agGlobalFx.ag-bgfx-global{
  background:
    radial-gradient(1300px 880px at 85% -10%, rgba(var(--aw-rgb),.14), transparent 60%),
    radial-gradient(1200px 980px at 5% 88%, rgba(var(--aw-rgb),.10), transparent 62%),
    radial-gradient(1000px 820px at 100% 96%, rgba(99,102,241,.08), transparent 62%),
    linear-gradient(180deg,#f5f7fc 0%,#edf0f7 48%,#e8ecf5 100%) !important;
}
html[data-theme="light"] #agGlobalFx .ag-orbit{ border-color:rgba(var(--aw-rgb),.20) !important; opacity:.65; }
html[data-theme="light"] #agGlobalFx .ag-stars i{ opacity:.5 !important; }
html[data-theme="light"] #agGlobalFx .ag-grid{ opacity:.55; }
html[data-theme="light"] .ws-main:has(#agentWorkspace.s2-full) > #agGlobalFx.ag-bgfx-global::before,
html[data-theme="light"] .ws-main:has(#agentWorkspace.s2-full) > #agGlobalFx.ag-bgfx-global::after{ opacity:.35; }

/* RefEngine 体系星空同样转浅（同结构高特异性，覆盖 4 类 !important 深色层） */
html[data-theme="light"] .ws-v2 .ws-main > .re-bg.re-bg-full{
  background:
    radial-gradient(120% 92% at 50% -12%, rgba(var(--aw-rgb),.16), transparent 56%),
    radial-gradient(88% 72% at 100% -2%, rgba(var(--aw-rgb),.12), transparent 60%),
    radial-gradient(92% 84% at -2% 102%, rgba(120,85,245,.10), transparent 62%),
    radial-gradient(118% 90% at 102% 102%, rgba(var(--aw-rgb),.10), transparent 63%),
    linear-gradient(180deg,#f5f7fc 0%,#edf0f7 48%,#e9edf6 100%) !important;
}
html[data-theme="light"] .ws-v2 .ws-main.re-cosmos-dock .re-orb-1,
html[data-theme="light"] .ws-v2 .ws-main.re-cosmos-dock .re-orb-2,
html[data-theme="light"] .ws-v2 .ws-main.re-cosmos-dock .re-orb-3{ opacity:.32 !important; }
html[data-theme="light"] .ws-v2 .ws-main.re-cosmos-dock .re-bg-grid{ opacity:.45 !important; }
html[data-theme="light"] .ws-v2 .ws-main.re-cosmos-dock .re-stars i{ opacity:.55 !important; box-shadow:none !important; }
html[data-theme="light"] .ws-v2 .ws-main.re-cosmos-dock .re-bg-flow,
html[data-theme="light"] .ws-v2 .ws-main.re-cosmos-dock .re-bg-lines{ opacity:.3 !important; }
html[data-theme="light"] .re-orb,
html[data-theme="light"] .re-bl{ opacity:.28 !important; }
html[data-theme="light"] .re-stars i{ opacity:.5 !important; }
html[data-theme="light"] .re-bg-grid{ opacity:.5 !important; }

/* RefEngine / 多帧 hero 标题、副标题、模式卡 转深色可读 */
html[data-theme="light"] .re-hero-title,
html[data-theme="light"] .re-title,
html[data-theme="light"] .ag-hero-title{ color:#0f172a !important; text-shadow:none !important; }
html[data-theme="light"] .re-hero-sub,
html[data-theme="light"] .re-subtitle,
html[data-theme="light"] .re-desc{ color:#5b6577 !important; }
html[data-theme="light"] .re-mode-btn,
html[data-theme="light"] .re-engine-tab,
html[data-theme="light"] .re-tab{
  background:rgba(255,255,255,.9) !important;
  border:1px solid #dde3ee !important;
  color:#334155 !important;
}
html[data-theme="light"] .re-mode-btn.active,
html[data-theme="light"] .re-engine-tab.active,
html[data-theme="light"] .re-tab.active{
  background:linear-gradient(90deg,rgba(var(--aw-rgb),.16),rgba(var(--aw-rgb),.08)) !important;
  border-color:rgba(var(--aw-rgb),.5) !important;
  color:#0e7490 !important;
}
/* RefEngine 模式小卡（.re-fmini）转浅 */
html[data-theme="light"] .re-fmini{
  background:rgba(255,255,255,.94) !important;
  border:1px solid #dde3ee !important;
  color:#334155 !important;
  box-shadow:0 4px 14px rgba(15,23,42,.06) !important;
}
html[data-theme="light"] .re-fmini .re-fmini-tx{ color:#334155 !important; }
html[data-theme="light"] .re-fmini .re-fmini-ic{ color:var(--mc) !important; }
html[data-theme="light"] .re-fmini.active{
  background:color-mix(in srgb,var(--mc) 14%,#ffffff) !important;
  border:1px solid color-mix(in srgb,var(--mc) 55%,transparent) !important;
  box-shadow:0 0 18px color-mix(in srgb,var(--mc) 22%,transparent) !important;
}
html[data-theme="light"] .re-fmini.active .re-fmini-tx{ color:#0e7490 !important; }
/* RefEngine 通用玻璃卡/面板转浅 */
html[data-theme="light"] .re-fcard,
html[data-theme="light"] .re-card,
html[data-theme="light"] .re-panel,
html[data-theme="light"] .re-workbench{
  background:rgba(255,255,255,.92) !important;
  border-color:#e3e8f1 !important;
  color:#334155 !important;
}
/* 覆盖 RefEngine 整套深色 CSS 变量，级联修复 .re-feat/.re-mod/.re-sub 等 */
html[data-theme="light"] .re-ws{
  --re-ink:#0f172a !important;
  --re-mut:#64748b !important;
  --re-card:rgba(255,255,255,.94) !important;
  --re-line:#e3e8f1 !important;
}
html[data-theme="light"] .re-feat h4{ color:#1c2233 !important; }
html[data-theme="light"] .re-feat p{ color:#64748b !important; }
html[data-theme="light"] .re-feat-ic{ background:rgba(251,191,36,.14) !important; }
html[data-theme="light"] .re-flow,
html[data-theme="light"] .re-mod{ background:rgba(255,255,255,.9) !important; border-color:#e3e8f1 !important; color:#334155 !important; }
html[data-theme="light"] .re-mod-tx small{ color:#64748b !important; }
html[data-theme="light"] .re-rail-hist{ background:rgba(15,23,42,.04) !important; border-color:#e3e8f1 !important; color:#64748b !important; }
/* 多模型协作 悬浮 回答/总结 胶囊 + toast */
html[data-theme="light"] .re-multi-bar button{
  background:#ffffff !important;
  border:1px solid #dde3ee !important;
  color:#334155 !important;
  box-shadow:0 8px 22px rgba(15,23,42,.12) !important;
}
html[data-theme="light"] .re-multi-bar .re-mb-ans{ color:#0e7490 !important; border-color:rgba(34,211,238,.6) !important; }
html[data-theme="light"] .re-multi-bar .re-mb-sum{ color:#b45309 !important; border-color:rgba(251,191,36,.6) !important; }
html[data-theme="light"] .re-toast{ background:rgba(255,255,255,.98) !important; border:1px solid #e3e8f1 !important; color:#1c2233 !important; box-shadow:0 16px 40px rgba(15,23,42,.16) !important; }

/* 多帧 ribbon 浅底深字 */
html[data-theme="light"] .mf-ribbon{ background:linear-gradient(90deg,rgba(var(--aw-rgb),.10),rgba(0,229,160,.06)) !important; border:1px solid rgba(var(--aw-rgb),.30) !important; }
html[data-theme="light"] .mf-ribbon-t{ color:#0e7490 !important; }
html[data-theme="light"] .mf-ribbon-r span{ color:#64748b !important; }
html[data-theme="light"] .mf-risk-tip{ color:#b45309 !important; }
html[data-theme="light"] #wsComposer.mf-composer #agPlaybookBtn{ background:rgba(var(--aw-rgb),.12) !important; border:1px solid rgba(var(--aw-rgb),.5) !important; color:#0e7490 !important; }

/* 顶栏在浅底上保持透明、文字清晰 */
html[data-theme="light"] .ws-v2 .ws-main.ag-fx-on > .ws-topbar,
html[data-theme="light"] .ws-v2 .ws-main.re-cosmos-dock > .ws-topbar{ background:transparent !important; }

/* ===== 2. Hero / 制作组文字（底转浅后确保可读） ===== */
html[data-theme="light"] .ag-hero-title{ color:#0f172a !important; text-shadow:none !important; }
html[data-theme="light"] .ag-sub{ color:#5b6577 !important; }
html[data-theme="light"] .ag-team-head{ color:#1c2233 !important; }
html[data-theme="light"] .ag-experts .m-name{ color:#2b3445 !important; }
html[data-theme="light"] .ag-experts .m-duty{ color:#7a8499 !important; }

/* ===== 3. 任务设置卡：白底 + 浅边 + 柔和阴影 ===== */
html[data-theme="light"] .ag-form-card{
  background:#ffffff !important;
  border:1px solid #e6eaf2 !important;
  box-shadow:0 20px 48px rgba(15,23,42,.10) !important;
}
html[data-theme="light"] .ag-form-card small{ color:#8b93a5 !important; }
html[data-theme="light"] .ag-field-label,
html[data-theme="light"] .fl-label-txt{ color:#64748b !important; }
html[data-theme="light"] .ag-form-card .ag-card-title,
html[data-theme="light"] .ag-form-card .ag-form-title{ color:#1c2233 !important; }
html[data-theme="light"] .ag-form-card .ag-card-hint,
html[data-theme="light"] .ag-form-card .ag-form-hint{ color:#94a0b4 !important; }

/* ===== 4. 作曲器：工具钮 / 添加槽 / 首末帧槽 转浅 ===== */
html[data-theme="light"] .ws-composer.cp-v2,
html[data-theme="light"] .ws-composer{ background:#ffffff !important; border:1px solid #e4e8f1 !important; box-shadow:0 12px 34px rgba(15,23,42,.08) !important; }
html[data-theme="light"] .cp-tool,
html[data-theme="light"] .cp-tool-help{
  background:#f1f4f9 !important;
  border:1px solid #dde3ee !important;
  color:#475569 !important;
}
html[data-theme="light"] .cp-tool:hover,
html[data-theme="light"] .cp-tool-help:hover{ background:#e6ecf6 !important; border-color:#cbd5e3 !important; }
html[data-theme="light"] .cp-tool svg,
html[data-theme="light"] .cp-tool-help svg{ color:#475569 !important; }
/* 高特异性覆盖各套深色空槽（含 #cpRefs / :not(.has-items) 的 !important 规则） */
html[data-theme="light"] .cp-v2 .cp-refs .cp-frame-add,
html[data-theme="light"] .cp-v2 .cp-frames .cp-frame-add,
html[data-theme="light"] .cp-v2 #cpRefs .cp-frame-add,
html[data-theme="light"] .cp-v2 .cp-refs:not(.has-items) .cp-frame-add,
html[data-theme="light"] .cp-v2 .cp-ref-add,
html[data-theme="light"] .cp-v2 .sp-add,
html[data-theme="light"] .cp-v2 .cp-fstack-add,
html[data-theme="light"] .cp-v2 .cp-refs .cp-ref-add,
html[data-theme="light"] .cp-v2 .cp-fstack .cp-fstack-add{
  background:#f6f8fc !important;
  border:1.5px dashed #c3cdda !important;
  color:#64748b !important;
  box-shadow:none !important;
}
html[data-theme="light"] .cp-v2 .cp-frame-add *,
html[data-theme="light"] .cp-v2 .cp-ref-add *,
html[data-theme="light"] .cp-v2 .sp-add *,
html[data-theme="light"] .cp-v2 .cp-fstack-add *{ color:#64748b !important; }
html[data-theme="light"] .cp-v2 .cp-refs .cp-frame-add:hover,
html[data-theme="light"] .cp-v2 .cp-frames .cp-frame-add:hover,
html[data-theme="light"] .cp-v2 #cpRefs .cp-frame-add:hover,
html[data-theme="light"] .cp-v2 .cp-ref-add:hover,
html[data-theme="light"] .cp-v2 .sp-add:hover,
html[data-theme="light"] .cp-v2 .cp-fstack-add:hover{ background:#eef2f9 !important; border-color:#9fb0c8 !important; }
html[data-theme="light"] .cp-frame-arrow,
html[data-theme="light"] .cp-mid-arrow{ color:#94a3b8 !important; }
html[data-theme="light"] #wsComposer textarea,
html[data-theme="light"] .ws-composer textarea{ color:#1c2233 !important; }
html[data-theme="light"] #wsComposer textarea::placeholder,
html[data-theme="light"] .ws-composer textarea::placeholder{ color:#9aa6ba !important; }

/* 已插入附件卡在浅色下 */
html[data-theme="light"] .cp-card,
html[data-theme="light"] .sp-card{ background:#f3f5fa !important; border-color:#dde3ee !important; color:#334155 !important; }

/* ===== 5. 左侧项目面板（RefEngine / S2 引擎）转浅 ===== */
html[data-theme="light"] .re-left-panel,
html[data-theme="light"] .s2-project-panel,
html[data-theme="light"] .left-panel,
html[data-theme="light"] .manju-s2-container .left-panel{
  background:#ffffff !important;
  border-color:#e6eaf2 !important;
  color:#334155 !important;
}
html[data-theme="light"] .re-left-panel *,
html[data-theme="light"] .s2-project-panel *,
html[data-theme="light"] .manju-s2-container .left-panel *{ color:inherit; }

/* ===== 5b. S2 引擎：特性卡 / 阶段时间线 / 项目面板 转浅 ===== */
html[data-theme="light"] #s2EngineBlock .ability-card{
  background:rgba(255,255,255,.94) !important;
  border:1px solid #e3e8f1 !important;
  color:#334155 !important;
  box-shadow:0 6px 18px rgba(15,23,42,.06) !important;
}
html[data-theme="light"] #s2EngineBlock .ability-card:hover{ background:#ffffff !important; }
html[data-theme="light"] #s2EngineBlock .ability-card.active-card{ background:#ffffff !important; }
html[data-theme="light"] #s2EngineBlock .ability-title{ color:#1c2233 !important; }
html[data-theme="light"] #s2EngineBlock .ability-desc,
html[data-theme="light"] #s2EngineBlock .ability-text [class*="desc"]{ color:#64748b !important; }
html[data-theme="light"] #s2EngineBlock .phase-name{ color:#64748b !important; }
html[data-theme="light"] #s2EngineBlock .p-label{ color:#94a3b8 !important; }
html[data-theme="light"] #s2EngineBlock .p-node.lit .p-label{ color:#475569 !important; }
html[data-theme="light"] #s2EngineBlock .p-node.running .p-label{ color:#b45309 !important; }
html[data-theme="light"] #s2EngineBlock .pipeline-section .p-dot{ background:#cbd5e1 !important; }

/* S2 新建项目面板（整块硬编码深色） */
html[data-theme="light"] .s2proj-panel,
html[data-theme="light"] .s2proj-panel-content{ background:#ffffff !important; border-color:#e6eaf2 !important; }
html[data-theme="light"] .s2proj-header{ border-bottom:1px solid #eef1f6 !important; }
html[data-theme="light"] .s2proj-new{ background:#f1f4f9 !important; border:1px solid #dde3ee !important; color:#334155 !important; }
html[data-theme="light"] .s2proj-new:hover{ background:#e7edf6 !important; }
html[data-theme="light"] .s2proj-card{ background:#f6f8fc !important; border:1px solid #e6eaf2 !important; }
html[data-theme="light"] .s2proj-card:hover{ background:#eef2f9 !important; }
html[data-theme="light"] .s2proj-card.active{ background:#eaf6f9 !important; border-color:rgba(0,202,224,.4) !important; }
html[data-theme="light"] .s2proj-name{ color:#1c2233 !important; }
html[data-theme="light"] .s2proj-meta{ color:#7c8ea6 !important; }
html[data-theme="light"] .s2proj-close,
html[data-theme="light"] .s2proj-action{ background:#eef1f6 !important; color:#475569 !important; }
html[data-theme="light"] .s2proj-close:hover,
html[data-theme="light"] .s2proj-action:hover{ background:#e2e8f2 !important; color:#1c2233 !important; }
html[data-theme="light"] .s2proj-cover{ background:#eef1f6 !important; }
html[data-theme="light"] .s2proj-panel.collapsed .s2proj-collapse-handle{ background:#ffffff !important; }
html[data-theme="light"] .s2proj-panel.collapsed:hover .s2proj-collapse-handle{ background:#f1f4f9 !important; }
html[data-theme="light"] .s2proj-handle-text{ color:#64748b !important; }
html[data-theme="light"] .s2proj-handle-chevron{ color:#64748b !important; }
html[data-theme="light"] .s2proj-collapse-handle *{ color:#64748b !important; }
/* 项目面板底部 智能引擎胶囊 + 齿轮 */
html[data-theme="light"] .engine-btn{ background:#f1f4f9 !important; border:1px solid #cfe0ea !important; color:#0e7490 !important; box-shadow:none !important; }
html[data-theme="light"] .engine-btn:hover{ background:#e6f4f8 !important; border-color:rgba(0,202,224,.7) !important; color:#0e7490 !important; box-shadow:none !important; }
html[data-theme="light"] .engine-btn-ic,
html[data-theme="light"] .engine-btn-chev{ color:#0e9ec0 !important; }
html[data-theme="light"] .engine-btn-glow{ display:none !important; }
html[data-theme="light"] .config-btn{ background:#f1f4f9 !important; border:1px solid #d8e0ea !important; color:#475569 !important; }
html[data-theme="light"] .config-btn:hover{ background:#e6f4f8 !important; border-color:rgba(0,202,224,.6) !important; color:#0e7490 !important; }

/* ===== 6. 引擎阶段卡 / 通用玻璃卡在浅色下 ===== */
html[data-theme="light"] .re-stage-card,
html[data-theme="light"] .s2-stage-card,
html[data-theme="light"] .engine-card,
html[data-theme="light"] .showcase-card{
  background:rgba(255,255,255,.92) !important;
  border-color:#e3e8f1 !important;
  color:#334155 !important;
}
