body.game-layout {
    background: linear-gradient(180deg, #87CEEB 0%, #E0F6FF 100%);
    --title-color: #2c5530;
    --title-shadow: 2px 2px 4px rgba(255, 255, 255, 0.5);
    --back-btn-bg: rgba(255, 255, 255, 0.5);
    --back-btn-color: #5a8f7b;
    --text-secondary: #555;
}

/* 难度选择 */
.difficulty-selector {
    margin-bottom: 20px;
}

.difficulty-selector label {
    font-size: 1.1rem;
    color: #2c5530;
    margin-right: 10px;
}

.diff-btn {
    padding: 8px 20px;
    margin: 0 5px;
    border: none;
    border-radius: 20px;
    font-size: 1rem;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.5);
    color: #2c5530;
    transition: all 0.3s;
}

.diff-btn:hover {
    background: rgba(255, 255, 255, 0.8);
}

.diff-btn.active {
    background: #5a8f7b;
    color: white;
}

/* 音量阈值控制 */
.volume-threshold-control {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 15px;
    padding: 12px 20px;
    margin-bottom: 20px;
}

.volume-threshold-control label {
    font-size: 1rem;
    color: #2c5530;
    display: block;
    margin-bottom: 8px;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.slider-label {
    font-size: 0.85rem;
    color: #666;
    min-width: 20px;
}

#volumeThreshold {
    flex: 1;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(90deg, #1dd1a1, #ff6b6b);
    border-radius: 4px;
    outline: none;
}

#volumeThreshold::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: white;
    border: 3px solid #5a8f7b;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

#volumeThreshold::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: white;
    border: 3px solid #5a8f7b;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.threshold-value {
    margin-top: 8px;
    font-size: 0.9rem;
    color: #666;
}

.threshold-value span {
    font-weight: bold;
    color: #5a8f7b;
}

#volumeThreshold:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 游戏区域 */
.game-area {
    position: relative;
    height: 300px;
    background: linear-gradient(180deg, #87CEEB 0%, #B4E1FF 100%);
    border-radius: 30px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.1),
        inset 0 -5px 20px rgba(255, 255, 255, 0.3);
}

/* 危险警告遮罩 - 类似FPS低血量效果 */
.warning-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 20;
    opacity: 0;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(255, 0, 0, 0.6) 100%);
    box-shadow: inset 0 0 80px rgba(255, 0, 0, 0.5);
    border-radius: 30px;
    transition: opacity 0.05s;
}

/* 云朵 */
.sky {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}

.cloud {
    position: absolute;
    background: white;
    border-radius: 50%;
    opacity: 0.8;
}

.cloud::before,
.cloud::after {
    content: '';
    position: absolute;
    background: white;
    border-radius: 50%;
}

.cloud-1 {
    width: 80px;
    height: 35px;
    top: 30px;
    left: 10%;
    animation: cloud-float 15s linear infinite;
}

.cloud-1::before {
    width: 40px;
    height: 40px;
    top: -20px;
    left: 10px;
}

.cloud-1::after {
    width: 50px;
    height: 50px;
    top: -25px;
    left: 30px;
}

.cloud-2 {
    width: 100px;
    height: 40px;
    top: 80px;
    right: 20%;
    animation: cloud-float 20s linear infinite;
    animation-delay: -5s;
}

.cloud-2::before {
    width: 50px;
    height: 50px;
    top: -25px;
    left: 15px;
}

.cloud-2::after {
    width: 60px;
    height: 60px;
    top: -30px;
    left: 40px;
}

.cloud-3 {
    width: 60px;
    height: 30px;
    top: 150px;
    left: 30%;
    animation: cloud-float 18s linear infinite;
    animation-delay: -10s;
}

.cloud-3::before {
    width: 30px;
    height: 30px;
    top: -15px;
    left: 10px;
}

.cloud-3::after {
    width: 35px;
    height: 35px;
    top: -18px;
    left: 25px;
}

@keyframes cloud-float {
    0% {
        transform: translateX(-100px);
    }
    100% {
        transform: translateX(calc(100vw + 100px));
    }
}

/* 飞行轨道 - 安全区域 (30%-70%) */
.track {
    position: absolute;
    top: 30%;
    left: 0;
    right: 0;
    height: 40%; /* 从30%到70% */
    background: linear-gradient(180deg,
        rgba(144, 238, 144, 0.15) 0%,
        rgba(144, 238, 144, 0.3) 50%,
        rgba(144, 238, 144, 0.15) 100%);
    border-top: 2px dashed rgba(90, 143, 123, 0.4);
    border-bottom: 2px dashed rgba(90, 143, 123, 0.4);
}

.track-center {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(90, 143, 123, 0.5);
    transform: translateY(-50%);
}

.track-center::before,
.track-center::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(90, 143, 123, 0.3);
}

.track-center::before {
    transform: translateY(-15px);
}

.track-center::after {
    transform: translateY(15px);
}

/* 小鸟 */
.bird {
    position: absolute;
    left: 80px;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 50px;
    transition: top 0.1s ease-out;
    z-index: 10;
}

