﻿:root {
  --ink: #e8fbff;
  --muted: #a5c7d2;
  --paper: #071118;
  --panel: rgba(8, 24, 34, 0.76);
  --line: rgba(176, 239, 255, 0.20);
  --accent: #9eefff;
  --accent-dark: #0b7ea5;
  --green: #41f0a2;
  --red: #ff5574;
  --amber: #ffd166;
  --black: #02070b;
  --shadow: 0 24px 90px rgba(0, 220, 255, 0.10), 0 0 0 1px rgba(53, 217, 255, 0.10);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 15% 12%, rgba(53, 217, 255, 0.18), transparent 28rem),
    radial-gradient(circle at 85% 8%, rgba(65, 240, 162, 0.14), transparent 26rem),
    radial-gradient(circle at 50% 100%, rgba(74, 85, 255, 0.16), transparent 30rem),
    linear-gradient(135deg, #040b12 0%, #07131d 48%, #02070b 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  opacity: 0.54;
  background-image:
    linear-gradient(rgba(53, 217, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(53, 217, 255, 0.07) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at center, #000, transparent 82%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 0%, rgba(53, 217, 255, 0.035) 50%, transparent 100%);
  background-size: 100% 8px;
  animation: scanline 8s linear infinite;
}

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

button {
  border: 1px solid rgba(53, 217, 255, 0.34);
  border-radius: 12px;
  padding: 0.82rem 1.08rem;
  color: #eaffff;
  background: linear-gradient(135deg, rgba(53, 217, 255, 0.92), rgba(11, 126, 165, 0.84));
  cursor: pointer;
  box-shadow: 0 0 24px rgba(53, 217, 255, 0.20), inset 0 1px 0 rgba(255,255,255,0.18);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

button:hover {
  transform: translateY(-1px);
  border-color: rgba(65, 240, 162, 0.55);
  box-shadow: 0 0 34px rgba(53, 217, 255, 0.32), inset 0 1px 0 rgba(255,255,255,0.22);
}

button.ghost {
  color: var(--ink);
  background: rgba(10, 32, 44, 0.70);
  border-color: rgba(131, 167, 181, 0.28);
  box-shadow: none;
}

.form-actions, .variable-actions {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
}

button.danger {
  background: linear-gradient(135deg, #ff5574, #92213a);
  border-color: rgba(255, 85, 116, 0.55);
  box-shadow: 0 0 26px rgba(255, 85, 116, 0.20);
}

input, textarea, select {
  width: 100%;
  border: 1px solid rgba(78, 220, 255, 0.20);
  border-radius: 12px;
  padding: 0.84rem 0.95rem;
  color: var(--ink);
  background: rgba(2, 12, 18, 0.72);
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02);
}

input:focus, textarea:focus, select:focus {
  border-color: rgba(53, 217, 255, 0.65);
  box-shadow: 0 0 0 3px rgba(53, 217, 255, 0.12), inset 0 0 0 1px rgba(255,255,255,0.04);
}

textarea { resize: vertical; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.78rem 0.58rem; border-bottom: 1px solid rgba(78, 220, 255, 0.13); text-align: left; vertical-align: top; }
th { color: #7ddff6; font-size: 0.78rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.07em; }
tr:hover td { background: rgba(53, 217, 255, 0.035); }

.app-nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 0.65rem;
  max-width: 1440px; margin: 0 auto; padding: 0.9rem 2rem;
  backdrop-filter: blur(20px);
}

.app-nav a, .app-nav button, .nav-user {
  border: 1px solid rgba(78, 220, 255, 0.20);
  border-radius: 999px;
  padding: 0.55rem 0.88rem;
  color: var(--ink);
  background: rgba(6, 20, 30, 0.66);
  text-decoration: none;
  box-shadow: 0 0 18px rgba(53, 217, 255, 0.06);
}

.app-nav a.active {
  color: #021018;
  background: linear-gradient(135deg, #41f0a2, #35d9ff);
  border-color: rgba(65, 240, 162, 0.68);
  box-shadow: 0 0 26px rgba(65, 240, 162, 0.24);
}

.app-nav .brand { font-weight: 950; letter-spacing: 0.04em; text-transform: uppercase; }
.nav-user { margin-left: auto; color: var(--muted); }

.hero { display: flex; align-items: center; justify-content: space-between; gap: 2rem; max-width: 1440px; margin: 0 auto; padding: 3rem 2rem 1.2rem; }
.compact-hero { padding-top: 1.4rem; }
.eyebrow { margin: 0 0 0.45rem; color: var(--green); font-weight: 900; letter-spacing: 0.16em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0.55rem; font-size: clamp(2.2rem, 5vw, 4.8rem); line-height: 0.96; letter-spacing: -0.07em; text-shadow: 0 0 28px rgba(53, 217, 255, 0.16); }
h2 { margin-bottom: 0; font-size: 1.05rem; letter-spacing: 0.02em; }
.hero-copy { max-width: 46rem; color: var(--muted); font-size: 1.08rem; }

.hud-scope {
  position: relative;
  width: min(30vw, 300px);
  height: 190px;
  border: 1px solid rgba(78, 220, 255, 0.22);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(53, 217, 255, 0.08), transparent 42%),
    rgba(3, 15, 23, 0.46);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03), 0 0 46px rgba(53,217,255,0.12);
  overflow: hidden;
}

.hud-scope::before,
.hud-scope::after {
  content: "";
  position: absolute;
  width: 46px;
  height: 46px;
  border-color: var(--accent);
  opacity: 0.72;
}

.hud-scope::before {
  left: 16px;
  top: 16px;
  border-left: 2px solid;
  border-top: 2px solid;
}

.hud-scope::after {
  right: 16px;
  bottom: 16px;
  border-right: 2px solid;
  border-bottom: 2px solid;
}

.hud-ring {
  position: absolute;
  right: 34px;
  top: 26px;
  width: 116px;
  height: 116px;
  border-radius: 999px;
  border: 1px solid rgba(53,217,255,0.35);
  background:
    radial-gradient(circle, transparent 0 42%, rgba(53,217,255,0.08) 43% 44%, transparent 45%),
    conic-gradient(from 90deg, rgba(65,240,162,0.9), rgba(53,217,255,0.12), rgba(53,217,255,0.65), rgba(65,240,162,0.9));
  mask-image: radial-gradient(circle, transparent 0 52%, #000 53%);
  animation: hudRotate 10s linear infinite;
}

.hud-grid {
  position: absolute;
  left: 24px;
  top: 28px;
  display: grid;
  grid-template-columns: repeat(3, 28px);
  gap: 10px;
}

.hud-grid span {
  width: 28px;
  height: 20px;
  border: 1px solid rgba(78, 220, 255, 0.30);
  background: rgba(53,217,255,0.05);
  animation: hudBlink 2.6s ease-in-out infinite;
}

.hud-grid span:nth-child(2n) {
  animation-delay: -0.8s;
}

.hud-grid span:nth-child(3n) {
  animation-delay: -1.6s;
}

.hud-readout {
  position: absolute;
  left: 24px;
  bottom: 24px;
  display: grid;
  gap: 0.25rem;
}

.hud-readout b {
  color: var(--accent);
  font-size: 0.84rem;
  letter-spacing: 0.18em;
}

.hud-readout em {
  color: var(--green);
  font-size: 1.35rem;
  font-style: normal;
  font-weight: 950;
  letter-spacing: 0.08em;
}

.layout { display: grid; grid-template-columns: minmax(320px, 0.9fr) minmax(420px, 1.2fr); gap: 1rem; max-width: 1440px; margin: 0 auto; padding: 1rem 2rem 2.5rem; }
.accounts-layout { display: block; max-width: 1680px; }
.panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 1.15rem;
  background: linear-gradient(180deg, rgba(10, 32, 44, 0.78), rgba(4, 14, 22, 0.72));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  overflow: hidden;
}
.panel::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(135deg, rgba(53,217,255,0.12), transparent 30%, rgba(65,240,162,0.08)); opacity: 0.7; }
.panel > * { position: relative; z-index: 1; }
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }

