:root {
  --blue: #0066ff;
  --blue-dark: #0052cc;
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-700: #334155;
  --slate-900: #0f172a;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--slate-50);
  color: var(--slate-900);
  font-size: 14px;
}
header.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; background: #fff; border-bottom: 1px solid var(--slate-200);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.brand .logo {
  width: 32px; height: 32px; border-radius: 9px; background: rgba(0,102,255,.1);
  display: flex; align-items: center; justify-content: center; font-size: 17px;
}
.muted { color: var(--slate-500); font-size: 12px; }
.tabs { display: flex; gap: 4px; padding: 12px 20px 0; }
.tab {
  padding: 8px 14px; border-radius: 9px 9px 0 0; cursor: pointer; border: 1px solid transparent;
  background: transparent; font-size: 14px; color: var(--slate-500);
}
.tab.active { background: #fff; border-color: var(--slate-200); border-bottom-color: #fff; color: var(--blue); font-weight: 600; }
main { padding: 16px 20px 40px; }
.card { background: #fff; border: 1px solid var(--slate-200); border-radius: 14px; padding: 16px; }
.card + .card { margin-top: 14px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
button {
  font: inherit; cursor: pointer; border-radius: 9px; border: 1px solid var(--slate-200);
  background: #fff; padding: 8px 14px; color: var(--slate-700);
}
button:hover { background: var(--slate-50); }
button.primary { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 500; }
button.primary:hover { background: var(--blue-dark); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.danger { color: #dc2626; border-color: #fecaca; padding: 4px 8px; font-size: 12px; }
input, textarea, select {
  font: inherit; width: 100%; padding: 8px 10px; border-radius: 9px;
  border: 1px solid var(--slate-200); outline: none; background: #fff; color: var(--slate-900);
}
input:focus, textarea:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,102,255,.12); }
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; margin-bottom: 5px; font-size: 12px; color: var(--slate-500); }
.part-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.part-head h3 { margin: 0; font-size: 15px; }
.badge { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--slate-100); color: var(--slate-500); }
.materials { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.material {
  border: 1px solid var(--slate-200); border-radius: 10px; overflow: hidden; background: #fff;
  display: flex; flex-direction: column;
}
.material.selected { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(0,102,255,.15); }
.material video, .material .thumb { width: 100%; height: 92px; object-fit: cover; background: #0f172a; display: block; }
.material .meta { padding: 7px 8px; font-size: 11px; color: var(--slate-500); }
.material .meta .name { color: var(--slate-900); font-size: 12px; margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.material .actions { display: flex; justify-content: space-between; align-items: center; padding: 0 8px 8px; }
.upload {
  border: 1px dashed var(--slate-200); border-radius: 10px; padding: 18px; text-align: center;
  color: var(--slate-500); cursor: pointer; font-size: 12px;
}
.upload:hover { border-color: var(--blue); color: var(--blue); }
.progress { height: 8px; border-radius: 999px; background: var(--slate-100); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--blue); transition: width .3s; }
.task { border: 1px solid var(--slate-200); border-radius: 12px; padding: 14px; background: #fff; }
.task + .task { margin-top: 10px; }
.tag { font-size: 11px; padding: 2px 8px; border-radius: 999px; }
.tag.done { background: #ecfdf5; color: #047857; }
.tag.running { background: #eff6ff; color: #1d4ed8; }
.tag.failed { background: #fef2f2; color: #b91c1c; }
.hint { font-size: 12px; color: var(--slate-500); line-height: 1.7; }
.warn { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; padding: 10px 12px; border-radius: 10px; font-size: 12px; }
.error { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; padding: 10px 12px; border-radius: 10px; font-size: 12px; }
.empty { text-align: center; color: var(--slate-400); padding: 26px; font-size: 13px; }
.account-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.account { display: flex; align-items: center; gap: 8px; border: 1px solid var(--slate-200); border-radius: 10px; padding: 8px 10px; font-size: 13px; cursor: pointer; }
.account input { width: auto; }
.result-list { margin-top: 10px; font-size: 12px; }
.result-list div { padding: 3px 0; }
.loading-overlay { position: fixed; inset: 0; background: rgba(255,255,255,.75); display: flex; align-items: center; justify-content: center; font-size: 14px; color: var(--slate-500); }
video.preview { width: 100%; max-height: 420px; background: #000; border-radius: 10px; }

/* ===== 成片库 ===== */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.video-card {
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow .15s, transform .15s;
}
.video-card:hover { box-shadow: 0 6px 20px rgba(15,23,42,.08); transform: translateY(-1px); }
.video-thumb { width: 100%; height: 170px; background: #0f172a; object-fit: contain; display: block; }
.video-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.video-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.video-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.video-actions button { padding: 6px 12px; font-size: 13px; }
.video-actions a { text-decoration: none; }

/* ===== 设置页 ===== */
.tabs.inner { padding: 0 0 10px; }
.tab2 {
  padding: 7px 14px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--slate-200); background: #fff; color: var(--slate-500); font-size: 13px;
}
.tab2.active { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 500; }
.part-row {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 10px 12px; border: 1px solid var(--slate-200); border-radius: 10px; background: #fff;
}
.part-row + .part-row { margin-top: 8px; }
.part-row .idx {
  width: 26px; height: 26px; border-radius: 8px; background: var(--slate-100);
  display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--slate-500);
}
.voice-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; border: 1px solid var(--slate-200); border-radius: 10px;
}
.voice-row + .voice-row { margin-top: 8px; }
.bgm-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; border: 1px solid var(--slate-200); border-radius: 10px;
}
.bgm-row + .bgm-row { margin-top: 8px; }
.bgm-row audio { height: 34px; }

/* ===== 多页面导航 ===== */
.nav {
  display: flex; gap: 4px; padding: 10px 20px 0; background: var(--slate-50);
  border-bottom: 1px solid var(--slate-200);
}
.nav a {
  display: flex; align-items: center; gap: 6px; padding: 8px 14px;
  border-radius: 9px 9px 0 0; text-decoration: none; color: var(--slate-500);
  border: 1px solid transparent; border-bottom: none; font-size: 14px;
}
.nav a:hover { color: var(--blue); background: #fff; }
.nav a.active {
  background: #fff; border-color: var(--slate-200); color: var(--blue);
  font-weight: 600; margin-bottom: -1px;
}
.nav-icon { font-size: 15px; }
.top .right { display: flex; align-items: center; gap: 14px; }
.brand-name { font-weight: 600; }
.page-head { margin-bottom: 16px; }
.page-head h1 { margin: 0 0 4px; font-size: 22px; }
.page-head p { margin: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.stat .muted { font-size: 12px; }
.stat-num { font-size: 26px; font-weight: 700; margin: 4px 0 2px; }
.quick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-top: 12px; }
.quick {
  display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; text-decoration: none;
  border: 1px solid var(--slate-200); border-radius: 12px; color: var(--slate-900); background: #fff;
  transition: border-color .15s, transform .15s;
}
.quick:hover { border-color: var(--blue); transform: translateY(-1px); }
.quick > span:first-child { font-size: 20px; }
.quick .muted { font-size: 12px; }
#page { padding: 16px 20px 40px; }
