:root {
  --bg: #060a16;
  --panel: rgba(12, 18, 34, 0.78);
  --border: rgba(255, 255, 255, 0.1);
  --text: #f8fbff;
  --muted: rgba(248, 251, 255, 0.62);
  --accent: #4f7cff;
  --shadow: 0 24px 80px rgba(2, 6, 23, 0.45);
  --radius: 22px;
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, PingFang SC, Microsoft YaHei, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }

body {
  background:
    radial-gradient(circle at 10% 10%, rgba(43, 211, 255, 0.08), transparent 45%),
    radial-gradient(circle at 90% 15%, rgba(79, 124, 255, 0.10), transparent 45%),
    linear-gradient(180deg, #030611 0%, #070d1c 45%, #030510 100%);
  color: var(--text);
  font-family: var(--font);
}

.bg-orb { position: fixed; pointer-events: none; filter: blur(70px); opacity: .6; z-index: 0; }
.orb-a { width: 240px; height: 240px; left: -40px; top: -30px; background: rgba(43, 211, 255, .15); }
.orb-b { width: 260px; height: 260px; right: -30px; top: 40px; background: rgba(79, 124, 255, .16); }
.orb-c { width: 260px; height: 220px; left: 30%; bottom: -40px; background: rgba(139, 92, 246, .12); }

.container {
  position: relative;
  z-index: 1;
  width: min(1200px, calc(100% - 24px));
  margin: 0 auto;
  padding: 16px 0 28px;
}

.card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.glass {
  background: linear-gradient(180deg, rgba(16, 24, 45, .78), rgba(8, 12, 24, .74));
  backdrop-filter: blur(14px);
}

.hero { padding: 20px; }
.live-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
}

.eyebrow {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.hero-title {
  margin: 6px 0 0;
  font-size: clamp(1.55rem, 2vw + 1rem, 2.4rem);
  line-height: 1.02;
  font-weight: 900;
  letter-spacing: -.03em;
}
.hero-title.small { font-size: clamp(1.35rem, 1.6vw + .9rem, 2rem); }

.hero-subtitle {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: .92rem;
  line-height: 1.55;
}

.badge-row {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.badge {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(79,124,255,.15);
  border: 1px solid rgba(79,124,255,.25);
  color: #cfe0ff;
  font-size: 12px;
  font-weight: 700;
}
.inline-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  color: #d8e3ff;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  padding: 6px 9px;
  border-radius: 999px;
  display: inline-block;
}

.grid-home {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 16px;
  margin-top: 16px;
}
.live-grid {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
}
.live-right { display: grid; gap: 16px; }
.double-pane { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.panel {
  background: var(--panel);
  padding: 16px;
}

.panel-header h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -.02em;
}
.panel-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.45;
}
.panel-header.small h2 { font-size: .95rem; }

.field { display: block; margin-top: 12px; }
.field span {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

input, select, textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(4, 8, 18, .78);
  color: var(--text);
  font: inherit;
  outline: none;
}
input, select { height: 42px; padding: 0 12px; }
input::placeholder { color: rgba(255,255,255,.25); }

input:focus, select:focus, textarea:focus {
  border-color: rgba(79,124,255,.45);
  box-shadow: 0 0 0 3px rgba(79,124,255,.12);
}

.input-row { display: flex; gap: 8px; }
.input-row input { min-width: 0; flex: 1; }

.btn {
  border: 1px solid var(--border);
  border-radius: 12px;
  height: 42px;
  padding: 0 14px;
  background: rgba(255,255,255,.03);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  transition: 160ms ease;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  background: rgba(255,255,255,.06);
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(180deg, #4f7cff, #3f6df3);
  border-color: rgba(79,124,255,.45);
  color: #fff;
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #628aff, #4c76f6);
}
.btn-secondary { background: rgba(255,255,255,.05); }
.btn-ghost { background: transparent; }

.action-row { margin-top: 12px; display: flex; gap: 8px; }
.action-row .btn { flex: 1; }

.quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.segmented {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.segmented button {
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
  transition: 140ms ease;
}
.segmented button.active {
  background: rgba(255,255,255,.92);
  color: #0b1220;
}

.toggle-list { margin-top: 12px; display: grid; gap: 8px; }
.toggle-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.03);
  padding: 10px 12px;
  border-radius: 14px;
}
.toggle-item span {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}
.toggle-item input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.status-card {
  margin-top: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.03);
  border-radius: 14px;
  padding: 12px;
}
.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
}
.status-row + .status-row { margin-top: 8px; }

.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}
.status-chip.idle { background: rgba(255,255,255,.08); color: rgba(255,255,255,.85); }
.status-chip.connecting { background: rgba(244,181,69,.14); color: #ffd99c; }
.status-chip.streaming { background: rgba(37,208,139,.15); color: #b5ffd9; }
.status-chip.stopping { background: rgba(148,163,184,.14); color: #dbe7f7; }
.status-chip.error { background: rgba(255,95,122,.16); color: #ffc4cf; }

.timer-text {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--text);
  font-weight: 700;
}
.muted { color: var(--muted); }
.message { margin-top: 10px; font-size: 12px; }

.error-box {
  margin-top: 10px;
  border: 1px solid rgba(255,95,122,.25);
  background: rgba(255,95,122,.08);
  color: #ffd0d8;
  border-radius: 10px;
  padding: 10px;
  font-size: 12px;
  line-height: 1.45;
  word-break: break-word;
}
.hidden { display: none !important; }

.output-box {
  min-height: 260px;
  resize: vertical;
  padding: 12px;
  font-size: 12px;
  line-height: 1.45;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: rgba(4, 8, 18, .9);
}

.log-list {
  margin-top: 8px;
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(4, 8, 18, .88);
  padding: 8px;
  display: grid;
  gap: 6px;
}

.log-item {
  border-radius: 10px;
  padding: 8px 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.4;
  word-break: break-all;
}
.log-info { background: rgba(255,255,255,.04); color: rgba(255,255,255,.86); }
.log-error { background: rgba(255,95,122,.08); color: #ffd0d8; }
.log-ws { background: rgba(43,211,255,.08); color: #c7f5ff; }

.feature-panel { display: flex; flex-direction: column; }
.feature-list {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.7;
  font-size: 14px;
}
.note-box {
  margin-top: auto;
  border-radius: 14px;
  border: 1px solid rgba(244,181,69,.16);
  background: rgba(244,181,69,.08);
  padding: 12px;
  font-size: 12px;
  line-height: 1.5;
  color: #ffe1a6;
}

@media (max-width: 980px) {
  .grid-home, .live-grid { grid-template-columns: 1fr; }
  .double-pane { grid-template-columns: 1fr; }
  .live-hero { flex-direction: column; align-items: stretch; }
}

@media (max-width: 640px) {
  .container { width: calc(100% - 16px); padding-top: 10px; }
  .hero, .panel { padding: 14px; }
  .quick-grid { grid-template-columns: 1fr; }
  .action-row { flex-direction: column; }
  .btn { width: 100%; }
  .input-row { flex-direction: column; }
}

