:root {
  --bg: #0a0c11;
  --bg-soft: #10131b;
  --panel: #141823;
  --panel-2: #1a1f2d;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #eef1f7;
  --muted: #97a0b3;
  --faint: #5d667a;
  --accent: #7c6cff;
  --accent-2: #b06dff;
  --accent-soft: rgba(124, 108, 255, 0.14);
  --ok: #3ddc97;
  --warn: #ffb020;
  --err: #ff5d6c;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
::selection { background: rgba(124, 108, 255, 0.4); }

/* ---------- 导航 ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 12, 17, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1080px; margin: 0 auto; padding: 0 20px;
  height: 60px; display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 17px; letter-spacing: 0.02em; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-size: 14px;
  box-shadow: 0 4px 14px rgba(124, 108, 255, 0.45);
}
.brand-name em { font-style: normal; color: var(--muted); font-size: 12px; font-weight: 500; margin-left: 4px; }
.nav-links { display: flex; gap: 4px; }
.nav-links a {
  padding: 8px 14px; border-radius: 10px; color: var(--muted);
  font-size: 14px; transition: all 0.15s;
}
.nav-links a:hover { color: var(--text); background: var(--panel-2); }
.nav-links a.active { color: #fff; background: var(--accent-soft); }

/* ---------- 布局 ---------- */
.app { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 28px 20px 60px; }
.foot { text-align: center; color: var(--faint); font-size: 12px; padding: 18px; border-top: 1px solid var(--line); }

.page-title { font-size: 24px; font-weight: 700; margin-bottom: 4px; }
.page-sub { color: var(--muted); font-size: 14px; margin-bottom: 24px; }

.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px;
}
.panel + .panel { margin-top: 16px; }

.section-title { font-size: 15px; font-weight: 600; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }

