/* 运营控制台 · 夜班导播台气质（非紫渐变 / 非奶油陶土 / 非报章风） */
:root {
  --bg0: #0c1218;
  --bg1: #121b24;
  --panel: #17222d;
  --panel-2: #1d2a37;
  --line: rgba(232, 214, 176, 0.14);
  --text: #f2ebe0;
  --muted: #9aa8b5;
  --accent: #e8a838;
  --accent-2: #3db8a8;
  --warn: #d4923a;
  --danger-ink: #f0c9a0;
  --ok-ink: #b7e0d4;
  --info-ink: #a8c7e8;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  --radius: 14px;
  --font-display: "Outfit", "Noto Sans SC", sans-serif;
  --font-body: "Noto Sans SC", "Outfit", sans-serif;
  --focus: 0 0 0 3px rgba(61, 184, 168, 0.45);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  font-family: var(--font-body);
  background: var(--bg0);
}

body {
  position: relative;
  min-height: 100vh;
}

.bg-atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 480px at 12% -10%, rgba(232, 168, 56, 0.16), transparent 60%),
    radial-gradient(700px 420px at 90% 0%, rgba(61, 184, 168, 0.12), transparent 55%),
    linear-gradient(165deg, var(--bg0), var(--bg1) 45%, #0a1015 100%);
}

.bg-atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(242, 235, 224, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(242, 235, 224, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 78%);
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.01em;
  margin: 0 0 0.35em;
}

h1 {
  font-size: clamp(1.45rem, 2vw, 1.85rem);
}

h2 {
  font-size: clamp(1.25rem, 1.8vw, 1.55rem);
}

h3 {
  font-size: 1.05rem;
}

p {
  margin: 0 0 0.75rem;
  line-height: 1.55;
}

.lede {
  color: var(--muted);
  max-width: 52ch;
}

.muted {
  color: var(--muted);
  font-size: 0.92rem;
}

.brand-mark {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  color: var(--accent);
}

code {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.9em;
  color: var(--accent-2);
}

a {
  color: var(--accent-2);
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

/* display:flex/grid 会盖掉原生 [hidden]，必须强制隐藏——否则登录页与主壳叠成「往下滚」 */
[hidden] {
  display: none !important;
}

.login-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 12px;
}

.app-shell {
  height: 100vh;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
  background: rgba(12, 18, 24, 0.72);
  z-index: 2;
}

.topbar-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.shell-body {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 0;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 12px;
  border-right: 1px solid var(--line);
  background: rgba(18, 27, 36, 0.65);
  overflow-y: auto;
  min-height: 0;
}

.nav-item {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  text-align: left;
  font: inherit;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.nav-item:hover {
  background: rgba(232, 168, 56, 0.08);
}

.nav-item.active {
  background: linear-gradient(120deg, rgba(232, 168, 56, 0.18), rgba(61, 184, 168, 0.1));
  border-color: rgba(232, 168, 56, 0.35);
}

.view-root {
  padding: 20px 22px 48px;
  max-width: 1280px;
  width: 100%;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-behavior: smooth;
}

/* 检阅等双栏页：限制在主区内滚动，避免整页被拉长 */
.split-pane {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(320px, 1.2fr);
  gap: 14px;
  align-items: stretch;
  min-height: min(70vh, 720px);
  max-height: calc(100vh - 160px);
}

.split-pane > .card {
  overflow: auto;
  min-height: 0;
}

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

  .side-nav {
    flex-direction: row;
    flex-wrap: wrap;
    border-right: none;
    border-bottom: 1px solid var(--line);
    max-height: none;
  }

  .split-pane {
    max-height: none;
  }
}

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

.card {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}

.card.tight {
  padding: 12px 14px;
}

.placeholder-card .hero-metric {
  margin-bottom: 8px;
}

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

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

.stat-card .stat-label {
  color: var(--muted);
  margin: 0;
  font-size: 0.85rem;
}

.stat-card .stat-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  margin: 4px 0;
  color: var(--accent);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stack.gap-lg {
  gap: 16px;
}

