/* ============ 橡小图AI - 大师兄AI 深色科技风（#0e1322 深蓝黑 · 蓝色渐变 · 毛玻璃顶栏 · 深色卡片 · 16px 圆角） ============ */
:root {
  color-scheme: dark;
  --bg: #0e1322;
  --panel: #161c2e;
  --card: #1a2133;
  --accent-end: #1d4ed8;
  --soft-line: rgba(255,255,255,0.07);
  --line: rgba(255,255,255,0.10);
  --line-strong: rgba(255,255,255,0.16);
  --text: #e9edf5;
  --text-secondary: #b7c2d6;
  --text-muted: #7d8aa6;
  --accent: #2563eb;
  --accent-strong: #6fa8ff;
  --accent-soft: rgba(37,99,235,0.16);
  --ok: #16a34a;
  --danger: #dc2626;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 10px;
  --shadow: 0 8px 24px rgba(0,0,0,0.45);
  --content-width: 1500px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Inter', -apple-system, 'Segoe UI', 'Microsoft YaHei', sans-serif;
  background: radial-gradient(1200px 620px at 50% -12%, rgba(37,99,235,0.24), transparent 60%), radial-gradient(900px 500px at 100% 100%, rgba(29,78,216,0.16), transparent 60%), #0e1322;
  background-attachment: fixed;
  color: var(--text);
  font-size: 14px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
button { font-family: inherit; cursor: pointer; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.16); border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

/* 顶栏：深色毛玻璃横条（大师兄AI深色科技风） */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: 60px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 24px;
  background: rgba(13,18,32,0.92);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
body { padding-top: 60px; }
.topbar-left { display: flex; align-items: center; gap: 18px; min-width: 0; }
.logo { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo-mark {
  width: 40px; height: 40px; border-radius: 10px; overflow: hidden; flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 4px 14px rgba(37,99,235,0.22);
}
.logo-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.logo-texts { display: flex; flex-direction: column; min-width: 0; }
.logo-text { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; color: var(--text); white-space: nowrap; }
.logo-sub { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.main-nav { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.nav-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 36px; padding: 0 13px; border-radius: 8px;
  background: transparent; border: 1px solid transparent;
  color: var(--text-secondary); font-size: 13.5px; font-weight: 500; white-space: nowrap;
  transition: all .18s ease;
}
.nav-btn:hover { background: rgba(255,255,255,0.06); color: var(--text); }
.nav-btn.active { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
.topbar-right { display: flex; align-items: center; flex-shrink: 0; }
.balance-box {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.06); border: 1px solid var(--soft-line);
  padding: 6px 8px 6px 14px; border-radius: 10px;
}
.balance-label { color: var(--text-muted); font-size: 12px; }
.balance-value { font-weight: 700; font-size: 14px; color: var(--accent-strong); }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; border-radius: 10px; padding: 9px 16px;
  font-size: 14px; font-weight: 600; transition: all .18s ease; white-space: nowrap;
}
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-block { width: 100%; padding: 11px; font-size: 15px; }
.btn-primary { background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%); color: #fff; box-shadow: 0 6px 18px rgba(59,130,246,0.25); }
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-ghost { background: var(--card); color: var(--text-secondary); border: 1px solid var(--line); }
.btn-ghost:hover { background: rgba(255,255,255,0.06); color: var(--text); }

/* 主区域 */
.main { max-width: var(--content-width); margin: 0 auto; padding: 20px 24px 48px; width: 100%; flex: 1; }
.page { display: none; }
.page.active { display: block; animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* 白色卡片 */
.panel {
  background: var(--panel);
  border: 1px solid var(--soft-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 20px;
}
.panel-title { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.panel-desc { color: var(--text-muted); font-size: 13px; margin-bottom: 16px; }
/* 表单 */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; font-weight: 600; }
.hint { color: var(--text-muted); font-weight: 400; font-size: 12px; }
.input, textarea.input, select.input {
  width: 100%; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  color: var(--text); padding: 9px 12px; font-size: 14px;
  font-family: inherit; outline: none; transition: border .18s, box-shadow .18s;
}
.input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,130,246,0.12); }
textarea { resize: vertical; line-height: 1.6; }
.color-input { height: 40px; padding: 4px; cursor: pointer; }
.row { display: flex; gap: 12px; }
.half { flex: 1; }
.field-tip { font-size: 12px; color: var(--text-muted); margin-top: 4px; line-height: 1.6; }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: var(--card); border: 1px solid var(--line);
  color: var(--text-secondary); border-radius: 8px; padding: 6px 13px;
  font-size: 13px; transition: all .16s;
}
.chip:hover { border-color: var(--accent); color: var(--text); }
.chip.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); font-weight: 600; }
.check-row { display: flex; gap: 18px; }
.check { display: flex; align-items: center; gap: 6px; color: var(--text-secondary); font-size: 13px; cursor: pointer; }
.check input { accent-color: var(--accent); width: 15px; height: 15px; }

/* 价格/状态 */
.price-note { font-size: 13px; color: var(--text-muted); margin: 10px 0 12px; }
.price-note b { color: var(--accent-strong); }
.status-text { font-size: 13px; color: var(--text-secondary); margin-top: 10px; min-height: 20px; line-height: 1.6; }
.status-text.error { color: var(--danger); }
.status-text.ok { color: var(--ok); }

/* 布局 */
.design-layout, .gen-layout { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(460px, 1.1fr); gap: 20px; align-items: start; }
@media (max-width: 1100px) { .design-layout, .gen-layout { grid-template-columns: 1fr; } }

/* 画布（无限画布） */
.canvas-panel { display: flex; flex-direction: column; }
.canvas-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; color: var(--text-secondary); font-size: 13px; flex-wrap: wrap; }
.toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.canvas-wrap {
  background: #0b0f1a;
  border-radius: var(--radius-md);
  padding: 14px; display: flex; flex-direction: column; align-items: center; gap: 10px;
  overflow: auto; max-height: 78vh; position: relative;
  border: 1px solid var(--soft-line);
  cursor: grab;
}
.canvas-wrap:active { cursor: grabbing; }
#designCanvas {
  background: #ffffff; border-radius: 4px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  cursor: default;
  touch-action: none; user-select: none;
}
#designCanvas .sel-rect { stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 5 3; fill: rgba(59,130,246,0.06); pointer-events: none; }
.canvas-tip { color: var(--text-muted); font-size: 12px; text-align: center; }
.canvas-viewport { transform-origin: 0 0; will-change: transform; }

