:root {
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-color: rgba(255, 255, 255, 0.9);
    --slider-bg: rgba(255, 255, 255, 0.2);
    --slider-thumb: #ffffff;
    --touch-feedback: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    min-height: 100vh;
    background: #000;
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    touch-action: manipulation;
}

body:fullscreen {
    background: #000;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #fff;
    opacity: 0;
    transition: opacity 0.3s ease, background-color 0.3s ease;
    z-index: 1;
    touch-action: none;
    pointer-events: none;
}

.container {
    width: 100%;
    position: fixed;
    bottom: 0;
    left: 0;
    padding: 20px;
    z-index: 2;
    background: transparent;
    touch-action: none;
}

.control-panel {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px 24px 0 0;
    padding: 24px;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.2);
    max-width: 600px;
    margin: 0 auto;
    touch-action: none;
}

.fullscreen-button {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 3;
    transition: all 0.3s ease;
}

body:not(:fullscreen) .fullscreen-button {
    position: absolute;
    top: -40px;
    right: 20px;
}

#fullscreenBtn {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    color: var(--text-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    padding: 0;
}

#fullscreenBtn:hover {
    background: rgba(255, 255, 255, 0.2);
}

#fullscreenBtn:active {
    transform: scale(0.95);
}

.fullscreen-icon {
    width: 24px;
    height: 24px;
    fill: var(--text-color);
}

.fullscreen-enter,
.fullscreen-exit {
    transition: opacity 0.3s ease;
}

body:not(:fullscreen) .fullscreen-exit {
    display: none;
}

body:fullscreen .fullscreen-enter {
    display: none;
}

.control-group {
    margin-bottom: 32px;
    padding: 0 16px;
    touch-action: none;
}

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

label {
    display: block;
    margin-bottom: 12px;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-color);
    user-select: none;
}

.slider-container {
    position: relative;
    padding: 8px 0;
    touch-action: none;
}

input[type="range"] {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
    touch-action: none;
    margin: 20px 0;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 32px;
    height: 32px;
    background: #ffffff;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

input[type="range"]::-webkit-slider-thumb:hover,
input[type="range"]::-webkit-slider-thumb:active {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Firefox支持 */
input[type="range"]::-moz-range-thumb {
    width: 32px;
    height: 32px;
    background: #ffffff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

input[type="range"]::-moz-range-track {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.slider-value {
    position: absolute;
    right: 0;
    top: -28px;
    font-size: 14px;
    color: var(--text-color);
    opacity: 0.8;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px 8px;
    border-radius: 12px;
    user-select: none;
}

.mode-buttons {
    display: flex;
    gap: 20px;
    padding: 20px;
    justify-content: center;
}

.mode-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

.mode-btn .icon {
    font-size: 24px;
}

.mode-btn.active {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

.timer-display {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}

.control-item {
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 25px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    touch-action: none;
}

.control-item .icon {
    font-size: 24px;
    min-width: 32px;
    text-align: center;
}

.control-item .value {
    min-width: 70px;
    text-align: right;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
}

/* 安卓特定优化 */
@media (max-width: 480px) {
    .container {
        padding: 16px;
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
    }
    
    .control-panel {
        padding: 20px;
        border-radius: 20px 20px 0 0;
    }

    .control-group {
        padding: 0 8px;
    }

    input[type="range"]::-webkit-slider-thumb {
        width: 36px;
        height: 36px;
    }
    
    input[type="range"]::-moz-range-thumb {
        width: 36px;
        height: 36px;
    }
    
    .control-item {
        margin: 20px;
        padding: 18px;
    }

    .control-item .icon {
        font-size: 28px;
        min-width: 36px;
    }

    .control-item .value {
        font-size: 18px;
        min-width: 80px;
    }

    input[type="range"] {
        height: 10px;
        margin: 25px 0;
    }

    input[type="range"]::-moz-range-track {
        height: 10px;
    }

    .fullscreen-button {
        top: 16px;
        right: 16px;
    }

    body:not(:fullscreen) .fullscreen-button {
        top: -36px;
        right: 16px;
    }

    #fullscreenBtn {
        width: 36px;
        height: 36px;
    }

    .fullscreen-icon {
        width: 20px;
        height: 20px;
    }

    .mode-buttons {
        flex-wrap: wrap;
        gap: 8px;
    }

    .mode-btn {
        flex: 1 1 calc(50% - 4px);
        padding: 8px;
        font-size: 12px;
    }

    .mode-icon {
        font-size: 16px;
        margin-bottom: 2px;
    }
}

/* 防止iOS橡皮筋效果 */
html, body {
    position: fixed;
    width: 100%;
    height: 100%;
    overflow: hidden;
} 