/* ============================================================
   NO:2 COFFEE · 数据驾驶舱 · 餐饮大屏风格
   配色：深蓝 #0a1a3a / 蓝 #1890ff / 橙 #ff8c00 / 青 #00d4ff
   布局：每页 3列(左4 + 中2 + 右4) 九宫格
   ============================================================ */
:root {
  --bg-deep:    #050d1f;
  --bg:         #0a1a3a;
  --card:       rgba(15,35,75,0.6);
  --card-hover: rgba(20,45,95,0.7);
  --border:     rgba(24,144,255,0.25);
  --line:       rgba(24,144,255,0.18);
  --blue:       #1890ff;
  --blue-2:     #0e6dd8;
  --orange:     #ffa500;
  --orange-2:   #ff8c00;
  --cyan:       #00d4ff;
  --green:      #00ff88;
  --red:        #ff4d4f;
  --purple:     #a855f7;
  --yellow:     #ffd54f;
  --pink:       #ff5c8d;
  --t:          #5d8fb0;   /* 副文本 */
  --t2:         #a8c5e0;   /* 中等文本 */
  --t3:         #d8e7f5;   /* 主文本 */
  --hd:         #ffffff;   /* 标题 */
}
* { margin:0; padding:0; box-sizing:border-box; }
html, body { height:100%; }
body {
  font-family: "Microsoft YaHei","PingFang SC",sans-serif;
  background: var(--bg-deep);
  color: var(--t3);
  overflow: hidden;
  min-width: 1280px;
  min-height: 720px;
}

/* ============ 整体框架 ============ */
.wrap {
  height: 100vh;
  padding: 8px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(24,144,255,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(255,140,0,0.06) 0%, transparent 50%),
    var(--bg-deep);
}

/* ============ 顶部 Header ============ */
.header {
  position: relative;
  height: 52px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 0 20px;
  background: linear-gradient(90deg, rgba(10,26,58,0.4) 0%, rgba(15,35,80,0.6) 50%, rgba(10,26,58,0.4) 100%);
}
.header::before, .header::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 200px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--blue), transparent);
}
.header::before { left: 0; }
.header::after  { right: 0; }
.title {
  flex: 1;
  text-align: center;
  font: 700 22px/1 "Microsoft YaHei";
  color: var(--hd);
  letter-spacing: 4px;
  text-shadow: 0 0 12px rgba(24,144,255,0.6);
}
.title::before, .title::after {
  content: '';
  display: inline-block;
  width: 30px;
  height: 12px;
  vertical-align: middle;
  margin: 0 12px;
  background: linear-gradient(90deg, transparent, var(--blue));
}
.title::after { background: linear-gradient(90deg, var(--blue), transparent); }

.datetime {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font: 12px/1 "Consolas", monospace;
  color: var(--t);
  display: flex;
  align-items: center;
  gap: 10px;
}
.datetime b {
  color: var(--orange);
  font-weight: 700;
  font-size: 14px;
}
.warn-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 6px var(--orange);
  animation: pulse 1.5s infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }

/* ============ Tab栏 ============ */
.tabs {
  display: flex;
  align-items: stretch;
  height: 36px;
  flex-shrink: 0;
  gap: 0;
  padding: 0 16px;
}
.tab {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 22px;
  font-size: 13px;
  color: var(--t2);
  cursor: pointer;
  user-select: none;
  transition: 0.2s;
  border-bottom: 2px solid transparent;
}
.tab::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--t);
  margin-right: 8px;
  transition: 0.2s;
}
.tab:hover { color: var(--t3); }
.tab:hover::before { background: var(--cyan); box-shadow: 0 0 4px var(--cyan); }
.tab.active {
  color: var(--orange);
  font-weight: 700;
  border-bottom-color: var(--orange);
  text-shadow: 0 0 6px rgba(255,140,0,0.5);
}
.tab.active::before { background: var(--orange); box-shadow: 0 0 6px var(--orange); }

