/*
  bet-history-display.css
  只作用于 section.betting-history。
  不包含 .sc-cricket-bet-history / .sc-cricket-center。
  选择器锚定 .betting-history；外层只用 .account-page-content:has(> .betting-history)。
  夜间入口：.account-center[data-theme="dark"]。
  已结算 #e10600，已派发 #d92d20。
*/

.account-page-content:has(> .betting-history) > .betting-history {
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.betting-history {
  --bh-blue: #1085dc;
  --bh-blue-dark: #0c6cb8;
  --bh-ink: #14314f;
  --bh-muted: #5d7590;
  --bh-line: #d5e4f2;
  --bh-soft: #f4f8fc;
  --bh-cols: 300px 188px minmax(160px, 1.45fr) minmax(150px, 1.25fr) 72px 136px 84px 72px 136px 88px;
  color: var(--bh-ink);
  background: #fff;
  border: 1px solid var(--bh-line);
  border-radius: 12px;
  padding: 16px 16px 12px;
  box-shadow: none;
}

.betting-history > header {
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
}

.betting-history > header h2 {
  margin: 0;
  color: var(--bh-ink);
  font-size: 20px;
  line-height: 1.3;
}

.betting-history > header p {
  margin: 4px 0 0;
  color: var(--bh-muted);
  font-size: 12px;
  line-height: 1.4;
}

.betting-history > header .betting-secondary {
  width: auto;
  min-height: 34px;
  height: 34px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid var(--bh-line);
  border-radius: 8px;
  background: #fff;
  color: var(--bh-blue-dark);
  font-size: 13px;
  font-weight: 650;
}

.betting-history .bet-record-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 12px;
  margin: 0 0 12px;
}

.betting-history .bet-record-tabs {
  flex: 1 0 100%;
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  gap: 2px;
  padding: 3px;
  border-radius: 10px;
  background: #e8f3fb;
}

.betting-history .bet-record-tabs button {
  min-height: 32px;
  height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #1a4e7a;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.betting-history .bet-record-tabs button.is-on {
  background: var(--bh-blue);
  border-color: var(--bh-blue);
  color: #fff;
}

.betting-history .bet-record-tools > label {
  flex: 1 1 150px;
  max-width: 220px;
  min-width: 140px;
  gap: 4px;
  color: var(--bh-muted);
  font-size: 12px;
  font-weight: 650;
}

.betting-history .bet-record-tools input,
.betting-history .bet-record-tools select {
  width: 100%;
  height: 36px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid #c5d7e8;
  border-radius: 8px;
  background: #fff;
  color: var(--bh-ink);
  font-size: 13px;
}

.betting-history .bet-record-tools > button {
  height: 36px;
  min-height: 36px;
  padding: 0 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.betting-history .bet-record-tools > button:first-of-type {
  border: 1px solid var(--bh-blue-dark);
  background: var(--bh-blue);
  color: #fff;
}

.betting-history .bet-record-tools > button:last-of-type {
  border: 1px solid #b7d0e6;
  background: #fff;
  color: #14558a;
}

.betting-history .bet-record-table {
  display: grid;
  grid-template-columns: var(--bh-cols);
  column-gap: 8px;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--bh-line);
  border-radius: 10px;
  background: #fff;
}

.betting-history .bet-record-head,
.betting-history .bet-record-row,
.betting-history .bet-record-line {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: subgrid;
  min-width: 0;
  padding: 0;
}

.betting-history .bet-record-head {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--bh-soft);
  color: var(--bh-muted);
  font-size: 12px;
  font-weight: 700;
}

.betting-history .bet-record-head > span {
  min-width: 0;
  padding: 8px 2px;
  white-space: nowrap;
  text-overflow: clip;
}

.betting-history .bet-record-row {
  border: 0;
  border-radius: 0;
  border-top: 1px solid #e6eef6;
  background: transparent;
}

.betting-history .bet-record-row.is-open {
  background: #f8fbfe;
}

.betting-history .bet-record-line {
  align-items: center;
  font-size: 13px;
  line-height: 1.4;
}

.betting-history .bet-record-line > * {
  min-width: 0;
  max-width: 100%;
  padding: 10px 2px;
}

.betting-history .bet-record-no,
.betting-history .bet-record-row strong {
  display: block;
  overflow-x: auto;
  overflow-y: hidden;
  font-size: 12px;
  font-weight: 700;
  word-break: normal;
  overflow-wrap: normal;
  white-space: nowrap;
  text-overflow: clip;
  cursor: pointer;
}

.betting-history .bet-record-time,
.betting-history .bet-record-odds,
.betting-history .bet-record-status,
.betting-history .bet-record-result {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  text-overflow: clip;
  overflow: hidden;
}

.betting-history .bet-record-amount,
.betting-history .bet-record-return {
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: normal;
  overflow-wrap: anywhere;
  text-overflow: clip;
}

.betting-history .bet-record-odds {
  text-align: right;
}

