/* Shared modern data-analysis presentation layer. Loaded after legacy page styles. */
html:root {
    color-scheme: dark;
    --md-font: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", "Noto Sans SC", "Segoe UI", sans-serif;
    --md-bg: #06101c;
    --md-bg-deep: #040b13;
    --md-surface: #0b1929;
    --md-surface-2: #0e2235;
    --md-surface-3: #112b42;
    --md-line: rgba(91, 150, 190, 0.28);
    --md-line-strong: rgba(72, 232, 224, 0.46);
    --md-text: #e9f7ff;
    --md-muted: #86a5b8;
    --md-cyan: #48e8e0;
    --md-blue: #4b8cff;
    --md-red: #ff5f72;
    --md-gold: #ffc857;
    --md-shadow: 0 18px 46px rgba(0, 0, 0, 0.28);
    --md-shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.2);
    --w-surface: var(--md-bg);
    --w-surface-high: var(--md-surface-2);
    --w-surface-container: var(--md-surface);
    --w-surface-container-high: var(--md-surface-3);
    --w-on-surface: var(--md-text);
    --w-on-surface-variant: var(--md-muted);
    --w-on-primary: #031115;
    --w-outline: var(--md-line);
    --w-shadow: rgba(0, 0, 0, 0.26);
    --w-ssq: var(--md-cyan);
    --w-ssq-container: #103746;
    --w-ssq-light: #17495a;
    --w-amber: var(--md-gold);
    --w-amber-soft: #352d19;
}

html.warm-site,
html.warm-site body,
body.warm-home,
body.warm-portal {
    background:
        radial-gradient(circle at 12% 4%, rgba(75, 140, 255, 0.13), transparent 31rem),
        radial-gradient(circle at 88% 13%, rgba(72, 232, 224, 0.08), transparent 28rem),
        linear-gradient(180deg, var(--md-bg) 0%, var(--md-bg-deep) 100%) !important;
    color: var(--md-text) !important;
    font-family: var(--md-font) !important;
}

html.warm-site body *,
.stats-embed,
.stats-embed *,
.lab-shell,
.lab-shell * {
    font-family: var(--md-font) !important;
}

html.warm-site body .fa,
html.warm-site body [class^="fa-"],
html.warm-site body [class*=" fa-"],
.stats-embed .fa,
.stats-embed [class^="fa-"],
.stats-embed [class*=" fa-"],
.lab-shell .fa,
.lab-shell [class^="fa-"],
.lab-shell [class*=" fa-"] {
    font-family: FontAwesome !important;
}

a,
button,
select,
.tool-item,
.embed-tool-item {
    -webkit-tap-highlight-color: transparent;
}

button,
select {
    font-family: inherit;
}

button:focus-visible,
select:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--md-cyan) !important;
    outline-offset: 2px;
}

.ui-icon {
    display: inline-block;
    width: 1.16em;
    height: 1.16em;
    margin-right: 0.34em;
    object-fit: contain;
    vertical-align: -0.2em;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.24));
}

button .ui-icon {
    width: 1.22em;
    height: 1.22em;
    vertical-align: -0.23em;
}

/* Home dashboard */
body.warm-home {
    line-height: 1.62;
}

body.warm-home .hero,
body.warm-home .embed-card {
    position: relative;
    border: 1px solid var(--md-line) !important;
    background:
        linear-gradient(135deg, rgba(75, 140, 255, 0.075), transparent 42%),
        linear-gradient(180deg, rgba(14, 34, 53, 0.98), rgba(8, 24, 39, 0.98)) !important;
    color: var(--md-text) !important;
    box-shadow: var(--md-shadow) !important;
}

/* 首页上下两层采用同一组外框和内框基准线。 */
body.warm-home .embed-card {
    width: 100%;
    max-width: none;
    padding-inline: clamp(12px, 3.5vw, 18px);
}

