:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
  color: #1c1b17;
  background: #f8d761;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; }
button { font: inherit; cursor: pointer; }

.app {
  min-height: 100dvh;
  background: #f8d761;
}

.brand-mark {
  position: fixed;
  top: 10px;
  left: 50%;
  z-index: 1;
  width: 80px;
  height: 60px;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  padding-top: 8px;
  transform: translateX(-50%);
  color: #1c1b17;
  font-synthesis: weight;
  line-height: 1;
  white-space: nowrap;
}
.brand-mark span { font-size: 40px; font-weight: 800; }

.stage {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 52px 20px 36px;
}

.feedback-visual {
  display: block;
  width: min(64dvh, 500px, calc(100vw - 40px));
  height: auto;
  overflow: visible;
}

.vowel-shape {
  fill: none;
  stroke: #6b7e78;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.reference-shape { fill: none; stroke: #1c1b17; stroke-width: 8; }
.actual-pitch-dot { fill: #6b7e78; transition: cy .12s; }
.pitch-dot { fill: #1c1b17; }

.record-area { min-height: 121px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.record-button {
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  border: 2.67px solid #8d7949;
  border-radius: 50%;
  background: transparent;
  padding: 0;
  transition: transform .15s, border-color .15s;
}
.record-button:hover { transform: scale(1.04); border-color: #4c442d; }
.record-button:focus-visible, .corner-button:focus-visible { outline: 3px solid #1c1b17; outline-offset: 3px; }
.record-button:disabled { cursor: wait; opacity: .6; }
.record-icon {
  display: block;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #9a5a18;
  transition: width .15s, height .15s, border-radius .15s;
}
.record-button.recording .record-icon { width: 26px; height: 26px; border-radius: 4px; }
.record-hint { margin: 0; color: #292719; font-family: "PingFang SC", "Heiti SC", "Microsoft YaHei", sans-serif; font-size: 14px; font-weight: 700; text-align: center; line-height: 1.4; }
.demo-hint { margin: 4px 0 0; font-size: 12px; text-align: center; line-height: 1.4; }

.corner-button {
  position: fixed;
  top: 20px;
  z-index: 3;
  width: 44px;
  height: 44px;
  border: 2.67px solid #a18d5a;
  border-radius: 50%;
  background: transparent;
  color: #4c442d;
}
.corner-button:hover { border-color: #4c442d; color: #1c1b17; }
.corner-button:disabled { cursor: wait; opacity: .45; }
.reset-button { left: 22px; display: grid; place-items: center; }
.reset-button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.help-button {
  right: 22px;
  font-size: 20px;
  font-weight: 500;
}
.help-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 2;
  width: min(320px, calc(100vw - 40px));
  max-height: calc(100dvh - 140px);
  overflow-y: auto;
  transform: translate(-50%, -50%);
  padding: 19px 20px;
  border: 1px solid #c6ac4d;
  border-radius: 12px;
  background: #fff5d8;
  box-shadow: 0 12px 35px rgb(74 55 13 / 18%);
  font-size: 12px;
  line-height: 1.55;
  color: #4e482e;
}
.help-panel[hidden] { display: none; }
.help-panel h1 { margin: 0 0 10px; color: #1c1b17; font-size: 16px; font-weight: 650; }
.help-panel p { margin: 0; }
.help-panel dl { margin: 14px 0; }
.help-panel dt { margin-top: 10px; color: #1c1b17; font-weight: 650; }
.help-panel dd { margin: 2px 0 0; }
.help-panel .help-note { padding-top: 12px; border-top: 1px solid #eee5c9; }

@media (max-height: 600px) {
  .feedback-visual { width: min(62dvh, 420px, calc(100vw - 40px)); }
  .stage { padding: 40px 16px 20px; }
}

@media (max-width: 700px) {
  .stage { gap: 24px; padding: 60px 20px max(28px, env(safe-area-inset-bottom)); }
  .brand-mark { top: 8px; }
  .reset-button { top: 16px; left: 16px; }
  .help-button { top: 16px; right: 16px; }
}

@media (max-height: 500px) and (orientation: landscape) {
  .stage { flex-direction: row; gap: 24px; padding: 16px 72px 16px 20px; }
  .feedback-visual { width: min(78dvh, calc(100vw - 230px)); }
  .record-area { min-width: 150px; }
}
