:root {
  --blue: #1268a8;
  --blue2: #0b4f83;
  --cyan: #26a7d7;
  --ink: #183247;
  --muted: #71879a;
  --line: #dce8f1;
  --bg: #f3f8fb;
  --white: #fff;
  --green: #20a46b;
  --red: #db4f5c;
  --amber: #e99c2e;
  letter-spacing: 0;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  color: var(--ink);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
.hidden {
  display: none !important;
}
.login-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  background: #eaf4fa;
  position: relative;
  overflow: hidden;
}
.login-view:before {
  content: "";
  position: absolute;
  inset: 0 42% 0 0;
  background: linear-gradient(135deg, #073f69, #0b75b7 68%, #28a6d4);
  clip-path: polygon(0 0, 100% 0, 82% 100%, 0 100%);
}
.login-view:after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(#fff0 95%, #fff12 95%), linear-gradient(90deg, #fff0 95%, #fff12 95%);
  background-size: 42px 42px;
  pointer-events: none;
}
.login-brand {
  z-index: 1;
  align-self: center;
  justify-self: center;
  color: white;
  display: flex;
  align-items: center;
  gap: 20px;
}
.login-brand img {
  width: 88px;
  height: 88px;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px #00305066);
}
.login-brand strong {
  font-size: 38px;
  display: block;
}
.login-brand span {
  display: block;
  margin-top: 7px;
  opacity: 0.78;
  letter-spacing: 3px;
}
.login-panel {
  z-index: 1;
  background: #fff;
  padding: 44px;
  width: min(430px, 85%);
  align-self: center;
  border: 1px solid #d6e7f1;
  box-shadow: 0 24px 70px #305f7d20;
  border-radius: 6px;
}
.login-kicker {
  font-size: 12px;
  color: var(--blue);
  font-weight: 700;
  letter-spacing: 2px;
}
.login-panel h1 {
  font-size: 28px;
  margin: 10px 0 8px;
}
.login-panel p {
  color: var(--muted);
  margin: 0 0 30px;
}
.login-panel label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin: 18px 0 7px;
}
.login-panel input {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line);
  padding: 0 13px;
  outline: none;
}
.login-panel input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px #1268a815;
}
.password-field {
  display: flex;
}
.password-field input {
  border-right: 0;
}
.password-field button {
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0;
}
.wide {
  width: 100%;
  margin-top: 22px;
}
.form-error {
  color: var(--red);
  font-size: 13px;
  margin-top: 12px;
  min-height: 20px;
}
.app {
  display: grid;
  grid-template-columns: 226px 1fr;
  min-height: 100vh;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 226px;
  background: #fff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  z-index: 10;
}
.brand {
  height: 84px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  gap: 12px;
}
.brand img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}
.brand b {
  display: block;
  font-size: 17px;
  color: var(--blue2);
}
.brand span {
  font-size: 8px;
  color: #76a1bf;
  letter-spacing: 2px;
}
.sidebar nav {
  padding: 17px 10px;
  display: grid;
  gap: 4px;
}
.nav-item {
  height: 49px;
  border: 0;
  background: transparent;
  color: #61798d;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 0 14px;
  border-radius: 5px;
  position: relative;
}
.nav-item img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  opacity: 0.65;
}
.nav-item:hover {
  background: #f0f7fb;
  color: var(--ink);
}
.nav-item.active {
  background: #eaf4fb;
  color: var(--blue);
  font-weight: 700;
}
.nav-item.active:before {
  content: "";
  position: absolute;
  left: -10px;
  height: 28px;
  width: 3px;
  background: var(--cyan);
}
.nav-item.active img {
  opacity: 1;
}
.sidebar-foot {
  margin-top: auto;
  padding: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
}
.sidebar-foot b,
.sidebar-foot small {
  display: block;
}
.sidebar-foot small {
  color: var(--muted);
  margin-top: 3px;
}
.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #a9b8c3;
}
.status-dot.online {
  background: var(--green);
  box-shadow: 0 0 0 4px #20a46b1c;
}
.main {
  grid-column: 2;
  min-width: 0;
}
.topbar {
  height: 84px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  position: sticky;
  top: 0;
  z-index: 8;
}
.topbar p {
  font-size: 11px;
  letter-spacing: 2px;
  color: #7f9aaf;
  margin: 0;
}
.topbar h1 {
  font-size: 21px;
  margin: 4px 0 0;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 13px;
  color: var(--muted);
  font-size: 12px;
}
.icon-btn {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  background: white;
  color: var(--blue);
  display: grid;
  place-items: center;
  border-radius: 4px;
}
.user-button {
  border: 0;
  background: transparent;
  display: grid;
  grid-template-columns: 35px auto;
  grid-template-rows: 1fr 1fr;
  column-gap: 9px;
  text-align: left;
  color: var(--ink);
}
.user-button span {
  grid-row: 1/3;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background: #dff1fa;
  color: var(--blue);
  display: grid;
  place-items: center;
  font-weight: 700;
}
.user-button small {
  color: var(--muted);
}
.page-host {
  padding: 24px 28px 40px;
  max-width: 1600px;
  margin: auto;
}
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.page-head h2 {
  font-size: 17px;
  margin: 0;
}
.page-head p {
  font-size: 12px;
  color: var(--muted);
  margin: 4px 0 0;
}
.grid {
  display: grid;
  gap: 16px;
}
.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.split {
  grid-template-columns: minmax(0, 1.35fr) minmax(310px, 0.65fr);
}
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 18px;
  min-width: 0;
}
.card-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.card-title h3 {
  font-size: 14px;
  margin: 0;
}
.card-title span {
  font-size: 11px;
  color: var(--muted);
}
.metric {
  padding: 17px;
  border-left: 3px solid var(--blue);
}
.metric small {
  color: var(--muted);
}
.metric strong {
  font-size: 27px;
  display: block;
  margin: 9px 0 4px;
}
.metric em {
  font-size: 11px;
  font-style: normal;
  color: var(--green);
}
.metric.red {
  border-color: var(--red);
}
.metric.cyan {
  border-color: var(--cyan);
}
.metric.amber {
  border-color: var(--amber);
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.field label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #597186;
  margin-bottom: 6px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fbfdfe;
  padding: 9px 10px;
  min-height: 39px;
  outline: none;
}
.field textarea {
  resize: vertical;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--blue);
}
.radio-row,
.check-row,
.button-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.primary,
.secondary,
.danger {
  border: 0;
  border-radius: 4px;
  min-height: 38px;
  padding: 0 16px;
  font-weight: 700;
  font-size: 12px;
}
.primary {
  background: var(--blue);
  color: white;
}
.primary:hover {
  background: var(--blue2);
}
.secondary {
  background: #edf5fa;
  color: var(--blue);
  border: 1px solid #cee1ed;
}
.danger {
  background: #fff1f2;
  color: var(--red);
  border: 1px solid #f5cbd0;
}
.primary:disabled,
.secondary:disabled {
  opacity: 0.5;
  cursor: wait;
}
.log {
  height: 190px;
  overflow: auto;
  background: #082f4a;
  color: #b9def3;
  padding: 13px;
  font:
    11px/1.7 Consolas,
    monospace;
  white-space: pre-wrap;
}
.chart {
  height: 210px;
  position: relative;
}
.progress {
  height: 8px;
  background: #e8f0f5;
  overflow: hidden;
}
.progress > span {
  height: 100%;
  display: block;
  background: var(--blue);
  transition: width 0.3s;
}
.table-wrap {
  overflow: auto;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.data-table th {
  background: #f3f8fb;
  color: #637b8d;
  text-align: left;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.data-table td {
  padding: 10px;
  border-bottom: 1px solid #edf3f7;
  white-space: nowrap;
}
.tag {
  display: inline-block;
  padding: 3px 7px;
  background: #e8f6ef;
  color: var(--green);
  font-size: 10px;
  border-radius: 3px;
}
.tag.red {
  background: #fff0f1;
  color: var(--red);
}
.warning-level.level-0 {
  background: #e8f6ef;
  color: var(--green);
}
.warning-level.level-1 {
  background: #eaf4fb;
  color: var(--blue);
}
.warning-level.level-2 {
  background: #fff6e7;
  color: #a86400;
}
.warning-level.level-3 {
  background: #fff0f1;
  color: var(--red);
}
.threshold-hint {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}
.radar {
  aspect-ratio: 1.8;
  min-height: 250px;
  background:
    radial-gradient(circle at center, #1db4db1c 0 1px, transparent 2px),
    repeating-radial-gradient(circle at center, transparent 0 46px, #2a9bc92a 47px 48px),
    linear-gradient(135deg, #062d48, #074b70);
  position: relative;
  overflow: hidden;
}
.radar:before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 44%;
  height: 1px;
  background: #4ed1ec66;
  transform-origin: left;
  animation: sweep 4s linear infinite;
  box-shadow: 0 0 20px #43d4f0;
}
.radar:after {
  content: "目标监测中";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: #90e5f4;
  font-size: 12px;
}
.radar .person {
  position: absolute;
  left: 68%;
  top: 38%;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #53e2ff;
  box-shadow:
    0 0 0 8px #53e2ff20,
    0 0 22px #53e2ff;
}
@keyframes sweep {
  to {
    transform: rotate(360deg);
  }
}
.tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}
.tab {
  border: 0;
  background: transparent;
  padding: 10px 15px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
}
.tab.active {
  color: var(--blue);
  border-color: var(--blue);
  font-weight: 700;
}
.tab-panel.hidden {
  display: none;
}
.chat-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 16px;
  height: calc(100vh - 150px);
  min-height: 560px;
}
.chat-main {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}
.chat-header {
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.chat-messages {
  flex: 1;
  overflow: auto;
  padding: 22px;
  background: #f8fbfd;
}
.message {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}
.message.user {
  flex-direction: row-reverse;
}
.avatar {
  flex: 0 0 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #d8eef8;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}
.message.user .avatar {
  background: var(--blue);
  color: white;
}
.bubble {
  max-width: 78%;
  padding: 12px 15px;
  background: white;
  border: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.7;
  box-shadow: 0 4px 14px #1c526d0b;
}
.message.user .bubble {
  background: #e7f4fb;
  border-color: #c9e3f0;
}
.bubble p:first-child {
  margin-top: 0;
}
.bubble p:last-child {
  margin-bottom: 0;
}
.bubble pre {
  overflow: auto;
  background: #092f48;
  color: #d8edf7;
  padding: 10px;
}
.chat-input {
  border-top: 1px solid var(--line);
  padding: 13px;
  display: flex;
  gap: 10px;
}
.chat-input textarea {
  flex: 1;
  resize: none;
  min-height: 48px;
  max-height: 110px;
  border: 1px solid var(--line);
  padding: 10px;
}
.quick-list {
  display: grid;
  gap: 8px;
}
.quick-list button {
  text-align: left;
  border: 1px solid var(--line);
  background: #f8fbfd;
  padding: 11px;
  color: #46667b;
  font-size: 12px;
}
.quick-list button:hover {
  border-color: var(--cyan);
  color: var(--blue);
}
.switch {
  position: relative;
  width: 38px;
  height: 21px;
  display: inline-block;
}
.switch input {
  opacity: 0;
}
.switch span {
  position: absolute;
  inset: 0;
  background: #b8c7d0;
  border-radius: 20px;
}
.switch span:after {
  content: "";
  position: absolute;
  width: 15px;
  height: 15px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #fff;
  transition: 0.2s;
}
.switch input:checked + span {
  background: var(--blue);
}
.switch input:checked + span:after {
  transform: translateX(17px);
}
#toast {
  position: fixed;
  right: 24px;
  top: 96px;
  z-index: 50;
  display: grid;
  gap: 8px;
}
.toast {
  background: #133f59;
  color: white;
  padding: 11px 16px;
  border-left: 3px solid var(--cyan);
  box-shadow: 0 8px 24px #17394d30;
  font-size: 12px;
}
.toast.error {
  border-color: var(--red);
}
.toast.success {
  border-color: var(--green);
}
dialog {
  border: 1px solid var(--line);
  padding: 0;
  width: min(520px, 90vw);
  box-shadow: 0 30px 80px #17394d55;
}
dialog::backdrop {
  background: #08283d80;
}
#automatic-dispatch-dialog {
  text-align: center;
  min-width: min(440px, 90vw);
}
#automatic-dispatch-dialog.level-2 {
  border-top: 4px solid var(--amber);
}
#automatic-dispatch-dialog.level-3 {
  border-top: 4px solid var(--red);
}
.automatic-dispatch-progress {
  margin: 18px 0 4px;
  color: var(--blue);
  font-weight: 700;
}
.dialog-body {
  padding: 22px;
}
.dialog-head {
  padding: 15px 20px;
  background: #f1f7fa;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
}
@media (max-width: 900px) {
  .login-view {
    grid-template-columns: 1fr;
  }
  .login-view:before,
  .login-brand {
    display: none;
  }
  .app {
    display: block;
    padding-bottom: 68px;
  }
  .sidebar {
    inset: auto 0 0;
    width: auto;
    height: 68px;
    border: 0;
    border-top: 1px solid var(--line);
  }
  .brand,
  .sidebar-foot {
    display: none;
  }
  .sidebar nav {
    padding: 6px;
    display: flex;
    justify-content: space-around;
    overflow-x: auto;
  }
  .nav-item {
    height: 56px;
    min-width: 62px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 5px;
    font-size: 9px;
  }
  .nav-item img {
    width: 21px;
    height: 21px;
  }
  .nav-item.active:before {
    left: 20%;
    right: 20%;
    top: -6px;
    width: auto;
    height: 3px;
  }
  .main {
    min-width: 0;
  }
  .topbar {
    height: 70px;
    padding: 0 16px;
  }
  .topbar #clock {
    display: none;
  }
  .page-host {
    padding: 14px;
  }
  .cols-2,
  .cols-3,
  .cols-4,
  .split,
  .chat-shell {
    grid-template-columns: 1fr;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .chat-shell {
    height: auto;
  }
  .chat-main {
    height: 70vh;
  }
  .chat-shell > .card:last-child {
    display: none;
  }
}
