/* 虚拟摄影棚 — 独立页样式，沿用工作箱暖炭+黄铜体系，红线色点缀 */

:root {
  --st-bg: #151210;
  --st-panel: #1d1916;
  --st-panel-soft: #241f1a;
  --st-line: rgba(194, 160, 96, 0.18);
  --st-line-strong: rgba(194, 160, 96, 0.4);
  --st-ink: #e8dfcc;
  --st-muted: rgba(232, 223, 204, 0.55);
  --st-brass: #c2a060;
  --st-red: #d96a55;
  --st-mono: "Cascadia Code", "JetBrains Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--st-bg);
  color: var(--st-ink);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 13px;
}

body { display: flex; flex-direction: column; overflow: hidden; }

.hidden { display: none !important; }

/* ── 顶栏 ── */
.st-topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--st-line);
  background: var(--st-panel);
  flex: none;
}

.st-brand { display: flex; align-items: center; gap: 10px; }

.st-mark {
  width: 30px;
  height: 30px;
  display: inline-block;
  background: var(--st-brass);
  -webkit-mask: url(/assets/brand-mark.png) center / contain no-repeat;
  mask: url(/assets/brand-mark.png) center / contain no-repeat;
}

.st-brand-text { display: grid; line-height: 1.25; }
.st-brand-text strong { font-size: 15px; letter-spacing: 0.06em; }
.st-brand-text span { font-family: var(--st-mono); font-size: 9px; letter-spacing: 0.24em; color: var(--st-red); }

.st-template-bar { display: flex; align-items: center; gap: 6px; margin-left: 10px; }
.st-bar-label { font-size: 11px; color: var(--st-muted); margin-right: 4px; }

.st-template-bar button {
  border: 1px solid var(--st-line);
  background: transparent;
  color: var(--st-ink);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 12px;
  cursor: pointer;
}

.st-template-bar button:hover { border-color: var(--st-brass); }
.st-template-bar button.active { border-color: var(--st-red); color: var(--st-red); }

.st-top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.st-session { font-size: 11px; color: var(--st-muted); font-family: var(--st-mono); }

.st-ghost {
  border: 1px solid var(--st-line);
  background: transparent;
  color: var(--st-ink);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  text-decoration: none;
}
.st-ghost:hover { border-color: var(--st-brass); }

/* ── 主体三栏 ── */
.st-main { flex: 1; display: grid; grid-template-columns: 218px 1fr 252px; min-height: 0; }

.st-left, .st-right {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 10px;
  overflow-y: auto;
  background: var(--st-panel);
}
.st-left { border-right: 1px solid var(--st-line); }
.st-right { border-left: 1px solid var(--st-line); }

.st-block {
  border: 1px solid var(--st-line);
  border-radius: 10px;
  background: var(--st-panel-soft);
  padding: 10px;
}
.st-grow { flex: 1; min-height: 120px; display: flex; flex-direction: column; }
.st-grow .st-object-list { flex: 1; overflow-y: auto; }

.st-block h3 {
  margin: 0 0 8px;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--st-brass);
  font-weight: 700;
}
.st-block h3 small { color: var(--st-muted); font-weight: 400; }

/* ── 场景底图 ── */
.st-plate-zone {
  position: relative;
  border: 1px dashed var(--st-line-strong);
  border-radius: 8px;
  min-height: 72px;
  display: grid;
  place-items: center;
  cursor: pointer;
  overflow: hidden;
  background: #0d0b09;
}
.st-plate-zone:hover { border-color: var(--st-brass); }
.st-plate-zone.dragging { border-color: var(--st-red); }
.st-plate-empty {
  padding: 10px 8px;
  font-size: 11px;
  text-align: center;
  color: var(--st-muted);
  line-height: 1.6;
}
.st-plate-empty small { font-size: 10px; opacity: 0.8; }
#stPlateThumb { width: 100%; display: block; }
.st-plate-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 6px;
  font-size: 11px;
  color: var(--st-muted);
}
.st-plate-actions span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-plate-actions button {
  border: 1px solid rgba(217, 106, 85, 0.45);
  background: transparent;
  color: var(--st-red);
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 11px;
  cursor: pointer;
  flex: none;
}
.st-plate-hint { margin: 6px 0 0; font-size: 10px; line-height: 1.6; color: var(--st-muted); }

/* 三档模式按钮竖排撑满，窄栏不溢出
   注意：必须双类提权——.st-btn-grid 的三列规则在本文件更后面，同权重会反盖（2026-06-12 踩坑） */
