/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 阳光风格渐变背景 */
body {
    min-height: 100vh;
    background: linear-gradient(135deg, #ffd700, #ffa500, #ff8c00);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
    position: relative;
}

/* 主容器 */
.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* 标题区域 */
.header {
    text-align: center;
    margin-bottom: 30px;
    animation: fadeInDown 1s ease-out;
}



.main-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 3px 3px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000;
    margin-bottom: 10px;
    animation: pulse 2s infinite;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

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

.sub-title {
    font-size: 1.2rem;
    color: rgba(51, 51, 51, 0.8);
    font-weight: 300;
}

@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 游戏卡片网格 */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    max-width: 800px;
    width: 100%;
}

/* 游戏卡片 */
.game-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    padding: 25px 20px;
    text-align: center;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    animation: fadeInUp 1s ease-out;
    animation-fill-mode: both;
}

.game-card:nth-child(1) {
    animation-delay: 0.2s;
}

.game-card:nth-child(2) {
    animation-delay: 0.4s;
}

/* 卡片 */
.join {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    text-align: center;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    animation: fadeInUp 1s ease-out;
    animation-fill-mode: both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.game-card:hover::before {
    left: 100%;
}

.game-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(255, 165, 0, 0.4);
    border-color: rgba(255, 165, 0, 0.7);
}

/* 游戏图标 */
.game-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 15px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: linear-gradient(135deg, #ff9a00, #ff6a00, #ff9a00);
    box-shadow: 0 8px 20px rgba(255, 154, 0, 0.4);
}

