/* ============================================================
   Memorix Pipeline — Design System v2.0 (app_v2.css)
   Modern Minimalist — Linear / Vercel / Raycast inspired
   可直接替换 static/css/app.css (class 名完全兼容)
   ============================================================ */

/* === Design Tokens === */
:root {
  /* Color: Neutral */
  --bg:            #fafafa;
  --bg-subtle:     #f4f4f5;
  --surface:       #ffffff;
  --surface-hover: #fafafa;
  --ink:           #09090b;
  --ink-2:         #3f3f46;
  --muted:         #71717a;
  --muted-2:       #a1a1aa;
  --border:        #e4e4e7;
  --border-strong: #d4d4d8;

  /* Color: Accent (Purple) */
  --accent:        #6c3fc7;
  --accent2:       #9b6dff;
  --accent-hover:  #5b3fd4;
  --accent-bg:     rgba(108,63,199,0.08);
  --accent-bg-2:   rgba(108,63,199,0.12);
  --accent-border: rgba(108,63,199,0.2);

  /* Color: Semantic */
  --green:         #16a34a;
  --green-bg:      rgba(22,163,74,0.08);
  --orange:        #d97706;
  --orange-bg:     rgba(217,119,6,0.08);
  --red:           #dc2626;
  --red-bg:        rgba(220,38,38,0.08);
  --blue:          #2563eb;
  --blue-bg:       rgba(37,99,235,0.08);

  /* Typography */
  --font-sans:     'Inter', -apple-system, 'PingFang SC', 'Noto Sans CJK SC', system-ui, sans-serif;
  --font-mono:     'SF Mono', 'Fira Code', 'JetBrains Mono', monospace;

  /* Radius */
  --radius:        12px;
  --r-sm:          6px;
  --r-md:          8px;
  --r-lg:          12px;
  --r-xl:          16px;
  --r-full:        9999px;

  /* Shadows */
  --sh-xs:  0 1px 2px rgba(0,0,0,0.04);
  --sh-sm:  0 2px 4px rgba(0,0,0,0.04);
  --sh-md:  0 4px 12px rgba(0,0,0,0.06);
  --sh-lg:  0 8px 24px rgba(0,0,0,0.08);
  --sh-xl:  0 16px 48px rgba(0,0,0,0.10);

  /* Transitions */
  --t-fast:   120ms cubic-bezier(0.4,0,0.2,1);
  --t-normal: 200ms cubic-bezier(0.4,0,0.2,1);
  --t-slow:   350ms cubic-bezier(0.4,0,0.2,1);

  /* Layout */
  --nav-h: 56px;
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* === 顶部导航 === */
.navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 24px;
  height: var(--nav-h);
}

.navbar .brand {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  padding: 0;
  white-space: nowrap;
  cursor: pointer;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: opacity var(--t-fast);
  -webkit-background-clip: unset;
  -webkit-text-fill-color: unset;
  background: none;
}
.navbar .brand:hover { opacity: 0.8; }
.brand-dot {
  width: 22px; height: 22px;
  border-radius: var(--r-sm);
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
}

.navbar .nav-tabs {
  display: flex;
  gap: 2px;
  flex: 1;
  min-width: 0;
  overflow: visible;
  flex-wrap: nowrap;
}

.nav-tab {
  padding: 0 12px;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  border-bottom: 2px solid transparent;
  transition: all var(--t-fast);
  white-space: nowrap;
}

/* 分组导航 */
.nav-group { display:flex; align-items:center; gap:2px; margin-right:14px; flex-shrink:0; }
.nav-group-label {
  font-size:10px; font-weight:700; color:var(--muted);
  padding:4px 8px; border:1px solid var(--border); border-radius:10px;
  margin-right:4px; letter-spacing:1px; background:var(--surface); white-space:nowrap;
}
.nav-group .nav-tab { padding:16px 12px; font-size:13px; }

.nav-tab:hover { color: var(--accent); }
.nav-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

