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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 标题样式 */
.header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header h1 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 10px;
}

.header p {
    font-size: 1.1rem;
    color: #7f8c8d;
}

/* 字母导航栏样式 */
.letter-nav {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    padding: 15px;
}

.letter-container {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #888 #f1f1f1;
}

.letter-container::-webkit-scrollbar {
    height: 8px;
}

.letter-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.letter-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.letter-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.letter-btn {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border: none;
    background-color: #ecf0f1;
    color: #2c3e50;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.letter-btn:hover {
    background-color: #3498db;
    color: white;
    transform: scale(1.1);
}

.letter-btn.active {
    background-color: #2980b9;
    color: white;
}

/* 单词列表区域样式 */
.word-list-section {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    padding: 20px;
}

#current-letter-display {
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ecf0f1;
}

.word-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.word-item {
    padding: 15px;
    background-color: #ecf0f1;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 500;
    border: 2px solid transparent;
}

.word-item:hover {
    background-color: #3498db;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.word-item.playing {
    background-color: #27ae60;
    color: white;
    border-color: #27ae60;
}

/* 播放器区域样式 */
.player-section {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

/* 当前播放信息 */
.now-playing {
    text-align: center;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 6px;
}

#current-word {
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 5px;
}

#current-definition {
    font-size: 1rem;
    color: #7f8c8d;
}

/* 播放控制栏 */
.player-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 6px;
}

/* 控制按钮基础样式 */
.control-btn {
    width: 80px;
    height: 40px;
    border: none;
    background-color: #3498db;
    color: white;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* 确保播放和声音按钮大小完全一致 */
#play-pause-btn, #volume-btn {
    width: 80px;
    height: 40px;
}

.control-btn:hover {
    background-color: #2980b9;
    transform: scale(1.05);
}

/* 播放按钮特定样式 */
.play-btn {
    /* 播放按钮特定样式 */
}

/* 音量按钮特定样式 */
.volume-btn {
    /* 音量按钮特定样式 */
}

/* 进度条容器 */
.progress-container {
    flex: 1;
    min-width: 150px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background-color: #ddd;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
}

.progress {
    height: 100%;
    width: 0%;
    background-color: #3498db;
    border-radius: 4px;
    transition: width 0.1s ease;
}

.currentTime, .duration {
    font-size: 0.9rem;
    color: #666;
    min-width: 45px;
    text-align: center;
}

/* 音量控制容器 */
.volume-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.volume-slider-container {
    width: 100px;
}

#volume-slider {
    width: 100%;
    height: 6px;
    background: #ddd;
    outline: none;
    opacity: 0.7;
    transition: opacity 0.2s;
    border-radius: 3px;
}

#volume-slider:hover {
    opacity: 1;
}

/* 歌词区域 */
:root {
    --current-bg-image: url('/images/background1.svg');
    --bg-opacity: 0.5;
}

.lyrics-container {
    height: 400px;
    overflow: hidden;
    position: relative;
    background-color: #f8f9fa;
    border-radius: 6px;
    padding: 15px;
}

/* 背景图片容器 */
.lyrics-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: var(--current-bg-image);
    background-size: cover;
    background-position: center;
    opacity: var(--bg-opacity);
    z-index: 1;
    transition: opacity 1s ease-in-out;
}

.lyrics-wrapper {
    position: relative;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2;
    transition: transform 0.3s ease;
}

.lyrics-list {
    list-style: none;
    text-align: center;
    padding: 10px;
}

.lyrics-item {
    padding: 8px 0;
    font-size: 1.1rem;
    color: #666;
    transition: all 0.3s ease;
    line-height: 1.8;
    margin-bottom: 10px;
}

.lyrics-item.active {
    color: #3498db;
    font-size: 1.3rem;
    font-weight: bold;
    transform: scale(1.05);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .header h1 {
        font-size: 2rem;
    }

    .player-controls {
        flex-direction: row;
        gap: 10px;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
        position: relative;
    }

    .player-controls > #play-pause-btn {
        order: 1;
        flex-shrink: 0;
    }

    .player-controls > .progress-container {
        order: 2;
        flex: 1;
        min-width: 150px;
        justify-content: center;
    }

    .player-controls > .volume-container {
        order: 3;
        flex-shrink: 0;
        justify-content: center;
        align-items: center;
    }

    /* 确保音量控制容器内的按钮居中对齐 */
    .volume-container {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    /* 为音量按钮提供独立的容器以确保精确对齐 */
    .volume-btn-container {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .control-btn {
        width: 80px;
        height: 40px;
        font-size: 1rem;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    /* 确保在手机模式下播放和声音按钮大小完全一致 */
    #play-pause-btn, #volume-btn {
        width: 80px;
        height: 40px;
    }

    .volume-slider-container {
        width: 150px;
    }

    .word-list {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .lyrics-container {
        height: 360px;
    }

    .lyrics-item {
        font-size: 1rem;
    }

    .lyrics-item.active {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.8rem;
    }

    .letter-btn {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }

    .word-list {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .word-item {
        padding: 10px;
        font-size: 1rem;
    }

    #current-word {
        font-size: 1.5rem;
    }
}