:root {
    --bg-gradient-start: #fafaf9;
    --bg-gradient-end: #fafaf9;
    --card-bg: #ffffff;
    --text-primary: #1c1917;
    --text-secondary: #57534e;
    --border-color: #e7e5e4;
    --shadow: rgba(28, 25, 23, 0.06);
    --table-hover: #fafaf9;
    --input-bg: #ffffff;
    --input-border: #d6d3d1;
    --accent-primary: #be123c;
    --accent-secondary: #dc2626;
    --accent-gradient: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    --result-color: #b91c1c;
    --result-gradient: linear-gradient(145deg, #dc2626 0%, #b91c1c 50%, #991b1b 100%);
    --ball-shadow: 0 3px 10px rgba(185, 28, 28, 0.26);
    --ball-highlight: rgba(255,255,255,0.42);
    --hot-color: #b91c1c;
    --cold-color: #0369a1;
    --big-color: #b45309;
    --small-color: #1d4ed8;
    --accent-amber: #b91c1c;
    --success: #047857;
    --warning: #b91c1c;
    --danger: #b91c1c;
    --info-bg: #f0f9ff;
    --info-border: #0284c7;
    --warn-bg: #fffbeb;
    --warn-text: #92400e;
    --transition-ui: 0.2s ease;
    --font-display: 'Barlow Semi Condensed', 'Microsoft YaHei', sans-serif;
}

[data-theme="dark"] {
    --bg-gradient-start: #09090b;
    --bg-gradient-end: #0f0f0f;
    --card-bg: #18181b;
    --text-primary: #fafaf9;
    --text-secondary: #a8a29e;
    --border-color: #3f3f46;
    --shadow: rgba(0,0,0,0.5);
    --table-hover: #27272a;
    --input-bg: #27272a;
    --input-border: #52525b;
    --accent-primary: #dc2626;
    --accent-secondary: #ef4444;
    --result-color: #ef4444;
    --result-gradient: linear-gradient(145deg, #f87171 0%, #ef4444 50%, #dc2626 100%);
    --ball-shadow: 0 3px 14px rgba(220, 38, 38, 0.35);
    --ball-highlight: rgba(255,255,255,0.16);
    --hot-color: #ef4444;
    --cold-color: #38bdf8;
    --big-color: #fb923c;
    --small-color: #60a5fa;
    --accent-amber: #ef4444;
    --success: #34d399;
    --warning: #ef4444;
    --danger: #ef4444;
    --info-bg: #1e3a5f;
    --info-border: #38bdf8;
    --warn-bg: #422006;
    --warn-text: #fecaca;
}

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

html {
    background: #fafaf9;
}

[data-theme="dark"] html {
    background: #09090b;
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Segoe UI', sans-serif;
    background: var(--bg-gradient-start);
    min-height: 100vh;
    padding: 20px;
    transition: background var(--transition-ui);
    position: relative;
    overflow-x: hidden;
}

[data-theme="dark"] body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse 70% 40% at 50% 0%, rgba(220, 38, 38, 0.06) 0%, transparent 55%);
    pointer-events: none;
    z-index: 0;
}

.container {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

.ad-slot {
    width: 100%;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.ad-slot a {
    display: block;
    width: 100%;
    max-width: 100%;
}

.ad-img-responsive {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

.ad-slot-top,
.ad-slot-bottom {
    margin-bottom: 20px;
    text-align: center;
}

.ad-slot-sidebar {
    margin-top: 15px;
}

main {
    width: 100%;
}

header {
    width: 100%;
    box-sizing: border-box;
    background: var(--card-bg);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px var(--shadow);
    margin-bottom: 30px;
    text-align: center;
    position: relative;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

[data-theme="dark"] header {
    background: #18181b;
    border: 1px solid var(--border-color);
    box-shadow: 0 0 24px rgba(0,0,0,0.3);
}

.theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--accent-gradient);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.3;
    max-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: box-shadow var(--transition-ui), filter var(--transition-ui);
    box-shadow: 0 4px 14px rgba(185, 28, 28, 0.28);
}

.theme-toggle:hover {
    box-shadow: 0 6px 18px rgba(185, 28, 28, 0.35);
    filter: brightness(1.05);
}

h1 {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--result-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1em;
}

.latest-draw-container {
    width: 100%;
    margin-bottom: 20px;
}

.latest-draw-card {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 1px 3px var(--shadow), 0 8px 24px rgba(28,25,23,0.04), 0 4px 16px rgba(185,28,28,0.04);
    transition: all 0.3s;
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

[data-theme="dark"] .latest-draw-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 24px var(--shadow);
}

.latest-draw-card,
.tab-content {
    max-width: 1400px !important;
    margin-left: auto;
    margin-right: auto;
}

.latest-draw-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 30px;
    align-items: start;
    width: 100%;
}

.latest-draw-main {
    width: 100%;
}

.latest-draw-main .latest-draw-title {
    font-size: 1.2em;
    margin-bottom: 20px;
}

.latest-draw-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.latest-draw-period {
    text-align: center;
}

.draw-period-label {
    color: var(--text-secondary);
    font-size: 0.9em;
    margin-bottom: 5px;
}

.latest-draw-result-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.latest-three-nums-wrap {
    display: flex;
    gap: 10px;
}

.latest-draw-equal {
    font-size: 2em;
    color: var(--result-color);
}

.num-badge-lg {
    width: 50px;
    height: 50px;
    line-height: 50px;
    font-size: 1.4em;
}

.latest-draw-sidebar {
    width: 100%;
}

.recent-five-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    margin-bottom: 6px;
    background: var(--table-hover);
    border-radius: 6px;
    border-left: 3px solid var(--border-color);
}

.recent-five-item--first {
    background: var(--result-gradient);
    border-left-color: var(--result-color);
}

.recent-five-item--first .recent-five-draw,
.recent-five-item--first .recent-five-result,
.recent-five-item--first .recent-five-num {
    color: white;
}

.recent-five-item--first .recent-five-num {
    background: rgba(255,255,255,0.3);
}

.recent-five-item--second {
    border-left-color: var(--result-color);
}

.recent-five-draw {
    color: var(--text-secondary);
    font-size: 0.85em;
    min-width: 80px;
}

.recent-five-nums {
    display: flex;
    gap: 4px;
    align-items: center;
}

.recent-five-num {
    display: inline-block;
    width: 22px;
    height: 22px;
    line-height: 22px;
    text-align: center;
    background: var(--result-gradient);
    color: white;
    border-radius: 50%;
    font-size: 0.8em;
    font-weight: bold;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2), inset 0 1px 0 var(--ball-highlight);
}

.recent-five-result {
    font-family: var(--font-display);
    font-size: 1.3em;
    font-weight: 700;
    color: var(--result-color);
    min-width: 35px;
    text-align: right;
}

.recent-five-item--second .recent-five-result {
    color: var(--result-color);
}

.stat-value {
    font-size: 2em;
    font-weight: bold;
    color: var(--accent-primary);
    margin: 10px 0;
}

.latest-draw-main #latestDrawNumber {
    font-size: 1.6em;
    font-weight: 600;
    color: var(--text-secondary);
}

.latest-draw-main #latestResult {
    font-family: var(--font-display);
    font-size: 4em;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: var(--result-color);
    text-shadow: 0 2px 12px rgba(185, 28, 28, 0.22);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9em;
}

#countdown {
    font-family: var(--font-display);
    font-weight: 700;
}

.tabs {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 10px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    box-shadow: 0 5px 15px var(--shadow);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    width: 100%;
    box-sizing: border-box;
}

[data-theme="dark"] .tabs {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px var(--shadow);
}

