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

        body {
            font-family: 'Microsoft YaHei', 'SF Pro Display', -apple-system, sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            color: #2c3e50;
            padding: 20px;
            overflow-x: hidden;
        }

        .game-container {
            max-width: 1000px;
            margin: 0 auto;
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(20px);
            border-radius: 24px;
            padding: 30px;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
        }

        h1 {
            text-align: center;
            font-size: 2.8rem;
            color: #2c3e50;
            margin-bottom: 30px;
            font-weight: 700;
            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        }

        .game-info {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 20px;
            margin-bottom: 30px;
        }

        .player-info {
            background: linear-gradient(135deg, #C0392B, #A93226);
            color: white;
            padding: 20px;
            border-radius: 16px;
            text-align: center;
            box-shadow: 0 8px 25px rgba(192, 57, 43, 0.3);
            transition: transform 0.3s ease;
        }

        .player-info.active {
            transform: translateY(-3px);
            box-shadow: 0 12px 35px rgba(192, 57, 43, 0.4);
        }

        .player-info.black {
            background: linear-gradient(135deg, #2c3e50, #34495e);
            box-shadow: 0 8px 25px rgba(44, 62, 80, 0.3);
        }

        .player-info.black.active {
            box-shadow: 0 12px 35px rgba(44, 62, 80, 0.4);
        }

        .player-name {
            font-size: 1.2rem;
            font-weight: 700;
            margin-bottom: 10px;
        }

        .player-status {
            font-size: 1rem;
            opacity: 0.9;
        }

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

        .btn {
            padding: 12px 24px;
            border: none;
            border-radius: 50px;
            background: linear-gradient(135deg, #667eea, #764ba2);
            color: white;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            font-size: 0.9rem;
            box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
        }

        .btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
        }

        .btn:active {
            transform: translateY(0);
        }

        .btn.secondary {
            background: linear-gradient(135deg, #4ECDC4, #44A08D);
            box-shadow: 0 6px 20px rgba(78, 205, 196, 0.3);
        }

        .btn.secondary:hover {
            box-shadow: 0 8px 25px rgba(78, 205, 196, 0.4);
        }

        .chess-board-container {
            display: flex;
            justify-content: center;
            margin-bottom: 30px;
        }

        .chess-board {
            background: #D4B08A;
            border: 8px solid #8B4513;
            border-radius: 12px;
            padding: 30px;
            box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
            position: relative;
        }

        .board-container {
            position: relative;
            width: 450px;
            height: 500px;
            background: #D4B08A;
            border: 2px solid #8B4513;
            border-radius: 8px;
        }

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

        .board-intersection {
            position: absolute;
            width: 12px;
            height: 12px;
            margin: -6px 0 0 -6px;
            cursor: pointer;
            border-radius: 50%;
            transition: all 0.2s ease;
            z-index: 1;
        }

        .board-intersection:hover {
            background: rgba(255, 107, 107, 0.3);
        }

        .board-intersection.selected {
            background: rgba(255, 107, 107, 0.5);
            box-shadow: 0 0 0 3px #FF6B6B;
        }

        .board-intersection.possible-move {
            background: rgba(144, 238, 144, 0.7);
            box-shadow: 0 0 0 2px #90EE90;
        }

        .chess-piece {
            position: absolute;
            width: 44px;
            height: 44px;
            /* 精确居中在交叉线交点上：负边距为宽高的精确一半 */
            margin-left: -22px;
            margin-top: -22px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            font-size: 1.2rem;
            cursor: pointer;
            transition: all 0.2s ease;
            border: 2px solid;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
            z-index: 10;
            /* 确保棋子文字在圆形中完美居中 */
            text-align: center;
            line-height: 1;
            /* 传统象棋棋子质感 */
            background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.3), transparent 50%);
        }

        /* 象棋残局模式下的棋子增强显示 */
        .chess-piece.endgame-piece {
            border-width: 3px;
            box-shadow: 0 3px 12px rgba(0, 0, 0, 0.4);
            font-weight: 800;
            /* 残局模式下更加突出 */
        }

        .chess-piece.endgame-piece:hover {
            transform: scale(1.15);
            box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
        }

        /* 残局模式下的棋盘增强 */
        .endgame-mode .board-lines {
            filter: contrast(1.1) brightness(1.05);
        }

        .endgame-mode .chess-board {
            box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
            border-width: 10px;
        }

        /* Chess-Puzzle谜题模式专用样式 */
        .puzzle-btn {
            background: linear-gradient(135deg, #9b59b6, #8e44ad) !important;
            color: white !important;
            box-shadow: 0 6px 20px rgba(155, 89, 182, 0.3) !important;
        }

        .puzzle-btn:hover {
            box-shadow: 0 8px 25px rgba(155, 89, 182, 0.4) !important;
        }

        /* Chess-Puzzle模式下的棋盘 - 增强标准中国象棋设计 */
        .chess-puzzle-mode .board-lines {
            filter: contrast(1.2) brightness(1.15) saturate(1.1);
            /* 增强线条清晰度 */
        }

        .chess-puzzle-mode .chess-board {
            border: 15px solid #654321;
            box-shadow: 
                0 30px 80px rgba(0, 0, 0, 0.4),
                inset 0 0 20px rgba(139, 69, 19, 0.2);
            background: 
                linear-gradient(135deg, #D2B48C 0%, #DEB887 50%, #D2B48C 100%),
                radial-gradient(circle at 30% 30%, rgba(255,255,255,0.1), transparent 60%);
            /* 木质纹理增强效果 */
            position: relative;
        }

        .chess-puzzle-mode .chess-board::before {
            content: '';
            position: absolute;
            top: -15px;
            left: -15px;
            right: -15px;
            bottom: -15px;
            background: linear-gradient(45deg, #8B4513, #A0522D, #8B4513);
            border-radius: 8px;
            z-index: -1;
        }

        /* Chess-Puzzle模式下的棋盘容器增强 */
        .chess-puzzle-mode .board-container {
            background: rgba(212, 180, 138, 0.95);
            border-radius: 6px;
            border: 3px solid #8B4513;
        }

        /* Chess-Puzzle模式下的棋子增强 - 精确居中在交叉线上 */
        .chess-piece.puzzle-piece {
            border-width: 4px;
            box-shadow: 
                0 4px 15px rgba(0, 0, 0, 0.4),
                0 0 0 1px rgba(255, 255, 255, 0.3) inset;
            font-weight: 900;
            font-size: 1.25rem;
            /* 谜题模式下更加突出和立体 */
            filter: drop-shadow(0 3px 6px rgba(0,0,0,0.4));
            /* 确保精确居中在交叉线交点上 */
            transform-origin: center center;
            /* 增强木质棋子质感 */
            background: 
                radial-gradient(circle at 25% 25%, rgba(255,255,255,0.4), transparent 50%),
                radial-gradient(circle at 75% 75%, rgba(0,0,0,0.1), transparent 50%);
        }

        .chess-piece.puzzle-piece:hover {
            transform: scale(1.25);
            box-shadow: 
                0 8px 25px rgba(0, 0, 0, 0.6),
                0 0 0 2px rgba(255, 255, 255, 0.4) inset;
            filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5));
        }

        /* Chess-Puzzle模式下的棋子颜色增强 */
        .chess-piece.puzzle-piece.red {
            background: 
                linear-gradient(135deg, #E74C3C, #C0392B),
                radial-gradient(circle at 25% 25%, rgba(255,255,255,0.4), transparent 50%);
            border-color: #922B21;
            color: #FFFFFF;
            text-shadow: 0 1px 2px rgba(0,0,0,0.5);
        }

        .chess-piece.puzzle-piece.black {
            background: 
                linear-gradient(135deg, #2C3E50, #1B2631),
                radial-gradient(circle at 25% 25%, rgba(255,255,255,0.3), transparent 50%);
            border-color: #0B1426;
            color: #FFFFFF;
            text-shadow: 0 1px 2px rgba(0,0,0,0.7);
        }

        /* 谜题解决成功特效 */
        .puzzle-solved .chess-piece {
            animation: puzzleSolved 2s infinite alternate;
        }

        @keyframes puzzleSolved {
            0% { filter: drop-shadow(0 0 5px #4CAF50); }
            100% { filter: drop-shadow(0 0 15px #4CAF50); }
        }

        /* Chess-Puzzle模式下的士线增强效果 */
        .chess-puzzle-mode .palace-line {
            stroke: #A0522D;
            stroke-width: 2.8;
            opacity: 1;
            filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
        }

        /* Chess-Puzzle模式下的九宫格增强标记 */
        .chess-puzzle-mode #palaceLines {
            filter: drop-shadow(0 1px 3px rgba(0,0,0,0.2));
        }

        /* 谜题模式下的交叉点增强显示 */
        .chess-puzzle-mode .board-intersection {
            background: rgba(139, 69, 19, 0.1);
            border: 1px solid rgba(139, 69, 19, 0.2);
        }

        .chess-puzzle-mode .board-intersection:hover {
            background: rgba(255, 107, 107, 0.4);
            border: 2px solid #FF6B6B;
        }

        /* 关键棋子提示动画 */
        @keyframes keyPieceHint {
            0% { 
                transform: scale(1);
                filter: drop-shadow(0 3px 6px rgba(0,0,0,0.4));
            }
            50% { 
                transform: scale(1.15);
                filter: drop-shadow(0 0 10px #FFD700);
            }
            100% { 
                transform: scale(1);
                filter: drop-shadow(0 3px 6px rgba(0,0,0,0.4));
            }
        }

        /* Chess-Puzzle模式下的选中棋子增强效果 */
        .chess-puzzle-mode .board-intersection.selected {
            background: rgba(255, 215, 0, 0.6);
            box-shadow: 0 0 0 4px #FFD700;
            border-radius: 8px;
        }

        .chess-puzzle-mode .board-intersection.possible-move {
            background: rgba(144, 238, 144, 0.8);
            box-shadow: 0 0 0 3px #90EE90;
            border-radius: 6px;
        }

        .chess-piece:hover {
            transform: scale(1.1);
        }

        .chess-piece.red {
            background: linear-gradient(135deg, #E74C3C, #C0392B);
            color: white;
            border-color: #A93226;
        }

        .chess-piece.black {
            background: linear-gradient(135deg, #2c3e50, #34495e);
            color: white;
            border-color: #1B2631;
        }

        .river-line {
            position: absolute;
            left: 0;
            right: 0;
            top: 50%;
            height: 50px;
            margin-top: -25px;
            background: linear-gradient(to right, transparent, #654321, transparent);
            pointer-events: none;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #654321;
            font-weight: bold;
            font-size: 1.5rem;
        }

        .game-status {
            background: rgba(255, 255, 255, 0.8);
            padding: 20px;
            border-radius: 16px;
            margin-bottom: 20px;
            text-align: center;
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
        }

        .game-status h3 {
            color: #2c3e50;
            margin-bottom: 10px;
            font-size: 1.3rem;
        }

        .status-text {
            font-size: 1.1rem;
            color: #7f8c8d;
        }

        .move-history {
            background: rgba(255, 255, 255, 0.8);
            padding: 20px;
            border-radius: 16px;
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
            max-height: 200px;
            overflow-y: auto;
        }

        .move-history h3 {
            color: #2c3e50;
            margin-bottom: 15px;
            font-size: 1.2rem;
        }

        .move-item {
            display: flex;
            justify-content: space-between;
            padding: 5px 0;
            border-bottom: 1px solid #ecf0f1;
        }

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

        .game-over-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.8);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 1000;
        }

        .game-over-content {
            background: white;
            padding: 40px;
            border-radius: 20px;
            text-align: center;
            max-width: 400px;
            margin: 20px;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
        }

        .game-over-content h2 {
            color: #27ae60;
            margin-bottom: 20px;
            font-size: 2rem;
        }

        .winner-text {
            font-size: 1.5rem;
            color: #2c3e50;
            margin-bottom: 25px;
        }

        .celebration {
            font-size: 3rem;
            margin-bottom: 20px;
            animation: bounce 2s infinite;
        }

        @keyframes bounce {
            0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
            40% { transform: translateY(-10px); }
            60% { transform: translateY(-5px); }
        }

        .instructions {
            background: rgba(255, 255, 255, 0.8);
            padding: 25px;
            border-radius: 16px;
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
            margin-top: 30px;
        }

        .instructions h3 {
            color: #2c3e50;
            margin-bottom: 20px;
            font-size: 1.3rem;
            text-align: center;
        }

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

        .instruction-item {
            background: white;
            padding: 15px;
            border-radius: 12px;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
        }

        .instruction-item h4 {
            color: #C0392B;
            margin-bottom: 8px;
            font-size: 1rem;
        }

        .instruction-item p {
            color: #7f8c8d;
            font-size: 0.85rem;
            line-height: 1.4;
        }

        @media (max-width: 768px) {
            .game-container {
                padding: 20px;
                margin: 10px;
            }

            h1 {
                font-size: 2.2rem;
            }

            .board-container {
                width: 360px;
                height: 400px;
                /* 确保SVG适应移动端缩放 */
                transform: scale(0.8);
                transform-origin: center;
            }
            
            .board-lines {
                /* SVG在移动端的优化显示 */
                width: 100%;
                height: 100%;
            }

            .chess-piece {
                width: 36px;
                height: 36px;
                /* 移动端精确居中在交叉线上：负边距为宽高的精确一半 */
                margin-left: -18px;
                margin-top: -18px;
                font-size: 1rem;
            }

            .game-controls {
                flex-direction: column;
                align-items: center;
            }

            .btn {
                width: 100%;
                max-width: 200px;
            }

            .instruction-grid {
                grid-template-columns: 1fr;
            }
        }

        @media (max-width: 480px) {
            .board-container {
                width: 320px;
                height: 360px;
                /* 小屏幕进一步缩放 */
                transform: scale(0.7);
                transform-origin: center;
            }

            .chess-piece {
                width: 32px;
                height: 32px;
                /* 小屏移动端精确居中在交叉线上：负边距为宽高的精确一半 */
                margin-left: -16px;
                margin-top: -16px;
                font-size: 0.9rem;
            }
            
            /* 优化小屏幕上的河界文字 */
            .river-line {
                font-size: 1.2rem;
            }
        }