/* ============================================================
   原子视频工作台 · 样式
   方向：深色导航 + 浅色高密度工位（信息密度优先，少留白）
   规则：只调视觉与密度，类名与 DOM 结构不改（功能零变更）
   ============================================================ */

:root {
  /* ---- 面与线 ---- */
  --bg: #eaeef5;
  --panel: #ffffff;
  --panel-2: #f6f8fc;
  --line: #e4e9f2;
  --line-strong: #cbd4e3;

  /* ---- 文字（对比度按 WCAG 2.2 AA 校准：正文 ≥4.5:1，弱化文字不再低于 4.5）---- */
  --text: #16202f;
  --text-2: #525d70;
  --muted: #5a6476; /* QA 2026-10-01：原 #6b7484 在页面底仅 4.05，未达 AA */

  /* ---- 主色阶 ---- */
  --accent: #2160e6;
  --accent-2: #2f6bff;
  --accent-600: #1a51c9;
  --accent-soft: #e9efff;
  --accent-line: #bcd0ff;

  /* ---- 语义色（文字色已加深到 AA）---- */
  --ok: #0b7a45;
  --warn: #b45309;
  --danger: #c62828;
  --ok-soft: #e7f8ef;
  --warn-soft: #fef3e2;
  --danger-soft: #fdecec;

  /* ---- 形状 ---- */
  --radius: 12px;
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 14px;

  /* ---- 层级阴影 ---- */
  --shadow: 0 1px 2px rgba(16, 24, 40, .06);
  --sh-1: 0 1px 2px rgba(16, 24, 40, .06);
  --sh-2: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 12px -6px rgba(16, 24, 40, .10);
  --sh-3: 0 10px 26px -10px rgba(16, 24, 40, .22), 0 2px 6px rgba(16, 24, 40, .06);
  --sh-4: 0 24px 60px -18px rgba(12, 20, 36, .38);

  /* ---- 动效 ---- */
  --ease: cubic-bezier(.22, .61, .36, 1);
  --dur: .18s;

  /* ---- 导航 ---- */
  --nav-bg: #1b2332;
  --nav-text: #b6c1d4;
  --nav-hover: rgba(255, 255, 255, .07);
  --nav-active: rgba(47, 107, 255, .2);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.tiny { font-size: 11.5px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; min-width: 0; }
.between { justify-content: space-between; }

::selection { background: rgba(47, 107, 255, .18); }

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background:
    radial-gradient(900px 420px at 50% -8%, #dde7ff 0%, transparent 62%),
    var(--bg);
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(16, 24, 40, .08);
  padding: 22px 24px;
}

.brand { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; }
.brand h1 { font-size: 17px; margin: 0; letter-spacing: .2px; font-weight: 700; }
.brand p { margin: 1px 0 0; font-size: 11.5px; }
.brand strong { font-size: 13px; display: block; font-weight: 600; }
.brand.small { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.brand.small .brand-mark { width: 28px; height: 28px; font-size: 12px; border-radius: 8px; }

.brand-mark {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: #111;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px;
  flex: 0 0 auto;
  overflow: hidden;
}

/* 小米 logo 图：原图黑底 + 居中橙色 MI 圆角标，放大裁掉黑边让橙标顶满容器 */
.brand-mark img {
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scale(1.16);
  display: block;
}

.tabs {
  display: flex;
  gap: 3px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 3px;
  margin-bottom: 14px;
}

.tab {
  flex: 1;
  border: 0; background: transparent;
  padding: 6px 6px;
  border-radius: 7px;
  font-size: 12.5px; color: var(--text-2);
  cursor: pointer;
  font-family: inherit;
  transition: background .15s ease, color .15s ease;
}
.tab.active { background: #fff; color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(16,24,40,.08); }
.tab:hover:not(.active) { color: var(--text); }

.field { display: block; margin-bottom: 10px; }
.field > span { display: block; font-size: 11.5px; color: var(--text-2); margin-bottom: 4px; font-weight: 500; }

input, select, textarea {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 12.5px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 107, 255, .13);
}
input::placeholder, textarea::placeholder { color: #a8b1bf; }
textarea { resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11.5px; line-height: 1.55; }

.btn {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text);
  padding: 7px 13px;
  border-radius: 8px;
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .1s ease;
  white-space: nowrap;
}
.btn:hover { background: #f3f5f9; border-color: #b9c4d6; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.primary:hover { background: #2559d8; border-color: #2559d8; }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: rgba(47, 107, 255, .06); border-color: #b9c4d6; }
.btn.tiny { padding: 4px 8px; font-size: 11.5px; border-radius: 7px; }
.btn.block { width: 100%; margin-top: 4px; }
.btn.danger { color: var(--danger); border-color: #f3c9c9; }
.btn.danger:hover { background: #fff6f6; border-color: #ecb4b4; }

.link {
  border: 0; background: transparent; color: var(--accent);
  font-size: 12px; cursor: pointer; padding: 0; font-family: inherit;
}
.link:hover { text-decoration: underline; }
.link.signout { margin: 10px 12px 12px; text-align: left; }

.login-msg { font-size: 12px; min-height: 18px; margin: 8px 0 0; color: var(--danger); }
.login-msg.ok { color: var(--ok); }

/* 验证码行：输入框占满剩余空间，按钮固定宽度不被挤压截断 */
#field-code .row input { flex: 1 1 auto; width: auto; min-width: 0; }
#field-code .row .btn { flex: 0 0 auto; min-width: 96px; text-align: center; }

/* ---------- 应用布局 ---------- */
.app { display: flex; min-height: 100vh; }

/* 签名元素：深色导航栏，与浅色工位形成层次 */
.sidebar {
  width: 196px;
  flex: 0 0 196px;
  background: var(--nav-bg);
  border-right: 1px solid #141b28;
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar .brand { padding: 0 14px; }
.sidebar .brand strong { color: #f2f5fa; }
.sidebar .brand .muted { color: #8b97ab; }

#nav { display: flex; flex-direction: column; gap: 1px; padding: 4px 8px; flex: 1; }

.nav-item {
  display: flex; align-items: center; gap: 8px;
  border: 0; background: transparent;
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 12.5px; color: var(--nav-text);
  cursor: pointer; text-align: left;
  font-family: inherit;
  width: 100%;
  transition: background .15s ease, color .15s ease;
}
.nav-item i {
  font-style: normal; width: 15px; text-align: center;
  color: #7d8ba1; font-size: 12px; flex: 0 0 auto;
}
.nav-item:hover { background: var(--nav-hover); color: #e8eef8; }
.nav-item.active {
  background: var(--nav-active);
  color: #a8c2ff;
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--accent);
}
.nav-item.active i { color: #8db0ff; }

.sidebar .link.signout {
  color: #8b97ab;
  border-top: 1px solid rgba(255, 255, 255, .07);
  padding-top: 10px;
}
.sidebar .link.signout:hover { color: #fff; text-decoration: none; }

.main {
  flex: 1;
  padding: 16px 20px 40px;
  max-width: 1680px;
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 视图撑满主区，消灭页面下方大片留白 */
.view { display: none; }
.view.active {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}
.view.active > .card { margin-bottom: 13px; }
.view.active > .card:last-child {
  flex: 1 1 auto;
  margin-bottom: 0;
  min-height: 0;
}

/* 页头签名：accent 竖线统一各视图结构 */
.page-head { margin-bottom: 12px; }
.page-head h2 {
  margin: 0 0 2px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
  padding-left: 9px;
  border-left: 3px solid var(--accent);
}
.page-head p { margin: 0; font-size: 12px; padding-left: 12px; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 15px;
  margin-bottom: 13px;
  box-shadow: var(--shadow);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 10px;
}
.card-head h3 { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .1px; }

/* 两栏：等高拉伸，行高有上限（列表打满时饱满，数据少时不把灰底换成大片空卡） */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: minmax(240px, 540px);
  gap: 12px;
  align-items: start;
  align-content: start;
}
.two-col.wide-left { grid-template-columns: 1.35fr 1fr; }
.two-col.video-layout { grid-template-rows: minmax(280px, 1fr); }
.view.active > .two-col {
  flex: 0 1 auto;
  min-height: 0;
}
.view.active > .two-col.video-layout {
  flex: 1 1 auto;
}
.two-col > .card {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
}
.two-col .list, .two-col .gen-output {
  flex: 1;
  min-height: 0;
  max-height: none;
}

.two-col.video-layout { grid-template-columns: 1.7fr 1fr; gap: 12px; }
@media (max-width: 1100px) {
  .two-col.video-layout { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .two-col, .two-col.wide-left { grid-template-columns: 1fr; }
  .two-col.video-layout { grid-template-columns: 1fr; }
  .sidebar { width: 58px; flex: 0 0 58px; padding: 10px 0; }
  .sidebar .brand { justify-content: center; padding: 0 6px; }
  .sidebar .brand > div:last-child { display: none; }
  .nav-item {
    justify-content: center;
    padding: 8px 4px;
    font-size: 0;
    gap: 0;
    box-shadow: none;
  }
  .nav-item i { font-size: 14px; width: auto; }
  .nav-item.active { box-shadow: inset 3px 0 0 var(--accent); }
  .link.signout { font-size: 0; margin: 8px 6px 10px; text-align: center; }
  .link.signout::after { content: '退'; font-size: 11px; }
  .main { padding: 12px 12px 48px; }
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.form-grid .span2 { grid-column: span 2; }
@media (max-width: 720px) { .form-grid { grid-template-columns: 1fr; } .form-grid .span2 { grid-column: span 1; } }

/* 统计卡：大数字 + 等宽数字 */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 10px;
  margin-bottom: 13px;
}
.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px 13px;
  box-shadow: var(--shadow);
}
.stat .k { font-size: 11px; color: var(--muted); font-weight: 500; }
.stat .v {
  font-size: 24px; font-weight: 700;
  letter-spacing: -.5px;
  line-height: 1.15;
  margin-top: 1px;
  font-variant-numeric: tabular-nums;
}
.stat .d { font-size: 11px; color: var(--text-2); margin-top: 1px; }

/* 列表：高密度 + 屏外渲染跳过（长列表滚动性能） */
.list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 520px;
  overflow-y: auto;
  content-visibility: auto;
  contain-intrinsic-size: auto 520px;
}
.list.tall { max-height: 680px; contain-intrinsic-size: auto 680px; }

.item {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 11px;
  background: var(--panel-2);
  transition: border-color .15s ease, background .15s ease;
}
.item:hover { border-color: #c6d4f0; background: #fff; }
.item .t { font-weight: 600; font-size: 12.5px; display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.item .s { font-size: 11.5px; color: var(--text-2); margin-top: 2px; }
.item .a { margin-top: 7px; display: flex; gap: 5px; flex-wrap: wrap; }
.item.hit { border-color: #bcd0ff; background: var(--accent-soft); }

.pill {
  display: inline-block; padding: 0 7px; border-radius: 20px;
  font-size: 11px; line-height: 18px; background: #eef0f3; color: var(--text-2); white-space: nowrap;
}
.pill.ok { background: #e6f7ee; color: var(--ok); }
.pill.warn { background: #fef3e2; color: #b45309; }
.pill.bad { background: #fdeaea; color: #b91c1c; }
.pill.accent { background: var(--accent-soft); color: var(--accent); }

.studio-controls { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 8px; }
.studio-controls select { flex: 1; min-width: 180px; }
.inline { display: flex; align-items: center; gap: 5px; }
.inline > span { font-size: 11.5px; color: var(--text-2); white-space: nowrap; }
.inline input { width: 68px; }

.gen-output { max-height: 560px; overflow-y: auto; }
.gen-output pre {
  background: #f7f9fc; border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; font-size: 11.5px; overflow-x: auto; margin: 6px 0;
  white-space: pre-wrap; word-break: break-word; line-height: 1.6;
}
.seg { margin: 8px 0; padding: 8px 11px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 8px 8px 0; }
.seg .lbl { font-size: 11px; color: var(--accent); font-weight: 700; letter-spacing: .4px; }
.seg .txt { font-size: 13px; margin-top: 1px; }

.round {
  border: 1px solid var(--line); border-radius: 9px; padding: 8px 11px; margin-bottom: 7px; background: var(--panel-2);
}
.round.pass { border-color: #b8e6cd; background: #f4fcf7; }
.round.fail { border-color: #f3c9c9; background: #fef7f7; }

.score-bar { display: flex; height: 5px; border-radius: 3px; overflow: hidden; background: #eef0f3; margin: 5px 0; }
.score-bar > i { display: block; background: var(--accent); }

.dim-row { display: flex; align-items: center; gap: 8px; font-size: 11.5px; margin-bottom: 3px; }
.dim-row .n { width: 76px; color: var(--text-2); flex: 0 0 auto; }
.dim-row .b { flex: 1; height: 5px; background: #eef0f3; border-radius: 3px; overflow: hidden; }
.dim-row .b > i { display: block; height: 100%; background: var(--accent); }
.dim-row .v { width: 26px; text-align: right; font-variant-numeric: tabular-nums; color: var(--text-2); }

.chart { display: flex; flex-direction: column; gap: 7px; }
.chart .bar-row { display: flex; align-items: center; gap: 8px; font-size: 11.5px; }
.chart .bar-row .n { width: 84px; flex: 0 0 auto; color: var(--text-2); }
.chart .bar-row .b { flex: 1; height: 13px; background: #eef0f3; border-radius: 4px; overflow: hidden; }
.chart .bar-row .b > i { display: block; height: 100%; background: linear-gradient(90deg, #6b9bff, #2f6bff); }
.chart .bar-row .v { width: 28px; text-align: right; font-variant-numeric: tabular-nums; }

.warn {
  background: #fef8ec; border: 1px solid #f6e3bd; color: #7c5a1a;
  border-radius: 8px; padding: 8px 11px; font-size: 11.5px; margin: 0 0 12px; line-height: 1.55;
}

.toast {
  position: fixed; bottom: 22px; left: 50%;
  transform: translateX(-50%);
  background: #1a2230; color: #fff; padding: 9px 16px; border-radius: 9px;
  font-size: 12.5px; z-index: 999;
  box-shadow: 0 8px 24px rgba(0,0,0,.22);
  max-width: 80vw;
  animation: toast-in .18s ease;
}
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
.toast.err { background: var(--danger); }
.toast.ok { background: var(--ok); }

.empty { color: var(--muted); font-size: 11.5px; padding: 8px 0; text-align: center; }

/* 视频服务商「一键自检」结果清单 */
#provider-msg { display: block; }
#provider-msg .chk {
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-strong);
  border-radius: 7px;
  background: var(--panel-2);
  padding: 7px 9px;
  margin-top: 7px;
  font-size: 11.5px;
  line-height: 1.55;
}
#provider-msg .chk b { font-size: 12px; color: var(--text-2); }
#provider-msg .chk.ok { border-left-color: var(--ok); }
#provider-msg .chk.ok b { color: var(--ok); }
#provider-msg .chk.bad { border-left-color: var(--danger); background: #fff6f6; }
#provider-msg .chk.bad b { color: var(--danger); }
#provider-msg .chk-d { color: var(--text-2); margin-top: 2px; word-break: break-word; white-space: normal; }

.chips { display: flex; gap: 5px; flex-wrap: wrap; flex: 1; min-width: 240px; }
.chip {
  border: 1px solid var(--line-strong); background: #fff; color: var(--text-2);
  padding: 4px 10px; border-radius: 20px; font-size: 11.5px; cursor: pointer; font-family: inherit;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.chip:hover { background: #f3f5f9; }
.chip.on { background: var(--accent-soft); border-color: #bcd0ff; color: var(--accent); font-weight: 600; }
.chip.err { border-color: #f3c9c9; background: #fef7f7; color: var(--danger); }
/* 3C 垂类源：橙色系，与综合总榜区分开 */
.chip.vertical { border-color: #f0d6c2; color: #b4622a; }
.chip.vertical.on { background: #fff4ec; border-color: #eea877; color: #b4622a; box-shadow: 0 1px 2px rgba(238, 168, 119, .25); }

.src-group { margin-bottom: 8px; }
.src-group > .h {
  font-size: 11.5px; font-weight: 700; color: var(--text-2);
  padding: 3px 0 5px; position: sticky; top: 0; background: var(--panel); z-index: 1;
}
.src-group > .h .pill { margin-left: 6px; font-weight: 500; }

/* ---------- 爆款视频拆解面板 ---------- */
.bd-input { flex: 1 1 auto; width: auto; min-width: 0; }
.bd-status { font-size: 12px; color: var(--text-2); margin: 8px 0 0; min-height: 18px; }
.bd-status.ok { color: var(--ok); }
.bd-status.err { color: var(--danger); }

.bd-frames { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 0; }
.bd-frame { margin: 0; width: 96px; }
.bd-frame img { width: 100%; border-radius: 6px; border: 1px solid var(--line); display: block; }
.bd-frame figcaption { font-size: 10.5px; color: var(--text-2); text-align: center; margin-top: 2px; }

.bd-report { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
.bd-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.bd-head .pill.warn { background: #fff4ec; border-color: #e8c49f; color: #964a18; }
.bd-sum { font-size: 12.5px; color: var(--text); margin: 6px 0 10px; }
.bd-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }
.bd-cell { background: var(--panel-2, #f7f9fc); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.bd-cell h5 { margin: 0 0 4px; font-size: 11.5px; color: var(--text-2); font-weight: 700; }
.bd-cell p { margin: 0; font-size: 12.5px; line-height: 1.5; }
.bd-h5 { font-size: 12px; margin: 12px 0 6px; color: var(--text-2); }
.bd-rows { display: flex; flex-direction: column; gap: 5px; }
.bd-row { display: flex; gap: 8px; font-size: 12.5px; line-height: 1.5; }
.bd-tag { flex: 0 0 auto; min-width: 76px; font-weight: 600; color: var(--accent); }
.bd-list { margin: 0; padding-left: 18px; font-size: 12.5px; line-height: 1.6; }
.bd-ideas { display: flex; flex-direction: column; gap: 8px; }
.bd-actions { margin-top: 12px; display: flex; align-items: center; gap: 8px; }
.bd-more { margin: 4px 0; }
.bd-more summary { font-size: 11.5px; color: var(--accent); cursor: pointer; }
.pill.ok { background: #eefaf1; border-color: #bfe6cb; color: var(--ok); }

/* ---------- 成片库 ---------- */
.clip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 10px;
}
.clip-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow .15s ease, transform .15s ease;
}
@media (hover: hover) {
  .clip-card:hover { box-shadow: var(--sh-1, 0 4px 14px -6px rgba(20, 40, 80, .28)); transform: translateY(-1px); }
}
.clip-media { background: #0e1420; aspect-ratio: 9 / 16; display: flex; align-items: center; justify-content: center; }
.clip-media video { width: 100%; height: 100%; object-fit: contain; display: block; }
.clip-meta { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 3px; }
.clip-meta .t { font-size: 12.5px; font-weight: 600; }
.clip-meta .s { font-size: 11.5px; color: var(--text-2); }
.clip-meta .a { display: flex; gap: 6px; margin-top: 5px; }
.hot-item { display: flex; align-items: flex-start; gap: 8px; }
.hot-item input[type=checkbox] { width: auto; margin-top: 3px; flex: 0 0 auto; }
.hot-item .body { flex: 1; min-width: 0; }
.hot-item .tags { margin-right: 5px; }
.hot-item .tags > * ,
.hot-item .rel {
  display: inline-block;
  font-size: 11px;
  padding: 0 5px;
  border-radius: 4px;
  background: var(--bg);
  color: var(--text-2);
  margin-right: 3px;
  line-height: 17px;
}
.hot-item .rel { background: #e8f4ff; color: #0066cc; }
.hot-item .rel.mid { background: #e6f4ea; color: #137333; }
.hot-item .rel.high { background: #fce8e6; color: #c5221f; }

.hot-rank {
  flex: 0 0 18px; text-align: center; font-size: 11.5px; font-weight: 700; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.hot-rank.top { color: #e8503a; }

.idea { border: 1px solid var(--line); border-radius: 9px; padding: 10px 11px; background: var(--panel-2); }
.idea .t { font-weight: 600; font-size: 13px; }
.idea .m { font-size: 11.5px; color: var(--text-2); margin-top: 3px; }
.idea .m b { color: var(--text); }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: #c9d0da; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #aeb7c4; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 视频生成页 ---------- */
.video-script-card,
.video-jobs-card {
  display: flex;
  flex-direction: column;
  min-height: 480px;
}

.video-controls {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.video-script-select {
  flex: 1 1 220px;
  min-width: 180px;
}

.video-prompt {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  padding-right: 2px;
}

.video-prompt pre {
  background: #f7f9fc;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 12px;
  font-size: 11.5px;
  line-height: 1.65;
}

.job-list {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  padding-right: 2px;
}

.job-bulk-actions {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.job-item {
  position: relative;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.job-item:hover {
  border-color: #c6d4f0;
  background: #fff;
  box-shadow: 0 2px 6px rgba(16, 24, 40, .05);
}

.job-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}

.job-title {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.job-provider {
  font-weight: 700;
  font-size: 12.5px;
  color: var(--text);
}

.job-actions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.job-meta {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 5px;
}

.job-error {
  font-size: 11.5px;
  color: var(--danger);
  background: #fff6f6;
  border: 1px solid #f3c9c9;
  border-radius: 7px;
  padding: 7px 9px;
  margin-top: 5px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.job-video { margin-top: 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.job-video a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
}

/* 转存云存储行内的按钮与「已转存」徽标 */
.job-video .btn.tiny { flex: none; }
.job-video .pill { flex: none; }

/* ===== 产品图库 / 外观锁定 ===== */
.pf-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 5px;
}

.pf-thumb {
  position: relative;
  width: 68px;
  height: 68px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel-2);
  flex: none;
  transition: border-color .15s ease;
}
.pf-thumb:hover { border-color: #b9c4d6; }

.pf-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pf-del {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 17px;
  height: 17px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(16, 24, 40, 0.65);
  color: #fff;
  font-size: 11px;
  line-height: 17px;
  cursor: pointer;
}
.pf-del:hover {
  background: var(--danger);
}

.pf-add {
  cursor: pointer;
}

.prod-thumbs .pf-thumb {
  width: 50px;
  height: 50px;
}

.lock-box {
  border: 1px dashed #c9d4f0;
  background: #f8faff;
  border-radius: 9px;
  padding: 8px 11px;
  margin: 6px 0;
}
.lock-box:empty {
  display: none;
}

.lock-head {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  font-size: 12.5px;
}

.lock-appe {
  margin: 5px 0 0;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--text-2);
}

.lock-box.lock-warn {
  border-style: solid;
  border-color: #f3d9b0;
  background: #fef3e2;
  color: var(--warn);
  font-size: 11.5px;
  line-height: 1.55;
}

/* ---------- 外观展示页：布局档 ---------- */
/* 外观页内容比带货页长，不能用带货页那套「卡片定高 540px + 内部滚动」：
   否则 flex 会把模板卡片库（overflow:auto → 最小高度归零）和提示词区挤成 0 高。
   这里让行高随内容生长，提示词单独限高滚动。 */
.two-col.ap-layout { grid-template-rows: minmax(280px, auto); }
.two-col.ap-layout > .card { height: auto; }
.two-col.ap-layout .gen-output,
.two-col.ap-layout .tpl-grid { flex: 0 0 auto; }
.two-col.ap-layout .gen-output { max-height: 420px; }

/* ---------- 外观展示页：活图上传区（移植自豆包版） ---------- */
.upload-drop {
  border: 1.5px dashed var(--line-strong);
  border-radius: 12px;
  padding: 22px 18px;
  text-align: center;
  cursor: pointer;
  background: var(--panel-2);
  transition: border-color .15s, background .15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.upload-drop:hover { border-color: var(--accent); background: var(--accent-soft); }
.upload-drop.drag { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px rgba(47, 107, 255, .12); }
.upload-drop.has-img { border-style: solid; border-color: #b8e6cd; background: #f4fcf7; padding: 13px 16px; }
.upload-drop .dd-empty,
.upload-drop .dd-filled { font-size: 12.5px; color: var(--text-2); }
.upload-drop .dd-filled { display: none; color: var(--ok); font-weight: 600; }
.upload-drop.has-img .dd-empty { display: none; }
.upload-drop.has-img .dd-filled { display: block; }
.upload-drop input[type=file] { display: none; }

/* 预览画框：白底图居中展示，不铺满、不变形（2026-09-30 整改：原版裸 img 横向拉满整卡很难看） */
.ap-preview {
  display: block;
  max-width: min(100%, 480px);
  max-height: 280px;
  margin: 14px auto 2px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 22px -12px rgba(16, 24, 40, .22);
  object-fit: contain;
}

/* ---------- 外观展示页：全品类通用模板卡片库 ---------- */
.tpl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 10px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
}
.tpl-card {
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  padding: 11px 12px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s, background .15s;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.tpl-card:hover { border-color: #bcd0ff; background: #fff; }
.tpl-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(47, 107, 255, .14);
  background: var(--accent-soft);
}
.tpl-card-name { font-size: 13px; font-weight: 700; color: var(--text); }
.tpl-card-tag {
  display: inline-block;
  align-self: flex-start;
  font-size: 10.5px;
  color: var(--accent);
  background: #fff;
  border: 1px solid #bcd0ff;
  border-radius: 20px;
  padding: 0 8px;
  margin: 2px 0;
}
.tpl-card-meta { font-size: 11.5px; color: var(--text-2); }
.tpl-card-cam { font-size: 11px; color: var(--muted); line-height: 1.45; }

/* ---------- 外观展示页：模板管理折叠区 ---------- */
.ap-mgr {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.ap-mgr > summary {
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
}
.ap-mgr-body { padding-top: 10px; }
.ap-mgr-body textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  line-height: 1.5;
}

/* ---------- 产品线管理弹层 ---------- */
.lm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 120;
}
.lm-card {
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(16, 24, 40, .22);
  width: min(460px, 92vw);
  max-height: 82vh;
  overflow: auto;
  padding: 14px 16px;
}
.lm-card h4 { margin: 0 0 4px; font-size: 14px; }
.lm-card .lm-sub { margin: 0 0 10px; color: var(--text-2); font-size: 12px; }
.lm-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.lm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  background: var(--panel-2);
  font-size: 13px;
}
.lm-row button { color: var(--danger); }
.lm-add { display: flex; gap: 8px; margin-bottom: 12px; }
.lm-add input { flex: 1; }
.lm-foot { display: flex; justify-content: flex-end; gap: 8px; }

/* ---------- 卖点材料导入弹窗 ---------- */
.lm-card.pi-card { width: min(680px, 94vw); max-height: 86vh; overflow: auto; }
.pi-drop {
  display: flex; align-items: center; justify-content: center;
  border: 1.5px dashed var(--line); border-radius: 10px;
  padding: 18px 12px; cursor: pointer; margin-bottom: 10px;
  transition: border-color .15s ease, background .15s ease;
}
.pi-drop:hover { border-color: var(--accent, #2f6bff); background: rgba(47, 107, 255, .05); }
.pi-fname { font-weight: 600; font-size: 12.5px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pi-results-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 12px 0 8px; padding-top: 10px; border-top: 1px solid var(--line);
}
.pi-row {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 7px 9px; border: 1px solid var(--line); border-radius: 9px;
  margin-bottom: 6px; cursor: pointer; transition: border-color .12s ease, background .12s ease;
}
.pi-row:hover { border-color: var(--accent, #2f6bff); background: rgba(47, 107, 255, .04); }
.pi-row input { margin-top: 3px; }
.pi-p { font-weight: 700; font-size: 13px; white-space: nowrap; }
.pi-row .muted { flex: 1; min-width: 0; }

/* ============================================================
   v2 · 视觉与交互升级（2026-09-29）
   原则：只做视觉/交互层 —— 功能、数据结构、类名语义零变更。
   新增的涟漪 / 3D 微倾 / 数字滚动 / 命令面板 / 视图切换
   由 public/ui-polish.js 提供（删掉它的 script 标签即完全回退）。
   ============================================================ */

/* ---------- 1. 背景底噪：给高密度界面一点纵深 ---------- */
body {
  background:
    radial-gradient(1100px 520px at 12% -10%, rgba(47, 107, 255, .10), transparent 60%),
    radial-gradient(900px 460px at 100% 0%, rgba(120, 92, 255, .07), transparent 55%),
    var(--bg);
  background-attachment: fixed;
}

/* ---------- 2. 滚动条：更细，悬停加深 ---------- */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb {
  background: #c3cbd9;
  border: 2px solid transparent;
  border-radius: 999px;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: #9aa5b8; background-clip: content-box; }

/* ---------- 3. 卡片：分层阴影 + 悬停微抬 + 标题强调条 ---------- */
.card {
  border-radius: var(--r-lg);
  box-shadow: var(--sh-2);
  transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease),
    border-color var(--dur) var(--ease);
}
@media (hover: hover) {
  .card:hover { box-shadow: var(--sh-3); }
}
.card-head h3 { display: flex; align-items: center; gap: 7px; }
.card-head h3::before {
  content: '';
  width: 3px; height: 12px; flex: 0 0 auto;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ---------- 4. 页头：签名竖条从标题移到整块（标题排版更利落） ---------- */
.page-head { position: relative; padding-left: 11px; }
.page-head::before {
  content: '';
  position: absolute; left: 0; top: 3px; bottom: 3px; width: 3px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--accent-2), #7aa2ff);
}
.page-head h2 {
  border-left: 0;
  padding-left: 0;
  font-size: 18px;
  letter-spacing: -.2px;
}
.page-head p { padding-left: 0; }

/* ---------- 5. 按钮：主色渐变 + 抬升/按压 + 涟漪容器 ---------- */
.btn {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-sm);
  transition: transform .12s var(--ease), box-shadow var(--dur) var(--ease),
    background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.btn.primary {
  background: linear-gradient(180deg, var(--accent-2), var(--accent-600));
  border-color: var(--accent-600);
  box-shadow: 0 1px 2px rgba(20, 60, 160, .28), inset 0 1px 0 rgba(255, 255, 255, .18);
}
@media (hover: hover) {
  .btn:hover { transform: translateY(-1px); }
  .btn:not(.primary):hover { box-shadow: var(--sh-2); }
  .btn.primary:hover {
    background: linear-gradient(180deg, #3b76ff, #1c56d6);
    box-shadow: 0 6px 16px -6px rgba(20, 60, 160, .5), inset 0 1px 0 rgba(255, 255, 255, .2);
  }
}
.btn:active { transform: translateY(0) scale(.985); }
.btn:disabled,
.btn.primary:disabled {
  transform: none;
  box-shadow: none;
  background: linear-gradient(180deg, #8fb0f0, #7ea0e6);
  border-color: #7ea0e6;
}
.btn.ghost:disabled { background: transparent; border-color: var(--line-strong); }

/* 涟漪（ui-polish.js 注入 span.rp） */
.rp {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  transform: scale(0);
  opacity: .55;
  background: radial-gradient(circle, rgba(255, 255, 255, .8), rgba(255, 255, 255, 0) 70%);
  animation: rp-out .55s var(--ease) forwards;
}
.btn:not(.primary) .rp,
.nav-item .rp,
.chip .rp,
.tab .rp,
.tpl-card .rp {
  background: radial-gradient(circle, rgba(47, 107, 255, .32), rgba(47, 107, 255, 0) 70%);
}
@keyframes rp-out { to { transform: scale(2.6); opacity: 0; } }

/* ---------- 6. 导航：指示条滑动 + 悬停位移 ---------- */
.nav-item {
  position: relative;
  border-radius: var(--r-sm);
  overflow: hidden;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), transform .14s var(--ease);
}
.nav-item::before {
  content: '';
  position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, #8db0ff, var(--accent-2));
  transform: scaleY(0);
  transition: transform .22s var(--ease);
}
.nav-item.active {
  background: linear-gradient(90deg, rgba(47, 107, 255, .28), rgba(47, 107, 255, .08));
  box-shadow: none;
}
.nav-item.active::before { transform: scaleY(1); }
@media (hover: hover) {
  .nav-item:hover { transform: translateX(2px); }
  .nav-item.active:hover { transform: none; }
}

/* ---------- 7. 侧栏：渐变纵深 + 折叠开关 + 快捷键入口 ---------- */
.sidebar {
  background: linear-gradient(180deg, #1f2939 0%, #18202e 62%, #151c28 100%);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, .04);
}
.brand-mark {
  box-shadow: 0 4px 12px -4px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .18);
}

.nav-toggle {
  margin-left: auto;
  flex: 0 0 auto;
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 7px;
  background: rgba(255, 255, 255, .05);
  color: #b6c1d4;
  font-size: 11px; line-height: 1; font-family: inherit;
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.nav-toggle:hover { background: rgba(255, 255, 255, .14); color: #fff; }

.nav-hint {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin: 6px 10px 0;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, .04);
  color: #96a2b6;
  font-size: 11px; font-family: inherit;
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.nav-hint:hover { background: rgba(255, 255, 255, .1); color: #e8eef8; }
.nav-hint kbd {
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 5px;
  padding: 0 4px;
  font-family: inherit;
  font-size: 10px;
}

/* 折叠态（Ctrl/⌘ + B 或点头部按钮，状态记在 localStorage） */
.app.nav-collapsed .sidebar { width: 58px; flex: 0 0 58px; padding: 10px 0; }
.app.nav-collapsed .sidebar .brand { justify-content: center; padding: 0 6px; }
.app.nav-collapsed .sidebar .brand > div:last-child { display: none; }
.app.nav-collapsed .nav-toggle { margin: 0 auto; transform: rotate(180deg); }
.app.nav-collapsed .nav-hint { display: none; }
.app.nav-collapsed .nav-item { justify-content: center; padding: 8px 4px; font-size: 0; gap: 0; }
.app.nav-collapsed .nav-item i { font-size: 14px; width: auto; }
.app.nav-collapsed .link.signout { font-size: 0; margin: 8px 6px 10px; text-align: center; }
.app.nav-collapsed .link.signout::after { content: '退'; font-size: 11px; }

/* ---------- 8. 统计卡：顶部渐变描边 + 悬停抬升 ---------- */
.stat {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-lg);
  box-shadow: var(--sh-2);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.stat::after {
  content: '';
  position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--accent-2), #7aa2ff 55%, rgba(122, 162, 255, 0));
}
.stat .v { font-size: 26px; letter-spacing: -.6px; }
@media (hover: hover) {
  .stat:hover { transform: translateY(-2px); box-shadow: var(--sh-3); }
}

/* ---------- 9. 列表项 / 任务卡：悬停浮起 ---------- */
.item,
.idea,
.round {
  position: relative;
  border-radius: var(--r-sm);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
    border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
@media (hover: hover) {
  .item:hover,
  .idea:hover { transform: translateX(2px); box-shadow: var(--sh-2); }
  .job-item:hover { transform: translateX(2px); }
}

/* ---------- 10. 表单：悬停 / 聚焦 / 校验态 ---------- */
input, select, textarea {
  border-radius: var(--r-sm);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
    background var(--dur) var(--ease);
}
input:hover:not(:focus), select:hover:not(:focus), textarea:hover:not(:focus) { border-color: #b3bfd2; }
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 3px rgba(33, 96, 230, .16); }
input:user-invalid, textarea:user-invalid { border-color: #e2a3a3; }
input:user-invalid:focus { box-shadow: 0 0 0 3px rgba(198, 40, 40, .14); }
input[type=checkbox],
input[type=radio] { width: auto; accent-color: var(--accent); cursor: pointer; }

/* ---------- 11. 胶囊 / 筛选片：反馈 ---------- */
.pill { transition: transform .12s var(--ease), background var(--dur) var(--ease), color var(--dur) var(--ease); }
.chip {
  position: relative;
  overflow: hidden;
  transition: transform .12s var(--ease), background var(--dur) var(--ease),
    border-color var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
@media (hover: hover) {
  .chip:hover { transform: translateY(-1px); box-shadow: var(--sh-1); }
}
.chip:active { transform: scale(.97); }
.chip.on { box-shadow: 0 1px 2px rgba(33, 96, 230, .18), inset 0 0 0 1px rgba(33, 96, 230, .12); }

/* ---------- 12. 模板卡 / 缩略图 / 上传区 ---------- */
.tpl-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-md);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
    background var(--dur) var(--ease), transform var(--dur) var(--ease);
}
@media (hover: hover) {
  .tpl-card:hover { transform: translateY(-2px); box-shadow: var(--sh-3); }
}
.tpl-card.selected { box-shadow: 0 0 0 2px rgba(33, 96, 230, .2), var(--sh-2); }
.pf-thumb img { transition: transform .3s var(--ease); }
@media (hover: hover) {
  .pf-thumb:hover img { transform: scale(1.06); }
}
.upload-drop { border-radius: var(--r-lg); transition: border-color .15s var(--ease), background .15s var(--ease), transform .15s var(--ease); }
.upload-drop.drag { transform: scale(1.01); }

/* ---------- 13. 视图切换动效（ui-polish.js 打 .entering） ---------- */
.view.entering > * { animation: rise-in .3s var(--ease) both; }
.view.entering > *:nth-child(2) { animation-delay: .03s; }
.view.entering > *:nth-child(3) { animation-delay: .06s; }
.view.entering > *:nth-child(4) { animation-delay: .09s; }
@keyframes rise-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* ---------- 14. 3D 微倾（ui-polish.js 写入 --rx / --ry） ---------- */
.tilt {
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  will-change: transform;
}

/* ---------- 15. 命令面板（Ctrl/⌘ + K） ---------- */
.cmdk-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
  background: rgba(12, 20, 36, .42);
  backdrop-filter: blur(3px);
  animation: fade-in .16s var(--ease) both;
}
.cmdk-overlay.hidden { display: none; }
.cmdk {
  width: min(560px, 92vw);
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-4);
  overflow: hidden;
  animation: pop-in .2s var(--ease) both;
}
.cmdk-input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 13px 15px;
  font-size: 13.5px;
}
.cmdk-input:focus { box-shadow: none; border-bottom-color: var(--accent); }
.cmdk-list { list-style: none; margin: 0; padding: 6px; max-height: 46vh; overflow-y: auto; }
.cmdk-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 12.5px;
  color: var(--text-2);
}
.cmdk-item i { font-style: normal; width: 16px; text-align: center; color: var(--muted); }
.cmdk-item .k { margin-left: auto; font-size: 11px; color: var(--muted); }
.cmdk-item[aria-selected="true"] { background: var(--accent-soft); color: var(--text); }
.cmdk-item[aria-selected="true"] i { color: var(--accent); }
.cmdk-empty { padding: 14px; text-align: center; color: var(--muted); font-size: 12px; }
.cmdk-foot {
  display: flex; gap: 12px; flex-wrap: wrap;
  padding: 8px 14px;
  border-top: 1px solid var(--line);
  background: var(--panel-2);
  font-size: 11px;
  color: var(--muted);
}
.cmdk-foot kbd {
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 0 5px;
  background: #fff;
  font-family: inherit;
}
@keyframes fade-in { from { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(-8px) scale(.99); } }

/* ---------- 16. Toast：更立体 ---------- */
.toast {
  border-radius: 12px;
  padding: 10px 18px;
  font-weight: 500;
  letter-spacing: .2px;
  box-shadow: var(--sh-4);
  backdrop-filter: blur(6px);
  animation: toast-in .22s var(--ease);
}

/* ---------- 17. 跳转链接（仅键盘可见） ---------- */
.skip-link {
  position: fixed;
  top: 8px; left: 8px;
  z-index: 300;
  transform: translateY(-160%);
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--panel);
  color: var(--text);
  font-size: 12.5px;
  text-decoration: none;
  box-shadow: var(--sh-2);
  transition: transform .18s var(--ease);
}
.skip-link:focus { transform: none; }

/* ---------- 可访问性 / 动效收敛 ---------- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* ============================================================
   Hero 主图轮播（2026-09-29 深夜新增）
   结构：index.html #hero；切换逻辑：ui-polish.js 第 7 节
   ============================================================ */
.hero {
  position: relative;
  height: clamp(300px, 36vw, 430px);
  margin-bottom: 18px;
  border-radius: var(--r-lg);
  overflow: hidden;
  isolation: isolate;
  background: #0b1322;
  box-shadow: var(--sh-4);
}
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity .7s var(--ease), visibility 0s linear .7s;
  z-index: 1;
}
.hero-slide.is-active {
  opacity: 1;
  visibility: visible;
  transition: opacity .7s var(--ease);
  z-index: 2;
}
.hero-media, .hero-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.hero-media img {
  object-fit: cover;
  transform: scale(1.07);
}
.hero-slide.is-active .hero-media img {
  animation: heroZoom 9s var(--ease) forwards;
}
@keyframes heroZoom {
  from { transform: scale(1.07); }
  to   { transform: scale(1); }
}
/* 文案侧压暗 + 底部 UI 压暗，保证任意素材上白字可读 */
.hero-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(7, 13, 26, .86) 0%, rgba(7, 13, 26, .55) 36%, rgba(7, 13, 26, .08) 62%),
    linear-gradient(0deg, rgba(7, 13, 26, .62) 0%, rgba(7, 13, 26, 0) 34%);
  z-index: 1;
}
.hero-copy {
  position: absolute;
  left: clamp(20px, 4vw, 56px);
  bottom: clamp(56px, 9vw, 92px);
  right: clamp(120px, 22vw, 320px);
  z-index: 2;
  color: #fff;
  max-width: 560px;
}
.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  color: #cfe0ff;
  background: rgba(47, 107, 255, .28);
  border: 1px solid rgba(127, 176, 255, .45);
  backdrop-filter: blur(6px);
}
.hero-copy h3 {
  margin: 12px 0 8px;
  font-size: clamp(21px, 3vw, 31px);
  line-height: 1.22;
  letter-spacing: .01em;
  text-wrap: balance;
  text-shadow: 0 2px 18px rgba(4, 9, 20, .5);
}
.hero-copy p {
  margin: 0;
  font-size: clamp(12.5px, 1.4vw, 14.5px);
  line-height: 1.65;
  color: rgba(233, 240, 252, .82);
  max-width: 46ch;
}
.hero-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.hero .btn {
  background: rgba(255, 255, 255, .92);
  border-color: transparent;
  color: #14213a;
  font-weight: 600;
  backdrop-filter: blur(6px);
}
.hero .btn.primary {
  background: linear-gradient(135deg, #2f6bff, #5b8cff);
  color: #fff;
  border-color: rgba(255, 255, 255, .35);
  box-shadow: 0 8px 22px -8px rgba(47, 107, 255, .8);
}
.hero .btn.primary:hover { filter: brightness(1.08); }
.hero .btn.ghost {
  background: rgba(255, 255, 255, .12);
  color: #eaf1ff;
  border-color: rgba(255, 255, 255, .38);
}
.hero .btn.ghost:hover { background: rgba(255, 255, 255, .2); }

/* 底部：胶囊切换按钮 + 箭头 */
.hero-ui {
  position: absolute;
  left: clamp(20px, 4vw, 56px);
  right: clamp(20px, 4vw, 56px);
  bottom: 18px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.hero-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.hero-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .26);
  background: rgba(10, 18, 34, .42);
  color: rgba(233, 240, 252, .85);
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
}
.hero-tab i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .4);
  transition: background .2s var(--ease), box-shadow .2s var(--ease);
}
.hero-tab:hover { background: rgba(10, 18, 34, .6); color: #fff; transform: translateY(-1px); }
.hero-tab.is-active {
  background: rgba(47, 107, 255, .85);
  border-color: rgba(127, 176, 255, .8);
  color: #fff;
}
.hero-tab.is-active i { background: #fff; box-shadow: 0 0 8px rgba(255, 255, 255, .9); }
.hero-nav { display: flex; gap: 8px; }
.hero-arrow {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .3);
  background: rgba(10, 18, 34, .42);
  color: #fff;
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background .2s var(--ease), transform .15s var(--ease);
}
.hero-arrow:hover { background: rgba(47, 107, 255, .75); transform: scale(1.08); }
.hero-arrow:active { transform: scale(.94); }

/* 右上角页码 */
.hero-count {
  position: absolute;
  top: 18px;
  right: 22px;
  z-index: 3;
  display: flex;
  align-items: baseline;
  gap: 4px;
  color: #fff;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 10px rgba(4, 9, 20, .6);
}
.hero-count b { font-size: 21px; font-weight: 700; letter-spacing: .03em; }
.hero-count span { font-size: 12px; color: rgba(233, 240, 252, .68); }

/* 自动轮播进度条（悬停时暂停） */
.hero-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  z-index: 3;
  background: rgba(255, 255, 255, .12);
}
.hero-progress i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent-2), #8db4ff);
  animation: heroBar 6.5s linear forwards;
}
.hero:hover .hero-progress i { animation-play-state: paused; }
@keyframes heroBar {
  from { width: 0; }
  to   { width: 100%; }
}

/* ---------- 两张代码绘制主图 ---------- */
.hero-slide[data-art="aurora"] {
  background:
    radial-gradient(560px 300px at 76% 16%, rgba(47, 107, 255, .58), transparent 64%),
    radial-gradient(500px 330px at 94% 82%, rgba(124, 58, 237, .42), transparent 64%),
    radial-gradient(520px 300px at 52% 100%, rgba(14, 165, 164, .3), transparent 60%),
    linear-gradient(115deg, #0a1122 0%, #0e1a33 55%, #14264e 100%);
}
.hero-slide[data-art="aurora"]::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(720px 420px at 74% 42%, #000 30%, transparent 76%);
  mask-image: radial-gradient(720px 420px at 74% 42%, #000 30%, transparent 76%);
}
.hero-slide[data-art="aurora"]::after {
  content: "";
  position: absolute;
  right: -70px;
  top: 50%;
  width: 330px;
  height: 330px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: conic-gradient(from 210deg, rgba(47, 107, 255, 0), rgba(47, 107, 255, .6), rgba(124, 58, 237, .38), rgba(47, 107, 255, 0) 72%);
  -webkit-mask: radial-gradient(closest-side, transparent 60%, #000 61%, #000 71%, transparent 72%);
  mask: radial-gradient(closest-side, transparent 60%, #000 61%, #000 71%, transparent 72%);
}
.hero-slide[data-art="grid"] {
  background:
    radial-gradient(520px 280px at 82% 26%, rgba(47, 107, 255, .4), transparent 66%),
    linear-gradient(180deg, #0b1322, #101d36);
}
.hero-slide[data-art="grid"]::before {
  content: "";
  position: absolute;
  left: -22%;
  right: -22%;
  bottom: -46px;
  height: 58%;
  background-image:
    linear-gradient(rgba(127, 176, 255, .17) 1px, transparent 1px),
    linear-gradient(90deg, rgba(127, 176, 255, .17) 1px, transparent 1px);
  background-size: 54px 34px;
  transform: perspective(430px) rotateX(58deg);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 42%);
  mask-image: linear-gradient(180deg, transparent, #000 42%);
}
.hero-slide[data-art="grid"]::after {
  content: "";
  position: absolute;
  right: 11%;
  top: 17%;
  width: 230px;
  height: 150px;
  border: 1px solid rgba(127, 176, 255, .5);
  border-radius: 16px;
  background:
    linear-gradient(140deg, rgba(47, 107, 255, .26), rgba(124, 58, 237, .12)),
    radial-gradient(120px 70px at 70% 30%, rgba(127, 176, 255, .28), transparent 70%);
  box-shadow: 0 30px 60px -20px rgba(47, 107, 255, .45), inset 0 0 42px rgba(127, 176, 255, .14);
  transform: rotate(-4deg);
}

/* ---------- 小屏适配 ---------- */
@media (max-width: 860px) {
  .hero { height: 360px; }
  .hero-copy { right: 24px; bottom: 96px; }
  .hero-copy h3 { font-size: 20px; }
  .hero-slide[data-art="grid"]::after { width: 150px; height: 100px; right: 8%; }
  .hero-slide[data-art="aurora"]::after { width: 210px; height: 210px; }
}
@media (max-width: 620px) {
  .hero { height: 400px; }
  .hero-copy { bottom: 128px; }
  .hero-ui { flex-direction: column; align-items: flex-start; gap: 10px; }
  .hero-nav { position: absolute; right: 16px; bottom: 56px; }
  .hero-count { top: 12px; right: 14px; }
}

/* ---------- 浅色产品轮播变体 v3（小米官网风：白底官方图 multiply 融底，2026-09-29 深夜） ---------- */
.hero.hero-light {
  height: clamp(300px, 34vw, 440px);
  background: #fdfdfe;
}
.hero-light .hero-slide { background: #f6f8fc; }
.hero-light .hero-slide[data-tint="pink"]   { background: linear-gradient(115deg, #ffffff 4%, #ffeef3 55%, #ffdeea 100%); }
.hero-light .hero-slide[data-tint="black"]  { background: linear-gradient(115deg, #ffffff 4%, #eef2f9 55%, #dde6f3 100%); }
.hero-light .hero-slide[data-tint="gold"]   { background: linear-gradient(115deg, #fffef6 4%, #fff3c7 55%, #ffe9a6 100%); }
.hero-light .hero-slide[data-tint="violet"] { background: linear-gradient(115deg, #ffffff 4%, #f1eefb 55%, #e2dcf6 100%); }
/* 白底产品图：multiply 融入浅色渐变底，产品居右不裁切 */
.hero-light .hero-media img {
  left: auto;
  width: min(58%, 620px);
  object-fit: contain;
  object-position: right center;
  mix-blend-mode: multiply;
  padding: clamp(14px, 2.4vw, 28px) clamp(16px, 3vw, 48px) clamp(14px, 2.4vw, 28px) 0;
  box-sizing: border-box;
}
.hero-light .hero-copy {
  color: #17233c;
  right: clamp(220px, 38vw, 56%);
  bottom: clamp(60px, 9vw, 96px);
}
.hero-light .hero-copy h3 { color: #101d36; text-shadow: none; }
.hero-light .hero-copy p { color: #5a6579; }
.hero-light .hero-tag {
  color: #1d4fd8;
  background: rgba(47, 107, 255, .1);
  border-color: rgba(47, 107, 255, .38);
  backdrop-filter: none;
}
.hero-light .btn.ghost {
  background: rgba(23, 35, 60, .06);
  color: #17233c;
  border-color: rgba(23, 35, 60, .26);
}
.hero-light .btn.ghost:hover { background: rgba(23, 35, 60, .12); }
/* 控件浅色化：胶囊 / 箭头 / 页码 / 进度条 */
.hero-light .hero-tab {
  border-color: rgba(23, 35, 60, .14);
  background: rgba(255, 255, 255, .88);
  color: #5a6579;
  backdrop-filter: none;
  box-shadow: 0 1px 6px rgba(23, 35, 60, .06);
}
.hero-light .hero-tab i { background: rgba(23, 35, 60, .3); }
.hero-light .hero-tab:hover { background: #fff; color: #17233c; }
.hero-light .hero-tab.is-active { background: #17233c; border-color: #17233c; color: #fff; }
.hero-light .hero-tab.is-active i { background: #fff; box-shadow: none; }
.hero-light .hero-arrow {
  border-color: rgba(23, 35, 60, .16);
  background: rgba(255, 255, 255, .9);
  color: #17233c;
  backdrop-filter: none;
  box-shadow: 0 1px 6px rgba(23, 35, 60, .06);
}
.hero-light .hero-arrow:hover { background: #2f6bff; border-color: #2f6bff; color: #fff; }
.hero-light .hero-count { color: #17233c; text-shadow: none; }
.hero-light .hero-count span { color: rgba(23, 35, 60, .5); }
.hero-light .hero-progress { background: rgba(23, 35, 60, .08); }
@media (max-width: 860px) {
  .hero-light .hero-media img { width: min(78%, 460px); opacity: .96; }
  .hero-light .hero-copy { right: 24px; }
}
@media (max-width: 620px) {
  .hero-light .hero-media img { width: 92%; padding-right: 12px; }
  .hero-light .hero-copy { right: 20px; bottom: 150px; }
}

/* ---------- 卖点卡：筛选栏 + 批量管理（2026-09-30） ---------- */
.filter-bar {
  display: flex;
  gap: 8px;
  margin: 10px 0 2px;
  flex-wrap: wrap;
}
.filter-bar select {
  flex: 1;
  min-width: 140px;
  max-width: 260px;
}
.batch-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 4px;
  padding: 8px 10px;
  border: 1px dashed rgba(239, 68, 68, .45);
  border-radius: 10px;
  background: rgba(239, 68, 68, .06);
  flex-wrap: wrap;
}
.item.in-batch {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.item.in-batch .item-main { flex: 1; min-width: 0; }
.batch-check {
  display: flex;
  align-items: center;
  margin-top: 2px;
  cursor: pointer;
  flex-shrink: 0;
}
.batch-check input { width: 16px; height: 16px; cursor: pointer; accent-color: #ef4444; }

/* 上传归属行：产品线 + 产品全称 */
.upload-target { align-items: center; gap: 6px; flex-wrap: wrap; }
.upload-target input { flex: 1 1 260px; width: auto; min-width: 0; }

/* 内置图库选图弹窗 */
.bi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin: 8px 0; }
.bi-item { border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 6px; cursor: pointer; display: flex; flex-direction: column; gap: 5px; font-family: inherit; }
.bi-item:hover { border-color: var(--accent); }
.bi-item img { width: 100%; aspect-ratio: 1 / 1; object-fit: contain; border-radius: 6px; background: #f7f9fc; }
.bi-item span { font-size: 11.5px; color: var(--text-2); text-align: center; }

/* 拆解暂存/归档徽标与区块 */
.pill.warn { background: #fff5ec; border-color: #e8c49f; color: #964a18; }
.bd-drafts-wrap { margin-top: 6px; }

/* 迭代「最佳版本」卡片 */
.round.best { border-color: #f0cfae; background: #fffaf4; }

/* 视频页：外观参考图选择 */
.ref-pick { margin-top: 8px; border-top: 1px dashed var(--line); padding-top: 8px; }
.ref-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 12.5px; }
.ref-head b { font-size: 12.5px; }
.ref-thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.ref-thumb {
  border: 1.5px solid var(--line); border-radius: 10px; background: #fff; padding: 4px;
  cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; font-family: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.ref-thumb img { width: 72px; height: 72px; object-fit: contain; border-radius: 6px; background: #f7f9fc; }
.ref-thumb span { font-size: 10.5px; color: var(--text-2); }
.ref-thumb.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.ref-thumb.on span { color: var(--accent); font-weight: 600; }
.ref-empty { font-size: 12px; color: var(--danger); background: #fef7f7; border: 1px solid #f3c9c9; border-radius: 8px; padding: 8px 10px; }


/* ---------- 移动端可用性修复（QA 2026-10-01）---------- */
/* 窄屏：下拉与输入框可收缩，避免把 .row 撑出横向滚动条 */
.studio-controls select, .studio-controls input, .filter-bar select, .filter-bar input { min-width: 0; }
@media (max-width: 720px) {
  .card-head { flex-wrap: wrap; row-gap: 6px; }
  .card-head .row { width: 100%; }
  /* 控件在窄屏各占一行，避免被 flex 压成 53px 宽导致文字截断 */
  .studio-controls, .filter-bar, .video-controls { flex-wrap: wrap; }
  .studio-controls > select, .studio-controls > input,
  .filter-bar > select, .filter-bar > input,
  .video-controls > select, .video-controls > input { flex: 1 1 100%; width: 100%; }
  .studio-controls > .btn, .filter-bar > .btn, .video-controls > .btn { flex: 1 1 auto; }
  /* 触控热区：移动端把关键控件抬到 >=40px（原 nav-item 35px / 批量按钮 25px 太难点） */
  .nav-item { min-height: 42px; }
  .btn.tiny, .job-bulk-actions .btn, .card-head .btn { min-height: 36px; padding-left: 12px; padding-right: 12px; }
  .btn.primary { min-height: 40px; }
  .nav-toggle { width: 40px; height: 40px; font-size: 16px; }
  .tab { min-height: 40px; }
  .link { min-height: 32px; display: inline-flex; align-items: center; }
  /* 登录页输入框也抬到 40px，移动端更好点 */
  #login-view input { min-height: 40px; }
  #login-view .btn { min-height: 40px; }
}


/* ---------- 视频加载失败态（QA 2026-10-01）---------- */
.clip-media { position: relative; }
.video-fail {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; text-align: center; padding: 10px; background: #101826; color: #e8edf6; font-size: 12px; line-height: 1.5;
}
.video-fail .btn { pointer-events: auto; }
