* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

body {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #e6e6e6;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    max-width: 1200px;
    width: 100%;
    background: rgba(25, 25, 35, 0.9);
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

header {
    background: linear-gradient(90deg, #2c3e50, #4a235a);
    padding: 20px 30px;
    text-align: center;
    border-bottom: 3px solid #e74c3c;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    color: #fff;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

header h1 i {
    color: #e74c3c;
    margin-right: 15px;
}

.game-info {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 10px;
    font-size: 1.1em;
    flex-wrap: wrap;
}

.turn-indicator, .captured-pieces {
    background: rgba(0, 0, 0, 0.3);
    padding: 10px 20px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#turn {
    color: #e74c3c;
    font-weight: bold;
    font-size: 1.2em;
}

#red-captured {
    color: #e74c3c;
    font-weight: bold;
}

#black-captured {
    color: #3498db;
    font-weight: bold;
}

.chess-area {
    display: flex;
    padding: 30px;
    gap: 30px;
    flex-wrap: wrap;
    justify-content: center;
}

.chessboard {
    background: #d4a574;
    border: 8px solid #8b4513;
    border-radius: 5px;
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    grid-template-rows: repeat(10, 1fr);
    width: 600px;
    height: 666px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    position: relative;
}

.chessboard::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 49%, #8b4513 49%, #8b4513 51%, transparent 51%),
                linear-gradient(-45deg, transparent 49%, #8b4513 49%, #8b4513 51%, transparent 51%);
    background-size: 133px 133px;
    opacity: 0.1;
    pointer-events: none;
}

.cell {
    border-right: 1px solid #8b4513;
    border-bottom: 1px solid #8b4513;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    user-select: none;
}

.cell:nth-child(9n) {
    border-right: none;
}

.cell:nth-child(n+73) {
    border-bottom: none;
}

.cell.highlight {
    background: rgba(46, 204, 113, 0.3) !important;
    box-shadow: inset 0 0 10px rgba(46, 204, 113, 0.5);
}

.cell.selected {
    background: rgba(241, 196, 15, 0.4) !important;
    box-shadow: inset 0 0 15px rgba(241, 196, 15, 0.7);
}

.cell.valid-move {
    background: rgba(52, 152, 219, 0.3) !important;
}

.cell.valid-move::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: rgba(52, 152, 219, 0.8);
    border-radius: 50%;
    opacity: 0.8;
}

.cell.red {
    color: #c0392b;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.cell.black {
    color: #2c3e50;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.3);
}

.cell.red-piece {
    background: linear-gradient(145deg, rgba(192, 57, 43, 0.1), rgba(231, 76, 60, 0.2));
}

.cell.black-piece {
    background: linear-gradient(145deg, rgba(44, 62, 80, 0.1), rgba(52, 73, 94, 0.2));
}

.river {
    border-bottom: 2px solid #8b4513;
}

.control-panel {
    flex: 1;
    min-width: 300px;
    background: rgba(40, 40, 50, 0.8);
    border-radius: 15px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.status {
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    font-size: 1.3em;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(231, 76, 60, 0.3);
    color: #f1c40f;
}

.buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.btn {
    padding: 18px;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 15px rgba(52, 152, 219, 0.4);
}

.btn:active {
    transform: translateY(0);
}

#restart {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

#restart:hover {
    box-shadow: 0 7px 15px rgba(231, 76, 60, 0.4);
}

#undo {
    background: linear-gradient(135deg, #f39c12, #e67e22);
}

#undo:hover {
    box-shadow: 0 7px 15px rgba(243, 156, 18, 0.4);
}

#hint {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
}

#hint:hover {
    box-shadow: 0 7px 15px rgba(155, 89, 182, 0.4);
}

.rules {
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 10px;
    flex-grow: 1;
}

.rules h3 {
    color: #3498db;
    margin-bottom: 15px;
    font-size: 1.3em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.rules ul {
    list-style-type: none;
    padding-left: 5px;
}

.rules li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #bdc3c7;
    font-size: 0.95em;
}

.rules li:last-child {
    border-bottom: none;
}

footer {
    text-align: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.4);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9em;
    color: #95a5a6;
}

/* 响应式设计 */
@media (max-width: 1000px) {
    .chess-area {
        flex-direction: column;
        align-items: center;
    }
    
    .chessboard {
        width: 90vw;
        height: calc(90vw * 1.11);
        max-width: 500px;
        max-height: 555px;
    }
    
    .cell {
        font-size: 24px;
    }
}

@media (max-width: 600px) {
    header h1 {
        font-size: 1.8em;
    }
    
    .game-info {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }
    
    .cell {
        font-size: 20px;
    }
    
    .control-panel {
        min-width: 100%;
    }
}