/* Shared layout and accessibility improvements for every public template. */
html { overflow-x: hidden; }
body { min-width: 0; overflow-x: hidden; }
img, video, iframe { max-width: 100%; }
button, a, [role="tab"] { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible, [role="tab"]:focus-visible { outline: 3px solid #2563eb; outline-offset: 3px; }
.site-breadcrumbs { display:flex; flex-wrap:wrap; align-items:center; gap:.45rem; margin:0 0 1rem; color:#64748b; font-size:.85rem; }
.site-breadcrumbs a { color:#1d4ed8; text-decoration:none; }
.site-breadcrumbs a:hover { text-decoration:underline; }
.site-breadcrumbs span:last-child { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:min(60vw, 36rem); }
.site-page-intro { max-width: 70ch; margin: 0 0 1.25rem; color: #475569; font-size: .95rem; line-height: 1.65; }
.ad-item, .cb-ad, .bc-ad, .ml-ad { position: relative; }
.ad-label { position: absolute; z-index: 1; top: .45rem; left: .45rem; padding: .15rem .4rem; border-radius: .2rem; background: rgba(15,23,42,.78); color: #fff; font-size: .68rem; line-height: 1.3; letter-spacing: .02em; }
.ad-item img, .cb-ad img, .bc-ad img, .ml-ad img { display: block; max-width: 100%; height: auto; }
.table-responsive, .cb-table-wrap, .bc-table-wrap, .ml-table-wrap, .history-table, .trend-table, .stats-table, .predict-table { max-width: 100%; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
.cb-table-wrap > table, .bc-table-wrap > table, .ml-table-wrap > table { min-width: 600px; }
.article-content, .cb-a-content, .bc-article-content, .ml-article-content { max-width: 74ch; margin-inline: auto; font-size: clamp(1rem, 1.2vw, 1.125rem); line-height: 1.85; overflow-wrap: anywhere; }
.article-content p, .cb-a-content p, .bc-article-content p, .ml-article-content p { margin: 0 0 1.1em; }
.article-content img, .cb-a-content img, .bc-article-content img, .ml-article-content img { max-width: 100%; height: auto; }
.article-nav .title, .cb-article-nav .title, .bc-article-nav .title, .ml-article-nav .title, .mbw-article-nav .title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 768px) {
  .site-page-intro { font-size: .875rem; }
  .article-content, .cb-a-content, .bc-article-content, .ml-article-content { font-size: 1rem; line-height: 1.8; }
  .article-nav, .cb-article-nav, .bc-article-nav, .ml-article-nav, .mbw-article-nav { width: 100%; }
  .article-nav > *, .cb-article-nav > *, .bc-article-nav > *, .ml-article-nav > *, .mbw-article-nav > * { min-width: 0; max-width: 100%; }
  .article-nav .title, .cb-article-nav .title, .bc-article-nav .title, .ml-article-nav .title, .mbw-article-nav .title { max-width: min(52vw, 18rem); }
}

/* Content, controls, and mobile fixes. */
.cb-article .cb-a-content p { display: block; -webkit-line-clamp: unset; line-clamp: unset; -webkit-box-orient: initial; overflow: visible; }
.cb-article-nav .title, .ml-article-nav .title, .bc-article-nav .title, .mbw-article-nav .title { display: inline; max-width: min(58vw, 28rem); }
.cb-article-nav .sep, .ml-article-nav .sep, .bc-article-nav .sep, .mbw-article-nav .sep { display: inline; }
.cb-ad, .bc-ad, .ml-ad, .ad-item { box-shadow: 0 2px 8px rgba(15, 23, 42, .07); }
.cb-ad:hover, .bc-ad:hover, .ml-ad:hover, .ad-item:hover { transform: none; box-shadow: 0 4px 12px rgba(15, 23, 42, .1); }
.bc-next-box { background: #172554 !important; border-color: #93c5fd !important; box-shadow: 0 6px 18px rgba(15, 23, 42, .16) !important; }
.bc-link-btn.primary, .ml-link-btn.primary, .mbw-link-btn.primary { box-shadow: 0 5px 14px rgba(37, 99, 235, .18) !important; }
@media (max-width: 768px) {
  .cb-container, .bc-container, .ml-container, .container { width: 100%; max-width: 100%; }
  .cb-top-row, .bc-latest-meta, .ml-meta { grid-template-columns: 1fr; flex-wrap: wrap; }
  .cb-article-nav .title, .ml-article-nav .title, .bc-article-nav .title, .mbw-article-nav .title { max-width: min(55vw, 20rem); }
}
@media (max-width: 375px) {
  .cb-article-nav .title, .ml-article-nav .title, .bc-article-nav .title, .mbw-article-nav .title { max-width: 42vw; }
  .cb-article-nav .label, .ml-article-nav .label, .bc-article-nav .label, .mbw-article-nav .label { white-space: nowrap; }
}

/* ================= 统计数据移动端看板 ================= */
.stats-panel {
  padding: 2px 0 4px;
  color: #0f172a;
}

.stats-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px !important;
  padding: 0 2px 10px;
  border-bottom: 1px solid #e2e8f0;
  color: #0f172a;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.01em;
}

.stats-section-title i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: #eff6ff;
  color: #2563eb;
  font-size: 12px;
}

.stats-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}

.stat-card {
  position: relative;
  min-width: 0;
  padding: 12px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: 0 2px 8px rgba(15, 23, 42, .045);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.stat-card::after {
  content: '';
  position: absolute;
  right: -18px;
  bottom: -22px;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: rgba(37, 99, 235, .06);
  pointer-events: none;
}

.stat-card:hover {
  transform: translateY(-1px);
  border-color: #bfdbfe;
  box-shadow: 0 5px 14px rgba(15, 23, 42, .08);
}

.stat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}

.stat-type-badge {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  padding: 3px 8px;
  border-radius: 6px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.stat-hint {
  min-width: 0;
  overflow: hidden;
  color: #94a3b8;
  font-size: 10px;
  line-height: 1.3;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-card-body {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-top: 12px;
}

.stat-num-value {
  position: relative;
  z-index: 1;
  color: #0f172a;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 25px;
  font-weight: 800;
  line-height: 1;
}

.stat-unit {
  color: #64748b;
  font-size: 11px;
}

.stat-card.stat-warn {
  border-color: #fde68a;
  background: linear-gradient(145deg, #fff 0%, #fffbeb 100%);
}
.stat-card.stat-warn .stat-type-badge {
  background: #fef3c7;
  color: #b45309;
}
.stat-card.stat-warn .stat-num-value { color: #b45309; }
.stat-card.stat-hot {
  border-color: #fecaca;
  background: linear-gradient(145deg, #fff 0%, #fef2f2 100%);
}
.stat-card.stat-hot .stat-type-badge {
  background: #fee2e2;
  color: #b91c1c;
}
.stat-card.stat-hot .stat-num-value { color: #dc2626; }

.stats-numbers-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.stat-number-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  min-width: 0;
  padding: 8px 7px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, .035);
}

.stat-circle-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 25px;
  width: 25px;
  height: 25px;
  border-radius: 8px;
  background: #f1f5f9;
  color: #334155;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  font-weight: 800;
}

.stat-omit-val {
  min-width: 0;
  overflow: hidden;
  color: #334155;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 13px;
  font-weight: 700;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-omit-val small {
  color: #94a3b8;
  font-family: inherit;
  font-size: 9px;
  font-weight: 500;
}

.stat-number-box.num-warm {
  border-color: #fde68a;
  background: #fffbeb;
}
.stat-number-box.num-warm .stat-circle-num {
  background: #fef3c7;
  color: #b45309;
}
.stat-number-box.num-warm .stat-omit-val { color: #b45309; }
.stat-number-box.num-hot {
  border-color: #fecaca;
  background: #fef2f2;
}
.stat-number-box.num-hot .stat-circle-num {
  background: #fee2e2;
  color: #b91c1c;
}
.stat-number-box.num-hot .stat-omit-val { color: #dc2626; }

.stats-loading,
.stats-empty,
.stats-error {
  grid-column: 1 / -1;
  padding: 28px 12px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  color: #64748b;
  font-size: 13px;
  text-align: center;
}
.stats-error { color: #dc2626; border-color: #fecaca; }

/* 标签数量固定，移动端不产生横向滚动 */
.tabs {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: visible !important;
}
.tab-btn {
  min-width: 0 !important;
  width: 100%;
}

@media (max-width: 768px) {
  .table-responsive, .cb-table-wrap, .bc-table-wrap, .ml-table-wrap, .history-table, .trend-table, .stats-table, .predict-table {
    overflow-x: hidden !important;
  }
  .stats-panel { padding: 0; }
  .stats-section-title {
    margin-bottom: 10px !important;
    padding-bottom: 8px;
    font-size: 14px;
  }
  .stats-cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 18px;
  }
  .stat-card { padding: 10px; border-radius: 10px; }
  .stat-card-body { margin-top: 10px; }
  .stat-num-value { font-size: 22px; }
  .stats-numbers-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
  }
  .stat-number-box {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    padding: 7px 3px;
    border-radius: 8px;
  }
  .stat-circle-num { flex-basis: 24px; width: 24px; height: 24px; }
  .stat-omit-val { max-width: 100%; font-size: 12px; text-align: center; }
  .stat-omit-val small { font-size: 8px; }
  .tab-btn { padding: 10px 2px !important; font-size: 12px !important; }
}

@media (max-width: 360px) {
  .stat-hint { display: none; }
  .stat-type-badge { padding-inline: 6px; }
  .stats-numbers-grid { gap: 5px; }
  .stat-number-box { padding-inline: 2px; }
}
