/* 智慧梅花鹿产业综合服务平台（北斗牧鹿）- 展厅级科技大屏样式 */

:root {
  --bg-deep: #020b1a;
  --bg-primary: #051029;
  --bg-card: rgba(6, 25, 60, 0.75);
  --border-glow: rgba(32, 160, 255, 0.35);
  --border-bright: rgba(32, 160, 255, 0.7);
  --cyan: #00e0ff;
  --blue: #2080ff;
  --green: #00ff88;
  --yellow: #ffcc00;
  --red: #ff4466;
  --orange: #ff8800;
  --text: #e8f0ff;
  --text-dim: #6b88b0;
  --glow-cyan: 0 0 12px rgba(0, 224, 255, 0.4);
  --glow-blue: 0 0 12px rgba(32, 128, 255, 0.4);

  /* 梅花鹿主题色：呼应鹿茸/中药意象 */
  --accent-deer: #d97706;
  --accent-deer-bright: #f59e0b;
  --accent-deer-dim: rgba(217, 119, 6, 0.15);
  --glow-deer: 0 0 12px rgba(217, 119, 6, 0.45);

  /* 北斗品牌红：北斗终端/短报文等强调 */
  --beidou-red: #e63946;
  --beidou-red-dim: rgba(230, 57, 70, 0.15);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'PingFang SC', 'Microsoft YaHei', -apple-system, sans-serif;
  background: var(--bg-deep);
  color: var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── 科技感背景 ── */
.tech-grid-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(32, 128, 255, 0.08) 0%, transparent 60%),
    linear-gradient(rgba(32, 128, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(32, 128, 255, 0.02) 1px, transparent 1px);
  background-size: 100% 100%, 40px 40px, 40px 40px;
}

/* ── 科技感卡片 - 带四角装饰 ── */
.card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: 4px;
  backdrop-filter: blur(8px);
  overflow: hidden;
}
/* 四角装饰线 */
.card::before, .card::after {
  content: '';
  position: absolute;
  width: 12px; height: 12px;
  border-color: var(--cyan);
  border-style: solid;
  z-index: 2;
}
.card::before {
  top: -1px; left: -1px;
  border-width: 2px 0 0 2px;
}
.card::after {
  top: -1px; right: -1px;
  border-width: 2px 2px 0 0;
}
.card-corners-bottom::before {
  content: '';
  position: absolute;
  bottom: -1px; left: -1px;
  width: 12px; height: 12px;
  border-width: 0 0 2px 2px;
  border-style: solid;
  border-color: var(--cyan);
  z-index: 2;
}
.card-corners-bottom::after {
  content: '';
  position: absolute;
  bottom: -1px; right: -1px;
  width: 12px; height: 12px;
  border-width: 0 2px 2px 0;
  border-style: solid;
  border-color: var(--cyan);
  z-index: 2;
}

/* 卡片顶部扫光动画 */
.card-scanline::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  animation: scanline 4s linear infinite;
  z-index: 3;
}
@keyframes scanline {
  0%   { left: -60%; }
  100% { left: 100%; }
}

/* ── 区块标题 ── */
.section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--cyan);
  padding-left: 10px;
  margin-bottom: 8px;
  position: relative;
  letter-spacing: 1px;
}
.section-title::before {
  content: '';
  position: absolute;
  left: 0; top: 2px;
  width: 3px; height: 14px;
  background: var(--cyan);
  box-shadow: var(--glow-cyan);
  border-radius: 1px;
}
.section-title i {
  margin-right: 6px;
  font-size: 12px;
}

/* ── 标题栏装饰 ── */
.header-deco {
  position: relative;
  padding-bottom: 2px;
}
.header-deco::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-glow), var(--cyan), var(--border-glow), transparent);
}

