/* 青云科创AI 自定义样式覆盖
 * 通过 web/index.html <link> 全局加载，修编译产物里写死的 CSS。
 */

/* —— 2026-05-08 无限画布节点高度自适应 ——
 * 用户原话："视频生成图片生成这种节点，选择模型之后出现下拉选择，然后内容变长
 *           节点的背景没有对应的包裹起来，很怪"
 *
 * 真因（Playwright 实测）：chunk wuxianhuabu-CAFfiHQs.js 给节点 inline 写
 *   `style="height: 120px"`（固定 120px），选模型后 chunk 渲染出参数 fields,
 *   内部 .node-shell scrollHeight 暴涨到 186px，但 .vue-flow__node 容器
 *   高度被 inline height: 120px 卡死 → shell 溢出节点边界 = 用户看到的
 *   "背景没包裹起来"。
 *
 * 修：CSS !important 覆盖 inline height，让节点跟 shell 同步自适应。
 * vue-flow 内部 dimensions store 仍按 ResizeObserver 跟踪 → edge 连线
 * 会跟随真实高度（已实测无错位）。
 */
.vue-flow__node-wenben,
.vue-flow__node-tupian,
.vue-flow__node-aiduihua,
.vue-flow__node-shengtu,
.vue-flow__node-shengshipin,
.vue-flow__node-yulan {
  height: auto !important;
  min-height: unset !important;
}
.vue-flow__node-wenben .node-shell,
.vue-flow__node-tupian .node-shell,
.vue-flow__node-aiduihua .node-shell,
.vue-flow__node-shengtu .node-shell,
.vue-flow__node-shengshipin .node-shell,
.vue-flow__node-yulan .node-shell {
  height: auto !important;
}

/* —— 装饰星星 / 图标 z-index 修复（在所有 overlay 之上飘）—— */
.decoration-star,
.icon-decoration {
  z-index: 99999 !important;
  pointer-events: none !important;
}

/* —— 充值弹窗：宽度不动，档次多了让弹窗加高 + 内容自动滚动/换行 —— */
.zhifu-overlay .zhifu-container,
.zhifu-overlay .recharge-modal,
.zhifu-overlay .modal-content,
.zhifu-overlay [class*="zhifu-"][class*="container"],
.zhifu-overlay [class*="recharge-"][class*="container"] {
  max-height: 92vh !important;
  overflow-y: auto !important;
}

/* —— C1: chat 工具栏 toggle 激活态视觉加强 ——
 * 原 bundle 里 .switch-btn-active 仅 10% 不透明背景 + 30% 边框,
 * 视觉与 inactive 难以区分。这里把激活态改成实色背景 + 加边框 + 阴影。
 */
/* 暗色主题（默认） */
.switch-btn.switch-btn-active {
  background-color: rgba(var(--color-primary-rgb, 99, 102, 241), 0.35) !important;
  border: 1px solid rgba(var(--color-primary-rgb, 99, 102, 241), 0.7) !important;
  box-shadow: 0 0 0 1px rgba(var(--color-primary-rgb, 99, 102, 241), 0.45),
              0 0 10px rgba(var(--color-primary-rgb, 99, 102, 241), 0.35) !important;
  font-weight: 600 !important;
}
.switch-btn.switch-btn-active:hover {
  background-color: rgba(var(--color-primary-rgb, 99, 102, 241), 0.45) !important;
  border-color: rgba(var(--color-primary-rgb, 99, 102, 241), 0.85) !important;
}
.switch-btn.switch-btn-active .switch-text,
.switch-btn.switch-btn-active .switch-icon {
  color: var(--color-primary, #00cae0) !important;
  filter: brightness(1.2);
}

/* 亮色主题（teal 主色 #0e7490） */
html[data-theme="light"] .switch-btn.switch-btn-active {
  background: #0e74903d !important;          /* 24% 不透明度，比原 10% 更显眼 */
  border: 1px solid #0e7490 !important;      /* 实色边框 */
  box-shadow: 0 0 0 1px #0e7490a6,
              0 0 8px #0e749059 !important;
  color: #0e7490 !important;
  font-weight: 600 !important;
}
html[data-theme="light"] .switch-btn.switch-btn-active:hover {
  background: #0e749057 !important;
  border-color: #0a5d75 !important;
}
html[data-theme="light"] .switch-btn.switch-btn-active .switch-text,
html[data-theme="light"] .switch-btn.switch-btn-active .switch-icon {
  color: #0a5d75 !important;
}

/* ============================================================
 * W2: 浅色主题下 chat 区 / sidebar / 历史消息 残留深色覆盖
 *
 * 经 2026-05-06 bundle 审计（D:/yuanzhi/_audit_css.js 工具，扫所有
 * web/public/assets/*.css），原 98 行规则中绝大多数 selector 在 bundle
 * 里要么压根不存在（.duihua-region / aside.sidebar / .message-bubble /
 * .input-area / .chat-toolbar / .empty-state-card / .top-toolbar 等），
 * 要么 bundle 已经用 var(--bg-X) 跟 css 变量切换、不需要 hardcode 覆盖。
 *
 * 真实仍残留 hardcoded dark hex 的 selector 只剩两个：
 *   1. .history-dropdown — Chat-DpM-d6aB.css 里 background:#181a20fa
 *   2. .zhiding-ctx-menu — Home-hIpz_Ojn.css 里 background:#1e2028f5
 *
 * 收窄到只保留这两个 + markdown-body code-block fallback（pre 通常 v-html
 * 里没 scoped class，是公共默认 dark codeblock）。
 *
 * 影响范围只 light 主题；dark 主题不受影响。
 * ============================================================ */

/* 历史会话下拉（Chat 顶部"历史"按钮触发） — 实测 .history-dropdown { background:#181a20fa } */
html[data-theme="light"] .history-dropdown {
  background-color: #ffffff !important;
  color: #1f2937 !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
}

/* 智能体置顶右键菜单（Home 模型列表右键弹出） — 实测 .zhiding-ctx-menu { background:#1e2028f5 } */
html[data-theme="light"] .zhiding-ctx-menu {
  background-color: #ffffff !important;
  color: #1f2937 !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12) !important;
}

/* markdown 公共 pre/code（v-html 渲染的回答内容，非 scoped — bundle 没 light 兜底）
 * 实测 index 主 css 里 .mc-code-block-dark .hljs { background:#2b2b2b }，但那是
 * 用户主动选 dark 代码主题，不动；这里只兜底无 class 的纯 pre/code。
 */
html[data-theme="light"] pre:not([class]),
html[data-theme="light"] code:not([class]) {
  background-color: #f3f4f6 !important;
  color: #1f2937 !important;
  border: 1px solid rgba(0, 0, 0, 0.06) !important;
}
