/* 《未经授意》—— 群青托住空间，象牙白显现起伏与受力，朱红只留下一丝线索 */

:root {
  --ultra: #101a44;
  --ultra-deep: #070c22;
  --ultra-soft: #1b2a6b;
  --ivory: #f2ece0;
  --ivory-dim: #cfc7b6;
  --vermilion: #d0432c;
  --hair: rgba(242, 236, 224, 0.14);
  --serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "Times New Roman", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--ultra-deep);
  color: var(--ivory);
  font-family: var(--sans);
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
}

body {
  background:
    radial-gradient(120% 80% at 50% 0%, #17235c 0%, var(--ultra) 42%, var(--ultra-deep) 100%);
  min-height: 100vh;
  line-height: 1.75;
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px calc(72px + env(safe-area-inset-bottom));
}

/* ---------- 通用排版 ---------- */
.eyebrow {
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ivory-dim);
  font-weight: 500;
}

.brand {
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.22em;
  color: var(--ivory);
}

.rule { height: 1px; background: var(--hair); margin: 0; border: 0; }

.lead {
  font-family: var(--serif);
  font-size: clamp(15px, 4.4vw, 18px);
  color: var(--ivory-dim);
  line-height: 1.9;
}

.quote {
  font-family: var(--serif);
  font-size: clamp(17px, 5vw, 21px);
  line-height: 1.7;
  margin: 0;
}

em { font-style: normal; color: var(--vermilion); }

/* ---------- 头部 ---------- */
header {
  padding: calc(28px + env(safe-area-inset-top)) 0 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  text-align: center;
}

header .tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--ivory-dim);
  border: 1px solid var(--hair);
  border-radius: 999px;
  padding: 5px 14px;
}

header .sub {
  font-size: 12px;
  letter-spacing: 0.12em;
  color: rgba(242, 236, 224, 0.55);
}

/* ---------- Hero ---------- */
.hero { padding: 26px 0 8px; text-align: center; }

.hero h1 {
  font-family: var(--serif);
  font-size: clamp(20px, 6.2vw, 42px);
  line-height: 1.35;
  margin: 14px 0 18px;
  font-weight: 500;
  letter-spacing: 0.01em;
  /* 「如果，你是一只大麦虫。」永不折行——整句作为一个问题被说出 */
  white-space: nowrap;
}
/* 极窄屏兜底：仍然不折行，改用轻微横向压缩保证整句完整 */
@media (max-width: 330px) {
  .hero h1 { font-size: 18px; letter-spacing: -0.01em; }
}

.hero .note {
  font-size: 12px;
  letter-spacing: 0.14em;
  color: rgba(242, 236, 224, 0.45);
  margin-top: 16px;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 14px 30px;
  border: 1px solid rgba(242, 236, 224, 0.35);
  border-radius: 2px;
  background: transparent;
  color: var(--ivory);
  font-family: var(--serif);
  font-size: 16px;
  letter-spacing: 0.14em;
  cursor: pointer;
  transition: background 0.25s, border-color 0.25s, color 0.25s;
  width: 100%;
  max-width: 320px;
}

.btn:hover:not(:disabled) { background: rgba(242, 236, 224, 0.08); }

.btn.primary {
  background: var(--ivory);
  color: var(--ultra-deep);
  border-color: var(--ivory);
}

