/* ============================================
 * 可视化大屏样式 - 炫酷深色科技风
 * 布局: 顶部状态栏 + 查询栏 + KPI 4卡 + 主体3图表
 * ============================================ */

/* 主容器（内嵌显示，不覆盖全屏） */
#screen-content {
  width: 100%;
  background:
    radial-gradient(circle at 20% 0%, rgba(36, 208, 248, 0.08), transparent 50%),
    radial-gradient(circle at 80% 100%, rgba(255, 170, 34, 0.06), transparent 50%),
    #050b18;
  color: #D6E8F8;
  font-family: 'Microsoft YaHei', sans-serif;
  overflow: visible;
  z-index: 1;
  display: flex; flex-direction: column;
  padding: 24px 16px 40px;
  gap: 20px;
  box-sizing: border-box;
  position: relative;
}
/* 科技感网格背景（细微网格） */
#screen-content::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(36, 208, 248, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(36, 208, 248, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}
/* 扫描线动画 - 已禁用(持续 animation 触发整屏 paint, 是数据大屏卡顿主因之一) */
#screen-content::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 100px;
  background: linear-gradient(to bottom, transparent, rgba(36, 208, 248, 0.08), transparent);
  pointer-events: none;
  z-index: 0;
  top: -100px;
  display: none;
}
@keyframes scr-scan {
  0%   { top: -100px; }
  100% { top: 100%; }
}
/* 主容器子元素层级 */
#screen-content > * { position: relative; z-index: 1; }

/* ===== 第1行 顶部状态栏 ===== */
.scr-top { flex: 0 0 auto; }

/* 通用卡片：顶部光带 + 侧边/底部渐变透明边框 */
.scr-card {
  background: linear-gradient(135deg, rgba(15, 32, 56, 0.85), rgba(10, 21, 38, 0.85));
  border: none;
  border-radius: 6px;
  position: relative;
  display: flex; flex-direction: column;
  overflow: hidden;
  backdrop-filter: blur(4px);
  isolation: isolate;
}
/* 顶部亮带：中间亮，两端淡 */
.scr-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(36, 208, 248, 0.3) 15%,
    #24D0F8 50%,
    rgba(36, 208, 248, 0.3) 85%,
    transparent 100%);
  box-shadow: 0 0 10px rgba(36, 208, 248, 0.6);
  z-index: 2; pointer-events: none;
}
/* 左右边框：顶部亮 → 底部透明 */
.scr-card {
  border-left: 1px solid transparent;
  border-right: 1px solid transparent;
  border-image: linear-gradient(to bottom,
    rgba(36, 208, 248, 0.6) 0%,
    rgba(36, 208, 248, 0.25) 30%,
    rgba(36, 208, 248, 0.08) 70%,
    transparent 100%) 1 stretch;
  border-top: none; border-bottom: none;
}
/* 底部边框：使用伪元素做渐变（左淡→中亮→右淡，覆盖底部1px） */
.scr-card::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(36, 208, 248, 0.15) 30%,
    rgba(36, 208, 248, 0.4) 50%,
    rgba(36, 208, 248, 0.15) 70%,
    transparent 100%);
  z-index: 2; pointer-events: none;
}
.scr-card-head {
  flex: 0 0 36px; display: flex; align-items: center; justify-content: flex-start;
  padding: 0 14px;
  border-bottom: 1px solid rgba(36, 208, 248, 0.15);
  background: linear-gradient(90deg, rgba(36, 208, 248, 0.08), transparent);
}
.scr-card-title {
  font-size: 12px; color: #24D0F8; font-weight: 400; letter-spacing: 1.5px;
  text-shadow: 0 0 8px rgba(36, 208, 248, 0.5);
}
.scr-card-body { flex: 1; position: relative; overflow: hidden; padding: 4px; }
.scr-chart { width: 100%; height: 100%; }

