* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --accent: #0a84ff;
    --accent-light: #64d2ff;
    --accent-deep: #0055d4;
    --accent-soft: rgba(10, 132, 255, .1);
    --accent-grad: linear-gradient(135deg, #0a84ff 0%, #5e5ce6 100%);

    --bg-body: #f2f4f8;
    --glass: rgba(255, 255, 255, .68);
    --glass-strong: rgba(255, 255, 255, .85);
    --glass-border: rgba(255, 255, 255, .55);
    --hairline: rgba(70, 90, 130, .1);
    --shadow: 0 10px 30px rgba(15, 40, 80, .08), 0 1px 3px rgba(15, 40, 80, .04);
    --shadow-lg: 0 18px 44px rgba(15, 40, 80, .12), 0 2px 6px rgba(15, 40, 80, .05);
    --inner-highlight: inset 0 1.5px 0 rgba(255, 255, 255, .95);

    --text-main: #1c1c1e;
    --text-sub: #6e6e73;

    --ios-red: #ff3b30;
    --ios-blue: #007aff;
    --ios-green: #34c759;
    --ios-orange: #ff9500;
    --ios-cyan: #32ade6;
    --ios-purple: #af52de;
    --ios-pink: #ff2d55;
    --ios-yellow: #ffcc00;
    --ios-gray: #8e8e93;

    --radius: 20px;
    --radius-sm: 14px;
}

::selection {
    background: rgba(10, 132, 255, .22);
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(120, 150, 190, .35);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(120, 150, 190, .55); }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    background: #f2f4f8;
    color: var(--text-main);
    font-size: 14px;
    line-height: 1.55;
    min-height: 100vh;
    letter-spacing: -0.005em;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(640px 440px at 90% -8%, rgba(94, 92, 230, .20), transparent 62%),
        radial-gradient(760px 540px at -14% 26%, rgba(10, 132, 255, .14), transparent 62%),
        radial-gradient(560px 460px at 78% 108%, rgba(255, 55, 95, .07), transparent 62%),
        radial-gradient(480px 380px at 30% 60%, rgba(100, 210, 255, .10), transparent 62%),
        linear-gradient(180deg, #f0f3f9 0%, #f7f9fc 50%, #f1f4f9 100%);
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
}

img {
    max-width: 100%;
    display: block;
}

.header,
.results-table,
.algo-card-mini,
.missed-chart-container,
.opened-stats-container,
.plan-section,
.footer,
.star-banner,
.sum-calculator,
.next-draw,
.hc-item,
.seo-block,
.modal-box {
    -webkit-backdrop-filter: blur(20px) saturate(1.8);
    backdrop-filter: blur(20px) saturate(1.8);
}

.container-fluid {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 10px;
}

.container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 10px 24px;
}

.top-strip {
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 18px rgba(10, 90, 180, .2);
}

.ticker {
    background: linear-gradient(90deg, #0a84ff 0%, #5e5ce6 50%, #0a84ff 100%);
    overflow: hidden;
    line-height: 28px;
    height: 28px;
}

.ticker-track {
    display: inline-flex;
    white-space: nowrap;
    animation: ticker-scroll 25s linear infinite;
    will-change: transform;
}

.ticker-track span {
    display: inline-block;
    padding-right: 40px;
    color: #fff;
    font-size: 12px;
    letter-spacing: .5px;
    text-shadow: 0 1px 3px rgba(0, 40, 100, .25);
}

.ticker-track span::after {
    content: attr(data-text);
    padding-left: 40px;
}

.ticker:hover .ticker-track {
    animation-play-state: paused;
}

@keyframes ticker-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

.star-banner {
    margin: 5px 0 0;
    border-radius: 0;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
    position: relative;
}

.star-banner-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 0;
    overflow: hidden;
}

.star-banner.is-closed { display: none; }