.tab-button {
    flex: 1 1 auto;
    padding: 15px;
    border: none;
    background: var(--table-hover);
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    transition: background var(--transition-ui), box-shadow var(--transition-ui), border-color var(--transition-ui);
    font-weight: 500;
    color: var(--text-primary);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
}

.tab-button:hover {
    background: var(--border-color);
    box-shadow: 0 4px 12px rgba(185, 28, 28, 0.18);
}

.tab-button.active {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(185, 28, 28, 0.35);
    border: 1px solid var(--accent-primary);
}

[data-theme="dark"] .tab-button {
    background: var(--table-hover);
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .tab-button:hover {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
}

[data-theme="dark"] .tab-button.active {
    box-shadow: 0 0 20px rgba(220, 38, 38, 0.4);
}

.tab-content {
    display: none;
    width: 100%;
    max-width: 100%;
    background: var(--card-bg);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 5px 15px var(--shadow);
    transition: all 0.3s ease;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    min-height: 400px;
}

[data-theme="dark"] .tab-content {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 24px var(--shadow);
}

.tab-content h2 {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

[data-theme="dark"] .tab-content h2 {
    border-bottom: 2px solid var(--border-color);
    color: var(--text-primary);
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

label {
    margin-bottom: 5px;
    color: var(--text-secondary);
    font-weight: 500;
}

input, select {
    padding: 10px;
    border: 2px solid var(--input-border);
    border-radius: 6px;
    font-size: 1em;
    transition: border-color 0.3s;
    background: var(--input-bg);
    color: var(--text-primary);
}

input:focus, select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

button {
    padding: 12px 30px;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    transition: box-shadow var(--transition-ui), filter var(--transition-ui);
    box-shadow: 0 4px 12px rgba(185, 28, 28, 0.3);
}

button:hover {
    box-shadow: 0 6px 20px rgba(185, 28, 28, 0.4);
    filter: brightness(1.08);
}

[data-theme="dark"] button {
    box-shadow: 0 0 15px rgba(185, 28, 28, 0.3);
}

[data-theme="dark"] button:hover {
    box-shadow: 0 0 25px rgba(185, 28, 28, 0.5);
}

.table-container {
    overflow-x: auto;
    margin-top: 20px;
    -webkit-overflow-scrolling: touch;
    min-width: 0;
    max-width: 100%;
}

.table-container--bordered {
    max-height: 800px;
    overflow-y: auto;
    border: 2px solid var(--accent-primary);
    border-radius: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    color: var(--text-primary);
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background: var(--table-hover);
    font-weight: 600;
    color: var(--result-color);
}

[data-theme="dark"] th {
    background: #27272a;
    color: var(--accent-amber);
    border-bottom: 2px solid rgba(185, 28, 28, 0.2);
}

tr:hover {
    background: var(--table-hover);
}

[data-theme="dark"] tr:hover {
    background: var(--table-hover);
}

#intervalTable {
    border-collapse: collapse;
    font-size: 0.85em;
}

#intervalTable th,
#intervalTable td {
    border: 1px solid var(--border-color);
    padding: 6px 4px;
    text-align: center;
    min-width: 45px;
    max-width: 45px;
}

#intervalTable thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--result-gradient);
    color: white;
    font-weight: bold;
    font-size: 1em;
    padding: 10px 4px;
    border: 1px solid var(--result-color);
    box-shadow: 0 2px 8px var(--ball-shadow);
}

[data-theme="dark"] #intervalTable thead th {
    box-shadow: 0 0 15px rgba(185, 28, 28, 0.5);
}

#intervalTable thead tr:nth-child(2) td {
    position: sticky;
    top: 40px;
    z-index: 9;
    background: var(--table-hover);
    border: 1px solid var(--border-color);
    font-size: 0.8em;
    padding: 8px 2px;
}

#intervalTable tbody tr.interval-virtual-spacer {
    background: transparent !important;
    pointer-events: none;
}

#intervalTable tbody tr.interval-virtual-spacer td {
    border: none !important;
}

#intervalTable tbody tr:nth-child(odd):not(.interval-virtual-spacer) {
    background: var(--table-hover);
}

#intervalTable tbody tr:hover:not(.interval-virtual-spacer) {
    background: var(--table-hover);
    filter: brightness(0.97);
}

#intervalTable tbody td {
    font-family: 'Courier New', monospace;
}

.result-badge {
    display: inline-block;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: bold;
    background: var(--result-gradient);
    color: white;
    box-shadow: 0 2px 10px var(--ball-shadow);
}

[data-theme="dark"] .result-badge {
    box-shadow: 0 0 15px rgba(185, 28, 28, 0.5);
}

.number-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.number-item {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--table-hover);
    border-radius: 50%;
    font-size: 0.9em;
    font-weight: 500;
    border: 1px solid var(--border-color);
    box-shadow: inset 0 1px 0 var(--ball-highlight);
}

.chart-title-extra {
    display: inline-block;
    margin-left: 20px;
}

.chart-container {
    margin: 20px 0;
    padding: 20px;
    background: var(--table-hover);
    border-radius: 8px;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

.ai-prediction-compact {
    padding: 10px 12px !important;
}

[data-theme="dark"] .chart-container {
    background: #27272a;
    border: 1px solid rgba(185, 28, 28, 0.12);
}

.tab-content > * {
    max-width: 100%;
}

.tab-content .table-container {
    width: 100%;
}

.tab-content .chart-container {
    width: 100%;
    box-sizing: border-box;
}

.chart-title {
    font-size: 1.3em;
    font-weight: 600;
    color: var(--result-color);
    margin-bottom: 15px;
}

[data-theme="dark"] .chart-title {
    color: var(--accent-amber);
    text-shadow: 0 0 10px rgba(220, 38, 38, 0.3);
}

.frequency-bar {
    display: flex;
    align-items: center;
    margin: 10px 0;
}

.frequency-label {
    width: 100px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.frequency-progress {
    flex: 1;
    height: 30px;
    background: #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    margin: 0 15px;
}

.frequency-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary) 0%, var(--result-color) 100%);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    color: white;
    font-weight: 500;
    transition: width 0.5s;
    box-shadow: 0 0 10px rgba(185, 28, 28, 0.3);
}

[data-theme="dark"] .frequency-fill {
    box-shadow: 0 0 15px rgba(185, 28, 28, 0.5);
}

.frequency-count {
    width: 100px;
    text-align: right;
    font-weight: 500;
}

.loading {
    text-align: center;
    padding: 40px;
    min-height: 2.5em;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 1.2em;
}

.retry-btn {
    margin-left: 12px;
    padding: 6px 14px;
    font-size: 0.9em;
    border: 1px solid var(--danger);
    background: transparent;
    color: var(--danger);
    border-radius: 6px;
    cursor: pointer;
    transition: background var(--transition-ui), color var(--transition-ui);
}

.retry-btn:hover {
    background: var(--danger);
    color: #fff;
}

.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 0.95em;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    z-index: 10002;
    opacity: 0;
    transition: transform 0.25s ease, opacity 0.25s ease;
    pointer-events: none;
    max-width: 90vw;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
}

.toast.error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
}

.toast.warn {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
}

button:disabled,
button.btn-loading {
    cursor: not-allowed;
    opacity: 0.75;
}

button.btn-loading {
    position: relative;
    color: transparent !important;
}

button.btn-loading::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btnSpin 0.6s linear infinite;
}

@keyframes btnSpin {
    to { transform: rotate(360deg); }
}

button:focus-visible,
.tab-button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible,
.bet-panel-header:focus-visible,
.modal-close:focus-visible,
.collapse-trigger:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

input:focus-visible,
select:focus-visible {
    box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.15);
}

[data-theme="dark"] input:focus-visible,
[data-theme="dark"] select:focus-visible {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.25);
}

