:root {
  --bg: #e0f2fe;
  --bg-deep: #cffafe;
  --panel: #ffffff;
  --panel-tint: rgba(255, 255, 255, 0.88);
  --text: #0f172a;
  --muted: #64748b;
  --stroke: #bae6fd;
  --stroke-strong: #7dd3fc;
  --accent: #0ea5e9;
  --accent-mid: #22d3ee;
  --accent-soft: rgba(14, 165, 233, 0.12);
  --ok: #0d9488;
  --danger: #e11d48;
  --shadow: 0 16px 48px rgba(14, 165, 233, 0.11), 0 4px 14px rgba(15, 23, 42, 0.06);
}

* { box-sizing: border-box; }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  z-index: 10000;
  max-width: min(560px, calc(100% - 32px));
  padding: 12px 18px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0f766e 0%, #0e7490 100%);
  color: #ecfdf5;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 12px 32px rgba(15, 118, 110, 0.35);
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}
.toast.toastVisible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.loginGate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(145deg, #e0f2fe 0%, #ccfbf1 45%, #f0fdf4 100%);
  backdrop-filter: blur(8px);
}
.loginGate.hidden { display: none; }
.loginCard {
  width: min(400px, 100%);
  padding: 22px;
  border-radius: 18px;
  border: 1px solid rgba(125, 211, 252, 0.75);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.loginBrand { display: flex; gap: 12px; align-items: center; margin-bottom: 6px; }
.loginBrand .logo { flex-shrink: 0; width: 44px; height: 44px; border-radius: 12px; background: linear-gradient(135deg, #0ea5e9, #22c55e); box-shadow: 0 10px 24px rgba(14, 165, 233, 0.25); }
.loginTitle { font-weight: 800; letter-spacing: 0.2px; font-size: 17px; color: var(--text); }
.loginLabel { font-size: 12px; color: var(--muted); margin-top: 2px; }
.loginCaptchaRow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.captchaWrap {
  border: 1px solid var(--stroke-strong);
  border-radius: 10px;
  overflow: hidden;
  padding: 0;
  background: #f8fafc;
  cursor: pointer;
  line-height: 0;
}
.captchaWrap:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.captchaImg { display: block; vertical-align: top; }
.btnSmall { padding: 8px 10px; font-size: 12px; border-radius: 10px; }
.btnLoginBtn { margin-top: 8px; }
.loginErr {
  font-size: 13px;
  color: var(--danger);
  min-height: 1.2em;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji",
    "Segoe UI Emoji";
  color: var(--text);
  background:
    radial-gradient(1100px 520px at 12% -8%, rgba(34, 211, 238, 0.45) 0%, transparent 58%),
    radial-gradient(900px 460px at 92% 8%, rgba(52, 211, 153, 0.35) 0%, transparent 52%),
    linear-gradient(180deg, var(--bg) 0%, #f8fafc 55%, var(--bg-deep) 100%);
  min-height: 100vh;
}

.shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  grid-template-rows: 64px 1fr;
  min-height: 100vh;
}

.nav {
  grid-row: 1 / span 2;
  border-right: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(14px);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.navBrand { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 14px; background: linear-gradient(135deg, rgba(224, 242, 254, 0.9), rgba(236, 253, 245, 0.85)); border: 1px solid var(--stroke); }
.logo { width: 38px; height: 38px; border-radius: 12px; background: linear-gradient(135deg, #0ea5e9, #34d399); box-shadow: 0 10px 24px rgba(14, 165, 233, 0.22); }
.brandText .title { font-weight: 800; letter-spacing: 0.2px; }
.navSection { margin-top: 10px; font-size: 12px; color: var(--muted); padding: 6px 8px; }
.navItem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(186, 230, 253, 0.8);
  background: rgba(255, 255, 255, 0.55);
  color: var(--text);
  cursor: pointer;
}
.navItem:hover { border-color: var(--accent-mid); background: rgba(255,255,255,0.95); box-shadow: 0 6px 20px rgba(14, 165, 233, 0.09); }
.navItem.active {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(224, 242, 254, 0.95), rgba(236, 253, 245, 0.9));
  box-shadow: 0 8px 22px rgba(14, 165, 233, 0.12);
}
.navFooter { margin-top: auto; padding: 10px 8px; border-top: 1px solid var(--stroke); }

.topbar {
  grid-column: 2;
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px);
}
.topLeft { display: flex; flex-direction: column; gap: 2px; }
.pageTitle { font-weight: 850; letter-spacing: 0.2px; }
.pageSub { font-size: 12px; }
.topRight { display: flex; gap: 10px; align-items: center; }
.muted { color: var(--muted); font-size: 12px; }

.content { grid-column: 2; padding: 14px; min-width: 0; }
.page { min-width: 0; }
.hidden { display: none; }
.grid2 { display: grid; grid-template-columns: 380px 1fr; gap: 14px; }

.card, .panel {
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.card { padding: 12px; }
.cardTitle { font-weight: 650; margin-bottom: 10px; }
.row { display: flex; gap: 8px; align-items: center; }
.hint { margin-top: 8px; line-height: 1.5; }
.divider {
  height: 1px;
  background: var(--stroke);
  margin: 12px 0;
}

.input {
  flex: 1;
  background: #f8fafc;
  border: 1px solid var(--stroke);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 10px;
  outline: none;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2); }
.inputSmall { width: 280px; flex: 0 0 auto; }

.btn {
  background: linear-gradient(180deg, #22d3ee 0%, #0ea5e9 48%, #0284c7 100%);
  color: #f0f9ff;
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  font-weight: 650;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(14, 165, 233, 0.28);
}
.btn:hover { filter: brightness(1.06); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; filter: none; }
.btn.btnGhost {
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  border: 1px solid var(--stroke-strong);
  box-shadow: none;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--stroke);
  background: #f8fafc;
  color: var(--text);
  border-radius: 999px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 12px;
}
.chip.active { border-color: var(--accent); background: var(--accent-soft); color: #0369a1; }

.list { display: flex; flex-direction: column; gap: 8px; }
.item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid rgba(186, 230, 253, 0.9);
  cursor: pointer;
}
.item:hover { border-color: var(--accent-mid); background: #ffffff; }
.item.active {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(224, 242, 254, 0.55), rgba(236, 253, 245, 0.5));
}
.left { min-width: 0; }
.name { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: #f1f5f9;
  color: var(--muted);
}
.badge.online { color: #0f766e; border-color: rgba(45, 212, 191, 0.65); background: rgba(167, 243, 208, 0.45); }
.badge.offline { color: #be123c; border-color: rgba(251, 113, 133, 0.55); background: rgba(254, 205, 211, 0.38); }

.panel { padding: 12px; min-height: 520px; }
.panelHeader { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panelTitle { font-size: 16px; font-weight: 750; }
.panelSub { margin-top: 4px; }
.panelActions { display: flex; gap: 8px; }

.tabs { display: flex; gap: 8px; margin-top: 12px; }
.tab {
  border: 1px solid var(--stroke);
  background: #f8fafc;
  color: var(--text);
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
}
.tab.active { border-color: var(--accent); background: var(--accent-soft); color: #0369a1; font-weight: 650; }

.tabBody { margin-top: 12px; }

.liveWrap { display: flex; flex-direction: column; gap: 10px; }
.liveImg {
  width: 100%;
  max-height: 520px;
  object-fit: contain;
  border-radius: 14px;
  border: 1px solid var(--stroke-strong);
  background: linear-gradient(180deg, #f8fafc, #eef2ff);
}

.historyHeader { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.shot {
  background: #ffffff;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(14, 116, 144, 0.07);
}
.shot img { width: 100%; height: 140px; object-fit: cover; display: block; }
.shotMeta { padding: 10px; font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; }

@media (max-width: 1100px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .nav { grid-row: auto; grid-column: 1; flex-direction: row; align-items: center; overflow: auto; }
  .navBrand { min-width: 260px; }
  .topbar { grid-column: 1; }
  .content { grid-column: 1; }
  .grid2 { grid-template-columns: 1fr; }
}

.table {
  border: 1px solid var(--stroke);
  border-radius: 14px;
  overflow: hidden;
  background: #ffffff;
}
.tr {
  display: grid;
  grid-template-columns: 34px 1.2fr 1fr 110px 110px;
  gap: 10px;
  padding: 10px 10px;
  border-bottom: 1px solid #e2e8f0;
  align-items: center;
}
.tr.header { font-size: 12px; color: var(--muted); background: linear-gradient(180deg, #f8fafc, #f1f5f9); }
.tr:last-child { border-bottom: none; }
.checkbox { width: 16px; height: 16px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 12px; }

