/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 主题 CSS 变量 */
:root {
    /* 亮色主题（默认） */
    --bg-gradient-1: #87CEEB;
    --bg-gradient-2: #98D8C8;
    --bg-gradient-3: #7CB342;
    --container-bg-1: #87CEEB;
    --container-bg-2: #B8E994;
    --container-bg-3: #6B8E23;
    --text-primary: #fff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --overlay-bg: rgba(0, 0, 0, 0.7);
    --card-bg: rgba(255, 255, 255, 0.1);
    --card-border: rgba(255, 255, 255, 0.2);
}

/* 暗色主题 */
[data-theme="dark"] {
    --bg-gradient-1: #0f0f23;
    --bg-gradient-2: #1a1a2e;
    --bg-gradient-3: #16213e;
    --container-bg-1: #0f0f23;
    --container-bg-2: #1a1a2e;
    --container-bg-3: #16213e;
    --text-primary: #e0e0e0;
    --text-secondary: rgba(224, 224, 224, 0.7);
    --overlay-bg: rgba(0, 0, 0, 0.85);
    --card-bg: rgba(30, 30, 50, 0.6);
    --card-border: rgba(100, 100, 150, 0.3);
}

body {
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(180deg, var(--bg-gradient-1) 0%, var(--bg-gradient-2) 50%, var(--bg-gradient-3) 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    transition: background 0.3s ease;
}

/* 游戏容器 */
#game-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    height: 600px;
    background: linear-gradient(180deg, var(--container-bg-1) 0%, var(--container-bg-2) 70%, var(--container-bg-3) 100%);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    transition: background 0.3s ease;
}

/* 游戏标题 */
#title {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 24px;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    z-index: 10;
    pointer-events: none;
}

/* 游戏画布 */
#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* UI 覆盖层 */
#ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 50px 15px 15px;
    pointer-events: none;
    z-index: 5;
}

/* 静音按钮 */
.mute-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    padding: 0;
    margin: 0;
    font-size: 20px;
    line-height: 40px;
    text-align: center;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    pointer-events: auto;
    transition: background 0.2s, transform 0.1s;
}

.mute-btn:hover {
    background: rgba(0, 0, 0, 0.5);
    transform: scale(1.1);
}

.mute-btn:active {
    transform: scale(0.95);
}

.mute-btn.muted {
    background: rgba(255, 100, 100, 0.4);
    border-color: rgba(255, 100, 100, 0.5);
}

/* 语言切换下拉 */
.lang-select {
    position: absolute;
    top: 10px;
    right: 150px;
    height: 36px;
    padding: 0 8px;
    font-size: 13px;
    font-weight: bold;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: #fff;
    pointer-events: auto;
    transition: background 0.2s, border-color 0.2s;
    cursor: pointer;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23fff' d='M2 4l4 4 4-4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 28px;
}

.lang-select:hover {
    background-color: rgba(0, 0, 0, 0.6);
    border-color: rgba(255, 255, 255, 0.5);
}

.lang-select:focus {
    border-color: #4CAF50;
}

.lang-select option {
    background: #333;
    color: #fff;
    padding: 8px;
}

/* 主题切换按钮 */
.theme-btn {
    position: absolute;
    top: 10px;
    right: 260px;
    width: 40px;
    height: 40px;
    padding: 0;
    margin: 0;
    font-size: 18px;
    line-height: 40px;
    text-align: center;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    pointer-events: auto;
    transition: background 0.2s, transform 0.1s;
    cursor: pointer;
}

.theme-btn:hover {
    background: rgba(0, 0, 0, 0.5);
    transform: scale(1.1);
}

.theme-btn:active {
    transform: scale(0.95);
}

/* 暗色主题时按钮高亮 */
[data-theme="dark"] .theme-btn {
    background: rgba(100, 100, 200, 0.4);
    border-color: rgba(100, 100, 200, 0.5);
}

/* 暗色主题 - Canvas 暗化滤镜 */
[data-theme="dark"] #gameCanvas {
    filter: brightness(0.85) saturate(0.9);
}

/* 暗色主题 - 屏幕覆盖层 */
[data-theme="dark"] .screen {
    background: rgba(10, 10, 30, 0.9);
}

