* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html, body {
    background-color: #f5f7fa;
    font-family: "PingFang SC", "YaHei", sans-serif;
    max-width: 480px;
    margin: 0 auto;
    height: 100%;
}
.app-wrap {
    display: flex;
    flex-direction: column;
    height: 100%;
}
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    /* 底部留出 tab 栏高度 + 安全区，防止内容被遮挡（与 Tab 栏高度精确对齐，无多余缝隙） */
    padding-bottom: calc(56px + env(safe-area-inset-bottom));
}
.top-bg {
    background: linear-gradient(180deg, #ff6b7b 0%, #ff8794 100%);
    border-radius: 0 0 20px;
    box-shadow: 0 6px 16px rgba(255,107,123,0.2);
}

.date-wrap-container {
    margin-top: 4px !important;
    margin-bottom: 4px !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
}
.date-scroll-wrap {
    display: flex;
    align-items: center;
    justify-content: space-around;
    overflow-x: auto;
    flex: 1;
    padding: 4px 0;
    -webkit-overflow-scrolling: touch;
}
.date-scroll-wrap::-webkit-scrollbar { display: none; }
.date-item {
    transition: all 0.25s ease;
    cursor: pointer;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background-color: #fef2f2;
    color: #666;
}
.date-item.active {
    background-color: #ef4444;
    color: #fff;
    box-shadow: 0 2px 8px rgba(239,68,68,0.25);
}
.date-item .week { font-size: 10px; line-height: 1; }
.date-item .day  { font-size: 13px; font-weight: 50; line-height: 1; }

.data-bar {
    background: linear-gradient(90deg, #fff5f5 0%, #fffafa 100%);
    border: 1px solid #ffe6e6;
    border-radius: 10px;
    padding: 6px 12px;
    margin: 6px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px;
}
.match-card {
    margin-bottom: 6px;
    position: relative;
    background: #fff;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.stat-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin: -16px 16px 4px 16px;
    padding: 8px 16px;
    position: relative;
    z-index: 10;
}
.stat-number { font-size: 20px; font-weight: bold; color: #ef4444; }
.stat-label  { font-size: 11px; color: #666; margin-top: 2px; }

.team-box { width: auto; flex: 1; display: flex; align-items: center; gap: 4px; }
.team-name {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 6.5rem;
    color: #1f2937;
}
.score-middle {
    width: 60px;
    flex-shrink: 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.half-score-box {
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 0px 4px;
    font-size: 10px;
    color: #999;
    line-height: 1;
}
.ai-analysis {
    background: linear-gradient(90deg, #fff5f5 0%, #fffafa 100%);
    border: 1px solid #ffe6e6;
    border-radius: 10px;
    padding: 8px 10px;
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.ai-title   { color: #ef4444; font-weight: bold; font-size: 13px; flex-shrink: 0; }
.ai-content { flex: 1; font-size: 12px; color: #666; line-height: 1.4; }
.vs-text    { font-size: 20px; font-weight: 700; color: #ef4444; letter-spacing: 0px; }

.team-score       { display: flex; align-items: center; gap: 3px; white-space: nowrap; }
.team-score-label { font-size: 11px; color: #666; }
.team-score-value { font-size: 16px; font-weight: bold; color: #ef4444; }

.league-tag {
    background-color: #f0f7ff;
    color: #4078c0;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1;
    flex-shrink: 0;
}
.status-tag  { padding: 2px 8px; border-radius: 10px; font-size: 13px; line-height: 1; border: none; flex-shrink: 0; }
.status-end  { background: #f3f4f6; color: #6b7280; }
.status-wait { background: #fff7ed; color: #c2410c; }
.hit-badge {
    position: absolute;
    bottom: 12px; right: 12px;
    background: #ef4444;
    color: #fff;
    font-size: 10px; font-weight: bold;
    padding: 2px 6px;
    border-radius: 8px;
    z-index: 10;
}
.hit-badge.miss { background: #6b7280 !important; }

.odds-container { display: flex; align-items: stretch; margin-top: 6px; gap: 3px; }
.odds-label-box,
.odds-mark-box,
.odds-option-box { height: 30px !important; }
.odds-label-column { display: flex; flex-direction: column; gap: 4px; width: 46px; }
.odds-label-box {
    background: #f3f4f6;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: #555;
    font-weight: 500;
}
.odds-mark-column { display: flex; flex-direction: column; gap: 4px; width: 26px; }
.odds-mark-box {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: #888;
}
.odds-mark-box.handicap { color: #ef4444; }
.odds-options-container { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.odds-options-row { display: flex; gap: 3px; }
.odds-option-box {
    flex: 1;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.2s ease;
    pointer-events: none;
    cursor: default;
}
.odds-option-box.result:not(.hit):not(.active) .odds-text,
.odds-option-box.result:not(.hit):not(.active) .odds-value {
    color: #ef4444 !important;
    font-weight: bold !important;
}
.odds-option-box.hit {
    background: #ef4444 !important;
    border-color: #ef4444 !important;
    box-shadow: inset 0 0 4px rgba(0,0,0,0.1);
}
.odds-option-box.hit .odds-text,
.odds-option-box.hit .odds-value { color: #ffffff !important; font-weight: bold !important; }
.odds-option-box.miss {
    background: #f3f4f6 !important;
    border-color: #d1d5db !important;
}
.odds-option-box.miss .odds-text,
.odds-option-box.miss .odds-value { color: #9ca3af !important; font-weight: normal !important; }
.odds-option-box.active {
    background: #ef4444 !important;
    border-color: #ef4444 !important;
    box-shadow: inset 0 0 4px rgba(0,0,0,0.1);
}
.odds-option-box.active .odds-text,
.odds-option-box.active .odds-value { color: #fff !important; font-weight: bold !important; }
.odds-text  { font-size: 14px; font-weight: 500; }
.odds-value { font-size: 15px; font-weight: 600; }

.filter-btn {
    background-color: #ef4444;
    color: #fff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
}

.bottom-bar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    max-width: 480px;
    margin: 0 auto;
    background: linear-gradient(90deg, #fff5f5 0%, #fff 100%);
    border-top: 1px solid #ffe6e6;
    box-shadow: 0 -2px 12px rgba(255,107,123,0.15);
    padding: 12px 16px;
    display: none;          /* 默认隐藏，initVip() 确认非 VIP 后才显示，避免加载闪烁 */
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
    transition: all 0.3s ease;
    z-index: 998;
}
.bottom-bar.hidden  { display: none; }
.bottom-bar.visible { display: flex; }
.bottom-bar .price-title { font-size: 22px; font-weight: bold; color: #f97316; }
.bottom-bar .price-desc  { font-size: 14px; color: #6b7280; }
.bottom-bar .price-offer {
    font-size: 14px; color: #ef4444; font-weight: 500;
    cursor: pointer; text-decoration: underline;
    display: flex; align-items: center; gap: 4px;
}
.bottom-bar .btn-trial {
    background: linear-gradient(90deg, #ef4444 0%, #f97316 100%);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 25px;
    font-size: 16px; font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(239,68,68,0.3);
    transition: transform 0.2s ease;
}
.bottom-bar .btn-trial:active { transform: scale(0.95); }

.cs-icon { width: 16px; height: 16px; flex-shrink: 0; display: inline-block; }

.vip-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 20px;
    padding: 0 8px;
    border-radius: 10px;
    font-size: 11px; font-weight: 500;
    margin-left: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #888;
    color: #fff;
    gap: 4px;
}
.vip-badge.inactive { background-color: #9ca3af; color: #ffffff; border: none; }
.vip-badge.active {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #000;
    border: 2px solid #f59e0b;
    box-shadow: 0 2px 8px rgba(245,158,11,0.4);
    font-weight: bold;
}
.vip-badge::before { content: "VIP开通 >"; }
.vip-days { font-size: 12px; color: #ef4444; font-weight: bold; margin-left: 6px; }

.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999; opacity: 0; visibility: hidden;
    transition: all 0.3s ease;
}
.modal-overlay.show { opacity: 1; visibility: visible; }
.modal-box { background: #fff; border-radius: 16px; width: 90%; max-width: 340px; padding: 20px; }
.package-item {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.package-item.active { border-color: #ff4d4f; background: #fff2f2; }
.input-key {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px 12px;
    margin-top: 10px;
    outline: none;
}
.pay-btn {
    width: 100%;
    background: #ff4d4f;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px;
    margin-top: 15px;
    font-weight: bold;
    cursor: pointer;
}
.close-btn {
    width: 100%;
    background: #f5f5f5;
    color: #666;
    border: none;
    border-radius: 8px;
    padding: 12px;
    margin-top: 8px;
    cursor: pointer;
}
.info-btn { cursor: pointer; transition: transform 0.2s ease; }

/* ===================== 底部固定 Tab 导航栏 ===================== */
.bottom-nav {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    width: 100%;
    max-width: 480px;
    height: 56px;
    display: flex;
    align-items: stretch;
    background: #fff;
    border-top: 1px solid #f0f0f0;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
    z-index: 1000;
    padding-bottom: constant(safe-area-inset-bottom);
    padding-bottom: env(safe-area-inset-bottom);
}
.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-decoration: none;
    color: #9ca3af;
    font-size: 10px;
    cursor: pointer;
    transition: color 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.nav-item.active { color: #ef4444; }
.nav-item:active { opacity: 0.7; }
.nav-icon {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.nav-icon svg { width: 22px; height: 22px; fill: currentColor; }
.nav-label { font-size: 10px; line-height: 1; }

/* ===================== ICP 备案页脚 ===================== */
/* 模式一：审核中 — 固定在视口最底部，替代 Tab 栏（Tab 栏此时隐藏） */
.icp-footer--fixed {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    bottom: 0;
    z-index: 1000;
    background: #fff5f5;
    border-top: 1px solid #ffe6e6;
    padding: 10px 12px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #666;
    text-align: center;
    line-height: 1.5;
}
/* 模式二：已过审 — 内嵌在内容末尾，内容不足时自动下沉贴紧 Tab 栏 */
.icp-footer--inline {
    max-width: 480px;
    margin: auto auto 0;   /* margin-top:auto 让它在内容少时沉底 */
    width: 100%;
    padding: 12px 16px;
    background: #fff5f5;
    border-top: 1px solid #ffe6e6;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: #666;
    text-align: center;
    line-height: 1.6;
}
.icp-footer--fixed a,
.icp-footer--inline a {
    color: #ef4444;
    text-decoration: none;
    font-weight: 500;
}
.icp-footer--fixed a:active,
.icp-footer--inline a:active { opacity: 0.7; }
.info-btn:active { transform: scale(1.1); }
