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

body {
    font-family: 'Arial', sans-serif;
    
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #333;
}

.game-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 20px;
    max-width: 1000px;
    width: 100%;
}

.game-header {
    margin-bottom: 20px;
}

.score-panel {
    display: flex;
    justify-content: space-around;
    background: linear-gradient(45deg, #ff6b6b, #feca57);
    padding: 15px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 10px;
}

.caught-items {
    background: rgba(255, 255, 255, 0.9);
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    max-height: 100px;
    overflow-y: auto;
}

.caught-items-title {
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
    font-size: 14px;
}

.caught-items-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.caught-item {
    background: #4CAF50;
    color: white;
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 12px;
    display: inline-block;
}

/* 配置面板样式 */
.config-panel {
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 20px;
    border-radius: 10px;
    max-width: 600px;
    max-height: 500px;
    overflow-y: auto;
    margin: 0 auto;
}

.config-panel h3 {
    text-align: center;
    margin-bottom: 20px;
    color: #ffd700;
}

.config-section {
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 15px;
}

.config-section h4 {
    margin-bottom: 10px;
    color: #ffeb3b;
    font-size: 16px;
}

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

.config-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.config-item label {
    font-size: 14px;
    color: #ccc;
}

.config-item input {
    padding: 5px;
    border: 1px solid #555;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 14px;
}

.config-item input:focus {
    outline: none;
    border-color: #ffd700;
    background: rgba(255, 255, 255, 0.2);
}

.config-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.config-buttons .game-btn {
    min-width: 80px;
}

.score-item {
    text-align: center;
    color: white;
    font-weight: bold;
}

.score-item .label {
    display: block;
    font-size: 14px;
    margin-bottom: 5px;
}

.score-item span:last-child {
    font-size: 24px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.game-area {
    position: relative;
    margin-bottom: 20px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

#gameCanvas {
    display: block;
    background: linear-gradient(to bottom, #87CEEB 0%, #98FB98 30%, #DEB887 100%);
    border: none;
    width: 100%;
    height: auto;
}

.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 15px;
}

.overlay-content {
    text-align: center;
    color: white;
    padding: 30px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.overlay-content h2 {
    font-size: 36px;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.overlay-content p {
    font-size: 18px;
    margin-bottom: 25px;
}

.game-btn {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 16px;
    border-radius: 25px;
    cursor: pointer;
    margin: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    font-weight: bold;
}

.game-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    background: linear-gradient(45deg, #ee5a24, #ff6b6b);
}

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

.game-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.controls-info, .items-info {
    background: rgba(255, 255, 255, 0.8);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.controls-info h3, .items-info h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 18px;
    border-bottom: 2px solid #ff6b6b;
    padding-bottom: 5px;
}

.controls-info ul {
    list-style: none;
}

.controls-info li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    position: relative;
    padding-left: 20px;
}

.controls-info li:before {
    content: "▶";
    position: absolute;
    left: 0;
    color: #ff6b6b;
    font-weight: bold;
}

.item-list {
    display: grid;
    gap: 10px;
}

.item {
    display: flex;
    align-items: center;
    padding: 10px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 10px;
    transition: all 0.3s ease;
}

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

.item-icon {
    font-size: 24px;
    margin-right: 15px;
    width: 30px;
    text-align: center;
}

.player-info {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

#playerName {
    padding: 12px 20px;
    border: 2px solid #ddd;
    border-radius: 25px;
    font-size: 16px;
    margin-right: 15px;
    outline: none;
    transition: all 0.3s ease;
    width: 200px;
}

#playerName:focus {
    border-color: #ff6b6b;
    box-shadow: 0 0 10px rgba(255, 107, 107, 0.3);
}

.leaderboard {
    margin-top: 20px;
    text-align: left;
}

.leaderboard h3 {
    color: #ffd700;
    margin-bottom: 15px;
    text-align: center;
}

#leaderboardList {
    list-style: none;
    max-height: 200px;
    overflow-y: auto;
}

#leaderboardList li {
    padding: 8px 15px;
    margin: 5px 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#leaderboardList li:nth-child(1) {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #333;
    font-weight: bold;
}

#leaderboardList li:nth-child(2) {
    background: linear-gradient(45deg, #c0c0c0, #e8e8e8);
    color: #333;
    font-weight: bold;
}

#leaderboardList li:nth-child(3) {
    background: linear-gradient(45deg, #cd7f32, #daa520);
    color: #333;
    font-weight: bold;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .game-container {
        padding: 15px;
        margin: 10px;
    }
    
    .score-panel {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .score-item {
        flex: 1;
        min-width: 120px;
    }
    
    .game-controls {
        grid-template-columns: 1fr;
    }
    
    #gameCanvas {
        max-width: 100%;
        height: 50vh; /* 手机端画布高度调整为70%视口高度，增加画布长度 */
        min-height: 500px; /* 设置最小高度确保游戏体验 */
    }
    
    .overlay-content h2 {
        font-size: 28px;
    }
    
    #playerName {
        width: 150px;
        margin-bottom: 10px;
    }
}

/* 游戏动画效果 */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.bounce {
    animation: bounce 1s;
}

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

.pulse {
    animation: pulse 2s infinite;
}

/* 游戏结果详情样式 */
.game-result-details {
    margin: 20px 0;
    text-align: left;
    max-width: 500px;
    width: 100%;
}

.result-section {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.result-section h3 {
    color: #ffd700;
    font-size: 18px;
    margin-bottom: 10px;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

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

.item-stat {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.item-stat .item-name {
    font-weight: bold;
    color: #fff;
}

.item-stat .item-count {
    background: #ffd700;
    color: #333;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: bold;
    font-size: 14px;
}

.game-statistics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.stat-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-item .stat-label {
    font-size: 12px;
    color: #ccc;
    margin-bottom: 5px;
}

.stat-item .stat-value {
    font-size: 18px;
    font-weight: bold;
    color: #ffd700;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .game-result-details {
        max-width: 100%;
    }
    
    .items-statistics {
        grid-template-columns: 1fr;
    }
    
    .game-statistics {
        grid-template-columns: 1fr;
    }
}