/* 激光流：暗场 + 一块面板，光落在面板上沿往下淌。 */
:root {
  --bg: #05060a;
  --panel: #0a0c14;
  --line: rgba(255, 255, 255, .09);
  --ink: #eef1f8;
  --muted: #8d95ab;
  --accent: #3847ff;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
}

body {
  color: var(--ink);
  font: 15px/1.65 ui-sans-serif, system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* 画布铺满舞台，压在面板上面 —— 光要盖住内容，才像真的照上去 */
.stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100svh;
  padding: 96px 24px 120px;
  overflow: hidden;
}

.laser-flow-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  display: block;
  pointer-events: none;
}

.panel {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  padding: 40px 40px 34px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(255, 255, 255, .05), transparent 60%),
    var(--panel);
  box-shadow: 0 40px 120px rgba(0, 0, 0, .55);
}

.panel__eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.panel__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

.panel__title {
  margin: 0;
  font-size: clamp(30px, 4.6vw, 46px);
  line-height: 1.22;
  font-weight: 650;
  letter-spacing: -.015em;
}

.panel__body {
  max-width: 44ch;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 14.5px;
}

.panel__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 30px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.panel__stats dt {
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.panel__stats dd {
  margin: 4px 0 0;
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}

/* ── 控制条 ── */
.controls {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(10, 12, 20, .72);
  backdrop-filter: blur(14px);
}

.ctl {
  padding: 6px 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: color .2s ease, background .2s ease;
}

.ctl:hover { color: var(--ink); background: rgba(255, 255, 255, .06); }
.ctl:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.swatches {
  display: flex;
  gap: 7px;
  padding: 0 4px;
}

.swatch {
  width: 16px;
  height: 16px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 50%;
  background: currentColor;
  color: #3847ff;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}

.swatch[data-color="#00d1ff"] { color: #00d1ff; }
.swatch[data-color="#ff2e88"] { color: #ff2e88; }
.swatch[data-color="#ffc24b"] { color: #ffc24b; }

.swatch:hover { transform: scale(1.15); }

.swatch.is-on {
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px currentColor, 0 0 14px currentColor;
}

.swatch:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.hint {
  position: fixed;
  left: 24px;
  bottom: 26px;
  z-index: 3;
  margin: 0;
  color: rgba(141, 149, 171, .75);
  font-size: 12px;
  letter-spacing: .02em;
}

/* ── 浅色主题：着色器会切到"色相 + 透明度"那套输出，页面也跟着反过来 ── */
.is-light {
  --bg: #f3f5fb;
  --panel: #ffffff;
  --line: rgba(16, 19, 28, .1);
  --ink: #10131c;
  --muted: #5b6478;
}

.is-light body {
  background: var(--bg);
}

.is-light .panel {
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(56, 71, 255, .06), transparent 60%),
    var(--panel);
  box-shadow: 0 30px 90px rgba(16, 19, 28, .12);
}

.is-light .controls {
  background: rgba(255, 255, 255, .78);
}

.is-light .ctl:hover { background: rgba(16, 19, 28, .06); }

.is-light .hint { color: rgba(91, 100, 120, .8); }

@media (max-width: 700px) {
  .stage { padding: 64px 18px 132px; }
  .panel { padding: 28px 24px 26px; border-radius: 22px; }
  .panel__stats { grid-template-columns: 1fr; gap: 12px; }
  .hint { left: 18px; bottom: 84px; }
  .controls { right: 14px; bottom: 14px; left: 14px; justify-content: space-between; }
}

@media (prefers-reduced-motion: reduce) {
  .swatch, .ctl { transition: none; }
}
