body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    background-color: #f0f0f0;
}

#gameContainer {
    position: relative;
    width: 800px;
    height: 800px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#gameInstructions {
    width: 100%;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.6));
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 10px;
    color: white;
    font-family: 'Segoe UI', Arial, sans-serif;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    animation: fadeIn 0.5s ease-in-out;
    position: absolute;
    bottom: 0px;
    padding: 10px 20px;
}

#gameInstructions h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: #4CAF50;
}

#gameInstructions p {
    margin: 5px 0;
    font-size: 14px;
    line-height: 1.4;
}

#gameInstructions .control-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 5px;
}

#gameInstructions .key-icon {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
}

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

#scorePanel {
    width: 100%;
    height: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* padding: 0 15px; */
    background: linear-gradient(to right, rgba(0, 100, 0, 0.8), rgba(34, 139, 34, 0.8));
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 100;
}

.segment-counter {
    color: white;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 18px;
    font-weight: bold;
}

.segment-stats {
    display: flex;
    gap: 20px;
    align-items: center;
}

.segment-type {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.1);
    padding: 5px 10px;
    border-radius: 15px;
}

.segment-type span {
    color: white;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 16px;
    font-weight: bold;
}

.segment-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

#targetScore, #currentScore {
    color: white;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 15px;
}

#progressContainer {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    margin: 0 20px;
    overflow: hidden;
}

#progressBar {
    height: 100%;
    background: linear-gradient(to right, #32CD32, #98FB98);
    border-radius: 3px;
    transition: width 0.3s ease;
}

#startScreen {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    border: 2px solid #333;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #4A148C, #311B92);
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.game-title {
    font-size: 64px;
    font-weight: bold;
    font-family: 'Segoe UI', Arial, sans-serif;
    color: transparent;
    background: linear-gradient(45deg, #FFD700, #FFF176, #FFD700);
    -webkit-background-clip: text;
    background-clip: text;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    margin-bottom: 30px;
    animation: glow 2s ease-in-out infinite;
}

.game-logo {
    margin-bottom: 40px;
    animation: float 3s ease-in-out infinite;
}

.logo-image {
    width: 100px;
    height: 100px;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.3));
}

#startButton {
    width: 220px;
    height: 60px;
    border: none;
    border-radius: 30px;
    background: linear-gradient(to bottom, #4CAF50, #388E3C);
    color: white;
    font-size: 24px;
    font-weight: bold;
    font-family: 'Segoe UI', Arial, sans-serif;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#startButton:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

#startButton:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#gameCanvas {
    width: 100%;
    height: 100%;
    border: 2px solid #333;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    background-image: url('background.jpg');
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
}

#gameCanvas::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(74, 20, 140, 0.2), rgba(49, 27, 146, 0.2));
    animation: gradientShift 10s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

#score {
    text-align: center;
    font-size: clamp(16px, 4vw, 24px);
    margin-top: 10px;
    color: #333;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    position: relative;
}

.score-popup {
    position: absolute;
    color: #28a12c;
    font-size: 50px;
    font-weight: 700;
    opacity: 0;
    pointer-events: none;
    animation: scorePopup 1.5s ease-out forwards;
}

@keyframes scorePopup {
    0% {
        transform: translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateY(-30px);
        opacity: 0;
    }
}

.score-popup {
    position: absolute;
    color: #4CAF50;
    font-size: 24px;
    font-weight: bold;
    opacity: 0;
    pointer-events: none;
    animation: scorePopup 1s ease-out forwards;
}

@keyframes scorePopup {
    0% {
        transform: translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateY(-30px);
        opacity: 0;
    }
}

#score::after {
    content: '目标: 100分';
    font-size: 0.8em;
    color: #666;
}

@keyframes glow {
    0%, 100% {
        text-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
    }
    50% {
        text-shadow: 0 0 30px rgba(255, 215, 0, 0.6);
    }
}

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

/* 添加媒体查询以适应小屏幕 */
@media (max-width: 640px) {
    #gameContainer {
        width: 95vw;
        height: 63.33vw; /* 保持 3:2 的宽高比 */
    }
}