body.warm-home #homeToolFrameContainer {
    width: 100%;
    margin-right: 0;
    margin-left: 0;
}

body.warm-home .hero::before {
    background: linear-gradient(90deg, var(--md-cyan), var(--md-blue), transparent 72%);
    height: 2px;
    inset: 0 0 auto !important;
    border-radius: 16px 16px 0 0;
    box-shadow: none !important;
    opacity: 0.82;
}

body.warm-home .hero-section-title {
    color: var(--md-text) !important;
    text-shadow: none !important;
    letter-spacing: 0.08em;
}

body.warm-home .hero-panel,
body.warm-home .cold-hot-col,
body.warm-home .more-section,
body.warm-home .group-section {
    background: linear-gradient(180deg, rgba(17, 43, 66, 0.78), rgba(9, 28, 45, 0.9)) !important;
    border: 1px solid var(--md-line) !important;
    color: var(--md-text) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035), var(--md-shadow-soft) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

body.warm-home .hero-draw-name,
body.warm-home .hero-game-capture.card-ssq .hero-draw-name,
body.warm-home .more-section h4,
body.warm-home .group-section h4,
body.warm-home .cold-hot-col h4 {
    color: var(--md-text) !important;
}

body.warm-home .hero-draw-when,
body.warm-home .embed-tool-item p,
body.warm-home footer,
body.warm-home .footer-domain,
body.warm-home .empty-inline {
    color: var(--md-muted) !important;
}

body.warm-home .hero-card-info .hero-draw-period,
body.warm-home .embed-card .embed-section-title-ssq,
body.warm-home footer .toggle {
    color: var(--md-cyan) !important;
}

body.warm-home .hero-pick,
body.warm-home .hero-game-capture.card-ssq .hero-pick {
    background: rgba(72, 232, 224, 0.055) !important;
    border: 1px solid rgba(72, 232, 224, 0.2) !important;
    color: var(--md-muted) !important;
}

body.warm-home .hero-pick-inner h4,
body.warm-home .embed-tool-item h3 {
    color: var(--md-gold) !important;
}

body.warm-home .ball {
    border: 1px solid rgba(255, 255, 255, 0.28);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.32), inset 0 1px 1px rgba(255, 255, 255, 0.26) !important;
    font-variant-numeric: tabular-nums;
}

