/* ============ 预测页 · yu28.top 复刻风格 ============ */

/* 主题变量：浅色（white/blue 主题）与深色（dark 主题） */
body.page-predict {
    --y28-bg: #f7f9fc;
    --y28-fg: #0f1b2d;
    --y28-card: #ffffff;
    --y28-muted: #eef2f7;
    --y28-muted-fg: #5a6b82;
    --y28-border: #d8e0eb;
    --y28-primary: #1565c0;
    --y28-accent: #e3effc;
    --y28-dt-dragon: #e53935;
    --y28-dt-tiger: #1976d2;
    --y28-dt-tie: #8e24aa;
    --y28-primary-25: rgba(21, 101, 192, .25);
    --y28-shadow: 0 1px 2px rgba(15, 27, 45, .06);
    --y28-sum-bg: #1565c0;
    --y28-sum-fg: #ffffff;
}
html.theme-dark body.page-predict {
    --y28-bg: #0b1220;
    --y28-fg: #e8eef7;
    --y28-card: #121a2b;
    --y28-muted: #1a2438;
    --y28-muted-fg: #9aabc4;
    --y28-border: rgba(255, 255, 255, .12);
    --y28-primary: #1e88e5;
    --y28-accent: #1a2f4d;
    --y28-dt-dragon: #e53935;
    --y28-dt-tiger: #1e88e5;
    --y28-dt-tie: #ab47bc;
    --y28-primary-25: rgba(30, 136, 229, .25);
    --y28-shadow: 0 1px 2px rgba(0, 0, 0, .35);
    --y28-sum-bg: #5ea3ee;
    --y28-sum-fg: #0b1a30;
}
html.theme-blue body.page-predict {
    --y28-bg: #0a1628;
    --y28-fg: #e0f2fe;
    --y28-card: #10233d;
    --y28-muted: #162e4b;
    --y28-muted-fg: #8fb3d9;
    --y28-border: rgba(125, 190, 255, .16);
    --y28-primary: #0ea5e9;
    --y28-accent: #0d2038;
    --y28-dt-dragon: #e53935;
    --y28-dt-tiger: #2196f3;
    --y28-dt-tie: #ab47bc;
    --y28-primary-25: rgba(14, 165, 233, .25);
    --y28-shadow: 0 1px 2px rgba(0, 0, 0, .35);
    --y28-sum-bg: #38bdf8;
    --y28-sum-fg: #083344;
}

body.page-predict {
    background: var(--y28-bg);
    transition: background .3s ease, color .3s ease;
}
body.page-predict #bg-particles,
body.page-predict #bg-image,
body.page-predict .wm { display: none; }
body.page-predict .header-area { padding: 26px 0 4px; }
body.page-predict .page-title-main { font-size: 26px; letter-spacing: 1px; }
body.page-predict .page-sub { font-size: 12px; letter-spacing: 2px; }

.y28-banner { display: flex; flex-direction: column; gap: 14px; }

/* 双列面板：桌面并排，移动端堆叠 */
.y28-panels {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}
@media (min-width: 760px) {
    .y28-panels { grid-template-columns: minmax(13rem, .72fr) minmax(0, 1.28fr); align-items: stretch; }
}

/* 通用卡片 */
.y28-card {
    border: 1px solid var(--y28-border);
    border-radius: 12px;
    background: var(--y28-card);
    box-shadow: var(--y28-shadow);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    transition: background .3s ease, border-color .3s ease;
}

