:root {
  --bg-0: #030b1a;
  --bg-1: #061630;
  --panel-bg: rgba(9, 30, 61, 0.55);
  --panel-border: rgba(64, 158, 255, 0.35);
  --line: rgba(64, 158, 255, 0.18);
  --cyan: #00e5ff;
  --blue: #2f80ff;
  --green: #37f2b3;
  --orange: #ff9f43;
  --red: #ff5b7f;
  --purple: #9d7bff;
  --gold: #ffd166;
  --text: #dbeaff;
  --text-dim: #7fa6d8;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-0);
  font-family: "PingFang SC", "Microsoft YaHei", "HarmonyOS Sans", Helvetica, Arial, sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

#screen-wrap {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(1200px 700px at 50% -10%, rgba(20, 76, 150, 0.45), transparent 60%),
    radial-gradient(900px 600px at 10% 110%, rgba(12, 60, 120, 0.35), transparent 60%),
    linear-gradient(160deg, var(--bg-0), var(--bg-1));
}

#screen {
  position: relative;
  width: 1920px;
  height: 1080px;
  transform-origin: 0 0;
  padding: 4px 4px 4px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ============ 顶部标题栏 ============ */
.screen-header {
  position: relative;
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background:
    linear-gradient(180deg, rgba(20, 70, 140, 0.5), rgba(8, 26, 54, 0.1));
  border-bottom: 2px solid transparent;
  border-image: linear-gradient(90deg, transparent, var(--cyan), transparent) 1;
  margin-bottom: 6px;
}
.screen-header::before,
.screen-header::after {
  content: "";
  position: absolute;
  bottom: -2px;
  width: 120px;
  height: 2px;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
}
.screen-header::before { left: 0; }
.screen-header::after { right: 0; }