.snake-icon {
    background: linear-gradient(135deg, #ff9a00, #ff6a00, #ff9a00);
}

.shooting-icon {
    background: linear-gradient(135deg, #4facfe, #00f2fe, #4facfe);
}

/* 游戏标题 */
.game-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.game-subtitle {
    font-size: 1rem;
    color: rgba(51, 51, 51, 0.8);
    font-weight: 300;
}

/* 添加反馈按钮样式 */
.feedback-button {
    position: fixed;
    top: 30px;
    right: 20px;
    width: 120px;
    height: 60px;
    border-radius: 25px;
    background: rgba(255, 215, 0, 0.9);
    color: #fff;
    font-size: 1rem;
    font-weight: bold;
    border: none;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feedback-button:hover {
    background: rgba(255, 165, 0, 1);
    transform: scale(1.1);
}

.feedback-panel {
    position: fixed;
    top: 90px;
    right: 20px;
    width: 400px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    z-index: 1000;
    display: none;
}

/* 加载动画 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ffd700, #ffa500, #ff8c00);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #ff8c00;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-title {
        font-size: 2rem;
    }
    
    .sub-title {
        font-size: 1rem;
    }
    
    .game-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .game-card {
        padding: 30px 20px;
    }
    
    .game-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .game-title {
        font-size: 1.3rem;
    }
}

/* 首页功能卡片区域 */
.features-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    max-width: 800px;
    width: 100%;
}

.feature-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    padding: 30px 20px;
    text-align: center;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    animation: fadeInUp 1s ease-out;
    animation-fill-mode: both;
}

.feature-card:nth-child(1) {
    animation-delay: 0.2s;
}

.feature-card:nth-child(2) {
    animation-delay: 0.4s;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.feature-card:hover::before {
    left: 100%;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(255, 165, 0, 0.4);
    border-color: rgba(255, 165, 0, 0.7);
}

.feature-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 15px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: linear-gradient(135deg, #ff9a00, #ff6a00, #ff9a00);
    box-shadow: 0 8px 20px rgba(255, 154, 0, 0.4);
}

.feature-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.feature-subtitle {
    font-size: 1rem;
    color: rgba(51, 51, 51, 0.8);
    font-weight: 300;
}

/* 水印样式 */
.watermark {
    position: fixed;
    bottom: 10px;
    right: 10px;
    font-size: 0.8rem;
    color: #8b0000;
    z-index: 1000;
    pointer-events: none;
    background: rgba(255, 215, 0, 0.7);
    padding: 5px 10px;
    border-radius: 5px;
    border: 1px solid #ff0000;
}

/* 底部版权信息 */
.copyright {
    text-align: center;
    font-size: 0.85rem;
    padding: 15px;
    margin-top: 30px;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* ========== 移动端适配样式 ========== */
/* 小屏幕手机适配 */
@media (max-width: 480px) {
    /* 全局容器适配 */
    .container {
        padding: 10px;
    }

    /* 标题适配 */
    .main-title {
        font-size: 1.5rem;
        text-shadow: 2px 2px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000;
    }

    .sub-title {
        font-size: 0.85rem;
        padding: 0 10px;
        line-height: 1.4;
    }

    /* 游戏网格适配 */
    .game-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    /* 游戏卡片适配 */
    .game-card {
        padding: 20px 15px;
        border-radius: 12px;
    }

    .game-icon {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }

    .game-title {
        font-size: 1.1rem;
    }

    .game-subtitle {
        font-size: 0.85rem;
    }

    /* 特性卡片适配 */
    .features-section {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .feature-card {
        padding: 18px 15px;
        border-radius: 12px;
    }

    .feature-icon {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }

    .feature-title {
        font-size: 1.1rem;
    }

    .feature-subtitle {
        font-size: 0.85rem;
    }

    /* 工具栏适配 */
    .toolbar-container {
        top: 10px;
        right: 10px;
    }

    .logo-container {
        top: 10px;
        left: 10px;
    }

    .error-logo {
        width: 40px;
        height: 40px;
    }

    .toolbar {
        width: 40px;
        height: 40px;
        cursor: pointer;
    }

    /* 移动端禁用 hover 效果，改为点击展开 */
    .toolbar:hover {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        padding: 0;
        box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
    }

    .toolbar:hover .toolbar-icon {
        opacity: 1;
        transform: scale(1);
    }

    .toolbar:hover .toolbar-content {
        display: none;
        opacity: 0;
        transform: translateX(20px);
    }

    /* 点击展开状态 */
    .toolbar.expanded {
        width: 100%;
        border-radius: 10px;
        padding: 10px;
        box-shadow: 0 0 25px rgba(255, 215, 0, 0.8);
    }

    .toolbar.expanded .toolbar-icon {
        opacity: 0;
        transform: scale(0.5);
    }

    .toolbar.expanded .toolbar-content {
        display: flex;
        opacity: 1;
        transform: translateX(0);
    }

    .toolbar.expanded .toolbar-title {
        display: block;
        font-size: 0.9rem;
    }

    .toolbar.expanded .toolbar-item,
    .toolbar.expanded .social-item {
        opacity: 1;
        transform: translateX(0);
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* 游戏卡片适配 */
    .games-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* 画布适配 */
    canvas {
        max-width: 100% !important;
        height: auto !important;
        touch-action: none;
    }

    /* 按钮适配 - 触摸友好 */
    button, .btn {
        padding: 14px 24px;
        font-size: 1rem;
        min-height: 44px;
        border-radius: 12px;
    }

    /* 卡片通用适配 */
    .card {
        padding: 15px;
        margin: 10px;
        border-radius: 12px;
    }
    
    /* 水印/版权信息适配 */
    .watermark {
        bottom: 10px;
        right: 10px;
        font-size: 0.65rem;
        padding: 4px 8px;
        white-space: nowrap;
    }
    
    .watermark h3 {
        font-size: 0.65rem;
        line-height: 1.2;
        text-align: right;
    }
    
    /* 底部版权信息适配 */
    .copyright {
        text-align: center;
        font-size: 0.7rem;
        padding: 10px;
        margin-top: 15px;
        color: rgba(255, 255, 255, 0.8);
        text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
        white-space: normal;
        line-height: 1.4;
    }

    /* 触摸友好 - 更大的点击区域 */
    a, button, .game-card, .feature-card {
        min-height: 44px;
        min-width: 44px;
    }

    /* 反馈按钮适配 */
    .feedback-button {
        top: 15px;
        right: 60px;
        width: 80px;
        height: 40px;
        font-size: 0.85rem;
        border-radius: 20px;
    }

    .feedback-panel {
        width: calc(100% - 20px);
        right: 10px;
        left: 10px;
        top: 65px;
        padding: 15px;
    }

    /* 改善触摸滚动体验 */
    * {
        -webkit-overflow-scrolling: touch;
    }
}

/* 中等手机适配 */
@media (max-width: 768px) and (min-width: 481px) {
    /* 全局容器适配 */
    .container {
        padding: 15px;
    }

    /* 标题适配 */
    .main-title {
        font-size: 1.8rem;
        text-shadow: 2px 2px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000;
    }

    .sub-title {
        font-size: 0.9rem;
        padding: 0 10px;
    }

    /* 游戏网格适配 */
    .game-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    /* 游戏卡片适配 */
    .game-card {
        padding: 25px 20px;
    }

    .game-icon {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }

    .game-title {
        font-size: 1.2rem;
    }

    /* 特性卡片适配 */
    .features-section {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .feature-card {
        padding: 20px;
    }

    .feature-icon {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    .feature-title {
        font-size: 1.2rem;
    }

    .feature-subtitle {
        font-size: 0.9rem;
    }

    /* 工具栏适配 */
    .toolbar-container {
        top: 10px;
        right: 10px;
    }

    .logo-container {
        top: 10px;
        left: 10px;
    }

    .error-logo {
        width: 50px;
        height: 50px;
    }

    .toolbar {
        width: 45px;
        height: 45px;
        cursor: pointer;
    }

    /* 移动端禁用 hover 效果，改为点击展开 */
    .toolbar:hover {
        width: 45px;
        height: 45px;
        border-radius: 50%;
        padding: 0;
        box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
    }

    .toolbar:hover .toolbar-icon {
        opacity: 1;
        transform: scale(1);
    }

    .toolbar:hover .toolbar-content {
        display: none;
        opacity: 0;
        transform: translateX(20px);
    }

    /* 点击展开状态 */
    .toolbar.expanded {
        width: 100%;
        border-radius: 10px;
        padding: 10px;
        box-shadow: 0 0 25px rgba(255, 215, 0, 0.8);
    }

    .toolbar.expanded .toolbar-icon {
        opacity: 0;
        transform: scale(0.5);
    }

    .toolbar.expanded .toolbar-content {
        display: flex;
        opacity: 1;
        transform: translateX(0);
    }

    .toolbar.expanded .toolbar-title {
        display: block;
        font-size: 1rem;
    }

    .toolbar.expanded .toolbar-item,
    .toolbar.expanded .social-item {
        opacity: 1;
        transform: translateX(0);
        min-height: 44px;
    }

    /* 游戏卡片适配 */
    .games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    /* 画布适配 */
    canvas {
        max-width: 100% !important;
        height: auto !important;
        touch-action: none;
    }

    /* 按钮适配 */
    button, .btn {
        padding: 12px 20px;
        font-size: 1rem;
        min-height: 44px;
    }

    /* 卡片通用适配 */
    .card {
        padding: 15px;
        margin: 10px;
    }
    
    /* 水印/版权信息适配 */
    .watermark {
        bottom: 15px;
        right: 15px;
        font-size: 0.7rem;
        padding: 4px 8px;
        white-space: nowrap;
    }
    
    .watermark h3 {
        font-size: 0.7rem;
        line-height: 1.2;
        text-align: right;
    }
    
    /* 底部版权信息适配 */
    .copyright {
        text-align: center;
        font-size: 0.8rem;
        padding: 10px;
        margin-top: 20px;
        color: rgba(255, 255, 255, 0.8);
        text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    }

    /* 触摸友好 */
    a, button, .game-card, .feature-card {
        min-height: 44px;
        min-width: 44px;
    }
}

/* 平板适配 */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        padding: 20px;
    }

    .main-title {
        font-size: 2rem;
    }

    .features-section {
        grid-template-columns: repeat(2, 1fr);
    }

    .games-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