.collapsible-panel {
  margin-top: 0.75rem;
  border: 1px solid rgba(78, 220, 255, 0.16);
  border-radius: 14px;
  background: rgba(2, 12, 18, 0.28);
}

.collapsible-panel > summary {
  padding: 0.85rem 1rem;
  color: var(--accent);
  font-weight: 800;
  cursor: pointer;
  list-style-position: inside;
}

.collapsible-panel > summary:hover { background: rgba(53, 217, 255, 0.06); }
.collapse-hint { float: right; color: var(--muted); font-size: 0.78rem; font-weight: 500; }
.collapsible-content { padding: 0 1rem 1rem; }

.status-grid, .server-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.85rem; }
.status-grid article, .server-grid div, .kv-list div {
  border: 1px solid rgba(210, 246, 255, 0.20);
  border-radius: 18px;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.055);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.status-grid span, .server-grid strong { display: block; font-size: 1.85rem; font-weight: 950; }
.status-grid small, .server-grid small, .kv-list span { color: var(--muted); }
.kv-list { display: grid; gap: 0.65rem; }
.kv-list div { display: flex; justify-content: space-between; }

.dashboard-panel, .server-panel, .queue-panel, .top-console { animation: riseIn 0.7s ease both; }
.server-panel { animation-delay: 0.08s; }
.queue-panel { animation-delay: 0.16s; }
.metric-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-height: 116px;
  overflow: hidden;
  border-radius: 20px !important;
  border-color: rgba(205, 245, 255, 0.24) !important;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.14), rgba(255,255,255,0.035) 48%, rgba(122,231,255,0.08)),
    rgba(9, 29, 41, 0.38) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.20),
    inset 0 -1px 0 rgba(255,255,255,0.05),
    0 22px 60px rgba(0, 20, 32, 0.28);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.metric-card::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background:
    linear-gradient(115deg, rgba(255,255,255,0.22), transparent 34%),
    radial-gradient(circle at 18% 14%, color-mix(in srgb, var(--metric, var(--accent)) 28%, transparent), transparent 44%);
  opacity: 0.78;
  pointer-events: none;
}

