/* ============================================================
   喃旺小匠 · 数据大屏 样式
   深色科技风 · 1920×1080 固定布局 · scale 自适应
   ============================================================ */

/* ---------- CSS 变量 ---------- */
:root {
  --db-bg: #050818;
  --db-bg-2: #0a1030;
  --db-bg-3: #0f1845;
  --db-card: rgba(15, 25, 65, 0.65);
  --db-card-border: rgba(0, 229, 255, 0.3);
  --db-glow-cyan: #00e5ff;
  --db-glow-purple: #a855f7;
  --db-glow-blue: #22d3ee;
  --db-glow-gold: #fbbf24;
  --db-glow-pink: #ec4899;
  --db-glow-green: #34d399;
  --db-text: #f0f4ff;
  --db-text-dim: #a0b4d8;
  --db-text-mute: #6a7eaa;
}

/* ---------- 全局重置 ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--db-bg); /* 与大屏背景一致，非 16:9 屏幕下黑边无缝融合 */
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
    'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  color: var(--db-text);
}

/* ---------- 大屏容器 ---------- */
.dashboard-wrapper {
  position: absolute;
  left: 0;
  top: 0;
  width: 1920px;
  height: 1080px;
  transform-origin: top left;
  background: var(--db-bg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ---------- Canvas 粒子背景 ---------- */
#particleCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ---------- 网格背景 ---------- */
.grid-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(0, 229, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 255, 0.06) 1px, transparent 1px);
  background-size: 50px 50px;
}

/* ---------- 径向光晕 ---------- */
.radial-glow {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 40% at 50% 10%, rgba(0, 229, 255, 0.12), transparent),
    radial-gradient(ellipse 50% 50% at 80% 80%, rgba(168, 85, 247, 0.10), transparent),
    radial-gradient(ellipse 40% 40% at 15% 70%, rgba(34, 211, 238, 0.08), transparent),
    radial-gradient(ellipse 30% 30% at 50% 50%, rgba(236, 72, 153, 0.06), transparent);
}

/* ---------- 四角装饰 ---------- */
.corner-decoration {
  position: absolute;
  width: 40px;
  height: 40px;
  z-index: 2;
  pointer-events: none;
}
.corner-decoration::before,
.corner-decoration::after {
  content: '';
  position: absolute;
  background: var(--db-glow-cyan);
  box-shadow: 0 0 8px var(--db-glow-cyan);
}
.corner-decoration.tl { top: 12px; left: 12px; }
.corner-decoration.tl::before { top: 0; left: 0; width: 40px; height: 2px; }
.corner-decoration.tl::after  { top: 0; left: 0; width: 2px; height: 40px; }

.corner-decoration.tr { top: 12px; right: 12px; }
.corner-decoration.tr::before { top: 0; right: 0; width: 40px; height: 2px; }
.corner-decoration.tr::after  { top: 0; right: 0; width: 2px; height: 40px; }

.corner-decoration.bl { bottom: 12px; left: 12px; }
.corner-decoration.bl::before { bottom: 0; left: 0; width: 40px; height: 2px; }
.corner-decoration.bl::after  { bottom: 0; left: 0; width: 2px; height: 40px; }

.corner-decoration.br { bottom: 12px; right: 12px; }
.corner-decoration.br::before { bottom: 0; right: 0; width: 40px; height: 2px; }
.corner-decoration.br::after  { bottom: 0; right: 0; width: 2px; height: 40px; }

/* ---------- 布局主框架 ---------- */
.db-body {
  position: relative;
  z-index: 1;
  width: 100%;
  flex: 1;
  min-height: 0;
  padding: 80px 20px 16px; /* 顶部栏高度 80px */
  display: flex;
  gap: 16px;
}

/* ---------- 顶部栏 ---------- */
.db-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 80px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  background: linear-gradient(180deg, rgba(5, 8, 24, 0.98), rgba(5, 8, 24, 0.7));
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 229, 255, 0.35);
}