.btn.primary:hover:not(:disabled) { background: #fff; }

.btn:disabled { opacity: 0.35; cursor: default; }

.btn.sm { min-height: 44px; padding: 10px 20px; font-size: 14px; }

.btn.ghost {
  border-color: rgba(196, 62, 45, 0.65);
  color: rgba(242, 236, 224, 0.82);
  max-width: 320px;
}
.btn.ghost:hover:not(:disabled) {
  background: rgba(196, 62, 45, 0.14);
  border-color: rgba(196, 62, 45, 0.95);
}
.btn.sound {
  max-width: 320px;
  min-height: 44px;
  padding: 10px 20px;
  font-size: 13.5px;
  letter-spacing: 0.1em;
  border-color: rgba(242, 236, 224, 0.28);
  color: rgba(242, 236, 224, 0.75);
}
.btn.sound.on {
  border-color: rgba(122, 196, 154, 0.7);
  color: rgba(122, 196, 154, 0.95);
}
.btn.sound:hover:not(:disabled) { background: rgba(242, 236, 224, 0.08); }

.stop-note {
  margin: 12px auto 0;
  max-width: 320px;
  font-size: 11.5px;
  line-height: 1.8;
  color: rgba(242, 236, 224, 0.42);
}

/* ---------- 体验场域 ---------- */
.field {
  margin: 30px 0 8px;
  border: 1px solid var(--hair);
  background: linear-gradient(180deg, rgba(27, 42, 107, 0.5), rgba(7, 12, 34, 0.6));
  padding: 18px 16px 16px;
}

.field-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.field-title {
  font-size: 11px;
  letter-spacing: 0.24em;
  color: var(--ivory-dim);
}

.field-status { font-size: 12px; color: rgba(242, 236, 224, 0.5); }

.stage-box {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 62vh;
  border: 1px solid rgba(242, 236, 224, 0.2);
  overflow: hidden;
  background: #0a1130;
  touch-action: none;
  user-select: none;
}

.stage-box canvas { display: block; width: 100%; height: 100%; }

.stage-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
  padding: 24px;
  background: rgba(7, 12, 34, 0.72);
  backdrop-filter: blur(3px);
  transition: opacity 0.4s;
}

.stage-overlay.hidden { opacity: 0; pointer-events: none; }

.stage-overlay .quote { margin-bottom: 4px; }

.stage-overlay .hint {
  font-size: 12px;
  letter-spacing: 0.1em;
  color: rgba(242, 236, 224, 0.5);
}

.timer {
  position: absolute;
  top: 12px;
  right: 14px;
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.1em;
  color: var(--ivory-dim);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.timer.urgent { color: var(--vermilion); }

.field-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: rgba(242, 236, 224, 0.42);
}

.field-foot .live { font-variant-numeric: tabular-nums; }

/* ---------- 三步 ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 34px 0 8px;
}

.step { border-top: 1px solid var(--hair); padding-top: 12px; }

.step .n {
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--vermilion);
}

.step h3 {
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 500;
  margin: 8px 0 4px;
  letter-spacing: 0.04em;
}

.step p { margin: 0; font-size: 11.5px; color: rgba(242, 236, 224, 0.5); line-height: 1.7; }

@media (max-width: 480px) {
  .steps { grid-template-columns: 1fr; gap: 0; }
  .step { padding: 12px 0; border-top: 1px solid var(--hair); }
}

/* ---------- 区块 ---------- */
section { padding: 40px 0; }
section + section { border-top: 1px solid var(--hair); }

.section-head { margin-bottom: 22px; }
.section-head .eyebrow { display: block; margin-bottom: 10px; }
.section-head h2 {
  font-family: var(--serif);
  font-size: clamp(19px, 5.6vw, 26px);
  font-weight: 500;
  margin: 0;
  letter-spacing: 0.03em;
}

/* ---------- 结果：影像 + 声音 ---------- */
.result-grid { display: grid; gap: 20px; }

.art-frame {
  border: 1px solid var(--hair);
  background: #0a1130;
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

.art-frame canvas { display: block; width: 100%; height: 100%; }

.art-caption {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: rgba(242, 236, 224, 0.45);
}

.work-title {
  font-family: var(--serif);
  font-size: 17px;
  color: var(--ivory);
  letter-spacing: 0.04em;
}

.readout {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 4px;
}

.readout div { border-top: 1px solid var(--hair); padding-top: 8px; }
.readout .k { font-size: 10px; letter-spacing: 0.14em; color: rgba(242, 236, 224, 0.4); }
.readout .v {
  font-family: var(--serif);
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}

.audio-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.audio-row .btn { width: auto; flex: 1 1 150px; max-width: none; }
.audio-hint {
  margin-top: 12px;
  font-size: 11.5px;
  line-height: 1.8;
  color: rgba(242, 236, 224, 0.62);
  border-left: 2px solid rgba(196, 62, 45, 0.7);
  padding-left: 10px;
}

/* ---------- 表单 ---------- */
label.form-label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--ivory-dim);
  margin-bottom: 10px;
}

