/* 28pc.bid homepage reference layout, 2026-10-29 */
html[data-theme] body[data-page='home'] {
  --ref-teal: #12999a;
  --ref-teal-dark: #087a7d;
  --ref-blue: #2686d7;
  --ref-ink: #121b2f;
  --ref-muted: #657080;
  --ref-line: #dfe5ea;
  --ref-bg: #f7f9fb;
  --ref-card: #ffffff;
  --ref-soft: #eaf7f6;
  --ref-shadow: 0 12px 28px rgba(22, 45, 64, 0.06), 0 2px 7px rgba(22, 45, 64, 0.04);
  background: var(--ref-bg);
  color: var(--ref-ink);
}

html[data-theme] body[data-page='home'] main {
  width: min(1220px, calc(100% - 48px));
  max-width: 1220px;
  margin: 0 auto;
  padding: 28px 0 42px;
}

html[data-theme] body[data-page='home'] .result-page-title {
  color: var(--ref-ink);
  font-size: clamp(28px, 3vw, 38px) !important;
  font-weight: 800;
  letter-spacing: -0.035em;
}

html[data-theme] body[data-page='home'] .page-heading {
  margin: 3px 0 20px;
  color: var(--ref-muted);
}

html[data-theme] body[data-page='home'] .page-heading .eyebrow {
  color: var(--ref-muted);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
}

html[data-theme] body[data-page='home'] .live-band {
  position: relative;
  isolation: isolate;
  display: grid !important;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.85fr);
  grid-template-rows: auto 1fr;
  gap: 0 18px;
  margin: 0 0 18px;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
}

html[data-theme] body[data-page='home'] .live-band::before {
  content: '';
  position: absolute;
  z-index: 0;
  top: 0;
  bottom: 0;
  left: 0;
  width: calc((100% - 18px) * 0.646);
  border: 1px solid var(--ref-line);
  border-radius: 16px;
  background: var(--ref-card);
  box-shadow: var(--ref-shadow);
  pointer-events: none;
}

html[data-theme] body[data-page='home'] .live-meta {
  z-index: 1;
  grid-column: 1;
  grid-row: 1;
  align-items: flex-start;
  margin: 0;
  padding: 20px 24px 0;
  border: 0;
  background: transparent;
}

html[data-theme] body[data-page='home'] .live-meta .eyebrow {
  color: var(--ref-ink);
  font-size: 16px;
  font-weight: 750;
  letter-spacing: 0;
}

html[data-theme] body[data-page='home'] .live-dot {
  background: var(--ref-teal);
  box-shadow: 0 0 0 5px rgba(18, 153, 154, 0.12);
}

html[data-theme] body[data-page='home'] .live-main {
  z-index: 1;
  grid-column: 1;
  grid-row: 2;
  display: grid;
  align-content: center;
  min-height: 226px;
  padding: 22px 26px 26px;
}

html[data-theme] body[data-page='home'] .equation {
  justify-content: center;
  gap: clamp(10px, 1.5vw, 22px);
}

html[data-theme] body[data-page='home'] .equation b,
html[data-theme] body[data-page='home'] .equation em {
  display: grid;
  width: clamp(70px, 6.5vw, 84px) !important;
  height: clamp(70px, 6.5vw, 84px) !important;
  flex: 0 0 auto !important;
  place-items: center;
  border: 0 !important;
  border-radius: 50% !important;
  color: #fff !important;
  font-size: clamp(32px, 3.6vw, 46px) !important;
  font-style: normal;
  font-weight: 760;
  line-height: 1 !important;
  box-shadow: inset 0 -7px 14px rgba(0, 52, 65, 0.12), 0 10px 22px rgba(18, 153, 154, 0.14);
}

