:root {
  --bg: #0f1226;
  --bg2: #1a1f3c;
  --card: #ffffff;
  --primary: #ff5a5f;
  --primary-dark: #e0484d;
  --secondary: #4f7cff;
  --text: #1f2430;
  --muted: #6b7280;
  --accent: #10b981;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  min-height: 100vh;
  background: radial-gradient(1200px 600px at 20% -10%, #2a3170, transparent),
              radial-gradient(900px 500px at 100% 0%, #43215a, transparent),
              linear-gradient(160deg, var(--bg), var(--bg2));
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.app {
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.header { text-align: center; color: #fff; }
.header h1 {
  font-size: 2.4rem;
  letter-spacing: 0.5px;
  background: linear-gradient(90deg, #ffd86b, #ff5a5f, #4f7cff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.subtitle { margin-top: 8px; color: #c9cdf0; font-size: 0.98rem; }

.card {
  background: var(--card);
  border-radius: 22px;
  padding: 32px 28px;
  box-shadow: var(--shadow);
}

.sentence-block { text-align: center; margin-bottom: 24px; }
.label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
  margin-bottom: 10px;
}
.sentence {
  font-size: 2.6rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
}
.pinyin {
  margin-top: 12px;
  font-size: 1.1rem;
  color: var(--secondary);
  font-style: italic;
}
.translation {
  margin-top: 6px;
  font-size: 0.95rem;
  color: var(--muted);
}

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

.btn {
  border: none;
  border-radius: 14px;
  padding: 14px 22px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
  color: #fff;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); box-shadow: 0 8px 20px rgba(255, 90, 95, 0.35); }
.btn-primary.recording { background: linear-gradient(135deg, #111, #333); animation: pulse 1.2s infinite; }
.btn-secondary { background: var(--secondary); box-shadow: 0 8px 20px rgba(79, 124, 255, 0.3); }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 90, 95, 0.6); }
  50% { box-shadow: 0 0 0 12px rgba(255, 90, 95, 0); }
}

.status {
  text-align: center;
  margin: 22px 0 6px;
  color: var(--muted);
  font-size: 0.95rem;
  min-height: 22px;
}

.result {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px dashed #e5e7eb;
}
.result-row { text-align: center; margin-bottom: 16px; }
.result-label { display: block; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin-bottom: 4px; }
.heard { font-size: 1.3rem; font-weight: 600; color: var(--text); }

.score-wrap { display: flex; align-items: center; justify-content: center; gap: 20px; }
.score-circle {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  display: flex;
  align-items: baseline;
  justify-content: center;
  font-weight: 700;
  font-size: 2.2rem;
  color: #fff;
  background: conic-gradient(var(--accent) 0deg, #e5e7eb 0deg);
  position: relative;
}
.score-circle::before {
  content: "";
  position: absolute;
  inset: 10px;
  background: #fff;
  border-radius: 50%;
}
.score-circle span { position: relative; z-index: 1; }
.score-circle .pct { font-size: 1rem; }
.score-text { font-size: 1rem; color: var(--muted); max-width: 220px; }

.footer { text-align: center; color: #9aa0d0; font-size: 0.82rem; }
