* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'SimSun', '宋体', 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, 48, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 119, 198, 0.2) 0%, transparent 50%),
        linear-gradient(135deg, #1a1a2e 0%, #16213e 25%, #0f3460 50%, #533483 75%, #7209b7 100%);
    min-height: 100vh;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 25% 25%, #ffd700 1px, transparent 1px),
        radial-gradient(circle at 75% 75%, #ff6b6b 1px, transparent 1px);
    background-size: 100px 100px, 150px 150px;
    opacity: 0.1;
    pointer-events: none;
    z-index: -1;
}

/* 欢迎页面样式 */
.welcome-container {
    max-width: 1200px;
    margin: 0 auto;
    background: 
        linear-gradient(135deg, rgba(255, 248, 220, 0.95) 0%, rgba(255, 235, 205, 0.95) 100%);
    border-radius: 25px;
    padding: 50px 40px;
    box-shadow: 
        0 25px 50px rgba(0,0,0,0.15),
        inset 0 1px 0 rgba(255,255,255,0.6),
        0 0 0 1px rgba(139, 69, 19, 0.2);
    text-align: center;
    position: relative;
    border: 3px solid transparent;
    background-clip: padding-box;
}

.welcome-container::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: linear-gradient(45deg, #d4af37, #ffd700, #b8860b, #daa520);
    border-radius: 28px;
    z-index: -1;
    pointer-events: none;
}

.welcome-container::after {
    content: '🐉';
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 2em;
    opacity: 0.3;
    transform: rotate(15deg);
}

.welcome-header {
    margin-bottom: 50px;
}

.logo-section {
    margin-bottom: 30px;
}

.main-title {
    background: linear-gradient(45deg, #8b0000, #dc143c, #b22222, #8b0000);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 4em;
    margin-bottom: 15px;
    text-shadow: 2px 2px 8px rgba(139, 0, 0, 0.3);
    font-weight: 900;
    font-family: 'KaiTi', '楷体', serif;
    letter-spacing: 0.1em;
    position: relative;
}

.main-title::before {
    content: '🏮';
    position: absolute;
    left: -60px;
    top: 50%;
    transform: translateY(-50%) rotate(-10deg);
    font-size: 0.6em;
    animation: lanternSwing 3s ease-in-out infinite;
}

.main-title::after {
    content: '🏮';
    position: absolute;
    right: -60px;
    top: 50%;
    transform: translateY(-50%) rotate(10deg);
    font-size: 0.6em;
    animation: lanternSwing 3s ease-in-out infinite reverse;
}

@keyframes lanternSwing {
    0%, 100% { transform: translateY(-50%) rotate(-10deg); }
    50% { transform: translateY(-50%) rotate(10deg); }
}

.subtitle {
    color: #666;
    font-size: 1.3em;
    margin-bottom: 15px;
    font-weight: 300;
}

.tagline {
    color: #888;
    font-size: 1.1em;
    font-style: italic;
}

.welcome-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.action-card {
    background: 
        linear-gradient(135deg, rgba(255, 248, 220, 0.9) 0%, rgba(250, 240, 230, 0.9) 100%);
    border-radius: 20px;
    padding: 35px 25px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 2px solid rgba(139, 69, 19, 0.2);
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 8px 25px rgba(0,0,0,0.1),
        inset 0 1px 0 rgba(255,255,255,0.6);
}

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

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

.action-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 20px 40px rgba(0,0,0,0.2),
        0 0 0 3px rgba(212, 175, 55, 0.3),
        inset 0 1px 0 rgba(255,255,255,0.8);
    border-color: rgba(212, 175, 55, 0.6);
    background: 
        linear-gradient(135deg, rgba(255, 253, 240, 0.95) 0%, rgba(255, 248, 220, 0.95) 100%);
}

.action-icon {
    font-size: 3.5em;
    margin-bottom: 20px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
    animation: iconFloat 2s ease-in-out infinite;
}

@keyframes iconFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}

.action-card h3 {
    background: linear-gradient(45deg, #8b4513, #a0522d, #8b4513);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.4em;
    margin-bottom: 12px;
    font-weight: 900;
    font-family: 'KaiTi', '楷体', serif;
    letter-spacing: 0.05em;
}

.action-card p {
    color: #666;
    font-size: 0.95em;
    line-height: 1.4;
    margin: 0;
}

.welcome-footer {
    color: #888;
    font-size: 1.1em;
    margin-top: 20px;
}

/* 房间列表样式优化 */
.room-list-section {
    margin-top: 40px;
    padding: 30px;
    background: 
        linear-gradient(135deg, rgba(255, 248, 220, 0.9) 0%, rgba(245, 222, 179, 0.9) 100%);
    border-radius: 20px;
    border: 2px solid rgba(139, 69, 19, 0.2);
    box-shadow: 
        0 15px 35px rgba(0,0,0,0.1),
        inset 0 1px 0 rgba(255,255,255,0.6);
}

.room-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(139, 69, 19, 0.2);
}

.room-list-header h3 {
    background: linear-gradient(45deg, #8b4513, #a0522d, #8b4513);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.8em;
    margin: 0;
    font-weight: 900;
    font-family: 'KaiTi', '楷体', serif;
    letter-spacing: 0.05em;
}

.room-list-controls {
    display: flex;
    gap: 10px;
}

.room-list-container {
    position: relative;
    min-height: 200px;
}

.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #8b4513;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(139, 69, 19, 0.2);
    border-top: 4px solid #8b4513;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

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

.room-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.room-card {
    background: 
        linear-gradient(135deg, rgba(255, 253, 240, 0.95) 0%, rgba(255, 248, 220, 0.95) 100%);
    border-radius: 15px;
    padding: 20px;
    border: 2px solid rgba(139, 69, 19, 0.2);
    box-shadow: 
        0 8px 20px rgba(0,0,0,0.1),
        inset 0 1px 0 rgba(255,255,255,0.6);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
}

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

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

.room-card:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 15px 30px rgba(0,0,0,0.15),
        0 0 0 2px rgba(212, 175, 55, 0.3),
        inset 0 1px 0 rgba(255,255,255,0.8);
    border-color: rgba(212, 175, 55, 0.5);
}

.room-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.room-id {
    font-size: 1.2em;
    font-weight: 900;
    color: #8b4513;
    font-family: 'KaiTi', '楷体', serif;
}

