/* ===================================
   小学霸游戏平台 - 自定义样式
   Version: 1.0
   Date: 2025-10-01
   =================================== */

/* ===================================
   1. CSS变量定义
   =================================== */
:root {
    /* 主色调 */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --accent-gradient: linear-gradient(135deg, #fa709a 0%, #fee140 100%);

    /* 功能色 */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    /* 中性色 */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* 阴影 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

    /* 动画时长 */
    --transition-fast: 150ms;
    --transition-base: 250ms;
    --transition-slow: 350ms;
}

/* ===================================
   2. 玻璃拟态效果
   =================================== */
.glass-effect {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.glass-effect-dark {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ===================================
   3. 优化的游戏卡片
   =================================== */
.game-card-enhanced {
    position: relative;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    overflow: hidden;
    transition: all var(--transition-slow) cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.game-card-enhanced:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow:
        0 25px 50px -12px rgba(102, 126, 234, 0.35),
        0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 10px 15px -3px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.game-card-enhanced::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-gradient);
    transform: scaleX(0);
    transition: transform var(--transition-base);
}

.game-card-enhanced:hover::before {
    transform: scaleX(1);
}

/* 卡片图片容器 */
.game-card-image-wrapper {
    position: relative;
    height: 200px;
    overflow: hidden;
    border-radius: 20px 20px 0 0;
}

.game-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow) cubic-bezier(0.4, 0, 0.2, 1);
}

.game-card-enhanced:hover .game-card-image {
    transform: scale(1.1);
}

/* 游戏标签 */
.game-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 6px 12px;
    background: var(--secondary-gradient);
    color: white;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: var(--shadow-md);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* 难度标签 */
.difficulty-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.difficulty-easy {
    background: rgba(16, 185, 129, 0.9);
    color: white;
}

.difficulty-medium {
    background: rgba(245, 158, 11, 0.9);
    color: white;
}

.difficulty-hard {
    background: rgba(239, 68, 68, 0.9);
    color: white;
}

/* ===================================
   4. 改进的按钮样式
   =================================== */
.btn-enhanced {
    position: relative;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    transition: all var(--transition-base);
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-enhanced::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width var(--transition-slow), height var(--transition-slow);
}

.btn-enhanced:active::before {
    width: 300px;
    height: 300px;
}

.btn-primary-enhanced {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 15px 0 rgba(102, 126, 234, 0.3);
}

.btn-primary-enhanced:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px 0 rgba(102, 126, 234, 0.4);
}

.btn-play {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #667eea 0%, #06b6d4 100%);
    color: white;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    transition: all var(--transition-base);
    box-shadow: 0 4px 15px 0 rgba(102, 126, 234, 0.3);
}

.btn-play:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px 0 rgba(102, 126, 234, 0.5);
}

.btn-play svg {
    transition: transform var(--transition-base);
}

.btn-play:hover svg {
    transform: translateX(3px);
}

/* ===================================
   5. 导航栏优化
   =================================== */
.navbar-enhanced {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(229, 231, 235, 0.5);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    transition: transform var(--transition-base);
}

.nav-logo:hover {
    transform: scale(1.05);
}

.nav-logo-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

/* ===================================
   6. 特性卡片
   =================================== */
.feature-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    transition: all var(--transition-base);
    border: 1px solid rgba(229, 231, 235, 0.5);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.feature-icon-wrapper {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.feature-icon-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--primary-gradient);
    opacity: 0.1;
    transition: opacity var(--transition-base);
}

.feature-card:hover .feature-icon-wrapper::before {
    opacity: 0.2;
}

.feature-icon {
    width: 32px;
    height: 32px;
    position: relative;
    z-index: 1;
}

/* ===================================
   7. 加载动画
   =================================== */
.skeleton-loader {
    background: linear-gradient(
        90deg,
        rgba(229, 231, 235, 0.5) 0%,
        rgba(229, 231, 235, 0.3) 50%,
        rgba(229, 231, 235, 0.5) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 8px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ===================================
   8. 响应式优化
   =================================== */
@media (max-width: 768px) {
    .game-card-enhanced {
        border-radius: 16px;
    }

    .game-card-image-wrapper {
        height: 150px;
    }

    .btn-enhanced {
        padding: 10px 20px;
        font-size: 13px;
    }
}

/* ===================================
   9. 动画效果
   =================================== */
.fade-in {
    animation: fadeIn var(--transition-slow) ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-up {
    animation: slideUp var(--transition-slow) cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===================================
   10. 用户信息卡片
   =================================== */
.user-info-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    transition: all var(--transition-base);
}

.user-info-card:hover {
    background: rgba(255, 255, 255, 0.2);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.user-level {
    padding: 2px 8px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

/* ===================================
   11. 滚动条美化
   =================================== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-gradient);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}