html[data-theme] body[data-page='home'] .equation b:nth-of-type(1),
html[data-theme] body[data-page='home'] .equation b:nth-of-type(3) {
  background: linear-gradient(145deg, #3c9be7, #1874cf) !important;
}

html[data-theme] body[data-page='home'] .equation b:nth-of-type(2),
html[data-theme] body[data-page='home'] .equation em {
  background: linear-gradient(145deg, #2ab8b6, #0c9194) !important;
}

html[data-theme] body[data-page='home'] .equation i {
  color: #374151 !important;
  font-size: clamp(24px, 2.8vw, 34px) !important;
  font-style: normal;
  font-weight: 500;
}

html[data-theme] body[data-page='home'] .live-labels {
  justify-content: center;
  margin-top: 20px;
}

html[data-theme] body[data-page='home'] .live-labels > * {
  border-color: transparent !important;
  background: var(--ref-soft) !important;
  color: var(--ref-teal-dark) !important;
}

html[data-theme] body[data-page='home'] .live-next {
  grid-column: 2;
  grid-row: 1 / 3;
  display: grid !important;
  align-content: center;
  justify-items: center;
  min-height: 100%;
  margin: 0 !important;
  padding: 28px 24px !important;
  border: 1px solid var(--ref-line) !important;
  border-radius: 16px !important;
  background: var(--ref-card) !important;
  color: var(--ref-muted) !important;
  text-align: center;
  box-shadow: var(--ref-shadow);
}

html[data-theme] body[data-page='home'] .live-next::before {
  content: '◷';
  display: grid;
  width: 44px;
  height: 44px;
  margin-bottom: 12px;
  place-items: center;
  border-radius: 50%;
  background: var(--ref-soft);
  color: var(--ref-teal);
  font-size: 26px;
}

html[data-theme] body[data-page='home'] .live-next > span {
  color: var(--ref-ink);
  font-size: 16px;
  font-weight: 700;
}

html[data-theme] body[data-page='home'] .live-next strong[data-countdown] {
  margin: 16px 0 20px;
  color: var(--ref-teal) !important;
  font-size: clamp(43px, 4.4vw, 62px) !important;
  font-variant-numeric: tabular-nums;
  font-weight: 730;
  letter-spacing: 0.035em;
  line-height: 1;
}

html[data-theme] body[data-page='home'] .live-next > div {
  display: flex;
  width: 100%;
  justify-content: center;
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--ref-line);
}

html[data-theme] body[data-page='home'] .scratch-link,
html[data-theme] body[data-page='home'] .live-next .refresh {
  border-color: #a8d9d7 !important;
  background: #fff !important;
  color: var(--ref-teal-dark) !important;
}

html[data-theme] body[data-page='home'] .tool-cards {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 18px;
}

html[data-theme] body[data-page='home'] .tool-cards > a {
  min-height: 74px;
  border: 1px solid var(--ref-line);
  border-radius: 14px;
  background: var(--ref-card);
  box-shadow: none;
}

html[data-theme] body[data-page='home'] .tool-cards > a:hover {
  border-color: #82c9c7;
  color: var(--ref-teal-dark);
  transform: translateY(-1px);
}

html[data-theme] body[data-page='home'] .workspace {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 16px;
}

html[data-theme] body[data-page='home'] .panel {
  border: 1px solid var(--ref-line) !important;
  border-radius: 16px !important;
  background: var(--ref-card) !important;
  box-shadow: var(--ref-shadow) !important;
}

html[data-theme] body[data-page='home'] .history-panel {
  padding: 0 !important;
  overflow: hidden;
}

html[data-theme] body[data-page='home'] .history-panel .section-heading,
html[data-theme] body[data-page='home'] .history-panel .toolbar,
html[data-theme] body[data-page='home'] .history-panel .pagination {
  padding-right: 20px;
  padding-left: 20px;
}

html[data-theme] body[data-page='home'] .history-panel .section-heading {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  min-height: 64px;
  border-bottom: 1px solid var(--ref-line);
}

html[data-theme] body[data-page='home'] .history-panel .section-heading::before {
  content: '历史结果';
  color: var(--ref-ink);
  font-size: 21px;
  font-weight: 790;
}

html[data-theme] body[data-page='home'] .history-panel .section-heading > div {
  display: none;
}

html[data-theme] body[data-page='home'] .history-panel .section-heading > a {
  color: var(--ref-teal-dark);
}

html[data-theme] body[data-page='home'] .history-panel .toolbar {
  margin: 0;
  padding-top: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ref-line);
  background: #fbfcfd;
}