.db-topbar::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 10%;
  right: 10%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--db-glow-cyan), var(--db-glow-purple), var(--db-glow-cyan), transparent);
  animation: glowLine 3s ease-in-out infinite;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.5);
}

@keyframes glowLine {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.db-topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.db-logo {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.35)) drop-shadow(0 0 18px rgba(0, 229, 255, 0.3));
}

.db-logo-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.db-logo-cn {
  font-size: 22px;
  line-height: 1.1;
  font-weight: 700;
  background: linear-gradient(135deg, var(--db-glow-cyan), var(--db-glow-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.db-logo-en {
  font-size: 10px;
  line-height: 1;
  letter-spacing: 3px;
  color: #6f81ad;
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.3);
  white-space: nowrap;
}

.db-tm {
  font-size: 11px;
  font-weight: 400;
  color: var(--db-glow-gold);
  margin-left: 2px;
  vertical-align: super;
  text-shadow: 0 0 6px rgba(251, 191, 36, 0.5);
}

.db-topbar-center {
  text-align: center;
}

.db-main-title {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--db-text);
  /* 跑马灯视口：固定宽度，超出隐藏，两端渐隐 */
  width: 1100px;
  margin: 0 auto;
  overflow: hidden;
  white-space: nowrap;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

/* 科技感霓虹：文案青/紫交替发光 */
.db-marquee-group > span:nth-child(odd) {
  color: #8fe8ff;
  text-shadow: 0 0 12px rgba(0, 229, 255, 0.75), 0 0 28px rgba(0, 229, 255, 0.35);
}

.db-marquee-group > span:nth-child(even) {
  color: #cdbcff;
  text-shadow: 0 0 12px rgba(168, 85, 247, 0.75), 0 0 28px rgba(168, 85, 247, 0.35);
}

.db-marquee-track {
  display: inline-flex;
  white-space: nowrap;
  animation: dbMarquee 51s linear infinite;
}

.db-marquee-group {
  display: inline-flex;
  flex-shrink: 0;
}

.db-marquee-group > span::after {
  content: '✦';
  margin: 0 28px;
  font-size: 14px;
  letter-spacing: 0;
  color: var(--db-glow-cyan);
  opacity: 0.7;
  vertical-align: 3px;
  text-shadow: none;
}

/* 无缝跑马灯：两份内容循环平移 50% */
@keyframes dbMarquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.db-topbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.db-clock {
  text-align: right;
}

.db-clock-date {
  font-size: 13px;
  color: var(--db-text-dim);
  letter-spacing: 1px;
}

.db-clock-time {
  font-size: 20px;
  font-weight: 700;
  color: var(--db-glow-cyan);
  font-family: 'Consolas', 'Monaco', monospace;
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.6);
}

.db-topbar-btns {
  display: flex;
  gap: 10px;
}

.db-btn {
  padding: 8px 16px;
  font-size: 13px;
  border: 1px solid var(--db-card-border);
  background: rgba(0, 229, 255, 0.08);
  color: var(--db-glow-cyan);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(5px);
}

.db-btn:hover {
  background: rgba(0, 229, 255, 0.2);
  border-color: var(--db-glow-cyan);
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.3);
}

/* ---------- 左侧栏 ---------- */
.db-left {
  width: 340px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
}

/* ---------- 右侧栏 ---------- */
.db-right {
  width: 520px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
}

/* ---------- 中央主区 ---------- */
.db-center {
  flex: 1 1 980px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  overflow: hidden;
}

/* ---------- 通用卡片 ---------- */
.db-card {
  background: linear-gradient(135deg, rgba(15, 25, 65, 0.75), rgba(10, 18, 50, 0.6));
  border: 1px solid rgba(0, 229, 255, 0.22);
  border-radius: 14px;
  backdrop-filter: blur(12px);
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.08), inset 0 1px 0 rgba(0, 229, 255, 0.1);
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.db-card:hover {
  border-color: rgba(0, 229, 255, 0.4);
  box-shadow: 0 0 30px rgba(0, 229, 255, 0.18), inset 0 1px 0 rgba(0, 229, 255, 0.15);
}