/* 暗色主题 - 按钮样式调整 */
[data-theme="dark"] button {
    background: linear-gradient(180deg, #3d9960, #1f6e3d);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .secondary-btn {
    background: linear-gradient(180deg, #4a5568, #2d3748);
}

[data-theme="dark"] .daily-btn {
    background: linear-gradient(180deg, #2c5282, #1a365d);
}

[data-theme="dark"] .endless-btn {
    background: linear-gradient(180deg, #553c9a, #44337a);
}

/* 暗色主题 - 卡片和面板 */
[data-theme="dark"] .volume-panel {
    background: rgba(20, 20, 40, 0.98);
    border-color: rgba(100, 100, 150, 0.4);
}

[data-theme="dark"] .share-panel-content {
    background: linear-gradient(180deg, #1a1a2e, #16213e);
    border-color: rgba(100, 100, 150, 0.4);
}

/* 音量设置按钮 */
.volume-btn {
    position: absolute;
    top: 10px;
    right: 60px;
    width: 40px;
    height: 40px;
    padding: 0;
    margin: 0;
    font-size: 18px;
    line-height: 40px;
    text-align: center;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    pointer-events: auto;
    transition: background 0.2s, transform 0.1s;
    cursor: pointer;
}

.volume-btn:hover {
    background: rgba(0, 0, 0, 0.5);
    transform: scale(1.1);
}

.volume-btn:active {
    transform: scale(0.95);
}

.volume-btn.active {
    background: rgba(100, 180, 255, 0.4);
    border-color: rgba(100, 180, 255, 0.5);
}

/* 音量设置面板 */
.volume-panel {
    position: absolute;
    top: 55px;
    right: 10px;
    width: 200px;
    padding: 12px;
    background: rgba(20, 20, 30, 0.95);
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    pointer-events: auto;
    z-index: 50;
    animation: volumePanelIn 0.2s ease-out;
}

.volume-panel.hidden {
    display: none;
}

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

.volume-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 14px;
    font-weight: bold;
    color: #FFE66D;
}

.volume-panel-close {
    width: 24px;
    height: 24px;
    padding: 0;
    margin: 0;
    font-size: 14px;
    line-height: 22px;
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.volume-panel-close:hover {
    background: rgba(255, 100, 100, 0.3);
    color: #fff;
}

.volume-control {
    margin-bottom: 10px;
}

.volume-control:last-child {
    margin-bottom: 0;
}

.volume-control label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.volume-label {
    width: 55px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}

.volume-control input[type="range"] {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    outline: none;
}

.volume-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: linear-gradient(180deg, #4ECB71, #2E8B57);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    transition: transform 0.1s;
}

.volume-control input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.volume-control input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: linear-gradient(180deg, #4ECB71, #2E8B57);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.volume-value {
    width: 35px;
    font-size: 11px;
    color: #4ECB71;
    text-align: right;
    font-weight: bold;
}

/* 振动控制特殊样式 */
.vibration-control input[type="range"] {
    background: rgba(255, 150, 50, 0.2);
}

.vibration-control input[type="range"]::-webkit-slider-thumb {
    background: linear-gradient(180deg, #FF9F43, #E67E22);
}

.vibration-control input[type="range"]::-moz-range-thumb {
    background: linear-gradient(180deg, #FF9F43, #E67E22);
}

.vibration-control .volume-value {
    color: #FF9F43;
}

/* 非触摸设备上隐藏振动控制 */
@media (hover: hover) and (pointer: fine) {
    .vibration-control {
        display: none;
    }
}

/* 音效预览区域 */
.sfx-preview-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sfx-preview-header {
    font-size: 12px;
    color: #4FC3F7;
    font-weight: bold;
    margin-bottom: 10px;
    text-align: center;
}

.sfx-preview-btns {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.sfx-preview-btn {
    width: 38px;
    height: 38px;
    padding: 0;
    margin: 0;
    font-size: 18px;
    line-height: 38px;
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sfx-preview-btn:hover {
    background: rgba(79, 195, 247, 0.2);
    border-color: rgba(79, 195, 247, 0.4);
    transform: scale(1.1);
}

.sfx-preview-btn:active {
    transform: scale(0.95);
    background: rgba(79, 195, 247, 0.3);
}

.sfx-preview-btn.playing {
    background: rgba(78, 203, 113, 0.3);
    border-color: rgba(78, 203, 113, 0.5);
    animation: sfxBtnPulse 0.3s ease-out;
}

@keyframes sfxBtnPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

/* 全屏按钮 */
.fullscreen-btn {
    position: absolute;
    top: 10px;
    right: 110px;
    width: 40px;
    height: 40px;
    padding: 0;
    margin: 0;
    font-size: 20px;
    line-height: 40px;
    text-align: center;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    pointer-events: auto;
    transition: background 0.2s, transform 0.1s;
    cursor: pointer;
}

.fullscreen-btn:hover {
    background: rgba(0, 0, 0, 0.5);
    transform: scale(1.1);
}

.fullscreen-btn:active {
    transform: scale(0.95);
}

.fullscreen-btn.active {
    background: rgba(100, 200, 100, 0.4);
    border-color: rgba(100, 200, 100, 0.5);
}

/* 全屏模式样式 */
#game-container:fullscreen,
#game-container:-webkit-full-screen {
    max-width: 100%;
    width: 100vw;
    height: 100vh;
    background: #1a1a2e; /* 深色背景让 canvas 更突出 */
    display: flex;
    align-items: center;
    justify-content: center;
}

:fullscreen #gameCanvas,
:-webkit-full-screen #gameCanvas {
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    border-radius: 8px;
}

/* 全屏模式下的按钮调整 */
:fullscreen .fullscreen-btn,
:-webkit-full-screen .fullscreen-btn {
    background: rgba(100, 200, 100, 0.4);
    border-color: rgba(100, 200, 100, 0.5);
}

/* 分数显示 */
#score-display {
    text-align: center;
    margin-bottom: 10px;
}

#score {
    font-size: 48px;
    font-weight: bold;
    color: #fff;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.5);
}

/* 难度等级徽章 */
.difficulty-badge {
    display: inline-block;
    margin-left: 10px;
    padding: 4px 10px;
    font-size: 14px;
    font-weight: bold;
    color: #fff;
    background: linear-gradient(180deg, #FF6B6B, #D32F2F);
    border-radius: 12px;
    vertical-align: middle;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    transition: background 0.3s ease;
}

.difficulty-badge.level-high {
    background: linear-gradient(180deg, #FF5722, #B71C1C);
    animation: pulse 0.5s ease-in-out infinite alternate;
}

@keyframes pulse {
    from { transform: scale(1); }
    to { transform: scale(1.1); }
}

/* 连击显示 */
.combo-display {
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    color: #FFE66D;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 5px;
    animation: comboPop 0.15s ease-out;
}

.combo-display.hidden {
    display: none;
}

/* 连击等级样式 */
.combo-good {
    color: #4ECB71;
    font-size: 26px;
}

.combo-great {
    color: #FF9800;
    font-size: 28px;
    animation: comboPop 0.15s ease-out, comboGlow 0.5s ease-in-out infinite alternate;
}

.combo-epic {
    color: #FF4081;
    font-size: 32px;
    animation: comboPop 0.15s ease-out, comboGlow 0.3s ease-in-out infinite alternate, comboShake 0.1s ease-in-out infinite;
}

@keyframes comboPop {
    0% { transform: scale(1.5); opacity: 0.5; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes comboGlow {
    from { text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5), 0 0 10px currentColor; }
    to { text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5), 0 0 20px currentColor, 0 0 30px currentColor; }
}

@keyframes comboShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

/* 时间条 */
#timer-bar {
    width: 100%;
    height: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

#timer-fill {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #FF6B6B, #FFE66D, #4ECB71);
    border-radius: 8px;
    transition: width 0.1s linear;
}

/* 通用屏幕样式 */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    background: rgba(0, 0, 0, 0.7);
    z-index: 20;
    padding: 20px;
    padding-top: 30px;
    text-align: center;
    overflow-y: auto;
    box-sizing: border-box;
}

.screen.hidden {
    display: none;
}

.screen h2 {
    font-size: 32px;
    color: #FFE66D;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 12px;
}

.screen p {
    font-size: 14px;
    color: #fff;
    margin-bottom: 6px;
    line-height: 1.4;
}

.screen .hint-text {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 5px;
}

/* 按钮样式 */
button {
    margin-top: 10px;
    padding: 12px 30px;
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    background: linear-gradient(180deg, #4ECB71, #2E8B57);
    border: none;
    border-radius: 25px;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.1s, box-shadow 0.1s;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 20px rgba(0, 0, 0, 0.4);
}

button:active {
    transform: translateY(1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

/* 操作提示 */
#controls-hint {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 400px;
    padding: 15px 20px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.hint-left, .hint-right {
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* 游戏结束时的分数高亮 */
#final-score {
    font-size: 48px;
    color: #FFE66D;
    font-weight: bold;
}

#max-combo-text {
    color: #FF9800;
    font-size: 14px;
}

#max-combo {
    font-weight: bold;
    color: #FFE66D;
}

#high-score-text {
    color: #4ECB71;
    font-size: 14px;
}

#high-score {
    font-weight: bold;
}

/* 响应式设计 */
@media (max-width: 420px) {
    #game-container {
        border-radius: 0;
        height: 100vh;
        max-width: 100%;
    }

    #controls-hint {
        position: fixed;
        bottom: 0;
        left: 0;
        background: rgba(0, 0, 0, 0.3);
    }
}

/* 触摸反馈 */
@media (hover: none) {
    button:hover {
        transform: none;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    }
}

/* 游戏结束按钮组 */
#game-over-btns {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.secondary-btn {
    background: linear-gradient(180deg, #FFB300, #FF8F00);
    padding: 12px 25px;
    font-size: 16px;
}

/* 成就界面 */
#achievements-screen {
    background: rgba(0, 0, 0, 0.85);
}

#achievements-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-width: 350px;
    max-height: 350px;
    overflow-y: auto;
    padding: 10px;
    margin-bottom: 10px;
}

