:root {
  --bg: #0f1419;
  --panel: #182029;
  --text: #eef3f7;
  --muted: #9aa8b5;
  --accent: #c62828;
  --line: rgba(255, 255, 255, 0.08);
  --radius: 14px;
  font-family: "Segoe UI", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
a { color: inherit; }

.page-home .hero {
  padding: 48px 24px 28px;
  background:
    radial-gradient(900px 420px at 15% -10%, rgba(198, 40, 40, 0.28), transparent 60%),
    linear-gradient(180deg, #161d25, var(--bg));
  border-bottom: 1px solid var(--line);
}
.hero__eyebrow {
  margin: 0 0 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-size: 12px;
}
.hero h1 { margin: 0 0 10px; font-size: clamp(28px, 4vw, 42px); }
.hero__lead { margin: 0; max-width: 52ch; color: var(--muted); line-height: 1.6; }

.feature { margin-bottom: 28px; }
.feature__card {
  display: grid;
  grid-template-columns: minmax(180px, 320px) 1fr;
  gap: 0;
  text-decoration: none;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .18s ease, transform .18s ease;
}
.feature__card:hover {
  transform: translateY(-2px);
  border-color: rgba(198,40,40,.5);
}
.feature__media {
  min-height: 180px;
  background: #10161c center/cover no-repeat;
}
.feature__body { padding: 18px 20px; display: grid; gap: 8px; align-content: center; }
.feature__tag {
  margin: 0;
  width: fit-content;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(198,40,40,.2);
  color: #ffb4b4;
  font-size: 12px;
}
.feature__body h2 { margin: 0; font-size: 20px; }
.feature__body p { margin: 0; color: var(--muted); line-height: 1.55; font-size: 14px; }
@media (max-width: 720px) {
  .feature__card { grid-template-columns: 1fr; }
  .feature__media { min-height: 140px; }
}

.wrap { width: min(1100px, calc(100% - 32px)); margin: 28px auto 64px; }
.wrap h2 { margin: 0 0 14px; font-size: 18px; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.card {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  transition: transform .18s ease, border-color .18s ease;
}
.card:hover { transform: translateY(-2px); border-color: rgba(198,40,40,.45); }
.card__media {
  aspect-ratio: 4/3;
  background: #10161c center/cover no-repeat;
  border-bottom: 1px solid var(--line);
}
.card__body { padding: 14px 14px 16px; display: grid; gap: 6px; }
.card__body strong { font-size: 15px; }
.card__body span { color: var(--muted); font-size: 13px; line-height: 1.45; }
.card__cta {
  margin-top: 8px;
  color: #ffb4b4;
  font-size: 13px;
}
.note {
  margin-top: 36px;
  padding: 18px 18px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.02);
}
.note ul { color: var(--muted); line-height: 1.7; }
.note code { color: #ffd7d7; }

.page-viewer { height: 100vh; overflow: hidden; }
.viewer-bar {
  position: absolute;
  z-index: 2;
  left: 0; right: 0; top: 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  background: linear-gradient(180deg, rgba(8,12,16,.88), rgba(8,12,16,.2) 70%, transparent);
  pointer-events: none;
}
.viewer-bar > * { pointer-events: auto; }
.viewer-bar__back, .viewer-bar__hint {
  text-decoration: none;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--line);
}
.viewer-bar__meta h1 { margin: 0; font-size: 16px; }
.viewer-bar__meta p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }

.stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #111820;
  --poster-color: transparent;
}
.ar-btn {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  background: var(--accent);
  color: white;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}
.ar-btn--system {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  background: #fff;
  color: #121417;
  font-size: 14px;
  white-space: nowrap;
}
.ar-btn__icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.viewer-colors {
  position: absolute;
  z-index: 6;
  top: 72px;
  left: 16px;
  display: flex;
  gap: 8px;
  padding: 6px;
  border-radius: 12px;
  background: rgba(12, 14, 18, 0.55);
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(10px);
}
.viewer-colors .color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 2px solid rgba(255,255,255,0.35);
  background: var(--swatch, #333);
  cursor: pointer;
  padding: 0;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.25);
}
.viewer-colors .color-swatch.is-active {
  outline: 2px solid #fff;
  outline-offset: 2px;
  border-color: #fff;
}
body[data-stage-bg="white"] .viewer-colors {
  background: rgba(255,255,255,0.85);
  border-color: rgba(0,0,0,0.12);
}
body[data-stage-bg="white"] .viewer-colors .color-swatch.is-active {
  outline-color: #111;
}
.ar-help {
  position: absolute;
  z-index: 3;
  right: 16px;
  bottom: 16px;
  width: min(320px, calc(100% - 32px));
  padding: 14px 16px;
  border-radius: var(--radius);
  background: rgba(16, 22, 28, 0.92);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  display: none;
}
.ar-help:target { display: block; }
.ar-help h2 { margin: 0 0 8px; color: var(--text); font-size: 14px; }
.ar-help ol { margin: 0; padding-left: 18px; }

/* Stage: pure white / pure black + BOXOpro */
.stage-toolbar {
  position: absolute;
  z-index: 5;
  left: 16px;
  bottom: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  pointer-events: none;
}
.stage-toolbar > * { pointer-events: auto; }
.stage-toolbar__brand {
  height: 28px;
  width: auto;
  color: #fff;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.35));
}
.stage-toolbar__bg {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: rgba(20, 24, 28, 0.72);
  border: 1px solid rgba(255,255,255,0.14);
  backdrop-filter: blur(8px);
}
.stage-toolbar__bg button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  color: #c9d4de;
  background: transparent;
  cursor: pointer;
}
.stage-toolbar__bg button.is-active {
  background: #fff;
  color: #111;
}
body[data-stage-bg="white"] .viewer-bar {
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.15) 70%, transparent);
}
body[data-stage-bg="white"] .viewer-bar__meta h1 { color: #111; }
body[data-stage-bg="white"] .viewer-bar__meta p { color: #555; }
body[data-stage-bg="white"] .viewer-bar__back,
body[data-stage-bg="white"] .viewer-bar__hint {
  background: rgba(0,0,0,0.06);
  border-color: rgba(0,0,0,0.12);
  color: #111;
}
body[data-stage-bg="white"] .stage-toolbar__bg {
  background: rgba(255,255,255,0.85);
  border-color: rgba(0,0,0,0.12);
}
body[data-stage-bg="white"] .stage-toolbar__bg button { color: #444; }
body[data-stage-bg="white"] .stage-toolbar__bg button.is-active {
  background: #111;
  color: #fff;
}
body[data-stage-bg="white"] .stage { background: #fff; }
body[data-stage-bg="black"] .stage { background: #000; }