/* ── 大数字 ── */
.big-num {
  font-size: 28px;
  font-weight: 700;
  font-family: 'DIN Alternate', 'Helvetica Neue', monospace;
  color: var(--cyan);
  text-shadow: var(--glow-cyan);
  line-height: 1;
}
.big-num-blue { color: var(--blue); text-shadow: var(--glow-blue); }
.big-num-green { color: var(--green); text-shadow: 0 0 12px rgba(0,255,136,0.4); }
.big-num-yellow { color: var(--yellow); text-shadow: 0 0 12px rgba(255,204,0,0.4); }
.big-num-red { color: var(--red); text-shadow: 0 0 12px rgba(255,68,102,0.4); }
.big-num-sm { font-size: 22px; }
.big-num-xs { font-size: 18px; }

/* ── 指标标签 ── */
.metric-label {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  margin-top: 2px;
}

/* ── 进度条 ── */
.progress-bar {
  height: 6px;
  background: rgba(32, 128, 255, 0.12);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}
.progress-fill {
  height: 100%;
  border-radius: 3px;
  position: relative;
  transition: width 1.5s ease;
}
.progress-fill::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 20px; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5));
  animation: progress-glow 2s ease infinite;
}
@keyframes progress-glow {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}
.progress-cyan .progress-fill { background: linear-gradient(90deg, rgba(0,224,255,0.3), var(--cyan)); }
.progress-green .progress-fill { background: linear-gradient(90deg, rgba(0,255,136,0.3), var(--green)); }
.progress-yellow .progress-fill { background: linear-gradient(90deg, rgba(255,204,0,0.3), var(--yellow)); }
.progress-red .progress-fill { background: linear-gradient(90deg, rgba(255,68,102,0.3), var(--red)); }

/* ── 状态指示点 ── */
.dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.dot-green { background: var(--green); box-shadow: 0 0 6px var(--green); }
.dot-yellow { background: var(--yellow); box-shadow: 0 0 6px var(--yellow); animation: blink 1.5s infinite; }
.dot-red { background: var(--red); box-shadow: 0 0 6px var(--red); animation: blink 1s infinite; }
.dot-cyan { background: var(--cyan); box-shadow: 0 0 6px var(--cyan); }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.3} }

/* ── 标签 ── */
.tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 2px;
  font-size: 10px;
  font-weight: 600;
}
.tag-green { background: rgba(0,255,136,0.15); color: var(--green); border: 1px solid rgba(0,255,136,0.3); }
.tag-yellow { background: rgba(255,204,0,0.15); color: var(--yellow); border: 1px solid rgba(255,204,0,0.3); }
.tag-red { background: rgba(255,68,102,0.15); color: var(--red); border: 1px solid rgba(255,68,102,0.3); }
.tag-cyan { background: rgba(0,224,255,0.15); color: var(--cyan); border: 1px solid rgba(0,224,255,0.3); }

/* ── 滚动容器 ── */
.scroll-list {
  overflow-y: auto;
  scrollbar-width: none;
}
.scroll-list::-webkit-scrollbar { display: none; }

/* ── 告警滚动条 ── */
.marquee { overflow: hidden; white-space: nowrap; }
.marquee-content {
  display: inline-block;
  animation: marquee-scroll 40s linear infinite;
}
@keyframes marquee-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ── 底部数据模块 ── */
.data-module {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: 4px;
  padding: 10px 12px;
  overflow: hidden;
}
.data-module::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--blue), var(--cyan), var(--blue), transparent);
}

/* ── 动画工具类 ── */
.animate-pulse-slow { animation: pulse 3s ease-in-out infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.6} }

.fade-in { animation: fadeIn 0.6s ease; }
@keyframes fadeIn { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:translateY(0)} }

/* ── 数字跳动动画 ── */
.num-rolling {
  display: inline-block;
  animation: numRoll 0.3s ease;
}
@keyframes numRoll { from{transform:translateY(-8px);opacity:0} to{transform:translateY(0);opacity:1} }

