:root {
  color-scheme: dark;
  --bg: #111418;
  --panel: #1a2028;
  --panel-2: #222a35;
  --text: #eef3f8;
  --muted: #9da8b5;
  --line: #33404f;
  --accent: #49a8ff;
  --danger: #ff6262;
  --ok: #50d88a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

.center-page {
  display: grid;
  place-items: center;
  padding: 24px;
}

.home,
.auth-card {
  width: min(560px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
}

h1,
h2,
p {
  margin-top: 0;
}

p,
.muted {
  color: var(--muted);
}

.actions,
.row,
.toolbar,
.auth-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.button,
button {
  border: 0;
  border-radius: 6px;
  padding: 10px 14px;
  background: var(--accent);
  color: #06111d;
  text-decoration: none;
  cursor: pointer;
  font-weight: 700;
}

.button.secondary,
button.secondary {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
}

input,
select {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  background: #0d1117;
  color: var(--text);
  min-width: 0;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.status {
  min-height: 22px;
  color: var(--muted);
}

.status.ok {
  color: var(--ok);
}

.status.bad {
  color: var(--danger);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.topbar h1 {
  font-size: 18px;
  margin: 0;
}

.desktop-main {
  display: grid;
  grid-template-columns: minmax(340px, 43vw) 1fr;
  gap: 14px;
  padding: 14px;
  min-height: 0;
}

.panel {
  min-width: 0;
  min-height: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.video-wrap {
  display: grid;
  place-items: center;
  min-height: 360px;
  height: calc(100vh - 150px);
  background: #05070a;
}

.video-wrap canvas,
.video-wrap img,
.video-wrap video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.grid-panel {
  display: grid;
  grid-template-rows: auto auto 1fr;
}

.grid-controls {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.card-grid {
  display: grid;
  gap: 10px;
  padding: 10px;
  overflow: auto;
  align-content: start;
}

.slot {
  position: relative;
  min-height: 150px;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #0b0f14;
}

.slot.active {
  outline: 2px solid var(--accent);
}

.slot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.slot-empty {
  height: 100%;
  display: grid;
  place-items: center;
  color: #556170;
}

.slot-meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 8px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .82) 24%);
  font-size: 12px;
  color: var(--text);
}

.phone-main {
  display: grid;
  grid-template-columns: minmax(260px, 360px) 1fr;
  gap: 14px;
  padding: 14px;
}

.phone-controls {
  padding: 14px;
}

.phone-video {
  min-height: calc(100vh - 92px);
}

.hidden {
  display: none !important;
}

@media (max-width: 900px) {
  .desktop-main,
  .phone-main {
    grid-template-columns: 1fr;
  }

  .video-wrap,
  .phone-video {
    height: auto;
    min-height: 340px;
  }
}