a[href],
.tb-link,
.ticker-item,
.fav-close,
.fav-btn-primary,
.fav-btn-secondary,
.fav-noshow,
label[for],
.bet-panel-header,
.modal-close {
    cursor: pointer;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 1.5em;
    color: var(--text-secondary);
    padding: 4px 8px;
    line-height: 1;
    transition: color var(--transition-ui);
}

.modal-close:hover {
    color: var(--text-primary);
}

.countdown-box {
    margin-bottom: 15px;
    padding: 12px;
    background: var(--accent-gradient);
    border-radius: 8px;
    color: white;
}

.countdown-label {
    font-size: 0.85em;
    opacity: 0.9;
    margin-bottom: 5px;
}

.countdown-info {
    font-size: 0.75em;
    opacity: 0.8;
    margin-top: 5px;
}

.sidebar-section-title {
    color: var(--text-secondary);
    font-size: 0.95em;
    margin-bottom: 12px;
    font-weight: 500;
}

.recent-five-wrap {
    font-size: 0.9em;
    max-height: 400px;
    overflow-y: auto;
}

.prediction-info-box {
    background: linear-gradient(135deg, rgba(185, 28, 28, 0.08), rgba(220, 38, 38, 0.06));
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid var(--accent-primary);
}

.prediction-info-box p {
    margin: 0;
    color: var(--text-primary);
    font-size: 0.9em;
}

.select-accent {
    padding: 8px 15px;
    border-radius: 6px;
    border: 2px solid var(--accent-primary);
    background: var(--input-bg);
    color: var(--text-primary);
    font-weight: 500;
    font-size: 1em;
    transition: border-color var(--transition-ui), box-shadow var(--transition-ui);
}

.select-accent:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.status-success {
    color: var(--success);
}

.status-update {
    color: var(--text-secondary);
    font-size: 0.9em;
}

.section-spacer {
    margin: 20px 0;
}

.section-lead {
    margin-bottom: 15px;
}

.number-buttons-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.w-max-200 { max-width: 200px; }
.w-max-250 { max-width: 250px; }
.w-max-260 { max-width: 260px; }
.w-max-300 { max-width: 300px; }
.flex-1 { flex: 1; }
.min-w-180 { min-width: 180px; }
.min-w-200 { min-width: 200px; }
.mb-8 { margin-bottom: 8px; }
.mb-15 { margin-bottom: 15px; }
.mb-20 { margin-bottom: 20px; }
.ml-10 { margin-left: 10px; }
.ml-15 { margin-left: 15px; }
.mr-8 { margin-right: 8px; }
.mt-8 { margin-top: 8px; }
.mt-15 { margin-top: 15px; }
.fw-bold { font-weight: bold; }
.fw-500 { font-weight: 500; }
.text-secondary { color: var(--text-secondary); }
.leading-relaxed { line-height: 1.8; }
.text-lg { font-size: 1.1em; }
.text-xs { font-size: 0.75em; }
.opacity-90 { opacity: 0.9; }
.opacity-80 { opacity: 0.8; }
.opacity-70 { opacity: 0.7; }
.align-items-end { align-items: flex-end; }
.flex-wrap { flex-wrap: wrap; }
.form-inline-group--no-mb { margin-bottom: 0; cursor: pointer; }
.settings-label { display: block; margin-bottom: 5px; font-weight: 500; }
.footer-copy { font-weight: 500; }
.footer-meta-item { margin: 0 10px; }
.footer-seo-link { color: var(--text-primary); margin: 0 8px; text-decoration: none; }
.footer-seo-link:hover { text-decoration: underline; }
.legend-dot { }
.legend-dot--danger { color: var(--danger); }
.legend-dot--success { color: var(--success); }
.legend-dot--primary { color: var(--text-primary); }
.legend-dot--accent { color: var(--accent-primary); font-weight: bold; }
.legend-dot--info { color: var(--info-border); font-weight: bold; }

.form-group--narrow { max-width: 250px; }
.form-group--narrow-260 { max-width: 260px; }

.radio-option {
    margin-bottom: 0;
    cursor: pointer;
    background: rgba(255,255,255,0.2);
    padding: 8px 15px;
    border-radius: 6px;
}

.mode-desc {
    margin: 10px 0 0 0;
    font-size: 0.9em;
    opacity: 0.95;
}

.footer-wrap {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-secondary);
    font-size: 0.9em;
    margin-top: 40px;
    background: var(--card-bg);
    border-top: 2px solid var(--border-color);
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-block {
    margin-bottom: 25px;
    padding: 20px;
    background: var(--table-hover);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.footer-block h3 {
    color: var(--accent-primary);
    font-size: 1em;
    margin-bottom: 15px;
    font-weight: 600;
}

.footer-group {
    margin-bottom: 15px;
}

.footer-group:last-child {
    margin-bottom: 0;
}

.footer-group .footer-group-label {
    font-size: 0.8em;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

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

.footer-link {
    color: var(--accent-primary);
    text-decoration: none;
    padding: 6px 12px;
    background: linear-gradient(135deg, rgba(185, 28, 28, 0.08), rgba(220, 38, 38, 0.06));
    border-radius: 6px;
    border: 1px solid var(--accent-primary);
    transition: all 0.3s;
    display: inline-block;
}

.footer-link:hover {
    filter: brightness(1.05);
}

.footer-link--success {
    background: rgba(4, 120, 87, 0.08);
    border-color: rgba(4, 120, 87, 0.3);
    color: var(--success);
}

.footer-link--warn {
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.3);
    color: var(--warning);
}

.footer-seo {
    margin-top: 20px;
    padding: 15px;
    background: rgba(185, 28, 28, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(185, 28, 28, 0.1);
}

.label-inline {
    display: flex;
    align-items: center;
    gap: 5px;
}

.settings-row {
    margin-bottom: 15px;
}

.settings-row label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.settings-hint {
    margin-top: 10px;
    padding: 10px;
    background: var(--table-hover);
    border-radius: 6px;
    font-size: 0.9em;
    color: var(--text-secondary);
}

.select-full {
    width: 100%;
    max-width: 300px;
    padding: 10px;
}

.form-inline-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.form-inline-group label {
    margin-bottom: 0;
}

.form-inline-group--tight {
    margin-bottom: 6px;
}

.input-narrow {
    width: 60px;
    padding: 6px 8px;
    border: 2px solid var(--input-border);
    border-radius: 6px;
    font-size: 1em;
    background: var(--input-bg);
    color: var(--text-primary);
}

.input-narrow--info {
    border-color: var(--info-border);
}

.input-narrow--wide {
    width: 80px;
}

.input-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent-primary);
}

.input-readonly {
    background: var(--table-hover);
}

.input-accent {
    font-weight: bold;
    color: var(--accent-primary);
}

[data-theme="dark"] .input-readonly {
    background: var(--input-bg);
}

.modal-desc {
    color: var(--text-secondary);
    font-size: 0.9em;
    margin-bottom: 15px;
}

.modal-section-title {
    font-weight: bold;
    margin-bottom: 8px;
}

.text-sm { font-size: 0.85em; }
.text-sm--90 { font-size: 0.9em; }
.modal-help {
    font-size: 0.85em;
    line-height: 1.5;
}

.btn-default-numbers {
    background: var(--accent-gradient);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: box-shadow var(--transition-ui), filter var(--transition-ui);
}

.btn-default-numbers:hover {
    filter: brightness(1.06);
    box-shadow: 0 4px 14px rgba(185, 28, 28, 0.3);
}

.three-position-banner {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    color: white;
}