/* ═══════ 数据下钻面板 ═══════ */
.drilldown-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.drilldown-overlay.active { display: flex; opacity: 1; }
.drilldown-mask {
  position: absolute;
  inset: 0;
  background: rgba(2, 11, 26, 0.65);
  backdrop-filter: blur(4px);
}
.drilldown-panel {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 520px;
  max-width: 90vw;
  background: linear-gradient(180deg, rgba(6,20,50,0.98), rgba(3,12,35,0.98));
  border-left: 2px solid var(--border-bright);
  box-shadow: -10px 0 40px rgba(0,0,0,0.6), 0 0 80px rgba(32,128,255,0.1);
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.drilldown-overlay.active .drilldown-panel { transform: translateX(0); }

/* 顶部导航栏 */
.drill-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-glow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  background: rgba(6,25,60,0.5);
}
.drill-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}
.drill-breadcrumb span { color: var(--text-dim); cursor: pointer; transition: color 0.2s; }
.drill-breadcrumb span:hover { color: var(--cyan); }
.drill-breadcrumb span.active { color: var(--cyan); font-weight: 600; cursor: default; }
.drill-breadcrumb i.fa-chevron-right { font-size: 10px; color: var(--text-dim); opacity: 0.5; }
.drill-close {
  width: 30px; height: 30px;
  border-radius: 4px;
  border: 1px solid var(--border-glow);
  background: rgba(255,255,255,0.04);
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.drill-close:hover { color: var(--red); border-color: rgba(255,68,102,0.4); background: rgba(255,68,102,0.08); }

/* 内容区 */
.drill-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  scrollbar-width: thin;
  scrollbar-color: rgba(32,128,255,0.3) transparent;
}
.drill-body::-webkit-scrollbar { width: 4px; }
.drill-body::-webkit-scrollbar-track { background: transparent; }
.drill-body::-webkit-scrollbar-thumb { background: rgba(32,128,255,0.3); border-radius: 2px; }

/* 下钻卡片 */
.drill-card {
  background: rgba(10,30,70,0.5);
  border: 1px solid var(--border-glow);
  border-radius: 6px;
  padding: 14px;
  margin-bottom: 12px;
  transition: all 0.2s;
}
.drill-card-click {
  cursor: pointer;
}
.drill-card-click:hover {
  border-color: var(--cyan);
  background: rgba(0,224,255,0.05);
  box-shadow: 0 0 20px rgba(0,224,255,0.08);
}

/* 统计行 */
.drill-stats {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}
.drill-stats.cols-3 { grid-template-columns: repeat(3, 1fr); }
.drill-stats.cols-4 { grid-template-columns: repeat(4, 1fr); }
.drill-stat-item {
  text-align: center;
  padding: 10px 6px;
  background: rgba(0,224,255,0.04);
  border: 1px solid rgba(0,224,255,0.15);
  border-radius: 6px;
}
.drill-stat-num {
  font-size: 22px;
  font-weight: 700;
  font-family: 'DIN Alternate', 'Helvetica Neue', monospace;
  color: var(--cyan);
  line-height: 1.2;
  text-shadow: var(--glow-cyan);
}
.drill-stat-label {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
}

/* 牛群列表项 */
.drill-cow-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: rgba(10,30,70,0.4);
  border: 1px solid rgba(32,128,255,0.12);
  border-radius: 5px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: all 0.2s;
}
.drill-cow-row:hover {
  background: rgba(0,224,255,0.06);
  border-color: var(--cyan);
}

/* 个体牛详情 指标卡 */
.drill-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.drill-metric-box {
  padding: 10px 12px;
  background: rgba(10,30,70,0.5);
  border: 1px solid rgba(32,128,255,0.15);
  border-radius: 5px;
}
.drill-metric-box .label { font-size: 11px; color: var(--text-dim); margin-bottom: 4px; }
.drill-metric-box .value { font-size: 18px; font-weight: 700; font-family: 'DIN Alternate', monospace; }

