* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.3) 0%, transparent 50%),
        linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    padding: 20px;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 24px;
    padding: 30px;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.08),
        0 8px 16px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
}

.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    pointer-events: none;
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 2.8em;
    text-shadow: 
        2px 2px 4px rgba(0, 0, 0, 0.1),
        0 1px 2px rgba(255, 255, 255, 0.8);
    font-weight: 700;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 18px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px;
    color: white;
    font-weight: bold;
    box-shadow: 
        0 8px 20px rgba(102, 126, 234, 0.3),
        0 4px 8px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
}

.game-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    pointer-events: none;
}

.current-player {
    font-size: 1.1em;
}

.game-status {
    font-size: 1.1em;
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 25px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.game-board {
    display: flex;
    justify-content: center;
    margin: 30px 0;
    padding: 25px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 20px;
    box-shadow: 
        inset 0 5px 15px rgba(0, 0, 0, 0.08),
        0 8px 25px rgba(0, 0, 0, 0.06),
        0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
}

.game-board::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.1) 100%);
    pointer-events: none;
}

#chessboard {
    border: 3px solid #8B4513;
    border-radius: 12px;
    background: 
        linear-gradient(135deg, #DEB887 0%, #CD853F 50%, #D2B48C 100%);
    cursor: crosshair;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 
        0 8px 25px rgba(139, 69, 19, 0.3),
        0 4px 12px rgba(0, 0, 0, 0.2),
        inset 0 2px 4px rgba(255, 255, 255, 0.3),
        inset 0 -2px 4px rgba(0, 0, 0, 0.1);
}

#chessboard::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 9px;
    background: 
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(0, 0, 0, 0.1) 0%, transparent 50%);
    pointer-events: none;
}



#chessboard:hover {
    transform: scale(1.02);
    box-shadow: 
        0 12px 35px rgba(139, 69, 19, 0.4),
        0 6px 18px rgba(0, 0, 0, 0.25),
        inset 0 2px 4px rgba(255, 255, 255, 0.4),
        inset 0 -2px 4px rgba(0, 0, 0, 0.15);
}

.controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 30px 0;
}

.controls button {
    padding: 14px 28px;
    font-size: 1.1em;
    border: none;
    border-radius: 28px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.15),
        0 2px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.controls button::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 ease;
}

#restart-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

#restart-btn:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 12px 25px rgba(102, 126, 234, 0.4),
        0 6px 15px rgba(0, 0, 0, 0.2);
}

#restart-btn:hover::before {
    left: 100%;
}

#undo-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

#undo-btn:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 12px 25px rgba(240, 147, 251, 0.4),
        0 6px 15px rgba(0, 0, 0, 0.2);
}

#undo-btn:hover::before {
    left: 100%;
}

#hint-btn {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

#hint-btn:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 12px 25px rgba(79, 172, 254, 0.4),
        0 6px 15px rgba(0, 0, 0, 0.2);
}

#hint-btn:hover::before {
    left: 100%;
}

.controls button:active {
    transform: translateY(0);
}

.rules {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 25px;
    border-radius: 18px;
    margin-top: 30px;
    border-left: 5px solid #667eea;
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.06),
        0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
}

.rules::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.1) 100%);
    pointer-events: none;
}

.rules h3 {
    color: #2c3e50;
    margin-bottom: 18px;
    font-size: 1.4em;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.rules ul {
    list-style: none;
    padding-left: 0;
}

.rules li {
    padding: 10px 0;
    color: #555;
    position: relative;
    padding-left: 30px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.rules li:hover {
    color: #2c3e50;
    transform: translateX(5px);
}

.rules li:before {
    content: "•";
    color: #667eea;
    font-weight: bold;
    font-size: 1.6em;
    position: absolute;
    left: 0;
    top: 8px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 20px;
        margin: 10px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .game-info {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    #chessboard {
        width: 100%;
        max-width: 400px;
        height: auto;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
    }
    
    .controls button {
        width: 200px;
    }
}

/* 胜利动画 */
@keyframes winner {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.winner {
    animation: winner 0.5s ease-in-out;
}

/* 提示效果 */
.hint {
    opacity: 0.7;
    filter: brightness(1.2);
}

/* 五子棋简介区域样式 */
.introduction {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 30px;
    border-radius: 20px;
    margin-top: 30px;
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.08),
        0 3px 10px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
}

.introduction::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0.1) 100%);
    pointer-events: none;
}

.introduction h3 {
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 1.6em;
    font-weight: 700;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
}

.introduction h3::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

.intro-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    position: relative;
    z-index: 1;
}

.introduction h4 {
    color: #34495e;
    margin-bottom: 15px;
    font-size: 1.2em;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.introduction p {
    color: #555;
    line-height: 1.7;
    margin-bottom: 12px;
    text-align: justify;
    font-size: 0.95em;
    transition: color 0.3s ease;
}

.introduction p:hover {
    color: #2c3e50;
}

.origin-section,
.culture-section,
.gameplay-section,
.modern-section {
    background: rgba(255, 255, 255, 0.6);
    padding: 20px;
    border-radius: 15px;
    border-left: 4px solid #667eea;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.origin-section::before,
.culture-section::before,
.gameplay-section::before,
.modern-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    pointer-events: none;
}

.origin-section:hover,
.culture-section:hover,
.gameplay-section:hover,
.modern-section:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    border-left-color: #764ba2;
}

.origin-section {
    border-left-color: #e74c3c;
}

.culture-section {
    border-left-color: #f39c12;
}

.gameplay-section {
    border-left-color: #27ae60;
}

.modern-section {
    border-left-color: #9b59b6;
}

/* 响应式设计优化 */
@media (max-width: 768px) {
    .introduction {
        padding: 20px;
        margin: 20px 10px;
    }
    
    .intro-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .introduction h3 {
        font-size: 1.4em;
    }
    
    .introduction h4 {
        font-size: 1.1em;
    }
    
    .origin-section,
    .culture-section,
    .gameplay-section,
    .modern-section {
        padding: 15px;
    }
}
