/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #e74c3c;
    --secondary-color: #3498db;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --border-color: #ddd;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f7fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 0;
    box-shadow: var(--shadow);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 24px;
    font-weight: 700;
}

.logo a {
    color: white;
    text-decoration: none;
}

.nav {
    display: flex;
    gap: 20px;
}

.nav a {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 5px;
    transition: background 0.3s;
}

.mipai-toggle {
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: #374151;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.mipai-toggle:hover {
    background: #f9fafb;
}

.mipai-toggle.active {
    border-color: #e74c3c;
    background: #e74c3c;
    color: #fff;
}

.nav a:hover,
.nav a.active {
    background: rgba(255,255,255,0.2);
}

/* Main Content */
.main-content {
    padding: 30px 0;
    min-height: calc(100vh - 200px);
}

/* Ads Section */
.ads-section {
    margin-bottom: 30px;
    max-width: 100%;
    overflow: hidden;
}

.ad-item {
    margin-bottom: 15px;
    margin-left: auto;
    margin-right: auto;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    max-width: 100%;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.ad-item:last-child {
    margin-bottom: 0;
}

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

.ad-image {
    width: 100%;
    height: auto;
    display: block;
    max-height: 150px;
    max-width: 100%;
    object-fit: contain;
}

/* Latest Result Card */
.latest-result {
    margin-bottom: 30px;
}

.result-card {
    background: white;
    border-radius: 15px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.countdown {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
}

.countdown-time {
    font-weight: 700;
    font-size: 20px;
    font-family: 'Courier New', monospace;
}

.card-body {
    padding: 30px;
}

.result-info {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    justify-content: center;
}

.result-info > div {
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f2ff 100%);
    padding: 15px 25px;
    border-radius: 12px;
    border: 2px solid #e8ebff;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
    transition: all 0.3s ease;
}

.result-info > div:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
    border-color: #667eea;
}

.result-info .label {
    color: #667eea;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 5px;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-info .article-card p {
    color: #666;
    font-size: 15px;
    line-height: 1.6;
    margin-top: 10px;
    overflow: hidden;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-word;
}

.result-info .value {
    font-weight: 700;
    font-size: 20px;
    color: #2c3e50;
    display: block;
}

.result-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 30px 0;
    position: relative;
    overflow: hidden;
}

.number-ball {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* Scratch overlay */
.scratch-canvas {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: auto;
    touch-action: none;
    cursor: pointer;
}

.sum-display {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 10px;
}

.sum-label {
    font-size: 32px;
    color: #666;
}

.sum-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--primary-color);
}

