/* 驾驶舱风格 - 中豫港通 BI 指挥中心 v2
 * 深色科技 + 异形边框 + 荧光高亮 + 装饰元素
 * 基于 ECharts 5 + CSS3
 */

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: #020817;
  color: #e2e8f0;
  font-size: 13px;
  min-height: 100vh;
  overflow-x: hidden;
}

/* 背景：星空 + 网格 */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(ellipse at 20% 30%, rgba(0,100,200,0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(120,0,200,0.10) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(0,200,255,0.05) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image:
    linear-gradient(rgba(0,200,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,200,255,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* 主容器 */
.command-center {
  position: relative;
  z-index: 1;
  padding: 16px 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* 顶部标题栏 */
.header {
  height: 64px;
  background:
    linear-gradient(90deg, rgba(0,30,80,0.6) 0%, rgba(0,80,160,0.4) 50%, rgba(0,30,80,0.6) 100%);
  border: 1px solid rgba(0,200,255,0.3);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  clip-path: polygon(40px 0, calc(100% - 40px) 0, 100% 50%, calc(100% - 40px) 100%, 40px 100%, 0 50%);
}
.header::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(180deg, rgba(0,200,255,0.1) 0%, transparent 50%, rgba(0,200,255,0.1) 100%);
  pointer-events: none;
}
.header-title {
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 4px;
  background: linear-gradient(180deg, #fff 0%, #67e8f9 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 20px rgba(0,200,255,0.5);
  position: relative;
  z-index: 1;
}
.header-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}
.header-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0,200,255,0.1);
  border: 1px solid rgba(0,200,255,0.3);
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
  color: #67e8f9;
}
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

/* 主内容 3 列布局 */
.main-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 360px 1fr 360px;
  gap: 12px;
  min-height: 0;
}

.col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

/* 通用模块框（带异形装饰角） */
.module {
  background: linear-gradient(180deg, rgba(0,30,80,0.4) 0%, rgba(0,15,40,0.6) 100%);
  border: 1px solid rgba(0,200,255,0.2);
  position: relative;
  padding: 12px 16px;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.module::before,
.module::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  border: 2px solid #00f6ff;
  pointer-events: none;
}
.module::before {
  top: -1px;
  left: -1px;
  border-right: none;
  border-bottom: none;
}
.module::after {
  bottom: -1px;
  right: -1px;
  border-left: none;
  border-top: none;
}
/* 右下角 + 左上角的辅助装饰 */
.module .corner-tr,
.module .corner-bl {
  position: absolute;
  width: 12px;
  height: 12px;
  border: 2px solid #00f6ff;
  pointer-events: none;
}
.module .corner-tr {
  top: -1px;
  right: -1px;
  border-left: none;
  border-bottom: none;
}
.module .corner-bl {
  bottom: -1px;
  left: -1px;
  border-right: none;
  border-top: none;
}

/* 模块标题 */
.module-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0 0 12px;
  padding-bottom: 8px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  position: relative;
}
.module-title::before,
.module-title::after {
  content: '';
  flex: 0 0 30px;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, #00f6ff 50%, transparent 100%);
}
.module-title::before {
  background: linear-gradient(90deg, transparent 0%, #00f6ff 100%);
}
.module-title::after {
  background: linear-gradient(90deg, #00f6ff 0%, transparent 100%);
}
.module-title .icon {
  font-size: 14px;
  color: #00f6ff;
}

/* 图表容器 */
.chart {
  flex: 1;
  min-height: 200px;
  position: relative;
}

/* KPI 沙漏（圆形 + 大数字） */
.hourglass-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  flex: 1;
  align-content: center;
}
.hourglass {
  background: radial-gradient(circle, rgba(0,200,255,0.15) 0%, transparent 70%);
  border: 1px solid rgba(0,200,255,0.3);
  border-radius: 50%;
  aspect-ratio: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px;
  margin: 0 auto;
  width: 100%;
  max-width: 130px;
  text-align: center;
  box-shadow: 0 0 20px rgba(0,200,255,0.2) inset;
}
.hourglass::before {
  content: '';
  position: absolute;
  inset: 4px;
  border: 1px dashed rgba(0,200,255,0.3);
  border-radius: 50%;
  pointer-events: none;
  animation: rotate 20s linear infinite;
}
@keyframes rotate {
  to { transform: rotate(360deg); }
}
.hourglass-icon {
  font-size: 22px;
  margin-bottom: 2px;
}
.hourglass-value {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  font-family: "SF Mono", "Monaco", "Consolas", monospace;
  letter-spacing: -0.5px;
  line-height: 1.1;
}
.hourglass-label {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
}
.hourglass-unit {
  font-size: 10px;
  color: #67e8f9;
  margin-top: 1px;
}

/* 大数字 KPI 卡（带单位） */
.mega-kpi {
  background: linear-gradient(135deg, rgba(0,100,200,0.2) 0%, rgba(0,200,255,0.1) 100%);
  border: 1px solid rgba(0,200,255,0.4);
  position: relative;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  clip-path: polygon(20px 0, 100% 0, calc(100% - 20px) 100%, 0 100%);
}
.mega-kpi-icon {
  font-size: 32px;
  color: #67e8f9;
  flex: 0 0 50px;
  text-align: center;
}
.mega-kpi-body {
  flex: 1;
}
.mega-kpi-label {
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 4px;
}
.mega-kpi-value {
  font-size: 30px;
  font-weight: 700;
  color: #fff;
  font-family: "SF Mono", "Monaco", "Consolas", monospace;
  letter-spacing: -1px;
  line-height: 1.1;
  text-shadow: 0 0 20px rgba(0,200,255,0.6);
}
.mega-kpi-value .unit {
  font-size: 14px;
  color: #67e8f9;
  font-weight: 400;
  margin-left: 4px;
}

/* 表格（深色科技风） */
.tech-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.tech-table thead th {
  background: linear-gradient(180deg, rgba(0,200,255,0.2) 0%, rgba(0,200,255,0.05) 100%);
  color: #67e8f9;
  font-weight: 600;
  text-align: left;
  padding: 6px 10px;
  font-size: 11px;
  border-bottom: 1px solid rgba(0,200,255,0.3);
  letter-spacing: 0.5px;
}
.tech-table tbody td {
  padding: 6px 10px;
  border-bottom: 1px solid rgba(0,200,255,0.08);
  color: #cbd5e1;
}
.tech-table tbody tr:hover td {
  background: rgba(0,200,255,0.05);
  color: #fff;
}
.tech-table .num {
  font-family: "SF Mono", "Monaco", "Consolas", monospace;
  text-align: right;
  color: #67e8f9;
}
.tech-table .rank {
  display: inline-block;
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, #00f6ff, #0066cc);
  color: #020817;
  text-align: center;
  line-height: 20px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
  margin-right: 6px;
}
.tech-table .rank.top {
  background: linear-gradient(135deg, #facc15, #f59e0b);
}
.tech-table .progress-mini {
  height: 4px;
  background: rgba(0,200,255,0.1);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
  margin-top: 2px;
}
.tech-table .progress-mini-bar {
  height: 100%;
  background: linear-gradient(90deg, #00f6ff, #0066cc);
  border-radius: 2px;
}

/* 状态标签 */
.status-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
}
.status-tag.success { background: rgba(34,197,94,0.2); color: #4ade80; border: 1px solid rgba(34,197,94,0.4); }
.status-tag.warning { background: rgba(245,158,11,0.2); color: #fbbf24; border: 1px solid rgba(245,158,11,0.4); }
.status-tag.danger { background: rgba(239,68,68,0.2); color: #f87171; border: 1px solid rgba(239,68,68,0.4); }
.status-tag.info { background: rgba(0,200,255,0.2); color: #67e8f9; border: 1px solid rgba(0,200,255,0.4); }
.status-tag.gray { background: rgba(148,163,184,0.2); color: #94a3b8; border: 1px solid rgba(148,163,184,0.3); }

/* 排名 KPI 行 */
.rank-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rank-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 12px;
}
.rank-num {
  width: 18px;
  height: 18px;
  background: linear-gradient(135deg, #00f6ff, #0066cc);
  color: #020817;
  text-align: center;
  line-height: 18px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 3px;
  flex: 0 0 18px;
}
.rank-num.top { background: linear-gradient(135deg, #facc15, #f59e0b); }
.rank-name {
  flex: 1;
  color: #cbd5e1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rank-value {
  color: #67e8f9;
  font-family: "SF Mono", "Monaco", "Consolas", monospace;
  font-weight: 600;
}

/* 地图容器 */
.map-container {
  flex: 1;
  min-height: 0;
  position: relative;
}
.map-container > div {
  width: 100%;
  height: 100%;
}
.map-legend {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(2,8,23,0.7);
  border: 1px solid rgba(0,200,255,0.3);
  padding: 6px 10px;
  font-size: 11px;
  color: #cbd5e1;
  z-index: 10;
  border-radius: 4px;
  line-height: 1.6;
}
.map-legend .lg-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}

/* 顶部 4 大数字 KPI（带环形装饰） */
.top-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  height: 100px;
}
.top-kpi {
  background: linear-gradient(135deg, rgba(0,100,200,0.3) 0%, rgba(0,200,255,0.15) 100%);
  border: 1px solid rgba(0,200,255,0.4);
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  overflow: hidden;
  clip-path: polygon(16px 0, 100% 0, calc(100% - 16px) 100%, 0 100%);
}
.top-kpi::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 80px;
  height: 80px;
  background: radial-gradient(circle, rgba(0,200,255,0.2) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.top-kpi-icon {
  font-size: 24px;
  color: #67e8f9;
  flex: 0 0 32px;
  z-index: 1;
}
.top-kpi-body {
  flex: 1;
  z-index: 1;
}
.top-kpi-label {
  font-size: 11px;
  color: #94a3b8;
  margin-bottom: 2px;
}
.top-kpi-value {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  font-family: "SF Mono", "Monaco", "Consolas", monospace;
  letter-spacing: -0.5px;
  line-height: 1.1;
  text-shadow: 0 0 10px rgba(0,200,255,0.5);
}
.top-kpi-value .unit {
  font-size: 11px;
  color: #67e8f9;
  margin-left: 2px;
}
.top-kpi-delta {
  display: inline-block;
  font-size: 10px;
  padding: 1px 4px;
  border-radius: 2px;
  margin-left: 4px;
  font-weight: 600;
}
.top-kpi-delta.up { background: rgba(34,197,94,0.2); color: #4ade80; }
.top-kpi-delta.down { background: rgba(239,68,68,0.2); color: #f87171; }

/* 滚动条美化 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: rgba(0,200,255,0.05); }
::-webkit-scrollbar-thumb { background: rgba(0,200,255,0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,200,255,0.5); }

/* 响应式 */
@media (max-width: 1600px) {
  .main-grid { grid-template-columns: 320px 1fr 320px; }
  .top-kpi-value { font-size: 18px; }
}
@media (max-width: 1200px) {
  .main-grid { grid-template-columns: 1fr; }
}

/* 选择器深色风 */
select.tech-select {
  background: rgba(0,200,255,0.1);
  border: 1px solid rgba(0,200,255,0.3);
  color: #67e8f9;
  padding: 4px 12px;
  font-size: 12px;
  border-radius: 4px;
  outline: none;
}
select.tech-select option {
  background: #020817;
  color: #e2e8f0;
}