.metric-card::after {
  content: "";
  position: absolute;
  right: -22px;
  top: -24px;
  width: 96px;
  height: 96px;
  border-radius: 999px;
  opacity: 0.28;
  background:
    radial-gradient(circle, color-mix(in srgb, var(--metric, var(--accent)) 60%, transparent), transparent 68%);
  filter: blur(2px);
}

.metric-card:hover {
  transform: translateY(-2px);
  border-color: rgba(220, 250, 255, 0.36) !important;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.18), rgba(255,255,255,0.05) 52%, rgba(122,231,255,0.11)),
    rgba(11, 35, 48, 0.48) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.25),
    0 28px 70px rgba(80, 211, 235, 0.16);
}

.metric-card i {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 1px solid color-mix(in srgb, var(--metric, var(--accent)) 38%, rgba(255,255,255,0.18));
  border-radius: 17px;
  color: color-mix(in srgb, var(--metric, var(--accent)) 78%, #ffffff);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.22);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 950;
  letter-spacing: 0.09em;
}

.metric-card div,
.metric-card span,
.metric-card small {
  position: relative;
  z-index: 1;
}
.accent-a { --metric: #9eefff; } .accent-b { --metric: #a8f6ce; } .accent-c { --metric: #ffe4a3; } .accent-d { --metric: #c6c0ff; } .accent-e { --metric: #ffc2e9; } .accent-f { --metric: #b6f3ff; }

.server-focus { display: grid; grid-template-columns: repeat(2, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.server-stat-card {
  min-height: 140px;
  border-radius: 20px !important;
}
.server-stat-card span {
  display: block;
  font-size: 2rem;
  font-weight: 950;
  line-height: 1.1;
}
.server-stat-card small {
  color: var(--muted);
}
.live-pill { display: inline-flex; align-items: center; gap: 0.45rem; border-radius: 999px; padding: 0.32rem 0.72rem; color: #04130d; background: var(--green); font-size: 0.82rem; font-weight: 950; box-shadow: 0 0 20px rgba(65,240,162,0.22); }
.live-pill b { width: 0.5rem; height: 0.5rem; border-radius: 999px; background: #04130d; animation: livePulse 1.4s ease-in-out infinite; }
.server-grid.refined { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

.stack, .grid-form { display: grid; gap: 0.75rem; }
.field { display: grid; gap: 0.38rem; }
.field > span { color: var(--ink); font-size: 0.88rem; font-weight: 850; }
.field > small { color: var(--muted); font-size: 0.78rem; line-height: 1.45; }
.variable-guide { display: grid; gap: 0.45rem; padding: 0.85rem; border: 1px solid rgba(53,217,255,0.26); border-radius: 16px; background: rgba(53,217,255,0.07); }
.variable-guide strong { color: var(--green); }
.variable-guide p { margin: 0; color: var(--muted); font-size: 0.86rem; line-height: 1.55; }
code { border-radius: 0.35rem; padding: 0.08rem 0.28rem; color: #b9f7ff; background: rgba(53,217,255,0.10); }
.inline-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.inline-fields.compact { grid-template-columns: repeat(2, minmax(8rem, 12rem)); }
.task-layout { grid-template-columns: minmax(320px, 0.78fr) minmax(520px, 1.22fr); align-items: start; }
.task-list-panel { grid-column: 1 / -1; }
.compose-detail textarea[name="body_template"] { min-height: 22rem; }
.grid-form { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.grid-form > .field, .grid-form button { grid-column: span 2; }
.check { display: flex; align-items: center; gap: 0.6rem; color: var(--muted); }
.check input { width: auto; }
.proxy-layout { grid-template-columns: 1fr; }
.proxy-settings-panel { animation: riseIn 0.7s ease both; }
.proxy-strategy-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 0.85rem;
  align-items: stretch;
}
.strategy-card, .proxy-enable-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  border: 1px solid rgba(78,220,255,0.18);
  border-radius: 18px;
  padding: 0.9rem;
  background:
    linear-gradient(135deg, rgba(53,217,255,0.10), rgba(33,52,91,0.18)),
    rgba(255,255,255,0.04);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.10);
  cursor: pointer;
}
.strategy-card input { width: auto; accent-color: var(--green); }
.strategy-card strong, .proxy-enable-card strong { display: block; color: var(--ink); font-weight: 950; }
.strategy-card small, .proxy-enable-card small { display: block; color: var(--muted); line-height: 1.45; }
.strategy-card:has(input:checked) {
  border-color: rgba(53,217,255,0.58);
  box-shadow: 0 0 0 1px rgba(53,217,255,0.16), 0 16px 34px rgba(53,217,255,0.08);
}
.proxy-strategy-grid button { min-width: 8rem; }
.proxy-update-card { grid-column: span 2; }
.proxy-update-card input { width: auto; accent-color: var(--green); }
.proxy-update-minutes { grid-column: span 1; }
.proxy-settings-status {
  grid-column: span 2;
  display: grid;
  gap: 0.25rem;
  align-content: center;
  border: 1px solid rgba(78,220,255,0.16);
  border-radius: 16px;
  padding: 0.85rem 1rem;
  background: rgba(255,255,255,0.04);
}
.proxy-settings-status span { color: var(--ink); font-weight: 850; }
.proxy-settings-status small { color: var(--muted); }
.proxy-enable-card {
  grid-column: span 2;
  min-height: 4.65rem;
}
.proxy-enable-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.toggle-visual {
  position: relative;
  flex: 0 0 3.2rem;
  width: 3.2rem;
  height: 1.72rem;
  border-radius: 999px;
  background: rgba(148,163,184,0.34);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.14);
  transition: 0.2s ease;
}
.toggle-visual::after {
  content: "";
  position: absolute;
  top: 0.22rem;
  left: 0.22rem;
  width: 1.28rem;
  height: 1.28rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 6px 14px rgba(0,0,0,0.22);
  transition: 0.2s ease;
}
.proxy-enable-card input:checked + .toggle-visual {
  background: linear-gradient(90deg, var(--green), var(--accent));
}
.proxy-enable-card input:checked + .toggle-visual::after {
  transform: translateX(1.48rem);
}
.proxy-enable-card:has(input:checked) {
  border-color: rgba(53,217,255,0.52);
  background:
    linear-gradient(135deg, rgba(53,217,255,0.16), rgba(33,52,91,0.20)),
    rgba(255,255,255,0.05);
}
.proxy-api-box {
  border: 1px solid rgba(53,217,255,0.18);
  border-radius: 18px;
  padding: 1rem;
  background:
    radial-gradient(circle at top left, rgba(53,217,255,0.18), transparent 34%),
    linear-gradient(135deg, rgba(8,20,38,0.72), rgba(20,36,68,0.44)),
    rgba(255,255,255,0.035);
  box-shadow: 0 18px 45px rgba(2,8,23,0.18), inset 0 1px 0 rgba(255,255,255,0.10);
}
.proxy-api-box summary { margin-bottom: 0.75rem; }
.proxy-fetch-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.42fr);
  gap: 0.9rem;
  align-items: start;
}
.proxy-api-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem;
  border: 1px solid rgba(53,217,255,0.18);
  border-radius: 16px;
  background: rgba(255,255,255,0.055);
}
.proxy-api-icon {
  display: grid;
  place-items: center;
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 16px;
  color: #031018;
  background: linear-gradient(135deg, var(--green), var(--accent));
  font-weight: 950;
  letter-spacing: 0.04em;
  box-shadow: 0 12px 30px rgba(53,217,255,0.22);
}
.proxy-api-head strong { display: block; color: var(--ink); font-weight: 950; }
.proxy-api-head small { display: block; color: var(--muted); margin-top: 0.18rem; }
.proxy-fetch-form .proxy-url-field { grid-column: 1 / 2; }
.proxy-api-options {
  grid-column: 2 / 3;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}
.proxy-fetch-form .proxy-header-field { grid-column: 1 / 2; }
.proxy-api-actions {
  grid-column: 2 / 3;
  display: grid;
  gap: 0.75rem;
  align-self: stretch;
}
.proxy-api-actions button { min-height: 3rem; }
.proxy-api-result {
  grid-column: 1 / -1;
  max-height: 220px;
  margin: 0;
  overflow: auto;
  border: 1px solid rgba(90,105,130,0.28);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  background: rgba(5,10,20,0.78);
  color: #d7e4ff;
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-size: 0.86rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.badge, .status { display: inline-flex; align-items: center; border-radius: 999px; padding: 0.25rem 0.65rem; color: #021018; background: var(--accent); font-size: 0.8rem; font-weight: 900; }
.status.ok, .status.done { color: #03150d; background: var(--green); }
.status.bad, .status.fail { color: #fff; background: var(--red); }
.status.pause { color: #031018; background: var(--amber); }
.importer { margin: 0.9rem 0; }
.importer summary { color: var(--green); cursor: pointer; font-weight: 850; }
.importer textarea { margin: 0.75rem 0; }
.bulk-check { display: grid; gap: 0.75rem; margin: 1rem 0; }
.bulk-check button { width: fit-content; }
.account-test-results {
  max-height: 260px;
  margin: 0;
  overflow: auto;
  border: 1px solid rgba(90,105,130,0.28);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  background: #0c1220;
  color: #d7e4ff;
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-size: 0.86rem;
  line-height: 1.55;
  white-space: pre-wrap;
}
.account-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin: 1rem 0;
}
.account-stats-grid article {
  border: 1px solid rgba(78,220,255,0.18);
  border-radius: 18px;
  padding: 1rem;
  background:
    radial-gradient(circle at top left, rgba(53,217,255,0.14), transparent 38%),
    rgba(255,255,255,0.045);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.10);
}
.account-stats-grid span {
  display: block;
  color: var(--ink);
  font-size: 1.9rem;
  font-weight: 950;
}
.account-stats-grid small { color: var(--muted); }
.account-table-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin: 0.9rem 0;
}
.pager-controls {
  display: flex;
  align-items: end;
  gap: 0.55rem;
}
.compact-select {
  min-width: 6.5rem;
  gap: 0.25rem;
}
.compact-select span { font-size: 0.78rem; }
.danger-text { color: var(--red); font-weight: 850; }
.table-wrap { overflow-x: auto; }
.accounts-table-wrap { width: 100%; }
.accounts-table {
  min-width: 1160px;
  table-layout: fixed;
}
.accounts-table th:nth-child(1),
.accounts-table td:nth-child(1) { width: 25%; }
.accounts-table th:nth-child(2),
.accounts-table td:nth-child(2) { width: 24%; }
.accounts-table th:nth-child(3),
.accounts-table td:nth-child(3) { width: 12%; }
.accounts-table th:nth-child(4),
.accounts-table td:nth-child(4) { width: 14%; }
.accounts-table th:nth-child(5),
.accounts-table td:nth-child(5) { width: 10%; }
.accounts-table th:nth-child(6),
.accounts-table td:nth-child(6) { width: 15%; }
.accounts-table td {
  word-break: break-word;
}
.accounts-table td:last-child {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.accounts-table td:last-child button {
  padding: 0.48rem 0.62rem;
  white-space: nowrap;
}
.file-line { display: grid; gap: 0.4rem; padding: 0.75rem; border: 1px dashed rgba(78,220,255,0.24); border-radius: 16px; background: rgba(53,217,255,0.06); }
.info-card { padding: 0.9rem; border: 1px solid rgba(78,220,255,0.18); border-radius: 16px; background: rgba(53,217,255,0.06); line-height: 1.7; word-break: break-all; }
.section-kicker { margin: 0 0 0.25rem; color: var(--green); font-size: 0.72rem; font-weight: 950; letter-spacing: 0.16em; text-transform: uppercase; }
.tracking-page .hero-copy { max-width: 58rem; }
.tracking-layout { grid-template-columns: minmax(420px, 1fr) minmax(300px, 0.42fr); align-items: start; }
.tracking-full-layout { display: block; }
.tracking-config-panel, .tracking-guide-panel, .tracking-report-panel {
  border-color: rgba(142, 239, 255, 0.26);
  background:
    radial-gradient(circle at 8% 0%, rgba(65,240,162,0.12), transparent 22rem),
    radial-gradient(circle at 100% 0%, rgba(53,217,255,0.14), transparent 24rem),
    linear-gradient(180deg, rgba(10, 32, 44, 0.84), rgba(4, 14, 22, 0.78));
}
.tracking-hero { position: relative; overflow: hidden; }
.tracking-orb, .tracking-radar {
  position: relative;
  flex: 0 0 220px;
  width: 220px;
  height: 160px;
  border: 1px solid rgba(78,220,255,0.20);
  border-radius: 28px;
  background: rgba(3, 15, 23, 0.38);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04), 0 26px 80px rgba(0, 220, 255, 0.10);
}
.tracking-orb::before, .tracking-radar::before {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 999px;
  border: 1px solid rgba(65,240,162,0.34);
  background: radial-gradient(circle, rgba(65,240,162,0.20), transparent 58%);
}
.tracking-orb span, .tracking-radar span {
  position: absolute;
  inset: 38px 68px;
  border-radius: 999px;
  border: 1px dashed rgba(158,239,255,0.46);
  animation: hudRotate 12s linear infinite;
}
.tracking-orb span:nth-child(2) { inset: 56px 86px; animation-duration: 7s; animation-direction: reverse; }
.tracking-orb i, .tracking-radar i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 10px rgba(65,240,162,0.12), 0 0 34px rgba(65,240,162,0.65);
  transform: translate(-50%, -50%);
}
.tracking-radar span {
  inset: 22px 52px;
  background: conic-gradient(from 40deg, rgba(65,240,162,0.52), transparent 28%, transparent);
  border-style: solid;
  mask-image: radial-gradient(circle, transparent 0 34%, #000 35%);
}
.tracking-live-dot {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid rgba(65,240,162,0.30);
  border-radius: 999px;
  padding: 0.42rem 0.72rem;
  color: var(--green);
  background: rgba(65,240,162,0.08);
  font-size: 0.76rem;
  font-weight: 950;
  letter-spacing: 0.08em;
}
.tracking-live-dot::before {
  content: "";
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 18px rgba(65,240,162,0.8);
}
.switch-card {
  align-items: flex-start;
  border: 1px solid rgba(78,220,255,0.22);
  border-radius: 18px;
  padding: 1rem;
  background: linear-gradient(135deg, rgba(65,240,162,0.12), rgba(53,217,255,0.06));
}
.switch-card input { width: auto; margin-top: 0.2rem; transform: scale(1.2); accent-color: var(--green); }
.switch-card strong { display: block; margin-bottom: 0.22rem; }
.switch-card small { display: block; color: var(--muted); line-height: 1.55; }
.tracking-preview-card {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid rgba(158,239,255,0.22);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.025)),
    rgba(2,12,18,0.55);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.10);
}
.tracking-protocol-row {
  display: grid !important;
  grid-template-columns: minmax(120px, 160px) minmax(0, 1fr) !important;
  align-items: start;
  gap: 0.9rem;
}
.tracking-protocol-row .field {
  min-width: 0;
}
.tracking-preview-card div { display: grid; gap: 0.35rem; }
.tracking-preview-card small { color: var(--muted); font-weight: 850; text-transform: uppercase; letter-spacing: 0.08em; }
.tracking-preview-card code { display: block; padding: 0.65rem 0.75rem; border: 1px solid rgba(78,220,255,0.14); border-radius: 12px; word-break: break-all; }
.tracking-flow { display: grid; gap: 0.9rem; }
.tracking-flow div {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.2rem 0.75rem;
  padding: 1rem;
  border: 1px solid rgba(78,220,255,0.16);
  border-radius: 18px;
  background: rgba(255,255,255,0.045);
}
.tracking-flow b {
  grid-row: span 2;
  width: 2.35rem;
  height: 2.35rem;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #031018;
  background: linear-gradient(135deg, var(--green), var(--accent));
  box-shadow: 0 0 24px rgba(65,240,162,0.16);
}
.tracking-flow strong { color: var(--ink); }
.tracking-flow span { color: var(--muted); font-size: 0.9rem; line-height: 1.55; }
.tracking-report-title { align-items: flex-end; }
.tracking-summary-grid { margin-bottom: 1rem; grid-template-columns: repeat(4, minmax(160px, 1fr)); }
.tracking-summary-grid .tracking-stat {
  position: relative;
  min-height: 128px;
  overflow: hidden;
  border-color: rgba(205,245,255,0.26);
  background:
    linear-gradient(135deg, rgba(255,255,255,0.13), rgba(255,255,255,0.04)),
    radial-gradient(circle at 88% 18%, rgba(65,240,162,0.18), transparent 4.8rem);
}
.tracking-summary-grid .tracking-stat::after {
  content: "";
  position: absolute;
  right: -32px;
  bottom: -36px;
  width: 110px;
  height: 110px;
  border-radius: 999px;
  border: 18px solid rgba(53,217,255,0.08);
}
.tracking-summary-grid .tracking-stat small { color: var(--green); font-size: 0.7rem; font-weight: 950; letter-spacing: 0.14em; }
.tracking-summary-grid .tracking-stat span { margin: 0.25rem 0 0.15rem; font-size: clamp(2rem, 4vw, 3.1rem); line-height: 1; }
.tracking-summary-grid .tracking-stat em { color: var(--muted); font-style: normal; font-weight: 800; }
.tracking-table-shell {
  overflow-x: auto;
  border: 1px solid rgba(78,220,255,0.16);
  border-radius: 20px;
  background: rgba(2,12,18,0.38);
}
.tracking-table { min-width: 1080px; }
.tracking-table th { background: rgba(53,217,255,0.055); }
.tracking-table td { padding: 0.95rem 0.75rem; }
.tracking-table tbody tr:nth-child(2n) td { background: rgba(255,255,255,0.018); }
.tracking-table code { white-space: nowrap; }
.file-line span { display: block; margin-bottom: 0.45rem; color: var(--green); font-weight: 850; }
.hint, .file-line small { color: var(--muted); font-size: 0.86rem; }
.template-list, .task-list, .variable-list { display: grid; gap: 0.8rem; margin-top: 0.9rem; }
.template-item, .task-card, .variable-item { border: 1px solid rgba(78,220,255,0.18); border-radius: 18px; padding: 0.9rem; background: rgba(3,15,23,0.56); }
.template-item { display: grid; grid-template-columns: 1fr 1.2fr auto; align-items: center; gap: 0.7rem; }
.template-item span, .task-meta { color: var(--muted); font-size: 0.9rem; }
.template-item button, .task-actions button { padding: 0.5rem 0.7rem; border-radius: 10px; box-shadow: none; }
.template-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.5rem; }
.template-preview-dialog { width: min(96vw, 1100px); height: min(90vh, 820px); border: 1px solid rgba(78,220,255,0.28); border-radius: 22px; padding: 0; color: var(--ink); background: var(--panel); box-shadow: var(--shadow); }
.template-preview-dialog[open] { display: flex; flex-direction: column; }
.template-preview-dialog::backdrop { background: rgba(0,0,0,0.76); backdrop-filter: blur(5px); }
.template-preview-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; border-bottom: 1px solid rgba(78,220,255,0.18); padding: 1rem 1.2rem; }
.template-preview-head h2, .template-preview-head p { margin-top: 0; }
.template-preview-head .hint { margin-bottom: 0; }
.template-preview-status, .template-preview-error { margin: 1rem; white-space: pre-wrap; word-break: break-word; }
.template-preview-frame { width: 100%; min-height: 0; flex: 1; border: 0; background: #fff; }
.variable-item { display: grid; grid-template-columns: 1fr auto; gap: 0.65rem; }
.variable-item strong { margin-right: 0.45rem; color: var(--green); }
.variable-item p { grid-column: 1 / -1; max-height: 4.8rem; margin: 0; overflow: hidden; color: var(--muted); line-height: 1.55; word-break: break-word; }
.variable-meta { display: flex; flex-wrap: wrap; gap: 0.8rem; color: var(--muted); font-size: 0.84rem; }
.copy-guide { grid-column: 1 / -1; }
.copy-group { display: flex; flex-wrap: wrap; align-items: center; gap: 0.55rem; margin-top: 0.85rem; }
.copy-group strong { min-width: 5rem; color: var(--green); }
.copy-group button { padding: 0.42rem 0.65rem; border-radius: 999px; box-shadow: none; font-family: "Cascadia Mono", "Consolas", monospace; font-size: 0.82rem; }
.task-head, .task-meta { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.task-subject { font-weight: 900; }
.progress { height: 0.68rem; margin-top: 0.85rem; overflow: hidden; border-radius: 999px; background: rgba(78,220,255,0.12); }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--green), var(--accent)); box-shadow: 0 0 16px rgba(53,217,255,0.32); }
.task-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.85rem; }

