/* ============================================================
   LinleAI 智能工具箱 · 公共样式
   深空科技风 · 双主题（CSS 变量）· 组件库
   主色：紫罗兰蓝渐变 #635BFF → #36CFFB
   ============================================================ */

/* ---------- 主题变量（深色默认） ---------- */
:root,
html[data-theme="dark"] {
  /* 侧边栏宽度（可拖拽调整，JS 动态改写） */
  --sidebar-w: 248px;

  --bg-page: #070912;
  --bg-panel: #0d111c;
  --bg-card: #111827;
  --bg-hover: #1a2236;
  --bg-input: #0a0e18;
  --bg-sidebar: #0a0e18;
  --bg-topbar: rgba(10, 14, 24, 0.85);

  --border: rgba(139, 148, 189, 0.1);
  --border-strong: rgba(139, 148, 189, 0.2);

  --text-primary: #f0f2f8;
  --text-secondary: #9ca3c0;
  --text-muted: #5f6b8a;

  --primary: #635bff;
  --primary-light: #36cffb;
  --primary-grad: linear-gradient(135deg, #635bff 0%, #36cffb 100%);
  --primary-glow: rgba(99, 91, 255, 0.25);
  --primary-glow-strong: rgba(99, 91, 255, 0.35);

  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.12);
  --success-border: rgba(16, 185, 129, 0.35);

  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.12);
  --warning-border: rgba(245, 158, 11, 0.35);

  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.12);

  /* 柔和分层阴影（去刺眼强光） */
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.2), 0 4px 14px rgba(0, 0, 0, 0.18);
  --shadow-hover: 0 2px 6px rgba(0, 0, 0, 0.22), 0 14px 34px rgba(0, 0, 0, 0.26);
  --shadow-modal: 0 4px 12px rgba(0, 0, 0, 0.28), 0 24px 64px rgba(0, 0, 0, 0.4);
  --shadow-topbar: 0 1px 0 rgba(139, 148, 189, 0.08);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  --scrollbar-thumb: #1e2740;
}

/* ---------- 主题变量（浅色） ---------- */
html[data-theme="light"] {
  --bg-page: #f2f5fb;
  --bg-panel: #ffffff;
  --bg-card: #ffffff;
  --bg-hover: #eef1f9;
  --bg-input: #f4f6fb;
  --bg-sidebar: #fafbfe;
  --bg-topbar: rgba(255, 255, 255, 0.9);

  --border: rgba(30, 41, 82, 0.08);
  --border-strong: rgba(30, 41, 82, 0.16);

  --text-primary: #141b2e;
  --text-secondary: #46506e;
  --text-muted: #6a728c;

  --primary: #635bff;
  --primary-light: #0ea5e9;
  --primary-grad: linear-gradient(135deg, #635bff 0%, #0ea5e9 100%);
  --primary-glow: rgba(99, 91, 255, 0.12);
  --primary-glow-strong: rgba(99, 91, 255, 0.2);

  --success: #059669;
  --success-bg: rgba(5, 150, 105, 0.1);
  --success-border: rgba(5, 150, 105, 0.35);

  --warning: #d97706;
  --warning-bg: rgba(217, 119, 6, 0.1);
  --warning-border: rgba(217, 119, 6, 0.35);

  --danger: #dc2626;
  --danger-bg: rgba(220, 38, 38, 0.1);

  /* 柔和分层阴影（浅色） */
  --shadow-card: 0 1px 2px rgba(30, 41, 82, 0.05), 0 4px 12px rgba(30, 41, 82, 0.06);
  --shadow-hover: 0 2px 6px rgba(30, 41, 82, 0.07), 0 14px 30px rgba(30, 41, 82, 0.1);
  --shadow-modal: 0 4px 12px rgba(30, 41, 82, 0.1), 0 24px 56px rgba(30, 41, 82, 0.16);
  --shadow-topbar: 0 1px 0 rgba(30, 41, 82, 0.08);

  --scrollbar-thumb: #c9d2e4;
}

/* 浅色模式下，深色"屏幕/播放器"类元素强制保持深色底，避免白字白底看不清 */
html[data-theme="light"] .repl-preview-screen,
html[data-theme="light"] .generating-state[style*="border"],
html[data-theme="light"] .compare-wrap,
html[data-theme="light"] .crop-canvas-wrap { background: #0e1424; }
html[data-theme="light"] .modal-mask { background: rgba(30, 41, 82, 0.4); }

/* ---------- 基础 ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Noto Sans CJK SC", sans-serif, "Segoe UI Emoji", "Segoe UI Symbol", "Apple Color Emoji", "Noto Color Emoji", "Twemoji", "EmojiOne Color", "Android Emoji";
  background: var(--bg-page);
  color: var(--text-primary);
  font-size: 16px;
  line-height: 1.75;
  transition: background 0.3s ease, color 0.3s ease;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
::-webkit-scrollbar-corner { background: transparent; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: 15.5px; color: var(--text-primary); }

.hidden { display: none !important; }

/* ---------- 主渐变文字 ---------- */
.grad-text {
  background: var(--primary-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
/* 深色下渐变文字加柔光，强化科技感 */
html[data-theme="dark"] .grad-text {
  filter: drop-shadow(0 1px 10px rgba(99, 91, 255, 0.42));
}

/* ---------- 柔光文字（标语 / 重要数字） ---------- */
.text-glow {
  color: var(--text-primary);
  text-shadow: 0 0 10px rgba(54, 207, 251, 0.3);
}
html[data-theme="dark"] .text-glow {
  text-shadow: 0 0 14px rgba(54, 207, 251, 0.45), 0 0 5px rgba(99, 91, 255, 0.28);
}

/* ---------- 高亮胶囊徽章（旗舰 / NEW / 推荐） ---------- */
.hl-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 13px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: #fff;
  background: var(--primary-grad);
  box-shadow: 0 3px 12px var(--primary-glow);
}

/* ---------- 正文关键词高亮 ---------- */
.hl {
  color: var(--primary-light);
  font-weight: 600;
  text-shadow: 0 0 8px var(--primary-glow);
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  font-size: 15.5px;
  font-weight: 500;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary {
  background: var(--primary-grad);
  color: #fff;
  box-shadow: 0 4px 14px var(--primary-glow);
}
.btn-primary:hover:not(:disabled) { box-shadow: 0 6px 20px var(--primary-glow); transform: translateY(-1px); }
.btn-outline {
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text-primary);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost { color: var(--text-secondary); }
.btn-ghost:hover { color: var(--text-primary); background: var(--bg-hover); }
.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.btn-sm { padding: 8px 16px; font-size: 14px; }

/* ---------- 爆款复刻页 输入控件统一样式增强 ---------- */
.repl-section .form-input,
.repl-section input[type="text"],
.repl-section input[type="search"],
.repl-section input[type="email"],
.repl-section input[type="tel"],
.repl-section input[type="number"] {
  padding: 12px 15px;
  font-size: 14.5px;
  min-height: 46px;
  line-height: 1.6;
}
.repl-section textarea.form-input {
  resize: vertical;
  line-height: 1.8;
}

/* ---------- 输入组件 ---------- */
.input, .select, .textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.textarea { resize: vertical; min-height: 130px; line-height: 1.8; }
.select { appearance: none; cursor: pointer; }

.field-label {
  display: block;
  font-size: 14.5px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 600;
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-card);
  transition: all 0.25s ease;
}

/* ---------- 标签（状态） ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 11px;
  border-radius: 999px;
  letter-spacing: 0.3px;
}
.tag-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-border);
}
.tag-warning {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid var(--warning-border);
}
.tag-info {
  background: var(--primary-glow);
  color: var(--primary-light);
  border: 1px solid rgba(99, 91, 255, 0.3);
}

/* ============================================================
   访客首页（index.html 独立布局，锁定深色）
   ============================================================ */
body.home-page {
  background: #0a0e1a;
  color: #e6eaf5;
  min-height: 100vh;
  overflow-x: hidden;
}

/* 背景星空光效 */
.home-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 18% 12%, rgba(99, 91, 255, 0.16) 0%, transparent 55%),
    radial-gradient(ellipse at 82% 30%, rgba(54, 207, 251, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 90%, rgba(99, 91, 255, 0.08) 0%, transparent 55%);
}

.home-grid-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(139, 148, 189, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 148, 189, 0.05) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 50% 20%, black 30%, transparent 75%);
}

.home-container {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 28px;
}

