/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background: #f5f5dc; /* 浅黄色背景 */
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow: hidden; /* 防止页面出现滚动条 */
}

/* 已移除.container样式 */

.page {
    display: none;
}

.page.active {
    display: block;
}

/* 设置页面样式 */
#setup-page {
    text-align: center;
    background: #f5f5dc;
    padding: 20px; /* 减少内边距节约空间 */
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

#setup-page h1 {
    color: #333;
    margin-bottom: 30px;
    font-size: 2.5em;
}

.setup-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px; /* 减小间距节约空间 */
    width: 100%;
}

/* 单词挑战模式下的垂直居中 */
.setup-content.word-challenge-center {
    justify-content: center;
    min-height: 80vh;
}

/* 新的设置卡片样式 */
.setup-card {
    width: 100%;
    max-width: 600px;
    padding: 15px; /* 进一步减少内边距节约空间 */
    background: #f0e6d2;
}

.setup-card h2 {
    color: #3e2723;
    margin-bottom: 15px;
    font-size: 2.8em;
    font-weight: bold;
}

/* 挑战模式选择 */
.challenge-mode-section,
.listening-level-section,
.listening-challenge-section {
    margin: 8px 0; /* 进一步减小外边距节约空间 */
    padding: 8px; /* 进一步减小内边距节约空间 */
    background: rgba(255, 255, 255, 0.5);
    border-radius: 10px;
}