.db-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 229, 255, 0.8), rgba(168, 85, 247, 0.4), transparent);
}

.db-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px 10px;
  border-bottom: 1px solid rgba(0, 229, 255, 0.15);
}

.db-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--db-glow-cyan);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 1px;
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.3);
}

.db-card-title::before {
  content: '';
  width: 3px;
  height: 14px;
  background: linear-gradient(180deg, var(--db-glow-cyan), var(--db-glow-purple));
  border-radius: 2px;
  box-shadow: 0 0 6px rgba(0, 229, 255, 0.6);
}

.db-card-body {
  padding: 16px 20px 20px;
}

.db-card-badge {
  font-size: 11px;
  color: var(--db-text-mute);
  letter-spacing: 1px;
}

/* ---------- 实时数据概览 ---------- */
.db-stats {
  flex: 1;
  min-height: 0;
}

.db-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.db-stat-item {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.10), rgba(168, 85, 247, 0.06));
  border: 1px solid rgba(0, 229, 255, 0.18);
  border-radius: 12px;
  padding: 16px 18px 14px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.06);
}

.db-stat-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--db-glow-cyan), var(--db-glow-purple));
  border-radius: 4px 0 0 4px;
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.5);
}

.db-stat-item::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(0, 229, 255, 0.5), transparent);
}

.db-stat-item:hover {
  border-color: rgba(0, 229, 255, 0.5);
  box-shadow: 0 0 30px rgba(0, 229, 255, 0.25), inset 0 0 15px rgba(0, 229, 255, 0.05);
  transform: translateY(-2px);
}

.db-stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.db-stat-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  background: rgba(0, 229, 255, 0.12);
  border: 1px solid rgba(0, 229, 255, 0.25);
}