.room-status {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.room-status.waiting {
    background: linear-gradient(135deg, #ffeaa7, #fdcb6e);
    color: #8b4513;
}

.room-status.playing {
    background: linear-gradient(135deg, #55efc4, #00b894);
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.room-status.check {
    background: linear-gradient(135deg, #fd79a8, #e84393);
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    animation: checkPulse 1.5s ease-in-out infinite;
}

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

.room-players {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

.player-slot {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 10px;
    font-size: 0.9em;
    border: 1px solid rgba(139, 69, 19, 0.1);
}

.player-slot span:first-child {
    font-size: 1.1em;
}

.room-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 0.85em;
    color: #666;
    padding: 8px 0;
    border-top: 1px solid rgba(139, 69, 19, 0.1);
    border-bottom: 1px solid rgba(139, 69, 19, 0.1);
}

.room-actions {
    display: flex;
    gap: 10px;
}

.btn-join, .btn-spectate {
    flex: 1;
    padding: 10px 15px;
    border: none;
    border-radius: 10px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-join {
    background: linear-gradient(135deg, #dc143c 0%, #b22222 50%, #8b0000 100%);
    color: #fff8dc;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.btn-join:hover:not(:disabled) {
    background: linear-gradient(135deg, #ff1744 0%, #dc143c 50%, #b22222 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(220, 20, 60, 0.4);
}

.btn-spectate {
    background: linear-gradient(135deg, #8b4513 0%, #a0522d 50%, #654321 100%);
    color: #fff8dc;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.btn-spectate:hover {
    background: linear-gradient(135deg, #a0522d 0%, #8b4513 50%, #654321 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(139, 69, 19, 0.4);
}

.empty-rooms {
    text-align: center;
    padding: 60px 20px;
    color: #8b4513;
}

.empty-icon {
    font-size: 4em;
    margin-bottom: 20px;
    opacity: 0.6;
}

.empty-rooms h4 {
    font-size: 1.5em;
    margin-bottom: 10px;
    font-family: 'KaiTi', '楷体', serif;
    font-weight: 900;
}

.empty-rooms p {
    margin-bottom: 25px;
    color: #666;
    font-size: 1.1em;
}

/* 游戏页面样式 */
.game-container {
    max-width: 1000px;
    margin: 0 auto;
    background: 
        linear-gradient(135deg, rgba(255, 248, 220, 0.95) 0%, rgba(255, 235, 205, 0.95) 100%);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 
        0 20px 40px rgba(0,0,0,0.2),
        inset 0 1px 0 rgba(255,255,255,0.6),
        0 0 0 2px rgba(139, 69, 19, 0.2);
    position: relative;
    border: 3px solid transparent;
    background-clip: padding-box;
}

.game-container::after {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: linear-gradient(45deg, #d4af37, #ffd700, #b8860b, #daa520);
    border-radius: 28px;
    z-index: -1;
    pointer-events: none;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 3px solid transparent;
    background: linear-gradient(90deg, rgba(139, 69, 19, 0.3), rgba(212, 175, 55, 0.3), rgba(139, 69, 19, 0.3));
    background-size: 100% 3px;
    background-repeat: no-repeat;
    background-position: bottom;
    position: relative;
}

.game-container::before {
    content: '⚔️';
    position: absolute;
    left: 50%;
    top: -15px;
    transform: translateX(-50%);
    font-size: 1.5em;
    background: rgba(255, 248, 220, 0.9);
    padding: 5px 10px;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.game-title {
    display: flex;
    align-items: center;
    gap: 15px;
}

.game-title h2 {
    background: linear-gradient(45deg, #8b0000, #dc143c, #b22222);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2em;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(139, 0, 0, 0.3);
    font-family: 'KaiTi', '楷体', serif;
    font-weight: 900;
}

.btn-back {
    background: linear-gradient(135deg, #696969 0%, #2f4f4f 50%, #1c1c1c 100%);
    color: #fff8dc;
    border: 2px solid rgba(105, 105, 105, 0.3);
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.btn-back:hover {
    background: linear-gradient(135deg, #2f4f4f 0%, #696969 50%, #1c1c1c 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(105, 105, 105, 0.4);
}

.btn-back:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.room-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.room-details {
    display: flex;
    gap: 15px;
    font-size: 14px;
}

.room-details span {
    color: #666;
}

.room-details strong {
    color: #333;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 12px;
}

.btn-warning {
    background: linear-gradient(135deg, #ff8c00 0%, #ffa500 50%, #ff7f00 100%);
    color: #fff8dc;
    border-color: rgba(255, 140, 0, 0.3);
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.btn-warning:hover {
    background: linear-gradient(135deg, #ffa500 0%, #ff8c00 50%, #ff7f00 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 140, 0, 0.4);
}

.game-actions {
    display: flex;
    gap: 10px;
}

.game-main {
    margin-top: 2rem;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
    align-items: start;
}



.replay-header {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(139, 69, 19, 0.2);
}

.replay-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.replay-title h2 {
    background: linear-gradient(45deg, #8b4513, #a0522d, #8b4513);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2.2em;
    margin: 0;
    font-weight: 900;
    font-family: 'KaiTi', '楷体', serif;
}

.replay-info {
    background: rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    padding: 15px 20px;
    border: 1px solid rgba(139, 69, 19, 0.2);
}

.replay-game-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.replay-players {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    font-size: 1.1em;
    font-weight: 700;
}

.player-red {
    color: #8b0000;
}

.player-black {
    color: #2c2c2c;
}

.vs {
    color: #8b4513;
    font-weight: 900;
}

.replay-details {
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 0.9em;
    color: #666;
    flex-wrap: wrap;
}

/* 左侧控制区域 */
.replay-controls-section {
    background: 
        linear-gradient(135deg, rgba(255, 248, 220, 0.9) 0%, rgba(245, 222, 179, 0.9) 100%);
    border-radius: 15px;
    border: 2px solid rgba(139, 69, 19, 0.2);
    box-shadow: 
        0 10px 25px rgba(0,0,0,0.1),
        inset 0 1px 0 rgba(255,255,255,0.6);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: fit-content;
}

.replay-progress {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.progress-info {
    text-align: center;
    font-weight: 600;
    color: #8b4513;
    font-size: 0.9em;
}

.progress-bar input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(139, 69, 19, 0.2);
    outline: none;
    -webkit-appearance: none;
}

.progress-bar input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #8b4513;
    cursor: pointer;
}

.replay-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.replay-controls .btn {
    flex: 1;
    min-width: 60px;
    padding: 8px 12px;
    font-size: 0.8em;
    white-space: nowrap;
}

.replay-speed {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    font-size: 0.9em;
    color: #666;
}

.replay-speed select {
    padding: 4px 8px;
    border: 1px solid rgba(139, 69, 19, 0.3);
    border-radius: 6px;
    background: rgba(255, 248, 220, 0.8);
    color: #8b4513;
    font-size: 0.9em;
}

.move-history {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.move-history h4 {
    margin: 0;
    color: #8b4513;
    font-size: 1em;
    font-weight: 900;
    font-family: 'KaiTi', '楷体', serif;
    text-align: center;
}

.move-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid rgba(139, 69, 19, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.4);
    padding: 8px;
}

.move-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    margin-bottom: 4px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85em;
}

.move-item:hover {
    background: rgba(255, 215, 0, 0.2);
}

.move-item.played {
    background: rgba(139, 69, 19, 0.1);
    color: #8b4513;
}

.move-item.current {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.3) 0%, rgba(255, 165, 0, 0.2) 100%);
    border-left: 3px solid #ffd700;
    font-weight: 700;
}

.move-number {
    font-weight: 700;
    color: #8b4513;
    min-width: 25px;
}

.move-player {
    font-weight: 600;
    min-width: 20px;
}

.move-notation {
    flex: 1;
    color: #333;
}

/* 右侧棋盘区域 */
.replay-board-section {
    display: flex;
    justify-content: center;
    align-items: center;
}

.replay-board-section .chess-board {
    width: 100%;
    max-width: 600px;
    height: auto;
    aspect-ratio: 9/10;
}

.chess-area {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.game-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.btn {
    padding: 8px 16px;
    border: 2px solid transparent;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    position: relative;
    overflow: hidden;
    font-family: 'Microsoft YaHei', sans-serif;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

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

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #dc143c 0%, #b22222 50%, #8b0000 100%);
    color: #fff8dc;
    border-color: rgba(139, 0, 0, 0.3);
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #ff1744 0%, #dc143c 50%, #b22222 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(220, 20, 60, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #8b4513 0%, #a0522d 50%, #654321 100%);
    color: #fff8dc;
    border-color: rgba(139, 69, 19, 0.3);
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #a0522d 0%, #8b4513 50%, #654321 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(139, 69, 19, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #228b22 0%, #32cd32 50%, #006400 100%);
    color: #fff8dc;
    border-color: rgba(34, 139, 34, 0.3);
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.btn-success:hover {
    background: linear-gradient(135deg, #32cd32 0%, #228b22 50%, #006400 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(34, 139, 34, 0.4);
}



.game-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.room-info-panel {
    background: 
        linear-gradient(135deg, rgba(255, 248, 220, 0.9) 0%, rgba(245, 222, 179, 0.9) 100%);
    border-radius: 15px;
    border: 2px solid rgba(139, 69, 19, 0.2);
    box-shadow: 
        0 10px 25px rgba(0,0,0,0.1),
        inset 0 1px 0 rgba(255,255,255,0.6);
    overflow: hidden;
}

.room-panel-header {
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.1) 0%, rgba(160, 82, 45, 0.1) 100%);
    padding: 15px 20px;
    border-bottom: 1px solid rgba(139, 69, 19, 0.2);
}

.room-panel-header h3 {
    margin: 0;
    color: #8b4513;
    font-size: 1.1em;
    font-weight: 900;
    font-family: 'KaiTi', '楷体', serif;
}

.room-panel-content {
    padding: 15px 20px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(139, 69, 19, 0.1);
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    font-size: 0.9em;
    color: #666;
    font-weight: 600;
}

.info-value {
    font-size: 0.9em;
    color: #8b4513;
    font-weight: 700;
    font-family: 'KaiTi', '楷体', serif;
}

.room-panel-actions {
    height: 73.5px;
    padding: 15px 20px;
    border-top: 1px solid rgba(139, 69, 19, 0.2);
    background: rgba(255, 255, 255, 0.3);
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* 紧凑型玩家面板 */
.players-panel-compact {
    background: 
        linear-gradient(135deg, rgba(255, 248, 220, 0.9) 0%, rgba(245, 222, 179, 0.9) 100%);
    border-radius: 12px;
    border: 2px solid rgba(139, 69, 19, 0.2);
    box-shadow: 
        0 8px 20px rgba(0,0,0,0.1),
        inset 0 1px 0 rgba(255,255,255,0.6);
    overflow: hidden;
    margin-bottom: 15px;
}

.players-header-compact {
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.1) 0%, rgba(160, 82, 45, 0.1) 100%);
    padding: 10px 15px;
    border-bottom: 1px solid rgba(139, 69, 19, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.players-header-compact h3 {
    margin: 0;
    color: #8b4513;
    font-size: 1em;
    font-weight: 900;
    font-family: 'KaiTi', '楷体', serif;
}

.room-info-inline {
    display: flex;
    gap: 15px;
    font-size: 0.8em;
    color: #666;
    font-weight: 600;
}

.room-info-inline span {
    white-space: nowrap;
}

.players-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    gap: 10px;
}

.player-mini {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    transition: all 0.3s ease;
    padding: 8px;
    border-radius: 8px;
}

.player-mini.active {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.15) 0%, rgba(255, 215, 0, 0.1) 100%);
    border-left: 3px solid #d4af37;
}

.player-mini.red.active {
    border-left-color: #dc143c;
    background: linear-gradient(135deg, rgba(220, 20, 60, 0.1) 0%, rgba(255, 182, 193, 0.1) 100%);
}

.player-mini.black.active {
    border-left-color: #2c3e50;
    background: linear-gradient(135deg, rgba(44, 62, 80, 0.1) 0%, rgba(149, 165, 166, 0.1) 100%);
}

.player-avatar-mini {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(240, 240, 240, 0.8) 100%);
    border: 1px solid rgba(139, 69, 19, 0.2);
    font-size: 0.9em;
}

.player-info-mini {
    flex: 1;
    min-width: 0;
}

.player-name-mini {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85em;
    font-weight: 700;
    color: #8b4513;
    font-family: 'KaiTi', '楷体', serif;
    margin-bottom: 2px;
}

.player-status-mini {
    font-size: 0.7em;
    color: #666;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vs-indicator {
    font-size: 0.8em;
    font-weight: 900;
    color: #8b4513;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 165, 0, 0.2) 100%);
    padding: 4px 8px;
    border-radius: 12px;
    border: 1px solid rgba(255, 165, 0, 0.3);
}

.current-turn-mini {
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.3);
    border-top: 1px solid rgba(139, 69, 19, 0.1);
    font-size: 0.8em;
    color: #666;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}



.player-side-info {
    font-weight: 600;
    color: #8b4513;
}

.turn-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ddd;
    transition: all 0.3s ease;
    opacity: 0.3;
}

.player-mini.active .turn-indicator {
    opacity: 1;
    background: linear-gradient(135deg, #32cd32 0%, #228b22 100%);
    box-shadow: 0 0 8px rgba(50, 205, 50, 0.5);
    animation: pulse 2s infinite;
}

/* 走棋记录面板 */
.move-history-panel {
    background: 
        linear-gradient(135deg, rgba(255, 248, 220, 0.9) 0%, rgba(245, 222, 179, 0.9) 100%);
    border-radius: 12px;
    border: 2px solid rgba(139, 69, 19, 0.2);
    box-shadow: 
        0 8px 20px rgba(0,0,0,0.1),
        inset 0 1px 0 rgba(255,255,255,0.6);
    overflow: hidden;
    margin-bottom: 15px;
    flex: 1;
}

.move-history-header {
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.1) 0%, rgba(160, 82, 45, 0.1) 100%);
    padding: 10px 15px;
    border-bottom: 1px solid rgba(139, 69, 19, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.move-history-header h3 {
    margin: 0;
    color: #8b4513;
    font-size: 1em;
    font-weight: 900;
    font-family: 'KaiTi', '楷体', serif;
}

.move-history-content {
    padding: 10px;
    max-height: 200px;
    overflow-y: auto;
    font-size: 0.8em;
}

.move-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    margin-bottom: 4px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 6px;
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
}

.move-item:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: translateX(2px);
}

.move-item.red {
    border-left-color: #dc143c;
}

.move-item.black {
    border-left-color: #2c3e50;
}

.move-number {
    font-weight: 700;
    color: #8b4513;
    min-width: 25px;
}

.move-notation {
    flex: 1;
    margin: 0 8px;
    color: #333;
    font-weight: 600;
}

.move-time {
    font-size: 0.7em;
    color: #666;
    white-space: nowrap;
}

.no-moves {
    text-align: center;
    color: #999;
    padding: 20px;
    font-style: italic;
}

/* 聊天面板 */
.chat-panel {
    background: 
        linear-gradient(135deg, rgba(255, 248, 220, 0.9) 0%, rgba(245, 222, 179, 0.9) 100%);
    border-radius: 12px;
    border: 2px solid rgba(139, 69, 19, 0.2);
    box-shadow: 
        0 8px 20px rgba(0,0,0,0.1),
        inset 0 1px 0 rgba(255,255,255,0.6);
    overflow: hidden;
    margin-bottom: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-header {
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.1) 0%, rgba(160, 82, 45, 0.1) 100%);
    padding: 10px 15px;
    border-bottom: 1px solid rgba(139, 69, 19, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    margin: 0;
    color: #8b4513;
    font-size: 1em;
    font-weight: 900;
    font-family: 'KaiTi', '楷体', serif;
}

.chat-messages {
    flex: 1;
    padding: 10px;
    max-height: 180px;
    overflow-y: auto;
    font-size: 0.8em;
    min-height: 120px;
}

.chat-message {
    margin-bottom: 8px;
    padding: 6px 8px;
    border-radius: 8px;
    max-width: 85%;
    word-wrap: break-word;
    animation: messageSlideIn 0.3s ease-out;
}

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

.chat-message.own {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    margin-left: auto;
    border: 1px solid rgba(33, 150, 243, 0.2);
}

.chat-message.other {
    background: linear-gradient(135deg, #f3e5f5 0%, #e1bee7 100%);
    margin-right: auto;
    border: 1px solid rgba(156, 39, 176, 0.2);
}

.chat-message.system {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    margin: 0 auto;
    text-align: center;
    font-style: italic;
    border: 1px solid rgba(255, 152, 0, 0.2);
    max-width: 100%;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
    font-size: 0.7em;
}

.message-sender {
    font-weight: 700;
    color: #8b4513;
}

.message-time {
    color: #666;
    font-size: 0.9em;
}

.message-content {
    color: #333;
    line-height: 1.3;
}

.chat-input-area {
    padding: 10px;
    border-top: 1px solid rgba(139, 69, 19, 0.2);
    background: rgba(255, 255, 255, 0.3);
    display: flex;
    gap: 8px;
}

.chat-input-area input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid rgba(139, 69, 19, 0.3);
    border-radius: 20px;
    font-size: 0.8em;
    background: rgba(255, 248, 220, 0.8);
    color: #8b4513;
    transition: all 0.3s ease;
}

.chat-input-area input:focus {
    outline: none;
    border-color: rgba(212, 175, 55, 0.6);
    background: rgba(255, 253, 240, 0.9);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}

.chat-input-area input::placeholder {
    color: rgba(139, 69, 19, 0.6);
}

.no-messages {
    text-align: center;
    color: #999;
    padding: 20px;
    font-style: italic;
}



/* 保持原有的玩家面板样式以兼容 */
.players-panel {
    background: 
        linear-gradient(135deg, rgba(255, 248, 220, 0.9) 0%, rgba(245, 222, 179, 0.9) 100%);
    border-radius: 15px;
    border: 2px solid rgba(139, 69, 19, 0.2);
    box-shadow: 
        0 10px 25px rgba(0,0,0,0.1),
        inset 0 1px 0 rgba(255,255,255,0.6);
    overflow: hidden;
}

.players-header {
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.1) 0%, rgba(160, 82, 45, 0.1) 100%);
    padding: 15px 20px;
    border-bottom: 1px solid rgba(139, 69, 19, 0.2);
}

.players-header h3 {
    margin: 0;
    color: #8b4513;
    font-size: 1.1em;
    font-weight: 900;
    font-family: 'KaiTi', '楷体', serif;
}

.player-compact {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(139, 69, 19, 0.1);
    transition: all 0.3s ease;
    position: relative;
}

.player-compact:last-of-type {
    border-bottom: none;
}

.player-compact.active {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.2) 0%, rgba(255, 215, 0, 0.1) 100%);
    border-left: 4px solid #d4af37;
    transform: translateX(2px);
}

.player-compact.red.active {
    border-left-color: #dc143c;
    background: linear-gradient(135deg, rgba(220, 20, 60, 0.1) 0%, rgba(255, 182, 193, 0.1) 100%);
}

.player-compact.black.active {
    border-left-color: #2c3e50;
    background: linear-gradient(135deg, rgba(44, 62, 80, 0.1) 0%, rgba(149, 165, 166, 0.1) 100%);
}

.player-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
}

.player-avatar-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(240, 240, 240, 0.8) 100%);
    border: 2px solid rgba(139, 69, 19, 0.2);
    font-size: 1.2em;
}

.player-info-compact {
    flex: 1;
}

.player-name {
    display: flex;
    font-size: 1em;
    font-weight: 700;
    color: #8b4513;
    font-family: 'KaiTi', '楷体', serif;
    margin-bottom: 2px;
    align-items: center;
}

.player-status {
    font-size: 0.8em;
    color: #666;
    font-weight: 500;
}

.turn-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ddd;
    transition: all 0.3s ease;
    opacity: 0.3;
}

.player-compact.active .turn-indicator {
    opacity: 1;
    background: linear-gradient(135deg, #32cd32 0%, #228b22 100%);
    box-shadow: 0 0 10px rgba(50, 205, 50, 0.5);
    animation: pulse 2s infinite;
}

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

.current-turn-display {
    padding: 20px;
    text-align: center;
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.05) 0%, rgba(160, 82, 45, 0.05) 100%);
    border-top: 1px solid rgba(139, 69, 19, 0.1);
    border-bottom: 1px solid rgba(139, 69, 19, 0.1);
}

.turn-text {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
    font-weight: 600;
}

.turn-player {
    font-size: 1.1em;
    font-weight: 900;
    color: #8b4513;
    font-family: 'KaiTi', '楷体', serif;
}



.player-avatar {
    width: 80px;
    height: 80px;
    min-width: 80px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 红方古代将军头像 */
.red-general {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #ff6b6b, #d32f2f, #8b0000);
    border: 4px solid #8b0000;
    box-shadow: 0 8px 20px rgba(139, 0, 0, 0.4), inset 0 2px 8px rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.red-general::before {
    content: '';
    position: absolute;
    top: 15%;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 35px;
    background: radial-gradient(ellipse, #ffcccb 0%, #ff9999 50%, #ff6b6b 100%);
    border-radius: 50% 50% 40% 40%;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.red-general::after {
    content: '帥';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    font-weight: 900;
    color: #8b0000;
    text-shadow: 0 1px 3px rgba(255, 255, 255, 0.8), 0 0 5px rgba(255, 255, 255, 0.5);
    font-family: 'KaiTi', '楷体', serif;
}

.red-general .crown {
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 20px;
    background: linear-gradient(45deg, #ffd700, #ffb347, #ff8c00);
    border-radius: 10px 10px 0 0;
    box-shadow: 0 2px 6px rgba(255, 215, 0, 0.6), inset 0 1px 3px rgba(255, 255, 255, 0.4);
}

.red-general .crown::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 10px solid #ffd700;
}

/* 黑方古代将军头像 */
.black-general {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #4a4a4a, #2c2c2c, #000000);
    border: 4px solid #1a1a1a;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6), inset 0 2px 8px rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.black-general::before {
    content: '';
    position: absolute;
    top: 15%;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 35px;
    background: radial-gradient(ellipse, #666666 0%, #4a4a4a 50%, #2c2c2c 100%);
    border-radius: 50% 50% 40% 40%;
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.1);
}

.black-general::after {
    content: '將';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    font-weight: 900;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8), 0 0 5px rgba(255, 255, 255, 0.3);
    font-family: 'KaiTi', '楷体', serif;
}

.black-general .crown {
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 20px;
    background: linear-gradient(45deg, #c0c0c0, #a0a0a0, #808080);
    border-radius: 10px 10px 0 0;
    box-shadow: 0 2px 6px rgba(192, 192, 192, 0.4), inset 0 1px 3px rgba(255, 255, 255, 0.3);
}

.black-general .crown::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 10px solid #c0c0c0;
}

/* 头像悬停效果 */
.red-general:hover, .black-general:hover {
    transform: scale(1.05);
    transition: all 0.3s ease;
}

.red-general:hover {
    box-shadow: 0 12px 25px rgba(139, 0, 0, 0.6), inset 0 2px 8px rgba(255, 255, 255, 0.4);
}

.black-general:hover {
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.8), inset 0 2px 8px rgba(255, 255, 255, 0.3);
}

/* 激活状态的光环效果 */
.player-info.active .red-general {
    animation: redGlow 2s ease-in-out infinite alternate;
}

.player-info.active .black-general {
    animation: blackGlow 2s ease-in-out infinite alternate;
}

@keyframes redGlow {
    0% { box-shadow: 0 8px 20px rgba(139, 0, 0, 0.4), inset 0 2px 8px rgba(255, 255, 255, 0.3), 0 0 20px rgba(255, 107, 107, 0.6); }
    100% { box-shadow: 0 8px 20px rgba(139, 0, 0, 0.4), inset 0 2px 8px rgba(255, 255, 255, 0.3), 0 0 30px rgba(255, 107, 107, 0.9); }
}

@keyframes blackGlow {
    0% { box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6), inset 0 2px 8px rgba(255, 255, 255, 0.2), 0 0 20px rgba(192, 192, 192, 0.4); }
    100% { box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6), inset 0 2px 8px rgba(255, 255, 255, 0.2), 0 0 30px rgba(192, 192, 192, 0.7); }
}

.player-details h3 {
    margin: 0 0 5px 0;
    color: #333;
    font-size: 1.2em;
}

.player-details p {
    margin: 0;
    color: #666;
    font-size: 0.9em;
}



.chess-board {
    width: 620px;
    height: 680px;
    margin: 0 auto;
    background: 
        radial-gradient(circle at 30% 30%, #f5deb3 0%, #deb887 40%, #d2b48c 100%),
        linear-gradient(45deg, rgba(139, 69, 19, 0.1) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(139, 69, 19, 0.1) 25%, transparent 25%);
    background-size: 100% 100%, 15px 15px, 15px 15px;
    border: 6px solid transparent;
    border-radius: 12px;
    position: relative;
    box-shadow: 
        0 20px 40px rgba(0,0,0,0.4),
        inset 0 2px 4px rgba(255,255,255,0.3),
        0 0 0 2px #8b4513,
        0 0 0 4px #d4af37;
    padding: 30px;
}

.chess-board::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    background: 
        conic-gradient(from 0deg, #8b4513, #a0522d, #8b4513, #654321, #8b4513);
    border-radius: 18px;
    z-index: -1;
    pointer-events: none;
}

.chess-board::after {
    content: '龙';
    position: absolute;
    top: 10px;
    left: 15px;
    font-size: 24px;
    color: rgba(139, 69, 19, 0.3);
    font-family: 'KaiTi', '楷体', serif;
    font-weight: bold;
    transform: rotate(-5deg);
}

.board-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.board-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.board-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    grid-template-rows: repeat(10, 1fr);
}

.board-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: absolute;
    z-index: 2;
    width: 54px;
    border-radius: 50%;
    height: 54px;
}

@keyframes hoverGlow {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.board-cell.selected {
    position: relative;
}

.board-cell.selected::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 2px solid #ffd700;
    border-radius: 50%;
    background: linear-gradient(45deg, 
        rgba(255, 215, 0, 0.2) 0%, 
        rgba(255, 193, 7, 0.15) 50%, 
        rgba(255, 215, 0, 0.2) 100%);
    animation: elegant-pulse 2s ease-in-out infinite;
    z-index: 1;
    box-shadow: 
        0 0 20px rgba(255, 215, 0, 0.4),
        inset 0 0 10px rgba(255, 215, 0, 0.1);
}

.board-cell.selected::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    background: radial-gradient(circle, #ffd700 0%, #ffb300 100%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    animation: gentle-glow 1.5s ease-in-out infinite alternate;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.8);
}

@keyframes elegant-pulse {
    0%, 100% { 
        transform: scale(1); 
        opacity: 0.9;
        border-color: #ffd700;
        box-shadow: 
            0 0 20px rgba(255, 215, 0, 0.4),
            inset 0 0 10px rgba(255, 215, 0, 0.1);
    }
    50% { 
        transform: scale(1.05); 
        opacity: 1;
        border-color: #ffb300;
        box-shadow: 
            0 0 25px rgba(255, 215, 0, 0.6),
            inset 0 0 15px rgba(255, 215, 0, 0.2);
    }
}

@keyframes gentle-glow {
    0% { 
        opacity: 0.7; 
        transform: translate(-50%, -50%) scale(0.9);
        box-shadow: 0 0 6px rgba(255, 215, 0, 0.6);
    }
    100% { 
        opacity: 1; 
        transform: translate(-50%, -50%) scale(1.1);
        box-shadow: 0 0 12px rgba(255, 215, 0, 1);
    }
}

.board-cell.possible-move {
    position: relative;
}

.board-cell.possible-move::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    background: rgba(34, 197, 94, 0.7);
    border: 2px solid #22c55e;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    transition: all 0.2s ease;
}

.board-cell.possible-move:hover::before {
    background: rgba(34, 197, 94, 0.9);
    transform: translate(-50%, -50%) scale(1.3);
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.8);
}

