:root {
  --bg: #07111f;
  --panel: rgba(13, 23, 41, 0.82);
  --panel-border: rgba(34, 211, 238, 0.16);
  --text: #ecfeff;
  --muted: #94a3b8;
  --accent: #22d3ee;
  --accent-soft: #34d399;
  --warn: #f59e0b;
  --danger: #fb7185;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Segoe UI", "Microsoft YaHei UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(34, 211, 238, 0.12), transparent 28%),
    radial-gradient(circle at bottom right, rgba(52, 211, 153, 0.12), transparent 24%),
    linear-gradient(180deg, #050b15 0%, #081321 42%, #050a13 100%);
}

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

.hero,
.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.hero {
  padding: 28px;
}

.hero::after,
.panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.06), transparent 48%, rgba(52, 211, 153, 0.06));
}

.hero__badge,
.panel__eyebrow,
.eyebrow {
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  font-size: 12px;
}

.hero__content {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
}

h1,
h2 {
  margin: 10px 0 0;
  font-family: Consolas, "Courier New", monospace;
  letter-spacing: 0.02em;
}

h1 {
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.05;
}

h2 {
  font-size: 22px;
}

.subtitle,
.panel__desc,
.panel__foot {
  color: var(--muted);
  line-height: 1.7;
}

.panel__desc--center {
  text-align: center;
  margin: 16px 0 0;
}

.hero__status {
  min-width: 200px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 20px;
  background: rgba(8, 19, 33, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.status-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--warn);
  box-shadow: 0 0 0 8px rgba(245, 158, 11, 0.12);
}

.status-dot.is-ok {
  background: var(--accent-soft);
  box-shadow: 0 0 0 8px rgba(52, 211, 153, 0.14);
}

.status-dot.is-error {
  background: var(--danger);
  box-shadow: 0 0 0 8px rgba(251, 113, 133, 0.14);
}

.status-label {
  margin: 0 0 4px;
  font-size: 12px;
  color: var(--muted);
}

.dashboard {
  margin-top: 22px;
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 20px;
}

.dashboard--call {
  grid-template-columns: 1fr;
}

.panel {
  padding: 20px;
}

.panel__head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
  margin-bottom: 18px;
}

.panel--preview {
  grid-row: span 2;
}

.panel--call-stage {
  grid-row: span 2;
}

.preview-frame {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #000;
  min-height: 380px;
}

.preview-frame img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #010409;
}

.preview-overlay {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(5, 10, 19, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.hidden {
  display: none;
}

.call-setup {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  color: var(--muted);
  font-size: 13px;
}

.field input,
.field select {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  color: var(--text);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(5, 10, 19, 0.82);
  outline: none;
}

.field input:focus,
.field select:focus {
  border-color: rgba(34, 211, 238, 0.5);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.08);
}

.action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}

.monitor-quality-field {
  min-width: 150px;
  margin-left: auto;
}

.action-bar--secondary {
  margin-top: 16px;
  margin-bottom: 0;
}

.mode-switch {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px;
  border-radius: 999px;
  background: rgba(5, 10, 19, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.mode-button {
  height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  color: var(--text);
  cursor: pointer;
  background: transparent;
  transition: background 0.2s ease, transform 0.2s ease;
}

.mode-button:hover {
  transform: translateY(-1px);
}

.mode-button.is-active {
  color: #03131c;
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
}

.primary-button,
.danger-button,
.mini-button {
  height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  color: #03131c;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease, background 0.2s ease;
}

.primary-button {
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
}

.danger-button {
  color: white;
  background: linear-gradient(135deg, #ef4444, #fb7185);
}

.mini-button {
  height: 34px;
  padding: 0 12px;
  color: var(--text);
  background: rgba(34, 211, 238, 0.12);
  border: 1px solid rgba(34, 211, 238, 0.18);
}

.primary-button:hover,
.danger-button:hover,
.mini-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.primary-button:disabled,
.danger-button:disabled,
.mini-button:disabled,
.ghost-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.share-box {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.share-box span {
  color: var(--muted);
  font-size: 13px;
}

.share-box code,
.status-text {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(5, 10, 19, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #dbeafe;
}

.status-text {
  flex: 1;
}

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

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

.video-card {
  padding: 14px;
  border-radius: 20px;
  background: rgba(6, 13, 25, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.video-card__head,
.video-card__actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.video-card__head {
  margin-bottom: 10px;
}

.video-card span {
  color: var(--muted);
}

.video-card video {
  width: 100%;
  border-radius: 16px;
  aspect-ratio: 4 / 3;
  background: #02060d;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.video-card img {
  width: 100%;
  border-radius: 16px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #02060d;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.monitor-stack {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 16px;
  overflow: hidden;
  background: #02060d;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.monitor-stack img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  opacity: 1;
  transition: none;
}

#monitorImageB {
  display: none;
}

.video-card__hint {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 13px;
}

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

.metric-card,
.roadmap-item {
  padding: 16px;
  border-radius: 20px;
  background: rgba(6, 13, 25, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.metric-card__label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
}

.metric-card strong,
.detail-row strong {
  font-size: 18px;
}

.detail-list {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.detail-list--compact {
  margin-top: 16px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.detail-row span {
  color: var(--muted);
}

.detail-list--compact .detail-row strong {
  max-width: 60%;
  text-align: right;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
}

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

.api-list code {
  display: block;
  padding: 14px 16px;
  border-radius: 16px;
  color: #cffafe;
  background: rgba(5, 10, 19, 0.88);
  border: 1px solid rgba(34, 211, 238, 0.12);
}

.roadmap {
  display: grid;
  gap: 12px;
}

.roadmap-item span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-bottom: 12px;
  border-radius: 50%;
  font-family: Consolas, "Courier New", monospace;
  background: rgba(34, 211, 238, 0.12);
  color: var(--accent);
}

.roadmap-item p {
  margin-bottom: 0;
  color: var(--muted);
}

.ghost-button {
  height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(34, 211, 238, 0.2);
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.08);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.ghost-button:hover {
  transform: translateY(-1px);
  background: rgba(34, 211, 238, 0.16);
}

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

  .dashboard--call {
    grid-template-columns: 1fr;
  }

  .hero__content,
  .panel__head {
    flex-direction: column;
    align-items: start;
  }

  .hero__status {
    width: 100%;
  }

  .call-setup,
  .preflight-grid,
  .video-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 20px, 1220px);
    padding-top: 16px;
  }

  .hero,
  .panel {
    border-radius: 20px;
  }

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

  .preview-frame {
    min-height: 260px;
  }

  .action-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .mode-switch {
    display: grid;
    width: 100%;
  }

  .status-text {
    width: 100%;
  }
}
