:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --line: #e4e7ef;
  --ink: #1f2430;
  --sub: #6b7280;
  --brand: #5b6cff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.6 -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}

.app { max-width: 720px; margin: 0 auto; padding: 20px 16px 40px; }

.hdr h1 { font-size: 20px; margin: 0 0 6px; }
.hint { margin: 0; color: var(--sub); font-size: 13px; }
.hint.warn { color: #b45309; font-weight: 600; }

.stage {
  position: relative;
  margin: 16px 0;
  background: linear-gradient(160deg, #efeaf6 0%, #e7ecf7 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.wrist-tag {
  position: absolute; top: 10px; left: 12px; z-index: 2;
  font-size: 12px; color: var(--sub);
  background: rgba(255,255,255,.75);
  padding: 3px 8px; border-radius: 999px;
}

#scene { display: block; width: 100%; height: 360px; }

.fallback {
  margin: 0; padding: 12px 16px;
  font-size: 13px; color: #92400e; background: #fff7ed;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px 16px 16px;
}

.ctrl { padding: 12px 0; border-bottom: 1px dashed var(--line); }
.ctrl:last-child { border-bottom: 0; }
.ctrl h2 { font-size: 14px; margin: 0 0 8px; color: var(--ink); }

.btns { display: flex; flex-wrap: wrap; gap: 8px; }

.btns button {
  border: 1px solid var(--line);
  background: #fff; color: var(--ink);
  padding: 7px 14px; border-radius: 999px;
  font-size: 13px; cursor: pointer;
}
.btns button::before {
  content: ""; display: inline-block;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--c, #ccc); margin-right: 6px; vertical-align: -1px;
}
.btns button.on { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(91,108,255,.15); }

/* 串缩略条（选中机制） */
.strip {
  display: flex; flex-wrap: wrap; gap: 6px;
  max-height: 132px; overflow-y: auto; padding: 4px 0;
}
.bead-dot {
  width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid #fff;
  background: var(--c, #ccc);
  color: rgba(0,0,0,.55); font-size: 11px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: 0 0 0 1px var(--line);
}
.bead-dot.sel {
  box-shadow: 0 0 0 2px var(--brand);
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

input[type="range"] { width: 62%; vertical-align: middle; }

button.primary {
  background: var(--brand); color: #fff; border: 0;
  padding: 9px 18px; border-radius: 10px; font-size: 14px; cursor: pointer;
}

.modal {
  position: fixed; inset: 0; z-index: 10;
  background: rgba(17,20,28,.45);
  display: flex; align-items: center; justify-content: center;
}
.modal[hidden] { display: none; }
.modal-box {
  background: #fff; border-radius: 14px; padding: 20px;
  width: min(360px, 88vw); text-align: center;
}
.modal-box h3 { margin: 0 0 8px; font-size: 16px; }
.modal-box p { color: var(--sub); font-size: 13px; margin: 0 0 14px; }
.modal-box button {
  border: 1px solid var(--line); background: #fff;
  padding: 7px 16px; border-radius: 8px; cursor: pointer;
}