.achievement-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.2s, box-shadow 0.2s;
}

.achievement-item.unlocked {
    background: rgba(78, 203, 113, 0.2);
    border-color: #4ECB71;
}

.achievement-item.rarity-rare.unlocked {
    background: rgba(33, 150, 243, 0.2);
    border-color: #2196F3;
}

.achievement-item.rarity-epic.unlocked {
    background: rgba(156, 39, 176, 0.2);
    border-color: #9C27B0;
}

.achievement-item.rarity-legendary.unlocked {
    background: rgba(255, 193, 7, 0.2);
    border-color: #FFC107;
    box-shadow: 0 0 15px rgba(255, 193, 7, 0.3);
}

.achievement-item.locked {
    opacity: 0.5;
    filter: grayscale(0.8);
}

.achievement-item .icon {
    font-size: 28px;
    margin-bottom: 5px;
}

.achievement-item .name {
    font-size: 10px;
    color: #fff;
    text-align: center;
    line-height: 1.2;
}

.achievement-item.locked .name {
    color: #888;
}

#achievements-progress {
    color: #FFE66D;
    font-size: 14px;
    margin-top: 5px;
}

/* 成就解锁弹窗 */
.achievement-popup {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: linear-gradient(135deg, rgba(78, 203, 113, 0.95), rgba(46, 139, 87, 0.95));
    border-radius: 30px;
    border: 2px solid #FFE66D;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4), 0 0 30px rgba(255, 230, 109, 0.3);
    z-index: 100;
    animation: popupSlideIn 0.5s ease-out;
}