/* 如果目标位置有敌方棋子，显示攻击标记 */
.board-cell.possible-move.attack-target::before {
    background: rgba(239, 68, 68, 0.7);
    border-color: #ef4444;
    width: 20px;
    height: 20px;
}

.board-cell.possible-move.attack-target:hover::before {
    background: rgba(239, 68, 68, 0.9);
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.8);
}

.river-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, 0%);
    font-size: 24px;
    font-weight: bold;
    color: #8b4513;
    text-shadow: 1px 1px 2px rgba(255,255,255,0.8);
    pointer-events: none;
    z-index: 1;
}

.chess-piece {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 
        0 4px 12px rgba(0,0,0,0.4),
        inset 0 2px 4px rgba(255,255,255,0.4),
        0 0 0 1px rgba(0,0,0,0.1);
    border: 2px solid;
    position: relative;
    margin: 0;
    font-family: 'KaiTi', '楷体', serif;
}

.chess-piece::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    right: 3px;
    bottom: 3px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.4), transparent 60%);
    pointer-events: none;
}

.chess-piece.red {
    background: 
        radial-gradient(circle at 30% 30%, #fff8dc 0%, #f4e4bc 40%, #deb887 100%),
        linear-gradient(45deg, rgba(139, 0, 0, 0.1) 0%, transparent 100%);
    color: #8b0000;
    border-color: #654321;
    text-shadow: 
        0 2px 4px rgba(255,255,255,0.9),
        0 0 6px rgba(255,255,255,0.6),
        1px 1px 0 rgba(139, 0, 0, 0.3);
    font-weight: 900;
    box-shadow: 
        0 6px 15px rgba(139, 0, 0, 0.3),
        inset 0 2px 4px rgba(255,255,255,0.5),
        0 0 0 1px rgba(139, 0, 0, 0.2);
}

.chess-piece.black {
    background: 
        radial-gradient(circle at 30% 30%, #3a3a3a 0%, #2c2c2c 40%, #1a1a1a 100%),
        linear-gradient(45deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
    color: #f5f5dc;
    border-color: #654321;
    text-shadow: 
        0 2px 4px rgba(0,0,0,0.9),
        0 0 6px rgba(255,255,255,0.4),
        1px 1px 0 rgba(0, 0, 0, 0.8);
    font-weight: 900;
    box-shadow: 
        0 6px 15px rgba(0, 0, 0, 0.5),
        inset 0 2px 4px rgba(255,255,255,0.2),
        0 0 0 1px rgba(0, 0, 0, 0.3);
}

.chess-piece:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 
        0 8px 20px rgba(0,0,0,0.5),
        inset 0 2px 4px rgba(255,255,255,0.5),
        0 0 15px rgba(212, 175, 55, 0.6);
    filter: brightness(1.1);
}

.chess-piece.red:hover {
    box-shadow: 
        0 8px 20px rgba(139, 0, 0, 0.4),
        inset 0 2px 4px rgba(255,255,255,0.6),
        0 0 15px rgba(255, 215, 0, 0.8);
}

.chess-piece.black:hover {
    box-shadow: 
        0 8px 20px rgba(0, 0, 0, 0.6),
        inset 0 2px 4px rgba(255,255,255,0.3),
        0 0 15px rgba(192, 192, 192, 0.8);
}

/* 移动动画效果 */
.chess-piece.moving {
    position: absolute;
    z-index: 100;
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(0,0,0,0.6);
    filter: brightness(1.1);
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* 最后移动的棋子高亮 */
.board-cell.last-move {
    border-radius: 50%;
    animation: lastMoveGlow 2s ease-in-out;
}

@keyframes lastMoveGlow {
    0% { background-color: rgba(255, 215, 0, 0.8); }
    50% { background-color: rgba(255, 215, 0, 0.4); }
    100% { background-color: transparent; }
}

/* AI对战模态框样式 */
#ai-game-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
}

#ai-game-modal .modal-content {
    background: linear-gradient(135deg, rgba(255, 248, 220, 0.98) 0%, rgba(255, 235, 205, 0.98) 100%);
    margin: 5% auto;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    box-shadow: 
        0 25px 50px rgba(0,0,0,0.3),
        inset 0 1px 0 rgba(255,255,255,0.6),
        0 0 0 2px rgba(139, 69, 19, 0.2);
    position: relative;
    border: 3px solid transparent;
    background-clip: padding-box;
}

#ai-game-modal .modal-content::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: linear-gradient(45deg, #d4af37, #ffd700, #b8860b, #daa520);
    border-radius: 23px;
    z-index: -1;
    pointer-events: none;
}

