/* ============ 基础 ============ */
* { box-sizing: border-box; }

:root {
  --primary: #2f8fff;
  --primary-dark: #123a68;
  --cyan: #00e5ff;
  --accent: #7c5cff;

  --bg-deep: #050b16;
  --bg: #081425;
  --panel: rgba(14, 32, 58, 0.72);
  --border: rgba(64, 158, 255, 0.22);
  --border-strong: rgba(0, 229, 255, 0.55);

  --text: #e6f0ff;
  --muted: #7f97b8;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
}

body {
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(47, 143, 255, 0.18), transparent 60%),
    radial-gradient(1000px 500px at 90% 0%, rgba(124, 92, 255, 0.14), transparent 55%),
    radial-gradient(900px 700px at 50% 120%, rgba(0, 229, 255, 0.10), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

/* 全局网格纹理（科技感底纹） */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(64, 158, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(64, 158, 255, 0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(circle at 50% 25%, #000 25%, transparent 78%);
          mask-image: radial-gradient(circle at 50% 25%, #000 25%, transparent 78%);
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

.hidden { display: none !important; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scanline {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============ 顶栏 ============ */
.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 56px;
  padding: 0 24px;
  background: linear-gradient(90deg, rgba(8, 20, 37, 0.96), rgba(14, 40, 74, 0.92));
  backdrop-filter: blur(8px);
  color: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

/* 顶栏底部流光 */
.topbar::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), var(--primary), transparent);
  background-size: 200% 100%;
  opacity: 0.75;
  animation: scanline 6s linear infinite;
}

.topbar .brand {
  font-size: 17px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 1px;
  background: linear-gradient(180deg, #ffffff, #8fd4ff);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 8px rgba(0, 229, 255, 0.45));
}

.topbar nav {
  display: flex;
  gap: 4px;
  flex: 1;
  overflow-x: auto;
}

.topbar nav a {
  color: rgba(190, 215, 245, 0.85);
  padding: 6px 14px;
  border-radius: 4px;
  white-space: nowrap;
  font-size: 14px;
  transition: all .2s ease;
}

.topbar nav a:hover {
  background: rgba(0, 229, 255, 0.12);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(0, 229, 255, 0.35);
  text-decoration: none;
}

.topbar .user {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: rgba(200, 220, 245, 0.9);
  white-space: nowrap;
}

.topbar .user a { color: #ffd666; }

/* ============ 主区域 ============ */
main {
  position: relative;
  z-index: 1;
  padding: 18px 20px 32px;
  max-width: 1800px;
  margin: 0 auto;
}

/* ============ KPI 条 ============ */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.kpi {
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, rgba(20, 44, 78, 0.85), rgba(10, 24, 44, 0.85));
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  box-shadow: var(--shadow), inset 0 0 24px rgba(47, 143, 255, 0.08);
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
  animation: fadeIn .6s ease both;
}

/* 左侧发光竖条 */
.kpi::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--cyan), var(--primary));
  box-shadow: 0 0 12px var(--cyan);
}

/* 右上角光晕 */
.kpi::after {
  content: "";
  position: absolute;
  right: -30%; top: -60%;
  width: 60%; height: 200%;
  background: radial-gradient(circle, rgba(0, 229, 255, 0.16), transparent 70%);
  pointer-events: none;
}

.kpi:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5), 0 0 24px rgba(0, 229, 255, 0.22);
}

.kpi .label {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.kpi .value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #ffffff, #7fd0ff);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 10px rgba(0, 229, 255, 0.5));
}

.kpi .value span {
  font-size: 13px;
  font-weight: 400;
  margin-left: 4px;
  color: var(--muted);
  -webkit-text-fill-color: var(--muted);
}

.kpi .sub {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

/* ============ 网格与卡片 ============ */
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.grid .wide { grid-column: 1 / -1; }

.card {
  position: relative;
  background: var(--panel);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
  min-width: 0;
  transition: border-color .25s ease, box-shadow .25s ease;
  animation: fadeIn .7s ease both;
}

/* 卡片顶部流动高光线 */
.card::before {
  content: "";
  position: absolute;
  left: 16px; right: 16px; top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  opacity: 0.55;
}

.card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow), 0 0 22px rgba(0, 229, 255, 0.14);
}

.card h3 {
  position: relative;
  margin: 0 0 12px;
  padding-left: 12px;
  font-size: 15px;
  font-weight: 600;
  color: #dbe9ff;
  line-height: 1.2;
}

.card h3::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 14px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--cyan), var(--primary));
  box-shadow: 0 0 8px var(--cyan);
}

.chart { width: 100%; height: 280px; }
.chart.tall { height: 360px; }
.chart.small { height: 200px; margin-top: 8px; }

/* ============ 表格 ============ */
.table-wrap { width: 100%; overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th,
.data-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(64, 158, 255, 0.14);
  white-space: nowrap;
  color: #c9dcf5;
}

.data-table thead th {
  background: rgba(10, 28, 52, 0.9);
  color: #8fb0d8;
  font-weight: 600;
  position: sticky;
  top: 0;
}

.data-table tbody tr { transition: background .15s ease; }
.data-table tbody tr:hover { background: rgba(47, 143, 255, 0.09); }