.ad-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 56px;
    border-radius: var(--radius);
    overflow: hidden;
    background: repeating-linear-gradient(45deg, rgba(255,255,255,.5) 0 14px, rgba(240,242,247,.5) 14px 28px);
    color: var(--text-sub);
    font-size: 12px;
    letter-spacing: 2px;
}

#back-top {
    position: fixed;
    left: 10px;
    bottom: 16px;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 26px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: 999px;
    background: rgba(255, 255, 255, .5);
    backdrop-filter: blur(10px) saturate(1.6);
    -webkit-backdrop-filter: blur(10px) saturate(1.6);
    color: rgba(120, 120, 128, .95);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(15, 40, 80, .1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity .25s, transform .25s, visibility .25s;
    -webkit-tap-highlight-color: transparent;
}

#back-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.header {
    margin-top: 5px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 12px 14px 6px;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 9px;
    border-bottom: 1px solid var(--hairline);
}

.update-line {
    font-size: 12px;
    color: var(--text-sub);
    padding: 2px 0 0 10px;
}

.update-line time { font-variant-numeric: tabular-nums; }

.section-h2 {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-main);
    position: relative;
    padding-left: 12px;
    margin: 10px 14px 8px;
    letter-spacing: -0.01em;
}

.section-h2::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 15px;
    border-radius: 2px;
    background: var(--accent-grad);
    box-shadow: 0 2px 6px rgba(10, 132, 255, .35);
}

.header-top .section-h2 { margin-left: 2px; }
.missed-chart-header .section-h2 { margin-left: 2px; }
.opened-stats-header .section-h2 { margin-left: 2px; }

.section-sub {
    font-size: 12px;
    color: var(--text-sub);
}

.controls button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    font-size: 12px;
    color: var(--accent);
    background: var(--accent-soft);
    border-radius: 20px;
    transition: opacity .15s;
}

.controls button:hover { opacity: .75; }

#mp-close { display: inline; }
#mp-open  { display: none; }
#peek-btn.peeking #mp-close { display: none; }
#peek-btn.peeking #mp-open  { display: inline; }

.header-middle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 14px 0;
    position: relative;
}

.next-draw {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    text-align: center;
    align-self: center;
    width: auto;
    max-width: 100%;
    background: var(--glass-strong);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow), var(--inner-highlight);
    padding: 10px 22px;
}

.countdown-label {
    display: block;
    width: 100%;
    font-size: 12px;
    color: var(--text-sub);
}

.countdown-label h3 {
    font-size: 14px;
    color: var(--text-main);
    letter-spacing: -0.01em;
}

.countdown-label strong {
    color: var(--accent-deep);
}

.countdown-caption {
    display: block;
    width: 100%;
    font-size: 12px;
    color: var(--text-sub);
}

.countdown-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--ios-blue);
}

.countdown-inner input {
    background: rgba(255, 255, 255, .92);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-sm);
    color: var(--accent);
    font-size: 16px;
    font-weight: 800;
    text-align: center;
    padding: 6px 12px;
    width: 160px;
    letter-spacing: 1px;
    box-shadow: var(--inner-highlight), 0 2px 8px rgba(15, 40, 80, .06);
    font-variant-numeric: tabular-nums;
}

.sum-calculator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 700;
    flex-wrap: nowrap;
    overflow-x: auto;
    position: relative;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px 18px;
}

.sum-calculator > span {
    color: var(--text-sub);
    flex: none;
    font-size: 24px;
    font-weight: 600;
}

.mi-panel {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    display: none;
    z-index: 5;
}

.mi-panel .scratch-canvas {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: var(--radius-sm);
    cursor: pointer;
    touch-action: none;
}