/* 倒计时卡 */
.y28-cd-card { border-color: var(--y28-primary-25); justify-content: space-between; }
.y28-cd-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; }
.y28-cd-label { display: inline-flex; align-items: center; gap: 6px; color: var(--y28-muted-fg); }
.y28-cd-label svg { width: 14px; height: 14px; color: var(--y28-primary); }
.y28-cd-nbr { color: var(--y28-muted-fg); font-variant-numeric: tabular-nums; white-space: nowrap; }
.y28-cd-nbr span { color: var(--y28-fg); font-weight: 700; }
.y28-cd-face { padding: 16px 0 12px; }
.y28-cd-face > span {
    font-size: 40px;
    font-weight: 600;
    line-height: 1;
    color: var(--y28-fg);
    font-variant-numeric: tabular-nums;
    letter-spacing: .5px;
}
@media (min-width: 760px) {
    .y28-cd-face > span { font-size: 34px; }
}
.y28-cd-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 11px; color: var(--y28-muted-fg); }
.y28-cd-open { font-variant-numeric: tabular-nums; white-space: nowrap; }
.y28-cd-bar {
    margin-top: 12px;
    height: 6px;
    border-radius: 999px;
    background: var(--y28-border);
    overflow: hidden;
}
.y28-cd-fill {
    height: 100%;
    width: 0%;
    border-radius: inherit;
    background: var(--y28-primary);
    transition: width .25s linear;
}

