:root {
  --bg: #edf3fb;
  --bg-accent: #dfe9f8;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-strong: #ffffff;
  --line: rgba(116, 137, 170, 0.18);
  --text: #162033;
  --muted: #7d8798;
  --accent: #1287f4;
  --accent-2: #27b8ff;
  --good: #1f6b49;
  --warn: #8c640b;
  --bad: #9b3843;
  --shadow: 0 30px 70px rgba(37, 75, 137, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
}

body {
  color: var(--text);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 10% 15%, rgba(39, 184, 255, 0.12), transparent 24%),
    radial-gradient(circle at 90% 5%, rgba(18, 135, 244, 0.12), transparent 28%),
    linear-gradient(180deg, #f7faff 0%, var(--bg) 100%);
}

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

.shell {
  height: 100vh;
  height: 100dvh;
  padding: 0;
}

.stage {
  height: 100vh;
  height: 100dvh;
  border-radius: 0;
  padding: 28px 32px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 251, 255, 0.88));
  box-shadow: var(--shadow);
  border: 0;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.stage::before,
.stage::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.stage::before {
  width: 360px;
  height: 360px;
  right: -120px;
  top: -140px;
  background: radial-gradient(circle, rgba(39, 184, 255, 0.16), transparent 70%);
}

.stage::after {
  width: 420px;
  height: 420px;
  left: -140px;
  bottom: -180px;
  background: radial-gradient(circle, rgba(18, 135, 244, 0.1), transparent 72%);
}

.topbar,
.view {
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex: 0 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  box-shadow: 0 16px 32px rgba(18, 135, 244, 0.25);
}

