@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;600;700&family=Noto+Sans+SC:wght@400;500;600&display=swap');

:root {
    /* 暖色调配色方案 */
    --color-cream: #FDF6E3;
    --color-warm-white: #FAF3EB;
    --color-peach: #FFD4A3;
    --color-orange: #FFA559;
    --color-coral: #FF6B6B;
    --color-coral-light: #FF8787;
    --color-amber: #FFB347;
    --color-brown: #4A3728;
    --color-brown-light: #5D4E37;
    --color-brown-pale: #8B7355;
    --color-shadow: rgba(74, 55, 40, 0.15);

    /* 字体 */
    --font-serif: 'Noto Serif SC', serif;
    --font-sans: 'Noto Sans SC', sans-serif;
}

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

body {
    font-family: var(--font-sans);
    background: var(--color-cream);
    background-image:
        linear-gradient(135deg, rgba(255, 165, 89, 0.03) 0%, transparent 50%),
        linear-gradient(225deg, rgba(255, 107, 107, 0.03) 0%, transparent 50%);
    color: var(--color-brown);
    overflow: hidden;
    height: 100vh;
    position: relative;
}

/* 温暖的纸质纹理背景 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.02;
    pointer-events: none;
    z-index: 0;
}

/* 曲谱容器 */
.score-container {
    height: 100vh;
    overflow: hidden;
    background: linear-gradient(180deg,
        rgba(253, 246, 227, 0.5) 0%,
        rgba(250, 243, 235, 0.8) 100%);
    cursor: pointer;
    user-select: none;
    position: relative;
}

/* 音乐元素装饰背景 */
.score-container::before {
    content: '♪♫♩♬';
    position: absolute;
    top: 20%;
    left: 5%;
    font-size: 120px;
    color: rgba(255, 165, 89, 0.03);
    font-family: var(--font-serif);
    pointer-events: none;
    z-index: 0;
}

.score-container::after {
    content: '♭♯♮';
    position: absolute;
    bottom: 15%;
    right: 5%;
    font-size: 100px;
    color: rgba(255, 107, 107, 0.03);
    font-family: var(--font-serif);
    pointer-events: none;
    z-index: 0;
}

.score-content {
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    transition: transform 0.016s linear;
    will-change: transform;
    position: relative;
    z-index: 1;
}

.score-content img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(74, 55, 40, 0.12);
    background: white;
    padding: 8px;
}

/* 空状态 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 60vh;
    color: var(--color-brown-pale);
    animation: fadeInUp 0.6s ease-out;
}

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

.empty-icon {
    font-size: 72px;
    margin-bottom: 24px;
    opacity: 0.6;
    filter: drop-shadow(0 4px 8px rgba(255, 165, 89, 0.2));
    animation: float 3s ease-in-out infinite;
}

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

.empty-state p {
    font-size: 18px;
    font-weight: 500;
    color: var(--color-brown-light);
}

/* ========== 控制面板（透明浮层） ========== */
.control-panel {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(74, 55, 40, 0.85);
    backdrop-filter: blur(12px);
    padding: 16px 24px;
    border-radius: 20px;
    z-index: 1000;
    box-shadow:
        0 8px 32px rgba(74, 55, 40, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    transition: opacity 0.3s ease, transform 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.control-panel.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(20px);
}

/* 隐藏文件输入 */
#imageUpload {
    display: none;
}

/* 按钮组 */
.btn-group {
    display: flex;
    gap: 12px;
    align-items: center;
}

.control-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.control-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(0.5);
}

.control-btn .btn-icon {
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 上传按钮 */
.upload-btn {
    background: linear-gradient(135deg, var(--color-coral) 0%, var(--color-coral-light) 100%);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

.upload-btn:not(:disabled):hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(255, 107, 107, 0.5);
}

/* 播放按钮 */
.play-btn {
    background: linear-gradient(135deg, var(--color-orange) 0%, var(--color-amber) 100%);
    box-shadow: 0 4px 12px rgba(255, 165, 89, 0.4);
}

.play-btn:not(:disabled):hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(255, 165, 89, 0.5);
}

/* 重置按钮 */
.reset-btn {
    background: linear-gradient(135deg, var(--color-warm-white) 0%, var(--color-peach) 100%);
    box-shadow: 0 4px 12px rgba(74, 55, 40, 0.2);
}

.reset-btn:not(:disabled):hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(74, 55, 40, 0.3);
}

/* 速度控制 */
.speed-control {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 12px;
}

#speedSlider {
    width: 120px;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

#speedSlider::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(90deg,
        var(--color-orange) 0%,
        var(--color-coral) 50%,
        var(--color-amber) 100%);
}

#speedSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    transition: transform 0.2s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

#speedSlider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

#speedSlider::-moz-range-track {
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(90deg,
        var(--color-orange) 0%,
        var(--color-coral) 50%,
        var(--color-amber) 100%);
}

#speedSlider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s;
}

#speedSlider::-moz-range-thumb:hover {
    transform: scale(1.2);
}

#speedValue {
    color: white;
    font-weight: 600;
    font-size: 14px;
    min-width: 45px;
    text-align: center;
}

/* 文件计数 */
.file-count {
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    font-weight: 500;
}

/* 响应式 */
@media (max-width: 768px) {
    .control-panel {
        bottom: 20px;
        padding: 14px 20px;
    }

    .control-btn {
        width: 48px;
        height: 48px;
    }

    .control-btn .btn-icon {
        font-size: 20px;
    }

    #speedSlider {
        width: 100px;
    }

    .speed-control {
        padding: 6px 14px;
    }
}