.achievement-popup.hidden {
    display: none;
}

.achievement-popup .achievement-icon {
    font-size: 32px;
    animation: iconBounce 0.5s ease-out 0.2s;
}

.achievement-popup .achievement-info {
    display: flex;
    flex-direction: column;
}

.achievement-popup .achievement-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.achievement-popup #achievement-name {
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

@keyframes popupSlideIn {
    0% {
        transform: translateX(-50%) translateY(-50px);
        opacity: 0;
    }
    100% {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

@keyframes iconBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

/* 屏幕震动效果 */
#game-container.screen-shake {
    animation: screenShake 0.4s ease-out;
}

@keyframes screenShake {
    0%, 100% { transform: translateX(0) translateY(0); }
    10% { transform: translateX(-8px) translateY(4px); }
    20% { transform: translateX(8px) translateY(-4px); }
    30% { transform: translateX(-6px) translateY(3px); }
    40% { transform: translateX(6px) translateY(-3px); }
    50% { transform: translateX(-4px) translateY(2px); }
    60% { transform: translateX(4px) translateY(-2px); }
    70% { transform: translateX(-2px) translateY(1px); }
    80% { transform: translateX(2px) translateY(-1px); }
    90% { transform: translateX(-1px) translateY(0); }
}

/* 移动端触摸区域指示 */
.touch-zones {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    pointer-events: none;
    z-index: 15;
}

.touch-zones.hidden {
    display: none;
}

.touch-zone {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: background 0.15s ease;
}

.touch-zone-left {
    background: linear-gradient(90deg, rgba(78, 203, 113, 0.15) 0%, rgba(78, 203, 113, 0) 80%);
    border-right: 1px dashed rgba(255, 255, 255, 0.2);
}

.touch-zone-right {
    background: linear-gradient(270deg, rgba(78, 203, 113, 0.15) 0%, rgba(78, 203, 113, 0) 80%);
}

.touch-arrow {
    font-size: 48px;
    color: rgba(255, 255, 255, 0.25);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.15s ease;
    user-select: none;
}

/* 触摸激活状态 */
.touch-zone.active {
    background: rgba(78, 203, 113, 0.3);
}

.touch-zone.active .touch-arrow {
    color: rgba(255, 255, 255, 0.8);
    transform: scale(1.2);
}

/* 触摸波纹效果 */
.touch-ripple {
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
}

.touch-ripple.animate {
    animation: rippleEffect 0.4s ease-out;
}

@keyframes rippleEffect {
    0% {
        transform: scale(0);
        opacity: 0.6;
    }
    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

/* 首次提示动画 - 箭头脉冲 */
.touch-zones.show-hint .touch-arrow {
    animation: arrowPulse 1.5s ease-in-out infinite;
}

@keyframes arrowPulse {
    0%, 100% {
        opacity: 0.25;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.15);
    }
}

/* 淡出动画 - 游戏开始后渐隐 */
.touch-zones.fade-out {
    animation: zonesFadeOut 2s ease-out forwards;
}

@keyframes zonesFadeOut {
    0% { opacity: 1; }
    50% { opacity: 1; }
    100% { opacity: 0.3; }
}

/* 开始界面按钮组 */
#start-btns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 100%;
    padding-bottom: 20px;
}

#start-btns button {
    padding: 12px 20px;
    font-size: 16px;
}

/* 皮肤选择界面 */
#skin-screen {
    background: rgba(0, 0, 0, 0.85);
}

/* 皮肤预览区域 */
#skin-preview-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 15px;
    padding: 15px 25px;
    background: linear-gradient(180deg, rgba(135, 206, 235, 0.3) 0%, rgba(107, 142, 35, 0.3) 100%);
    border-radius: 15px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.2);
}

#skin-preview-canvas {
    border-radius: 8px;
    image-rendering: pixelated;
}

#skin-preview-name {
    margin-top: 8px;
    font-size: 16px;
    font-weight: bold;
    color: #FFE66D;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

#skin-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    max-width: 320px;
    max-height: 350px;
    overflow-y: auto;
    padding: 10px;
    margin-bottom: 10px;
}

.skin-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.skin-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.skin-item.unlocked {
    background: rgba(78, 203, 113, 0.15);
    border-color: rgba(78, 203, 113, 0.4);
}

.skin-item.selected {
    background: rgba(78, 203, 113, 0.3);
    border-color: #4ECB71;
    box-shadow: 0 0 15px rgba(78, 203, 113, 0.4);
}

.skin-item.locked {
    opacity: 0.6;
    cursor: not-allowed;
}

