/* ================================
   亮色电竞风 B — 浅灰金属 UI
   完整最终版 style.css
================================ */

/* ===== 主题色（电竞蓝 + 电竞红 + 金属浅灰） ===== */
:root {
  --blue: #2c72ff;
  --blue-light: #5a92ff;
  --blue-lighter: #9ab8ff;

  --red: #ff4155;
  --red-dark: #d82f41;

  --metal-bg: #f5f6fa;
  --metal-card: #ffffff;
  --metal-border: #e0e4f0;
  --metal-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);

  --text-main: #111827;
  --text-sub: #6b7280;
  --text-light: #9ca3af;

  --radius-lg: 16px;
  --radius-md: 12px;

  --ball-size: 30px;
}

/* 全局 */
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Microsoft YaHei", sans-serif;
  background: var(--metal-bg);
  color: var(--text-main);
}

/* 容器 */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px;
}

/* 顶部导航（亮色金属条） */
.header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 14px;
  margin: 0 0 12px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--metal-border);
  box-shadow: var(--metal-shadow);
}

@media (min-width: 640px) {
  .header {
    margin: -12px -12px 12px;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

/* logo 文字（电竞渐变） */
.logo-text {
  margin: 0;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.4px;
  background: linear-gradient(
    120deg,
    var(--blue),
    var(--blue-light),
    var(--red)
  );
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: logo-flow 3s linear infinite;
}

@keyframes logo-flow {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 200% 50%;
  }
}

.header-buttons {
  display: flex;
  gap: 10px;
}

.header-buttons a {
  padding: 6px 14px;
  background: linear-gradient(90deg, var(--blue), var(--blue-light));
  border-radius: 999px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
  transition: 0.2s;
}
.header-buttons a:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.45);
}

/* tabs */
.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0 12px;
  align-items: center;
}

/* 单个 tab */
.tab {
  position: relative;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-sub);
  background: #ffffff;
  border: 1px solid var(--metal-border);
  cursor: pointer;
  user-select: none;
  transition: 0.18s;
}
.tab:hover {
  border-color: var(--blue-light);
  color: var(--blue);
}
.tab.active {
  background: linear-gradient(90deg, var(--blue), var(--blue-light));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.55);
}

/* 卡片通用 */
.card {
  background: var(--metal-card);
  border-radius: var(--radius-lg);
  padding: 12px;
  border: 1px solid var(--metal-border);
  box-shadow: var(--metal-shadow);
}

/* 布局：左右两列（最新开奖 + 预测） */
.grid {
  display: grid;
  gap: 16px;
}

.grid-2 {
  grid-template-columns: 1.15fr 0.85fr;
}

@media (max-width: 900px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

/* 最新开奖信息区 */
.kp {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.kp .period {
  font-weight: 700;
  font-size: 15px;
}
.kp .time {
  font-size: 12px;
  color: var(--text-sub);
}

/* 球体样式 */
.balls {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* 彩球 */
.ball {
  --size: 30px;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 30% 30%, #ffffff, #dbe4ff);
  border: 1px solid #cbd5f5;
  box-shadow: 0 3px 6px rgba(15, 23, 42, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
  font-weight: 700;
  color: #1f2933;
  font-variant-numeric: tabular-nums;
}
.ball.sm {
  --size: 24px;
}
.ball.xs {
  --size: 20px;
}

/* 标签：大/小/单/双/龙/虎/豹 */
.tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.tag {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}

/* 颜色分配 */
.t-da {
  background: var(--blue);
}
.t-xiao {
  background: var(--blue-light);
}
.t-dan {
  background: var(--red);
}
.t-shuang {
  background: #10b981;
}
.t-ji {
  background: #111827;
}
.t-duan {
  background: #9ca3af;
}
.t-long {
  background: #f97316;
}
.t-hu {
  background: #6366f1;
}
.t-bao {
  background: #ec4899;
}

/* 最新开奖底部：三区尾 + 和值 */
.sumline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
  font-size: 13px;
}
.sumline b {
  font-size: 16px;
  color: var(--blue);
}

/* 统计徽章 */
.sum-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef2ff;
  border: 1px solid var(--metal-border);
  color: var(--blue);
  font-weight: 700;
}

/* 预测卡片 */
#predict-card .pred-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
#predict-card .pred-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
}
#pred-nums {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
#pred-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* 置信度条 */
.confbar {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue), #22c55e, var(--red));
  transition: width 0.35s ease;
  box-shadow: 0 0 8px rgba(37, 99, 235, 0.45);
}

/* 专家分析卡片 */
.expert-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--metal-border);
  box-shadow: var(--metal-shadow);
  background: #ffffff;
}
.expert-head {
  font-weight: 900;
  font-size: 15px;
  margin-bottom: 8px;
  color: var(--blue);
  border-left: 4px solid var(--blue);
  padding-left: 8px;
}
.expert-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.expert-note {
  padding: 8px 10px;
  border-radius: 10px;
  background: #f9fafb;
  font-size: 13px;
  color: var(--text-sub);
}

/* 倒计时块 */
.countdown.pretty {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 10px;
  margin-top: 8px;
  border-radius: var(--radius-md);
  border: 1px solid var(--metal-border);
  background: #f9fafb;
}
.cd-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.cd-label {
  font-size: 12px;
  color: var(--text-sub);
}
.cd-value {
  min-width: 64px;
  text-align: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid var(--metal-border);
  font-weight: 700;
}

