﻿/* ========== CSS Variables / Design Tokens ========== */
:root {
    --primary: #6C5CE7;
    --primary-light: #A29BFE;
    --primary-dark: #5A4BD1;
    --secondary: #00CEC9;
    --accent: #FD79A8;
    --accent-light: #FDCB6E;
    --success: #00B894;
    --warning: #FDCB6E;
    --danger: #FF7675;
    --bg-primary: #F8F9FE;
    --bg-secondary: #FFFFFF;
    --bg-card: #FFFFFF;
    --text-primary: #2D3436;
    --text-secondary: #636E72;
    --text-light: #B2BEC3;
    --border: #E8ECF1;
    --shadow-sm: 0 2px 8px rgba(108, 92, 231, 0.08);
    --shadow-md: 0 4px 16px rgba(108, 92, 231, 0.12);
    --shadow-lg: 0 8px 32px rgba(108, 92, 231, 0.16);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ========== Reset & Base ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding-bottom: calc(60px + var(--safe-bottom));
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
}

/* ========== Header ========== */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: calc(12px + var(--safe-top)) 16px 12px;
    color: #fff;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 480px;
    margin: 0 auto;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-logo-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.header-logo-text {
    display: flex;
    flex-direction: column;
}

    .header-logo-text h1 {
        font-size: 18px;
        font-weight: 700;
        letter-spacing: 0.5px;
        background: linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.85) 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }

    .header-logo-text span {
        font-size: 11px;
        opacity: 0.85;
        display: block;
        margin-top: -2px;
        color: rgba(255,255,255,0.85);
    }

.header-search {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

    .header-search:active {
        background: rgba(255,255,255,0.3);
    }

    .header-search i {
        font-size: 16px;
    }

/* ========== Tab Navigation ========== */
.tab-nav {
    background: var(--bg-secondary);
    position: sticky;
    top: 56px;
    z-index: 99;
    box-shadow: var(--shadow-sm);
}

.tab-nav-inner {
    display: flex;
    max-width: 480px;
    margin: 0 auto;
    position: relative;
}

.tab-item {
    flex: 1;
    text-align: center;
    padding: 14px 0;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

    .tab-item.active {
        color: var(--primary);
        font-weight: 600;
    }

        .tab-item.active::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 50%;
            transform: translateX(-50%);
            width: 24px;
            height: 3px;
            background: linear-gradient(90deg, var(--primary), var(--primary-light));
            border-radius: 2px;
        }

    .tab-item .badge {
        position: absolute;
        top: 8px;
        right: calc(50% - 20px);
        background: var(--accent);
        color: #fff;
        font-size: 9px;
        padding: 1px 5px;
        border-radius: 10px;
        font-weight: 600;
    }

/* ========== Lottery Type Selector ========== */
.lottery-selector {
    background: var(--bg-secondary);
    padding: 12px 16px;
    max-width: 480px;
    margin: 0 auto;
}

.lottery-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 2px;
}

    .lottery-tabs::-webkit-scrollbar {
        display: none;
    }

.lottery-tab {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 20px;
    background: var(--bg-primary);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1.5px solid transparent;
}

    .lottery-tab.active {
        background: linear-gradient(135deg, var(--primary), var(--primary-light));
        color: #fff;
        border-color: transparent;
        box-shadow: 0 4px 12px rgba(108, 92, 231, 0.3);
    }

    .lottery-tab .lottery-icon {
        width: 20px;
        height: 20px;
        flex-shrink: 0;
    }

        .lottery-tab .lottery-icon svg {
            width: 100%;
            height: 100%;
        }

/* ========== Content Area ========== */
.content {
    max-width: 480px;
    margin: 0 auto;
    padding: 12px 16px;
}

