/**
 * 音乐播放器移动端样式
 * Mobile Styles for Music Player
 */

/* ========================================
   移动端基础样式 (max-width: 768px)
   ======================================== */
@media (max-width: 768px) {
    :root {
        --player-height: 120px;
    }

    /* 导航栏 */
    .navbar {
        padding: 0.5rem 0;
    }
    .navbar .container {
        padding: 0 0.75rem;
    }
    .navbar-brand {
        font-size: 1rem;
        gap: 0.375rem;
    }
    .navbar-brand i {
        font-size: 1.1rem;
    }
    .nav-actions {
        gap: 0.35rem;
    }
    .nav-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.15rem;
        padding: 0.4rem 0.5rem;
        font-size: 0.6rem;
        border-radius: 8px;
        min-width: 48px;
    }
    .nav-btn i {
        font-size: 1.1rem;
    }
    .nav-btn span {
        display: block;
        font-size: 0.6rem;
    }

    /* 主容器 */
    .main-container {
        padding: 0.75rem;
        padding-bottom: calc(var(--player-height) + 1rem);
    }

    /* 搜索栏 */
    .search-panel {
        padding: 0.75rem;
        border-radius: 12px;
    }
    .search-bar {
        border-radius: 10px;
    }
    .search-bar-inner {
        flex-direction: column;
    }
    .platform-select {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        width: 100%;
        padding: 0.6rem 0.75rem;
        font-size: 0.85rem;
    }
    .search-input-box {
        padding: 0 0.5rem;
        width: 100%;
    }
    .search-input-box input {
        padding: 0.6rem 0;
        font-size: 0.9rem;
    }
    .search-btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
        border-radius: 0 0 10px 0;
    }

    /* 搜索建议 */
    .search-suggest {
        max-height: 50vh;
        border-radius: 0 0 10px 10px;
    }
    .suggest-item, .hot-item {
        padding: 0.6rem 0.75rem;
        font-size: 0.85rem;
    }
    .hot-rank {
        width: 20px;
        height: 20px;
        font-size: 0.7rem;
    }

    /* 结果区域 */
    .result-section {
        border-radius: 10px;
        margin-top: 0.75rem;
    }
    .result-header {
        padding: 0.6rem 0.75rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .result-title {
        font-size: 0.9rem;
    }
    .result-actions {
        width: 100%;
        justify-content: flex-start;
        gap: 0.5rem;
    }
    .action-btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
        flex: 1;
        justify-content: center;
    }

    /* 歌曲列表 */
    .songs-container {
        max-height: calc(100vh - 350px);
    }
    .song-item {
        padding: 0.6rem 0.75rem;
        grid-template-columns: 40px 1fr auto;
        gap: 0.6rem;
    }
    .song-cover {
        width: 40px;
        height: 40px;
        border-radius: 6px;
    }
    .song-name {
        font-size: 0.85rem;
        line-height: 1.3;
    }
    .song-artist {
        font-size: 0.7rem;
    }
    .song-duration {
        font-size: 0.7rem;
        min-width: 35px;
    }
    .song-actions {
        opacity: 1;
        gap: 0.2rem;
    }
    .song-action-btn {
        width: 26px;
        height: 26px;
        font-size: 0.7rem;
    }

    /* MV 标签 */
    .mv-tag {
        padding: 0.08rem 0.3rem;
        font-size: 0.55rem;
        margin-left: 0.3rem;
    }

    /* 分页 */
    .pagination {
        padding: 0.5rem;
        gap: 0.25rem;
    }
    .pagination button {
        padding: 0.35rem 0.5rem;
        min-width: 28px;
        font-size: 0.7rem;
    }
    .page-info {
        font-size: 0.7rem;
    }

    /* 空状态 */
    .empty-state {
        padding: 2.5rem 1rem;
    }
    .empty-state i {
        font-size: 2.5rem;
    }
    .empty-state h3 {
        font-size: 1rem;
    }
    .empty-state p {
        font-size: 0.8rem;
    }

    /* 底部播放器 */
    .bottom-player {
        display: flex;
        flex-direction: column;
        height: auto;
        padding: 0.5rem 0.75rem 0.625rem;
        gap: 0.4rem;
    }
    .player-left {
        display: none;
    }
    .player-center {
        order: 2;
        max-width: 100%;
        gap: 0.3rem;
    }
    .player-controls {
        gap: 1rem;
    }
    .ctrl-btn {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
    .ctrl-btn.play-btn {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }
    .progress-wrapper {
        gap: 0.4rem;
    }
    .progress-bar {
        height: 4px;
    }
    .time-label {
        font-size: 0.65rem;
        min-width: 32px;
    }

    /* 播放器右侧 */
    .player-right {
        order: 1;
        justify-content: space-between;
        width: 100%;
        padding-bottom: 0.3rem;
        border-bottom: 1px solid var(--border-color);
        margin-bottom: 0.2rem;
    }
    .player-right::before {
        content: attr(data-title);
        font-size: 0.85rem;
        font-weight: 500;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        flex: 1;
        margin-right: 0.5rem;
        color: var(--text-primary);
    }
    .volume-wrap {
        display: none;
    }
    .like-btn {
        width: 28px;
        height: 28px;
    }
    .speed-btn {
        padding: 0.2rem 0.4rem;
        font-size: 0.65rem;
    }
    .speed-dropdown {
        min-width: 70px;
    }
    .speed-option {
        padding: 0.4rem 0.75rem;
        font-size: 0.75rem;
    }
    .quality-btn {
        padding: 0.3rem 0.4rem;
    }
    .quality-btn span {
        display: none;
    }
    .quality-dropdown {
        right: auto;
        left: 0;
        min-width: 120px;
    }

    /* 歌词显示 */
    .lyric-overlay {
        bottom: calc(var(--player-height) + 15px);
        padding: 0.4rem 1rem;
        max-width: 92%;
    }
    .lyric-current {
        font-size: 1.1rem;
    }
    .lyric-next {
        font-size: 0.75rem;
    }

    /* 歌词弹窗 */
    .lyric-modal {
        width: 100%;
        max-width: 100%;
        border-radius: 16px 16px 0 0;
        max-height: 55vh;
    }
    .lyric-modal-header {
        padding: 0.75rem 1rem;
    }
    .lyric-modal-content {
        height: 280px;
        padding: 0.75rem;
    }
    .lyric-line {
        font-size: 0.9rem;
        padding: 0.5rem 0;
    }
    .lyric-line.active {
        font-size: 1rem;
    }

    /* 播放列表弹窗 */
    .playlist-modal {
        width: 100%;
        right: 0;
        border-left: none;
        border-radius: 16px 0 0 0;
    }
    .playlist-modal-header {
        padding: 0.75rem 1rem;
    }
    .playlist-modal-content {
        max-height: calc(100vh - var(--player-height) - 100px);
    }

    /* MV 弹窗 */
    .mv-modal {
        width: 95%;
        max-width: none;
    }
    .mv-modal-header {
        padding: 0.75rem 1rem;
    }
    .mv-modal-title {
        font-size: 0.95rem;
    }
    .mv-modal-content {
        min-height: 200px;
    }
    .mv-modal-content video {
        min-height: 200px;
    }

    /* 均衡器弹窗 */
    .eq-modal {
        width: 95%;
        max-width: none;
    }
    .eq-modal-content {
        padding: 1rem;
    }
    .eq-presets {
        gap: 0.4rem;
        margin-bottom: 1rem;
    }
    .eq-preset {
        padding: 0.4rem 0.75rem;
        font-size: 0.75rem;
    }
    .eq-slider-item {
        gap: 0.75rem;
    }
    .eq-slider-item span:first-child {
        width: 45px;
        font-size: 0.7rem;
    }
    .eq-value {
        width: 40px;
        font-size: 0.7rem;
    }

    /* Toast */
    .toast-container {
        top: auto;
        bottom: calc(var(--player-height) + 15px);
        right: 0.75rem;
        left: 0.75rem;
    }
    .toast {
        max-width: 100%;
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
    }

    /* 发现/排行榜/歌手 */
    .discover-container,
    .ranking-container,
    .artist-container {
        padding: 0.5rem 0.75rem;
    }
    .discover-section-title,
    .ranking-section-title {
        font-size: 0.95rem;
        margin-bottom: 0.75rem;
    }
    .discover-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 0.6rem;
    }
    .card-item {
        border-radius: 8px;
    }
    .card-item-cover {
        height: 100px;
    }
    .card-item-info {
        padding: 0.4rem 0.5rem;
    }
    .card-item-title {
        font-size: 0.75rem;
    }
    .card-item-subtitle {
        font-size: 0.65rem;
    }

    /* 歌手容器 */
    .artist-container {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 0.5rem !important;
        padding: 0.5rem !important;
    }
    
    /* 歌手卡片 */
    .artist-card {
        padding: 0.5rem;
        background: var(--bg-card);
        border-radius: 10px;
    }
    .artist-card .card-item-cover {
        width: 60px;
        height: 60px;
        margin: 0 auto 0.4rem;
    }
    .artist-card .card-item-info {
        padding: 0.25rem;
    }
    .artist-card .card-item-title {
        font-size: 0.7rem;
    }
    .artist-avatar {
        width: 50px;
        height: 50px;
    }
    .artist-name {
        font-size: 0.75rem;
    }

    /* 排行榜详情 */
    .ranking-detail-modal {
        width: 100%;
        max-width: 100%;
        height: 85vh;
        border-radius: 16px 16px 0 0;
    }
    .ranking-detail-header {
        padding: 0.75rem 1rem;
    }
    .ranking-detail-cover {
        width: 60px;
        height: 60px;
    }
    .ranking-detail-name {
        font-size: 1rem;
    }

    /* 歌手详情 */
    .artist-detail-modal {
        width: 100%;
        max-width: 100%;
        height: 85vh;
        border-radius: 16px 16px 0 0;
    }
    .artist-detail-header {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    .artist-detail-avatar {
        width: 60px;
        height: 60px;
    }
    .artist-detail-name {
        font-size: 1rem;
    }

    /* 歌单 */
    .mylist-item {
        padding: 0.6rem 0.75rem;
    }
    .mylist-cover {
        width: 48px;
        height: 48px;
    }
    .mylist-name {
        font-size: 0.85rem;
    }
    .mylist-count {
        font-size: 0.7rem;
    }

    /* 添加到歌单弹窗 */
    .add-to-mylist-modal {
        width: 90%;
        max-width: 320px;
    }
    .add-to-mylist-header {
        padding: 0.75rem 1rem;
    }

    /* 平台选择 */
    .platform-tabs {
        gap: 0.3rem;
        padding: 0.5rem;
        flex-wrap: wrap;
    }
    .platform-tab {
        padding: 0.35rem 0.6rem;
        font-size: 0.75rem;
    }
}