body.warm-home .ball-red {
    background: linear-gradient(145deg, #ff7182, #c92f4a) !important;
}

body.warm-home .ball-blue {
    background: linear-gradient(145deg, #66a2ff, #245dcc) !important;
}

body.warm-home .hero-more-btn,
body.warm-home .hero-card-actions .share-btn,
html.warm-site body.warm-portal .share-btn {
    background: linear-gradient(135deg, var(--md-cyan), #2db5c8) !important;
    border: 1px solid rgba(72, 232, 224, 0.58) !important;
    color: #031115 !important;
    box-shadow: 0 8px 20px rgba(33, 196, 200, 0.16) !important;
}

body.warm-home .hero-card-actions .bookmark-btn,
html.warm-site body.warm-portal .bookmark-btn,
body.warm-home .toggle-btn,
html.warm-site body.warm-portal .toggle-btn {
    background: rgba(14, 34, 53, 0.92) !important;
    border: 1px solid var(--md-line) !important;
    color: var(--md-text) !important;
    box-shadow: none !important;
}

body.warm-home .hero-more-btn:hover,
body.warm-home .hero-card-actions .share-btn:hover,
html.warm-site body.warm-portal .share-btn:hover {
    background: linear-gradient(135deg, #6af5ed, #38c8d8) !important;
    transform: translateY(-1px);
}

body.warm-home .hero-card-actions .bookmark-btn:hover,
body.warm-home .toggle-btn:hover,
html.warm-site body.warm-portal .bookmark-btn:hover,
html.warm-site body.warm-portal .toggle-btn:hover {
    border-color: var(--md-line-strong) !important;
    background: rgba(17, 49, 70, 0.98) !important;
}

body.warm-home .embed-tool-item,
html.warm-site body.warm-portal .tool-item {
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(17, 43, 66, 0.9), rgba(10, 27, 43, 0.96)) !important;
    border: 1px solid var(--md-line) !important;
    color: var(--md-text) !important;
    box-shadow: var(--md-shadow-soft) !important;
}

body.warm-home .embed-tool-item::before,
html.warm-site body.warm-portal .tool-item::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 2px;
    background: linear-gradient(180deg, var(--md-cyan), transparent 80%);
    opacity: 0.7;
}

body.warm-home .embed-card.embed-ssq .embed-tool-item:hover,
html.warm-site body.warm-portal .tool-item:hover {
    background: linear-gradient(180deg, rgba(20, 58, 78, 0.98), rgba(10, 34, 50, 0.98)) !important;
    border-color: var(--md-line-strong) !important;
    transform: translateY(-2px);
}

body.warm-home .embed-card.embed-ssq .embed-tool-item.active,
html.warm-site body.warm-portal .tool-item.active {
    background: linear-gradient(180deg, rgba(18, 72, 83, 0.92), rgba(9, 39, 55, 0.98)) !important;
    border-color: rgba(72, 232, 224, 0.62) !important;
    box-shadow: 0 0 0 1px rgba(72, 232, 224, 0.12), 0 12px 28px rgba(0, 0, 0, 0.28) !important;
}

body.warm-home #homeToolFrameContainer,
html.warm-site body.warm-portal #toolFrameContainer {
    border-color: var(--md-line) !important;
    background: var(--md-surface) !important;
    box-shadow: var(--md-shadow-soft);
}

body.warm-home #homeToolFrame {
    background: transparent !important;
}

html.warm-site body.warm-portal #toolFrame {
    background: var(--md-surface) !important;
}

/* 动态图本身作为二级框，父容器只负责定位，不再额外画一层错位边线。 */
body.warm-home #homeToolFrameContainer {
    border-color: transparent !important;
    background: transparent !important;
    box-shadow: none !important;
}

body.warm-home .panel-share-hint,
html.warm-site body.warm-portal #shareHint {
    background: linear-gradient(180deg, #3b321d, #252317) !important;
    color: #ffe3a1 !important;
    border-color: rgba(255, 200, 87, 0.34) !important;
}

body.warm-home #infoDetail,
html.warm-site body.warm-portal .footer-detail {
    color: var(--md-text) !important;
}

body.warm-home .modal-overlay,
html.warm-site body.warm-portal .modal-overlay {
    background: rgba(3, 9, 16, 0.82) !important;
}

