/* === 主题变量 === */
:root {
  --bg-page: #0f0f0f;
  --bg-card: #1a1a2e;
  --bg-nested: #16213e;
  --bg-input: #0f0f0f;
  --bg-hover: #222;
  --text-primary: #e0e0e0;
  --text-secondary: #ccc;
  --text-muted: #999;
  --text-dim: #666;
  --text-faint: #555;
  --text-placeholder: #444;
  --border: #333;
  --border-hover: #555;
  --divider: #222;
  --scrollbar: #333;
  --dragover-bg: rgba(102,126,234,0.05);
  --active-check-inset: #16213e;
  --accent: #667eea;
  --accent-deep: #764ba2;
  --btn-cancel-bg: #333;
  --btn-cancel-text: #888;
}

/* === 品牌视觉 token（登录页/品牌页固定暗色用；将来全站可复用。详见 CLAUDE.md「品牌视觉规范」）=== */
:root {
  --ink: #0c0a0f;
  --ink-deep: #06050a;
  --ivory: #f3ece0;
  --ivory-dim: rgba(243,236,224,0.66);
  --ivory-faint: rgba(243,236,224,0.40);
  --line: rgba(243,236,224,0.14);
  --gold: #c9a86a;
  --danger: #ff6b6b;
  --accent-bright: #9aa6ff;
  --display: Georgia, "Songti SC", "STSong", "Source Han Serif SC", "Noto Serif CJK SC", "SimSun", serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, "Courier New", monospace;
}
[data-theme="light"] {
  --bg-page: #f5f6fa;
  --bg-card: #ffffff;
  --bg-nested: #eef0f5;
  --bg-input: #f0f2f5;
  --bg-hover: #f0f2f5;
  --text-primary: #2d3436;
  --text-secondary: #555;
  --text-muted: #888;
  --text-dim: #aaa;
  --text-faint: #bbb;
  --text-placeholder: #ccc;
  --border: #ddd;
  --border-hover: #ccc;
  --divider: #e8e8e8;
  --scrollbar: #ccc;
  --dragover-bg: rgba(102,126,234,0.08);
  --active-check-inset: #ffffff;
  --btn-cancel-bg: #e8e8e8;
  --btn-cancel-text: #666;
}

/* === Reset === */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: var(--bg-page); color: var(--text-primary); min-height: 100vh; }