.db-stat-num {
  font-size: 28px;
  font-weight: 700;
  font-family: 'Consolas', 'Monaco', monospace;
  background: linear-gradient(135deg, var(--db-glow-cyan), var(--db-glow-blue), var(--db-glow-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
  white-space: nowrap;
  filter: drop-shadow(0 0 8px rgba(0, 229, 255, 0.4));
}

/* 实时事件发生时的高亮闪烁（新订单 / 新用户入驻 / 新工厂入驻） */
.db-stat-item.db-stat-flash {
  animation: dbStatFlash 1s ease;
}

@keyframes dbStatFlash {
  0%   { box-shadow: 0 0 0 0 rgba(0, 229, 255, 0); }
  30%  { box-shadow: 0 0 25px 3px rgba(0, 229, 255, 0.6); filter: brightness(1.4); }
  100% { box-shadow: 0 0 0 0 rgba(0, 229, 255, 0); filter: brightness(1); }
}

.db-stat-label {
  font-size: 12px;
  color: var(--db-text-dim);
  margin-top: 2px;
  letter-spacing: 1px;
}

.db-stat-trend {
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px 6px;
  border-radius: 4px;
}

.db-stat-trend.up {
  color: #22d3ee;
  background: rgba(34, 211, 238, 0.1);
}

.db-stat-trend.down {
  color: #f5576c;
  background: rgba(245, 87, 108, 0.1);
}

.db-stat-spark {
  display: block;
  width: 100%;
  height: 28px;
  margin-top: 4px;
}

.db-stat-sub {
  font-size: 11px;
  color: var(--db-text-mute);
  display: flex;
  justify-content: space-between;
  margin-top: 2px;
}

.db-stat-sub span {
  color: var(--db-glow-cyan);
  font-weight: 600;
}

/* ---------- ECharts 图表容器统一尺寸 ---------- */
.db-roles-chart,
.db-order-trend,
.db-factory-chart,
.db-china-map,
.db-ai-category-chart {
  position: relative;
}

.db-roles-chart {
  width: 100%;
  height: 260px;
}

.db-order-trend {
  width: 100%;
  height: 190px;
}

.db-ai-category-chart {
  width: 100%;
  height: 190px;
}

/* ---------- 中央主区 · 品牌形象 ---------- */
.db-hero {
  flex-shrink: 0;
  height: 170px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.db-hero-title {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: 6px;
  background: linear-gradient(135deg, var(--db-glow-cyan) 0%, var(--db-glow-blue) 40%, var(--db-glow-purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 30px rgba(0, 229, 255, 0.3);
  animation: titleGlow 4s ease-in-out infinite;
}

@keyframes titleGlow {
  0%, 100% { filter: drop-shadow(0 0 16px rgba(0, 229, 255, 0.4)); }
  50% { filter: drop-shadow(0 0 28px rgba(168, 85, 247, 0.5)); }
}

.db-hero-sub {
  font-size: 14px;
  color: var(--db-text-dim);
  letter-spacing: 4px;
  margin-top: 8px;
}

.db-hero-sub .ai-pipeline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.db-hero-sub .pipeline-step {
  color: var(--db-glow-cyan);
  font-weight: 600;
}

.db-hero-sub .pipeline-arrow {
  color: var(--db-glow-purple);
  opacity: 0.6;
}

/* ---------- Hero 摇摇领先 · 数据亮点 ---------- */
.db-hero-highlights {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 12px;
  padding: 6px 28px;
  background: linear-gradient(90deg, rgba(0, 229, 255, 0.10), rgba(168, 85, 247, 0.08), rgba(0, 229, 255, 0.10));
  border-top: 1px solid rgba(0, 229, 255, 0.3);
  border-bottom: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: 6px;
  box-shadow: inset 0 0 20px rgba(0, 229, 255, 0.05);
}

.db-highlight-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.3s;
}

.db-highlight-item:hover {
  background: rgba(0, 229, 255, 0.15);
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.3);
  transform: translateY(-2px);
}

.db-highlight-icon {
  font-size: 18px;
  filter: drop-shadow(0 0 8px rgba(0, 229, 255, 0.6));
}

.db-highlight-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1;
}

.db-highlight-num {
  font-size: 22px;
  font-weight: 800;
  font-family: 'Consolas', 'Monaco', monospace;
  background: linear-gradient(135deg, var(--db-glow-cyan), var(--db-glow-gold), var(--db-glow-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 6px rgba(0, 229, 255, 0.4));
}

.db-highlight-unit {
  font-size: 13px;
  margin-left: 2px;
}

.db-highlight-label {
  font-size: 11px;
  color: var(--db-text-dim);
  margin-top: 2px;
  letter-spacing: 1px;
}

.db-highlight-divider {
  width: 1px;
  height: 28px;
  background: linear-gradient(180deg, transparent, rgba(0, 229, 255, 0.4), transparent);
}

/* ---------- 功能矩阵 9 宫格 ---------- */
.db-features {
  flex: 1;
  min-height: 0;
}

.db-features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 12px;
  height: calc(100% - 48px);
}

.db-feature-card {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.06), rgba(168, 85, 247, 0.03));
  border: 1px solid rgba(0, 229, 255, 0.15);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.04);
}

.db-feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 229, 255, 0.12), transparent);
  transition: left 0.6s;
}

.db-feature-card:hover {
  transform: translateY(-3px);
  border-color: rgba(0, 229, 255, 0.5);
  box-shadow: 0 8px 35px rgba(0, 229, 255, 0.25), inset 0 0 20px rgba(0, 229, 255, 0.05);
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.12), rgba(168, 85, 247, 0.06));
}

.db-feature-card:hover::before {
  left: 100%;
}

.db-feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
  background: rgba(0, 229, 255, 0.1);
}

.db-feature-info {
  flex: 1;
  min-width: 0;
}

.db-feature-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--db-text);
  margin-bottom: 4px;
}

.db-feature-desc {
  font-size: 11px;
  color: var(--db-text-dim);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- 案例轮播墙 ---------- */
.db-cases {
  flex: 1;
  min-height: 280px;
}

/* ---------- 实时交易动态（品牌 / 工厂 / 网红） ---------- */
.db-trade-feed {
  height: 100%;
  overflow: hidden;
}

.db-trade-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.db-trade-row {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 10px;
  font-size: 13px;
  white-space: nowrap;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(0, 229, 255, 0.08), rgba(168, 85, 247, 0.04));
  border: 1px solid rgba(0, 229, 255, 0.12);
  animation: tradeIn 0.45s ease;
}

