/* =========================================================
   Token 出海看板 · 亮色简约风
   品牌橙 #ED7D31 · 大量留白 · 细字重数字 · 柔和阴影
   ========================================================= */

:root {
  --orange: #ED7D31;
  --orange-soft: #fdf0e8;
  --orange-line: #f3c9ad;
  --up: #ED7D31;
  --down: #8a93a0;

  --ink: #1a1a1a;          /* 主标题 */
  --ink-2: #3d3d3d;        /* 次标题 */
  --gray: #6b7280;         /* 正文 */
  --gray-2: #9aa1ab;       /* 辅助 */
  --line: #ececec;         /* 分隔线/边框 */
  --bg: #ffffff;
  --bg-soft: #fafafa;
  --bg-card: #ffffff;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 3px rgba(20, 25, 35, .04), 0 8px 28px rgba(20, 25, 35, .04);
  --shadow-hover: 0 2px 6px rgba(20, 25, 35, .06), 0 14px 40px rgba(237, 125, 49, .10);

  --maxw: 1200px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}

/* ---------- 顶部品牌渐变线 ---------- */
.brand-line {
  height: 3px;
  background: linear-gradient(90deg,
    var(--orange) 0%,
    #f5a25f 30%,
    #ffd1a8 60%,
    transparent 100%);
  position: sticky;
  top: 0;
  z-index: 10;
}

/* ---------- 容器 ---------- */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 40px 28px 80px;
}

/* ---------- 顶部 Hero ---------- */
.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  padding-bottom: 36px;
  margin-bottom: 36px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.hero-left {
  display: flex;
  align-items: center;
  gap: 18px;
}

.logo-mark {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--orange) 0%, #f59e57 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 8px 22px rgba(237, 125, 49, .28);
}
.logo-text {
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -.02em;
}
.logo-dot {
  position: absolute;
  top: 8px; right: 8px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #fff;
  opacity: .85;
}

.hero-title h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--ink);
}
.hero-sub {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--gray);
  font-weight: 400;
}

.hero-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.fresh-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--orange-soft);
  color: var(--orange);
  font-size: 12.5px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 999px;
}
.pulse-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 0 rgba(237, 125, 49, .55);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(237,125,49,.5); }
  70%  { box-shadow: 0 0 0 8px rgba(237,125,49,0); }
  100% { box-shadow: 0 0 0 0 rgba(237,125,49,0); }
}

.period-tag {
  font-size: 13px;
  color: var(--gray);
}

.hero-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

/* 导出 Excel 按钮 */
.export-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all .2s ease;
  box-shadow: 0 1px 2px rgba(20,25,35,.03);
}
.export-btn svg { color: var(--orange); transition: transform .2s ease; }
.export-btn:hover {
  border-color: var(--orange-line);
  color: var(--orange);
  box-shadow: 0 4px 14px rgba(237,125,49,.12);
}
.export-btn:hover svg { transform: translateY(1px); }
.export-btn:active { transform: scale(.98); }

/* ---------- 看板访问密码门 ---------- */
#viewGate {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: linear-gradient(160deg, #fff 0%, var(--orange-soft) 100%);
}
.gate-card {
  background: #fff; border: 1px solid var(--line); border-radius: 18px;
  padding: 44px 36px 36px; width: 100%; max-width: 360px;
  text-align: center;
  box-shadow: 0 10px 50px rgba(237,125,49,.10);
}
#viewGate .logo-mark { margin: 0 auto 18px; }
.gate-title { font-size: 22px; font-weight: 600; margin: 0 0 6px; }
.gate-team { font-size: 14px; color: var(--ink-2); margin: 0 0 18px; font-weight: 500; }
.gate-sub { font-size: 13px; color: var(--gray); margin: 0 0 26px; }
.gate-form { text-align: left; }
.gate-form input {
  width: 100%; padding: 11px 14px; font-size: 15px; font-family: inherit;
  border: 1px solid var(--line); border-radius: 8px; outline: none;
  transition: border-color .15s, box-shadow .15s; text-align: center; letter-spacing: 2px;
}
.gate-form input:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(237,125,49,.12); }
.gate-error { color: #e74c3c; font-size: 12.5px; min-height: 18px; margin: 8px 0 12px; text-align: center; }
.gate-note { font-size: 12px; color: var(--gray-2); margin: 18px 0 0; line-height: 1.6; }

/* ---------- 通用模块卡片 ---------- */
.summary-card,
.module,
.kpi-card,
.chart-wrap {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.section-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--orange);
  text-transform: uppercase;
  margin-bottom: 12px;
}