/* 时间线 */
.drill-timeline { position: relative; padding-left: 18px; }
.drill-timeline::before {
  content: '';
  position: absolute;
  left: 5px; top: 4px; bottom: 4px;
  width: 2px;
  background: linear-gradient(180deg, var(--cyan), var(--border-glow), transparent);
  border-radius: 1px;
}
.drill-timeline-item {
  position: relative;
  padding: 6px 0;
  font-size: 12px;
}
.drill-timeline-item::before {
  content: '';
  position: absolute;
  left: -16px; top: 12px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  border: 2px solid rgba(0,224,255,0.3);
  box-shadow: 0 0 6px rgba(0,224,255,0.4);
}
.drill-timeline-item .time { color: var(--text-dim); font-size: 11px; }
.drill-timeline-item .event { color: var(--text); margin-top: 2px; }

/* 小标签 行内 */
.drill-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
}

/* 动画：内容淡入 */
.drill-fade-in { animation: drillFade 0.35s ease; }
@keyframes drillFade { from{opacity:0;transform:translateX(20px)} to{opacity:1;transform:translateX(0)} }

/* ═══════ 扩展主题色 ═══════ */
:root {
  --gold: #f5a623;
  --gold-dim: rgba(245, 166, 35, 0.15);
  --pink: #ec4899;
  --purple: #a78bfa;
  --gov-blue: #3b82f6;
}

/* ═══════ 门户入口卡片 ═══════ */
.portal-card {
  position: relative;
  background: rgba(6, 25, 60, 0.65);
  border: 1px solid var(--border-glow);
  border-radius: 8px;
  padding: 24px 20px;
  cursor: pointer;
  transition: all 0.35s ease;
  overflow: hidden;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.portal-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  opacity: 0;
  transition: opacity 0.35s;
}
.portal-card:hover {
  border-color: var(--cyan);
  background: rgba(0, 224, 255, 0.06);
  box-shadow: 0 0 30px rgba(0, 224, 255, 0.12), 0 8px 32px rgba(0, 0, 0, 0.3);
  transform: translateY(-4px);
}
.portal-card:hover::before { opacity: 1; }
.portal-card-icon {
  width: 52px; height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 12px;
  transition: transform 0.35s;
}
.portal-card:hover .portal-card-icon { transform: scale(1.1); }
.portal-card-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: 1px;
}
.portal-card-desc {
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 10px;
  line-height: 1.5;
}
.portal-card-stats {
  display: flex;
  gap: 16px;
  font-size: 11px;
}
.portal-card-stat b {
  display: block;
  font-size: 16px;
  font-family: 'DIN Alternate', monospace;
}

/* ═══════ 返回导航按钮（通用） ═══════ */
.back-portal-btn {
  color: var(--cyan);
  border: 1px solid rgba(0, 224, 255, 0.3);
  border-radius: 4px;
  padding: 3px 10px;
  text-decoration: none;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  background: transparent;
  cursor: pointer;
}
.back-portal-btn:hover {
  background: rgba(0, 224, 255, 0.1);
}

/* ═══════ 七开心环形布局 ═══════ */
.qikai-ring {
  position: relative;
  width: 280px; height: 280px;
}
.qikai-center {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}
.qikai-item {
  position: absolute;
  width: 60px; height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  font-size: 10px;
  font-weight: 600;
  transition: all 0.3s;
  cursor: default;
}
.qikai-item:hover { transform: scale(1.15); }
.qikai-item i { font-size: 16px; margin-bottom: 2px; }

/* 环形旋转动画 */
@keyframes ringRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes ringCounterRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(-360deg); }
}
.ring-orbit {
  position: absolute;
  inset: 0;
  border: 1px dashed rgba(0, 224, 255, 0.2);
  border-radius: 50%;
  animation: ringRotate 60s linear infinite;
}