/* === 导航栏右侧操作区 === */
.nav-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-icon-btn {
  width: 32px;
  height: 32px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: all var(--t-fast);
  position: relative;
}
.nav-icon-btn:hover {
  background: var(--bg-subtle);
  color: var(--ink);
  border-color: var(--border);
}
.nav-icon-btn svg { width: 16px; height: 16px; }
.nav-icon-btn.running { color: var(--green); }
.nav-icon-btn.running:hover {
  color: var(--red);
  background: var(--red-bg);
  border-color: rgba(220,38,38,0.2);
}
.nav-icon-btn:disabled { opacity: 0.4; cursor: wait; }
.nav-icon-btn .tooltip {
  position: absolute;
  bottom: -28px;
  right: 0;
  white-space: nowrap;
  background: var(--ink);
  color: var(--surface);
  padding: 3px 8px;
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-fast);
  z-index: 200;
}
.nav-icon-btn:hover .tooltip { opacity: 1; }

.nav-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-strong);
  transition: all var(--t-normal);
}
.nav-status-dot.running {
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green-bg);
}
.nav-status-dot.loading {
  background: var(--orange);
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}

/* === 主内容 === */
.main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 24px 60px;
}
.tab-panel { display: none; }
.tab-panel.active {
  display: block;
  animation: fadeIn var(--t-normal) ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* H3 子标签栏 */
.h3-subtab-bar {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.h3-subtab {
  padding: 8px 18px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all var(--t-fast);
}
.h3-subtab:hover { color: var(--accent); }
.h3-subtab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.h3-subpanel {}

/* 图生图面板使用更宽的布局 */
.main.wide { max-width: 85% !important; padding: 28px 12px 60px; }
#panel-i2i #i2i-gradio-frame { min-height: 900px; width: 100%; }
#panel-i2i .card { padding: 12px; }
#panel-i2i #i2i-placeholder { padding: 8px; }

/* === 卡片 === */
.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  padding: 24px;
  margin-bottom: 16px;
  transition: box-shadow var(--t-fast);
}
.card:hover { box-shadow: var(--sh-xs); }
.card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}
.card-title::before {
  content: '';
  width: 3px;
  height: 16px;
  border-radius: 2px;
  background: var(--accent);
  flex-shrink: 0;
}

/* === 上传区 === */
.upload-zone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--r-lg);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--t-normal);
  background: var(--bg-subtle);
}
.upload-zone:hover {
  border-color: var(--accent);
  background: var(--accent-bg);
}
.upload-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-bg-2);
}
.upload-zone.has-file {
  border-color: var(--green);
  border-style: solid;
  background: var(--green-bg);
}
.upload-zone .icon { font-size: 28px; margin-bottom: 8px; opacity: 0.6; }
.upload-zone .hint { color: var(--muted); font-size: 13px; margin-top: 4px; }
.upload-zone .filename { color: var(--accent); font-weight: 600; margin-top: 8px; font-size: 13px; }

/* === 表单控件 === */
.form-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.form-group { flex: 1; min-width: 200px; }
.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--ink-2);
}
.form-group select,
.form-group textarea,
.form-group input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  background: var(--surface);
  outline: none;
  transition: all var(--t-fast);
}
.form-group textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
.form-group select:focus,
.form-group textarea:focus,
.form-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}

/* 单选按钮组 */
.radio-group { display: flex; gap: 8px; flex-wrap: wrap; }
.radio-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  transition: all var(--t-fast);
  background: var(--surface);
  user-select: none;
}
.radio-label:hover {
  border-color: var(--accent);
  background: var(--accent-bg);
}
.radio-label:has(input:checked) {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-bg);
}
.radio-label input[type="radio"] { display: none; }

/* 参数说明 */
.help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg-subtle);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  cursor: help;
  margin-left: 6px;
  position: relative;
  vertical-align: middle;
  border: 1px solid var(--border);
}
.help-icon:hover {
  background: var(--accent-bg);
  color: var(--accent);
  border-color: var(--accent-border);
}
.help-icon:hover::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: 135%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--surface);
  padding: 9px 12px;
  border-radius: var(--r-md);
  font-size: 12px;
  font-weight: 400;
  white-space: pre-line;
  width: 230px;
  z-index: 99;
  box-shadow: var(--sh-md);
  text-align: left;
  line-height: 1.6;
}
.help-icon:hover::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 122%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--ink);
  z-index: 99;
}

