﻿/* ========== CSS Variables / Design Tokens ========== */
:root {
    --primary: #6C5CE7;
    --primary-light: #A29BFE;
    --primary-dark: #5A4BD1;
    --secondary: #00CEC9;
    --accent: #FD79A8;
    --accent-light: #FDCB6E;
    --success: #00B894;
    --success-light: #E8F8F5;
    --warning: #FDCB6E;
    --warning-light: #FFF9E6;
    --danger: #FF7675;
    --danger-light: #FFE8E8;
    --gray: #B2BEC3;
    --gray-light: #F0F2F8;
    --bg-primary: #F0F2F8;
    --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.06);
    --shadow-md: 0 4px 16px rgba(108, 92, 231, 0.1);
    --shadow-lg: 0 8px 32px rgba(108, 92, 231, 0.14);
    --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-back {
    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-back:active {
        background: rgba(255,255,255,0.3);
    }

    .header-back i {
        font-size: 16px;
    }

.header-title {
    text-align: center;
    flex: 1;
}

    .header-title h1 {
        font-size: 17px;
        font-weight: 700;
        letter-spacing: 0.5px;
    }

    .header-title span {
        font-size: 11px;
        opacity: 0.8;
        display: block;
        margin-top: -2px;
    }

.header-placeholder {
    width: 36px;
    height: 36px;
}

/* ========== Author Card ========== */
.author-card {
    background: var(--bg-secondary);
    margin: 12px 16px 0;
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-sm);
}

.author-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.3);
}

.author-info {
    flex: 1;
    min-width: 0;
}

.author-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

    .author-name .verified {
        width: 16px;
        height: 16px;
        border-radius: 50%;
        background: var(--primary);
        color: #fff;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 9px;
    }

.author-stats {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 2px;
}

.author-follow-btn {
    flex-shrink: 0;
    padding: 6px 18px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.3);
    transition: transform 0.2s;
}

    .author-follow-btn:active {
        transform: scale(0.95);
    }

/* ========== Article Content ========== */
.article-section {
    background: var(--bg-secondary);
    margin: 12px 16px 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.article-title {
    padding: 16px 16px 12px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

    .article-title .lottery-badge {
        flex-shrink: 0;
        padding: 2px 8px;
        border-radius: 6px;
        background: linear-gradient(135deg, var(--primary), var(--primary-light));
        color: #fff;
        font-size: 11px;
        font-weight: 600;
        margin-top: 2px;
    }

    .article-title .status {
        flex-shrink: 0;
        padding: 2px 8px;
        border-radius: 6px;
        font-size: 11px;
        font-weight: 600;
        margin-top: 2px;
    }

.status-pending {
    background: var(--warning-light);
    color: #E67E22;
}

.status-win {
    background: var(--success-light);
    color: var(--success);
}

.status-lose {
    background: var(--gray-light);
    color: var(--gray);
}

/* ========== Prediction Numbers ========== */
.prediction-list {
    padding: 0 16px 16px;
}

.prediction-item {
    display: flex;
    align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

    .prediction-item:last-child {
        border-bottom: none;
    }

.prediction-label {
    flex-shrink: 0;
    width: 56px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    padding-top: 6px;
}

.prediction-values {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
}

.prediction-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    padding: 0 6px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(108, 92, 231, 0.25);
}

    .prediction-num.single {
        min-width: 32px;
        height: 32px;
        font-size: 14px;
        border-radius: 10px;
    }

.prediction-text {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    word-break: break-all;
}


.line-item {
    margin: 10px 0px;
}

/* ========== Historical Performance ========== */
.history-section {
    background: var(--bg-secondary);
    margin: 12px 16px 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.history-header {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}

    .history-header h3 {
        font-size: 15px;
        font-weight: 600;
        color: var(--text-primary);
        display: flex;
        align-items: center;
        gap: 6px;
    }

        .history-header h3 i {
            color: var(--primary);
        }

.history-stats {
    display: flex;
    gap: 12px;
    font-size: 12px;
}

.history-stat {
    display: flex;
    align-items: center;
    gap: 4px;
}

    .history-stat .dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
    }

.dot-win {
    background: var(--success);
}

.dot-lose {
    background: var(--gray);
}

.history-list {
    list-style: none;
}

.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

    .history-item:active {
        background: var(--gray-light);
    }

    .history-item:last-child {
        border-bottom: none;
    }

.history-item-left {
    flex: 1;
    min-width: 0;
}

.history-item-title {
    font-size: 13px;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

    .history-item-title a {
        color: var(--text-primary);
        transition: color 0.2s;
    }

        .history-item-title a:active {
            color: var(--primary);
        }

.history-result {
    flex-shrink: 0;
    margin-left: 10px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.result-win {
    background: var(--success-light);
    color: var(--success);
}

.result-lose {
    background: var(--gray-light);
    color: var(--gray);
}

/* ========== 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);
    }

/* ========== Bottom 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;
    }

/* ========== Responsive ========== */
@media (max-width: 360px) {
    .author-card {
        padding: 12px;
        gap: 10px;
    }

    .author-avatar {
        width: 42px;
        height: 42px;
        font-size: 18px;
    }

    .prediction-label {
        width: 48px;
        font-size: 12px;
    }
}