.form-panel {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.form-panel--muted {
    background: var(--table-hover);
}

.form-panel--info {
    background: var(--info-bg);
    border: 1px solid var(--info-border);
}

.form-panel--warn {
    background: var(--warn-bg);
    padding: 12px;
    border-radius: 6px;
}

.form-panel h3 {
    margin: 0 0 12px 0;
    color: var(--accent-primary);
}

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    font-size: 0.9em;
    margin-bottom: 15px;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.footer-bar {
    text-align: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.9em;
}

.toolbar-row {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.toolbar-row--center {
    align-items: center;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}

.form-group--tight {
    margin: 0;
}

.status-badge {
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 500;
    background: rgba(4, 120, 87, 0.12);
    color: var(--success);
}

[data-theme="dark"] .status-badge {
    background: rgba(52, 211, 153, 0.15);
}

.btn-accent-purple {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: filter var(--transition-ui), box-shadow var(--transition-ui);
}

.btn-accent-purple:hover {
    filter: brightness(1.08);
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);
}

@media (prefers-reduced-motion: reduce) {
    .vs-dot { animation: none; }
    .toast { animation-duration: 0.2s; }
    .latest-draw-card, .tab-content, .tab-button, .theme-toggle, .fav-modal, button, .bet-number-btn {
        transition-duration: 0.1s;
    }
}

.bet-calc-pro {
    max-width: 100%;
}

.bet-calc-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.bet-calc-title {
    margin: 0 0 4px 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.bet-calc-subtitle {
    margin: 0 0 10px 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

.bet-calc-formula-intro {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-family: inherit;
}

.bet-calc-panel {
    margin-bottom: 24px;
    padding: 16px 18px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.bet-calc-panel-title {
    margin: 0 0 14px 0;
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
}

.bet-calc-panel-tag {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.bet-calc-label-main {
    font-family: ui-monospace, monospace;
    font-size: 0.85em;
    margin-right: 2px;
}

.bet-calc-field-readonly .bet-calc-readonly {
    padding: 8px 10px;
    background: var(--table-hover);
    border-radius: 4px;
    font-family: ui-monospace, monospace;
    font-size: 0.95rem;
    min-height: 2.2em;
    display: flex;
    align-items: center;
}

.bet-calc-display {
    padding: 14px 16px;
    background: var(--table-hover);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: ui-monospace, monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 14px;
    min-height: 60px;
}

.bet-calc-display--empty {
    color: var(--text-secondary);
    font-style: normal;
}

.bet-calc-display-line {
    margin: 2px 0;
}

.bet-calc-algo-line {
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.bet-calc-algo-name {
    font-weight: 600;
    margin-right: 6px;
}

.bet-calc-formula-inline,
.bet-calc-formula {
    font-family: ui-monospace, monospace;
    font-size: 0.88em;
    padding: 2px 6px;
    background: rgba(0,0,0,0.06);
    border-radius: 4px;
}

[data-theme="dark"] .bet-calc-formula-inline,
[data-theme="dark"] .bet-calc-formula {
    background: rgba(255,255,255,0.08);
}

.bet-calc-num {
    font-family: ui-monospace, monospace;
    font-weight: 600;
}

.bet-calc-intro {
    margin-bottom: 20px;
    padding: 12px;
    background: var(--table-hover);
    border-radius: 6px;
    font-size: 0.9em;
    color: var(--text-secondary);
}

.bet-calc-params-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.bet-calc-params-table-wrap {
    overflow-x: auto;
}

.bet-calc-params-table {
    width: 100%;
    min-width: 480px;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.bet-calc-params-table th {
    text-align: right;
    padding: 6px 10px 6px 0;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    width: 1%;
}

.bet-calc-params-table td {
    padding: 6px 8px;
    width: 1%;
}

.bet-calc-params-table td input {
    width: 100%;
    min-width: 72px;
    max-width: 120px;
    padding: 6px 8px;
    box-sizing: border-box;
}

.bet-calc-params-readonly {
    display: inline-block;
    min-width: 72px;
    padding: 6px 8px;
    background: var(--table-hover);
    border-radius: 4px;
    font-family: ui-monospace, monospace;
}

.bet-calc-params-input-full {
    max-width: none !important;
    width: 100% !important;
}

.bet-calc-params-table .bet-calc-smart-wrap {
    margin-top: 4px;
}

.bet-calc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px 16px;
    margin-bottom: 14px;
}

.bet-calc-field {
    display: flex;
    flex-direction: column;
}

.bet-calc-field label {
    margin-bottom: 4px;
    font-size: 0.9em;
}

.bet-calc-field input {
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
}

.bet-calc-summary {
    display: flex;
    align-items: flex-end;
}

.bet-calc-summary span {
    padding: 8px;
    font-size: 0.9em;
    color: var(--text-secondary);
}

.bet-calc-schemes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 25px;
}

.bet-calc-output {
    padding: 20px;
    background: var(--card-bg);
    border-radius: 8px;
    min-height: 120px;
}

.bet-calc-table-wrap {
    overflow-x: auto;
    margin-top: 12px;
}

.bet-calc-table {
    width: 100%;
    border-collapse: collapse;
}

.bet-calc-th, .bet-calc-td {
    padding: 8px 6px;
}

.bet-calc-th { border-bottom: 2px solid var(--border-color); }
.bet-calc-th-n, .bet-calc-td-n { text-align: center; }
.bet-calc-th-r, .bet-calc-td-r { text-align: right; }
.bet-calc-th-l, .bet-calc-td-l { text-align: left; }
.bet-calc-th-profit, .bet-calc-td-profit { color: #2e7d32; }
.bet-calc-td { font-size: 0.95em; }
.bet-calc-td-l { font-size: 0.85em; }
.bet-calc-tr-stop { background: rgba(244, 67, 54, 0.1); }
.bet-calc-tr-ok { background: rgba(16, 185, 129, 0.08); }

.bet-calc-summary-line {
    margin-bottom: 10px;
    font-size: 0.9em;
    color: var(--text-secondary);
}

.bet-calc-desc {
    margin-bottom: 8px;
    font-size: 0.95em;
}

.bet-calc-warn {
    color: #c62828;
    margin-bottom: 8px;
}

.bet-calc-smart-wrap {
    margin-top: 6px;
    font-size: 0.85em;
    line-height: 1.5;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.bet-calc-smart-hint {
    color: var(--text-secondary);
}

.bet-calc-apply-btn {
    padding: 4px 10px;
    font-size: 0.9em;
    cursor: pointer;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-color);
}

.bet-calc-apply-btn:hover {
    background: var(--table-hover);
}

.bet-calc-presets {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.bet-calc-presets-label {
    font-size: 0.9em;
    color: var(--text-secondary);
}

.bet-calc-preset-btn {
    padding: 6px 12px;
    font-size: 0.9em;
    cursor: pointer;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-color);
}

.bet-calc-preset-btn:hover {
    background: var(--table-hover);
}

.collapse-trigger {
    cursor: pointer;
}

.collapse-content {
    padding: 15px;
    background: var(--card-bg);
    border-radius: 8px;
    font-size: 0.9em;
    line-height: 1.8;
    color: var(--text-secondary);
}

.collapse-content p {
    margin: 0 0 12px;
}

.collapse-content p:last-child {
    margin-bottom: 0;
}

.bet-calc-usage-section .bet-calc-panel-title {
    cursor: pointer;
}

#betCalcUsageTriggerLabel {
    font-weight: normal;
    font-size: 0.85em;
    color: var(--text-secondary);
    margin-left: 4px;
}

.bet-calc-dl {
    margin: 0;
}

.bet-calc-dl dt {
    font-weight: 600;
    margin-top: 14px;
    color: var(--text-color);
}

.bet-calc-dl dt:first-child {
    margin-top: 0;
}

.bet-calc-dl dd {
    margin: 4px 0 0;
    padding-left: 0;
    line-height: 1.6;
    color: var(--text-secondary);
}

.card-block {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.theme-toggle .theme-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    min-width: 20px;
    max-width: 20px;
    min-height: 20px;
    max-height: 20px;
    flex-shrink: 0;
    vertical-align: middle;
}

.theme-toggle .theme-icon svg {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 20px;
    max-height: 20px;
    fill: currentColor;
}

.bet-actions .btn-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.bet-actions .btn-icon svg {
    display: block;
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.bet-panel-header .panel-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.bet-panel-header .panel-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.accent-text {
    color: var(--accent-primary);
}

.three-nums {
    display: inline-flex;
    gap: 5px;
}

.num-badge {
    display: inline-block;
    width: 28px;
    height: 28px;
    line-height: 28px;
    text-align: center;
    background: var(--result-gradient);
    color: white;
    border-radius: 50%;
    font-weight: bold;
    font-size: 0.9em;
    box-shadow: var(--ball-shadow), inset 0 -2px 4px rgba(0,0,0,0.15), inset 0 1px 0 var(--ball-highlight);
}

[data-theme="dark"] .num-badge {
    box-shadow: var(--ball-shadow), inset 0 -2px 6px rgba(0,0,0,0.3), inset 0 1px 0 var(--ball-highlight);
}

.clickable-number {
    cursor: pointer;
    transition: box-shadow var(--transition-ui), filter var(--transition-ui);
}

.clickable-number:hover {
    box-shadow: 0 4px 16px var(--ball-shadow);
    filter: brightness(1.12);
}

.clickable-number:active {
    filter: brightness(1.05);
}

.distribution-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.distribution-section {
    background: var(--table-hover);
    padding: 20px;
    border-radius: 8px;
}

.distribution-title {
    font-size: 1.2em;
    font-weight: 600;
    color: var(--result-color);
    margin-bottom: 15px;
}

/* ===== 顶部导航栏 ===== */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 998;
    font-family: -apple-system, 'SF Pro Text', 'Microsoft YaHei', sans-serif;
}

.top-bar-row1 {
    background: #09090b;
    border-bottom: 1px solid rgba(185, 28, 28, 0.12);
}

.top-bar-r1-inner {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 20px;
    font-size: 0.72em;
}

.top-bar-notice {
    color: rgba(148, 163, 184, 0.7);
    letter-spacing: 0.5px;
}

.top-bar-r1-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.top-bar-email {
    color: rgba(148, 163, 184, 0.6);
}

.top-bar-email a {
    color: #ef4444;
    text-decoration: none;
    font-family: 'Consolas', 'SF Mono', monospace;
    transition: color 0.2s;
}

.top-bar-email a:hover {
    color: #ef4444;
    text-decoration: underline;
}

.top-bar-row2 {
    background: linear-gradient(90deg, #09090b, #18181b 50%, #09090b);
    border-bottom: 1px solid rgba(185, 28, 28, 0.15);
    position: relative;
    overflow: hidden;
}

.top-bar-row2::after {
    content: '';
    position: absolute;
    top: 0;
    left: -60%;
    width: 40%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(185, 28, 28, 0.05), transparent);
    animation: barSweep 10s linear infinite;
    pointer-events: none;
}

@keyframes barSweep {
    0% { left: -40%; }
    100% { left: 100%; }
}

.top-bar-r2-inner {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    padding: 5px 20px;
    gap: 6px;
    flex-wrap: wrap;
}

.top-bar-group {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.top-bar-tag {
    font-size: 0.62em;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 2px 7px;
    border-radius: 3px;
    margin-right: 2px;
    flex-shrink: 0;
}

.top-bar-tag.vip {
    color: #ef4444;
    background: rgba(185, 28, 28, 0.15);
    border: 1px solid rgba(220, 38, 38, 0.35);
}

.top-bar-tag.backup {
    color: rgba(148, 163, 184, 0.8);
    background: rgba(100, 116, 139, 0.1);
    border: 1px solid rgba(100, 116, 139, 0.2);
}

.tb-link {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.7em;
    font-weight: 500;
    font-family: 'Consolas', 'SF Mono', monospace;
    letter-spacing: 0.2px;
    transition: all 0.2s ease;
    white-space: nowrap;
    border: 1px solid transparent;
}

.tb-link.vip {
    color: #ef4444;
}

.tb-link.vip:hover {
    color: #fff;
    background: rgba(185, 28, 28, 0.2);
    border-color: rgba(185, 28, 28, 0.35);
    text-shadow: 0 0 8px rgba(185, 28, 28, 0.4);
}

.tb-link.net {
    color: #6ee7b7;
}

.tb-link.net:hover {
    color: #fff;
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
    text-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.tb-link.com {
    color: #ef4444;
}

.tb-link.com:hover {
    color: #fff;
    background: rgba(220, 38, 38, 0.15);
    border-color: rgba(220, 38, 38, 0.3);
    text-shadow: 0 0 8px rgba(220, 38, 38, 0.4);
}

.tb-link.active {
    color: #fff !important;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary)) !important;
    border-color: var(--accent-primary) !important;
    box-shadow: 0 0 10px rgba(185, 28, 28, 0.35);
    pointer-events: none;
}

.tb-sep {
    width: 1px;
    height: 14px;
    background: rgba(185, 28, 28, 0.12);
    margin: 0 4px;
    flex-shrink: 0;
}

.top-bar-mobile-email {
    display: none;
}

.top-bar-mobile-ticker {
    display: none;
}

.ticker-label-left,
.ticker-label-right {
    display: none;
}

.kf-float-btn {
    position: fixed;
    left: 20px;
    bottom: 24px;
    z-index: 9998;
    padding: 12px 20px;
    background: var(--accent-gradient);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 24px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(185, 28, 28, 0.4);
    transition: box-shadow var(--transition-ui), filter var(--transition-ui);
}

.kf-float-btn:hover {
    box-shadow: 0 6px 24px rgba(185, 28, 28, 0.5);
    filter: brightness(1.08);
}

.kf-panel {
    display: none;
    position: fixed;
    left: 20px;
    bottom: 70px;
    width: 380px;
    height: 520px;
    z-index: 9999;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    border: 1px solid rgba(185, 28, 28, 0.2);
}

.kf-panel.show {
    display: block;
}

.kf-panel-close {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    font-size: 20px;
    line-height: 1;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}

.kf-panel-close:hover {
    background: rgba(0, 0, 0, 0.6);
}

.kf-iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

@media (max-width: 768px) {
    .kf-float-btn {
        left: 12px;
        bottom: 20px;
        padding: 10px 16px;
        font-size: 13px;
    }

    .kf-panel {
        left: 3vw;
        right: 3vw;
        bottom: 72px;
        width: 94vw;
        height: 70vh;
        max-height: 520px;
    }
}

/* 收藏提示弹窗 */
.fav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10001;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    justify-content: center;
    align-items: center;
    animation: favFadeIn 0.3s ease;
}

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

@keyframes favFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fav-modal {
    position: relative;
    width: 90%;
    max-width: 380px;
    background: linear-gradient(160deg, #18181b 0%, #27272a 40%, #18181b 100%);
    border: 1px solid rgba(185, 28, 28, 0.25);
    border-radius: 16px;
    padding: 32px 28px 24px;
    text-align: center;
    box-shadow:
        0 0 60px rgba(185, 28, 28, 0.12),
        0 20px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    animation: favSlideUp 0.35s ease;
}

@keyframes favSlideUp {
    from { opacity: 0; transform: translateY(30px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.fav-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 50% 30%, rgba(185, 28, 28, 0.08), transparent 60%);
    pointer-events: none;
}

.fav-close {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 1.5em;
    color: rgba(148, 163, 184, 0.5);
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
    z-index: 1;
}

.fav-close:hover {
    color: #fff;
}

.fav-icon {
    font-size: 2.4em;
    margin-bottom: 12px;
    animation: favStarPulse 2s ease-in-out infinite;
}

@keyframes favStarPulse {
    0%, 100% { opacity: 1; filter: brightness(1); }
    50% { opacity: 0.95; filter: brightness(1.25); }
}

.fav-title {
    font-size: 1.15em;
    font-weight: 700;
    color: #e2e8f0;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.fav-desc {
    font-size: 0.82em;
    color: rgba(148, 163, 184, 0.85);
    line-height: 1.7;
    margin-bottom: 14px;
}

.fav-domain {
    font-family: 'Consolas', 'SF Mono', monospace;
    font-size: 0.9em;
    color: #ef4444;
    font-weight: 600;
    padding: 8px 16px;
    background: rgba(220, 38, 38, 0.08);
    border: 1px solid rgba(220, 38, 38, 0.2);
    border-radius: 8px;
    margin-bottom: 20px;
    letter-spacing: 0.5px;
}

.fav-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}

.fav-btn-primary {
    flex: 1;
    padding: 10px 0;
    border: none;
    border-radius: 8px;
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    color: #fff;
    background: var(--result-gradient);
    box-shadow: 0 4px 15px var(--ball-shadow);
    transition: box-shadow var(--transition-ui);
}

.fav-btn-primary:hover {
    box-shadow: 0 6px 20px rgba(185, 28, 28, 0.4);
}

.fav-btn-secondary {
    flex: 0.6;
    padding: 10px 0;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 8px;
    font-size: 0.82em;
    font-weight: 500;
    cursor: pointer;
    color: rgba(148, 163, 184, 0.7);
    background: transparent;
    transition: all 0.2s;
}

.fav-btn-secondary:hover {
    border-color: rgba(148, 163, 184, 0.4);
    color: #e2e8f0;
}

.fav-noshow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.72em;
    color: rgba(148, 163, 184, 0.45);
    cursor: pointer;
}

.fav-noshow input {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: var(--accent-primary);
}

.default-numbers-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
}

.default-numbers-modal.show {
    display: flex;
}

.default-numbers-modal .modal-inner {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 50px rgba(0,0,0,0.5);
}

.default-numbers-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--result-color);
    padding-bottom: 10px;
}

.default-numbers-modal .modal-header h3 {
    margin: 0;
    color: var(--result-color);
}

.default-numbers-modal .modal-section-warn {
    margin-bottom: 15px;
    padding: 10px;
    background: var(--warn-bg);
    border-radius: 6px;
    color: var(--warn-text);
}

.default-numbers-modal .modal-section-info {
    margin-bottom: 15px;
    padding: 10px;
    background: var(--info-bg);
    border-radius: 6px;
    border: 2px solid var(--info-border);
    color: var(--text-primary);
}

.default-numbers-modal .modal-section-info .strong,
.default-numbers-modal .modal-section-info strong {
    color: var(--info-border);
}

.default-numbers-modal .modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.default-numbers-modal .btn-clear {
    background: var(--danger);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}

.default-numbers-modal .btn-save {
    background: var(--result-gradient);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: var(--ball-shadow);
}

.default-numbers-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

/* 访客统计卡片 */
.visitor-stats-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin-top: 4px;
}

.vs-card {
    position: relative;
    padding: 10px 6px 8px;
    border-radius: 8px;
    text-align: center;
    background: var(--table-hover);
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.vs-card:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 2px 12px rgba(185, 28, 28, 0.1);
}

[data-theme="dark"] .vs-card {
    background: rgba(15, 15, 25, 0.6);
    border-color: rgba(185, 28, 28, 0.1);
}

[data-theme="dark"] .vs-card:hover {
    border-color: rgba(185, 28, 28, 0.3);
    box-shadow: 0 0 15px rgba(185, 28, 28, 0.08);
}

.vs-card.vs-live {
    border-color: var(--accent-primary);
    background: linear-gradient(135deg, rgba(185, 28, 28, 0.06), rgba(234, 88, 12, 0.06));
}

[data-theme="dark"] .vs-card.vs-live {
    background: linear-gradient(135deg, rgba(185, 28, 28, 0.1), rgba(234, 88, 12, 0.08));
    border-color: rgba(185, 28, 28, 0.3);
}

.vs-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    animation: vsDotPulse 1.5s ease-in-out infinite;
}

@keyframes vsDotPulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(4, 120, 87, 0.4); }
    50% { opacity: 0.6; box-shadow: 0 0 0 4px rgba(4, 120, 87, 0); }
}