.challenge-mode-section h3,
.listening-level-section h3,
.listening-challenge-section h3 {
    color: #3e2723;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.mode-selector,
.level-selector {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 挑战模式选项水平排列 */
.challenge-mode-section .mode-selector {
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    gap: 20px;
}

.level-select {
    padding: 12px 15px;
    border-radius: 8px;
    border: 2px solid #ddd;
    background: white;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    box-sizing: border-box;
}

.level-select:hover {
    border-color: #8bc34a;
    transform: translateX(5px);
}

.mode-option,
.level-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.mode-option:hover,
.level-option:hover {
    background: #f5f5f5;
    border-color: #8bc34a;
    transform: translateX(5px);
}

.mode-option input[type="radio"],
.level-option input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.mode-label,
.level-label {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
}

.mode-option input[type="radio"]:checked + .mode-label,
.level-option input[type="radio"]:checked + .level-label {
    color: #8bc34a;
    font-weight: bold;
}

.setup-description {
    color: #5d4037;
    margin-bottom: 10px;
    font-size: 16px;
}

.ket-info {
    color: #5d4037;
    font-weight: bold;
    margin: 15px 0 25px;
    font-size: 16px;
}

/* 操作按钮区域 */
.setup-actions {
    display: flex;
    flex-direction: column;
    gap: 10px; /* 进一步减小按钮间距节约空间 */
    align-items: center; /* 居中显示子元素 */
}

.button-row {
    display: flex;
    gap: 20px; /* 按钮之间的间距 */
    justify-content: center;
}

.action-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 20px; /* 减小按钮内边距节约空间 */
    font-size: 16px; /* 减小字体大小节约空间 */
    font-weight: 600;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    /* 确保下载和上传按钮大小一致 */
    min-width: 180px; /* 减小最小宽度节约空间 */
    width: auto; /* 自适应宽度 */
    min-height: 40px; /* 减小最小高度节约空间 */
    white-space: nowrap; /* 防止文字换行 */
}

.action-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.download-btn {
    background: linear-gradient(45deg, #8bc34a, #689f38);
    color: white;
}

.upload-btn {
    background: linear-gradient(45deg, #1565c0, #0d47a1);
    color: white;
}

.button-icon {
    font-size: 20px;
}

.button-text {
    white-space: nowrap; /* 防止文字换行 */
}

.file-type-info {
    color: #666;
    font-size: 14px;
    margin-bottom: 12px;
}

#word-file {
    display: none;
}

.upload-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 15px;
}

.file-name-display {
    font-size: 14px;
    color: #555;
    min-height: 20px;
    font-style: italic;
    white-space: nowrap;
}

.start-button {
    background: linear-gradient(45deg, #ef6c00, #e65100);
    color: white;
    border: none;
    padding: 12px 30px; /* 减小按钮内边距节约空间 */
    font-size: 16px; /* 减小字体大小节约空间 */
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 15px; /* 减小顶部间距 */
    position: relative;
    z-index: 10; /* 提高z-index确保按钮在最上层 */
}

.start-button:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

/* 移除旧的样式 */
.setup-sections,
.template-section,
.upload-section {
    display: none;
}

/* 现代提示框样式 */
.modern-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease-out;
}

.modern-modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modern-modal-content {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    overflow: hidden;
    animation: slideIn 0.3s ease-out;
}

.modern-modal-header {
    background: linear-gradient(45deg, #8bc34a, #689f38);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modern-modal-header h2 {
    margin: 0;
    font-size: 1.5em;
}

.modern-modal-close {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.modern-modal-close:hover {
    transform: scale(1.2);
}

.modern-modal-body {
    padding: 30px;
    text-align: center;
}

.modern-modal-body p {
    margin: 0;
    font-size: 16px;
    color: #333;
    line-height: 1.6;
}

.modern-modal-footer {
    padding: 20px;
    display: flex;
    justify-content: center; /* 居中显示按钮 */
    gap: 15px;
    background-color: #f5f5f5;
}

.modern-modal-btn {
    padding: 12px 42px; /* 增加按钮宽度20px */
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
}

.cancel-btn {
    background: #999;
    color: white;
}

.cancel-btn:hover {
    background: #777;
    transform: translateY(-2px);
}

.confirm-btn {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
}

.confirm-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        transform: translateY(-50px);
        opacity: 0;
    }
    to { 
        transform: translateY(0);
        opacity: 1;
    }
}

/* 庆祝动画样式 */
@keyframes celebration {
    0% { 
        background: linear-gradient(45deg, #2196F3, #1976D2);
    }
    25% { 
        background: linear-gradient(45deg, #FF6B6B, #FF8E53);
    }
    50% { 
        background: linear-gradient(45deg, #4ECDC4, #44A08D);
    }
    75% { 
        background: linear-gradient(45deg, #FFD93D, #FF6B6B);
    }
    100% { 
        background: linear-gradient(45deg, #2196F3, #1976D2);
    }
}

.celebration-header {
    animation: celebration 2s ease-in-out infinite;
}

/* 小偷胜利动画样式 */
@keyframes thief-celebration-fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

.thief-celebration {
    position: fixed;
    z-index: 3000;
    pointer-events: none;
    animation: thief-celebration-fall 1.5s linear infinite;
}

/* 漫天喝彩动画 - 彩带效果 */
@keyframes confetti-fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    z-index: 3000;
    pointer-events: none;
}

.confetti:nth-child(odd) {
    background: linear-gradient(45deg, #FF6B6B, #FF8E53);
    animation: confetti-fall 3s linear infinite;
}

.confetti:nth-child(even) {
    background: linear-gradient(45deg, #4ECDC4, #44A08D);
    animation: confetti-fall 3.5s linear infinite;
}

.confetti:nth-child(3n) {
    background: linear-gradient(45deg, #FFD93D, #FF6B6B);
    animation: confetti-fall 2.5s linear infinite;
}

.confetti:nth-child(4n) {
    background: linear-gradient(45deg, #A8E6CF, #7FCDCD);
    animation: confetti-fall 4s linear infinite;
}

.confetti:nth-child(5n) {
    background: linear-gradient(45deg, #FFB6C1, #FFA07A);
    animation: confetti-fall 3.2s linear infinite;
}

/* 渐变动画 */
@keyframes gradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* 烟花动画样式 */
@keyframes fireworks-fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

.firework {
    position: fixed;
    font-size: 30px; /* 冰淇淋图标大小 */
    z-index: 3000;
    pointer-events: none;
    /* 移除所有阴影效果 */
    color: #FF0000; /* 红色 */
    text-shadow: none; /* 移除阴影 */
}

.firework:nth-child(odd) {
    content: "🍦"; /* 冰淇淋图标 */
    animation: fireworks-fall 1s linear infinite; /* 加快动画速度 */
}

.firework:nth-child(even) {
    content: "🍨"; /* 圣代冰淇淋图标 */
    animation: fireworks-fall 1.2s linear infinite;
}

.firework:nth-child(3n) {
    content: "🍧"; /* 刨冰图标 */
    animation: fireworks-fall 0.8s linear infinite;
}

.firework:nth-child(4n) {
    content: "🍩"; /* 甜甜圈图标 */
    animation: fireworks-fall 1.5s linear infinite;
}

.firework:nth-child(5n) {
    content: "🍭"; /* 棒棒糖图标 */
    animation: fireworks-fall 0.9s linear infinite;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.play-audio-btn-header {
    background: linear-gradient(45deg, #2196F3, #1976D2);
    color: white;
    border: none;
    padding: 8px 15px;
    font-size: 14px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(33, 150, 243, 0.3);
}

.play-audio-btn-header:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(33, 150, 243, 0.4);
}

.countdown-display {
    display: flex;
    align-items: center;
    background: #ffeb3b;
    padding: 5px 10px;
    border-radius: 20px;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.countdown-icon {
    margin-right: 5px;
}

.countdown-value {
    color: #333;
}

/* 钻石级标题样式 */
#challenge-modal-title {
    color: #9c27b0;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

/* 单词挑战弹框样式 - 适当缩小 */
.modal.word-challenge .modal-content {
    max-width: 500px; /* 缩小最大宽度 */
    padding: 20px; /* 减少内边距 */
}

/* 听力挑战弹框样式 - 保持原来大小 */
.modal.listening-challenge .modal-content {
    max-width: 800px; /* 保持原来的最大宽度 */
    padding: 30px; /* 保持原来的内边距 */
}

/* 单词挑战中的单词显示 */
.modal.word-challenge #challenge-word {
    font-size: 14px; /* 稍微减小字体 */
    padding: 10px; /* 减少内边距 */
}

/* 听力挑战中的选项容器 */
.modal.listening-challenge .listening-options {
    max-height: 400px; /* 为听力挑战选项设置最大高度 */
    overflow-y: auto; /* 需要时显示滚动条 */
}

/* 倒计时容器样式 */
#countdown-container {
    margin-bottom: 20px;
}

@keyframes modalFadeIn {
    from {opacity: 0; transform: translateY(-50px);}
    to {opacity: 1; transform: translateY(0);}
}

.countdown-circle {
    width: 120px;
    height: 120px;
    border: 5px solid #4CAF50;
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}

.countdown-circle::before {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 5px solid transparent;
    border-top-color: #2196F3;
    animation: spin 60s linear infinite; /* 修改为60秒 */
}

@keyframes spin {
    to {transform: rotate(360deg);}
}

.countdown-timer {
    font-size: 36px;
    font-weight: bold;
    color: #333;
}

.countdown-text {
    font-size: 14px;
    color: #666;
    margin-top: 5px;
}

.countdown-message {
    font-size: 18px;
    margin: 20px 0;
    color: #333;
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 800px; /* 增大最大宽度 */
    width: 90%;
    max-height: 80vh; /* 限制最大高度 */
    overflow-y: auto; /* 只有在内容超出时才显示滚动条 */
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #333;
}

#challenge-word {
    font-size: 16px;
    font-weight: normal;
    margin: 20px 0;
    color: #333;
    line-height: 1.5;
    text-align: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.modal-buttons button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
    flex: 1;
}

#challenge-success {
    background: #4CAF50;
    color: white;
}

#challenge-fail {
    background: #F44336;
    color: white;
}

.modal-buttons button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* 听力挑战样式 */
.audio-player {
    text-align: center;
    margin-bottom: 20px;
}

.play-audio-btn {
    background: linear-gradient(45deg, #2196F3, #1976D2);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 18px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
}

.play-audio-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.4);
}

.listening-question {
    font-size: 18px;
    color: #333;
    margin: 10px 0; /* 减少间距 */
    padding: 10px; /* 减少内边距 */
    background: rgba(33, 150, 243, 0.1);
    border-radius: 10px;
    border-left: 4px solid #2196F3;
    min-height: 20px; /* 保持最小高度 */
}

.listening-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px; /* 减少顶部间距 */
}

.listening-option-btn {
    padding: 15px 20px;
    border: 2px solid #ddd;
    background: white;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
    text-align: left;
}

.listening-option-btn:hover {
    background: #f5f5f5;
    border-color: #2196F3;
    transform: translateX(5px);
}

/* 钻石级标题样式 */
.spelling-input {
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 16px;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 12px;
}

.spelling-input:focus {
    outline: none;
    border-color: #2196F3;
}

.submit-answer-btn {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    margin-top: 20px;
}

.submit-answer-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3);
}

/* 听英排词样式 */
.word-bank {
    margin: 20px 0;
    padding: 15px;
    background: rgba(33, 150, 243, 0.1);
    border-radius: 10px;
    border: 2px dashed #2196F3;
}

.word-bank h4 {
    margin-top: 0;
    color: #2196F3;
    text-align: center;
}

.answer-area {
    margin: 20px 0;
    padding: 15px;
    background: rgba(76, 175, 80, 0.1);
    border-radius: 10px;
    border: 2px dashed #4CAF50;
}

.answer-area h4 {
    margin-top: 0;
    color: #4CAF50;
    text-align: center;
}

.selectable-word {
    display: inline-block;
    padding: 10px 15px;
    margin: 5px;
    background: #2196F3;
    color: white;
    border-radius: 20px;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s;
}

.selectable-word:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(33, 150, 243, 0.3);
}

.answer-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 50px;
    padding: 10px;
    border: 2px dashed #ccc;
    border-radius: 10px;
    background: white;
    margin-top: 15px;
}

.answer-word {
    padding: 8px 12px;
    background: #4CAF50;
    color: white;
    border-radius: 15px;
    cursor: move;
    user-select: none;
    transition: all 0.3s;
}

.answer-word:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(76, 175, 80, 0.3);
}

