:root {
  color-scheme: dark;
  --bg: #101215;
  --panel: #181c21;
  --line: #262c33;
  --fg: #e6e9ee;
  --dim: #8b949e;
  --ok: #3fb950;
  --warn: #d29922;
  --err: #f85149;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 14px/1.5 system-ui, "Segoe UI", "Microsoft YaHei", sans-serif;
}

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

h1 { font-size: 16px; margin: 0; }
h2 { font-size: 13px; margin: 16px 0 8px; color: var(--dim); font-weight: 600; }

.token-row { display: flex; gap: 8px; }

input, button {
  background: var(--panel);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 10px;
  font: inherit;
}

button { cursor: pointer; }
button:hover { border-color: var(--dim); }

main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  padding: 16px;
}

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

.video-wrap { position: relative; background: #000; border-radius: 8px; overflow: hidden; }

video { width: 100%; display: block; aspect-ratio: 16 / 9; background: #000; }

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dim);
  pointer-events: none;
  font-size: 15px;
}

.overlay.hidden { display: none; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  min-width: 0;
}

table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: var(--dim); font-weight: 500; width: 84px; padding: 3px 0; }
td { padding: 3px 0; font-variant-numeric: tabular-nums; }

#log {
  max-height: 220px;
  overflow: auto;
  margin: 0;
  font-size: 12px;
  color: var(--dim);
  white-space: pre-wrap;
  word-break: break-all;
}

.ok { color: var(--ok); }
.warn { color: var(--warn); }
.err { color: var(--err); }

/* ---- 极简全屏模式：URL 带 SN/链路（如 /SN-66032317）时，只留全屏视频 ---- */
html.minimal header,
html.minimal .panel { display: none; }

html.minimal main { display: block; padding: 0; }
html.minimal .video-wrap { border-radius: 0; height: 100vh; }
html.minimal video {
  width: 100vw;
  height: 100vh;
  aspect-ratio: auto;
  object-fit: contain;
}

/* 排障/全屏提示默认隐藏，仅在极简模式出现 */
#fshint { display: none; }
#fshint.hidden { display: none; }

html.minimal #fshint {
  display: block;
  position: fixed;
  left: 50%;
  bottom: 6vh;
  transform: translateX(-50%);
  color: var(--dim);
  font-size: 14px;
  pointer-events: none;
}

html.minimal #diagBtn {
  position: fixed;
  right: 12px;
  top: 12px;
  opacity: .55;
}

html.minimal.idle { cursor: none; }