/* ===== 第1行 顶部状态栏 ===== */
.scr-top {
  flex: 0 0 56px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  background: linear-gradient(90deg, rgba(15, 32, 56, 0.95), rgba(20, 45, 75, 0.7), rgba(15, 32, 56, 0.95));
  border: 1px solid #24D0F8;
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(36, 208, 248, 0.25);
  position: relative;
}
.scr-top::after {
  content: ''; position: absolute; left: 50%; bottom: 0; width: 60%; height: 2px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, #24D0F8, transparent);
  box-shadow: 0 0 12px #24D0F8;
}
.scr-top-left { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #36E088; }
.scr-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #36E088; box-shadow: 0 0 10px #36E088, 0 0 20px #36E088;
  animation: scrPulse 1.5s ease-in-out infinite;
  cursor: pointer; user-select: none; -webkit-user-select: none;
  display: inline-block;
}
@keyframes scrPulse { 0%,100%{opacity:1; transform:scale(1);} 50%{opacity:0.5; transform:scale(0.85);} }
.scr-top-title {
  font-size: 24px; font-weight: bold; color: #FFFFFF;
  letter-spacing: 8px;
  background: linear-gradient(90deg, #24D0F8, #FFFFFF, #24D0F8);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 20px rgba(36, 208, 248, 0.4);
}
.scr-top-right { display: flex; align-items: center; gap: 16px; }
.scr-time {
  font-size: 14px; color: #24D0F8; font-family: 'Consolas', monospace;
  text-shadow: 0 0 6px rgba(36, 208, 248, 0.5);
}
.scr-btn {
  padding: 7px 18px; border-radius: 3px; cursor: pointer; font-size: 13px;
  border: none; font-weight: 500; transition: all 0.2s;
}
.scr-btn-query {
  background: linear-gradient(135deg, #FF2E63, #c01548);
  color: #fff; box-shadow: 0 0 10px rgba(255, 46, 99, 0.4);
}
.scr-btn-refresh {
  background: linear-gradient(135deg, #FFAA22, #cc8800);
  color: #08101E; box-shadow: 0 0 10px rgba(255, 170, 34, 0.4);
}
.scr-btn-exit {
  background: transparent; color: #80A4C8;
  border: 1px solid rgba(128, 164, 200, 0.5);
}
.scr-btn:hover { transform: translateY(-1px); filter: brightness(1.1); }
.scr-btn-refresh.active {
  background: linear-gradient(135deg, #36E088, #1ea860);
  box-shadow: 0 0 14px rgba(54, 224, 136, 0.6);
  animation: scrBlink 2s ease-in-out infinite;
}
@keyframes scrBlink { 0%,100%{opacity:1;} 50%{opacity:0.7;} }

/* ===== 第2行 查询栏 ===== */
.scr-query {
  flex: 0 0 52px;
  display: flex; align-items: center; gap: 14px;
  padding: 0 24px;
  background: linear-gradient(90deg, rgba(15, 32, 56, 0.6), rgba(20, 45, 75, 0.4));
  border: 1px solid rgba(36, 208, 248, 0.3);
  border-radius: 10px;
}
.scr-query-label { font-size: 13px; color: #24D0F8; letter-spacing: 1px; }
.scr-query-input {
  background: #091629; color: #D6E8F8;
  border: 1px solid rgba(36, 208, 248, 0.3);
  border-radius: 3px; padding: 6px 10px;
  font-family: 'Consolas', monospace; font-size: 13px;
  outline: none; transition: all 0.2s;
}
.scr-query-input:focus {
  border-color: #24D0F8;
  box-shadow: 0 0 8px rgba(36, 208, 248, 0.4);
}
.scr-query-sep { color: #80A4C8; font-size: 13px; }
.scr-query-info { margin-left: auto; font-size: 12px; color: #80A4C8; }
.scr-query-info b { color: #FFCC44; font-family: 'Consolas', monospace; }

/* ===== 第3行 KPI 4 联卡 ===== */
.scr-kpi-row {
  flex: 0 0 76px;
  display: grid; grid-template-columns: repeat(4, 1fr);
  column-gap: 10px;
  row-gap: 20px;
}
.scr-kpi {
  position: relative;
  background: linear-gradient(135deg, rgba(15, 32, 56, 0.95), rgba(10, 21, 38, 0.8));
  border: 1px solid rgba(36, 208, 248, 0.3);
  border-radius: 8px;
  padding: 6px 14px 6px 20px;
  display: flex; flex-direction: column; justify-content: space-between;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), inset 0 0 20px rgba(36, 208, 248, 0.05);
  transition: transform 0.3s, box-shadow 0.3s;
}
.scr-kpi:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(36, 208, 248, 0.25), inset 0 0 24px rgba(36, 208, 248, 0.1);
}
/* 左侧彩色装饰条 */
.scr-kpi::before {
  content: '';
  position: absolute; top: 10px; bottom: 10px; left: 0;
  width: 3px; border-radius: 0 2px 2px 0;
  background: var(--kpi-color, #24D0F8);
  box-shadow: 0 0 8px var(--kpi-color, #24D0F8);
}
/* 右下角发光圆 */
.scr-kpi::after {
  content: ''; position: absolute; right: -20px; bottom: -20px;
  width: 60px; height: 60px; border-radius: 50%;
  background: radial-gradient(circle, var(--kpi-glow, rgba(36, 208, 248, 0.18)), transparent 70%);
  pointer-events: none;
}
.scr-kpi-label {
  font-size: 11px; color: #80A4C8;
  letter-spacing: 1.2px; text-transform: uppercase;
  line-height: 1;
}
.scr-kpi-val {
  font-size: 24px; font-weight: 700; color: #FFFFFF;
  font-family: 'Consolas', 'DIN Alternate', monospace;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
  line-height: 1;
  display: flex; align-items: baseline; gap: 4px;
}
.scr-kpi-sub {
  font-size: 10px; color: #5A7A95;
  letter-spacing: 0.8px;
  line-height: 1;
  position: relative; z-index: 1;
}

/* ===== 第4行 主体: 左表格 + 中地图 + 右表格 ===== */
.scr-main {
  display: grid;
  grid-template-columns: 1fr 1.6fr 1fr;
  grid-template-rows: 540px 560px;
  column-gap: 10px;
  row-gap: 20px;
  min-height: 1120px;
  /* contain: 让浏览器将大屏作为独立子树, 减少侧边栏过渡期间对外 reflow 的连锁计算 */
  contain: layout style;
}
.scr-main .scr-card-records { grid-row: 1; grid-column: 1; }
.scr-main .scr-card-map    { grid-row: 1; grid-column: 2; }
.scr-main .scr-card-games  { grid-row: 1; grid-column: 3; }
.scr-main .scr-card-rank   { grid-row: 2; grid-column: 1; }
.scr-main .scr-card-trend  { grid-row: 2; grid-column: 2; }
.scr-main .scr-card-pie    { grid-row: 2; grid-column: 3; }

/* 三列同行高度对齐：表格/地图都填满卡片 */
.scr-main .scr-card-games,
.scr-main .scr-card-records,
.scr-main .scr-card-map,
.scr-main .scr-card-rank,
.scr-main .scr-card-trend,
.scr-main .scr-card-pie { min-height: 0; height: 100%; }
.scr-card-games .scr-card-body,
.scr-card-records .scr-card-body,
.scr-card-map .scr-card-body { height: 100%; padding: 0; }
.scr-card-games .scr-table-wrap,
.scr-card-records .scr-table-wrap { height: 100%; }

/* 地图卡片（中心主体，加粗描边和发光） */
.scr-card-map {
  border-color: rgba(36, 208, 248, 0.55) !important;
  box-shadow: 0 0 24px rgba(36, 208, 248, 0.25), inset 0 0 40px rgba(20, 45, 75, 0.5);
}
.scr-card-map .scr-card-head {
  background: linear-gradient(90deg, rgba(36, 208, 248, 0.18), transparent);
  border-bottom-color: rgba(36, 208, 248, 0.35);
}
.scr-card-map .scr-card-title { color: #24D0F8; text-shadow: 0 0 8px rgba(36, 208, 248, 0.5); }
.scr-card-map #scr-map { width: 100%; height: 100%; }

/* 滚动表格容器 */
.scr-table-wrap {
  width: 100%; height: 100%; overflow: hidden; position: relative;
  /* contain 隔离: 表格滚动重绘不扩散到外层, 大幅减少 paint 区域 */
  contain: strict;
  content-visibility: auto;
}
.scr-table-scroll {
  width: 100%; height: 100%; overflow-y: auto;
  scrollbar-width: none; -ms-overflow-style: none;
  /* 提升为合成层, scrollTop 变化不触发 layout */
  will-change: scroll-position;
  transform: translateZ(0);
}
.scr-table-scroll::-webkit-scrollbar { width: 0; display: none; }
.scr-table-scroll::-webkit-scrollbar-thumb { background: transparent; }
.scr-table-scroll::-webkit-scrollbar-track { background: transparent; }

/* 表格自动滚动动画（数据多时启用） */
.scr-table-auto {
  animation: scrTableScroll 12s linear infinite;
}
@keyframes scrTableScroll {
  0% { transform: translateY(0); }
  100% { transform: translateY(-50%); }
}

/* 表格样式 */
.scr-table { width: 100%; font-size: 12px; border-collapse: collapse; }
.scr-table thead th {
  position: sticky; top: 0; z-index: 2;
  background: #0F2038; color: #24D0F8;
  padding: 8px 10px; text-align: left; font-weight: 500; font-size: 11px;
  letter-spacing: 1px;
  border-bottom: 1px solid rgba(36, 208, 248, 0.4);
  white-space: nowrap;
}
.scr-table tbody td {
  padding: 7px 10px; border-bottom: 1px solid rgba(60, 180, 240, 0.08);
  color: #D6E8F8; white-space: nowrap;
  font-size: 11px;
  /* contain 防止 hover 时整列 reflow */
  contain: layout style paint;
}
.scr-table tbody tr:hover td { background: rgba(36, 208, 248, 0.06); }
.scr-num { color: #FFCC44; font-family: 'Consolas', monospace; font-weight: 500; }
.scr-name { color: #D6E8F8; }
.scr-tag {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 10px; font-weight: 500;
}
.scr-tag-on  { background: rgba(54, 224, 136, 0.2); color: #36E088; border: 1px solid rgba(54, 224, 136, 0.4); }
.scr-tag-off { background: rgba(128, 164, 200, 0.15); color: #80A4C8; border: 1px solid rgba(128, 164, 200, 0.3); }
.scr-empty-row { text-align: center; color: #80A4C8; padding: 30px 10px; }

/* 空状态 */
.scr-empty {
  display: flex; align-items: center; justify-content: center;
  height: 100%; color: #80A4C8; font-size: 14px;
}
