:root {
  color-scheme: light;
  --paper: #f7f6f2;
  --paper-deep: #efeee8;
  --white: #ffffff;
  --ink: #151714;
  --muted: #72776f;
  --line: rgba(21, 23, 20, 0.14);
  --line-strong: rgba(21, 23, 20, 0.28);
  --orange: #f59e0b;
  --orange-deep: #d97706;
  --orange-soft: rgba(245, 158, 11, 0.12);
  --shadow: 0 24px 70px rgba(22, 31, 34, 0.11);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 1px 1px, rgba(21, 23, 20, 0.045) 0.8px, transparent 0.9px),
    var(--paper);
  background-size: 22px 22px, auto;
  color: var(--ink);
  font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
  color: inherit;
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(245, 158, 11, 0.42);
  outline-offset: 3px;
}

a {
  color: inherit;
  text-decoration: none;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--white);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header,
main,
.site-footer {
  width: min(1240px, calc(100% - 72px));
  margin-inline: auto;
}

.site-header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  border-bottom: 1px solid var(--line);
}

.chapter-mark {
  display: flex;
  align-items: center;
  font-family: Bahnschrift, "Arial Narrow", Arial, sans-serif;
  letter-spacing: 0.12em;
}

.chapter-mark strong {
  font-size: 14px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(18px, 3vw, 42px);
  font-size: 12px;
}

.site-nav a {
  position: relative;
  padding: 10px 0;
}

.site-nav a::after {
  position: absolute;
  right: 0;
  bottom: 3px;
  left: 0;
  height: 1px;
  content: "";
  background: var(--orange);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 220ms var(--ease);
}

.site-nav a:hover::after {
  transform: scaleX(1);
}

.lab-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: clamp(46px, 7vw, 96px);
  align-items: start;
  min-height: calc(100svh - 68px);
  padding: clamp(62px, 8vh, 88px) 0 54px;
}

.hero-copy {
  max-width: 820px;
  padding-top: 4px;
}

.eyebrow,
.module-code {
  margin: 0;
  color: var(--orange-deep);
  font-family: Bahnschrift, "Arial Narrow", Arial, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero-copy h1 {
  margin: 22px 0 24px;
  font-family: Bahnschrift, "Arial Narrow", Arial, sans-serif;
  font-size: clamp(58px, 8vw, 112px);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 0.82;
}

.hero-copy h1 span {
  display: block;
  font-size: 0.43em;
  letter-spacing: 0.09em;
  line-height: 1.25;
}

.hero-lead {
  max-width: 760px;
  margin: 38px 0 40px;
  font-family: "Noto Serif SC", "STSong", "SimSun", serif;
  font-size: clamp(23px, 2.45vw, 35px);
  line-height: 1.62;
}

.hero-lead::before {
  display: block;
  width: 64px;
  height: 2px;
  margin-bottom: 25px;
  content: "";
  background: var(--orange);
}

.scroll-cue {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.scroll-cue b {
  color: var(--orange-deep);
  font-size: 18px;
  animation: cue-bounce 1.8s ease-in-out infinite;
}

@keyframes cue-bounce {
  0%, 100% { transform: translateY(-2px); }
  50% { transform: translateY(4px); }
}

.gesture-module {
  width: 310px;
  justify-self: end;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.gesture-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
}

.module-code {
  font-size: 9px;
}

.gesture-head h2 {
  margin: 4px 0 0;
  font-size: 15px;
  font-weight: 700;
}

.gesture-badge {
  color: var(--orange-deep);
  font-family: Bahnschrift, "Arial Narrow", Arial, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1;
}

.gesture-visual {
  position: relative;
  overflow: visible;
}

.gesture-media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: #fff;
}

#gesture-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: scale(0.92);
}

.gesture-grid {
  position: absolute;
  inset: 0;
  opacity: 0.17;
  background-image:
    linear-gradient(rgba(21, 23, 20, 0.22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 23, 20, 0.22) 1px, transparent 1px);
  background-size: 25% 25%;
  pointer-events: none;
  mask-image: linear-gradient(to bottom, transparent 20%, #000 100%);
}

.gesture-state {
  position: static;
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 7px 9px;
  border-top: 1px solid var(--line);
  background: rgba(247, 246, 242, 0.96);
  font-family: Bahnschrift, "Arial Narrow", Arial, sans-serif;
  font-size: 10px;
  letter-spacing: 0.03em;
}

.state-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 3px rgba(114, 119, 111, 0.12);
}