@keyframes tradeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: none; }
}

.db-trade-role {
  flex: 0 0 40px;
  height: 22px;
  line-height: 20px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  border-radius: 5px;
}

.db-trade-role.brand {
  color: #00e5ff;
  background: rgba(0, 229, 255, 0.12);
  border: 1px solid rgba(0, 229, 255, 0.35);
}

.db-trade-role.factory {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.35);
}

.db-trade-role.influencer {
  color: #ff6ec7;
  background: rgba(255, 110, 199, 0.1);
  border: 1px solid rgba(255, 110, 199, 0.35);
}

.db-trade-name {
  color: #dfe8ff;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
}

.db-trade-action {
  flex: 1 1 0;
  min-width: 0;
  color: #8ea0c8;
  overflow: hidden;
  text-overflow: ellipsis;
}

.db-trade-amount {
  color: #7dffce;
  font-weight: 700;
  text-shadow: 0 0 8px rgba(0, 255, 208, 0.4);
  font-variant-numeric: tabular-nums;
}

.db-trade-time {
  color: #5a6692;
  font-size: 11px;
  flex: 0 0 auto;
}

/* ---------- 订单趋势图 ---------- */
.db-order-trend {
  height: 240px;
}

/* ---------- 工厂分布图 ---------- */
.db-factory-chart {
  height: 260px;
}

/* ---------- 扫描线动画 ---------- */
.scanline {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--db-glow-cyan), transparent);
  box-shadow: 0 0 10px var(--db-glow-cyan);
  opacity: 0.3;
  z-index: 1;
  pointer-events: none;
}

.db-card:nth-child(1) .scanline {
  top: 0;
  animation: scanDown 6s linear infinite;
}

@keyframes scanDown {
  0% { top: 0; opacity: 0; }
  10% { opacity: 0.4; }
  90% { opacity: 0.4; }
  100% { top: 100%; opacity: 0; }
}

/* ---------- AI 对话悬浮层 ---------- */
.db-ai-demo {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  gap: 12px;
  pointer-events: none;
}

.db-ai-msg {
  background: rgba(20, 30, 70, 0.85);
  border: 1px solid var(--db-card-border);
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 13px;
  max-width: 260px;
  backdrop-filter: blur(10px);
  animation: floatUp 0.6s ease-out;
}

.db-ai-msg.user {
  background: rgba(168, 85, 247, 0.15);
  border-color: rgba(168, 85, 247, 0.4);
  color: var(--db-text);
}

.db-ai-msg.ai {
  background: rgba(0, 229, 255, 0.12);
  border-color: rgba(0, 229, 255, 0.4);
  color: var(--db-glow-cyan);
}

.db-ai-msg.thinking {
  display: flex;
  align-items: center;
  gap: 4px;
}

.db-ai-msg.thinking span {
  width: 6px;
  height: 6px;
  background: var(--db-glow-cyan);
  border-radius: 50%;
  animation: dotBounce 1.4s ease-in-out infinite;
}

.db-ai-msg.thinking span:nth-child(2) { animation-delay: 0.2s; }
.db-ai-msg.thinking span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotBounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

@keyframes floatUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- 滚动条隐藏 ---------- */
::-webkit-scrollbar {
  display: none;
}

/* 呼吸光点 */
.breathing-dot {
  width: 8px;
  height: 8px;
  background: var(--db-glow-cyan);
  border-radius: 50%;
  animation: breathe 2s ease-in-out infinite;
  box-shadow: 0 0 8px var(--db-glow-cyan);
}

@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
}

