:root {
  color-scheme: light;
  --paper: #f9f8f5;
  --ink: #211c28;
  --muted: #696371;
  --line: #e7e3e8;
  --accent: #653fc1;
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: wait; }
button:focus-visible, summary:focus-visible { outline: 3px solid #754bde; outline-offset: 3px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
.topbar { border-bottom: 1px solid #ebe7e5; background: #fcfbf8; }
.topbar-inner, .page { width: min(1120px, calc(100% - 80px)); margin: auto; }
.topbar-inner { height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 800; letter-spacing: .035em; }
.brand-mark { display: grid; place-items: center; border-radius: 10px; width: 32px; height: 32px; color: #fff; background: #292033; font-size: 21px; line-height: 1; }
.privacy { display: flex; gap: 7px; align-items: center; color: #625b69; font-size: 12px; white-space: nowrap; }
.shield { display: grid; place-items: center; width: 14px; height: 15px; border: 1px solid #82788c; border-radius: 4px 4px 7px 7px; font-size: 9px; font-weight: 800; }
.page { padding-top: 41px; }
.intro { margin-bottom: 27px; }
.eyebrow { display: flex; align-items: center; gap: 9px; color: #6846ae; font-size: 11px; font-weight: 750; letter-spacing: .12em; }
.eyebrow > span { height: 2px; width: 16px; background: #9068e8; }
h1 { margin: 12px 0 10px; font-size: clamp(34px, 4.1vw, 58px); line-height: 1.15; letter-spacing: -.055em; font-weight: 850; }
h1 span { color: #8960e2; }
.intro-copy { color: var(--muted); font-size: 15px; line-height: 1.6; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 320px; align-items: start; gap: 18px; }
.stage-card, .control-card { overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: #fff; box-shadow: 0 3px 11px #31244906; }
.stage { position: relative; height: 366px; overflow: hidden; background: radial-gradient(ellipse at 50% 43%, #fbf8ff 0, #eee6ff 60%, #e8dcfc 100%); }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage-top { position: absolute; inset: 17px 19px auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; z-index: 1; pointer-events: none; }
.stage-top h2, .stage-state { display: flex; gap: 7px; align-items: center; padding: 7px 11px; border-radius: 30px; border: 1px solid #ffffffd9; background: #ffffffaa; font-size: 12px; font-weight: 700; color: #453457; white-space: nowrap; }
.stage-top h2 span { color: #6c46b5; font-size: 16px; line-height: 12px; }
.stage-state i, .camera-status i, .live-indicator i { width: 6px; height: 6px; border-radius: 100%; background: var(--state-color, #9b77e8); }
.touch-target { position: absolute; top: 12%; bottom: 16%; left: 50%; width: min(350px, 83%); transform: translateX(-50%); background: transparent; border: 0; border-radius: 42%; touch-action: manipulation; }
.touch-target:focus-visible { outline-offset: -4px; }
.stage-bottom { position: absolute; bottom: 14px; left: 12px; right: 12px; display: grid; justify-items: center; gap: 7px; pointer-events: none; }
.stage-caption { color: #4f3a65; background: #ffffffb5; border: 1px solid #ffffffdc; border-radius: 32px; padding: 7px 14px; font-size: 12px; font-weight: 650; text-align: center; }
.progress-track { width: 125px; height: 4px; border-radius: 5px; background: #fff9; overflow: hidden; }
.progress-track > div { height: 100%; background: #7752c6; border-radius: inherit; transform: scaleX(0); transform-origin: left; }
.stage-meta { height: 45px; padding: 0 19px; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #665d73; font-size: 12px; }
.stage-meta-icon { color: #8b63db; font-size: 17px; vertical-align: -1px; margin-right: 4px; }
.stage-meta > :last-child { font-size: 10px; letter-spacing: .13em; font-weight: 700; }
.control-card { padding: 17px 17px 10px; min-height: 413px; }
.control-heading, .emotion-heading { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.control-heading h2, .interaction-heading h2 { font-size: 18px; font-weight: 800; letter-spacing: -.035em; }
.camera-status { display: flex; gap: 6px; align-items: center; border-radius: 30px; background: #f3eff6; padding: 5px 8px; font-size: 10px; color: #62586e; white-space: nowrap; }
.camera-status i { background: #968a9e; }
.camera-status[data-status="running"] i { background: #318360; }
.camera-status[data-status="starting"] i { background: #9a69dc; }
.camera-status[data-status="error"] i { background: #b14f69; }
.camera-view { position: relative; height: 128px; margin-top: 13px; overflow: hidden; isolation: isolate; border: 1px solid #eae1f6; border-radius: 12px; background: radial-gradient(ellipse at center, #f2ebfc, #eae0f7); color: #76648a; }
.camera-view video { display: none; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.camera-view[data-live="true"] video { display: block; }
.view-grid { position: absolute; inset: 0; background: linear-gradient(90deg,#a490bb19 1px,transparent 1px),linear-gradient(#a490bb19 1px,transparent 1px); background-size: 21px 21px; mask-image: radial-gradient(ellipse at center, black, transparent 90%); }
.viewfinder { position: absolute; top: 50%; left: 50%; width: 104px; height: 70px; transform: translate(-50%, -50%); }
.viewfinder b { position: absolute; width: 12px; height: 12px; border-style: solid; border-color: #ab93ce; border-width: 0; }
.viewfinder b:nth-child(1) { top: 0; left: 0; border-width: 1px 0 0 1px; border-radius: 4px 0 0 0; }
.viewfinder b:nth-child(2) { top: 0; right: 0; border-width: 1px 1px 0 0; border-radius: 0 4px 0 0; }
.viewfinder b:nth-child(3) { bottom: 0; right: 0; border-width: 0 1px 1px 0; border-radius: 0 0 4px 0; }
.viewfinder b:nth-child(4) { bottom: 0; left: 0; border-width: 0 0 1px 1px; border-radius: 0 0 0 4px; }
.camera-view[data-live="true"] .viewfinder b { border-color: #fff; }
.camera-placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; font-size: 10px; }
.camera-view[data-live="true"] .camera-placeholder, .camera-view[data-live="true"] .view-grid { display: none; }
.camera-icon { position: relative; display: inline-block; width: 15px; height: 11px; margin-right: 4px; border: 1.4px solid currentColor; border-radius: 3px; }
.camera-icon::after { content: ""; position: absolute; left: 100%; top: 2px; width: 5px; height: 5px; border: 1.4px solid currentColor; border-left: 0; border-radius: 0 1px 1px 0; transform: skewY(-12deg); }
.live-indicator { position: absolute; display: none; gap: 5px; align-items: center; top: 7px; left: 8px; background: #24192cba; color: #fff; border-radius: 6px; padding: 4px 5px; font-size: 9px; font-weight: 750; letter-spacing: .09em; }
.live-indicator i { background: #98f5b9; }
.camera-view[data-live="true"] .live-indicator { display: flex; }
.camera-toggle { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 41px; margin-top: 10px; border-radius: 10px; border: 1px solid #292136; background: #292136; color: #fff; font-size: 13px; font-weight: 700; }
.camera-toggle:hover { background: #493360; }
.camera-toggle:disabled { opacity: .68; }
.camera-help { margin: 7px 0 13px; min-height: 17px; font-size: 11px; line-height: 1.5; color: #6b6374; }
.emotion-heading { border-top: 1px solid #ede9f0; padding-top: 12px; margin-bottom: 8px; }
.emotion-heading h3 { color: #494151; font-size: 12px; }
#emotion-score { color: #6b6374; font-size: 11px; }
.emotion-readout { display: flex; align-items: center; gap: 8px; color: #574a63; border: 1px solid #ece5f2; border-radius: 10px; background: #f8f5fb; padding: 9px 11px; font-size: 12px; font-weight: 700; }
.emotion-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--state-color, #a99db6); box-shadow: 0 0 0 3px #977bb11c; }
.demo { margin-top: 4px; }
.demo summary { display: flex; align-items: center; justify-content: space-between; padding: 9px 2px; color: #6944af; font-size: 12px; font-weight: 650; list-style: none; cursor: pointer; }
.demo summary::-webkit-details-marker { display: none; }
.demo summary:hover { color: #442777; }
.chevron { width: 6px; height: 6px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); margin-right: 4px; margin-bottom: 3px; }
.demo[open] .chevron { transform: rotate(225deg); margin-bottom: -3px; }
.demo-options { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 4px; }
.demo-options button { border: 1px solid #e7ddf3; border-radius: 20px; background: #faf7fd; color: #563879; padding: 6px 9px; font-size: 11px; }
.demo-options button:hover, .demo-options button[aria-pressed="true"] { background: #eaddff; border-color: #aa87e8; }
.interactions { margin-top: 23px; }
.interaction-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 7px 12px; margin-bottom: 12px; }
.interaction-heading p { color: var(--muted); font-size: 12px; }
.mode-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.mode { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 75px; border: 1px solid var(--line); border-radius: 14px; padding: 11px 13px; background: #fff; text-align: left; transition: background .18s, border-color .18s, transform .18s; }
.mode:hover { transform: translateY(-2px); border-color: #bca6dc; }
.mode[data-active="true"] { background: #f6f0ff; border-color: #a685d9; }
.mode-icon { display: grid; place-items: center; flex: 0 0 41px; height: 41px; background: #e9f4f1; color: #347963; border-radius: 10px; font-size: 26px; line-height: 1; }
.mode-comfort .mode-icon { background: #f9eaf2; color: #a54d7a; }
.mode-cheer .mode-icon { background: #f6eddb; color: #8d5a28; }
.mode-copy { display: grid; gap: 4px; }
.mode-copy strong { font-size: 13px; }
.mode-copy small { color: #6b6374; font-size: 11px; }
.mode-arrow { margin-left: auto; align-self: flex-start; color: #81718d; font-size: 15px; }
footer { display: flex; justify-content: space-between; gap: 14px; padding: 15px 0 18px; margin-top: 24px; border-top: 1px solid #ebe7e5; color: #6b6374; font-size: 11px; }
footer span:first-child { font-weight: 700; white-space: nowrap; }
@media (min-width: 1500px) {
  .page { padding-top: 55px; }
  .intro { margin-bottom: 33px; }
  .stage { height: 400px; }
  .control-card { min-height: 447px; }
  .camera-view { height: 158px; }
}
@media (max-width: 950px) {
  .topbar-inner, .page { width: calc(100% - 48px); }
  .workspace { grid-template-columns: minmax(0, 1fr) 285px; gap: 12px; }
}
@media (max-width: 680px) {
  .topbar-inner, .page { width: calc(100% - 28px); }
  .topbar-inner { height: 56px; }
  .page { padding-top: 27px; }
  .intro { margin-bottom: 18px; }
  .intro-copy { font-size: 13px; }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .stage { height: clamp(265px, 75vw, 350px); }
  .stage-top { inset: 12px 12px auto; }
  .control-card { min-height: 0; }
  .camera-view { height: 136px; }
  .mode-grid { grid-template-columns: 1fr; gap: 8px; }
  .mode { min-height: 58px; padding: 8px 11px; }
  footer { margin-top: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  .mode:hover { transform: none; }
}