.header-title { text-align: center; line-height: 1.1; }
.title-main {
  display: block;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 3px;
  white-space: nowrap;
  background: linear-gradient(180deg, #ffffff, #74d7ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 22px rgba(0, 200, 255, 0.35);
}
.title-sub {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  letter-spacing: 5px;
  color: var(--text-dim);
}

.header-side {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 360px;
  font-size: 15px;
  color: var(--text-dim);
}
.header-right { justify-content: flex-end; }
.header-nav { cursor: pointer; padding: 4px 8px; border-radius: 4px; }
.header-nav.active {
  color: var(--cyan);
  background: rgba(0, 229, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(0, 229, 255, 0.4);
}
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
}
.clock-time {
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
}
.clock-date { font-size: 15px; }
.weather { font-size: 13px; }

/* ============ 主体三列 ============ */
.screen-body {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1.42fr 1fr;
  gap: 6px;
  min-height: 0;
}
.col { display: flex; flex-direction: column; gap: 6px; min-height: 0; min-width: 0; }

/* ============ 面板 ============ */
.panel {
  position: relative;
  flex: 1;
  min-height: 0;
  min-width: 0;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  backdrop-filter: blur(2px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.panel::before, .panel::after {
  content: "";
  position: absolute;
  width: 14px; height: 14px;
  border: 2px solid var(--cyan);
  opacity: 0.8;
}
.panel::before { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.panel::after { bottom: -1px; right: -1px; border-left: none; border-top: none; }

.panel-head {
  height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  font-size: 17px;
  font-weight: 600;
  color: #eaf4ff;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(0, 229, 255, 0.12), transparent);
}
.panel-head i {
  width: 4px; height: 16px; border-radius: 2px;
  background: linear-gradient(180deg, var(--cyan), var(--blue));
  box-shadow: 0 0 8px var(--cyan);
}
.panel-head em {
  margin-left: auto;
  font-style: normal;
  font-size: 12px;
  color: var(--text-dim);
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.panel-head em.live-dot {
  color: var(--red);
  border-color: rgba(255, 91, 127, 0.5);
  position: relative;
  padding-left: 16px;
}
.panel-head em.live-dot::before {
  content: "";
  position: absolute;
  left: 6px; top: 50%; transform: translateY(-50%);
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 8px var(--red);
  animation: blink 1s infinite;
}
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0.2; } }

.panel-body { flex: 1; min-height: 0; min-width: 0; padding: 8px 10px; overflow: hidden; }
.chart { width: 100%; height: 100%; }

/* 店铺筛选下拉 */
.store-filter {
  margin-left: 12px;
  background: rgba(0, 229, 255, 0.08);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 13px;
  outline: none;
  cursor: pointer;
  max-width: 220px;
}
.store-filter:hover { border-color: var(--cyan); }
.store-filter option { background: #0a1830; color: var(--text); }

/* 排序切换按钮 */
.sort-toggle { margin-left: auto; display: flex; gap: 4px; }
.sort-toggle button {
  font-size: 12px; padding: 3px 10px; cursor: pointer;
  color: var(--text-dim);
  background: rgba(64, 158, 255, 0.08);
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: all 0.15s;
}
.sort-toggle button:hover { color: var(--text); }
.sort-toggle button.active {
  color: #04121f; font-weight: 700;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  border-color: transparent;
}

/* ============ 中列 KPI ============ */
.col-center { }
.map-panel { flex: 1; }
/* 订单量走势：高度与左列 GMV 走势面板一致（左列 3 面板均分，约 304px） */
.order-trend-panel { flex: 0 0 304px; }
.feed-panel { flex: 1.7; }

.kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  flex: 0 0 auto;
}
.kpi-card {
  position: relative;
  padding: 9px 14px;
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  background:
    linear-gradient(180deg, rgba(0, 229, 255, 0.10), rgba(9, 30, 61, 0.4));
  overflow: hidden;
}
.kpi-card::after {
  content: "";
  position: absolute;
  right: -20px; top: -20px;
  width: 70px; height: 70px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 229, 255, 0.25), transparent 70%);
}
.kpi-label { font-size: 14px; color: var(--text-dim); display: flex; align-items: center; gap: 6px; }
.kpi-label .ic { font-size: 16px; }
.kpi-value {
  margin-top: 4px;
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 16px rgba(0, 200, 255, 0.4);
  line-height: 1.1;
}
.kpi-value .unit { font-size: 15px; font-weight: 500; color: var(--text-dim); margin-left: 3px; }
.kpi-cur { font-size: 15px; color: var(--cyan); margin-right: 2px; }
.kpi-foot {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 6px;
}
.kpi-foot .rise { color: var(--green); }
.kpi-foot .fall { color: var(--red); }
.kpi-foot .dim { color: var(--text-dim); }

/* ============ 右列 商品列表 ============ */
.goods-list { height: 100%; display: flex; flex-direction: column; gap: 8px; overflow: hidden; }
.goods-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.03);
}
.goods-rank {
  width: 22px; height: 22px; flex: 0 0 22px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; border-radius: 4px;
  background: rgba(64, 158, 255, 0.2); color: var(--text);
}
.goods-item:nth-child(1) .goods-rank { background: linear-gradient(135deg, #ffcf5c, #ff9f43); color: #3a2500; }
.goods-item:nth-child(2) .goods-rank { background: linear-gradient(135deg, #d9e6ff, #9fb6da); color: #12233f; }
.goods-item:nth-child(3) .goods-rank { background: linear-gradient(135deg, #ffab76, #d97b3a); color: #2e1500; }
.goods-thumb {
  width: 38px; height: 38px; flex: 0 0 38px;
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  background: rgba(0, 229, 255, 0.1);
  border: 1px solid var(--line);
}
.goods-info { flex: 1; min-width: 0; }
.goods-name {
  font-size: 14px; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.goods-bar-wrap { margin-top: 4px; height: 6px; border-radius: 3px; background: rgba(255,255,255,0.06); overflow: hidden; }
.goods-bar { height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--blue), var(--cyan)); }
.goods-num { flex: 0 0 auto; text-align: right; }
.goods-sales { font-size: 15px; font-weight: 700; color: var(--cyan); }
.goods-unit { font-size: 11px; color: var(--text-dim); }

/* ============ 右列 实时订单播报 ============ */
.order-feed { height: 100%; overflow: hidden; position: relative; }
.order-feed-inner { display: flex; flex-direction: column; gap: 8px; will-change: transform; }
.feed-empty { color: var(--text-dim); font-size: 13px; text-align: center; padding: 30px 0; }
.order-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 4px;
  background: linear-gradient(90deg, rgba(0, 229, 255, 0.08), transparent);
  border-left: 2px solid var(--cyan);
  animation: slideIn 0.5s ease;
}
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
.order-flag { font-size: 20px; flex: 0 0 auto; }
.order-main { flex: 1; min-width: 0; }
.order-title { font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.order-meta { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.order-amount { font-size: 16px; font-weight: 700; color: var(--gold); flex: 0 0 auto; }
.order-platform {
  font-size: 10px; padding: 1px 6px; border-radius: 8px;
  background: rgba(64, 158, 255, 0.2); color: var(--cyan); margin-left: 6px;
}