#ai-game-modal h3 {
    background: linear-gradient(45deg, #8b4513, #a0522d, #8b4513);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2em;
    margin-bottom: 20px;
    font-weight: 900;
    font-family: 'KaiTi', '楷体', serif;
    text-align: center;
}

.difficulty-selection {
    margin-bottom: 25px;
}

.difficulty-selection h4 {
    color: #8b4513;
    font-family: 'KaiTi', '楷体', serif;
    font-weight: 900;
    margin-bottom: 15px;
}

.difficulty-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.difficulty-option {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.6);
    border: 2px solid rgba(139, 69, 19, 0.2);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.difficulty-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.1), transparent);
    transition: left 0.6s;
    pointer-events: none;
}

.difficulty-option:hover::before {
    left: 100%;
}

.difficulty-option:hover {
    background: rgba(255, 253, 240, 0.8);
    border-color: rgba(212, 175, 55, 0.4);
    transform: translateX(5px);
}

.difficulty-option.selected {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.2) 0%, rgba(255, 215, 0, 0.1) 100%);
    border-color: #d4af37;
    border-width: 3px;
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
}

.difficulty-icon {
    font-size: 2em;
    min-width: 50px;
    text-align: center;
}

.difficulty-info {
    flex: 1;
}

.difficulty-info h5 {
    margin: 0 0 5px 0;
    color: #8b4513;
    font-size: 1.1em;
    font-weight: 900;
    font-family: 'KaiTi', '楷体', serif;
}