/* ---------- 本周总结 ---------- */
.summary-card {
  padding: 26px 30px;
  margin-bottom: 22px;
  box-shadow: var(--shadow);
}
.summary-body {
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.9;
}
.summary-body p {
  margin: 0 0 6px;
}
.summary-body p:last-child { margin-bottom: 0; }
.summary-body .lead {
  font-weight: 500;
  color: var(--ink);
}

/* ---------- KPI 卡片 ---------- */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 36px;
}
.kpi-card {
  padding: 24px 26px;
  box-shadow: var(--shadow);
  transition: transform .25s ease, box-shadow .25s ease;
  position: relative;
  overflow: hidden;
}
.kpi-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--orange) 0%, #f5a25f 100%);
  opacity: 0;
  transition: opacity .25s ease;
}
.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}
.kpi-card:hover::before { opacity: 1; }

.kpi-label {
  font-size: 13px;
  color: var(--gray);
  margin-bottom: 12px;
  font-weight: 400;
}
.kpi-value {
  font-size: 40px;
  font-weight: 300;
  letter-spacing: -.02em;
  color: var(--ink);
  line-height: 1.1;
  margin-bottom: 10px;
}
.kpi-value.accent { color: var(--orange); }
.kpi-trend {
  font-size: 13px;
  color: var(--gray);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.kpi-trend.up { color: var(--orange); }

/* ---------- 模块 ---------- */
.module {
  padding: 28px 30px;
  margin-bottom: 22px;
  box-shadow: var(--shadow);
}
.module-head { margin-bottom: 22px; }
.module-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -.005em;
}
.module-comment {
  margin: 6px 0 0;
  font-size: 13.5px;
  color: var(--gray);
  line-height: 1.7;
}

.chart-wrap {
  padding: 14px 10px 8px;
}
.chart { width: 100%; }

/* ---------- 模块2：排名卡片 ---------- */
.rank-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}
.rank-card {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 18px 16px 16px;
  position: relative;
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.rank-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(20,25,35,.06);
  border-color: var(--orange-line);
}
.rank-card .rank-no {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-2);
  letter-spacing: .05em;
  margin-bottom: 6px;
}
.rank-card.top3 .rank-no { color: var(--orange); }
.rank-card .rank-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 12px;
  min-height: 22px;
  line-height: 1.3;
}
.rank-card .rank-tokens {
  font-size: 22px;
  font-weight: 300;
  color: var(--ink);
  letter-spacing: -.01em;
}
.rank-card .rank-tokens .unit {
  font-size: 13px;
  color: var(--gray);
  margin-left: 2px;
}
.rank-card .rank-wow {
  margin-top: 6px;
  font-size: 12.5px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.rank-wow.up { color: var(--orange); }
.rank-wow.down { color: var(--down); }
.rank-bar {
  position: absolute;
  left: 0; bottom: 0;
  height: 3px;
  background: var(--orange);
  opacity: .85;
}

/* ---------- 图表网格 ---------- */
.chart-grid {
  display: grid;
  gap: 14px;
}
.chart-grid.two {
  grid-template-columns: 1fr 1fr;
}
.model-grid {
  grid-template-columns: repeat(3, 1fr);
}
.model-grid .chart-wrap {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 12px 10px;
}
.model-grid .model-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  padding: 0 4px 6px;
}

/* ---------- 页脚 ---------- */
.footer {
  margin-top: 40px;
  padding-top: 28px;
}
.footer-line {
  height: 2px;
  background: linear-gradient(90deg, var(--orange), transparent);
  margin-bottom: 18px;
}
.footer-text {
  font-size: 13.5px;
  color: var(--gray);
}
.footer-meta {
  font-size: 12px;
  color: var(--gray-2);
  margin-top: 6px;
}

