@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;
}

/* 控制面板 */
.control-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg,
        rgba(250, 243, 235, 0.98) 0%,
        rgba(253, 246, 227, 0.95) 100%);
    backdrop-filter: blur(10px);
    padding: 24px 20px;
    z-index: 1000;
    box-shadow:
        0 8px 32px var(--color-shadow),
        0 0 0 1px rgba(255, 165, 89, 0.1) inset;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    border-bottom: 3px solid var(--color-orange);
    position: relative;
}

/* 顶部装饰线 */
.control-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--color-coral), var(--color-amber), var(--color-coral));
    border-radius: 0 0 3px 3px;
}

.control-panel.hidden {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}

.control-header h1 {
    font-family: var(--font-serif);
    font-size: 26px;
    text-align: center;
    margin-bottom: 20px;
    color: var(--color-brown);
    font-weight: 600;
    letter-spacing: 0.05em;
    position: relative;
    display: inline-block;
    width: 100%;
}

.control-header h1::after {
    content: '🎵';
    position: absolute;
    right: calc(50% - 90px);
    top: 50%;
    transform: translateY(-50%);
    font-size: 22px;
}

/* 上传区域 */
.upload-section {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
    flex-wrap: wrap;
    justify-content: center;
}

.upload-btn {
    background: linear-gradient(135deg, var(--color-coral) 0%, var(--color-coral-light) 100%);
    color: white;
    padding: 14px 28px;
    border-radius: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    font-size: 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 4px 12px rgba(255, 107, 107, 0.25),
        0 0 0 1px rgba(255, 107, 107, 0.1) inset;
    position: relative;
    overflow: hidden;
}

.upload-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.upload-btn:hover::before {
    left: 100%;
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 20px rgba(255, 107, 107, 0.35),
        0 0 0 1px rgba(255, 107, 107, 0.2) inset;
}

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

.upload-btn input[type="file"] {
    display: none;
}

.file-count {
    color: var(--color-brown-pale);
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    background: rgba(255, 165, 89, 0.15);
    border-radius: 8px;
}

/* 按钮组 */
.controls {
    display: flex;
    gap: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn {
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 110px;
    justify-content: center;
    font-family: var(--font-sans);
    position: relative;
    overflow: hidden;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--color-orange) 0%, var(--color-amber) 100%);
    color: white;
    box-shadow:
        0 4px 12px rgba(255, 165, 89, 0.3),
        0 0 0 1px rgba(255, 165, 89, 0.1) inset;
}

.btn-primary:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 20px rgba(255, 165, 89, 0.4),
        0 0 0 1px rgba(255, 165, 89, 0.2) inset;
}

.btn-secondary {
    background: linear-gradient(135deg, var(--color-warm-white) 0%, var(--color-peach) 100%);
    color: var(--color-brown);
    box-shadow:
        0 2px 8px rgba(74, 55, 40, 0.08),
        0 0 0 1px rgba(255, 165, 89, 0.2) inset;
}

.btn-secondary:not(:disabled):hover {
    background: linear-gradient(135deg, var(--color-peach) 0%, var(--color-orange) 100%);
    transform: translateY(-2px);
    box-shadow:
        0 4px 12px rgba(255, 165, 89, 0.2),
        0 0 0 1px rgba(255, 165, 89, 0.3) inset;
}

.btn-icon {
    font-size: 18px;
}

/* 速度控制 */
.speed-control {
    background: linear-gradient(135deg,
        rgba(255, 165, 89, 0.08) 0%,
        rgba(255, 107, 107, 0.05) 100%);
    padding: 18px;
    border-radius: 16px;
    border: 1px solid rgba(255, 165, 89, 0.2);
    box-shadow: 0 2px 8px rgba(74, 55, 40, 0.05) inset;
}

.speed-control label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    color: var(--color-brown-light);
    font-weight: 500;
    font-size: 14px;
}

#speedValue {
    color: var(--color-coral);
    font-weight: 600;
    font-size: 16px;
    padding: 4px 12px;
    background: rgba(255, 107, 107, 0.15);
    border-radius: 8px;
}

#speedSlider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(90deg,
        rgba(255, 165, 89, 0.2) 0%,
        rgba(255, 107, 107, 0.2) 100%);
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

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

#speedSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-coral) 0%, var(--color-amber) 100%);
    cursor: pointer;
    transition: transform 0.2s;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.4);
    border: 3px solid white;
}

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

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

#speedSlider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-coral) 0%, var(--color-amber) 100%);
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.4);
    transition: transform 0.2s;
}

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

/* 提示信息 */
.hint {
    text-align: center;
    margin-top: 14px;
    color: var(--color-brown-pale);
    font-size: 13px;
    font-weight: 500;
}

.hint p {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(255, 179, 71, 0.15);
    border-radius: 20px;
}

/* 曲谱容器 */
.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: 120px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    transition: transform 0.016s linear, padding-top 0.3s ease;
    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);
}

/* 响应式 */
@media (max-width: 768px) {
    .control-header h1 {
        font-size: 22px;
    }

    .control-header h1::after {
        right: calc(50% - 75px);
        font-size: 18px;
    }

    .btn {
        min-width: 90px;
        padding: 12px 18px;
        font-size: 14px;
    }

    .controls {
        gap: 10px;
    }

    .upload-section {
        flex-direction: column;
        gap: 12px;
    }

    .control-panel {
        padding: 20px 16px;
    }
}