.betting-history .bet-record-match,
.betting-history .bet-record-content {
  white-space: normal;
  word-break: normal;
  overflow-wrap: anywhere;
  text-overflow: clip;
}

.betting-history .bet-record-paid {
  color: #d92d20;
  font-weight: 700;
}

.betting-history .bet-record-status.is-settled,
.betting-history .bet-record-return.is-settled,
.betting-history .bet-record-settled {
  color: #e10600;
  font-weight: 700;
}

.betting-history .bet-record-line > button,
.betting-history .bet-record-line button {
  justify-self: start;
  min-height: 30px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--bh-blue);
  border-radius: 8px;
  background: #fff;
  color: var(--bh-blue-dark);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.betting-history .bet-record-detail-wrap {
  grid-column: 1 / -1;
  padding: 0 2px 12px;
  background: var(--bh-soft);
}

.betting-history .bet-record-detail {
  margin: 0;
  padding-top: 4px;
  gap: 12px;
  font-size: 13px;
}

.betting-history .bet-record-detail > h3,
.betting-history .bet-record-group h4 {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--bh-ink);
}

.betting-history .bet-record-group dt {
  color: var(--bh-muted);
}

.betting-history .bet-record-group dd {
  margin: 0;
  font-size: 13px;
  font-weight: 650;
  color: var(--bh-ink);
  word-break: normal;
  overflow-wrap: anywhere;
  white-space: normal;
  text-overflow: clip;
}

.betting-history .betting-pagination {
  margin-top: 12px;
  font-size: 13px;
  color: var(--bh-muted);
}

.betting-history .betting-pagination button {
  min-height: 34px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid #b7d0e6;
  border-radius: 8px;
  background: #fff;
  color: #14558a;
  font-weight: 700;
}

.betting-history button:focus-visible,
.betting-history .bet-record-tools input:focus-visible,
.betting-history .bet-record-tools select:focus-visible {
  outline: 2px solid var(--bh-blue);
  outline-offset: 2px;
}

.account-center[data-theme="dark"] .account-page-content:has(> .betting-history) {
  background: #1c2a3b;
  border-color: #3d5670;
  color: #e8f1f8;
}

.account-center[data-theme="dark"] .betting-history {
  --bh-blue: #4aa3e8;
  --bh-blue-dark: #d7ebfb;
  --bh-ink: #f2f7fb;
  --bh-muted: #c5d5e4;
  --bh-line: #3d5670;
  --bh-soft: #24364a;
  color: #f2f7fb;
  background: #1c2a3b;
  border-color: #3d5670;
}

.account-center[data-theme="dark"] .account-page-content:has(> .betting-history) > .betting-history {
  background: transparent;
  color: #f2f7fb;
}

.account-center[data-theme="dark"] .betting-history > header h2,
.account-center[data-theme="dark"] .betting-history .bet-record-group dd,
.account-center[data-theme="dark"] .betting-history .bet-record-detail > h3,
.account-center[data-theme="dark"] .betting-history .bet-record-group h4 {
  color: #f7fbfe;
}

.account-center[data-theme="dark"] .betting-history > header p,
.account-center[data-theme="dark"] .betting-history .bet-record-tools > label,
.account-center[data-theme="dark"] .betting-history .bet-record-head,
.account-center[data-theme="dark"] .betting-history .bet-record-group dt,
.account-center[data-theme="dark"] .betting-history .betting-pagination {
  color: #c5d5e4;
}

.account-center[data-theme="dark"] .betting-history .bet-record-tabs {
  background: #152232;
}

.account-center[data-theme="dark"] .betting-history .bet-record-tabs button {
  color: #d7e7f5;
}

.account-center[data-theme="dark"] .betting-history .bet-record-tabs button.is-on {
  background: #1085dc;
  color: #fff;
}

.account-center[data-theme="dark"] .betting-history .bet-record-tools input,
.account-center[data-theme="dark"] .betting-history .bet-record-tools select {
  background: #152232;
  color: #f2f7fb;
  border-color: #4a647c;
}

.account-center[data-theme="dark"] .betting-history > header .betting-secondary,
.account-center[data-theme="dark"] .betting-history .bet-record-tools > button:last-of-type,
.account-center[data-theme="dark"] .betting-history .betting-pagination button,
.account-center[data-theme="dark"] .betting-history .bet-record-line > button,
.account-center[data-theme="dark"] .betting-history .bet-record-line button {
  background: #152232;
  color: #e7f3fc;
  border-color: #6d8eab;
}

.account-center[data-theme="dark"] .betting-history .bet-record-tools > button:first-of-type {
  background: #1085dc;
  border-color: #1085dc;
  color: #fff;
}

.account-center[data-theme="dark"] .betting-history .bet-record-table,
.account-center[data-theme="dark"] .betting-history .bet-record-head {
  background: #24364a;
  border-color: #3d5670;
}

.account-center[data-theme="dark"] .betting-history .bet-record-row {
  border-top-color: #31485f;
  background: transparent;
}

