/* 重置和基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    max-width: 500px;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    backdrop-filter: blur(10px);
    animation: fadeIn 0.8s ease-out;
}

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

/* 头部样式 */
.header {
    text-align: center;
    padding: 30px 20px 20px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.header h1 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.header p {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* 国家网格样式 */
.country-grid {
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.country-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

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

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

.country-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #4facfe;
}

.flag-container {
    margin-bottom: 15px;
}

.flag {
    width: 60px;
    height: 40px;
    margin: 0 auto;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    position: relative;
}

/* 塞内加尔国旗 - 绿白红垂直条纹，中间有绿色五角星 */
.flag-senegal {
    background: linear-gradient(to right, #00853f 33.33%, #ffffff 33.33%, #ffffff 66.66%, #fcd116 66.66%);
}

.flag-senegal::after {
    content: '★';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #00853f;
    font-size: 16px;
}

/* 多哥国旗 - 绿黄红横条纹，左上角有红色方块和白色五角星 */
.flag-togo {
    background: 
        linear-gradient(to bottom, 
            #006a4e 0%, #006a4e 20%, 
            #ffce00 20%, #ffce00 40%, 
            #006a4e 40%, #006a4e 60%, 
            #ffce00 60%, #ffce00 80%, 
            #006a4e 80%, #006a4e 100%);
}

.flag-togo::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 40%;
    height: 60%;
    background: #d21034;
}

.flag-togo::after {
    content: '★';
    position: absolute;
    top: 15px;
    left: 12px;
    color: white;
    font-size: 12px;
    z-index: 1;
}

/* 贝宁国旗 - 左边绿色，右边上黄下红 */
.flag-benin {
    background: #006a4e;
}

.flag-benin::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 60%;
    height: 50%;
    background: #ffce00;
}

.flag-benin::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 60%;
    height: 50%;
    background: #d21034;
}

/* 布基纳法索国旗 - 上红下绿，中间有黄色五角星 */
.flag-burkina {
    background: linear-gradient(to bottom, #d21034 50%, #006a4e 50%);
}

.flag-burkina::after {
    content: '★';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ffce00;
    font-size: 16px;
}

.country-name {
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.country-description {
    font-size: 0.9rem;
    color: #666;
    font-weight: 300;
}

/* 页脚样式 */
.footer {
    text-align: center;
    padding: 15px 20px;
    background: #f8f9fa;
    color: #666;
    font-size: 0.85rem;
    border-top: 1px solid #e9ecef;
}

/* 移动端优化 */
@media (max-width: 480px) {
    .container {
        margin: 10px;
        border-radius: 15px;
    }
    
    .header {
        padding: 25px 15px 15px;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .header p {
        font-size: 0.9rem;
    }
    
    .country-grid {
        padding: 15px;
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .country-card {
        padding: 18px;
    }
    
    .country-name {
        font-size: 1.2rem;
    }
    
    .flag {
        width: 50px;
        height: 33px;
    }
}

/* 点击动画 */
.country-card:active {
    transform: translateY(-2px) scale(0.98);
}

/* 加载动画 */
.country-card {
    animation: slideUp 0.6s ease-out;
    animation-delay: calc(var(--animation-order, 0) * 0.1s);
    opacity: 0;
    animation-fill-mode: forwards;
}

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