/* 提示词字数统计 */
.char-count {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}
.char-count.warn {
  color: var(--orange);
  font-weight: 600;
}

/* Remotion 分镜编辑器 */
.scene-row input,
.scene-row select {
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  font-size: 13px;
  font-family: inherit;
  color: var(--ink);
  background: var(--surface);
  outline: none;
  transition: all var(--t-fast);
}
.scene-row input:focus,
.scene-row select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}

/* 手机 Agent 设备状态徽章 */
.agent-device {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 10px;
  padding: 3px 12px;
  border-radius: var(--r-full);
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border);
  color: var(--muted);
}
.agent-device.online {
  color: var(--green);
  border-color: rgba(22,163,74,0.3);
  background: var(--green-bg);
}
.agent-device.offline {
  color: var(--red);
  border-color: rgba(220,38,38,0.3);
  background: var(--red-bg);
}
.agent-device.checking { color: var(--muted); }

.checkbox-row { display: flex; gap: 16px; flex-wrap: wrap; margin: 8px 0; }
.checkbox-item { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.checkbox-item input { width: 16px; height: 16px; cursor: pointer; accent-color: var(--accent); }
.checkbox-item label { font-weight: 500; font-size: 14px; cursor: pointer; color: var(--ink-2); }

/* === 按钮 === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 32px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast);
  font-family: inherit;
  white-space: nowrap;
  outline: none;
}
.btn:focus-visible { box-shadow: 0 0 0 3px var(--accent-bg); }

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled {
  background: var(--border-strong);
  cursor: not-allowed;
  color: var(--muted);
}

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border-strong);
}
.btn-secondary:hover {
  background: var(--bg-subtle);
  border-color: var(--muted-2);
}

.btn-abort {
  background: var(--surface);
  color: var(--red);
  border-color: rgba(220,38,38,0.2);
}
.btn-abort:hover {
  background: var(--red-bg);
  border-color: var(--red);
}

.btn-sm { padding: 6px 14px; font-size: 13px; border-radius: var(--r-sm); }
.btn-center { text-align: center; margin-top: 20px; }

/* === 日志区 === */
.log-box {
  background: #0c0c0f;
  color: #d4d4d8;
  border-radius: var(--r-md);
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  max-height: 300px;
  overflow-y: auto;
  line-height: 1.5;
  border: 1px solid #1e1e24;
}
.log-box::-webkit-scrollbar { width: 6px; }
.log-box::-webkit-scrollbar-track { background: transparent; }
.log-box::-webkit-scrollbar-thumb { background: #2e2e36; border-radius: 3px; }
.log-box::-webkit-scrollbar-thumb:hover { background: #3e3e48; }

.log-box .log-line { padding: 2px 0; }
.log-box .log-ts { color: #52525b; margin-right: 8px; }
.log-box .log-err { color: #f87171; }

/* === 模型对比并排列 === */
.compare-col-head {
  font-size: 13px; font-weight: 600; color: var(--muted);
  padding: 8px 10px; border: 1px solid var(--border); border-bottom: none;
  border-radius: 8px 8px 0 0; background: var(--surface);
}
.compare-col-meta {
  font-size: 12px; color: var(--muted); padding: 6px 10px;
  border: 1px solid var(--border); border-top: none; border-bottom: none;
  background: var(--surface);
}
.compare-col-md {
  max-height: 600px; overflow-y: auto;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 0 0 8px 8px; padding: 16px;
  font-size: 14px; line-height: 1.8;
  font-family: 'PingFang SC','Noto Sans CJK SC',sans-serif;
}

/* === 审核面板 === */
.review-overlay {
  position: fixed;
  inset: 0;
  background: rgba(9,9,11,0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  overflow-y: auto;
}
.review-overlay.show { display: flex; }
.review-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  max-width: 900px;
  width: 100%;
  padding: 28px;
  box-shadow: var(--sh-xl);
}
.review-panel h2 { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.review-panel .sub { color: var(--muted); font-size: 13px; margin-bottom: 20px; }

.seg-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 400px;
  overflow-y: auto;
  margin-bottom: 16px;
}
.seg-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--bg-subtle);
  border-radius: var(--r-md);
  padding: 10px 14px;
  border: 1px solid var(--border);
}
.seg-time {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  background: var(--accent-bg);
  padding: 3px 8px;
  border-radius: var(--r-sm);
  min-width: 90px;
  text-align: center;
  cursor: pointer;
  transition: all var(--t-fast);
}
.seg-time:hover { background: var(--accent); color: #fff; }
.seg-text { flex: 1; font-size: 14px; outline: none; }

.edit-area {
  width: 100%;
  min-height: 80px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  padding: 12px 14px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  outline: none;
  transition: all var(--t-fast);
}
.edit-area:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}

.trans-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
@media (max-width: 700px) { .trans-grid { grid-template-columns: 1fr; } }

.trans-card {
  border-radius: var(--r-md);
  padding: 14px;
  border: 1px solid var(--border-strong);
  cursor: pointer;
  transition: all var(--t-fast);
}
.trans-card:hover { border-color: var(--accent); }
.trans-card.selected {
  border-color: var(--accent);
  background: var(--accent-bg);
}
.trans-card .label { font-size: 12px; font-weight: 600; margin-bottom: 6px; color: var(--muted); }
.trans-card .text { font-size: 13px; white-space: pre-wrap; word-break: break-all; color: var(--ink); }

.issue-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.issue-item {
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-subtle);
  border-radius: var(--r-sm);
  border-left: 3px solid var(--accent);
}
.issue-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--r-full);
  white-space: nowrap;
  background: var(--red-bg);
  color: var(--red);
}
.issue-tag.fluency  { background: var(--orange-bg); color: var(--orange); }
.issue-tag.omission { background: rgba(234,179,8,0.12); color: #a16207; }
.issue-tag.addition  { background: rgba(168,85,247,0.1); color: #7e22ce; }
.issue-tag.tone      { background: var(--blue-bg); color: var(--blue); }

.reco-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: var(--r-full);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 8px;
  background: var(--accent-bg);
  color: var(--accent);
}
.quick-btns { display: flex; gap: 8px; margin-bottom: 8px; }
.quick-btn {
  padding: 6px 16px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--t-fast);
}
.quick-btn:hover {
  border-color: var(--accent);
  background: var(--accent-bg);
}