/* ============ 主区域 9宫格 ============ */
.main {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1.6fr 1fr;
  gap: 8px;
  min-height: 0;
}
.main.hidden { display: none; }
.col {
  display: grid;
  grid-template-rows: repeat(4, 1fr);
  gap: 8px;
  min-height: 0;
}
.col.center {
  grid-template-rows: 1.5fr 1fr;
  grid-template-rows: minmax(0,1.4fr) minmax(0,0.8fr);
}
.col.center > .card:first-child { grid-row: span 1; }

/* ============ 卡片 ============ */
.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 2px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  backdrop-filter: blur(2px);
}
/* 四角装饰 */
.card::before, .card::after,
.card .corner-tl, .card .corner-br {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  border-color: var(--blue);
  border-style: solid;
  border-width: 0;
  pointer-events: none;
  z-index: 2;
}
.card::before { top: 0; left: 0; border-top-width: 1px; border-left-width: 1px; }
.card::after  { top: 0; right: 0; border-top-width: 1px; border-right-width: 1px; }
.card .corner-tl { bottom: 0; left: 0; border-bottom-width: 1px; border-left-width: 1px; }
.card .corner-br { bottom: 0; right: 0; border-bottom-width: 1px; border-right-width: 1px; }

/* 标题 */
.card-hd {
  height: 28px;
  flex-shrink: 0;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--t3);
  background: linear-gradient(90deg, rgba(24,144,255,0.15) 0%, transparent 100%);
  border-bottom: 1px solid var(--line);
}
.card-hd::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 12px;
  background: linear-gradient(180deg, var(--blue), var(--cyan));
  border-radius: 1px;
}
.card-hd .unit {
  margin-left: auto;
  font-size: 10px;
  color: var(--t);
}
.card-bd {
  flex: 1;
  padding: 6px 8px;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

/* 地图标记装饰 */
.dot {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 8px var(--orange);
  transform: translate(-50%, -50%);
  animation: pulse 1.8s infinite;
}
.dot::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 16px; height: 16px;
  border: 1px solid var(--orange);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.5;
}
@keyframes pulse { 0%,100%{transform:translate(-50%,-50%) scale(1);opacity:1} 50%{transform:translate(-50%,-50%) scale(1.4);opacity:0.5} }

/* ============ 数字大字 ============ */
.kpi {
  text-align: center;
  padding: 8px 4px;
}
.kpi .l {
  font-size: 11px;
  color: var(--t);
  margin-bottom: 4px;
}
.kpi .v {
  font: 700 22px/1 "Consolas", monospace;
  color: var(--blue);
  text-shadow: 0 0 8px rgba(24,144,255,0.4);
}
.kpi .v.orange { color: var(--orange); text-shadow: 0 0 8px rgba(255,140,0,0.4); }
.kpi .v.cyan   { color: var(--cyan);   text-shadow: 0 0 8px rgba(0,212,255,0.4); }
.kpi .v.green  { color: var(--green); }
.kpi .s {
  margin-top: 3px;
  font-size: 10px;
  color: var(--t);
}
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  height: 100%;
  align-content: center;
}

/* ============ 列表（带进度条） ============ */
.barlist {
  display: flex;
  flex-direction: column;
  gap: 5px;
  height: 100%;
  overflow: hidden;
}
.barlist .row {
  display: grid;
  grid-template-columns: 70px 1fr 50px;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}