/* ---------- 进入动画 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- 响应式 ----------
   平板 (≤980px)：双列网格
   手机 (≤640px)：全部单列，字号/间距全面优化 ---------- */
@media (max-width: 980px) {
  .kpi-row { grid-template-columns: 1fr; }
  .chart-grid.two { grid-template-columns: 1fr; }
  .model-grid { grid-template-columns: repeat(2, 1fr); }
  .rank-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-title h1 { font-size: 22px; }
}

@media (max-width: 640px) {
  .container { padding: 20px 14px 50px; }

  /* Hero：纵向堆叠，操作区移到下方 */
  .hero {
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
    padding-bottom: 26px;
    margin-bottom: 24px;
  }
  .hero-left { gap: 14px; }
  .logo-mark { width: 46px; height: 46px; border-radius: 14px; }
  .logo-text { font-size: 23px; }
  .hero-title h1 { font-size: 19px; line-height: 1.3; }
  .hero-sub { font-size: 13px; }
  .hero-right {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
  }
  .hero-actions { flex-direction: row; align-items: center; gap: 8px; }
  .fresh-tag { font-size: 11.5px; padding: 5px 11px; }
  .period-tag { font-size: 11.5px; }
  .export-btn { padding: 6px 12px; font-size: 12px; }
  .export-btn svg { width: 12px; height: 12px; }

  /* 卡片内边距收窄 */
  .summary-card, .module { padding: 18px 16px; border-radius: 12px; }
  .summary-card { margin-bottom: 16px; padding: 20px 18px; }
  .module { margin-bottom: 16px; }
  .section-label { font-size: 11px; margin-bottom: 10px; }

  /* 总结段落 */
  .summary-body { font-size: 14px; line-height: 1.85; }

  /* KPI 单列、数字略小 */
  .kpi-row { grid-template-columns: 1fr; gap: 12px; margin-bottom: 24px; }
  .kpi-card { padding: 18px 20px; }
  .kpi-label { font-size: 12.5px; margin-bottom: 10px; }
  .kpi-value { font-size: 32px; }
  .kpi-trend { font-size: 12.5px; }

  /* 模块标题 */
  .module-head { margin-bottom: 16px; }
  .module-title { font-size: 16px; }
  .module-comment { font-size: 12.5px; line-height: 1.65; }
  .chart-wrap { padding: 10px 4px 6px; }

  /* 图表高度缩短，避免手机上过长 */
  #chartTotal { height: 280px !important; }
  #chartDomTotal, #chartShare { height: 240px !important; }

  /* 排名卡片：单列、字号优化 */
  .rank-grid { grid-template-columns: 1fr; gap: 10px; }
  .rank-card { padding: 14px 16px; display: flex; align-items: center; gap: 14px; }
  .rank-card .rank-no { margin-bottom: 0; flex-shrink: 0; width: 36px; }
  .rank-card .rank-name { margin-bottom: 0; flex: 1; font-size: 14px; min-height: auto; }
  .rank-card .rank-tokens { font-size: 18px; }
  .rank-card .rank-tokens .unit { font-size: 12px; }
  .rank-card .rank-wow { margin-top: 0; font-size: 12px; }
  .rank-card .rank-bar { height: 100%; width: 3px !important; left: 0; right: auto; bottom: 0;
    background: linear-gradient(180deg, var(--orange), #f5a25f); opacity: .3; }

  /* 模块4 小图单列 */
  .model-grid { grid-template-columns: 1fr; gap: 10px; }
  .model-grid .model-title { font-size: 12.5px; }
  .model-grid .chart-wrap { padding: 12px 10px 8px; }
  .model-grid .chart { height: 170px !important; }

  /* 页脚 */
  .footer { margin-top: 28px; padding-top: 20px; }
  .footer-text { font-size: 12px; line-height: 1.7; }
  .footer-meta { font-size: 11px; margin-top: 5px; }
}

/* 超小屏（≤380px）再压缩 */
@media (max-width: 380px) {
  .hero-title h1 { font-size: 17px; }
  .kpi-value { font-size: 28px; }
  .summary-body { font-size: 13px; }
  .container { padding: 16px 12px 40px; }
}

/* 防止 ECharts 在小屏 tooltip 溢出 */
.chart { min-width: 0; }

