/* Kumo: warm paper for the home page, a dark editing room for the editor. Amber is the one action colour. */
:root {
  --paper: #fbf8f2; --card: #ffffff; --ink: #1c1d22; --sub: #5f6170; --faint: #9a9cab; --line: #ebe5d9;
  --amber: #ffb020; --amber-ink: #241600; --amber-soft: #fff1d6; --coral: #ff6b4a;
  --ed: #121418; --ed2: #1a1d23; --ed3: #22262e; --edline: #2b2f38; --edtext: #e9eaee; --edsub: #9aa0ae; --bad: #ff5d5d; --ok: #3ecf8e;
  --display: "Space Grotesk", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.55 var(--body); -webkit-font-smoothing: antialiased; background: var(--paper); color: var(--ink); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { opacity: .4; cursor: not-allowed; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
a { color: inherit; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 max(20px, env(safe-area-inset-left)); }
.sp { flex: 1; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); font-weight: 600; font-size: 14px; white-space: nowrap; }
.btn:hover:not(:disabled) { border-color: var(--ink); }
.btn.primary { background: var(--amber); border-color: var(--amber); color: var(--amber-ink); }
.btn.primary:hover:not(:disabled) { filter: brightness(1.05); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.big { min-height: 50px; padding: 12px 24px; font-size: 16px; border-radius: 12px; }
.btn.sm { min-height: 30px; padding: 4px 10px; font-size: 12.5px; border-radius: 8px; }
.btn.wide { width: 100%; }
.ib { display: inline-grid; place-items: center; min-width: 36px; height: 36px; border-radius: 9px; font-size: 18px; }
.lang { padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line); font-weight: 600; font-size: 13px; background: var(--card); }

/* editor */
body.is-editor { background: var(--ed); color: var(--edtext); height: calc(100dvh - var(--kumo-bar, 0px)); overflow: hidden; }
body.is-editor #app { height: calc(100dvh - var(--kumo-bar, 0px)); display: flex; flex-direction: column; }
.is-editor .btn { background: var(--ed3); border-color: var(--edline); color: var(--edtext); }
.is-editor .btn:hover:not(:disabled) { border-color: var(--edsub); }
.is-editor .btn.primary { background: var(--amber); border-color: var(--amber); color: var(--amber-ink); }
.is-editor .btn.ghost { background: transparent; border-color: transparent; }
.is-editor .ib:hover:not(:disabled) { background: var(--ed3); }
.ebar { display: flex; align-items: center; gap: 6px; height: 52px; padding: 0 10px; background: var(--ed2); border-bottom: 1px solid var(--edline); flex: none; }
.pname { background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 6px 8px; font-weight: 600; min-width: 0; width: min(320px, 30vw); }
.pname:hover, .pname:focus { border-color: var(--edline); background: var(--ed); }
.save { font-size: 12px; color: var(--edsub); white-space: nowrap; }
.save[data-s="pending"] { color: var(--amber); } .save[data-s="failed"] { color: var(--bad); }
.ewrap { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 400px; }
.left { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-right: 1px solid var(--edline); }
.stage { position: relative; flex: 1; min-height: 160px; background: #000; overflow: hidden; }
.stage video, .stage canvas { position: absolute; display: block; }
.stage canvas { pointer-events: none; }
.audiocard { position: absolute; inset: 0; display: grid; place-items: center; color: var(--edsub); font-size: 15px; background: radial-gradient(circle at 50% 40%, #252a35, #0e1014); }
.nomedia { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 20px; text-align: center; background: var(--ed); z-index: 2; }
.nomedia p { margin: 0; max-width: 34em; }
.nomedia small { color: var(--edsub); }
.transport { display: flex; align-items: center; gap: 4px; padding: 6px 10px; background: var(--ed2); border-top: 1px solid var(--edline); flex: none; }
.play { width: 40px; height: 40px; border-radius: 50%; background: var(--amber); color: var(--amber-ink); font-size: 14px; font-weight: 700; margin: 0 4px; }
.time { font: 500 13px ui-monospace, monospace; color: var(--edsub); margin-left: 8px; }
.time b { color: var(--edtext); font-weight: 600; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--edsub); margin-left: 10px; cursor: pointer; }
.chk input { accent-color: var(--amber); }
.tlbar { display: flex; align-items: center; gap: 10px; padding: 6px 12px; font-size: 12px; color: var(--edsub); background: var(--ed2); border-top: 1px solid var(--edline); flex: none; }
.zoomr { display: inline-flex; align-items: center; gap: 6px; }
.zoomr input { width: 120px; accent-color: var(--amber); }
.tl { position: relative; height: 128px; flex: none; background: var(--ed); touch-action: none; }
.tl canvas { position: absolute; inset: 0; display: block; }
.right { display: flex; flex-direction: column; min-height: 0; background: var(--ed2); }
.tabs { display: flex; gap: 2px; padding: 6px; border-bottom: 1px solid var(--edline); flex: none; overflow-x: auto; }
.tabs button { flex: 1; padding: 8px 6px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--edsub); white-space: nowrap; }
.tabs button[aria-pressed="true"] { background: var(--ed3); color: var(--edtext); }
.runbox { margin: 10px 12px 0; padding: 12px; border-radius: 12px; background: rgba(255, 176, 32, .1); border: 1px solid rgba(255, 176, 32, .35); display: grid; gap: 8px; flex: none; }
.runbox p { margin: 0; }
.rtop { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.bad { color: var(--bad); }
.spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255, 176, 32, .3); border-top-color: var(--amber); animation: spin .9s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.bar { position: relative; height: 6px; border-radius: 3px; background: var(--ed3); overflow: hidden; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--amber); border-radius: 3px; transition: width .3s; }
.bar.indet i { width: 30% !important; animation: indet 1.3s ease-in-out infinite; }
@keyframes indet { 0% { left: -30%; } 100% { left: 100%; } }
.pbody { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 14px 24px; display: flex; flex-direction: column; gap: 10px; }
.pbody h4 { margin: 10px 0 0; font-size: 13px; color: var(--edsub); text-transform: none; }
.hint { margin: 0; font-size: 12.5px; color: var(--edsub); line-height: 1.55; }
.warn { margin: 0; padding: 10px 12px; border-radius: 10px; background: rgba(255, 93, 93, .1); color: #ffb3b3; font-size: 13px; line-height: 1.5; }
.lhead { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--edsub); position: sticky; top: -12px; background: var(--ed2); padding: 4px 0; z-index: 2; }
.issues { padding: 3px 9px; border-radius: 99px; background: rgba(255, 93, 93, .15); color: #ff9b9b; font-size: 12px; font-weight: 600; }
.list { display: grid; gap: 6px; }
.row { border-radius: 10px; background: var(--ed); border: 1px solid var(--edline); padding: 8px; display: grid; gap: 6px; }
.row.cur { border-color: rgba(255, 176, 32, .7); box-shadow: inset 3px 0 0 var(--amber); }
.row.sel { border-color: var(--amber); }
.rhead { display: flex; align-items: center; gap: 3px; }
.ri { min-width: 24px; font: 600 11px ui-monospace, monospace; color: var(--edsub); }
.tin { width: 92px; padding: 4px 6px; border-radius: 6px; border: 1px solid transparent; background: var(--ed3); font: 500 12px ui-monospace, monospace; color: var(--edtext); }
.tin:focus { border-color: var(--amber); outline: 0; }
.arrow { color: var(--edsub); font-size: 11px; }
.mi { width: 26px; height: 26px; border-radius: 6px; color: var(--edsub); font-size: 12px; }
.mi:hover:not(:disabled) { background: var(--ed3); color: var(--edtext); }
.mi.del:hover { color: var(--bad); }
.txt { width: 100%; resize: none; border: 1px solid transparent; border-radius: 8px; padding: 6px 8px; background: transparent; font-size: 14.5px; line-height: 1.5; overflow: hidden; }
.txt:focus { border-color: var(--edline); background: var(--ed2); outline: 0; }
.badges { display: flex; flex-wrap: wrap; gap: 4px; }
.badge { padding: 3px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: rgba(255, 93, 93, .15); color: #ffa3a3; }
.badge.long { background: rgba(255, 176, 32, .15); color: #ffcf7a; }
.empty { padding: 22px 12px; text-align: center; color: var(--edsub); display: grid; gap: 12px; }
.row2 { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.pbody .row2 { justify-content: flex-start; }
.rg { display: grid; gap: 4px; font-size: 12.5px; color: var(--edsub); }
.rg span { display: flex; justify-content: space-between; }
.rg em { font-style: normal; color: var(--edtext); font-weight: 600; font-variant-numeric: tabular-nums; }
.rg input { accent-color: var(--amber); width: 100%; }
.seg { display: flex; flex-wrap: wrap; gap: 3px; padding: 3px; border-radius: 9px; background: var(--ed); }
.seg button { flex: 1 1 auto; padding: 6px 10px; border-radius: 7px; font-size: 12.5px; color: var(--edsub); }
.seg button[aria-pressed="true"] { background: var(--ed3); color: var(--edtext); font-weight: 600; }
.tpls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.tpl { display: grid; gap: 6px; padding: 10px; border-radius: 10px; border: 1.5px solid var(--edline); background: linear-gradient(135deg, #3d4a5c, #7a6a58); text-align: center; }
.tpl span { font-weight: 700; font-size: 15px; padding: 2px 6px; border-radius: 4px; justify-self: center; }
.tpl b { font-size: 11.5px; font-weight: 600; color: #fff; opacity: .9; }
.tpl-clean span { color: #fff; text-shadow: 0 2px 6px rgba(0, 0, 0, .7); }
.tpl-outline span { color: #fff; -webkit-text-stroke: 1px #000; paint-order: stroke; }
.tpl-box span { color: #fff; background: rgba(0, 0, 0, .6); }
.tpl-accent span { color: #ffd23f; -webkit-text-stroke: 1px #000; paint-order: stroke; font-weight: 800; }
.tpl.on { border-color: var(--amber); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.clr { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--edsub); }
.clr input { width: 44px; height: 30px; padding: 2px; border-radius: 7px; border: 1px solid var(--edline); background: var(--ed); }
.sw { display: flex; gap: 9px; align-items: flex-start; font-size: 13px; cursor: pointer; }
.sw input { accent-color: var(--amber); margin-top: 3px; width: 16px; height: 16px; flex: none; }
.sw.dim { opacity: .5; cursor: not-allowed; }
.offset { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.offset input, .fl input { width: 80px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--edline); background: var(--ed); }
.fl { display: grid; gap: 4px; font-size: 12.5px; color: var(--edsub); }
.fl input { width: 100%; font-size: 14px; color: var(--edtext); }
.hitlist { display: grid; gap: 3px; }
.hit { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 8px; text-align: left; padding: 7px 8px; border-radius: 8px; font-size: 13px; }
.hit span { font: 500 11px ui-monospace, monospace; color: var(--edsub); padding-top: 2px; }
.hit:hover, .hit.on { background: var(--ed3); }
.hit mark { background: rgba(255, 176, 32, .45); color: inherit; border-radius: 3px; padding: 0 1px; }
.xbtns { display: flex; flex-wrap: wrap; gap: 6px; }
.facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; margin: 0; font-size: 13px; }
.facts dt { color: var(--edsub); } .facts dd { margin: 0; }
.burn { display: grid; gap: 8px; padding: 12px; border-radius: 12px; background: var(--ed); border: 1px solid var(--edline); }
.burn.ok { border-color: rgba(62, 207, 142, .5); } .burn.err { border-color: rgba(255, 93, 93, .5); }
.burn p { margin: 0; font-size: 12.5px; color: var(--edsub); }
.burn a.btn { text-decoration: none; }
.dlg { border: 0; padding: 0; border-radius: 18px; background: var(--ed2); color: var(--edtext); width: min(520px, calc(100vw - 24px)); max-height: calc(calc(100dvh - var(--kumo-bar, 0px)) - 24px); }
.dlg::backdrop { background: rgba(0, 0, 0, .6); }
.dlg-in { display: grid; gap: 10px; padding: 22px; margin: 0; }
.dlg-in h3 { margin: 0; font: 700 19px var(--display); }
.dlg-in h4 { margin: 6px 0 0; font-size: 13px; color: var(--edsub); }
.opts2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.opt { display: grid; gap: 3px; text-align: left; padding: 12px; border-radius: 12px; border: 1.5px solid var(--edline); background: var(--ed); }
.opt b { font-size: 15px; } .opt span { font-size: 12.5px; color: var(--edsub); } .opt small { font-size: 11.5px; color: var(--faint); }
.opt.on { border-color: var(--amber); background: rgba(255, 176, 32, .08); }
.dlg-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; font-size: 13.5px; }
.keys dd { margin: 0; color: var(--edsub); }
kbd { font: 600 12px ui-monospace, monospace; padding: 2px 7px; border-radius: 6px; background: var(--ed3); border: 1px solid var(--edline); }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 90; max-width: calc(100vw - 32px); padding: 11px 18px; border-radius: 12px; background: #2a2d35; color: #fff; font-size: 14px; box-shadow: 0 12px 30px rgba(0, 0, 0, .3); }

@media (max-width: 1100px) { .ewrap { grid-template-columns: minmax(0, 1fr) 340px; } .tin { width: 84px; } }
@media (max-width: 900px) {
  /* editor: video on top, then controls, timeline, and the tabbed panel below */
  body.is-editor { overflow: auto; height: auto; }
  body.is-editor #app { height: auto; min-height: calc(100dvh - var(--kumo-bar, 0px)); }
  .ebar { position: sticky; top: 0; z-index: 10; }
  .hide-m { display: none; }
  .pname { width: 40vw; }
  .ewrap { display: block; }
  .left { border-right: 0; }
  .stage { flex: none; height: 56vw; max-height: 48vh; }
  .transport { flex-wrap: wrap; }
  .tl { height: 104px; }
  .right { min-height: 70vh; }
  .tabs { position: sticky; top: 52px; z-index: 5; background: var(--ed2); }
  .pbody { overflow: visible; }
  .lhead { top: 98px; }
  .tin { width: 80px; font-size: 11.5px; padding: 4px; }
  .rhead { flex-wrap: wrap; row-gap: 4px; }
  .mi { width: 28px; height: 28px; }
  .pbody { padding: 10px 10px 24px; }
  .opts2 { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition: none !important; } }

/* ===== editor v2: top bar · preview + side panel · full-width timeline ===== */
.ebar { height: 58px; gap: 4px; padding: 0 12px; }
.ebar .ib svg, .transport .ib svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ib.back { width: auto; padding: 0 10px 0 6px; gap: 4px; display: inline-flex; align-items: center; font-size: 13.5px; font-weight: 600; color: var(--edtext); }
.pn { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 0 1 auto; }
.pname { width: clamp(140px, 26vw, 360px); font-size: 15px; font-weight: 600; text-overflow: ellipsis; }
.save { padding: 3px 9px; border-radius: 99px; background: var(--ed3); font-size: 12px; }
.save[data-s="saved"]::before { content: "✓ "; color: var(--ok); }
.save[data-s="failed"] { color: #ffb0b0; background: rgba(255, 93, 93, .15); }
.vsep { width: 1px; height: 22px; background: var(--edline); margin: 0 6px; }
.ib[aria-pressed="true"] { color: var(--amber); }
.ewrap { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) clamp(320px, 27vw, 380px); grid-template-rows: minmax(0, 1fr) auto; grid-template-areas: "main side" "tl tl"; }
.ewrap.noside { grid-template-columns: minmax(0, 1fr) 0; }
.ewrap.noside .side { display: none; }
.main { grid-area: main; display: flex; flex-direction: column; min-width: 0; min-height: 0; border-right: 1px solid var(--edline); }
.side { grid-area: side; display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--ed2); }
.stage { flex: 1; min-height: 120px; }
.fsx { display: none; position: absolute; top: 16px; right: 16px; z-index: 5; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 10px; background: rgba(0, 0, 0, .65); color: #fff; font-size: 14px; font-weight: 600; }
.fsx kbd { background: rgba(255, 255, 255, .15); border-color: transparent; color: #fff; }
.stage:fullscreen { background: #000; }
.stage:fullscreen .fsx { display: inline-flex; }
.audiocard { gap: 10px; align-content: center; }
.audiocard span { font-size: 34px; color: var(--amber); }
.nomedia b { font-size: 16px; }
.nomedia p { margin: 0; max-width: 30em; color: var(--edsub); line-height: 1.6; }
.transport { min-height: 48px; }
.tlwrap { grid-area: tl; display: flex; flex-direction: column; border-top: 1px solid var(--edline); background: var(--ed2); min-width: 0; }
.tlgrip { height: 9px; cursor: ns-resize; display: grid; place-items: center; touch-action: none; }
.tlgrip i { width: 44px; height: 4px; border-radius: 2px; background: var(--edline); }
.tlgrip:hover i, .resizing .tlgrip i { background: var(--amber); }
.resizing, .resizing * { cursor: ns-resize !important; user-select: none; }
.tlbar { border-top: 0; padding: 2px 12px 6px; }
.tlcur { font: 500 12px ui-monospace, monospace; color: var(--amber); }
.tlhelp { opacity: .85; }
.tl { height: min(var(--tlh, 150px), 28vh); min-height: 70px; }
.tabs { padding: 8px; gap: 4px; }
.tabs button { padding: 9px 6px; font-size: 13.5px; }
.pbody { padding: 14px 16px 28px; gap: 12px; }
.pbody h4 { margin: 0; font-size: 12.5px; font-weight: 700; letter-spacing: .02em; color: var(--edsub); }
.hint { font-size: 13px; color: #a9afbc; }
.grp { display: grid; gap: 10px; padding: 0 0 14px; border-bottom: 1px solid var(--edline); }
.grp:last-of-type { border-bottom: 0; }
.adv summary { cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--edtext); list-style: none; display: flex; align-items: center; gap: 8px; }
.adv summary::before { content: "›"; display: inline-block; transition: transform .15s; color: var(--edsub); font-size: 16px; }
.adv[open] summary::before { transform: rotate(90deg); }
.adv summary::-webkit-details-marker { display: none; }
.btn.ghostline { background: transparent !important; }
.tpls { gap: 8px; }
.tpl { padding: 14px 8px 10px; min-height: 74px; align-content: center; }
.tpl.on { box-shadow: 0 0 0 1px var(--amber); }
/* list rows: playing / selected / editing look different */
.samplebar { display: grid; gap: 6px; padding: 12px 14px; border-radius: 12px; background: rgba(255, 176, 32, .09); border: 1px solid rgba(255, 176, 32, .35); }
.samplebar b { font-size: 13.5px; color: var(--amber); }
.samplebar p { margin: 0; font-size: 13px; line-height: 1.55; color: var(--edtext); }
.lhead { top: -14px; padding: 6px 0; }
.list { display: grid; gap: 6px; }
.row { transition: border-color .12s, background .12s; }
.row.cur { border-color: var(--edline); box-shadow: inset 3px 0 0 var(--amber); background: #17191e; }
.row.sel { border-color: var(--amber); }
.row:focus-within { border-color: #6aa8ff; box-shadow: 0 0 0 2px rgba(106, 168, 255, .22); background: #15181f; }
.row.cur:focus-within { box-shadow: inset 3px 0 0 var(--amber), 0 0 0 2px rgba(106, 168, 255, .22); }
.ri { min-width: 26px; height: 20px; display: grid; place-items: center; border-radius: 5px; background: var(--ed3); color: var(--edtext); }
.dur { font: 500 11px ui-monospace, monospace; color: var(--edsub); margin-left: 4px; }
.txt { font-size: 14.5px; line-height: 1.5; }
.legend { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; margin: 2px 0 0; font-size: 12px; color: var(--edsub); }
.lg { width: 14px; height: 10px; border-radius: 3px; border: 1px solid var(--edline); margin-left: 6px; }
.lg:first-child { margin-left: 0; }
.lg.cur { box-shadow: inset 3px 0 0 var(--amber); } .lg.sel { border-color: var(--amber); } .lg.edit { border-color: #6aa8ff; }
.empty .spin { margin: 0 auto; }
/* recognition steps */
.steps { display: flex; gap: 4px; margin: 0 0 8px; padding: 0; list-style: none; font-size: 12px; color: var(--edsub); }
.steps li { flex: 1; padding: 5px 0 0; border-top: 3px solid var(--edline); }
.steps li.done { border-color: var(--ok); color: var(--edtext); }
.steps li.on { border-color: var(--amber); color: var(--amber); font-weight: 600; }
/* export */
.xkinds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.xkinds button { display: grid; gap: 2px; padding: 10px 8px; border-radius: 10px; border: 1.5px solid var(--edline); background: var(--ed); text-align: left; }
.xkinds b { font-size: 13px; } .xkinds small { font: 500 11px ui-monospace, monospace; color: var(--edsub); }
.xkinds button[aria-pressed="true"] { border-color: var(--amber); background: rgba(255, 176, 32, .08); }
.xbody { display: grid; gap: 10px; }
.xempty { display: grid; gap: 10px; justify-items: start; padding: 14px; border-radius: 12px; background: var(--ed); border: 1px dashed var(--edline); }
.xempty p { margin: 0; font-size: 13.5px; color: var(--edtext); line-height: 1.55; }
.xprev { width: 100%; resize: vertical; padding: 10px; border-radius: 10px; border: 1px solid var(--edline); background: var(--ed); color: var(--edtext); font: 13px/1.6 Inter, "PingFang SC", sans-serif; }
.warnline { color: #ffcf7a; }
.dlg { overflow: auto; }
body.is-editor .toast { top: 70px; bottom: auto; }
@media (max-height: 640px) and (min-width: 901px) { .ebar { height: 52px; } .tl { height: min(var(--tlh, 150px), 22vh); } .transport { min-height: 42px; padding: 3px 10px; } }

/* phone: preview on top, compact timeline, tabbed panel fills the rest and scrolls on its own */
@media (max-width: 900px) {
  body.is-editor { overflow: hidden; height: calc(100dvh - var(--kumo-bar, 0px)); }
  body.is-editor #app { height: calc(100dvh - var(--kumo-bar, 0px)); }
  .ebar { height: 52px; position: static; padding: 0 6px; }
  .pname { width: 100%; min-width: 0; }
  .pn { flex: 1 1 auto; gap: 6px; }
  .save { display: none; }
  .ewrap, .ewrap.noside { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr); grid-template-areas: "main" "tl" "side"; }
  .ewrap.noside .side { display: flex; }
  .main { border-right: 0; }
  .stage { flex: none; height: min(56.25vw, 30dvh); min-height: 0; }
  .transport { padding: 4px 6px; min-height: 0; flex-wrap: nowrap; }
  .transport .chk { margin-left: 4px; }
  .time { font-size: 12px; margin-left: 4px; }
  .tlgrip, .tlbar { display: none; }
  .tl { height: 72px; min-height: 0; }
  .side { border-top: 1px solid var(--edline); }
  .tabs { position: static; padding: 6px; }
  .tabs button { font-size: 13px; padding: 8px 2px; }
  .pbody { overflow-y: auto; padding: 10px 12px 28px; }
  .lhead { top: -10px; }
  .xkinds { grid-template-columns: 1fr; }
  .xkinds button { grid-template-columns: 1fr auto; align-items: center; }
  body.is-editor .toast { top: 60px; }
}
.rhead { min-width: 0; }
.tin { width: 88px; }
.racts { display: none; align-items: center; gap: 2px; margin: 0 -2px -2px; padding-top: 6px; border-top: 1px solid var(--edline); }
.row.sel .racts, .row:focus-within .racts { display: flex; }
.racts button { padding: 5px 8px; border-radius: 7px; font-size: 12.5px; color: var(--edsub); white-space: nowrap; }
.racts button:hover:not(:disabled) { background: var(--ed3); color: var(--edtext); }
.racts button:disabled { opacity: .4; }
.racts .del:hover { color: #ff9b9b; }
.samplebar { position: relative; padding-right: 36px; }
.sbx { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 7px; color: var(--edsub); }
.sbx:hover { background: var(--ed3); color: var(--edtext); }
.chip { padding: 3px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; color: var(--amber); background: rgba(255, 176, 32, .12); }
.time, .chk { white-space: nowrap; }
body.fsfake .stage { position: fixed; inset: 0; z-index: 80; }
body.fsfake .fsx { display: inline-flex; }
.play { flex: none; }
@media (max-width: 900px) { .transport .chk { display: none; } }

/* ===== home v3 — one container, an 8px spacing scale, one set of components =====
   spacing: 8 / 16 / 24 / 32 / 48 / 64. Sections are 64px apart (48px on phones).
   cards: 16px radius, 1px line border, 24px padding (16px on phones). Buttons: 40px tall, 12px radius, 14px text. */
:root { --s1: 8px; --s2: 16px; --s3: 24px; --s4: 32px; --s6: 48px; --s8: 64px; --sec: 64px; --pad: 24px; --cardpad: 24px; --r: 16px; }
html { scrollbar-gutter: stable; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 var(--pad); }
body.is-home { font-size: 16px; }

/* header */
.htop { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.hin { display: flex; align-items: center; gap: var(--s3); height: 64px; }
.logo { display: flex; align-items: center; gap: var(--s1); text-decoration: none; margin-right: auto; }
.logo b { font: 700 22px var(--display); letter-spacing: -.02em; }
.mark { width: 32px; height: 32px; border-radius: 8px; background: var(--ink); display: grid; align-content: end; gap: 3px; padding: 7px; }
.mark i { display: block; height: 3px; border-radius: 2px; background: var(--amber); }
.mark i + i { background: #fff; width: 70%; justify-self: center; opacity: .85; }
.hnav { display: flex; gap: var(--s3); font-size: 14px; }
.hnav a { text-decoration: none; color: var(--sub); }
.hnav a:hover { color: var(--ink); }
.lang { height: 32px; padding: 0 12px; border-radius: 99px; }

/* shared components */
.is-home .btn { height: 40px; min-height: 40px; padding: 0 16px; border-radius: 12px; font-size: 14px; font-weight: 600; gap: var(--s1); }
.is-home .btn.big { height: 48px; min-height: 48px; padding: 0 24px; font-size: 16px; border-radius: 12px; }
.is-home .btn.sm { height: 32px; min-height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn.sample { border-color: #e3d3b5; background: var(--amber-soft); color: #7a4a00; }
.btn.sample .pl { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--amber); color: var(--amber-ink); font-size: 9px; padding-left: 2px; }
.btn.busy { opacity: .6; cursor: progress; }
.home h2 { font: 700 28px/1.25 var(--display); letter-spacing: -.02em; margin: 0 0 var(--s3); }
.sec { margin-top: var(--sec); }
.home p { text-align: left; }

/* hero: a centred heading group, then upload and demo as two equal columns */
.hero { padding-top: var(--s6); }
.hhead { text-align: center; max-width: 880px; margin: 0 auto var(--s4); }
.hhead .kick { display: inline-block; margin: 0 0 var(--s2); padding: 4px 12px; border-radius: 99px; background: var(--amber-soft); color: #8a5300; font-size: 13px; font-weight: 600; text-align: center; }
.hero h1 { font: 700 44px/1.15 var(--display); letter-spacing: -.03em; margin: 0 0 var(--s2); }
.hero h1 span { display: inline; white-space: nowrap; }
.hero h1 span + span { margin-left: .25em; }
.hero h1 .accent { color: #d98a00; }
.hhead .sub { margin: 0 auto; max-width: 640px; color: var(--sub); font-size: 17px; line-height: 1.7; text-align: center; }
.hwork { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); align-items: stretch; }
.hl, .hr { display: flex; flex-direction: column; gap: var(--s2); min-width: 0; }
.drop { flex: 1; display: grid; place-content: center; justify-items: center; gap: var(--s1); padding: var(--s4) var(--s3); border: 1px dashed #d6bf93; border-radius: var(--r); background: var(--card); text-align: center; color: var(--sub); font-size: 14px; }
.drop:hover, body.dragging .drop { border-color: var(--amber); }
.dic { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; background: var(--amber-soft); color: #b06d00; margin-bottom: var(--s1); }
.dic svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.drop .btn.big { margin-bottom: var(--s1); }
.drop small { color: var(--faint); font-size: 13px; line-height: 1.6; text-align: center; }
.alt { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s1); }
.alt .btn { width: 100%; }
.resume { display: flex; align-items: center; gap: var(--s1); height: 48px; padding: 0 var(--s2); width: 100%; border-radius: 12px; background: var(--card); border: 1px solid var(--line); text-align: left; font-size: 14px; }
.resume span { color: var(--sub); white-space: nowrap; }
.resume b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.resume em { margin-left: auto; font-style: normal; color: #d98a00; font-weight: 700; }
.resume:hover { border-color: #d6bf93; }
/* demo: video on top, a list that shows exactly four lines and scrolls, with a fade at the bottom */
.demo { flex: 1; display: flex; flex-direction: column; border-radius: var(--r); overflow: hidden; background: var(--ed); border: 1px solid var(--ed); }
.dv { position: relative; background: #000; }
.dv video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.dv canvas { position: absolute; left: 0; top: 0; width: 100%; aspect-ratio: 16 / 9; pointer-events: none; }
.dlist { --row: 40px; flex: 1; height: calc(var(--row) * 4 + 16px); min-height: calc(var(--row) * 4 + 16px); max-height: none; overflow-y: auto; padding: var(--s1); display: block; border-top: 1px solid var(--edline);
  -webkit-mask-image: linear-gradient(#000 calc(100% - 24px), transparent); mask-image: linear-gradient(#000 calc(100% - 24px), transparent); scrollbar-width: thin; scrollbar-color: var(--edline) transparent; }
.dlist.end { -webkit-mask-image: none; mask-image: none; }
.drow { display: grid; grid-template-columns: 56px minmax(0, 1fr); align-items: center; gap: var(--s1); width: 100%; height: var(--row); padding: 0 var(--s1); border-radius: 8px; text-align: left; color: var(--edtext); font-size: 14px; }
.drow span:first-child { font: 500 12px ui-monospace, monospace; color: var(--edsub); }
.drow span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drow:hover { background: var(--ed3); }
.drow.on { background: rgba(255, 176, 32, .16); box-shadow: inset 3px 0 0 var(--amber); }
.note { color: var(--sub); font-size: 13px; margin: 0; line-height: 1.6; }

/* recent projects */
.rhd { display: flex; align-items: baseline; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s3); }
.rhd h2 { margin: 0; }
.rhd .hint { color: var(--faint); font-size: 13px; }
.rgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s2); }
.rp { display: grid; gap: var(--s2); padding: var(--cardpad); border-radius: var(--r); background: var(--card); border: 1px solid var(--line); align-content: space-between; }
.rp-open { display: grid; gap: var(--s1); text-align: left; min-width: 0; padding: 0; background: none; border: 0; }
.rp-open b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--sub); }
.rp-open small { font-size: 13px; color: var(--sub); }
.rp-acts { display: flex; gap: var(--s1); }
.btn.more { margin-top: var(--s2); }

/* how it works: three cards in a row */
.how ol { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s2); }
.how li { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto 1fr; align-content: start; column-gap: var(--s2); row-gap: var(--s1); padding: var(--cardpad); border-radius: var(--r); background: var(--card); border: 1px solid var(--line); }
.how em { grid-row: 1 / 3; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: #fff0eb; font: 700 20px var(--display); font-style: normal; color: var(--coral); }
.how b { font-size: 16px; line-height: 1.5; align-self: center; }
.how span { color: var(--sub); font-size: 14px; line-height: 1.65; }

/* features: two-column grid of cards with an icon */
.fgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); }
.fgrid > div { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: var(--s2); row-gap: 4px; align-content: start; padding: var(--cardpad); border-radius: var(--r); background: var(--card); border: 1px solid var(--line); }
.fic { grid-row: 1 / 3; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--amber-soft); color: #b06d00; }
.fic svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.fgrid b { font-size: 16px; line-height: 1.5; }
.fgrid .ft { color: var(--sub); font-size: 14px; line-height: 1.65; }

/* limits */
.lgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); }
.lgrid div { display: grid; align-content: start; gap: var(--s1); padding: var(--cardpad); border-radius: var(--r); background: var(--card); border: 1px solid var(--line); }
.lgrid b { display: flex; align-items: center; gap: var(--s1); font-size: 16px; }
.lgrid b::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); flex: none; }
.lgrid span { color: var(--sub); font-size: 14px; line-height: 1.65; }

/* FAQ: equal rows, the toggle sits in one fixed column and is drawn, so nothing shifts */
.qa { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { display: grid; grid-template-columns: minmax(0, 1fr) 24px; align-items: center; column-gap: var(--s2); min-height: 64px; padding: var(--s2) 0; font-weight: 600; font-size: 16px; line-height: 1.5; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: none; }
.faq summary i { position: relative; width: 24px; height: 24px; }
.faq summary i::before, .faq summary i::after { content: ""; position: absolute; left: 5px; right: 5px; top: 11px; height: 2px; border-radius: 1px; background: var(--faint); transition: transform .2s; }
.faq summary i::after { transform: rotate(90deg); }
.faq details[open] summary i::after { transform: rotate(0deg); }
.faq p { margin: 0; padding: 0 40px var(--s3) 0; color: var(--sub); line-height: 1.7; }

/* footer */
.foot { margin-top: var(--sec); padding: var(--s3) 0 calc(var(--s3) + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); color: var(--sub); font-size: 14px; }
.foot .wrap { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s2); justify-content: space-between; }

@media (max-width: 1100px) { .rgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  :root { --sec: 48px; --cardpad: 16px; }
  .hnav { display: none; }
  .hero { padding-top: var(--s4); }
  .hhead { text-align: left; margin-bottom: var(--s3); }
  .hhead .sub { margin: 0; max-width: none; text-align: left; font-size: 16px; }
  .hero h1 { font-size: min(11.5vw, 48px); line-height: 1.15; }
  .hero h1 span { display: block; white-space: nowrap; }
  .hero h1 span + span { margin-left: 0; }
  .hwork { grid-template-columns: minmax(0, 1fr); }
  .alt { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .alt .sample { grid-column: 1 / -1; }
  .home h2 { font-size: 24px; margin-bottom: var(--s2); }
  .how ol { grid-template-columns: minmax(0, 1fr); gap: var(--s1); }
  .how li { grid-template-rows: auto auto; row-gap: 4px; }
  .how em { grid-row: 1 / 3; width: 32px; height: 32px; font-size: 16px; border-radius: 8px; align-self: start; }
  .how b { align-self: start; }
  .fgrid, .lgrid { grid-template-columns: minmax(0, 1fr); gap: var(--s1); }
  .rgrid { grid-template-columns: minmax(0, 1fr); }
  .faq summary { min-height: 56px; }
  .faq p { padding-right: 0; }
}
@media (max-width: 600px) { :root { --pad: 16px; } }
@media (max-width: 900px) {
  html[lang="zh-CN"] .hero h1 { font-size: min(14.5vw, 60px); letter-spacing: -.02em; }
  html[lang="en"] .hero h1 { font-size: min(10.5vw, 44px); }
  html[lang="en"] .hero h1 span { white-space: normal; }
}
.demo { flex: none; }
.dlist { flex: none; }
.hero h1 span + span { margin-left: 0; }
.hero h1 span.accent { margin-left: .3em; }
@media (max-width: 900px) { .hero h1 span.accent { margin-left: 0; } }
/* hero work area: upload and demo share one row so their edges line up; buttons and note share the next */
.hwork { grid-template-areas: "drop demo" "alt note" "resume ."; row-gap: var(--s2); column-gap: var(--s3); align-items: stretch; }
.hl, .hr { display: contents; }
.drop { grid-area: drop; }
.alt { grid-area: alt; align-self: start; }
.resume { grid-area: resume; }
.demo { grid-area: demo; align-self: start; }
.note { grid-area: note; align-self: start; }
.dlist { height: calc(var(--row) * 4 + 17px); min-height: calc(var(--row) * 4 + 17px); }
@media (max-width: 900px) {
  .hwork { grid-template-areas: "drop" "alt" "resume" "demo" "note"; }
  .demo { margin-top: var(--s2); }
}
.hhead .sub { text-wrap: balance; max-width: 720px; } @media (max-width: 900px) { .hhead .sub { text-wrap: pretty; } }
.drop small { text-wrap: balance; }

/* ---- looks, list states and the ⋯ menu (2026-11 redesign) ---- */
/* look cards: a real frame with the look on it, its name and what it suits; the chosen one has a ring and a tick */
.tpls { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tpl { position: relative; display: grid; gap: 4px; padding: 6px 6px 8px; min-height: 0; border-radius: 12px; border: 1.5px solid var(--edline); background: var(--ed); text-align: left; align-content: start; }
.tpl img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; background: var(--ed3); }
.tpl b { padding: 0 2px; font-size: 13.5px; font-weight: 700; color: var(--edtext); opacity: 1; }
.tpl small { padding: 0 2px; font-size: 11.5px; line-height: 1.4; color: var(--edsub); }
.tpl:hover { border-color: color-mix(in srgb, var(--amber) 50%, var(--edline)); }
.tpl.on { border-color: var(--amber); box-shadow: 0 0 0 2px color-mix(in srgb, var(--amber) 28%, transparent); }
.tpl .tick { position: absolute; top: 10px; right: 10px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--amber); color: #2a1a00; font: 800 13px/1 system-ui, sans-serif; font-style: normal; }
/* list: the text leads, times stay small until a line is chosen; playing = left bar, chosen = border, editing = blue ring */
.txt { font-size: 15.5px; font-weight: 500; color: var(--edtext); }
.tin { background: transparent; color: var(--edsub); border-color: transparent; }
.row.sel .tin, .row:focus-within .tin, .tin:focus { background: var(--ed3); color: var(--edtext); }
.row.cur { background: var(--ed2); }
.row:focus-within { background: var(--ed2); }
.row.cur .ri { background: var(--amber); color: #2a1a00; }
.samplebar { background: var(--ed2); border-color: var(--edline); }
.samplebar b { color: var(--edtext); }
/* the ⋯ menu for line breaks and find & replace, and the header of those pages */
.more-wrap { position: relative; }
.more-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 5; min-width: 168px; padding: 6px; border-radius: 12px; background: var(--ed); border: 1px solid var(--edline); box-shadow: 0 8px 24px rgba(20, 24, 50, .16); display: grid; }
.more-menu button { padding: 9px 10px; border-radius: 8px; text-align: left; font-size: 13.5px; color: var(--edtext); }
.more-menu button:hover { background: var(--ed3); }
.subhead { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; }
.subhead b { font-size: 15px; color: var(--edtext); }

/* ---- entry: words and buttons on the left (40%), the finished look on the right (60%) ---- */
.hero .hgrid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 40px; align-items: center; }
.hleft { display: grid; gap: 16px; justify-items: start; text-align: left; }
.hleft .kick { margin: 0; }
.hleft h1 { margin: 0; text-align: left; }
.hleft h1 span { display: block; white-space: normal; margin-left: 0 !important; }
.hleft .sub { margin: 0; max-width: 44ch; text-align: left; font-size: 16px; }
.hacts { display: flex; flex-wrap: wrap; gap: 10px; }
.hleft .drop { width: 100%; min-height: 0; padding: 12px 14px; display: grid; gap: 2px; justify-items: start; text-align: left; border-radius: 12px; cursor: pointer; }
.hleft .drop small { color: var(--sub); line-height: 1.55; }
.hleft .alt { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-start; }
.hright .demo { display: grid; gap: 12px; border: 0; background: none; overflow: visible; }
.hright .dv { position: relative; border-radius: 16px; overflow: hidden; background: #111; aspect-ratio: 16 / 9; }
.hright .dv video, .hright .dv canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.dpp { position: absolute; right: 12px; top: 12px; width: 36px; height: 36px; border-radius: 50%; background: rgba(0, 0, 0, .45); color: #fff; font-size: 13px; }
.dpp:hover { background: rgba(0, 0, 0, .65); }
.dtpls { display: flex; flex-wrap: wrap; gap: 6px; }
.dtpls button { height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--sub); font-size: 13.5px; font-weight: 600; }
.dtpls button[aria-checked="true"] { border-color: transparent; background: var(--ink); color: #fff; }
.dfoot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.dfoot .note { margin: 0; flex: 1 1 260px; font-size: 12.5px; color: var(--sub); line-height: 1.5; }
@media (max-width: 900px) {
  /* phones see the result first, then the buttons */
  .hero .hgrid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .hright { order: -1; }
  .dtpls { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding-inline: 16px; }
  .dtpls::-webkit-scrollbar { display: none; }
  .dtpls button { flex: none; }
}
/* the old two-column hero named grid areas on these; in the new left column they simply stack */
.hleft > * { grid-area: auto !important; }
.hleft .drop { flex: none; }
.hleft .drop { place-content: start !important; justify-items: start !important; text-align: left !important; }
.hleft .alt { display: flex !important; flex-direction: row !important; gap: 4px !important; }

/* short narrow windows (phone landscape, 200% zoom): the fixed-height layout left the subtitle list ~40px tall,
   so the whole editor scrolls as one page instead and the panel gets its natural height (no scroll inside a scroll) */
@media (max-width: 900px) and (max-height: 640px) {
  body.is-editor { overflow: auto; height: auto; }
  body.is-editor #app { height: auto; min-height: calc(100dvh - var(--kumo-bar, 0px)); }
  .ewrap, .ewrap.noside { grid-template-rows: auto auto auto; }
  .side { min-height: 0; }
  .pbody { overflow: visible; flex: none; }
  .tabs { position: sticky; top: 0; z-index: 3; background: var(--ed2); }
}