html[data-theme] body[data-page='home'] .history-panel .table-wrap {
  max-height: 720px;
  overflow: auto !important;
  border: 0 !important;
  border-radius: 0 !important;
}

html[data-theme] body[data-page='home'] .data-table {
  min-width: 840px;
}

html[data-theme] body[data-page='home'] .data-table th {
  border-bottom: 1px solid var(--ref-line);
  background: #f8fafb;
  color: #687180;
  font-size: 12px;
  letter-spacing: 0.04em;
}

html[data-theme] body[data-page='home'] .data-table td {
  border-bottom: 1px solid #edf0f3;
  background: #fff;
}

html[data-theme] body[data-page='home'] .data-table tbody tr:first-child td {
  background: #effaf9;
}

html[data-theme] body[data-page='home'] .workspace > aside {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

html[data-theme] body[data-page='home'] .workspace > aside .panel {
  margin: 0 !important;
}

html[data-theme='dark'] body[data-page='home'] {
  --ref-ink: #f1f5f7;
  --ref-muted: #a7b2bd;
  --ref-line: #2c3740;
  --ref-bg: #11171c;
  --ref-card: #182127;
  --ref-soft: #183c3c;
  --ref-shadow: 0 14px 30px rgba(0, 0, 0, 0.25);
}

html[data-theme='dark'] body[data-page='home'] .history-panel .toolbar,
html[data-theme='dark'] body[data-page='home'] .data-table th {
  background: #141c22;
}

html[data-theme='dark'] body[data-page='home'] .data-table td,
html[data-theme='dark'] body[data-page='home'] .scratch-link,
html[data-theme='dark'] body[data-page='home'] .live-next .refresh {
  background: var(--ref-card) !important;
}

html[data-theme='dark'] body[data-page='home'] .data-table tbody tr:first-child td {
  background: #17302f;
}

@media (min-width: 981px) {
  html[data-theme] body[data-page='home'] {
    display: grid;
    grid-template-columns: 244px minmax(0, 1fr);
    grid-template-rows: minmax(100vh, auto) auto;
  }

  html[data-theme] body[data-page='home'] > .site-header {
    position: sticky !important;
    z-index: 20;
    top: 0;
    grid-column: 1;
    grid-row: 1 / 3;
    display: flex;
    flex-direction: column;
    width: 244px;
    height: 100vh;
    max-height: none !important;
    overflow-x: hidden;
    overflow-y: auto;
    border: 0;
    border-right: 1px solid var(--ref-line);
    background: var(--ref-card);
    box-shadow: none;
  }

  html[data-theme] body[data-page='home'] > .site-header .c28-brand-row,
  html[data-theme] body[data-page='home'] > .site-header .header-inner {
    width: 100%;
  }

  html[data-theme] body[data-page='home'] > .site-header .header-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    min-height: 92px;
    padding: 18px 18px;
  }

  html[data-theme] body[data-page='home'] > .site-header .brand {
    min-width: 0;
  }

  html[data-theme] body[data-page='home'] > .site-header .header-caption {
    grid-column: 1 / -1;
    margin-top: 7px;
    color: var(--ref-muted);
    font-size: 12px;
  }

  html[data-theme] body[data-page='home'] > .site-header .c28-ads {
    width: 100%;
    padding: 0 12px 12px;
  }

  html[data-theme] body[data-page='home'] > .site-header .c28-grid {
    grid-template-columns: 1fr !important;
  }

  html[data-theme] body[data-page='home'] > .site-header .grouped-nav {
    display: flex !important;
    flex: 1;
    flex-direction: column;
    gap: 14px !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 18px 14px 24px !important;
    border-top: 1px solid var(--ref-line);
    background: transparent;
  }

  html[data-theme] body[data-page='home'] > .site-header .feature-group {
    display: block !important;
    width: 100%;
    min-width: 0;
    padding: 0;
    border: 0;
  }

  html[data-theme] body[data-page='home'] > .site-header .feature-group-label {
    display: block;
    margin: 0 9px 6px;
    color: #89929f;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0.08em;
  }

  html[data-theme] body[data-page='home'] > .site-header .feature-group > div {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 3px;
  }

  html[data-theme] body[data-page='home'] > .site-header .feature-group a {
    display: flex !important;
    min-height: 40px;
    justify-content: flex-start;
    padding: 8px 10px;
    border: 0;
    border-radius: 9px;
    color: #3c4652;
    background: transparent;
  }

  html[data-theme] body[data-page='home'] > .site-header .feature-group a:hover,
  html[data-theme] body[data-page='home'] > .site-header .feature-group a[aria-current='page'] {
    color: var(--ref-teal-dark);
    background: var(--ref-soft);
  }

  html[data-theme='dark'] body[data-page='home'] > .site-header .feature-group a {
    color: #d9e1e6;
  }

  html[data-theme] body[data-page='home'] > main {
    grid-column: 2;
    grid-row: 1;
  }

  html[data-theme] body[data-page='home'] > .site-footer {
    grid-column: 2;
    grid-row: 2;
  }
}