.answer-word.dragging {
    opacity: 0.5;
}

/* 游戏页面样式 */
#game-page {
    background: #f5f5dc;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.game-header {
    display: flex;
    justify-content: flex-end; /* 改为靠右显示 */
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eee;
}

.game-header h1 {
    color: #333;
    margin: 0;
}

.header-buttons {
    display: flex;
    gap: 10px;
}

.sound-btn {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 16px;
}

.sound-btn:hover {
    background: #45a049;
}

.sound-btn.muted {
    background: #f44336;
}

#bgm-toggle {
    background: #2196F3;
}

#bgm-toggle:hover {
    background: #1976D2;
}

#bgm-toggle.paused {
    background: #FF9800;
}

#fullscreen-btn, #back-to-setup {
    background: #999;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

#fullscreen-btn:hover, #back-to-setup:hover {
    background: #777;
}

#fullscreen-btn.fullscreen-active {
    background: #4CAF50;
}

.game-container {
    display: flex;
    gap: 20px;
    min-height: calc(100vh - 100px); /* 最小高度以适应头部区域 */
    height: auto; /* 根据内容自适应高度 */
    padding-bottom: 10px; /* 减少底部内边距 */
    margin-top: 0; /* 重置margin-top */
    align-items: flex-start; /* 顶部对齐子元素 */
    overflow: hidden; /* 防止内容溢出 */
}

/* 棋盘样式 */
.game-board-container {
    flex: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 66.67%; /* 占屏幕三分之二 */
    position: relative;
    height: 100%; /* 占满容器高度 */
    margin-top: 20px; /* 下移以避免覆盖头部区域 */
    min-height: 0; /* 允许收缩以适应容器 */
}

.victory-condition {
    margin-top: 20px; /* 增加顶部间距 */
    text-align: center;
    flex-shrink: 0; /* 不允许收缩 */
    width: 100%;
}

.victory-condition p {
    color: #3e2723;
    font-size: 1.2em;
    font-weight: bold;
    background: rgba(245, 245, 220, 0.9);
    padding: 10px 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: inline-block;
}

.xiaohongshu-info {
    margin-top: 10px;
}

.xiaohongshu-info p {
    color: #5d4037;
    font-size: 1em;
    font-weight: bold;
    background: rgba(245, 245, 220, 0.9);
    padding: 8px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: inline-block;
    margin: 5px 0;
}

.xiaohongshu-info p:first-child {
    color: #3e2723;
}

.board-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: #e8f5e9; /* 淡雅的灰绿色 */
    padding: 15px; /* 减少内边距 */
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 700px;
    border: 4px solid rgba(255, 255, 255, 0.7); /* 更亮的白色透明边框 */
    position: relative;
    flex: 1; /* 占满可用空间 */
    min-height: 0; /* 允许收缩 */
    min-height: 400px; /* 确保最小高度 */
    max-height: 80vh; /* 增加最大高度以确保棋子完全显示 */
}

.board-top, .board-bottom {
    display: flex;
    gap: 4px;
    justify-content: center;
    align-items: center;
    height: 80px; /* 减少高度 */
}

.board-middle {
    display: flex;
    gap: 4px;
    justify-content: space-between;
    align-items: stretch;
    min-height: 250px; /* 减少最小高度 */
    margin: 4px 0;
}

.board-left, .board-right {
    display: flex;
    flex-direction: column;
    gap: 4px;
    justify-content: center;
    align-items: center;
    width: 90px;
}

