:root {
  color-scheme: light;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #172023;
  background: #f4f6f5;
  letter-spacing: 0;
  --green: #087f5b;
  --green-dark: #056247;
  --ink: #172023;
  --muted: #687579;
  --line: #d8dfdc;
  --surface: #ffffff;
  --alert: #b42318;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: #f4f6f5; }
button, a { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }

.rt-topbar {
  height: 64px;
  padding: 0 clamp(20px, 4vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.94);
}
.rt-brand { color: var(--ink); text-decoration: none; font-size: 18px; font-weight: 700; }
.rt-service-state { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 14px; }
.rt-dot { width: 9px; height: 9px; border-radius: 50%; background: #97a3a0; }
.rt-dot.is-online { background: #12a474; box-shadow: 0 0 0 4px rgba(18,164,116,.13); }

.rt-workspace {
  min-height: calc(100vh - 64px);
  display: grid;
  grid-template-columns: minmax(360px, .9fr) minmax(520px, 1.1fr);
}
.rt-stage {
  padding: clamp(38px, 6vh, 72px) clamp(28px, 5vw, 76px);
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  border-right: 1px solid var(--line);
  background: var(--surface);
}
.rt-kicker { margin: 0 0 12px; color: var(--green); font-size: 14px; font-weight: 700; }
.rt-stage h1 { margin: 0; font-size: 34px; line-height: 1.2; font-weight: 720; }
.rt-room-meta { margin: 12px 0 0; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }

.rt-meter {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  overflow: hidden;
}
.rt-meter span { width: 5px; height: 18px; background: #9eaaa6; border-radius: 3px; transition: height .18s, background .18s; }
.rt-meter[data-state="listening"] span,
.rt-meter.is-user-speaking span { background: var(--green); animation: rt-wave .72s ease-in-out infinite alternate; }
.rt-meter[data-state="thinking"] span { background: #ca8a04; animation: rt-think 1.1s ease-in-out infinite; }
.rt-meter[data-state="speaking"] span { background: #2563a6; animation: rt-wave .55s ease-in-out infinite alternate; }
.rt-meter span:nth-child(3n) { animation-delay: .12s; }
.rt-meter span:nth-child(4n) { animation-delay: .24s; }
.rt-meter span:nth-child(5n) { animation-delay: .36s; }
@keyframes rt-wave { to { height: 96px; } }
@keyframes rt-think { 50% { height: 44px; opacity: .55; } }

.rt-actions { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; }
.rt-primary, .rt-secondary {
  min-height: 52px;
  border-radius: 6px;
  border: 1px solid transparent;
  padding: 0 18px;
  font-weight: 700;
}
.rt-primary { background: var(--green); color: white; }
.rt-primary:hover { background: var(--green-dark); }
.rt-secondary { background: white; border-color: var(--line); color: var(--ink); }
button:disabled { cursor: not-allowed; opacity: .5; }
.rt-error { margin: 14px 0 0; color: var(--alert); font-size: 14px; }

.rt-dialogue { display: grid; grid-template-rows: 1fr 1fr; min-width: 0; }
.rt-transcript { padding: clamp(34px, 6vh, 70px) clamp(28px, 6vw, 90px); min-height: 0; overflow: auto; }
.rt-user { border-bottom: 1px solid var(--line); background: #f7f9f8; }
.rt-agent { background: #edf7f3; }
.rt-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 28px; font-size: 14px; font-weight: 700; }
.rt-badge { border: 1px solid #bdc7c4; border-radius: 999px; padding: 5px 10px; color: var(--muted); font-size: 12px; font-weight: 600; }
.rt-badge.is-online { color: var(--green-dark); border-color: #8bcdb5; background: #e3f5ee; }
.rt-transcript p { margin: 0; max-width: 840px; font-size: 24px; line-height: 1.65; overflow-wrap: anywhere; }

@media (max-width: 840px) {
  .rt-workspace { grid-template-columns: 1fr; }
  .rt-stage { min-height: 56vh; border-right: 0; border-bottom: 1px solid var(--line); }
  .rt-meter { min-height: 150px; }
  .rt-dialogue { grid-template-rows: auto auto; }
  .rt-transcript { min-height: 240px; }
}

@media (max-width: 520px) {
  .rt-topbar { height: 56px; padding: 0 16px; }
  .rt-workspace { min-height: calc(100vh - 56px); }
  .rt-stage { padding: 28px 18px; }
  .rt-stage h1 { font-size: 27px; }
  .rt-actions { grid-template-columns: 1fr; }
  .rt-transcript { padding: 28px 20px; }
  .rt-transcript p { font-size: 20px; }
}