/* ========== Daily Recommend (Paid) Banner ========== */
.daily-recommend-banner {
    background: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 50%, #FFE66D 100%);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

    .daily-recommend-banner::before {
        content: '';
        position: absolute;
        top: -30px;
        right: -30px;
        width: 120px;
        height: 120px;
        border-radius: 50%;
        background: rgba(255,255,255,0.15);
    }

    .daily-recommend-banner::after {
        content: '';
        position: absolute;
        bottom: -20px;
        left: -20px;
        width: 80px;
        height: 80px;
        border-radius: 50%;
        background: rgba(255,255,255,0.1);
    }

    .daily-recommend-banner .banner-content {
        position: relative;
        z-index: 1;
    }

    .daily-recommend-banner .banner-icon {
        font-size: 28px;
        margin-bottom: 8px;
    }

    .daily-recommend-banner h3 {
        font-size: 18px;
        font-weight: 700;
        color: #fff;
        margin-bottom: 4px;
        text-shadow: 0 1px 3px rgba(0,0,0,0.1);
    }

    .daily-recommend-banner p {
        font-size: 13px;
        color: rgba(255,255,255,0.9);
        margin-bottom: 12px;
    }

    .daily-recommend-banner .banner-btn {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        background: #fff;
        color: #FF6B6B;
        padding: 8px 20px;
        border-radius: 20px;
        font-size: 14px;
        font-weight: 600;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        transition: transform 0.2s;
    }

        .daily-recommend-banner .banner-btn:active {
            transform: scale(0.95);
        }

/* ========== Section Header ========== */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

    .section-title .icon {
        width: 4px;
        height: 18px;
        background: linear-gradient(180deg, var(--primary), var(--primary-light));
        border-radius: 2px;
    }

    .section-title h3 {
        font-size: 16px;
        font-weight: 600;
        color: var(--text-primary);
    }

.section-subtitle {
    font-size: 12px;
    color: var(--text-light);
}

.section-more {
    font-size: 12px;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 2px;
}

/* ========== Expert Card ========== */
.expert-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.expert-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 14px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

    .expert-card:active {
        transform: scale(0.98);
        box-shadow: var(--shadow-md);
    }

    .expert-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 3px;
        height: 100%;
        background: linear-gradient(180deg, var(--primary), var(--primary-light));
        border-radius: 3px 0 0 3px;
    }

.expert-card-link {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.expert-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.expert-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
}

.expert-info {
    flex: 1;
    min-width: 0;
}

.expert-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

    .expert-name .rank {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 20px;
        height: 20px;
        border-radius: 50%;
        font-size: 11px;
        font-weight: 700;
        color: #fff;
    }