.home-header { text-align: center; padding: 72px 0 44px; }
.home-logo { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 18px; }
.home-logo-icon {
  width: 54px; height: 54px;
  background: linear-gradient(135deg, #635bff, #36cffb);
  border-radius: 15px;
  display: flex; align-items: center; justify-content: center;
  font-size: 27px;
  box-shadow: 0 8px 34px rgba(99, 91, 255, 0.45);
}
.home-logo-text { font-size: 34px; font-weight: 700; letter-spacing: -0.5px; }
.home-subtitle { font-size: 16px; color: #9aa3bd; max-width: 640px; margin: 0 auto; }
.home-subtitle b { color: #e6eaf5; }

/* 统计栏 */
.home-stats {
  display: flex;
  justify-content: center;
  gap: 56px;
  margin: 34px auto 0;
  padding: 22px 40px;
  background: rgba(22, 31, 51, 0.6);
  border: 1px solid rgba(139, 148, 189, 0.12);
  border-radius: 16px;
  max-width: 680px;
  backdrop-filter: blur(8px);
}
.home-stat { text-align: center; }
.home-stat-num { font-size: 30px; font-weight: 700; }
.home-stat-label { font-size: 13px; color: #9aa3bd; margin-top: 2px; }

/* 分组标题 */
.home-section { margin: 44px 0 22px; display: flex; align-items: center; gap: 12px; }
.home-section-dot { width: 8px; height: 8px; border-radius: 50%; }
.home-section-dot.green { background: #10b981; box-shadow: 0 0 12px rgba(16,185,129,.5); }
.home-section-dot.amber { background: #f59e0b; box-shadow: 0 0 12px rgba(245,158,11,.5); }
.home-section-title { font-size: 20px; font-weight: 600; }
.home-section-sub { font-size: 13px; color: #5d6785; margin-left: auto; }

/* 工具卡片（首页） */
.home-tools { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.home-tool {
  background: rgba(22, 31, 51, 0.65);
  border: 1px solid rgba(139, 148, 189, 0.12);
  border-radius: 16px;
  padding: 24px 20px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.home-tool::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(99,91,255,0.1), transparent 70%);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.home-tool:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 38px rgba(0,0,0,0.45), 0 0 0 1px rgba(99, 91, 255, 0.35);
  border-color: rgba(99, 91, 255, 0.4);
}
.home-tool:hover::before { opacity: 1; }
.home-tool-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; position: relative; z-index: 1; }
.home-tool-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 23px;
  position: relative; z-index: 1;
}
.home-tool-name { font-size: 16px; font-weight: 600; margin-bottom: 6px; position: relative; z-index: 1; }
.home-tool-desc { font-size: 13px; color: #9aa3bd; line-height: 1.55; position: relative; z-index: 1; }

.home-footer-cta {
  text-align: center;
  padding: 64px 0 24px;
}
.home-footer-cta h2 { font-size: 23px; font-weight: 600; margin-bottom: 10px; }
.home-footer-cta p { color: #9aa3bd; margin-bottom: 28px; }
.home-footer-bar {
  text-align: center;
  padding: 28px 0 36px;
  border-top: 1px solid rgba(139,148,189,0.08);
  color: #5d6785;
  font-size: 13px;
}

/* ============================================================
   工作台布局（登录后，公共）
   ============================================================ */
.workspace { display: flex; height: 100vh; overflow: hidden; }

/* 顶部通栏 */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 60px;
  background: var(--bg-topbar);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  z-index: 50;
}
.topbar-logo { display: flex; align-items: center; gap: 9px; min-width: 200px; }
.topbar-logo-icon {
  width: 32px; height: 32px;
  background: var(--primary-grad);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  color: #fff;
}
.topbar-logo-text { font-size: 16.5px; font-weight: 700; white-space: nowrap; }
.topbar-page-name { font-size: 15.5px; font-weight: 600; color: var(--text-primary); flex: 1; min-width: 0; }

.topbar-right { display: flex; align-items: center; gap: 14px; }
.topbar-utils { display: flex; align-items: center; gap: 4px; margin: 0 2px; }
.util-btn {
  display: inline-flex; align-items: center; gap: 5px;
  height: 34px; padding: 0 11px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.util-btn:hover { border-color: var(--primary); color: var(--text-primary); background: var(--bg-hover); }
.util-btn span { font-weight: 500; }
@media (max-width: 1100px) {
  .util-btn span { display: none; }
  .util-btn { padding: 0 9px; }
}

.balance-pill {
  display: flex; align-items: center; gap: 7px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 15px;
  font-size: 13.5px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 0.2s ease;
}
.balance-pill:hover { border-color: var(--primary); }
.balance-num { color: var(--primary-light); font-weight: 700; font-size: 14.5px; }

.icon-btn {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text-primary); }

.avatar-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 3px 10px 3px 3px;
  border-radius: 999px;
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}
.avatar-btn:hover { border-color: var(--primary); background: var(--bg-hover); }
.avatar-circle {
  width: 30px; height: 30px;
  background: var(--primary-grad);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: #fff; font-weight: 600;
}
.avatar-name { font-size: 13px; font-weight: 500; }

/* 侧边导航 */
.sidebar {
  position: fixed;
  top: 60px; bottom: 0; left: 0;
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  transition: width 0.25s ease;
  z-index: 40;
  padding-bottom: 30px;
}
.sidebar.collapsed { width: 0; border-right: none; }
.sidebar-inner { min-width: var(--sidebar-w); padding: 14px 11px; }
/* 拖拽拉伸手柄 */
.sidebar-resizer {
  position: absolute; top: 0; right: -3px; width: 6px; height: 100%;
  cursor: col-resize; z-index: 55;
}
.sidebar-resizer:hover, .sidebar-resizer.active { background: var(--primary); opacity: 0.45; }
.sidebar.collapsed .sidebar-resizer { display: none; }
.sidebar.dragging, .sidebar.dragging + .content { transition: none; }

.nav-group { margin-bottom: 12px; }
.nav-group-header {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  margin: 0 4px 6px;
  border-radius: 11px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .3px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  transition: all .2s ease;
  text-transform: none;
}
.nav-group-header::before {
  content: ''; width: 3px; height: 13px; border-radius: 2px;
  background: var(--primary-grad); flex-shrink: 0;
}
.nav-group-header:hover { color: var(--text-primary); background: var(--bg-hover); transform: translateX(2px); }
.nav-group-header .arrow { font-size: 11px; transition: transform 0.2s ease; margin-left: auto; }
.nav-group.collapsed .arrow { transform: rotate(-90deg); }
.nav-group.collapsed .nav-items { display: none; }

.nav-items { padding: 2px 6px; display: flex; flex-direction: column; gap: 3px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 12px;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all .22s ease;
  position: relative;
  overflow: hidden;
}
.nav-item::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--primary-glow), transparent);
  opacity: 0; transition: opacity .22s ease; pointer-events: none;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); transform: translateX(3px); }
.nav-item:hover::after { opacity: .4; }
.nav-item.active {
  background: var(--primary-glow);
  color: var(--primary-light);
  font-weight: 700;
  transform: translateX(2px);
  box-shadow: 0 4px 14px var(--primary-glow);
}
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 6px; bottom: 6px;
  width: 3px; border-radius: 2px; background: var(--primary-grad);
  z-index: 1;
}
.nav-emoji {
  width: 30px; height: 30px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9px;
  background: var(--bg-hover);
  font-size: 15px;
  transition: all .25s ease;
  box-shadow: inset 0 0 0 1px var(--border);
}
.nav-item:hover .nav-emoji { background: var(--bg-card); box-shadow: inset 0 0 0 1px var(--border-strong); transform: scale(1.05); }
.nav-item.active .nav-emoji { background: var(--primary-grad); color: #fff; box-shadow: 0 4px 12px var(--primary-glow); }
.nav-item.coming { color: var(--text-muted); }
.nav-item.coming::after { content: '待上线'; font-size: 10px; color: var(--warning); margin-left: auto; }

.nav-star {
  background: var(--primary-grad);
  color: #fff !important;
  font-weight: 700;
  box-shadow: 0 6px 18px var(--primary-glow);
}
.nav-star:hover { filter: brightness(1.08); color: #fff !important; transform: translateX(4px) scale(1.02); }
.nav-star .nav-emoji { background: rgba(255, 255, 255, 0.22); color: #fff; box-shadow: none; }
.nav-star:hover .nav-emoji { background: rgba(255, 255, 255, 0.32); }

.nav-top { border-bottom: 1px solid var(--border); padding-bottom: 12px; margin-bottom: 12px; }

/* 内容区 */
.content {
  flex: 1;
  margin-left: var(--sidebar-w);
  margin-top: 60px;
  padding: 32px 36px;
  overflow-y: auto;
  transition: margin-left 0.25s ease;
  min-height: calc(100vh - 60px);
}
/* 路由切换淡入过渡 */
@keyframes routeFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.content.route-enter { animation: routeFadeIn 0.3s ease; }
.sidebar.collapsed + .content { margin-left: 0; }

/* 折叠按钮 */
.sidebar-toggle {
  position: fixed;
  top: 68px;
  left: 224px;
  z-index: 45;
  width: 26px; height: 26px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: left 0.25s ease, transform 0.2s ease;
  box-shadow: var(--shadow-card);
}
.sidebar-toggle:hover { color: var(--primary); }
.sidebar-toggle.rotated { transform: rotate(180deg); }

/* ============================================================
   弹窗系统（统一）
   ============================================================ */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 18, 0.62);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity 0.22s ease;
}
html[data-theme="light"] .modal-mask { background: rgba(30, 41, 82, 0.35); }
.modal-mask.show { opacity: 1; }

.modal {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  transform: translateY(18px) scale(0.98);
  transition: transform 0.22s ease;
}
.modal-mask.show .modal { transform: translateY(0) scale(1); }
.modal-sm { max-width: 380px; }
.modal-md { max-width: 460px; }
.modal-lg { max-width: 640px; }
.modal-xl { max-width: 860px; }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px 0;
}
.modal-title { font-size: 17px; font-weight: 700; }
.modal-close {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  color: var(--text-muted);
  transition: all 0.2s ease;
}
.modal-close:hover { background: var(--bg-hover); color: var(--text-primary); }
.modal-body { padding: 20px 22px; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 0 22px 20px;
}

/* 登录弹窗 */
.login-tabs { display: flex; gap: 6px; margin-bottom: 18px; background: var(--bg-input); border-radius: 10px; padding: 4px; }
.login-tab {
  flex: 1; padding: 8px 0; text-align: center;
  border-radius: 8px; font-size: 14px; font-weight: 500;
  color: var(--text-secondary); transition: all 0.2s ease;
}
.login-tab.active { background: var(--primary-grad); color: #fff; }

/* 提示弹窗图标（旧模态 toast 保留，showConfirm 等仍用） */
.toast-icon { width: 58px; height: 58px; border-radius: 50%; margin: 6px auto 16px; display: flex; align-items: center; justify-content: center; font-size: 27px; }
.toast-icon.success { background: var(--success-bg); color: var(--success); }
.toast-icon.warning { background: var(--warning-bg); color: var(--warning); }
.toast-icon.info { background: var(--primary-glow); color: var(--primary-light); }
.toast-text { text-align: center; font-size: 14.5px; color: var(--text-secondary); line-height: 1.8; }
.link-like { color: var(--primary-light); font-weight: 600; cursor: pointer; text-decoration: none; }
.link-like:hover { text-decoration: underline; }

/* 浮动 toast（非阻塞提示，不关闭当前弹窗） */
.toast-float {
  position: fixed; top: 22px; left: 50%;
  transform: translateX(-50%) translateY(-24px);
  z-index: 10000;
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-panel); border: 1px solid var(--border-strong);
  border-radius: 12px; padding: 12px 18px;
  box-shadow: var(--shadow-modal); max-width: 90vw;
  opacity: 0; transition: all 0.25s ease;
}
.toast-float.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-float-icon { font-size: 22px; flex-shrink: 0; }
.toast-float-body { min-width: 0; }
.toast-float-title { font-size: 14.5px; font-weight: 600; color: var(--text-primary); }
.toast-float-msg { font-size: 13px; color: var(--text-secondary); margin-top: 2px; word-break: break-all; }
.toast-float-close { border: none; background: transparent; color: var(--text-muted); cursor: pointer; font-size: 15px; padding: 2px 4px; }
.toast-float-close:hover { color: var(--text-primary); }

/* 大图预览 */
.preview-img-wrap { text-align: center; }
.preview-img-wrap img { max-width: 100%; max-height: 66vh; border-radius: 12px; }

/* ============================================================
   通用小工具
   ============================================================ */
.divider { border: none; border-top: 1px solid var(--border); margin: 14px 0; }

/* Loading 动画 */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--primary-light);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 生成中占位 */
.generating-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 15px;
  min-height: 280px;
  color: var(--text-secondary);
}
.generating-state .gen-text { font-size: 14.5px; }

/* 空状态 */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 13px;
  padding: 64px 20px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 46px; }
.empty-state .empty-text { font-size: 14.5px; }

/* 素材网格（我的作品） */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; }
.media-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: all 0.25s ease;
}
.media-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.media-thumb {
  aspect-ratio: 4/3;
  background: var(--bg-hover);
  display: flex; align-items: center; justify-content: center;
  font-size: 40px;
  position: relative;
}
.media-meta { padding: 12px 14px; }
.media-name { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-date { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.media-hover-actions {
  position: absolute; inset: 0;
  background: rgba(8,12,24,0.65);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  opacity: 0; transition: opacity 0.2s ease;
}
.media-card:hover .media-hover-actions { opacity: 1; }
.media-action-btn {
  width: 34px; height: 34px;
  background: rgba(255,255,255,0.14);
  border-radius: 8px;
  color: #fff; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s ease;
}
.media-action-btn:hover { background: var(--primary); }

/* 文件夹（我的作品） */
.folder-tree { display: flex; flex-direction: column; gap: 2px; }
.folder-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 11px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}
.folder-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.folder-item.active { background: var(--primary-glow); color: var(--primary-light); font-weight: 600; }
.folder-item .folder-ops { margin-left: auto; opacity: 0; transition: opacity 0.2s ease; display: flex; gap: 2px; }
.folder-item:hover .folder-ops { opacity: 1; }
.folder-op-btn {
  width: 24px; height: 24px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  color: var(--text-muted);
}
.folder-op-btn:hover { background: var(--bg-card); color: var(--text-primary); }

/* 表格 */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td {
  padding: 14px 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}
.table tr:hover td { background: var(--bg-hover); }
.table .amount-out { color: var(--danger); font-weight: 600; }
.table .amount-in { color: var(--success); font-weight: 600; }

/* 分页 */
.pagination { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 20px; }
.page-btn {
  min-width: 34px; height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 13.5px;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary-grad); color: #fff; border-color: transparent; }
.page-info { font-size: 13.5px; color: var(--text-muted); }

/* 套餐卡片（充值） */
.package-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.package-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  text-align: center;
  cursor: pointer;
  position: relative;
  box-shadow: var(--shadow-card);
  transition: all 0.25s ease;
}
.package-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: rgba(99,91,255,0.35); }
.package-card.recommend {
  border: 1px solid var(--primary);
  background: linear-gradient(160deg, var(--primary-glow), transparent 60%);
}
.package-recommend-tag {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  background: var(--primary-grad); color: #fff;
  font-size: 11.5px; font-weight: 600;
  padding: 3px 13px; border-radius: 999px;
  white-space: nowrap;
}
.package-name { font-size: 16px; font-weight: 600; }
.package-amount { font-size: 32px; font-weight: 700; margin: 14px 0 4px; }
.package-amount small { font-size: 15px; font-weight: 500; color: var(--text-muted); }
.package-price { font-size: 16px; color: var(--primary-light); font-weight: 600; margin-bottom: 16px; }
.package-desc { font-size: 13px; color: var(--text-muted); line-height: 1.8; }

