:root {
  color-scheme: dark;
  --bg: #0d0f12;
  --panel: #15181d;
  --panel-2: #101318;
  --line: #262b33;
  --text: #f3f4f6;
  --muted: #8d95a3;
  --green: #1ddc87;
  --blue: #4da3ff;
  --red: #ff5f6d;
  --amber: #ffc857;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(77, 163, 255, 0.14), transparent 34rem),
    linear-gradient(180deg, #11151b 0%, var(--bg) 42%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}

button,
input,
select {
  font: inherit;
}

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

.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 68px);
  line-height: 0.95;
  letter-spacing: 0;
}

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

.status-card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 150px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(21, 24, 29, 0.82);
  color: var(--muted);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #4b5563;
}

.dot.live {
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(29, 220, 135, 0.12);
}

.dot.error {
  background: var(--red);
  box-shadow: 0 0 0 6px rgba(255, 95, 109, 0.12);
}

.setup-grid {
  display: grid;
  grid-template-columns: 2fr 1.2fr 1fr 1fr 1.1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.field {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(21, 24, 29, 0.78);
}

.field span,
.field-hint,
.panel-title small,
.notes span {
  color: var(--muted);
  font-size: 12px;
}

.field-hint {
  line-height: 1.4;
}

input,
select {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid #313844;
  border-radius: 6px;
  background: #0b0d10;
  color: var(--text);
  outline: none;
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
}

.switch-row input {
  width: 20px;
  min-height: 20px;
  accent-color: var(--green);
}

.switch-row span {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

input:focus,
select:focus {
  border-color: var(--blue);
}

.controls,
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.controls {
  margin-bottom: 18px;
}

button {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--text);
  cursor: pointer;
}

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

.primary {
  background: var(--green);
  color: #07110c;
  font-weight: 800;
}

.secondary {
  border-color: var(--line);
  background: #171b21;
}

.danger {
  background: #3a151a;
  border-color: rgba(255, 95, 109, 0.42);
  color: #ffd8dc;
}

.caption-panel,
.panel,
.notes {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(21, 24, 29, 0.82);
}

.caption-panel {
  margin-bottom: 16px;
  padding: 18px;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-title span {
  font-size: 14px;
  font-weight: 800;
}

.caption {
  min-height: 120px;
  display: flex;
  align-items: center;
  font-size: clamp(30px, 5vw, 58px);
  font-weight: 900;
  line-height: 1.16;
  letter-spacing: 0;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.9fr);
  gap: 16px;
}

.panel {
  min-height: 460px;
  padding: 16px;
}

.transcript-list {
  display: grid;
  align-content: start;
  gap: 10px;
  height: 520px;
  overflow: auto;
  padding-right: 4px;
}

.segment {
  padding: 12px;
  border: 1px solid #242a33;
  border-radius: 8px;
  background: var(--panel-2);
}

.segment-time {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  margin-bottom: 6px;
}

.segment-zh {
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.45;
}

.summary-output {
  height: 456px;
  overflow: auto;
  white-space: pre-wrap;
  margin: 12px 0 0;
  padding: 14px;
  border-radius: 8px;
  background: #0b0d10;
  border: 1px solid #242a33;
  color: #d8dee9;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  line-height: 1.65;
}

.notes {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
  padding: 14px 16px;
}

.notes strong {
  color: var(--amber);
}

@media (max-width: 860px) {
  .hero,
  .notes {
    flex-direction: column;
  }

  .setup-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .caption {
    min-height: 150px;
    align-items: flex-start;
  }
}
