/* ============================================================
   足球赛事AI分析预测系统 - H5网站主题
   复刻小程序深色商务风 (#0D1117)
   ============================================================ */

:root {
    --bg-primary: #0D1117;
    --bg-secondary: #161B22;
    --bg-tertiary: #1C2333;
    --accent: #58A6FF;
    --accent-dim: #1A3A5C;
    --success: #3FB950;
    --warning: #D29922;
    --danger: #F85149;
    --text-primary: #F0F6FC;
    --text-secondary: #8B949E;
    --border: #30363D;
    --border-light: #21262D;
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --shadow: 0 2px 12px rgba(0,0,0,0.3);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ===== 导航栏 ===== */
.nav-bar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
    padding: 0 16px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    cursor: pointer;
}

.nav-links {
    display: flex;
    gap: 4px;
    align-items: center;
}

.nav-links a, .nav-links span {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.nav-links a:hover, .nav-links span:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.nav-links .nav-active {
    color: var(--accent);
    font-weight: 600;
}

.nav-balance {
    color: var(--warning);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    background: rgba(210, 153, 34, 0.12);
    border-radius: 20px;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-dim);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
}

/* ===== 页面容器 ===== */
.container {
    max-width: 640px;
    margin: 0 auto;
    padding: 16px;
}

/* ===== 日期选择器 ===== */
.date-picker {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 0;
}

.date-picker button {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.date-picker button:hover {
    background: var(--border);
    color: var(--text-primary);
}

.date-picker .date-today {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent);
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 600;
    width: auto;
    height: auto;
    border-radius: 20px;
}

.date-text {
    font-size: 16px;
    font-weight: 600;
    min-width: 140px;
    text-align: center;
}

/* ===== 比赛卡片 ===== */
.match-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.match-card:hover {
    border-color: var(--accent-dim);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(88, 166, 255, 0.08);
}

.match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.match-code {
    font-size: 11px;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: 4px;
}

.match-league {
    font-size: 12px;
    color: var(--accent);
    font-weight: 500;
}

.match-teams {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.team {
    flex: 1;
    text-align: center;
}

.team-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
}

.team-name {
    font-size: 14px;
    font-weight: 600;
}

.match-vs {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-secondary);
    min-width: 40px;
    text-align: center;
}

.match-score {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 4px;
    color: var(--text-primary);
    min-width: 70px;
    text-align: center;
}

.match-score.score-live {
    color: var(--danger);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.match-time {
    min-width: 50px;
    text-align: center;
}

.match-time .time {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.match-time .status-tag {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    margin-top: 4px;
    display: inline-block;
}

.status-upcoming { background: var(--accent-dim); color: var(--accent); }
.status-live { background: rgba(248, 81, 73, 0.15); color: var(--danger); }
.status-finished { background: rgba(139, 148, 158, 0.12); color: var(--text-secondary); }
.status-started { background: rgba(248, 81, 73, 0.15); color: var(--danger); font-weight: 600; }

.match-background {
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg-primary);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    margin-top: 10px;
    line-height: 1.5;
}

/* ===== 空态 ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state .icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state .title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.empty-state .desc {
    font-size: 13px;
}

/* ===== 登录/表单页 ===== */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    width: 100%;
    max-width: 380px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 24px;
}

.auth-logo .logo-icon {
    font-size: 40px;
    margin-bottom: 8px;
}

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

.auth-logo p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
    transition: border 0.2s;
}

.form-group input:focus {
    border-color: var(--accent);
}

.form-group input::placeholder {
    color: var(--text-secondary);
}

.btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: #4895E8;
}

.btn-primary:disabled {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: not-allowed;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: var(--bg-tertiary);
}

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

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
    width: auto;
}

.auth-switch {
    text-align: center;
    margin-top: 16px;
    font-size: 13px;
    color: var(--text-secondary);
}

.auth-switch a {
    color: var(--accent);
    cursor: pointer;
    text-decoration: none;
}

/* ===== 比赛详情页 ===== */
.detail-header {
    text-align: center;
    padding: 20px 0;
}

.detail-league {
    font-size: 13px;
    color: var(--accent);
    margin-bottom: 16px;
    font-weight: 500;
}

.detail-teams {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 12px;
}

.detail-team {
    text-align: center;
}

.detail-team-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    font-size: 24px;
    font-weight: 700;
    color: var(--accent);
}

.detail-team-name {
    font-size: 15px;
    font-weight: 600;
}

.detail-score-section {
    text-align: center;
}

.detail-score {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: 6px;
    margin: 8px 0;
}

.detail-score.live {
    color: var(--danger);
    animation: pulse 1.5s ease-in-out infinite;
}

.detail-time {
    font-size: 14px;
    color: var(--text-secondary);
}

.detail-status-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-top: 8px;
}

.detail-bg {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin: 16px 0;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
    white-space: pre-line;
}

/* ===== AI分析按钮 ===== */
.ai-buttons {
    position: sticky;
    bottom: 0;
    background: var(--bg-primary);
    padding: 12px 16px 20px;
    border-top: 1px solid var(--border-light);
}