/* 结果卡片 */
.result-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; flex: 1; overflow: auto; padding: 4px; width: 100%; min-height: 0; }
.result-empty { grid-column: 1 / -1; text-align: center; color: var(--text-muted); padding: 80px 20px; line-height: 2; border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); }
.result-card { background: var(--card); border: 1px solid var(--soft-line); border-radius: var(--radius-md); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.result-card img { width: 100%; max-width: 100%; display: block; object-fit: contain; background: #10141f; cursor: pointer; transition: opacity .2s; flex-shrink: 0; }
.result-card img:hover { opacity: 0.85; }
.result-card-actions { display: flex; gap: 8px; padding: 10px; }
.result-card-actions .btn { flex: 1; font-size: 12px; }

/* 历史 */
.history-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.history-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.history-item { background: var(--card); border: 1px solid var(--soft-line); border-radius: var(--radius-md); padding: 14px; cursor: pointer; transition: border .18s; box-shadow: var(--shadow); }
.history-item:hover { border-color: var(--accent); }
.history-item img { width: 100%; border-radius: 8px; margin-top: 8px; }
.history-item h4 { font-size: 14px; margin-bottom: 6px; }
.history-item .hist-meta { font-size: 12px; color: var(--text-muted); }
.history-item .hist-time { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.history-empty { color: var(--text-muted); text-align: center; padding: 60px 0; }

/* 设置/帮助 */
.settings-panel { max-width: 720px; }
.settings-actions { display: flex; gap: 12px; margin-top: 16px; }
.sub-title { font-size: 15px; margin: 20px 0 12px; color: var(--text); border-top: 1px solid var(--soft-line); padding-top: 16px; }
.help-panel { max-width: 860px; }
.help-content h3 { font-size: 15px; margin: 18px 0 6px; color: var(--accent-strong); }
.help-content p { color: var(--text-secondary); line-height: 1.9; margin-bottom: 4px; }
.help-content b { color: var(--text); }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(2,6,23,0.72); display: flex; align-items: center; justify-content: center; z-index: 100; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.modal { background: var(--card); border: 1px solid var(--soft-line); border-radius: var(--radius-lg); padding: 24px; width: 440px; box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
.modal-sm { width: 360px; }
.modal h3 { font-size: 16px; margin-bottom: 6px; }
.modal-desc { color: var(--text-muted); font-size: 13px; margin-bottom: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* 新功能 */
.input-inline { width: 300px; padding: 8px 12px; font-size: 13px; }
.ai-edit-row { display: flex; align-items: center; gap: 8px; }
.upload-preview { max-width: 100%; max-height: 260px; border-radius: var(--radius-md); margin-top: 10px; border: 1px solid var(--soft-line); display: block; }
.vz-result { max-height: 78vh; overflow: auto; text-align: center; }
.vz-result svg { max-width: 100%; background: #fff; border-radius: 8px; }
.ly-result { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-height: 78vh; overflow: auto; }
.ly-item { background: var(--card); border: 1px solid var(--soft-line); border-radius: var(--radius-md); padding: 12px; }
.ly-item h4 { font-size: 13px; margin-bottom: 8px; color: var(--accent-strong); }
.ly-item img { max-width: 100%; border-radius: 8px; display: block; }
.ly-item .ly-text { font-size: 13px; color: var(--text-secondary); line-height: 1.8; white-space: pre-wrap; }
.ref-canvas { max-width: 100%; border-radius: var(--radius-md); margin-top: 10px; border: 1px solid var(--soft-line); background: var(--card); cursor: crosshair; }

/* IP 形象 */
.help-mascot { text-align: center; margin-bottom: 18px; }
.help-mascot img { max-width: 260px; border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.recharge-mascot { text-align: center; margin-bottom: 10px; }
.recharge-mascot img { width: 68px; height: 68px; border-radius: 12px; object-fit: cover; }
/* ---------- 首页 ---------- */
.home-hero {
  position: relative; text-align: center; padding: 48px 20px 36px; overflow: hidden;
}
.home-hero-glow {
  position: absolute; left: 50%; top: -40%; transform: translateX(-50%);
  width: 620px; height: 320px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(37,99,235,0.24), transparent 70%);
  pointer-events: none;
}
.home-title { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 12px; position: relative; }
.home-desc { color: var(--text-muted); font-size: 15px; margin-bottom: 24px; position: relative; }
.home-balance {
  display: inline-flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--soft-line); border-radius: 999px;
  padding: 10px 16px; box-shadow: var(--shadow); position: relative;
}
.home-balance span { color: var(--text-muted); font-size: 13px; }
.home-balance b { color: var(--accent-strong); font-size: 17px; }
.home-cards {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px;
  max-width: 1000px; margin: 0 auto; padding: 4px 0 12px;
}
@media (max-width: 900px) { .home-cards { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 600px) { .home-cards { grid-template-columns: 1fr; } }
.home-card {
  display: flex; flex-direction: row; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--soft-line); border-radius: 12px;
  padding: 10px 14px; cursor: pointer; transition: all .2s ease; box-shadow: var(--shadow);
}
.home-card:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 10px 24px rgba(37,99,235,0.16); }
.home-card-icon {
  width: 36px; height: 36px; border-radius: 9px; flex-shrink: 0;
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; color: #fff; box-shadow: 0 3px 10px rgba(37,99,235,0.30);
}
.home-card-body { flex: 1; min-width: 0; }
.home-card-body h3 { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.home-card-body p { font-size: 11.5px; color: var(--text-muted); line-height: 1.4; }
.home-card-arrow { color: var(--text-muted); font-size: 16px; flex-shrink: 0; }
/* ---------- 生图模式列表布局 ---------- */
.gen2-layout { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 16px; align-items: stretch; }
@media (max-width: 1100px) { .gen2-layout { grid-template-columns: 1fr; } }
.gen2-controls { display: flex; flex-direction: column; }
.gen2-results-col { position: sticky; top: 80px; width: 100%; height: calc(100vh - 100px); display: flex; flex-direction: column; }
.gen2-results { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.mode-list { max-height: 40vh; }
.ref-slots { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-top: 4px; }
.ref-slot { position: relative; aspect-ratio: 1; border: 1px dashed var(--line); border-radius: 10px; overflow: hidden; background: rgba(255,255,255,0.04); display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 22px; cursor: pointer; min-height: 46px; }
.ref-slot:hover { border-color: var(--accent); }
.ref-slot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ref-slot-del { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%; border: none; background: rgba(0,0,0,0.65); color: #fff; font-size: 12px; line-height: 1; cursor: pointer; z-index: 2; }
.ref-slot-tip { position: absolute; bottom: 2px; left: 2px; right: 2px; font-size: 9px; color: #fff; background: rgba(0,0,0,0.55); border-radius: 4px; text-align: center; padding: 1px 0; }
.ref-slot-main { border-color: var(--accent); }
.mode-panel { position: sticky; top: 80px; max-height: 82vh; display: flex; flex-direction: column; }
.mode-list { overflow: auto; margin-top: 10px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; flex: 1; max-height: 68vh; }
.mode-item {
  background: var(--card); border: 1px solid var(--soft-line); border-radius: 9px;
  padding: 7px 8px; font-size: 11.5px; color: var(--text-secondary);
  text-align: left; line-height: 1.35; transition: all .16s; overflow: hidden;
}
.mode-item:hover { border-color: var(--accent); color: var(--text); }
.mode-item.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); font-weight: 600; }
.mode-item .mode-badge {
  display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 8px;
  font-size: 10px; line-height: 16px; color: #fff; background: linear-gradient(135deg,#6366f1,#8b5cf6);
  vertical-align: 1px; white-space: nowrap;
}
.mode-item.active .mode-badge { background: linear-gradient(135deg,#4f46e5,#7c3aed); }
.mode-item .mode-num { color: var(--text-muted); font-size: 10px; margin-right: 4px; }
.gen2-right { display: flex; flex-direction: column; gap: 20px; }
/* ---------- 首页智能助手对话 ---------- */
.home-chat { max-width: 1100px; margin: 0 auto 22px; }
.home-chat-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.home-chat-icon { width: 42px; height: 42px; border-radius: 12px; background: var(--accent-soft); display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.home-chat-head h3 { font-size: 15px; font-weight: 700; }
.home-chat-head p { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.chat-box { background: var(--panel); border: 1px solid var(--soft-line); border-radius: 12px; padding: 14px; height: 250px; overflow: auto; display: flex; flex-direction: column; gap: 10px; }
.chat-msg { max-width: 82%; padding: 10px 14px; border-radius: 12px; font-size: 13px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.chat-msg.bot { background: var(--card); border: 1px solid var(--soft-line); align-self: flex-start; color: var(--text); }
.chat-msg.user { background: linear-gradient(135deg, #2563eb, #1d4ed8); color: #fff; align-self: flex-end; }
.chat-input-row { display: flex; gap: 10px; margin-top: 10px; }
.chat-input-row .input { flex: 1; }
/* ---------- 工作流画布 ---------- */
.wf-layout { display: grid; grid-template-columns: 260px minmax(0,1fr) 230px; gap: 16px; align-items: start; }
@media (max-width: 1200px) { .wf-layout { grid-template-columns: 260px minmax(0,1fr); } .wf-layout .wf-right { grid-column: 1 / -1; } }
@media (max-width: 900px) { .wf-layout { grid-template-columns: 1fr; } }
.wf-left { position: sticky; top: 80px; }
.wf-title { font-size: 13px; font-weight: 700; color: var(--text-secondary); margin: 16px 0 8px; }
.wf-title:first-child { margin-top: 0; }
.wf-start-btns, .wf-node-btns { display: flex; flex-direction: column; gap: 8px; }
.wf-canvas-panel { display: flex; flex-direction: column; }
.wf-canvas {
  position: relative; height: 76vh; overflow: hidden; border-radius: var(--radius-md);
  background-color: #0a0e18;
  border: 1px solid var(--soft-line);
  cursor: default;
}
.wf-canvas.panning { cursor: grabbing !important; }
.wf-viewport {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform-origin: 0 0;
  will-change: transform;
  /* 优化缩放清晰度 */
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  backface-visibility: hidden;
  transform-style: preserve-3d;
}
.wf-empty-tip {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  text-align: center; color: var(--text-muted); font-size: 14px; line-height: 2.1;
  pointer-events: none;
}
.wf-node {
  position: absolute; width: 260px; background: var(--card); border: 1px solid var(--soft-line);
  border-radius: 12px; box-shadow: 0 6px 18px rgba(0,0,0,0.45);
  padding: 10px; cursor: default; user-select: none;
}
.wf-node:active { cursor: grabbing; }
.wf-node-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 12px; font-weight: 700; color: var(--text-secondary);
  padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid var(--soft-line);
  cursor: move;
}
.wf-node-del {
  border: none; background: transparent; color: var(--text-muted); font-size: 14px; cursor: pointer; line-height: 1; padding: 2px;
}
.wf-node-del:hover { color: var(--danger); }
.wf-node-body { cursor: default; }
.wf-node-body .input { font-size: 13px; }
.wf-node-body textarea.input { min-height: 60px; }
.wf-node-result { margin-top: 8px; font-size: 12px; color: var(--text-secondary); line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.wf-node-result img { max-width: 100%; border-radius: 8px; margin-top: 6px; display: block; }
.wf-node-color { width: 100%; height: 60px; border: none; border-radius: 8px; cursor: pointer; padding: 0; }
.wf-node .btn { font-size: 12px; padding: 6px 10px; margin-top: 6px; }
/* ============ 大师兄AI风格优化（三栏工作台） ============ */
.mode-manual {
  display: block; width: 100%; margin-bottom: 8px; text-align: left;
  background: var(--accent-soft); border: 1px dashed var(--accent);
  color: var(--accent-strong); font-size: 12.5px; font-weight: 600;
  padding: 8px 10px; border-radius: 10px; transition: all .16s;
}
.mode-manual:hover { background: rgba(59,130,246,0.16); }
.mode-footer-card {
  display: flex; align-items: center; gap: 10px; margin-top: 10px;
  background: linear-gradient(135deg, rgba(37,99,235,0.20) 0%, rgba(255,255,255,0.05) 100%);
  border: 1px solid var(--soft-line); border-radius: 12px; padding: 10px 12px;
  cursor: pointer; transition: all .18s;
}
.mode-footer-card:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: 0 8px 20px rgba(59,130,246,0.12); }
.mode-footer-icon { width: 38px; height: 38px; border-radius: 10px; background: var(--accent-soft); display: flex; align-items: center; justify-content: center; font-size: 19px; flex-shrink: 0; }
.mode-footer-card b { font-size: 13px; color: var(--text); display: block; }
.mode-footer-card p { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.mode-footer-arrow { margin-left: auto; color: var(--text-muted); font-size: 16px; }
.gen2-right { display: flex; flex-direction: column; gap: 16px; }
.gen2-results .result-grid { max-height: 62vh; overflow: auto; }
.gen2-tool-btns { display: flex; flex-direction: column; gap: 8px; }
.gen2-tool-btns .btn { justify-content: flex-start; }
.gen2-tools .field-tip { margin-top: 10px; font-size: 11.5px; line-height: 1.7; }
.wf-right { position: sticky; top: 80px; }
.wf-right-btns { display: flex; flex-direction: column; gap: 8px; }
.wf-canvas-panel { min-height: 76vh; }

/* ============ 深色主题（首页 / 画布页，1:1 大师兄AI） ============ */
body.theme-dark {
  --bg: #0e1322;
  --panel: #161c2e;
  --card: #1a2133;
  --accent-end: #1d4ed8;
  --soft-line: rgba(255,255,255,0.07);
  --line: rgba(255,255,255,0.10);
  --line-strong: rgba(255,255,255,0.16);
  --text: #e9edf5;
  --text-secondary: #b7c2d6;
  --text-muted: #7d8aa6;
  --accent: #4f8cff;
  --accent-strong: #6fa8ff;
  --accent-soft: rgba(79,140,255,0.16);
  --shadow: 0 8px 24px rgba(0,0,0,0.45);
  background: radial-gradient(1100px 520px at 50% -12%, rgba(79,140,255,0.14), transparent 60%), #0e1322;
  background-attachment: fixed;
}
body.theme-dark .topbar {
  background: rgba(13,18,32,0.82);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
body.theme-dark .nav-btn { color: var(--text-secondary); }
body.theme-dark .nav-btn:hover { background: rgba(255,255,255,0.06); color: var(--text); }
body.theme-dark .nav-btn.active { background: var(--accent-soft); color: #cfe0ff; }
body.theme-dark .balance-box { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.10); }
body.theme-dark .balance-value { color: #6fa8ff; }
body.theme-dark .input, body.theme-dark textarea.input, body.theme-dark select.input {
  background: rgba(255,255,255,0.05); border-color: var(--line); color: var(--text);
}
body.theme-dark .input::placeholder { color: var(--text-muted); }
body.theme-dark .btn-ghost { background: rgba(255,255,255,0.05); color: var(--text-secondary); border-color: var(--line); }
body.theme-dark .btn-ghost:hover { background: rgba(255,255,255,0.10); color: var(--text); }
body.theme-dark .chat-box { background: rgba(255,255,255,0.04); border-color: var(--soft-line); }
body.theme-dark .chat-msg.bot { background: var(--panel); border-color: var(--soft-line); color: var(--text); }
body.theme-dark .home-chat-head p, body.theme-dark .home-desc { color: var(--text-muted); }
body.theme-dark .home-balance { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.12); }
body.theme-dark .home-balance b { color: #6fa8ff; }
body.theme-dark .home-card { background: rgba(255,255,255,0.045); border-color: rgba(255,255,255,0.08); box-shadow: 0 4px 16px rgba(0,0,0,0.25); }
body.theme-dark .home-card:hover { border-color: var(--accent); box-shadow: 0 12px 30px rgba(79,140,255,0.18); }
body.theme-dark .home-card-icon { background: var(--accent-soft); }
body.theme-dark .home-card-body p, body.theme-dark .home-card-arrow { color: var(--text-muted); }
body.theme-dark .home-title { color: var(--text); }
/* 深色：工作流画布（节点工作编辑器） */
body.theme-dark .wf-canvas {
  background-color: #0a0e18;
  border-color: var(--soft-line);
}
body.theme-dark .wf-node { background: #1a2133; border-color: var(--soft-line); color: var(--text); box-shadow: 0 6px 18px rgba(0,0,0,0.45); }
body.theme-dark .wf-node-head { border-bottom-color: var(--soft-line); }
body.theme-dark .wf-node input, body.theme-dark .wf-node textarea {
  background: rgba(255,255,255,0.06); border-color: var(--line); color: var(--text);
}
body.theme-dark .wf-empty-tip, body.theme-dark .wf-title { color: var(--text-muted); }
body.theme-dark .canvas-toolbar { color: var(--text-secondary); }
body.theme-dark .status-text { color: var(--text-muted); }
body.theme-dark .panel-desc, body.theme-dark .field-tip { color: var(--text-muted); }

.gen2-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.mode-panel { min-width: 0; }

/* ============ 个人中心（淘宝充值） ============ */
.profile-layout { display: grid; grid-template-columns: 320px 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .profile-layout { grid-template-columns: 1fr; } }
.profile-row { display: flex; align-items: center; gap: 12px; margin: 16px 0; }
.profile-avatar { width: 56px; height: 56px; border-radius: 14px; overflow: hidden; border: 1px solid var(--soft-line); flex-shrink: 0; }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-row b { font-size: 15px; display: block; }
.profile-row p { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.profile-balance { display: flex; justify-content: space-between; align-items: center; background: var(--accent-soft); border-radius: 12px; padding: 12px 14px; }
.profile-balance span { font-size: 13px; color: var(--text-secondary); }
.profile-balance b { font-size: 20px; color: var(--accent-strong); }
.recharge-panel .row { display: flex; gap: 8px; }
.recharge-panel .row .input { flex: 1; }
.profile-tools { grid-column: 1 / -1; }
@media (max-width: 900px) { .profile-tools { grid-column: auto; } }

/* ============ 首页单行输入框（1:1 大师兄AI首页） ============ */
.home-search {
  display: flex; align-items: center; gap: 10px;
  max-width: 1080px; margin: 0 auto 16px;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px; padding: 7px 7px 7px 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.35);
}
.home-search-icon {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  display: flex; align-items: center; justify-content: center; font-size: 17px;
}
.home-search .input {
  background: transparent; border: none; box-shadow: none; color: var(--text); flex: 1;
  padding: 8px 4px; font-size: 14px;
}
.home-search .input:focus { box-shadow: none; border: none; }
.home-search .input::placeholder { color: var(--text-muted); }
.home-search .btn { border-radius: 999px; padding: 9px 20px; }
.home-chat-reply {
  max-width: 1080px; margin: 0 auto 14px;
  background: var(--panel); border: 1px solid var(--soft-line); border-radius: 14px;
  padding: 14px 16px; font-size: 13.5px; line-height: 1.7; white-space: pre-wrap; word-break: break-word;
  box-shadow: var(--shadow);
}
.home-status { text-align: center; max-width: 1080px; margin: 0 auto 16px; }

/* ============ 星空背景 + 自定义尺寸（科技感） ============ */
#homeStars {
  position: fixed; inset: 0; z-index: 0; display: none;
  pointer-events: none;
}
body.home-mode #homeStars { display: block; }
body.home-mode .main { position: relative; z-index: 1; }
body.home-mode .home-hero-glow { z-index: 0; }
.size-row { display: flex; align-items: center; gap: 8px; }
.size-row .input { flex: 1; min-width: 0; }
.size-x { color: var(--text-muted); font-size: 16px; flex-shrink: 0; }

.status-text.error { color: #dc2626; background: rgba(220,38,38,0.10); padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(220,38,38,0.25); font-weight: 600; }

/* ============ 全页面深色组件 ============ */
body.theme-dark .btn-ghost { background: rgba(255,255,255,0.06); color: var(--text-secondary); border-color: var(--line); }
body.theme-dark .btn-ghost:hover { background: rgba(255,255,255,0.10); color: var(--text); }
body.theme-dark .chip { background: rgba(255,255,255,0.05); border-color: var(--line); color: var(--text-secondary); }
body.theme-dark .chip:hover { border-color: var(--accent); color: var(--text); }
body.theme-dark .chip.active { background: var(--accent-soft); border-color: var(--accent); color: #cfe0ff; }
body.theme-dark .mode-item { background: rgba(255,255,255,0.05); border-color: var(--soft-line); color: var(--text-secondary); }
body.theme-dark .mode-item:hover { border-color: var(--accent); color: var(--text); }
body.theme-dark .mode-item.active { background: var(--accent-soft); border-color: var(--accent); color: #cfe0ff; }
body.theme-dark .result-card { background: var(--panel); border-color: var(--soft-line); }
body.theme-dark .result-card img { background: #10141f; }
body.theme-dark .history-item { background: var(--panel); border-color: var(--soft-line); }
body.theme-dark .modal { background: #161c2e; border-color: var(--soft-line); box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
body.theme-dark .ly-item { background: var(--panel); border-color: var(--soft-line); }
body.theme-dark .ref-canvas { background: #10141f; border-color: var(--soft-line); }
body.theme-dark .canvas-wrap { background: #0b0f1a; }
body.theme-dark .canvas-toolbar { color: var(--text-secondary); }
body.theme-dark select.input option { background: #161c2e; color: var(--text); }
body.theme-dark .wf-node input, body.theme-dark .wf-node textarea { background: rgba(255,255,255,0.06); border-color: var(--line); color: var(--text); }
body.theme-dark .wf-node select { background: rgba(255,255,255,0.08); border-color: var(--line); color: var(--text); }
body.theme-dark .wf-node select option { background: #1a2133; color: #e2e8f0; }
body.theme-dark .wf-node select option:checked { background: #4f8cff; color: #fff; }
body.theme-dark .status-text.error { color: #f87171; }

/* ============ 首页智能助手工作台 ============ */
.home-assistant { max-width: 860px; margin: 0 auto 20px; }
.ha-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.ha-head b { font-size: 15px; display: block; }
.ha-head p { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.ha-options { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 12px; align-items: flex-start; }
.ha-ref-col { flex: 1; min-width: 0; }
.ha-ref-col .ref-slots, .home-ref-slots { grid-template-columns: repeat(6, 1fr) !important; gap: 24px !important; margin-top: 8px; width: 100% !important; }
.ha-opts { display: flex; flex-direction: column; gap: 12px; max-width: 1080px; margin: 0 auto 16px; }
.ha-opt label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 5px; }
.ha-opt .input { width: 110px; padding: 7px 10px; }
.ha-opt .chips { gap: 6px; }
.ha-opt .chip { padding: 6px 10px; font-size: 12px; }
.home-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 12px; }
.home-results .result-card { position: relative; }

/* ============ 节点式画布（端口+连线） ============ */
.wf-node { width: 240px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
.wf-node-in, .wf-node-out {
  position: absolute; width: 14px; height: 14px; border-radius: 50%;
  background: #22d3ee; border: 2px solid #0e1322; cursor: crosshair; z-index: 6;
  box-shadow: 0 0 6px rgba(34,211,238,0.6);
}
.wf-node-in { left: -8px; top: 50%; margin-top: -7px; }
.wf-node-out { right: -8px; top: 50%; margin-top: -7px; }
.wf-node-in:hover, .wf-node-out:hover { background: #f59e0b; }
.wf-node-del { position: absolute; top: 6px; right: 8px; width: 20px; height: 20px; border: none; border-radius: 6px; background: rgba(255,255,255,0.1); color: var(--text-muted); font-size: 13px; cursor: pointer; line-height: 1; }
.wf-node-del:hover { background: rgba(220,38,38,0.3); color: #fff; }
.wf-node-body { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 6px; }
.wf-node-body textarea { width: 100%; min-height: 54px; background: rgba(255,255,255,0.06); border: 1px solid var(--line); border-radius: 8px; color: var(--text); padding: 7px; font-size: 12px; resize: vertical; }
.wf-node-body textarea:focus { outline: none; border-color: var(--accent); }
.wf-node-img { max-width: 100%; border-radius: 8px; display: block; }
.wf-node-result { font-size: 12px; color: var(--text-secondary); white-space: pre-wrap; word-break: break-word; line-height: 1.5; }
.wf-node-status { font-size: 11px; color: var(--text-muted); margin-top: 2px; min-height: 14px; }
.wf-node-color { width: 100%; height: 30px; border: none; border-radius: 8px; background: transparent; cursor: pointer; }
.wf-edge { stroke: #4f8cff; stroke-width: 2; fill: none; pointer-events: stroke; cursor: pointer; }
.wf-edge:hover { stroke: #f59e0b; stroke-width: 3; }
.wf-edge-tmp { stroke: rgba(79,140,255,0.7); stroke-width: 2; stroke-dasharray: 6 4; fill: none; pointer-events: none; }

/* ============ 首页智能助手（整合版） ============ */
.home-assistant { max-width: 860px; margin: 0 auto 20px; padding: 14px 16px; }
.ha-row { display: flex; align-items: center; gap: 10px; }
.ha-row .input { flex: 1; background: rgba(255,255,255,0.05); border: 1px solid var(--line); border-radius: 999px; padding: 9px 16px; color: var(--text); }
.ha-row .btn { border-radius: 999px; flex-shrink: 0; }
.ha-opts { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--soft-line); }
.ha-label { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.ha-sel { width: auto; padding: 6px 8px; font-size: 12.5px; background: rgba(255,255,255,0.05); }
.ha-ref-thumbs { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.ha-ref-thumbs .ref-slot { width: 46px; height: 46px; min-height: 0; aspect-ratio: auto; font-size: 16px; }
.ha-ref-thumbs .ref-slot-del { width: 18px; height: 18px; font-size: 11px; }
.home-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 12px; }

.wf-sub { font-size: 12px; font-weight: 700; color: var(--text-muted); margin: 10px 0 6px; }
.wf-empty-title { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 16px; }
.wf-empty-actions { display: flex; flex-direction: column; gap: 8px; max-width: 260px; margin: 0 auto; }
.wf-empty-actions .btn { border-radius: 10px; }
.wf-empty-tip .field-tip { margin-top: 14px; }

/* ============ 首页：大师兄AI风格 简洁输入栏 + 可展开选项 ============ */
.home-search {
  display: flex; align-items: center; gap: 10px;
  max-width: 760px; margin: 0 auto 14px;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px; padding: 8px 8px 8px 16px;
  box-shadow: 0 10px 34px rgba(0,0,0,0.4);
}
.home-search .input {
  flex: 1; background: transparent; border: none; box-shadow: none;
  color: var(--text); font-size: 14.5px; padding: 8px 4px;
}
.home-search .input:focus { border: none; box-shadow: none; }
.home-search .btn { border-radius: 999px; flex-shrink: 0; }
.opt-toggle { width: 36px; height: 36px; padding: 0; border-radius: 50%; font-size: 15px; }
.ha-opts {
  max-width: 760px; margin: 0 auto 16px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--soft-line);
  border-radius: 14px; padding: 12px 14px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.ha-ref-col { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ha-ref-thumbs { display: flex; gap: 6px; flex-wrap: wrap; }
.ha-ref-thumbs .ref-slot { width: 42px; height: 42px; min-height: 0; aspect-ratio: auto; font-size: 15px; }
.ha-ref-thumbs .ref-slot-del { width: 17px; height: 17px; font-size: 10px; }
.ha-opt { display: flex; align-items: center; gap: 6px; }
.ha-opt label { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.ha-sel { width: auto; padding: 6px 8px; font-size: 12.5px; }

/* ============ 无限画布 1:1（大师兄AI） ============ */
.wf-lib-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  color: #fff; font-size: 12.5px; padding: 8px 10px; cursor: grab;
  transition: all .15s; text-align: left;
}
.wf-lib-item:hover { border-color: #2d9cdb; }
.lib-ico { width: 20px; height: 20px; border-radius: 5px; background: rgba(255,255,255,0.08); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; flex-shrink: 0; }
.lib-ico.lib-purple { color: #a940c9; }
.wf-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
/* 生图预设模式顶部工具栏 */
.wf-mode-toolbar {
  position: relative;
  z-index: 100;
  display: flex; align-items: flex-start; gap: 2px;
  padding: 4px 8px 4px 165px;
  background: transparent;
  border: none;
  margin: 0;
}
.wf-mode-toolbar-label {
  display: none;
}
.wf-mode-toolbar-scroll {
  flex: 1; display: flex; gap: 2px; flex-wrap: wrap;
  padding: 0;
  justify-content: flex-start;
}
.wf-mode-btn {
  flex-shrink: 0; flex-grow: 0;
  min-width: 90px;
  padding: 4px 4px; border-radius: 4px;
  background: rgba(34,211,238,0.08); border: 1px solid rgba(34,211,238,0.2);
  color: #67e8f9; font-size: 12px; cursor: grab; white-space: nowrap;
  transition: all .15s; user-select: none;
  text-align: center;
  line-height: 1.3;
}
.wf-mode-btn:hover {
  background: rgba(34,211,238,0.15); border-color: rgba(34,211,238,0.4);
  transform: translateY(-1px);
}
.wf-mode-btn:active { cursor: grabbing; }
.wf-mode-btn.cat-design { background: rgba(168,85,247,0.08); border-color: rgba(168,85,247,0.2); color: #c084fc; }
.wf-mode-btn.cat-design:hover { background: rgba(168,85,247,0.15); border-color: rgba(168,85,247,0.4); }
.wf-mode-btn.cat-3d { background: rgba(251,146,60,0.08); border-color: rgba(251,146,60,0.2); color: #fb923c; }
.wf-mode-btn.cat-3d:hover { background: rgba(251,146,60,0.15); border-color: rgba(251,146,60,0.4); }
.wf-mode-btn.cat-id { background: rgba(34,197,94,0.08); border-color: rgba(34,197,94,0.2); color: #4ade80; }
.wf-mode-btn.cat-id:hover { background: rgba(34,197,94,0.15); border-color: rgba(34,197,94,0.4); }
.wf-mode-btn.cat-fix { background: rgba(244,63,94,0.08); border-color: rgba(244,63,94,0.2); color: #fb7185; }
.wf-mode-btn.cat-fix:hover { background: rgba(244,63,94,0.15); border-color: rgba(244,63,94,0.4); }
.wf-mode-btn.cat-other { background: rgba(148,163,184,0.08); border-color: rgba(148,163,184,0.2); color: #94a3b8; }
.wf-mode-btn.cat-other:hover { background: rgba(148,163,184,0.15); border-color: rgba(148,163,184,0.4); }
.wf-tab { padding: 5px 14px; border-radius: 8px; font-size: 13px; color: #a0a7b5; border: 1px solid transparent; cursor: default; }
.wf-tab.active { color: #fff; border-color: rgba(45,156,219,0.5); background: #0a1a2f; }
.wf-spacer { flex: 1; }
.wf-status { font-size: 12px; color: #2cdc76; background: rgba(44,220,118,0.12); border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
.wf-empty-tip .wf-ai-glow { font-size: 40px; margin-bottom: 12px; filter: drop-shadow(0 0 18px rgba(45,156,219,0.6)); }
.wf-empty-title { font-size: 26px; font-weight: 700; color: #fff; margin-bottom: 8px; }
.wf-empty-sub { font-size: 13px; color: #a0a7b5; margin-bottom: 22px; }
.wf-empty-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; max-width: 720px; margin: 0 auto; }
.wf-start-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  color: #fff; font-size: 12.5px; padding: 9px 14px; cursor: pointer; transition: all .15s;
}
.wf-start-btn:hover { border-color: #2d9cdb; transform: translateY(-1px); }
.st-ico { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0; }
.st-purple { background: rgba(169,64,201,0.25); color: #a940c9; }
.st-blue { background: rgba(45,156,219,0.22); color: #2d9cdb; }
.st-green { background: rgba(27,141,74,0.25); color: #1b8d4a; }
.wf-drag-hint { font-size: 11.5px; color: #a0a7b5; margin-top: 20px; }
.wf-right { position: sticky; top: 80px; }
.wf-prop-placeholder { font-size: 12px; color: var(--text-muted); border: 1px dashed var(--soft-line); border-radius: 10px; padding: 18px 12px; text-align: center; line-height: 1.6; }
.wf-layout { grid-template-columns: 150px minmax(0,1fr) 220px; }

/* ============ 无限画布 精细调优（对照大师兄AI） ============ */
body.canvas-mode { --bg: #141823; background: #141823; }
body.canvas-mode .wf-left, body.canvas-mode .wf-canvas-panel, body.canvas-mode .wf-right { border-radius: 8px; box-shadow: inset 0 0 8px rgba(0,0,0,0.2); }
body.canvas-mode .wf-canvas {
  background-color: #141823;
}
.wf-ai-glow {
  width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #4f8cff, #2563eb 70%);
  color: #fff; font-size: 26px; font-weight: 800; font-style: italic;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 30px rgba(45,156,219,0.55);
}
.wf-start-btn { background: rgba(255,255,255,0.05); border: 1px solid #3a404e; border-radius: 6px; }
.wf-start-btn:hover { border-color: #4f8cff; background: rgba(79,140,255,0.12); }
.wf-lib-item { background: #1e2330; border: 1px solid #2a2f3d; border-radius: 6px; }
.wf-lib-item:hover { border-color: #4f8cff; }
.wf-sub { display: flex; align-items: center; gap: 6px; border-bottom: 1px solid #1e2330; padding-bottom: 4px; margin: 8px 0 4px; font-size: 12px; cursor: pointer; user-select: none; }
.wf-sub::after { content: '^'; margin-left: auto; font-size: 10px; color: var(--text-muted); transform: rotate(180deg); }
.wf-sub.closed::after { transform: rotate(0deg); }
.wf-sub.closed + .wf-node-btns { display: none; }
.wf-title { font-size: 13.5px; }
.wf-collapse { margin-left: auto; color: var(--text-muted); font-size: 13px; }
.wf-prop-placeholder { background: #1e2330; border: 1px solid #1e2330; border-radius: 6px; color: var(--text-muted); font-size: 12px; padding: 16px 10px; text-align: center; line-height: 1.7; }
.wf-tab { font-size: 12.5px; }
.wf-toolbar .btn { border-radius: 6px; }

.wf-bottom-bar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; align-items: center; gap: 8px; background: rgba(20,24,35,0.95); border: 1px solid #2a2f3d; border-left: none; border-right: none; border-bottom: none; border-radius: 0; padding: 6px 10px; }
.wf-unsaved { display: none !important; }
.wf-bottom-bar .btn { border-radius: 6px; }

.wf-lib-tools { display: flex; gap: 4px; margin: 6px 0 3px; }
.wf-lib-tool { display: flex; align-items: center; gap: 4px; background: #1f232b; border: 1px solid #3a3d45; border-radius: 6px; color: #fff; font-size: 11.5px; padding: 4px 6px; cursor: pointer; }
.wf-lib-tool:hover { border-color: #4f8cff; }
.wf-drag-hint2 { font-size: 11px; color: #a0a7b5; margin: 8px 0 4px; }
.tab-no { color: #4f8cff; font-style: normal; }
.tab-close { color: var(--text-muted); font-style: normal; cursor: pointer; margin-left: 4px; }
.wf-darkbtn { cursor: default; }
.wf-shortcuts { font-size: 11px; color: var(--text-muted); margin-left: 6px; white-space: nowrap; }
/* 画布稀疏小点网格 - 已移除 */
body.canvas-mode .wf-canvas {
  background-color: #12121b;
}
/* 两栏布局（去掉右栏后） */
.wf-layout { grid-template-columns: 250px minmax(0, 1fr); }

.st-red { background: rgba(220,60,60,0.22); color: #e5534b; }
.wf-tab-add { width: 24px; height: 24px; border-radius: 6px; border: 1px solid #3a3d45; background: transparent; color: #fff; font-size: 14px; cursor: pointer; }
.wf-tab-add:hover { border-color: #4f8cff; }

/* ============ 无限画布 全屏 + 悬浮组件库 ============ */
body.canvas-mode #page-canvas { position: fixed; inset: 0; z-index: 60; padding-top: 60px; }
body.canvas-mode .wf-layout { position: absolute; inset: 0; top: 60px; display: block; padding: 0; }
body.canvas-mode .wf-canvas-panel { position: absolute; inset: 0; display: flex; flex-direction: column; }
body.canvas-mode .wf-canvas { position: absolute; top: 46px; left: 0; right: 0; bottom: 42px; height: auto; border-radius: 0; border: none; }
body.canvas-mode .wf-toolbar { position: absolute; top: 0; left: 0; right: 0; z-index: 40; display: flex; align-items: center; gap: 8px; padding: 7px 12px; background: rgba(18,18,27,0.75); backdrop-filter: blur(8px); border-bottom: 1px solid #1e2330; flex-wrap: wrap; }
body.canvas-mode .wf-bottom-bar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 40; border-radius: 0; }
body.canvas-mode .wf-left {
  position: absolute; top: 54px; left: 12px; z-index: 35; width: 150px;
  background: rgba(22,26,38,0.98);
  border: 1px solid rgba(255,255,255,0.12); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.45);
  opacity: 1; transition: opacity .22s ease;
  padding: 4px 6px; max-height: calc(100vh - 70px); overflow: hidden;
}
body.canvas-mode .wf-left:hover { opacity: 1; background: rgba(22,26,38,1); }
.wf-left-head { display: flex; align-items: center; justify-content: space-between; cursor: move; user-select: none; }
.wf-left-drag { color: var(--text-muted); font-size: 13px; letter-spacing: 2px; cursor: move; }
.wf-left-head .wf-title { margin: 0; }
.wf-left { min-width: 150px; }
.wf-tabs { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
/* 闪烁提示 */
.wf-hint-pop {
  display: flex; align-items: center; gap: 6px; margin: 2px 0 6px 6px;
  color: #4f8cff; font-size: 12px; font-weight: 600;
  animation: wfBlink 1.1s ease-in-out infinite;
  pointer-events: none;
  position: static !important;
  left: auto !important;
  top: auto !important;
  transform: none !important;
}
.wf-hint-arrow { font-size: 16px; }
@keyframes wfBlink { 0%,100% { opacity: 0.15; } 50% { opacity: 1; } }
.wf-hint-pop.hidden { display: flex !important; }

/* 画布浮动闪烁提示 */
.wf-center-hint {
  position: fixed;
  top: 395px;
  left: 175px;
  pointer-events: none;
  z-index: 100;
  animation: wfCenterBlink 1.5s ease-in-out infinite;
}
.wf-center-hint.hidden { display: none; }
.wf-center-hint-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(30, 41, 59, 0.92);
  border: 1px solid rgba(79, 140, 255, 0.4);
  border-radius: 8px;
  padding: 8px 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}
.wf-center-hint-arrow-left {
  font-size: 20px;
  animation: wfPointLeft 1s ease-in-out infinite;
}
.wf-center-hint-content {
  text-align: left;
}
.wf-center-hint-text {
  font-size: 12px;
  font-weight: 600;
  color: #4f8cff;
  margin-bottom: 2px;
  white-space: nowrap;
}
.wf-center-hint-sub {
  font-size: 10px;
  color: #94a3b8;
  white-space: nowrap;
}
@keyframes wfCenterBlink {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}
@keyframes wfPointLeft {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(-8px); }
}

.wf-start-btn { white-space: nowrap; }
.wf-empty-actions { gap: 8px; }

.wf-node-panel { display: flex; flex-direction: column; gap: 6px; background: rgba(255,255,255,0.04); border: 1px solid #2a2f3d; border-radius: 8px; padding: 8px; }
.np-row { display: flex; align-items: center; gap: 6px; }
.np-label { font-size: 11px; color: #a0a7b5; width: 44px; flex-shrink: 0; }
.np-select { flex: 1; min-width: 0; width: 100%; background: #1e2330; border: 1px solid #3a3d45; border-radius: 6px; color: #fff; font-size: 11.5px; padding: 4px 6px; }
.np-select:focus { outline: none; border-color: #4f8cff; }
.np-stable { font-size: 10.5px; color: #2cdc76; white-space: nowrap; }
.np-chips { display: flex; gap: 4px; flex: 1; }
.np-chip { background: #1e2330; border: 1px solid #3a3d45; border-radius: 6px; color: #fff; font-size: 11px; padding: 3px 8px; cursor: pointer; }
.np-chip.active { background: #2563eb; border-color: #2563eb; }
.np-cost { font-size: 11.5px; color: #a0a7b5; }
.np-cost b { color: #fff; }

.wf-left-collapse { width: 22px; height: 22px; border-radius: 6px; border: 1px solid #3a3d45; background: transparent; color: #fff; font-size: 14px; cursor: pointer; flex-shrink: 0; }
.wf-left-collapse:hover { border-color: #4f8cff; }
body.canvas-mode .wf-left.collapsed { width: 46px; padding: 10px 6px; }
body.canvas-mode .wf-left.collapsed > *:not(.wf-left-head) { display: none; }
body.canvas-mode .wf-left.collapsed .wf-left-head { justify-content: center; }
body.canvas-mode .wf-left.collapsed .wf-title, body.canvas-mode .wf-left.collapsed .wf-left-drag { display: none; }
.np-color { width: 34px; height: 26px; border: 1px solid #3a3d45; border-radius: 6px; background: transparent; cursor: pointer; }
.np-row input[type=range] { flex: 1; accent-color: #2563eb; }

.wf-palette {
  position: absolute; z-index: 50; min-width: 170px;
  background: rgba(20,24,35,0.95); border: 1px solid #3a3d45; border-radius: 10px;
  box-shadow: 0 12px 34px rgba(0,0,0,0.5); padding: 6px; backdrop-filter: blur(8px);
}
.wf-pal-title { font-size: 11px; color: #a0a7b5; padding: 4px 8px 6px; border-bottom: 1px solid #1e2330; margin-bottom: 4px; }
.wf-pal-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  background: transparent; border: none; border-radius: 7px;
  color: #fff; font-size: 12.5px; padding: 7px 8px; cursor: pointer; text-align: left;
}
.wf-pal-item:hover { background: rgba(79,140,255,0.15); }
.wf-pal-item .lib-ico { color: #fff; }

.wf-select-box { position: absolute; z-index: 8; border: 1px dashed #4f8cff; background: rgba(79,140,255,0.12); pointer-events: none; display: none; }
.wf-node.wf-selected { border-color: #4f8cff !important; box-shadow: 0 0 0 1px #4f8cff, 0 0 16px rgba(79,140,255,0.35); }
.wf-node.wf-grouped { outline: 1px dashed rgba(44,220,118,0.7); }
.wf-node.wf-selected.wf-grouped { outline-color: #2cdc76; }

.wf-node-ico { font-size: 13px; width: 20px; height: 20px; border-radius: 5px; background: rgba(255,255,255,0.1); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.wf-head-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.wf-node-run { width: 20px; height: 20px; border: none; border-radius: 5px; background: rgba(255,255,255,0.08); color: #fff; font-size: 10px; cursor: pointer; line-height: 1; }
.wf-node-run:hover { background: #2563eb; }

/* ============ 节点外观（对齐大师兄AI：彩色发光边框 + 上传区） ============ */
.wf-node { border: 1px solid var(--soft-line); }
.wf-node[data-type="imageGen"], .wf-node[data-type="chat"] { border: 2px solid #4361ee; box-shadow: 0 0 14px rgba(67,97,238,0.35); }
.wf-node[data-type="prompt"] { border: 2px solid #ff3b80; box-shadow: 0 0 22px rgba(255,59,128,0.6); }
.wf-node[data-type="negPrompt"] { border: 2px solid #a940c9; border-style: dashed; box-shadow: 0 0 22px rgba(169,64,201,0.6); }
.wf-node[data-type="upscale"] { border: 2px solid #2d9cdb; box-shadow: 0 0 22px rgba(45,156,219,0.6); }
.wf-node[data-type="superres"], .wf-node[data-type="cutout"] { border: 2px solid #a940c9; box-shadow: 0 0 22px rgba(169,64,201,0.6); }
.wf-node[data-type="color"] { border: 2px solid #c05bd8; box-shadow: 0 0 22px rgba(192,91,216,0.6); }
.wf-node[data-type="imageTransform"] { border: 2px solid #f59e0b; box-shadow: 0 0 22px rgba(245,158,11,0.6); }
.wf-node[data-type="longConcat"], .wf-node[data-type="vectorize"], .wf-node[data-type="freeCutVector"] { border: 2px solid #4361ee; box-shadow: 0 0 14px rgba(67,97,238,0.35); }
.wf-node[data-type="note"] { border: 2px solid #38bdf8; box-shadow: 0 0 22px rgba(56,189,248,0.6); }
.wf-node[data-type="imageInput"] { border: 2px solid #a940c9; border-style: dashed; }
.wf-dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 18px 10px; border: 1px dashed #3a3d45; border-radius: 8px;
  color: #a0a7b5; font-size: 12px; text-align: center; cursor: pointer; background: rgba(255,255,255,0.02);
}
.wf-dropzone:hover { border-color: #4f8cff; }
.wf-dropzone .dz-ico { font-size: 24px; }
.np-cost { color: #2cdc76; }
.np-cost b { color: #fff; }

.wf-node-imgbox { min-height: 120px; border: 1px dashed #3a3d45; border-radius: 8px; background: rgba(255,255,255,0.02); }
.wf-preview-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 118px; color: #a0a7b5; }
.wf-preview-empty .pv-ico { font-size: 28px; }
.wf-preview-empty .pv-text { font-size: 11.5px; }

.wf-note-toolbar { display: flex; align-items: center; gap: 6px; }
.wf-note-toolbar .np-chip.active { background: #2563eb; }

/* 侧栏取消半透明自动隐藏，保持完全不透明 */
.wf-left { transition: opacity .35s ease; }
.wf-left.wf-left-idle:not(.collapsed) { opacity: 1; }
.wf-left.wf-left-idle:hover { opacity: 1; }
.wf-head-actions .wf-node-run { margin-right: 6px; }

/* ===== 优化：长条折叠按钮 + 提示语外置 + 运行/关闭间距 ===== */
.wf-left-head { flex-direction: column; align-items: stretch; gap: 0; }
.wf-left-titlebar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-bottom: 1px solid #3a3d45; }
.wf-left-titlebar .wf-title { margin: 0; }
.wf-left-collapse { width: 100%; display: block; text-align: center; padding: 7px 0; border: none; border-radius: 0; border-bottom: 1px solid #3a3d45; background: rgba(255,255,255,0.05); color: #cbd5e1; font-size: 12px; font-weight: 600; cursor: pointer; }
.wf-left-collapse:hover { background: rgba(255,255,255,0.10); color: #fff; border-color: #4f8cff; }
.wf-hint-pop { position: absolute; left: 100%; top: 66px; margin-left: 10px; white-space: nowrap; z-index: 40; background: rgba(13,18,32,0.95); border: 1px solid rgba(79,140,255,0.4); border-radius: 8px; padding: 6px 10px; }
.wf-head-actions .wf-node-run { margin-right: 10px; }
body.canvas-mode .wf-left.collapsed .wf-left-titlebar { display: none; }
body.canvas-mode .wf-left.collapsed .wf-left-head { justify-content: center; }
body.canvas-mode .wf-left.collapsed .wf-left-collapse { border-bottom: none; padding: 12px 0; font-size: 14px; }

/* ===== 优化：首页图标 / 积分明细 / 必填参考图 ===== */
.home-search-icon { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.08); flex-shrink: 0; }
.home-search-icon img { width: 100%; height: 100%; object-fit: cover; }
.ledger-list { display: flex; flex-direction: column; gap: 8px; max-height: 340px; overflow-y: auto; }
.ledger-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px solid var(--soft-line); border-radius: 8px; font-size: 12px; }
.ledger-main { display: flex; flex-direction: column; gap: 2px; }
.ledger-desc { color: var(--text); font-weight: 500; }
.ledger-time { color: var(--text-muted); font-size: 11px; }
.ledger-amount { font-weight: 700; white-space: nowrap; }
.ledger-in { color: #2cdc76; }
.ledger-out { color: #f87171; }
.ref-slot.ref-required { border-color: #f59e0b !important; box-shadow: 0 0 0 2px rgba(245,158,11,0.35) !important; }

/* ===== 设计页：需求框与画布尺寸同宽 + 参考图 / 矢量模式 / 提醒弹窗 ===== */
#designPrompt { width: 100%; box-sizing: border-box; }
.design-input-panel .form-group { width: 100%; }
.design-input-panel .form-group .input, .design-input-panel .form-group textarea.input { width: 100%; box-sizing: border-box; }
.vz-mode-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.vz-mode-tabs .chip { flex: 1; justify-content: center; }
.notice-overlay { position: fixed; inset: 0; z-index: 9999; background: rgba(0,0,0,0.55); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 20px; }
.notice-content { background: #1b2030; border: 1px solid rgba(255,255,255,0.12); border-radius: 16px; max-width: 460px; width: 100%; box-shadow: 0 24px 60px rgba(0,0,0,0.5); overflow: hidden; animation: popScaleIn .3s ease; }
@keyframes popScaleIn { from { opacity: 0; transform: scale(.94) translateY(10px); } to { opacity: 1; transform: scale(1); } }
.notice-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.notice-header h3 { margin: 0; font-size: 15px; color: #fff; }
.notice-close { background: none; border: none; color: #94a3b8; font-size: 20px; cursor: pointer; line-height: 1; }
.notice-close:hover { color: #fff; }
.notice-body { padding: 16px 18px; font-size: 13px; line-height: 1.7; color: #cbd5e1; }
.notice-body p { margin: 0; }
.notice-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 18px 16px; border-top: 1px solid rgba(255,255,255,0.08); }
.notice-check { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #94a3b8; cursor: pointer; }
.notice-check input { accent-color: #2563eb; }
/* __CANVAS_BTN_V2__ */
.wf-head-actions .wf-node-run { margin-right: 100px; }
.wf-node-del { color: #fff !important; background: rgba(239,68,68,0.28); border: 1px solid rgba(239,68,68,0.7); border-radius: 5px; width: 20px; height: 20px; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; }
.wf-node-del:hover { background: rgba(239,68,68,0.9); }
.wf-hint-pop.flash { animation: wfBlink 0.9s ease-in-out infinite; }
.wf-hint-pop:not(.flash) { animation: wfBlink 1.1s ease-in-out infinite; }
.ref-slot.ref-slot-active { border-color: #4f8cff !important; box-shadow: 0 0 0 2px rgba(79,140,255,0.45) !important; }
/* __DESIGN_V2__ */
.design-mode-btns { display: flex; gap: 10px; }
.design-mode-btn { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 8px; border: 1px solid var(--soft-line); border-radius: 10px; background: transparent; color: var(--text-secondary); cursor: pointer; transition: all .15s; }
.design-mode-btn b { font-size: 14px; }
.design-mode-btn span { font-size: 11px; color: var(--text-muted); }
.design-mode-btn.active { background: rgba(37,99,235,0.12); border-color: #2563eb; color: #fff; }
.design-mode-btn.active span { color: rgba(255,255,255,0.7); }
.panel-title .panel-sub { font-size: 12px; color: var(--text-muted); font-weight: 400; }
.ref-link { cursor: pointer; color: #4f8cff; font-size: 13px; }
.ref-link:hover { text-decoration: underline; }
.quick-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.qt-tag { padding: 6px 12px; border: 1px solid var(--soft-line); border-radius: 16px; background: transparent; color: var(--text-secondary); font-size: 12px; cursor: pointer; transition: all .15s; }
.qt-tag:hover { border-color: #4f8cff; color: #fff; }
.qt-tag.add { color: #2cdc76; border-color: rgba(44,220,118,0.5); }
.wf-empty-slogan { font-size: 30px; font-weight: 700; color: rgba(255,255,255,0.75); letter-spacing: 3px; text-shadow: 0 0 30px rgba(79,140,255,0.45); text-align: center; }

/* ============ 大师兄AI 深色科技风 · 统一强化 ============ */
body.theme-dark {
  background: radial-gradient(1200px 620px at 50% -12%, rgba(37,99,235,0.24), transparent 60%), radial-gradient(900px 500px at 100% 100%, rgba(29,78,216,0.16), transparent 60%), #0e1322;
}
/* 毛玻璃顶栏 */
body.theme-dark .topbar {
  background: rgba(13,18,32,0.72);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  box-shadow: 0 4px 24px rgba(0,0,0,0.35);
}
/* 主按钮：蓝色渐变（#2563eb -> #1d4ed8） */
.btn-primary { background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%); box-shadow: 0 6px 18px rgba(59,130,246,0.35); }
.btn-primary:hover { filter: brightness(1.1); transform: translateY(-1px); box-shadow: 0 8px 22px rgba(59,130,246,0.45); }
/* 深色卡片 + 16px 圆角 */
.panel, .modal, .result-card, .history-item, .ly-item, .home-card, .chat-box, .home-chat-reply, .ha-opts { border-radius: 16px; }
.panel, .result-card, .history-item, .ly-item, .home-card, .modal { background: var(--panel); border-color: rgba(255,255,255,0.08); }
.result-card img { background: #10141f; }
body.theme-dark .home-card:hover { border-color: var(--accent); box-shadow: 0 14px 34px rgba(59,130,246,0.30); }
/* 输入框与选择器深色化 */
.input, textarea.input, select.input { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.12); color: var(--text); }
.input::placeholder { color: var(--text-muted); }
select.input option { background: #161c2e; color: var(--text); }
/* 工作流画布深色网格 */
body.theme-dark .wf-canvas { background-color: #0a0e18;1px, transparent 1px); }
/* 弹窗遮罩 */
.modal-mask { background: rgba(2,6,23,0.72); }
/* 滚动条 */
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.16); }



/* ============ 覆盖为大师兄AI浅色紫色风格 ============ */
:root {
  color-scheme: light;
  --bg: #f0f2f8;
  --panel: #ffffff;
  --card: #ffffff;
  --soft-line: #e8eaf0;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --text: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --accent: #6366f1;
  --accent-strong: #7c3aed;
  --accent-soft: #eef2ff;
  --shadow: 0 4px 20px rgba(99,102,241,0.08);
}
body {
  background: #f0f2f8 !important;
  color: #1e293b !important;
}
body.theme-dark {
  background: #f0f2f8 !important;
  color: #1e293b !important;
}
/* 顶栏白色 */
.topbar {
  background: #ffffff !important;
  border-bottom: 1px solid #e8eaf0 !important;
  backdrop-filter: none !important;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04) !important;
}
body.theme-dark .topbar {
  background: #ffffff !important;
  border-bottom: 1px solid #e8eaf0 !important;
}
.logo-text { color: #1e293b !important; }
.logo-sub { color: #94a3b8 !important; }
.nav-btn { color: #475569 !important; }
.nav-btn:hover { background: #f1f5f9 !important; color: #1e293b !important; }
.nav-btn.active { background: #eef2ff !important; color: #6366f1 !important; }
body.theme-dark .nav-btn { color: #475569 !important; }
body.theme-dark .nav-btn:hover { background: #f1f5f9 !important; color: #1e293b !important; }
body.theme-dark .nav-btn.active { background: #eef2ff !important; color: #6366f1 !important; }
/* 积分框 */
.balance-box {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
}
.balance-label { color: #94a3b8 !important; }
.balance-value { color: #6366f1 !important; }
body.theme-dark .balance-box { background: #f8fafc !important; border-color: #e2e8f0 !important; }
body.theme-dark .balance-value { color: #6366f1 !important; }
/* 按钮紫色渐变 */
.btn-primary {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%) !important;
  box-shadow: 0 4px 14px rgba(99,102,241,0.3) !important;
}
.btn-primary:hover { filter: brightness(1.05) !important; }
.btn-ghost {
  background: #ffffff !important;
  color: #475569 !important;
  border: 1px solid #e2e8f0 !important;
}
.btn-ghost:hover { background: #f8fafc !important; color: #1e293b !important; }
body.theme-dark .btn-ghost { background: #ffffff !important; color: #475569 !important; border-color: #e2e8f0 !important; }
body.theme-dark .btn-ghost:hover { background: #f8fafc !important; color: #1e293b !important; }
/* 卡片白色 */
.panel, .modal, .result-card, .history-item, .ly-item, .home-card, .chat-box, .home-chat-reply, .ha-opts {
  background: #ffffff !important;
  border: 1px solid #e8eaf0 !important;
  box-shadow: 0 4px 20px rgba(99,102,241,0.06) !important;
}
.panel-title, .modal h3, .home-card-body h3, .history-item h4 { color: #1e293b !important; }
.panel-desc, .field-tip, .home-card-body p, .home-card-arrow, .home-desc, .hist-meta, .hist-time, .ly-text { color: #94a3b8 !important; }
body.theme-dark .panel, body.theme-dark .modal, body.theme-dark .result-card, body.theme-dark .history-item, body.theme-dark .ly-item, body.theme-dark .home-card, body.theme-dark .chat-box, body.theme-dark .home-chat-reply {
  background: #ffffff !important;
  border-color: #e8eaf0 !important;
}
body.theme-dark .home-card:hover { border-color: #6366f1 !important; box-shadow: 0 8px 24px rgba(99,102,241,0.15) !important; }
body.theme-dark .panel-desc, body.theme-dark .field-tip, body.theme-dark .home-card-body p, body.theme-dark .home-desc { color: #94a3b8 !important; }
/* 输入框 */
.input, textarea.input, select.input {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  color: #1e293b !important;
}
.input:focus, textarea:focus { border-color: #6366f1 !important; box-shadow: 0 0 0 3px rgba(99,102,241,0.1) !important; }
.input::placeholder { color: #94a3b8 !important; }
select.input option { background: #ffffff !important; color: #1e293b !important; }
body.theme-dark .input, body.theme-dark textarea.input, body.theme-dark select.input {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  color: #1e293b !important;
}
body.theme-dark .input::placeholder { color: #94a3b8 !important; }
body.theme-dark select.input option { background: #ffffff !important; color: #1e293b !important; }
/* chips */
.chip {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  color: #475569 !important;
}
.chip:hover { border-color: #6366f1 !important; color: #6366f1 !important; }
.chip.active { background: #eef2ff !important; border-color: #6366f1 !important; color: #6366f1 !important; }
body.theme-dark .chip { background: #ffffff !important; border-color: #e2e8f0 !important; color: #475569 !important; }
body.theme-dark .chip.active { background: #eef2ff !important; border-color: #6366f1 !important; color: #6366f1 !important; }
/* mode-item */
.mode-item {
  background: #ffffff !important;
  border: 1px solid #e8eaf0 !important;
  color: #475569 !important;
}
.mode-item:hover { border-color: #6366f1 !important; color: #6366f1 !important; }
.mode-item.active { background: #eef2ff !important; border-color: #6366f1 !important; color: #6366f1 !important; }
body.theme-dark .mode-item { background: #ffffff !important; border-color: #e8eaf0 !important; color: #475569 !important; }
body.theme-dark .mode-item.active { background: #eef2ff !important; border-color: #6366f1 !important; color: #6366f1 !important; }
/* 首页标题 */
.home-title { color: #1e293b !important; }
.home-hero-glow { background: radial-gradient(closest-side, rgba(99,102,241,0.15), transparent 70%) !important; }
.home-card-icon {
  background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
  box-shadow: 0 4px 12px rgba(99,102,241,0.25) !important;
}
/* 首页搜索框 */
.home-search {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 8px 30px rgba(99,102,241,0.1) !important;
}
.home-search .input { color: #1e293b !important; }
.home-search-icon {
  background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
}
.ha-opts {
  background: #ffffff !important;
  border: 1px solid #e8eaf0 !important;
}
.ha-label { color: #94a3b8 !important; }
/* ref-slot */
.ref-slot {
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
  color: #94a3b8 !important;
}
/* 弹窗 */
.modal-mask { background: rgba(15,23,42,0.4) !important; }
.modal { background: #ffffff !important; }
.modal-desc { color: #94a3b8 !important; }
body.theme-dark .modal { background: #ffffff !important; }
/* 聊天 */
.chat-msg.bot { background: #f8fafc !important; border-color: #e2e8f0 !important; color: #1e293b !important; }
.chat-msg.user { background: linear-gradient(135deg, #6366f1, #8b5cf6) !important; }
body.theme-dark .chat-box { background: #ffffff !important; border-color: #e8eaf0 !important; }
body.theme-dark .chat-msg.bot { background: #f8fafc !important; color: #1e293b !important; }
/* 滚动条 */
::-webkit-scrollbar-thumb { background: #cbd5e1 !important; }
/* 画布区域保持深色（设计稿预览区） */
.canvas-wrap { background: #f8fafc !important; border-color: #e2e8f0 !important; }
.canvas-tip { color: #94a3b8 !important; }
.canvas-toolbar { color: #475569 !important; }
body.theme-dark .canvas-wrap { background: #f8fafc !important; }
body.theme-dark .canvas-toolbar { color: #475569 !important; }
/* 工作流画布保持深色 */
.wf-canvas { background-color: #12121b !important;1px, transparent 1px) !important; }
.wf-node { background: #1e2330 !important; border-color: #2a2f3d !important; color: #e5e7eb !important; box-shadow: 0 4px 16px rgba(0,0,0,0.3) !important; }
.wf-node-head { border-bottom-color: #2a2f3d !important; color: #9ca3af !important; }
.wf-title { color: #9ca3af !important; }
.wf-empty-tip { color: #6b7280 !important; }
body.theme-dark .wf-canvas { background-color: #12121b !important;1px, transparent 1px) !important; }
body.theme-dark .wf-node { background: #1e2330 !important; border-color: #2a2f3d !important; color: #e5e7eb !important; }
body.theme-dark .wf-node-head { border-bottom-color: #2a2f3d !important; }
body.theme-dark .wf-title, body.theme-dark .wf-empty-tip { color: #9ca3af !important; }
/* 状态文字 */
.status-text { color: #475569 !important; }
.price-note { color: #94a3b8 !important; }
.price-note b { color: #6366f1 !important; }
.form-group label { color: #475569 !important; }
.hint { color: #94a3b8 !important; }
.check { color: #475569 !important; }
body.theme-dark .status-text { color: #475569 !important; }
body.theme-dark .price-note { color: #94a3b8 !important; }
body.theme-dark .price-note b { color: #6366f1 !important; }
/* result-card img */
.result-card img { background: #f1f5f9 !important; }
body.theme-dark .result-card img { background: #f1f5f9 !important; }
/* 个人中心 */
.profile-balance { background: #eef2ff !important; }
.profile-balance span { color: #475569 !important; }
.profile-balance b { color: #6366f1 !important; }
.profile-row b { color: #1e293b !important; }
.profile-row p { color: #94a3b8 !important; }
.ly-item h4 { color: #6366f1 !important; }
body.theme-dark .profile-balance { background: #eef2ff !important; }
body.theme-dark .profile-balance b { color: #6366f1 !important; }
/* mode-footer-card */
.mode-footer-card {
  background: linear-gradient(135deg, rgba(99,102,241,0.08) 0%, rgba(255,255,255,0.95) 100%) !important;
  border-color: #e8eaf0 !important;
}
.mode-footer-card:hover { border-color: #6366f1 !important; box-shadow: 0 8px 20px rgba(99,102,241,0.12) !important; }
.mode-footer-icon { background: #eef2ff !important; }
.mode-footer-card b { color: #1e293b !important; }
.mode-footer-card p { color: #94a3b8 !important; }
.mode-manual {
  background: #eef2ff !important;
  border-color: #6366f1 !important;
  color: #6366f1 !important;
}
.mode-manual:hover { background: #e0e7ff !important; }
/* 首页结果区 */
.result-empty { color: #94a3b8 !important; border-color: #e2e8f0 !important; }
.history-empty { color: #94a3b8 !important; }
.help-content h3 { color: #6366f1 !important; }
.help-content p { color: #475569 !important; }
.help-content b { color: #1e293b !important; }
.sub-title { color: #1e293b !important; border-top-color: #e8eaf0 !important; }

/* 导航栏一行显示 */
.main-nav { gap: 0px !important; flex-wrap: nowrap !important; }
.nav-btn { min-height: 32px !important; padding: 0 10px !important; font-size: 13px !important; }
.topbar { padding: 0 16px !important; gap: 10px !important; }
.topbar-left { gap: 12px !important; }
.logo-mark { width: 36px !important; height: 36px !important; }
.logo-text { font-size: 15px !important; }
.logo-sub { font-size: 10px !important; }
.balance-box { padding: 5px 8px 5px 12px !important; gap: 8px !important; }
.balance-value { font-size: 13px !important; }

/* ============ 最终修正：深色主题 + 固定预览 + 卡密充值 ============ */

/* --- 恢复深色主题（覆盖之前的浅色） --- */
:root {
  color-scheme: dark !important;
  --bg: #0e1322 !important;
  --panel: #161c2e !important;
  --card: #1a2133 !important;
  --soft-line: rgba(255,255,255,0.07) !important;
  --line: rgba(255,255,255,0.10) !important;
  --text: #e9edf5 !important;
  --text-secondary: #b7c2d6 !important;
  --text-muted: #7d8aa6 !important;
  --accent: #6366f1 !important;
  --accent-strong: #8b5cf6 !important;
  --accent-soft: rgba(99,102,241,0.16) !important;
  --shadow: 0 8px 24px rgba(0,0,0,0.45) !important;
}
body {
  background: radial-gradient(1200px 620px at 50% -12%, rgba(99,102,241,0.18), transparent 60%), radial-gradient(900px 500px at 100% 100%, rgba(139,92,246,0.12), transparent 60%), #0e1322 !important;
  color: #e9edf5 !important;
}
body.theme-dark {
  background: radial-gradient(1200px 620px at 50% -12%, rgba(99,102,241,0.18), transparent 60%), radial-gradient(900px 500px at 100% 100%, rgba(139,92,246,0.12), transparent 60%), #0e1322 !important;
  color: #e9edf5 !important;
}
/* 顶栏深色毛玻璃 */
.topbar {
  background: rgba(13,18,32,0.85) !important;
  border-bottom: 1px solid rgba(255,255,255,0.08) !important;
  backdrop-filter: blur(12px) !important;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3) !important;
}
body.theme-dark .topbar {
  background: rgba(13,18,32,0.85) !important;
  border-bottom: 1px solid rgba(255,255,255,0.08) !important;
}
.logo-text { color: #e9edf5 !important; }
.logo-sub { color: #7d8aa6 !important; }
.nav-btn { color: #b7c2d6 !important; }
.nav-btn:hover { background: rgba(255,255,255,0.06) !important; color: #e9edf5 !important; }
.nav-btn.active { background: rgba(99,102,241,0.16) !important; color: #a78bfa !important; }
body.theme-dark .nav-btn { color: #b7c2d6 !important; }
body.theme-dark .nav-btn:hover { background: rgba(255,255,255,0.06) !important; color: #e9edf5 !important; }
body.theme-dark .nav-btn.active { background: rgba(99,102,241,0.16) !important; color: #a78bfa !important; }
/* 积分框 */
.balance-box { background: rgba(255,255,255,0.06) !important; border: 1px solid rgba(255,255,255,0.1) !important; }
.balance-label { color: #7d8aa6 !important; }
.balance-value { color: #a78bfa !important; }
body.theme-dark .balance-box { background: rgba(255,255,255,0.06) !important; border-color: rgba(255,255,255,0.1) !important; }
body.theme-dark .balance-value { color: #a78bfa !important; }
/* 按钮紫色渐变 */
.btn-primary {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%) !important;
  box-shadow: 0 4px 14px rgba(99,102,241,0.35) !important;
  color: #fff !important;
}
.btn-primary:hover { filter: brightness(1.1) !important; }
.btn-primary:disabled { opacity: 0.4 !important; cursor: not-allowed !important; }
.btn-ghost {
  background: rgba(255,255,255,0.05) !important;
  color: #b7c2d6 !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
}
.btn-ghost:hover { background: rgba(255,255,255,0.1) !important; color: #e9edf5 !important; }
body.theme-dark .btn-ghost { background: rgba(255,255,255,0.05) !important; color: #b7c2d6 !important; border-color: rgba(255,255,255,0.12) !important; }
body.theme-dark .btn-ghost:hover { background: rgba(255,255,255,0.1) !important; color: #e9edf5 !important; }
/* 卡片深色 */
.panel, .modal, .result-card, .history-item, .ly-item, .home-card, .chat-box, .home-chat-reply, .ha-opts {
  background: #161c2e !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3) !important;
}
.panel-title, .modal h3, .home-card-body h3, .history-item h4 { color: #e9edf5 !important; }
.panel-desc, .field-tip, .home-card-body p, .home-card-arrow, .home-desc, .hist-meta, .hist-time, .ly-text { color: #7d8aa6 !important; }
body.theme-dark .panel, body.theme-dark .modal, body.theme-dark .result-card, body.theme-dark .history-item, body.theme-dark .ly-item, body.theme-dark .home-card, body.theme-dark .chat-box, body.theme-dark .home-chat-reply {
  background: #161c2e !important;
  border-color: rgba(255,255,255,0.08) !important;
}
body.theme-dark .home-card:hover { border-color: #6366f1 !important; box-shadow: 0 8px 24px rgba(99,102,241,0.2) !important; }
body.theme-dark .panel-desc, body.theme-dark .field-tip, body.theme-dark .home-card-body p, body.theme-dark .home-desc { color: #7d8aa6 !important; }
/* 输入框深色 */
.input, textarea.input, select.input {
  background: rgba(255,255,255,0.05) !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  color: #e9edf5 !important;
}
.input:focus, textarea:focus { border-color: #6366f1 !important; box-shadow: 0 0 0 3px rgba(99,102,241,0.15) !important; }
.input::placeholder { color: #7d8aa6 !important; }
select.input option { background: #161c2e !important; color: #e9edf5 !important; }
body.theme-dark .input, body.theme-dark textarea.input, body.theme-dark select.input {
  background: rgba(255,255,255,0.05) !important;
  border-color: rgba(255,255,255,0.12) !important;
  color: #e9edf5 !important;
}
body.theme-dark .input::placeholder { color: #7d8aa6 !important; }
body.theme-dark select.input option { background: #161c2e !important; color: #e9edf5 !important; }
/* chips */
.chip { background: rgba(255,255,255,0.05) !important; border: 1px solid rgba(255,255,255,0.12) !important; color: #b7c2d6 !important; }
.chip:hover { border-color: #6366f1 !important; color: #a78bfa !important; }
.chip.active { background: rgba(99,102,241,0.16) !important; border-color: #6366f1 !important; color: #a78bfa !important; }
body.theme-dark .chip { background: rgba(255,255,255,0.05) !important; border-color: rgba(255,255,255,0.12) !important; color: #b7c2d6 !important; }
body.theme-dark .chip.active { background: rgba(99,102,241,0.16) !important; border-color: #6366f1 !important; color: #a78bfa !important; }
/* mode-item */
.mode-item { background: rgba(255,255,255,0.05) !important; border: 1px solid rgba(255,255,255,0.08) !important; color: #b7c2d6 !important; }
.mode-item:hover { border-color: #6366f1 !important; color: #a78bfa !important; }
.mode-item.active { background: rgba(99,102,241,0.16) !important; border-color: #6366f1 !important; color: #a78bfa !important; }
body.theme-dark .mode-item { background: rgba(255,255,255,0.05) !important; border-color: rgba(255,255,255,0.08) !important; color: #b7c2d6 !important; }
body.theme-dark .mode-item.active { background: rgba(99,102,241,0.16) !important; border-color: #6366f1 !important; color: #a78bfa !important; }
/* 首页 */
.home-title { color: #e9edf5 !important; }
.home-hero-glow { background: radial-gradient(closest-side, rgba(99,102,241,0.2), transparent 70%) !important; }
.home-card-icon { background: linear-gradient(135deg, #6366f1, #8b5cf6) !important; box-shadow: 0 4px 12px rgba(99,102,241,0.3) !important; }
.home-search { background: rgba(255,255,255,0.06) !important; border: 1px solid rgba(255,255,255,0.12) !important; box-shadow: 0 8px 30px rgba(0,0,0,0.3) !important; }
.home-search .input { color: #e9edf5 !important; }
.home-search-icon { background: linear-gradient(135deg, #6366f1, #8b5cf6) !important; }
.ha-opts { background: rgba(255,255,255,0.04) !important; border: 1px solid rgba(255,255,255,0.08) !important; }
.ha-label { color: #7d8aa6 !important; }
/* ref-slot */
.ref-slot { background: rgba(255,255,255,0.04) !important; border-color: rgba(255,255,255,0.15) !important; color: #7d8aa6 !important; }
/* 弹窗 */
.modal-mask { background: rgba(2,6,23,0.7) !important; }
.modal { background: #161c2e !important; }
.modal-desc { color: #7d8aa6 !important; }
body.theme-dark .modal { background: #161c2e !important; }
/* 聊天 */
.chat-msg.bot { background: #1a2133 !important; border-color: rgba(255,255,255,0.08) !important; color: #e9edf5 !important; }
.chat-msg.user { background: linear-gradient(135deg, #6366f1, #8b5cf6) !important; }
body.theme-dark .chat-box { background: #161c2e !important; border-color: rgba(255,255,255,0.08) !important; }
body.theme-dark .chat-msg.bot { background: #1a2133 !important; color: #e9edf5 !important; }
/* 滚动条 */
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.16) !important; }
/* 状态文字 */
.status-text { color: #b7c2d6 !important; }
.price-note { color: #7d8aa6 !important; }
.price-note b { color: #a78bfa !important; }
.form-group label { color: #b7c2d6 !important; }
.hint { color: #7d8aa6 !important; }
.check { color: #b7c2d6 !important; }
body.theme-dark .status-text { color: #b7c2d6 !important; }
body.theme-dark .price-note { color: #7d8aa6 !important; }
body.theme-dark .price-note b { color: #a78bfa !important; }
.result-card img { background: #0b0f1a !important; }
body.theme-dark .result-card img { background: #0b0f1a !important; }
/* 个人中心 */
.profile-balance { background: rgba(99,102,241,0.12) !important; }
.profile-balance span { color: #b7c2d6 !important; }
.profile-balance b { color: #a78bfa !important; }
.profile-row b { color: #e9edf5 !important; }
.profile-row p { color: #7d8aa6 !important; }
.ly-item h4 { color: #a78bfa !important; }
body.theme-dark .profile-balance { background: rgba(99,102,241,0.12) !important; }
body.theme-dark .profile-balance b { color: #a78bfa !important; }
/* mode-footer-card */
.mode-footer-card { background: linear-gradient(135deg, rgba(99,102,241,0.1) 0%, rgba(255,255,255,0.03) 100%) !important; border-color: rgba(255,255,255,0.08) !important; }
.mode-footer-card:hover { border-color: #6366f1 !important; box-shadow: 0 8px 20px rgba(99,102,241,0.15) !important; }
.mode-footer-icon { background: rgba(99,102,241,0.16) !important; }
.mode-footer-card b { color: #e9edf5 !important; }
.mode-footer-card p { color: #7d8aa6 !important; }
.mode-manual { background: rgba(99,102,241,0.1) !important; border-color: #6366f1 !important; color: #a78bfa !important; }
.mode-manual:hover { background: rgba(99,102,241,0.16) !important; }
.result-empty { color: #7d8aa6 !important; border-color: rgba(255,255,255,0.15) !important; }
.history-empty { color: #7d8aa6 !important; }
.help-content h3 { color: #a78bfa !important; }
.help-content p { color: #b7c2d6 !important; }
.help-content b { color: #e9edf5 !important; }
.sub-title { color: #e9edf5 !important; border-top-color: rgba(255,255,255,0.08) !important; }
.canvas-toolbar { color: #b7c2d6 !important; }
body.theme-dark .canvas-toolbar { color: #b7c2d6 !important; }

/* --- 矢量排版：固定预览区（不可缩放平移） --- */
.preview-panel { display: flex !important; flex-direction: column !important; }
.preview-header {
  display: flex !important; align-items: center !important; justify-content: space-between !important;
  margin-bottom: 12px !important;
}
.preview-title { font-size: 15px !important; font-weight: 700 !important; color: #e9edf5 !important; }
.preview-status {
  font-size: 12px !important; padding: 4px 10px !important; border-radius: 999px !important;
  background: rgba(99,102,241,0.15) !important; color: #a78bfa !important; font-weight: 600 !important;
}
.preview-area {
  flex: 1 !important;
  background: rgba(255,255,255,0.03) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 12px !important;
  padding: 16px !important;
  display: flex !important; align-items: center !important; justify-content: center !important;
  overflow: hidden !important;
  min-height: 400px !important;
  max-height: 65vh !important;
}
.preview-area svg {
  max-width: 100% !important;
  max-height: 100% !important;
  width: auto !important;
  height: auto !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4) !important;
  pointer-events: none !important; /* 禁止SVG内交互 */
}
.preview-actions { margin-top: 12px !important; }
.preview-actions .btn-primary { padding: 12px !important; font-size: 15px !important; }

/* 隐藏旧的画布提示 */
.canvas-tip { display: none !important; }

/* --- 充值弹窗卡密模式 --- */
.recharge-mascot img { width: 56px !important; height: 56px !important; border-radius: 14px !important; object-fit: cover !important; }
#rechargeModal .modal { text-align: center !important; }
#rechargeModal .form-group { text-align: left !important; }
#rechargeModal .modal-actions { justify-content: center !important; }

/* ============ 登录/注册按钮（右上角） ============ */
.btn-login-register {
  display: flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: none; border-radius: 20px;
  padding: 7px 16px; cursor: pointer;
  color: #fff; font-size: 14px; font-weight: 600;
  transition: all .2s;
  box-shadow: 0 2px 10px rgba(99,102,241,0.3);
}
.btn-login-register:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(99,102,241,0.4);
}
.btn-login-register .login-icon { font-size: 16px; }
.btn-login-register .login-badge {
  background: rgba(255,255,255,0.2);
  padding: 2px 8px; border-radius: 10px;
  font-size: 11px; font-weight: 500;
}

/* ============ 用户下拉菜单（大师兄风格） ============ */
.user-menu-wrap { position: relative; }
.user-menu-trigger {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px; padding: 5px 14px 5px 5px; cursor: pointer; color: #fff;
  transition: background .2s;
}
.user-menu-trigger:hover { background: rgba(255,255,255,0.12); }
.user-avatar-sm {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff;
}
.user-balance { font-size: 14px; font-weight: 600; color: #4ade80; }

.user-popover {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 100;
  width: 260px; background: #fff; border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.25); overflow: hidden;
  color: #1f2937;
}
.user-popover-head {
  display: flex; align-items: center; gap: 12px; padding: 16px;
  border-bottom: 1px solid #f3f4f6;
}
.user-popover-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.user-popover-info b { font-size: 15px; display: block; }
.user-popover-info p { font-size: 12px; color: #6b7280; margin: 2px 0 0; }

.user-popover-balance {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: #f9fafb; border-bottom: 1px solid #f3f4f6;
}
.user-popover-balance span { font-size: 13px; color: #6b7280; }
.user-popover-balance b { font-size: 16px; color: #16a34a; font-weight: 700; }

.user-popover-menu { display: flex; flex-direction: column; }
.user-popover-menu a {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; font-size: 14px; color: #374151;
  text-decoration: none; cursor: pointer; transition: background .15s;
}
.user-popover-menu a:hover { background: #f3f4f6; }
.user-popover-menu a::before {
  content: ''; width: 18px; height: 18px; flex-shrink: 0;
  background-size: contain; background-repeat: no-repeat; opacity: 0.6;
}
.user-popover-menu #menuRecharge::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z'/%3E%3C/svg%3E"); }
.user-popover-menu #menuCopyLink::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1'/%3E%3C/svg%3E"); }
.user-popover-menu #menuActivation::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z'/%3E%3C/svg%3E"); }
.user-popover-menu #menuProfile::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z'/%3E%3C/svg%3E"); }
.user-popover-menu #menuHistory::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z'/%3E%3C/svg%3E"); }
.user-popover-menu #menuHelp::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z'/%3E%3C/svg%3E"); }
.user-popover-menu .user-logout { color: #ef4444; border-top: 1px solid #f3f4f6; }
.user-popover-menu .user-logout::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23ef4444'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1'/%3E%3C/svg%3E"); }

/* 强制无限画布深色背景 */
body.canvas-mode .wf-canvas {
  background-color: #12121b !important;1px, transparent 1px) !important;!important;
}
body.canvas-mode .wf-viewport {
  background: transparent !important;
}

/* ============ 大师兄风格个人中心 ============ */
.dsx-profile-wrap { max-width: 900px; margin: 0 auto; padding: 20px; display: flex; flex-direction: column; gap: 20px; }
.dsx-profile-top { display: grid; grid-template-columns: 1fr 1.5fr; gap: 20px; }
.dsx-card-title { font-size: 16px; font-weight: 600; color: #1f2937; margin: 0 0 16px; }
.dsx-info-card { padding: 24px; }
.dsx-info-row { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; font-size: 14px; }
.dsx-info-label { color: #6b7280; min-width: 70px; }
.dsx-info-value { color: #1f2937; font-weight: 500; flex: 1; }
.dsx-recharge-card { padding: 24px; }
.dsx-activation-input {
  width: 100%; padding: 12px 14px; border: 1px solid #e5e7eb; border-radius: 10px;
  font-size: 14px; resize: vertical; background: #f9fafb; color: #374151;
  font-family: inherit; line-height: 1.6; margin-bottom: 14px;
}
.dsx-activation-input:focus { outline: none; border-color: #6366f1; background: #fff; }
.dsx-recharge-btns { display: flex; gap: 10px; margin-bottom: 10px; }
.dsx-recharge-btns .btn { flex: 1; padding: 10px 16px; font-size: 14px; border-radius: 8px; border: none; cursor: pointer; font-weight: 500; }
.btn-buy { background: linear-gradient(135deg, #f97316, #ec4899); color: #fff; }
.btn-buy:hover { opacity: 0.9; }
.btn-copy-link { background: #fff; color: #374151; border: 1px solid #e5e7eb !important; }
.btn-copy-link:hover { background: #f9fafb; }
.btn-verify { background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; }
.btn-verify:hover { opacity: 0.9; }
.dsx-recharge-tip { font-size: 12px; color: #9ca3af; margin: 8px 0 0; }

/* 微信支付套餐 */
.dsx-recharge-packages {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.dsx-package {
  position: relative;
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.dsx-package:hover {
  border-color: #6366f1;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}
.dsx-package.active {
  border-color: #6366f1;
  background: linear-gradient(135deg, #eef2ff, #e0e7ff);
}
.dsx-package-hot {
  border-color: #f97316;
}
.dsx-package-hot:hover {
  border-color: #f97316;
}
.dsx-package-hot.active {
  border-color: #f97316;
  background: linear-gradient(135deg, #fff7ed, #ffedd5);
}
.dsx-package-tag {
  position: absolute;
  top: -8px;
  right: 8px;
  background: linear-gradient(135deg, #f97316, #ec4899);
  color: #fff;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 8px;
  font-weight: 600;
}
.dsx-package-price {
  font-size: 24px;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 4px;
}
.dsx-package-points {
  font-size: 14px;
  font-weight: 600;
  color: #6366f1;
  margin-bottom: 4px;
}
.dsx-package-desc {
  font-size: 11px;
  color: #9ca3af;
}
.dsx-recharge-tip p {
  margin: 4px 0;
  font-size: 12px;
  color: #6b7280;
}

/* 微信支付弹窗 */
.wechat-pay-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}
.wechat-pay-box {
  background: #fff;
  border-radius: 16px;
  padding: 30px;
  width: 360px;
  text-align: center;
  position: relative;
}
.wechat-pay-close {
  position: absolute;
  top: 12px; right: 16px;
  background: none; border: none;
  font-size: 24px; color: #9ca3af;
  cursor: pointer;
}
.wechat-pay-title {
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 8px;
}
.wechat-pay-amount {
  font-size: 32px;
  font-weight: 700;
  color: #07c160;
  margin-bottom: 20px;
}
.wechat-pay-qrcode {
  width: 200px;
  height: 200px;
  margin: 0 auto 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f9fafb;
}
.wechat-pay-qrcode img {
  width: 100%;
  height: 100%;
  border-radius: 8px;
}
.wechat-pay-tip {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 16px;
}
.wechat-pay-status {
  font-size: 14px;
  color: #07c160;
  font-weight: 500;
}
.wechat-pay-btn {
  background: #07c160;
  color: #fff;
  border: none;
  padding: 10px 32px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  margin-top: 12px;
}
.wechat-pay-btn:hover { opacity: 0.9; }

/* 充值页面 */
.recharge-page-wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 30px 20px;
}
.recharge-header {
  text-align: center;
  margin-bottom: 30px;
}
.recharge-header h2 {
  font-size: 28px;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 8px;
}
.recharge-header p {
  font-size: 14px;
  color: #6b7280;
  margin: 0 0 16px;
}
.recharge-balance {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  padding: 10px 24px;
  border-radius: 24px;
  font-size: 14px;
  color: #92400e;
}
.recharge-balance b {
  font-size: 18px;
  font-weight: 700;
  color: #d97706;
}
.recharge-packages-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 30px;
}
.recharge-package-card {
  position: relative;
  background: #fff;
  border: 2px solid #e5e7eb;
  border-radius: 16px;
  padding: 24px 16px;
  text-align: center;
  transition: all 0.2s ease;
  cursor: pointer;
}
.recharge-package-card:hover {
  border-color: #6366f1;
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15);
}
.recharge-package-card.pkg-hot {
  border-color: #f97316;
  background: linear-gradient(135deg, #fff7ed, #ffedd5);
}
.recharge-package-card.pkg-hot:hover {
  border-color: #f97316;
  box-shadow: 0 8px 24px rgba(249, 115, 22, 0.2);
}
.pkg-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #f97316, #ec4899);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 12px;
  border-radius: 10px;
}
.pkg-header {
  margin-bottom: 12px;
}
.pkg-price {
  font-size: 32px;
  font-weight: 700;
  color: #1f2937;
  line-height: 1.2;
}
.pkg-points {
  font-size: 16px;
  font-weight: 600;
  color: #6366f1;
  margin-top: 4px;
}
.pkg-hot .pkg-points {
  color: #f97316;
}
.pkg-desc {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 4px;
}
.pkg-tip {
  font-size: 12px;
  color: #9ca3af;
  margin-bottom: 16px;
}
.pkg-btn {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}
.pkg-hot .pkg-btn {
  background: linear-gradient(135deg, #f97316, #ec4899);
}
.pkg-btn:hover {
  opacity: 0.9;
}
.recharge-notice {
  text-align: center;
  padding: 20px;
  border-top: 1px solid #e5e7eb;
  margin-top: 10px;
}
.recharge-notice p {
  margin: 6px 0;
  font-size: 13px;
  color: #9ca3af;
  line-height: 1.6;
}
.recharge-notice b {
  color: #6b7280;
  font-weight: 600;
}

@media (max-width: 768px) {
  .recharge-packages-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.dsx-notice-card { padding: 20px 24px; }
.dsx-notice-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.dsx-notice-icon { width: 24px; height: 24px; border-radius: 50%; background: #e0e7ff; color: #4f46e5; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.dsx-notice-content { font-size: 13px; color: #4b5563; line-height: 1.8; }
.dsx-notice-content h4 { margin: 14px 0 6px; color: #1f2937; font-size: 14px; }
.dsx-notice-content p { margin: 4px 0; }
.dsx-notice-warn { margin-top: 14px !important; padding: 10px 12px; background: #fef3c7; border-radius: 6px; color: #92400e !important; font-size: 12px !important; }

.dsx-ledger-card { padding: 20px 24px; background: linear-gradient(135deg, #eef2ff, #f5f3ff) !important; }
.dsx-ledger-head { display: flex; align-items: center; gap: 14px; }
.dsx-ledger-icon { width: 44px; height: 44px; border-radius: 12px; background: linear-gradient(135deg, #6366f1, #8b5cf6); display: flex; align-items: center; justify-content: center; font-size: 20px; color: #fff; }
.dsx-ledger-desc { font-size: 12px; color: #6b7280; margin: 2px 0 0; }
.dsx-ledger-head .btn { margin-left: auto; }

.dsx-history-section { margin-top: 10px; }
.dsx-history-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.dsx-history-head h3 { font-size: 16px; font-weight: 600; color: #1f2937; margin: 0; }
.dsx-history-sub { font-size: 13px; color: #9ca3af; font-weight: 400; }
.dsx-history-tabs { display: flex; gap: 20px; }
.dsx-history-tab { background: none; border: none; font-size: 14px; color: #6b7280; cursor: pointer; padding: 4px 0; border-bottom: 2px solid transparent; }
.dsx-history-tab.active { color: #1f2937; font-weight: 600; border-bottom-color: #1f2937; }
.dsx-history-list { display: flex; flex-direction: column; gap: 10px; }
.dsx-history-item {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
}
.dsx-history-order { font-size: 12px; color: #9ca3af; font-family: monospace; }
.dsx-history-status { font-size: 11px; padding: 2px 8px; border-radius: 4px; background: #dcfce7; color: #16a34a; }
.dsx-history-time { font-size: 12px; color: #6b7280; }
.dsx-history-type { font-size: 12px; color: #6366f1; }
.dsx-history-points { font-size: 12px; color: #f97316; }
.dsx-history-prompt { flex: 1; font-size: 13px; color: #374151; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 400px; }
.dsx-history-actions { display: flex; gap: 8px; }
.dsx-history-actions .btn { padding: 5px 12px; font-size: 12px; border-radius: 6px; }

/* 深色主题下个人中心 */
body.theme-dark .dsx-card-title { color: #e5e7eb; }
body.theme-dark .dsx-info-value { color: #e5e7eb; }
body.theme-dark .dsx-info-label { color: #9ca3af; }
body.theme-dark .dsx-activation-input { background: #1f2937; border-color: #374151; color: #d1d5db; }
body.theme-dark .dsx-activation-input:focus { background: #111827; }
body.theme-dark .btn-copy-link { background: #1f2937; color: #d1d5db; border-color: #374151 !important; }
body.theme-dark .dsx-recharge-tip { color: #6b7280; }
body.theme-dark .dsx-notice-content { color: #9ca3af; }
body.theme-dark .dsx-notice-content h4 { color: #e5e7eb; }
body.theme-dark .dsx-ledger-card { background: linear-gradient(135deg, #1e1b4b, #2e1065) !important; }
body.theme-dark .dsx-ledger-desc { color: #9ca3af; }
body.theme-dark .dsx-history-head h3 { color: #e5e7eb; }
body.theme-dark .dsx-history-tab { color: #9ca3af; }
body.theme-dark .dsx-history-tab.active { color: #e5e7eb; border-bottom-color: #e5e7eb; }
body.theme-dark .dsx-history-item { background: #1f2937; border-color: #374151; }
body.theme-dark .dsx-history-prompt { color: #d1d5db; }

/* ============ 生图模式列表 ============ */
.mode-list {
  max-height: 420px; overflow-y: auto; display: grid;
  grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0;
}
.mode-item {
  padding: 16px 12px; border: 1px solid var(--soft-line); border-radius: 10px;
  cursor: pointer; transition: all .15s; background: var(--card); text-align: center;
  min-height: 50px; display: flex; align-items: center; justify-content: center;
}
.mode-item:hover { border-color: #6366f1; background: rgba(99,102,241,0.08); }
.mode-item.active { border-color: #1a1d29; background: #1a1d29; color: #fff; }
.mode-item.active .mode-name { color: #fff; }
.mode-item.active .mode-remark { color: rgba(255,255,255,0.6); }
.mode-name { font-size: 16px; font-weight: 600; color: var(--text); line-height: 1.4; }
.mode-remark { font-size: 13px; color: var(--text-muted); margin-top: 4px; line-height: 1.4; }
.mode-manual {
  width: 100%; padding: 8px 12px; margin-bottom: 8px;
  background: transparent; border: 1px dashed var(--soft-line); border-radius: 8px;
  color: var(--text-muted); cursor: pointer; font-size: 13px;
}
.mode-manual:hover { border-color: #6366f1; color: #6366f1; }

/* 参考图提示 */
.ref-tip { float: right; font-size: 11px; color: var(--text-muted); }
.form-group label { display: inline-block; }

/* ============ 浅色主题 ============ */
body.light {
  color-scheme: light;
  --bg: #f0f2f5;
  --panel: #ffffff;
  --card: #ffffff;
  --soft-line: rgba(0,0,0,0.06);
  --line: rgba(0,0,0,0.10);
  --line-strong: rgba(0,0,0,0.16);
  --text: #1a202c;
  --text-secondary: #4a5568;
  --text-muted: #718096;
  --shadow: 0 4px 12px rgba(0,0,0,0.08);
  background: linear-gradient(135deg, #f0f2f5 0%, #e8ecf1 100%) !important;
}
body.light .main-nav { background: rgba(255,255,255,0.9) !important; border-bottom: 1px solid var(--line); }
body.light .nav-btn { color: var(--text-secondary); }
body.light .nav-btn:hover { color: var(--text); background: var(--soft-line); }
body.light .nav-btn.active { background: var(--accent); color: #fff; }
body.light .panel { background: var(--panel) !important; border: 1px solid var(--line) !important; box-shadow: var(--shadow) !important; }
body.light .input, body.light textarea, body.light select { background: #f7f8fa !important; border-color: var(--line) !important; color: var(--text) !important; }
body.light .btn-ghost { background: transparent; border-color: var(--line); color: var(--text-secondary); }
body.light .btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
body.light .chip { background: #f0f2f5; color: var(--text-secondary); border-color: var(--line); }
body.light .chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }
body.light .mode-item { background: #f7f8fa; border-color: var(--line); }
body.light .mode-item:hover { border-color: var(--accent); background: rgba(37,99,235,0.05); }
body.light .mode-item.active { background: #1a202c; color: #fff; border-color: #1a202c; }
body.light .mode-item.active .mode-name { color: #fff; }
body.light .mode-item.active .mode-remark { color: rgba(255,255,255,0.6); }
body.light .ref-slot { background: #f7f8fa; border-color: var(--line); }
body.light .home-card { background: var(--card); border-color: var(--line); }
body.light .home-card:hover { border-color: var(--accent); }
body.light .wf-node { background: #fff !important; border-color: #e2e8f0 !important; color: #1a202c !important; box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important; }
body.light .wf-node-head { border-bottom-color: #e2e8f0 !important; color: #64748b !important; }
body.light .wf-lib-item { background: #fff !important; border-color: #e2e8f0 !important; color: #1a202c !important; }
body.light .wf-canvas { background-color: #f0f2f5 !important;1px, transparent 1px) !important; }
body.light .dsx-profile-card, body.light .dsx-recharge-card, body.light .dsx-notice-card { background: #fff !important; border-color: #e2e8f0 !important; }
body.light .dsx-input, body.light .dsx-textarea { background: #f7f8fa !important; border-color: #e2e8f0 !important; color: #1a202c !important; }
body.light .user-menu { background: #fff !important; border-color: #e2e8f0 !important; }
body.light .user-menu-item { color: #1a202c !important; }
body.light .user-menu-item:hover { background: #f0f2f5 !important; }
body.light .user-menu-divider { border-color: #e2e8f0 !important; }
body.light .history-item { background: #fff; border-color: #e2e8f0; }
body.light .ledger-item { background: #f7f8fa; border-color: #e2e8f0; }
body.light .dsx-history-item { background: #f7f8fa; border-color: #e2e8f0; }
body.light .quick-tags .qt-tag { background: #f0f2f5; color: #4a5568; border-color: #e2e8f0; }
body.light .quick-tags .qt-tag:hover { border-color: var(--accent); color: var(--accent); }
body.light .design-mode-btn { background: #f7f8fa; border-color: #e2e8f0; color: #1a202c; }
body.light .design-mode-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
body.light .np-chip { background: #f0f2f5; color: #4a5568; }
body.light .np-chip.active { background: var(--accent); color: #fff; }
body.light .np-select { background: #f7f8fa; border-color: #e2e8f0; color: #1a202c; }
body.light .wf-dropzone { background: #f7f8fa; border-color: #e2e8f0; color: #64748b; }
body.light .preview-area { background: #f7f8fa; }
body.light .result-empty { color: #94a3b8; }
body.light .field-tip { color: #94a3b8; }
body.light .hint { color: #94a3b8; }
body.light .status-text { color: #64748b; }
body.light .price-note { color: #64748b; }
body.light .form-group label { color: #4a5568; }
body.light .wf-tab { color: #64748b; }
body.light .wf-tab.active { color: #1a202c; background: #fff; border-color: #e2e8f0; }
body.light .wf-bottom-bar { background: rgba(255,255,255,0.95) !important; border-color: #e2e8f0 !important; }
body.light .wf-lib-tool { background: #fff; border-color: #e2e8f0; color: #1a202c; }

/* 主题切换按钮 */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--card); border: 1px solid var(--line);
  color: var(--text); cursor: pointer; font-size: 16px;
  transition: all .2s; margin-right: 8px;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); transform: rotate(15deg); }

/* 顶部充值按钮 */
.top-recharge-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 36px;
  padding: 0 16px;
  border: none;
  border-radius: 18px;
  background: linear-gradient(135deg, #f97316, #ec4899);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  margin-right: 8px;
}
.top-recharge-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

/* 浅色主题补充修复 */
body.light .home-title { color: #1a202c !important; }
body.light .home-desc { color: #4a5568 !important; }
body.light .home-card { background: #fff !important; border-color: #e2e8f0 !important; }
body.light .home-card-body h3 { color: #1a202c !important; }
body.light .home-card-body p { color: #718096 !important; }
body.light .home-search { background: #fff !important; border-color: #e2e8f0 !important; }
body.light .home-search .input { color: #1a202c !important; }
body.light .home-chat { background: #fff !important; border-color: #e2e8f0 !important; }
body.light .chat-msg { color: #1a202c !important; }
body.light .chat-msg.user { background: #ebf4ff !important; color: #1a202c !important; }
body.light .chat-msg.ai { background: #f7f8fa !important; color: #1a202c !important; }
body.light .panel-title { color: #1a202c !important; }
body.light .panel-desc { color: #718096 !important; }
body.light .design-layout .preview-panel { background: #fff !important; border-color: #e2e8f0 !important; }
body.light .gen2-results-col { background: #fff !important; border-color: #e2e8f0 !important; }
body.light .result-grid .result-card { background: #f7f8fa !important; border-color: #e2e8f0 !important; }
body.light .modal { background: #fff !important; color: #1a202c !important; }
body.light .modal-mask { background: rgba(0,0,0,0.5) !important; }
body.light .help-content h3 { color: #1a202c !important; }
body.light .help-content p { color: #4a5568 !important; }
body.light .settings-panel { background: #fff !important; border-color: #e2e8f0 !important; }
body.light .recharge-panel { background: #fff !important; border-color: #e2e8f0 !important; }

/* 节点线路状态 */
.np-status-row { margin-top: 4px; }
.np-line-status { font-size: 11px; display: inline-flex; align-items: center; gap: 4px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.status-ok { background: #22c55e; box-shadow: 0 0 6px rgba(34,197,94,0.5); }
.status-busy { background: #f59e0b; box-shadow: 0 0 6px rgba(245,158,11,0.5); }
.status-down { background: #ef4444; box-shadow: 0 0 6px rgba(239,68,68,0.5); }

/* ============ 浅色主题全面修复 ============ */
body.light .topbar {
  background: rgba(255,255,255,0.95) !important;
  border-bottom: 1px solid #e2e8f0 !important;
}
body.light .logo-text { color: #1a202c !important; }
body.light .logo-sub { color: #718096 !important; }
body.light .nav-btn { color: #4a5568 !important; }
body.light .nav-btn:hover { background: #f0f2f5 !important; color: #1a202c !important; }
body.light .nav-btn.active { background: #ebf4ff !important; color: #2563eb !important; }
body.light .theme-toggle { background: #fff !important; border-color: #e2e8f0 !important; color: #1a202c !important; }

/* 无限画布浅色主题 */
body.light .wf-canvas {
  background-color: #f0f2f5 !important;1px, transparent 1px) !important;
}
body.light .wf-left { background: #fff !important; border-right: 1px solid #e2e8f0 !important; }
body.light .wf-title { color: #4a5568 !important; }
body.light .wf-lib-item {
  background: #fff !important; border: 1px solid #e2e8f0 !important; color: #1a202c !important;
}
body.light .wf-lib-item:hover { border-color: #2563eb !important; background: #f7faff !important; }
body.light .wf-node {
  background: #fff !important; border: 1px solid #e2e8f0 !important; color: #1a202c !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
}
body.light .wf-node-head { border-bottom-color: #e2e8f0 !important; color: #64748b !important; }
body.light .wf-node-panel { background: #f7f8fa !important; border-color: #e2e8f0 !important; }
body.light .np-label { color: #64748b !important; }
body.light .np-select { background: #fff !important; border-color: #e2e8f0 !important; color: #1a202c !important; }
body.light .np-chip { background: #fff !important; border-color: #e2e8f0 !important; color: #4a5568 !important; }
body.light .np-chip.active { background: #2563eb !important; color: #fff !important; }
body.light .np-cost { color: #64748b !important; }
body.light .np-cost b { color: #1a202c !important; }
body.light .wf-toolbar { background: #fff !important; border-bottom: 1px solid #e2e8f0 !important; }
body.light .wf-tab { color: #64748b !important; }
body.light .wf-tab.active { color: #1a202c !important; background: #f0f2f5 !important; border-color: #e2e8f0 !important; }
body.light .wf-status { background: rgba(34,197,94,0.1) !important; color: #16a34a !important; }
body.light .wf-bottom-bar {
  background: rgba(255,255,255,0.95) !important; border-color: #e2e8f0 !important;
}
body.light .wf-empty-tip { color: #94a3b8 !important; }
body.light .wf-dropzone { background: #f7f8fa !important; border-color: #e2e8f0 !important; color: #64748b !important; }
body.light .wf-lib-tool { background: #fff !important; border-color: #e2e8f0 !important; color: #1a202c !important; }

/* 按钮浅色主题 */
body.light .btn-primary { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important; color: #fff !important; }
body.light .btn-ghost { background: #fff !important; border-color: #e2e8f0 !important; color: #4a5568 !important; }
body.light .btn-ghost:hover { border-color: #2563eb !important; color: #2563eb !important; }
body.light .wf-node .btn { background: #f0f2f5 !important; color: #1a202c !important; border: 1px solid #e2e8f0 !important; }
body.light .wf-node .btn:hover { background: #e2e8f0 !important; }

/* 预览区浅色主题 */
body.light .preview-area { background: #f7f8fa !important; }
body.light .preview-header { border-bottom-color: #e2e8f0 !important; }
body.light .preview-title { color: #1a202c !important; }
body.light .preview-status { color: #64748b !important; }

/* 结果区浅色主题 */
body.light .result-empty { color: #94a3b8 !important; }
body.light .result-card { background: #fff !important; border-color: #e2e8f0 !important; }

/* 表单浅色主题 */
body.light .form-group label { color: #4a5568 !important; }
body.light .hint { color: #94a3b8 !important; }
body.light .field-tip { color: #94a3b8 !important; }
body.light .status-text { color: #64748b !important; }
body.light .price-note { color: #64748b !important; }
body.light .price-note b { color: #2563eb !important; }

/* 首页浅色主题 */
body.light .home-search { background: #fff !important; border-color: #e2e8f0 !important; }
body.light .home-search .input { color: #1a202c !important; }
body.light .home-chat { background: #fff !important; border-color: #e2e8f0 !important; }
body.light .chat-msg { color: #1a202c !important; }
body.light .chat-msg.user { background: #ebf4ff !important; }
body.light .chat-msg.ai { background: #f7f8fa !important; }
body.light .ha-opts { background: #fff !important; border-color: #e2e8f0 !important; }

/* 个人中心浅色主题 */
body.light .dsx-profile-card, body.light .dsx-recharge-card, body.light .dsx-notice-card {
  background: #fff !important; border-color: #e2e8f0 !important;
}
body.light .dsx-info-label { color: #64748b !important; }
body.light .dsx-info-value { color: #1a202c !important; }
body.light .dsx-input, body.light .dsx-textarea { background: #f7f8fa !important; border-color: #e2e8f0 !important; color: #1a202c !important; }
body.light .dsx-history-item { background: #f7f8fa !important; border-color: #e2e8f0 !important; }
body.light .ledger-item { background: #f7f8fa !important; border-color: #e2e8f0 !important; }

/* 历史记录浅色主题 */
body.light .history-item { background: #fff !important; border-color: #e2e8f0 !important; }
body.light .history-item h4 { color: #1a202c !important; }
body.light .hist-meta { color: #64748b !important; }
body.light .hist-time { color: #94a3b8 !important; }

/* 用户菜单浅色主题 */
body.light .user-popover { background: #fff !important; border-color: #e2e8f0 !important; box-shadow: 0 8px 24px rgba(0,0,0,0.1) !important; }
body.light .user-popover-info b { color: #1a202c !important; }
body.light .user-popover-info p { color: #64748b !important; }
body.light .user-popover-balance { background: #f7f8fa !important; border-color: #e2e8f0 !important; }
body.light .user-popover-balance span { color: #64748b !important; }
body.light .user-popover-balance b { color: #2563eb !important; }
body.light .user-popover-menu a { color: #1a202c !important; }
body.light .user-popover-menu a:hover { background: #f0f2f5 !important; }
body.light .user-menu-divider { border-color: #e2e8f0 !important; }

/* 弹窗浅色主题 */
body.light .modal { background: #fff !important; color: #1a202c !important; }
body.light .modal h3 { color: #1a202c !important; }
body.light .modal-mask { background: rgba(0,0,0,0.5) !important; }

/* 帮助页浅色主题 */
body.light .help-content h3 { color: #1a202c !important; }
body.light .help-content p { color: #4a5568 !important; }

/* 设置页浅色主题 */
body.light .settings-panel { background: #fff !important; border-color: #e2e8f0 !important; }

/* 节点内select强制不溢出 */
.wf-node select {
  max-width: 100% !important;
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
.wf-node .np-row {
  width: 100%;
  box-sizing: border-box;
}
.wf-node .np-panel, .wf-node .wf-node-panel {
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

/* 无限画布浅色主题强制覆盖 */
body.light .wf-canvas {
  background-color: #f0f2f5 !important;1px, transparent 1px) !important;
}
body.light .wf-canvas-panel {
  background: #fff !important;
}
body.light .wf-toolbar {
  background: #fff !important;
  border-bottom: 1px solid #e2e8f0 !important;
}
body.light .wf-bottom-bar {
  background: #fff !important;
  border: 1px solid #e2e8f0 !important;
}
body.light .wf-left {
  background: #fff !important;
  border-right: 1px solid #e2e8f0 !important;
}
body.light .wf-right {
  background: #fff !important;
  border-left: 1px solid #e2e8f0 !important;
}
body.light .wf-empty-tip {
  color: #94a3b8 !important;
}
body.light .wf-node {
  background: #fff !important;
  border: 1px solid #e2e8f0 !important;
  color: #1a202c !important;
}
body.light .wf-node-head {
  color: #64748b !important;
  border-bottom-color: #e2e8f0 !important;
}
body.light .wf-node-panel {
  background: #f7f8fa !important;
  border-color: #e2e8f0 !important;
}
body.light .np-label { color: #64748b !important; }
body.light .np-select {
  background: #fff !important;
  border-color: #e2e8f0 !important;
  color: #1a202c !important;
}
body.light .np-cost { color: #64748b !important; }
body.light .np-cost b { color: #1a202c !important; }
body.light .wf-dropzone {
  background: #f7f8fa !important;
  border-color: #e2e8f0 !important;
  color: #64748b !important;
}
body.light .wf-lib-item {
  background: #fff !important;
  border-color: #e2e8f0 !important;
  color: #1a202c !important;
}
body.light .wf-lib-item:hover {
  border-color: #2563eb !important;
  background: #f7faff !important;
}
body.light .wf-title { color: #4a5568 !important; }
body.light .wf-tab { color: #64748b !important; }
body.light .wf-tab.active {
  color: #1a202c !important;
  background: #f0f2f5 !important;
  border-color: #e2e8f0 !important;
}
body.light .wf-status {
  background: rgba(34,197,94,0.1) !important;
  color: #16a34a !important;
}
body.light .wf-node .btn {
  background: #f0f2f5 !important;
  color: #1a202c !important;
  border: 1px solid #e2e8f0 !important;
}
body.light .wf-node .btn-primary {
  background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
  color: #fff !important;
  border: none !important;
}

/* ============ 无限画布 canvas-mode 浅色主题 ============ */
body.canvas-mode.light .wf-toolbar {
  background: rgba(255,255,255,0.95) !important;
  border-bottom: 1px solid #e2e8f0 !important;
}
body.canvas-mode.light .wf-toolbar .wf-tab {
  color: #4a5568 !important;
}
body.canvas-mode.light .wf-toolbar .wf-tab.active {
  color: #1a202c !important;
  background: #f0f2f5 !important;
  border-color: #e2e8f0 !important;
}
body.canvas-mode.light .wf-status {
  background: rgba(34,197,94,0.1) !important;
  color: #16a34a !important;
}
body.canvas-mode.light .wf-canvas {
  background-color: #f0f2f5 !important;1px, transparent 1px) !important;
}
body.canvas-mode.light .wf-left {
  background: rgba(255,255,255,0.95) !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08) !important;
}
body.canvas-mode.light .wf-left:hover {
  background: rgba(255,255,255,0.98) !important;
}
body.canvas-mode.light .wf-left .wf-title {
  color: #4a5568 !important;
}
body.canvas-mode.light .wf-left .wf-lib-item {
  background: #fff !important;
  border: 1px solid #e2e8f0 !important;
  color: #1a202c !important;
}
body.canvas-mode.light .wf-left .wf-lib-item:hover {
  border-color: #2563eb !important;
  background: #f7faff !important;
}
body.canvas-mode.light .wf-left .wf-sub {
  color: #4a5568 !important;
  border-bottom-color: #e2e8f0 !important;
}
body.canvas-mode.light .wf-left .wf-left-drag {
  color: #94a3b8 !important;
}
body.canvas-mode.light .wf-bottom-bar {
  background: rgba(255,255,255,0.95) !important;
  border: 1px solid #e2e8f0 !important;
}
body.canvas-mode.light .wf-empty-tip {
  color: #94a3b8 !important;
}
body.canvas-mode.light .wf-node {
  background: #fff !important;
  border: 1px solid #e2e8f0 !important;
  color: #1a202c !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08) !important;
}
body.canvas-mode.light .wf-node-head {
  border-bottom-color: #e2e8f0 !important;
  color: #64748b !important;
}
body.canvas-mode.light .wf-node-panel {
  background: #f7f8fa !important;
  border-color: #e2e8f0 !important;
}
body.canvas-mode.light .np-label { color: #64748b !important; }
body.canvas-mode.light .np-select {
  background: #fff !important;
  border-color: #e2e8f0 !important;
  color: #1a202c !important;
}
body.canvas-mode.light .np-chip {
  background: #fff !important;
  border-color: #e2e8f0 !important;
  color: #4a5568 !important;
}
body.canvas-mode.light .np-chip.active {
  background: #2563eb !important;
  color: #fff !important;
}
body.canvas-mode.light .np-cost { color: #64748b !important; }
body.canvas-mode.light .np-cost b { color: #1a202c !important; }
body.canvas-mode.light .wf-dropzone {
  background: #f7f8fa !important;
  border-color: #e2e8f0 !important;
  color: #64748b !important;
}
body.canvas-mode.light .wf-node .btn {
  background: #f0f2f5 !important;
  color: #1a202c !important;
  border: 1px solid #e2e8f0 !important;
}
body.canvas-mode.light .wf-node .btn-primary {
  background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
  color: #fff !important;
  border: none !important;
}
body.canvas-mode.light .wf-node .btn-ghost {
  background: #fff !important;
  color: #4a5568 !important;
  border: 1px solid #e2e8f0 !important;
}

/* 左侧工具栏文字颜色修复 */
.wf-left-collapse {
  color: #94a3b8 !important;
  background: transparent !important;
  border: none !important;
  font-size: 12px !important;
  cursor: pointer !important;
  padding: 2px 6px !important;
  border-radius: 4px !important;
}
.wf-left-collapse:hover {
  color: #2563eb !important;
  background: rgba(37,99,235,0.08) !important;
}
.wf-left .wf-title {
  color: #e2e8f0 !important;
  font-size: 14px !important;
  font-weight: 600 !important;
}
.wf-left .wf-title .hint {
  color: #64748b !important;
  font-size: 11px !important;
  font-weight: 400 !important;
}
.wf-left-drag {
  color: #475569 !important;
  font-size: 14px !important;
  letter-spacing: 2px !important;
}
.wf-hint-pop {
  color: #2563eb !important;
  font-size: 12px !important;
  font-weight: 600 !important;
}
.wf-sub {
  color: #94a3b8 !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  border-bottom: 1px solid rgba(255,255,255,0.06) !important;
  padding-bottom: 6px !important;
  margin-bottom: 8px !important;
}
.wf-lib-item {
  color: #cbd5e1 !important;
  background: rgba(255,255,255,0.04) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
}
.wf-lib-item:hover {
  color: #fff !important;
  border-color: #2563eb !important;
  background: rgba(37,99,235,0.15) !important;
}
.wf-lib-item .lib-ico {
  color: #60a5fa !important;
}

/* 浅色主题下左侧工具栏文字 */
body.light .wf-left-collapse { color: #64748b !important; }
body.light .wf-left-collapse:hover { color: #2563eb !important; background: rgba(37,99,235,0.08) !important; }
body.light .wf-left .wf-title { color: #1a202c !important; }
body.light .wf-left .wf-title .hint { color: #94a3b8 !important; }
body.light .wf-left-drag { color: #cbd5e1 !important; }
body.light .wf-sub { color: #4a5568 !important; border-bottom-color: #e2e8f0 !important; }
body.light .wf-lib-item { color: #1a202c !important; background: #fff !important; border-color: #e2e8f0 !important; }
body.light .wf-lib-item:hover { color: #2563eb !important; border-color: #2563eb !important; background: #f7faff !important; }
body.light .wf-lib-item .lib-ico { color: #2563eb !important; }

/* 节点内运行按钮修复 */
.wf-node .btn-run {
  background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
  color: #fff !important;
  border: none !important;
  font-weight: 600 !important;
}
.wf-node .btn-run:hover {
  filter: brightness(1.1) !important;
}
body.light .wf-node .btn-run {
  background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
  color: #fff !important;
}

/* 节点内所有按钮统一修复 */
.wf-node button {
  color: inherit !important;
}
.wf-node .btn {
  color: #e2e8f0 !important;
  background: rgba(255,255,255,0.08) !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
}
.wf-node .btn:hover {
  background: rgba(255,255,255,0.15) !important;
  color: #fff !important;
}
body.light .wf-node .btn {
  color: #1a202c !important;
  background: #f0f2f5 !important;
  border: 1px solid #e2e8f0 !important;
}
body.light .wf-node .btn:hover {
  background: #e2e8f0 !important;
  color: #1a202c !important;
}

/* ============ 浅色主题强制覆盖（最高优先级） ============ */
body.light .wf-canvas {
  background-color: #f0f2f5 !important;1px, transparent 1px) !important;
  border-color: #e2e8f0 !important;
}
body.light .wf-toolbar {
  background: rgba(255,255,255,0.95) !important;
  border-bottom: 1px solid #e2e8f0 !important;
}
body.light .wf-toolbar .wf-tab {
  color: #4a5568 !important;
}
body.light .wf-toolbar .wf-tab.active {
  color: #1a202c !important;
  background: #f0f2f5 !important;
  border-color: #e2e8f0 !important;
}
body.light .wf-status {
  background: rgba(34,197,94,0.1) !important;
  color: #16a34a !important;
}
body.light .wf-left {
  background: rgba(255,255,255,0.95) !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08) !important;
}
body.light .wf-left:hover {
  background: rgba(255,255,255,0.98) !important;
}
body.light .wf-bottom-bar {
  background: rgba(255,255,255,0.95) !important;
  border: 1px solid #e2e8f0 !important;
}
body.light .wf-empty-tip {
  color: #94a3b8 !important;
}
body.light .wf-node {
  background: #fff !important;
  border: 1px solid #e2e8f0 !important;
  color: #1a202c !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08) !important;
}
body.light .wf-node-head {
  border-bottom-color: #e2e8f0 !important;
  color: #64748b !important;
}
body.light .wf-node-panel {
  background: #f7f8fa !important;
  border-color: #e2e8f0 !important;
}
body.light .np-label { color: #64748b !important; }
body.light .np-select {
  background: #fff !important;
  border-color: #e2e8f0 !important;
  color: #1a202c !important;
}
body.light .np-chip {
  background: #fff !important;
  border-color: #e2e8f0 !important;
  color: #4a5568 !important;
}
body.light .np-chip.active {
  background: #2563eb !important;
  color: #fff !important;
}
body.light .np-cost { color: #64748b !important; }
body.light .np-cost b { color: #1a202c !important; }
body.light .wf-dropzone {
  background: #f7f8fa !important;
  border-color: #e2e8f0 !important;
  color: #64748b !important;
}
body.light .wf-node .btn {
  background: #f0f2f5 !important;
  color: #1a202c !important;
  border: 1px solid #e2e8f0 !important;
}
body.light .wf-node .btn-primary {
  background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
  color: #fff !important;
  border: none !important;
}
body.light .wf-node .btn-ghost {
  background: #fff !important;
  color: #4a5568 !important;
  border: 1px solid #e2e8f0 !important;
}
body.light .wf-left-collapse { color: #64748b !important; }
body.light .wf-left .wf-title { color: #1a202c !important; }
body.light .wf-left .wf-title .hint { color: #94a3b8 !important; }
body.light .wf-sub { color: #4a5568 !important; border-bottom-color: #e2e8f0 !important; }
body.light .wf-lib-item { color: #1a202c !important; background: #fff !important; border-color: #e2e8f0 !important; }
body.light .wf-lib-item:hover { color: #2563eb !important; border-color: #2563eb !important; background: #f7faff !important; }
body.light .wf-lib-item .lib-ico { color: #2563eb !important; }

/* ============ 浅色主题最高优先级覆盖（canvas-mode） ============ */
html body.light.canvas-mode .wf-canvas {
  background-color: #f0f2f5 !important;1px, transparent 1px) !important;
  border-color: #e2e8f0 !important;
}
html body.light.canvas-mode .wf-toolbar {
  background: rgba(255,255,255,0.95) !important;
  border-bottom: 1px solid #e2e8f0 !important;
}
html body.light.canvas-mode .wf-toolbar .wf-tab {
  color: #4a5568 !important;
}
html body.light.canvas-mode .wf-toolbar .wf-tab.active {
  color: #1a202c !important;
  background: #f0f2f5 !important;
  border-color: #e2e8f0 !important;
}
html body.light.canvas-mode .wf-status {
  background: rgba(34,197,94,0.1) !important;
  color: #16a34a !important;
}
html body.light.canvas-mode .wf-left {
  background: rgba(255,255,255,0.95) !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08) !important;
}
html body.light.canvas-mode .wf-left:hover {
  background: rgba(255,255,255,0.98) !important;
}
html body.light.canvas-mode .wf-bottom-bar {
  background: rgba(255,255,255,0.95) !important;
  border: 1px solid #e2e8f0 !important;
}
html body.light.canvas-mode .wf-empty-tip {
  color: #94a3b8 !important;
}
html body.light.canvas-mode .wf-node {
  background: #fff !important;
  border: 1px solid #e2e8f0 !important;
  color: #1a202c !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08) !important;
}
html body.light.canvas-mode .wf-node-head {
  border-bottom-color: #e2e8f0 !important;
  color: #64748b !important;
}
html body.light.canvas-mode .wf-node-panel {
  background: #f7f8fa !important;
  border-color: #e2e8f0 !important;
}
html body.light.canvas-mode .np-label { color: #64748b !important; }
html body.light.canvas-mode .np-select {
  background: #fff !important;
  border-color: #e2e8f0 !important;
  color: #1a202c !important;
}
html body.light.canvas-mode .np-chip {
  background: #fff !important;
  border-color: #e2e8f0 !important;
  color: #4a5568 !important;
}
html body.light.canvas-mode .np-chip.active {
  background: #2563eb !important;
  color: #fff !important;
}
html body.light.canvas-mode .np-cost { color: #64748b !important; }
html body.light.canvas-mode .np-cost b { color: #1a202c !important; }
html body.light.canvas-mode .wf-dropzone {
  background: #f7f8fa !important;
  border-color: #e2e8f0 !important;
  color: #64748b !important;
}
html body.light.canvas-mode .wf-node .btn {
  background: #f0f2f5 !important;
  color: #1a202c !important;
  border: 1px solid #e2e8f0 !important;
}
html body.light.canvas-mode .wf-node .btn-primary {
  background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
  color: #fff !important;
  border: none !important;
}
html body.light.canvas-mode .wf-left-collapse { color: #64748b !important; }
html body.light.canvas-mode .wf-left .wf-title { color: #1a202c !important; }
html body.light.canvas-mode .wf-left .wf-title .hint { color: #94a3b8 !important; }
html body.light.canvas-mode .wf-sub { color: #4a5568 !important; border-bottom-color: #e2e8f0 !important; }
html body.light.canvas-mode .wf-lib-item { color: #1a202c !important; background: #fff !important; border-color: #e2e8f0 !important; }
html body.light.canvas-mode .wf-lib-item:hover { color: #2563eb !important; border-color: #2563eb !important; background: #f7faff !important; }
html body.light.canvas-mode .wf-lib-item .lib-ico { color: #2563eb !important; }

/* 无限画布节点清晰度优化 */
#wfViewport {
  will-change: transform;
  transform: translateZ(0);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
.wf-node {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  backface-visibility: hidden;
  transform: translateZ(0);
}
.wf-node * {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.wf-node select, .wf-node input, .wf-node textarea, .wf-node button {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ============ 浅色主题边框优化 ============ */
body.light .ref-slot {
  border: 1px dashed #cbd5e1 !important;
  background: #f8fafc !important;
  color: #94a3b8 !important;
}
body.light .ref-slot:hover {
  border-color: #2563eb !important;
}
body.light .ref-slot-main {
  border-color: #2563eb !important;
}
body.light .mode-item {
  background: #fff !important;
  border: 1px solid #e2e8f0 !important;
  color: #4a5568 !important;
}
body.light .mode-item:hover {
  border-color: #2563eb !important;
  color: #1a202c !important;
}
body.light .mode-item.active {
  background: #eff6ff !important;
  border-color: #2563eb !important;
  color: #2563eb !important;
}
body.light .result-area {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
}
body.light .result-empty {
  color: #94a3b8 !important;
}
body.light .result-card {
  background: #fff !important;
  border: 1px solid #e2e8f0 !important;
}
body.light .gen-result-panel {
  background: #fff !important;
  border: 1px solid #e2e8f0 !important;
}
body.light .gen-input-panel {
  background: #fff !important;
  border: 1px solid #e2e8f0 !important;
}
body.light .canvas-toolbar {
  background: #fff !important;
  border-bottom: 1px solid #e2e8f0 !important;
  color: #1a202c !important;
}
body.light .upload-preview {
  border: 1px solid #e2e8f0 !important;
}
body.light .chips .chip {
  background: #fff !important;
  border: 1px solid #e2e8f0 !important;
  color: #4a5568 !important;
}
body.light .chips .chip.active {
  background: #2563eb !important;
  border-color: #2563eb !important;
  color: #fff !important;
}
body.light .input, body.light textarea.input, body.light select.input {
  background: #fff !important;
  border: 1px solid #e2e8f0 !important;
  color: #1a202c !important;
}
body.light .input:focus {
  border-color: #2563eb !important;
}
body.light .panel {
  background: #fff !important;
  border: 1px solid #e2e8f0 !important;
}
body.light .panel-title {
  color: #1a202c !important;
}
body.light .panel-desc {
  color: #64748b !important;
}
body.light .form-group label {
  color: #4a5568 !important;
}
body.light .field-tip {
  color: #94a3b8 !important;
}
body.light .price-note {
  color: #64748b !important;
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
}
body.light .status-text {
  color: #64748b !important;
}

/* ============ 无限画布交互优化 ============ */
.wf-edge.selected {
  stroke: #f59e0b !important;
  stroke-width: 3 !important;
}
.wf-edge.running {
  stroke-dasharray: 8 4;
  animation: antLine 0.6s linear infinite;
}
@keyframes antLine {
  from { stroke-dashoffset: 0; }
  to { stroke-dashoffset: -12; }
}
/* 右键菜单 */
.wf-context-menu {
  position: fixed;
  z-index: 10000;
  background: #1e1e2e;
  border: 1px solid #3a3a4e;
  border-radius: 8px;
  padding: 6px 0;
  min-width: 160px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  display: none;
}
.wf-context-menu.show { display: block; }
.wf-context-menu-item {
  padding: 8px 16px;
  color: #cdd6f4;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}
.wf-context-menu-item:hover {
  background: #313244;
  color: #fff;
}
.wf-context-menu-sep {
  height: 1px;
  background: #3a3a4e;
  margin: 4px 0;
}
/* 框选矩形 */
.wf-sel-box {
  position: absolute;
  border: 1px dashed #4f8cff;
  background: rgba(79,140,255,0.1);
  pointer-events: none;
  z-index: 999;
}
.wf-sel-box.right-btn {
  border-color: #f59e0b;
  background: rgba(245,158,11,0.1);
}

/* ============ 节点选中状态（确保优先级最高） ============ */
.wf-node.wf-selected {
  border-color: #4f8cff !important;
  border-width: 2px !important;
  box-shadow: 0 0 0 2px #4f8cff, 0 0 20px rgba(79,140,255,0.5) !important;
  background: linear-gradient(135deg, rgba(79,140,255,0.08), rgba(79,140,255,0.02)) !important;
}
body.light .wf-node.wf-selected {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 2px #2563eb, 0 0 20px rgba(37,99,235,0.4) !important;
  background: linear-gradient(135deg, rgba(37,99,235,0.06), rgba(37,99,235,0.02)) !important;
}

/* 隐藏未保存提示 */
.field-tip:contains("未保存") { display: none !important; }
.wf-left .field-tip { display: none !important; }

/* 进一步压缩左侧工具栏 */
body.canvas-mode .wf-left {
  padding: 4px 6px !important;
  max-height: calc(100vh - 70px) !important;
  overflow: hidden !important;
}
body.canvas-mode .wf-left .wf-sub {
  margin: 6px 0 3px !important;
  padding-bottom: 3px !important;
  font-size: 11.5px !important;
}
body.canvas-mode .wf-left .wf-lib-tool {
  padding: 3px 5px !important;
  font-size: 11px !important;
  margin: 1px 0 !important;
}
body.canvas-mode .wf-left .wf-lib-tools {
  margin: 4px 0 2px !important;
  gap: 3px !important;
}
body.canvas-mode .wf-left .wf-drag-hint2 {
  margin: 4px 0 2px !important;
  font-size: 10px !important;
}
body.canvas-mode .wf-left .wf-title {
  font-size: 12px !important;
}
body.canvas-mode .wf-left .wf-node-btns {
  gap: 3px !important;
}
/* 拖拽提示闪烁 */
/* ============ 快捷键说明弹窗 ============ */
.shortcut-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.shortcut-modal-mask {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}
.shortcut-modal-box {
  position: relative;
  width: 560px;
  max-height: 80vh;
  background: var(--card, #1a1f2e);
  border: 1px solid var(--soft-line, rgba(255,255,255,0.1));
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.shortcut-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--soft-line, rgba(255,255,255,0.1));
}
.shortcut-modal-head h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary, #fff);
}
.shortcut-modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text-muted, #999);
  font-size: 22px;
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.shortcut-modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary, #fff);
}
.shortcut-modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}
.shortcut-group {
  margin-bottom: 20px;
}
.shortcut-group:last-child {
  margin-bottom: 0;
}
.shortcut-group h4 {
  margin: 0 0 12px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent, #6ea8fe);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--soft-line, rgba(255,255,255,0.08));
}
.shortcut-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  gap: 16px;
}
.shortcut-keys {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.shortcut-keys kbd {
  display: inline-block;
  padding: 3px 8px;
  background: var(--bg-soft, #252b3d);
  border: 1px solid var(--soft-line, rgba(255,255,255,0.15));
  border-radius: 6px;
  font-size: 12px;
  font-family: monospace;
  color: var(--text-secondary, #ddd);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
  min-width: 24px;
  text-align: center;
}
.shortcut-desc {
  font-size: 13px;
  color: var(--text-secondary, #ccc);
  text-align: right;
  flex: 1;
}
/* 浅色主题适配 */
body.light .shortcut-modal-box {
  background: #fff;
  border-color: #e5e7eb;
}
body.light .shortcut-modal-head h3 {
  color: #1f2937;
}
body.light .shortcut-modal-close {
  color: #6b7280;
}
body.light .shortcut-modal-close:hover {
  background: #f3f4f6;
  color: #1f2937;
}
body.light .shortcut-group h4 {
  color: #3b82f6;
  border-bottom-color: #e5e7eb;
}
body.light .shortcut-keys kbd {
  background: #f9fafb;
  border-color: #d1d5db;
  color: #374151;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.1);
}
body.light .shortcut-desc {
  color: #4b5563;
}
/* ============ 图转矢量新布局（大师兄AI风格） ============ */
.vz-layout {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 120px);
  gap: 12px;
}
.vz-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--card, #1a1f2e);
  border: 1px solid var(--soft-line, rgba(255,255,255,0.1));
  border-radius: 12px;
  flex-shrink: 0;
}
.vz-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary, #fff);
  margin-right: 8px;
}
.vz-mode-tabs {
  display: flex;
  gap: 6px;
}
.vz-zoom-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.vz-zoom-level {
  font-size: 13px;
  color: var(--text-secondary, #ccc);
  min-width: 48px;
  text-align: center;
}
.vz-main {
  display: flex;
  gap: 12px;
  flex: 1;
  min-height: 0;
}
.vz-preview-area {
  flex: 1;
  background: var(--card, #1a1f2e);
  border: 1px solid var(--soft-line, rgba(255,255,255,0.1));
  border-radius: 12px;
  position: relative;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
}
.vz-upload-hint {
  text-align: center;
  padding: 40px;
  max-width: 500px;
}
.vz-upload-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary, #fff);
  margin-bottom: 12px;
}
.vz-upload-link {
  color: var(--accent, #6ea8fe);
  cursor: pointer;
  text-decoration: underline;
}
.vz-upload-desc {
  font-size: 13px;
  color: var(--text-secondary, #ccc);
  line-height: 1.7;
  margin-bottom: 16px;
}
.vz-upload-tips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.vz-tip {
  font-size: 12px;
  color: var(--text-muted, #999);
  background: rgba(255,255,255,0.06);
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--soft-line, rgba(255,255,255,0.1));
}
.vz-preview-img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: 8px;
}
.vz-result-svg {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
}
.vz-result-svg svg {
  max-width: 90%;
  max-height: 90%;
}
.vz-options-panel {
  width: 320px;
  flex-shrink: 0;
  background: var(--card, #1a1f2e);
  border: 1px solid var(--soft-line, rgba(255,255,255,0.1));
  border-radius: 12px;
  padding: 16px;
  overflow-y: auto;
}
.vz-option-group {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--soft-line, rgba(255,255,255,0.08));
}
.vz-option-group:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.vz-option-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary, #fff);
  margin-bottom: 4px;
}
.vz-option-desc {
  font-size: 12px;
  color: var(--text-muted, #999);
  margin-bottom: 10px;
}
.vz-slider-row {
  margin-top: 12px;
}
.vz-slider-row label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary, #ccc);
  margin-bottom: 6px;
}
.vz-slider-hint {
  color: var(--text-muted, #999);
  font-size: 11px;
}
.vz-slider-control {
  display: flex;
  align-items: center;
  gap: 10px;
}
.vz-slider {
  flex: 1;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
  outline: none;
}
.vz-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent, #6ea8fe);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.vz-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent, #6ea8fe);
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.vz-slider-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent, #6ea8fe);
  min-width: 28px;
  text-align: right;
}
/* 浅色主题适配 */
body.light .vz-topbar,
body.light .vz-preview-area,
body.light .vz-options-panel {
  background: #fff;
  border-color: #e5e7eb;
}
body.light .vz-title { color: #1f2937; }
body.light .vz-upload-title { color: #1f2937; }
body.light .vz-upload-desc { color: #6b7280; }
body.light .vz-tip {
  background: #f9fafb;
  border-color: #e5e7eb;
  color: #6b7280;
}
body.light .vz-option-title { color: #1f2937; }
body.light .vz-option-desc { color: #9ca3af; }
body.light .vz-slider-row label { color: #4b5563; }
body.light .vz-slider { background: #e5e7eb; }
/* ============ 矢量排版任务确认弹窗 ============ */
.design-confirm-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.design-confirm-mask {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
}
.design-confirm-box {
  position: relative;
  width: 520px;
  max-width: 90vw;
  max-height: 80vh;
  background: var(--card, #1a1f2e);
  border: 1px solid var(--soft-line, rgba(255,255,255,0.15));
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.design-confirm-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--soft-line, rgba(255,255,255,0.1));
}
.design-confirm-head h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary, #fff);
}
.design-confirm-close {
  background: none;
  border: none;
  color: var(--text-muted, #999);
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.design-confirm-close:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text-primary, #fff);
}
.design-confirm-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}
.design-confirm-row {
  margin-bottom: 14px;
  font-size: 14px;
  line-height: 1.6;
}
.design-confirm-row:last-child {
  margin-bottom: 0;
}
.dc-label {
  color: var(--text-muted, #999);
  font-weight: 600;
}
.dc-value {
  color: var(--text-primary, #fff);
  font-weight: 600;
}
.dc-desc {
  color: var(--text-secondary, #ccc);
  background: rgba(255,255,255,0.05);
  padding: 10px 12px;
  border-radius: 8px;
  margin-top: 6px;
  max-height: 120px;
  overflow-y: auto;
}
.dc-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.dc-option-tag {
  font-size: 12px;
  color: var(--accent, #6ea8fe);
  background: rgba(110,168,254,0.12);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(110,168,254,0.3);
}
.design-confirm-footer {
  display: flex;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--soft-line, rgba(255,255,255,0.1));
}
.design-confirm-footer .btn {
  flex: 1;
}
body.light .design-confirm-box {
  background: #fff;
  border-color: #e5e7eb;
}
body.light .design-confirm-head h3 { color: #1f2937; }
body.light .dc-value { color: #1f2937; }
body.light .dc-desc {
  color: #4b5563;
  background: #f9fafb;
}
/* ============ 首页参考图新布局 ============ */
.ha-top-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
  width: 100%;
}
.ha-ref-tip {
  font-size: 12px;
  color: var(--text-muted, #999);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ha-right-opts {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-shrink: 0;
}
.ha-opt-inline {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.ha-opt-inline label {
  font-size: 11px;
  color: var(--text-secondary, #ccc);
  margin-bottom: 0;
}
.ha-opt-inline .ha-sel {
  min-width: 90px;
  padding: 5px 8px;
  font-size: 12px;
}
/* 首页参考图方框间距拉大 */
.home-ref-slots {
  display: grid !important;
  grid-template-columns: repeat(6, 1fr) !important;
  gap: 24px !important;
  width: 100% !important;
  margin-top: 8px;
}
.home-ref-slots .ref-slot {
  min-height: 70px !important;
  border-width: 2px !important;
}
/* 强制首页参考图顶部行水平布局 */
#page-home .ha-top-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  width: 100% !important;
}
#page-home .ha-right-opts {
  display: flex !important;
  flex-direction: row !important;
  gap: 10px !important;
  margin-left: auto !important;
}
#page-home .ha-opt-inline {
  display: flex !important;
  flex-direction: column !important;
  gap: 3px !important;
}
/* ============ 矢量排版大师兄风格 ============ */
.design-ref-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.design-ref-row .ref-link {
  color: var(--accent, #6ea8fe);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}
.design-ref-row .ref-link:hover {
  text-decoration: underline;
}
.ref-link-desc {
  font-size: 12px;
  color: var(--text-muted, #999);
}
.model-health {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.6;
}
.health-line {
  display: block;
  color: var(--text-secondary, #ccc);
}
.health-status {
  display: block;
  color: var(--text-secondary, #ccc);
  margin-top: 2px;
}
.health-stable {
  color: #4ade80;
}
.design-action-row {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  margin-bottom: 12px;
}
.btn-design-main {
  flex: 1;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 10px;
}
.btn-beautify {
  padding: 14px 20px;
  font-size: 14px;
  border-radius: 10px;
  flex-shrink: 0;
}
.design-aux-opts {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--soft-line, rgba(255,255,255,0.1));
  border-radius: 10px;
  margin-bottom: 12px;
}
.design-aux-opts .check {
  font-size: 13px;
  color: var(--text-secondary, #ccc);
}
body.light .design-aux-opts {
  background: #f9fafb;
  border-color: #e5e7eb;
}
body.light .design-aux-opts .check {
  color: #4b5563;
}
body.light .health-line,
body.light .health-status {
  color: #6b7280;
}
body.light .ref-link-desc {
  color: #9ca3af;
}
/* ============ 交互修改页面 ============ */
.interactive-layout {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 100px);
  gap: 12px;
}
.interactive-topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 16px;
  background: var(--card, #1a1f2e);
  border: 1px solid var(--soft-line, rgba(255,255,255,0.1));
  border-radius: 12px;
  flex-shrink: 0;
}
.interactive-title h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary, #fff);
}
.interactive-title p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--text-muted, #999);
}
.interactive-tabs {
  display: flex;
  gap: 4px;
  margin-left: 20px;
}
.int-tab {
  padding: 6px 14px;
  border: 1px solid var(--soft-line, rgba(255,255,255,0.15));
  background: transparent;
  color: var(--text-secondary, #ccc);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}
.int-tab.active {
  background: var(--accent, #6ea8fe);
  color: #fff;
  border-color: var(--accent, #6ea8fe);
}
.interactive-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}
.interactive-main {
  display: flex;
  gap: 12px;
  flex: 1;
  min-height: 0;
}
.interactive-preview {
  flex: 1;
  background: var(--card, #1a1f2e);
  border: 1px solid var(--soft-line, rgba(255,255,255,0.1));
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
}
.int-layer-switch {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 10;
}
.int-layer-btn {
  padding: 6px 12px;
  border: 1px solid var(--soft-line, rgba(255,255,255,0.2));
  background: rgba(0,0,0,0.5);
  color: var(--text-secondary, #ccc);
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  white-space: nowrap;
}
.int-layer-btn.active {
  background: var(--accent, #6ea8fe);
  color: #fff;
  border-color: var(--accent, #6ea8fe);
}
.int-preview-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 300px;
  border-radius: 8px;
  overflow: hidden;
}
.int-upload-zone {
  text-align: center;
  padding: 40px;
  cursor: pointer;
  border: 2px dashed var(--soft-line, rgba(255,255,255,0.2));
  border-radius: 12px;
  transition: border-color 0.2s;
}
.int-upload-zone:hover {
  border-color: var(--accent, #6ea8fe);
}
.int-upload-icon {
  font-size: 48px;
  margin-bottom: 12px;
}
.int-upload-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary, #fff);
  margin-bottom: 4px;
}
.int-upload-hint {
  font-size: 12px;
  color: var(--text-muted, #999);
}
.int-preview-status {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-secondary, #ccc);
  text-align: center;
}
.interactive-panel {
  width: 320px;
  flex-shrink: 0;
  background: var(--card, #1a1f2e);
  border: 1px solid var(--soft-line, rgba(255,255,255,0.1));
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.interactive-panel > div {
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  padding-bottom: 20px;
}
.interactive-panel > div::-webkit-scrollbar {
  width: 6px;
}
.interactive-panel > div::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.2);
  border-radius: 3px;
}
.int-panel-tabs {
  display: flex;
  border-bottom: 1px solid var(--soft-line, rgba(255,255,255,0.1));
}
.int-panel-tab {
  flex: 1;
  padding: 12px;
  background: transparent;
  border: none;
  color: var(--text-secondary, #ccc);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}
.int-panel-tab.active {
  color: var(--accent, #6ea8fe);
  border-bottom: 2px solid var(--accent, #6ea8fe);
}
.int-panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}
.int-section {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--soft-line, rgba(255,255,255,0.08));
}
.int-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.int-section h4 {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary, #fff);
}
.int-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.int-section-header h4 {
  margin: 0;
}
.int-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.1);
  color: var(--text-muted, #999);
}
.int-info-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary, #ccc);
  margin-bottom: 6px;
}
.int-hint {
  font-size: 12px;
  color: var(--text-muted, #999);
  margin-bottom: 12px;
}
.int-prop-row {
  margin-bottom: 10px;
}
.int-prop-row label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary, #ccc);
  margin-bottom: 4px;
}
.btn-danger {
  background: #dc2626;
  color: #fff;
  border: none;
}
.interactive-bottom {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}
.int-thumb {
  flex: 1;
  background: var(--card, #1a1f2e);
  border: 1px solid var(--soft-line, rgba(255,255,255,0.1));
  border-radius: 12px;
  padding: 12px;
  min-height: 80px;
}
.int-thumb-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary, #fff);
  margin-bottom: 4px;
}
.int-thumb-status {
  font-size: 11px;
  color: var(--text-muted, #999);
}
body.light .interactive-topbar,
body.light .interactive-preview,
body.light .interactive-panel,
body.light .int-thumb {
  background: #fff;
  border-color: #e5e7eb;
}
body.light .interactive-title h2 { color: #1f2937; }
body.light .interactive-title p { color: #6b7280; }
body.light .int-tab { color: #4b5563; border-color: #d1d5db; }
body.light .int-panel-tab { color: #6b7280; }
body.light .int-section h4 { color: #1f2937; }
body.light .int-info-row { color: #4b5563; }
body.light .int-upload-text { color: #1f2937; }
body.light .int-upload-hint { color: #9ca3af; }
/* ============ 首页AI对话 ============ */
.home-chat-result {
  max-width: 800px;
  margin: 16px auto 0;
  background: var(--card, #1a1f2e);
  border: 1px solid var(--soft-line, rgba(255,255,255,0.1));
  border-radius: 12px;
  padding: 16px;
  max-height: 400px;
  overflow-y: auto;
}
.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chat-msg {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.chat-msg.user {
  flex-direction: row-reverse;
}
.chat-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #fff;
  flex-shrink: 0;
}
.chat-msg.user .chat-avatar {
  background: linear-gradient(135deg, #10b981, #059669);
}
.chat-bubble {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.6;
  word-break: break-word;
}
.chat-msg.ai .chat-bubble {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary, #fff);
  border-top-left-radius: 4px;
}
.chat-msg.user .chat-bubble {
  background: var(--accent, #6ea8fe);
  color: #fff;
  border-top-right-radius: 4px;
}
.chat-typing {
  display: inline-flex;
  gap: 4px;
  padding: 10px 14px;
}
.chat-typing span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted, #999);
  animation: typing 1.4s infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-8px); opacity: 1; }
}
body.light .home-chat-result {
  background: #fff;
  border-color: #e5e7eb;
}
body.light .chat-msg.ai .chat-bubble {
  background: #f3f4f6;
  color: #1f2937;
}

/* ============ 登录/注册弹窗 ============ */
.login-modal, .recharge-modal, .code-modal {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
}
.login-modal-mask, .recharge-modal-mask, .code-modal-mask {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
}
.login-modal-box, .recharge-modal-box, .code-modal-box {
  position: relative; z-index: 1;
  width: 400px; background: var(--panel); border-radius: 16px;
  border: 1px solid var(--line); box-shadow: var(--shadow);
  overflow: hidden;
}
.login-modal-head, .recharge-modal-head, .code-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--line);
}
.login-modal-head h3, .recharge-modal-head h3, .code-modal-head h3 {
  font-size: 18px; color: var(--text);
}
.login-modal-close, .recharge-modal-close, .code-modal-close {
  background: none; border: none; color: var(--text-muted);
  font-size: 24px; cursor: pointer; line-height: 1;
}
.login-modal-body, .recharge-modal-body, .code-modal-body {
  padding: 24px;
}
/* 登录欢迎提示 */
.login-welcome-tip {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(139,92,246,0.1));
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: 12px; padding: 14px 16px;
  margin-bottom: 20px;
}
.login-welcome-tip .welcome-icon {
  font-size: 32px;
}
.login-welcome-tip .welcome-text b {
  display: block; color: var(--text); font-size: 15px; margin-bottom: 4px;
}
.login-welcome-tip .welcome-text p {
  margin: 0; color: var(--text-secondary); font-size: 13px;
}
.login-welcome-tip .highlight {
  color: #f59e0b; font-weight: 700;
}
.login-tabs {
  display: flex; gap: 8px; margin-bottom: 20px;
  background: var(--card); padding: 4px; border-radius: 8px;
}
.login-tab {
  flex: 1; padding: 10px; background: none; border: none;
  color: var(--text-muted); border-radius: 6px; font-size: 14px;
}
.login-tab.active {
  background: var(--accent); color: #fff;
}
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block; margin-bottom: 6px; color: var(--text-secondary);
  font-size: 13px;
}
.form-group input {
  width: 100%; padding: 10px 12px; background: var(--card);
  border: 1px solid var(--line); border-radius: 8px;
  color: var(--text); font-size: 14px;
}
.form-group input:focus {
  outline: none; border-color: var(--accent);
}
.btn-block {
  width: 100%; padding: 12px; font-size: 15px;
}
.login-tip {
  text-align: center; margin-top: 12px; color: var(--text-muted);
  font-size: 12px;
}

/* ============ 充值弹窗 ============ */
.recharge-packages {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.recharge-package {
  padding: 16px; background: var(--card); border: 2px solid var(--line);
  border-radius: 12px; cursor: pointer; text-align: center;
  transition: all 0.2s;
}
.recharge-package:hover {
  border-color: var(--accent);
}
.recharge-package.selected {
  border-color: var(--accent); background: var(--accent-soft);
}
.recharge-package .pkg-name {
  font-size: 15px; font-weight: 600; color: var(--text);
  margin-bottom: 4px;
}
.recharge-package .pkg-points {
  font-size: 20px; color: var(--accent-strong); font-weight: 700;
}
.recharge-package .pkg-price {
  font-size: 13px; color: var(--text-muted); margin-top: 4px;
}
.recharge-qrcode {
  text-align: center; padding: 20px 0;
}
.recharge-qrcode img {
  width: 200px; height: 200px; border-radius: 8px;
  background: #fff; padding: 10px;
}
.recharge-qrcode p {
  margin-top: 12px; color: var(--text-secondary);
}
.recharge-status {
  color: var(--accent-strong); font-weight: 600;
}

/* ============ 比例预览小方框 ============ */
.ratio-preview-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}
.ratio-preview-box {
  width: 60px;
  height: 60px;
  border: 2px solid var(--accent);
  border-radius: 4px;
  background: rgba(37,99,235,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}
.ratio-preview-inner {
  background: rgba(37,99,235,0.3);
  border-radius: 2px;
  transition: all 0.3s ease;
}
.ratio-preview-label {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.ratio-preview-label b {
  color: var(--accent-strong);
  font-size: 14px;
}

/* ============ 生成计时器 ============ */
.gen-timer {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 10px;
  padding: 2px 10px;
  background: rgba(37,99,235,0.15);
  border-radius: 12px;
  font-size: 13px;
  color: var(--accent-strong);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.gen-timer::before {
  content: '⏱';
  font-size: 14px;
}
.gen-timer.done {
  background: rgba(22,163,74,0.15);
  color: #4ade80;
}
.gen-timer.done::before {
  content: '✓';
}

/* ============ 全屏图片预览 ============ */
.image-preview-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.image-preview-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(4px);
}
.image-preview-container {
  position: relative;
  z-index: 1;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.image-preview-wrapper {
  max-width: 85vw;
  max-height: 75vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}
.image-preview-img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  transition: transform 0.2s ease;
  cursor: grab;
  user-select: none;
}
.image-preview-img:active {
  cursor: grabbing;
}
.image-preview-close {
  position: absolute;
  top: -40px;
  right: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.image-preview-close:hover {
  background: rgba(255, 255, 255, 0.2);
}
.image-preview-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  font-size: 32px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 2;
}
.image-preview-nav:hover {
  background: rgba(255, 255, 255, 0.2);
}
.image-preview-prev {
  left: -60px;
}
.image-preview-next {
  right: -60px;
}
.image-preview-toolbar {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.08);
  padding: 8px 16px;
  border-radius: 24px;
}
.image-preview-counter {
  color: #fff;
  font-size: 14px;
  min-width: 60px;
  text-align: center;
}
.image-preview-tool {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  padding: 6px 14px;
  border-radius: 16px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
}
.image-preview-tool:hover {
  background: rgba(255, 255, 255, 0.2);
}
.image-preview-download {
  background: #2563eb;
}
.image-preview-download:hover {
  background: #1d4ed8;
}



/* ============ 新手引导 ============ */
.onboarding-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.onboarding-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
}
.onboarding-container {
  position: relative;
  z-index: 1;
  width: 90%;
  max-width: 560px;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.onboarding-header {
  text-align: center;
  margin-bottom: 24px;
}
.onboarding-header h2 {
  color: #fff;
  font-size: 24px;
  margin: 0 0 8px 0;
}
.onboarding-subtitle {
  color: #94a3b8;
  font-size: 14px;
  margin: 0;
}
.onboarding-steps {
  position: relative;
  min-height: 180px;
  margin-bottom: 24px;
}
.onboarding-step {
  display: none;
  text-align: center;
  animation: fadeIn 0.3s ease;
}
.onboarding-step.active {
  display: block;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.onboarding-icon {
  font-size: 48px;
  margin-bottom: 16px;
}
.onboarding-step h3 {
  color: #22d3ee;
  font-size: 20px;
  margin: 0 0 12px 0;
}
.onboarding-step p {
  color: #cbd5e1;
  font-size: 14px;
  line-height: 1.8;
  margin: 0;
}
.onboarding-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}
.onboarding-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transition: all 0.3s;
}
.onboarding-dot.active {
  background: #22d3ee;
  width: 24px;
  border-radius: 4px;
}
.onboarding-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.onboarding-actions .btn {
  flex: 1;
}

/* 强制去掉画布点阵背景 */
.wf-canvas, body.canvas-mode .wf-canvas {
  background-image: none !important;
}



/* 拖拽节点期间禁用画布鼠标事件，防止误触发框选 */
body.wf-dragging-node .wf-canvas,
body.wf-dragging-node #wfCanvas,
body.wf-dragging-node .wf-viewport {
  pointer-events: none !important;
  user-select: none !important;
}
body.wf-dragging-node {
  user-select: none !important;
}


/* 最高优先级：强制去掉无限画布所有点阵背景 */
html body .wf-canvas,
html body.theme-dark .wf-canvas,
html body.canvas-mode .wf-canvas,
html body.light .wf-canvas {
  background-image: none !important;
  background-size: auto !important;
}


/* ============ 右下角缩略图导航（参考图匠PIC AI） ============ */

/* 运行按钮样式 */
.wf-run-btn {
  background: linear-gradient(135deg, #22d3ee, #06b6d4) !important;
  color: #fff !important;
  font-weight: 600 !important;
  border: none !important;
  box-shadow: 0 2px 8px rgba(34, 211, 238, 0.3) !important;
}
.wf-run-btn:hover {
  background: linear-gradient(135deg, #06b6d4, #0891b2) !important;
  box-shadow: 0 4px 12px rgba(34, 211, 238, 0.4) !important;
}


/* 无限画布节点图片优化 - 缩放时保持清晰 */
.wf-node img {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  -webkit-user-drag: none;
  user-select: none;
}

.wf-node {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.wf-node-head, .wf-node-panel, .wf-node-body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
