﻿:root {
  --bg: #0d0d22;
  --panel: #171540;
  --panel-2: #201c4a;
  --line: #2b2658;
  --line-strong: #3d3674;
  --text: #eceafb;
  --muted: #9b95c6;
  --accent: #b044b0;
  --accent-strong: #c84cc8;
  --accent-soft: #261d52;
  --accent-2: #3dd6a3;
  --accent-2-soft: #16352e;
  --warn: #f5b84d;
  --warn-soft: #3a2f17;
  --danger: #ff7b7b;
  --danger-soft: #3a1d25;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 4px 16px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 10px 32px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow-x: clip; }
body {
  background: radial-gradient(1000px 420px at 50% -80px, rgba(120, 72, 200, 0.28), transparent 65%), var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  padding-bottom: env(safe-area-inset-bottom);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, a { -webkit-tap-highlight-color: transparent; }
button { touch-action: manipulation; font-family: inherit; }

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(23, 21, 64, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
}
.topnav {
  display: flex;
  gap: 4px;
  width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.topnav::-webkit-scrollbar { display: none; }
.topnav a {
  flex: 0 0 auto;
  padding: 6px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  border: 1px solid transparent;
}
.topnav a:hover { color: var(--text); background: var(--panel-2); text-decoration: none; }
.topnav a.current {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #d05ad0);
  box-shadow: 0 2px 8px rgba(176, 68, 184, 0.3);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand .logo {
  width: 34px; height: 34px; flex: 0 0 auto; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #d05ad0);
  color: #fff; display: grid; place-items: center;
  font-weight: 800; font-size: 16px;
  box-shadow: 0 4px 12px rgba(176, 68, 184, 0.35);
}
.brand h1 {
  margin: 0; font-size: 16px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand p {
  margin: 2px 0 0; color: var(--muted); font-size: 12px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.top-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.topbar-btn {
  padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: linear-gradient(135deg, var(--accent), #d05ad0); color: #fff;
  text-decoration: none; white-space: nowrap; border: none; cursor: pointer;
}
.topbar-btn:hover { opacity: 0.9; color: #fff; text-decoration: none; }
.status-pill {
  padding: 4px 10px; border-radius: 999px; font-size: 12px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--muted);
  white-space: nowrap;
}
.status-pill.ok { color: var(--accent-2); background: var(--accent-2-soft); border-color: #1f5c46; }
.status-pill.off { color: var(--danger); background: var(--danger-soft); border-color: #6b2a3a; }

@media (max-width: 640px) {
  .brand p { display: none; }
}

/* ---------- 步骤导航条 ---------- */
.stepper {
  display: flex; gap: 6px; padding: 8px 10px; overflow-x: auto;
  background: #1b1745; border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}
.stepper::-webkit-scrollbar { display: none; }
.stepper a {
  flex: 0 0 auto; padding: 6px 11px; border-radius: 999px;
  color: var(--muted); font-size: 13px; border: 1px solid transparent;
  white-space: nowrap;
}
.stepper a:hover { color: var(--text); background: var(--panel-2); text-decoration: none; }
.stepper a.current {
  color: #fff; background: var(--accent);
  box-shadow: 0 2px 8px rgba(176, 68, 184, 0.3);
}
.stepper a.done { color: var(--accent-2); background: var(--accent-2-soft); border-color: #1f5c46; }

/* ---------- 页面布局（移动优先） ---------- */
.layout, .step-layout {
  display: grid; grid-template-columns: 1fr; gap: 14px;
  padding: 14px 12px 32px; max-width: 1500px; margin: 0 auto;
}
@media (min-width: 980px) {
  .layout { grid-template-columns: 320px 1fr; gap: 18px; padding: 24px; }
  .step-layout { grid-template-columns: 380px 1fr; gap: 18px; padding: 24px; }
}

.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow);
}
.card h2 { margin: 0 0 12px; font-size: 16px; }
.card h3 { margin: 14px 0 8px; font-size: 14px; color: var(--muted); }
.input-card { align-self: start; }
@media (min-width: 980px) { .input-card { position: sticky; top: 80px; } }

/* ---------- 表单 ---------- */
label.field { display: block; margin-bottom: 14px; }
label.field span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 13px; font-weight: 500; }
.rewrite-options-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: end; margin-bottom: 14px; }
.rewrite-options-row label.field { margin-bottom: 0; }
@media (max-width: 640px) {
  .rewrite-options-row { grid-template-columns: 1fr; }
}
input[type="text"], input[type="url"], input[type="password"], textarea, select {
  width: 100%; padding: 11px 13px; border-radius: 12px;
  border: 1.5px solid var(--line); background: #1b1745; color: var(--text);
  font: inherit; font-size: 16px; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { min-height: 100px; resize: vertical; line-height: 1.55; }
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(176, 68, 184, 0.25);
}

/* ---------- 按钮 ---------- */
.primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 13px 18px; border-radius: 12px; border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--accent), #d05ad0); color: #fff;
  font-size: 15px; font-weight: 700;
  box-shadow: 0 4px 14px rgba(176, 68, 184, 0.3);
  transition: filter 0.15s, transform 0.05s;
}
.primary:hover { filter: brightness(1.05); }
.primary:active { transform: scale(0.98); }
.primary:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; }
.secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; padding: 11px 16px; border-radius: 12px;
  border: 1.5px solid var(--line-strong); background: #1b1745; color: var(--text);
  cursor: pointer; font-size: 14px; font-weight: 600;
  transition: border-color 0.15s, background 0.15s;
}
.secondary:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
@media (min-width: 720px) {
  .primary, .secondary { width: auto; }
}
.input-run-btn { margin: 2px 0 12px; }
.step-actions .primary, .step-actions .secondary,
.record-box .row .secondary { width: auto; flex: 1; }

/* ---------- 徽标 / 状态 ---------- */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; border: 1px solid var(--line);
  color: var(--muted); background: var(--panel-2);
}
.badge.ok { color: var(--accent-2); background: var(--accent-2-soft); border-color: #1f5c46; }
.badge.warn { color: var(--warn); background: var(--warn-soft); border-color: #6b5527; }
.badge.off { color: var(--danger); background: var(--danger-soft); border-color: #6b2a3a; }
.badge.run { color: #fff; background: var(--accent); border-color: var(--accent); }

/* ---------- 上传 / 录音 ---------- */
.dropzone {
  border: 1.5px dashed var(--line-strong); border-radius: 12px; padding: 18px 14px;
  text-align: center; color: var(--muted); cursor: pointer; margin-bottom: 12px;
  background: var(--panel-2); transition: border-color 0.15s, background 0.15s;
}
.dropzone.drag { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
.dropzone input { display: none; }
.dz-body { font-weight: 600; font-size: 14px; }
.dz-result { font-size: 12px; margin-top: 4px; }
.record-box {
  border: 1.5px dashed var(--line-strong); border-radius: 12px; padding: 12px;
  margin-bottom: 12px; background: var(--panel-2);
}
.record-box .row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.record-box audio { width: 100%; margin-top: 8px; }

/* 公共音色试听 */
.voice-audition-row { display: flex; align-items: stretch; gap: 10px; }
.voice-audition-row select { flex: 1; min-width: 0; }
.voice-audition-row .secondary { flex: 0 0 auto; white-space: nowrap; }

/* 公共数字人卡片列表 */
.industry-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.industry-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--panel-2);
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.industry-chip em {
  font-style: normal;
  font-size: 11px;
  color: var(--muted);
  background: rgba(155, 149, 198, 0.14);
  border-radius: 999px;
  padding: 1px 7px;
}
.industry-chip:hover { border-color: var(--accent); color: var(--text); }
.industry-chip.active {
  border-color: var(--accent-2);
  background: var(--accent-2-soft);
  color: var(--accent-2);
}
.industry-chip.active em { background: rgba(61, 214, 163, 0.18); color: var(--accent-2); }
.person-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 4px;
}
.person-card {
  border: 1.5px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--panel);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.person-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.person-card.selected {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(61, 214, 163, 0.18), var(--shadow);
}
.person-cover {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  display: block;
  background: var(--panel-2);
}
.person-cover-wrap { position: relative; }
.person-preview-btn {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: rgba(13, 13, 34, 0.72);
  color: #fff;
  font-size: 13px;
  display: grid;
  place-items: center;
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  transition: background 0.15s, transform 0.15s;
}
.person-preview-btn:hover { background: var(--accent); transform: scale(1.08); }
.person-meta { padding: 8px 10px 10px; }
.person-name { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.person-name em { font-style: normal; color: var(--muted); font-size: 12px; margin-left: 6px; }
.person-industry {
  display: inline-block;
  margin: 2px 0 6px;
  font-size: 11px;
  color: var(--accent-2);
  background: var(--accent-2-soft);
  border-radius: 6px;
  padding: 2px 8px;
}
.person-tags {
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.person-figure {
  width: 100%;
  padding: 4px 6px;
  font-size: 12px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--panel-2);
  color: var(--text);
}
.person-figure-static { display: block; font-size: 12px; color: var(--muted); padding: 2px 0; }

/* 数字人预览浮层 */
.preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: rgba(8, 8, 24, 0.78);
  backdrop-filter: blur(6px);
  padding: 20px;
}
.preview-box {
  width: min(420px, 92vw);
  border-radius: 16px;
  overflow: hidden;
  background: var(--panel);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line-strong);
}
.preview-box video { width: 100%; display: block; max-height: 70vh; background: #000; }
.preview-tip {
  padding: 8px 12px;
  font-size: 12px;
  color: var(--muted);
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
}
.preview-tools { display: flex; }
.preview-voice-btn {
  flex: 1;
  padding: 10px;
  border: none;
  cursor: pointer;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 14px;
  border-right: 1px solid var(--line);
}
.preview-voice-btn:hover { color: var(--accent-2); }
.preview-close {
  flex: 1;
  width: auto;
  padding: 10px;
  border: none;
  cursor: pointer;
  background: var(--panel-2);
  color: var(--text);
  font-size: 14px;
}
.preview-close:hover { color: var(--accent-2); }

@media (max-width: 720px) {
  .person-grid { grid-template-columns: repeat(5, 1fr); gap: 8px; }
}
@media (max-width: 480px) {
  .person-grid { grid-template-columns: repeat(5, 1fr); gap: 6px; }
  .person-cover { aspect-ratio: 3 / 4; }
  .person-meta { padding: 6px 6px 8px; }
  .person-name { font-size: 12px; margin-bottom: 4px; }
  .person-name em { display: block; margin: 2px 0 0; font-size: 10px; }
  .person-tags { display: none; }
  .person-figure, .person-figure-static { font-size: 10px; padding: 3px 4px; }
  .person-preview-btn { width: 26px; height: 26px; right: 5px; bottom: 5px; font-size: 10px; }
}

/* ---------- 运行状态 / 日志 ---------- */
.job-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.job-log {
  background: #0b0b1e; border: 1px solid #2b2658; border-radius: 12px;
  padding: 12px; font-family: Consolas, monospace; font-size: 12px;
  max-height: 260px; overflow: auto; white-space: pre-wrap; color: #cbbcf5;
  margin-bottom: 14px;
}
.hidden { display: none !important; }

/* ---------- 结果区 / 预览 ---------- */
.preview-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 980px) { .preview-grid { grid-template-columns: 240px 1fr; } }
.preview-grid video, .preview-grid img, .preview-grid audio {
  width: 100%; border-radius: 12px; background: #0b0b1e;
}
.preview-grid audio { min-height: 44px; }
.result-area .preview-grid { grid-template-columns: 1fr; }

.kv { display: grid; grid-template-columns: 76px 1fr; gap: 6px 12px; margin: 10px 0; font-size: 13px; }
@media (min-width: 640px) { .kv { grid-template-columns: 90px 1fr; } }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
pre.kv { white-space: pre-wrap; word-break: break-word; margin: 10px 0; }

.timeline { max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.timeline table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 320px; }
.timeline td { padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.timeline td.time { color: var(--muted); white-space: nowrap; width: 110px; }

.file-list { margin: 8px 0 0; padding-left: 18px; color: var(--muted); font-size: 13px; word-break: break-all; }
.titles-list { display: grid; gap: 8px; }
.titles-list .title-row { display: grid; grid-template-columns: 26px 1fr; gap: 8px; align-items: center; }
.title-row .num { color: var(--muted); text-align: center; font-weight: 600; }
.hits { color: var(--danger); }
mark.hit { background: rgba(255, 107, 107, 0.2); color: var(--danger); border-radius: 4px; padding: 0 3px; }
.step-result pre {
  white-space: pre-wrap; word-break: break-word;
  background: var(--panel-2); border: 1px solid var(--line);
  padding: 10px 12px; border-radius: 10px; font-size: 13px;
}

/* ---------- 步骤导航（上下页） ---------- */
.step-nav {
  display: flex; flex-direction: column; gap: 12px;
  padding: 10px 12px 28px; max-width: 1500px; margin: 0 auto;
}
.step-nav .right { display: flex; gap: 10px; flex-wrap: wrap; }
.step-nav .right a { flex: 1; text-align: center; }
@media (min-width: 980px) {
  .step-nav { flex-direction: row; justify-content: space-between; padding: 16px 24px 40px; }
  .step-nav .right { flex-wrap: nowrap; }
  .step-nav .right a { flex: initial; }
}

/* ---------- 一页式项目工作台 ---------- */
.project-main { max-width: 1180px; margin: 0 auto; padding: 14px 12px 48px; }
@media (min-width: 980px) { .project-main { padding: 24px 24px 64px; } }
.project-wrap { display: block; gap: 14px; align-items: start; }
@media (min-width: 980px) { .project-wrap { grid-template-columns: 210px 1fr; gap: 20px; } }
.project-content { min-width: 0; }

.step-nav-v {
  display: flex;
  flex-direction: row;
  gap: 6px;
  overflow-x: auto;
  padding: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  scrollbar-width: none;
  position: sticky;
  top: 74px;
  z-index: 15;
}
.step-nav-v::-webkit-scrollbar { display: none; }
.vnav-link {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.vnav-link:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.vnav-link.done { color: var(--accent-2); background: var(--accent-2-soft); }
.vnav-link.fail { color: var(--danger); background: var(--danger-soft); }
@media (min-width: 980px) {
  .step-nav-v {
    position: sticky;
    top: 80px;
    flex-direction: column;
    gap: 4px;
    padding: 12px 10px;
    overflow: visible;
  }
  .vnav-link { width: 100%; padding: 10px 12px; }
}

.project-head {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  margin-bottom: 16px;
}
@media (min-width: 980px) {
  .project-head { flex-direction: row; justify-content: space-between; align-items: flex-end; }
}
.project-head h1 { margin: 0; font-size: 20px; }
@media (min-width: 980px) { .project-head h1 { font-size: 24px; } }
.eyebrow { color: var(--muted); font-size: 12px; margin: 0 0 2px; letter-spacing: 0.04em; }
.rename-card {
  display: flex; flex-direction: column; gap: 12px;
  background: linear-gradient(135deg, var(--accent-soft), transparent 65%);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 16px;
}
@media (min-width: 980px) {
  .rename-card { flex-direction: row; align-items: center; justify-content: space-between; }
}
.rename-info { min-width: 0; }
.rename-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rename-form input { flex: 1 1 220px; min-width: 180px; }
.rename-save-btn { width: auto; padding: 10px 18px; }
.project-rename { width: 100%; margin-bottom: 16px; }
.rename-status { font-size: 12.5px; color: var(--muted); }
.rename-status.ok { color: var(--accent-2); }
.rename-status.error { color: var(--danger); }
.engine-pill {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 8px; padding: 4px 12px; border-radius: 999px;
  background: var(--accent-soft); border: 1px solid var(--line);
  color: var(--accent-strong); font-size: 12px; font-weight: 600;
}
.ghost-link {
  display: inline-flex; align-items: center; padding: 8px 14px;
  border: 1.5px solid var(--line-strong); border-radius: 12px;
  color: var(--text); background: #1b1745; font-size: 13px; font-weight: 600;
  white-space: nowrap;
}
.ghost-link:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.head-right { display: flex; flex-direction: column; gap: 10px; width: 100%; }
@media (min-width: 980px) { .head-right { width: auto; align-items: center; flex-direction: row; flex-wrap: nowrap; } }

.progress-card { width: 100%; }
@media (min-width: 980px) { .progress-card { width: 320px; } }
.progress-track {
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 999px; height: 10px; overflow: hidden;
}
.progress-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #d05ad0);
  transition: width 0.3s;
}
.progress-meta {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 6px; font-size: 13px; color: var(--muted);
}
.progress-meta strong { color: var(--text); }

.step-rail {
  display: flex; gap: 8px; margin-bottom: 18px;
  flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px;
  scrollbar-width: none;
}
.step-rail::-webkit-scrollbar { display: none; }
.step-rail a {
  width: 36px; height: 36px; flex: 0 0 auto; display: grid; place-items: center;
  border-radius: 50%; background: #1b1745; border: 1.5px solid var(--line-strong);
  color: var(--muted); font-weight: 700; font-size: 14px; text-decoration: none;
  transition: all 0.15s;
}
.step-rail a:hover { border-color: var(--accent); color: var(--accent); }
.step-rail a.done { color: #fff; background: var(--accent-2); border-color: var(--accent-2); }
.step-rail a.fail { color: #fff; background: var(--danger); border-color: var(--danger); }

.step-cards { display: grid; grid-template-columns: 1fr; gap: 18px; align-items: start; }
@media (min-width: 800px) and (max-width: 1179px) {
  .step-cards { grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(4, auto); gap: 20px; }
  .step-card .step-body { grid-template-columns: 1fr; }
  .step-card .step-card-head { flex-wrap: wrap; }
  .step-card .preview-grid { grid-template-columns: 1fr; }
}
@media (min-width: 1180px) {
  .step-cards { grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(3, auto); gap: 20px; }
  .step-card .step-body { grid-template-columns: 1fr; }
  .step-card .step-card-head { flex-wrap: wrap; }
  .step-card .preview-grid { grid-template-columns: 1fr; }
}
.step-card {
  padding: 0;
  overflow: hidden;
  scroll-margin-top: 74px;
  margin-bottom: 0;
  height: 520px;
  display: flex;
  flex-direction: column;
}
.step-card-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 14px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  flex-wrap: wrap;
  flex: 0 0 auto;
}
@media (min-width: 720px) { .step-card-head { padding: 16px 20px; flex-wrap: nowrap; } }
.step-num {
  width: 40px; height: 40px; flex: 0 0 auto; border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), #d05ad0); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 16px;
  box-shadow: 0 4px 14px rgba(176, 68, 184, 0.3);
}
.step-title { flex: 1; min-width: 0; }
.step-title h2 { margin: 0 0 2px; font-size: 15.5px; }
.step-title p { margin: 0; color: var(--muted); font-size: 12.5px; }
.step-actions {
  display: flex; align-items: center; gap: 10px;
  width: 100%; justify-content: space-between;
}
@media (min-width: 720px) { .step-actions { width: auto; justify-content: flex-end; } }
.step-body { display: grid; grid-template-columns: 1fr; gap: 16px; padding: 14px; }
@media (max-width: 799px) {
  .step-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
}
@media (min-width: 920px) {
  .step-body { grid-template-columns: 400px 1fr; gap: 20px; padding: 18px 20px; }
}
@media (min-width: 800px) {
  .step-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
}
.step-body::-webkit-scrollbar { width: 6px; }
.step-body::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 3px; }
.step-body::-webkit-scrollbar-track { background: transparent; }
.step-inputs { min-width: 0; }
.step-inputs .field { margin-bottom: 12px; }
/* 步骤4 数字人选择区横跨整行，让公共数字人卡片列表每行 5 个真正铺满 */
#inputs-4 { grid-column: 1 / -1; }
#result-4 { grid-column: 1 / -1; }
.step-result { min-width: 0; min-height: 60px; }
.step-result > video, .step-result > audio { width: 100%; border-radius: 12px; background: #0b0b1e; }
.step-result .preview-grid img, .step-result img { max-width: 100%; border-radius: 12px; }

/* ---------- 摘要卡 + 详情面板 ---------- */
.step-summary {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.step-summary video, .step-summary img {
  width: 100%;
  max-height: 150px;
  object-fit: cover;
  border-radius: 10px;
  background: #0b0b1e;
}
.step-summary audio { width: 100%; }
.summary-text {
  color: var(--text); font-size: 13px; line-height: 1.5;
  word-break: break-word; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
}
.summary-meta { color: var(--muted); font-size: 12px; }
.summary-empty { color: var(--muted); font-size: 13px; text-align: center; margin: auto; line-height: 1.8; }
.open-step-btn {
  flex: 0 0 auto;
  width: 100%;
  border-radius: 0;
  box-shadow: none;
  padding: 14px;
  font-size: 14px;
}
@media (min-width: 720px) { .open-step-btn { width: 100%; } }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 4, 14, 0.7);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal {
  background: #1b1745;
  border-radius: 18px;
  width: 100%;
  max-width: 900px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}
.modal-head h2 { margin: 0; font-size: 18px; }
.modal-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.modal-close { flex: 0 0 auto; }
.modal-body { padding: 18px 20px; overflow-y: auto; min-height: 0; }
.modal-body .step-inputs { margin-bottom: 14px; }
.modal .input-run-btn { display: none; }
.modal-progress {
  flex: 1;
  min-width: 0;
  color: var(--accent);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.modal-progress::before { content: "⏳ "; }
.modal-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: var(--panel-2);
}
.modal-foot .secondary { width: auto; flex: 1; }
body.modal-open { overflow: hidden; }
@media (max-width: 640px) {
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal { max-height: 96vh; border-radius: 18px 18px 0 0; }
}

.next-step {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; margin: 0; padding: 13px 12px;
  border: none; border-top: 1px solid var(--line);
  background: var(--panel-2); color: var(--accent);
  font-weight: 700; font-size: 14px; cursor: pointer;
  transition: background 0.15s;
  flex: 0 0 auto;
}
.next-step:hover { background: var(--accent-soft); }
.next-step:disabled { opacity: 0.6; cursor: default; }
@media (min-width: 720px) {
  .next-step {
    width: auto; margin: 14px 20px 16px auto;
    border: 1.5px solid var(--line-strong); border-radius: 12px;
    background: #1b1745; padding: 10px 18px;
  }
  .next-step:hover { border-color: var(--accent); background: var(--accent-soft); }
}

/* ---------- 项目列表 ---------- */
.project-cards { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 720px) {
  .project-cards { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}
.project-card { cursor: pointer; transition: border-color 0.15s, transform 0.1s; }
.project-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.project-card .name { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.project-delete { width: auto !important; padding: 4px 12px; font-size: 12px; }
.project-card .meta { color: var(--muted); font-size: 12px; margin-bottom: 10px; }
.step-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.mini-progress { display: flex; align-items: center; gap: 8px; }
.mini-progress .progress-track { flex: 1; height: 8px; }
.mini-progress .num { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }

/* ---------- 设置页 ---------- */
.health-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 640px) {
  .health-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}
.health-item {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 10px 12px; background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 12px; font-size: 13px;
  flex-wrap: wrap;
}
.health-item .detail {
  color: var(--muted); font-size: 11px; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
@media (min-width: 640px) { .health-item .detail { max-width: 60%; } }
.settings-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 720px) {
  .settings-grid { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
}

/* ---------- 提示 / 说明 ---------- */
.hint { color: var(--muted); font-size: 12.5px; }
.hint.ok { color: var(--accent-2); }
.notice {
  border: 1px solid #6b5527; background: var(--warn-soft); color: var(--warn);
  padding: 11px 14px; border-radius: 12px; font-size: 13px; margin: 10px 0;
}
.notice.success { border-color: #1f5c46; background: var(--accent-2-soft); color: var(--accent-2); }
.error-box {
  border: 1px solid #6b2a3a; background: var(--danger-soft); color: var(--danger);
  padding: 12px 14px; border-radius: 12px; white-space: pre-wrap; font-size: 13px;
}
.check { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.use-script-row { display: flex; align-items: center; gap: 12px; margin: 2px 0 14px; }
.use-script-btn { width: auto; padding: 9px 18px; }
.use-script-status { font-size: 13px; color: var(--muted); }
.use-script-status.ok { color: var(--accent-2); }

/* ---------- 首页落地页 ---------- */
html { scroll-behavior: smooth; }

.lp-hero {
  max-width: 1180px;
  margin: 0 auto;
  padding: 64px 20px 48px;
}
.lp-hero-inner {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  text-align: center;
}
.lp-title {
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.12;
  letter-spacing: -0.01em;
  white-space: normal;
  margin: 0 0 18px;
}
.lp-title .grad {
  background: linear-gradient(120deg, #d05ad0 10%, #7a8cff 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lp-sub {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.75;
  max-width: 560px;
  margin: 0 auto 26px;
}
.lp-actions { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; margin-bottom: 26px; }
.lp-cta { width: auto; min-width: 180px; padding: 14px 26px; font-size: 15px; }
.lp-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 22px; border-radius: 12px;
  border: 1.5px solid var(--line-strong);
  color: var(--text); font-size: 15px; font-weight: 600;
  transition: border-color 0.15s, background 0.15s;
}
.lp-ghost:hover { border-color: var(--accent); background: var(--accent-soft); text-decoration: none; }
.lp-trust {
  display: flex; flex-wrap: wrap; gap: 10px 22px;
  color: var(--muted); font-size: 13px;
  justify-content: center;
}
.lp-trust span::before { content: "●"; color: var(--accent-2); margin-right: 8px; font-size: 9px; vertical-align: 2px; }

.lp-section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 64px 20px;
}
.lp-alt {
  max-width: none;
  background: linear-gradient(180deg, rgba(32, 28, 74, 0.5), rgba(13, 13, 34, 0.2));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.lp-head { text-align: center; margin-bottom: 36px; }
.lp-head h2 { font-size: clamp(24px, 3.2vw, 32px); margin: 0 0 10px; letter-spacing: -0.01em; }
.lp-head p { color: var(--muted); margin: 0; font-size: 15px; }

.lp-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.lp-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 22px;
  transition: border-color 0.15s, transform 0.12s;
}
.lp-card:hover { border-color: rgba(176, 68, 176, 0.65); transform: translateY(-2px); }
.lp-ico {
  display: grid; place-items: center;
  width: 46px; height: 46px; border-radius: 14px;
  background: var(--accent-soft); color: #e39be3;
  margin-bottom: 16px;
}
.lp-ico svg { width: 24px; height: 24px; }
.lp-card h3 { margin: 0 0 8px; font-size: 17px; color: var(--text); }
.lp-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.7; }

.lp-flow {
  list-style: none; margin: 0 auto; padding: 0;
  max-width: 760px;
  display: grid; gap: 0;
}
.lp-flow li {
  position: relative;
  display: flex; gap: 20px;
  padding: 0 0 28px 0;
}
.lp-flow li:last-child { padding-bottom: 0; }
.lp-flow li::before {
  content: "";
  position: absolute; left: 21px; top: 46px; bottom: 0;
  width: 2px; background: linear-gradient(180deg, rgba(208, 90, 208, 0.5), rgba(61, 214, 163, 0.35));
}
.lp-flow li:last-child::before { display: none; }
.lp-flow b {
  flex: 0 0 auto;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), #d05ad0);
  color: #fff; font-size: 16px; font-weight: 800;
  box-shadow: 0 0 0 6px var(--bg);
  z-index: 1;
}
.lp-flow-body {
  padding-top: 2px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  flex: 1;
  padding: 14px 18px;
}
.lp-flow-body h3 { margin: 0 0 4px; font-size: 16px; }
.lp-flow-body p { margin: 0; color: var(--muted); font-size: 14px; }

.lp-footer {
  display: flex; justify-content: center; align-items: center;
  gap: 10px 22px; flex-wrap: wrap;
  padding: 30px 16px 44px;
  border-top: 1px solid var(--line);
  color: var(--muted); font-size: 13px;
}
.lp-footer a { color: var(--accent); }

@media (max-width: 920px) {
  .lp-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .lp-hero { padding: 44px 16px 36px; }
  .lp-section { padding: 48px 16px; }
  .lp-grid { grid-template-columns: 1fr; }
  .lp-cta { width: 100%; }
  .lp-actions { flex-direction: column; align-items: stretch; }
  .lp-ghost { justify-content: center; }
  .lp-flow li { gap: 14px; }
}

/* ---------- 形象库 / 声音库 / 知识库 / 作品库 ---------- */
.lib-layout { max-width: 1400px; }
.lib-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.lib-toolbar .field { flex: 1 1 220px; }
.lib-toolbar .check { white-space: nowrap; }

.lib-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
.lib-card {
  border: 1.5px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--panel);
  transition: border-color 0.15s, transform 0.15s;
}
.lib-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.lib-cover-wrap { position: relative; }
.lib-cover {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  display: block;
  background: var(--panel-2);
}
.lib-fav-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: rgba(13, 13, 34, 0.72);
  color: var(--muted);
  font-size: 16px;
  backdrop-filter: blur(4px);
}
.lib-fav-btn.on { color: var(--warn); }
.lib-preview-btn {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: rgba(13, 13, 34, 0.72);
  color: #fff;
  font-size: 13px;
  display: grid;
  place-items: center;
  backdrop-filter: blur(4px);
}
.lib-preview-btn:hover { background: var(--accent); }
.lib-card-meta { padding: 8px 10px 12px; }
.lib-card-name { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.lib-card-name em { font-style: normal; color: var(--muted); font-size: 12px; margin-left: 6px; }

.lib-custom-form {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr auto;
  gap: 10px;
  margin-bottom: 14px;
}
.lib-custom-form input, .lib-custom-form select {
  min-width: 0;
}
.lib-custom-list { display: grid; gap: 8px; }
.lib-custom-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-2);
}
.lib-custom-info { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.lib-custom-info b { font-size: 14px; }
.lib-custom-info span { color: var(--muted); font-size: 12px; }
.lib-custom-thumb {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--panel-2);
}
.lib-upload-preview {
  max-width: 220px;
  max-height: 320px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
}
.lib-custom-actions { display: flex; gap: 8px; flex-shrink: 0; }
.lib-custom-actions .danger { color: var(--danger); border-color: #6b2a3a; }

.lib-voice-list { display: grid; gap: 8px; }
.lib-voice-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}
.lib-voice-info { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.lib-voice-info b { font-size: 15px; }
.lib-voice-info em { font-style: normal; color: var(--accent-2); font-size: 12px; }
.lib-voice-actions { display: flex; gap: 8px; flex-shrink: 0; }
.lib-voice-actions .fav-on { color: var(--warn); border-color: #6b5527; }

.knowledge-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.knowledge-tab {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--panel-2);
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}
.knowledge-tab:hover { color: var(--text); }
.knowledge-tab.active {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #d05ad0);
  border-color: transparent;
}
.knowledge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}
.knowledge-list { display: grid; gap: 12px; max-width: 980px; }
.knowledge-card h3 { margin: 0 0 8px; font-size: 15px; }
.knowledge-pre {
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.8;
  color: var(--text);
  background: #1b1745;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 10px 0;
}
.knowledge-line { margin: 8px 0 0; font-size: 14px; line-height: 1.8; }
.knowledge-ul { margin: 10px 0 0; padding-left: 20px; }
.knowledge-ul li { margin: 6px 0; font-size: 14px; }

.works-layout { max-width: 1180px; }
.work-card { margin-bottom: 14px; }
.work-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.work-head h2 { margin: 0; font-size: 17px; }
.work-actions { display: flex; gap: 8px; }
.work-actions .danger { color: var(--danger); border-color: #6b2a3a; }
.work-steps { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.work-step {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  color: var(--muted);
  border: 1px solid var(--line);
}
.work-step.done { color: var(--accent-2); background: var(--accent-2-soft); border-color: #1f5c46; }
.work-step.fail { color: var(--danger); background: var(--danger-soft); border-color: #6b2a3a; }
.work-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin: 10px 0;
}
.work-media-label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.work-media video, .work-media audio { width: 100%; border-radius: 10px; background: #000; }
.work-script summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.work-script pre {
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.8;
  background: #1b1745;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 8px 0 0;
}

@media (max-width: 900px) {
  .lib-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .lib-custom-form { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .lib-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .lib-custom-form { grid-template-columns: 1fr; }
  .lib-custom-item { flex-direction: column; align-items: flex-start; }
  .lib-voice-row { flex-direction: column; align-items: flex-start; }
}

/* ---------- 工作台：左侧详细导航 + 步骤页平铺 ---------- */
.step-pages { display: grid; gap: 18px; }
.step-page { scroll-margin-top: 96px; }
.step-page .step-inputs .input-run-btn { display: none; }
.step-page-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 0 18px 18px;
}
.step-page-bar .input-run-btn { width: auto; margin: 0; min-width: 150px; }
.step-page-bar .legal-btn { border: 1.5px solid rgba(245, 184, 77, 0.55); color: var(--warn); min-width: 120px; }
.step-page-bar .legal-btn:hover { background: var(--warn-soft); color: var(--warn); }

.legal-variant {
  margin-bottom: 18px; padding: 14px;
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--panel);
}
.legal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.legal-head h3 { margin: 0; font-size: 16px; }
.legal-risk { font-size: 13px; color: var(--warn); font-weight: 600; }
.legal-summary { margin: 10px 0 8px; color: var(--muted); font-size: 14px; }
.legal-editor {
  border: 1.5px solid var(--line-strong); border-radius: 12px;
  background: #1b1745; padding: 12px 14px;
  min-height: 120px; line-height: 1.8; font-size: 15px;
  white-space: pre-wrap; word-break: break-word;
}
.legal-editor:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(176, 68, 184, 0.25); }
.legal-hit {
  color: #ff7b7b;
  text-decoration: underline wavy #ff7b7b;
  text-underline-offset: 4px;
}
.legal-editor-actions { display: flex; align-items: center; gap: 12px; margin: 10px 0 12px; flex-wrap: wrap; }
.legal-editor-actions .secondary { width: auto; }
.legal-save-status { font-size: 13px; color: var(--accent-2); }
.legal-issues { list-style: none; margin: 0; padding: 0; }
.legal-issues li {
  padding: 10px 12px; margin-bottom: 8px;
  border-left: 3px solid var(--danger);
  background: var(--danger-soft);
  border-radius: 0 10px 10px 0;
  font-size: 14px; line-height: 1.7;
}
.legal-suggest { margin-top: 4px; color: var(--muted); font-size: 13px; }
.legal-clean { color: var(--accent-2); font-size: 14px; }

.vnav-link {
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: center;
  gap: 4px 10px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
}
.vnav-num {
  grid-row: 1;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px; font-weight: 800;
}
.vnav-txt { display: flex; flex-direction: column; min-width: 0; }
.vnav-txt b { font-weight: 600; font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vnav-txt i { font-style: normal; font-size: 11px; color: var(--muted); }
.vnav-dot { display: none; }
.vnav-link.done .vnav-num { background: var(--accent-2-soft); border-color: #1f5c46; color: var(--accent-2); }
.vnav-link.fail .vnav-num { background: var(--danger-soft); border-color: #6b2a3a; color: var(--danger); }
.vnav-link.done .vnav-txt i { color: var(--accent-2); }
.vnav-link.fail .vnav-txt i { color: var(--danger); }

@media (min-width: 920px) {
  .step-page .step-body { grid-template-columns: 380px 1fr; gap: 20px; padding: 18px 20px; }
  .step-page-bar { padding: 0 20px 20px; }
}

@media (min-width: 980px) {
  .project-main { max-width: none; margin: 0; padding: 24px 24px 64px 0; }
  .project-content { max-width: 1180px; }
  .project-wrap { grid-template-columns: 268px 1fr; gap: 22px; }
  .vnav-link {
    grid-template-columns: 34px 1fr 10px;
    gap: 6px 10px;
    padding: 10px 12px;
    font-size: 14px;
  }
  .vnav-num { width: 30px; height: 30px; font-size: 12px; }
  .vnav-txt b { font-size: 14px; }
  .vnav-txt i { font-size: 12px; }
  .vnav-dot {
    display: block;
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--line-strong);
    justify-self: end;
  }
  .vnav-link.done .vnav-dot { background: var(--accent-2); box-shadow: 0 0 0 3px var(--accent-2-soft); }
  .vnav-link.fail .vnav-dot { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
  .step-page-bar { padding: 0 22px 22px; }
}

/* 收起左侧导航 */
.vnav-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 6px 10px; margin-bottom: 6px;
  border-bottom: 1px solid var(--line);
  font-size: 12px; color: var(--muted);
}
.vnav-collapse {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--muted);
  cursor: pointer; font-size: 12px;
}
.vnav-collapse:hover { color: var(--text); border-color: var(--accent); }

.nav-expand {
  position: fixed; left: 0; top: 50%;
  transform: translateY(-50%);
  z-index: 60;
  width: 36px; height: 60px;
  border-radius: 0 12px 12px 0;
  border: 1px solid var(--line); border-left: none;
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer; font-size: 14px;
  box-shadow: var(--shadow);
}
.nav-expand:hover { background: var(--accent-soft); color: #fff; }

.project-main.nav-collapsed .project-wrap { grid-template-columns: 1fr; gap: 0; }
.project-main.nav-collapsed .step-nav-v { display: none; }
.project-main.nav-collapsed .project-content { max-width: none; }

@media (max-width: 979px) {
  .vnav-head, .vnav-collapse, .nav-expand { display: none; }
}


/* 步骤5 BGM 试听 */
.bgm-preview-btn {
  flex: 0 0 auto;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid var(--line, #d9dee8);
  border-radius: 8px;
  background: var(--panel-2, #f4f6fb);
  color: var(--text, #152033);
  cursor: pointer;
  white-space: nowrap;
}
.bgm-preview-btn:hover { border-color: var(--accent, #4f6ef7); color: var(--accent, #4f6ef7); }
.bgm-preview-btn:active { transform: scale(.97); }

/* 步骤5 BGM 一行工具栏：混音开关 + 音乐选择 + 试听 + 音量滑杆 */
.bgm-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0 12px;
  flex-wrap: wrap;
}
.bgm-bar .check { flex: 0 0 auto; margin: 0; }
.bgm-bar-select {
  flex: 1 1 170px;
  min-width: 140px;
  max-width: 280px;
  width: auto;
}
.bgm-bar .bgm-gain-row { flex: 1 1 230px; min-width: 190px; }

/* BGM 音量滑杆 */
.bgm-gain-row { display: flex; align-items: center; gap: 10px; }
.bgm-gain-label { flex: 0 0 auto; font-size: 12px; color: var(--text-light, #888); }
.bgm-gain-row input[type="range"] {
  flex: 1 1 auto;
  min-width: 120px;
  -webkit-appearance: none;
  appearance: none;
  height: 5px;
  border-radius: 3px;
  background: linear-gradient(90deg,
    var(--accent, #4f6ef7) 0%,
    var(--accent, #4f6ef7) var(--fill, 47%),
    var(--line, #e2e5ea) var(--fill, 47%),
    var(--line, #e2e5ea) 100%);
  outline: none;
  cursor: pointer;
  margin: 0;
}
.bgm-gain-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent, #4f6ef7);
  box-shadow: 0 1px 4px rgba(0,0,0,.18);
  cursor: grab;
  transition: transform .12s, box-shadow .12s;
}
.bgm-gain-row input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.18); }
.bgm-gain-row input[type="range"]:active::-webkit-slider-thumb { cursor: grabbing; transform: scale(1.18); box-shadow: 0 1px 8px rgba(79,110,247,.35); }
.bgm-gain-row input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent, #4f6ef7);
  box-shadow: 0 1px 4px rgba(0,0,0,.18);
  cursor: grab;
}
.bgm-gain-row input[type="range"]::-moz-range-track { height: 5px; border-radius: 3px; background: var(--line, #e2e5ea); }
.bgm-gain-row input[type="range"]::-moz-range-progress { height: 5px; border-radius: 3px; background: var(--accent, #4f6ef7); }
.bgm-gain-value {
  flex: 0 0 auto;
  min-width: 52px;
  text-align: right;
  font-size: 12px;
  font-weight: 600;
  color: var(--text, #152033);
  font-variant-numeric: tabular-nums;
}

/* 步骤5 自动剪辑选项行 */
.edit-options-row {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  margin: 6px 0 12px;
  flex-wrap: wrap;
}
.edit-options-row .check { flex: 0 0 auto; margin: 0 0 10px; }
.edit-options-row .edit-style-field { flex: 1 1 220px; margin: 0; min-width: 180px; }
@media (max-width: 640px) {
  .edit-options-row { flex-direction: column; align-items: stretch; }
  .edit-options-row .check { margin-bottom: 0; }
}

.advanced-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 12px;
  padding: 11px 14px;
  border: 1px solid var(--line, #d9dee8);
  border-radius: 12px;
  background: var(--panel-2, #f8f9fc);
  color: var(--text, #152033);
  font-weight: 700;
  cursor: pointer;
}
.advanced-toggle:hover { border-color: var(--accent, #4f6ef7); background: var(--accent-soft, rgba(79,110,247,.08)); }
.advanced-chevron { font-size: 12px; color: var(--muted, #667085); }
.advanced-panel {
  border: 1px solid var(--line, #d9dee8);
  border-radius: 14px;
  padding: 14px;
  background: var(--panel, #fff);
  margin-bottom: 12px;
}
.advanced-panel.collapsed { display: none; }
.advanced-panel .edit-options-row { margin-top: 0; }
.advanced-panel .dropzone { margin-bottom: 12px; }


/* 步骤5 字幕样式预览卡片（极小图标） */
.sub-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 2px 0 12px;
}
.sub-card {
  flex: 0 0 auto;
  border: 1px solid var(--line, #d9dee8);
  border-radius: 8px;
  padding: 0;
  background: #fff;
  cursor: pointer;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 4px;
  transition: border-color .15s, box-shadow .15s, transform .05s;
}
.sub-card:hover { border-color: var(--accent, #4f6ef7); }
.sub-card.selected {
  border-color: var(--accent, #4f6ef7);
  box-shadow: 0 0 0 2px var(--accent-soft, rgba(79,110,247,.25));
}
.sub-card:active { transform: scale(.97); }
.sub-card-preview {
  position: relative;
  width: 38px;
  height: 50px;
  border-radius: 5px;
  flex: 0 0 auto;
  background:
    radial-gradient(circle at 30% 20%, #3a4a6b 0, transparent 55%),
    linear-gradient(160deg, #1b2a4a 0%, #0e1422 100%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 3px 8px;
  overflow: hidden;
}
.sub-card-preview::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 55%, rgba(0,0,0,.35));
  pointer-events: none;
}
.sub-card-text {
  position: relative;
  z-index: 1;
  font-weight: 800;
  line-height: 1.05;
  text-align: center;
  letter-spacing: 0;
  white-space: nowrap;
}
.sub-card-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text, #152033);
  white-space: nowrap;
}
.sub-card.selected .sub-card-label { color: var(--accent, #4f6ef7); }

/* ---- 步骤5 自定义字幕样式面板 ---- */
.sub-custom-panel {
  margin: 10px 0 4px;
  padding: 14px;
  border: 1px solid var(--line, #e2e5ea);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(79,110,247,.04), rgba(79,110,247,.01) 60%), var(--bg-soft, #f7f8fa);
}
.sub-custom-panel[hidden] { display: none; }
.sub-custom-grid {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.sub-preview-wrap {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.sub-preview-canvas {
  width: 126px;
  height: 224px;
  border-radius: 10px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(79,110,247,.35), transparent 60%),
    radial-gradient(100% 60% at 80% 100%, rgba(255,106,165,.25), transparent 55%),
    linear-gradient(160deg, #1c2438 0%, #0e1322 55%, #090d18 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06), 0 4px 14px rgba(10,16,32,.25);
}
.sub-preview-text {
  position: absolute;
  left: 6px;
  right: 6px;
  line-height: 1.4;
  word-break: break-word;
  pointer-events: none;
}
.sub-preview-tip {
  font-size: 11px;
  color: var(--text-light, #888);
  letter-spacing: .5px;
}
.sub-custom-controls {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sub-ctrl-group {
  padding: 10px 12px;
  border: 1px solid var(--line, #e2e5ea);
  border-radius: 10px;
  background: #fff;
}
.sub-ctrl-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-light, #6b7280);
  margin-bottom: 8px;
  letter-spacing: 1px;
}
.sub-ctrl-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  flex-wrap: wrap;
}
.sub-ctrl-label {
  flex: 0 0 auto;
  min-width: 58px;
  font-size: 12px;
  color: var(--text-light, #888);
}
.sub-ctrl-value {
  flex: 0 0 auto;
  min-width: 40px;
  text-align: right;
  font-size: 12px;
  font-weight: 600;
  color: var(--text, #152033);
  font-variant-numeric: tabular-nums;
}
.sub-font-select {
  flex: 1 1 140px;
  min-width: 130px;
  max-width: 220px;
}
.sub-inline-check { margin: 0; }
/* 色板 */
.swatch-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--line, #d8dce4), 0 1px 3px rgba(0,0,0,.15);
  cursor: pointer;
  padding: 0;
  transition: transform .12s, box-shadow .12s;
}
.swatch:hover { transform: scale(1.15); }
.swatch.active {
  box-shadow: 0 0 0 2px var(--accent, #4f6ef7), 0 1px 4px rgba(79,110,247,.4);
  transform: scale(1.12);
}
.swatch-custom {
  position: relative;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px dashed var(--accent, #4f6ef7);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: #fff;
}
.swatch-custom input[type="color"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.swatch-custom span {
  font-size: 13px;
  line-height: 1;
  color: var(--accent, #4f6ef7);
  pointer-events: none;
  font-weight: 700;
}
/* 分段选择器 */
.seg {
  display: inline-flex;
  border: 1px solid var(--line, #d8dce4);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.seg-btn {
  border: none;
  background: transparent;
  padding: 5px 12px;
  font-size: 12px;
  color: var(--text-light, #6b7280);
  cursor: pointer;
  transition: background .12s, color .12s;
}
.seg-btn + .seg-btn { border-left: 1px solid var(--line, #e8ebf0); }
.seg-btn:hover { background: rgba(79,110,247,.06); color: var(--text, #152033); }
.seg-btn.active {
  background: var(--accent, #4f6ef7);
  color: #fff;
  font-weight: 600;
}
.sub-bg-extra[hidden] { display: none; }
.sub-reset-btn {
  border: 1px solid var(--line, #d8dce4);
  background: #fff;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 12px;
  color: var(--text, #152033);
  cursor: pointer;
  transition: border-color .12s, color .12s;
}
.sub-reset-btn:hover { border-color: #d9554f; color: #d9554f; }
.sub-save-tip { font-size: 11px; color: var(--text-light, #aaa); }
/* 面板内滑杆（与 BGM 音量滑杆同款） */
.sub-ctrl-row input[type="range"] {
  flex: 1 1 110px;
  min-width: 90px;
  max-width: 220px;
  -webkit-appearance: none;
  appearance: none;
  height: 5px;
  border-radius: 3px;
  background: linear-gradient(90deg,
    var(--accent, #4f6ef7) 0%,
    var(--accent, #4f6ef7) var(--fill, 50%),
    var(--line, #e2e5ea) var(--fill, 50%),
    var(--line, #e2e5ea) 100%);
  outline: none;
  cursor: pointer;
  margin: 0;
}
.sub-ctrl-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent, #4f6ef7);
  box-shadow: 0 1px 4px rgba(0,0,0,.18);
  cursor: grab;
  transition: transform .12s;
}
.sub-ctrl-row input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.18); }
.sub-ctrl-row input[type="range"]::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent, #4f6ef7);
  box-shadow: 0 1px 4px rgba(0,0,0,.18);
  cursor: grab;
}
/* 小屏：预览窗移到顶部横排 */
@media (max-width: 640px) {
  .sub-custom-grid { flex-direction: column; }
  .sub-custom-grid .sub-preview-wrap { flex-direction: row; gap: 12px; }
  .sub-preview-canvas { width: 90px; height: 160px; }
}
/* 步骤5 画中画混剪素材 */
.pip-clip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin: 10px 0 0;
}
.pip-card {
  position: relative;
  border: 1px solid var(--line, #e2e5ea);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  transition: box-shadow .15s;
}
.pip-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.pip-card-video {
  aspect-ratio: 9 / 16;
  background: #000;
  overflow: hidden;
}
.pip-card-video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pip-card-info {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  font-size: 12px;
}
.pip-card-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text, #333);
}
.pip-card-dur {
  flex: 0 0 auto;
  color: #888;
  font-variant-numeric: tabular-nums;
}
.pip-card-video { position: relative; }
.pip-card-play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 28px;
  color: #fff;
  background: rgba(0,0,0,.5);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: .8;
  transition: opacity .2s;
}
.pip-card-video video[controls]::-webkit-video-controls { z-index: 1; }
.pip-card-video video:not([controls]) ~ .pip-card-play-icon { display: none; }
.pip-card-del {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .15s;
}
.pip-card:hover .pip-card-del { opacity: 1; }
.pip-card-del:hover { background: rgba(217,83,79,.85); }
.pip-card-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 2px dashed var(--line, #e2e5ea);
  background: var(--bg-soft, #f4f5f7);
  aspect-ratio: 9 / 16;
  gap: 6px;
  transition: border-color .15s, background .15s;
}
.pip-card-add:hover {
  border-color: var(--primary, #4f6ef7);
  background: rgba(79,110,247,.06);
}
.pip-add-icon {
  font-size: 32px;
  color: var(--primary, #4f6ef7);
  line-height: 1;
}
.pip-add-label {
  font-size: 13px;
  color: var(--text-light, #888);
}
.link-btn { background: none; border: none; color: #d9534f; cursor: pointer; padding: 2px 6px; font-size: 13px; }
.link-btn:hover { text-decoration: underline; }
.pip-upload-section {
  margin: 14px 0 16px;
  padding: 14px;
  border: 1px solid var(--line, #e2e5ea);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(79,110,247,.06), rgba(79,110,247,.02));
}
.pip-upload-section .section-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--text, #152033);
  margin-bottom: 10px;
}
.pip-upload-section .pip-upload-head {
  align-items: center;
}
.pip-upload-section .dropzone {
  margin-top: 10px;
}
@media (max-width: 720px) {
  .pip-upload-section { padding: 12px; border-radius: 12px; }
}
.link-btn:hover { text-decoration: underline; }

/* ---------- 智能混剪区域 ---------- */
.pip-ai-section {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line, #e2e5ea);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(79,110,247,.04), rgba(79,110,247,.01));
}
.pip-ai-section .section-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text, #152033);
  margin-bottom: 8px;
}
.pip-ai-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.pip-ai-actions button { font-size: 13px; padding: 6px 14px; }
.pip-analyze-summary {
  font-size: 12px;
  color: var(--text-light, #888);
  margin-bottom: 8px;
}
.pip-ai-status {
  font-size: 12px;
  line-height: 1.6;
  padding: 8px 10px;
  border-radius: 8px;
  margin-bottom: 8px;
  word-break: break-all;
}
.pip-ai-status.info {
  color: #1d4ed8;
  background: rgba(59,110,247,.08);
}
.pip-ai-status.ok {
  color: #047857;
  background: rgba(16,185,129,.10);
}
.pip-ai-status.err {
  color: #b91c1c;
  background: rgba(239,68,68,.10);
}
.match-preview {
  margin-top: 8px;
}
.match-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.match-item {
  display: flex;
  align-items: stretch;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--line, #e2e5ea);
  border-radius: 10px;
  background: rgba(255,255,255,.5);
}
.match-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  justify-content: center;
}
.match-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary, #4f6ef7);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.match-text .match-num { margin-bottom: 2px; }
.match-seg {
  font-size: 12px;
  color: var(--text, #152033);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.match-time {
  font-size: 11px;
  color: var(--text-light, #888);
  font-variant-numeric: tabular-nums;
}
.match-card {
  flex: 0 0 140px;
  width: 140px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.match-card video {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  border-radius: 6px;
  background: #000;
  display: block;
}
.match-card-name {
  font-size: 11px;
  color: var(--text, #152033);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.match-card-desc {
  font-size: 10px;
  color: var(--text-light, #888);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.match-card-empty {
  width: 100%;
  aspect-ratio: 9 / 16;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-soft, #f4f5f7);
  border-radius: 6px;
  font-size: 11px;
  color: var(--text-light, #bbb);
}

/* ---------- 运行日志 ---------- */
.logs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.log-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}
.log-summary > div {
  padding: 12px;
  border-radius: 12px;
  background: var(--bg-soft, #f6f7fb);
  border: 1px solid var(--line, #e5e8ef);
}
.log-summary b {
  display: block;
  font-size: 22px;
  line-height: 1.2;
}
.log-summary span {
  color: var(--muted, #667085);
  font-size: 12px;
}
.log-filters {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.log-filters input,
.log-filters select {
  min-width: 0;
}
.logs-list {
  display: grid;
  gap: 12px;
}
.log-row {
  padding: 14px 16px;
  border: 1px solid var(--line, #e5e8ef);
  border-radius: 14px;
  background: var(--panel, #fff);
  box-shadow: 0 8px 24px rgba(20, 30, 55, 0.05);
}
.log-row.error {
  border-color: rgba(220, 53, 69, 0.35);
  background: #fff7f7;
}
.log-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.log-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 8px;
  color: var(--muted, #667085);
  font-size: 12px;
}
.log-meta a { color: var(--accent, #4f6ef7); }
.log-detail {
  margin-top: 10px;
}
.log-detail summary {
  cursor: pointer;
  color: var(--accent, #4f6ef7);
  font-size: 13px;
}
.log-detail pre {
  margin: 10px 0 0;
  padding: 12px;
  border-radius: 10px;
  background: #10131c;
  color: #e5e7eb;
  overflow: auto;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
@media (max-width: 900px) {
  .log-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .log-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .log-summary,
  .log-filters { grid-template-columns: 1fr; }
}

/* ---------- 工作日志页（新版） ---------- */
.logs-layout { max-width: 1400px; }
.logs-layout .log-filters {
  display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap;
}
.logs-layout .log-filters .field { flex: 1 1 180px; min-width: 0; }
.logs-layout .log-filters .field span { margin-bottom: 4px; }
.log-count {
  font-size: 13px; color: var(--muted); white-space: nowrap;
  align-self: center;
}
.log-list {
  grid-column: 1 / -1;
  display: grid; gap: 8px;
}
.log-entry {
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--panel); padding: 12px 16px;
  transition: border-color 0.15s;
}
.log-entry:hover { border-color: var(--line-strong); }
.log-entry[data-level="error"] { border-color: rgba(255, 123, 123, 0.35); }
.log-entry[data-level="warn"] { border-color: rgba(245, 184, 77, 0.35); }
.log-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.log-time { color: var(--muted); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.log-step { font-size: 12px; color: var(--accent); }
.log-event { font-size: 12px; color: var(--muted); }
.log-msg { flex: 1; min-width: 120px; font-size: 13px; color: var(--text); }
.log-duration {
  font-size: 12px; color: var(--muted); white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.log-toggle {
  background: none; border: 1px solid var(--line); border-radius: 8px;
  color: var(--muted); cursor: pointer; font-size: 12px; padding: 3px 10px;
  white-space: nowrap;
}
.log-toggle:hover { border-color: var(--accent); color: var(--accent); }
.log-detail { display: none; margin-top: 10px; }
.log-detail.open { display: block; }
.log-detail pre {
  margin: 0; padding: 12px; border-radius: 10px;
  background: #10131c; color: #e5e7eb;
  overflow: auto; font-size: 12px; line-height: 1.55;
  white-space: pre-wrap; word-break: break-word; max-height: 400px;
}
.log-meta {
  display: flex; gap: 14px; flex-wrap: wrap;
  margin-top: 6px; font-size: 12px;
}