.ai-btn {
    position: relative;
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    background: linear-gradient(135deg, #1A3A5C, #1C3A5E);
    color: var(--accent);
    border: 1px solid var(--accent-dim);
    margin-bottom: 10px;
}

.ai-btn:hover {
    background: linear-gradient(135deg, #1E4070, #204878);
}

.ai-btn.disabled {
    background: var(--bg-secondary);
    color: var(--text-muted);
    border: 1px solid var(--border-light);
    cursor: not-allowed;
    opacity: 0.7;
}

.ai-btn.disabled:hover {
    background: var(--bg-secondary);
}

.ai-hint {
    margin-top: 10px;
    padding: 10px 14px;
    background: #FFF8E1;
    border: 1px solid #FFE082;
    border-radius: 8px;
    color: #795548;
    font-size: 12px;
    line-height: 1.6;
    text-align: center;
}

.ai-btn .btn-badge {
    position: absolute;
    top: -6px;
    right: 10px;
    background: linear-gradient(135deg, #F85149, #D93526);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 10px;
}

.ai-btn .btn-badge.paid {
    background: linear-gradient(135deg, #10B981, #059669);
}

.balance-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-secondary);
}

.balance-bar .balance {
    color: var(--warning);
    font-weight: 600;
}

/* ===== AI分析报告 ===== */
.report-phase {
    display: none;
}

.report-phase.active {
    display: block;
}

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    margin: 20px 0;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #8B5CF6);
    border-radius: 3px;
    transition: width 0.15s ease-out;
}

.loading-text {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 8px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--bg-tertiary);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

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

/* ===== 数据报告卡片 ===== */
.report-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
}

.report-card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.report-card-title .icon {
    font-size: 16px;
}

.report-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 13px;
    border-bottom: 1px solid var(--border-light);
}

.report-row:last-child {
    border-bottom: none;
}

.report-label {
    color: var(--text-secondary);
}

.report-value {
    color: var(--text-primary);
    font-weight: 500;
    text-align: right;
}

.report-value.highlight {
    color: var(--warning);
    font-weight: 600;
}

.report-value.success {
    color: var(--success);
}

.report-value.danger {
    color: var(--danger);
}

/* ===== 详细报告 ===== */
.detail-report {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
}

.detail-report pre {
    white-space: pre-wrap;
    font-family: "SF Mono", "Fira Code", monospace;
    font-size: 13px;
    line-height: 1.8;
    color: var(--text-primary);
}

.detail-report .section-title {
    color: var(--accent);
    font-weight: 700;
    font-size: 14px;
    margin: 12px 0 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border-light);
}

/* ===== 原始文本格式比赛数据 ===== */
.match-data-text {
    white-space: pre-wrap;
    font-family: "SF Mono", "Fira Code", "Consolas", monospace;
    font-size: 13px;
    line-height: 1.8;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    margin: 8px 0 0;
    overflow-x: auto;
    max-height: none;
}

/* ===== 预测摘要横幅 ===== */
.prediction-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--accent-dim), #1C3A5E);
    border: 1px solid var(--accent-dim);
    border-radius: var(--radius);
}

.pred-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    padding: 2px 8px;
    background: rgba(88, 166, 255, 0.15);
    border-radius: 4px;
}

.pred-winner {
    font-size: 15px;
    font-weight: 700;
    color: var(--warning);
}

.pred-confidence {
    font-size: 12px;
    color: var(--text-secondary);
}

.pred-score {
    font-size: 13px;
    font-weight: 600;
    color: var(--success);
}

/* ===== 弹窗 ===== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 200;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    width: 90%;
    max-width: 360px;
}

.modal h3 {
    font-size: 17px;
    margin-bottom: 12px;
    text-align: center;
}

.modal p {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 20px;
    line-height: 1.6;
}

.modal .highlight {
    color: var(--warning);
    font-weight: 600;
}

.modal-buttons {
    display: flex;
    gap: 10px;
}

.modal-buttons .btn {
    flex: 1;
}

/* ===== Token充值页 ===== */
.recharge-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 16px 0;
}

.recharge-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border-light);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.recharge-card .bonus-tag {
    position: absolute;
    top: 0;
    right: 0;
    background: linear-gradient(135deg, #F59E0B, #EF4444);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 0 var(--radius) 0 var(--radius);
}

.recharge-card:hover {
    border-color: var(--accent-dim);
}

.recharge-card.selected {
    border-color: var(--accent);
    background: var(--accent-dim);
}

.recharge-card .token-count {
    font-size: 28px;
    font-weight: 800;
    color: var(--accent);
}

.recharge-card .token-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 4px 0;
}

.recharge-card .price {
    font-size: 18px;
    font-weight: 700;
    color: var(--warning);
}

.recharge-card .price::before {
    content: '¥';
    font-size: 14px;
}

/* ===== 个人中心 ===== */
.profile-header {
    text-align: center;
    padding: 20px 0;
}

.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--accent-dim);
    border: 3px solid var(--border);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    margin: 0 auto 12px;
}

.profile-name {
    font-size: 18px;
    font-weight: 700;
}

.profile-phone {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.stat-row {
    display: flex;
    gap: 10px;
    margin: 16px 0;
}

.stat-card {
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 14px;
    text-align: center;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent);
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.menu-list {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    overflow: hidden;
}

.menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item:hover {
    background: var(--bg-tertiary);
}

.menu-item .arrow {
    color: var(--text-secondary);
    font-size: 18px;
}

.menu-item .menu-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.badge-active {
    background: rgba(63, 185, 80, 0.15);
    color: var(--success);
}

.badge-expired {
    background: rgba(139, 148, 158, 0.12);
    color: var(--text-secondary);
}

/* ===== Toast ===== */
.toast {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    z-index: 300;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
}

.toast.error {
    border-color: var(--danger);
    color: var(--danger);
}

.toast.success {
    border-color: var(--success);
    color: var(--success);
}

/* ===== 响应式 ===== */
@media (max-width: 480px) {
    .container {
        padding: 12px;
    }
    .detail-teams {
        gap: 12px;
    }
    .detail-team-avatar {
        width: 48px;
        height: 48px;
        font-size: 18px;
    }
    .detail-score {
        font-size: 28px;
    }
    .recharge-grid {
        grid-template-columns: 1fr;
    }
}
