/* 全局样式 - 简洁风格 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background-color: #F8FAFC;
    color: #1E3A5F;
    line-height: 1.6;
}

/* 导航栏 */
.navbar {
    background: #FFFFFF;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    padding: 12px 0;
}

.navbar-brand {
    font-weight: 600;
    font-size: 18px;
    color: #1E3A5F;
}

.nav-link {
    color: #64748B;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
}

.nav-link:hover {
    color: #1E3A5F;
}

/* 主容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

main.container {
    padding-top: 32px;
    padding-bottom: 48px;
    min-height: calc(100vh - 200px);
}

/* 卡片样式 */
.card {
    background: #FFFFFF;
    border-radius: 12px;
    border: 1px solid #F1F5F9;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    transition: box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid #F1F5F9;
    padding: 16px 20px;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

/* 按钮样式 */
.btn {
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    padding: 10px 20px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: #2196F3;
    color: #FFFFFF;
}

.btn-primary:hover {
    background: #1976D2;
}

.btn-outline-primary {
    background: transparent;
    color: #2196F3;
    border: 1px solid #2196F3;
}

.btn-outline-primary:hover {
    background: #2196F3;
    color: #FFFFFF;
}

.btn-outline-secondary {
    background: transparent;
    color: #64748B;
    border: 1px solid #E2E8F0;
}

.btn-outline-secondary:hover {
    background: #F1F5F9;
    color: #1E3A5F;
}

.btn-lg {
    padding: 12px 28px;
    font-size: 16px;
}

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

/* 表单样式 */
.form-control {
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.form-control:focus {
    border-color: #2196F3;
    box-shadow: 0 0 0 3px rgba(33,150,243,0.1);
    outline: none;
}

.input-group-text {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 8px 0 0 8px;
    color: #94A3B8;
}

/* 表格样式 */
.table {
    background: #FFFFFF;
    border-radius: 12px;
    overflow: hidden;
}

.table th {
    background: #F8FAFC;
    border-top: none;
    font-weight: 600;
    font-size: 13px;
    color: #64748B;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table td {
    vertical-align: middle;
    font-size: 14px;
    border-color: #F1F5F9;
}

/* 徽章样式 */
.badge {
    font-weight: 500;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 6px;
}

/* 首页英雄区域 */
.hero-section {
    background: #FFFFFF;
    border-radius: 16px;
    padding: 48px 32px;
    text-align: center;
    border: 1px solid #F1F5F9;
    margin-bottom: 32px;
}

.hero-section h1 {
    font-size: 32px;
    font-weight: 700;
    color: #1E3A5F;
    margin-bottom: 12px;
}

.hero-section p {
    font-size: 16px;
    color: #64748B;
    margin-bottom: 24px;
}

/* 游戏卡片 */
.game-card {
    border-radius: 12px;
    overflow: hidden;
}

.game-card .card-img-top {
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F8FAFC;
    font-size: 48px;
    color: #CBD5E1;
}

.game-card .card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1E3A5F;
    margin-bottom: 8px;
}

.game-card .card-text {
    font-size: 13px;
    color: #64748B;
    line-height: 1.5;
}

/* 游戏区域 */
.game-area {
    min-height: 400px;
}

.game-input-area {
    max-width: 400px;
    margin: 0 auto;
}

/* 统计卡片 */
.stat-card {
    background: #FFFFFF;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    border: 1px solid #F1F5F9;
}

.stat-card h2 {
    font-size: 36px;
    font-weight: 700;
    color: #1E3A5F;
    margin-bottom: 4px;
}

.stat-card p {
    font-size: 13px;
    color: #94A3B8;
    margin: 0;
}

/* 排行榜 */
.leaderboard-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #F1F5F9;
}

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

.rank-badge {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    margin-right: 12px;
}

.rank-1 {
    background: #FEF3C7;
    color: #D97706;
}

.rank-2 {
    background: #F1F5F9;
    color: #64748B;
}

.rank-3 {
    background: #FDE8E8;
    color: #DC2626;
}

.rank-other {
    background: #F8FAFC;
    color: #94A3B8;
}

/* 分页样式 */
.pagination {
    margin-top: 24px;
}

.page-link {
    border: 1px solid #E2E8F0;
    color: #64748B;
    border-radius: 8px;
    margin: 0 2px;
    padding: 8px 14px;
    font-size: 14px;
}

.page-link:hover {
    background: #F8FAFC;
    color: #1E3A5F;
}

.page-item.active .page-link {
    background: #2196F3;
    border-color: #2196F3;
    color: #FFFFFF;
}

/* 页脚 */
footer {
    background: #FFFFFF;
    border-top: 1px solid #F1F5F9;
    padding: 32px 0;
    margin-top: 48px;
}

footer h5, footer h6 {
    font-weight: 600;
    color: #1E3A5F;
    margin-bottom: 16px;
}

footer a {
    color: #64748B;
    text-decoration: none;
    font-size: 14px;
}

footer a:hover {
    color: #2196F3;
}

/* 提示框 */
.alert {
    border-radius: 10px;
    border: none;
    font-size: 14px;
}

