/**
 * LottoMaster 样式文件
 * 极简主义设计，毛玻璃特效，响应式布局
 */

/* ========== 全局样式 ========== */
:root {
    --primary-color: #007AFF;
    --success-color: #34C759;
    --danger-color: #FF3B30;
    --warning-color: #FF9500;
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f7;
    --border-color: #d2d2d7;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text-primary);
    background: var(--bg-secondary);
    line-height: 1.6;
}

/* ========== 首页布局 ========== */
.lotto-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.lotto-header {
    text-align: center;
    margin-bottom: 48px;
}

.lotto-header h1 {
    font-size: 48px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

.lotto-header p {
    font-size: 21px;
    color: var(--text-secondary);
}

/* ========== 彩种网格 ========== */
.lotto-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 60px;
}

.lotto-card {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.lotto-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.lotto-card-header {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}

.lotto-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    margin-right: 16px;
    object-fit: cover;
}

.lotto-name {
    font-size: 24px;
    font-weight: 600;
    flex: 1;
}

/* ========== 战绩标签 ========== */
.badge-hit {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-top: 8px;
}

.badge-hit.high {
    background: linear-gradient(135deg, #FF6B6B 0%, #FF3B30 100%);
    color: white;
}

.badge-hit.medium {
    background: linear-gradient(135deg, #FFD93D 0%, #FF9500 100%);
    color: white;
}

.badge-hit.low {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.badge-hit .emoji {
    margin-right: 4px;
}

/* ========== 倒计时 ========== */
.countdown {
    font-size: 16px;
    color: var(--text-secondary);
    margin-top: 12px;
}

.countdown-time {
    font-weight: 600;
    color: var(--primary-color);
}

/* ========== 详情页布局 ========== */
.detail-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

.detail-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 40px;
}

/* ========== 左侧主内容区 ========== */
.detail-main {
    background: var(--bg-primary);
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--shadow-sm);
}

.detail-header {
    text-align: center;
    margin-bottom: 40px;
}

.current-issue {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.issue-number {
    font-size: 42px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 16px;
}

.countdown-large {
    font-size: 56px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.countdown-label {
    font-size: 16px;
    color: var(--text-secondary);
    margin-top: 8px;
}

/* ========== 毛玻璃解锁按钮 ========== */
.unlock-section {
    margin: 40px 0;
    text-align: center;
}

.btn-unlock {
    position: relative;
    display: inline-block;
    padding: 20px 48px;
    font-size: 20px;
    font-weight: 600;
    color: white;
    background: rgba(0, 122, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: 0 8px 32px rgba(0, 122, 255, 0.3);
}

.btn-unlock:hover {
    background: rgba(0, 122, 255, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 122, 255, 0.4);
}

.btn-unlock:active {
    transform: translateY(0);
}

.btn-unlock .lock-icon {
    margin-right: 8px;
}

.content-locked {
    padding: 60px 20px;
    text-align: center;
    background: var(--bg-secondary);
    border-radius: 16px;
    margin: 24px 0;
}

.content-locked .lock-emoji {
    font-size: 64px;
    margin-bottom: 16px;
}

.content-locked p {
    font-size: 18px;
    color: var(--text-secondary);
}

/* ========== 当前预测显示 ========== */
.prediction-display {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 32px;
    margin: 24px 0;
    text-align: center;
}

.prediction-label {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 16px;
}

.prediction-numbers {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    font-size: 24px;
    font-weight: 700;
    border-radius: 12px;
    background: white;
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.number-hit {
    background: var(--danger-color);
    color: white;
    animation: pulse 1s ease-in-out;
}

.number-miss {
    background: #e8e8ed;
    color: #aaa;
    font-weight: 400;
    opacity: 0.6;
}

.number-special {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: 2px solid #764ba2;
}

.number-locked {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.6);
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ========== 历史战绩表 ========== */
.history-section {
    margin-top: 48px;
}

.section-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 24px;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
}

.history-table thead {
    background: var(--bg-secondary);
}

.history-table th {
    padding: 16px;
    text-align: left;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.history-table td {
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.history-table tr:hover {
    background: var(--bg-secondary);
}

.issue-cell {
    font-weight: 600;
    color: var(--primary-color);
}

.numbers-cell {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.numbers-cell .number {
    width: 40px;
    height: 40px;
    font-size: 16px;
}

.hit-cell {
    font-weight: 700;
    font-size: 18px;
}

.hit-cell.high {
    color: var(--danger-color);
}

.hit-cell.medium {
    color: var(--warning-color);
}

.hit-cell.low {
    color: var(--text-secondary);
}

/* ========== 右侧边栏 ========== */
.detail-sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sidebar-card {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.sidebar-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.stat-item {
    text-align: center;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 12px;
}

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

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

/* ========== 关联文章 ========== */
.related-posts {
    list-style: none;
}

.related-post-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.related-post-link {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 15px;
    display: block;
    transition: color 0.2s ease;
}

.related-post-link:hover {
    color: var(--primary-color);
}

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

/* ========== 响应式设计 ========== */
@media (max-width: 1024px) {
    .detail-layout {
        grid-template-columns: 1fr;
    }

    .detail-sidebar {
        order: -1;
    }
}

@media (max-width: 768px) {
    .lotto-grid {
        grid-template-columns: 1fr;
    }

    .lotto-header h1 {
        font-size: 36px;
    }

    .countdown-large {
        font-size: 42px;
    }

    .issue-number {
        font-size: 32px;
    }

    .detail-main {
        padding: 24px;
    }

    .history-table {
        font-size: 14px;
    }

    .history-table th,
    .history-table td {
        padding: 12px 8px;
    }

    .numbers-cell .number {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .lotto-container,
    .detail-container {
        padding: 20px 16px;
    }

    .btn-unlock {
        padding: 16px 32px;
        font-size: 18px;
    }

    .prediction-numbers .number {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
}

/* ========== 加载动画 ========== */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 122, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

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

/* ========== 工具类 ========== */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