.bird-body {
    position: absolute;
    width: 50px;
    height: 40px;
    background: linear-gradient(135deg, #FFD93D 0%, #FF9F43 100%);
    border-radius: 50% 50% 40% 40%;
    top: 5px;
    left: 5px;
}

.bird-wing {
    position: absolute;
    width: 25px;
    height: 20px;
    background: linear-gradient(135deg, #FF9F43 0%, #FF6B6B 100%);
    border-radius: 50% 50% 20% 50%;
    top: 12px;
    left: 20px;
    transform-origin: right center;
    animation: flap 0.3s ease-in-out infinite;
}

@keyframes flap {
    0%, 100% {
        transform: rotate(0deg);
    }
    50% {
        transform: rotate(-20deg);
    }
}

.bird.stable .bird-wing {
    animation-duration: 0.5s;
}

.bird.unstable .bird-wing {
    animation-duration: 0.15s;
}

.bird-eye {
    position: absolute;
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    top: 10px;
    left: 35px;
}

.bird-eye::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: #333;
    border-radius: 50%;
    top: 3px;
    left: 4px;
}

.bird-beak {
    position: absolute;
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 12px solid #FF6B6B;
    top: 18px;
    left: 50px;
}

/* 进度环 */
.progress-ring {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 70px;
    height: 70px;
}

.progress-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.progress-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.4);
    stroke-width: 8;
}

.progress-fill {
    fill: none;
    stroke: #5a8f7b;
    stroke-width: 8;
    stroke-dasharray: 283;
    stroke-dashoffset: 283;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.1s;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.9rem;
    font-weight: bold;
    color: #2c5530;
}

/* 稳定性面板 */
.stability-panel {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 20px;
    padding: 15px 20px;
    margin-bottom: 15px;
}

.stability-row {
    display: flex;
    gap: 20px;
    margin-bottom: 10px;
}

.stability-item {
    flex: 1;
}

.stability-label {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 5px;
}

.stability-bar {
    width: 100%;
    height: 12px;
    background: #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
}

.stability-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.1s;
    width: 0%;
}

.volume-stability {
    background: linear-gradient(90deg, #48dbfb, #0abde3);
}

.pitch-stability {
    background: linear-gradient(90deg, #ff9ff3, #f368e0);
}

.overall-stability {
    font-size: 1rem;
    color: #2c5530;
}

.overall-value {
    font-weight: bold;
    font-size: 1.2rem;
}

.overall-target {
    color: #888;
    font-size: 0.9rem;
}

/* 音量指示器 */
.volume-indicator {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 15px;
    padding: 12px 20px;
    margin-bottom: 15px;
}

.volume-label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 8px;
}

.volume-meter {
    width: 100%;
    height: 20px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.volume-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #1dd1a1, #10ac84);
    border-radius: 10px;
    transition: width 0.05s;
}

.volume-min-line {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 15%; /* 与滑动条默认值5对应: 5 * 3 = 15% */
    width: 2px;
    background: #ff6b6b;
}

.volume-hint {
    margin-top: 5px;
    font-size: 0.85rem;
    color: #888;
}

.volume-hint.active {
    color: #1dd1a1;
}

.volume-hint.warning {
    color: #ff6b6b;
}

/* 状态区域 */
.status {
    margin-top: 15px;
}

.instruction {
    font-size: 1.1rem;
    color: #2c5530;
    margin-bottom: 15px;
}

.btn-group {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.start-btn {
    padding: 15px 40px;
    font-size: 1.3rem;
    background: linear-gradient(135deg, #5a8f7b 0%, #2c5530 100%);
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(90, 143, 123, 0.4);
    font-weight: bold;
}

.start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(90, 143, 123, 0.5);
}

.start-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

.stop-btn {
    padding: 15px 40px;
    font-size: 1.3rem;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
    font-weight: bold;
}

.stop-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.5);
}

/* 结果弹窗 */
.result-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 100;
}

.result-overlay.active {
    opacity: 1;
    visibility: visible;
}

.result-card {
    background: white;
    border-radius: 30px;
    padding: 35px;
    text-align: center;
    transform: scale(0.8);
    transition: transform 0.3s;
    max-width: 90%;
    width: 380px;
    position: relative;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

.close-btn:hover {
    background: #e0e0e0;
    color: #333;
}

.result-btn-group {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.close-result-btn {
    padding: 15px 30px;
    font-size: 1.1rem;
    background: #f0f0f0;
    color: #666;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: background 0.2s;
    font-weight: bold;
}

.close-result-btn:hover {
    background: #e0e0e0;
}

.result-overlay.active .result-card {
    transform: scale(1);
}

.result-icon {
    font-size: 4rem;
    margin-bottom: 10px;
}

.result-title {
    font-size: 1.8rem;
    color: #2c5530;
    margin-bottom: 10px;
}

.result-message {
    font-size: 1rem;
    color: #666;
    margin-bottom: 20px;
}

.result-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 25px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: bold;
    color: #5a8f7b;
}

.stat-label {
    font-size: 0.85rem;
    color: #888;
}

/* 响应式调整 */
@media (max-width: 480px) {
    .game-area {
        height: 250px;
    }

    .bird {
        left: 50px;
        width: 50px;
        height: 40px;
    }

    .bird-body {
        width: 40px;
        height: 32px;
    }

    .diff-btn {
        padding: 6px 14px;
        font-size: 0.9rem;
        margin: 3px;
    }

    .progress-ring {
        width: 55px;
        height: 55px;
    }

    .stability-row {
        flex-direction: column;
        gap: 10px;
    }
}
