:root {
  --bg: #f5efe5;
  --bg-strong: #eadbc8;
  --panel: rgba(255, 250, 242, 0.8);
  --line: rgba(95, 63, 32, 0.15);
  --text: #2e241b;
  --muted: #6e5a47;
  --accent: #c55b2d;
  --accent-dark: #8f3f1d;
  --ok: #2f9e44;
  --shadow: 0 24px 60px rgba(92, 61, 31, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.9), transparent 30%),
    linear-gradient(135deg, #f8f3eb, var(--bg) 40%, var(--bg-strong));
  min-height: 100vh;
}

.shell {
  width: min(1100px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 40px 0 56px;
}

.hero {
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(32px, 6vw, 54px);
  line-height: 1;
}

.subtext {
  max-width: 760px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.meta-grid {
  margin-bottom: 18px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.controls,
.logs {
  margin-bottom: 18px;
}

.controls,
.logs,
.panel {
  padding: 22px;
}

.status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #b8a38d;
  box-shadow: 0 0 0 6px rgba(184, 163, 141, 0.18);
}

.dot.connected {
  background: var(--ok);
  box-shadow: 0 0 0 6px rgba(47, 158, 68, 0.18);
}

.button-row {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease, background 160ms ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

#startBtn {
  background: var(--accent);
  color: #fff;
}

#stopBtn {
  background: #e7d8c5;
  color: var(--text);
}

.hint {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.panel-title {
  margin-bottom: 12px;
  font-weight: 700;
}

.meta-panel {
  min-height: 180px;
}

.language-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 110px;
  border-radius: 18px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(95, 63, 32, 0.08);
}

.language-main {
  font-size: 34px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--accent-dark);
}

.language-sub {
  margin-top: 10px;
  color: var(--muted);
}

.params-list {
  display: grid;
  gap: 10px;
}

.param-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(95, 63, 32, 0.08);
}

.param-key {
  color: var(--muted);
  font-size: 13px;
}

.param-value {
  text-align: right;
  font-weight: 700;
  word-break: break-word;
}

.transcript {
  min-height: 220px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(95, 63, 32, 0.08);
  padding: 16px;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
}

.live {
  color: var(--accent-dark);
}

.final {
  font-size: 16px;
}

.final-item + .final-item {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed rgba(95, 63, 32, 0.16);
}

.final-item-text {
  line-height: 1.8;
}

.final-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.result-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(197, 91, 45, 0.12);
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
}

#logBox {
  margin: 0;
  min-height: 180px;
  max-height: 260px;
  overflow: auto;
  padding: 14px;
  border-radius: 16px;
  background: rgba(37, 28, 20, 0.92);
  color: #f9ecdb;
  font-size: 12px;
  line-height: 1.6;
}

@media (max-width: 820px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .shell {
    width: min(100vw - 20px, 1100px);
    padding-top: 24px;
  }

  .controls,
  .logs,
  .panel {
    padding: 18px;
  }
}
