:root {
  --ink: #1f2430;
  --muted: #7b8494;
  --blue: #3b6cff;
  --blue-soft: #e8efff;
  --paper: #ffffff;
  --line: #e6eaf1;
  --bg: #f3f5f8;
  --ui: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--ui);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.stage {
  width: min(640px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 56px;
}

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

.kicker {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

h1 {
  margin: 0;
  font-size: 32px;
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1.15;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--line);
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #c5ccd6;
}

.status[data-state="on"] { color: #178a52; background: #eefbf4; border-color: #d7f3e4; }
.status[data-state="on"] .dot { background: #22a35f; }
.status[data-state="busy"] { color: #b86a12; background: #fff8ee; border-color: #ffe6c2; }
.status[data-state="busy"] .dot { background: #f0a035; }

.thread { display: grid; gap: 12px; }

.bubble {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px 20px 16px;
}

.bubble.you { border-radius: 8px 20px 20px 20px; }
.bubble.mine {
  background: var(--blue-soft);
  border-color: transparent;
  border-radius: 20px 20px 8px 20px;
}

.who {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.mine .who { color: var(--blue); }

.mine-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.line {
  margin: 10px 0 0;
  font-size: 28px;
  font-weight: 650;
  line-height: 1.4;
  letter-spacing: 0;
}

.mine .line { color: #17306b; }

.live {
  margin: 8px 0 0;
  min-height: 1.2em;
  color: var(--blue);
  font-size: 14px;
}

.bars {
  display: flex;
  gap: 4px;
  height: 14px;
  margin-top: 14px;
  align-items: flex-end;
  opacity: 0;
}
.bars i {
  width: 3px;
  height: 6px;
  border-radius: 99px;
  background: var(--blue);
}
body.is-busy .bars { opacity: 1; }
body.is-busy .bars i { animation: eq 0.7s ease-in-out infinite; }
body.is-busy .bars i:nth-child(2) { animation-delay: .1s; }
body.is-busy .bars i:nth-child(3) { animation-delay: .2s; }
body.is-busy .bars i:nth-child(4) { animation-delay: .05s; }
@keyframes eq { 50% { height: 14px; } }

.replay {
  border: 0;
  background: #fff;
  color: var(--blue);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  border-radius: 999px;
  padding: 6px 10px;
  cursor: pointer;
}
.replay:disabled { opacity: 0.4; cursor: default; }

.caption {
  margin: 16px 2px 0;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.actions {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr 168px;
  gap: 10px;
  align-items: stretch;
}

.mic {
  appearance: none;
  border: 0;
  height: 56px;
  border-radius: 16px;
  background: var(--blue);
  color: #fff;
  font: inherit;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
}
.mic:hover { background: #2f5ef0; }
.mic[aria-pressed="true"] { background: #243044; }

.rate {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 8px 12px 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.rate span { display: flex; justify-content: space-between; }
.rate b { color: var(--ink); font-weight: 700; }
.rate input {
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 99px;
  background: #e6eaf1;
  outline: none;
}
.rate input::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--blue);
  cursor: pointer;
}

.note {
  min-height: 1.2em;
  margin: 10px 2px 0;
  text-align: center;
  color: #c2412d;
  font-size: 14px;
  font-weight: 600;
}

.history-block { margin-top: 28px; }
.history-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.history-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--muted);
}
.history-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.history { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.empty { margin: 8px 0 0; color: #a3abB8; color: #a3abb8; font-size: 14px; }
.history-block:has(.history li) .empty { display: none; }

.history li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 15px;
}
.history .src { color: #3c4453; }
.history .arrow { color: #b7c0ce; }
.history .dst { font-weight: 700; color: #17306b; }

@media (max-width: 640px) {
  h1 { font-size: 28px; }
  .line { font-size: 24px; }
  .actions { grid-template-columns: 1fr; }
  .history li { grid-template-columns: 1fr; gap: 4px; }
  .history .arrow { display: none; }
}