/* 和值走势图（表格） */
.sumlist-wrap {
  margin-top: 6px;
}

.sumlist {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.sumlist th,
.sumlist td {
  padding: 10px 6px;
  border-bottom: 1px solid var(--metal-border);
  font-size: 14px;
  white-space: nowrap;
  text-align: center;
}

.sumlist th:nth-child(1),
.sumlist td:nth-child(1),
.sumlist th:nth-child(2),
.sumlist td:nth-child(2) {
  text-align: left;
}

/* 和值那一列彩球 */
.sumlist .ball {
  --size: 22px;
  width: var(--size);
  height: var(--size);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fffbeb, #f97316);
  color: #fff;
  font-weight: 700;
}

/* 大/小/单/双 标记 */
.badge-mini {
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: bold;
  font-size: 12px;
  color: white;
}

.b-da {
  background: var(--blue);
}
.b-xiao {
  background: var(--blue-light);
}
.b-dan {
  background: var(--red);
}
.b-shuang {
  background: var(--blue);
}

/* 搜索结果卡片修复 */
.cards-wrap {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

.hcard {
  background: #fff;
  border: 1px solid var(--metal-border);
  border-radius: var(--radius-md);
  padding: 10px;
  box-shadow: var(--metal-shadow);
}

.hnums {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

/* 搜索输入与按钮 */
#search-issue {
  height: 38px;
  border-radius: var(--radius-md);
  border: 1px solid var(--metal-border);
  padding: 0 12px;
}

.btn-ghost,
#btn-search,
#btn-clear {
  height: 38px;
  padding: 0 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--metal-border);
  background: var(--metal-card);
  cursor: pointer;
  transition: 0.2s;
}

.btn-ghost:hover,
#btn-search:hover,
#btn-clear:hover {
  border-color: var(--blue-light);
  box-shadow: 0 4px 12px rgba(148, 163, 184, 0.45);
}

/* 分页器隐藏（当前不使用） */
.pager {
  display: none;
}

/* 顶部广告位 */
.ad-slot {
  margin: 10px 0 12px;
}
.ad-slot.card {
  padding: 8px;
}
.ad-slot img {
  width: 100%;
  display: block;
  border-radius: 10px;
}

/* 返回顶部按钮 */
#back-top {
  position: fixed;
  right: 16px;
  bottom: 20px;
  z-index: 60;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--metal-border);
  background: linear-gradient(135deg, var(--blue), var(--blue-light));
  color: #ffffff;
  font-weight: 900;
  font-size: 18px;
  line-height: 40px;
  text-align: center;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.45);
  cursor: pointer;
  user-select: none;
  opacity: 0;
  transform: translateY(10px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease, box-shadow 0.2s ease,
    filter 0.2s ease;
}
#back-top.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* 修复和值走势图：命中显示色，未命中置灰 */
.sumlist td .badge-mini.dim {
  opacity: 0.25 !important;
  filter: grayscale(60%);
}

/* 修复和值球（如果值不存在，不亮）*/
.sumlist td.c-val.dim .ball {
  opacity: 0.35;
  filter: grayscale(60%);
}

/* ========= 历史卡片区美化（简洁电竞浅色版） ========= */

/* 布局：自适应两列 / 多列 */
.cards-wrap {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 14px;
}

/* 单张卡片：圆角 + 金属边 + 阴影 */
.hcard {
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid #dde1ea;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
  padding: 10px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* 顶部：期号 + 时间 */
.hrow {
  display: flex;
  align-items: center;
}
.hrow.between {
  justify-content: space-between;
}

.hissue {
  font-weight: 800;
  font-size: 14px;
  color: #111827;
}
.hmeta {
  font-size: 12px;
  color: #6b7280;
}

/* 一排号码球 */
.hnums {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

/* 尾公式一行：尾：9+0+0=9 */
.tail-line {
  margin-top: 4px;
  font-size: 13px;
  color: #4b5563;
  font-weight: 600;
}

/* 历史卡片里的标签行，稍微紧凑一点 */
.tags-history {
  margin-top: 4px;
  flex-wrap: wrap;
  gap: 6px;
}
.tags-history .tag {
  padding: 3px 10px;
  font-size: 12px;
}

/* 小屏适配：单列展示 */
@media (max-width: 768px) {
  .cards-wrap {
    grid-template-columns: 1fr;
  }
  .hcard {
    padding: 10px 10px 12px;
  }
}

/* ==========================
   📱 手机版悬浮官方查询按钮（PC 不变）
========================== */

/* 默认隐藏浮动按钮 */
#btn-official-float {
  display: none;
}

/* 只有小屏启用悬浮模式（移动端） */
@media (max-width: 768px) {

  /* 隐藏原 tabs 中的官方按钮 */
  #btn-official {
    display: none !important;
  }

  /* 显示悬浮按钮 */
  #btn-official-float {
    display: block;
    position: fixed;
    right: 18px;
    bottom: 26px;
    z-index: 9999;

    padding: 12px 18px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    border: none;

    color: #fff;
    background: linear-gradient(90deg,#2563eb,#3b82f6);
    box-shadow: 0 8px 24px rgba(37,99,235,.45);

    cursor: pointer;
    user-select: none;

    transition: .28s cubic-bezier(.22,1,.36,1);
  }

  #btn-official-float:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 12px 28px rgba(37,99,235,.55);
  }
}