body.warm-home .modal-overlay .tips,
html.warm-site body.warm-portal .modal-overlay .tips {
    max-width: min(90%, 680px);
    margin-top: 16px;
    padding: 10px 18px;
    border: 1px solid rgba(72, 232, 224, 0.34);
    border-radius: 999px;
    background: rgba(8, 24, 39, 0.94);
    color: var(--md-text) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    font-size: clamp(15px, 2vw, 17px);
    font-weight: 600;
    line-height: 1.55;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

/* Analysis portal */
html.warm-site body.warm-portal {
    min-height: 100vh;
}

html.warm-site body.warm-portal .page-container {
    background:
        linear-gradient(135deg, rgba(75, 140, 255, 0.07), transparent 38%),
        linear-gradient(180deg, rgba(14, 34, 53, 0.98), rgba(8, 24, 39, 0.98)) !important;
    border: 1px solid var(--md-line) !important;
    box-shadow: var(--md-shadow) !important;
}

html.warm-site body.warm-portal .card-glass,
html.warm-site body.warm-portal .card-glass h2,
html.warm-site body.warm-portal .card-glass h3,
html.warm-site body.warm-portal .daily-header-right h2,
html.warm-site body.warm-portal .cold-hot-col,
html.warm-site body.warm-portal .more-section,
html.warm-site body.warm-portal .group-section,
html.warm-site body.warm-portal .more-row,
html.warm-site body.warm-portal .group-row,
html.warm-site body.warm-portal .group-label,
html.warm-site body.warm-portal .card-glass p {
    color: var(--md-text) !important;
}

html.warm-site body.warm-portal .draw-label,
html.warm-site body.warm-portal .today-date,
html.warm-site body.warm-portal .tool-item p,
html.warm-site body.warm-portal .portal-footer-domain {
    color: var(--md-muted) !important;
}

html.warm-site body.warm-portal .draw-period,
html.warm-site body.warm-portal nav a,
html.warm-site body.warm-portal .footer-toggle {
    color: var(--md-cyan) !important;
}

html.warm-site body.warm-portal .highlight-text,
html.warm-site body.warm-portal .cold-hot-col,
html.warm-site body.warm-portal .more-section,
html.warm-site body.warm-portal .group-section,
html.warm-site body.warm-portal .footer-detail {
    background: rgba(9, 28, 45, 0.82) !important;
    border: 1px solid var(--md-line) !important;
}

html.warm-site body.warm-portal .tool-item h3 {
    color: var(--md-gold) !important;
}

/* Chart and history pages */
html.warm-site body:not(.warm-home):not(.warm-portal) {
    min-height: 100vh;
    padding: 8px 0 !important;
}

html.warm-site:has(body:not(.warm-home):not(.warm-portal)),
html.warm-site body:not(.warm-home):not(.warm-portal) {
    background: transparent !important;
}

html.warm-site body:not(.warm-home):not(.warm-portal) .content-wrap {
    width: 100% !important;
    max-width: none !important;
    padding: clamp(8px, 2.5vw, 14px) 0 !important;
    color: var(--md-text) !important;
}

html.warm-site body:not(.warm-home):not(.warm-portal) .content-wrap > .btn-row {
    padding-right: 10px;
    padding-left: 10px;
}

html.warm-site #captureArea,
html.warm-site .content-wrap > div:has(> canvas#canvas2),
html.warm-site .recommend-list,
html.warm-site .rec-section,
html.warm-site article,
html.warm-site .video-item {
    background:
        linear-gradient(135deg, rgba(75, 140, 255, 0.07), transparent 45%),
        linear-gradient(180deg, rgba(14, 34, 53, 0.98), rgba(8, 24, 39, 0.98)) !important;
    border: 1px solid var(--md-line) !important;
    color: var(--md-text) !important;
    box-shadow: var(--md-shadow-soft) !important;
}

html.warm-site #captureArea,
html.warm-site .content-wrap > div:has(> canvas#canvas2) {
    border-radius: 12px !important;
}

html.warm-site body.repeat-chart-page #captureArea {
    background:
        radial-gradient(circle at 82% 12%, rgba(75, 140, 255, 0.055), transparent 42%),
        linear-gradient(180deg, rgba(15, 37, 54, 0.98), rgba(7, 21, 32, 0.99)) !important;
    border-color: rgba(91, 150, 190, 0.22) !important;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2) !important;
}

html.warm-site body.repeat-chart-page #gifCaptureArea {
    background: transparent !important;
}

html.warm-site body.repeat-chart-page .content-wrap > article {
    background: linear-gradient(180deg, rgba(13, 32, 47, 0.96), rgba(8, 22, 33, 0.98)) !important;
    border-color: rgba(91, 150, 190, 0.2) !important;
    color: var(--md-text) !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.16) !important;
}

html.warm-site body.repeat-chart-page .content-wrap > article p,
html.warm-site body.repeat-chart-page .content-wrap > article strong {
    color: #b5c9d4 !important;
}

html.warm-site body.history-repeat-page #tableContainer {
    background:
        radial-gradient(circle at 82% 10%, rgba(75, 140, 255, 0.055), transparent 42%),
        linear-gradient(180deg, rgba(15, 37, 54, 0.98), rgba(7, 21, 32, 0.99)) !important;
    border: 1px solid rgba(91, 150, 190, 0.22) !important;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2) !important;
}