/* ---------- 首页 ---------- */
.hero { text-align: center; padding: 26px 0 8px; }
.hero h1 { font-size: clamp(26px, 4.5vw, 40px); font-weight: 800; letter-spacing: -0.01em; }
.hero h1 .g {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { color: var(--muted); margin-top: 10px; font-size: 15px; }

.create { max-width: 720px; margin: 22px auto 0; }
.create .field { margin-bottom: 18px; }
.field-label { font-size: 13px; color: var(--muted); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.field-label .hint { margin-left: auto; font-size: 12px; }

.direction-input {
  width: 100%; padding: 14px 16px; border-radius: var(--radius-sm);
  background: var(--bg-soft); border: 1px solid var(--line-strong);
  font-size: 16px; outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
.direction-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip {
  padding: 6px 13px; border-radius: 999px; font-size: 13px;
  background: var(--panel-2); border: 1px solid var(--line);
  color: var(--muted); transition: all 0.15s;
}
.chip:hover { color: var(--text); border-color: var(--accent); }

.seg { display: flex; gap: 8px; }
.seg button {
  flex: 1; padding: 11px; border-radius: var(--radius-sm);
  background: var(--bg-soft); border: 1px solid var(--line-strong);
  color: var(--muted); font-size: 14px; transition: all 0.15s;
}
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--accent-soft); border-color: var(--accent); color: #fff; font-weight: 600; }

.cta {
  width: 100%; padding: 16px; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-size: 17px; font-weight: 700; letter-spacing: 0.04em;
  box-shadow: 0 8px 24px rgba(124, 108, 255, 0.35);
  transition: transform 0.12s, box-shadow 0.12s, opacity 0.3s;
}
.cta:hover { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(124, 108, 255, 0.45); }
.cta:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.cta .busy { display: none; }
.cta.loading .busy { display: inline; }
.cta.loading .cta-label { display: none; }

.auto-row { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; font-size: 14px; color: var(--muted); }
.switch { position: relative; width: 42px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--line-strong); transition: 0.2s;
}
.slider::before {
  content: ""; position: absolute; width: 18px; height: 18px; left: 2px; top: 2px;
  border-radius: 50%; background: #fff; transition: 0.2s;
}
.switch input:checked + .slider { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(18px); }

/* ---------- 任务列表 ---------- */
.task-list { display: flex; flex-direction: column; gap: 10px; }
.task-row {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color 0.15s;
}
.task-row:hover { border-color: var(--line-strong); }
.task-row .dir { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-row .prog { color: var(--muted); font-size: 13px; max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-row .meta { color: var(--faint); font-size: 12px; text-align: right; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; flex: none; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.queued { background: rgba(151,160,179,.12); color: var(--muted); }
.badge.running { background: var(--accent-soft); color: var(--accent-2); }
.badge.done, .badge.ready { background: rgba(61,220,151,.12); color: var(--ok); }
.badge.failed, .badge.partial { background: rgba(255,93,108,.12); color: var(--err); }
.badge .dot.pulse { animation: pulse 1.4s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ---------- 任务详情 ---------- */
.task-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.task-head .t-title { font-size: 22px; font-weight: 700; flex: 1; min-width: 220px; }
.task-head .t-meta { color: var(--faint); font-size: 13px; }

.progress-card { display: flex; gap: 20px; align-items: center; margin-bottom: 4px; }
.steps {
  display: flex; align-items: center; gap: 0; flex-wrap: wrap;
  padding: 10px 0 4px; row-gap: 8px;
}
.step { display: flex; align-items: center; color: var(--faint); font-size: 13px; white-space: nowrap; }
.step .no {
  width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line-strong);
  display: grid; place-items: center; font-size: 12px; margin-right: 7px;
  background: var(--bg-soft); transition: all 0.2s;
}
.step .sep { width: 26px; height: 1px; background: var(--line-strong); margin: 0 8px; }
.step.done { color: var(--ok); }
.step.done .no { border-color: var(--ok); background: rgba(61,220,151,.12); }
.step.active { color: var(--text); font-weight: 600; }
.step.active .no { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-2); box-shadow: 0 0 0 4px rgba(124,108,255,.12); }

.current-progress {
  display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px;
  background: var(--bg-soft); border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm); padding: 12px 16px; margin-top: 6px;
}
.spin {
  width: 16px; height: 16px; border-radius: 50%; flex: none;
  border: 2px solid var(--accent-soft); border-top-color: var(--accent);
  animation: rot 0.9s linear infinite;
}
@keyframes rot { to { transform: rotate(360deg); } }

.shot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.shot-card {
  padding: 13px 14px; background: var(--panel-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); font-size: 13px;
}
.shot-card .s-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.shot-card .s-no { font-weight: 700; color: var(--accent-2); font-size: 12px; }
.shot-card .s-sub { color: var(--text); line-height: 1.45; min-height: 38px; }
.shot-card .s-dur { color: var(--faint); font-size: 12px; margin-top: 6px; }
.shot-card.error { border-color: rgba(255,93,108,.4); }

/* ---------- 成片卡片 ---------- */
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.v-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; transition: transform 0.15s, border-color 0.15s;
}
.v-card:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.v-cover { position: relative; aspect-ratio: 9/16; background: #0d1017; overflow: hidden; }
.v-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.v-cover .v-dur {
  position: absolute; right: 8px; bottom: 8px; font-size: 11px; font-weight: 600;
  background: rgba(0,0,0,.65); padding: 2px 8px; border-radius: 6px;
}
.v-cover .v-play {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(0,0,0,.25); opacity: 0; transition: opacity 0.2s;
}
.v-card:hover .v-play { opacity: 1; }
.v-play span {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(124,108,255,.9); font-size: 18px; padding-left: 3px;
}
.v-body { padding: 12px 14px; }
.v-title { font-weight: 600; font-size: 14px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.v-meta { color: var(--faint); font-size: 12px; margin-top: 6px; display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- 视频详情 ---------- */
.v-detail { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: 22px; align-items: start; }
.v-show { background: #0d1017; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.v-show video { width: 100%; display: block; aspect-ratio: 9/16; background: #000; }
.v-materials { display: flex; flex-direction: column; gap: 14px; }
.material { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.material h3 { font-size: 13px; color: var(--muted); margin-bottom: 8px; font-weight: 600; }
.copy-line {
  display: flex; align-items: flex-start; gap: 10px; justify-content: space-between;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px;
}
.copy-line .txt { font-size: 13.5px; line-height: 1.55; word-break: break-word; }
.copy-btn {
  flex: none; padding: 5px 12px; border-radius: 8px; font-size: 12px; font-weight: 600;
  background: var(--accent-soft); color: var(--accent-2); transition: all 0.15s;
}
.copy-btn:hover { background: var(--accent); color: #fff; }
.copy-btn.ok { background: rgba(61,220,151,.15); color: var(--ok); }
.hashtags { display: flex; flex-wrap: wrap; gap: 6px; }
.hash { font-size: 12.5px; padding: 4px 10px; background: var(--accent-soft); color: var(--accent-2); border-radius: 999px; }

.metric-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.metric-cell label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.metric-cell input { width: 100%; padding: 9px 11px; background: var(--bg-soft); border: 1px solid var(--line-strong); border-radius: 8px; outline: none; }
.metric-cell input:focus { border-color: var(--accent); }
.metric-cell input[type="number"] { -moz-appearance: textfield; }
.metric-cell input::-webkit-outer-spin-button, .metric-cell input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* ---------- 选题池 ---------- */
.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.topic-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; display: flex; flex-direction: column; gap: 10px;
}
.topic-card .t-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.topic-card .t-score {
  flex: none; font-weight: 800; font-size: 17px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.topic-card .t-title { font-weight: 600; font-size: 15px; line-height: 1.5; }
.topic-card .t-reason { color: var(--muted); font-size: 13px; line-height: 1.6; flex: 1; }
.topic-card .t-foot { display: flex; gap: 8px; align-items: center; }
.topic-card .t-dir { color: var(--faint); font-size: 12px; }
.btn {
  padding: 8px 14px; border-radius: 9px; font-size: 13px; font-weight: 600;
  background: var(--panel-2); border: 1px solid var(--line-strong); color: var(--text);
  transition: all 0.15s;
}
.btn:hover { border-color: var(--accent); color: #fff; }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border: none; color: #fff; }
.btn.danger { color: var(--err); }
.btn.danger:hover { border-color: var(--err); }
.btn.sm { padding: 6px 11px; font-size: 12px; }

/* ---------- 设置 ---------- */
.set-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: none; }
.set-row .label { font-size: 14px; }
.set-row .desc { color: var(--faint); font-size: 12px; margin-top: 2px; }
.set-row select { padding: 8px 12px; background: var(--bg-soft); border: 1px solid var(--line-strong); border-radius: 8px; outline: none; }

.empty { text-align: center; color: var(--faint); padding: 48px 0; font-size: 14px; }
.empty .big { font-size: 40px; margin-bottom: 10px; opacity: 0.5; }

/* ---------- 杂项 ---------- */
.toasts { position: fixed; top: 74px; right: 20px; z-index: 99; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--panel-2); border: 1px solid var(--line-strong); border-radius: 10px;
  padding: 11px 16px; font-size: 13.5px; box-shadow: var(--shadow);
  animation: slidein 0.25s ease;
  max-width: 320px;
}
.toast.err { border-color: rgba(255,93,108,.5); color: #ffb3ba; }
@keyframes slidein { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }

.media-dim { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; }
.media-dim button {
  padding: 9px 14px; border-radius: 9px; background: var(--panel-2);
  border: 1px solid var(--line-strong); color: var(--muted); font-size: 13px;
}
.media-dim button.on { color: #fff; border-color: var(--accent); background: var(--accent-soft); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) {
  .app { padding: 20px 14px 50px; }
  .v-detail { grid-template-columns: 1fr; }
  .grid2 { grid-template-columns: 1fr; }
  .task-row .prog { max-width: 200px; }
  .nav-inner { padding: 0 12px; }
  .brand-name em { display: none; }
  .step .sep { width: 14px; }
}