.sum-item {
    min-width: 54px;
    height: 54px;
    line-height: 54px;
    text-align: center;
    border-radius: 50%;
    background: linear-gradient(180deg, #ffffff 0%, #f0f3f9 100%);
    border: 1px solid rgba(255, 255, 255, .9);
    color: var(--text-main);
    font-size: 24px;
    font-weight: 800;
    padding: 0 6px;
    flex: none;
    text-shadow: 0 2px 6px rgba(20, 40, 80, .16);
    box-shadow: 0 8px 20px rgba(20, 50, 100, .14), var(--inner-highlight);
}

.sum-item.result {
    background: linear-gradient(135deg, #ff9f0a 0%, #ff453a 100%);
    color: #fff;
    border: none;
    text-shadow: 0 2px 8px rgba(120, 20, 0, .4);
    box-shadow: 0 10px 24px rgba(255, 80, 40, .32), inset 0 1.5px 0 rgba(255, 255, 255, .45);
}

.sum-item.border-radius-20 {
    border-radius: 15px;
    min-width: 52px;
    height: 48px;
    line-height: 48px;
    padding: 0 14px;
    color: #fff;
    border: none;
    font-size: 22px;
    text-shadow: 0 1px 5px rgba(0, 0, 0, .3);
    box-shadow: 0 6px 16px rgba(20, 50, 100, .18), inset 0 1.5px 0 rgba(255, 255, 255, .4);
}

.stats-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 0;
}

.stats-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
}

.help-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-grad);
    color: #fff;
    font-size: 12px;
    cursor: help;
    box-shadow: 0 3px 8px rgba(10, 132, 255, .3), inset 0 1px 0 rgba(255, 255, 255, .4);
}

.help-icon .tooltip {
    display: none;
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(320px, calc(100vw - 48px));
    max-height: 70vh;
    overflow-y: auto;
    background: var(--glass-strong);
    -webkit-backdrop-filter: blur(20px) saturate(1.8);
    backdrop-filter: blur(20px) saturate(1.8);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 14px;
    font-size: 12px;
    line-height: 1.7;
    color: var(--text-sub);
    z-index: 1001;
    box-shadow: var(--shadow-lg);
}

.help-icon:hover .tooltip,
.help-icon.show-tip .tooltip {
    display: block;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding-bottom: 8px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 7px;
    background: var(--glass-strong);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 8px;
    box-shadow: 0 3px 10px rgba(15, 40, 80, .06), var(--inner-highlight);
}

.stat-left {
    min-width: 38px;
    height: 38px;
    line-height: 38px;
    text-align: center;
    border-radius: 11px;
    background: linear-gradient(135deg, #af52de 0%, #bf5af2 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    text-shadow: 0 1px 4px rgba(60, 0, 90, .35);
    box-shadow: 0 4px 10px rgba(160, 60, 220, .3), inset 0 1.5px 0 rgba(255, 255, 255, .4);
}

.stat-right {
    display: flex;
    flex-direction: column;
    font-size: 12px;
    color: var(--text-sub);
}

.hotcold-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin: 8px 0 4px;
}

.hc-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 8px 10px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
}

.hc-label {
    font-size: 12px;
    color: var(--text-sub);
}

.hc-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
    font-variant-numeric: tabular-nums;
}

.hc-value.hc-hot { color: var(--ios-red); }
.hc-value.hc-cold { color: var(--ios-blue, #007aff); }

.backtest-info {
    margin: 10px 0;
    padding: 9px 12px;
    font-size: 12px;
    line-height: 1.7;
    color: var(--text-sub);
    background: var(--accent-soft);
    border: 1px solid rgba(10, 132, 255, .16);
    border-radius: var(--radius-sm);
}

.backtest-info strong { color: var(--text-main); }

.sub-tabs {
    display: flex;
    gap: 6px;
    padding: 8px 0 6px;
    border-top: 1px solid var(--hairline);
}

.sub-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 2px;
    font-size: 12px;
    color: var(--text-sub);
    background: var(--glass-strong);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    transition: all .15s;
    box-shadow: 0 2px 6px rgba(15, 40, 80, .05);
}

.sub-tab i {
    font-style: normal;
}

.sub-tab.active {
    background: var(--accent-grad);
    color: #fff;
    border-color: transparent;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(10, 132, 255, .3), inset 0 1.5px 0 rgba(255, 255, 255, .35);
}

.results-table {
    margin-top: 10px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.results-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    table-layout: auto;
}

.results-table th,
.results-table td {
    padding: 6px 6px;
    text-align: center;
    border-bottom: 1px solid var(--hairline);
}

.results-table thead th {
    background: var(--glass-strong);
    color: var(--text-sub);
    font-weight: 700;
    font-size: 12px;
}

.results-table tbody tr:hover {
    background: rgba(10, 132, 255, .04);
}

.results-table tbody tr:last-child td {
    border-bottom: none;
}

.history-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--hairline);
    flex-wrap: wrap;
}