html.warm-site body.history-repeat-page .history-table th,
html.warm-site body.history-repeat-page .history-table td {
    border-color: rgba(91, 150, 190, 0.16) !important;
    background: rgba(8, 25, 39, 0.84) !important;
    color: #c5d7e1 !important;
}

html.warm-site body.history-repeat-page .history-table th {
    background: linear-gradient(180deg, rgba(24, 58, 76, 0.97), rgba(14, 42, 59, 0.98)) !important;
    color: #d9e9f1 !important;
}

html.warm-site body.history-repeat-page .history-table tr:nth-child(even) td,
html.warm-site body.history-repeat-page .history-table tr.repeat4-row td {
    background: rgba(11, 31, 47, 0.9) !important;
}

html.warm-site body.history-repeat-page .history-table tr.repeat5-row td {
    background: rgba(13, 35, 51, 0.92) !important;
}

html.warm-site body.history-repeat-page .history-table tr.repeat6-row td {
    background: rgba(15, 39, 56, 0.94) !important;
}

html.warm-site body.history-repeat-page .history-table tr.group-header td {
    background: rgba(17, 52, 68, 0.96) !important;
    color: #8fd9d4 !important;
    border-bottom-color: rgba(72, 232, 224, 0.3) !important;
}

html.warm-site body.history-repeat-page .history-table td.red-ball {
    background: rgba(145, 57, 72, 0.34) !important;
    color: #f1c5cc !important;
}

html.warm-site body.history-repeat-page .history-table td.blue-ball {
    background: rgba(48, 83, 129, 0.4) !important;
    color: #c8d9ee !important;
}

html.warm-site body.history-repeat-page .history-table tbody tr:hover td {
    background: rgba(25, 55, 73, 0.94) !important;
}

html.warm-site body.history-repeat-page .history-table tbody tr:hover td.red-ball[data-matched="true"] {
    background: rgba(167, 68, 82, 0.54) !important;
    box-shadow: inset 0 0 0 1px rgba(255, 200, 87, 0.7) !important;
}

html.warm-site body.history-repeat-page .content-wrap > article {
    background: linear-gradient(180deg, rgba(13, 32, 47, 0.96), rgba(8, 22, 33, 0.98)) !important;
    border-color: rgba(91, 150, 190, 0.2) !important;
    color: var(--md-text) !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.16) !important;
}

html.warm-site body.history-repeat-page .content-wrap > article p,
html.warm-site body.history-repeat-page .content-wrap > article strong {
    color: #b5c9d4 !important;
}

html.warm-site #captureArea p,
html.warm-site #captureArea label,
html.warm-site #captureArea div:not(.loading-mask),
html.warm-site article p,
html.warm-site article strong,
html.warm-site .video-item p,
html.warm-site .info-row,
html.warm-site .section-label,
html.warm-site .btn-row,
html.warm-site .recommend-list .rec-item,
html.warm-site .recommend-list .rec-item span,
html.warm-site .rec-section .rec-list {
    color: var(--md-text) !important;
}

html.warm-site .recommend-list h2,
html.warm-site .rec-section h3 {
    color: var(--md-gold) !important;
}

html.warm-site .rec-section .red {
    color: #ff8c99 !important;
}

html.warm-site table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
    overflow: hidden;
    border-radius: 10px;
}

html.warm-site table th,
html.warm-site table td {
    border-color: rgba(91, 150, 190, 0.22) !important;
    color: var(--md-text) !important;
    background: rgba(9, 28, 45, 0.82) !important;
}

html.warm-site table th {
    background: linear-gradient(180deg, rgba(23, 73, 90, 0.96), rgba(13, 50, 68, 0.96)) !important;
    color: #dffffc !important;
}