.st-btn-grid.st-plate-mode { grid-template-columns: 1fr; }
.st-btn-grid.st-plate-mode button { white-space: normal; padding: 6px 4px; }

/* ── 相机数值面板 ── */
.st-cam-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}

.st-cam-grid label {
  display: grid;
  gap: 2px;
  font-size: 10px;
  color: var(--st-muted);
}

.st-cam-grid input {
  width: 100%;
  border: 1px solid var(--st-line);
  background: var(--st-panel);
  color: var(--st-brass);
  border-radius: 5px;
  padding: 4px 5px;
  font-size: 11px;
  font-family: var(--st-mono);
}

.st-cam-grid input:disabled { opacity: 0.4; }

.st-cam-hint {
  margin: 7px 0 0;
  font-size: 10px;
  line-height: 1.7;
  color: var(--st-muted);
}

.st-cam-reset {
  width: 100%;
  margin-top: 8px;
  border: 1px solid var(--st-line);
  background: transparent;
  color: var(--st-ink);
  border-radius: 6px;
  padding: 6px;
  font-size: 11px;
  cursor: pointer;
}

.st-cam-reset:hover { border-color: var(--st-brass); color: var(--st-brass); }

.st-add-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.st-add-grid button {
  border: 1px solid var(--st-line);
  background: transparent;
  color: var(--st-ink);
  border-radius: 7px;
  padding: 6px 4px;
  font-size: 12px;
  cursor: pointer;
}
.st-add-grid button:hover { border-color: var(--st-brass); color: var(--st-brass); }

.st-object-list { display: grid; gap: 4px; }
.st-object-row {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 4px 7px;
  font-size: 12px;
  cursor: pointer;
  color: var(--st-muted);
}
.st-object-row:hover { border-color: var(--st-line); }
.st-object-row.active { border-color: var(--st-red); color: var(--st-ink); }
.st-object-row i {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--st-line-strong);
  flex: none;
  font-style: normal;
}
.st-object-row.is-char i { background: var(--st-red); }

.st-help p { margin: 0; font-size: 11px; line-height: 1.7; color: var(--st-muted); }

/* ── 快捷键说明：分组 + 键帽样式 ── */
.st-keys { display: grid; gap: 10px; }

.st-keys-group h4 {
  margin: 0 0 4px;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--st-red);
  font-weight: 700;
}

.st-keys-group p {
  margin: 0 0 3px;
  font-size: 10.5px;
  line-height: 1.8;
  color: var(--st-muted);
}

.st-keys kbd {
  display: inline-block;
  border: 1px solid var(--st-line-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--st-panel);
  color: var(--st-ink);
  font-family: var(--st-mono);
  font-size: 9.5px;
  line-height: 1;
  padding: 2px 5px 3px;
  margin: 0 1px;
  white-space: nowrap;
}

/* ── 中部视口 ── */
.st-center { display: flex; flex-direction: column; min-width: 0; min-height: 0; }

.st-viewport-wrap { position: relative; flex: 1; min-height: 0; background: #0d0b09; }
#stViewport { width: 100%; height: 100%; display: block; touch-action: none; }

.st-campreview {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 300px;
  border: 1px solid var(--st-line-strong);
  border-radius: 10px;
  background: var(--st-panel);
  overflow: hidden;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.5);
}

.st-campreview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 9px;
  font-family: var(--st-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--st-brass);
  border-bottom: 1px solid var(--st-line);
  cursor: move;
  touch-action: none;
  user-select: none;
}

.st-preview-resize {
  position: absolute;
  right: 2px;
  bottom: 0;
  padding: 0 4px 2px;
  font-size: 12px;
  color: var(--st-line-strong);
  cursor: nwse-resize;
  touch-action: none;
  user-select: none;
}

.st-preview-resize:hover { color: var(--st-brass); }

.st-pose-grid { grid-template-columns: repeat(4, 1fr); margin-top: 4px; }

.st-top-actions button:disabled { opacity: 0.35; cursor: default; }

#stCamPreview { width: 100%; display: block; background: #000; }

