:root {
  --bg: #0b1020;
  --bg-alt: #121a2f;
  --panel: rgba(245, 249, 255, 0.9);
  --line: rgba(96, 126, 201, 0.18);
  --text: #16213d;
  --muted: #6c7897;
  --green: #27c58b;
  --cyan: #46d1ff;
  --blue: #5589ff;
  --orange: #ffb248;
  --red: #ff617c;
  --shadow: 0 22px 48px rgba(8, 16, 39, 0.28);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 0%, rgba(70, 209, 255, 0.18), transparent 34%),
    radial-gradient(circle at 100% 10%, rgba(85, 137, 255, 0.15), transparent 30%),
    linear-gradient(180deg, #edf6ff 0%, #dfe9ff 46%, #cedcff 100%);
}
button, input, textarea { font: inherit; }
button { border: 0; cursor: pointer; }
.app {
  min-height: 100vh;
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.screen {
  display: none;
  width: min(100%, 520px);
}
.screen.active { display: block; }
.glass {
  background: var(--panel);
  border: 1px solid rgba(255,255,255,0.6);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}
.hero-card, .result-card {
  border-radius: 28px;
  padding: 28px 22px;
}
.eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 800;
}
h1, h2, p { margin: 0; }
h1 { font-size: clamp(2.3rem, 8vw, 3.2rem); line-height: 1.06; }
.subtitle {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.7;
  font-size: 1rem;
}
.feature-list {
  display: grid;
  gap: 12px;
  margin: 24px 0 20px;
}
.feature-list div {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255,255,255,0.68);
  border: 1px solid var(--line);
}
.feature-list strong {
  display: block;
  margin-bottom: 5px;
  font-size: 0.98rem;
}
.feature-list span { color: var(--muted); font-size: 0.92rem; }
.hero-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}
.hero-meta div, .result-grid div {
  padding: 14px 15px;
  border-radius: 18px;
  background: rgba(255,255,255,0.68);
  border: 1px solid var(--line);
}
.hero-meta span, .result-grid span { display: block; color: var(--muted); font-size: 0.86rem; }
.hero-meta strong, .result-grid strong { display: block; margin-top: 6px; font-size: 1.08rem; }
.primary-btn, .secondary-btn {
  width: 100%;
  padding: 16px 18px;
  border-radius: 18px;
  font-weight: 800;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.primary-btn {
  color: #fff;
  background: linear-gradient(120deg, var(--blue), #7b5bff);
  box-shadow: 0 16px 26px rgba(88, 101, 255, 0.24);
}
.secondary-btn {
  color: var(--text);
  background: rgba(255,255,255,0.86);
  border: 1px solid var(--line);
}
.primary-btn:active, .secondary-btn:active, .hold-btn:active { transform: scale(0.98); }
.topbar {
  padding: 12px;
  border-radius: 22px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.stat-pill {
  border-radius: 18px;
  padding: 12px 10px;
  background: rgba(255,255,255,0.75);
  text-align: center;
  border: 1px solid var(--line);
}
.stat-pill span { display: block; color: var(--muted); font-size: 0.78rem; }
.stat-pill strong { display: block; margin-top: 4px; font-size: 1.05rem; }
.stat-pill.accent strong { color: var(--green); }
.stat-pill.danger strong { color: var(--red); }
.event-banner, .chat-board, .control-panel {
  margin-top: 14px;
  border-radius: 24px;
  padding: 16px;
}
.event-label { display: block; color: var(--muted); font-size: 0.78rem; }
#eventTitle { display: block; margin-top: 4px; font-size: 1.04rem; }
#eventDesc { margin-top: 7px; color: var(--muted); line-height: 1.6; font-size: 0.92rem; }
.chat-head {
  display: grid;
  gap: 12px;
}
.chat-head h2 { font-size: 1.08rem; }
#statusText { margin-top: 5px; color: var(--muted); line-height: 1.55; font-size: 0.9rem; }
.bars { display: grid; gap: 10px; }
.meter span { display: block; font-size: 0.82rem; color: var(--muted); margin-bottom: 5px; }
.meter-track {
  height: 11px;
  border-radius: 999px;
  background: rgba(96,126,201,0.12);
  overflow: hidden;
}
.meter-track i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), #5cf0a8);
  transition: width 0.15s ease;
}
.meter.warn .meter-track i { background: linear-gradient(90deg, #ffb248, var(--red)); }
.chat-stream {
  margin-top: 16px;
  min-height: 280px;
  max-height: 320px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,0.68), rgba(244,248,255,0.92));
  border: 1px solid rgba(96,126,201,0.12);
}
.message {
  max-width: 82%;
  padding: 10px 12px;
  border-radius: 18px;
  line-height: 1.5;
  font-size: 0.92rem;
  box-shadow: 0 8px 18px rgba(8, 16, 39, 0.08);
  animation: floatIn 0.22s ease;
}
.message.left {
  align-self: flex-start;
  background: #fff;
  border-bottom-left-radius: 8px;
}
.message.right {
  align-self: flex-end;
  background: linear-gradient(120deg, #d8f4ff, #dfe1ff);
  border-bottom-right-radius: 8px;
}
.message.system {
  align-self: center;
  background: rgba(86, 105, 154, 0.12);
  color: #445377;
  font-size: 0.82rem;
  padding: 7px 12px;
}
.gap-panel {
  margin-top: 14px;
  padding: 14px;
  border-radius: 20px;
  background: rgba(255,255,255,0.76);
  border: 1px solid var(--line);
}
.gap-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  font-size: 0.88rem;
}
.gap-head span { color: var(--muted); }
.gap-track {
  margin-top: 12px;
  position: relative;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255,97,124,0.24), rgba(255,178,72,0.2) 42%, rgba(39,197,139,0.22) 58%, rgba(255,97,124,0.24));
  overflow: hidden;
}
.gap-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 40%;
  width: 20%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(39,197,139,0.35), rgba(70,209,255,0.36));
}
.gap-marker {
  position: absolute;
  top: -4px;
  width: 14px;
  height: 26px;
  border-radius: 999px;
  background: linear-gradient(180deg, #5f79ff, #1d2f7a);
  box-shadow: 0 8px 16px rgba(66, 88, 180, 0.28);
}
.record-target { margin-top: 10px; color: var(--muted); font-size: 0.88rem; }
.control-panel { text-align: center; }
.record-readout span { color: var(--muted); font-size: 0.86rem; }
.record-readout strong { display: block; margin-top: 4px; font-size: 1.4rem; }
.hold-btn {
  margin-top: 14px;
  width: 100%;
  min-height: 96px;
  border-radius: 26px;
  font-size: 1.24rem;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(140deg, #38d29f, #3f89ff);
  box-shadow: 0 18px 32px rgba(60, 124, 255, 0.24);
}
.hold-btn.recording {
  background: linear-gradient(140deg, #ff7f6d, #ff4f7d);
  box-shadow: 0 18px 32px rgba(255, 79, 125, 0.26);
}
.hint-text {
  margin-top: 12px;
  min-height: 2.8em;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.9rem;
}
.result-card h2 { font-size: clamp(2rem, 6vw, 2.6rem); }
.result-score {
  margin-top: 10px;
  font-size: 1.05rem;
  color: var(--muted);
}
.result-score strong { font-size: 2rem; color: var(--text); }
.result-summary {
  margin-top: 14px;
  color: var(--muted);
  line-height: 1.7;
}
.result-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 20px;
}
#shareText {
  width: 100%;
  min-height: 112px;
  margin-top: 18px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.82);
  color: var(--text);
  resize: none;
}
.result-actions {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}
@keyframes floatIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 420px) {
  .app { padding: 12px; }
  .hero-card, .result-card, .event-banner, .chat-board, .control-panel, .topbar { border-radius: 20px; }
  .chat-stream { min-height: 250px; }
}