.board-center {
    flex: 1;
    background: #e8f5e9; /* 淡雅的灰绿色，与棋盘背景一致 */
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 0 10px;
    box-shadow: none; /* 移除阴影效果 */
    border: 3px solid rgba(255, 255, 255, 0.7); /* 更亮的白色透明边框 */
    position: relative;
    overflow: hidden;
}

.board-center h2 {
    font-size: 2.4em;
    color: #2e7d32; /* 淡雅的深绿色文字 */
    text-shadow: none; /* 移除文字阴影 */
    font-weight: bold;
    letter-spacing: 3px;
    z-index: 1;
}

.board-cell {
    width: 90px;
    height: 90px;
    background: #c8e6c9; /* 淡雅的绿灰色 */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 14px; /* 字体大小调整为14px */
    font-weight: bold;
    text-align: center;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: visible;
    color: #2e7d32; /* 淡雅的深绿色文字，提高可读性 */
    text-shadow: none; /* 移除文字阴影 */
    border: 3px solid rgba(255, 255, 255, 0.7); /* 更亮的白色透明边框 */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    text-overflow: ellipsis;
    padding: 6px;
    box-sizing: border-box;
    margin: 0 auto; /* 确保格子在轨道中居中 */
}

.player-icon {
    position: absolute;
    top: -16px;
    right: -16px;
    font-size: 40px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    width: 64px;
    height: 64px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border: 2px solid #fff;
    z-index: 10;
}

.right-panel-police, .right-panel-thief {
    font-size: 48px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    width: 80px;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border: 2px solid #fff;
    z-index: 100;
}

