/* 潮汕旧报：旧报栏线、朱砂方印；号码保留固定正红、正蓝、正绿。 */
.index-main {  margin: 6px auto 0; padding: 8px 5px; border: 1px solid var(--line); background: var(--paper) var(--paper-texture) center / 580px; }
.index-draw-board { margin-bottom: 0; padding: 0; color: var(--ink); }
.multi-draw-card { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.draw-tab-control { position: absolute; width: 1px; height: 1px; opacity: 0; }
.draw-tab-label { position: relative; display: flex; grid-row: 1; min-width: 0; min-height: 40px; padding: 6px 2px; align-items: center; justify-content: center; border: 1px solid var(--line); border-right: 0; background: transparent; color: var(--ink); font-size: 15px; font-weight: 700; cursor: pointer; }
.draw-tab-label:last-of-type { border-right: 1px solid var(--line); }
.draw-tab-control:checked + .draw-tab-label { background: #795127 var(--wood-texture) center / 480px; color: var(--paper); }
.draw-tab-control:focus-visible + .draw-tab-label { outline: 2px solid var(--ink); outline-offset: -4px; }
.draw-lottery { position: relative; display: none; grid-row: 2; grid-column: 1 / -1; min-width: 0; margin-top: 0; padding: 0 8px; border: 1px solid var(--line); border-top: 0; background: var(--surface); }
.draw-tab-control:checked + .draw-tab-label + .draw-lottery { display: block; }
.draw-lottery-header, .draw-card-header { display: flex; padding-top: 10px; align-items: center; justify-content: space-between; flex-wrap: nowrap; gap: 4px; }
.draw-lottery-brand, .draw-card-brand { display: flex; min-width: 0; align-items: center; gap: 6px; }
.draw-lottery-brand h3, .draw-card-brand h2, .draw-issue, .draw-countdown-label { margin: 0; color: var(--ink); font-size: 13px; font-weight: 500; line-height: 1.5; white-space: nowrap; }
.draw-lottery-brand .eyebrow, .draw-card-brand .eyebrow { display: none !important; }
.draw-countdown-label { display: flex; align-items: center; gap: 4px; }
.draw-countdown-label time { color: #ae2e1d; font-family: inherit; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.draw-numbers { display: grid; width: 100%; margin: 12px 0 8px; align-items: start; gap: clamp(5px, 2.2vw, 25px); grid-template-columns: repeat(7, minmax(0, 1fr)); }
.draw-numbers > .ball { display: grid; min-width: 0; justify-items: center; align-content: start; line-height: 1; }
.draw-numbers > .ball > b { display: grid; width: 100%; aspect-ratio: 1; place-items: center; border: 0; border-radius: 50%; color: #fff; font-family: Arial, sans-serif; font-size: clamp(18px, 4.8vw, 30px); font-weight: 700; font-variant-numeric: tabular-nums; }
.draw-numbers > .ball-red > b { background: #ed1c24; }
.draw-numbers > .ball-blue > b { background: #1677d2; }
.draw-numbers > .ball-green > b { background: #1ca65b; }
.draw-numbers > .ball > small { display: block; width: 1em; min-height: 40px; margin-top: 7px; color: var(--ink); font-size: 14px; font-weight: 500; line-height: 20px; text-align: center; white-space: normal; }
.draw-numbers > .ball-pending > b { background: #bcb7ac; }
.draw-numbers > .ball-sealed { position: relative; }
.draw-numbers > .ball-sealed::before { display: block; width: 100%; aspect-ratio: 1; border-radius: 50%; background: #bcb7ac; content: ""; }
.draw-numbers > .ball-sealed > b, .draw-numbers > .ball-sealed > small { position: absolute; visibility: hidden; }
.draw-sealed-message { display: none; }
.draw-numbers:has(.ball-sealed) + .draw-sealed-message { display: block; }
.draw-pending { grid-column: 1 / -1; padding-block: 18px; text-align: center; }
.draw-next-row { display: flex; padding: 8px 0; align-items: center; justify-content: space-between; flex-wrap: nowrap; gap: 6px; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.5; }
.draw-next-line { min-width: 0; margin: 0; }
.draw-next-label, .draw-next-line time { white-space: nowrap; }
.draw-history-link { flex: none; color: var(--ink); text-decoration: underline; white-space: nowrap; }
.index-shortcuts { display: grid; margin: 10px 0; padding: 0; border: 1px solid var(--line); background: transparent; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.index-shortcuts a { display: flex; flex-direction: column; min-height: 70px; padding: 3px 2px; justify-content: center; align-items: center; gap: 0; border-right: 1px solid var(--line); color: var(--ink); }
.index-shortcuts a:last-child { border-right: 0; }
.index-shortcuts a:hover strong { text-decoration: underline; }
.index-shortcuts a[aria-disabled="true"] { cursor: default; }
.index-shortcut-mark { display: block; width: 48px; height: 48px; flex: none; background-image: url("../images/press-shortcuts.webp"); background-repeat: no-repeat; background-size: 200% 200%; }
.is-site .index-shortcut-mark { background-position: left top; }
.is-year .index-shortcut-mark { background-position: right top; }
.is-gallery .index-shortcut-mark { background-position: left bottom; }
.is-classic .index-shortcut-mark { background-position: right bottom; }
.index-shortcuts strong { font-size: 13px; font-weight: 700; white-space: nowrap; }
.index-feed { display: grid; padding: 0; grid-template-columns: minmax(0, 1fr); gap: 10px; counter-reset: press-section; }
.index-feed > .masonry-card { counter-increment: press-section; }
.index-section-heading, .image-swiper-title { position: relative; display: flex; width: 100%; max-width: 100%; min-height: 38px; margin: 0 0 5px; padding: 4px; align-items: center; gap: 5px; border: 3px double var(--line); color: var(--ink); }
.index-section-heading::before, .image-swiper-title::before { display: grid; width: 26px; height: 26px; min-width: 26px; place-items: center; content: counter(press-section, decimal-leading-zero); background: var(--cinnabar); color: var(--paper); font-family: "Old Press Serif", serif; font-size: 16px; font-weight: 500; line-height: 1; }
.index-section-heading h2, .index-section-heading > span, .image-swiper-title { font-family: "Old Press Serif", "Songti SC", serif; font-size: 17px; font-weight: 700; line-height: 1.35; }
.index-section-heading h2 { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.index-section-heading > span + span { margin-left: auto; color: var(--muted); font-size: 13px; }
.index-article { padding: 0; background: var(--surface); }
.index-article .article-body :is(th, td) { padding: 5px; border-color: var(--line); text-align: center !important; }
.index-article tbody tr:nth-child(even) { background: rgb(129 125 118 / 5%); }
.index-title-list { display: grid; grid-template-columns: minmax(0, 1fr); counter-reset: press-row; }
.index-title-list a { display: flex; min-height: 29px; padding: 3px 8px; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); color: var(--ink); font-size: var(--article-size); font-weight: 700; line-height: 1.5; overflow-wrap: anywhere; counter-increment: press-row; }
.index-title-list a::before { flex: 0 0 30px; min-width: 30px; color: var(--muted); font-size: 12px; font-weight: 500; white-space: nowrap; content: "❖ " counter(press-row); }
.index-title-list a:hover { background: var(--heading-wash); text-decoration: underline; }
.image-swipers-heading { display: none; }
.image-swiper { min-width: 0; }
.image-swiper-tabs { display: grid; width: 100%; padding: 0; gap: 0; background: transparent; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.image-swiper-tabs button { min-width: 0; min-height: 34px; padding: 5px 2px; border: 1px solid var(--line); border-right: 0; border-radius: 0; background: transparent; color: var(--ink); font-size: 14px; font-weight: 500; line-height: 1.5; white-space: nowrap; }
.image-swiper-tabs button:last-child { border-right: 1px solid var(--line); }
.image-swiper-tabs .is-long-period { font-size: clamp(11px, 3vw, 14px); }
.image-swiper-tabs button[aria-selected="true"] { background: #795127 var(--wood-texture) center / 480px; color: var(--paper); }
.image-swiper-tabs button:hover { box-shadow: inset 0 -2px var(--gilt); }
.image-swiper-frame { position: relative; margin: 0; border: 1px solid var(--line); border-top: 0; background: transparent; }
.image-swiper-slide, .image-swiper-link { display: block; position: relative; min-height: 0; }
.image-swiper-slide img { display: block; width: 100%; height: auto; aspect-ratio: auto; object-fit: contain; }
.image-swiper-arrow { position: absolute; z-index: 2; top: 50%; display: grid; width: 38px; height: 38px; padding: 10px; place-items: center; border: 0; border-radius: 50%; background: rgb(52 36 20 / 65%); color: #fff; transform: translateY(-50%); }
.image-swiper-arrow svg { width: 18px; height: 18px; }
.image-swiper-arrow.is-prev { left: 4px; }
.image-swiper-arrow.is-next { right: 4px; }
.image-swiper-arrow:hover { background: rgb(52 36 20 / 85%); }
.index-image-flow { padding: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.index-document-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); background: var(--surface); }
.index-document-list a { display: grid; min-height: 48px; padding: 8px 5px; align-items: center; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: center; font-size: var(--article-size); overflow-wrap: anywhere; }
.index-document-list strong { font-weight: 600; }
.article-app-header, .document-app-header { position: sticky; z-index: 20; top: 0; color: var(--ink); }
.article-app-header-inner, .document-app-header-inner { display: grid; grid-template-columns: 64px minmax(0, 1fr) 64px; align-items: center; width: min(760px, 100%); min-height: 56px; margin-inline: auto; padding: 4px 10px; border-bottom: 1px solid var(--gilt); background: var(--paper); }
.article-app-header strong, .document-app-header strong { overflow: hidden; text-align: center; font-size: 18px; text-overflow: ellipsis; white-space: nowrap; }
.article-back, .document-back { display: flex; align-items: center; min-height: 44px; font-size: 14px; }
.article-page-shell, .document-page-shell { min-height: calc(100vh - 140px); padding: 14px; }
@media (min-width: 681px) {
  .draw-tab-label { min-height: 44px; font-size: 20px; }
  .draw-lottery { padding-inline: 18px; }
  .draw-lottery-header { padding-top: 15px; }
  .draw-lottery-brand h3, .draw-card-brand h2, .draw-issue, .draw-countdown-label, .draw-countdown-label time, .draw-next-row { font-size: 14px; }
  .draw-next-row { padding-block: 10px; }
  .index-shortcuts { margin-block: 10px; }
  .index-shortcuts a { min-height: 80px; gap: 0; }
  .index-shortcut-mark { width: 56px; height: 56px; }
  .index-shortcuts strong { font-size: 16px; }
  .index-section-heading, .image-swiper-title { min-height: 38px; }
  .index-section-heading h2, .index-section-heading > span, .image-swiper-title { font-size: 21px; }
  .index-section-heading::before, .image-swiper-title::before { width: 30px; height: 30px; min-width: 30px; font-size: 20px; }
  .index-article .article-body :is(th, td) { padding-block: 6px; }
  .image-swiper-tabs button { min-height: 38px; font-size: 16px; }
  .index-title-list a { min-height: 29px; }
}
@media (max-width: 680px) {
  .article-page-shell, .document-page-shell { padding: 8px; }
}
@media (max-width: 360px) {
  .index-main { padding-inline: 6px; }
  .draw-lottery { padding-inline: 7px; }
  .draw-lottery-brand { gap: 3px; }
  .draw-countdown-label { gap: 2px; }
  .draw-numbers { gap: 5px; }
  .index-section-heading h2, .index-section-heading > span, .image-swiper-title { font-size: 17px; }
}

/* History controls retain the shared runtime's filter and canvas hooks. */
.history-app-header { position: sticky; z-index: 20; top: 0; color: var(--ink); }
.history-app-header-inner { display: grid; grid-template-columns: 64px minmax(0, 1fr) 64px; align-items: center; width: min(760px, 100%); min-height: 56px; margin-inline: auto; padding: 4px 12px; border-bottom: 1px solid var(--pale-gold); background: var(--paper); }
.history-app-header strong { overflow: hidden; text-align: center; text-overflow: ellipsis; white-space: nowrap; font-size: 18px; }
.history-back { display: flex; min-height: 44px; align-items: center; font-size: 14px; }
.history-page-shell { width: min(760px, 100%); min-height: calc(100vh - 140px); margin: 0 auto; background-color: var(--paper); background-image: var(--paper-texture); background-size: 580px; }
.history-filter-row { display: grid; grid-template-columns: 52px minmax(0, 1fr); min-height: 48px; border-bottom: 1px solid var(--line); }
.history-filter-row > strong { display: grid; place-items: center; background: var(--heading-wash); font-size: 14px; }
.history-chip-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px; }
.history-condition-chips { min-width: 0; flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-inline: contain; }
.history-condition-group { display: none; }
[data-history-trend="sx"] [data-history-condition-group="sx"],
[data-history-trend="wx"] [data-history-condition-group="wx"],
[data-history-trend="tail"] [data-history-condition-group="tail"] { display: contents; }
.history-chip { display: inline-flex; flex: none; align-items: center; justify-content: center; min-width: 32px; min-height: 32px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 3px; background: var(--paper); color: var(--ink); font-size: 14px; }
.history-chip:hover { border-color: var(--gilt); }
.history-chip.is-active { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.history-log-card { margin-top: 14px; }
.history-log-scroll { overflow-x: auto; overscroll-behavior-inline: contain; }
.history-log-list { min-width: 344px; font-variant-numeric: tabular-nums; }
.history-log-header, .history-log-row { display: grid; grid-template-columns: minmax(62px, 1.18fr) repeat(7, minmax(40px, 1fr)); }
.history-log-header { min-height: 42px; border-bottom: 1px solid var(--gilt); background: var(--heading-wash); }
.history-log-heading { display: grid; place-items: center; padding: 7px 2px; border-right: 1px solid var(--line); font-size: 12px; white-space: nowrap; }
.history-log-body { position: relative; }
.history-log-row { min-height: 66px; border-bottom: 1px solid var(--line); }
.history-issue-cell, .history-ball-cell { position: relative; z-index: 2; display: grid; align-content: center; justify-items: center; min-width: 0; padding: 6px 2px; border-right: 1px solid var(--line); }
.history-issue-cell { background: var(--surface); }
.history-issue-cell strong { font-size: 12px; white-space: nowrap; }
.history-special-heading, .history-ball-cell.is-special-cell { border-left: 2px solid var(--gilt); }
.history-ball { display: grid; width: clamp(27px, 7.4vw, 34px); aspect-ratio: 1; place-items: center; border-radius: 50%; background: var(--ink); color: var(--paper); font-size: 14px; font-weight: 750; }
.history-ball-red { background: var(--ball-red); color: #fff; }
.history-ball-green { background: var(--ball-green); color: #fff; }
.history-ball-blue { background: var(--ball-blue); color: #fff; }
.history-ball-cell small { margin-top: 3px; font-size: 11px; line-height: 1.1; white-space: nowrap; }
.history-ball.is-trend-match { outline: 3px solid var(--ink); outline-offset: 2px; }
.history-trend-canvas { position: absolute; z-index: 1; inset: 0 auto auto 0; pointer-events: none; }
.history-empty { display: grid; min-height: 160px; place-items: center; color: var(--muted); }
.history-load-zone { padding: 12px; text-align: center; }
.history-load-more { width: 100%; min-height: 40px; border: 0; background: var(--pale-gold); color: var(--ink); }
.history-load-more:disabled { cursor: wait; opacity: .6; }
.history-load-status { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.history-pagination { display: flex; justify-content: center; gap: 16px; padding: 12px; }
.history-page-shell.is-enhanced .history-pagination { display: none; }
.history-footer { width: min(760px, 100%); margin-inline: auto; padding: 24px 12px; border-top: 1px solid var(--ink); background: var(--paper); color: var(--ink); text-align: center; font-size: 12px; }

/* Paper headings and carousel dots follow the approved newspaper composition. */
.index-feed > .masonry-card { border: 1px solid var(--line); }
.index-feed > .masonry-card > .index-section-heading { width: calc(100% - 6px); margin: 3px 3px 5px; }
.image-swiper-title { width: calc(100% - 6px); margin: 3px 3px 5px; }
.index-section-heading .press-recommendation { margin-left: auto; padding: 1px 4px; border: 3px double var(--cinnabar); color: var(--cinnabar); font-size: 12px; white-space: nowrap; }
.image-swiper-dots { position: absolute; z-index: 1; bottom: 3px; left: 50%; display: flex; transform: translateX(-50%); }
.image-swiper-dot { display: grid; width: 20px; height: 24px; padding: 0; place-items: center; border: 0; background: transparent; }
.image-swiper-dot::before { width: 7px; height: 7px; border: 1px solid rgb(255 255 255 / 75%); border-radius: 50%; background: rgb(255 255 255 / 50%); content: ""; }
.image-swiper-dot.is-current::before { background: #fff; }
.image-swiper-caption { position: absolute; right: 8px; bottom: 5px; padding: 0 3px; background: rgb(52 36 20 / 60%); color: #fff; font-size: 11px; }
.index-article .article-body table { border-style: hidden; }
@media (max-width: 360px) {
  .index-main { width: 100%; padding-inline: 5px; }
  .index-notice { width: 100%; }
  .index-section-heading .press-recommendation { font-size: 10px; padding-inline: 2px; }
}

/* 封盘统一显示：兼容首次渲染及现有实时脚本生成的七个 ball-sealed。 */
body[data-layout] [data-field="numbers"].draw-numbers:has(> .ball-sealed) {
  padding-bottom: 0;
}
body[data-layout] [data-field="numbers"].draw-numbers > .ball-sealed {
  position: relative;
  display: block !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  padding: 0 !important;
  aspect-ratio: 1;
  box-sizing: border-box;
  border: 1px solid #e8bd55 !important;
  border-radius: 50% !important;
  background: linear-gradient(180deg, #fffef7 0%, #f5f5f2 52%, #e5e7eb 100%) !important;
  box-shadow: none !important;
  overflow: hidden;
}
body[data-layout] [data-field="numbers"].draw-numbers > .ball-sealed::before {
  content: var(--sealed-character, "等") !important;
  position: absolute;
  inset: 0;
  display: grid;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: none;
  box-shadow: none;
  color: #70757a;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  font-size: clamp(18px, 4.8vw, 26px);
  font-weight: 700;
  line-height: 1;
  text-shadow: none;
  transform: none;
}
body[data-layout] [data-field="numbers"].draw-numbers > .ball-sealed:nth-child(2) { --sealed-character: "待"; }
body[data-layout] [data-field="numbers"].draw-numbers > .ball-sealed:nth-child(3) { --sealed-character: "正"; }
body[data-layout] [data-field="numbers"].draw-numbers > .ball-sealed:nth-child(4) { --sealed-character: "在"; }
body[data-layout] [data-field="numbers"].draw-numbers > .ball-sealed:nth-child(5) { --sealed-character: "搅"; }
body[data-layout] [data-field="numbers"].draw-numbers > .ball-sealed:nth-child(6) { --sealed-character: "球"; }
body[data-layout] [data-field="numbers"].draw-numbers > .ball-sealed:nth-child(7) { --sealed-character: "中"; }
body[data-layout] [data-field="numbers"].draw-numbers > .ball-sealed::after { content: none !important; }
body[data-layout] [data-field="numbers"].draw-numbers > .ball-sealed > b,
body[data-layout] [data-field="numbers"].draw-numbers > .ball-sealed > small { display: none !important; }


/* 站点域名导航：四列三行，沿用模板字体与主题色。 */
body[data-layout] .index-domain-links {
  display: grid;
  width: 100%;
  min-width: 0;
  margin: 0 0 12px;
  padding: 4px 0;
  grid-column: 1 / -1;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line, #ddd);
  background: var(--classic-page, var(--paper, var(--surface, transparent)));
  color: inherit;
}
body[data-layout] .index-domain-links > a {
  display: grid;
  min-width: 0;
  min-height: 44px;
  padding: 8px 2px;
  place-items: center;
  color: inherit;
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}
body[data-layout] .index-domain-links > a:hover { text-decoration: underline; }
body[data-layout] .index-domain-links > a:focus-visible { outline: 2px solid currentColor; outline-offset: -4px; box-shadow: none; }
@media (min-width: 681px) {
  body[data-layout] .index-domain-links > a { min-height: 48px; font-size: 18px; }
}