.brand-eyebrow,
.hero-kicker,
.drawer-kicker {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand h1,
.hero-copy h2,
.result-header h2,
.settings-header h2 {
  margin: 0;
}

.brand h1 {
  font-size: 22px;
}

.icon-button,
.ghost-button {
  border: 0;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, opacity 140ms ease;
}

.icon-button:hover,
.ghost-button:hover,
.record-button:hover {
  transform: translateY(-1px);
}

.icon-button {
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  box-shadow: 0 14px 28px rgba(40, 69, 117, 0.1);
}

.ghost-lite {
  background: rgba(240, 246, 255, 0.95);
}

.view {
  flex: 1 1 auto;
  min-height: 0;
  display: none;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.view.view-active {
  display: flex;
}

.hero-card,
.result-card {
  width: min(980px, 100%);
}

.hero-card {
  width: min(1040px, 100%);
  height: 100%;
  display: grid;
  align-content: center;
  gap: 24px;
  justify-items: center;
  text-align: center;
}

.hint-text {
  margin: 0;
  color: var(--muted);
}

.prompt-card {
  width: min(1040px, 100%);
  padding: 22px 24px;
  text-align: left;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: 0 20px 45px rgba(34, 62, 110, 0.08);
}

.prompt-card label,
.field label {
  display: block;
  margin-bottom: 12px;
  color: #647287;
  font-size: 14px;
}

textarea,
input,
select {
  width: 100%;
  border: 1px solid rgba(126, 148, 184, 0.22);
  border-radius: 18px;
  background: rgba(248, 251, 255, 0.88);
  color: var(--text);
  padding: 14px 16px;
  outline: none;
}

textarea:focus,
input:focus,
select:focus {
  border-color: rgba(18, 135, 244, 0.4);
  box-shadow: 0 0 0 4px rgba(18, 135, 244, 0.08);
}

textarea {
  min-height: 118px;
  resize: vertical;
  line-height: 1.8;
}

.recording-zone {
  display: grid;
  justify-items: center;
  gap: 16px;
}

.record-button {
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  transition: transform 140ms ease;
}

.record-button-core {
  display: grid;
  place-items: center;
  width: 176px;
  height: 176px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  box-shadow:
    0 20px 44px rgba(18, 135, 244, 0.28),
    inset 0 -12px 24px rgba(255, 255, 255, 0.08);
}

.record-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.mic-icon {
  position: relative;
  width: 28px;
  height: 56px;
  border: 8px solid #fff;
  border-bottom: 0;
  border-radius: 18px 18px 12px 12px;
}

.mic-icon::before,
.mic-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.mic-icon::before {
  width: 42px;
  height: 24px;
  bottom: -18px;
  border: 6px solid #fff;
  border-top: 0;
  border-radius: 0 0 24px 24px;
}

.mic-icon::after {
  width: 6px;
  height: 24px;
  bottom: -42px;
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 18px 0 0 #fff;
}

.ghost-button {
  min-width: 168px;
  padding: 13px 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
  box-shadow: 0 14px 28px rgba(40, 69, 117, 0.1);
}

.ghost-button:disabled,
.icon-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.hint-text {
  min-height: 28px;
  font-size: 15px;
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.status-chip,
.metric-card,
.result-panel {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  box-shadow: 0 16px 38px rgba(41, 74, 126, 0.08);
}

.status-chip {
  min-width: 180px;
  padding: 14px 18px;
  border-radius: 18px;
}

.status-chip span,
.metric-card span,
.score-ring span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.status-chip strong {
  display: block;
  margin-top: 8px;
  font-size: 16px;
}

.result-card {
  height: 100%;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 18px;
  overflow: hidden;
}

.result-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.result-header h2 {
  font-size: clamp(28px, 3vw, 42px);
}

.score-hero {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 14px;
}

.score-ring {
  display: grid;
  place-items: center;
  min-height: 228px;
  border-radius: 28px;
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.95), rgba(246, 250, 255, 0.95) 58%, rgba(18, 135, 244, 0.12) 59%, rgba(39, 184, 255, 0.16) 70%, rgba(255, 255, 255, 0.95) 71%);
  border: 1px solid rgba(18, 135, 244, 0.15);
  box-shadow: 0 24px 54px rgba(18, 135, 244, 0.12);
}

.score-ring strong {
  margin-top: 10px;
  font-size: 64px;
  line-height: 1;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.metric-card,
.result-panel {
  border-radius: 26px;
}

.metric-card {
  min-height: 228px;
  padding: 24px 22px;
}

.metric-card strong {
  display: block;
  margin-top: 16px;
  font-size: 32px;
}

.result-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  min-height: 0;
}

.result-panel {
  min-height: 0;
  padding: 20px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.result-panel h3 {
  margin: 0 0 12px;
  font-size: 18px;
}

.feedback-list {
  display: grid;
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 10px;
  min-height: 0;
}

.feedback-list.empty {
  color: var(--muted);
}

.feedback-item {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(120, 144, 181, 0.12);
  background: rgba(247, 250, 255, 0.9);
  line-height: 1.55;
  overflow: hidden;
}

.feedback-item strong {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
}

.tone-good {
  color: var(--good);
}

.tone-warn {
  color: var(--warn);
}

.tone-bad {
  color: var(--bad);
}

.settings-panel[hidden] {
  display: none;
}

.settings-panel {
  position: fixed;
  inset: 0;
  z-index: 20;
}

.settings-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14, 24, 41, 0.26);
  backdrop-filter: blur(4px);
}

.settings-drawer {
  position: absolute;
  top: 16px;
  right: 16px;
  bottom: 16px;
  width: min(440px, calc(100vw - 32px));
  padding: 24px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 24px 64px rgba(25, 47, 88, 0.2);
  overflow: auto;
}

.settings-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.settings-grid {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.field.wide {
  grid-column: 1 / -1;
}

@media (max-width: 900px) {
  .stage {
    padding: 20px;
  }

  .score-hero,
  .result-sections,
  .score-grid,
  .result-header {
    grid-template-columns: 1fr;
  }

  .result-header {
    display: grid;
  }

  .score-ring {
    min-height: 220px;
  }

  .metric-card {
    min-height: 180px;
  }

  .feedback-list {
    grid-template-rows: none;
  }
}

@media (max-width: 640px) {
  .stage {
    padding: 18px 16px;
  }

  .topbar {
    align-items: flex-start;
  }

  .brand {
    align-items: flex-start;
  }

  .record-button-core {
    width: 148px;
    height: 148px;
  }

  .settings-drawer {
    inset: auto 0 0 0;
    width: 100%;
    max-height: 82vh;
    border-radius: 28px 28px 0 0;
  }
}