.difficulty-info p {
    margin: 0;
    color: #666;
    font-size: 0.9em;
    line-height: 1.3;
}

.side-selection {
    margin-bottom: 25px;
}

.side-selection h4 {
    color: #8b4513;
    font-family: 'KaiTi', '楷体', serif;
    font-weight: 900;
    margin-bottom: 15px;
}

.side-options {
    display: flex;
    gap: 15px;
}

.side-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.6);
    border: 2px solid rgba(139, 69, 19, 0.2);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    color: #8b4513;
    position: relative;
    overflow: hidden;
}

.side-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.1), transparent);
    transition: left 0.6s;
    pointer-events: none;
}

.side-option:hover::before {
    left: 100%;
}

.side-option:hover {
    background: rgba(255, 253, 240, 0.8);
    border-color: rgba(212, 175, 55, 0.4);
    transform: translateY(-2px);
}

.side-option.selected {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.2) 0%, rgba(255, 215, 0, 0.1) 100%);
    border-color: #d4af37;
    border-width: 3px;
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
}

.side-color {
    font-size: 1.5em;
}

/* AI思考状态样式 */
.ai-thinking {
    position: relative;
}

.ai-thinking::after {
    content: '🤖 AI思考中...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
    z-index: 1000;
    animation: thinkingPulse 1.5s ease-in-out infinite;
}

@keyframes thinkingPulse {
    0%, 100% { opacity: 0.8; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
}

/* AI游戏状态指示器 */
.ai-game-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 165, 0, 0.2) 100%);
    padding: 6px 12px;
    border-radius: 15px;
    border: 1px solid rgba(255, 165, 0, 0.3);
    font-size: 0.8em;
    font-weight: 600;
    color: #8b4513;
}

.ai-game-indicator::before {
    content: '🤖';
    font-size: 1.1em;
}

/* 响应式设计 */
@media (max-width: 768px) {
    #ai-game-modal .modal-content {
        margin: 10% auto;
        padding: 20px;
        width: 95%;
    }
    
    .difficulty-options {
        gap: 8px;
    }
    
    .difficulty-option {
        padding: 12px 15px;
    }
    
    .difficulty-icon {
        font-size: 1.5em;
        min-width: 40px;
    }
    
    .side-options {
        flex-direction: column;
        gap: 10px;
    }
    
    .side-option {
        padding: 12px 15px;
    }
}