.skin-item.locked:hover {
    transform: none;
}

/* 皮肤预览容器 */
.skin-preview-container {
    width: 80px;
    height: 100px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.skin-preview-canvas {
    border-radius: 6px;
    image-rendering: pixelated;
    background: linear-gradient(180deg, rgba(135, 206, 235, 0.2) 0%, rgba(107, 142, 35, 0.2) 100%);
}

.skin-info {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.skin-item .skin-icon {
    font-size: 36px;
    margin-bottom: 8px;
}

.skin-item .skin-name {
    font-size: 14px;
    font-weight: bold;
    color: #fff;
    text-align: center;
    margin-bottom: 4px;
}

.skin-item .skin-desc {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    line-height: 1.3;
}

.skin-item.locked .skin-name,
.skin-item.locked .skin-desc {
    color: #888;
}

.skin-item .skin-unlock-hint {
    font-size: 9px;
    color: #FFE66D;
    margin-top: 6px;
    text-align: center;
}

.skin-item .skin-selected-badge {
    font-size: 9px;
    color: #4ECB71;
    margin-top: 6px;
    font-weight: bold;
}

#skin-progress {
    color: #FFE66D;
    font-size: 14px;
    margin-top: 5px;
}

.skin-item .unlock-req {
    font-size: 10px;
    color: #FF9800;
    margin-top: 4px;
    padding: 2px 8px;
    background: rgba(255, 152, 0, 0.2);
    border-radius: 8px;
}

.skin-item .skin-check {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 14px;
    color: #4ECB71;
    font-weight: bold;
}

.skin-item {
    position: relative;
}

/* 皮肤解锁弹窗 */
.skin-unlock-popup {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.95), rgba(255, 143, 0, 0.95));
    border-radius: 30px;
    border: 2px solid #fff;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4), 0 0 30px rgba(255, 193, 7, 0.3);
    z-index: 100;
    animation: popupSlideIn 0.5s ease-out;
}

.skin-unlock-popup.hidden {
    display: none;
}

.skin-unlock-popup .skin-popup-icon {
    font-size: 32px;
    animation: iconBounce 0.5s ease-out 0.2s;
}

.skin-unlock-popup .skin-popup-info {
    display: flex;
    flex-direction: column;
}

.skin-unlock-popup .skin-popup-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.skin-unlock-popup .skin-popup-name {
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* ============ 每日挑战样式 ============ */

/* 每日挑战按钮 */
.daily-btn {
    background: linear-gradient(180deg, #2196F3, #1565C0);
    padding: 12px 25px;
    font-size: 16px;
}

.daily-btn:hover {
    background: linear-gradient(180deg, #42A5F5, #1976D2);
}

/* 每日挑战界面 */
#daily-screen {
    background: rgba(0, 0, 0, 0.85);
}

.daily-info {
    text-align: center;
    margin-bottom: 15px;
}

.daily-date-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 5px !important;
}

.daily-date-value {
    font-size: 24px !important;
    font-weight: bold;
    color: #2196F3 !important;
    margin: 0 !important;
}

.daily-stats {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin: 20px 0;
}

.daily-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    border: 2px solid rgba(33, 150, 243, 0.3);
}

.daily-stat .stat-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 5px;
}

.daily-stat .stat-value {
    font-size: 28px;
    font-weight: bold;
    color: #FFE66D;
}

.daily-hint {
    font-size: 12px !important;
    color: rgba(255, 255, 255, 0.6) !important;
    font-style: italic;
}

.daily-btns {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

#daily-start-btn {
    background: linear-gradient(180deg, #2196F3, #1565C0);
}

#daily-start-btn:hover {
    background: linear-gradient(180deg, #42A5F5, #1976D2);
}

/* 每日挑战结束界面 */
#daily-game-over-screen {
    background: rgba(0, 0, 0, 0.85);
}

#daily-game-over-screen h2 {
    color: #2196F3;
}

.new-record {
    font-size: 24px !important;
    color: #FFD700 !important;
    font-weight: bold;
    animation: newRecordPulse 0.5s ease-in-out infinite alternate;
    margin-bottom: 15px !important;
}

@keyframes newRecordPulse {
    from { transform: scale(1); text-shadow: 0 0 10px rgba(255, 215, 0, 0.5); }
    to { transform: scale(1.1); text-shadow: 0 0 20px rgba(255, 215, 0, 0.8); }
}

#daily-final-score {
    font-size: 48px;
    color: #2196F3;
    font-weight: bold;
}

#daily-high-score {
    font-size: 24px;
    color: #FFE66D;
    font-weight: bold;
}

.daily-combo-text {
    color: #FF9800 !important;
    font-size: 14px !important;
}

.daily-attempts-text {
    color: #4ECB71 !important;
    font-size: 14px !important;
}

#daily-game-over-btns {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

#daily-retry-btn {
    background: linear-gradient(180deg, #2196F3, #1565C0);
}

#daily-retry-btn:hover {
    background: linear-gradient(180deg, #42A5F5, #1976D2);
}

/* ============ 无限模式样式 ============ */

