/* =====================================================================
   Stillbeat 应用 · 视觉系统 v3.2 —— 干净、时尚、克制
   三栏工作台:左 · 设置(白卡片手风琴) / 中 · 深灰舞台里的一帧 + 时间线卡 / 右 · 镜头列表
   纸面 #F5F5F3 · 白卡 · 1px #E6E6E2 · 圆角 16 · 胶囊按钮(黑 / 白描边)· 舞台炭灰 #45474F
   字:Archivo(标题 / 正文)· IBM Plex Mono(HEX、时码、编号)
   颜色纪律:界面只用黑白灰;克莱因只在静点;橙只在拍点 / 播放头 / 进行中
   ===================================================================== */
@font-face { font-family: "Archivo"; src: url(/fonts/archivo-var.woff2) format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url(/fonts/plexmono-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url(/fonts/plexmono-500.woff2) format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --ink: #0E0F11; --chalk: #F4F4F1; --klein: #0A2FD6; --klein-lit: #4A66FF; --orange: #FF5A1F;
  /* muted 由 #7C7C7A 加深:原值在纸白上仅 3.83:1;新值 4.89:1(WCAG AA) */
  --bg: #F5F5F3; --card: #FFFFFF; --fg: #111214; --muted: #6B6B69; --line: #E6E6E2; --line-2: #EFEFEC; --field: #F4F4F2;
  --stage: #45474F; --dot: var(--klein);
  --ok: #3E8E63; --warn: #B0842E; --err: #C24B3C;
  /* 旧脚本别名 */
  --border: var(--line); --text: var(--fg); --accent: var(--orange); --accent-2: var(--fg); --panel: var(--card); --panel-2: var(--field);
  /* 图层角色色:只做信息编码,一律不用品牌色(克莱因蓝留给品牌点),并压低饱和 */
  --r-primary: #8A6A2E; --r-secondary: #4A6FA5; --r-text: #3E8E63; --r-background: #6F6188;
  --body: "Archivo", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --mono: "IBM Plex Mono", Menlo, Consolas, monospace;
  --r: 16px; --r-s: 10px;
  --shadow-card: 0 1px 2px rgba(17,18,20,.04);
  --shadow-frame: 0 30px 60px -20px rgba(0,0,0,.55), 0 8px 20px -10px rgba(0,0,0,.4);
  --shadow-float: 0 24px 60px -20px rgba(17,18,20,.35), 0 2px 6px rgba(17,18,20,.08);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131416; --card: #1B1C1F; --fg: #F1F1EE; --muted: #8E8E8C; --line: #2A2B2F; --line-2: #232428; --field: #232428; --stage: #0E0F11; --dot: var(--klein-lit);
    --shadow-card: none; --shadow-float: 0 24px 60px -20px rgba(0,0,0,.8);
  }
}
:root[data-theme="dark"] { --bg: #131416; --card: #1B1C1F; --fg: #F1F1EE; --muted: #8E8E8C; --line: #2A2B2F; --line-2: #232428; --field: #232428; --stage: #0E0F11; --dot: var(--klein-lit); --shadow-card: none; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--fg); font: 14px/1.5 var(--body); font-variation-settings: "wdth" 100, "wght" 400; -webkit-font-smoothing: antialiased; display: flex; flex-direction: column; }
/* 排印:把 Archivo 的可变轴推向两端 —— 标题窄而重、标签小而疏。
   中间那些"不大不小"的字号正是寡淡的来源;张力来自尺度比,不是装饰。 */
h1, h2, h3 { font-family: var(--body); font-variation-settings: "wdth" 92, "wght" 720; font-weight: 720; letter-spacing: -.028em; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(40px, 5.4vw, 76px); line-height: .94; }
h2 { font-size: 26px; line-height: 1.1; }
a { color: inherit; }
p { margin: 0; }
.mono, .badge, .lbl, .sub, #time-label, #mt-time, .grp-tag { font-family: var(--mono); }
.muted { color: var(--muted); }
.note { font-size: 11px; color: var(--muted); letter-spacing: .01em; }
.spacer { flex: 1; }
.hidden { display: none !important; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; row-gap: 8px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.eyebrow i { width: 6px; height: 6px; border-radius: 50%; background: var(--orange); display: inline-block; }
.status { font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.status:empty { display: none; }
.status .mt-fix { margin-top: 8px; }

/* ---------- 卡片 ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-card); }
.card-head { display: flex; align-items: baseline; gap: 10px; padding: 16px 18px 10px; }
.card-head b { font-size: 15px; font-weight: 600; }

/* ---------- 按钮 ---------- */
/* 硬切:颜色与状态一律瞬变。产品卖的就是"不叠化、不转场、直接切",
   界面自己的反馈若还在 .12s 淡入,就是在反驳自己卖的东西。
   位移类(translate/rotate)保留短过渡 —— 那是物理反馈,不是装饰。 */
button { font: 500 13px/1 var(--body); cursor: pointer; color: var(--fg); background: transparent; border: 1px solid transparent; border-radius: 999px; padding: 9px 14px; transition: none; }
button:disabled { opacity: .38; cursor: not-allowed; }
.pill { height: 40px; padding: 0 18px; border-radius: 999px; font-weight: 600; font-size: 13.5px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.pill.black, button.primary { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.pill.black:hover:not(:disabled), button.primary:hover:not(:disabled) { opacity: .87; }
.pill.ghost, .modal button, .btnrow button { background: var(--card); border-color: var(--line); color: var(--fg); }
.pill.ghost:hover:not(:disabled), .modal button:hover:not(:disabled) { border-color: var(--fg); }
.pill.big { width: 100%; height: 50px; font-size: 15px; }
.pill.small, button.small { height: 32px; padding: 0 14px; font-size: 12.5px; border: 1px solid var(--line); background: var(--card); }
.pill.wide { width: 100%; }
button.link { padding: 6px 0; border: 0; border-radius: 0; font-size: 12.5px; color: var(--muted); }
button.link:hover:not(:disabled) { color: var(--fg); }
button.x { width: 28px; height: 28px; padding: 0; font-size: 18px; line-height: 1; color: var(--muted); border-radius: 50%; }
button.x:hover { background: var(--field); color: var(--fg); }
.btn-link { display: inline-flex; align-items: center; height: 36px; padding: 0 16px; border-radius: 999px; background: var(--fg); color: var(--bg); text-decoration: none; font-size: 13px; font-weight: 600; }
.btn-link:hover { opacity: .87; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }

/* ---------- 表单 ---------- */
input, select, textarea { font: 13px/1.4 var(--body); color: var(--fg); background: var(--field); border: 1px solid transparent; border-radius: var(--r-s); padding: 9px 12px; outline: none; width: 100%; transition: border-color .12s, background .12s; }
input:focus, select:focus, textarea:focus { border-color: var(--fg); background: var(--card); }
textarea { resize: vertical; }
::placeholder { color: #A5A5A2; }
input[type=file] { background: transparent; padding: 4px 0; font-family: var(--mono); font-size: 11px; color: var(--muted); }
input.num, input[type=number] { width: 68px; font-family: var(--mono); font-size: 12px; text-align: right; padding: 7px 10px; }
select, select.inline { appearance: none; -webkit-appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' fill='none' stroke='%237C7C7A' stroke-width='1.6'/></svg>"); background-repeat: no-repeat; background-position: right 12px center; cursor: pointer; }
select.inline { width: auto; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; padding: 0; border: 0; background: transparent; }
input[type=range]::-webkit-slider-runnable-track { height: 3px; border-radius: 2px; background: var(--line); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--fg); margin-top: -6.5px; border: 0; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
input[type=range]::-moz-range-track { height: 3px; border-radius: 2px; background: var(--line); }
input[type=range]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--fg); border: 0; }
input[type=checkbox], input[type=radio] { accent-color: var(--fg); width: 15px; height: 15px; padding: 0; margin: 0; border: 0; }
input[type=color] { width: 100%; height: 34px; padding: 2px; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--card); cursor: pointer; }
label.chk { display: inline-flex; gap: 7px; align-items: center; color: var(--fg); font-size: 12.5px; cursor: pointer; white-space: nowrap; }
label.mini { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
label.mini input[type=number] { width: 60px; }
label.mini input[type=range] { width: 80px; }
.field { display: block; margin: 0 0 12px; font-size: 12px; color: var(--muted); }
.field > input, .field > select, .field > textarea { margin-top: 6px; }
.field.two { display: flex; gap: 10px; }
.field.two > label { flex: 1; display: block; font-size: 12px; color: var(--muted); }
.field.two > label > input, .field.two > label > select { margin-top: 6px; width: 100%; }
.field.row { display: flex; }
.lbl-t { display: block; font-size: 12px; color: var(--muted); margin: 6px 0 8px; }
label.slider { display: grid; grid-template-columns: 1fr auto; row-gap: 0; column-gap: 8px; align-items: center; font-size: 12.5px; color: var(--fg); margin: 2px 0 6px; }
label.slider .val { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
label.slider input[type=range] { grid-column: 1 / -1; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips .chip { padding: 6px 11px; font-size: 12px; border-radius: 999px; background: var(--field); color: var(--muted); border: 1px solid transparent; font-family: var(--body); }
.chips .chip.on { background: var(--fg); color: var(--bg); }
.import-box { display: flex; flex-direction: column; gap: 8px; padding: 10px 0 4px; }
details.sub summary { cursor: pointer; font-size: 12px; color: var(--muted); }
details.sub pre { white-space: pre-wrap; font: 11px/1.5 var(--mono); color: var(--muted); max-height: 160px; overflow: auto; margin: 8px 0 0; }

/* ---------- 头部 ---------- */
header.top { display: flex; align-items: center; gap: 22px; height: 64px; padding: 0 24px; flex: none; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--body); font-variation-settings: "wdth" 112, "wght" 640; font-size: 16px; letter-spacing: .02em; white-space: nowrap; }
.brand .mark { display: block; }
.brand .dot { fill: var(--dot); }
.brand .ip { display: inline-block; width: .2em; height: .2em; border-radius: 50%; background: var(--dot); margin: 0 .17em; vertical-align: .3em; }
.mode-tabs { display: flex; gap: 4px; background: var(--field); border-radius: 999px; padding: 4px; }
.mode-tabs button { padding: 0 16px; height: 32px; border-radius: 999px; font-weight: 600; color: var(--muted); border: 0; }
.mode-tabs button:hover:not(:disabled) { color: var(--fg); }
.mode-tabs button.active { background: var(--card); color: var(--fg); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
body.on-upload .mode-tabs { visibility: hidden; }
.topnav { display: flex; gap: 8px; align-items: center; }
.topnav .pill { height: 34px; padding: 0 14px; font-size: 12.5px; font-weight: 500; }
#key-chip.good { color: var(--fg); }
#key-chip b { font-weight: 600; }
/* 失败态统一语言:中性胶囊 + 一枚红点,不用彩色填充 —— 报警不该抢戏 */
.chip.bad, #key-chip.bad, #license-chip.bad { background: var(--field); color: var(--err); border-color: transparent; }
.chip.bad::before, #key-chip.bad::before, #license-chip.bad::before {
  content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%;
  background: var(--err); margin-right: 7px; vertical-align: 1px;
}

/* ---------- 主区 ---------- */
main { flex: 1; overflow: auto; }

/* 上传 */
#screen-upload { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.upload-wrap { width: min(720px, 100%); display: flex; flex-direction: column; gap: 18px; }
#dropzone { padding: 64px 56px; cursor: pointer; display: flex; flex-direction: column; gap: 16px; transition: none; }
#dropzone:hover { border-color: var(--fg); }
#dropzone.drag { border-color: var(--fg); box-shadow: 0 0 0 4px rgba(17,18,20,.06); }
#dropzone .lead { font-size: 16px; line-height: 1.5; color: var(--muted); max-width: 44ch; }
#dropzone .hint { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
#dropzone .flow { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
#dropzone .flow i { width: 16px; height: 1px; background: var(--line); flex: none; }
.samples-row { display: flex; align-items: center; gap: 14px; }
#samples { display: flex; gap: 8px; }
#samples .sample { width: 92px; padding: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; text-align: center; cursor: pointer; transition: transform .15s; }
#samples .sample:hover { border-color: var(--fg); transform: translateY(-2px); }
#samples .sample img { width: 100%; height: 54px; object-fit: contain; display: block; background: var(--field); border-radius: 8px; padding: 9px; box-sizing: border-box; }
#samples .sample div { margin-top: 8px; font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: .01em; }

/* 工作台 */
#screen-work { padding: 8px 24px 40px; height: 100%; }
.studio { display: grid; grid-template-columns: 296px minmax(0, 1fr) 316px; gap: 20px; max-width: 1680px; margin: 0 auto; align-items: start; min-height: calc(100vh - 120px); }
.col-left, .col-right { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 8px; max-height: calc(100vh - 96px); overflow: auto; padding-bottom: 20px; scrollbar-width: thin; }
.col-center { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

.logo-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.logo-thumb { width: 40px; height: 40px; border-radius: 50%; background: var(--field); display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 16px; flex: none; }
.logo-meta b { font-size: 13.5px; font-weight: 600; display: block; word-break: break-all; }
.logo-meta .note { margin-top: 2px; }

details.acc > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 16px 18px; font-size: 15px; font-weight: 600; }
details.acc > summary::-webkit-details-marker { display: none; }
details.acc > summary .chev { margin-left: auto; width: 8px; height: 8px; border-right: 1.6px solid var(--muted); border-bottom: 1.6px solid var(--muted); transform: rotate(45deg); transition: transform .15s; }
details.acc[open] > summary .chev { transform: rotate(225deg); }
details.acc > summary .note { font-weight: 400; }
.acc-body { padding: 0 18px 16px; border-top: 1px solid var(--line-2); padding-top: 14px; }

/* 舞台 */
/* 舞台:从纯灰升级到"黑底 + 品牌色 + 互补色"双层光晕,缓慢呼吸 —— 像 Apple Sonos 的产品片 */
.stage { position: relative; background: #08090A; border-radius: var(--r); min-height: 420px; height: calc(100vh - 224px); max-height: 900px; display: flex; align-items: center; justify-content: center; padding: 28px; overflow: hidden; }
.stage::before, .stage::after { content: ""; position: absolute; inset: -25%; pointer-events: none; }
.stage::before { background: radial-gradient(48% 58% at 22% 32%, var(--glow-a, #0A2FD6) 0%, transparent 62%); animation: breathe 9s ease-in-out infinite; opacity: .55; }
.stage::after  { background: radial-gradient(56% 66% at 78% 70%, var(--glow-b, #FF5A1F) 0%, transparent 60%); animation: breathe 9s ease-in-out infinite reverse; opacity: .5; }
@keyframes breathe { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .stage::before, .stage::after { animation: none; } }
#mt-canvas { display: block; height: 100%; max-width: 100%; width: auto; object-fit: contain; border-radius: 6px; box-shadow: var(--shadow-frame); }
#lm-stage { box-shadow: var(--shadow-frame); border-radius: 6px; overflow: hidden; }
.timeline-card { display: flex; align-items: center; gap: 14px; padding: 10px 14px; }
.timeline-card .play { width: 36px; height: 36px; border-radius: 50%; padding: 0; background: var(--fg); color: var(--bg); border: 0; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.timeline-card .play:hover:not(:disabled) { opacity: .85; }
.timeline-card .icon { width: 32px; height: 32px; padding: 0; border-radius: 50%; border: 1px solid var(--line); font-size: 14px; flex: none; }
.timeline-card .mono { font-size: 12px; letter-spacing: .04em; font-variant-numeric: tabular-nums; min-width: 112px; white-space: nowrap; }
#mt-timeline { flex: 1; min-width: 0; width: 0; height: 28px; display: block; cursor: pointer; }
#progress { flex: 1; height: 3px; border-radius: 2px; background: var(--line); cursor: pointer; position: relative; }
#progress-fill { height: 100%; width: 0%; border-radius: 2px; background: var(--fg); }
#time-label { min-width: 90px; text-align: right; }

/* 浮动编辑面板 */
.edit-panel { position: absolute; right: 20px; bottom: 20px; width: 320px; max-height: calc(100% - 40px); overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-float); padding: 14px 16px 12px; color: var(--fg); }
.ep-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 13.5px; }
.ep-head b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.edit-panel .field.two { margin: 8px 0 4px; }

/* 右栏:镜头 */
.frames-card { padding-bottom: 8px; }
.frames-card .links { padding: 0 18px 8px; gap: 14px; }
.frames-card .status { padding: 0 18px 8px; }
.frames { display: flex; flex-direction: column; gap: 6px; padding: 0 10px 8px; max-height: 52vh; overflow: auto; scrollbar-width: thin; }
.mt-row { display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; background: var(--card); position: relative; transition: none; }
.mt-row:hover { border-color: #B9B9B5; }
.mt-row img { width: 40px; height: 70px; object-fit: cover; border-radius: 6px; flex: none; background: #000; }
.mt-row .info { flex: 1; min-width: 0; }
.mt-row .nm { font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-row .sub { font-size: 10.5px; color: var(--muted); margin-top: 2px; letter-spacing: .02em; }
.mt-row button { width: 24px; height: 24px; padding: 0; border-radius: 50%; font-size: 12px; line-height: 1; color: var(--muted); border: 0; display: none; }
.mt-row button:hover { background: var(--field); color: var(--fg); }
.mt-row:hover button { display: inline-flex; align-items: center; justify-content: center; }
.mt-row.sel { border-color: var(--fg); box-shadow: 0 0 0 1px var(--fg); }
.mt-row.unused { opacity: .4; }
.shotlist { display: flex; flex-direction: column; padding: 0 18px 6px; }
.shot { display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 5px 0; border-bottom: 1px solid var(--line-2); }
.shot .n { font-family: var(--mono); font-size: 10px; color: var(--muted); min-width: 18px; }
.shot b { font-weight: 500; }
.shot .t { font-size: 11px; color: var(--muted); }
.shot .st { margin-left: auto; font-family: var(--mono); font-size: 10px; color: var(--muted); }
.shot.run .st { color: var(--orange); } .shot.done .st { color: var(--ok); } .shot.fail .st { color: var(--err); }
.shot .e { width: 3px; height: 12px; border-radius: 2px; background: var(--line); flex: none; position: relative; overflow: hidden; }
.shot .e::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; background: var(--fg); }
.shot .e1::after { height: 20%; } .shot .e2::after { height: 40%; } .shot .e3::after { height: 60%; } .shot .e4::after { height: 80%; } .shot .e5::after { height: 100%; background: var(--orange); }
.mt-lib { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-height: 40vh; overflow: auto; }
.mt-thumb { position: relative; border-radius: 8px; overflow: hidden; cursor: pointer; background: #000; aspect-ratio: 9/16; }
.mt-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mt-thumb .lbl { position: absolute; left: 0; right: 0; bottom: 0; font-size: 9px; padding: 4px 6px; background: linear-gradient(transparent, rgba(0,0,0,.7)); color: #eee; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-thumb .lbl i { font-style: normal; background: #fff; color: #111; border-radius: 3px; padding: 0 3px; margin-right: 3px; font-size: 8px; }
.mt-thumb .del, .mt-thumb .regen, .mt-thumb .i2v { position: absolute; width: 20px; height: 20px; padding: 0; font-size: 11px; line-height: 18px; border-radius: 50%; background: rgba(0,0,0,.7); border: 0; color: #fff; display: none; }
.mt-thumb .del { top: 4px; right: 4px; } .mt-thumb .regen { top: 4px; right: 28px; } .mt-thumb .i2v { bottom: 24px; right: 4px; background: var(--fg); }
.mt-thumb:hover .del, .mt-thumb:hover .regen, .mt-thumb:hover .i2v { display: block; }
.mt-thumb.sel { outline: 2px solid var(--fg); outline-offset: -2px; }
.mt-thumb .qa { position: absolute; top: 4px; left: 4px; font-size: 10px; background: var(--orange); color: #fff; border-radius: 4px; padding: 1px 4px; }
.mt-thumb .qa.drift { left: auto; right: 52px; background: var(--err); }
.pal-preview { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.pal span { display: inline-block; width: 18px; height: 18px; border-radius: 50%; margin-right: 4px; vertical-align: middle; border: 1px solid rgba(0,0,0,.08); }
.swatches { display: flex; gap: 8px; margin-bottom: 12px; }
.swatches label { flex: 1; display: flex; flex-direction: column; gap: 4px; font-size: 10.5px; color: var(--muted); text-align: center; }

/* Motion */
#variants-card { padding-bottom: 16px; }
#variant-list { display: flex; gap: 10px; flex-wrap: wrap; padding: 0 18px; }
#variant-list > p { color: var(--muted); font-size: 13px; }
.vcard { width: calc(50% - 5px); min-width: 220px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; transition: none; }
.vcard:hover, .vcard.active { border-color: var(--fg); }
.vcard .vhead { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.vcard .vtitle { font-weight: 600; font-size: 13px; }
.vcard .vconcept { font-size: 12px; color: var(--muted); max-height: 74px; overflow: auto; white-space: pre-wrap; }
.badge { font-size: 10px; letter-spacing: .04em; padding: 2px 7px; border-radius: 999px; background: var(--field); color: var(--muted); }
.badge.run { color: var(--orange); } .badge.ok { color: var(--ok); } .badge.err { color: var(--err); }
#edit-row { display: flex; gap: 10px; margin: 12px 18px 0; }
#edit-input { flex: 1; }
#export-row { display: flex; gap: 10px; margin: 12px 18px 0; flex-wrap: wrap; align-items: center; }
#action-box { display: flex; flex-direction: column; gap: 8px; padding: 16px; }
#pipeline-status { color: var(--orange); font-family: var(--mono); font-size: 11.5px; }
.tabs { display: flex; gap: 4px; padding: 12px 12px 0; }
.tabs button { padding: 0 12px; height: 30px; border-radius: 999px; font-size: 12.5px; color: var(--muted); border: 0; }
.tabs button.active { background: var(--field); color: var(--fg); }
#layer-list { display: flex; flex-direction: column; padding: 8px 12px 12px; max-height: 46vh; overflow: auto; }
.lrow { display: flex; gap: 10px; align-items: center; padding: 8px 4px; border-bottom: 1px solid var(--line-2); }
.lrow img { width: 32px; height: 32px; object-fit: contain; background: #fff; border-radius: 6px; flex: none; border: 1px solid var(--line); }
.lrow .linfo { flex: 1; min-width: 0; }
.lrow .lid { font-size: 12.5px; font-weight: 600; }
.lrow .ldesc { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lrow select { width: 92px; font-size: 11.5px; padding: 5px 24px 5px 8px; }
.role-primary { color: var(--r-primary); } .role-secondary { color: var(--r-secondary); } .role-text { color: var(--r-text); } .role-background { color: var(--r-background); }
.grp-tag { font-size: 10px; color: var(--orange); border: 1px solid var(--orange); border-radius: 4px; padding: 0 4px; }
#log-list { display: flex; flex-direction: column; gap: 6px; padding: 8px 12px 12px; max-height: 52vh; overflow: auto; font-size: 12px; }
#log-list details { border-bottom: 1px solid var(--line-2); padding: 6px 0; }
#log-list summary { cursor: pointer; color: var(--muted); }
#log-list pre { white-space: pre-wrap; word-break: break-all; max-height: 260px; overflow: auto; color: var(--fg); font: 11px/1.5 var(--mono); }
#log-list .plain { color: var(--muted); padding: 2px 0; }

/* ---------- 弹窗 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(17,18,20,.36); display: flex; align-items: center; justify-content: center; z-index: 70; backdrop-filter: blur(4px); }
.modal { width: 520px; max-width: 92vw; max-height: 86vh; overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 26px 28px; box-shadow: var(--shadow-float); }
.modal h2 { margin: 0 0 16px; }
.modal .frow { margin-bottom: 14px; }
.modal .frow label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.modal .btnrow { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; align-items: center; }
.modal .btnrow button { height: 38px; border-radius: 999px; padding: 0 16px; }
.modal .about p { font-size: 13.5px; margin-bottom: 10px; }
.modal .about code { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.modal .brand { margin-bottom: 14px; }
.modal.login { width: 460px; }
.modal.wide { width: 900px; }
#test-result { font-size: 12.5px; min-height: 16px; }
#test-result img { display: block; margin-top: 8px; border-radius: 6px; }
.autocfg { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border-radius: 12px; background: var(--field); margin-bottom: 16px; font-size: 13px; }
.autocfg > button { flex: none; white-space: nowrap; height: 38px; border-radius: 999px; }
#autocfg-log { font-family: var(--mono); font-size: 11.5px; line-height: 1.6; white-space: pre-wrap; margin: -6px 0 14px; padding: 10px 12px; background: var(--field); border-radius: 10px; }
#autocfg-log img { height: 72px; border-radius: 6px; display: block; margin-top: 6px; }
.acc-notice { border-left: 2px solid var(--orange); padding: 8px 12px; margin-bottom: 14px; font-size: 13px; }
.acc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; font-size: 14px; }
.acc-grid .note { font-size: 11px; margin-bottom: 2px; }
.assets-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; max-height: 60vh; overflow: auto; padding: 2px; }
.asset { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.asset img, .asset video { width: 100%; aspect-ratio: 9/16; object-fit: cover; display: block; background: #000; }
.asset-meta { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 10.5px; color: var(--muted); padding: 6px 8px 0; }
.asset-actions { display: flex; justify-content: space-between; gap: 6px; padding: 6px 8px 8px; }
.asset.picked { outline: 2px solid var(--fg); outline-offset: -2px; }
#license-key { font-family: var(--mono); letter-spacing: .06em; }
#project-list { display: flex; flex-direction: column; }
body.hosted #btn-settings, body.hosted #btn-quit { display: none; }

.toast { position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%); background: var(--fg); color: var(--bg); padding: 11px 18px; border-radius: 999px; z-index: 99; box-shadow: var(--shadow-float); font-size: 13px; }
.spin { display: inline-block; animation: spin 1s linear infinite; color: var(--orange); }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1180px) {
  .studio { grid-template-columns: 1fr; }
  .col-left, .col-right { position: static; max-height: none; }
  .stage { height: 62vh; }
}
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }
/* Brand application studio — the work takes the largest part of the screen. */
body.on-material { background: #f7f7f4; }
body.on-atelier { background: #f5f5f0; }
body.on-atelier #screen-work { padding: 0; height: auto; }
body.on-campaign { background: #f5f5f0; }
body.on-campaign #screen-work { padding: 0; height: auto; }
body.on-atelier #btn-save-top, body.on-atelier:not(.hosted) #key-chip { display: none; }
header.top { border-bottom: 1px solid var(--line); gap: 18px; }
.mode-tabs { background: transparent; border-radius: 0; gap: 16px; padding: 0; }
.mode-tabs button { border-radius: 0; padding: 0 2px; height: 64px; border-bottom: 2px solid transparent; }
.mode-tabs button.active { background: transparent; border-color: var(--fg); box-shadow: none; }
.mode-tabs button span { font-size: 11px; margin-left: 5px; font-weight: 400; }
body.on-upload:not(.hosted) #key-chip, body.on-material #btn-save-top { display: none; }
.topnav .pill { background: transparent; border-color: transparent; padding: 0 8px; }
#screen-upload { padding: 68px 6vw 48px; align-items: start; }
.upload-wrap { width: min(1080px, 100%); gap: 28px; }
.upload-intro { margin-bottom: 10px; }
.upload-intro .eyebrow { letter-spacing: .15em; margin-bottom: 26px; }
.upload-intro h1 { font-size: clamp(38px, 5.6vw, 76px); line-height: 1.12; letter-spacing: -.065em; font-weight: 550; font-variation-settings: "wght" 560; }
.upload-intro .lead { margin-top: 26px; font-size: 15px; line-height: 1.9; color: #656963; }
#dropzone { padding: 25px 30px; flex-direction: row; align-items: center; gap: 24px; border-radius: 5px; background: #eeefea; box-shadow: none; }
#dropzone strong { font-size: 17px; font-weight: 550; }
#dropzone .hint { margin-top: 5px; letter-spacing: 0; font: 12px/1.6 var(--body); }
.upload-symbol { width: 43px; height: 43px; display: grid; place-items: center; background: #222722; color: white; border-radius: 50%; font-size: 24px; flex-shrink: 0; }
.upload-local { margin-left: auto; color: #656963; font-size: 12px; }
.samples-row { gap: 22px; }
#samples { gap: 14px; }
#samples .sample { border: 0; border-radius: 0; background: none; display: flex; align-items: center; gap: 10px; width: auto; padding: 0; text-align: left; }
#samples .sample img { width: 46px; height: 46px; border-radius: 3px; background: #e9e9e3; padding: 10px; }
#samples .sample div { margin: 0; font: 10px var(--mono); letter-spacing: .045em; }
.upload-materials { margin-top: 30px; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4,1fr); padding-top: 22px; gap: 15px; color: #6b6e66; font-size: 11px; }
.upload-materials b { font: 10px var(--mono); display: block; margin-bottom: 10px; color: #353d35; }
body.on-material #screen-work { padding: 0 28px 22px; height: auto; }
#material-studio { max-width: 1760px; margin: auto; }
.ms-topbar { display: flex; justify-content: space-between; align-items: center; padding: 25px 0 24px; gap: 16px; }
.ms-topbar > div:first-child { display: flex; align-items: baseline; gap: 18px; }
.ms-eyebrow { font: 9px/1.5 var(--mono); letter-spacing: .12em; color: #74786f; }
.ms-topbar h1 { font-size: 23px; line-height: 1.2; letter-spacing: -.045em; font-weight: 550; font-variation-settings: "wght" 550; }
.ms-topbar-actions, .ms-export-actions { display: flex; gap: 9px; align-items: center; }
.ms-action { border: 1px solid #d8dad2; background: transparent; padding: 11px 16px; border-radius: 4px; font-size: 12px; min-height: 38px; font-weight: 500; }
.ms-action:hover:not(:disabled) { border-color: #30392f; background: #eeefe9; }
.ms-action-primary { color: #f5f6ef; border-color: #252e25; background: #252e25; }
.ms-action-primary:hover:not(:disabled) { background: #3b463a; color: #fff; }
.ms-layout { display: grid; grid-template-columns: 190px minmax(300px, 1fr) 236px; gap: 26px; align-items: start; }
.ms-controls { padding-top: 0; }
.ms-section { padding: 17px 0; border-top: 1px solid #dfe1d8; }
.ms-section:first-child { padding-top: 17px; }
.ms-label { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: #41483e; margin-bottom: 12px; gap: 8px; }
.ms-label output { font: 10px var(--mono); color: #74786f; }
.ms-options { display: flex; flex-wrap: wrap; gap: 5px; }
.ms-option { border: 1px solid #e0e2da; border-radius: 3px; padding: 9px 11px; font-size: 11px; color: #60665b; min-height: 32px; background: transparent; }
.ms-option:hover:not(:disabled) { border-color: #8e9685; color: #252e25; }
.ms-option.is-active { color: #20291f; background: #e4e8dd; border-color: #c6cdbd; }
.ms-surfaces { display: grid; grid-template-columns: 1fr 1fr; }
.ms-surfaces .ms-option { min-height: 48px; }
.ms-note { font-size: 10px; line-height: 1.7; color: #767c70; }
#ms-process-note { margin-top: 10px; min-height: 34px; }
.ms-color-field { display: grid; grid-template-columns: 1fr 24px 60px; gap: 8px; align-items: center; margin-bottom: 11px; font-size: 11px; }
.ms-color-field input[type=color] { height: 24px; width: 24px; border: 0; background: none; border-radius: 0; padding: 0; }
.ms-color-field input::-webkit-color-swatch-wrapper { padding: 0; }
.ms-color-field input::-webkit-color-swatch { border: 1px solid #ddd; border-radius: 50%; }
.ms-color-field span:last-child { font: 9px var(--mono); color: #74786f; }
.ms-text-action { border: 0; border-radius: 0; padding: 3px 0; font-size: 10px; color: #596d51; text-decoration: underline; text-underline-offset: 3px; }
.ms-range { margin: -4px 0 12px; }
.ms-range::-webkit-slider-thumb { width: 12px; height: 12px; margin-top: -4.5px; background: #394733; box-shadow: none; }
.ms-stage-wrap { min-width: 0; overflow: visible; }
.ms-stage-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; min-height: 32px; gap: 10px; }
#ms-scene-label { font: 10px/1.4 var(--mono); color: #565f50; }
.ms-view-switch { display: flex; gap: 1px; }
.ms-view-switch .ms-option { font: 10px var(--mono); padding: 7px 9px; border: 0; background: none; min-height: 28px; }
.ms-view-switch .ms-option.is-active { background: #e8eae3; }
.ms-stage { position: relative; width: min(100%, calc(max(300px, 100vh - 360px) * var(--ms-ratio, 1))); margin: auto; aspect-ratio: var(--ms-aspect, 1); background: #e7e8e0; overflow: hidden; }
#ms-preview { display: block; width: 100%; height: 100%; object-fit: contain; }
.ms-stage-status { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 38px; background: #e7e8e0; color: #56614d; font-size: 12px; text-align: center; }
.ms-stage-status[hidden] { display: none; }
.ms-stage-status.ms-error { color: #8d4935; }
.ms-stage-caption { position: absolute; bottom: 18px; left: 20px; right: 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #495342; font: 9px/1.5 var(--mono); pointer-events: none; }
.ms-motion { pointer-events: auto; padding: 7px 10px; background: rgba(250,251,246,.75); color: #44513b; font-size: 10px; border: 1px solid rgba(108,119,96,.2); border-radius: 3px; backdrop-filter: blur(10px); }
.ms-stage-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.ms-aspects .ms-option { border: 0; font: 10px var(--mono); padding: 6px 8px; min-height: 25px; }
.ms-look-info { border-top: 1px solid #dfe1d8; padding: 17px 0 23px; }
.ms-look-info h2 { font-size: 28px; line-height: 1.15; margin: 18px 0 12px; overflow-wrap: anywhere; }
#ms-look-description { font-size: 12px; line-height: 1.9; color: #636b5b; }
.ms-look-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0; }
.ms-look-tags span { font-size: 9px; padding: 3px 7px; border: 1px solid #dce0d4; border-radius: 2px; color: #737c68; }
.ms-applications { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 10px; margin-bottom: 15px; }
.ms-application { padding: 0 0 8px; border: 1px solid transparent; border-radius: 2px; display: grid; grid-template-columns: 1fr auto; text-align: left; overflow: hidden; }
.ms-application canvas { width: 100%; height: auto; aspect-ratio: 1; display: block; grid-column: 1 / -1; background: #e7e8e0; margin-bottom: 9px; }
.ms-application span { font-size: 10px; padding-left: 4px; }
.ms-application small { font-size: 9px; color: #767c70; padding-right: 4px; }
.ms-application.is-active { border-color: #879879; }
.ms-application:hover:not(:disabled) { border-color: #586c48; }
.ms-outputbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; border-top: 1px solid #dfe1d8; padding-top: 19px; margin-top: 26px; }
.ms-outputbar p { font-size: 11px; color: #74786f; margin-top: 4px; }
@media (min-width: 1600px) { .ms-layout { grid-template-columns: 220px minmax(300px,1fr) 270px; gap: 38px; } }
@media (max-width: 1180px) {
  .ms-layout { grid-template-columns: 166px minmax(260px,1fr) 195px; gap: 18px; }
  .topnav { gap: 2px; } .topnav .pill { padding: 0 6px; font-size: 11px; }
  .mode-tabs { gap: 12px; } .mode-tabs button { font-size: 12px; }
  .mode-tabs button span { display: none; }
  body:not(.hosted) #key-chip { display: none; }
}
@media (max-width: 900px) {
  header.top { padding: 0 16px; gap: 14px; } .brand { font-size: 13px; gap: 5px; }
  #btn-about, #btn-quit { display: none; }
  body.on-material #screen-work { padding: 0 18px 25px; }
  .ms-layout { grid-template-columns: 164px minmax(0,1fr); gap: 20px; }
  .ms-inspector { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1.6fr; gap: 25px; }
  .ms-applications { grid-template-columns: repeat(4,1fr); gap: 7px; }
  .ms-application { grid-template-columns: 1fr; }
  .ms-application small { padding: 6px 4px 0; }
  .ms-stage { width: 100%; }
  .ms-outputbar { margin-top: 6px; }
  .upload-local { display: none; }
}
@media (max-width: 620px) {
  header.top { height: auto; min-height: 58px; flex-wrap: wrap; padding: 12px 16px 0; gap: 0; }
  header.top > .spacer { display: none; }
  .topnav { margin-left: auto; }
  .mode-tabs { order: 3; width: 100%; gap: 20px; margin-top: 8px; overflow-x: auto; }
  .mode-tabs button { height: 40px; font-size: 12px; white-space: nowrap; flex-shrink: 0; }
  .mode-tabs button span { display: inline; font-size: 10px; }
  body.on-upload .mode-tabs { display: none; }
  body.on-upload header.top { padding-bottom: 12px; }
  #screen-upload { padding: 44px 22px; }
  .upload-intro h1 { font-size: 43px; }
  .upload-intro .lead { font-size: 13px; }
  #dropzone { padding: 20px 16px; gap: 14px; }
  #dropzone strong { font-size: 15px; } #dropzone .hint { font-size: 10px; }
  .samples-row { align-items: flex-start; flex-direction: column; gap: 15px; }
  #samples { width: 100%; gap: 18px; } #samples .sample { flex-direction: column; }
  .upload-materials { grid-template-columns: 1fr 1fr; row-gap: 24px; margin-top: 15px; }
  body.on-material #screen-work { padding: 0 15px 24px; }
  .ms-topbar { padding: 20px 0; }
  .ms-topbar h1 { font-size: 20px; } .ms-topbar .ms-eyebrow { display: none; }
  .ms-topbar-actions .ms-action { font-size: 10px; padding: 8px 11px; min-height: 33px; }
  .ms-layout { display: flex; flex-direction: column; gap: 22px; }
  .ms-stage-wrap { order: -1; width: 100%; flex: none; }
  .ms-stage { min-height: 0; }
  .ms-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; width: 100%; }
  .ms-controls .ms-section { padding: 15px 0; }
  .ms-controls .ms-section:nth-child(3) { grid-column: 1; }
  .ms-inspector { display: block; width: 100%; }
  .ms-look-info { display: none; }
  .ms-inspector .ms-section { padding-bottom: 0; }
  .ms-outputbar { display: block; padding-top: 15px; }
  .ms-export-actions { margin-top: 15px; display: grid; grid-template-columns: 1fr 1fr; }
  #ms-export-video { grid-column: 1 / -1; }
  .ms-stage-caption { bottom: 12px; left: 12px; right: 12px; }
}

/* Real studio output introduces the result before asking for an upload. */
.upload-intro { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; }
.upload-intro h1 { font-size: clamp(40px, 5.2vw, 70px); }
.upload-preview { position: relative; margin: 0; min-width: 0; }
.upload-preview img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; }
.upload-preview figcaption { display: flex; justify-content: space-between; gap: 12px; font: 9px/1.5 var(--mono); color: #737b6b; margin-top: 12px; }
@media (max-width: 750px) {
  .upload-intro { grid-template-columns: 1fr; gap: 30px; }
  .upload-intro h1 { font-size: 44px; }
  .upload-preview { max-width: 420px; width: 100%; }
  .upload-intro .lead { margin-top: 20px; }
}