.data-table td.empty {
  text-align: center;
  color: var(--muted);
  padding: 28px 12px;
}

/* ============ 徽章 ============ */
.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 18px;
  font-weight: 500;
  border: 1px solid transparent;
}

.badge.danger  { background: rgba(255, 77, 106, 0.16); color: #ff8a9c; border-color: rgba(255, 77, 106, 0.4); }
.badge.warning { background: rgba(255, 176, 32, 0.16); color: #ffc95c; border-color: rgba(255, 176, 32, 0.4); }
.badge.info    { background: rgba(47, 143, 255, 0.16); color: #6fb4ff; border-color: rgba(47, 143, 255, 0.4); }
.badge.success { background: rgba(0, 224, 161, 0.14); color: #4fe7b8; border-color: rgba(0, 224, 161, 0.4); }
.badge.muted   { background: rgba(127, 151, 184, 0.16); color: #9db2cc; border-color: rgba(127, 151, 184, 0.35); }

.badge.grade-A { background: rgba(0, 224, 161, 0.14); color: #4fe7b8; border-color: rgba(0, 224, 161, 0.4); }
.badge.grade-B { background: rgba(47, 143, 255, 0.16); color: #6fb4ff; border-color: rgba(47, 143, 255, 0.4); }
.badge.grade-C { background: rgba(255, 176, 32, 0.16); color: #ffc95c; border-color: rgba(255, 176, 32, 0.4); }
.badge.grade-D { background: rgba(255, 140, 60, 0.16); color: #ffab73; border-color: rgba(255, 140, 60, 0.4); }
.badge.grade-E { background: rgba(255, 77, 106, 0.16); color: #ff8a9c; border-color: rgba(255, 77, 106, 0.4); }

/* ============ 工具栏 ============ */
.toolbar {
  background: var(--panel);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 18px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.toolbar label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
}

.toolbar select {
  min-width: 320px;
  padding: 7px 10px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: rgba(10, 24, 44, 0.9);
  color: var(--text);
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.toolbar select:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.12);
}

/* ============ 企业信息两栏 ============ */
.info-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.info-list { padding: 4px 0; }

.info-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px dashed rgba(64, 158, 255, 0.18);
  font-size: 14px;
}

.info-item:last-child { border-bottom: none; }

.info-item .k { color: var(--muted); }
.info-item .v { color: #dbe9ff; font-weight: 500; text-align: right; }

.empty {
  color: var(--muted);
  text-align: center;
  padding: 24px 0;
}

/* ============ 登录页 ============ */
.login-body {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(900px 500px at 20% 0%, rgba(47, 143, 255, 0.22), transparent 60%),
    radial-gradient(700px 500px at 90% 100%, rgba(124, 92, 255, 0.18), transparent 60%),
    linear-gradient(135deg, #050b16 0%, #081425 55%, #0c1f3a 100%);
}

.login-box {
  position: relative;
  width: 380px;
  max-width: calc(100vw - 40px);
  background: rgba(14, 32, 58, 0.82);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 36px 32px 32px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(0, 229, 255, 0.08);
}

.login-box::before {
  content: "";
  position: absolute;
  left: 24px; right: 24px; top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
}

.login-box h1 {
  margin: 0 0 6px;
  font-size: 20px;
  text-align: center;
  line-height: 1.4;
  color: #e6f0ff;
  text-shadow: 0 0 16px rgba(0, 229, 255, 0.3);
}

.login-box .sub {
  margin: 0 0 24px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.login-box form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-box label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.login-box input {
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: rgba(5, 12, 24, 0.6);
  color: var(--text);
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.login-box input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.12);
}

.login-box button {
  margin-top: 6px;
  padding: 11px;
  font-size: 15px;
  letter-spacing: 4px;
  color: #fff;
  background: linear-gradient(90deg, var(--primary), #2a6bb0);
  border: none;
  border-radius: 5px;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(47, 143, 255, 0.35);
  transition: opacity .2s ease, box-shadow .2s ease;
}

.login-box button:hover {
  opacity: 0.94;
  box-shadow: 0 0 28px rgba(0, 229, 255, 0.45);
}

.flash {
  margin-bottom: 16px;
  padding: 9px 12px;
  background: rgba(255, 77, 106, 0.14);
  border: 1px solid rgba(255, 77, 106, 0.35);
  color: #ff8a9c;
  border-radius: 5px;
  font-size: 13px;
  text-align: center;
}
/*地图*/
.chart.map {
  height: 450px;
}

/* footer 贴底 */
.footer {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  box-sizing: border-box;
  padding: 12px 16px;
  z-index: 2;
  text-align: center;
  font-size: 12px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.55);   /* 深色背景下比 #666 清晰 */
  background: transparent;
}

/* p 用 flex 让图标和文字垂直居中 */
.footer p {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
}

.footer a {
  color: rgba(255, 255, 255, 0.55) !important;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer a:hover {
  color: #9ecbff !important;
}

.footer img {
  display: inline-block;
  vertical-align: middle;
  margin-right: 4px;
}


/* ============ 响应式 ============ */
@media (max-width: 1100px) {
  .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .grid, .info-row { grid-template-columns: 1fr; }
  .topbar { gap: 12px; padding: 0 14px; }
  .topbar .brand { font-size: 15px; }
  main { padding: 12px; }
}