/* ============================================================
   版面 / 元件 — 風格取自 igkjw_web，內容結構取自 kjw-pc
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html {
  font-family: "微软雅黑", "Microsoft YaHei", sans-serif, "Helvetica Neue", Tahoma, Helvetica, Arial;
  line-height: 1.5;
  font-size: 16px;
  overflow-y: scroll;
  color: var(--text-color);
  letter-spacing: 1px;
}
body { margin: 0; background: var(--bg); font-size: 0.875rem; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; cursor: pointer; }

.w-label {
  max-width: var(--w-label);
  margin: auto;
  padding-left: var(--padding);
  padding-right: var(--padding);
}

/* ---------- 頁首 ---------- */
.headerBg { background: var(--header-bg); position: relative; z-index: 30; }
.headerBg header {
  max-width: var(--w-label);
  margin: auto;
  display: flex;
  align-items: center;
  padding: 0 var(--padding);
}
.logo { display: flex; align-items: center; gap: 0.5rem; padding: 0.75rem 0; color: #fff; }
.logo svg { display: block; }
.logo .logo-text { font-size: 1.125rem; font-weight: bold; letter-spacing: 2px; }

.mainNav { margin-left: 1.5rem; flex: 1; }
.nav-list { display: flex; align-items: center; }
.nav-list > li > a {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0 1.125rem;
  height: 52px;
  color: var(--header-color);
  transition: var(--transition);
}
.nav-list > li > a:hover { background: var(--navList-bg-hover); color: var(--header-color-hover); }
.nav-list > li.current > a { background: var(--navList-current-bg); color: var(--header-color-hover); }
.nav-list .caret { width: 0; height: 0; border: 4px solid transparent; border-top-color: currentColor; margin-top: 3px; }

/* 漢堡鈕：只在窄螢幕出現 */
.nav-toggle {
  display: none;
  align-items: center; justify-content: center;
  width: 40px; height: 40px;
  margin-left: 0.5rem;
  background: none; border: 0;
  color: var(--header-color);
  border-radius: var(--borderRadius);
  transition: var(--transition);
}
.nav-toggle:hover, .nav-toggle[aria-expanded="true"] {
  background: var(--navList-bg-hover);
  color: var(--header-color-hover);
}
.nav-toggle svg path { transition: var(--transition); transform-origin: center; }
.nav-toggle[aria-expanded="true"] .bar-mid { opacity: 0; }
.nav-toggle[aria-expanded="true"] .bar-top { transform: translateY(5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bar-bot { transform: translateY(-5px) rotate(-45deg); }

.navTop { margin-left: auto; display: flex; align-items: center; gap: 1rem; color: var(--header-color); }
.navTop .live-clock { font-variant-numeric: tabular-nums; letter-spacing: 1px; }
.navTop a:hover { color: var(--navTop-color-hover); }

/* ---------- 彩票大廳下拉（kjw-pc 的 lotteryNamebox） ---------- */
.lotteryNamebox {
  position: absolute;
  left: 0; right: 0; top: 100%;
  background: var(--navList-submenu-bg);
  box-shadow: var(--navList-submenu-boxShadow);
  border-top: var(--navList-submenu-border);
  border-radius: var(--navList-submenu-borderRadius);
  display: none;
}
.lotteryNamebox.is-open { display: block; }
.lotteryNamebox .content_middle { max-width: var(--w-label); margin: auto; padding: 0.5rem var(--padding) 1rem; }
.lotteryNamebox .LineOne { display: flex; align-items: flex-start; padding: 0.75rem 0; border-bottom: var(--navList-submenu-border); }
.lotteryNamebox .LineOne:last-child { border-bottom: 0; }
.lotteryNamebox .group-title {
  flex: 0 0 5.5em;
  color: #fff;
  background: var(--header-bg);
  border-radius: var(--borderRadius);
  text-align: center;
  padding: 0.25rem 0;
  margin-right: 1rem;
}
.lotteryNamebox .LineOne.hot .group-title { background: var(--style-color1); }
.lotteryNamebox ul { display: flex; flex-wrap: wrap; flex: 1; }
.lotteryNamebox ul li a {
  display: block;
  padding: 0.25rem 0.75rem;
  margin: 0.125rem;
  border-radius: var(--borderRadius);
  color: var(--text-color2);
  transition: var(--transition);
  white-space: nowrap;
}
.lotteryNamebox ul li a:hover { background: var(--navList-submenu-bg-hover); color: var(--header-bg); }
.lotteryNamebox ul li a.current { background: var(--navList-current-bg); color: #fff; }

/* ---------- 主內容 ---------- */
.content { padding: var(--padding) 0 2rem; }

/* 開獎頭（kjw-pc 的 haomaqu_resetPar） */
.lottery-header {
  display: flex;
  flex-flow: row wrap;
  align-items: stretch;
  background: var(--card-bg);
  border: var(--lottery-header-border);
  border-radius: var(--borderRadius);
  margin-bottom: var(--padding);
}
.lottery-header .current,
.lottery-header .next,
.lottery-header .result {
  display: flex;
  align-items: center;
  padding: var(--padding);
}
.lottery-header .current { flex: 0 0 340px; gap: 0.75rem; border-right: var(--lottery-header-border); }
.lottery-header .game-icon {
  width: 60px; height: 60px;
  display: block;
  flex: 0 0 auto;
}
.lottery-header .latest { flex: 1; min-width: 0; }
.lottery-header .game-name { font-size: 1rem; font-weight: bold; margin-bottom: 0.25rem; }
.lottery-header .period { color: var(--text-color2); }
.lottery-header .period .preDrawIssue { color: var(--style-color1); font-weight: bold; margin: 0 0.25em; }

.issue-nav { display: flex; align-items: center; flex-wrap: nowrap; margin-top: 0.375rem; }
.issue-nav button {
  width: 24px; height: var(--lottery-header-select-height);
  background: #fff;
  border: var(--lottery-header-select-border);
  color: var(--text-color2);
  line-height: 1;
}
/* 用 class 指定，不能用 :last-child —— 後面還有一顆隱藏的「回到最新」 */
.issue-nav .issue-prev { border-radius: var(--borderRadius) 0 0 var(--borderRadius); }
.issue-nav .issue-next { border-radius: 0 var(--borderRadius) var(--borderRadius) 0; }
.issue-nav button:disabled { color: var(--lottery-header-button-disabled); cursor: default; }
.issue-nav .select {
  height: var(--lottery-header-select-height);
  border-top: var(--lottery-header-select-border);
  border-bottom: var(--lottery-header-select-border);
  padding: 0 0.75em;
  display: flex; align-items: center;
  justify-content: center;
  min-width: 96px;
  font-variant-numeric: tabular-nums;
}

/* 倒數 */
.lottery-header .next { flex: 0 0 250px; flex-direction: column; align-items: flex-start; justify-content: center; gap: 0.375rem; border-right: var(--lottery-header-border); }
.lottery-header .next .linetit { color: var(--text-color2); }
.next-meta { display: flex; flex-direction: column; gap: 0.125rem; color: var(--text-color3); font-size: 0.8125rem; }
.next-meta b { color: var(--text-color2); font-variant-numeric: tabular-nums; }
.countdown { display: flex; align-items: center; gap: 0.25rem; color: var(--text-color2); }
.countdown .bgtime {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 34px;
  background: var(--text-color);
  color: #fff;
  border-radius: var(--borderRadius);
  font-size: 1.125rem;
  font-weight: bold;
  font-variant-numeric: tabular-nums;
}
.countdown.is-hurry .bgtime { background: var(--style-color1); }
.drawing-tip { display: none; color: var(--style-color1); font-size: 1rem; }
.next.is-drawing .drawing-tip { display: block; }
.next.is-drawing .countdown { display: none; }

/* 開獎結果 */
.lottery-header .result { flex: 1; gap: 0.75rem; flex-wrap: wrap; }
.numberbox { display: flex; align-items: center; gap: 0.375rem; }
.sep { color: var(--text-color3); }
/* 總和球：首頁卡片與彩種頁共用，不綁在 .numberbox 底下 */
.total {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: var(--lottery-header-number-width); height: var(--lottery-header-number-width);
  border-radius: 50%;
  background: var(--lottery-header-number-bg2);
  color: var(--lottery-header-number-color3);
  font-size: 1.125rem; font-weight: bold;
}
.result .line { width: 1px; align-self: stretch; background: #eee; margin: 0 0.25rem; }
.badgeBg { display: flex; gap: 0.375rem; }
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 30px; height: 30px; padding: 0 0.5em;
  border-radius: var(--borderRadius);
  color: #fff;
}
.badge.big, .badge.dragon { background: var(--style-color1); }
.badge.small, .badge.tiger { background: var(--style-color2); }
.badge.odd { background: var(--lottery-header-number-color7); }
.badge.even { background: var(--style-color3); }
.badge.tie { background: var(--lottery-header-number-color8); }

/* 開獎球 */
.ball {
  display: inline-flex; align-items: center; justify-content: center;
  width: var(--lottery-header-number-width); height: var(--lottery-header-number-width);
  border-radius: 50%;
  color: #fff; font-size: 1rem; font-weight: bold;
  font-variant-numeric: tabular-nums;
  box-shadow: inset 0 -2px 4px rgba(0, 0, 0, 0.18);
}
.ball.sm { width: 26px; height: 26px; font-size: 0.8125rem; }
.ball.plain { background: var(--lottery-header-number-color5); }
.ball.c1 { background: var(--ball-1); } .ball.c2 { background: var(--ball-2); }
.ball.c3 { background: var(--ball-3); } .ball.c4 { background: var(--ball-4); }
.ball.c5 { background: var(--ball-5); } .ball.c6 { background: var(--ball-6); }
.ball.c7 { background: var(--ball-7); } .ball.c8 { background: var(--ball-8); }
.ball.c9 { background: var(--ball-9); } .ball.c10 { background: var(--ball-10); }

/* 六合彩波色球，最後一顆是特碼 */
.ball.bo-red { background: var(--bose-red); }
.ball.bo-blue { background: var(--bose-blue); }
.ball.bo-green { background: var(--bose-green); }
.ball.special { box-shadow: inset 0 -2px 4px rgba(0, 0, 0, 0.18), 0 0 0 2px var(--lottery-header-number-color); }

/* 骰子（快3） */
.dice {
  width: var(--lottery-header-number-width); height: var(--lottery-header-number-width);
  border-radius: 6px; background: #fff;
  border: 1px solid #e0e0e0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  display: block;
}
.dice.sm { width: 26px; height: 26px; border-radius: 4px; }

/* 立體紅鈕 */
.btn-red {
  background: var(--btn-red-bg);
  border: var(--btn-red-border);
  border-radius: 18px;
  box-shadow: var(--btn-red-shadow);
  color: #fff;
  font-size: 0.9375rem;
  padding: 0.4rem 1rem;
  transition: var(--transition);
}
.btn-red:active { transform: translate(2px, 3px); box-shadow: 1px 1px 0 0 #8a2a21; }

/* ---------- 次選單（歷史/走勢/路子/長龍/遺漏） ---------- */
.zoushimap { display: flex; background: var(--card-bg); border: var(--lottery-header-border); border-radius: var(--borderRadius); overflow: hidden; margin-bottom: var(--padding); }
.zoushimap li a {
  display: block; padding: 0.625rem 1.5rem;
  color: var(--text-color2);
  border-right: var(--lottery-header-border);
  transition: var(--transition);
}
.zoushimap li a:hover { background: #f9f9f9; color: var(--header-bg); }
.zoushimap li a.active { background: var(--header-bg); color: #fff; }

/* ---------- 開獎記錄 ---------- */
.panel { background: var(--card-bg); border: var(--lottery-header-border); border-radius: var(--borderRadius); }
.listhead {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--padding);
  border-bottom: var(--lottery-table-border);
  flex-wrap: wrap; gap: 0.5rem;
}
.listhead .lmms { font-size: 1rem; font-weight: bold; position: relative; padding-left: 0.625rem; }
.listhead .lmms::before {
  content: ""; position: absolute; left: 0; top: 0.15em; bottom: 0.15em;
  width: 3px; background: var(--header-bg); border-radius: 2px;
}
.listheadr { display: flex; align-items: center; gap: 0.75rem; }
.day-switch { display: flex; }
.day-switch span {
  padding: 0.25rem 0.875rem;
  border: var(--border);
  margin-left: -1px;
  cursor: pointer;
  color: var(--text-color2);
  transition: var(--transition);
}
.day-switch span:first-child { border-radius: var(--borderRadius) 0 0 var(--borderRadius); margin-left: 0; }
.day-switch span:last-child { border-radius: 0 var(--borderRadius) var(--borderRadius) 0; }
.day-switch span.checked { background: var(--header-bg); border-color: var(--header-bg); color: #fff; }
.date-input { padding: 0.25rem 0.5rem; border: var(--border); border-radius: var(--borderRadius); color: var(--text-color2); font-family: inherit; }

.lottery-table { width: 100%; overflow-x: auto; }
.lottery-table table { width: 100%; border-collapse: collapse; }
.lottery-table th, .lottery-table td {
  padding: 0.5rem var(--padding);
  border-bottom: var(--lottery-table-border);
  text-align: left;
}
.lottery-table th { background: var(--lottery-table-head-bg); color: var(--text-color2); font-weight: normal; }
.lottery-table tbody tr:nth-child(even) { background: var(--lottery-table-stripe); }
.lottery-table tbody tr:hover { background: #f6edf8; }
.lottery-table .time, .lottery-table .issue { color: var(--text-color2); font-variant-numeric: tabular-nums; }
.lottery-table .codes { display: flex; align-items: center; gap: 0.25rem; }
.lottery-table .shape { display: flex; align-items: center; gap: 0.375rem; }
.lottery-table .sum { color: var(--style-color1); font-weight: bold; min-width: 1.5em; display: inline-block; }
.lottery-table .tag { color: var(--text-color2); }
.no-result { color: var(--text-color3); }
.lottery-table .empty { text-align: center; color: var(--text-color3); padding: 2.5rem 0; }

/* ============================================================
   首頁 — 左側 Nav + 彩種卡片
   ============================================================ */
.home-layout { display: flex; align-items: flex-start; gap: var(--padding); }

/* ---------- 左側分類 Nav ---------- */
.side-col { flex: 0 0 var(--side-nav-width); }
.side-nav {
  background: var(--card-bg);
  border: var(--lottery-header-border);
  border-radius: var(--borderRadius);
  /* 不能用 overflow:hidden —— 子選單是 absolute 飛到容器外，會被整個裁掉 */
}
.side-item { position: relative; border-bottom: var(--lottery-header-border); }
.side-item:last-child { border-bottom: 0; }
/* 圓角改由頭尾項目自己切 */
.side-item:first-child > .side-link { border-radius: var(--borderRadius) var(--borderRadius) 0 0; }
.side-item:last-child > .side-link { border-radius: 0 0 var(--borderRadius) var(--borderRadius); }
.side-link {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem var(--padding);
  background: none;
  border: 0;
  font-size: 0.875rem;
  color: var(--text-color2);
  letter-spacing: 1px;
  transition: var(--transition);
}
.side-link:hover { background: #f9f9f9; color: var(--header-bg); }
.side-item.active > .side-link { background: var(--header-bg); color: #fff; }
.side-arrow { transition: var(--transition); flex: 0 0 auto; }
.side-item.is-open .side-arrow { transform: rotate(90deg); }

/* 子清單：往下展開的手風琴，一次只開一組 */
.side-sub {
  display: none;
  background: var(--codes-band-bg);
  border-top: var(--lottery-header-border);
  padding: 0.25rem 0;
}
.side-item.is-open .side-sub { display: block; }
.side-sub li a {
  display: block;
  padding: 0.4rem var(--padding) 0.4rem 1.25rem;
  color: var(--text-color2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: var(--transition);
  border-left: 3px solid transparent;
}
.side-sub li a:hover {
  background: #fff;
  color: var(--header-bg);
  border-left-color: var(--navList-current-bg);
}

/* ---------- 卡片列表 ---------- */
.card-grid {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--padding);
}
.game-card {
  background: var(--card-bg);
  border: var(--lottery-header-border);
  border-radius: var(--borderRadius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}
.game-card:hover { box-shadow: 0 2px 12px rgba(81, 64, 157, 0.12); }

.card-head { display: flex; align-items: center; gap: 0.875rem; padding: 0.875rem var(--padding); }
.card-icon {
  width: 58px; height: 58px;
  flex: 0 0 auto;
  display: block;
}
.game-img { width: 100%; height: 100%; object-fit: contain; display: block; }

.card-title { min-width: 0; flex: 1; }
.card-title h2 { margin: 0; font-size: 1rem; font-weight: bold; line-height: 1.4; }
.card-title h2 a:hover { color: var(--header-bg); }
.card-title .issue { font-weight: normal; font-size: 0.8125rem; color: var(--text-color2); margin-left: 0.375rem; }
.card-title .issue b { color: var(--style-color1); margin: 0 0.15em; }
.card-time { display: flex; align-items: center; gap: 0.375rem; margin-top: 0.5rem; color: var(--text-color2); }
.card-time .gray { color: var(--text-color3); }
.card-time .bgtime {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 26px; height: 26px;
  background: var(--text-color);
  color: #fff;
  border-radius: var(--borderRadius);
  font-variant-numeric: tabular-nums;
}
.card-time .countdown.is-hurry .bgtime { background: var(--style-color1); }
.card-time .drawing-tip { display: none; color: var(--style-color1); }
.card-time.is-drawing .drawing-tip { display: block; }
.card-time.is-drawing .countdown,
.card-time.is-drawing .gray { display: none; }

/* 開獎號碼是卡片的主角：獨立底色、置中、大顆 */
.card-codes {
  display: flex; align-items: center; justify-content: center;
  flex-wrap: wrap; gap: 0.4rem;
  min-height: 86px;
  padding: 0.875rem var(--padding);
  background: var(--codes-band-bg);
  border-top: var(--lottery-table-border);
  border-bottom: var(--lottery-table-border);
}
.card-codes .ball { width: 40px; height: 40px; font-size: 1.0625rem; }
.card-codes .dice { width: 44px; height: 44px; }
.card-codes .total { min-width: 40px; height: 40px; font-size: 1.1875rem; }
.card-codes .sep { font-size: 1.0625rem; }

.card-stat { width: 100%; border-collapse: collapse; }
.card-stat th, .card-stat td {
  padding: 0.375rem 0.5rem;
  text-align: center;
  border-right: var(--lottery-table-border);
  border-bottom: var(--lottery-table-border);
}
.card-stat th:last-child, .card-stat td:last-child { border-right: 0; }
.card-stat th { background: var(--lottery-table-head-bg); color: var(--text-color2); font-weight: normal; }
.card-stat td { height: 46px; }
.card-stat td .badge { min-width: 24px; height: 24px; margin: 0 0.1rem; }
.card-stat td .hot { color: var(--style-color1); margin-right: 0.25rem; }

.card-links { display: flex; margin-top: auto; }
.card-links a {
  flex: 1;
  text-align: center;
  padding: 0.625rem 0;
  color: var(--text-color2);
  border-right: var(--lottery-table-border);
  transition: var(--transition);
}
.card-links a:last-child { border-right: 0; }
.card-links a:hover { background: #f6edf8; color: var(--header-bg); }

@media all and (max-width: 960px) {
  .card-grid { grid-template-columns: minmax(0, 1fr); }
}
@media all and (max-width: 768px) {
  .home-layout { flex-direction: column; }
  .side-col { flex: 1 1 auto; width: 100%; }
  .card-grid { width: 100%; }
}

/* ---------- 頁尾 ---------- */
.site-footer { background: #fff; border-top: var(--border); margin-top: 1.5rem; padding: 1.25rem 0; color: var(--text-color3); }
.site-footer .footer-nav { display: flex; gap: 1.25rem; margin-bottom: 0.5rem; }
.site-footer .footer-nav a:hover { color: var(--header-bg); }

/* ---------- RWD（沿用 igkjw_web 斷點） ---------- */
@media all and (max-width: 960px) {
  .lottery-header .current,
  .lottery-header .next { flex: 1 1 100%; border-right: 0; border-bottom: var(--lottery-header-border); }
  .lottery-header .next { flex-direction: row; gap: 0.75rem; }
  .lottery-header .next .linetit { margin-bottom: 0; }
  .lotteryNamebox .LineOne { flex-direction: column; }
  /* 直排後 flex-basis 會變成限制高度，標籤會被拉成細長條，要改回自動 */
  .lotteryNamebox .group-title {
    flex: 0 0 auto;
    align-self: flex-start;
    min-width: 5.5em;
    padding: 0.25rem 0.875rem;
    margin-right: 0;
    margin-bottom: 0.5rem;
  }
}
@media all and (max-width: 768px) {
  /* 主選單收進漢堡鈕，漢堡鈕排到最右邊 */
  .nav-toggle { display: flex; order: 3; }
  .navTop { order: 2; }
  /* 手機不重複放側欄，彩種一律走「彩票大厅」 */
  .side-col { display: none; }
  .lotteryNamebox { max-height: 70vh; overflow-y: auto; z-index: 26; }
  .lotteryNamebox .group-title { margin-bottom: 0.5rem; }
  .mainNav {
    position: absolute;
    left: 0; right: 0; top: 100%;
    margin-left: 0;
    background: var(--header-bg);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: var(--navList-submenu-boxShadow);
    display: none;
    z-index: 25;
  }
  .mainNav.is-open { display: block; }
  .nav-list { flex-direction: column; align-items: stretch; }
  .nav-list > li > a { height: auto; padding: 0.875rem var(--padding); }

  .listhead { flex-direction: column; align-items: stretch; }
  .listheadr { justify-content: space-between; }
  .zoushimap { overflow-x: auto; }
  .zoushimap li a { white-space: nowrap; padding: 0.625rem 1rem; }
  .lottery-table th:nth-child(2), .lottery-table td:nth-child(2) { display: none; }
}

/* ============================================================
   分析頁 — 走勢 / 路子 / 長龍 / 遺漏
   ============================================================ */
.panel.mt { margin-top: var(--padding); }

/* 名次 / 位置切換列 */
.rank-tabs, .pos-tabs {
  display: flex; flex-wrap: wrap; gap: 1px;
  background: var(--lottery-table-head-bg);
  border-bottom: var(--lottery-table-border);
}
.rank-tab {
  flex: 1 1 auto;
  min-width: 68px;
  padding: 0.5rem 0.75rem;
  background: #fff;
  border: 0;
  color: var(--text-color2);
  transition: var(--transition);
}
.rank-tab:hover { color: var(--header-bg); }
.rank-tab.active { background: var(--header-bg); color: #fff; }

/* 盤口 chip */
.group-tabs { display: flex; flex-wrap: wrap; gap: 0.375rem; padding: var(--padding); }
.chip {
  padding: 0.25rem 0.875rem;
  border: var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text-color2);
  transition: var(--transition);
}
.chip:hover { border-color: var(--navList-current-bg); color: var(--header-bg); }
.chip.active { background: var(--navList-current-bg); border-color: var(--navList-current-bg); color: #fff; }

/* ---------- 走勢圖 ---------- */
.trend-wrap { max-height: 70vh; overflow: auto; }
.trend-table { font-variant-numeric: tabular-nums; }
.trend-table th, .trend-table td {
  padding: 0.25rem 0.375rem;
  text-align: center;
  border-right: var(--lottery-table-border);
  border-bottom: var(--lottery-table-border);
  white-space: nowrap;
}
.trend-table thead th { position: sticky; top: 0; z-index: 2; background: var(--lottery-table-head-bg); }
.trend-table td.miss { color: #c9c9c9; }
.trend-table td.hit { background: #fff8f0; }
.trend-table td.issue, .trend-table td.time { color: var(--text-color2); text-align: left; }
.trend-table tfoot td {
  background: var(--codes-band-bg);
  color: var(--text-color2);
  font-weight: bold;
}
.trend-table tfoot tr:first-child td { border-top: 2px solid var(--navList-current-bg); }

/* ---------- 路子 ---------- */
.road-wrap { padding: var(--padding); overflow-x: auto; }
.road-grid {
  display: grid;
  grid-auto-rows: 26px;
  gap: 2px;
  justify-content: start;
}
.road-dot {
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  font-size: 0.75rem;
  font-style: normal;
  color: #fff;
}
.road-dot.on { background: var(--style-color1); }
.road-dot.off { background: var(--style-color2); }
.road-dot.tie { background: var(--lottery-header-number-color8); }

.road-legend { display: flex; align-items: center; gap: 0.875rem; color: var(--text-color2); }
.legend-item { display: flex; align-items: center; gap: 0.375rem; }
.legend-item .dot { width: 14px; height: 14px; border-radius: 50%; display: block; }
.legend-item .dot.on { background: var(--style-color1); }
.legend-item .dot.off { background: var(--style-color2); }
.legend-note { color: var(--text-color3); }

.appear-table td.num { font-variant-numeric: tabular-nums; }
.appear-table td.num.hot { color: var(--style-color1); font-weight: bold; }

/* ---------- 長龍 ---------- */
.dragon-note { padding: var(--padding) var(--padding) 0; color: var(--text-color3); }
.dragon-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: var(--padding);
  padding: var(--padding);
}
.dragon-item {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.625rem 0.875rem;
  border: var(--border);
  border-radius: var(--borderRadius);
  background: #fff;
}
.dragon-item.is-hot { border-color: var(--style-color1); background: #fff6f6; }
.dragon-rank { color: var(--text-color2); }
.dragon-count-num {
  margin-left: auto;
  font-size: 1.25rem; font-weight: bold;
  color: var(--text-color);
  font-variant-numeric: tabular-nums;
}
.dragon-item.is-hot .dragon-count-num { color: var(--style-color1); }
.dragon-unit { color: var(--text-color3); }
.dragon-count { color: var(--text-color3); margin-left: 0.5rem; }

/* ---------- 遺漏 / 冷熱 ---------- */
.missing-table { font-variant-numeric: tabular-nums; }
.missing-table th, .missing-table td {
  padding: 0.375rem;
  text-align: center;
  border-right: var(--lottery-table-border);
  border-bottom: var(--lottery-table-border);
}
.missing-table td.pos, .heat-table td.pos { text-align: left; color: var(--text-color2); white-space: nowrap; }
.missing-table td.just-out { background: var(--style-color1); color: #fff; font-weight: bold; }
.missing-table td.long-miss { color: var(--style-color2); font-weight: bold; }

.heat-table td { vertical-align: top; }
.heat-ball { display: inline-flex; align-items: center; gap: 0.15rem; margin: 0.15rem 0.35rem 0.15rem 0; }
.heat-times { color: var(--text-color3); font-weight: normal; }
.heat-table .tier-hot { background: #fff6f6; }
.heat-table .tier-cold { background: #f4f8fd; }

@media all and (max-width: 768px) {
  .rank-tab { min-width: 56px; padding: 0.4rem 0.5rem; }
  .dragon-list { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

/* 期號切換：翻到過去的期數時給明確狀態 */
.issue-nav.is-past .select { background: #fff8f0; color: var(--lottery-header-number-color); font-weight: bold; }
.issue-back {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  width: var(--lottery-header-select-height);
  height: var(--lottery-header-select-height);
  margin-left: 0.5rem;
  padding: 0;
  border: 1px solid var(--navList-current-bg);
  border-radius: var(--borderRadius);
  background: #fff;
  color: var(--navList-current-bg);
  transition: var(--transition);
}
.issue-back:hover { background: var(--navList-current-bg); color: #fff; }
@keyframes issue-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}
.issue-nav.shake { animation: issue-shake 0.4s; }
@media (prefers-reduced-motion: reduce) { .issue-nav.shake { animation: none; } }