.rank-1 {
    background: linear-gradient(135deg, #FFD700, #FFA500);
}

.rank-2 {
    background: linear-gradient(135deg, #C0C0C0, #A0A0A0);
}

.rank-3 {
    background: linear-gradient(135deg, #CD7F32, #B8860B);
}

.rank-other {
    background: var(--text-light);
}

.expert-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.expert-tag {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--text-secondary);
}

    .expert-tag.hit {
        background: #E8F8F5;
        color: var(--success);
    }

    .expert-tag.streak {
        background: #FFF3E0;
        color: #E67E22;
    }

.expert-arrow {
    color: var(--text-light);
    font-size: 14px;
}

.expert-content {
    padding-left: 50px;
}

.expert-prediction {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

    .expert-prediction .lottery-type {
        color: var(--primary);
        font-weight: 500;
    }

/* ========== Sort Filter ========== */
.sort-filter {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    overflow-x: auto;
    scrollbar-width: none;
}

    .sort-filter::-webkit-scrollbar {
        display: none;
    }

.sort-item {
    flex-shrink: 0;
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--border);
}

    .sort-item.active {
        background: var(--primary);
        color: #fff;
        border-color: var(--primary);
    }

/* ========== Paid Content Overlay ========== */
.paid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}

    .paid-overlay.show {
        display: flex;
    }

.paid-modal {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 360px;
    overflow: hidden;
    animation: modalSlideUp 0.3s ease;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.paid-modal-header {
    background: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 100%);
    padding: 24px 20px;
    text-align: center;
    color: #fff;
}

    .paid-modal-header .lock-icon {
        font-size: 36px;
        margin-bottom: 10px;
    }

    .paid-modal-header h3 {
        font-size: 18px;
        font-weight: 700;
        margin-bottom: 6px;
    }

    .paid-modal-header p {
        font-size: 13px;
        opacity: 0.9;
    }

.paid-modal-body {
    padding: 24px 20px;
}

    .paid-modal-body .phone-input-group {
        margin-bottom: 16px;
    }

        .paid-modal-body .phone-input-group label {
            display: block;
            font-size: 13px;
            font-weight: 500;
            color: var(--text-secondary);
            margin-bottom: 6px;
        }

    .paid-modal-body .phone-input {
        width: 100%;
        padding: 12px 16px;
        border: 1.5px solid var(--border);
        border-radius: var(--radius-md);
        font-size: 16px;
        color: var(--text-primary);
        background: var(--bg-primary);
        outline: none;
        transition: border-color 0.2s;
    }

        .paid-modal-body .phone-input:focus {
            border-color: var(--primary);
        }

        .paid-modal-body .phone-input::placeholder {
            color: var(--text-light);
        }

    .paid-modal-body .phone-hint {
        font-size: 11px;
        color: var(--text-light);
        margin-top: 4px;
    }

    .paid-modal-body .price-info {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 16px;
        background: #FFF9E6;
        border-radius: var(--radius-md);
        margin-bottom: 16px;
    }

.price-info .price-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.price-info .price-value {
    font-size: 24px;
    font-weight: 700;
    color: #FF6B6B;
}

    .price-info .price-value small {
        font-size: 14px;
        font-weight: 400;
    }

.paid-modal-footer {
    padding: 0 20px 24px;
    display: flex;
    gap: 10px;
}

.btn {
    flex: 1;
    padding: 12px;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

    .btn:active {
        transform: scale(0.97);
    }

.btn-cancel {
    background: var(--bg-primary);
    color: var(--text-secondary);
}

.btn-pay {
    background: linear-gradient(135deg, #FF6B6B, #FF8E53);
    color: #fff;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

/* ========== Toast ========== */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.75);
    color: #fff;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 14px;
    z-index: 999;
    display: none;
    animation: toastFade 0.3s ease;
}

    .toast.show {
        display: block;
    }

@keyframes toastFade {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ========== Bottom Tab Bar ========== */
.bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
    z-index: 100;
    padding-bottom: var(--safe-bottom);
}

.bottom-bar-inner {
    display: flex;
    max-width: 480px;
    margin: 0 auto;
}

.bottom-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 0;
    color: var(--text-light);
    font-size: 10px;
    gap: 2px;
    cursor: pointer;
    transition: color 0.2s;
}

    .bottom-tab.active {
        color: var(--primary);
    }

    .bottom-tab i {
        font-size: 20px;
    }

    .bottom-tab .tab-label {
        font-size: 10px;
        font-weight: 500;
    }

/* ========== Loading ========== */
.loading-more {
    text-align: center;
    padding: 20px;
    color: var(--text-light);
    font-size: 13px;
}

    .loading-more .spinner {
        display: inline-block;
        width: 20px;
        height: 20px;
        border: 2px solid var(--border);
        border-top-color: var(--primary);
        border-radius: 50%;
        animation: spin 0.6s linear infinite;
        vertical-align: middle;
        margin-right: 6px;
    }

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========== Empty State ========== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
}

    .empty-state i {
        font-size: 48px;
        margin-bottom: 12px;
    }

    .empty-state p {
        font-size: 14px;
    }

/* ========== Footer ========== */
.footer {
    text-align: center;
    padding: 20px 16px;
    font-size: 11px;
    color: var(--text-light);
    line-height: 1.8;
}

    .footer a {
        color: var(--text-light);
    }

/* ========== Responsive ========== */
@media (max-width: 360px) {
    .expert-content {
        padding-left: 0;
    }

    .expert-header {
        margin-bottom: 8px;
    }
}