/* === 标题 === */
h1 { font-size: 24px; font-weight: 600; margin-bottom: 8px; background: linear-gradient(135deg, var(--accent), var(--accent-deep)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

/* === 移动端交互基线（全站）=== */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }   /* 防横屏自动放大文字 */
* { -webkit-tap-highlight-color: transparent; }                     /* 去触屏灰色点击高亮 */
/* iOS Safari：input font-size<16px 聚焦时会缩放整个页面 → 移动端统一 16px（!important 压过各页 .field input{14px}）*/
@media (max-width: 768px) {
  input[type="text"], input[type="number"], input[type="password"], input[type="search"],
  input[type="email"], input[type="tel"], input[type="url"], textarea, select { font-size: 16px !important; }
}

/* === 通用组件 === */
.subtitle { color: var(--text-dim); font-size: 14px; margin-bottom: 24px; }
.nav-link { display: inline-block; margin-bottom: 20px; color: var(--accent); font-size: 14px; text-decoration: none; }
.nav-link:hover { text-decoration: underline; }
.empty { text-align: center; padding: 60px 20px; color: var(--text-faint); font-size: 14px; }
.container { max-width: 900px; margin: 0 auto; padding: 40px 20px; }

/* === 共享开关 .toggle-switch（label>input + span，:checked 驱动）===
   全站统一 44×24 触摸友好尺寸；兼容历史两种滑块 class（.slider / .toggle-slider），免改各页 HTML。
   admin 用异种 div+.on 机制，admin.css 本地覆盖（载于 common 之后），互不串扰。*/
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-switch .slider, .toggle-switch .toggle-slider { position: absolute; inset: 0; background: var(--border); border-radius: 12px; cursor: pointer; transition: background 0.2s; }
.toggle-switch .slider::before, .toggle-switch .toggle-slider::before { content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; background: #fff; border-radius: 50%; transition: transform 0.2s; }
.toggle-switch input:checked + .slider, .toggle-switch input:checked + .toggle-slider { background: var(--accent); }
.toggle-switch input:checked + .slider::before, .toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* === Toast === */
.toast-anchor { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); padding: 12px 24px; border-radius: 10px; font-size: 14px; z-index: 9999; opacity: 0; transition: opacity 0.25s; pointer-events: none; }

/* === Lightbox === */
.lightbox { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 1000; justify-content: center; align-items: center; cursor: zoom-out; }
.lightbox.active { display: flex; }
.lightbox img { max-width: 90vw; max-height: 90vh; border-radius: 8px; transition: transform 0.1s; touch-action: none; }
.lightbox img.zoomed { max-width: none; max-height: none; }
.lightbox video { max-width: 90vw; max-height: 90vh; border-radius: 8px; background: #000; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border: none; background: rgba(255,255,255,0.12); color: #fff; font-size: 28px; line-height: 1; border-radius: 50%; cursor: pointer; backdrop-filter: blur(4px); transition: background 0.2s; display: flex; align-items: center; justify-content: center; z-index: 2; }
.lb-nav:hover { background: rgba(255,255,255,0.26); }
.lb-prev { left: 24px; }
.lb-next { right: 24px; }
.lb-counter { position: absolute; top: 20px; left: 50%; transform: translateX(-50%); font-family: var(--mono); font-size: 13px; color: rgba(255,255,255,0.85); background: rgba(0,0,0,0.42); padding: 4px 12px; border-radius: 12px; z-index: 2; }

/* 对比浮层：照片墙点开单条作品，「输入(我的照片/样片)」与「结果」并列；z-index 900 低于 lightbox(1000)，点图放大时 lightbox 叠在上层 */
.compare-box { display: none; position: fixed; inset: 0; z-index: 900; }
.compare-box.active { display: flex; }
.cmp-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.82); }
.cmp-panel { position: relative; margin: auto; width: min(1120px, 94vw); max-height: 90vh; background: var(--bg-card); border-radius: 14px; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,0.45); }
.cmp-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--divider); }
.cmp-title { font-weight: 600; }
.cmp-close { background: none; border: none; font-size: 18px; color: var(--text-muted); cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.cmp-close:hover { background: var(--bg-hover); }
.cmp-body { display: flex; gap: 20px; padding: 18px; overflow-y: auto; }
.cmp-col { display: flex; flex-direction: column; }
.cmp-inputs { width: 190px; flex-shrink: 0; gap: 18px; }
.cmp-results { flex: 1; min-width: 0; }
.cmp-sec { display: flex; flex-direction: column; }
.cmp-label { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.cmp-grid { display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; }
.cmp-tile { border-radius: 8px; overflow: hidden; cursor: zoom-in; position: relative; }
.cmp-tile img { display: block; object-fit: cover; transition: opacity 0.2s; }
.cmp-tile:hover img { opacity: 0.85; }
.cmp-tile--face img { width: 150px; height: 196px; }
.cmp-inputs .cmp-tile:not(.cmp-tile--face) img { width: 86px; height: 112px; }
.cmp-grid--results .cmp-tile img { width: 158px; height: 210px; }
@media (max-width: 720px) {
  .cmp-panel { max-height: 94vh; }
  .cmp-body { flex-direction: column; gap: 16px; padding: 14px; }
  .cmp-inputs { width: 100%; }
  .cmp-results { order: -1; }
  .cmp-tile--face img { width: 116px; height: 152px; }
  .cmp-inputs .cmp-tile:not(.cmp-tile--face) img { width: 72px; height: 94px; }
  .cmp-grid--results .cmp-tile img { width: 132px; height: 174px; }
}

/* Lightbox 滑动对比模式：样片(上)叠结果图(底)，竖分割线跟鼠标；z-index 1001/1002 高于 lightbox(1000) */
.lb-action-btn { color: #fff; font-size: 12px; padding: 8px 14px; background: rgba(102,126,234,0.85); border: none; border-radius: 6px; cursor: pointer; }
.lb-action-btn:hover { background: rgba(102,126,234,1); }
.lb-slider-img { position: fixed; display: none; z-index: 1001; object-fit: cover; pointer-events: none; }
.lb-slider-handle { position: fixed; display: none; z-index: 1002; pointer-events: none; --pct: 50%; }
.lb-slider-handle::before { content: ''; position: absolute; left: var(--pct); top: 0; bottom: 0; width: 2px; background: rgba(255,255,255,0.92); transform: translateX(-50%); box-shadow: 0 0 6px rgba(0,0,0,0.35); }
.lb-slider-grip { position: absolute; top: 50%; left: var(--pct); transform: translate(-50%,-50%); width: 40px; height: 40px; border-radius: 50%; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,0.45); display: flex; align-items: center; justify-content: center; font-size: 16px; color: #555; }
.lb-slider-grip::before { content: '⇔'; }
.lb-slider-label { position: absolute; top: 10px; font-size: 12px; color: #fff; background: rgba(0,0,0,0.5); padding: 3px 9px; border-radius: 4px; pointer-events: none; }
.lb-slider-label-l { left: 10px; }
.lb-slider-label-r { right: 10px; }

/* === 通栏 Topbar（全站共享 shell）===
   home/studio/share_manage 共用。各页按需覆盖 .topbar-inner 的 max-width 与 .hero-title 尺寸；
   页内独有元素（studio 的 more-menu/step-track、home 的 hero-rule）留在各自 CSS。 */
.topbar { background: var(--bg-card); border-bottom: 1px solid var(--border); }
.topbar-inner {
  max-width: 1100px; margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.topbar-brand { min-width: 0; }
.hero-mark { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.hero-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 10px rgba(201,168,106,0.7); }
.hero-eyebrow { font-family: var(--mono); font-size: 11px; letter-spacing: 2px; color: var(--text-muted); }
.hero-title {
  font-family: var(--display); font-weight: 600; line-height: 1.3; letter-spacing: 0.5px;
  font-size: clamp(15px, 1.8vw, 18px); margin: 0; color: var(--text-primary);
}

/* 操作区：ghost chip 语言（Q点 唯一 accent 锚点；其余透明底 + border，hover 变 accent；退出 hover 变红）*/
.ph-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.ph-right #usernameDisplay,
.ph-right #creditDisplay,
.topbar-link,
.nav-bar a,
.nav-bar .help-btn,
.nav-bar .theme-toggle,
.ph-logout {
  display: inline-flex; align-items: center; justify-content: center;
  box-sizing: border-box; height: 30px;
}
.ph-right #usernameDisplay {
  font-size: 12px; color: var(--text-muted); white-space: nowrap;
  max-width: 120px; overflow: hidden; text-overflow: ellipsis;
  padding-right: 12px; border-right: 1px solid var(--border);
}
.ph-right #creditDisplay {
  font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  padding: 5px 12px; border-radius: 8px; cursor: pointer; white-space: nowrap; transition: background 0.2s;
}
.ph-right #creditDisplay:hover { background: color-mix(in srgb, var(--accent) 24%, transparent); }
/* 返回首页：ghost chip（不沿用全局 .nav-link——那是登录页带 margin-bottom:20px 的链接，会顶偏对齐）*/
.topbar-link {
  padding: 5px 12px; border-radius: 8px; background: transparent; color: var(--text-muted);
  font-size: 12px; text-decoration: none; border: 1px solid var(--border); white-space: nowrap;
  transition: border-color 0.2s, color 0.2s;
}
.topbar-link:hover { border-color: var(--accent); color: var(--accent); }
.nav-bar { display: flex; align-items: center; gap: 8px; padding-right: 12px; border-right: 1px solid var(--border); }
.nav-bar a,
.nav-bar .help-btn,
.nav-bar .theme-toggle {
  padding: 5px 12px; border-radius: 8px; background: transparent; color: var(--text-muted);
  font-size: 12px; line-height: 1.4; text-decoration: none; border: 1px solid var(--border);
  white-space: nowrap; cursor: pointer; transition: border-color 0.2s, color 0.2s;
}
.nav-bar a:hover,
.nav-bar .help-btn:hover,
.nav-bar .theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.ph-logout {
  background: transparent; border: 1px solid var(--border); border-radius: 8px;
  color: var(--text-dim); cursor: pointer; font-size: 12px; line-height: 1.4;
  padding: 5px 12px; white-space: nowrap; transition: border-color 0.2s, color 0.2s;
}
.ph-logout:hover { border-color: var(--danger); color: var(--danger); }

/* === 任务卡片 === */
.task-card { background: var(--bg-card); border-radius: 12px; margin-bottom: 10px; overflow: hidden; }
.tc-header { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; cursor: pointer; transition: background 0.2s; }
.tc-header:hover { background: var(--bg-hover); }
.tc-thumbs { display: flex; gap: 4px; flex-shrink: 0; margin-right: 4px; align-items: center; }
.tc-thumbs img { width: 36px; height: 36px; object-fit: cover; border-radius: 4px; }
.tc-thumbs video { width: 36px; height: 36px; object-fit: cover; border-radius: 4px; }
.tc-thumb-placeholder { width: 36px; height: 36px; border-radius: 4px; background: var(--bg-nested); display: flex; align-items: center; justify-content: center; color: var(--text-faint); font-size: 9px; border: 1px dashed var(--border); }
.tc-thumb-sep { color: var(--border); display: flex; align-items: center; font-size: 14px; }
.tc-left { flex: 1; overflow: hidden; min-width: 0; }
.tc-prompt { font-size: 13px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-meta { font-size: 11px; color: var(--text-dim); margin-top: 3px; display: flex; gap: 12px; align-items: center; }
.tc-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.tc-arrow { color: var(--text-faint); transition: transform 0.2s; width: 18px; height: 18px; }
.task-card.open .tc-arrow { transform: rotate(180deg); }
.tc-body { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
.task-card.open .tc-body { max-height: 50000px; overflow-y: auto; }
.tc-body-inner { padding: 0 16px 16px; border-top: 1px solid var(--divider); }
.tc-params { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; font-size: 12px; }
.tc-param { display: flex; flex-direction: column; gap: 2px; }
.tc-param label { color: var(--text-muted); font-size: 11px; }
.tc-param span { color: var(--text-secondary); word-break: break-all; }
.tc-inspect-img { max-height: 150px; object-fit: contain; background: var(--bg-nested); border-radius: 6px; }
.tc-inspect-img.sm { max-height: 120px; }
.tc-thumb-mini { height: 60px; object-fit: cover; border-radius: 4px; }

/* 状态标签 */
.status-tag { font-size: 11px; padding: 2px 8px; border-radius: 4px; white-space: nowrap; }
.status-pending, .status-submitting, .status-preparing { background: rgba(241,196,15,0.15); color: #f1c40f; }
.status-queued { background: rgba(52,152,219,0.15); color: #3498db; }
.status-running { background: rgba(155,89,182,0.15); color: #9b59b6; }
.status-success { background: rgba(39,174,96,0.15); color: #27ae60; }
.status-failed, .status-not_found { background: rgba(231,76,60,0.15); color: #e74c3c; }
.status-cancelled { background: rgba(231,76,60,0.15); color: #e74c3c; }

/* 操作按钮 */
.btn-action { background: transparent; padding: 3px 8px; font-size: 11px; border-radius: 4px; cursor: pointer; transition: all 0.2s; border-width: 1px; border-style: solid; }
.btn-retry { color: #667eea; border-color: #667eea; }
.btn-load-settings { color: #27ae60; border-color: #27ae60; }
.btn-del { color: #e74c3c; border-color: #e74c3c; }

/* === 画廊卡（home「最近作品」/ studio「个人记录」共用；由 renderGalleryCard 渲染）=== */
.gal-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.gal-grid > :not(.task-card) { grid-column: 1 / -1; }  /* 空状态提示跨列居中 */
.gal-card { background: transparent; margin-bottom: 0; border-radius: 0; overflow: visible; }
.gal-shot {
  position: relative; display: block; width: 100%; aspect-ratio: 3 / 4;
  background: var(--bg-nested); border-radius: 10px; overflow: hidden; cursor: zoom-in;
}
.gal-shot img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.35s; }
.gal-shot video { width: 100%; height: 100%; object-fit: cover; display: block; }
.gal-card:hover .gal-shot img { transform: scale(1.05); }
.gal-count {
  position: absolute; top: 6px; right: 6px; min-width: 20px; text-align: center; z-index: 2;
  background: rgba(0,0,0,0.62); color: #fff; font-family: var(--mono); font-size: 11px;
  padding: 2px 6px; border-radius: 6px; backdrop-filter: blur(4px);
}
.gal-overlay {
  position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; gap: 6px;
  padding: 12px; border-radius: 10px;
  background: linear-gradient(180deg, rgba(0,0,0,0) 45%, rgba(0,0,0,0.62) 100%);
  opacity: 0; transition: opacity 0.2s;
}
.gal-card:hover .gal-overlay { opacity: 1; }
.gal-overlay .btn-action {
  background: rgba(0,0,0,0.5); color: #fff; border: 1px solid rgba(255,255,255,0.35);
  padding: 3px 11px; font-size: 11px; border-radius: 6px; backdrop-filter: blur(4px); transition: background 0.2s;
}
.gal-overlay .btn-action:hover { background: rgba(0,0,0,0.72); }
.gal-placeholder { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--text-faint); font-size: 12px; }
.gal-meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 8px 2px 0; }
.gal-time { font-family: var(--mono); font-size: 11px; color: var(--text-dim); white-space: nowrap; }
.gal-error { font-size: 11px; color: #e74c3c; padding: 2px 2px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 768px) { .gal-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; } }
@media (max-width: 480px) { .gal-grid { grid-template-columns: repeat(2, 1fr); } }
@media (hover: none) { .gal-overlay { opacity: 1; } }  /* 触屏无 hover，操作常显 */

/* 图片网格 */
.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-top: 10px; }
.image-grid .img-card { border-radius: 8px; overflow: hidden; position: relative; cursor: pointer; }
.image-grid .img-card img { max-width: 512px; max-height: 512px; object-fit: contain; display: block; background: var(--bg-nested); }
.image-grid .img-card video { max-width: 512px; max-height: 512px; object-fit: contain; display: block; background: #000; }
/* 结果格悬浮层通用（admin 网格 / gallery 瀑布流 / renderResultCell 共用，不限于 .image-grid） */
.img-card .img-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.4); display: flex; gap: 8px; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.2s; flex-wrap: wrap; }
.img-card:hover .img-overlay { opacity: 1; }
.img-card .img-overlay a { color: #fff; font-size: 12px; padding: 6px 12px; background: rgba(102,126,234,0.8); border-radius: 6px; text-decoration: none; }

/* Lightbox 下载 */
.lightbox-actions { position: fixed; top: 16px; right: 16px; z-index: 1001; display: flex; gap: 8px; }
.lightbox-actions a { color: #fff; font-size: 12px; padding: 8px 16px; background: rgba(102,126,234,0.8); border-radius: 6px; text-decoration: none; }
.lightbox-actions a:hover { background: rgba(102,126,234,1); }

/* 管理模式专用 */
.task-stats { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.stat-card { background: var(--bg-card); border-radius: 8px; padding: 12px 16px; min-width: 80px; text-align: center; }
.stat-num { font-size: 20px; font-weight: 600; }
.stat-label { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.stat-success .stat-num { color: #27ae60; }
.stat-failed .stat-num { color: #e74c3c; }
.stat-running .stat-num { color: #9b59b6; }
.stat-queued .stat-num { color: #3498db; }
.filter-bar { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.filter-btn { padding: 4px 12px; background: var(--bg-card); border: 1px solid var(--border); color: var(--text-muted); border-radius: 6px; font-size: 12px; cursor: pointer; transition: all 0.2s; }
.filter-btn.active { border-color: #667eea; color: #667eea; }
.task-pagination { display: flex; justify-content: center; gap: 8px; margin-top: 16px; }
.task-pagination button { padding: 6px 14px; background: var(--bg-card); border: 1px solid var(--border); color: var(--text-muted); border-radius: 6px; font-size: 12px; cursor: pointer; }
.task-pagination button:disabled { opacity: 0.3; cursor: default; }
.task-pagination button:hover:not(:disabled) { border-color: #667eea; color: #667eea; }

/* 移动端适配 */
@media (max-width: 768px) {
  .tc-header { padding: 10px 12px; flex-wrap: wrap; gap: 8px; }
  .tc-thumbs { order: -1; width: 100%; }
  .tc-prompt { font-size: 12px; }
  .tc-meta { font-size: 10px; gap: 6px; flex-wrap: wrap; }
  .tc-right { gap: 4px; flex-wrap: wrap; justify-content: flex-end; width: 100%; }
  .btn-action { padding: 2px 6px; font-size: 10px; }
  .tc-params { grid-template-columns: 1fr; }
  .image-grid { grid-template-columns: 1fr; }
  .filter-bar { gap: 4px; }
  .filter-btn { padding: 3px 8px; font-size: 11px; }
  .stat-card { padding: 8px 10px; min-width: 60px; }
  .stat-num { font-size: 16px; }
}

/* === 页面通用组件 === */
.page-header { width:100%; margin:0 auto; padding:12px 20px; display:flex; align-items:center; justify-content:space-between; border-bottom:1px solid var(--divider); }
h1 { font-size:18px; font-weight:600; margin:0; }
.theme-toggle { background:none; border:none; cursor:pointer; padding:4px; color:var(--text-dim); transition:color 0.2s; display:flex; align-items:center; flex:none; width:auto; }
.theme-toggle:hover { color:var(--accent); }
.help-btn { background:none; border:none; cursor:pointer; padding:2px 8px; border-radius:6px; font-size:14px; font-weight:600; color:var(--text-dim); transition:all 0.2s; flex:none; width:auto; }
.help-btn:hover { color:var(--accent); background:var(--bg-nested); }
.btn-primary { background:linear-gradient(135deg,#667eea,#764ba2); color:#fff; border:none; border-radius:8px; cursor:pointer; transition:all 0.2s; }
.btn-primary:hover { opacity:0.9; }
.btn-primary:disabled { opacity:0.5; cursor:not-allowed; }
.btn-generate { padding:12px 32px; background:linear-gradient(135deg,#667eea,#764ba2); color:#fff; border:none; border-radius:10px; font-size:15px; font-weight:600; cursor:pointer; transition:opacity 0.2s; }
.btn-generate:hover { opacity:0.9; }
.btn-generate:disabled { opacity:0.5; cursor:not-allowed; }
.btn-sm { padding:4px 12px; border-radius:6px; font-size:12px; cursor:pointer; border:1px solid var(--border); background:transparent; color:var(--text-muted); transition:all 0.2s; }
.btn-sm:hover { border-color:var(--accent); color:var(--accent); }
.btn-sm.danger { color:#e74c3c; border-color:#e74c3c; }
.btn-sm.danger:hover { background:rgba(231,76,60,0.1); }
.clear-btn { background:transparent; color:#e74c3c; border:1px solid #e74c3c; padding:6px 16px; border-radius:8px; font-size:13px; cursor:pointer; transition:all 0.2s; }
.clear-btn:hover { background:#e74c3c; color:#fff; }
.upload-area { border:2px dashed var(--border); border-radius:12px; text-align:center; cursor:pointer; transition:border-color 0.2s; }
.upload-area:hover { border-color:var(--accent); }
.upload-area.dragover { border-color:var(--accent); background:var(--dragover-bg); }
.progress-wrap { height:4px; background:var(--bg-nested); border-radius:2px; overflow:hidden; }
.progress-bar { height:100%; background:linear-gradient(90deg,#667eea,#764ba2); border-radius:2px; transition:width 0.3s; width:0; }
.cost-hint { font-size:13px; color:var(--text-muted); display:inline-flex; align-items:center; gap:4px; white-space:nowrap; }
.cost-help { display:inline-flex; align-items:center; justify-content:center; width:16px; height:16px; border-radius:50%; font-size:11px; font-weight:600; background:var(--bg-nested); color:var(--text-dim); cursor:pointer; position:relative; }
.cost-help:hover { color:var(--accent); }
.cost-tooltip { display:none; position:absolute; bottom:calc(100% + 8px); left:50%; transform:translateX(-50%); background:var(--bg-card); border:1px solid var(--border); border-radius:10px; padding:12px 16px; font-size:12px; color:var(--text-secondary); white-space:nowrap; box-shadow:0 4px 16px rgba(0,0,0,0.2); z-index:100; }
.cost-help.open .cost-tooltip { display:block; }
.cost-tooltip::after { content:''; position:absolute; top:100%; left:50%; transform:translateX(-50%); border:6px solid transparent; border-top-color:var(--bg-card); }
.modal-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,0.5); z-index:1000; justify-content:center; align-items:center; }
.modal-overlay.active { display:flex; }
.modal-box { background:var(--bg-card); border-radius:12px; padding:24px; width:320px; }
.credit-popup { background:var(--bg-card); border-radius:16px; width:420px; max-width:92vw; max-height:80vh; display:flex; flex-direction:column; overflow:hidden; box-shadow:0 8px 32px rgba(0,0,0,0.3); }
.credit-popup-header { padding:20px 24px 16px; border-bottom:1px solid var(--divider); display:flex; justify-content:space-between; align-items:center; }
.credit-popup-balance { font-size:24px; font-weight:700; color:var(--accent); }
.credit-popup-close { background:none; border:none; font-size:20px; color:var(--text-dim); cursor:pointer; padding:4px 8px; border-radius:6px; transition:background 0.2s; }
.credit-popup-close:hover { background:var(--bg-nested); }
.credit-popup-summary { display:flex; gap:12px; padding:16px 24px; border-bottom:1px solid var(--divider); }
.credit-stat { flex:1; text-align:center; }
.credit-stat-num { font-size:18px; font-weight:600; }
.credit-stat-num.spent { color:#e74c3c; }
.credit-stat-num.income { color:#27ae60; }
.credit-stat-label { font-size:11px; color:var(--text-muted); margin-top:2px; }
.credit-popup-list { flex:1; overflow-y:auto; padding:8px 24px; }
.credit-tx-row { display:flex; justify-content:space-between; align-items:center; padding:10px 0; border-bottom:1px solid var(--divider); }
.credit-tx-row:last-child { border-bottom:none; }
.credit-tx-left { flex:1; min-width:0; }
.credit-tx-type { font-size:13px; color:var(--text-primary); }
.credit-tx-note { font-size:11px; color:var(--text-dim); margin-top:2px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.credit-tx-time { font-size:11px; color:var(--text-dim); margin-top:2px; opacity:0.7; }
.credit-tx-right { text-align:right; flex-shrink:0; margin-left:12px; }
.credit-tx-amount { font-size:15px; font-weight:600; }
.credit-tx-bal { font-size:12px; color:var(--text-dim); margin-top:2px; }
.credit-popup-footer { padding:12px 24px; text-align:center; font-size:12px; color:var(--text-dim); border-top:1px solid var(--divider); }
.credit-popup-loading { text-align:center; padding:40px; color:var(--text-dim); }
.credit-popup-empty { text-align:center; padding:32px; color:var(--text-dim); font-size:13px; }
.step-label { font-size:13px; font-weight:600; color:var(--accent); margin-bottom:12px; display:flex; align-items:center; gap:8px; }
.step-label .num { width:22px; height:22px; border-radius:50%; background:linear-gradient(135deg,#667eea,#764ba2); color:#fff; font-size:12px; display:flex; align-items:center; justify-content:center; }
.group-tabs { display:flex; gap:8px; margin-bottom:12px; flex-wrap:wrap; }
.group-tab { padding:6px 14px; border-radius:8px; background:var(--bg-nested); color:var(--text-muted); font-size:13px; cursor:pointer; border:1px solid var(--border); transition:all 0.2s; }
@media (max-width: 768px) {
  .page-header { padding:10px 16px; }
  h1 { font-size:15px; }
  .upload-area { padding:20px 12px; border-radius:10px; }
  .group-tabs { gap:6px; }
  .group-tab { padding:5px 12px; font-size:12px; }
  .credit-popup { width:100%; max-width:100%; max-height:100vh; border-radius:0; }
  .credit-popup-header { padding:16px; }
  .credit-popup-summary { padding:12px 16px; }
  .credit-popup-list { padding:8px 16px; }
  .credit-popup-footer { padding:10px 16px; }
  .credit-popup-balance { font-size:20px; }
  .credit-stat-num { font-size:15px; }
  .credit-tx-type { font-size:12px; }
  .btn-sm { padding:3px 8px; font-size:11px; }
  .btn-generate { width:100%; padding:12px 0; font-size:14px; border-radius:10px; text-align:center; }
}

/* === 聚合 N 格网格：studio 个人记录聚合卡 + share 顾客页结果区共用 === */
.batch-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.batch-cell { width: 92px; aspect-ratio: 3 / 4; border-radius: 8px; overflow: hidden; background: var(--bg-nested); position: relative; }
.batch-cell.done { cursor: zoom-in; }
.batch-cell img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.3s; }
.batch-cell video { width: 100%; height: 100%; object-fit: cover; display: block; background: #000; }
.batch-cell.done:hover img { transform: scale(1.05); }
.batch-cell.pending { display: flex; align-items: center; justify-content: center; border: 2px dashed var(--border); color: var(--text-faint); font-size: 12px; animation: pulse 1.5s infinite; }
.batch-cell.failed { display: flex; align-items: center; justify-content: center; border: 2px solid var(--danger, #ff6b6b); color: var(--danger, #ff6b6b); background: rgba(255,107,107,0.06); font-size: 12px; }
@media (max-width: 480px) { .batch-cell { width: 74px; } }

/* === ICP 备案页脚（common.js injectFooter 注入，全站）=== */
.site-footer { text-align: center; padding: 18px 20px 26px; font-size: 12px; }
.site-footer a { color: var(--text-faint); text-decoration: none; transition: color 0.2s; }
.site-footer a:hover { color: var(--text-muted); text-decoration: underline; }
/* login 等固定暗色全屏封面页：右下角 fixed 角标，不破坏封面 */
.site-footer.fixed { position: fixed; right: 14px; bottom: 10px; padding: 0; z-index: 5; font-family: var(--mono); }
.site-footer.fixed a { color: var(--ivory-faint); font-size: 11px; }
.site-footer.fixed a:hover { color: var(--ivory-dim); }

/* === 素材库选择器（asset_picker.js 注入 #assetPicker，全站共享）=== */
/* upload-area 作为浮按钮的定位上下文（统一在此声明 position:relative，供 .asset-pick-mini 绝对定位锚定）*/
.upload-area { position: relative; }
/* 复用 .modal-overlay（本文件上方已定义），picker 提到更高层 */
#assetPicker { z-index: 9998; }
.picker-panel { background: var(--bg-card, var(--bg-page)); border-radius: 14px; width: 94%; max-width: 760px; max-height: 86vh; display: flex; flex-direction: column; box-shadow: 0 12px 40px rgba(0,0,0,0.25); }
.picker-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; font-size: 15px; font-weight: 600; color: var(--text-primary); border-bottom: 1px solid var(--border); }
.picker-close { background: none; border: none; font-size: 22px; color: var(--text-dim); cursor: pointer; line-height: 1; }
.picker-toolbar { padding: 12px 20px 8px; }
.picker-search { width: 100%; box-sizing: border-box; padding: 8px 12px; background: var(--bg-input); border: 1px solid var(--border); border-radius: 8px; color: var(--text-primary); font-size: 13px; outline: none; }
.picker-grid { flex: 1; overflow-y: auto; padding: 10px 20px 14px; display: flex; flex-wrap: wrap; gap: 16px; width: 100%; min-width: 0; align-content: flex-start; }
.picker-card { flex: 0 0 calc((100% - 48px)/4); background: var(--bg-card, var(--bg-nested)); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; cursor: pointer; display: flex; flex-direction: column; transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s; }
.picker-card:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(0,0,0,0.12); border-color: transparent; }
.picker-thumb { position: relative; width: 100%; height: 168px; flex: 0 0 168px; background-color: #000; background-position: center; background-size: cover; background-repeat: no-repeat; overflow: hidden; }
@media (max-width: 640px) { .picker-card { flex-basis: calc((100% - 16px)/2); } }
.picker-badge { position: absolute; top: 6px; left: 6px; background: rgba(0,0,0,0.6); color: #fff; font-size: 10px; padding: 1px 6px; border-radius: 4px; }
.picker-name { padding: 8px 10px 0; font-size: 12px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.picker-meta { padding: 3px 10px 10px; font-size: 11px; color: var(--text-dim); }
.picker-toolbar-row { display: flex; gap: 8px; align-items: center; }
.picker-upload-btn { flex-shrink: 0; padding: 8px 12px; background: linear-gradient(135deg,#667eea,#764ba2); color: #fff; border: none; border-radius: 8px; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.picker-tagbar { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.picker-tag { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; background: var(--bg-input); border: 1px solid var(--border); border-radius: 14px; font-size: 12px; color: var(--text-muted); cursor: pointer; }
.picker-tag.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.picker-tag-c { font-size: 10px; opacity: 0.7; }
.picker-card.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.picker-check { position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; background: var(--accent); color: #fff; border-radius: 50%; font-size: 12px; display: flex; align-items: center; justify-content: center; }
.picker-fav { position: absolute; bottom: 6px; right: 6px; width: 26px; height: 26px; background: rgba(0,0,0,0.55); color: #fff; border: none; border-radius: 50%; font-size: 15px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.15s, transform 0.15s; }
.picker-fav:hover { background: rgba(0,0,0,0.8); transform: scale(1.1); }
.picker-fav.on { color: #f5b041; }
.picker-footer { display: flex; align-items: center; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--border); background: var(--bg-nested); }
.picker-footer .picker-selall { margin-left: auto; background: none; border: 1px solid var(--border); padding: 6px 12px; border-radius: 8px; font-size: 12px; color: var(--text-muted); cursor: pointer; }
.picker-footer .picker-confirm { padding: 8px 20px; background: linear-gradient(135deg,#667eea,#764ba2); color: #fff; border: none; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; }
/* label 行内「素材库」按钮（多选/无 upload-area 区，如 tools 换脸目标图）*/
.asset-pick { margin-left: auto; padding: 2px 10px; background: var(--bg-nested); border: 1px solid var(--border); border-radius: 6px; color: var(--accent); font-size: 12px; font-weight: 500; cursor: pointer; transition: all 0.15s; }
.asset-pick:hover { background: linear-gradient(135deg,#667eea,#764ba2); color: #fff; border-color: transparent; }
/* 各上传区右上角「素材库」浮按钮 */
.asset-pick-mini { position: absolute; top: 8px; right: 8px; z-index: 3; padding: 3px 10px; background: rgba(102,126,234,0.12); border: 1px solid var(--accent); border-radius: 14px; color: var(--accent); font-size: 12px; font-weight: 600; cursor: pointer; }
.asset-pick-mini:hover { background: linear-gradient(135deg,#667eea,#764ba2); color: #fff; border-color: transparent; }
/* workflow 直调历史 chip（tools 页）*/
.wf-chip { padding: 4px 10px; background: var(--bg-input); border: 1px solid var(--border); border-radius: 14px; font-size: 12px; color: var(--text-muted); cursor: pointer; font-family: var(--mono, ui-monospace, monospace); transition: all 0.15s; }
.wf-chip:hover { background: linear-gradient(135deg,#667eea,#764ba2); color: #fff; border-color: transparent; }
.wf-chip-clear { padding: 4px 10px; background: none; border: 1px dashed var(--border); border-radius: 14px; font-size: 11px; color: var(--text-faint); cursor: pointer; }
.wf-chip-clear:hover { color: var(--danger, #ff6b6b); border-color: var(--danger, #ff6b6b); }
/* 素材库入口图标：SVG「照片栈」，继承 currentColor，hover 随文字变白 */
.asset-pick::before, .asset-pick-mini::before, .asset-mini::before {
  content: ""; display: inline-block; width: 14px; height: 14px; vertical-align: -2px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 5h12a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1z'/%3E%3Cpath d='M7 3h14a1 1 0 0 1 1 1v14'/%3E%3Ccircle cx='7' cy='10' r='1.5'/%3E%3Cpath d='m3 17 3.5-3.5a1.5 1.5 0 0 1 2 0L12 16'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 5h12a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1z'/%3E%3Cpath d='M7 3h14a1 1 0 0 1 1 1v14'/%3E%3Ccircle cx='7' cy='10' r='1.5'/%3E%3Cpath d='m3 17 3.5-3.5a1.5 1.5 0 0 1 2 0L12 16'/%3E%3C/svg%3E") center/contain no-repeat;
}
.asset-pick::before, .asset-pick-mini::before { margin-right: 4px; }
