:root {
  --bg: #05070c;
  --bg-soft: #0b1020;
  --panel: rgba(12, 16, 28, 0.78);
  --panel-soft: rgba(15, 21, 34, 0.92);
  --text: #f4efe6;
  --muted: rgba(244, 239, 230, 0.72);
  --gold: #f0c77c;
  --gold-soft: rgba(240, 199, 124, 0.14);
  --line: rgba(255, 255, 255, 0.08);
  --success: #5fd1a6;
  --danger: #ff8a7a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Noto Sans SC', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 18%, rgba(240, 199, 124, 0.12), transparent 24%),
    radial-gradient(circle at 82% 20%, rgba(96, 125, 182, 0.14), transparent 28%),
    linear-gradient(180deg, #04060a 0%, #080c14 45%, #05070c 100%);
}

.demo-page {
  width: min(calc(100% - 36px), 1360px);
  margin: 0 auto;
  padding: 28px 0 42px;
}

.eyebrow,
.panel-label {
  margin: 0 0 10px;
  color: var(--gold);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 12px;
}

.demo-hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 0 28px;
  align-items: flex-start;
}

.demo-hero h1 {
  margin: 0;
  font-family: 'Noto Serif SC', serif;
  font-size: clamp(2.8rem, 7vw, 5.8rem);
  line-height: 1;
}

.demo-hero h1 span {
  display: inline-block;
  margin-left: 12px;
  color: rgba(255, 255, 255, 0.4);
  font-size: clamp(1rem, 2vw, 1.4rem);
  letter-spacing: 0.38em;
  text-transform: uppercase;
  vertical-align: middle;
}

.subtitle {
  margin: 18px 0 10px;
  font-size: clamp(1.15rem, 2.2vw, 1.55rem);
  font-weight: 600;
}

.description {
  margin: 0;
  max-width: 780px;
  color: var(--muted);
  line-height: 1.85;
}

.demo-guide {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.demo-guide div {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
}

.demo-guide strong {
  color: var(--gold);
}

.demo-guide span {
  color: rgba(255, 255, 255, 0.86);
  line-height: 1.65;
}

.ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  border: 1px solid rgba(240, 199, 124, 0.22);
  background: rgba(255, 255, 255, 0.04);
}

.demo-layout {
  display: grid;
  grid-template-columns: 1.35fr 0.85fr;
  gap: 22px;
}

.panel {
  border-radius: 28px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)),
    var(--panel);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(16px);
}

.stage-panel,
.output-panel {
  padding: 22px;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-heading h2 {
  margin: 0;
  font-size: 1.48rem;
}

.status-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(95, 209, 166, 0.14);
  color: #d9ffef;
  border: 1px solid rgba(95, 209, 166, 0.22);
  font-size: 0.92rem;
}

.status-pill--soft {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.84);
  border-color: var(--line);
}

.camera-stage {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(17, 21, 33, 0.24), rgba(7, 10, 16, 0.8)),
    #070a10;
  border: 1px solid rgba(240, 199, 124, 0.12);
}

#input-video,
#overlay-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#input-video {
  object-fit: cover;
  transform: scaleX(-1);
  opacity: 0.96;
}

#overlay-canvas {
  pointer-events: none;
}

.stage-overlay {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  display: flex;
  justify-content: flex-start;
  pointer-events: none;
}

.stage-overlay__hint {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(8, 11, 17, 0.72);
  border: 1px solid rgba(240, 199, 124, 0.18);
  color: rgba(255, 248, 235, 0.92);
}

.control-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.btn {
  appearance: none;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border: 1px solid var(--line);
  cursor: pointer;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}

.btn:hover {
  transform: translateY(-2px);
  border-color: rgba(240, 199, 124, 0.28);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.22);
}

.btn--primary {
  background: linear-gradient(135deg, rgba(240, 199, 124, 0.95), rgba(196, 145, 56, 0.96));
  color: #16110a;
  font-weight: 700;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.tips-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.tip-card {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
}

.tip-card strong {
  display: block;
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.94);
}

.tip-card span {
  color: var(--muted);
  line-height: 1.7;
}

.artboard-wrap {
  border-radius: 22px;
  overflow: hidden;
  background:
    radial-gradient(circle at 24% 16%, rgba(240, 199, 124, 0.18), transparent 26%),
    linear-gradient(180deg, #efe4cd 0%, #eadcc0 100%);
  border: 1px solid rgba(162, 125, 56, 0.18);
}

#artboard-canvas {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 1 / 1;
}

.output-note {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
}

.output-note p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.info-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin-top: 22px;
}

.mini-card {
  padding: 20px 22px;
}

.mini-card h3 {
  margin: 0 0 14px;
  font-size: 1.16rem;
}

.mini-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.85;
}

@media (max-width: 1120px) {
  .demo-layout,
  .info-strip {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .demo-page {
    width: min(calc(100% - 20px), 1360px);
    padding-top: 18px;
  }

  .demo-hero {
    flex-direction: column;
  }

  .demo-guide,
  .tips-row {
    grid-template-columns: 1fr;
  }

  .stage-panel,
  .output-panel,
  .mini-card {
    padding: 16px;
  }

  .control-bar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