.console-panel { grid-column: 1 / -1; }
.top-console { order: -1; }
.console { height: 220px; margin: 0; overflow: auto; border: 1px solid rgba(65,240,162,0.16); border-radius: 18px; padding: 1rem; color: #bdf7c5; background: radial-gradient(circle at 10% 0%, rgba(65,240,162,0.15), transparent 18rem), linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px), #02070b; background-size: auto, 100% 28px, auto; font-family: "Cascadia Mono", "Consolas", monospace; font-size: 0.9rem; line-height: 1.55; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03), 0 20px 50px rgba(0,0,0,0.28); }
.console.log-pulse { animation: logPulse 0.45s ease; }
.toast { position: fixed; right: 1rem; bottom: 1rem; max-width: 28rem; border: 1px solid rgba(53,217,255,0.28); border-radius: 16px; padding: 0.9rem 1rem; color: var(--ink); background: rgba(2,12,18,0.94); opacity: 0; transform: translateY(8px); transition: 0.2s ease; pointer-events: none; box-shadow: 0 0 30px rgba(53,217,255,0.15); }
.toast.show { opacity: 1; transform: translateY(0); }
.login-body { display: grid; place-items: center; padding: 1rem; }
.login-card { width: min(100%, 460px); border: 1px solid var(--line); border-radius: 28px; padding: 2rem; background: var(--panel); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.login-card h1 { font-size: clamp(2rem, 7vw, 3.6rem); }

@keyframes riseIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes hudRotate { to { transform: rotate(360deg); } }
@keyframes hudBlink { 0%, 100% { opacity: 0.35; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-2px); } }
@keyframes livePulse { 0%,100% { box-shadow: 0 0 0 0 rgba(4,19,13,0.35); } 50% { box-shadow: 0 0 0 8px rgba(4,19,13,0); } }
@keyframes logPulse { 0% { box-shadow: 0 0 0 rgba(65,240,162,0); } 50% { box-shadow: 0 0 30px rgba(65,240,162,0.24); } 100% { box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03), 0 20px 50px rgba(0,0,0,0.28); } }
@keyframes scanline { from { background-position: 0 0; } to { background-position: 0 100%; } }

