:root {
  --bg: #faf8f5;
  --surface: #ffffff;
  --surface-2: #f3efe9;
  --text: #1d1a17;
  --muted: #6d655c;
  --line: #e2dbd1;
  --accent: #b2603a;
  --accent-soft: #f5e7df;
  --ok: #3f7d58;
  --err: #b3403a;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(29, 26, 23, .05), 0 8px 24px rgba(29, 26, 23, .06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14120f;
    --surface: #1d1a16;
    --surface-2: #26221d;
    --text: #f2ede6;
    --muted: #a79d91;
    --line: #332d26;
    --accent: #d98a5f;
    --accent-soft: #33241b;
    --ok: #6fbf8e;
    --err: #e0776f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
        "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 840px; margin: 0 auto; padding: 0 20px; }

.site-header { padding: 48px 0 28px; }
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand-cn { font-size: 34px; font-weight: 700; letter-spacing: .06em; }
.brand-en { font-size: 15px; color: var(--muted); letter-spacing: .22em; text-transform: uppercase; }
.tagline { margin: 10px 0 0; color: var(--muted); font-size: 15px; }

.step {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.step h2 { margin: 0 0 6px; font-size: 17px; display: flex; align-items: center; gap: 10px; }
.step-no {
  display: inline-grid; place-items: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 13px; font-weight: 700;
}
.hint { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.hint strong { color: var(--text); }
.person-limit { color: var(--accent); font-size: 13px; }

.dropzone {
  display: grid; place-items: center; gap: 4px;
  padding: 32px 20px; text-align: center; cursor: pointer;
  border: 1.5px dashed var(--line); border-radius: 12px;
  background: var(--surface-2); transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dz-icon { font-size: 26px; color: var(--accent); line-height: 1; }
.dz-text { font-size: 15px; }
.dz-sub { font-size: 12px; color: var(--muted); }

.thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.thumb { position: relative; width: 88px; height: 112px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .badge {
  position: absolute; left: 5px; top: 5px;
  background: rgba(0,0,0,.66); color: #fff; font-size: 10px;
  padding: 2px 6px; border-radius: 20px;
}
.thumb .rm {
  position: absolute; right: 4px; top: 4px; width: 20px; height: 20px;
  border: 0; border-radius: 50%; cursor: pointer; line-height: 1;
  background: rgba(0,0,0,.66); color: #fff; font-size: 14px;
}

.themes { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.theme-card {
  text-align: left; cursor: pointer; padding: 16px;
  border: 1.5px solid var(--line); border-radius: 12px;
  background: var(--surface-2); color: inherit; font: inherit;
  transition: border-color .15s, background .15s;
}
.theme-card:hover:not(:disabled) { border-color: var(--accent); }
.theme-card.selected { border-color: var(--accent); background: var(--accent-soft); }
.theme-card:disabled { opacity: .5; cursor: not-allowed; }
.theme-name { display: block; font-size: 19px; font-weight: 600; }
.theme-meta { display: block; margin-top: 4px; font-size: 12.5px; color: var(--muted); }

.params {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px;
  margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line);
}
.param-wide { grid-column: span 2; }
@media (max-width: 860px) { .params { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) {
  .params { grid-template-columns: repeat(2, 1fr); }
  .param-wide { grid-column: span 2; }
}
.param[hidden] { display: none; }

.param { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.param-label { font-size: 11.5px; color: var(--muted); letter-spacing: .03em; }
.param select {
  width: 100%; padding: 7px 8px; font: inherit; font-size: 13.5px;
  color: var(--text); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 8px; cursor: pointer;
}
.param select:focus { outline: none; border-color: var(--accent); }
.param-readout {
  padding: 7px 8px; font-size: 13.5px; color: var(--muted);
  background: var(--surface-2); border: 1px dashed var(--line); border-radius: 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.cta {
  width: 100%; padding: 16px; font-size: 17px; font-weight: 600;
  color: #fff; background: var(--accent); border: 0; border-radius: 12px; cursor: pointer;
  transition: opacity .15s;
}
.cta:hover:not(:disabled) { opacity: .9; }
.cta:disabled { opacity: .4; cursor: not-allowed; }
.cta-note { margin: 10px 0 0; text-align: center; font-size: 13px; color: var(--muted); }

.cta-download {
  display: block; margin-top: 18px; text-align: center; text-decoration: none;
}
.cta-download[hidden] { display: none; }

.progress-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.progress-bar { flex: 1; height: 7px; border-radius: 20px; background: var(--surface-2); overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--accent); transition: width .3s; }
.progress-label { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

.scene-list { list-style: none; margin: 0; padding: 0; }
.scene-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px;
}
.scene-list li:first-child { border-top: 0; }
.scene-name { flex: 1; color: var(--muted); }
.state { font-size: 12.5px; padding: 3px 9px; border-radius: 20px; background: var(--surface-2); color: var(--muted); }
.state.running { background: var(--accent-soft); color: var(--accent); }
.state.done { background: transparent; color: var(--ok); }
.state.failed { background: transparent; color: var(--err); }
.spinner {
  width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid var(--accent); border-right-color: transparent;
  animation: spin .7s linear infinite; display: inline-block; vertical-align: -1px; margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.gallery figure { margin: 0; cursor: zoom-in; }
.gallery img {
  width: 100%; aspect-ratio: 9 / 16; object-fit: cover;
  border-radius: 12px; border: 1px solid var(--line); display: block;
  transition: transform .15s;
}
.gallery figure:hover img { transform: translateY(-2px); }
.gallery figcaption { margin-top: 6px; font-size: 12px; color: var(--muted); }
.idscore {
  display: inline-block; margin-left: 2px; padding: 1px 6px;
  border-radius: 20px; font-size: 11px; white-space: nowrap;
}
.idscore-ok { background: rgba(63, 125, 88, .14); color: var(--ok); }
.idscore-bad { background: rgba(179, 64, 58, .14); color: var(--err); }
.idscore-na { background: var(--surface-2); color: var(--muted); }

.proc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }
.proc-item { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.proc-item dt { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.proc-item dd { margin: 3px 0 0; font-size: 14px; word-break: break-all; }

.proc-block { border-top: 1px solid var(--line); padding: 10px 0; }
.proc-block summary { cursor: pointer; font-size: 14.5px; font-weight: 600; padding: 4px 0; }
.proc-block ol, .proc-block ul { margin: 8px 0 4px; padding-left: 20px; font-size: 14px; color: var(--muted); }
.proc-block li { margin: 5px 0; }
.prompt-box {
  margin: 10px 0 0; padding: 14px; max-height: 380px; overflow: auto;
  background: var(--surface-2); border-radius: 10px;
  font: 12.5px/1.65 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap; word-break: break-word;
}
.record { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; margin-top: 8px; font-size: 13px; }
.record b { font-weight: 600; }
.record .kv { color: var(--muted); }

.danger { text-align: center; background: transparent; border: 0; box-shadow: none; padding: 4px; }
.ghost {
  background: transparent; border: 1px solid var(--line); color: var(--muted);
  padding: 9px 18px; border-radius: 10px; cursor: pointer; font-size: 13.5px;
}
.ghost:hover { border-color: var(--err); color: var(--err); }

.lightbox {
  position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.92);
  display: grid; grid-template-rows: 1fr auto; place-items: center; padding: 40px 16px 16px;
}
.lightbox[hidden] { display: none; }
.lb-stage {
  display: grid; place-items: center; width: 100%; height: 100%;
  overflow: hidden; touch-action: pan-y;   /* 允许纵向滚动，横向留给划屏切换 */
}
.lightbox img {
  max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px;
  user-select: none; -webkit-user-drag: none;
  transition: transform .18s ease-out, opacity .18s ease-out;
}
.lightbox img.swiping { transition: none; }

.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .14); color: #fff;
  font-size: 26px; line-height: 1; cursor: pointer;
  display: grid; place-items: center;
}
.lb-nav:hover { background: rgba(255, 255, 255, .26); }
.lb-nav:disabled { opacity: 0; pointer-events: none; }
.lb-prev { left: 12px; }
.lb-next { right: 12px; }
/* 触屏设备靠划屏，不占画面 */
@media (hover: none) and (pointer: coarse) {
  .lb-nav { display: none; }
}

.lb-counter { color: rgba(255, 255, 255, .6); font-variant-numeric: tabular-nums; }
.lb-close {
  position: absolute; top: 10px; right: 14px; z-index: 2;
  background: transparent; border: 0; color: #fff; font-size: 34px; cursor: pointer; line-height: 1;
}
.lb-bar { display: flex; align-items: center; gap: 16px; color: #fff; font-size: 13px; padding: 12px 0 0; }
.lb-download { color: #fff; text-decoration: underline; }

.loading { color: var(--muted); font-size: 14px; margin: 0; }
.error-box { background: var(--accent-soft); color: var(--err); border-radius: 10px; padding: 12px 14px; font-size: 14px; margin-top: 12px; }

.site-footer { padding: 30px 0 50px; color: var(--muted); font-size: 12.5px; text-align: center; }