.board-cell:hover {
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

.police-start {
    background: linear-gradient(45deg, #ef6c00, #e65100) !important;
    color: white;
}

.thief-start {
    background: linear-gradient(45deg, #1565c0, #0d47a1) !important;
    color: white;
}

.police-position {
    background: #ef6c00 !important;
    color: white;
    font-weight: bold;
}

.thief-position {
    background: #1565c0 !important;
    color: white;
    font-weight: bold;
}

/* 控制面板样式 */
.game-controls {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px; /* 进一步缩小间距 */
    max-width: 300px; /* 限制控制面板宽度 */
    min-height: 0; /* 允许收缩以适应容器 */
    justify-content: space-between; /* 在容器内均匀分布子元素 */
    transform: translateY(0); /* 移除偏移使右侧容器与左侧棋盘平行 */
    position: relative;
    z-index: 5;
}

.dice-section {
    text-align: center;
    padding: 10px; /* 减小内边距 */
    background: #e8f5e9;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 5;
}

.dice-section h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.2em;
}

.dice {
    width: 70px; /* 进一步缩小骰子宽度 */
    height: 70px; /* 进一步缩小骰子高度 */
    margin: 0 auto 10px; /* 进一步减小底部边距 */
    position: relative;
    transform-style: preserve-3d;
    transition: transform 1s;
}

.dice-face {
    position: absolute;
    width: 100%;
    height: 100%;
    background: white;
    border: 2px solid #333;
    border-radius: 8px; /* 稍微减小圆角 */
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
}

.dice-face-1 { transform: translateZ(50px); }
.dice-face-2 { transform: rotateX(180deg) translateZ(50px); }
.dice-face-3 { transform: rotateY(90deg) translateZ(50px); }
.dice-face-4 { transform: rotateY(-90deg) translateZ(50px); }
.dice-face-5 { transform: rotateX(90deg) translateZ(50px); }
.dice-face-6 { transform: rotateX(-90deg) translateZ(50px); }

/* 骰子点数样式 */
.dice-dot {
    width: 12px; /* 缩小点数大小 */
    height: 12px; /* 缩小点数大小 */
    background-color: #e74c3c;
    border-radius: 50%;
    position: absolute;
}

/* 骰子1 */
.dice-face-1 .dice-dot:nth-child(1) {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* 骰子2 */
.dice-face-2 .dice-dot:nth-child(1) {
    top: 25%;
    left: 25%;
}
.dice-face-2 .dice-dot:nth-child(2) {
    bottom: 25%;
    right: 25%;
}

/* 骰子3 */
.dice-face-3 .dice-dot:nth-child(1) {
    top: 25%;
    left: 25%;
}
.dice-face-3 .dice-dot:nth-child(2) {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
.dice-face-3 .dice-dot:nth-child(3) {
    bottom: 25%;
    right: 25%;
}

/* 骰子4 */
.dice-face-4 .dice-dot:nth-child(1) {
    top: 25%;
    left: 25%;
}
.dice-face-4 .dice-dot:nth-child(2) {
    top: 25%;
    right: 25%;
}
.dice-face-4 .dice-dot:nth-child(3) {
    bottom: 25%;
    left: 25%;
}
.dice-face-4 .dice-dot:nth-child(4) {
    bottom: 25%;
    right: 25%;
}

/* 骰子5 */
.dice-face-5 .dice-dot:nth-child(1) {
    top: 25%;
    left: 25%;
}
.dice-face-5 .dice-dot:nth-child(2) {
    top: 25%;
    right: 25%;
}
.dice-face-5 .dice-dot:nth-child(3) {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
.dice-face-5 .dice-dot:nth-child(4) {
    bottom: 25%;
    left: 25%;
}
.dice-face-5 .dice-dot:nth-child(5) {
    bottom: 25%;
    right: 25%;
}

/* 骰子6 */
.dice-face-6 .dice-dot:nth-child(1) {
    top: 25%;
    left: 25%;
}
.dice-face-6 .dice-dot:nth-child(2) {
    top: 25%;
    right: 25%;
}
.dice-face-6 .dice-dot:nth-child(3) {
    top: 50%;
    left: 25%;
    transform: translateY(-50%);
}
.dice-face-6 .dice-dot:nth-child(4) {
    top: 50%;
    right: 25%;
    transform: translateY(-50%);
}
.dice-face-6 .dice-dot:nth-child(5) {
    bottom: 25%;
    left: 25%;
}
.dice-face-6 .dice-dot:nth-child(6) {
    bottom: 25%;
    right: 25%;
}

/* 骰子滚动动画 */
@keyframes rolling {
    0% { transform: rotateX(0) rotateY(0) rotateZ(0); }
    100% { transform: rotateX(720deg) rotateY(1080deg) rotateZ(360deg); }
}

.rolling {
    animation: rolling 1s ease-out;
}

#roll-dice {
    background: linear-gradient(45deg, #ef6c00, #e65100);
    color: white;
    border: none;
    padding: 12px 24px; /* 适当的按钮内边距 */
    font-size: 16px; /* 适当的字体大小 */
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    z-index: 100; /* 确保按钮在上层 */
}

#roll-dice:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

#roll-dice:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 骰子点数显示样式 */
.dice-result {
    margin-top: 10px; /* 减小顶部边距 */
    padding: 8px; /* 减小内边距 */
    background: linear-gradient(45deg, #4CAF50, #45a049);
    border-radius: 8px;
    color: white;
    font-weight: bold;
    font-size: 14px; /* 稍微减小字体大小 */
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

#dice-number {
    font-size: 18px; /* 稍微减小字体大小 */
    font-weight: bold;
    color: #FFD700;
}

/* 追捕信息样式 */
.chase-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 1; /* 占满可用空间 */
    justify-content: flex-start; /* 从顶部开始分布子元素 */
    margin-top: 20px; /* 增加顶部间距 */
}

.police-chase, .thief-escape {
    text-align: center;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.police-chase {
    background: linear-gradient(45deg, #ef6c00, #e65100);
    margin-top: -10px; /* 减少向上移动的距离 */
}

.thief-escape {
    background: linear-gradient(45deg, #1565c0, #0d47a1);
    margin-top: -15px; /* 减少向上移动的距离 */
}

.police-chase h3, .thief-escape h3 {
    margin-bottom: 10px;
    color: white;
}

.steps-display {
    font-size: 24px;
    font-weight: bold;
    color: white;
}

/* 全屏模式样式 */
:fullscreen .page.active,
:-webkit-full-screen .page.active,
:-moz-full-screen .page.active,
:-ms-fullscreen .page.active {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px 0;
}

:fullscreen body,
:-webkit-full-screen body,
:-moz-full-screen body,
:-ms-fullscreen body {
    padding: 0;
    height: 100vh;
}

:fullscreen .container,
:-webkit-full-screen .container,
:-moz-full-screen .container,
:-ms-fullscreen .container {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 全屏模式下的游戏容器样式 */
:fullscreen .game-container,
:-webkit-full-screen .game-container,
:-moz-full-screen .game-container,
:-ms-fullscreen .game-container {
    height: 100vh;
    padding: 10px; /* 减小内边距以增加可用空间 */
    box-sizing: border-box;
    gap: 20px; /* 减小间隙以增加可用空间 */
    align-items: flex-start; /* 顶部对齐子元素 */
}

/* 全屏模式下的棋盘容器样式修复 */
:fullscreen .game-board-container,
:-webkit-full-screen .game-board-container,
:-moz-full-screen .game-board-container,
:-ms-fullscreen .game-board-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-top: 0;
    padding: 20px;
    box-sizing: border-box;
}

:fullscreen .board-wrapper,
:-webkit-full-screen .board-wrapper,
:-moz-full-screen .board-wrapper,
:-ms-fullscreen .board-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: none;
    height: 100%;
    padding: 10px; /* 减小内边距以增加可用空间 */
    box-sizing: border-box;
    min-height: 400px; /* 调整最小高度 */
    max-height: 95vh; /* 增加最大高度限制以更好地利用空间 */
    flex: 1 1 auto; /* 允许元素根据可用空间自适应 */
}

:fullscreen .board-top,
:fullscreen .board-bottom,
:-webkit-full-screen .board-top,
:-webkit-full-screen .board-bottom,
:-moz-full-screen .board-top,
:-moz-full-screen .board-bottom,
:-ms-fullscreen .board-top,
:-ms-fullscreen .board-bottom {
    display: flex;
    gap: 4px;
    justify-content: center;
    align-items: center;
    height: 50px; /* 进一步减小高度以更好地利用空间 */
    width: 100%;
}

:fullscreen .board-middle,
:-webkit-full-screen .board-middle,
:-moz-full-screen .board-middle,
:-ms-fullscreen .board-middle {
    display: flex;
    gap: 4px;
    justify-content: space-between;
    align-items: stretch;
    flex: 1;
    min-height: 0;
    margin: 4px 0;
    width: 100%;
}

:fullscreen .board-left,
:fullscreen .board-right,
:-webkit-full-screen .board-left,
:-webkit-full-screen .board-right,
:-moz-full-screen .board-left,
:-moz-full-screen .board-right,
:-ms-fullscreen .board-left,
:-ms-fullscreen .board-right {
    display: flex;
    flex-direction: column;
    gap: 4px;
    justify-content: center;
    align-items: center;
    width: 60px; /* 进一步减小宽度以更好地利用空间 */
}

:fullscreen .board-center,
:-webkit-full-screen .board-center,
:-moz-full-screen .board-center,
:-ms-fullscreen .board-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 0 10px;
    min-width: 0;
}

:fullscreen .board-cell,
:-webkit-full-screen .board-cell,
:-moz-full-screen .board-cell,
:-ms-fullscreen .board-cell {
    margin: 0 auto;
    width: 60px; /* 进一步调整棋子宽度 */
    height: 60px; /* 进一步调整棋子高度 */
    font-size: 10px; /* 调整字体大小 */
}

/* 全屏模式下的控制面板样式 */
:fullscreen .game-controls,
:-webkit-full-screen .game-controls,
:-moz-full-screen .game-controls,
:-ms-fullscreen .game-controls {
    display: flex;
    flex-direction: column;
    justify-content: space-around; /* 使用space-around而不是center避免重叠 */
    gap: 15px; /* 进一步缩小间距 */
    max-width: 300px; /* 减小最大宽度 */
    height: 100%;
    padding: 10px 0; /* 减小内边距 */
    box-sizing: border-box;
    transform: translateY(0); /* 移除偏移使右侧容器与左侧棋盘平行 */
    flex: 1 1 auto; /* 允许元素根据可用空间自适应 */
}

:fullscreen .dice-section,
:fullscreen .chase-info,
:-webkit-full-screen .dice-section,
:-webkit-full-screen .chase-info,
:-moz-full-screen .dice-section,
:-moz-full-screen .chase-info,
:-ms-fullscreen .dice-section,
:-ms-fullscreen .chase-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-around; /* 使用space-around而不是center避免重叠 */
    min-height: 0;
    gap: 15px; /* 进一步减小间隙以更好地利用空间 */
}

/* 添加针对大屏幕全屏模式的优化 */
/* 大屏幕设备 */
@media (min-width: 1200px) {
    .board-cell {
        width: 100px; /* 调整大屏幕下的棋子宽度 */
        height: 100px; /* 调整大屏幕下的棋子高度 */
        font-size: 14px; /* 调整大屏幕下的字体大小 */
    }
    
    .board-top, .board-bottom {
        height: 90px; /* 调整大屏幕下的轨道高度 */
    }
    
    .board-left, .board-right {
        width: 100px; /* 调整大屏幕下的轨道宽度 */
    }
    
    .dice {
        width: 90px; /* 调整大屏幕下的骰子宽度 */
        height: 90px; /* 调整大屏幕下的骰子高度 */
        margin: 0 auto 20px; /* 调整大屏幕下的骰子底部边距 */
    }
    
    .dice-dot {
        width: 18px; /* 调整大屏幕下的骰子点数大小 */
        height: 18px; /* 调整大屏幕下的骰子点数大小 */
    }
    
    .police-chase, .thief-escape {
        padding: 25px; /* 调整大屏幕下的追捕框内边距 */
    }
    
    .steps-display {
        font-size: 26px; /* 调整大屏幕下的步数显示字体大小 */
    }
    
    :fullscreen .board-cell,
    :-webkit-full-screen .board-cell,
    :-moz-full-screen .board-cell,
    :-ms-fullscreen .board-cell {
        width: 100px; /* 调整大屏幕全屏模式下的棋子宽度 */
        height: 100px; /* 调整大屏幕全屏模式下的棋子高度 */
        font-size: 16px; /* 调整大屏幕全屏模式下的字体大小 */
    }
    
    :fullscreen .board-top,
    :fullscreen .board-bottom,
    :-webkit-full-screen .board-top,
    :-webkit-full-screen .board-bottom,
    :-moz-full-screen .board-top,
    :-moz-full-screen .board-bottom,
    :-ms-fullscreen .board-top,
    :-ms-fullscreen .board-bottom {
        height: 100px; /* 调整大屏幕全屏模式下的轨道高度 */
    }
    
    :fullscreen .board-left,
    :fullscreen .board-right,
    :-webkit-full-screen .board-left,
    :-webkit-full-screen .board-right,
    :-moz-full-screen .board-left,
    :-moz-full-screen .board-right,
    :-ms-fullscreen .board-left,
    :-ms-fullscreen .board-right {
        width: 100px; /* 调整大屏幕全屏模式下的轨道宽度 */
    }
    
    :fullscreen .dice,
    :-webkit-full-screen .dice,
    :-moz-full-screen .dice,
    :-ms-fullscreen .dice {
        width: 100px; /* 调整大屏幕全屏模式下的骰子宽度 */
        height: 100px; /* 调整大屏幕全屏模式下的骰子高度 */
        margin: 0 auto 25px; /* 调整大屏幕全屏模式下的骰子底部边距 */
    }
    
    :fullscreen .dice-dot,
    :-webkit-full-screen .dice-dot,
    :-moz-full-screen .dice-dot,
    :-ms-fullscreen .dice-dot {
        width: 20px; /* 调整大屏幕全屏模式下的骰子点数大小 */
        height: 20px; /* 调整大屏幕全屏模式下的骰子点数大小 */
    }
    
    :fullscreen .police-chase,
    :-webkit-full-screen .police-chase,
    :-moz-full-screen .police-chase,
    :-ms-fullscreen .police-chase,
    :fullscreen .thief-escape,
    :-webkit-full-screen .thief-escape,
    :-moz-full-screen .thief-escape,
    :-ms-fullscreen .thief-escape {
        padding: 30px; /* 调整大屏幕全屏模式下的追捕框内边距 */
    }
    
    :fullscreen .steps-display,
    :-webkit-full-screen .steps-display,
    :-moz-full-screen .steps-display,
    :-ms-fullscreen .steps-display {
        font-size: 30px; /* 调整大屏幕全屏模式下的步数显示字体大小 */
    }
}

/* 响应式设计 */
/* 中等屏幕设备 */
@media (min-width: 769px) and (max-width: 1199px) {
    .board-cell {
        width: 80px; /* 调整中等屏幕下的棋子宽度 */
        height: 80px; /* 调整中等屏幕下的棋子高度 */
        font-size: 12px; /* 调整中等屏幕下的字体大小 */
    }
    
    .board-top, .board-bottom {
        height: 70px; /* 调整中等屏幕下的轨道高度 */
    }
    
    .board-left, .board-right {
        width: 80px; /* 调整中等屏幕下的轨道宽度 */
    }
    
    .dice {
        width: 70px; /* 调整中等屏幕下的骰子宽度 */
        height: 70px; /* 调整中等屏幕下的骰子高度 */
        margin: 0 auto 15px; /* 调整中等屏幕下的骰子底部边距 */
    }
    
    .dice-dot {
        width: 14px; /* 调整中等屏幕下的骰子点数大小 */
        height: 14px; /* 调整中等屏幕下的骰子点数大小 */
    }
    
    .police-chase, .thief-escape {
        padding: 20px; /* 调整中等屏幕下的追捕框内边距 */
    }
    
    .steps-display {
        font-size: 22px; /* 调整中等屏幕下的步数显示字体大小 */
    }
}

/* 超大屏幕设备 */
@media (min-width: 1400px) {
    .board-cell {
        width: 110px; /* 调整超大屏幕下的棋子宽度 */
        height: 110px; /* 调整超大屏幕下的棋子高度 */
        font-size: 16px; /* 调整超大屏幕下的字体大小 */
    }
    
    .board-top, .board-bottom {
        height: 100px; /* 调整超大屏幕下的轨道高度 */
    }
    
    .board-left, .board-right {
        width: 110px; /* 调整超大屏幕下的轨道宽度 */
    }
    
    .dice {
        width: 100px; /* 调整超大屏幕下的骰子宽度 */
        height: 100px; /* 调整超大屏幕下的骰子高度 */
        margin: 0 auto 25px; /* 调整超大屏幕下的骰子底部边距 */
    }
    
    .dice-dot {
        width: 20px; /* 调整超大屏幕下的骰子点数大小 */
        height: 20px; /* 调整超大屏幕下的骰子点数大小 */
    }
    
    .police-chase, .thief-escape {
        padding: 30px; /* 调整超大屏幕下的追捕框内边距 */
    }
    
    .steps-display {
        font-size: 28px; /* 调整超大屏幕下的步数显示字体大小 */
    }
    
    :fullscreen .board-cell,
    :-webkit-full-screen .board-cell,
    :-moz-full-screen .board-cell,
    :-ms-fullscreen .board-cell {
        width: 110px; /* 调整超大屏幕全屏模式下的棋子宽度 */
        height: 110px; /* 调整超大屏幕全屏模式下的棋子高度 */
        font-size: 18px; /* 调整超大屏幕全屏模式下的字体大小 */
    }
    
    :fullscreen .board-top,
    :fullscreen .board-bottom,
    :-webkit-full-screen .board-top,
    :-webkit-full-screen .board-bottom,
    :-moz-full-screen .board-top,
    :-moz-full-screen .board-bottom,
    :-ms-fullscreen .board-top,
    :-ms-fullscreen .board-bottom {
        height: 110px; /* 调整超大屏幕全屏模式下的轨道高度 */
    }
    
    :fullscreen .board-left,
    :fullscreen .board-right,
    :-webkit-full-screen .board-left,
    :-webkit-full-screen .board-right,
    :-moz-full-screen .board-left,
    :-moz-full-screen .board-right,
    :-ms-fullscreen .board-left,
    :-ms-fullscreen .board-right {
        width: 110px; /* 调整超大屏幕全屏模式下的轨道宽度 */
    }
    
    :fullscreen .dice,
    :-webkit-full-screen .dice,
    :-moz-full-screen .dice,
    :-ms-fullscreen .dice {
        width: 110px; /* 调整超大屏幕全屏模式下的骰子宽度 */
        height: 110px; /* 调整超大屏幕全屏模式下的骰子高度 */
        margin: 0 auto 30px; /* 调整超大屏幕全屏模式下的骰子底部边距 */
    }
    
    :fullscreen .dice-dot,
    :-webkit-full-screen .dice-dot,
    :-moz-full-screen .dice-dot,
    :-ms-fullscreen .dice-dot {
        width: 22px; /* 调整超大屏幕全屏模式下的骰子点数大小 */
        height: 22px; /* 调整超大屏幕全屏模式下的骰子点数大小 */
    }
    
    :fullscreen .police-chase,
    :-webkit-full-screen .police-chase,
    :-moz-full-screen .police-chase,
    :-ms-fullscreen .police-chase,
    :fullscreen .thief-escape,
    :-webkit-full-screen .thief-escape,
    :-moz-full-screen .thief-escape,
    :-ms-fullscreen .thief-escape {
        padding: 35px; /* 调整超大屏幕全屏模式下的追捕框内边距 */
    }
    
    :fullscreen .steps-display,
    :-webkit-full-screen .steps-display,
    :-moz-full-screen .steps-display,
    :-ms-fullscreen .steps-display {
        font-size: 32px; /* 调整超大屏幕全屏模式下的步数显示字体大小 */
    }
}

/* 小屏幕设备 */
@media (max-width: 768px) {
    .dice-section {
        padding: 5px; /* 进一步减小骰子区域的内边距 */
        margin: 0; /* 移除外边距 */
    }
    
    .dice {
        width: 50px; /* 进一步调整小屏幕下的骰子宽度 */
        height: 50px; /* 进一步调整小屏幕下的骰子高度 */
        margin: 0 auto 8px; /* 进一步调整小屏幕下的骰子底部边距 */
    }
    
    .dice-dot {
        width: 10px; /* 调整小屏幕下的骰子点数大小 */
        height: 10px; /* 调整小屏幕下的骰子点数大小 */
    }
    
    #roll-dice {
        padding: 8px 16px; /* 调整小屏幕下按钮的内边距 */
        font-size: 12px; /* 调整小屏幕下按钮的字体大小 */
    }
    
    .dice-result {
        padding: 6px; /* 调整小屏幕下结果区域的内边距 */
        font-size: 12px; /* 调整小屏幕下结果区域的字体大小 */
    }
    
    #dice-number {
        font-size: 16px; /* 调整小屏幕下骰子数字的字体大小 */
    }
    
    .police-chase, .thief-escape {
        padding: 15px; /* 调整小屏幕下追捕框的内边距 */
    }
    
    .steps-display {
        font-size: 20px; /* 调整小屏幕下步数显示的字体大小 */
    }
    body {
        padding: 5px;
        font-size: 14px;
        overflow: hidden; /* 防止页面出现滚动条 */
    }
    
    .game-controls {
        gap: 10px; /* 进一步减小右侧控制区域的间距 */
    }
    
    .container {
        height: calc(100vh - 10px);
        overflow-x: hidden;
    }
    
    #setup-page {
        padding: 10px; /* 进一步减少内边距 */
    }
    
    .setup-card {
        padding: 8px; /* 进一步减少内边距 */
        margin: 5px 0;
    }
    
    /* 在小屏幕上，挑战模式选项垂直排列以适应屏幕宽度 */
    .challenge-mode-section .mode-selector {
        flex-direction: column;
        gap: 12px;
    }
    
    .game-container {
        flex-direction: column;
        height: calc(100vh - 60px); /* 进一步减少顶部间距 */
        gap: 10px; /* 减少间距 */
        padding: 5px; /* 减少内边距 */
        margin-top: -30px; /* 进一步整体上移 */
    }
    
    #start-game {
        margin-top: 10px; /* 在小屏幕上增加顶部间距 */
        padding: 10px 20px; /* 减小按钮内边距 */
        font-size: 14px; /* 减小字体大小 */
    }
    
    .game-board-container {
        width: 100%;
        order: 1;
    }
    
    .board-wrapper {
        background: #e8f5e9; /* 淡雅的灰绿色 */
        border: 3px solid rgba(255, 255, 255, 0.7); /* 更亮的白色透明边框 */
    }
    
    .board-center {
        background: #e8f5e9; /* 淡雅的灰绿色 */
        border: 2px solid rgba(255, 255, 255, 0.7); /* 更亮的白色透明边框 */
    }
    
    .board-cell {
        border: 2px solid rgba(255, 255, 255, 0.7); /* 更亮的白色透明边框 */
        background: #c8e6c9; /* 淡雅的绿灰色 */
        color: #2e7d32; /* 淡雅的深绿色文字 */
        font-size: 14px; /* 移动端字体大小调整为14px */
    }
    
    .game-controls {
        max-width: none;
        flex-direction: column;
        gap: 8px; /* 进一步减小右侧控制区域的间距 */
        order: 2;
        width: 100%;
        padding: 5px; /* 为控制区域添加内边距 */
        position: relative;
        z-index: 5;
    }
    
    .dice-section, .chase-info {
        flex: none;
        min-width: auto;
        width: 100%;
        padding: 10px; /* 减小区域的内边距 */
        margin: 0;
        position: relative;
        z-index: 10;
    }
    
    .dice-section h3, .chase-info h3 {
        font-size: 1.1em;
        margin-bottom: 10px;
    }
    
    .dice-container {
        gap: 10px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .dice {
        width: 50px; /* 设置固定宽度 */
        height: 50px; /* 设置固定高度 */
        min-width: 50px;
        min-height: 50px;
        font-size: 1.2em;
        margin: 0 auto 5px; /* 进一步减小骰子底部边距 */
        position: relative;
        z-index: 50; /* 确保骰子在上层但低于按钮 */
    }
    
    .roll-button {
        padding: 12px 24px; /* 适当的按钮内边距 */
        font-size: 1.1em; /* 适当的字体大小 */
        min-height: 44px; /* 触摸友好的最小高度 */
        min-width: 44px; /* 触摸友好的最小宽度 */
        position: relative;
        z-index: 100; /* 确保按钮在上层 */
        touch-action: manipulation; /* 改善触摸体验 */
    }
    
    .arrow-left, .arrow-right {
        font-size: 20px;
        width: 30px;
        height: 30px;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .board-cell {
        width: 50px;
        height: 50px;
        font-size: 10px;
        padding: 4px;
        min-width: 44px; /* 触摸友好的最小尺寸 */
        min-height: 44px;
        border-radius: 12px;
    }
    
    .board-top, .board-bottom {
        height: 60px;
        gap: 3px;
    }
    
    .board-left, .board-right {
        width: 60px;
        gap: 3px;
    }
    
    .board-middle {
        min-height: 200px;
        gap: 3px;
        margin: 3px 0;
    }
    
    .board-center {
        min-width: 200px;
        min-height: 200px;
        margin: 0 8px;
        border-radius: 15px;
    }
    
    .board-center h2 {
        font-size: 1.3em;
        color: #2e7d32; /* 淡雅的深绿色文字 */
        letter-spacing: 2px;
    }
    
    .player-icon {
        width: 56px;
        height: 56px;
        font-size: 32px;
        top: -12px;
        right: -12px;
    }
    
    /* 在移动端全屏模式下进一步调整 */
    :fullscreen .player-icon,
    :-webkit-full-screen .player-icon,
    :-moz-full-screen .player-icon,
    :-ms-fullscreen .player-icon {
        width: 56px;
        height: 56px;
        font-size: 32px;
        top: -12px;
        right: -12px;
    }
    
    :fullscreen .container,
    :-webkit-full-screen .container,
    :-moz-full-screen .container,
    :-ms-fullscreen .container {
        height: 100vh;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    :fullscreen body,
    :-webkit-full-screen body,
    :-moz-full-screen body,
    :-ms-fullscreen body {
        height: 100vh;
        padding: 0;
    }
    
    .right-panel-police, .right-panel-thief {
        width: 70px;
        height: 70px;
        font-size: 40px;
    }
    
    .victory-condition p {
        font-size: 1em;
        padding: 8px 15px;
    }
    
    .xiaohongshu-info {
        margin-top: 10px;
    }
    
    .xiaohongshu-info p {
        font-size: 0.9em;
        padding: 6px 12px;
    }
    
    /* 确保模态框在移动端正常显示 */
    .modal-content {
        width: 90%;
        max-width: 400px;
        margin: 10% auto;
        padding: 20px;
    }
    
    .modal h2 {
        font-size: 1.3em;
    }
    
    .modal button {
        padding: 12px 20px;
        font-size: 1em;
        min-height: 44px;
    }
    
    /* 移动端隐藏全屏按钮 */
    #fullscreen-btn {
        display: none;
    }
}