/* === 结果区 === */
.result-box { text-align: center; }
.result-box video,
.result-box audio {
  width: 100%;
  max-width: 640px;
  border-radius: var(--r-md);
}
.result-link {
  display: inline-block;
  margin-top: 12px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}
.result-link:hover { text-decoration: underline; }

/* === 状态徽章 === */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: var(--r-full);
  font-size: 12px;
  font-weight: 600;
}
.badge-running {
  background: var(--blue-bg);
  color: var(--blue);
}
.badge-running .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue);
  animation: pulse 1.5s infinite;
}
.badge-done {
  background: var(--green-bg);
  color: var(--green);
}
.badge-error {
  background: var(--red-bg);
  color: var(--red);
}

/* === TTS 录音 === */
.ref-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.ref-tab {
  padding: 8px 18px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all var(--t-fast);
}
.ref-tab:hover { color: var(--accent); }
.ref-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* 朗读文本框 (录音引导) */
.reading-text {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px 20px;
  margin-bottom: 12px;
}
.reading-text .label {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.reading-text .content {
  font-size: 18px;
  line-height: 1.8;
  color: var(--ink);
}
.reading-text .refresh {
  font-size: 13px;
  color: var(--accent);
  cursor: pointer;
  text-decoration: none;
  font-weight: 500;
  transition: opacity var(--t-fast);
}
.reading-text .refresh:hover {
  opacity: 0.7;
  text-decoration: underline;
}

.rec-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  margin: 16px 0;
}
.rec-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t-normal);
}
.rec-btn.idle { background: var(--red); color: #fff; }
.rec-btn.recording {
  background: #fca5a5;
  animation: pulse 1.5s infinite;
}
.rec-timer {
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  min-width: 50px;
}

.upload-section {
  border: 2px dashed var(--border-strong);
  border-radius: var(--r-md);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--t-fast);
}
.upload-section:hover { border-color: var(--accent); }
.upload-section input { display: none; }