.barlist .row .n {
  color: var(--t3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.barlist .row .bar {
  height: 8px;
  background: rgba(24,144,255,0.1);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}
.barlist .row .bar div {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: linear-gradient(90deg, var(--blue-2), var(--blue), var(--cyan));
  border-radius: 2px;
  box-shadow: 0 0 6px rgba(24,144,255,0.5);
  transition: width 0.6s;
}
.barlist .row .bar div.orange {
  background: linear-gradient(90deg, var(--orange-2), var(--orange), var(--yellow));
  box-shadow: 0 0 6px rgba(255,140,0,0.5);
}
.barlist .row .val {
  text-align: right;
  font: 700 11px/1 "Consolas", monospace;
  color: var(--blue);
}
.barlist .row .val.orange { color: var(--orange); }
.barlist .row .val.cyan   { color: var(--cyan); }
.barlist .row .v-flex {
  display: flex; align-items: center; gap: 6px;
}
.barlist .row .v-flex .v { font-size: 10px; color: var(--t); }

/* ============ 柱状图 canvas ============ */
canvas { display: block; width: 100%; height: 100%; }

/* ============ 仪表盘环形进度 ============ */
.ring-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ring-wrap svg { width: 100%; height: 100%; }
.ring-center {
  position: absolute;
  text-align: center;
}
.ring-center .v {
  font: 700 18px/1 "Consolas", monospace;
  color: var(--orange);
  text-shadow: 0 0 6px rgba(255,140,0,0.4);
}
.ring-center .l {
  margin-top: 4px;
  font-size: 10px;
  color: var(--t);
}

/* ============ 图例 ============ */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 10px;
  color: var(--t2);
  padding: 2px 0;
}
.legend .li {
  display: flex; align-items: center; gap: 3px;
}
.legend .sw {
  width: 8px; height: 8px; border-radius: 1px;
}

/* ============ 排名列表 ============ */
.rank {
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 100%;
  overflow: hidden;
}
.rank .r {
  display: grid;
  grid-template-columns: 22px 1fr 50px;
  gap: 6px;
  align-items: center;
  font-size: 11px;
  padding: 2px 0;
}
.rank .idx {
  width: 18px; height: 18px;
  font: 700 11px/18px "Consolas", monospace;
  text-align: center;
  background: rgba(24,144,255,0.2);
  color: var(--blue);
  border-radius: 2px;
}
.rank .idx.top1 { background: linear-gradient(135deg,#ff4d4f,#ff8c00); color:#fff; }
.rank .idx.top2 { background: linear-gradient(135deg,#ffa500,#ffd54f); color:#fff; }
.rank .idx.top3 { background: linear-gradient(135deg,#1890ff,#00d4ff); color:#fff; }
.rank .nm { color: var(--t3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank .v  { text-align: right; font: 700 11px "Consolas"; color: var(--orange); }

/* ============ 中央地图 ============ */
.map-bg {
  position: relative;
  width: 100%; height: 100%;
  background:
    radial-gradient(ellipse at center, rgba(24,144,255,0.08) 0%, transparent 60%),
    repeating-linear-gradient(0deg, transparent 0 39px, rgba(24,144,255,0.08) 39px 40px),
    repeating-linear-gradient(90deg, transparent 0 39px, rgba(24,144,255,0.08) 39px 40px);
}
.map-info {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(24,144,255,0.15);
  border: 1px solid var(--border);
  padding: 6px 14px;
  font-size: 11px;
  color: var(--t2);
  white-space: nowrap;
  border-radius: 2px;
}
.map-info b { color: var(--orange); font-weight: 700; margin: 0 4px; }

/* ============ 趋势双线（橙色+青色） ============ */
.trend-legend {
  display: flex; gap: 12px; font-size: 10px; color: var(--t2);
  padding: 4px 0 0;
}
.trend-legend .lg { display: flex; align-items: center; gap: 4px; }
.trend-legend .ln { width: 14px; height: 2px; background: var(--orange); }
.trend-legend .ln.c { background: var(--cyan); }

/* ============ 实时订单列表 ============ */
.live {
  display: flex; flex-direction: column; gap: 4px; height: 100%; overflow: hidden;
}
.live .li {
  display: grid;
  grid-template-columns: 50px 1fr 60px;
  align-items: center;
  font-size: 11px;
  padding: 4px 6px;
  background: rgba(24,144,255,0.06);
  border-left: 2px solid var(--blue);
  border-radius: 2px;
}
.live .tm { color: var(--cyan); font: 700 10px "Consolas"; }
.live .it { color: var(--t2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live .am { text-align: right; color: var(--orange); font: 700 11px "Consolas"; }

/* ============ 滚动条 ============ */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-thumb { background: rgba(24,144,255,0.3); border-radius: 2px; }
::-webkit-scrollbar-track { background: transparent; }

/* ============ 隐藏/显示 ============ */
.hidden { display: none !important; }

/* ============ 适配小屏 ============ */
@media (max-width: 1400px) {
  .title { font-size: 18px; letter-spacing: 2px; }
  .kpi .v { font-size: 18px; }
  .barlist .row { font-size: 10px; }
}