.account-center[data-theme="dark"] .betting-history .bet-record-row.is-open,
.account-center[data-theme="dark"] .betting-history .bet-record-detail-wrap {
  background: #182838;
}

.account-center[data-theme="dark"] .betting-history .bet-record-no,
.account-center[data-theme="dark"] .betting-history .bet-record-time,
.account-center[data-theme="dark"] .betting-history .bet-record-match,
.account-center[data-theme="dark"] .betting-history .bet-record-content,
.account-center[data-theme="dark"] .betting-history .bet-record-odds,
.account-center[data-theme="dark"] .betting-history .bet-record-amount,
.account-center[data-theme="dark"] .betting-history .bet-record-status,
.account-center[data-theme="dark"] .betting-history .bet-record-result,
.account-center[data-theme="dark"] .betting-history .bet-record-return {
  color: #f2f7fb;
}

.account-center[data-theme="dark"] .betting-history .bet-record-paid {
  color: #d92d20;
  font-weight: 700;
}

.account-center[data-theme="dark"] .betting-history .bet-record-status.is-settled,
.account-center[data-theme="dark"] .betting-history .bet-record-return.is-settled,
.account-center[data-theme="dark"] .betting-history .bet-record-settled {
  color: #e10600;
  font-weight: 700;
}

@media (max-width: 900px) {
  .betting-history .bet-record-tools > label {
    flex: 1 1 calc(50% - 12px);
    max-width: calc(50% - 6px);
    min-width: 0;
  }

  .betting-history .bet-record-tools > button,
  .betting-history > header .betting-secondary,
  .betting-history .betting-pagination button,
  .betting-history .bet-record-line > button,
  .betting-history .bet-record-line button {
    min-height: 44px;
    height: 44px;
  }

  .betting-history .bet-record-head {
    display: none;
  }

  .betting-history .bet-record-table {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .betting-history .bet-record-row {
    display: block;
    border: 1px solid var(--bh-line);
    border-radius: 10px;
    background: #fff;
  }

  .betting-history .bet-record-line {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-column: auto;
    gap: 8px 10px;
    min-width: 0;
    width: auto;
    padding: 12px;
  }

  .betting-history .bet-record-line > .bet-record-no,
  .betting-history .bet-record-line > .bet-record-time,
  .betting-history .bet-record-line > .bet-record-match,
  .betting-history .bet-record-line > .bet-record-content {
    grid-column: 1 / -1;
  }

  .betting-history .bet-record-line > * {
    display: block;
    padding: 0;
    text-align: left;
  }

  .betting-history .bet-record-line > *::before {
    display: block;
    margin-bottom: 2px;
    color: var(--bh-muted);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
  }

  .betting-history .bet-record-no::before { content: "投注单号"; }
  .betting-history .bet-record-time::before { content: "投注时间"; }
  .betting-history .bet-record-match::before { content: "赛事"; }
  .betting-history .bet-record-content::before { content: "投注内容"; }
  .betting-history .bet-record-odds::before { content: "赔率"; }
  .betting-history .bet-record-amount::before { content: "金额"; }
  .betting-history .bet-record-status::before { content: "状态"; }
  .betting-history .bet-record-result::before { content: "结果"; }
  .betting-history .bet-record-return::before { content: "返还金额"; }
  .betting-history .bet-record-line > button::before { content: "操作"; }

  .betting-history .bet-record-line > .bet-record-no {
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    word-break: normal;
    overflow-wrap: normal;
    text-overflow: clip;
  }

  .betting-history .bet-record-content,
  .betting-history .bet-record-amount,
  .betting-history .bet-record-return {
    white-space: normal;
    overflow: visible;
    overflow-wrap: anywhere;
    text-overflow: clip;
  }

  .betting-history .bet-record-line > button,
  .betting-history .bet-record-line button {
    width: 100%;
    height: 44px;
    min-height: 44px;
  }

  .betting-history .bet-record-detail {
    grid-template-columns: 1fr;
  }

  .betting-history .bet-record-detail-wrap {
    padding: 0 12px 12px;
  }
}

.account-center[data-theme="dark"] .betting-history .bet-record-row {
  background: transparent;
}

@media (max-width: 900px) {
  .account-center[data-theme="dark"] .betting-history .bet-record-row {
    background: #24364a;
    border-color: #3d5670;
  }
}

.betting-history .bet-record-time,
.betting-history .bet-record-odds,
.betting-history .bet-record-status,
.betting-history .bet-record-result {
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow: visible;
  overflow-wrap: anywhere;
  word-break: normal;
  text-overflow: clip;
}

@media (max-width: 900px) {
  .betting-history .bet-record-tabs button,
  .betting-history .bet-record-tools input,
  .betting-history .bet-record-tools select {
    min-height: 44px;
    height: 44px;
  }

  .betting-history .bet-record-line.bet-record-head {
    display: none;
  }
}

.betting-history {
  --bh-cols: 140px 96px minmax(176px, 1.8fr) minmax(112px, 1fr) 56px 88px 64px 88px 88px 80px;
}
