:root {
  --bg: #f3f4ef;
  --card: #ffffff;
  --ink: #1f261f;
  --ink-2: #3c4738;
  --muted: #79816f;
  --line: #e3e6dc;
  --line-strong: #d3d8c8;
  --lime: #d7fa72;
  --lime-deep: #c3ee4a;
  --dark: #232c22;
  --danger: #c4553f;
  --warn: #d08a2c;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(28, 36, 24, .04), 0 10px 30px -18px rgba(28, 36, 24, .25);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ol, ul { margin: 0; }
button, input, select { font-family: inherit; font-size: inherit; color: inherit; }
a { color: inherit; }
.muted-sm { font-size: 12px; color: var(--muted); }

/* ---------------------------------------------------------------- 顶栏 */
.topbar {
  height: 68px;
  padding: 0 clamp(16px, 4vw, 48px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(251, 252, 248, .88);
  backdrop-filter: saturate(160%) blur(10px);
  position: sticky;
  top: 0;
  z-index: 30;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 10px;
  background: var(--dark); color: var(--lime);
  display: grid; place-items: center; font-size: 20px; line-height: 1;
}
.brand-name { font-size: 20px; font-weight: 750; letter-spacing: -.6px; }
.badge {
  font-size: 9px; letter-spacing: .8px; font-weight: 700;
  border: 1px solid var(--line-strong); border-radius: 5px;
  padding: 3px 5px; color: var(--muted);
}
.topbar-right { display: flex; align-items: center; gap: 14px; }
.engine { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.engine i { width: 6px; height: 6px; border-radius: 50%; background: #8aa85c; }
.engine.is-error i { background: var(--danger); }

main { max-width: 1360px; margin: 0 auto; padding: clamp(18px, 3vw, 34px) clamp(14px, 4vw, 48px) 28px; }

/* ---------------------------------------------------------------- 进度条/按钮 */
.btn {
  appearance: none; border: 1px solid transparent; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 11px; padding: 12px 18px;
  font-weight: 650; font-size: 13px; text-decoration: none; white-space: nowrap;
  transition: transform .14s ease, background .14s ease, border-color .14s ease, opacity .14s;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.primary { background: var(--lime); color: #26311c; }
.btn.primary:hover:not(:disabled) { background: var(--lime-deep); }
.btn.dark { background: var(--dark); color: #f3f6ea; }
.btn.ghost { background: transparent; border-color: var(--line-strong); color: var(--ink-2); }
.btn.ghost:hover:not(:disabled) { background: #fff; }
.btn.small { padding: 9px 13px; font-size: 12.5px; background: #fff; border-color: var(--line-strong); color: var(--ink-2); }
.btn.small.is-active { background: var(--ink); color: var(--lime); border-color: var(--ink); }
.btn.small:disabled { background: #f4f5f0; }
a.is-disabled { pointer-events: none; opacity: .45; }
.is-pulse { box-shadow: 0 0 0 0 rgba(195, 238, 74, .8); animation: pulse 1.8s ease-out infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(195, 238, 74, .85); }
  70% { box-shadow: 0 0 0 10px rgba(195, 238, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(195, 238, 74, 0); }
}
.link-btn { border: 0; background: none; color: var(--muted); text-decoration: underline; cursor: pointer; padding: 2px; font-size: 12px; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-strong);
  background: #fff; cursor: pointer; display: grid; place-items: center; font-size: 12px; flex: none;
}
.icon-btn:hover { background: #f6f8f0; }

.progress-track { height: 6px; border-radius: 4px; background: #e6e9df; overflow: hidden; width: clamp(80px, 16vw, 160px); }
.progress-track.wide { width: 100%; }
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, #b8df57, #8fbf3f); transition: width .25s ease; }
.spinner {
  width: 14px; height: 14px; border-radius: 50%; flex: none;
  border: 2px solid #dfe4d5; border-top-color: #86a844;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- 作品列表 */
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.eyebrow { font-size: 10px; letter-spacing: 2.4px; font-weight: 700; color: #8a927f; margin-bottom: 8px; }
.view-head h1 { font-size: clamp(26px, 3.2vw, 36px); letter-spacing: -1.1px; font-weight: 700; line-height: 1.2; }
.lede { color: var(--muted); font-size: 13.5px; max-width: 620px; margin-top: 10px; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.upload-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px; margin-bottom: 18px; display: grid; gap: 10px; box-shadow: var(--shadow);
}
.upload-row { display: flex; align-items: center; gap: 12px; }
.upload-copy { flex: 1; min-width: 0; }
.upload-copy strong { font-size: 13px; display: block; }
.upload-copy p { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

.empty-state {
  background: var(--card); border: 1.5px dashed #cfd6c3; border-radius: var(--radius);
  padding: clamp(30px, 6vw, 64px) 24px; display: grid; gap: 12px; justify-items: center; text-align: center;
  background: linear-gradient(180deg, #fbfcf7, #f6f7f1);
}
.empty-icon { width: 52px; height: 52px; border-radius: 16px; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; font-size: 24px; color: #77836a; }
.empty-state h2 { font-size: 18px; }
.empty-state p { font-size: 13px; color: var(--muted); max-width: 460px; }
.empty-state small { font-size: 11px; color: #9aa193; }

.work-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.work-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column;
  transition: border-color .15s, transform .15s;
}
.work-card:hover { border-color: var(--line-strong); }
.work-thumb {
  position: relative; aspect-ratio: 16 / 9; background: #1b2219; overflow: hidden;
  display: grid; place-items: center;
}
.work-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.work-thumb .ph { color: #6f7d66; font-size: 22px; }
.work-dur {
  position: absolute; right: 8px; bottom: 8px; background: rgba(18, 23, 15, .8);
  color: #eef4e2; font-size: 11px; padding: 2px 7px; border-radius: 6px; font-variant-numeric: tabular-nums;
}
.work-status {
  position: absolute; left: 8px; top: 8px; font-size: 10.5px; font-weight: 700;
  padding: 3px 8px; border-radius: 6px; background: rgba(215, 250, 114, .95); color: #2b3719;
}
.work-status.is-error { background: rgba(196, 85, 63, .95); color: #fff; }
.work-status.is-processing { background: rgba(255, 255, 255, .92); color: #41502f; }
.work-body { padding: 12px 14px 14px; display: grid; gap: 10px; flex: 1; }
.work-name { font-size: 13.5px; font-weight: 650; }
.work-sub { font-size: 11.5px; color: var(--muted); }
.work-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.work-actions .btn { padding: 8px 12px; font-size: 12px; border-radius: 9px; }
.work-actions .link-btn { margin-left: auto; }

.limits { margin-top: 26px; padding: 0 4px; color: var(--muted); }
.limits h3 { font-size: 12px; margin-bottom: 8px; color: var(--ink-2); font-weight: 650; }
.limits ul { padding-left: 18px; display: grid; gap: 5px; font-size: 11.5px; }
/* 侧栏里的小字限制说明：不继承页面底部那套间距 */
ul.limits.tight { margin: 2px 0 0; padding: 0 0 0 16px; font-size: 11px; line-height: 1.5; display: grid; gap: 4px; }

/* ---------------------------------------------------------------- 作品内头部 */
.flow-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.back-btn {
  border: 1px solid var(--line-strong); background: #fff; border-radius: 9px;
  padding: 7px 12px; font-size: 12.5px; cursor: pointer; color: var(--ink-2); white-space: nowrap;
}
.back-btn:hover { background: #f6f8f0; }
.flow-title { font-size: 13px; font-weight: 650; max-width: 40vw; }
.steps { list-style: none; display: flex; align-items: center; padding: 0; margin: 0 0 0 auto; overflow-x: auto; }
.step { display: flex; align-items: center; gap: 7px; color: #9aa193; font-size: 12.5px; white-space: nowrap; }
.step b { font-size: 10px; letter-spacing: .5px; border: 1px solid var(--line-strong); border-radius: 20px; padding: 2px 7px; font-weight: 700; }
.step:not(:last-child)::after { content: ""; width: clamp(14px, 3vw, 42px); height: 1px; background: var(--line-strong); margin: 0 10px; }
.step.is-active { color: var(--ink); font-weight: 650; }
.step.is-active b { background: var(--dark); border-color: var(--dark); color: var(--lime); }
.step.is-done { color: var(--ink-2); }
.step.is-done b { background: #eaf5cf; border-color: #d6e9a8; color: #4d6128; }

/* ---------------------------------------------------------------- 面板布局 */
.stage-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(270px, .85fr); gap: 16px; align-items: start; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.panel-title { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; letter-spacing: .2px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink); }
.dot.lime { background: #a8cf4e; }
.panel-meta { font-size: 12px; color: var(--muted); }
.truncate { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.tag { border: 1px solid var(--line-strong); border-radius: 6px; padding: 2px 7px; font-size: 11px; color: var(--ink-2); font-weight: 650; }
.tag.is-warn { border-color: #eccfa2; background: #fdf5e9; color: #9a6a1f; }
.tag.is-live { border-color: #cfe49c; background: #f2fadc; color: #556d24; }
.tag.raw { border-color: #cfe49c; background: #f7fbe9; color: #5d7526; }
.panel-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

.side { display: grid; gap: 0; padding: 0; }
.side-block { padding: 14px 16px; border-bottom: 1px solid var(--line); display: grid; gap: 9px; }
.side-block:last-child { border-bottom: 0; }
.side-block h3 { font-size: 12.5px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.side-block .count { font-size: 10.5px; color: var(--muted); font-weight: 600; border: 1px solid var(--line-strong); border-radius: 20px; padding: 1px 7px; }
.side-actions { padding: 14px 16px; display: grid; gap: 8px; border-bottom: 1px solid var(--line); }
.side-actions .btn { width: 100%; }
.side > .note, .side-block .note { padding: 0; }
.hint-list { padding-left: 16px; display: grid; gap: 5px; font-size: 11.5px; color: var(--muted); }
.empty { font-size: 12px; color: #a6ac9c; }

/* ---------------------------------------------------------------- 编辑器 */
.editor { padding: 14px 16px 16px; display: grid; gap: 12px; }
.stage { position: relative; background: #12170f; border-radius: 12px; overflow: hidden; line-height: 0; display: grid; place-items: center; min-height: 200px; }
/* 画面必须等比显示：width:100% + max-height 会把竖屏视频压扁，
   人脸被横向拉伸后既难看又容易被当成"模糊"，选框也会跟着画面一起变形。 */
.stage video { width: auto; max-width: 100%; max-height: 58vh; display: block; object-fit: contain; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.stage canvas.loupe {
  width: 132px; height: 132px; inset: auto 10px 10px auto;
  border: 2px solid rgba(215, 250, 114, .9); border-radius: 50%;
  background: #12170f; cursor: none; box-shadow: 0 6px 20px rgba(0, 0, 0, .45);
}
.stage-tip {
  position: absolute; left: 12px; bottom: 12px; pointer-events: none;
  background: rgba(20, 26, 16, .72); color: #eef4e2; font-size: 11.5px;
  padding: 5px 9px; border-radius: 7px; line-height: 1.4; max-width: 70%;
}
.transport { display: flex; align-items: center; gap: 10px; }
.time { font-variant-numeric: tabular-nums; font-size: 11.5px; color: var(--muted); min-width: 38px; text-align: center; }
.seek-wrap { position: relative; flex: 1; padding-top: 2px; }
input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 4px; border-radius: 4px;
  background: #dfe4d5; outline: none; margin: 8px 0;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%;
  background: var(--dark); border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.25); cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px; border: 2px solid #fff; border-radius: 50%; background: var(--dark); cursor: pointer;
}
input[type="range"]:disabled { opacity: .45; }
.anchor-marks { position: absolute; left: 0; right: 0; top: 1px; height: 18px; pointer-events: none; }
.anchor-marks i { position: absolute; top: 0; width: 2px; height: 12px; background: #a4c655; transform: translateX(-1px); border-radius: 1px; }
.anchor-marks i.lost { background: #e0a259; height: 8px; top: 4px; width: 3px; }
.tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.selection { font-size: 11.5px; color: var(--muted); margin-left: auto; }
.note { font-size: 11px; color: #9aa193; }

.anchor-list { display: flex; flex-wrap: wrap; gap: 6px; }
.anchor-chip {
  display: inline-flex; align-items: stretch; border: 1px solid var(--line-strong);
  border-radius: 8px; overflow: hidden; background: #fff; font-size: 11.5px;
}
.anchor-chip button { border: 0; background: transparent; padding: 5px 8px; cursor: pointer; font-size: 11.5px; }
.anchor-chip button.jump { font-variant-numeric: tabular-nums; font-weight: 600; }
.anchor-chip button.del { color: #9aa193; border-left: 1px solid var(--line); }
.anchor-chip button.del:hover { background: #fbeeea; color: var(--danger); }
.anchor-chip.is-subject { border-color: #b8d76a; background: #f5fbe4; }
.anchor-chip.is-subject button.jump::after { content: " 主角"; color: #6d8c2c; font-weight: 700; }
.anchor-chip.is-lost { border-color: #eccfa2; }
.lost-list { display: flex; flex-wrap: wrap; gap: 6px; }
.lost-chip {
  border: 1px solid #eccfa2; background: #fdf5e9; color: #8a5f1c;
  border-radius: 8px; padding: 4px 8px; font-size: 11.5px; cursor: pointer; font-variant-numeric: tabular-nums;
}
.mini-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mini-stats div { display: grid; }
.mini-stats b { font-size: 14px; font-variant-numeric: tabular-nums; }
.mini-stats span { font-size: 10.5px; color: var(--muted); }

.subject-card { display: grid; gap: 6px; }
.subject-card .thumb { width: 100%; aspect-ratio: 16/9; border-radius: 10px; background: #1b2219; object-fit: contain; }
.subject-card strong { font-size: 13px; }
.subject-card p { font-size: 11.5px; color: var(--muted); }

/* ---------------------------------------------------------------- 播放器 */
.player { background: #12170f; display: grid; place-items: center; padding: 10px; min-height: 220px; position: relative; }
.player video { width: auto; max-width: 100%; max-height: 68vh; display: block; border-radius: 8px; background: #000; }
.player canvas { width: auto; max-width: 100%; max-height: 68vh; display: block; border-radius: 8px; background: #000; }
.player-empty {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center;
  gap: 5px; color: #c7d0b8; text-align: center; padding: 24px; background: #1b2219;
}
.player-empty span { font-size: 22px; opacity: .7; }
.player-empty p { font-weight: 650; font-size: 13px; }
.player-empty small { font-size: 11px; color: #8e9a82; line-height: 1.5; max-width: 280px; }
.player-meta { padding: 12px 16px; font-size: 11.5px; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; }
.player-meta b { color: var(--ink-2); font-weight: 650; }

.setting-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.setting-tools button {
  border: 1px solid var(--line-strong); background: #fbfcf8; border-radius: 10px;
  padding: 9px 10px; cursor: pointer; text-align: left; font-size: 11.5px; color: var(--muted);
  display: flex; flex-direction: column; gap: 2px;
}
.setting-tools button:hover { background: #f4f7ec; border-color: #bccca0; }
.setting-tools button b { color: var(--ink); font-size: 12.5px; font-weight: 650; }

.meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.meta-grid div { display: grid; }
.meta-grid b { font-size: 14px; font-variant-numeric: tabular-nums; }
.meta-grid span { font-size: 10.5px; color: var(--muted); }

.history { margin-top: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.history-list { display: grid; gap: 6px; }
.history-item { display: flex; align-items: center; gap: 10px; font-size: 12px; flex-wrap: wrap; }
.history-item .tag { font-size: 10.5px; }
.history-item a { color: #4b6a20; text-decoration: underline; font-size: 11.5px; }

/* ---------------------------------------------------------------- 进度 / 提示条 */
.progress-inline {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border: 1px solid var(--line); background: #fbfcf7; border-radius: 11px;
}
.progress-inline > div:not(.progress-track) { flex: 1; min-width: 0; }
.progress-inline strong { font-size: 12.5px; display: block; }
.progress-inline p { font-size: 11px; color: var(--muted); margin-top: 1px; }
.banner {
  margin-top: 14px; padding: 11px 14px; border-radius: 12px; font-size: 12.5px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.banner.warn { background: #fdf5e9; border: 1px solid #eccfa2; color: #8a5f1c; }
.banner.error { background: #fbeae5; border: 1px solid #eec3b8; color: #9c3f2b; }
.banner.ok { background: #f2fadc; border: 1px solid #cfe49c; color: #4d6522; }

.view-foot {
  margin-top: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  position: sticky; bottom: 10px; box-shadow: 0 12px 30px -22px rgba(20,28,18,.5); z-index: 20;
  flex-wrap: wrap;
}
.foot-copy { min-width: 0; flex: 1; }
.foot-copy strong { font-size: 13px; display: block; }
.foot-copy p { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.foot-actions { display: flex; align-items: center; gap: 9px; flex: none; flex-wrap: wrap; }

/* ---------------------------------------------------------------- 底部面板 */
.sheet { position: fixed; inset: 0; z-index: 95; display: flex; align-items: flex-end; justify-content: center; }
.sheet-mask { position: absolute; inset: 0; background: rgba(24, 30, 22, .46); }
.sheet-card {
  position: relative; background: #fff; width: min(560px, 100%); max-height: 84vh; overflow: auto;
  border-radius: 18px 18px 0 0; padding: 16px 18px calc(20px + env(safe-area-inset-bottom, 0px));
  display: grid; gap: 14px; box-shadow: 0 -18px 40px -30px rgba(0,0,0,.5);
  animation: sheetUp .18s ease;
}
@keyframes sheetUp { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet-head h3 { font-size: 15px; }
.sheet-close { border: 0; background: none; font-size: 22px; color: #a3a99a; cursor: pointer; line-height: 1; }
.sheet-body { display: grid; gap: 14px; }
.opt-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.opt-grid.two { grid-template-columns: repeat(2, 1fr); }
.opt {
  border: 1px solid var(--line-strong); background: #fbfcf8; border-radius: 11px;
  padding: 11px 8px; cursor: pointer; display: grid; gap: 2px; justify-items: center; text-align: center;
  font-size: 12.5px; font-weight: 650;
}
.opt small { font-size: 10.5px; color: var(--muted); font-weight: 500; }
.opt.is-active { background: var(--dark); border-color: var(--dark); color: var(--lime); }
.opt.is-active small { color: #b9c9a4; }
.opt-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.opt-row label { font-size: 12.5px; font-weight: 650; }
.opt-row output { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sheet-foot { font-size: 11.5px; color: var(--muted); }
.switch {
  appearance: none; width: 46px; height: 26px; border-radius: 20px; background: #dfe3d8;
  position: relative; cursor: pointer; transition: background .15s; flex: none; border: 0;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.switch:checked { background: #9dc24e; }
.switch:checked::after { transform: translateX(20px); }

/* ---------------------------------------------------------------- 全局杂项 */
.site-footer {
  max-width: 1360px; margin: 0 auto; padding: 8px clamp(14px, 4vw, 48px) 34px;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  font-size: 10.5px; color: #9ba193; letter-spacing: .3px;
}
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 16px);
  background: rgba(28, 35, 25, .94); color: #f2f6e9; padding: 10px 16px; border-radius: 10px;
  font-size: 12.5px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 120; max-width: 82vw;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.modal { position: fixed; inset: 0; background: rgba(24, 30, 22, .48); display: grid; place-items: center; padding: 20px; z-index: 110; }
.modal-card {
  background: #fff; border-radius: 18px; padding: 26px; max-width: 460px; width: 100%;
  position: relative; box-shadow: 0 30px 60px -30px rgba(0,0,0,.5); display: grid; gap: 12px;
}
.modal-card.narrow { max-width: 340px; }
.modal-card h2 { font-size: 17px; }
.modal-card ol { padding-left: 18px; display: grid; gap: 8px; font-size: 12.5px; color: var(--ink-2); }
.modal-note { font-size: 12px; color: var(--muted); }
.modal-card input[type="text"] { border: 1px solid var(--line-strong); border-radius: 9px; padding: 10px 12px; }
.modal-close { position: absolute; top: 10px; right: 12px; border: 0; background: none; font-size: 20px; color: #a3a99a; cursor: pointer; }

/* ---------------------------------------------------------------- 区间显示 / 效果面板 */
.range-strip {
  margin: 12px 16px 0; padding: 9px 12px; border-radius: 10px;
  background: #f7f9ef; border: 1px solid #e2e8d3; color: var(--ink-2);
  font-size: 12px; font-variant-numeric: tabular-nums; line-height: 1.65;
}
.range-strip b { font-weight: 700; color: var(--ink); }
.range-strip .range-rule { display: block; font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.range-note { font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; line-height: 1.65; }

.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-chip {
  border: 1px solid var(--line-strong); background: #fbfcf8; border-radius: 9px;
  padding: 7px 11px; font-size: 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.filter-chip i {
  width: 12px; height: 12px; border-radius: 4px; display: inline-block;
  border: 1px solid rgba(0, 0, 0, .12);
}
.filter-chip.is-active { background: var(--dark); border-color: var(--dark); color: var(--lime); }
.filter-chip.is-active i { border-color: rgba(255, 255, 255, .35); }

.slider-line { display: grid; grid-template-columns: 56px 1fr 52px; align-items: center; gap: 8px; }
.slider-line label { font-size: 11.5px; color: var(--ink-2); }
.slider-line input[type="range"] { margin: 4px 0; }
.slider-line output { font-size: 11px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.slider-line.is-off { opacity: .45; }

.toggle-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.toggle-line label { font-size: 12px; }
.toggle-line label small { display: block; font-size: 10.5px; font-weight: 400; color: var(--muted); margin-top: 1px; }
.mini-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }

.side-block summary {
  list-style: none; cursor: pointer; font-size: 12.5px; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.side-block summary::-webkit-details-marker { display: none; }
.side-block summary::after { content: "▾"; margin-left: auto; color: var(--muted); font-size: 11px; }
.side-block details[open] summary::after, details.side-block[open] summary::after { content: "▴"; }
.adjust-body { display: grid; gap: 8px; margin-top: 8px; }

.player .effect-frame {
  width: auto; max-width: 100%; max-height: 68vh; display: block; border-radius: 8px;
  background: #000; object-fit: contain;
}
.frame-badge {
  position: absolute; left: 14px; top: 14px; z-index: 3;
  background: rgba(215, 250, 114, .92); color: #2b3719;
  font-size: 10.5px; font-weight: 700; padding: 4px 8px; border-radius: 6px;
}

.upload-phases { display: flex; gap: 8px; font-size: 11px; color: var(--muted); flex-wrap: wrap; }
.upload-phases .phase {
  border: 1px solid var(--line); border-radius: 20px; padding: 2px 9px; background: #fbfcf8;
}
.upload-phases .phase.is-active { border-color: #cfe49c; background: #f2fadc; color: #4d6522; font-weight: 700; }
.upload-phases .phase.is-done { color: #6f8a33; }

@media (max-width: 720px) {
  .range-strip { margin: 10px 12px 0; font-size: 11.5px; }
  .slider-line { grid-template-columns: 52px 1fr 48px; }
  .player .effect-frame { max-height: 46vh; }
}

/* ---------------------------------------------------------------- 响应式 */
@media (max-width: 1040px) {
  .stage-layout { grid-template-columns: 1fr; }
  .side { grid-template-columns: 1fr; }
  .view-foot { position: static; }
}

@media (max-width: 720px) {
  .topbar { height: 60px; }
  .brand-name { font-size: 17px; }
  .engine { display: none; }
  .view-head { flex-direction: column; align-items: flex-start; gap: 14px; }
  .head-actions { width: 100%; }
  .head-actions .btn { flex: 1; }
  .lede { font-size: 13px; }
  .flow-head { gap: 10px; }
  .flow-title { max-width: 42vw; font-size: 12.5px; }
  .steps { margin-left: 0; width: 100%; }
  .step span { display: none; }
  .step.is-active span { display: inline; }
  .step:not(:last-child)::after { margin: 0 7px; width: 12px; }
  .panel-head { padding: 12px 14px; }
  .editor { padding: 12px; }
  .stage video { max-height: 42vh; max-width: 100%; }
  .selection { width: 100%; margin-left: 0; }
  .view-foot { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px; }
  .foot-actions { justify-content: space-between; }
  .foot-actions .btn { flex: 1; min-width: 0; }
  .player video, .player canvas { max-height: 46vh; }
  .setting-tools { grid-template-columns: 1fr 1fr; }
  .work-grid { grid-template-columns: 1fr; }
  .site-footer { flex-direction: column; }
  .toast { bottom: 96px; }
  .sheet-card { border-radius: 16px 16px 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