/* 模态框 */
.modal-content {
    border-radius: 16px;
    border: none;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.modal-header {
    border-bottom: 1px solid #F1F5F9;
    padding: 20px 24px;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    border-top: 1px solid #F1F5F9;
    padding: 16px 24px;
}

/* 游戏特定样式 */
.guess-number-display {
    font-size: 72px;
    font-weight: 700;
    color: #1E3A5F;
    text-align: center;
    padding: 24px;
}

.game-hint {
    font-size: 18px;
    color: #64748B;
    text-align: center;
    margin-bottom: 24px;
}

.game-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin: 24px 0;
}

.game-stat {
    text-align: center;
}

.game-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #1E3A5F;
}

.game-stat-label {
    font-size: 13px;
    color: #94A3B8;
}

/* 记忆卡片游戏 */
.memory-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    max-width: 400px;
    margin: 0 auto;
}

.memory-card {
    aspect-ratio: 1;
    background: #F8FAFC;
    border: 2px solid #E2E8F0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.memory-card:hover {
    border-color: #2196F3;
    background: #EFF6FF;
}

.memory-card.flipped {
    background: #FFFFFF;
    border-color: #2196F3;
}

.memory-card.matched {
    background: #F0FDF4;
    border-color: #22C55E;
    cursor: default;
}

/* 2048游戏 */
.game-2048-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    max-width: 400px;
    margin: 0 auto;
    background: #E2E8F0;
    border-radius: 12px;
    padding: 12px;
}

.tile-2048 {
    aspect-ratio: 1;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    transition: all 0.15s ease;
}

.tile-0 { background: #F1F5F9; color: transparent; }
.tile-2 { background: #FFFFFF; color: #1E3A5F; }
.tile-4 { background: #FEF9C3; color: #1E3A5F; }
.tile-8 { background: #FDE68A; color: #1E3A5F; }
.tile-16 { background: #FDBA74; color: #FFFFFF; }
.tile-32 { background: #FB923C; color: #FFFFFF; }
.tile-64 { background: #F97316; color: #FFFFFF; }
.tile-128 { background: #EAB308; color: #FFFFFF; font-size: 22px; }
.tile-256 { background: #EAB308; color: #FFFFFF; font-size: 22px; }
.tile-512 { background: #CA8A04; color: #FFFFFF; font-size: 22px; }
.tile-1024 { background: #CA8A04; color: #FFFFFF; font-size: 18px; }
.tile-2048 { background: #1E3A5F; color: #FFFFFF; font-size: 18px; }

/* 响应式 */
@media (max-width: 768px) {
    .hero-section {
        padding: 32px 20px;
    }
    
    .hero-section h1 {
        font-size: 24px;
    }
    
    .game-stats {
        gap: 20px;
    }
    
    .game-stat-value {
        font-size: 24px;
    }
    
    .memory-grid {
        max-width: 300px;
    }
    
    .game-2048-grid {
        max-width: 300px;
    }
}

/* 动画 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

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

.pop {
    animation: pop 0.3s ease;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: #94A3B8;
}

.empty-state h4 {
    color: #64748B;
    margin-top: 16px;
}

/* 面包屑 */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 20px;
}

.breadcrumb-item a {
    color: #2196F3;
    text-decoration: none;
}

.breadcrumb-item.active {
    color: #94A3B8;
}

/* 下拉菜单 */
.dropdown-menu {
    border: 1px solid #F1F5F9;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    padding: 8px;
}

.dropdown-item {
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 14px;
    color: #64748B;
}

.dropdown-item:hover {
    background: #F8FAFC;
    color: #1E3A5F;
}

/* 游戏结束模态框 */
.game-over-content {
    text-align: center;
    padding: 20px;
}

.game-over-content h3 {
    font-size: 24px;
    font-weight: 700;
    color: #1E3A5F;
    margin-bottom: 16px;
}

.game-over-score {
    font-size: 48px;
    font-weight: 700;
    color: #2196F3;
    margin: 16px 0;
}

.game-over-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin: 24px 0;
}

/* 打字游戏 */
.typing-text {
    font-size: 24px;
    letter-spacing: 2px;
    line-height: 1.8;
    text-align: center;
    padding: 24px;
    background: #F8FAFC;
    border-radius: 12px;
    margin-bottom: 24px;
}

.typing-text .correct {
    color: #22C55E;
}

.typing-text .incorrect {
    color: #EF4444;
    text-decoration: underline;
}

.typing-text .current {
    background: #DBEAFE;
    padding: 2px 4px;
    border-radius: 4px;
}

/* 数学游戏 */
.math-question {
    font-size: 48px;
    font-weight: 700;
    color: #1E3A5F;
    text-align: center;
    padding: 32px;
    background: #F8FAFC;
    border-radius: 12px;
    margin-bottom: 24px;
}

.math-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    max-width: 400px;
    margin: 0 auto;
}

.math-option {
    padding: 16px;
    font-size: 24px;
    font-weight: 600;
    background: #FFFFFF;
    border: 2px solid #E2E8F0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.math-option:hover {
    border-color: #2196F3;
    background: #EFF6FF;
}

.math-option.correct {
    border-color: #22C55E;
    background: #F0FDF4;
}

.math-option.incorrect {
    border-color: #EF4444;
    background: #FEF2F2;
}