.vs-val {
    font-size: 1.3em;
    font-weight: 700;
    font-family: 'Consolas', 'SF Mono', monospace;
    line-height: 1.2;
    margin-bottom: 2px;
}

.vs-card.vs-live .vs-val { color: var(--accent-primary); }
.vs-peak { color: var(--danger); }
.vs-new { color: var(--success); }
.vs-view { color: var(--big-color); }
.vs-mnew { color: var(--small-color); }
.vs-mview { color: var(--accent-primary); }

.vs-label {
    font-size: 0.7em;
    color: var(--text-secondary);
    letter-spacing: 0.3px;
}

@media (max-width: 768px) {
    .visitor-stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    .vs-val {
        font-size: 1.1em;
    }

    .vs-label {
        font-size: 0.62em;
    }

    .vs-card {
        padding: 8px 4px 6px;
    }
}

@media (max-width: 360px) {
    .visitor-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 悬浮选号栏 */
.bet-panel {
    position: fixed;
    bottom: 10px;
    right: 10px;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 10px 40px var(--shadow);
    z-index: 999;
    width: 280px;
    max-height: 75vh;
    overflow-y: auto;
    transition: all 0.3s;
    border: 2px solid var(--result-color);
}

[data-theme="dark"] .bet-panel {
    background: #18181b;
    border: 2px solid rgba(220, 38, 38, 0.4);
    box-shadow: 0 0 30px rgba(220, 38, 38, 0.15);
}

.bet-panel.minimized {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
}

.bet-panel.minimized .bet-panel-content {
    display: none;
}

.bet-panel.minimized .bet-panel-header {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8em;
}

.bet-panel-header {
    background: var(--result-gradient);
    color: white;
    padding: 10px 12px;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: filter var(--transition-ui);
    font-size: 0.95em;
}

.bet-panel-content {
    padding: 12px;
}

.bet-panel-desc {
    margin-bottom: 12px;
    font-size: 0.9em;
    color: var(--text-secondary);
}

.bet-selected-box {
    margin: 12px 0;
    padding: 10px;
    background: var(--table-hover);
    border-radius: 6px;
    min-height: 40px;
    font-size: 0.9em;
    color: var(--text-primary);
}

.bet-selected-box .accent,
.bet-selected-box .accent-text {
    font-weight: bold;
    color: var(--result-color);
}

.bet-result-box {
    margin-top: 15px;
    padding: 12px;
    border-radius: 6px;
    font-size: 0.9em;
    display: none;
}

.bet-numbers {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin-bottom: 12px;
}

.bet-number-btn {
    padding: 6px 2px;
    border: 2px solid var(--input-border);
    background: var(--input-bg);
    color: var(--text-primary);
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: border-color var(--transition-ui), box-shadow var(--transition-ui);
    font-size: 0.85em;
}

.bet-number-btn:hover {
    border-color: var(--result-color);
    box-shadow: 0 2px 10px var(--ball-shadow);
}

.bet-number-btn.selected {
    background: var(--result-gradient);
    color: white;
    border-color: var(--result-color);
    box-shadow: var(--ball-shadow), inset 0 1px 0 var(--ball-highlight);
}

.bet-actions {
    display: flex;
    gap: 6px;
    margin-top: 10px;
}

.bet-actions button {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 10px;
    font-size: 14px;
    line-height: 1.3;
    max-height: 44px;
}

.bet-btn-copy {
    background: var(--result-gradient);
}

.bet-btn-random {
    background: linear-gradient(135deg, var(--warning) 0%, #ff5722 100%);
}

.bet-btn-clear {
    background: linear-gradient(135deg, var(--danger) 0%, #e91e63 100%);
}

/* 新开奖悬浮提醒 - 左下角固定 */
.new-draw-notification {
    position: fixed !important;
    bottom: 20px !important;
    left: 20px !important;
    right: auto !important;
    top: auto !important;
    background: var(--result-gradient);
    color: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 10px 40px var(--ball-shadow);
    z-index: 10000;
    animation: slideInLeft 0.5s ease-out;
    cursor: pointer;
    max-width: 320px;
    min-width: 280px;
    border: 2px solid rgba(255, 255, 255, 0.25);
}

[data-theme="dark"] .new-draw-notification {
    box-shadow: 0 0 40px rgba(220, 38, 38, 0.3);
    border: 2px solid rgba(220, 38, 38, 0.4);
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%) scale(0.8);
        opacity: 0;
    }
    to {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%) scale(0.8);
        opacity: 0;
    }
    to {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

.notification-title {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 10px;
}

.notification-content {
    font-size: 1.5em;
    text-align: center;
    margin: 10px 0;
}

.notification-close {
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: pointer;
    font-size: 1.2em;
    opacity: 0.8;
}

.notification-close:hover {
    opacity: 1;
}

/* 响应式设计 */
@media (max-width: 1400px) {
    .tb-link {
        font-size: 0.65em;
        padding: 2px 6px;
    }
}

@media (max-width: 1200px) {
    .bet-panel {
        right: 10px;
    }
    
    .container {
        padding: 15px;
    }

    .latest-draw-layout {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    #recentFiveDraws {
        max-width: 100% !important;
    }
    
}

@media (max-width: 1024px) {
    .latest-draw-card {
        padding: 20px !important;
    }

    .tabs {
        flex-wrap: wrap;
    }

    .tab-button {
        flex: 1 1 auto;
        min-width: 80px;
    }

    .theme-toggle {
        position: static;
        margin-bottom: 15px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
    }

    .theme-toggle .theme-icon,
    .theme-toggle .theme-icon svg {
        width: 20px !important;
        height: 20px !important;
        max-width: 20px !important;
        max-height: 20px !important;
    }

    header {
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .top-bar-row1,
    .top-bar-row2 {
        display: none;
    }

    .top-bar-mobile-ticker {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        padding: 6px 12px;
        background: linear-gradient(90deg, #070b19, #0e1230 50%, #070b19);
        border-bottom: 1px solid rgba(185, 28, 28, 0.12);
        position: relative;
        overflow: hidden;
    }

    .top-bar-mobile-ticker::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background:
            radial-gradient(ellipse 300px 20px at 50% 50%, rgba(99,102,241,0.06), transparent);
        pointer-events: none;
    }

    .ticker-deco {
        color: rgba(185, 28, 28, 0.3);
        font-size: 0.45em;
        animation: tickerPulse 2s ease-in-out infinite;
    }

    @keyframes tickerPulse {
        0%, 100% { opacity: 0.3; }
        50% { opacity: 0.8; color: rgba(220, 38, 38, 0.8); }
    }

    .ticker-slot {
        position: relative;
        height: 20px;
        min-width: 140px;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
    }

    .ticker-item {
        font-family: 'Consolas', 'SF Mono', monospace;
        font-size: 0.78em;
        font-weight: 600;
        letter-spacing: 0.5px;
        text-decoration: none;
        white-space: nowrap;
        transition: opacity 0.4s, transform 0.4s;
    }

    .ticker-item.vip { color: #a5b4fc; }
    .ticker-item.net { color: #6ee7b7; }
    .ticker-item.com { color: #ef4444; }
    .ticker-item.active {
        color: #fff;
        text-shadow: 0 0 10px rgba(185, 28, 28, 0.5);
    }

    .ticker-item.fade-out {
        opacity: 0;
        transform: translateY(-10px);
    }

    .ticker-item.fade-in {
        opacity: 0;
        transform: translateY(10px);
    }

    .ticker-label-left,
    .ticker-label-right {
        display: inline-block;
        flex-shrink: 0;
        font-size: 0.68em;
        font-weight: 600;
        letter-spacing: 1px;
        white-space: nowrap;
        text-decoration: none;
    }

    .ticker-label-left {
        color: rgba(148, 163, 184, 0.8);
    }

    .ticker-label-right {
        color: rgba(129, 140, 248, 0.8);
    }

    .bet-panel {
        right: 10px;
        bottom: 10px;
    }
    
    body {
        padding: 8px;
    }

    h1 {
        font-size: 1.6em;
    }

    .subtitle {
        font-size: 0.9em;
    }

    header {
        padding: 15px;
    }

    .theme-toggle {
        position: static;
        margin-bottom: 10px;
        width: 100%;
        max-width: 280px;
        margin-left: auto;
        margin-right: auto;
        padding: 12px;
        max-height: 48px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
    }

    .theme-toggle .theme-icon,
    .theme-toggle .theme-icon svg {
        width: 20px !important;
        height: 20px !important;
        max-width: 20px !important;
        max-height: 20px !important;
    }

    .latest-draw-card {
        padding: 15px !important;
    }

    .latest-draw-layout {
        grid-template-columns: 1fr !important;
    }

    #latestDrawNumber {
        font-size: 1.8em !important;
    }

    #latestResult {
        font-size: 2.5em !important;
    }

    .num-badge {
        width: 38px !important;
        height: 38px !important;
        line-height: 38px !important;
        font-size: 1.1em !important;
    }

    #latestThreeNumbers .num-badge {
        width: 42px !important;
        height: 42px !important;
        line-height: 42px !important;
    }

    .tabs {
        padding: 6px;
        gap: 6px;
        flex-wrap: wrap;
    }

    .tab-button {
        padding: 12px 15px;
        font-size: 0.9em;
        flex: 1 1 auto;
        min-width: 70px;
    }

    .tab-content {
        padding: 15px;
    }

    h2 {
        font-size: 1.4em;
        margin-bottom: 15px;
    }

    .stat-value {
        font-size: 1.8em !important;
    }

    .search-form {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .distribution-grid {
        grid-template-columns: 1fr !important;
    }

    .frequency-bar {
        gap: 5px;
    }

    .frequency-label {
        font-size: 0.9em;
    }

    .frequency-count {
        font-size: 0.9em;
    }

    table {
        font-size: 0.85em;
    }

    th, td {
        padding: 10px 6px;
    }

    #intervalTable {
        font-size: 0.72em;
    }

    #intervalTable th,
    #intervalTable td {
        min-width: 32px;
        max-width: 32px;
        padding: 5px 2px;
    }

    #intervalTable thead th {
        font-size: 0.95em;
        padding: 8px 2px;
    }

    .chart-container {
        padding: 12px;
    }

    .chart-title {
        font-size: 1.05em;
        margin-bottom: 12px;
    }

    .new-draw-notification {
        bottom: 10px !important;
        left: 10px !important;
        right: 10px !important;
        max-width: none !important;
        padding: 15px;
    }

    #aiPredictionResult {
        overflow-x: hidden;
        width: 100%;
        max-width: 100%;
    }

    #aiPredictionResult .chart-container {
        overflow: hidden;
    }

    .ai-model-card {
        padding: 6px 8px !important;
    }

    .ai-model-card > div:first-child {
        gap: 6px !important;
    }

    .ai-model-card > div:first-child > div:first-child {
        min-width: 90px !important;
    }

    .ai-model-card > div:first-child > div:first-child > div:first-child {
        font-size: 0.85em !important;
    }

    .ai-model-card > div:last-child {
        font-size: 0.65em !important;
    }
    
    .bet-panel {
        width: calc(100% - 20px);
        max-width: 360px;
        bottom: 10px;
        right: 10px;
        left: auto;
    }

    .bet-numbers {
        grid-template-columns: repeat(7, 1fr);
    }

    #numberButtons {
        gap: 8px;
    }

    #numberButtons button {
        min-width: 42px !important;
        padding: 12px 6px;
        font-size: 0.95em;
    }

    #recentFiveDraws > div {
        padding: 10px 12px;
        margin-bottom: 6px;
    }

    button {
        padding: 12px 20px;
        font-size: 0.95em;
        touch-action: manipulation;
    }

    input, select {
        padding: 12px;
        font-size: 1em;
        touch-action: manipulation;
    }
}