/* ═══════ 金融主题覆盖 ═══════ */
.theme-finance {
  --accent: var(--gold);
  --accent-dim: var(--gold-dim);
}
.theme-finance .section-title { color: var(--gold); }
.theme-finance .section-title::before { background: var(--gold); box-shadow: 0 0 12px rgba(245,166,35,0.4); }

/* ═══════ 政府主题覆盖 ═══════ */
.theme-gov {
  --accent: var(--gov-blue);
}
.theme-gov .data-module::before {
  background: linear-gradient(90deg, transparent, #3b82f6, #60a5fa, #3b82f6, transparent);
}

/* ═══════ 梅花鹿/鹿茸主题覆盖 ═══════ */
.theme-deer {
  --accent: var(--accent-deer);
  --accent-dim: var(--accent-deer-dim);
}
.theme-deer .section-title { color: var(--accent-deer-bright); }
.theme-deer .section-title::before { background: var(--accent-deer-bright); box-shadow: var(--glow-deer); }

.tag-deer {
  background: var(--accent-deer-dim);
  color: var(--accent-deer-bright);
  border: 1px solid rgba(217, 119, 6, 0.4);
}
.dot-deer { background: var(--accent-deer-bright); box-shadow: 0 0 6px var(--accent-deer-bright); }
.big-num-deer { color: var(--accent-deer-bright); text-shadow: var(--glow-deer); }

/* ═══════ 北斗终端徽章 ═══════ */
.beidou-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  background: var(--beidou-red-dim);
  color: var(--beidou-red);
  border: 1px solid rgba(230, 57, 70, 0.4);
  letter-spacing: 0.5px;
}
.beidou-badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--beidou-red);
  box-shadow: 0 0 6px var(--beidou-red);
  animation: blink 1.5s infinite;
}
.beidou-badge.online {
  background: rgba(0, 255, 136, 0.12);
  color: var(--green);
  border-color: rgba(0, 255, 136, 0.4);
}
.beidou-badge.online::before { background: var(--green); box-shadow: 0 0 6px var(--green); }

/* ═══════ 北斗短报文流（替代原告警滚动条） ═══════ */
.beidou-msg-flow .msg-row {
  display: inline-flex;
  align-items: center;
  margin: 0 22px;
  font-size: 12px;
  letter-spacing: 0.3px;
}
.beidou-msg-flow .msg-icon {
  color: var(--beidou-red);
  margin-right: 6px;
  font-size: 11px;
}
.beidou-msg-flow .msg-tid {
  color: var(--accent-deer-bright);
  font-family: 'DIN Alternate', monospace;
  margin-right: 6px;
}

/* ═══════ NFC 溯源链路图 ═══════ */
.nfc-trace {
  display: flex;
  align-items: stretch;
  gap: 0;
  width: 100%;
}
.nfc-trace-step {
  flex: 1;
  position: relative;
  padding: 12px 8px;
  background: rgba(6, 25, 60, 0.55);
  border: 1px solid var(--border-glow);
  text-align: center;
  font-size: 12px;
}
.nfc-trace-step:not(:last-child)::after {
  content: '';
  position: absolute;
  right: -8px; top: 50%;
  width: 16px; height: 16px;
  background: var(--bg-deep);
  border-top: 1px solid var(--border-glow);
  border-right: 1px solid var(--border-glow);
  transform: translateY(-50%) rotate(45deg);
  z-index: 2;
}
.nfc-trace-step.active {
  border-color: var(--accent-deer-bright);
  background: rgba(217, 119, 6, 0.08);
  box-shadow: 0 0 12px rgba(217, 119, 6, 0.18);
}
.nfc-trace-step .step-icon {
  font-size: 18px;
  margin-bottom: 4px;
  color: var(--cyan);
}
.nfc-trace-step.active .step-icon { color: var(--accent-deer-bright); }
.nfc-trace-step .step-label {
  font-weight: 600;
  margin-bottom: 2px;
}
.nfc-trace-step .step-meta {
  font-size: 10px;
  color: var(--text-dim);
}