/* 最新开奖卡 */
.y28-lt-card { justify-content: space-between; container-type: inline-size; grid-column: 1 / -1; }
.y28-cd-card { grid-column: 1 / -1; }
.y28-lt-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.y28-lt-head h2 { font-size: 15px; font-weight: 600; color: var(--y28-fg); letter-spacing: .2px; margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.y28-lt-time { font-size: 12px; font-weight: 400; color: var(--y28-muted-fg); margin-left: 8px; font-variant-numeric: tabular-nums; }
.y28-lt-extra {
    flex-shrink: 0;
    font-size: 11px;
    color: var(--y28-muted-fg);
    border: 1px solid var(--y28-border);
    border-radius: 8px;
    padding: 4px 10px;
    background: var(--y28-muted);
}
.y28-lt-extra.y28-lt-mimi-btn {
    color: #fff;
    background: var(--y28-sum-bg, #1e56d8);
    border-color: transparent;
    cursor: pointer;
    font-weight: 600;
    transition: filter .2s ease;
}
.y28-lt-extra.y28-lt-mimi-btn:hover { filter: brightness(1.1); }
.y28-lt-extra.y28-lt-mimi-btn:active { transform: translateY(1px); }
.y28-lt-extra.y28-lt-mimi-btn:disabled { opacity: .55; cursor: default; filter: none; transform: none; }
.y28-lt-body { display: flex; flex-direction: column; align-items: stretch; gap: 14px; padding-top: 16px; flex: 1; }
@media (max-width: 380px) { .y28-lt-body { gap: 12px; } }

/* 咪牌数字球 */
.y28-strip { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: nowrap; }
.y28-strip-empty { min-height: 44px; align-items: center; font-size: 15px; font-weight: 600; color: var(--y28-muted-fg); }
.y28-ball {
    width: 36px; height: 36px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--y28-border);
    background: var(--y28-muted);
    color: var(--y28-fg);
    font-size: 16px; font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    flex-shrink: 0;
}
.y28-op { color: var(--y28-muted-fg); font-size: 16px; font-weight: 600; flex-shrink: 0; }
.y28-ball.y28-sum { background: var(--y28-sum-bg, var(--y28-primary)); color: var(--y28-sum-fg, #fff); border-color: transparent; }

@container (min-width: 400px) {
    .y28-ball { width: 46px; height: 46px; font-size: 20px; }
    .y28-op { font-size: 19px; }
}
@container (min-width: 500px) {
    .y28-ball { width: 58px; height: 58px; font-size: 26px; }
    .y28-op { font-size: 23px; }
}
@container (min-width: 620px) {
    .y28-ball { width: 70px; height: 70px; font-size: 32px; }
    .y28-op { font-size: 27px; }
}
@container (min-width: 900px) {
    .y28-ball { width: 82px; height: 82px; font-size: 38px; }
    .y28-op { font-size: 32px; }
}

/* 咪牌刮奖 */
.y28-scratch { position: relative; border-radius: 12px; }
.y28-scratch-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    touch-action: none;
    cursor: pointer;
    z-index: 5;
}
.y28-scratch.y28-opened .y28-ball { animation: y28-ball-in .55s ease; }
@keyframes y28-ball-in {
    from { transform: scale(.6); opacity: .15; }
    to { transform: scale(1); opacity: 1; }
}

/* 彩色 chip */
.y28-chip {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 28px; padding: 3px 10px;
    border-radius: 999px;
    color: #fff !important;
    font-size: 12px; font-weight: 600;
    line-height: 1.6;
}
.y28-chip-dragon { background: var(--y28-dt-dragon); }
.y28-chip-tiger { background: var(--y28-dt-tiger); }
.y28-chip-tie { background: var(--y28-dt-tie); }

/* 软标签（形态/位置/极值） */
.y28-soft {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.6;
}
body.page-predict .y28-pat-za { color: #2e7d32; background: rgba(67, 160, 71, .14); }
body.page-predict .y28-pat-dui { color: #bf360c; background: rgba(249, 168, 37, .16); }
body.page-predict .y28-pat-shun { color: #6a1b9a; background: rgba(142, 36, 170, .14); }
body.page-predict .y28-pat-baozi { color: #c62828; background: rgba(229, 57, 53, .14); }
body.page-predict .y28-pat-ban { color: #00695c; background: rgba(0, 137, 123, .14); }
body.page-predict .y28-loc-da { color: #c62828; background: rgba(229, 57, 53, .14); }
body.page-predict .y28-loc-xiao { color: #1565c0; background: rgba(30, 136, 229, .14); }
body.page-predict .y28-loc-zhong { color: var(--y28-muted-fg); background: var(--y28-muted); }
body.page-predict .y28-ext-da { color: #c62828; background: rgba(229, 57, 53, .14); }
body.page-predict .y28-ext-xiao { color: #1565c0; background: rgba(30, 136, 229, .14); }
html.theme-dark body.page-predict .y28-pat-za,
html.theme-blue body.page-predict .y28-pat-za { color: #a5d6a7; background: rgba(102, 187, 106, .22); }
html.theme-dark body.page-predict .y28-pat-dui,
html.theme-blue body.page-predict .y28-pat-dui { color: #ffe082; background: rgba(249, 168, 37, .24); }
html.theme-dark body.page-predict .y28-pat-shun,
html.theme-blue body.page-predict .y28-pat-shun { color: #ce93d8; background: rgba(206, 147, 216, .22); }
html.theme-dark body.page-predict .y28-pat-baozi,
html.theme-blue body.page-predict .y28-pat-baozi { color: #ef9a9a; background: rgba(239, 83, 80, .22); }
html.theme-dark body.page-predict .y28-pat-ban,
html.theme-blue body.page-predict .y28-pat-ban { color: #80cbc4; background: rgba(38, 166, 154, .22); }
html.theme-dark body.page-predict .y28-loc-da,
html.theme-blue body.page-predict .y28-loc-da { color: #ef9a9a; background: rgba(239, 83, 80, .22); }
html.theme-dark body.page-predict .y28-loc-xiao,
html.theme-blue body.page-predict .y28-loc-xiao { color: #90caf9; background: rgba(66, 165, 245, .22); }
html.theme-dark body.page-predict .y28-ext-da,
html.theme-blue body.page-predict .y28-ext-da { color: #ef9a9a; background: rgba(239, 83, 80, .22); }
html.theme-dark body.page-predict .y28-ext-xiao,
html.theme-blue body.page-predict .y28-ext-xiao { color: #90caf9; background: rgba(66, 165, 245, .22); }
.y28-mute { color: var(--y28-muted-fg); }

/* 下期预测卡 */
.y28-predict-head { font-size: 14px; font-weight: 600; color: var(--y28-fg); margin-bottom: 12px; }
.y28-predict-nbr { font-size: 12px; font-weight: 400; color: var(--y28-muted-fg); margin-left: 6px; font-variant-numeric: tabular-nums; }
.y28-predict-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (max-width: 420px) { .y28-predict-grid { grid-template-columns: repeat(2, 1fr); } }
.y28-predict-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 4px;
    border-radius: 10px;
    background: var(--y28-muted);
}
.y28-predict-label { font-size: 11px; color: var(--y28-muted-fg); }
.y28-predict-val { font-size: 15px; font-weight: 800; color: var(--y28-primary); }

/* 历史表格 */
.y28-hist-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--y28-border); border-radius: 12px; background: var(--y28-card); box-shadow: var(--y28-shadow); }
.y28-table { width: 100%; min-width: 30rem; border-collapse: collapse; font-size: 13px; }
.y28-table thead th {
    border-bottom: 1px solid var(--y28-border);
    background: var(--y28-muted);
    padding: 10px 12px;
    text-align: left;
    color: var(--y28-muted-fg);
    font-weight: 600;
    font-size: 12px;
    white-space: nowrap;
    position: sticky;
    top: 0;
}
.y28-table tbody td {
    border-bottom: 1px solid var(--y28-border);
    padding: 10px 12px;
    color: var(--y28-fg);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.y28-table tbody tr:last-child td { border-bottom: none; }
.y28-table tbody tr:nth-child(2n) { background: var(--y28-muted); }
.y28-table tbody tr:hover { background: var(--y28-accent); }
.y28-nbr { font-weight: 700; }
.y28-time { color: var(--y28-muted-fg); }

/* 号码算式 */
.y28-eq { display: inline-flex; align-items: baseline; gap: 2px; white-space: nowrap; }
.y28-digit { font-weight: 600; }
.y28-eqop { color: var(--y28-muted-fg); font-weight: 500; margin: 0 1px; }
.y28-eqsum { color: var(--y28-primary); font-weight: 700; }

/* 表格号码眯牌（点击咪牌按钮后眯第一行） */
.y28-nums { position: relative; }
.y28-nums.y28-nums-coat { cursor: pointer; }
.y28-nums.y28-nums-coat::after {
    content: '';
    position: absolute;
    inset: 2px -3px;
    border-radius: 6px;
    background: linear-gradient(135deg, #8f99a7, #c6cdd8 45%, #97a1af);
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, .55), inset 0 -1px 2px rgba(60, 70, 85, .35);
    z-index: 1;
}
.y28-nums.y28-nums-coat::before {
    content: '眯牌';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(45, 56, 72, .72);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    z-index: 2;
    pointer-events: none;
}
.y28-nums.y28-nums-coat:hover::after { filter: brightness(1.07); }
.y28-nums.y28-nums-coat:active::after { filter: brightness(.92); }
.y28-nums .y28-eq { transition: opacity .3s ease; }
.y28-nums.y28-nums-coat .y28-eq { opacity: 0; }

/* 移动端隐藏桌面列 */
.y28-desk { display: table-cell; }
@media (max-width: 768px) {
    .y28-desk { display: none; }
    .y28-table { min-width: 22rem; }
}

.y28-hist-scroll::-webkit-scrollbar { height: 6px; }
.y28-hist-scroll::-webkit-scrollbar-thumb { background: var(--y28-border); border-radius: 3px; }

.predict-foot { text-align: center; font-size: 11px; color: var(--y28-muted-fg); padding-top: 2px; }
.predict-empty { color: var(--y28-muted-fg); font-size: 13px; text-align: center; padding: 24px 0; }
.predict-loading {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 120;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 170px;
    padding: 16px 22px;
    border-radius: 12px;
    border: 1px solid var(--y28-border);
    background: var(--y28-card);
    box-shadow: var(--y28-shadow), 0 10px 30px rgba(0, 0, 0, .4), 0 2px 6px rgba(0, 0, 0, .3);
    color: var(--y28-fg);
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}
.predict-loading::before {
    content: '';
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 2px solid var(--y28-primary);
    border-top-color: transparent;
    animation: y28-spin .8s linear infinite;
}
@keyframes y28-spin {
    to { transform: rotate(360deg); }
}
.predict-err { color: #ef6b6b; font-size: 12px; text-align: center; padding: 4px 0 12px; word-break: break-all; }
