/* ============================================================
   历史开奖页 · 样式（绿色为主，与首页统一）
   号码球不需要在这里定义：.num / .num-ball / .num-sub / .num-sep
   都在 gallery.css 里（共用圆环底图 ball-*.png），本页直接用。
   ============================================================ */

/* ---------- 顶栏 ---------- */
.dh {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center;
  padding: 9px 10px;
  background: linear-gradient(135deg, #12c877 0%, #069457 100%);
  box-shadow: 0 2px 8px rgba(6, 148, 87, .22);
  color: #fff;
}
.dh-back, .dh-cal {
  flex: 0 0 auto; width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border: 0; background: transparent; color: #fff; cursor: pointer; padding: 0;
}
.dh-back svg, .dh-cal svg {
  width: 20px; height: 20px; fill: none; stroke: #fff;
  stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
}
/* 两侧按钮等宽，标题才是真正居中的 */
.dh-title {
  flex: 1; margin: 0; text-align: center;
  font-size: 17px; font-weight: 700; letter-spacing: 1.5px;
}

/* ---------- Tab 行（吸顶在顶栏下面） ---------- */
.dh-tabsrow {
  position: sticky; top: 48px; z-index: 25;
  display: flex; align-items: center; gap: 8px;
  padding: 0 12px; background: #fff;
  border-bottom: 1px solid var(--line);
}
.dh-tabs { display: flex; gap: 2px; flex: 1; min-width: 0; }
.dh-tabs button {
  position: relative; border: 0; background: transparent;
  font-family: inherit; font-size: 15px; font-weight: 600;
  color: #8a9199; padding: 11px 10px 12px; cursor: pointer;
  white-space: nowrap;
}
.dh-tabs button.active { color: var(--brand-dark); }
.dh-tabs button.active::after {
  content: ''; position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: 26px; height: 3px; border-radius: 2px; background: var(--brand);
}
.dh-lt { display: flex; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.dh-lt button {
  border: 0; background: #fff; font-family: inherit;
  font-size: 12px; padding: 5px 11px; color: #7b838c; cursor: pointer;
}
.dh-lt button + button { border-left: 1px solid var(--line); }
.dh-lt button.active { background: var(--brand); color: #fff; }

/* ---------- 工具行 ---------- */
.dh-bar { display: flex; align-items: center; gap: 8px; padding: 11px 12px 9px; }
.dh-year {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px;
  border: 0; background: transparent; padding: 0; cursor: pointer;
  font-family: inherit; font-size: 14px; color: #3b4249; text-align: left;
}
.dh-year span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dh-year i { font-style: normal; font-size: 11px; color: #b9bfc7; flex: 0 0 auto; }
.dh-pills { display: flex; gap: 6px; flex: 0 0 auto; }
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 5px 10px; font-family: inherit; font-size: 12.5px;
  color: #5b6470; cursor: pointer;
}
.pill i { font-style: normal; font-size: 10px; color: #b9bfc7; }
.pill.on { border-color: #b9e7cd; background: var(--brand-soft); color: var(--brand-dark); }
.pill.on i { color: var(--brand); font-size: 11px; }

/* 年份胶囊（点年份标签才展开） */
.dh-years {
  display: flex; gap: 6px; overflow-x: auto; padding: 0 12px 9px;
  scrollbar-width: none;
}
.dh-years::-webkit-scrollbar { display: none; }
.dh-years button {
  flex: 0 0 auto; border: 1px solid var(--line); background: #fff;
  border-radius: 999px; padding: 4px 12px; font-size: 12.5px;
  font-family: inherit; color: var(--text); cursor: pointer;
}
.dh-years button.active { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ---------- 开奖记录 ---------- */
.dl-state { text-align: center; color: var(--muted); padding: 24px 12px; }
.dl-list { display: flex; flex-direction: column; gap: 10px; padding: 0 12px; }
.dl-row {
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px;
}
.dl-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 11px;
}
.dl-issue { font-size: 14px; font-weight: 700; color: #2b3038; }
.dl-issue b { color: var(--brand-dark); font-weight: 800; font-size: 15px; }
.dl-date { font-size: 12.5px; color: #a6adb5; white-space: nowrap; }
/* 一行 6 平码 + 分隔 + 特码，撑满整宽 */
.dl-balls {
  display: flex; flex-wrap: wrap; align-items: flex-start;
  justify-content: space-between; gap: 8px 4px;
}
.dl-more { text-align: center; color: var(--muted); padding: 16px 0; font-size: 13px; }

/* ---------- 开奖日期（月历） ---------- */
.cal-view { padding: 12px; }
.cal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 10px;
}
.cal-head b { font-size: 15px; letter-spacing: .5px; }
.cal-head button {
  width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: #5b6470; font-size: 16px; line-height: 1;
  cursor: pointer; font-family: inherit;
}
.cal-week, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-week span { text-align: center; font-size: 12px; color: #a6adb5; padding: 4px 0; }
.cal-grid { margin-top: 2px; }
.cal-grid button {
  position: relative; aspect-ratio: 1 / 1; border: 1px solid var(--line);
  background: #fff; border-radius: 9px; font-family: inherit;
  font-size: 13px; color: #c2c8ce; cursor: default; padding: 0;
}
/* 有开奖的日期 */
.cal-grid button.has {
  color: #2b3038; font-weight: 700; cursor: pointer;
  border-color: #b9e7cd; background: var(--brand-soft);
}
.cal-grid button.on { background: var(--brand); color: #fff; border-color: var(--brand); }
/* 今天 */
.cal-grid button.today::after {
  content: ''; position: absolute; left: 50%; bottom: 3px; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%; background: #e2523f;
}
.cal-grid button.on.today::after { background: #fff; }
.cal-grid button.empty { border: 0; background: transparent; }
.cal-tip { text-align: center; font-size: 12.5px; color: var(--muted); padding: 12px 0 10px; }
.cal-detail:empty { display: none; }
/* .cal-view 已经给了 12px 内边距，这里如果沿用 .dl-list 的 12px 就成了双重缩进，
   宽度比其他行少 24px，7 个球 + 分隔符一行放不下会折行。 */
.cal-detail { padding: 0; }
.cal-detail .dl-row { margin-bottom: 0; }