.trans-result {
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--blue-bg);
  border: 1px solid rgba(37,99,235,0.2);
  border-radius: var(--r-md);
  display: none;
}
.trans-result.show { display: block; }
.trans-result .label { font-weight: 600; font-size: 12px; color: var(--blue); margin-bottom: 4px; }
.trans-result .text { font-size: 13px; color: #1e40af; white-space: pre-wrap; }

/* ===== 两级导航菜单 ===== */
.nav-item { position: relative; flex-shrink: 0; }
.nav-item-label {
  padding: 0 14px;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
  white-space: nowrap;
  transition: color var(--t-fast);
  gap: 4px;
}
.nav-item-label:hover { color: var(--ink); }
.nav-item-label .chevron {
  width: 14px; height: 14px;
  opacity: 0.5;
  transition: transform var(--t-fast);
  flex-shrink: 0;
}
.nav-item.has-sub:hover .chevron { transform: rotate(180deg); }

.nav-submenu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 168px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-lg);
  padding: 4px;
  z-index: 200;
  animation: dropdownIn var(--t-fast) ease;
}
@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.nav-item.has-sub:hover .nav-submenu { display: block; }
.nav-submenu .nav-tab {
  padding: 8px 14px;
  font-size: 13px;
  border-radius: var(--r-sm);
  height: auto;
  border-bottom: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-tab-icon {
  width: 16px; height: 16px;
  opacity: 0.6;
  flex-shrink: 0;
}
.nav-submenu .nav-tab:hover {
  background: var(--accent-bg);
  color: var(--accent);
}
.nav-submenu .nav-tab.active {
  background: var(--accent-bg);
  color: var(--accent);
  font-weight: 600;
  border-bottom: none;
}

/* ===== 引导页 ===== */
.boot-hero {
  position: relative;
  border-radius: var(--r-xl);
  overflow: hidden;
  margin-bottom: 28px;
  background: linear-gradient(135deg, #1a1a2e 0%, #3a2a6d 50%, #7a3ff2 100%);
  color: #fff;
}
.boot-hero-inner {
  position: relative;
  z-index: 2;
  padding: 48px 44px;
}
.boot-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: var(--r-full);
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 16px;
  color: rgba(255,255,255,0.8);
}
.boot-hero-badge .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent2);
  animation: pulse 2s infinite;
}
.boot-hero h1 {
  margin: 0 0 10px;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.boot-hero-sub {
  margin: 0 0 24px;
  font-size: 15px;
  opacity: 0.7;
  line-height: 1.5;
  max-width: 520px;
}
.boot-hero-actions { display: flex; gap: 10px; }
.boot-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0.3;
  background:
    radial-gradient(circle at 85% 15%, #a78bfa 0%, transparent 50%),
    radial-gradient(circle at 15% 85%, #6d28d9 0%, transparent 45%);
}

.boot-section-title {
  font-size: 17px;
  font-weight: 600;
  margin: 26px 0 14px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}
.boot-section-title::before {
  content: '';
  width: 3px;
  height: 16px;
  border-radius: 2px;
  background: var(--accent);
}

.boot-gen-status {
  background: var(--accent-bg);
  color: var(--accent);
  border: 1px solid var(--accent-border);
  border-radius: var(--r-md);
  padding: 10px 16px;
  font-size: 13px;
  margin-bottom: 14px;
}

.boot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.boot-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--t-normal);
}
.boot-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--sh-md);
  transform: translateY(-2px);
}
.boot-card-img {
  height: 130px;
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.boot-card-img img { width: 100%; height: 100%; object-fit: cover; }
.boot-img-placeholder { font-size: 12px; color: var(--muted); }
.boot-card-body { padding: 14px 16px 16px; }
.boot-card-title {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.boot-card-title .arrow {
  opacity: 0;
  transform: translateX(-4px);
  transition: all var(--t-fast);
  color: var(--accent);
  font-size: 14px;
}
.boot-card:hover .boot-card-title .arrow {
  opacity: 1;
  transform: translateX(0);
}
.boot-card-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 600;
  background: var(--accent-bg);
  color: var(--accent);
  margin-top: 8px;
}
.boot-card-desc { font-size: 12.5px; color: var(--muted); line-height: 1.7; }

.boot-scenes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}
.boot-scene {
  display: flex;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--ink-2);
  transition: border-color var(--t-fast);
}
.boot-scene:hover { border-color: var(--border-strong); }
.boot-scene-icon { font-size: 20px; }
.boot-scene b { color: var(--ink); font-weight: 600; }