/* ---------- 响应式 scale 容器 ---------- */
.db-scale-wrap {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- 中国地图卡片 ---------- */
.db-map-card {
  position: relative;
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  /* 上方边距压缩为 1px（抵消 .db-center 的 16px gap），给地图更大空间 */
  margin-top: -15px;
}

.db-map-card .db-card-body {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* 地图 + 排行榜 左右分栏 */
.db-map-wrap {
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  display: flex;
  gap: 10px;
}

.db-china-map {
  flex: 1 1 0;
  min-width: 0;
  min-height: 420px;
}

/* ---------- 活跃城市排行榜（右侧，自动滚动） ---------- */
.db-city-rank {
  flex: 0 0 190px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: rgba(10, 14, 39, 0.72);
  border: 1px solid rgba(0, 229, 255, 0.18);
  border-radius: 10px;
  padding: 10px 12px 8px;
  backdrop-filter: blur(6px);
}

.db-city-rank-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
}

.db-city-rank-tab {
  flex: 1 1 0;
  min-width: 0;
  height: 31px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  color: #8ea0c8;
  background: rgba(0, 229, 255, 0.06);
  border: 1px solid rgba(0, 229, 255, 0.18);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.25s;
  white-space: nowrap;
  padding: 0;
}

.db-city-rank-tab:hover {
  color: #dfe8ff;
}

/* 激活态跟随角色配色：网红=粉 / 品牌=青 / 工厂=金 */
.db-city-rank-tab.active[data-role="influencer"] {
  color: #ff6ec7;
  background: rgba(255, 110, 199, 0.12);
  border-color: rgba(255, 110, 199, 0.5);
  box-shadow: 0 0 10px rgba(255, 110, 199, 0.25);
}

.db-city-rank-tab.active[data-role="brand"] {
  color: #00e5ff;
  background: rgba(0, 229, 255, 0.12);
  border-color: rgba(0, 229, 255, 0.5);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.25);
}

.db-city-rank-tab.active[data-role="factory"] {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.5);
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.25);
}

.db-city-rank-view {
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 12%, #000 88%, transparent);
}

.db-city-rank-track {
  animation: dbRankScroll 16s linear infinite;
}

.db-city-rank:hover .db-city-rank-track {
  animation-play-state: paused;
}

.db-rank-group {
  display: block;
}

.db-rank-row {
  height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  white-space: nowrap;
}

.db-rank-idx {
  flex: 0 0 26px;
  height: 26px;
  line-height: 26px;
  text-align: center;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  color: #5a6692;
  background: rgba(0, 229, 255, 0.1);
}

.db-rank-idx.r1 { color: #1a1208; background: linear-gradient(135deg, #ffe27a, #ffb347); box-shadow: 0 0 10px rgba(255, 209, 102, 0.5); }
.db-rank-idx.r2 { color: #10182e; background: linear-gradient(135deg, #dbe6ff, #9fb8d8); }
.db-rank-idx.r3 { color: #241108; background: linear-gradient(135deg, #ffb48a, #d97e4a); }

.db-rank-city {
  flex: 1 1 0;
  color: #dfe8ff;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
}

.db-rank-val {
  color: #00e5ff;
  font-weight: 700;
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.45);
  font-variant-numeric: tabular-nums;
}

/* 排行榜无缝上滚：两份列表循环平移 50% */
@keyframes dbRankScroll {
  from { transform: translateY(0); }
  to { transform: translateY(-50%); }
}

/* ---------- 地图「活跃区域」图例 ---------- */
.db-map-live-legend {
  position: absolute;
  top: 46px;
  left: 20px; /* 移到左侧，避免与右侧排行榜重叠 */
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  letter-spacing: 2px;
  color: #fbbf24;
  background: rgba(10, 14, 39, 0.65);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 20px;
  padding: 4px 12px;
  z-index: 3;
  pointer-events: none;
}

.db-map-live-legend .db-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.9);
  animation: dbLivePulse 1.2s ease infinite;
}

@keyframes dbLivePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.35; transform: scale(0.75); }
}

/* ---------- 行业分类 3D 饼图 ---------- */
.db-industry-chart {
  width: 100%;
  height: 260px;
  min-height: 220px;
  flex-shrink: 0;
}

/* ---------- AI 生成分类占比 ---------- */
.db-ai-category-chart {
  width: 100%;
  height: 210px;
  flex-shrink: 0;
}