.display-modes {
    display: flex;
    gap: 5px;
}

.mode-btn {
    padding: 5px 12px;
    font-size: 12px;
    color: var(--text-sub);
    background: var(--glass-strong);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    transition: all .15s;
}

.mode-btn.active {
    background: var(--ios-blue);
    color: #fff;
    border-color: transparent;
    font-weight: 700;
    box-shadow: 0 3px 10px rgba(0, 122, 255, .3), inset 0 1.5px 0 rgba(255, 255, 255, .35);
}

.history-right {
    display: flex;
    align-items: center;
    gap: 5px;
}

.period-select {
    background: var(--glass-strong);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    color: var(--text-main);
    font-size: 12px;
    padding: 5px 8px;
    color-scheme: light;
}

.refresh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    color: #fff;
    background: linear-gradient(135deg, #34c759 0%, #28a745 100%);
    border-radius: 50%;
    transition: opacity .15s;
    box-shadow: 0 3px 10px rgba(40, 167, 69, .32), inset 0 1.5px 0 rgba(255, 255, 255, .4);
}

.refresh-btn:hover { opacity: .85; }
.refresh-btn:active { transform: scale(.95); }

.refresh-btn.spinning svg {
    animation: refresh-spin .9s linear infinite;
}

@keyframes refresh-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.number-tag {
    display: inline-block;
    min-width: 22px;
    height: 22px;
    line-height: 22px;
    padding: 0 4px;
    text-align: center;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    margin: 1px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .22);
    box-shadow: inset 0 -2px 4px rgba(0, 0, 0, .14), 0 2px 6px rgba(43, 78, 130, .14), inset 0 1px 0 rgba(255, 255, 255, .35);
}