textarea {
  width: 100%;
  min-height: 96px;
  padding: 14px;
  background: rgba(242, 236, 224, 0.05);
  border: 1px solid var(--hair);
  border-radius: 2px;
  color: var(--ivory);
  font-family: var(--serif);
  font-size: 16px; /* 16px 起，避免 iOS 聚焦缩放 */
  line-height: 1.8;
  resize: vertical;
}

textarea:focus { outline: none; border-color: rgba(242, 236, 224, 0.4); }
textarea::placeholder { color: rgba(242, 236, 224, 0.28); }

.stance-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0 20px; }

.chip {
  flex: 1 1 auto;
  min-height: 46px;
  padding: 11px 14px;
  border: 1px solid var(--hair);
  border-radius: 2px;
  background: transparent;
  color: var(--ivory-dim);
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: all 0.2s;
}

.chip[aria-pressed="true"] {
  border-color: var(--ivory);
  color: var(--ultra-deep);
  background: var(--ivory);
}

.form-note { font-size: 11.5px; color: rgba(242, 236, 224, 0.42); margin-top: 12px; line-height: 1.8; }

/* ---------- 打卡回执 ---------- */
.receipt {
  border: 1px solid var(--vermilion);
  background: rgba(208, 67, 44, 0.08);
  padding: 18px;
  margin-top: 22px;
}

.receipt .no {
  font-family: var(--serif);
  font-size: 26px;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}

.receipt .lbl { font-size: 11px; letter-spacing: 0.2em; color: var(--ivory-dim); }
.receipt .done { font-size: 12.5px; color: rgba(242, 236, 224, 0.6); margin-top: 8px; line-height: 1.8; }

/* ---------- 共同作品 ---------- */
.collective {
  position: relative;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--hair);
  background: #0a1130;
  overflow: hidden;
}

.collective canvas { display: block; width: 100%; height: 100%; }

.coll-audio {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.coll-meta {
  margin: 0;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: rgba(242, 236, 224, 0.5);
  text-align: center;
  line-height: 1.8;
}

.counter {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 20px 0 6px;
}

.counter .big {
  font-family: var(--serif);
  font-size: clamp(38px, 12vw, 58px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.counter .unit { font-size: 12px; letter-spacing: 0.18em; color: var(--ivory-dim); }

.stance-bar { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11.5px; color: rgba(242, 236, 224, 0.5); margin-top: 6px; }
.stance-bar span b { color: var(--ivory); font-weight: 500; font-family: var(--serif); }

.echoes { margin-top: 26px; display: grid; gap: 0; }

.echo {
  border-top: 1px solid var(--hair);
  padding: 14px 0;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.echo .idx {
  font-family: var(--serif);
  font-size: 11px;
  color: var(--vermilion);
  letter-spacing: 0.1em;
  padding-top: 3px;
  flex: 0 0 auto;
}

.echo .txt { font-family: var(--serif); font-size: 14.5px; line-height: 1.85; margin: 0; }
.echo .meta { font-size: 11px; color: rgba(242, 236, 224, 0.35); margin-top: 5px; letter-spacing: 0.08em; }

.empty { font-size: 13px; color: rgba(242, 236, 224, 0.4); padding: 16px 0; }

/* ---------- 关于 ---------- */
.about p { font-family: var(--serif); font-size: 14.5px; line-height: 2; color: rgba(242, 236, 224, 0.72); margin: 0 0 16px; }

.about .disclaimer {
  border-left: 2px solid var(--vermilion);
  padding-left: 14px;
  font-size: 13px;
  color: rgba(242, 236, 224, 0.55);
}

footer {
  padding: 40px 0 20px;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: rgba(242, 236, 224, 0.32);
}

.hidden { display: none !important; }

.spin {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 1px solid rgba(242, 236, 224, 0.25);
  border-top-color: var(--ivory);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  vertical-align: -2px;
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