/* ---------- 底部全宽能力矩阵 ---------- */
.db-features-row {
  position: relative;
  z-index: 1;
  width: 100%;
  box-sizing: border-box;
  padding: 0 20px 16px;
  height: 176px;
  flex-shrink: 0;
  align-self: stretch;
}

.db-features-full {
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* 9 列横排能力矩阵（底部全宽） */
.db-features-grid-wide {
  grid-template-columns: repeat(9, 1fr) !important;
  grid-template-rows: 1fr !important;
  gap: 10px;
  height: 100%;
}

.db-features-grid-wide .db-feature-card {
  flex-direction: column;
  justify-content: center;
  text-align: center;
  padding: 5px;
  gap: 3px;
  cursor: pointer; /* 可点击：模拟用户涌入使用 */
  position: relative;
}

.db-features-grid-wide .db-feature-icon {
  width: 42px;
  height: 42px;
  font-size: 23px;
  border-radius: 10px;
}

.db-features-grid-wide .db-feature-label {
  font-size: 13px;
  white-space: nowrap;
}

.db-features-grid-wide .db-feature-desc {
  display: block;
  font-size: 11px;
  color: var(--db-text-mute);
  max-width: 100%;
}

/* 底部全宽能力矩阵：字体整体放大约 30%（仅作用于本区域；同步压缩间距/行高/图标盒，防止内容超出固定高度） */
.db-features-full .db-card-title {
  font-size: 19px;
}

.db-features-full .db-card-badge {
  font-size: 13px;
}

.db-features-grid-wide .db-feature-card {
  padding: 4px 6px;
  gap: 2px;
}

.db-features-grid-wide .db-feature-icon {
  width: 40px;
  height: 40px;
  font-size: 27px;
}

.db-features-grid-wide .db-feature-label {
  font-size: 16px;
  line-height: 1.15;
  margin-bottom: 0;
}

.db-features-grid-wide .db-feature-desc {
  font-size: 13px;
  line-height: 1.2;
}

.db-features-grid-wide .db-feature-live {
  font-size: 12px;
  line-height: 1.15;
  margin-top: 0;
  gap: 3px;
}

.db-features-grid-wide .db-feature-live b {
  font-size: 13px;
}

.db-features-grid-wide .db-float-plus {
  font-size: 20px;
}

/* ---------- 能力实时使用人数 + 点击互动 ---------- */
.db-feature-live {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 10px;
  color: var(--db-text-mute);
  white-space: nowrap;
  margin-top: 1px;
}

.db-feature-live b {
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 11px;
  font-weight: 700;
  color: #22d3ee;
  display: inline-block;
  transition: transform 0.3s ease, text-shadow 0.3s ease;
}

.db-live-dot-mini {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #22d3ee;
  box-shadow: 0 0 6px rgba(34, 211, 238, 0.9);
  animation: dbLivePulse 1.4s ease infinite;
  flex-shrink: 0;
}

.db-feature-card.db-feature-flash {
  animation: dbStatFlash 0.9s ease;
}

.db-float-plus {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 16px;
  font-weight: 800;
  color: #22d3ee;
  text-shadow: 0 0 10px rgba(34, 211, 238, 0.9);
  animation: dbFloatUp 1s ease forwards;
  pointer-events: none;
  z-index: 5;
}

@keyframes dbFloatUp {
  0%   { opacity: 0; transform: translate(-50%, 10px) scale(0.5); }
  15%  { opacity: 1; transform: translate(-50%, 0) scale(1.2); }
  30%  { transform: translate(-50%, -4px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -28px) scale(0.8); }
}

/* ---------- 全局扫描线动画（科技感） ---------- */
@keyframes scanlineMove {
  0%   { transform: translateY(0); }
  100% { transform: translateY(1080px); }
}

.scanline {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(0, 229, 255, 0.6), transparent);
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.4);
  pointer-events: none;
  z-index: 2;
  animation: scanlineMove 4s linear infinite;
  opacity: 0.5;
}