/* 无限模式按钮 */
.endless-btn {
    background: linear-gradient(180deg, #9C27B0, #7B1FA2);
    padding: 12px 25px;
    font-size: 16px;
}

.endless-btn:hover {
    background: linear-gradient(180deg, #AB47BC, #8E24AA);
}

/* 无限模式界面 */
#endless-screen {
    background: rgba(0, 0, 0, 0.85);
}

#endless-screen h2 {
    color: #CE93D8;
}

.endless-desc {
    font-size: 14px !important;
    color: rgba(255, 255, 255, 0.8) !important;
    margin-bottom: 10px !important;
}

.endless-stats {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin: 20px 0;
}

.endless-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    border: 2px solid rgba(156, 39, 176, 0.3);
}

.endless-stat .stat-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 5px;
}

.endless-stat .stat-value {
    font-size: 28px;
    font-weight: bold;
    color: #FFE66D;
}

.endless-hint {
    font-size: 12px !important;
    color: rgba(255, 255, 255, 0.6) !important;
    font-style: italic;
}

.endless-btns {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

#endless-start-btn {
    background: linear-gradient(180deg, #9C27B0, #7B1FA2);
}

#endless-start-btn:hover {
    background: linear-gradient(180deg, #AB47BC, #8E24AA);
}

/* 无限模式结束界面 */
#endless-game-over-screen {
    background: rgba(0, 0, 0, 0.85);
}

#endless-game-over-screen h2 {
    color: #CE93D8;
}

#endless-final-score {
    font-size: 48px;
    color: #CE93D8;
    font-weight: bold;
}

#endless-high-score {
    font-size: 24px;
    color: #FFE66D;
    font-weight: bold;
}

.endless-combo-text {
    color: #FF9800 !important;
    font-size: 14px !important;
}

#endless-game-over-btns {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

#endless-retry-btn {
    background: linear-gradient(180deg, #9C27B0, #7B1FA2);
}

#endless-retry-btn:hover {
    background: linear-gradient(180deg, #AB47BC, #8E24AA);
}

/* 无限模式时隐藏时间条 */
.endless-mode #timer-bar {
    display: none;
}

/* ============ 教程界面样式 ============ */

#tutorial-screen {
    background: rgba(0, 0, 0, 0.9);
    padding: 30px 20px;
}

.tutorial-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 320px;
    width: 100%;
}

.tutorial-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    animation: tutorialFadeIn 0.4s ease-out;
}

.tutorial-step.hidden {
    display: none;
}

@keyframes tutorialFadeIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.tutorial-icon {
    font-size: 64px;
    margin-bottom: 15px;
    animation: tutorialIconBounce 0.6s ease-out;
}