/* 步骤条（短视频工厂） */
.steps-bar { display: flex; align-items: center; gap: 0; padding: 20px 26px; }
.step-item { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.step-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  font-size: 13px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.25s ease;
}
.step-item.active .step-num { background: var(--primary-grad); border-color: transparent; color: #fff; box-shadow: 0 0 12px var(--primary-glow); }
.step-item.done .step-num { background: var(--success-bg); border-color: var(--success-border); color: var(--success); }
.step-label { font-size: 14px; color: var(--text-muted); transition: color 0.2s ease; white-space: nowrap; }
.step-item.active .step-label { color: var(--text-primary); font-weight: 600; }
.step-line { flex: 1; height: 2px; background: var(--border); margin: 0 13px; min-width: 18px; }
.step-item.done + .step-line { background: var(--success); }

/* 对比滑块（老照片修复） */
.compare-wrap { position: relative; overflow: hidden; border-radius: 12px; border: 1px solid var(--border); user-select: none; touch-action: none; }
.compare-wrap img { display: block; width: 100%; height: 100%; object-fit: cover; }
.compare-after { position: absolute; inset: 0; overflow: hidden; }
.compare-divider {
  position: absolute; top: 0; bottom: 0;
  width: 2px; background: #fff;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
  cursor: ew-resize;
  z-index: 3;
}
.compare-handle {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 34px; height: 34px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 10px rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  color: #333; font-size: 12px;
  z-index: 3;
}
.compare-tag {
  position: absolute; top: 10px;
  font-size: 11px; font-weight: 600;
  padding: 3px 10px; border-radius: 999px;
  background: rgba(0,0,0,0.55); color: #fff;
  z-index: 3;
}
.compare-tag.left { left: 10px; }
.compare-tag.right { right: 10px; }

/* 框选（去水印） */
.crop-canvas-wrap { position: relative; overflow: hidden; border-radius: 12px; border: 1px solid var(--border); }
.crop-canvas-wrap img { display: block; width: 100%; cursor: crosshair; }
.crop-box {
  position: absolute;
  border: 2px dashed var(--primary-light);
  background: rgba(99,91,255,0.14);
  display: none;
  pointer-events: none;
}
.crop-box.show { display: block; }

/* 结果网格（文生图） */
.result-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; }
.result-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: all 0.25s ease;
  position: relative;
}
.result-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.result-img { aspect-ratio: 1/1; background: linear-gradient(135deg, #1e2a44, #141b30); display: flex; align-items: center; justify-content: center; font-size: 40px; }
.result-actions {
  position: absolute; right: 8px; bottom: 8px;
  display: flex; gap: 6px;
  opacity: 0; transition: opacity 0.2s ease;
}
.result-card:hover .result-actions { opacity: 1; }
.result-actions button {
  width: 30px; height: 30px;
  background: rgba(10,14,26,0.75);
  border-radius: 7px;
  color: #e6eaf5; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s ease;
}
.result-actions button:hover { background: var(--primary); }
.result-tag { position: absolute; top: 8px; left: 8px; font-size: 10px; background: rgba(10,14,26,0.7); color: #9aa3bd; padding: 2px 8px; border-radius: 6px; }

/* 上传占位 */
.upload-zone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-md);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 11px;
  min-height: 230px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.25s ease;
  background: var(--bg-input);
}
.upload-zone:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-glow); }
.upload-zone .up-icon { font-size: 40px; }
.upload-zone.has-img { border-style: solid; border-color: var(--success-border); }