@media (max-width: 980px) {
  .hero, .layout { padding-left: 1rem; padding-right: 1rem; }
  .hero { display: block; }
  .app-nav { flex-wrap: wrap; padding-left: 1rem; padding-right: 1rem; }
  .nav-user { margin-left: 0; }
  .layout { grid-template-columns: 1fr; }
  .tracking-layout { grid-template-columns: 1fr; }
  .tracking-orb, .tracking-radar { display: none; }
  .tracking-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tracking-protocol-row { grid-template-columns: 1fr !important; }
  .grid-form { grid-template-columns: 1fr; }
  .grid-form input:nth-child(n), .grid-form button { grid-column: auto; }
  .proxy-strategy-grid { grid-template-columns: 1fr; }
  .proxy-update-card, .proxy-update-minutes, .proxy-settings-status { grid-column: auto; }
  .proxy-fetch-form { grid-template-columns: 1fr; }
  .proxy-api-head, .proxy-fetch-form .proxy-url-field, .proxy-api-options, .proxy-fetch-form .proxy-header-field, .proxy-api-actions { grid-column: auto; }
  .proxy-fetch-form .proxy-header-field { grid-column: auto; }
  .proxy-enable-card { grid-column: auto; }
  .account-stats-grid { grid-template-columns: 1fr; }
  .account-table-toolbar, .pager-controls { align-items: stretch; flex-direction: column; }
  .inline-fields, .inline-fields.compact, .template-item, .variable-item, .server-focus { grid-template-columns: 1fr; }
  .hud-scope { display: none; }
}

@media (max-width: 560px) {
  .tracking-summary-grid { grid-template-columns: 1fr; }
  .tracking-report-title { align-items: stretch; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