@keyframes tutorialIconBounce {
    0% { transform: scale(0.5); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.tutorial-step h2 {
    font-size: 28px;
    color: #FFE66D;
    margin-bottom: 15px;
}

.tutorial-step p {
    font-size: 15px;
    color: #fff;
    margin-bottom: 8px;
    line-height: 1.4;
}

/* 控制方式展示 */
.tutorial-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 15px 0;
}

.control-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.control-item .key {
    font-size: 18px;
    font-weight: bold;
    color: #FFE66D;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    border: 2px solid #FFE66D;
    font-family: monospace;
    min-width: 60px;
    text-align: center;
}

.control-item span:last-child {
    color: #fff;
    font-size: 14px;
}

.tutorial-hint {
    font-size: 12px !important;
    color: rgba(255, 255, 255, 0.6) !important;
    font-style: italic;
    margin-top: 10px !important;
}

/* 躲避树枝演示 */
.tutorial-demo {
    margin: 20px 0;
    padding: 20px;
    background: linear-gradient(180deg, rgba(135, 206, 235, 0.2) 0%, rgba(107, 142, 35, 0.2) 100%);
    border-radius: 15px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.demo-tree {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.demo-trunk {
    font-size: 36px;
    margin: 5px 0;
}

.demo-branch {
    font-size: 24px;
    position: absolute;
    top: -5px;
}

.demo-branch.left {
    left: -35px;
    transform: scaleX(-1);
}

.demo-branch.right {
    right: -35px;
}

.demo-player {
    font-size: 32px;
    position: absolute;
    bottom: -10px;
}

.demo-player.left {
    left: -45px;
}

.demo-player.right {
    right: -45px;
}

.demo-player.danger {
    animation: dangerBlink 0.5s ease-in-out infinite alternate;
}

@keyframes dangerBlink {
    from { opacity: 1; }
    to { opacity: 0.4; }
}

.tutorial-warning {
    font-size: 18px !important;
    color: #FF6B6B !important;
    font-weight: bold;
    margin-top: 15px !important;
    padding: 8px 16px;
    background: rgba(255, 107, 107, 0.2);
    border-radius: 8px;
    border: 2px solid rgba(255, 107, 107, 0.4);
}

/* 时间条演示 */
.tutorial-timer-demo {
    width: 100%;
    margin: 20px 0;
}

.demo-timer-bar {
    width: 100%;
    height: 24px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.demo-timer-fill {
    height: 100%;
    width: 70%;
    background: linear-gradient(90deg, #FF6B6B, #FFE66D, #4ECB71);
    border-radius: 10px;
    animation: timerDemo 2s ease-in-out infinite;
}

@keyframes timerDemo {
    0% { width: 70%; }
    50% { width: 40%; }
    100% { width: 70%; }
}

.tutorial-tip {
    font-size: 14px !important;
    color: #4ECB71 !important;
}

.tutorial-tip strong {
    color: #FFE66D;
}

/* 高级技巧列表 */
.tutorial-tips-list {
    text-align: left;
    margin: 15px 0;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.tutorial-tips-list p {
    font-size: 14px !important;
    margin-bottom: 10px !important;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tutorial-tips-list p:last-child {
    margin-bottom: 0 !important;
}

.tutorial-tips-list strong {
    color: #FFE66D;
}

/* 导航区域 */
.tutorial-nav {
    width: 100%;
    max-width: 320px;
    margin-top: 20px;
}

.tutorial-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.tutorial-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.tutorial-dots .dot:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: scale(1.2);
}

.tutorial-dots .dot.active {
    background: #FFE66D;
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(255, 230, 109, 0.5);
}

.tutorial-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.tutorial-buttons button {
    margin-top: 0;
    padding: 12px 24px;
    font-size: 16px;
}

#tutorial-skip-btn {
    background: linear-gradient(180deg, #9E9E9E, #616161);
}

#tutorial-prev-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#tutorial-prev-btn:disabled:hover {
    transform: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

#tutorial-next-btn {
    background: linear-gradient(180deg, #4ECB71, #2E8B57);
}

/* ============ 排行榜样式 ============ */

#leaderboard-screen {
    background: rgba(0, 0, 0, 0.9);
}

#leaderboard-screen h2 {
    color: #FFB300;
    margin-bottom: 15px;
}

.leaderboard-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 10px;
    width: 100%;
    max-width: 350px;
}

.lb-col-rank { width: 40px; text-align: center; }
.lb-col-skin { width: 30px; text-align: center; }
.lb-col-score { flex: 1; text-align: center; }
.lb-col-combo { width: 50px; text-align: center; }
.lb-col-date { width: 70px; text-align: right; }

#leaderboard-list {
    width: 100%;
    max-width: 350px;
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 6px;
    transition: background 0.2s, transform 0.2s;
}

.leaderboard-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(3px);
}

/* 前三名特殊样式 */
.leaderboard-item.rank-1 {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.2), rgba(255, 215, 0, 0.05));
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.leaderboard-item.rank-2 {
    background: linear-gradient(90deg, rgba(192, 192, 192, 0.2), rgba(192, 192, 192, 0.05));
    border: 1px solid rgba(192, 192, 192, 0.3);
}

.leaderboard-item.rank-3 {
    background: linear-gradient(90deg, rgba(205, 127, 50, 0.2), rgba(205, 127, 50, 0.05));
    border: 1px solid rgba(205, 127, 50, 0.3);
}

.lb-rank {
    width: 40px;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    color: #fff;
}

.leaderboard-item.rank-1 .lb-rank { color: #FFD700; }
.leaderboard-item.rank-2 .lb-rank { color: #C0C0C0; }
.leaderboard-item.rank-3 .lb-rank { color: #CD7F32; }

.lb-skin {
    width: 30px;
    text-align: center;
    font-size: 20px;
}

.lb-score {
    flex: 1;
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    color: #FFE66D;
}

.lb-combo {
    width: 50px;
    text-align: center;
    font-size: 12px;
    color: #FF9800;
}

.lb-date {
    width: 70px;
    text-align: right;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
}

.leaderboard-empty {
    padding: 40px 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
}

.leaderboard-btns {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.danger-btn {
    background: linear-gradient(180deg, #EF5350, #C62828);
    padding: 10px 20px;
    font-size: 14px;
}

.danger-btn:hover {
    background: linear-gradient(180deg, #F44336, #D32F2F);
}

/* ============ 统计页面样式 ============ */
#stats-screen {
    background: rgba(0, 0, 0, 0.92);
}

#stats-screen h2 {
    color: #4FC3F7;
    margin-bottom: 15px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-width: 350px;
    margin: 0 auto 15px;
}

.stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.2s, background 0.2s;
}

.stat-card:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
}

.stat-card .stat-icon {
    font-size: 24px;
    margin-bottom: 5px;
}

.stat-card .stat-value {
    font-size: 20px;
    font-weight: bold;
    color: #4FC3F7;
    margin-bottom: 3px;
}

.stat-card .stat-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
}

.stats-extra {
    max-width: 300px;
    margin: 0 auto 15px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.stats-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stats-row:last-child {
    border-bottom: none;
}

.stats-row span:last-child {
    color: #4FC3F7;
    font-weight: bold;
}

.stats-btns {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* ============ 回放界面样式 ============ */
#replay-screen {
    background: rgba(0, 0, 0, 0.9);
}

#replay-screen h2 {
    color: #FFD54F;
    font-size: 24px;
    margin-bottom: 20px;
}

.replay-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    max-width: 320px;
    margin: 0 auto 20px;
}

.replay-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.replay-stat .stat-icon {
    font-size: 24px;
    margin-bottom: 5px;
}