.result-tags {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.tag {
    display: inline-block;
    padding: 8px 18px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    color: white !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    border: none;
}

.tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* 大小标签颜色 */
.tag.tag-big {
    background: linear-gradient(135deg, #ff6b35 0%, #ff8c5a 100%) !important;
}

.tag.tag-small {
    background: linear-gradient(135deg, #4ecdc4 0%, #6dd5cd 100%) !important;
}

/* 单双标签颜色 */
.tag.tag-odd {
    background: linear-gradient(135deg, #ffa500 0%, #ffb733 100%) !important;
}

.tag.tag-even {
    background: linear-gradient(135deg, #95e1d3 0%, #a8e6db 100%) !important;
}

/* 组合标签颜色 */
.tag.tag-big-odd {
    background: linear-gradient(135deg, #ff6b35 0%, #ff8c5a 100%);
}

.tag.tag-big-even {
    background: linear-gradient(135deg, #e74c3c 0%, #ec6b5e 100%);
}

.tag.tag-small-odd {
    background: linear-gradient(135deg, #95e1d3 0%, #a8e6db 100%);
}

.tag.tag-small-even {
    background: linear-gradient(135deg, #4ecdc4 0%, #6dd5cd 100%);
}

/* 极值标签 */
.tag.tag-extreme {
    background: linear-gradient(135deg, #9b59b6 0%, #b370cf 100%) !important;
}

.no-data {
    text-align: center;
    color: #999;
    padding: 40px;
}

/* Tabs */
.data-section {
    background: white;
    border-radius: 15px;
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 30px;
}

.tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 2px solid var(--border-color);
}

.tab-btn {
    flex: 1;
    padding: 15px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #666;
    transition: all 0.3s;
}

.tab-btn:hover {
    background: rgba(102, 126, 234, 0.1);
}

.tab-btn.active {
    color: var(--primary-color);
    background: white;
    border-bottom: 3px solid var(--primary-color);
}

.tab-content {
    display: none;
    padding: 30px;
}

.tab-content.active {
    display: block;
}

.mipai-mask {
    position: absolute;
    inset: 0;
    z-index: 3;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    pointer-events: auto;
}

.mipai-mask-box {
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid rgba(231,76,60,0.45);
    color: #e74c3c;
    background: #fff;
    box-shadow: 0 8px 24px rgba(231,76,60,0.10);
}

.mipai-mask-box i {
    font-size: 22px;
    margin-bottom: 6px;
    display: block;
}

.mipai-mask-text {
    font-weight: 700;
    line-height: 1.4;
}

/* Card toolbar under header */
.card-toolbar {
    display: flex;
    justify-content: flex-end;
    padding: 8px 30px 0;
    gap: 10px;
}

/* Table */
.table-responsive {
    overflow-x: auto;
}

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

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

.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: var(--dark-color);
}

.data-table tr:hover {
    background: #f8f9fa;
}

.mini-ball {
    display: inline-block;
    width: 30px;
    height: 30px;
    line-height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    margin: 0 2px;
}

/* Inline numbers e.g. 4+3+3=10 */
.numbers-inline {
    font-family: 'Courier New', Consolas, monospace;
    font-weight: 700;
    color: #2c3e50;
    white-space: nowrap;
}

.badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-big { background: #e74c3c; color: white; }
.badge-small { background: #3498db; color: white; }
.badge-odd { background: #f39c12; color: white; }
.badge-even { background: #27ae60; color: white; }

/* Combo + Shape badges */
.badge-combo {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid;
    background: #fff;
}
.badge-combo.combo-big { color: #e74c3c; border-color: #f5b5ae; }
.badge-combo.combo-small { color: #3498db; border-color: #b6d6f0; }

.shape-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
}
.shape-badge.shape-za6 { background: #64748b; }
.shape-badge.shape-duizi { background: #f59e0b; }
.shape-badge.shape-baozi { background: #6b46c1; }

/* Charts */
.trend-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.chart-container {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.chart-container h3 {
    margin-bottom: 15px;
    color: var(--dark-color);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-item {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    text-align: center;
}

.stat-item h4 {
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
}

.stat-item .value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
}

/* Predict Panel */
.predict-panel {
    text-align: center;
}

.predict-notice {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #856404;
}

.predict-content {
    padding: 20px;
}

/* Articles Section */
.articles-section {
    margin-top: 40px;
}

.articles-section h2 {
    margin-bottom: 20px;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.article-card {
    background: white;
    padding: 24px;
    border-radius: 18px;
    border: 1px solid rgba(226,232,240,0.8);
    box-shadow: 0 15px 35px rgba(15, 23, 42, 0.06);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    overflow: hidden;
}

.article-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 22px 45px rgba(37, 99, 235, 0.18);
    border-color: rgba(59,130,246,0.25);
}

.article-card h3 {
    margin-bottom: 12px;
}

.article-card h3 a {
    color: var(--dark-color);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.article-card h3 a:hover {
    color: var(--primary-color);
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    color: #64748b;
    font-size: 13px;
    margin-bottom: 14px;
}

.article-card p {
    color: #475569;
    line-height: 1.7;
    font-size: 14px;
}

.articles-pagination {
    margin-top: 32px;
    display: flex;
    justify-content: center;
}

.articles-pagination .pagination-inner {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    background: rgba(241,245,249,0.9);
    border-radius: 999px;
    padding: 10px 14px;
    border: 1px solid rgba(226,232,240,0.9);
    box-shadow: 0 14px 28px rgba(15,23,42,0.08);
}

.articles-pagination .page-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 999px;
    text-decoration: none;
    color: #1e3a8a;
    background: #fff;
    border: 1px solid rgba(148,163,184,0.4);
    transition: all 0.2s ease;
    font-weight: 600;
}

.articles-pagination .page-btn i {
    font-size: 12px;
}

.articles-pagination .page-btn:hover:not(.disabled) {
    transform: translateY(-2px);
    border-color: rgba(59,130,246,0.5);
    color: #2563eb;
    box-shadow: 0 12px 24px rgba(59,130,246,0.18);
}

.articles-pagination .page-btn.disabled {
    pointer-events: none;
    opacity: 0.45;
}

.articles-pagination .page-info {
    font-size: 13px;
    color: #475569;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.9);
    border: 1px solid rgba(226,232,240,0.9);
}

.articles-footer {
    margin-top: 18px;
    display: flex;
    justify-content: center;
}

.articles-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 999px;
    border: 1px solid rgba(37, 99, 235, 0.25);
    color: #1d4ed8;
    font-weight: 600;
    text-decoration: none;
    background: linear-gradient(135deg, rgba(59,130,246,0.1), rgba(37,99,235,0.08));
    box-shadow: 0 8px 16px rgba(59, 130, 246, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s;
}

.articles-more:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.2);
    border-color: rgba(37, 99, 235, 0.45);
}

.article-card h3 {
    margin-bottom: 10px;
}

.article-card h3 a {
    color: var(--dark-color);
    text-decoration: none;
}

.article-card h3 a:hover {
    color: var(--primary-color);
}

.article-meta {
    display: flex;
    gap: 15px;
    color: #999;
    font-size: 14px;
    margin-bottom: 10px;
}

.article-card p {
    color: #666;
    line-height: 1.6;
}

/* Article Detail */
.article-detail {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    margin-bottom: 40px;
}

.article-toolbar {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.article-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 10px;
    text-decoration: none;
    color: #334155;
    background: #f1f5f9;
    border: 1px solid rgba(148, 163, 184, 0.4);
    transition: all 0.2s ease;
}

.article-back:hover {
    background: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.7);
    color: #1e293b;
}

.article-back.primary {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 8px 18px rgba(99, 102, 241, 0.25);
}

.article-back.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(79, 70, 229, 0.3);
}

.article-header {
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.article-header h1 {
    font-size: 32px;
    color: var(--dark-color);
    margin-bottom: 15px;
}

.article-content {
    font-size: 16px;
    line-height: 1.8;
    color: #333;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 20px 0;
}

.article-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Article prev/next navigation */
.article-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 0;
}

.article-nav > div { display: flex; gap: 12px; }

.nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
    border: 1px solid rgba(148,163,184,0.45);
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    color: #1f2937;
    transition: all 0.2s ease;
}

.nav-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(2, 6, 23, 0.08);
    border-color: rgba(59,130,246,0.45);
    color: #1d4ed8;
}

.nav-btn.prev i { color: #64748b; }
.nav-btn.next i { color: #64748b; }

/* Compact styling for article-nav buttons */
.article-nav .nav-btn {
  padding: 8px 12px;
  background: #ffffff;
  border-color: rgba(148,163,184,0.35);
  box-shadow: none;
  color: #334155;
  font-size: 14px;
}
.article-nav .nav-btn:hover {
  border-color: rgba(59,130,246,0.45);
  color: #1d4ed8;
}
.article-nav .label { color: #64748b; }
.article-nav .title { color: #1f2937; }

/* Responsive tweaks for article-nav */
@media (max-width: 992px) {
  .article-footer { flex-direction: column; align-items: stretch; }
  .article-nav { flex-direction: column; align-items: stretch; }
  .article-nav .nav-btn { width: 100%; justify-content: space-between; }
  .article-nav .title { max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

@media (max-width: 576px) {
  .article-nav .nav-btn { justify-content: center; }
  .article-nav .title, .article-nav .sep { display: none; }
}

.btn-back {
    display: inline-block;
    padding: 10px 20px;
    background: var(--secondary-color);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background 0.3s;
}

.btn-back:hover {
    background: #2980b9;
}

.related-articles {
    margin-top: 40px;
}

.related-articles h2 {
    margin-bottom: 20px;
    color: var(--dark-color);
}

/* Footer */
.footer {
    background: var(--dark-color);
    color: white;
    text-align: center;
    padding: 30px 0;
    margin-top: 50px;
}

.footer p {
    margin: 5px 0;
}

/* Loading */
.loading {
    text-align: center;
    color: #999;
    padding: 20px;
}

/* Responsive - 平板端 */
@media (max-width: 992px) {
    .container {
        padding: 0 20px;
    }
    
    .result-card {
        padding: 25px;
    }
    
    .tabs {
        gap: 8px;
    }
    
    .tab-btn {
        padding: 10px 15px;
        font-size: 14px;
    }
}

/* Responsive - 移动端 */
@media (max-width: 768px) {
    /* 头部优化 */
    .header {
        padding: 15px 0;
    }
    
    .header .container {
        flex-direction: column;
        gap: 12px;
    }
    
    .header h1 {
        font-size: 22px;
    }
    
    .nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }
    
    .nav a {
        padding: 8px 15px;
        font-size: 13px;
    }
    
    /* 容器优化 */
    .container {
        padding: 0 15px;
    }
    
    /* 广告位优化 */
    .ads-section {
        margin-bottom: 20px;
    }
    
    .ad-item {
        border-radius: 8px;
    }
    
    .ad-image {
        max-height: 100px;
        object-fit: contain;
    }
    
    /* 开奖结果卡片 */
    .result-card {
        padding: 20px 15px;
        margin-bottom: 15px;
    }
    
    .result-header h2 {
        font-size: 18px;
    }
    
    .countdown {
        font-size: 13px;
        padding: 6px 12px;
    }
    
    .result-info {
        flex-direction: column;
        gap: 12px;
    }
    
    .result-info > div {
        padding: 12px 20px;
    }
    
    .result-info .label {
        font-size: 12px;
    }
    
    .result-info .value {
        font-size: 18px;
    }
    
    .result-numbers {
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .number-ball {
        width: 55px;
        height: 55px;
        font-size: 26px;
    }
    
    .sum-display {
        font-size: 16px;
    }
    
    .sum-value {
        font-size: 32px;
    }
    
    .result-tags {
        justify-content: center;
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .tag {
        padding: 6px 14px;
        font-size: 12px;
    }
    
    /* 标签页优化 */
    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        gap: 8px;
        padding: 0 10px;
        position: sticky;
        top: 0;
        background: #fff;
        z-index: 5;
    }
    
    .tab-btn {
        flex: 0 0 auto;
        padding: 10px 14px;
        font-size: 13px;
        min-width: 88px;
    }
    
    .tab-content {
        padding: 15px;
    }
    
    /* 表格优化 */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .trend-table,
    .stats-table,
    .predict-table {
        font-size: 11px;
        min-width: 600px;
    }

    .card-body {
        padding: 15px;
    }
    
    .trend-table thead th,
    .stats-table thead th,
    .predict-table thead th {
        padding: 8px 4px;
        font-size: 11px;
    }
    
    .trend-table tbody td,
    .stats-table tbody td,
    .predict-table tbody td {
        padding: 6px 4px;
    }
    
    .trend-badge {
        padding: 3px 8px;
        font-size: 10px;
    }
    
    /* 统计表格 */
    .stats-table {
        font-size: 12px;
    }
    
    .stats-number {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
    
    .stats-value {
        font-size: 16px;
    }
    
    /* 下一期预测卡片 */
    .next-predict {
        margin: 15px 0;
    }
    
    .next-predict-content {
        padding: 15px;
    }
    
    .next-predict-title {
        font-size: 16px;
        margin-bottom: 12px;
    }
    
    .next-predict-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .predict-stat-item {
        padding: 12px;
    }
    
    .stat-label {
        font-size: 11px;
    }
    
    .stat-value-big {
        font-size: 20px;
    }
    
    .stat-value-highlight {
        font-size: 22px;
    }
    
    /* 文章网格 */
    .articles-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .article-card {
        padding: 15px;
    }
    
    .article-card h3 {
        font-size: 16px;
    }
    
    /* 文章详情 */
    .article-detail {
        padding: 20px 15px;
    }
    
    .article-header h1 {
        font-size: 22px;
    }
    
    .article-meta {
        font-size: 13px;
        flex-wrap: wrap;
    }
    
    /* 页脚 */
    .footer {
        padding: 15px;
        font-size: 13px;
    }
}

/* Responsive - 小屏手机 */
@media (max-width: 576px) {
    /* 头部 */
    .header h1 {
        font-size: 20px;
    }
    
    .nav a {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    /* 容器 */
    .container {
        padding: 0 10px;
    }
    
    /* 开奖结果 */
    .result-card {
        padding: 15px 10px;
    }
    
    .result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .result-header h2 {
        font-size: 16px;
    }
    
    .countdown {
        font-size: 12px;
        padding: 5px 10px;
    }
    
    .result-info > div {
        padding: 10px 15px;
    }
    
    .result-info .label {
        font-size: 11px;
    }
    
    .result-info .value {
        font-size: 16px;
    }
    
    .number-ball {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
    
    .sum-value {
        font-size: 28px;
    }
    
    .tag {
        padding: 5px 12px;
        font-size: 11px;
    }
    
    /* 标签页 */
    .tabs {
        padding: 0 5px;
        gap: 4px;
    }
    
    .tab-btn {
        padding: 8px 10px;
        font-size: 12px;
    }
    
    .tab-content {
        padding: 12px 8px;
    }
    
    /* 表格 */
    .trend-table,
    .stats-table,
    .predict-table {
        font-size: 10px;
        min-width: 550px;
    }
    
    .trend-table thead th,
    .stats-table thead th,
    .predict-table thead th {
        padding: 6px 3px;
        font-size: 10px;
    }
    
    .trend-table tbody td,
    .stats-table tbody td,
    .predict-table tbody td {
        padding: 5px 3px;
    }
    
    .trend-badge {
        padding: 2px 6px;
        font-size: 9px;
    }
    
    /* 统计数字 */
    .stats-number {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }
    
    .stats-value {
        font-size: 14px;
    }
    
    /* 预测卡片 */
    .next-predict-content {
        padding: 12px;
    }
    
    .next-predict-title {
        font-size: 14px;
    }
    
    .next-predict-stats {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .predict-stat-item {
        padding: 10px;
    }
    
    .stat-label {
        font-size: 10px;
    }
    
    .stat-value-big {
        font-size: 18px;
    }
    
    .stat-value-highlight {
        font-size: 20px;
    }
    
    /* 文章卡片 */
    .article-card {
        padding: 12px;
    }
    
    .article-card h3 {
        font-size: 15px;
    }
    
    .article-meta {
        font-size: 12px;
    }
    
    /* 文章详情 */
    .article-detail {
        padding: 15px 10px;
    }
    
    .article-header h1 {
        font-size: 20px;
    }
    
    .article-content {
        font-size: 15px;
        line-height: 1.8;
    }
    
    /* 页脚 */
    .footer {
        padding: 12px;
        font-size: 12px;
    }
}

/* 走势表格样式 */
.trend-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.trend-table thead th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 8px;
    text-align: center;
    font-weight: 600;
    border: 1px solid #e0e0e0;
}

.trend-table tbody td {
    padding: 10px 8px;
    text-align: center;
    border: 1px solid #e0e0e0;
    background: white;
}

.trend-table tbody tr:nth-child(even) {
    background: #f9f9f9;
}

.trend-table tbody tr:hover {
    background: #f0f0f0;
}

/* 走势标记样式 */
.trend-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
    color: white;
}

.trend-badge.trend-big {
    background: #ff6b35;
}

.trend-badge.trend-small {
    background: #4ecdc4;
}

.trend-badge.trend-odd {
    background: #ffa500;
}

.trend-badge.trend-even {
    background: #95e1d3;
}

.trend-badge.trend-big-odd {
    background: #ff6b35;
}

.trend-badge.trend-big-even {
    background: #e74c3c;
}

.trend-badge.trend-small-odd {
    background: #95e1d3;
}

.trend-badge.trend-small-even {
    background: #4ecdc4;
}

/* 预测表格样式 */
.predict-notice {
    background: #fff9e6;
    border: 1px solid #ffe58f;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.predict-notice i {
    color: #faad14;
    font-size: 18px;
}

.predict-notice span {
    color: #8c6d1f;
    font-size: 14px;
}

.predict-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.predict-table thead th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 8px;
    text-align: center;
    font-weight: 600;
    border: 1px solid #e0e0e0;
}

.predict-table tbody td {
    padding: 10px 8px;
    text-align: center;
    border: 1px solid #e0e0e0;
    background: white;
}

.predict-table tbody tr:nth-child(even) {
    background: #f9f9f9;
}

.predict-table tbody tr:hover {
    background: #f0f0f0;
}

/* 预测文本样式 */
.predict-text {
    font-weight: 600;
    font-size: 13px;
}

.predict-text.text-big {
    color: #ff6b35;
}

.predict-text.text-small {
    color: #4ecdc4;
}

/* 结果标记样式 */
.result-correct {
    color: #52c41a;
    font-size: 18px;
    font-weight: bold;
}

.result-wrong {
    color: #ff4d4f;
    font-size: 18px;
    font-weight: bold;
}

/* 统计表格样式 */
.stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.stats-table thead th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 8px;
    text-align: center;
    font-weight: 600;
    border: 1px solid #e0e0e0;
}

.stats-table tbody td {
    padding: 12px 15px;
    text-align: left;
    border: 1px solid #e0e0e0;
    background: white;
}

.stats-table tbody tr:nth-child(even) {
    background: #f9f9f9;
}

.stats-table tbody tr:hover {
    background: #f0f0f0;
}

/* 统计数字样式 */
.stats-num {
    display: inline-block;
    width: 32px;
    height: 32px;
    line-height: 32px;
    text-align: center;
    background: #1890ff;
    color: white;
    border-radius: 50%;
    font-weight: 600;
    font-size: 14px;
}

.stats-value {
    font-weight: 600;
    color: #333;
}

.stats-value.hot-number {
    color: #ff4d4f;
    font-size: 16px;
}

/* 下一期预测样式 */
.next-predict {
    margin-bottom: 20px;
}

.next-predict-loading {
    text-align: center;
    padding: 20px;
    color: #999;
}

.next-predict-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 25px;
    color: white;
    box-sizing: border-box;
    width: 100%;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.next-predict-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.next-predict-title i {
    font-size: 20px;
}

.next-predict-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 15px;
}

.predict-stat-item {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    min-width: 0;
    box-sizing: border-box;
    transition: all 0.3s;
}

.predict-stat-item:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.predict-stat-item.highlight {
    background: rgba(255, 255, 255, 0.25);
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.stat-label {
    font-size: 12px;
    opacity: 0.9;
    margin-bottom: 8px;
}

.stat-value-big {
    font-size: 24px;
    font-weight: 700;
}

.stat-value-highlight {
    font-size: 28px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.next-predict-footer {
    text-align: center;
    font-size: 12px;
    opacity: 0.8;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 15px;
}

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.back-to-top:active {
    transform: translateY(-2px);
}

/* 移动端优化 */
@media (max-width: 768px) {
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 18px;
    }

    /* Predict card overrides (placed after base to win cascade) */
    .next-predict-content { padding: 15px; }
    .next-predict-title { font-size: 16px; margin-bottom: 12px; }
    .next-predict-stats { grid-template-columns: repeat(2, 1fr) !important; gap: 10px; }
    .predict-stat-item { padding: 12px; }
    .stat-label { font-size: 12px; }
    .stat-value-big { font-size: 20px; }
    .stat-value-highlight { font-size: 20px; }
}

/* Pagination (Predict) */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 0 6px;
}
.pagination .page-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #374151;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease, color .15s ease, background .15s ease, border-color .15s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  outline: none;
}
.pagination .page-btn i { font-size: 12px; opacity: .9; }
.pagination .page-btn:hover:not([disabled]) {
  transform: translateY(-1px);
  border-color: #c7d2fe;
  background: #f8fafc;
  color: #4f46e5;
  box-shadow: 0 4px 12px rgba(79,70,229,0.15);
}
.pagination .page-btn:focus-visible { box-shadow: 0 0 0 3px rgba(79,70,229,.25); }
.pagination .page-btn[disabled] {
  background: #f9fafb;
  color: #9ca3af;
  border-color: #e5e7eb;
  box-shadow: none;
}
.pagination .page-info {
  color: #6b7280;
  font-size: 13px;
  background: #f3f4f6;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
}

@media (max-width: 576px) {
  .pagination .page-btn { padding: 6px 12px; }
  .pagination .page-info { font-size: 12px; }
}
@media (max-width: 576px) {
    .back-to-top {
        bottom: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    /* Predict card tighter at very small screens */
    .next-predict-content { padding: 12px; }
    .next-predict-title { font-size: 14px; }
    .next-predict-stats { grid-template-columns: 1fr !important; gap: 8px; }
    .predict-stat-item { padding: 10px; }
    .stat-value-big { font-size: 18px; }
    .stat-value-highlight { font-size: 20px; }
}