/* ========================================
   超小屏幕 (max-width: 480px)
   ======================================== */
@media (max-width: 480px) {
    :root {
        --player-height: 115px;
    }

    .navbar-brand {
        font-size: 0.9rem;
    }
    .nav-btn {
        padding: 0.35rem 0.5rem;
    }

    .search-panel {
        padding: 0.5rem;
    }
    .platform-select {
        padding: 0.5rem 0.6rem;
        font-size: 0.8rem;
    }
    .search-input-box input {
        font-size: 0.85rem;
    }
    .search-btn {
        padding: 0.5rem 0.75rem;
    }

    .result-header {
        padding: 0.5rem 0.6rem;
    }
    .action-btn {
        padding: 0.35rem 0.5rem;
        font-size: 0.7rem;
    }

    .song-item {
        padding: 0.5rem 0.6rem;
        grid-template-columns: 36px 1fr auto;
    }
    .song-cover {
        width: 36px;
        height: 36px;
    }
    .song-name {
        font-size: 0.8rem;
    }
    .song-actions {
        gap: 0.15rem;
    }
    .song-action-btn {
        width: 24px;
        height: 24px;
        font-size: 0.65rem;
    }

    .discover-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
    .card-item-cover {
        height: 90px;
    }
    .card-item-title {
        font-size: 0.7rem;
    }

    .ctrl-btn {
        width: 30px;
        height: 30px;
    }
    .ctrl-btn.play-btn {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    .player-controls {
        gap: 0.75rem;
    }

    .lyric-current {
        font-size: 1rem;
    }
    .lyric-next {
        font-size: 0.7rem;
    }
}

/* ========================================
   横屏模式优化
   ======================================== */
@media (max-width: 768px) and (orientation: landscape) {
    :root {
        --player-height: 80px;
    }

    .main-container {
        padding-bottom: calc(var(--player-height) + 0.5rem);
    }

    .bottom-player {
        flex-direction: row;
        align-items: center;
        padding: 0.4rem 1rem;
    }
    .player-left {
        display: flex;
        flex: 0 0 auto;
    }
    .player-cover {
        width: 50px;
        height: 50px;
    }
    .player-info {
        max-width: 120px;
    }
    .player-center {
        order: 0;
        flex: 1;
    }
    .player-right {
        order: 0;
        width: auto;
        border-bottom: none;
        padding-bottom: 0;
    }
    .player-right::before {
        display: none;
    }

    .songs-container {
        max-height: calc(100vh - 200px);
    }

    .lyric-modal {
        max-height: 70vh;
    }
    .playlist-modal {
        width: 50%;
    }
}

/* ========================================
   触摸优化
   ======================================== */
@media (hover: none) and (pointer: coarse) {
    /* 增大点击区域 */
    .song-item {
        min-height: 56px;
    }
    .song-action-btn {
        min-width: 32px;
        min-height: 32px;
    }
    .ctrl-btn {
        min-width: 36px;
        min-height: 36px;
    }
    .nav-btn {
        min-height: 36px;
    }

    /* 禁用 hover 效果 */
    .song-actions {
        opacity: 1;
    }
    .speed-dropdown {
        display: none;
    }
    .speed-selector.active .speed-dropdown {
        display: block;
    }
}