.st-capture {
  border: 1px solid var(--st-red);
  background: rgba(217, 106, 85, 0.14);
  color: var(--st-red);
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.st-capture:hover { background: rgba(217, 106, 85, 0.28); }

/* ── 分镜条 ── */
.st-shots {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  min-height: 86px;
  border-top: 1px solid var(--st-line);
  background: var(--st-panel);
  overflow-x: auto;
}
.st-shots-empty { font-size: 11px; color: var(--st-muted); }
.st-shot-thumb {
  position: relative;
  flex: none;
  width: 112px;
  height: 63px;
  border: 1px solid var(--st-line);
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  background: #000;
}
.st-shot-thumb:hover { border-color: var(--st-brass); }
.st-shot-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.st-shot-thumb span {
  position: absolute;
  left: 4px;
  bottom: 3px;
  font-family: var(--st-mono);
  font-size: 9px;
  color: #fff;
  text-shadow: 0 1px 3px #000;
}
.st-shot-del {
  position: absolute;
  right: 3px;
  top: 3px;
  width: 16px;
  height: 16px;
  line-height: 14px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.65);
  color: #ddd;
  font-size: 10px;
  cursor: pointer;
}

/* ── 右栏控件 ── */
.st-row-label { font-size: 11px; color: var(--st-muted); margin: 8px 0 5px; }

.st-btn-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.st-btn-grid button {
  border: 1px solid var(--st-line);
  background: transparent;
  color: var(--st-ink);
  border-radius: 6px;
  padding: 5px 2px;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
}
.st-btn-grid button:hover { border-color: var(--st-brass); }
.st-btn-grid button.active { border-color: var(--st-red); color: var(--st-red); background: rgba(217, 106, 85, 0.1); }

.st-light-grid { grid-template-columns: repeat(2, 1fr); }

.st-slider { display: grid; gap: 3px; margin-top: 8px; font-size: 11px; color: var(--st-muted); }
.st-slider em { font-style: normal; color: var(--st-brass); font-family: var(--st-mono); }
.st-slider input { width: 100%; accent-color: var(--st-brass); }

select {
  width: 100%;
  border: 1px solid var(--st-line);
  background: var(--st-panel);
  color: var(--st-ink);
  border-radius: 6px;
  padding: 6px;
  font-size: 12px;
}

.st-sel-empty { font-size: 11px; color: var(--st-muted); }
.st-sel-name { margin: 0 0 4px; font-size: 13px; font-weight: 700; }
.st-sel-actions { display: flex; gap: 6px; margin-top: 10px; }
.st-sel-actions button {
  flex: 1;
  border: 1px solid var(--st-line);
  background: transparent;
  color: var(--st-ink);
  border-radius: 6px;
  padding: 6px;
  font-size: 12px;
  cursor: pointer;
}
.st-sel-actions button:hover { border-color: var(--st-brass); }
.st-sel-actions .st-danger { border-color: rgba(217, 106, 85, 0.45); color: var(--st-red); }

.st-color-row { display: flex; gap: 6px; margin-top: 10px; }
.st-color-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
}
.st-color-dot.active { border-color: var(--st-ink); }

/* ── 拍摄弹窗 ── */
.st-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.65);
  padding: 24px;
}

.st-modal-card {
  width: min(640px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  border: 1px solid var(--st-line-strong);
  border-radius: 14px;
  background: var(--st-panel);
  padding: 14px;
  display: grid;
  gap: 10px;
}

.st-modal-head { display: flex; align-items: center; justify-content: space-between; }
.st-modal-head strong { letter-spacing: 0.06em; }

#stModalImg {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--st-line);
  background: #000;
}

#stModalPrompt {
  width: 100%;
  border: 1px solid var(--st-line);
  border-radius: 8px;
  background: #0d0b09;
  color: var(--st-ink);
  font-family: var(--st-mono);
  font-size: 11px;
  line-height: 1.7;
  padding: 10px;
  resize: vertical;
}

.st-modal-actions { display: flex; gap: 8px; }
.st-modal-actions button {
  flex: 1;
  border: 1px solid var(--st-line);
  background: transparent;
  color: var(--st-ink);
  border-radius: 8px;
  padding: 9px;
  font-size: 13px;
  cursor: pointer;
}
.st-modal-actions button:hover { border-color: var(--st-brass); }
.st-modal-actions .st-primary {
  border-color: var(--st-brass);
  background: rgba(194, 160, 96, 0.16);
  color: var(--st-brass);
  font-weight: 700;
}
.st-modal-actions .st-primary:hover { background: rgba(194, 160, 96, 0.3); }
.st-modal-hint { margin: 0; font-size: 11px; color: var(--st-muted); line-height: 1.6; }

@media (max-width: 1100px) {
  .st-main { grid-template-columns: 180px 1fr 220px; }
  .st-campreview { width: 220px; }
}