.replay-stat .stat-value {
    font-size: 22px;
    font-weight: bold;
    color: #4FC3F7;
}

.replay-stat .stat-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 3px;
}

.replay-no-data {
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    margin: 20px 0;
}

.replay-btns {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

#replay-start-btn {
    background: linear-gradient(180deg, #FFD54F 0%, #FF8F00 100%);
    color: #333;
    font-weight: bold;
}

#replay-start-btn:hover {
    background: linear-gradient(180deg, #FFEB3B 0%, #FFA000 100%);
}

#replay-start-btn:disabled {
    background: rgba(150, 150, 150, 0.5);
    color: rgba(255, 255, 255, 0.4);
    cursor: not-allowed;
}

/* 回放指示器 */
.replay-indicator {
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: rgba(255, 215, 0, 0.9);
    border-radius: 20px;
    color: #333;
    font-weight: bold;
    font-size: 14px;
    z-index: 100;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    animation: replayPulse 1.5s ease-in-out infinite;
}

.replay-indicator.hidden {
    display: none;
}

@keyframes replayPulse {
    0%, 100% { opacity: 0.9; }
    50% { opacity: 1; box-shadow: 0 3px 15px rgba(255, 215, 0, 0.6); }
}

.replay-indicator button {
    padding: 4px 12px;
    font-size: 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    color: #333;
    cursor: pointer;
    transition: background 0.2s;
}

.replay-indicator button:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* 回放按钮样式 */
.replay-btn {
    background: linear-gradient(180deg, #FFD54F 0%, #FFC107 100%) !important;
    color: #333 !important;
}

/* ============ 分享功能样式 ============ */

/* 分享按钮 */
.share-btn {
    background: linear-gradient(180deg, #4FC3F7 0%, #29B6F6 100%) !important;
    color: #fff !important;
    border-color: #0288D1 !important;
}

.share-btn:hover {
    background: linear-gradient(180deg, #81D4FA 0%, #4FC3F7 100%) !important;
}

/* 分享面板 */
.share-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: sharePanelIn 0.3s ease-out;
}

.share-panel.hidden {
    display: none;
}

@keyframes sharePanelIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.share-panel-content {
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 16px;
    border: 2px solid rgba(100, 180, 255, 0.3);
    padding: 20px;
    width: 90%;
    max-width: 360px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: shareContentIn 0.3s ease-out 0.1s both;
}

@keyframes shareContentIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.share-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.share-panel-header h3 {
    margin: 0;
    font-size: 18px;
    color: #4FC3F7;
}

.share-panel-close {
    width: 28px;
    height: 28px;
    font-size: 16px;
    line-height: 28px;
    text-align: center;
    background: rgba(255, 100, 100, 0.2);
    border: 1px solid rgba(255, 100, 100, 0.3);
    border-radius: 50%;
    color: #FF6B6B;
    cursor: pointer;
    transition: all 0.2s;
}

.share-panel-close:hover {
    background: rgba(255, 100, 100, 0.4);
    transform: scale(1.1);
}

/* 分享预览 */
.share-preview-container {
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
}

.share-preview-container canvas {
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    max-width: 100%;
    height: auto;
}

/* 分享按钮组 */
.share-btns {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.share-action-btn {
    flex: 1;
    min-width: 90px;
    padding: 10px 15px;
    font-size: 14px;
    font-weight: bold;
    background: linear-gradient(180deg, #4FC3F7 0%, #29B6F6 100%);
    border: 2px solid #0288D1;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
}

.share-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(41, 182, 246, 0.4);
}

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

.share-action-btn.hidden {
    display: none;
}

/* 复制成功提示 */
.share-copy-hint {
    text-align: center;
    color: #4ECB71;
    font-size: 14px;
    margin-top: 10px;
    animation: hintPop 0.3s ease-out;
}

.share-copy-hint.hidden {
    display: none;
}

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

/* ============ 速度选择界面 ============ */
#speed-screen {
    background: rgba(0, 0, 0, 0.88);
}

#speed-screen h2 {
    color: #FFB74D;
    margin-bottom: 10px;
}

.speed-desc {
    font-size: 14px !important;
    color: rgba(255, 255, 255, 0.7) !important;
    margin-bottom: 20px !important;
}

#speed-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 320px;
    margin-bottom: 20px;
}

.speed-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
    transition: all 0.2s ease;
}

.speed-item:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateX(4px);
}

.speed-item.selected {
    background: rgba(255, 183, 77, 0.2);
    border-color: #FFB74D;
    box-shadow: 0 0 15px rgba(255, 183, 77, 0.3);
}

.speed-icon {
    font-size: 32px;
    width: 50px;
    text-align: center;
}

.speed-info {
    flex: 1;
    text-align: left;
}

.speed-name {
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 3px;
}

.speed-detail {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.speed-check {
    font-size: 20px;
    color: #FFB74D;
    opacity: 0;
    transition: opacity 0.2s;
}

.speed-item.selected .speed-check {
    opacity: 1;
}

/* 速度按钮样式 */
.speed-btn {
    background: linear-gradient(180deg, #FFB74D, #FF9800);
}