.boot-footer { margin: 28px 0 8px; text-align: center; font-size: 12px; color: var(--muted); }

/* ===== 引导页底部强调区 ===== */
.boot-highlight {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0;
  margin: 34px 0 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 26px 20px;
  box-shadow: var(--sh-sm);
}
.boot-highlight-item {
  flex: 1;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  min-width: 0;
}
.boot-highlight-num {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  white-space: nowrap;
  -webkit-background-clip: unset;
  -webkit-text-fill-color: unset;
  background: none;
}
.boot-highlight-label { font-size: 12px; color: var(--muted); white-space: nowrap; }
.boot-highlight-sep { width: 1px; background: var(--border); margin: 4px 14px; }

@media (max-width: 720px) {
  .boot-highlight { flex-wrap: wrap; padding: 18px 12px; }
  .boot-highlight-item { min-width: 45%; padding: 6px 0; }
  .boot-highlight-sep { display: none; }
}

/* ===== 新增组件: 进度条 ===== */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-subtle);
  border-radius: var(--r-full);
  overflow: hidden;
}
.progress-bar .fill {
  height: 100%;
  background: var(--accent);
  border-radius: var(--r-full);
  transition: width var(--t-normal);
}

/* ===== 新增组件: 空状态 ===== */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
}
.empty-state .icon { font-size: 40px; opacity: 0.3; margin-bottom: 12px; }
.empty-state .title { font-size: 16px; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }
.empty-state .desc { font-size: 13px; }

/* ===== 新增组件: Toast ===== */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--ink);
  color: var(--surface);
  padding: 12px 20px;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--sh-lg);
  z-index: 300;
  transform: translateY(100px);
  opacity: 0;
  transition: all var(--t-normal);
}
.toast.show { transform: translateY(0); opacity: 1; }

/* 日志时间戳 (LTX 等生成进度) */
.log-ts {
  color: var(--muted, #888);
  font-size: 11px;
  opacity: .7;
  margin-right: 8px;
  font-variant-numeric: tabular-nums;
}

/* ==============================
   内容抓取 (分平台工作流 + 二维码登录)
   ============================== */
.cf-platforms {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.cf-platform {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 12px;
  cursor: pointer;
  transition: all var(--t-normal);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cf-platform:hover { border-color: var(--accent); }
.cf-platform.active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--bg));
  box-shadow: inset 0 0 0 1px var(--accent);
}
.cf-p-icon { font-size: 22px; }
.cf-p-name { font-weight: 600; font-size: 14px; }
.cf-p-hint { font-size: 11px; color: var(--muted); }

.cf-login-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.cf-login-status { display: flex; align-items: center; gap: 10px; }
.cf-login-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--border);
}
.cf-login-badge.logged {
  color: #16a34a;
  background: rgba(22,163,74,0.12);
  border-color: rgba(22,163,74,0.35);
}
.cf-login-badge.waiting { color: var(--accent); }
.cf-login-badge.fail { color: #f87171; }

.cf-qr-box {
  margin-top: 14px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.cf-qr-imgwrap {
  width: 240px;
  height: 240px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.cf-qr-imgwrap img { max-width: 100%; max-height: 100%; }
.cf-qr-tip {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.8;
  max-width: 260px;
}

.cf-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.cf-meta-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
}
.cf-meta-item b { color: var(--accent); }