.border-radius-20 { border-radius: 14px; }
.background-red   { background: linear-gradient(135deg, #ff453a 0%, #e02d22 100%); }
.background-blue  { background: linear-gradient(135deg, #0a84ff 0%, #0066d6 100%); }
.result-lan       { background: linear-gradient(135deg, #32ade6 0%, #1e90d6 100%); }
.result-hong      { background: linear-gradient(135deg, #ff6482 0%, #ff2d55 100%); }
.result-lv        { background: linear-gradient(135deg, #34c759 0%, #28a745 100%); }
.result-cheng     { background: linear-gradient(135deg, #ff9f0a 0%, #ff8a00 100%); }
.result-dhong     { background: linear-gradient(135deg, #ff5aa9 0%, #f0307d 100%); }

.text-red  { color: var(--ios-red); font-weight: 700; }
.text-blue { color: var(--ios-blue); font-weight: 700; }
.text-pink { color: var(--ios-pink); font-weight: 700; }

.icon-dui,
.icon-cuo {
    display: inline-block;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    position: relative;
    vertical-align: middle;
    box-shadow: 0 2px 6px rgba(15, 40, 80, .18), inset 0 1px 0 rgba(255, 255, 255, .4);
}

.icon-dui { background: linear-gradient(135deg, #34c759 0%, #28a745 100%); }
.icon-cuo { background: linear-gradient(135deg, #ff453a 0%, #e02d22 100%); }

.icon-dui::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 4px;
    width: 9px;
    height: 5px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg);
}

.icon-cuo::before,
.icon-cuo::after {
    content: "";
    position: absolute;
    left: 3px;
    top: 8px;
    width: 12px;
    height: 2px;
    background: #fff;
}

.icon-cuo::before { transform: rotate(45deg); }
.icon-cuo::after  { transform: rotate(-45deg); }

.mask-row-bar {
    background: repeating-linear-gradient(45deg, rgba(120,130,150,.12) 0 10px, rgba(120,130,150,.06) 10px 20px);
    border: 1px dashed rgba(60,60,67,.2);
    border-radius: var(--radius-sm);
    color: var(--text-sub);
    font-size: 12px;
    padding: 5px 0;
    letter-spacing: 2px;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    padding: 10px 0;
}

.pagination button {
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    border-radius: var(--radius-sm);
    background: var(--glass-strong);
    border: 1px solid var(--glass-border);
    color: var(--text-sub);
    font-size: 12px;
    transition: all .15s;
}

.pagination button:hover { color: var(--text-main); }

.pagination button.active {
    background: var(--ios-blue);
    color: #fff;
    border-color: transparent;
    font-weight: 700;
    box-shadow: 0 3px 10px rgba(0, 122, 255, .3);
}

.predict-container {
    margin-top: 10px;
    display: none;
}

.predict-menu {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}

.predict-menu-item {
    flex: 1;
    padding: 8px 0;
    font-size: 12px;
    color: var(--text-sub);
    background: var(--glass-strong);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    transition: all .15s;
    box-shadow: 0 2px 6px rgba(15, 40, 80, .05);
}

.predict-menu-item.active {
    background: var(--ios-blue);
    color: #fff;
    font-weight: 700;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(0, 122, 255, .3), inset 0 1.5px 0 rgba(255, 255, 255, .35);
}

.algorithms-display {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 8px;
}

.algo-card-mini {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 10px;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
}

.algo-card-mini:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.algo-header-mini {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.algo-name-mini {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
}

.algo-tag-mini {
    font-size: 12px;
    padding: 2px 7px;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
}

.algo-formula-mini {
    font-size: 12px;
    color: var(--text-sub);
    background: rgba(120, 130, 150, .1);
    border-radius: var(--radius-sm);
    padding: 5px 7px;
    margin-bottom: 6px;
    word-break: break-all;
}

.algo-stats-mini {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 3px;
    text-align: center;
}

.stat-label-mini {
    font-size: 12px;
    color: var(--text-sub);
}

.stat-value-mini {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-main);
}

.stat-value-mini.highlight { color: var(--ios-orange); }

.algorithms-display.is-peeking .algo-card-mini,
.stats-grid.is-peeking .stat-item {
    filter: blur(6px);
    pointer-events: none;
    user-select: none;
}

.missed-chart-container {
    margin-top: 10px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: none;
}

.missed-chart-header {
    padding: 10px 14px;
    border-bottom: 1px solid var(--hairline);
}

.missed-chart-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    padding-left: 10px;
    border-left: 4px solid var(--accent);
}

.missed-chart-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    padding: 10px;
}

.missed-chart-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--glass-strong);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 7px 9px;
    box-shadow: 0 2px 8px rgba(15, 40, 80, .05), var(--inner-highlight);
}

.missed-chart-left {
    min-width: 34px;
    height: 34px;
    line-height: 34px;
    text-align: center;
    border-radius: 10px;
    background: linear-gradient(135deg, #32ade6 0%, #5e5ce6 100%);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    text-shadow: 0 1px 4px rgba(0, 30, 90, .35);
    box-shadow: 0 3px 8px rgba(60, 100, 220, .28), inset 0 1.5px 0 rgba(255, 255, 255, .4);
}

.missed-chart-right {
    display: flex;
    flex-direction: column;
    font-size: 12px;
    color: var(--text-sub);
}

.opened-stats-container {
    margin-top: 10px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding-bottom: 6px;
    display: none;
}

.opened-stats-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--hairline);
    flex-wrap: wrap;
}

.opened-stats-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    padding-left: 10px;
    border-left: 4px solid var(--accent);
}

.stats-subtitle {
    font-size: 12px;
    color: var(--text-sub);
}

.header-date-picker {
    margin-left: auto;
    background: var(--glass-strong);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    padding: 4px 8px;
    font-size: 12px;
    color-scheme: light;
}

.stats-section {
    padding: 8px 14px 2px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 7px;
}

.title-icon {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 6px rgba(10, 132, 255, .55);
}

.stats-grid-2col { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.stats-grid-3col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.stats-grid-4col { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }

.stats-row {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--glass-strong);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 6px 9px;
    font-size: 12px;
    box-shadow: 0 2px 6px rgba(15, 40, 80, .05), var(--inner-highlight);
}

.type-tag {
    min-width: 32px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    border-radius: 10px;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 0 7px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .2);
    box-shadow: 0 2px 6px rgba(15, 40, 80, .12), inset 0 1px 0 rgba(255, 255, 255, .35);
}

.tag-blue        { background: linear-gradient(135deg, #0a84ff 0%, #0066d6 100%); }
.tag-red         { background: linear-gradient(135deg, #ff453a 0%, #e02d22 100%); }
.tag-green       { background: linear-gradient(135deg, #34c759 0%, #28a745 100%); }
.tag-orange      { background: linear-gradient(135deg, #ff9f0a 0%, #ff8a00 100%); }
.tag-cyan        { background: linear-gradient(135deg, #32ade6 0%, #1e90d6 100%); }
.tag-purple      { background: linear-gradient(135deg, #af52de 0%, #bf5af2 100%); }
.tag-gray        { background: linear-gradient(135deg, #aeaeb2 0%, #8e8e93 100%); }
.tag-light-green { background: linear-gradient(135deg, #b5d43c 0%, #a3c614 100%); }

.stats-value {
    color: var(--text-sub);
    font-size: 12px;
}

.plan-section {
    margin-top: 10px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.plan-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--hairline);
}

.plan-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
    padding-left: 10px;
    border-left: 4px solid var(--accent);
}

.plan-subtitle {
    font-size: 12px;
    color: var(--text-sub);
}

.plan-tabs {
    display: flex;
    gap: 6px;
    padding: 8px 10px;
    overflow-x: auto;
    border-bottom: 1px solid var(--hairline);
}

.plan-tab {
    flex-shrink: 0;
    padding: 6px 12px;
    font-size: 12px;
    color: var(--text-sub);
    background: var(--glass-strong);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    white-space: nowrap;
    transition: all .15s;
}

.plan-tab.active {
    background: var(--ios-blue);
    color: #fff;
    border-color: transparent;
    font-weight: 700;
    box-shadow: 0 3px 10px rgba(0, 122, 255, .3);
}

.plan-stats {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 6px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--hairline);
}

.plan-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    background: var(--glass-strong);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 6px 2px;
    box-shadow: 0 2px 6px rgba(15, 40, 80, .05), var(--inner-highlight);
}

.ps-label {
    font-size: 12px;
    color: var(--text-sub);
}

.ps-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
}

.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.plan-table {
    width: 100%;
    min-width: 780px;
    border-collapse: collapse;
    font-size: 12px;
}

.plan-table th,
.plan-table td {
    padding: 6px;
    text-align: center;
    border-bottom: 1px solid var(--hairline);
    white-space: nowrap;
}

.plan-table thead th {
    background: var(--glass-strong);
    color: var(--text-sub);
    font-weight: 700;
    font-size: 12px;
}

.plan-table tbody tr:last-child td {
    border-bottom: none;
}

.plan-periods {
    white-space: normal !important;
    min-width: 90px;
}

.plan-period {
    display: block;
    font-size: 12px;
    color: var(--text-sub);
    line-height: 1.6;
}

.plan-period.wait {
    color: var(--ios-orange);
}

.plan-result {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .2);
    box-shadow: 0 2px 6px rgba(15, 40, 80, .12), inset 0 1px 0 rgba(255, 255, 255, .3);
}

.plan-result.ongoing { background: linear-gradient(135deg, #0a84ff 0%, #0066d6 100%); }
.plan-result.hit     { background: linear-gradient(135deg, #34c759 0%, #28a745 100%); }
.plan-result.miss    { background: linear-gradient(135deg, #ff453a 0%, #e02d22 100%); }

.plan-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    flex-wrap: wrap;
}

.plan-pagination {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.pp-info {
    font-size: 12px;
    color: var(--text-sub);
    margin-right: 4px;
}

.pp-btn {
    min-width: 26px;
    height: 26px;
    padding: 0 6px;
    border-radius: 8px;
    background: var(--glass-strong);
    border: 1px solid var(--glass-border);
    color: var(--text-sub);
    font-size: 12px;
}

.pp-btn.active {
    background: var(--ios-blue);
    color: #fff;
    border-color: transparent;
    font-weight: 700;
    box-shadow: 0 3px 8px rgba(0, 122, 255, .3);
}

.pp-ellipsis {
    color: var(--text-sub);
    font-size: 12px;
}

.system-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--text-sub);
}

.system-status i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ios-green);
    box-shadow: 0 0 6px var(--ios-green);
}

.peek-section-mask {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(242, 244, 248, .8);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border-radius: var(--radius);
    color: var(--text-sub);
    font-size: 13px;
    letter-spacing: 3px;
    z-index: 20;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    border: 0;
    white-space: nowrap;
}

.seo-block {
    margin-top: 10px;
    background: var(--glass);
    -webkit-backdrop-filter: blur(20px) saturate(1.8);
    backdrop-filter: blur(20px) saturate(1.8);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.seo-body.seo-static {
    padding: 2px 16px 14px;
}

.seo-body.seo-static p {
    margin: 0 0 6px;
    font-size: 12.5px;
    line-height: 1.85;
    color: var(--text-sub);
    text-align: justify;
}

.seo-body.seo-static p strong {
    color: var(--text-main);
}

.seo-body p + p {
    margin-top: 6px;
}

.faq-answer {
    padding: 2px 14px 12px;
    font-size: 12.5px;
    color: var(--text-sub);
    line-height: 1.85;
    text-align: justify;
}

.faq-block {
    padding: 10px 10px 14px;
}

.faq-block .section-heading {
    position: relative;
    padding-left: 12px;
    margin: 4px 6px 12px;
    text-align: left;
    font-size: 16px;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.01em;
}

.faq-block .section-heading::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 15px;
    border-radius: 2px;
    background: var(--accent-grad);
    box-shadow: 0 2px 6px rgba(10, 132, 255, .35);
}

.faq-item {
    background: var(--glass-strong);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    margin: 0 4px 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(15, 40, 80, .05), var(--inner-highlight);
    transition: border-color .2s, box-shadow .2s;
}

.faq-item[open] {
    border-color: rgba(10, 132, 255, .3);
    box-shadow: 0 4px 14px rgba(10, 132, 255, .1), var(--inner-highlight);
}

.faq-item summary {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::before {
    content: "";
    flex: none;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}

.faq-item summary::after {
    content: "+";
    margin-left: auto;
    flex: none;
    width: 20px;
    height: 20px;
    line-height: 19px;
    text-align: center;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
    transition: transform .2s;
}

.faq-item[open] summary::after {
    transform: rotate(45deg);
}

.seo-block,
.footer {
    content-visibility: auto;
    contain-intrinsic-size: auto 320px;
}

.footer {
    margin-top: 12px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px;
}

.footer-top h3 {
    font-size: 13px;
    color: var(--text-main);
    margin-bottom: 7px;
}

.footer-middle {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.footer-item {
    background: var(--glass-strong);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 8px;
    text-align: center;
    font-size: 12px;
    color: var(--text-sub);
}

.footer-item img {
    width: 36px;
    height: 36px;
    margin: 0 auto 4px;
}

.footer-item p:first-of-type {
    color: var(--text-main);
    font-weight: 600;
    margin-bottom: 2px;
}

.footer-bottom .links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.footer-bottom .links a {
    font-size: 12px;
    color: var(--text-sub);
    padding: 6px 18px;
    border-radius: 999px;
    background: var(--glass-strong);
    border: 1px solid var(--glass-border);
    transition: all .18s;
    box-shadow: 0 2px 6px rgba(15, 40, 80, .05);
}

.footer-bottom .links a:hover {
    color: #fff;
    background: var(--accent-grad);
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(10, 132, 255, .3);
}

.footer-copyright {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--hairline);
    text-align: center;
    font-size: 12px;
    line-height: 1.8;
    color: var(--text-sub);
}

.footer-copyright a { color: var(--accent); }

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(20, 30, 45, .35);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.modal-overlay.show { display: flex; }

.modal-box {
    width: 100%;
    max-width: 340px;
    background: rgba(255, 255, 255, .82);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 20px;
    animation: modal-pop .18s ease;
}

@keyframes modal-pop {
    from { opacity: 0; transform: scale(.94) translateY(6px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-box h3 {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-main);
    padding-left: 10px;
    border-left: 4px solid var(--accent);
    margin-bottom: 10px;
}

.modal-box p {
    font-size: 12.5px;
    line-height: 1.9;
    color: var(--text-sub);
    margin-bottom: 16px;
}

.modal-close {
    display: block;
    margin: 0 auto;
    padding: 7px 28px;
    font-size: 12px;
    color: #fff;
    background: var(--accent-grad);
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: 2px;
    box-shadow: 0 4px 12px rgba(10, 132, 255, .3), inset 0 1.5px 0 rgba(255, 255, 255, .35);
}

.modal-close:active { transform: scale(.96); }

@media (max-width: 768px) {
    .ticker-track span { padding-right: 40px; }

    .footer-bottom .links {
        flex-wrap: nowrap;
        gap: 4px;
    }

    .footer-bottom .links a {
        flex: 1 1 0;
        padding: 5px 4px;
        font-size: 12px;
        white-space: nowrap;
        text-align: center;
    }

    .star-banner {
        margin: 5px -10px 0;
        border-radius: 0;
        border-left: none;
        border-right: none;
        box-shadow: none;
    }

    .stats-grid { grid-template-columns: repeat(2, 1fr); }

    .hotcold-board { grid-template-columns: repeat(2, 1fr); }

    .algorithms-display { grid-template-columns: 1fr; }

    .missed-chart-grid { grid-template-columns: 1fr; }

    .stats-grid-3col,
    .stats-grid-4col { grid-template-columns: repeat(2, 1fr); }

    .footer-middle { grid-template-columns: repeat(2, 1fr); }

    .header-middle {
        justify-content: center;
        align-items: stretch;
    }

    .next-draw {
        align-self: center;
        width: auto;
        padding: 10px 18px;
    }

    .sum-calculator {
        width: 100%;
        flex: 1 1 100%;
        padding: 16px 8px;
        gap: 6px;
        font-size: 17px;
    }

    .sum-calculator > span { font-size: 18px; }

    .sum-item {
        min-width: 40px;
        height: 40px;
        line-height: 40px;
        font-size: 18px;
        padding: 0 3px;
    }

    .sum-item.border-radius-20 {
        min-width: 38px;
        height: 36px;
        line-height: 36px;
        padding: 0 8px;
        border-radius: 12px;
        font-size: 17px;
    }

    .stat-item { min-width: 0; }

    .results-table th,
    .results-table td { padding: 4px 2px; font-size: 12px; }

    .results-table thead th { font-size: 12px; }

    .number-tag {
        min-width: 20px;
        height: 20px;
        line-height: 20px;
        font-size: 12px;
        padding: 0 2px;
    }

    .help-icon .tooltip {
        width: min(300px, calc(100vw - 40px));
    }

    .plan-stats { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 480px) {
    .countdown-inner input { width: 140px; font-size: 15px; }
    .stats-grid-2col { grid-template-columns: 1fr; }
}