@media (max-width: 980px) {
  html[data-theme] body[data-page='home'] main {
    width: min(100% - 28px, 1220px);
    padding-top: 20px;
  }

  html[data-theme] body[data-page='home'] .live-band {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    gap: 12px;
  }

  html[data-theme] body[data-page='home'] .live-band::before {
    right: 0;
    bottom: 222px;
    width: auto;
  }

  html[data-theme] body[data-page='home'] .live-meta {
    grid-column: 1;
    grid-row: 1;
  }

  html[data-theme] body[data-page='home'] .live-main {
    grid-column: 1;
    grid-row: 2;
  }

  html[data-theme] body[data-page='home'] .live-next {
    grid-column: 1;
    grid-row: 3;
    min-height: 210px;
  }
}

@media (max-width: 650px) {
  html[data-theme] body[data-page='home'] .equation {
    width: 100% !important;
    max-width: 100% !important;
    gap: clamp(3px, 1vw, 5px);
  }

  html[data-theme] body[data-page='home'] .equation b,
  html[data-theme] body[data-page='home'] .equation em {
    width: clamp(46px, 13vw, 54px) !important;
    height: clamp(46px, 13vw, 54px) !important;
    font-size: clamp(23px, 7vw, 30px) !important;
  }

  html[data-theme] body[data-page='home'] .equation i {
    font-size: clamp(17px, 5vw, 22px) !important;
  }

  html[data-theme] body[data-page='home'] .equation .c28-draw-chime-toggle {
    flex: 0 0 30px !important;
  }

  html[data-theme] body[data-page='home'] .live-labels {
    width: 100% !important;
    max-width: 100% !important;
  }

  html[data-theme] body[data-page='home'] .tool-cards,
  html[data-theme] body[data-page='home'] .workspace > aside {
    grid-template-columns: 1fr;
  }

  html[data-theme] body[data-page='home'] .history-panel .toolbar {
    align-items: stretch;
  }

  html[data-theme] body[data-page='home'] .history-panel .table-wrap {
    max-height: 580px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html[data-theme] body[data-page='home'] *,
  html[data-theme] body[data-page='home'] *::before,
  html[data-theme] body[data-page='home'] *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
