:root {
  color-scheme: dark;
  font-family:
    Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Microsoft YaHei",
    sans-serif;
  background: #111316;
  color: #f3f0e8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(22, 24, 26, 0.96), rgba(14, 15, 17, 1)),
    #111316;
}

:fullscreen {
  background: #111316;
}

button,
select,
input {
  font: inherit;
}

.app {
  display: grid;
  grid-template-rows: minmax(280px, 1fr) auto minmax(180px, 30vh);
  min-height: 100vh;
}

.caption-stage {
  display: grid;
  align-content: center;
  gap: 18px;
  padding: clamp(24px, 5vw, 72px);
  border-bottom: 1px solid #2a2f35;
}

.caption-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #aeb8c2;
  font-size: 14px;
}

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

.dot.live {
  background: #3bd671;
  box-shadow: 0 0 16px rgba(59, 214, 113, 0.45);
}

.dot.error {
  background: #ff615c;
}

.caption-text {
  max-width: 1200px;
  font-size: clamp(34px, 6vw, 78px);
  line-height: 1.1;
  font-weight: 750;
  letter-spacing: 0;
}

.caption-subtext {
  min-height: 30px;
  color: #b7d3d0;
  font-size: 20px;
  line-height: 1.45;
}

.controls {
  display: grid;
  gap: 16px;
  padding: 18px clamp(18px, 4vw, 40px);
  background: #191c20;
  border-bottom: 1px solid #2a2f35;
}

.control-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

button {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid #39404a;
  border-radius: 8px;
  color: #f3f0e8;
  background: #22272d;
  cursor: pointer;
}

button:hover:not(:disabled) {
  background: #2a3038;
}

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

button.primary {
  color: #071311;
  background: #70e3c2;
  border-color: #70e3c2;
}

button.primary:hover:not(:disabled) {
  background: #8ceed1;
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: #aeb8c2;
  font-size: 13px;
}

select,
input {
  min-height: 40px;
  width: 100%;
  border: 1px solid #39404a;
  border-radius: 8px;
  padding: 0 10px;
  color: #f3f0e8;
  background: #111316;
}

.history {
  min-height: 0;
  overflow: auto;
  padding: 18px clamp(18px, 4vw, 40px) 32px;
  background: #111316;
}

:fullscreen .app {
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 100vh;
}

:fullscreen .caption-stage {
  align-content: end;
  min-height: 0;
  padding: clamp(28px, 6vw, 96px);
  padding-bottom: clamp(40px, 8vh, 110px);
}

:fullscreen .caption-text {
  max-width: 1400px;
  font-size: clamp(52px, 8vw, 118px);
}

:fullscreen .caption-subtext {
  max-width: 1200px;
  font-size: clamp(22px, 2.4vw, 36px);
}

:fullscreen .controls {
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 12px clamp(18px, 3vw, 36px);
}

:fullscreen .control-grid {
  display: none;
}

:fullscreen .history {
  display: none;
}

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

h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
}

ol {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

li {
  padding: 12px 14px;
  border: 1px solid #2a2f35;
  border-radius: 8px;
  background: #171a1e;
  line-height: 1.45;
}

.source {
  display: block;
  margin-top: 6px;
  color: #9fb0bd;
  font-size: 13px;
}

.time {
  display: block;
  margin-bottom: 5px;
  color: #83909c;
  font-size: 12px;
}

@media (max-width: 760px) {
  .app {
    grid-template-rows: minmax(240px, 1fr) auto minmax(180px, 32vh);
  }

  .control-grid {
    grid-template-columns: 1fr;
  }

  .caption-text {
    font-size: clamp(30px, 12vw, 52px);
  }
}
