:root {
  --mist: #edf4f2;
  --paper: #fbfdfc;
  --white: #ffffff;
  --ink: #17322e;
  --ink-soft: #33504b;
  --muted: #71847f;
  --line: #d7e4e0;
  --teal: #208b7d;
  --teal-deep: #126c61;
  --teal-pale: #d9eee9;
  --coral: #c9684f;
  --shadow: 0 30px 80px rgba(30, 71, 64, 0.11);
  --radius: 26px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--mist);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(90deg, transparent calc(50% - 1px), rgba(46, 104, 95, 0.05) 50%, transparent calc(50% + 1px)),
    var(--mist);
  font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
[role="button"]:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(32, 139, 125, 0.27);
  outline-offset: 4px;
}

.page-shell {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 28px 0 24px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: clamp(48px, 8vh, 96px);
}

.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
  font-family: Bahnschrift, "Arial Narrow", sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 1px solid rgba(32, 139, 125, 0.35);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
}

.brand-mark i {
  display: block;
  width: 2px;
  height: 8px;
  border-radius: 2px;
  background: var(--teal);
}

.brand-mark i:nth-child(2),
.brand-mark i:nth-child(4) { height: 13px; }
.brand-mark i:nth-child(3) { height: 18px; }

.system-status {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.03em;
}

.status-dot {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 5px rgba(32, 139, 125, 0.1);
}

main {
  display: grid;
  grid-template-columns: minmax(280px, 0.78fr) minmax(520px, 1.22fr);
  gap: clamp(44px, 7vw, 104px);
  align-items: start;
}

.intro {
  padding-top: 34px;
  position: sticky;
  top: 24px;
}