.state-dot[data-state="active"] {
  background: var(--orange);
  box-shadow: 0 0 0 3px var(--orange-soft);
}

.state-dot[data-state="error"] {
  background: #b8412c;
  box-shadow: 0 0 0 3px rgba(184, 65, 44, 0.12);
}

.gesture-guide {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 8px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.gesture-guide b {
  color: var(--orange-deep);
  font-size: 10px;
}

.gesture-actions {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.camera-note {
  min-width: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
  overflow-wrap: anywhere;
  text-align: right;
}

#camera-feed {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.primary-button,
.brief-actions button {
  appearance: none;
  border: 0;
  border-radius: 0;
}

.primary-button {
  min-height: 46px;
  padding: 0 20px;
  background: var(--ink);
  color: var(--white);
  font-weight: 700;
  transition: background 180ms ease, transform 180ms ease;
}

.primary-button:hover {
  background: var(--orange-deep);
  transform: translateY(-1px);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.55;
  transform: none;
}

.compact-button {
  min-height: 34px;
  padding: 0 11px;
  font-size: 9px;
}

.lab-section {
  min-height: calc(100svh - 68px);
  padding: clamp(54px, 7vh, 72px) 0 54px;
  border-top: 1px solid var(--line-strong);
}

.section-heading {
  margin-bottom: 32px;
}

.section-heading h2 {
  margin: 6px 0 8px;
  font-family: Bahnschrift, "Arial Narrow", Arial, sans-serif;
  font-size: clamp(31px, 4vw, 54px);
  letter-spacing: -0.035em;
}

.collaboration-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(360px, 0.88fr);
  gap: clamp(38px, 6vw, 78px);
  align-items: start;
}

.collaboration-form {
  display: grid;
  gap: 15px;
  padding-top: 18px;
  border-top: 1px solid var(--line-strong);
}

.collaboration-form label {
  display: grid;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
}

.collaboration-form input,
.collaboration-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.58);
  color: var(--ink);
  transition: border-color 160ms ease, background 160ms ease;
}

.collaboration-form input:hover,
.collaboration-form textarea:hover,
.collaboration-form input:focus,
.collaboration-form textarea:focus {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.82);
}

.collaboration-form input {
  min-height: 46px;
  padding: 0 13px;
  font-size: 14px;
}

.collaboration-form textarea {
  min-height: 84px;
  padding: 12px 13px;
  resize: vertical;
  font-size: 14px;
  line-height: 1.6;
}

.collaboration-form .idea-field textarea {
  min-height: 126px;
}

.honeypot {
  position: absolute;
  left: -10000px;
  width: 1px !important;
  height: 1px;
  opacity: 0;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 3px;
}

#collaboration-status {
  color: var(--muted);
  font-size: 12px;
}

#collaboration-status[data-state="success"] {
  color: #417353;
}

#collaboration-status[data-state="error"] {
  color: #b8412c;
}

.brief-card {
  position: relative;
  min-height: 620px;
  padding: 28px 76px 26px 28px;
  overflow: hidden;
  border: 0;
  background: var(--ink);
  color: #f7f1e5;
  box-shadow: 0 28px 58px rgba(21, 23, 20, 0.2);
}

.brief-rail {
  position: absolute;
  z-index: 1;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  width: 58px;
  align-items: center;
  justify-content: center;
  padding: 20px 0;
  background: var(--orange);
  color: var(--ink);
  font-family: Bahnschrift, "Arial Narrow", Arial, sans-serif;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-orientation: mixed;
  writing-mode: vertical-rl;
}

.brief-rail::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -48px;
  width: 50px;
  content: "";
  background: var(--orange);
  clip-path: polygon(100% 0, 100% 100%, 42% 100%, 100% 83%, 100% 42%, 0 22%);
}

.brief-head {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(247, 241, 229, 0.55);
  color: var(--orange);
  font-family: Bahnschrift, "Arial Narrow", Arial, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.13em;
}

.brief-head strong {
  position: absolute;
  top: -2px;
  right: -64px;
  width: 52px;
  color: var(--ink);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-align: center;
}