/* 移动轨迹指示 */
.board-cell.move-from::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background-color: rgba(255, 165, 0, 0.3);
    border: 2px solid #ffa500;
    border-radius: 50%;
    animation: moveFromPulse 1.5s ease-in-out;
    z-index: 1;
}

.board-cell.move-to::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background-color: rgba(0, 255, 0, 0.3);
    border: 2px solid #00ff00;
    border-radius: 50%;
    animation: moveToPulse 1.5s ease-in-out;
    z-index: 1;
}

@keyframes moveFromPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.7; }
    50% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
}

@keyframes moveToPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.7; }
    50% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
}

/* 新移动提示闪烁 */
.board-cell.new-move {
    animation: newMoveFlash 3s ease-in-out;
}

@keyframes newMoveFlash {
    0%, 20%, 40%, 60%, 80%, 100% { background-color: transparent; }
    10%, 30%, 50%, 70%, 90% { background-color: rgba(255, 255, 0, 0.6); }
}

.chess-piece::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.3), transparent 50%);
    pointer-events: none;
}

.status-bar {
    width: 590px;
    margin: 0 auto;
    padding: 15px 20px;
    background: linear-gradient(135deg, rgba(255, 248, 220, 0.9) 0%, rgba(245, 222, 179, 0.9) 100%);
    border-radius: 12px;
    text-align: center;
    border: 2px solid rgba(139, 69, 19, 0.2);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    position: relative;
}

.status-bar::before {
    content: '🎯';
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5em;
    opacity: 0.6;
}

.status-bar p {
    color: #8b4513;
    font-weight: 600;
    font-size: 1.1em;
    margin: 0;
    text-shadow: 0 1px 2px rgba(255,255,255,0.8);
}

.room-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: linear-gradient(45deg, #e8f4f8, #d1ecf1);
    border-radius: 10px;
}

.room-id {
    font-weight: bold;
    color: #2c3e50;
}

.player-count {
    color: #27ae60;
    font-weight: bold;
}