.eyebrow,
.section-label {
  margin: 0 0 18px;
  color: var(--teal-deep);
  font-family: Bahnschrift, "Arial Narrow", sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.intro h1 {
  margin: 0;
  font-family: STZhongsong, "Songti SC", SimSun, serif;
  font-size: clamp(42px, 5vw, 68px);
  font-weight: 500;
  line-height: 1.18;
  letter-spacing: -0.06em;
}

.intro h1 em {
  color: var(--teal);
  font-style: normal;
  position: relative;
}

.intro h1 em::after {
  content: "";
  position: absolute;
  left: 3px;
  right: -7px;
  bottom: 2px;
  height: 6px;
  border-bottom: 1px solid rgba(32, 139, 125, 0.43);
  border-radius: 50%;
  transform: rotate(-1.5deg);
}

.intro-copy {
  max-width: 390px;
  margin: 30px 0 0;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.9;
}

.process-line {
  display: flex;
  align-items: center;
  margin-top: 44px;
  color: #91a29e;
  font-size: 11px;
  white-space: nowrap;
}

.process-line span.active {
  color: var(--teal-deep);
  font-weight: 700;
}

.process-line i {
  width: clamp(16px, 2.5vw, 34px);
  height: 1px;
  margin: 0 10px;
  background: #cbdad6;
}

.workspace {
  padding: clamp(26px, 4vw, 44px);
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: var(--radius);
  background: rgba(251, 253, 252, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.workspace-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 25px;
}

.workspace-head .section-label {
  margin-bottom: 8px;
}

.workspace h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.04em;
}

.format-note {
  color: #8a9a96;
  font-family: Bahnschrift, sans-serif;
  font-size: 10px;
  letter-spacing: 0.08em;
}

.subject-form {
  margin-bottom: 24px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
}

.form-title,
.audio-label-row,
.result-waveform-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.form-title {
  margin-bottom: 15px;
  padding-bottom: 11px;
  border-bottom: 1px solid #edf2f1;
}

.form-title span,
.audio-label-row > span,
.result-waveform-head span {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}

.form-title small,
.audio-label-row small {
  color: var(--muted);
  font-size: 10px;
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field > span {
  color: var(--muted);
  font-size: 10px;
}

.input-shell {
  height: 43px;
  display: flex;
  align-items: center;
  border: 1px solid #dce7e4;
  border-radius: 10px;
  background: #f8fbfa;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.input-shell:focus-within {
  border-color: var(--teal);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(32, 139, 125, 0.1);
}

.input-shell input,
.input-shell select {
  min-width: 0;
  width: 100%;
  height: 100%;
  padding: 0 12px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
}

.input-shell input::placeholder { color: #a7b5b2; }
.input-shell b {
  padding-right: 11px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
}

.select-shell {
  position: relative;
}

.select-shell::after {
  content: "";
  position: absolute;
  right: 13px;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg) translateY(-2px);
  pointer-events: none;
}

.input-shell select {
  appearance: none;
  padding-right: 32px;
}

.audio-label-row {
  margin-bottom: 10px;
}

.drop-zone {
  position: relative;
  min-height: 236px;
  overflow: hidden;
  border: 1px dashed #b9cfca;
  border-radius: 19px;
  background: #f5f9f8;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.drop-zone:hover,
.drop-zone.dragging {
  border-color: var(--teal);
  background: #f0f8f6;
}

.drop-zone.dragging {
  transform: scale(1.008);
}

#waveform {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.4;
}

.drop-zone.has-file #waveform {
  opacity: 0.92;
}

.wave-scan {
  position: absolute;
  top: 25px;
  bottom: 25px;
  left: 50%;
  width: 1px;
  background: linear-gradient(transparent, rgba(32, 139, 125, 0.46), transparent);
  opacity: 0;
}

.drop-zone.has-file .wave-scan {
  opacity: 1;
}

.drop-copy {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 32px;
  text-align: center;
  transition: opacity 160ms ease;
}

.drop-zone.has-file .drop-copy {
  opacity: 0;
  pointer-events: none;
}

.upload-symbol {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  border-radius: 50%;
  background: var(--teal-pale);
  color: var(--teal-deep);
}

.upload-symbol svg {
  width: 22px;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.drop-copy strong {
  font-size: 15px;
  font-weight: 650;
}

.drop-copy > span:last-child {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.file-panel {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-top: 13px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
}

.play-button {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: white;
  cursor: pointer;
}

.play-button svg {
  width: 18px;
  fill: currentColor;
}

.pause-icon,
.play-button.playing .play-icon { display: none; }
.play-button.playing .pause-icon { display: block; }

.file-details {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.file-details strong {
  overflow: hidden;
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-details span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-family: Bahnschrift, sans-serif;
  font-size: 10px;
}

.file-details b { font-weight: 400; }
.file-details i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #adbfbb;
}

.replace-button {
  flex: 0 0 auto;
  padding: 8px 5px;
  border: 0;
  background: transparent;
  color: var(--teal-deep);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.detect-button {
  width: 100%;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  margin-top: 18px;
  border: 0;
  border-radius: 15px;
  background: var(--ink);
  color: white;
  font-size: 15px;
  font-weight: 650;
  cursor: pointer;
  box-shadow: 0 13px 28px rgba(23, 50, 46, 0.17);
  transition: transform 160ms ease, background 160ms ease, opacity 160ms ease;
}

.detect-button svg {
  width: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 160ms ease;
}

.detect-button:hover:not(:disabled) { background: #21423d; transform: translateY(-1px); }
.detect-button:hover:not(:disabled) svg { transform: translateX(3px); }
.detect-button:disabled { opacity: 0.32; cursor: not-allowed; box-shadow: none; }

.loading-panel {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 22px;
  padding: 22px;
  border-radius: 16px;
  background: var(--teal-pale);
}

.listening-orbit {
  position: relative;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
}

.listening-orbit i {
  position: absolute;
  inset: 0;
  border: 1px solid var(--teal);
  border-radius: 50%;
  animation: listen 1.8s ease-out infinite;
}

.listening-orbit i:nth-child(2) { animation-delay: 0.55s; }
.listening-orbit i:nth-child(3) { animation-delay: 1.1s; }

.loading-panel > div:last-child {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.loading-panel strong { font-size: 14px; }
.loading-panel span { color: var(--muted); font-size: 11px; }

@keyframes listen {
  0% { transform: scale(0.15); opacity: 0; }
  20% { opacity: 0.8; }
  100% { transform: scale(1); opacity: 0; }
}

.result-panel {
  margin-top: 22px;
  padding: 23px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: var(--white);
  animation: result-in 420ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes result-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.result-topline,
.result-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.result-topline > span {
  color: var(--teal-deep);
  font-weight: 700;
}

.result-topline b { font-family: Bahnschrift, sans-serif; font-weight: 400; }

.result-main {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 19px 0 20px;
}

.probability-ring {
  position: relative;
  width: 116px;
  height: 116px;
  flex: 0 0 auto;
}

.probability-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.probability-ring circle {
  fill: none;
  stroke-width: 7;
}

.ring-track { stroke: #e8f0ee; }
.ring-value {
  stroke: var(--teal);
  stroke-linecap: round;
  stroke-dasharray: 301.593;
  stroke-dashoffset: 301.593;
  transition: stroke-dashoffset 900ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.result-panel.risk .ring-value { stroke: var(--coral); }

.probability-ring > div {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: baseline;
  justify-content: center;
  padding-top: 39px;
  font-family: Bahnschrift, sans-serif;
}

.probability-ring strong { font-size: 29px; letter-spacing: -0.05em; }
.probability-ring span { margin-left: 2px; color: var(--muted); font-size: 12px; }

.result-copy { min-width: 0; }
.result-kicker { color: var(--muted); font-size: 10px; letter-spacing: 0.08em; }
.result-copy h3 {
  margin: 7px 0 7px;
  font-family: STZhongsong, "Songti SC", SimSun, serif;
  font-size: 22px;
  font-weight: 600;
}
.result-copy p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.7; }

.probability-list {
  display: grid;
  gap: 14px;
  padding: 18px 0;
  border-top: 1px solid #edf2f1;
  border-bottom: 1px solid #edf2f1;
}

.result-waveform-block {
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid #e5eeec;
  border-radius: 13px;
  background: #f7faf9;
}

.result-waveform-head {
  margin-bottom: 9px;
}

.result-waveform-head b {
  color: var(--muted);
  font-family: Bahnschrift, sans-serif;
  font-size: 9px;
  font-weight: 400;
}

.result-waveform-canvas {
  height: 70px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--white);
}

#resultWaveform {
  display: block;
  width: 100%;
  height: 100%;
}

.waveform-time-axis {
  display: flex;
  justify-content: space-between;
  padding-top: 6px;
  color: #8d9c99;
  font-family: Bahnschrift, sans-serif;
  font-size: 8px;
}

.probability-row > div {
  display: flex;
  justify-content: space-between;
  margin-bottom: 7px;
  color: var(--ink-soft);
  font-family: Bahnschrift, sans-serif;
  font-size: 11px;
}

.probability-row b { font-weight: 600; }
.probability-row > i {
  display: block;
  height: 4px;
  overflow: hidden;
  border-radius: 4px;
  background: #e9f0ee;
}
.probability-row em {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
  transition: width 850ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.probability-row:last-child em { background: var(--coral); }
.result-meta { padding-top: 14px; }

footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-top: 50px;
  padding-top: 20px;
  border-top: 1px solid rgba(57, 101, 94, 0.13);
  color: var(--muted);
  font-size: 10px;
}

footer p { margin: 0; }
footer p span { color: var(--coral); margin-right: 6px; }

.toast {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: 28px;
  width: min(440px, calc(100% - 32px));
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px 15px;
  border: 1px solid rgba(201, 104, 79, 0.18);
  border-radius: 14px;
  background: #fffaf8;
  color: #754335;
  box-shadow: 0 18px 50px rgba(70, 40, 32, 0.15);
  font-size: 12px;
  animation: toast-in 220ms ease-out both;
}

.toast svg { width: 19px; flex: 0 0 auto; fill: none; stroke: var(--coral); stroke-width: 1.7; stroke-linecap: round; }
.toast span { flex: 1; }
.toast button { border: 0; background: transparent; color: #997369; font-size: 20px; cursor: pointer; }

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

[hidden] { display: none !important; }

@media (max-width: 900px) {
  .site-header { margin-bottom: 50px; }
  main { grid-template-columns: 1fr; gap: 42px; }
  .intro { position: static; padding-top: 0; }
  .intro-copy { max-width: 560px; }
  .process-line { margin-top: 30px; }
}

@media (max-width: 580px) {
  .page-shell { width: min(100% - 28px, 520px); padding-top: 18px; }
  .site-header { margin-bottom: 38px; }
  .system-status span:last-child { display: none; }
  .intro h1 { font-size: 43px; }
  .intro-copy { margin-top: 22px; font-size: 14px; }
  .process-line { width: 100%; justify-content: space-between; }
  .process-line i { flex: 1; }
  .workspace { margin: 0 -4px; padding: 22px 17px; border-radius: 22px; }
  .workspace-head { align-items: flex-start; }
  .field-grid { grid-template-columns: 1fr; }
  .subject-form { padding: 15px; }
  .form-title { align-items: flex-start; }
  .format-note { max-width: 90px; text-align: right; line-height: 1.5; }
  .drop-zone { min-height: 210px; }
  .drop-copy { padding: 24px 18px; }
  .result-main { gap: 16px; }
  .probability-ring { width: 100px; height: 100px; }
  .probability-ring > div { padding-top: 32px; }
  .probability-ring strong { font-size: 26px; }
  .result-copy h3 { font-size: 19px; }
  footer { flex-direction: column; margin-top: 36px; line-height: 1.6; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Reference-platform layout: compact blue clinical dashboard */
body {
  background: #f4f7fb;
  color: #243746;
  font-family: "Microsoft YaHei UI", "PingFang SC", sans-serif;
}

.page-shell {
  width: 100%;
  padding: 0 0 36px;
}

.site-header {
  height: 58px;
  margin: 0 0 36px;
  padding: 0 max(28px, calc((100% - 1040px) / 2));
  background: #fff;
  border-bottom: 1px solid #e7edf4;
  box-shadow: 0 1px 4px rgba(36, 72, 108, 0.04);
}

.brand {
  gap: 9px;
  color: #0875dc;
  font-family: "Microsoft YaHei UI", sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
}

.brain-mark {
  width: 27px;
  height: 27px;
  display: inline-grid;
  place-items: center;
}

.brain-mark svg { width: 100%; height: 100%; }
.brain-mark path:nth-child(-n+2) { fill: #f15bb5; opacity: 0.88; }
.brain-mark path:last-child { stroke: #8a4fff; stroke-width: 1.1; stroke-linecap: round; }

.top-nav {
  display: flex;
  align-items: stretch;
  height: 100%;
  gap: 5px;
}

.top-nav a {
  display: flex;
  align-items: center;
  padding: 0 18px;
  border-radius: 0 0 8px 8px;
  color: #536473;
  text-decoration: none;
  font-size: 12px;
}

.top-nav a.active {
  background: #e6f2ff;
  color: #0875dc;
  font-weight: 700;
}

main {
  width: min(1040px, calc(100% - 36px));
  display: block;
  margin: 0 auto;
}

.intro {
  position: static;
  padding: 0;
  margin-bottom: 18px;
}

.intro .eyebrow,
.process-line { display: none; }

.intro h1 {
  margin: 0 0 6px;
  color: #096ec8;
  font-family: "Microsoft YaHei UI", sans-serif;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.02em;
}

.intro-copy {
  max-width: none;
  margin: 0;
  color: #94a2ae;
  font-size: 12px;
  line-height: 1.6;
}

.workspace {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.workspace-head { display: none; }

.subject-form,
.audio-card,
.result-panel {
  border: 0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(44, 73, 106, 0.07);
}

.subject-form {
  margin-bottom: 18px;
  padding: 20px 24px 22px;
}

.form-title {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-color: #e9eef4;
}

.form-title span,
.audio-label-row > span,
.result-waveform-head span {
  color: #344b5e;
  font-size: 12px;
}

.field > span { color: #738492; font-size: 11px; }
.field-grid { gap: 16px; }
.input-shell {
  height: 42px;
  border-color: #dce4ec;
  border-radius: 7px;
  background: #fbfcfe;
}
.input-shell:focus-within {
  border-color: #2589e7;
  box-shadow: 0 0 0 3px rgba(37, 137, 231, 0.09);
}
.input-shell input,
.input-shell select { color: #2e4252; font-size: 12px; }

.audio-card {
  padding: 20px 24px 24px;
}

.audio-label-row {
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e9eef4;
}

.drop-zone {
  min-height: 180px;
  border: 1px dashed #cfdbe6;
  border-radius: 8px;
  background: #f8fafc;
}

.drop-zone:hover,
.drop-zone.dragging {
  border-color: #1b83e5;
  background: #f4f9ff;
}

.upload-symbol {
  width: 46px;
  height: 46px;
  margin-bottom: 12px;
  background: #1682e5;
  color: #fff;
  box-shadow: 0 7px 15px rgba(22, 130, 229, 0.22);
}

.drop-copy strong { color: #263d4f; font-size: 13px; }
.drop-copy > span:last-child { color: #9aa8b4; font-size: 10px; }
.drop-zone.has-file .wave-scan { background: linear-gradient(transparent, rgba(24, 129, 226, 0.55), transparent); }

.file-panel {
  border-color: #e1e8ef;
  border-radius: 8px;
}

.play-button,
.detect-button {
  background: #147fdc;
}

.play-button { width: 36px; height: 36px; }
.replace-button { color: #167fd9; }

.detect-button {
  width: 150px;
  height: 42px;
  margin: 20px auto 0;
  border-radius: 7px;
  font-size: 12px;
  box-shadow: 0 5px 12px rgba(20, 127, 220, 0.2);
}
.detect-button:hover:not(:disabled) { background: #0871cb; }
.detect-button:disabled { background: #afbdc8; opacity: 1; }

.loading-panel {
  width: 320px;
  margin: 20px auto 0;
  padding: 16px 20px;
  border-radius: 8px;
  background: #eaf5ff;
}

.result-panel {
  margin-top: 22px;
  padding: 22px 24px;
}

.result-topline {
  padding-bottom: 12px;
  border-bottom: 1px solid #e9eef4;
}
.result-topline > span { color: #1677cf; }

.result-main {
  min-height: 66px;
  padding: 16px 0 12px;
}

.probability-ring { display: none; }

.result-copy {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px 14px;
}

.result-kicker {
  color: #5c7181;
  font-size: 12px;
}

.result-copy h3 {
  width: fit-content;
  margin: 0;
  padding: 5px 15px;
  border: 1px solid #9bd5ad;
  border-radius: 18px;
  background: #ebf8ee;
  color: #269348;
  font-family: "Microsoft YaHei UI", sans-serif;
  font-size: 15px;
  font-weight: 700;
}

.result-panel.risk .result-copy h3 {
  border-color: #ffb5a8;
  background: #fff0ed;
  color: #df604a;
}

.result-copy p {
  grid-column: 1 / -1;
  margin: 0;
  color: #718392;
  font-size: 11px;
}

.probability-list {
  padding: 14px 0 18px;
  border-top: 0;
}

.probability-row > div {
  color: #536b7c;
  font-family: "Microsoft YaHei UI", sans-serif;
  font-size: 11px;
}

.probability-row > i { height: 8px; background: #edf1f4; }
.probability-row em { background: #55b769; }
.probability-row:last-child em { background: #ff8800; }

.result-waveform-block {
  margin: 0 0 16px;
  border-color: #e5ebf1;
  border-radius: 8px;
  background: #f8fafc;
}

.result-waveform-canvas { background: #fff; }

.result-meta {
  color: #7e8d99;
  font-size: 10px;
}

.result-info-stack {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.result-info-card {
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(44, 73, 106, 0.07);
}

.detection-time-card {
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 24px;
}

.detection-time-card span {
  color: #8a9aa7;
  font-size: 12px;
}

.detection-time-card strong {
  color: #263e50;
  font-family: Bahnschrift, "Microsoft YaHei UI", sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.explanation-card {
  padding: 20px 24px 22px;
}

.explanation-card h3 {
  margin: 0 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e9eef4;
  color: #344b5e;
  font-size: 12px;
  font-weight: 700;
}

.explanation-card p {
  margin: 0;
  color: #667b8b;
  font-size: 11px;
  line-height: 1.9;
}

footer {
  width: min(1040px, calc(100% - 36px));
  margin: 26px auto 0;
  color: #97a4ae;
}

@media (max-width: 680px) {
  .site-header {
    height: auto;
    min-height: 56px;
    padding: 0 18px;
  }
  .brand { font-size: 13px; }
  .top-nav a { padding: 0 10px; font-size: 10px; }
  .top-nav a:not(.active) { display: none; }
  main { width: min(100% - 24px, 620px); }
  .intro h1 { font-size: 21px; }
  .field-grid { grid-template-columns: 1fr; }
  .form-title small { display: none; }
  .subject-form,
  .audio-card,
  .result-panel { padding: 18px 16px; }
  .detection-time-card,
  .explanation-card { padding: 18px 16px; }
  .detection-time-card { align-items: flex-start; flex-direction: column; gap: 7px; }
  .audio-label-row { align-items: flex-start; }
  .audio-label-row small { max-width: 150px; text-align: right; line-height: 1.5; }
  .result-copy { grid-template-columns: 1fr; }
  .result-copy p { grid-column: auto; }
  .loading-panel { width: 100%; }
}

/* Audio recording page — aligned to the supplied clinical-platform reference */
:root {
  --reference-blue: #1682e5;
  --reference-blue-dark: #0873d2;
  --reference-text: #344b5e;
  --reference-muted: #8b9aa7;
  --reference-border: #e8edf3;
}

.intro {
  margin-bottom: 20px;
}

.intro h1 {
  margin-bottom: 3px;
}

.reference-card {
  border: 0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 5px 18px rgba(44, 73, 106, 0.075);
}

.subject-form {
  margin-bottom: 20px;
  padding: 22px 26px 25px;
}

.subject-field-grid {
  grid-template-columns: 1.15fr 1fr .78fr .92fr;
  gap: 16px;
}

.reading-card {
  margin-bottom: 20px;
  padding: 22px 26px 26px;
  border-left: 4px solid var(--reference-blue);
}

.card-heading,
.recording-title {
  min-height: 31px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid var(--reference-border);
  color: var(--reference-text);
  font-size: 12px;
  font-weight: 700;
}

.card-heading button {
  padding: 0;
  border: 0;
  background: transparent;
  color: #2686dc;
  font-size: 11px;
  cursor: pointer;
}

.card-heading button:disabled {
  color: #abb7c1;
  cursor: not-allowed;
}

.reading-card p {
  min-height: 74px;
  display: flex;
  align-items: center;
  margin: 18px 0 0;
  padding: 15px 20px;
  border-radius: 8px;
  background: #f7f9fb;
  color: #536979;
  font-size: 13px;
  line-height: 2;
}

.recording-card {
  position: relative;
  padding: 24px 26px 26px;
  text-align: center;
}

.recording-title {
  justify-content: center;
  padding-bottom: 15px;
}

.microphone-button {
  position: relative;
  z-index: 1;
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  margin: 18px auto 18px;
  border: 0;
  border-radius: 50%;
  background: var(--reference-blue);
  color: #fff;
  box-shadow: 0 7px 17px rgba(22, 130, 229, .28);
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease;
}

.microphone-button:hover:not(:disabled) {
  background: var(--reference-blue-dark);
  transform: translateY(-1px);
}

.microphone-button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.microphone-button svg {
  width: 35px;
  height: 35px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.microphone-button.recording {
  background: #ef5b5b;
  box-shadow: 0 7px 18px rgba(239, 91, 91, .3);
}

.pulse-ring {
  position: absolute;
  inset: -8px;
  border: 2px solid rgba(239, 91, 91, .35);
  border-radius: inherit;
  opacity: 0;
}

.microphone-button.recording .pulse-ring {
  animation: recording-pulse 1.5s ease-out infinite;
}

@keyframes recording-pulse {
  0% { transform: scale(.86); opacity: .8; }
  100% { transform: scale(1.28); opacity: 0; }
}

.recording-waveform {
  position: relative;
  height: 132px;
  overflow: hidden;
  border: 1px solid #e2e9ef;
  border-radius: 8px;
  background: #f8fafc;
}

#waveform {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 1;
}

.recording-status {
  position: absolute;
  right: 12px;
  bottom: 9px;
  padding: 3px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .86);
  color: #99a6b1;
  font-size: 9px;
  pointer-events: none;
}

.microphone-button.recording + .recording-waveform .recording-status {
  color: #df5757;
}

.recording-time {
  margin-top: 14px;
  color: #253d4f;
  font-family: Bahnschrift, "Microsoft YaHei UI", sans-serif;
  font-size: 20px;
  font-weight: 700;
}

.recording-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
}

.record-action {
  min-width: 112px;
  height: 38px;
  padding: 0 16px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.record-action.primary {
  border: 1px solid var(--reference-blue);
  background: var(--reference-blue);
  color: #fff;
  box-shadow: 0 4px 10px rgba(22, 130, 229, .2);
}

.record-action.primary.recording {
  border-color: #ef5b5b;
  background: #ef5b5b;
}

.record-action.secondary,
.record-action.upload {
  border: 1px solid #d8e1e9;
  background: #fff;
  color: #718391;
}

.record-action.upload {
  border-color: #b9dafe;
  color: #167bd4;
}

.record-action:hover:not(:disabled) {
  filter: brightness(.97);
  transform: translateY(-1px);
}

.record-action:disabled {
  border-color: #e3e8ed;
  background: #f8f9fa;
  color: #b0bbc4;
  cursor: not-allowed;
  box-shadow: none;
}

.selected-audio {
  width: min(520px, 100%);
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px auto 0;
  padding: 10px 12px;
  border: 1px solid #e2e9ef;
  border-radius: 8px;
  background: #f9fbfd;
  text-align: left;
}

.selected-audio .play-button {
  width: 34px;
  height: 34px;
}

.submit-area {
  min-height: 118px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-direction: column;
  padding-top: 28px;
}

.submit-area .detect-button {
  width: 168px;
  height: 48px;
  margin: 0;
  font-size: 13px;
}

.submit-area > span {
  margin-top: 8px;
  color: #a2adb6;
  font-size: 10px;
}

.submit-area .loading-panel {
  margin: 0;
}

.submit-area .listening-orbit {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(22, 130, 229, .18);
  border-top-color: var(--reference-blue);
  border-radius: 50%;
  animation: detection-spin .85s linear infinite;
}

.submit-area .listening-orbit i {
  display: none;
}

.submit-area .loading-panel strong {
  color: #344b5e;
  font-size: 13px;
  font-weight: 700;
}

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

.result-panel {
  margin-top: 6px;
}

.probability-row:first-child em {
  background: #ff8800;
}

.probability-row:last-child em {
  background: #55b769;
}

.result-meta {
  gap: 15px;
}

@media (max-width: 880px) {
  .subject-field-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .subject-field-grid {
    grid-template-columns: 1fr;
  }

  .reading-card,
  .recording-card {
    padding: 18px 16px 20px;
  }

  .reading-card p {
    padding: 13px 14px;
    font-size: 12px;
    line-height: 1.9;
  }

  .recording-waveform {
    height: 110px;
  }

  .recording-controls {
    flex-wrap: wrap;
    gap: 9px;
  }

  .record-action {
    min-width: calc(50% - 6px);
  }

  .record-action.upload {
    width: 100%;
  }
}
