@media screen and (max-width: 768px) {
    .main-container {
        margin-left: 0;
        padding: 20px;
        padding-bottom: 200px;
    }

    .search-container {
        flex-direction: column;
        padding: 16px;
    }

    .quality-selector {
        width: 100%;
        justify-content: center;
    }

    .search-box {
        width: 100%;
    }

    .results {
        grid-template-columns: 1fr;
    }

    .player-main {
        grid-template-columns: 1fr;
        gap: 16px;
        text-align: center;
    }

    .player-info {
        order: -1;
        align-items: center;
    }

    .lyrics-container {
        bottom: 180px;
        height: 80px;
    }

    .lyrics-line {
        font-size: 13px;
    }

    .lyrics-line.active {
        font-size: 15px;
    }

    .sidebar-toggle {
        display: flex;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .player-right-controls {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .volume-control {
        width: 100%;
        justify-content: center;
    }

    /* 搜索结果页面布局 */
    .results-container {
        height: calc(100vh - 81px);
        display: flex;
        flex-direction: column;
    }
    
    /* 搜索结果列表 */
    .results-list {
        padding: 10px;
        max-height: 50vh;
        overflow-y: auto;
        border-right: none;
        border-bottom: 1px solid var(--glass-border);
    }
    
    /* 播放器区域 */
    .player-section {
        padding: 15px;
    }
    
    /* 控制按钮 */
    .control-buttons {
        gap: 16px;
    }
    
    .control-button,
    #playPauseBtn {
        width: 48px;
        height: 48px;
    }
    
    /* 歌词显示区 */
    .lyrics-display {
        max-height: 30vh;
        padding: 20px 10px;
    }
    
    /* 搜索结果卡片 */
    .song-card {
        padding: 12px;
        margin-bottom: 8px;
    }
    
    /* 播放器控制器 */
    .player-main {
        grid-template-columns: 1fr;
        gap: 16px;
        text-align: center;
    }
    
    .player-info {
        padding-right: 0;
    }
    
    .player-right-controls {
        justify-content: center;
    }
    
    /* 设备方向切换处理 */
    @media (orientation: landscape) {
        .results-container {
            flex-direction: row;
            height: calc(100vh - 60px);
        }
        
        .results-list {
            width: 50%;
            max-height: none;
            border-right: 1px solid var(--glass-border);
            border-bottom: none;
        }
        
        .player-section {
            width: 50%;
        }
    }
}

/* 桌面端隐藏移动端元素 */
@media screen and (min-width: 769px) {
    .sidebar-toggle {
        display: none;
    }

    .sidebar-overlay {
        display: none;
    }
}

/* 安全区域适配 */
@supports (padding: env(safe-area-inset-bottom)) {
    @media screen and (max-width: 768px) {
        .player-container {
            padding-bottom: calc(20px + env(safe-area-inset-bottom));
        }

        .main-container {
            padding-top: calc(20px + env(safe-area-inset-top));
            padding-bottom: calc(200px + env(safe-area-inset-bottom));
        }
    }
}

/* 触摸设备优化 */
@media (hover: none) {
    .song-card:active {
        background: var(--bg-card-hover);
        transform: scale(0.98);
    }
    
    .control-button:active,
    #playPauseBtn:active {
        transform: scale(0.9);
        opacity: 0.8;
    }
} 