:root {
  --shell: #12352e;
  --ink: #10241f;
  --muted: #5c6b64;
  --bg: #e8ede9;
  --panel: #f7faf8;
  --line: #c5d0ca;
  --accent: #e85d04;
  --tip-bg: #ffe8d6;
  --pool-muted: #c5d9d3;
  --track: #d5ded9;
  --w: #2a9d8f;
  --p: #1d4e89;
  --q: #c9a227;
  --pq: #c44536;
  --phone: 390px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: #dfe6e2;
  color: var(--ink);
  font-family: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
}

.phone {
  max-width: var(--phone);
  margin: 0 auto;
  min-height: 100vh;
  padding: 12px 12px 20px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shell-band {
  height: 4px;
  border-radius: 2px;
  background: var(--shell);
}

.header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-height: 40px;
}

.header-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.brand {
  font-size: 16px;
  font-weight: 700;
  color: var(--shell);
  line-height: 1.1;
}

.race-ctx {
  font-size: 10px;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.2;
}

.countdown {
  min-width: 76px;
  height: 28px;
  padding: 0 10px;
  border-radius: 4px;
  background: var(--shell);
  color: #fff;
  font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tip-strip {
  border: 1px solid var(--accent);
  background: var(--tip-bg);
  border-radius: 4px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
}

.tip-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tip-lab {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}

.tip-cta {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

.tip-rates {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
}

.pool-switch {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: 40px;
  border-radius: 4px;
  overflow: hidden;
}

.pool {
  border: 0;
  background: var(--shell);
  color: var(--pool-muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.pool.is-on {
  background: var(--accent);
  color: #fff;
}

.race-dock {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
}

.venue {
  flex: 0 0 68px;
  height: 36px;
  border: 0;
  border-radius: 4px;
  background: var(--shell);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  padding: 0 6px;
}

.caret {
  color: #a8c5be;
  font-size: 10px;
}

.race-rail {
  flex: 1;
  min-width: 0;
  height: 36px;
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
}

.race-rail::-webkit-scrollbar {
  display: none;
}

.race-chip {
  flex: 0 0 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.race-chip.is-on {
  background: var(--accent);
  color: #fff;
}

.legend {
  display: flex;
  gap: 12px;
  height: 20px;
  align-items: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
}

.leg {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.sw {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}

.sw.W {
  background: var(--w);
}
.sw.P {
  background: var(--p);
}
.sw.Q {
  background: var(--q);
}
.sw.PQ {
  background: var(--pq);
}

.list {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
}

.row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  min-height: 56px;
  border-bottom: 1px solid var(--line);
}

.row:last-child {
  border-bottom: 0;
}

.no {
  width: 28px;
  height: 40px;
  border-radius: 4px;
  background: var(--shell);
  color: #fff;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 16px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mid {
  width: 120px;
  flex-shrink: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.name-odd {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
}

.name {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.odd {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.meta {
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.bar-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tag-row {
  display: flex;
  gap: 3px;
  min-height: 14px;
}

.tag {
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  padding: 1px 4px;
  border-radius: 2px;
  line-height: 1.2;
}

.tag.W {
  background: var(--w);
}
.tag.P {
  background: var(--p);
}
.tag.Q {
  background: var(--q);
}
.tag.PQ {
  background: var(--pq);
}

.bar-track {
  height: 14px;
  border-radius: 2px;
  background: var(--track);
  display: flex;
  overflow: hidden;
}

.seg {
  height: 100%;
}

.seg.W {
  background: var(--w);
}
.seg.P {
  background: var(--p);
}
.seg.Q {
  background: var(--q);
}
.seg.PQ {
  background: var(--pq);
}

.amt {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  min-width: 34px;
  text-align: right;
  flex-shrink: 0;
}

.disc {
  margin: 4px 0 0;
  text-align: center;
  font-size: 10px;
  color: var(--muted);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(16, 36, 31, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 40;
}

.modal[hidden] {
  display: none;
}

.modal-card {
  width: 100%;
  max-width: 320px;
  background: #fff;
  border-radius: 8px;
  padding: 20px 16px;
}

.modal-card h2 {
  margin: 0 0 8px;
  font-size: 16px;
  color: var(--shell);
}

.modal-card p {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
}

.btn {
  width: 100%;
  height: 40px;
  border: 0;
  border-radius: 4px;
  background: var(--shell);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

/* —— page8：近 10 次 —— */
.hot-range {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 4px;
  background: var(--shell);
  color: #fff;
}

.hot-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.hot-title {
  font-size: 12px;
  font-weight: 700;
}

.hot-sub {
  font-size: 10px;
  color: #a8c5be;
}

.hot-nos {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.hot-no {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chart-cap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 28px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}

.cap-left,
.cap-right {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}

.swatch.g {
  background: var(--w);
}
.swatch.o {
  background: var(--accent);
  width: 6px;
  height: 6px;
}

.row.is-click {
  cursor: pointer;
}

.row.is-click:active {
  background: #eef3ef;
}

.spark-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.spark-10 {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 36px;
  flex: 1;
  min-width: 0;
}

.spark-bar {
  flex: 1;
  min-width: 4px;
  max-width: 10px;
  border-radius: 1px;
  background: var(--w);
  align-self: flex-end;
}

.spark-bar.is-hot {
  background: var(--accent);
}

.spark-bar.is-empty,
.trend-10.is-empty .spark-bar {
  height: 4px !important;
  background: var(--track);
  opacity: 0.7;
}

.empty-list {
  margin: 0;
  padding: 24px 12px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

/* —— page11：馬詳 —— */
.header-horse {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.horse-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
}

.btn-back {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 4px;
  background: var(--shell);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.h-mid {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.name-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.odd-win {
  color: var(--w);
  font-weight: 700;
  font-size: 12px;
}

.odd-pla {
  color: var(--p);
  font-weight: 700;
  font-size: 12px;
}

.pool-tip {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  padding: 2px 0;
}

.sec-pool {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px 0 8px;
  border-bottom: 1px solid var(--line);
}

.sec-cap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
}

.sec-cap .dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.sec-cap .dot.w {
  background: var(--w);
}
.sec-cap .dot.p {
  background: var(--p);
}

.trend-10 {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.trend-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 28px;
}

.trend-labs {
  display: flex;
  gap: 4px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
}

.trend-labs span {
  flex: 1;
  text-align: center;
  min-width: 0;
}

.pair-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 32px;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 4px;
}

.pair-tog {
  border: 0;
  background: var(--shell);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.pair-tog.is-on {
  background: #c9a227;
}

.pair-table {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
}

.pair-banker {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
}

.drag-tag {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border-radius: 3px;
  padding: 2px 6px;
}

.pair-leg {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 28px;
  border-bottom: 1px solid var(--line);
  min-height: 40px;
}

.pair-leg:last-child {
  border-bottom: 0;
}

.leg-no {
  width: 22px;
  height: 22px;
  border-radius: 3px;
  background: var(--shell);
  color: #fff;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.leg-name {
  width: 72px;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leg-trend {
  flex: 1;
  min-width: 0;
}

.phone[data-view='horse'] .pool-switch,
.phone[data-view='horse'] .race-dock,
.phone[data-view='horse'] .legend,
.phone[data-view='horse'] .tip-strip {
  display: none;
}

.phone[data-view='chart'] .tip-strip,
.phone[data-view='chart'] .legend {
  display: none;
}