.brief-card h3 {
  position: relative;
  z-index: 2;
  margin: 26px 0 10px;
  color: #f7f1e5;
  font-family: Bahnschrift, "Arial Narrow", Arial, sans-serif;
  font-size: clamp(74px, 7.5vw, 100px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 0.84;
}

.brief-intro {
  position: relative;
  z-index: 2;
  margin: 18px 0 20px;
  color: #f7f1e5;
  font-family: "Noto Serif SC", "STSong", "SimSun", serif;
  font-size: 18px;
}

.brief-intro::after {
  display: block;
  width: 20px;
  height: 2px;
  margin-top: 14px;
  content: "";
  background: var(--orange);
}

.brief-paper {
  position: relative;
  z-index: 2;
  background: #f7f1e5;
  color: var(--ink);
}

.brief-summary {
  min-height: 160px;
  margin: 0;
  padding: 18px 20px;
  color: #62655f;
  font-family: "Noto Serif SC", "STSong", "SimSun", serif;
  font-size: clamp(17px, 1.45vw, 20px);
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.brief-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid rgba(21, 23, 20, 0.48);
}

.brief-card dl > div {
  min-height: 88px;
  padding: 15px 18px;
}

.brief-card dl > div + div {
  border-left: 1px solid rgba(21, 23, 20, 0.48);
}

.brief-card dt {
  color: var(--orange-deep);
  font-family: Bahnschrift, "Arial Narrow", Arial, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
}

.brief-card dd {
  max-height: 54px;
  margin: 9px 0 0;
  overflow: auto;
  color: #62655f;
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.brief-actions {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 8px;
  margin-top: 18px;
}

.brief-actions button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 14px;
  background: var(--orange);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.brief-actions button:first-child {
  border: 1px solid rgba(247, 241, 229, 0.72);
  background: transparent;
  color: #f7f1e5;
}

.brief-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.34;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 58px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
}

.site-footer a:hover {
  color: var(--orange-deep);
}

@media (max-width: 900px) {
  .site-header,
  main,
  .site-footer {
    width: min(100% - 40px, 720px);
  }

  .lab-hero {
    grid-template-columns: minmax(0, 1fr) 285px;
    gap: 38px;
  }

  .gesture-module {
    width: 285px;
  }

  .collaboration-layout {
    grid-template-columns: minmax(0, 1fr) minmax(310px, 0.88fr);
    gap: 28px;
  }
}

@media (max-width: 760px) {
  .site-header,
  main,
  .site-footer {
    width: calc(100% - 32px);
  }

  .site-header {
    min-height: 58px;
  }

  .site-nav {
    gap: 18px;
  }

  .site-nav a:nth-child(2) {
    display: none;
  }

  .lab-hero {
    grid-template-columns: 1fr;
    gap: 22px;
    min-height: calc(100svh - 58px);
    padding: 38px 0 26px;
  }

  .hero-copy h1 {
    margin-top: 17px;
    font-size: clamp(50px, 16vw, 70px);
  }

  .hero-lead {
    margin: 28px 0 24px;
    font-size: clamp(20px, 6.2vw, 27px);
    line-height: 1.55;
  }

  .hero-lead::before {
    margin-bottom: 18px;
  }

  .scroll-cue {
    padding-top: 13px;
  }

  .gesture-module {
    width: min(100%, 276px);
    justify-self: end;
  }

  .lab-section {
    min-height: 0;
    padding: 32px 0 24px;
  }

  .section-heading {
    margin-bottom: 16px;
  }

  .section-heading h2 {
    margin-top: 4px;
    font-size: clamp(29px, 9vw, 38px);
  }

  .collaboration-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .collaboration-form {
    gap: 13px;
    padding-top: 14px;
  }

  .collaboration-form .idea-field textarea {
    min-height: 112px;
  }

  .brief-card {
    min-height: 0;
    padding: 24px 66px 22px 20px;
  }

  .brief-rail {
    width: 50px;
  }

  .brief-rail::before {
    left: -36px;
    width: 38px;
  }

  .brief-head strong {
    right: -57px;
    width: 45px;
    font-size: 7px;
  }

  .brief-card h3 {
    min-height: 0;
    margin: 20px 0 10px;
    font-size: 64px;
  }

  .brief-summary {
    min-height: 108px;
    padding: 16px;
  }

  .brief-card dl > div {
    min-height: 78px;
    padding: 12px;
  }

  .site-footer {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 7px 18px;
    padding: 16px 0 calc(16px + env(safe-area-inset-bottom));
  }

}

@media (max-width: 760px), (hover: none), (pointer: coarse) {
  .gesture-module {
    display: none;
  }
}

@media (max-width: 360px) {
  .site-header,
  main,
  .site-footer {
    width: calc(100% - 24px);
  }

  .site-nav {
    font-size: 11px;
  }

  .site-nav a:last-child {
    display: none;
  }

  .hero-copy h1 {
    font-size: 49px;
  }

  .form-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .form-actions .primary-button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