@media (max-width: 480px) {
    body {
        padding: 5px;
    }

    h1 {
        font-size: 1.4em;
        line-height: 1.3;
    }

    .subtitle {
        font-size: 0.85em;
    }

    header {
        padding: 12px;
        margin-bottom: 15px;
    }

    .theme-toggle {
        width: 100%;
        max-width: 280px;
        margin-left: auto;
        margin-right: auto;
        padding: 10px;
        font-size: 14px;
        max-height: 48px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
    }

    .theme-toggle .theme-icon,
    .theme-toggle .theme-icon svg {
        width: 20px !important;
        height: 20px !important;
        max-width: 20px !important;
        max-height: 20px !important;
    }

    .latest-draw-card {
        padding: 12px !important;
    }

    #latestDrawNumber {
        font-size: 1.6em !important;
    }

    #latestResult {
        font-size: 2.2em !important;
    }

    .num-badge {
        width: 32px !important;
        height: 32px !important;
        line-height: 32px !important;
        font-size: 0.95em !important;
    }

    #latestThreeNumbers {
        gap: 8px !important;
    }

    #latestThreeNumbers .num-badge {
        width: 38px !important;
        height: 38px !important;
        line-height: 38px !important;
        font-size: 1.1em !important;
    }

    .tabs {
        padding: 5px;
        gap: 5px;
    }

    .tab-button {
        padding: 10px 12px;
        font-size: 0.85em;
    }

    .tab-content {
        padding: 12px;
    }

    h2 {
        font-size: 1.25em;
        margin-bottom: 12px;
    }

    button {
        padding: 11px 18px;
        font-size: 0.9em;
    }

    input, select {
        padding: 10px;
        font-size: 0.95em;
    }

    table {
        font-size: 0.78em;
    }

    th, td {
        padding: 8px 4px;
    }

    .result-badge {
        padding: 4px 12px;
        font-size: 0.9em;
    }

    #intervalTable {
        font-size: 0.68em;
    }

    #intervalTable th,
    #intervalTable td {
        min-width: 28px;
        max-width: 28px;
        padding: 4px 1px;
    }

    #intervalTable thead th {
        padding: 6px 1px;
        font-size: 0.9em;
    }

    #intervalTable thead tr:nth-child(2) td {
        padding: 6px 1px;
        font-size: 0.75em;
        line-height: 1.2;
    }

    .chart-container {
        padding: 10px;
        margin-bottom: 15px;
    }

    .chart-title {
        font-size: 1em;
        margin-bottom: 10px;
        line-height: 1.4;
    }

    .stat-value {
        font-size: 1.5em !important;
    }

    #numberButtons {
        gap: 6px;
    }

    #numberButtons button {
        min-width: 40px !important;
        padding: 10px 5px;
        font-size: 0.9em;
    }

    .new-draw-notification {
        bottom: 10px !important;
        left: 5px !important;
        right: 5px !important;
        padding: 12px;
        font-size: 0.9em;
    }

    .notification-title {
        font-size: 1.1em;
    }

    .notification-content {
        font-size: 1.1em;
    }

    #recentFiveDraws > div {
        padding: 8px 10px;
        margin-bottom: 5px;
    }

    .ai-model-streak-row {
        font-size: 0.62em !important;
    }

    #recentFiveDraws > div > div:first-child {
        font-size: 0.8em;
    }

    #recentFiveDraws > div > div:last-child {
        font-size: 1.3em !important;
    }

    .bet-panel {
        width: calc(100% - 10px);
        bottom: 5px;
        right: 5px;
        max-width: none;
    }

    .bet-panel-header {
        padding: 10px 12px;
        font-size: 0.9em;
    }

    .bet-panel-content {
        padding: 12px;
    }

    .bet-numbers {
        grid-template-columns: repeat(7, 1fr);
        gap: 5px;
    }

    .bet-number-btn {
        padding: 10px 2px;
        font-size: 0.85em;
    }

    .frequency-bar {
        margin: 8px 0;
    }

    .frequency-label {
        font-size: 0.85em;
        width: auto;
        min-width: 80px;
    }

    .frequency-count {
        font-size: 0.85em;
        min-width: 70px;
    }

    .frequency-progress {
        height: 25px;
    }

    div[style*="grid-template-columns: repeat(auto-fit"] {
        grid-template-columns: 1fr !important;
    }

    div[style*="grid-template-columns: repeat(auto-fill"] {
        grid-template-columns: repeat(3, 1fr) !important;
    }

}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .tab-button:hover {
        transform: none;
    }

    .stat-card:hover {
        transform: none;
    }

    button:hover {
        transform: none;
    }

    .bet-number-btn:hover {
        transform: none;
    }

    button {
        min-height: 44px;
    }

    .tab-button {
        min-height: 44px;
    }

    .bet-number-btn {
        min-height: 40px;
    }
}