@media (max-width: 768px) {
    body {
        padding: 10px;
        font-size: 16px;
    }
    
    .welcome-container {
        padding: 30px 20px;
        margin: 10px;
        max-width: 100%;
    }
    
    .main-title {
        font-size: 2.8em;
    }
    
    .main-title::before,
    .main-title::after {
        display: none;
    }
    
    .welcome-actions {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .action-card {
        padding: 25px 20px;
        min-height: 120px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    
    .action-icon {
        font-size: 2.5em;
        margin-bottom: 15px;
    }
    
    .room-list-section {
        margin: 20px 10px;
        padding: 20px 15px;
    }
    
    .room-list-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .room-list-controls {
        justify-content: center;
    }
    
    .room-list {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .room-card {
        padding: 15px;
    }
    
    .room-players {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .room-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .btn-join, .btn-spectate {
        padding: 12px 15px;
        font-size: 1em;
        min-height: 44px;
    }
    
    .game-container {
        padding: 15px 10px;
        margin: 5px;
        max-width: 100%;
    }
    
    .game-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .game-title {
        justify-content: space-between;
        align-items: center;
    }
    
    .game-title h2 {
        font-size: 1.4em;
    }
    
    .btn-back {
        padding: 8px 15px;
        font-size: 12px;
    }
    
    .game-main {
        grid-template-columns: 1fr;
        gap: 15px;
        margin-top: 1rem;
    }
    
    .game-sidebar {
        order: -1;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    /* 紧凑型玩家面板移动端优化 */
    .players-panel-compact {
        margin-bottom: 10px;
    }
    
    .players-header-compact {
        padding: 8px 12px;
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }
    
    .players-header-compact h3 {
        font-size: 0.9em;
        text-align: center;
    }
    
    .room-info-inline {
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px;
        font-size: 0.7em;
    }
    
    .players-row {
        padding: 8px 12px;
        flex-direction: column;
        gap: 8px;
    }
    
    .player-mini {
        padding: 6px;
        justify-content: center;
    }
    
    .vs-indicator {
        align-self: center;
        font-size: 0.7em;
        padding: 2px 6px;
    }
    
    .player-avatar-mini {
        width: 24px;
        height: 24px;
        font-size: 0.8em;
    }
    
    .player-name-mini {
        font-size: 0.8em;
    }
    
    .player-status-mini {
        font-size: 0.65em;
    }
    
    .current-turn-mini {
        padding: 6px 12px;
        font-size: 0.7em;
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }
    
    /* 走棋记录移动端优化 */
    .move-history-panel {
        margin-bottom: 10px;
    }
    
    .move-history-header {
        padding: 8px 12px;
    }
    
    .move-history-header h3 {
        font-size: 0.9em;
    }
    
    .move-history-content {
        padding: 8px;
        max-height: 150px;
        font-size: 0.7em;
    }
    
    .move-item {
        padding: 4px 6px;
        margin-bottom: 3px;
    }
    
    .move-number {
        min-width: 20px;
        font-size: 0.8em;
    }
    
    .move-notation {
        margin: 0 6px;
        font-size: 0.8em;
    }
    
    .move-time {
        font-size: 0.6em;
    }
    
    /* 聊天面板移动端优化 */
    .chat-panel {
        margin-bottom: 10px;
    }
    
    .chat-header {
        padding: 8px 12px;
    }
    
    .chat-header h3 {
        font-size: 0.9em;
    }
    
    .chat-messages {
        padding: 8px;
        max-height: 120px;
        min-height: 80px;
        font-size: 0.7em;
    }
    
    .chat-message {
        margin-bottom: 6px;
        padding: 4px 6px;
        border-radius: 6px;
        max-width: 90%;
    }
    
    .message-header {
        font-size: 0.6em;
    }
    
    .message-content {
        font-size: 0.8em;
        line-height: 1.2;
    }
    
    .chat-input-area {
        padding: 8px;
        gap: 6px;
    }
    
    .chat-input-area input {
        padding: 6px 10px;
        font-size: 0.7em;
        border-radius: 15px;
    }
    
    .chat-input-area .btn {
        padding: 6px 10px;
        font-size: 0.7em;
        min-height: 32px;
    }
    
    /* 棋盘区域移动端优化 */
    .chess-area {
        gap: 10px;
    }
    
    .status-bar {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 10px 15px;
        font-size: 0.9em;
    }
    
    .status-bar::before {
        display: none;
    }
    
    .status-bar p {
        font-size: 0.9em;
        margin: 0;
    }
    
    .chess-board {
        width: 100%;
        max-width: 100%;
        height: auto;
        aspect-ratio: 9/10;
        padding: 15px;
        margin: 0;
    }
    
    .chess-piece {
        /* 尺寸由JavaScript动态设置 */
        min-width: 24px;
        min-height: 24px;
        max-width: 36px;
        max-height: 36px;
        font-size: 14px;
        touch-action: manipulation;
        display: flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
    }
    
    .board-cell {
        /* 尺寸和位置由JavaScript动态设置 */
        min-width: 24px;
        min-height: 24px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .board-cell.selected::before {
        /* 选中状态的高亮效果 */
        width: calc(100% + 4px);
        height: calc(100% + 4px);
    }

    
    /* 按钮移动端优化 */
    .btn {
        min-height: 36px;
        font-size: 0.8em;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        padding: 6px 12px;
    }
    
    .btn-sm {
        min-height: 32px;
        font-size: 0.7em;
        padding: 4px 8px;
    }
    
    /* 模态框移动端优化 */
    .modal-content {
        margin: 10% auto;
        padding: 20px 15px;
        width: 95%;
        max-width: 350px;
    }
    
    .modal input {
        font-size: 16px;
        min-height: 40px;
        padding: 12px;
    }
    
    /* 触摸优化 */
    * {
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        -khtml-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
    
    input, textarea {
        -webkit-user-select: text;
        -khtml-user-select: text;
        -moz-user-select: text;
        -ms-user-select: text;
        user-select: text;
    }
}
    
    /* 历史记录页面移动端优化 */
    .history-container {
        padding: 15px 10px;
        margin: 5px;
        max-width: 100%;
    }
    
    .history-header {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .history-title {
        justify-content: space-between;
        align-items: center;
    }
    
    .history-title h2 {
        font-size: 1.4em;
    }
    
    .history-stats {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .stat-item {
        min-width: 60px;
        padding: 8px;
        font-size: 0.8em;
    }
    
    .history-list {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .history-card {
        padding: 12px;
    }
    
    .history-players {
        grid-template-columns: 1fr;
        gap: 8px;
        text-align: center;
    }
    
    .history-vs {
        display: none;
    }
    
    .history-info {
        flex-direction: column;
        gap: 4px;
        text-align: center;
        font-size: 0.8em;
    }
    
    .history-actions {
        flex-direction: column;
        gap: 6px;
    }
    
    .btn-replay, .btn-delete {
        padding: 8px 12px;
        font-size: 0.8em;
        min-height: 36px;
    }
    
    /* 回放页面移动端优化 */
    .replay-container {
        padding: 15px 10px;
        margin: 5px;
        max-width: 100%;
    }
    
    .replay-main {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .replay-controls-section {
        order: -1;
        padding: 12px;
    }
    
    .replay-controls {
        gap: 4px;
        flex-wrap: wrap;
    }
    
    .replay-controls .btn {
        padding: 6px 8px;
        font-size: 0.7em;
        min-height: 36px;
        flex: 1;
        min-width: 60px;
    }
    
    .move-list {
        max-height: 150px;
        font-size: 0.8em;
    }
    
    .replay-board-section .chess-board {
        width: 100%;
        max-width: 100%;
    }
    
    /* 音效设置页面移动端优化 */
    .audio-settings-container {
        padding: 15px 10px;
        margin: 5px;
        max-width: 100%;
    }
    
    .audio-settings-title h2 {
        font-size: 1.4em;
    }
    
    .setting-item {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        text-align: center;
    }
    
    .sound-test-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .sound-test-btn {
        min-height: 36px;
        font-size: 0.8em;
        padding: 6px 8px;
    }

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at center, rgba(139, 69, 19, 0.3) 0%, transparent 70%),
        linear-gradient(135deg, rgba(0,0,0,0.6) 0%, rgba(139, 69, 19, 0.4) 100%);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: 
        linear-gradient(135deg, rgba(255, 248, 220, 0.95) 0%, rgba(255, 235, 205, 0.95) 100%);
    margin: 15% auto;
    padding: 35px;
    border-radius: 25px;
    width: 90%;
    max-width: 420px;
    text-align: center;
    box-shadow: 
        0 25px 50px rgba(0,0,0,0.4),
        inset 0 1px 0 rgba(255,255,255,0.6),
        0 0 0 3px rgba(139, 69, 19, 0.2);
    border: 3px solid transparent;
    background-clip: padding-box;
    position: relative;
}

.modal-content::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: linear-gradient(45deg, #d4af37, #ffd700, #b8860b, #daa520);
    border-radius: 28px;
    z-index: -1;
    pointer-events: none;
}

.modal-content h3 {
    background: linear-gradient(45deg, #8b4513, #a0522d, #8b4513);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-family: 'KaiTi', '楷体', serif;
    font-weight: 900;
    margin-bottom: 20px;
    font-size: 1.4em;
}



.modal input {
    width: 100%;
    padding: 15px;
    margin: 15px 0;
    border: 2px solid rgba(139, 69, 19, 0.3);
    border-radius: 15px;
    font-size: 16px;
    background: rgba(255, 248, 220, 0.8);
    color: #8b4513;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.modal input:focus {
    outline: none;
    border-color: rgba(212, 175, 55, 0.6);
    background: rgba(255, 253, 240, 0.9);
    box-shadow: 
        inset 0 2px 4px rgba(0,0,0,0.1),
        0 0 15px rgba(212, 175, 55, 0.3);
}

.modal input::placeholder {
    color: rgba(139, 69, 19, 0.6);
}

.modal input:focus {
    outline: none;
    border-color: #4834d4;
}

/* 历史记录页面样式 */
.history-container {
    max-width: 1200px;
    margin: 0 auto;
    background: 
        linear-gradient(135deg, rgba(255, 248, 220, 0.95) 0%, rgba(255, 235, 205, 0.95) 100%);
    border-radius: 25px;
    padding: 30px;
    box-shadow: 
        0 25px 50px rgba(0,0,0,0.15),
        inset 0 1px 0 rgba(255,255,255,0.6),
        0 0 0 1px rgba(139, 69, 19, 0.2);
    position: relative;
    border: 3px solid transparent;
    background-clip: padding-box;
    min-height: 80vh;
}

.history-header {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(139, 69, 19, 0.2);
}

.history-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-title h2 {
    background: linear-gradient(45deg, #8b4513, #a0522d, #8b4513);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2.2em;
    margin: 0;
    font-weight: 900;
    font-family: 'KaiTi', '楷体', serif;
}

.history-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    border: 1px solid rgba(139, 69, 19, 0.2);
    min-width: 80px;
}

.stat-label {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
    font-weight: 600;
}

.stat-value {
    font-size: 1.4em;
    font-weight: 900;
    color: #8b4513;
    font-family: 'KaiTi', '楷体', serif;
}

.history-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.history-content {
    position: relative;
}

.history-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
}

.history-card {
    background: 
        linear-gradient(135deg, rgba(255, 253, 240, 0.95) 0%, rgba(255, 248, 220, 0.95) 100%);
    border-radius: 15px;
    padding: 20px;
    border: 2px solid rgba(139, 69, 19, 0.2);
    box-shadow: 
        0 8px 20px rgba(0,0,0,0.1),
        inset 0 1px 0 rgba(255,255,255,0.6);
    transition: all 0.3s ease;
}

.history-card:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 12px 25px rgba(0,0,0,0.15),
        inset 0 1px 0 rgba(255,255,255,0.8);
}

.history-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.history-room {
    font-size: 1.1em;
    font-weight: 700;
    color: #8b4513;
    font-family: 'KaiTi', '楷体', serif;
}

.history-result {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
    text-transform: uppercase;
}

.history-result.result-red {
    background: linear-gradient(135deg, #ffcccb, #ff9999);
    color: #8b0000;
}

.history-result.result-black {
    background: linear-gradient(135deg, #d3d3d3, #a9a9a9);
    color: #2c2c2c;
}

.history-result.result-draw {
    background: linear-gradient(135deg, #ffeaa7, #fdcb6e);
    color: #8b4513;
}

.history-players {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 15px;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 10px;
}

.history-player {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.history-player.red {
    color: #8b0000;
}

.history-player.black {
    color: #2c2c2c;
}

.history-vs {
    font-weight: 900;
    color: #8b4513;
    font-size: 0.9em;
}

.history-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 0.9em;
    color: #666;
    flex-wrap: wrap;
    gap: 10px;
}

.history-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.btn-replay, .btn-delete {
    flex: 1;
    padding: 8px 15px;
    border: none;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.btn-replay {
    background: linear-gradient(135deg, #32cd32 0%, #228b22 100%);
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.btn-replay:hover {
    background: linear-gradient(135deg, #228b22 0%, #32cd32 100%);
    transform: translateY(-1px);
}

.btn-delete {
    background: linear-gradient(135deg, #dc143c 0%, #b22222 100%);
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.btn-delete:hover {
    background: linear-gradient(135deg, #b22222 0%, #dc143c 100%);
    transform: translateY(-1px);
}

.empty-history {
    text-align: center;
    padding: 60px 20px;
    color: #8b4513;
}

.empty-history .empty-icon {
    font-size: 4em;
    margin-bottom: 20px;
    opacity: 0.6;
}

.empty-history h4 {
    font-size: 1.5em;
    margin-bottom: 10px;
    font-family: 'KaiTi', '楷体', serif;
    font-weight: 900;
}

.empty-history p {
    margin-bottom: 25px;
    color: #666;
    font-size: 1.1em;
}

.history-container::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: linear-gradient(45deg, #d4af37, #ffd700, #b8860b, #daa520);
    border-radius: 28px;
    z-index: -1;
    pointer-events: none;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.history-title {
    display: flex;
    align-items: center;
    gap: 20px;
}

.history-title h2 {
    background: linear-gradient(45deg, #8b0000, #dc143c, #b22222);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2.2em;
    margin: 0;
    font-weight: 900;
    font-family: 'KaiTi', '楷体', serif;
}

.history-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 10px;
    border: 1px solid rgba(139, 69, 19, 0.2);
    min-width: 80px;
}

.stat-label {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.4em;
    font-weight: 900;
    color: #8b4513;
    font-family: 'KaiTi', '楷体', serif;
}

.history-controls {
    display: flex;
    gap: 10px;
}

.history-content {
    position: relative;
    min-height: 300px;
}

.history-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
}

.history-card {
    background: 
        linear-gradient(135deg, rgba(255, 253, 240, 0.95) 0%, rgba(255, 248, 220, 0.95) 100%);
    border-radius: 15px;
    padding: 20px;
    border: 2px solid rgba(139, 69, 19, 0.2);
    box-shadow: 
        0 8px 20px rgba(0,0,0,0.1),
        inset 0 1px 0 rgba(255,255,255,0.6);
    transition: all 0.3s ease;
}

.history-card:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 12px 25px rgba(0,0,0,0.15),
        0 0 0 2px rgba(212, 175, 55, 0.3),
        inset 0 1px 0 rgba(255,255,255,0.8);
}

.history-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.history-room {
    font-size: 1.1em;
    font-weight: 900;
    color: #8b4513;
    font-family: 'KaiTi', '楷体', serif;
}

.history-result {
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.9em;
    font-weight: 600;
}

.history-result.result-red {
    background: linear-gradient(135deg, #ffcccb, #ff9999);
    color: #8b0000;
}

.history-result.result-black {
    background: linear-gradient(135deg, #d3d3d3, #a9a9a9);
    color: #000;
}

.history-result.result-draw {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    color: #8b4513;
}

.history-players {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 15px;
    align-items: center;
    margin-bottom: 15px;
}

.history-player {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.history-vs {
    text-align: center;
    font-weight: 900;
    color: #8b4513;
    font-size: 1.1em;
}

.history-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.85em;
    color: #666;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.history-actions {
    display: flex;
    gap: 10px;
}

.btn-replay, .btn-delete {
    flex: 1;
    padding: 8px 15px;
    border: none;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-replay {
    background: linear-gradient(135deg, #228b22 0%, #32cd32 50%, #006400 100%);
    color: #fff8dc;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.btn-replay:hover {
    background: linear-gradient(135deg, #32cd32 0%, #228b22 50%, #006400 100%);
    transform: translateY(-2px);
}

.btn-delete {
    background: linear-gradient(135deg, #dc143c 0%, #b22222 50%, #8b0000 100%);
    color: #fff8dc;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.btn-delete:hover {
    background: linear-gradient(135deg, #ff1744 0%, #dc143c 50%, #b22222 100%);
    transform: translateY(-2px);
}

.empty-history {
    text-align: center;
    padding: 60px 20px;
    color: #8b4513;
}

.empty-history .empty-icon {
    font-size: 4em;
    margin-bottom: 20px;
    opacity: 0.6;
}

.empty-history h4 {
    font-size: 1.5em;
    margin-bottom: 10px;
    font-family: 'KaiTi', '楷体', serif;
    font-weight: 900;
}

.empty-history p {
    margin-bottom: 25px;
    color: #666;
    font-size: 1.1em;
}

/* 回放页面样式 */
.replay-container {
    max-width: 1400px;
    margin: 0 auto;
    background: 
        linear-gradient(135deg, rgba(255, 248, 220, 0.95) 0%, rgba(255, 235, 205, 0.95) 100%);
    border-radius: 25px;
    padding: 25px;
    box-shadow: 
        0 25px 50px rgba(0,0,0,0.15),
        inset 0 1px 0 rgba(255,255,255,0.6),
        0 0 0 1px rgba(139, 69, 19, 0.2);
    position: relative;
    border: 3px solid transparent;
    background-clip: padding-box;
    min-height: 80vh;
}

.replay-container::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: linear-gradient(45deg, #d4af37, #ffd700, #b8860b, #daa520);
    border-radius: 28px;
    z-index: -1;
    pointer-events: none;
}

.replay-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 20px;
}

.replay-title {
    display: flex;
    align-items: center;
    gap: 20px;
}

.replay-title h2 {
    background: linear-gradient(45deg, #8b0000, #dc143c, #b22222);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2em;
    margin: 0;
    font-weight: 900;
    font-family: 'KaiTi', '楷体', serif;
}

.replay-info {
    flex: 1;
}

.replay-game-info {
    text-align: center;
}

.replay-players {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 10px;
    font-size: 1.1em;
    font-weight: 600;
}

.replay-players .vs {
    font-weight: 900;
    color: #8b4513;
}

.replay-details {
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 0.9em;
    color: #666;
    flex-wrap: wrap;
}

.replay-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 20px;
}

.replay-title {
    display: flex;
    align-items: center;
    gap: 20px;
}

.replay-title h2 {
    background: linear-gradient(45deg, #8b0000, #dc143c, #b22222);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2em;
    margin: 0;
    font-weight: 900;
    font-family: 'KaiTi', '楷体', serif;
}

.replay-info {
    flex: 1;
}

.replay-game-info {
    text-align: center;
}

.replay-players {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 10px;
    font-size: 1.1em;
    font-weight: 600;
}

.replay-players .vs {
    font-weight: 900;
    color: #8b4513;
}

.replay-details {
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 0.9em;
    color: #666;
    flex-wrap: wrap;
}

.replay-main {
    display: grid;
    grid-template-columns: 30% 70%;
    gap: 20px;
    align-items: start;
    margin-top: 1rem;
}

.replay-board-section {
    display: flex;
    justify-content: center;
    align-items: center;
}

.replay-board-section .chess-board {
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: 9/10;
}

.replay-controls-section {
    background: 
        linear-gradient(135deg, rgba(255, 248, 220, 0.9) 0%, rgba(245, 222, 179, 0.9) 100%);
    border-radius: 15px;
    border: 2px solid rgba(139, 69, 19, 0.2);
    box-shadow: 
        0 10px 25px rgba(0,0,0,0.1),
        inset 0 1px 0 rgba(255,255,255,0.6);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: fit-content;
}

.replay-progress {
    margin-bottom: 20px;
}

.progress-info {
    text-align: center;
    margin-bottom: 10px;
    font-weight: 600;
    color: #8b4513;
}

.progress-bar input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(139, 69, 19, 0.2);
    outline: none;
    cursor: pointer;
}

.replay-controls {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.replay-controls .btn {
    padding: 8px 12px;
    font-size: 0.9em;
}

.replay-speed {
    text-align: center;
    margin-bottom: 20px;
}

.replay-speed label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #8b4513;
}

.replay-speed select {
    padding: 5px 10px;
    border: 2px solid rgba(139, 69, 19, 0.3);
    border-radius: 8px;
    background: rgba(255, 248, 220, 0.8);
    color: #8b4513;
    font-weight: 600;
}

.move-history {
    max-height: 300px;
    overflow-y: auto;
}

.move-history h4 {
    margin-bottom: 10px;
    color: #8b4513;
    font-family: 'KaiTi', '楷体', serif;
    font-weight: 900;
}

.move-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}



.move-number {
    font-weight: 600;
    min-width: 25px;
}

.move-player {
    font-weight: 600;
    min-width: 20px;
}

.move-notation {
    flex: 1;
}

/* 音效设置页面样式 */
.audio-settings-container {
    max-width: 800px;
    margin: 0 auto;
    background: 
        linear-gradient(135deg, rgba(255, 248, 220, 0.95) 0%, rgba(255, 235, 205, 0.95) 100%);
    border-radius: 25px;
    padding: 30px;
    box-shadow: 
        0 25px 50px rgba(0,0,0,0.15),
        inset 0 1px 0 rgba(255,255,255,0.6),
        0 0 0 1px rgba(139, 69, 19, 0.2);
    position: relative;
    border: 3px solid transparent;
    background-clip: padding-box;
}

.audio-settings-container::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: linear-gradient(45deg, #d4af37, #ffd700, #b8860b, #daa520);
    border-radius: 28px;
    z-index: -1;
    pointer-events: none;
}

.audio-settings-header {
    margin-bottom: 30px;
}

.audio-settings-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.audio-settings-title h2 {
    background: linear-gradient(45deg, #8b0000, #dc143c, #b22222);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2.2em;
    margin: 0;
    font-weight: 900;
    font-family: 'KaiTi', '楷体', serif;
}

.settings-section {
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 15px;
    border: 2px solid rgba(139, 69, 19, 0.2);
}

.settings-section h3 {
    color: #8b4513;
    font-family: 'KaiTi', '楷体', serif;
    font-weight: 900;
    margin-bottom: 20px;
    font-size: 1.3em;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid rgba(139, 69, 19, 0.1);
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-label span {
    font-weight: 600;
    color: #333;
    font-size: 1.1em;
}

.setting-label p {
    margin: 5px 0 0 0;
    color: #666;
    font-size: 0.9em;
}

.setting-control {
    display: flex;
    align-items: center;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #8b4513;
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

#volume-slider {
    width: 150px;
    height: 6px;
    border-radius: 3px;
    background: rgba(139, 69, 19, 0.2);
    outline: none;
    cursor: pointer;
}

.sound-test-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.sound-test-btn {
    padding: 12px 15px;
    font-size: 0.9em;
    text-align: center;
}

.settings-info {
    background: rgba(255, 255, 255, 0.8);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid rgba(139, 69, 19, 0.1);
}

.settings-info ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.settings-info li {
    padding: 5px 0;
    color: #666;
    font-size: 0.9em;
}

.settings-info li strong {
    color: #8b4513;
    font-weight: 600;
}