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

body {
    font-family: 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #b19173, #6d7aa7);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
        padding: 20px;
    color: #cacaca;
}

.header {
    text-align: center;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    width: 100%;
    max-width: 800px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

h1 {
    font-size: 2.5rem;
    text-shadow: 0 0 10px rgba(112, 112, 112, 0.8);
    margin-bottom: 10px;
    color: #c7c7c7;
}

.subtitle {
    font-size: 1.2rem;
    color: #adadad;
    margin-bottom: 10px;
}

.rules {
    background: rgba(70, 70, 70, 0.7);
    padding: 10px;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-top: 10px;
}

.container {
    display: flex;
    gap: 30px;
    max-width: 1200px;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    transform-origin: top center;
}

.game-board {
    background: #3f3f3f;
    border: 4px solid #3f3f3f;
    border-radius: 8px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.7);
    padding: 20px;
    position: relative;
}

.board {
    display: grid;
    grid-template-columns: repeat(9, 60px);
    grid-template-rows: repeat(10, 60px);
    position: relative;
}

.cell {
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.white-cell {
    background-color: #cfcfcf;
}

.black-cell {
    background-color: #8f8f8f;
}

.piece {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease; /* 过渡动画 */
    position: relative;
    z-index: 10;
    user-select: none;
}

.piece.moving {
    z-index: 100; /* 移动时提高层级 */
}

.piece.white {
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    color: #333;
    border: 2px solid #999;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.1);
}

.piece.black {
    background: linear-gradient(145deg, #333333, #000000);
    color: #fff;
    border: 2px solid #444;
}

.piece.selected {
    box-shadow: 0 0 0 4px rgb(255, 239, 147), 0 0 20px rgba(156, 144, 74, 0.8);
    transform: scale(1.1);
    z-index: 20;
}

.possible-move {
    position: absolute;
    width: 20px;
    height: 20px;
    background: rgba(220, 255, 174, 0.6);
    border-radius: 50%;
    z-index: 5;
    pointer-events: none;
    box-shadow: 0 0 5px rgba(111, 156, 74, 0.8);
}

.possible-capture {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid rgba(255, 50, 50, 0.7);
    border-radius: 50%;
    z-index: 5;
    pointer-events: none;
    box-shadow: 0 0 8px rgba(255, 50, 50, 0.5);
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 10px;
    width: 300px;
    height: fit-content;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.status {
    background: rgba(82, 82, 82, 0.5);
    padding: 15px;
    border-radius: 8px;
    font-size: 1.2rem;
    text-align: center;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.status h2 {
    color: rgb(179, 179, 179);
    margin-bottom: 10px;
}

.btn {
    padding: 12px 20px;
    font-size: 1.1rem;
    background: linear-gradient(to bottom, #2b313d, #454e53);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
}

.btn:hover {
    background: linear-gradient(to bottom, #6e7c9c, #454e53);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.special-rule {
    background: rgba(70, 70, 70, 0.7);
    padding: 15px;
    border-radius: 8px;
    font-size: 1rem;
}

.special-rule h3 {
    color: #ccc;
    margin-bottom: 10px;
    text-align: center;
}

.player-turn {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.turn-indicator {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

/* 添加难度选择按钮样式 */
.difficulty-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.difficulty-btn {
    flex: 1;
    padding: 8px;
    font-size: 0.9rem;
}

.difficulty-btn.active {
    background: linear-gradient(to bottom, #6e7c9c, #454e53);
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

/* 九宫格外边框样式 */
.palace-border {
    position: absolute;
    border: 3px solid rgba(255, 255, 255, 0.9);
    z-index: 15;
    pointer-events: none;
}

.river-highlight {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-bottom: dashed 3px rgba(255, 255, 255, 0.9);
    z-index: 15;
    pointer-events: none;
}
/* 添加走子提示标记样式 */
.move-indicator {
    position: absolute;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 3px solid;
    z-index: 25;
    pointer-events: none;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.move-indicator.white {
    border-color: rgba(255, 229, 80, 0.6);
    box-shadow: 0 0 5px 1px rgba(255, 229, 80, 0.4);
}

.move-indicator.black {
    border-color: rgba(255, 229, 80, 0.6);
    box-shadow: 0 0 5px 1px rgba(255, 229, 80, 0.4);
}
@media screen and (max-width: 768px) {
    .container {
        transform: scale(0.8);
        width: 125%; /* 补偿缩放后的空间 */
    }
}

@media screen and (max-width: 480px) {
    .container {
        transform: scale(0.6);
        width: 166%; /* 补偿缩放后的空间 */
    }
}