/* 公告卡片 */
.notice-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: all 0.25s ease;
}
.notice-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.notice-title { font-size: 15.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.notice-date { font-size: 12.5px; color: var(--text-muted); margin-top: 5px; }
.notice-badge { font-size: 10.5px; background: var(--danger-bg); color: var(--danger); padding: 2px 9px; border-radius: 999px; font-weight: 600; }

/* 帮助中心 */
.help-layout { display: flex; gap: 24px; }
.help-side { width: 220px; flex-shrink: 0; }
.help-content { flex: 1; min-width: 0; }

/* 邀请码框 */
.invite-code-box {
  background: var(--bg-input);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px;
}
.invite-code { font-size: 19px; font-weight: 700; letter-spacing: 2px; font-family: 'Courier New', monospace; }

/* 二维码占位 */
.qr-placeholder {
  width: 150px; height: 150px;
  margin: 0 auto;
  border-radius: 12px;
  background: repeating-conic-gradient(#2a3654 0% 25%, #1a2238 0% 50%) 50% / 12px 12px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
}
html[data-theme="light"] .qr-placeholder { background: repeating-conic-gradient(#dfe5f1 0% 25%, #f4f6fb 0% 50%) 50% / 12px 12px; }

/* ============================================================
   通用页面 Banner · 大色块（复刻参考图视觉系统）
   用法：<div class="page-banner b1"><div class="page-banner-ico">🖼️</div>
          <div class="page-banner-info"><div class="page-banner-title">...</div>
          <div class="page-banner-sub">...</div></div>
          <div class="page-banner-tag">待上线</div></div>
   主题：b1 深色 / b2 蓝紫渐变 / b3 紫色 / b4 粉橙渐变 / b5 青色渐变
   ============================================================ */
.page-banner {
  display: flex; align-items: center; gap: 18px;
  padding: 20px 26px;
  border-radius: 16px;
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.06);
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  transition: transform .25s ease, box-shadow .25s ease;
}
.page-banner:hover { transform: translateY(-1px); box-shadow: 0 12px 30px rgba(0,0,0,.32); }
.page-banner::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(120% 100% at 0% 50%, rgba(255,255,255,.18), transparent 60%);
  pointer-events: none;
}
.page-banner-ico {
  width: 56px; height: 56px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 14px;
  background: rgba(255,255,255,.15);
  backdrop-filter: blur(8px);
  font-size: 28px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
  position: relative; z-index: 1;
}
.page-banner-info { flex: 1; min-width: 0; position: relative; z-index: 1; }
.page-banner-title {
  font-size: 22px; font-weight: 800; color: #fff;
  margin-bottom: 6px;
  text-shadow: 0 1px 2px rgba(0,0,0,.18);
  display: flex; align-items: center; gap: 10px;
}
.page-banner-sub {
  font-size: 14px; color: rgba(255,255,255,.78);
  font-weight: 500;
}
.page-banner-tag {
  flex-shrink: 0;
  padding: 7px 16px;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  backdrop-filter: blur(8px);
  font-size: 13px; font-weight: 700;
  color: #fff;
  border: 1px solid rgba(255,255,255,.25);
  position: relative; z-index: 1;
  letter-spacing: .3px;
}
.page-banner-tag.status-hot { background: rgba(239,68,68,.88); border-color: rgba(239,68,68,.5); }
.page-banner-tag.status-new { background: rgba(16,185,129,.88); border-color: rgba(16,185,129,.5); }

/* 主题 */
.page-banner.b1 { background: linear-gradient(135deg, #0f1729 0%, #1e293b 60%, #334155 100%); }
.page-banner.b2 { background: linear-gradient(135deg, #1e3a8a 0%, #4f46e5 50%, #7c3aed 100%); }
.page-banner.b3 { background: linear-gradient(135deg, #7e22ce 0%, #c026d3 50%, #db2777 100%); }
.page-banner.b4 { background: linear-gradient(135deg, #be123c 0%, #f59e0b 60%, #facc15 100%); }
.page-banner.b5 { background: linear-gradient(135deg, #0d9488 0%, #0891b2 50%, #1d4ed8 100%); }
.page-banner.b6 { background: linear-gradient(135deg, #1f2937 0%, #4338ca 50%, #7c3aed 100%); }

@media (max-width: 760px) {
  .page-banner { padding: 16px 18px; gap: 14px; }
  .page-banner-ico { width: 46px; height: 46px; font-size: 22px; }
  .page-banner-title { font-size: 18px; }
  .page-banner-sub { font-size: 13px; }
  .page-banner-tag { padding: 5px 12px; font-size: 12px; }
}

/* 响应式（PC 优先，小屏简单降级） */
@media (max-width: 1200px) {
  .home-tools, .package-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .home-tools, .package-grid { grid-template-columns: repeat(2, 1fr); }
  .home-stats { gap: 28px; }
}

/* ============================================================
   爆款视频复刻 · 三列大色块工作台（复刻参考图视觉）
   布局：3 列等宽 grid，每列顶部高对比色块标题 + 下拉/AI/自定义三选项
   ============================================================ */
.repl { display: flex; flex-direction: column; gap: 20px; }

.repl-title { font-size: 21px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.repl-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--primary-grad); box-shadow: 0 0 12px var(--primary-glow); flex-shrink: 0; }

.repl-cols { display: grid; grid-template-columns: 1fr 1.1fr 1fr; gap: 22px; align-items: start; }
.repl-col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

/* 大色块标题（3 列顶部） */
.repl-banner {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex; align-items: center; gap: 14px;
  color: #fff;
  overflow: hidden;
  box-shadow: 0 6px 22px rgba(0,0,0,.35);
  transition: transform .25s ease, box-shadow .25s ease;
}
.repl-banner:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0,0,0,.45); }
.repl-banner.b1 { background: linear-gradient(135deg, #1e2236 0%, #2a2f4a 100%); border: 1px solid rgba(255,255,255,.06); }
.repl-banner.b2 { background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%); }
.repl-banner.b3 { background: linear-gradient(135deg, #a855f7 0%, #6d28d9 100%); }
.repl-banner::after {
  content: ''; position: absolute; right: -30px; top: -30px;
  width: 140px; height: 140px; border-radius: 50%;
  background: rgba(255,255,255,.08);
  pointer-events: none;
}
.repl-banner-ico {
  width: 46px; height: 46px; flex-shrink: 0;
  border-radius: 12px;
  background: rgba(255,255,255,.18);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 24px; backdrop-filter: blur(6px);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.15);
}
.repl-banner.b1 .repl-banner-ico { background: rgba(255,255,255,.08); }
.repl-banner-info { flex: 1; min-width: 0; }
.repl-banner-title { font-size: 18px; font-weight: 700; line-height: 1.3; color: #fff; text-shadow: 0 0 12px rgba(54, 207, 251, 0.4); }
.repl-banner-title.grad-text { text-shadow: none; }
.repl-banner-sub { font-size: 13px; opacity: .92; margin-top: 4px; color: rgba(255, 255, 255, 0.9); }
.repl-banner-tag {
  position: absolute; right: 16px; top: 16px;
  background: rgba(0,0,0,.3); color: #fff;
  font-size: 11.5px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px;
  letter-spacing: .3px;
  z-index: 1;
}
.repl-banner.b1 .repl-banner-tag { background: rgba(255,255,255,.1); }

/* 卡片 section */
.repl-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 20px;
  box-shadow: var(--shadow-card);
  transition: border-color .2s, transform .2s, box-shadow .2s;
  /* 关键：让内部绝对定位的下拉菜单有锚点，避免溢出 section 与下方卡片重叠/闪烁 */
  position: relative;
  /* 避免下拉菜单被 section 边界裁切，菜单浮在它自己的堆叠上下文里 */
  z-index: 1;
}
.repl-section:hover { border-color: var(--border-strong); transform: translateY(-1px); }
/* 当下拉打开时，把当前 section 提到最上层，避免菜单被下方卡片盖住 */
.repl-section:has(.repl-dd.open) { z-index: 50; }
.repl-section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px; gap: 10px;
}
.repl-section-title { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 9px; }
.repl-section-title .ri {
  width: 28px; height: 28px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px; background: var(--primary-glow); font-size: 15px;
}
.repl-section-meta { font-size: 12.5px; color: var(--text-muted); }

/* 导入条 — 图标容器化、padding 加大，更精致协调 */
.repl-import-row { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.repl-url-wrap {
  flex: 1; min-width: 0; position: relative;
  display: flex; align-items: center;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 4px 14px 4px 4px;
  transition: all .25s ease;
}
.repl-url-wrap:hover { border-color: var(--border-strong); }
.repl-url-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
  background: var(--bg-card);
}
.repl-url-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; flex-shrink: 0;
  background: linear-gradient(135deg, rgba(59, 130, 246, .12), rgba(168, 85, 247, .12));
  border-radius: 9px;
  font-size: 16px;
  margin-right: 10px;
  pointer-events: none;
}
.repl-url {
  flex: 1; min-width: 0;
  border: none !important;
  background: transparent !important;
  padding: 10px 0 !important;
  font-size: 14.5px !important;
  box-shadow: none !important;
}
.repl-url:focus { box-shadow: none !important; }
.repl-import-hint {
  font-size: 12.5px; color: var(--text-muted);
  margin-top: 10px; line-height: 1.6;
  padding-left: 4px;
}
.repl-import-hint::before {
  content: "💡"; margin-right: 4px;
}

/* 文本域 — 加大尺寸、更精致、字符计数 pill 化 */
.repl-textarea {
  min-height: 160px;
  padding: 16px 18px;
  line-height: 1.85;
  font-size: 14.5px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--bg-input);
  transition: all .25s ease;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.04);
}
.repl-textarea:focus {
  border-color: var(--primary);
  background: var(--bg-card);
  box-shadow: 0 0 0 4px var(--primary-glow), inset 0 1px 2px rgba(0,0,0,.04);
}
.repl-textarea-lg {
  min-height: 320px;
  padding: 18px 20px;
  line-height: 1.9;
  font-size: 15px;
  border-radius: 14px;
}
.repl-textarea-lg:focus {
  border-color: var(--primary);
  background: var(--bg-card);
  box-shadow: 0 0 0 4px var(--primary-glow);
}
/* 时间轴分段内的小文本域 */
.repl-seg textarea.form-input,
.repl-seg .form-textarea {
  min-height: 110px;
  padding: 12px 14px;
  line-height: 1.75;
  font-size: 14px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  transition: all .2s;
}
.repl-seg textarea.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* 改写风格 pills — 更精致 */
.repl-style-tabs { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.repl-tab {
  font-size: 14px; font-weight: 500;
  padding: 8px 18px; border-radius: 999px;
  border: 1.5px solid var(--border-strong);
  color: var(--text-secondary);
  background: var(--bg-input);
  cursor: pointer;
  transition: all .25s ease;
  position: relative;
  display: inline-flex; align-items: center; gap: 6px;
}
.repl-tab::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-muted); opacity: .5;
  transition: all .25s;
}
.repl-tab:hover {
  border-color: var(--primary);
  color: var(--text-primary);
  transform: translateY(-1px);
}
.repl-tab:hover::before { opacity: 1; background: var(--primary); }
.repl-tab.active {
  background: var(--primary-grad);
  color: #fff;
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 4px 14px var(--primary-glow), inset 0 1px 0 rgba(255,255,255,.15);
}
.repl-tab.active::before { background: #fff; opacity: 1; }

/* 时间轴 — 卡片化、左侧渐变色条区分三段、字数 pill 化 */
.repl-timeline { display: flex; flex-direction: column; gap: 14px; }
.repl-tl-empty {
  font-size: 13px; color: var(--text-muted);
  padding: 22px;
  text-align: center;
  border: 1.5px dashed var(--border-strong);
  border-radius: 12px;
  background: var(--bg-input);
}
.repl-seg {
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px 14px 18px;
  position: relative;
  overflow: hidden;
  transition: all .25s ease;
}
.repl-seg:hover { border-color: var(--border-strong); transform: translateY(-1px); }
/* 左侧渐变色条 + 三段色彩区分（深/浅主题都协调） */
.repl-seg::before {
  content: "";
  position: absolute;
  top: 10px; bottom: 10px; left: 0;
  width: 4px; border-radius: 0 4px 4px 0;
  background: var(--primary-grad);
}
.repl-seg:nth-child(1)::before { background: linear-gradient(180deg, #38bdf8, #0ea5e9); }   /* 开场：天空蓝 */
.repl-seg:nth-child(2)::before { background: linear-gradient(180deg, #a78bfa, #7c3aed); }   /* 主体：紫罗兰 */
.repl-seg:nth-child(3)::before { background: linear-gradient(180deg, #f472b6, #db2777); }   /* 结尾：玫粉 */
.repl-seg:nth-child(4)::before { background: linear-gradient(180deg, #fbbf24, #f59e0b); }   /* 备用：金橙 */
.repl-seg-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px; gap: 10px;
}
.repl-seg-name {
  font-size: 14.5px; font-weight: 700;
  display: flex; align-items: center; gap: 9px;
  color: var(--text-primary);
  letter-spacing: .2px;
}
.repl-seg-name::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--primary-grad);
  flex-shrink: 0;
  box-shadow: 0 0 8px var(--primary-glow);
}
.repl-seg:nth-child(1) .repl-seg-name::before { background: #38bdf8; box-shadow: 0 0 8px rgba(56,189,248,.5); }
.repl-seg:nth-child(2) .repl-seg-name::before { background: #a78bfa; box-shadow: 0 0 8px rgba(167,139,250,.5); }
.repl-seg:nth-child(3) .repl-seg-name::before { background: #f472b6; box-shadow: 0 0 8px rgba(244,114,182,.5); }
.repl-seg:nth-child(4) .repl-seg-name::before { background: #fbbf24; box-shadow: 0 0 8px rgba(251,191,36,.5); }
.repl-seg-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary-grad); flex-shrink: 0; }
/* 字数 pill */
.repl-seg-head .repl-section-meta {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

/* 三选项模式切换：下拉 / AI生成 / 自定义 */
.repl-mode-tabs { display: inline-flex; gap: 4px; background: var(--bg-input); border: 1px solid var(--border); border-radius: 10px; padding: 4px; margin-bottom: 14px; }
.repl-mode { padding: 7px 16px; border-radius: 7px; font-size: 13px; font-weight: 500; color: var(--text-secondary); cursor: pointer; transition: all .2s; }
.repl-mode:hover { color: var(--text-primary); }
.repl-mode.active { background: var(--primary-grad); color: #fff; box-shadow: 0 2px 8px var(--primary-glow); }

.repl-mode-panel { display: none; }
.repl-mode-panel.active { display: block; animation: replFadeIn .25s ease; }
@keyframes replFadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* 自定义下拉（参考图风格：圆角芯片 + 选中渐变） */
.repl-dd { position: relative; }
.repl-dd-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 13px 15px; border-radius: 11px;
  background: var(--bg-input); border: 1px solid var(--border);
  font-size: 14.5px; color: var(--text-primary);
  cursor: pointer; transition: all .2s;
  width: 100%;
  min-height: 48px;
}
.repl-dd-trigger:hover { border-color: var(--border-strong); }
.repl-dd-trigger.open { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.repl-dd-label { display: flex; align-items: center; gap: 9px; min-width: 0; }
.repl-dd-ico { width: 28px; height: 28px; border-radius: 7px; background: var(--primary-glow); display: inline-flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.repl-dd-name { font-weight: 500; }
.repl-dd-name small { font-size: 12px; color: var(--text-muted); margin-left: 6px; }
.repl-dd-arrow { font-size: 11px; color: var(--text-muted); transition: transform .2s; }
.repl-dd-trigger.open .repl-dd-arrow { transform: rotate(180deg); }
.repl-dd-menu {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--bg-card); border: 1px solid var(--border-strong);
  border-radius: 11px; padding: 6px;
  box-shadow: 0 14px 36px rgba(0,0,0,.35);
  /* 关键：相对 .repl-section(relative) 定位，永远不会溢出当前 section 边界 */
  z-index: 40; max-height: 280px; overflow-y: auto;
  display: none;
}
.repl-dd.open .repl-dd-menu { display: block; animation: replFadeIn .2s ease; }
.repl-dd-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
  font-size: 14px; color: var(--text-secondary);
  cursor: pointer; transition: all .15s;
}
.repl-dd-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.repl-dd-item.active { background: var(--primary-glow); color: var(--text-primary); font-weight: 600; }
.repl-dd-item .di-ico { width: 24px; height: 24px; border-radius: 6px; background: var(--bg-input); display: inline-flex; align-items: center; justify-content: center; font-size: 14px; }

/* 自定义上传区 */
.repl-upload {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-md);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; min-height: 120px;
  color: var(--text-muted); cursor: pointer;
  transition: all .2s; background: var(--bg-input);
  text-align: center; padding: 18px;
}
.repl-upload:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-glow); transform: translateY(-1px); }
.repl-upload .up-ico { font-size: 30px; }
.repl-upload .up-title { font-size: 14px; font-weight: 600; }
.repl-upload .up-sub { font-size: 12.5px; }
.repl-upload.has-file { border-style: solid; border-color: var(--success-border); color: var(--success); background: rgba(16, 185, 129, 0.08); }

/* AI 生成区（参考图"AI生成"按钮风格） */
.repl-ai {
  display: flex; flex-direction: column; gap: 12px;
  padding: 16px; border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(59, 130, 246, .08), rgba(168, 85, 247, .08));
  border: 1px solid var(--border);
}
.repl-ai-prompt { display: flex; align-items: center; gap: 10px; }
.repl-ai-tag {
  font-size: 12px; font-weight: 700;
  background: var(--primary-grad); color: #fff;
  padding: 4px 10px; border-radius: 999px;
  box-shadow: 0 2px 8px var(--primary-glow);
}
.repl-ai-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.repl-ai-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 8px;
  text-align: center; cursor: pointer; font-size: 13px; color: var(--text-secondary);
  transition: all .2s;
}
.repl-ai-card:hover { border-color: var(--primary); color: var(--text-primary); transform: translateY(-2px); }
.repl-ai-card.active { border-color: var(--primary); background: var(--primary-glow); color: var(--text-primary); font-weight: 600; }
.repl-ai-card .ac-ico { font-size: 24px; margin-bottom: 6px; }
.repl-ai-btn { width: 100%; margin-top: 4px; }

/* 通用：开关、滑块、色板 */
.repl-switch { display: flex; align-items: center; gap: 12px; cursor: pointer; margin-bottom: 14px; user-select: none; }
.repl-switch input { display: none; }
.repl-switch-track { width: 46px; height: 25px; border-radius: 999px; background: var(--bg-input); border: 1px solid var(--border-strong); position: relative; transition: all .2s; flex-shrink: 0; }
.repl-switch-dot { position: absolute; top: 2px; left: 2px; width: 19px; height: 19px; border-radius: 50%; background: var(--text-muted); transition: all .2s; }
.repl-switch input:checked + .repl-switch-track { background: var(--primary-grad); border-color: transparent; }
.repl-switch input:checked + .repl-switch-track .repl-switch-dot { left: 23px; background: #fff; }
.repl-switch-label { font-size: 14.5px; font-weight: 500; color: var(--text-primary); }

.repl-swatches { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 10px; }
.repl-swatch { width: 36px; height: 36px; border-radius: 9px; cursor: pointer; border: 2px solid transparent; transition: all .2s; }
.repl-swatch:hover { transform: scale(1.1); }
.repl-swatch.active { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }

.repl-range { display: flex; align-items: center; gap: 12px; }
.repl-range input[type=range] { flex: 1; accent-color: var(--primary); min-width: 80px; height: 6px; }
.repl-range span { font-size: 14px; color: var(--text-secondary); min-width: 46px; text-align: right; font-weight: 500; }

.repl-hint { font-size: 12.5px; color: var(--text-muted); margin-top: 12px; line-height: 1.7; }

/* 叠加层管理（自定义编辑） */
.repl-overlay-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.repl-overlay-empty { font-size: 13px; color: var(--text-muted); padding: 16px; text-align: center; border: 1px dashed var(--border); border-radius: var(--radius-sm); }
.repl-overlay-item { display: flex; align-items: center; gap: 10px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 9px 12px; font-size: 13.5px; }
.repl-overlay-item .ov-ico { width: 26px; height: 26px; border-radius: 7px; background: var(--primary-glow); display: inline-flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.repl-overlay-item .ov-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-secondary); }
.repl-overlay-item .ov-del { width: 24px; height: 24px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; color: var(--text-muted); cursor: pointer; transition: all .2s; flex-shrink: 0; }
.repl-overlay-item .ov-del:hover { background: var(--danger-bg); color: var(--danger); }

/* 底部合成条 */
.repl-footbar {
  padding: 20px 24px;
  background: linear-gradient(135deg, rgba(59, 130, 246, .08), rgba(168, 85, 247, .08));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex; flex-direction: column; gap: 16px;
}
.repl-foot-main { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.repl-foot-info { min-width: 0; }
.repl-foot-info h4 { margin: 0 0 4px 0; font-size: 16px; font-weight: 700; }
.repl-foot-sum { font-size: 13.5px; color: var(--text-muted); }
.repl-foot-sum b { color: var(--primary-light); font-weight: 600; }
.repl-synth { padding: 13px 34px; font-size: 16px; }

.repl-progress-bar { height: 9px; background: var(--bg-input); border-radius: 999px; overflow: hidden; }
.repl-progress-bar > div { height: 100%; width: 0; background: var(--primary-grad); transition: width .4s; }
.repl-progress-status { font-size: 14px; color: var(--text-secondary); margin-top: 10px; }

.repl-result { margin-top: 18px; display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
.repl-preview { text-align: center; flex-shrink: 0; }
.repl-preview-screen { position: relative; width: 210px; aspect-ratio: 9/16; background: #000; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 54px; overflow: hidden; box-shadow: 0 12px 30px rgba(0,0,0,.45); }
.repl-preview-screen .repl-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.repl-play-btn { width: 56px; height: 56px; background: rgba(255,255,255,.2); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 22px; cursor: pointer; color: #fff; }
.repl-preview-dur { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,.65); color: #fff; font-size: 12px; padding: 3px 11px; border-radius: 999px; }

.repl-ov-text { position: absolute; left: 0; right: 0; text-align: center; font-weight: 700; text-shadow: 0 2px 8px rgba(0,0,0,.7); padding: 0 14px; pointer-events: none; }
.repl-ov-pip { position: absolute; border-radius: 8px; overflow: hidden; box-shadow: 0 4px 14px rgba(0,0,0,.5); pointer-events: none; display: flex; align-items: center; justify-content: center; font-size: 24px; background: rgba(255,255,255,.15); }
.repl-preview-actions { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }
.repl-distribute { flex: 1; min-width: 220px; }
.repl-dist-title { font-size: 15px; font-weight: 600; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.repl-dist-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.repl-dist-btns .btn { flex: 1; min-width: 90px; }

/* 响应式 */
@media (max-width: 1180px) {
  .repl-cols { grid-template-columns: 1fr 1fr; }
  .repl-cols > .repl-col:nth-child(3) { grid-column: span 2; }
}
@media (max-width: 760px) {
  .repl-cols { grid-template-columns: 1fr; }
  .repl-cols > .repl-col:nth-child(3) { grid-column: auto; }
  .repl-import-row { flex-direction: column; align-items: stretch; }
}

/* ==========================================================================
   爆款复刻 v2 — 参考图风格：步骤卡 + 深色大文本 + 渐变大按钮 + 预览屏
   ========================================================================== */

/* 顶部提示条 */
.repl-tip {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  background: linear-gradient(90deg, rgba(251, 146, 60, .18), rgba(251, 191, 36, .12));
  border: 1px solid rgba(251, 146, 60, .35);
  border-radius: 12px;
  margin-bottom: 18px;
  color: #fed7aa;
  font-size: 13.5px;
}
.repl-tip-ico { font-size: 17px; flex-shrink: 0; }
.repl-tip-text { flex: 1; }
.repl-tip-close {
  cursor: pointer; opacity: .55; font-size: 14px;
  padding: 2px 8px; border-radius: 6px;
  transition: all .2s;
}
.repl-tip-close:hover { opacity: 1; background: rgba(255,255,255,.08); }

/* 步骤卡：01/02/03 大编号 + 标题 + 右上动作 */
.repl-step {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(59, 130, 246, .12), rgba(168, 85, 247, .08));
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-top: 4px;
}
.repl-step-no {
  font-size: 30px; font-weight: 800;
  background: var(--primary-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -.5px;
  line-height: 1;
  flex-shrink: 0;
  min-width: 56px;
}
.repl-step-info { flex: 1; min-width: 0; }
.repl-step-title { font-size: 16px; font-weight: 700; color: var(--text-primary); line-height: 1.3; }
.repl-step-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 3px; }
.repl-step-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* 复刻卡（替代 .repl-section 的视觉基线） */
.repl-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 12px;
  position: relative;
  z-index: 1;
}
.repl-card:has(.repl-dd.open) { z-index: 50; }

/* 分段 Tab（实色 + 黑底拼接风） */
.repl-seg-tabs {
  display: flex; gap: 6px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
}
.repl-seg-tab {
  flex: 1;
  padding: 9px 14px;
  border-radius: 7px;
  font-size: 13.5px; font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: center;
  transition: all .2s;
}
.repl-seg-tab:hover { color: var(--text-primary); }
.repl-seg-tab.active {
  background: var(--primary-grad);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 3px 12px var(--primary-glow);
}

/* URL 行（输入框 + 多个右侧小按钮） */
.repl-url-row { display: flex; gap: 8px; align-items: center; }
.repl-url-row .repl-url-wrap { flex: 1; min-width: 0; }
.repl-url-row .repl-url-wrap.wide { flex: 1; }

/* 小型胶囊按钮（mini-btn / pill-btn） */
.repl-mini-btn {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px 12px;
  font-size: 13px; font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 4px;
}
.repl-mini-btn:hover { border-color: var(--primary); color: var(--text-primary); transform: translateY(-1px); }
.repl-mini-btn.accent { color: var(--primary-light); border-color: rgba(168, 85, 247, .35); background: rgba(168, 85, 247, .1); }
.repl-mini-btn.accent:hover { background: rgba(168, 85, 247, .2); }

.repl-pill-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 13.5px; font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
  justify-content: center;
}
.repl-pill-btn:hover { transform: translateY(-1px); }
.repl-pill-btn.primary {
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 3px 12px rgba(59, 130, 246, .35);
}
.repl-pill-btn.primary:hover { box-shadow: 0 6px 20px rgba(59, 130, 246, .5); }
.repl-pill-btn.accent {
  background: linear-gradient(135deg, #a855f7, #ec4899);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 3px 12px rgba(168, 85, 247, .35);
}
.repl-pill-btn.accent:hover { box-shadow: 0 6px 20px rgba(168, 85, 247, .5); }
.repl-pill-btn.ghost { background: var(--bg-input); border-color: var(--border-strong); color: var(--text-secondary); }
.repl-pill-btn.ghost:hover { border-color: var(--primary); color: var(--primary-light); }
.repl-pill-btn.wide { width: 100%; }

/* 深色大文本框 */
.repl-textarea-dark {
  width: 100%;
  min-height: 220px;
  background: #06090f;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14.5px;
  line-height: 1.85;
  outline: none;
  resize: vertical;
  transition: all .25s ease;
}
.repl-textarea-dark:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
}
.repl-char-count {
  text-align: right;
  font-size: 12px; color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  margin-top: -6px;
}
.repl-char-count span { color: var(--primary-light); font-weight: 600; }

/* 两列行 + 平铺字段 */
.repl-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.repl-row-2.split button { min-height: 42px; font-size: 14px; }
.repl-row-tags { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }
.repl-flat-field { display: flex; align-items: center; gap: 12px; }
.repl-flat-field label {
  font-size: 14px; color: var(--text-secondary);
  min-width: 96px; font-weight: 500;
}
.repl-flat-input {
  flex: 1; min-width: 0;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 9px 14px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: all .2s;
}
.repl-flat-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }

/* 数字声音子 Tab */
.repl-row-icons { display: flex; gap: 6px; margin-bottom: 8px; }
.repl-icon-tab {
  flex: 1;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  text-align: center;
  transition: all .2s;
}
.repl-icon-tab:hover { color: var(--text-primary); }
.repl-icon-tab.active { background: rgba(59, 130, 246, .15); border-color: var(--primary); color: var(--primary-light); font-weight: 600; }

/* 数字人形象选择 */
.repl-digital-pick {
  display: flex; gap: 16px; align-items: center;
  padding: 14px;
  background: rgba(59, 130, 246, .06);
  border: 1.5px dashed rgba(59, 130, 246, .35);
  border-radius: 12px;
}
.repl-digital-img {
  width: 84px; height: 84px;
  border-radius: 14px;
  background: linear-gradient(135deg, #fda4af, #c4b5fd);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(0,0,0,.3);
}
.repl-digital-emoji { font-size: 38px; line-height: 1; }
.repl-digital-name { font-size: 11px; color: #1f2937; font-weight: 700; margin-top: 2px; }
.repl-digital-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.repl-digital-label { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.repl-digital-meta { font-size: 12px; color: var(--text-muted); }
.repl-digital-info .repl-pill-btn { align-self: flex-start; }

/* 大渐变按钮（生成数字视频 / 手抖执行发布） */
.repl-gradient-btn {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 16px 24px;
  background: linear-gradient(135deg, #3b82f6 0%, #a855f7 100%);
  border: none;
  border-radius: 14px;
  color: #fff;
  font-size: 16px; font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(99, 102, 241, .35);
  transition: all .25s ease;
  letter-spacing: .3px;
}
.repl-gradient-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(99, 102, 241, .55);
  filter: brightness(1.08);
}
.repl-gradient-btn:disabled { opacity: .5; cursor: not-allowed; }
.repl-gradient-btn.publish {
  background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 50%, #a855f7 100%);
  font-size: 17px;
}
.repl-gradient-btn .gb-ico { font-size: 18px; }
.repl-gradient-btn .gb-arrow { font-size: 18px; transition: transform .25s; }
.repl-gradient-btn:hover:not(:disabled) .gb-arrow { transform: translateX(4px); }

/* 子行（标签 + 按钮组） */
.repl-sub-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap;
  padding-top: 6px;
}
.repl-sub-row.tight { padding: 0; margin-bottom: 4px; }
.repl-sub-row.tags { justify-content: flex-start; }
.repl-sub-label {
  font-size: 13.5px; color: var(--text-secondary);
  display: inline-flex; align-items: center; gap: 8px;
}
.repl-sub-label strong { color: var(--text-primary); font-weight: 700; }
.repl-sub-label .muted { color: var(--text-muted); font-size: 12.5px; }
.repl-t-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  background: var(--primary-grad);
  color: #fff;
  border-radius: 6px;
  font-size: 13px; font-weight: 800;
}

/* 空状态盒 */
.repl-empty-box {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 32px 18px;
  background: #06090f;
  border: 1.5px dashed var(--border-strong);
  border-radius: 12px;
  color: var(--text-muted);
}
.repl-empty-box .empty-ico { font-size: 32px; }
.repl-empty-box .empty-text { font-size: 14px; }
.repl-empty-box .big { font-size: 42px; }

/* 字幕工具栏（字号/字体/间距/描边/位置） */
.repl-toolbar {
  display: flex; flex-direction: column; gap: 12px;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.repl-tool-row {
  display: grid; grid-template-columns: 50px 1fr 60px;
  align-items: center; gap: 12px;
  font-size: 13px;
}
.repl-tool-row label { color: var(--text-muted); font-weight: 500; }
.repl-tool-row input[type=range] {
  width: 100%; accent-color: var(--primary);
}
.repl-tool-row select {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 7px 10px;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  cursor: pointer;
}
.repl-tool-row span {
  font-size: 13px; color: var(--text-primary);
  text-align: right; font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* 大预览屏 */
.repl-preview-big { display: flex; flex-direction: column; gap: 12px; }
.repl-preview-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.repl-pill-tag {
  background: rgba(59, 130, 246, .12);
  border: 1px solid rgba(59, 130, 246, .3);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px; font-weight: 500;
  color: #93c5fd;
  cursor: pointer;
  transition: all .2s;
}
.repl-pill-tag.blue { background: rgba(59, 130, 246, .12); border-color: rgba(59, 130, 246, .3); color: #93c5fd; }
.repl-pill-tag:hover { background: rgba(59, 130, 246, .2); border-color: var(--primary); }

.repl-preview-screen {
  position: relative;
  width: 100%;
  aspect-ratio: 9/16;
  max-height: 360px;
  background:
    radial-gradient(circle at 50% 35%, #3a2818 0%, #1a1014 70%),
    #0a0a0a;
  background-blend-mode: normal;
  border-radius: 14px;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05), 0 8px 24px rgba(0,0,0,.4);
}
.repl-preview-overlay-text {
  position: absolute;
  top: 12%; left: 8%; right: 8%;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,.8), 0 0 2px rgba(0,0,0,.9);
  letter-spacing: .5px;
  line-height: 1.5;
}
.repl-preview-overlay-text .hl { color: #fde047; font-size: 19px; }
.repl-preview-figure {
  font-size: 96px;
  filter: drop-shadow(0 6px 16px rgba(0,0,0,.5));
  opacity: .9;
}
.repl-play-btn {
  position: absolute;
  bottom: 18px; left: 50%;
  transform: translateX(-50%);
  width: 56px; height: 56px;
  background: rgba(255,255,255,.15);
  border: 2px solid rgba(255,255,255,.35);
  border-radius: 50%;
  color: #fff; font-size: 22px;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: all .2s;
}
.repl-play-btn:hover { background: rgba(255,255,255,.3); transform: translateX(-50%) scale(1.08); }
.repl-preview-dur {
  position: absolute;
  bottom: 18px; right: 18px;
  background: rgba(0,0,0,.6);
  color: #fff;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 6px;
  font-variant-numeric: tabular-nums;
}
.repl-preview-foot { display: flex; gap: 8px; justify-content: center; }

/* 发布区 */
.repl-publish-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 36px 18px;
  background: #06090f;
  border: 1.5px dashed var(--border-strong);
  border-radius: 12px;
}

.repl-publish-mode { display: flex; gap: 18px; align-items: center; padding: 4px 4px 0; }
.repl-radio {
  display: inline-flex; align-items: center; gap: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-secondary);
  user-select: none;
}
.repl-radio input { display: none; }
.repl-radio .radio-dot {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  background: var(--bg-card);
  position: relative;
  transition: all .2s;
  flex-shrink: 0;
}
.repl-radio.active { color: var(--primary-light); font-weight: 600; }
.repl-radio.active .radio-dot { border-color: var(--primary); }
.repl-radio.active .radio-dot::after {
  content: ""; position: absolute;
  inset: 3px; border-radius: 50%;
  background: var(--primary-grad);
}

/* 多平台分发按钮（独立 .repl-dist-btn，与原 .repl-dist-btns 兼容） */
.repl-dist-btn {
  flex: 1; min-width: 90px;
  background: var(--bg-input);
  border: 1.5px solid var(--border-strong);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13.5px; font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all .2s;
}
.repl-dist-btn:hover { border-color: var(--primary); color: var(--text-primary); transform: translateY(-1px); }
.repl-dist-btn.on {
  background: rgba(59, 130, 246, .15);
  border-color: var(--primary);
  color: var(--primary-light);
  font-weight: 600;
}

/* 进度条 + 状态文本 */
.repl-progress-bar { height: 8px; background: var(--bg-input); border-radius: 999px; overflow: hidden; }
.repl-progress-bar > div { height: 100%; background: var(--primary-grad); transition: width .4s ease; }
.repl-progress-status { font-size: 12.5px; color: var(--text-muted); margin-top: 6px; text-align: center; }

/* 模式面板（兼容老代码） */
.repl-mode-panel { display: none; }
.repl-mode-panel.active { display: block; animation: replFadeIn .25s ease; }

/* dd trigger 紧凑版（flat：无 icon，纯文字） */
.repl-dd-trigger.flat { padding: 9px 12px; min-height: 40px; }

/* 浅色主题下的额外微调 */
html[data-theme="light"] .repl-preview-screen { box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
html[data-theme="light"] .repl-textarea-dark { background: #f4f6fb; }
html[data-theme="light"] .repl-empty-box,
html[data-theme="light"] .repl-publish-empty { background: #f4f6fb; }

/* ==========================================================================
   数字人视频模块（dg-* 前缀）—— 深色科技风，蓝紫渐变主色
   ========================================================================== */
.dg { display: flex; flex-direction: column; gap: 18px; }

/* 三大入口卡 */
.dg-hero-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.dg-hero {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 14px; padding: 18px;
  cursor: pointer; transition: all .25s ease;
}
.dg-hero:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: 0 10px 28px var(--primary-glow); }
.dg-hero-video {
  width: 72px; height: 72px; flex-shrink: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #3b82f6, #a855f7);
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; position: relative;
}
.dg-hero-play {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: #fff; opacity: 0; transition: opacity .2s;
  background: rgba(0,0,0,.3); border-radius: 12px;
}
.dg-hero:hover .dg-hero-play { opacity: 1; }
.dg-hero-body { flex: 1; min-width: 0; }
.dg-hero-title { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.dg-hero-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }
.dg-hero-arrow { font-size: 20px; color: var(--text-muted); transition: transform .2s; }
.dg-hero:hover .dg-hero-arrow { transform: translateX(3px); color: var(--primary-light); }

/* Tab */
.dg-tabs { display: flex; gap: 6px; background: var(--bg-input); border: 1px solid var(--border); border-radius: 10px; padding: 4px; width: fit-content; }
.dg-tabs.small { width: 100%; }
.dg-tab {
  padding: 9px 20px; border-radius: 7px; font-size: 14px; font-weight: 500;
  color: var(--text-secondary); cursor: pointer; transition: all .2s; white-space: nowrap;
}
.dg-tab:hover { color: var(--text-primary); }
.dg-tab.active { background: var(--primary-grad); color: #fff; font-weight: 600; box-shadow: 0 3px 12px var(--primary-glow); }
.dg-tabs.small .dg-tab { flex: 1; text-align: center; padding: 8px 10px; font-size: 13px; }

/* 面板 */
.dg-panel { display: flex; flex-direction: column; gap: 16px; }

/* 按钮 */
.dg-btn {
  padding: 10px 18px; border-radius: 10px; font-size: 14px; font-weight: 600;
  cursor: pointer; border: 1px solid transparent; transition: all .2s;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  white-space: nowrap;
}
.dg-btn.primary { background: var(--primary-grad); color: #fff; box-shadow: 0 3px 12px var(--primary-glow); }
.dg-btn.primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px var(--primary-glow); }
.dg-btn.outline { background: var(--bg-input); border-color: var(--border-strong); color: var(--text-primary); }
.dg-btn.outline:hover { border-color: var(--primary); color: var(--primary-light); }
.dg-btn.ghost { background: var(--bg-input); color: var(--text-secondary); }
.dg-btn.ghost:hover { color: var(--text-primary); }
.dg-btn.danger { background: rgba(239,68,68,.12); color: var(--danger); border-color: rgba(239,68,68,.3); }
.dg-btn.full { background: linear-gradient(135deg, #ef4444, #f97316); color: #fff; box-shadow: 0 3px 12px rgba(239,68,68,.35); }
.dg-btn.video { background: linear-gradient(135deg, #3b82f6, #a855f7); color: #fff; box-shadow: 0 3px 12px var(--primary-glow); }
.dg-btn.full:hover, .dg-btn.video:hover { transform: translateY(-1px); }

.dg-mini {
  background: var(--bg-input); border: 1px solid var(--border); border-radius: 7px;
  padding: 5px 9px; font-size: 13px; color: var(--text-secondary); cursor: pointer; transition: all .2s;
}
.dg-mini:hover { border-color: var(--primary); color: var(--text-primary); }
.dg-mini.danger:hover { border-color: var(--danger); color: var(--danger); }

.dg-actions { display: flex; gap: 12px; }
.dg-empty {
  padding: 40px 20px; text-align: center; color: var(--text-muted); font-size: 14px;
  border: 1.5px dashed var(--border-strong); border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}

/* 形象网格 */
.dg-avatar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.dg-avatar-card {
  position: relative; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px; cursor: pointer; transition: all .2s;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.dg-avatar-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: 0 6px 18px var(--primary-glow); }
.dg-avatar-cover {
  width: 72px; height: 72px; border-radius: 50%;
  background: linear-gradient(135deg, #fda4af, #c4b5fd);
  display: flex; align-items: center; justify-content: center; font-size: 34px;
}
.dg-avatar-name { font-size: 14px; font-weight: 600; color: var(--text-primary); text-align: center; }
.dg-avatar-tag { font-size: 12px; color: var(--text-muted); }
.dg-avatar-ops { position: absolute; top: 8px; right: 8px; display: flex; gap: 4px; opacity: 0; transition: opacity .2s; }
.dg-avatar-card:hover .dg-avatar-ops { opacity: 1; }
.dg-avatar-use {
  margin-top: 6px; padding: 6px 14px; border-radius: 999px; font-size: 12.5px;
  background: var(--primary-grad); color: #fff; font-weight: 600;
}

/* 筛选 */
.dg-filter { display: flex; gap: 8px; flex-wrap: wrap; }
.dg-filter-item {
  padding: 7px 16px; border-radius: 999px; font-size: 13px; cursor: pointer;
  border: 1px solid var(--border-strong); color: var(--text-secondary); transition: all .2s;
}
.dg-filter-item:hover { border-color: var(--primary); color: var(--text-primary); }
.dg-filter-item.active { background: var(--primary-grad); color: #fff; border-color: transparent; font-weight: 600; }

/* 弹窗 */
.dg-modal-mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,.55); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  animation: replFadeIn .2s ease;
}
.dg-modal {
  width: min(560px, 92vw); max-height: 86vh; overflow-y: auto;
  background: var(--bg-card); border: 1px solid var(--border-strong);
  border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.dg-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.dg-modal-title { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.dg-modal-close { cursor: pointer; font-size: 16px; color: var(--text-muted); padding: 4px 8px; border-radius: 6px; transition: all .2s; }
.dg-modal-close:hover { color: var(--text-primary); background: var(--bg-hover); }
.dg-modal-body { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.dg-modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--border); }

/* 上传区 */
.dg-upload-zone {
  border: 1.5px dashed var(--border-strong); border-radius: 12px;
  padding: 26px 18px; display: flex; flex-direction: column; align-items: center; gap: 8px;
  cursor: pointer; color: var(--text-muted); transition: all .2s; background: var(--bg-input);
  text-align: center;
}
.dg-upload-zone:hover { border-color: var(--primary); color: var(--primary-light); background: var(--primary-glow); }
.dg-up-ico { font-size: 32px; }
.dg-up-title { font-size: 14px; font-weight: 600; }
.dg-up-sub { font-size: 12px; }

.dg-input {
  width: 100%; background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 10px; padding: 11px 14px; font-size: 14px; color: var(--text-primary);
  outline: none; transition: all .2s;
}
.dg-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }

/* 进度 */
.dg-progress { display: flex; flex-direction: column; gap: 6px; }
.dg-progress-bar { height: 8px; background: var(--bg-input); border-radius: 999px; overflow: hidden; }
.dg-progress-bar > div { height: 100%; background: var(--primary-grad); transition: width .4s ease; }
.dg-progress-text { font-size: 12.5px; color: var(--text-muted); text-align: center; }

/* 工作台（全驱/视频数字） */
.dg-work { display: flex; flex-direction: column; gap: 16px; }
.dg-work-cols { display: grid; grid-template-columns: 320px 1fr 240px; gap: 16px; align-items: start; }
.dg-work-left { display: flex; flex-direction: column; gap: 14px; }
.dg-work-foot { display: flex; justify-content: center; }

.dg-step-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.dg-step-title { font-size: 15px; font-weight: 700; color: var(--text-primary); display: flex; align-items: center; gap: 8px; }
.dg-step-no {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 7px;
  background: var(--primary-grad); color: #fff; font-size: 13px; font-weight: 700;
}

.dg-avatar-pick {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg-input); cursor: pointer; transition: all .2s;
}
.dg-avatar-pick:hover { border-color: var(--primary); }
.dg-avatar-pick-cover {
  width: 48px; height: 48px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, #fda4af, #c4b5fd);
  display: flex; align-items: center; justify-content: center; font-size: 24px;
}
.dg-avatar-pick-info { flex: 1; min-width: 0; }
.dg-avatar-pick-name { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.dg-avatar-pick-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.dg-field-label { font-size: 13px; color: var(--text-secondary); display: flex; justify-content: space-between; }
.dg-count { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.dg-textarea {
  width: 100%; min-height: 90px; background: var(--bg-input); border: 1.5px solid var(--border);
  border-radius: 10px; padding: 12px 14px; font-size: 13.5px; line-height: 1.7;
  color: var(--text-primary); outline: none; resize: vertical; transition: all .2s;
}
.dg-textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.dg-textarea.sm { min-height: 70px; }
.dg-link { align-self: flex-start; background: none; border: none; color: var(--primary-light); font-size: 13px; cursor: pointer; }
.dg-link:hover { text-decoration: underline; }

.dg-drop-zone {
  border: 1.5px dashed var(--border-strong); border-radius: 10px; padding: 20px 16px;
  display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer;
  color: var(--text-muted); background: var(--bg-input); text-align: center; transition: all .2s;
}
.dg-drop-zone:hover { border-color: var(--primary); color: var(--primary-light); }

.dg-tts-box { display: flex; flex-direction: column; gap: 12px; }
.dg-row { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.dg-row label { color: var(--text-muted); min-width: 40px; }
.dg-row input[type=range] { flex: 1; accent-color: var(--primary); }
.dg-row span { min-width: 44px; text-align: right; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.dg-select {
  flex: 1; background: var(--bg-input); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 12px; font-size: 13px; color: var(--text-primary); cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
}
.dg-select:hover { border-color: var(--primary); }

/* 预览 */
.dg-preview { display: flex; flex-direction: column; gap: 10px; }
.dg-preview-screen {
  width: 100%; aspect-ratio: 16/9; border-radius: 14px; overflow: hidden;
  background: linear-gradient(135deg, #1a1f35, #0a0e1a); position: relative;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
}
.dg-preview-ref { font-size: 80px; opacity: .5; }
.dg-preview-dur {
  position: absolute; bottom: 12px; right: 12px;
  background: rgba(0,0,0,.6); color: #fff; font-size: 12px; padding: 3px 8px; border-radius: 6px;
}
.dg-preview-ops { display: flex; justify-content: center; }

/* 历史 */
.dg-history { display: flex; flex-direction: column; gap: 10px; }
.dg-history-item {
  display: flex; align-items: center; gap: 10px; padding: 10px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
  cursor: pointer; transition: all .2s;
}
.dg-history-item:hover { border-color: var(--primary); }
.dg-history-cover {
  width: 56px; height: 40px; border-radius: 6px; flex-shrink: 0;
  background: linear-gradient(135deg, #3b82f6, #a855f7);
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.dg-history-info { flex: 1; min-width: 0; }
.dg-history-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.dg-history-meta { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }

/* 生成按钮 */
.dg-gen-btn {
  padding: 16px 40px; border-radius: 14px; font-size: 16px; font-weight: 700;
  background: var(--primary-grad); color: #fff; border: none; cursor: pointer;
  box-shadow: 0 8px 24px var(--primary-glow); transition: all .25s;
  display: inline-flex; align-items: center; gap: 12px;
}
.dg-gen-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 12px 32px var(--primary-glow); }
.dg-gen-btn:disabled { opacity: .5; cursor: not-allowed; }
.dg-gen-cost { font-size: 13px; font-weight: 500; opacity: .85; }

/* 选择器弹窗内容 */
.dg-picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 12px; }
.dg-picker-item {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px; border: 1.5px solid var(--border); border-radius: 10px; cursor: pointer; transition: all .2s;
}
.dg-picker-item:hover { border-color: var(--primary); }
.dg-picker-item.active { border-color: var(--primary); background: var(--primary-glow); }
.dg-picker-cover {
  width: 48px; height: 48px; border-radius: 50%;
  background: linear-gradient(135deg, #fda4af, #c4b5fd);
  display: flex; align-items: center; justify-content: center; font-size: 24px;
}
.dg-picker-name { font-size: 12px; color: var(--text-primary); text-align: center; }

.dg-voice-list { display: flex; flex-direction: column; gap: 8px; max-height: 50vh; overflow-y: auto; }
.dg-voice-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 10px; cursor: pointer; transition: all .2s;
}
.dg-voice-item:hover { border-color: var(--primary); }
.dg-voice-item.active { border-color: var(--primary); background: var(--primary-glow); }
.dg-voice-ico { font-size: 22px; }
.dg-voice-name { flex: 1; font-size: 14px; color: var(--text-primary); }

/* 作品广场 */
.dg-banners { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.dg-banner {
  display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: 14px;
  cursor: pointer; color: #fff; transition: all .25s;
}
.dg-banner:hover { transform: translateY(-2px); }
.dg-banner.b1 { background: linear-gradient(135deg, #a855f7, #6d28d9); }
.dg-banner.b2 { background: linear-gradient(135deg, #3b82f6, #6366f1); }
.dg-banner.b3 { background: linear-gradient(135deg, #06b6d4, #3b82f6); }
.dg-banner-ico { font-size: 28px; }
.dg-banner-txt { flex: 1; }
.dg-banner-title { font-size: 15px; font-weight: 700; }
.dg-banner-sub { font-size: 12px; opacity: .85; margin-top: 2px; }
.dg-banner-arrow { font-size: 20px; opacity: .8; }

.dg-works-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.dg-work-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden; cursor: pointer; transition: all .2s;
}
.dg-work-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: 0 8px 22px var(--primary-glow); }
.dg-work-cover {
  position: relative; aspect-ratio: 16/9;
  background: linear-gradient(135deg, #1a1f35, #0a0e1a);
  display: flex; align-items: center; justify-content: center;
}
.dg-work-emoji { font-size: 36px; opacity: .6; }
.dg-work-play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 32px; color: #fff; background: rgba(0,0,0,.35);
}
.dg-work-play.big { font-size: 52px; position: static; background: none; }
.dg-work-dur {
  position: absolute; bottom: 8px; right: 8px;
  background: rgba(0,0,0,.6); color: #fff; font-size: 11px; padding: 2px 7px; border-radius: 5px;
}
.dg-work-title { padding: 10px 12px 4px; font-size: 13.5px; font-weight: 600; color: var(--text-primary); }
.dg-work-meta { padding: 0 12px 12px; font-size: 11.5px; color: var(--text-muted); }
.dg-work-detail-screen {
  position: relative; aspect-ratio: 16/9; border-radius: 12px;
  background: linear-gradient(135deg, #1a1f35, #0a0e1a);
  display: flex; align-items: center; justify-content: center; font-size: 60px; opacity: .7;
}
.dg-work-detail-ops { display: flex; gap: 10px; flex-wrap: wrap; }

/* 音色库 */
.dg-voice-banner {
  display: flex; align-items: center; gap: 14px; padding: 20px;
  background: linear-gradient(135deg, #a855f7, #6d28d9); border-radius: 14px;
  color: #fff; cursor: pointer; transition: all .25s;
}
.dg-voice-banner:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(168,85,247,.4); }
.dg-voice-banner-ico { font-size: 34px; }
.dg-voice-banner-txt { flex: 1; }
.dg-voice-banner-title { font-size: 17px; font-weight: 700; }
.dg-voice-banner-sub { font-size: 13px; opacity: .85; margin-top: 4px; }
.dg-voice-banner-btn { font-size: 14px; font-weight: 600; padding: 8px 16px; background: rgba(255,255,255,.2); border-radius: 999px; }
.dg-free-tip {
  padding: 12px 16px; border-radius: 10px; font-size: 13.5px;
  background: rgba(251,191,36,.12); border: 1px solid rgba(251,191,36,.3); color: #fbbf24;
}
.dg-free-tip b { font-size: 16px; }
.dg-voice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.dg-voice-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  transition: all .2s;
}
.dg-voice-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.dg-voice-card-ico {
  width: 56px; height: 56px; border-radius: 50%; font-size: 26px;
  background: var(--primary-glow); display: flex; align-items: center; justify-content: center;
}
.dg-voice-card-name { font-size: 14px; font-weight: 600; color: var(--text-primary); text-align: center; }
.dg-voice-card-tag { font-size: 12px; color: var(--text-muted); }
.dg-voice-card-ops { display: flex; gap: 6px; margin-top: 4px; }

/* 文本配音 */
.dg-tts { display: flex; flex-direction: column; gap: 16px; }
.dg-tts-head { display: flex; align-items: center; gap: 14px; }
.dg-tts-avatar {
  width: 52px; height: 52px; border-radius: 14px; font-size: 28px;
  background: var(--primary-grad); display: flex; align-items: center; justify-content: center;
}
.dg-tts-info { flex: 1; }
.dg-tts-title { font-size: 18px; font-weight: 700; color: var(--text-primary); display: flex; align-items: center; gap: 10px; }
.dg-tts-tag {
  font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 999px;
  background: var(--primary-glow); color: var(--primary-light);
}
.dg-tts-sub { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.dg-tts-body { display: grid; grid-template-columns: 1fr 280px; gap: 16px; align-items: start; }
.dg-tts-editor { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 16px; position: relative; display: flex; flex-direction: column; gap: 12px; }
.dg-tts-textarea {
  width: 100%; min-height: 280px; background: var(--bg-input); border: 1.5px solid var(--border);
  border-radius: 12px; padding: 16px 18px; font-size: 15px; line-height: 1.9;
  color: var(--text-primary); outline: none; resize: vertical; transition: all .2s;
}
.dg-tts-textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-glow); }
.dg-tts-loading {
  position: absolute; inset: 0; border-radius: 14px;
  background: rgba(0,0,0,.5); backdrop-filter: blur(2px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  color: #fff; font-size: 14px; z-index: 5;
}
.dg-ring {
  width: 40px; height: 40px; border-radius: 50%;
  border: 4px solid rgba(255,255,255,.25); border-top-color: #fff;
  animation: dgSpin .8s linear infinite;
}
@keyframes dgSpin { to { transform: rotate(360deg); } }
.dg-tts-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dg-tts-count { margin-left: auto; font-size: 12.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.dg-tts-bottom { display: flex; align-items: center; gap: 12px; }
.dg-tts-voice {
  flex: 1; display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  background: var(--bg-input); border: 1px solid var(--border); border-radius: 12px; cursor: pointer; transition: all .2s;
}
.dg-tts-voice:hover { border-color: var(--primary); }
.dg-tts-voice-ico {
  width: 40px; height: 40px; border-radius: 50%; font-size: 20px;
  background: var(--primary-glow); display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.dg-tts-voice-info { flex: 1; min-width: 0; }
.dg-tts-voice-name { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.dg-tts-voice-tag { font-size: 11.5px; color: var(--text-muted); }
.dg-tts-voice-arrow { color: var(--text-muted); font-size: 12px; }
.dg-tts-history { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.dg-tts-item {
  display: flex; align-items: center; gap: 10px; padding: 10px;
  background: var(--bg-input); border: 1px solid var(--border); border-radius: 10px; transition: all .2s;
}
.dg-tts-item:hover { border-color: var(--primary); }
.dg-tts-wave { font-size: 20px; color: var(--primary-light); }
.dg-tts-item-info { flex: 1; min-width: 0; }
.dg-tts-item-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.dg-tts-item-meta { font-size: 11.5px; color: var(--text-muted); }
.dg-tts-item-ops { display: flex; gap: 5px; }

/* 响应式 */
@media (max-width: 1100px) {
  .dg-work-cols { grid-template-columns: 1fr; }
  .dg-tts-body { grid-template-columns: 1fr; }
  .dg-hero-grid, .dg-banners { grid-template-columns: 1fr; }
}

/* ==========================================================================
   全局文字样式统一规范（Typography Normalization）
   规范：正文14 / 辅助13 / 按钮14·600 / 区块标题15·700 / 页面标题17·700
   ========================================================================== */

/* 输入控件：统一 14px（原 15.5px 突兀） */
input, select, textarea { font-size: 14px; }

/* 按钮：统一 14px / 600 */
.btn { font-size: 14px; font-weight: 600; }

/* 导航：分组标题 13px/700，菜单项 14px/500 */
.nav-group-header { font-size: 13px; font-weight: 700; }
.nav-item { font-size: 14px; font-weight: 500; }

/* 页面 Banner 标题：17px/700，副标题 13px */
.page-banner-title { font-size: 17px; font-weight: 700; }
.page-banner-sub { font-size: 13px; }

/* 弹窗标题：16px/700 */
.modal-title { font-size: 16px; font-weight: 700; }

/* 顶部栏页面名：15px/600 */
.topbar-page-name { font-size: 15px; font-weight: 600; }

/* 复刻/数字人区块标题统一 15px/700 */
.repl-section-title, .repl-step-title, .dg-step-title, .dg-hero-title,
.dg-banner-title, .dg-voice-banner-title, .dg-tts-title { font-size: 15px; font-weight: 700; }

/* 表单标签：13px/500 */
.field-label, .dg-field-label { font-size: 13px; font-weight: 500; }

/* 卡片主标题（通用卡片内首个标题）统一 15px/600 */
.media-name, .folder-name, .work-name { font-size: 14px; font-weight: 600; }

/* 辅助说明文字：统一 13px + muted 色（消除硬编码 #9aa3bd/#5d6785） */
.home-subtitle, .home-stat-label, .home-section-sub, .home-tool-desc,
.repl-hint, .repl-import-hint, .repl-section-meta, .dg-hero-sub,
.dg-banner-sub, .dg-voice-banner-sub, .dg-tts-sub, .dg-avatar-tag,
.dg-voice-card-tag, .dg-history-meta, .dg-work-meta, .dg-tts-item-meta {
  font-size: 13px;
  color: var(--text-muted);
}

/* 空状态文字：13px */
.dg-empty, .repl-tl-empty, .repl-overlay-empty { font-size: 13px; }

/* 数字人视频预览：占位封面 + 播放按钮（修复 mock-video 破损图标） */
.dg-preview-video {
  position: relative;
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
}
.dg-preview-thumb {
  width: 100%; height: 100%;
  background: linear-gradient(160deg, #2a3654, #141b30);
  display: flex; align-items: center; justify-content: center;
  font-size: 84px; opacity: .85;
}
.dg-preview-play {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 40px; color: #fff; cursor: pointer;
  background: rgba(0,0,0,.25);
  transition: all .2s;
}
.dg-preview-play:hover { background: rgba(0,0,0,.4); transform: scale(1.05); }

/* 表单校验反馈（I09）：红边框 + 提示文字 */
.field-error {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}
.field-error-tip {
  color: var(--danger);
  font-size: 12px;
  margin-top: 5px;
  line-height: 1.5;
}

/* 任务中心铃铛（E01） */
.bell-btn { position: relative; }
.bell-badge {
  position: absolute; top: -3px; right: -3px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 99px;
  background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700;
  align-items: center; justify-content: center;
}

/* 全局搜索框（E02） */
.topbar-search { position: relative; width: 220px; margin: 0 12px; flex-shrink: 0; }
.topbar-search-input {
  width: 100%; padding: 8px 14px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text-primary); font-size: 13px;
  outline: none; transition: all .2s;
}
.topbar-search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.topbar-search-res {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--bg-card); border: 1px solid var(--border-strong);
  border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,.35);
  z-index: 60; overflow: hidden;
}
.search-item {
  padding: 10px 14px; font-size: 13.5px; color: var(--text-primary);
  cursor: pointer; transition: background .15s;
}
.search-item:hover { background: var(--primary-glow); }

/* ==========================================================================
   UI 视觉升级 · 阶段1 基础层（T04/T05/T08/T11/T12/T13/T14/T15）
   规范：深空科技风 —— 卡片 #0d111c / 按钮 36px·渐变发光 / 输入 #0a0e18·聚焦外发光
   ========================================================================== */

/* ---------- T05 过渡时长变量（统一 0.2s） ---------- */
:root {
  --dur-fast: 0.15s;
  --dur: 0.2s;
  --dur-slow: 0.3s;
  --ease: ease;
}

/* ---------- T04 页面背景：极淡网格 + 顶部径向光晕 ---------- */
body { isolation: isolate; }
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgba(99, 91, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 91, 255, 0.035) 1px, transparent 1px);
  background-size: 40px 40px;
}
body::after {
  content: "";
  position: fixed; top: -180px; left: 50%; transform: translateX(-50%);
  width: 900px; height: 420px; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(99, 91, 255, 0.10), transparent 65%);
}
html[data-theme="light"] body::before { opacity: 0.35; }
html[data-theme="light"] body::after { opacity: 0.5; }
/* 访客首页有独立星空背景，屏蔽网格避免冲突 */
body.home-page::before, body.home-page::after { display: none; }

/* ---------- T08 主/次按钮统一（36px 高 / 圆角10 / 14px / 渐变发光） ---------- */
.btn {
  height: 36px; padding: 0 18px;
  border-radius: 10px;
  font-size: 14px; font-weight: 500;
  transition: all var(--dur) var(--ease);
}
.btn-sm { height: 30px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-primary {
  background: var(--primary-grad);
  box-shadow: 0 0 20px rgba(99, 91, 255, 0.3);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 0 28px rgba(99, 91, 255, 0.45);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); box-shadow: 0 0 14px rgba(99, 91, 255, 0.18); }

/* ---------- T11 输入框/文本域统一（#0a0e18 / 圆角10 / 聚焦外发光） ---------- */
.input, .select, .textarea, .form-input, .dg-input {
  background: var(--bg-input);
  border-radius: 10px;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.input:focus, .select:focus, .textarea:focus, .form-input:focus, .dg-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow-strong);
}
::placeholder { color: #4a5578; opacity: 1; }
html[data-theme="light"] ::placeholder { color: #a0a8c0; }

/* ---------- T12 下拉框箭头 + 选项 hover 微光 ---------- */
.select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23635bff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
  padding-right: 36px;
}
.repl-dd-menu .repl-dd-item:hover,
.dg-picker-item:hover,
.dg-voice-item:hover {
  background: var(--primary-glow);
}
.repl-dd-item.active,
.dg-picker-item.active,
.dg-voice-item.active {
  background: var(--primary-glow);
  border-color: var(--primary);
  box-shadow: inset 3px 0 0 var(--primary);
}

/* ---------- T13 卡片体系统一（#0d111c / 圆角14 / hover 发光） ---------- */
.card, .repl-section, .dg-step-box {
  background: var(--bg-panel);
  border: 1px solid rgba(139, 148, 189, 0.08);
  border-radius: 14px;
  transition: all var(--dur) var(--ease);
}
.card { position: relative; }
.card::before {
  content: "";
  position: absolute; top: 0; left: 14px; right: 14px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(99, 91, 255, 0.5), rgba(54, 207, 251, 0.5), transparent);
}
.card:hover, .dg-step-box:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover), 0 0 22px rgba(99, 91, 255, 0.08);
}
.repl-section:hover { border-color: rgba(139, 148, 189, 0.18); }

/* ---------- T14 标签/角标统一（胶囊 / 11px / 品牌渐变新增） ---------- */
.tag { font-size: 11px; padding: 3px 10px; border-radius: 999px; }
.tag-brand {
  background: var(--primary-grad);
  color: #fff; border: none;
  box-shadow: 0 0 12px rgba(99, 91, 255, 0.35);
}

/* ---------- T15 弹窗统一（深底 / 蓝紫描边发光 / 圆角16 / 遮罩 blur） ---------- */
.modal-mask {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
html[data-theme="light"] .modal-mask { background: rgba(30, 41, 82, 0.4); }
.modal {
  background: var(--bg-panel);
  border: 1px solid rgba(99, 91, 255, 0.2);
  border-radius: 16px;
  box-shadow: 0 0 40px rgba(99, 91, 255, 0.12), var(--shadow-modal);
}
.modal-mask.show .modal { transform: translateY(0) scale(1); }
.dg-modal {
  background: var(--bg-panel);
  border: 1px solid rgba(99, 91, 255, 0.2);
  border-radius: 16px;
  box-shadow: 0 0 40px rgba(99, 91, 255, 0.12), var(--shadow-modal);
}

/* ---------- T07 渐变分割线工具类 ---------- */
.divider-grad {
  height: 1px; border: none; margin: 16px 0;
  background: linear-gradient(90deg, transparent, rgba(139, 148, 189, 0.25), transparent);
}

/* ==========================================================================
   UI 视觉升级 · 阶段2 页面层（T09/T10/T17/T18/T19 + Lucide 图标基础）
   ========================================================================== */

/* ---------- T09 .dg-btn 对齐 .btn 体系（36px / 14px / 渐变发光） ---------- */
.dg-btn {
  height: 36px; padding: 0 18px;
  border-radius: 10px;
  font-size: 14px; font-weight: 500;
}
.dg-btn.primary {
  box-shadow: 0 0 20px rgba(99, 91, 255, 0.3);
}
.dg-btn.primary:hover { transform: translateY(-1px); box-shadow: 0 0 28px rgba(99, 91, 255, 0.45); }
.dg-mini { height: 30px; padding: 0 12px; font-size: 13px; border-radius: 8px; }

/* ---------- T10 .repl 按钮高度对齐（胶囊保留） ---------- */
.repl-pill-btn { height: 34px; padding: 0 18px; font-size: 13.5px; border-radius: 999px; }
.repl-mini-btn { height: 30px; padding: 0 12px; font-size: 13px; border-radius: 8px; }

/* ---------- T17 顶栏玻璃拟态增强（半透明 + 底部渐变光边） ---------- */
.topbar {
  background: rgba(10, 14, 24, 0.72);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.topbar::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(99, 91, 255, 0.4), rgba(54, 207, 251, 0.4), transparent);
  pointer-events: none;
}
html[data-theme="light"] .topbar { background: rgba(255, 255, 255, 0.78); }

/* ---------- T18 侧边栏玻璃拟态 ---------- */
.sidebar {
  background: rgba(10, 14, 24, 0.66);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-right: 1px solid rgba(139, 148, 189, 0.08);
}
html[data-theme="light"] .sidebar { background: rgba(250, 251, 254, 0.8); }

/* ---------- T19 页面标题区发光 hover 微调 ---------- */
.page-banner:hover {
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.32), 0 0 26px rgba(99, 91, 255, 0.14);
}

/* ---------- T16 Lucide 图标基础（供阶段3替换使用） ---------- */
.lucide {
  width: 18px; height: 18px;
  stroke-width: 1.8;
  flex-shrink: 0;
}
.lucide-sm { width: 16px; height: 16px; }
.lucide-lg { width: 22px; height: 22px; }
.lucide-xl { width: 26px; height: 26px; }

/* ==========================================================================
   UI 视觉升级 · 阶段3 交互细节（T28/T29/T30/T32/T33）
   ========================================================================== */

/* ---------- T28 主 CTA 渐变描边发光（mask 渐变边框） ---------- */
.btn-primary, .dg-btn.primary, .repl-pill-btn.primary {
  position: relative;
}
.btn-primary::after, .dg-btn.primary::after, .repl-pill-btn.primary::after {
  content: '';
  position: absolute; inset: -1px; border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(99, 91, 255, 0.8), rgba(54, 207, 251, 0.8));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  opacity: 0.45;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.btn-primary:hover::after, .dg-btn.primary:hover::after, .repl-pill-btn.primary:hover::after { opacity: 0.9; }

/* ---------- T29 loading 呼吸灯脉冲 ---------- */
.spinner {
  animation: spin 0.8s linear infinite, dgPulse 1.6s ease-in-out infinite;
}
.dg-ring {
  animation: dgSpin 0.8s linear infinite, dgPulse 1.6s ease-in-out infinite;
}
@keyframes dgPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

/* ---------- T30 进度条渐变流动 ---------- */
.repl-progress-bar > div, .dg-progress-bar > div {
  background: linear-gradient(90deg, #635bff, #36cffb, #635bff);
  background-size: 200% 100%;
  animation: dgFlow 2s linear infinite;
}
@keyframes dgFlow {
  0% { background-position: 0% 0; }
  100% { background-position: 200% 0; }
}

/* ---------- T32 页面切换动画微调（0.25s） ---------- */
.content.route-enter { animation: routeFadeIn 0.25s ease; }

/* ---------- T33 空状态统一增强（图标 + 文字 + 主操作引导） ---------- */
.dg-empty, .repl-tl-empty, .repl-overlay-empty {
  border: 1.5px dashed rgba(99, 91, 255, 0.18);
  background: rgba(99, 91, 255, 0.03);
}
.dg-empty .dg-btn, .dg-empty button.btn {
  margin-top: 4px;
}

/* ---------- T27-fix 管理后台独立 Tabs（避免与 .login-tabs 窄容器样式冲突） ---------- */
.admin-tabs { display: flex; gap: 8px; margin-bottom: 0; padding: 4px; background: var(--bg-input); border-radius: 10px; }
.admin-tab {
  flex: 1; padding: 10px 0; text-align: center;
  border-radius: 8px; font-size: 14px; font-weight: 500;
  color: var(--text-secondary); transition: all 0.2s ease;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  white-space: nowrap;
}
.admin-tab:hover { color: var(--text-primary); background: var(--bg-hover); }
.admin-tab.active { background: var(--primary-grad); color: #fff; box-shadow: 0 0 14px rgba(99, 91, 255, 0.35); }
.admin-tab.active:hover { background: var(--primary-grad); }

/* ---------- 开关（系统参数 boolean 字段可视化） ---------- */
.cfg-switch { position: relative; display: inline-flex; align-items: center; width: 46px; height: 24px; cursor: pointer; vertical-align: middle; flex-shrink: 0; }
.cfg-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.cfg-switch .slider { position: absolute; inset: 0; background: var(--bg-input); border: 1px solid var(--border-strong); border-radius: 24px; transition: .25s; }
.cfg-switch .slider::before { content: ''; position: absolute; left: 2px; top: 2px; width: 18px; height: 18px; background: var(--text-secondary); border-radius: 50%; transition: .25s; }
.cfg-switch input:checked + .slider { background: linear-gradient(135deg, #635bff, #36cffb); border-color: transparent; box-shadow: 0 0 10px rgba(99, 91, 255, 0.4); }
.cfg-switch input:checked + .slider::before { left: 24px; background: #fff; }
.cfg-switch:hover .slider { box-shadow: 0 0 0 3px rgba(99, 91, 255, 0.08); }
.cfg-switch .lbl-on, .cfg-switch .lbl-off { position: absolute; top: 50%; transform: translateY(-50%); font-size: 10px; color: #fff; font-weight: 700; pointer-events: none; }
.cfg-switch .lbl-on { right: 8px; opacity: 0; transition: .2s; }
.cfg-switch .lbl-off { left: 8px; color: var(--text-muted); transition: .2s; }
.cfg-switch input:checked ~ .lbl-on { opacity: 1; }
.cfg-switch input:checked ~ .lbl-off { opacity: 0; }
.cfg-bool-display { display: inline-flex; align-items: center; gap: 10px; padding: 4px 8px; border-radius: 8px; background: rgba(99, 91, 255, 0.08); }
.cfg-bool-text { font-size: 13px; color: var(--text-primary); font-weight: 600; }

/* ---------- 工厂步骤条联动：目标区高亮闪烁 ---------- */
.step-flash { animation: stepFlash 1.6s ease; border-radius: 10px; }
@keyframes stepFlash {
  0%, 100% { box-shadow: 0 0 0 0 rgba(99, 91, 255, 0); }
  30% { box-shadow: 0 0 0 4px rgba(99, 91, 255, .45); }
}
.steps-bar .step-item { cursor: pointer; transition: transform .15s; }
.steps-bar .step-item:active { transform: scale(.96); }