.row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.row.wrap {
  flex-wrap: wrap;
}

.row.align-end {
  align-items: flex-end;
}

.grow {
  flex: 1;
  min-width: 180px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 16px;
}

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

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(8, 12, 16, 0.55);
  color: var(--text);
  padding: 10px 12px;
}

textarea {
  resize: vertical;
  min-height: 72px;
}

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

.btn {
  appearance: none;
  border: 1px solid rgba(232, 168, 56, 0.55);
  background: linear-gradient(180deg, #f0b84a, #d4922a);
  color: #1a1206;
  font-weight: 700;
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease, opacity 0.15s ease;
}

.btn:hover:not(:disabled) {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.btn:disabled,
.btn.is-loading {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn.secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
  font-weight: 600;
}

.btn.sm {
  padding: 6px 10px;
  font-size: 0.85rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 0.78rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.chip-ok {
  border-color: rgba(61, 184, 168, 0.45);
  color: var(--ok-ink);
  background: rgba(61, 184, 168, 0.12);
}

.chip-warn {
  border-color: rgba(212, 146, 58, 0.5);
  color: var(--danger-ink);
  background: rgba(212, 146, 58, 0.14);
}

.chip-info {
  border-color: rgba(168, 199, 232, 0.45);
  color: var(--info-ink);
  background: rgba(168, 199, 232, 0.12);
}

.chip-muted {
  color: var(--muted);
}

.chip-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.plain-list {
  margin: 0;
  padding-left: 1.1rem;
}

.plain-list li + li {
  margin-top: 6px;
}

.warn-list {
  color: var(--danger-ink);
}

.hero-metric {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  color: var(--accent-2);
  margin: 0.2rem 0 0.6rem;
}

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.row-click {
  cursor: pointer;
}

.row-click:hover td {
  background: rgba(232, 168, 56, 0.06);
}

.row-click.is-selected td {
  background: rgba(61, 184, 168, 0.1);
}

.preview-video {
  display: block;
  width: 100%;
  max-width: 360px;
  max-height: min(52vh, 560px);
  margin: 0 auto;
  border-radius: 12px;
  background: #000;
  object-fit: contain;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.data-table th {
  color: var(--muted);
  font-weight: 600;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cell-note {
  margin-top: 4px;
  color: var(--danger-ink);
  font-size: 0.8rem;
}

.empty {
  color: var(--muted);
  padding: 18px;
}

.error-banner {
  margin: 0;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(212, 146, 58, 0.55);
  background: rgba(212, 146, 58, 0.12);
  color: var(--danger-ink);
}

.form-msg {
  margin: 0;
  font-size: 0.9rem;
}

.form-msg.is-ok {
  color: var(--ok-ink);
}

.form-msg.is-error {
  color: var(--danger-ink);
}

.sticky-actions {
  position: sticky;
  bottom: 12px;
  z-index: 2;
}

.evidence-card {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 12px;
  margin: 0 0 12px;
}

.evidence-card legend {
  padding: 0 6px;
  color: var(--accent);
  font-weight: 700;
}

.code-block {
  margin: 0;
  padding: 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  overflow: auto;
  max-height: 280px;
  font-size: 0.82rem;
  color: var(--muted);
}

.toast-host {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 50;
  display: grid;
  gap: 8px;
}

.toast {
  min-width: 220px;
  max-width: 360px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  animation: toast-in 0.22s ease;
}

.toast.is-error {
  border-color: rgba(212, 146, 58, 0.55);
  color: var(--danger-ink);
}

.toast.is-out {
  opacity: 0;
  transform: translateY(6px);
  transition: 0.25s ease;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 1280px) {
  .view-root {
    max-width: 100%;
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .shell-body {
    grid-template-columns: 1fr;
  }

  .side-nav {
    flex-direction: row;
    flex-wrap: wrap;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .nav-item {
    flex: 1 1 auto;
    text-align: center;
    min-width: calc(50% - 8px);
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .grid-2,
  .form-grid,
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .page-head {
    flex-direction: column;
  }

  .view-root {
    padding: 14px 12px 40px;
  }
}