html.warm-site table tr:nth-child(even) td {
    background: rgba(14, 39, 59, 0.92) !important;
}

html.warm-site .history-table tr.group-header td {
    background: rgba(18, 60, 76, 0.94) !important;
    color: var(--md-cyan) !important;
}

html.warm-site .history-table td.red-ball {
    background: rgba(255, 95, 114, 0.22) !important;
    color: #ffdce1 !important;
}

html.warm-site .history-table td.blue-ball {
    background: rgba(75, 140, 255, 0.24) !important;
    color: #dfebff !important;
}

html.warm-site .history-table td.period-cell,
html.warm-site td[style*="color:#fff"],
html.warm-site td[style*="color: #fff"] {
    color: var(--md-text) !important;
}

html.warm-site #saveImageBtn,
html.warm-site #recordGifBtn,
html.warm-site .small.blue.button:not(#reduce1):not(#plus1):not(#reduce3):not(#plus3):not([id^="reduce"]):not([id^="plus"]),
html.warm-site button.small.blue.button:not([style*="background-image"]) {
    min-height: 36px;
    padding: 7px 14px !important;
    border-radius: 8px !important;
    background: linear-gradient(135deg, #1a7080, #155469) !important;
    border: 1px solid rgba(72, 232, 224, 0.38) !important;
    color: #eaffff !important;
    box-shadow: 0 7px 18px rgba(0, 0, 0, 0.2) !important;
}

html.warm-site #saveImageBtn:hover,
html.warm-site #recordGifBtn:hover,
html.warm-site .small.blue.button:not(#reduce1):not(#plus1):not(#reduce3):not(#plus3):not([id^="reduce"]):not([id^="plus"]):hover,
html.warm-site button.small.blue.button:not([style*="background-image"]):hover {
    background: linear-gradient(135deg, #218da0, #17667a) !important;
    border-color: rgba(72, 232, 224, 0.65) !important;
    color: #ffffff !important;
}

html.warm-site #reduce1,
html.warm-site #plus1,
html.warm-site #reduce3,
html.warm-site #plus3,
html.warm-site button.small.blue.button[id^="reduce"],
html.warm-site button.small.blue.button[id^="plus"] {
    min-height: 0;
    background-color: transparent !important;
    box-shadow: none !important;
}

html.warm-site #xzlq,
html.warm-site #repeatSelect,
html.warm-site select {
    min-height: 36px;
    border-radius: 8px !important;
    background: #0d2639 !important;
    border: 1px solid var(--md-line) !important;
    color: var(--md-text) !important;
    padding: 5px 9px;
}

html.warm-site #xzlq option,
html.warm-site #repeatSelect option,
html.warm-site select option {
    background: #0d2639 !important;
    color: var(--md-text) !important;
}

html.warm-site canvas {
    border-radius: 8px;
}

html.warm-site video {
    background: #02070c !important;
    border: 1px solid var(--md-line);
    border-radius: 10px;
}

html.warm-site .loading-mask {
    background: rgba(3, 10, 17, 0.84) !important;
    color: var(--md-text) !important;
    backdrop-filter: blur(4px);
}

/* Embedded hit-rate statistics */
.stats-embed {
    color: var(--md-text) !important;
    border: 1px solid var(--md-line) !important;
    background:
        linear-gradient(135deg, rgba(75, 140, 255, 0.07), transparent 40%),
        linear-gradient(180deg, rgba(14, 34, 53, 0.98), rgba(8, 24, 39, 0.98)) !important;
    box-shadow: var(--md-shadow-soft) !important;
}

.stats-embed h2,
.stats-embed h3,
.stats-embed .dist-row-2col .dist-col-half h4,
.stats-embed .detail-wrap th,
.stats-embed .load-more-btn {
    color: var(--md-cyan) !important;
}

.stats-embed h4,
.stats-embed .cold-hot-col h4,
.stats-embed .dist-bar-val,
.stats-embed .tool-item,
.stats-embed .detail-wrap td {
    color: var(--md-text) !important;
}

.stats-embed .info-bar,
.stats-embed .cold-hot-col,
.stats-embed .stat-item,
.stats-embed .section-panel,
.stats-embed .dist-row-2col .dist-col-half,
.stats-embed .tool-item,
.stats-embed .detail-wrap table,
.stats-embed .load-more-btn {
    background: rgba(9, 28, 45, 0.86) !important;
    border-color: var(--md-line) !important;
}

.stats-embed .info-bar,
.stats-embed .stat-item .lbl,
.stats-embed .dist-label,
.stats-embed .tool-item p,
.stats-embed .loading {
    color: var(--md-muted) !important;
}

.stats-embed .stat-item .num {
    color: var(--md-cyan) !important;
    font-variant-numeric: tabular-nums;
}

.stats-embed .stat-item .hit {
    color: var(--md-red) !important;
}

.stats-embed .tool-item h3 {
    color: var(--md-gold) !important;
}

.stats-embed .tool-item:hover,
.stats-embed .tool-item.active {
    background: rgba(17, 66, 78, 0.9) !important;
    border-color: var(--md-line-strong) !important;
}

.stats-embed .dist-bar-bg,
.stats-embed .loading-progress-wrap {
    background: rgba(134, 165, 184, 0.13) !important;
}

.stats-embed .dist-bar-fill,
.stats-embed .loading-progress-fill {
    background: linear-gradient(180deg, #63f0e8, #247d91) !important;
}

.stats-embed .detail-wrap th {
    background: rgba(18, 67, 80, 0.94) !important;
}

.stats-embed .detail-wrap td {
    background: rgba(9, 28, 45, 0.82) !important;
    border-color: rgba(91, 150, 190, 0.22) !important;
}

.stats-embed .validation-note {
    background: rgba(72, 232, 224, 0.07) !important;
    border-left-color: var(--md-cyan) !important;
    color: #a9c6d5 !important;
}

.stats-embed .ball {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 4px 10px rgba(0, 0, 0, 0.24);
}

/* Keep the prediction lab in the same shared palette without changing its layout. */
.lab-shell {
    --lab-bg: var(--md-bg);
    --lab-panel: var(--md-surface);
    --lab-panel-2: var(--md-surface-2);
    --lab-line: #1b425c;
    --lab-cyan: var(--md-cyan);
    --lab-blue: var(--md-blue);
    --lab-red: var(--md-red);
    --lab-gold: var(--md-gold);
    --lab-text: var(--md-text);
    --lab-muted: var(--md-muted);
}

/* Keep the four primary home actions in a stable 2 x 2 grid. */
body.warm-home .hero-card-actions {
    flex: 0 1 304px;
    align-self: center;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: min(304px, 46%);
    max-width: 46%;
    min-width: 260px;
    padding: 0;
}

body.warm-home .hero-card-actions .panel-share-hint {
    grid-column: 1 / -1;
}

body.warm-home .hero-card-actions .hero-more-btn,
body.warm-home .hero-card-actions .share-btn {
    width: 100%;
    min-width: 0;
    justify-content: center;
    white-space: nowrap;
}

@media (max-width: 767.98px) {
    body.warm-home .hero-card-actions {
        width: 100%;
        max-width: none;
        min-width: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (max-width: 620px) {
    body.warm-home .hero-card-actions {
        width: 100%;
        max-width: none;
        min-width: 0;
    }

    body.warm-home .hero,
    body.warm-home .embed-card,
    html.warm-site body.warm-portal .page-container,
    html.warm-site #captureArea,
    .stats-embed {
        border-radius: 12px !important;
    }

    body.warm-home .hero-panel,
    body.warm-home .cold-hot-col,
    body.warm-home .more-section,
    body.warm-home .group-section,
    html.warm-site .recommend-list,
    html.warm-site .rec-section {
        border-radius: 9px !important;
    }
}