/* 横屏优化 */
@media (max-width: 768px) and (orientation: landscape) {
    .latest-draw-layout {
        grid-template-columns: 1fr 280px !important;
    }

    .tabs {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .tab-button {
        flex: 1 1 auto;
        min-width: 70px;
    }

    #recentFiveDraws {
        max-width: 280px !important;
    }

    body {
        padding: 10px;
    }

    .bet-panel {
        width: 260px !important;
    }
}

/* 超小屏优化 */
@media (max-width: 360px) {
    h1 {
        font-size: 1.2em;
    }

    .subtitle {
        font-size: 0.8em;
    }

    #latestDrawNumber {
        font-size: 1.4em !important;
    }

    #latestResult {
        font-size: 2em !important;
    }

    #latestThreeNumbers .num-badge {
        width: 35px !important;
        height: 35px !important;
        line-height: 35px !important;
    }

    .tab-button {
        font-size: 0.8em;
        padding: 10px;
    }

    table {
        font-size: 0.75em;
    }

    #intervalTable {
        font-size: 0.65em;
    }

    #intervalTable th,
    #intervalTable td {
        min-width: 26px;
        max-width: 26px;
    }

    .bet-numbers {
        grid-template-columns: repeat(7, 1fr);
        gap: 4px;
    }

    .bet-number-btn {
        padding: 8px 1px;
        font-size: 0.8em;
    }
}

@media (prefers-reduced-motion: reduce) {
    .vs-dot { animation: none; }
    .toast { animation-duration: 0.2s; }
    .latest-draw-card, .tab-content, .tab-button, .theme-toggle, .fav-modal, button, .bet-number-btn {
        transition-duration: 0.1s;
    }
}

