/* 移动端适配样式 */

/* 基础断点设置 */
@media (max-width: 1240px) {
    .box, .kbox, .headcont, .searchbox {
        width: 95%;
        max-width: 95%;
    }
}

/* 平板适配 (768px - 1024px) */
@media (max-width: 1024px) {
    .box, .kbox, .headcont, .searchbox {
        width: 95%;
        margin-left: auto;
        margin-right: auto;
    }
    
    .left {
        width: 300px;
    }
    
    .detailtop {
        flex-direction: column;
        align-items: flex-start;
        padding: 15px;
    }
    
    .coverbox {
        width: 200px;
        height: 200px;
        align-self: center;
        margin-bottom: 20px;
    }
    
    .detailright {
        margin-left: 0;
        height: auto;
        width: 100%;
    }
    
    .detailbtn {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .detailbtn a {
        margin-right: 0;
        margin-bottom: 10px;
        min-width: 120px;
    }
}

/* 手机端适配 (最大768px) */
@media (max-width: 768px) {
    /* 基础布局 */
    body {
        font-size: 13px;
    }
    .footercont{ padding: 0 20px;}
    .footer{ margin-top: 15px;}
    .box {
        flex-direction: column;
        width: 95%;
        margin: 10px auto 0 auto;
    }
    
    .left {
        width: 100%;
        margin-bottom: 15px;
        padding: 12px;
    }
    
    .right {
        margin-left: 0;
        width: 100%;
        padding: 12px;
    }
    
    .kbox {
        width: 95%;
        margin: 15px auto;
        padding: 12px;
    }
    
    /* 头部适配 */
    .headbox {
        height: 60px;
    }
    
    .headcont {
        height: 60px;
        width: 95%;
        padding: 0 15px;
    }
    
    img.logo {
        width: 80px;
    }
    
    .topright {
        flex-wrap: wrap;
    }
    
    .topright a {
        margin-left: 5px;
        height: 28px;
        padding: 0 10px;
        font-size: 12px;
    }
    
    /* 搜索框适配 */
    .searchbox {
        width: 95%;
        margin: 10px auto 0 auto;
        padding: 12px;
    }
    
    .searchbox form {
        flex-direction: column;
        gap: 10px;
    }
    
    .searchleftcont {
        height: 42px;
        width: 100%;
        margin-bottom: 10px;
    }
    
    .searchleftcont input {
        font-size: 16px; /* 防止iOS缩放 */
        height: 42px;
    }
    
    .searchrightbtn {
        height: 42px;
        width: 100%;
        margin-left: 0;
        font-size: 14px;
        border: none;
        cursor: pointer;
    }
    
    /* 详情页适配 */
    .detailtop {
        flex-direction: column;
        padding: 10px;
        text-align: center;
    }
    
    .coverbox {
        width: 180px;
        height: 180px;
        margin: 0 auto 15px auto;
        position: relative;
    }
    
    .detailright {
        margin-left: 0;
        height: auto;
        width: 100%;
        text-align: center;
    }
    
    .musicinfo h1 {
        font-size: 20px;
    }
    
    .musicinfo p {
        margin-top: 8px;
        font-size: 13px;
    }
    
    .detailbtn {
        flex-direction: column;
        align-items: center;
        gap: 10px;
        margin-top: 15px;
    }
    
    .detailbtn a {
        width: 100%;
        max-width: 280px;
        margin: 0;
        height: 44px;
        font-size: 16px;
    }
    
    /* 移动端播放按钮优化 - 与PC端保持一致的灰色风格 */
    .detailbtn a.playbtn {
        background: #282828;
        color: #fff;
        border: #b3b3b3 solid 2px;
        transition: all 0.3s ease;
        font-weight: normal;
    }
    
    .detailbtn a.playbtn:hover,
    .detailbtn a.playbtn:active {
        background: #333;
        color: #fff;
        border-color: #ec7119;
        box-shadow: 0 0 10px rgba(236, 113, 25, 0.3);
    }
    
    /* 播放中状态的按钮样式 */
    .detailbtn a.playbtn.playing {
        background: #333;
        border-color: #ec7119;
        box-shadow: 0 0 15px rgba(236, 113, 25, 0.4);
    }
    
    /* 列表适配 */
    ul.list li {
        height: auto;
        min-height: 60px;
        padding: 10px 0;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
    }
    
    .listleft {
        width: 100%;
        margin-bottom: 0;
    }
    
    .info {
        flex: 1;
        margin-left: 10px;
    }
    
    .info h3 {
        font-size: 14px;
        line-height: 1.3;
    }
    
    .info p {
        font-size: 11px;
        margin-top: 3px;
    }
    
    /* 隐藏移动端列表右侧下载图标 */
    ul.list li > a:last-child {
        display: none;
    }
    
    ul.list li a i {
        font-size: 20px;
    }
    
    /* 侧边栏适配 */
    .left ul li {
        height: 44px;
        padding: 0 5px;
    }
    
    .left ul li a {
        font-size: 14px;
    }
    
    .left ul li a i {
        font-size: 14px;
        margin-right: 6px;
    }
    
    /* 小标题适配 */
    strong.smalltitle {
        font-size: 16px;
    }
    
    strong.smalltitle i {
        font-size: 18px;
        margin-right: 6px;
    }
    
    /* 分页适配 */
    .page {
        padding: 20px 0 10px 0;
    }
    
    .page ul.pagination {
        flex-wrap: wrap;
        gap: 3px;
    }
    
    .page ul.pagination li {
        margin: 0;
    }
    
    .page ul.pagination li a,
    .page ul.pagination li span {
        height: 32px;
        padding: 0 8px;
        font-size: 12px;
        min-width: 32px;
    }
    
    /* 音乐封面适配 */
    a.musiccover {
        width: 45px;
        height: 45px;
    }
    
    /* 歌词区域适配 */
    .musicltr {
        font-size: 14px;
        line-height: 1.6;
        text-align: left;
        padding: 0 5px;
    }
    
    .lyrics-container {
        margin-top: 15px;
    }
    
    .lyrics-toggle {
        padding: 15px 0;
    }
    
    .toggle-btn {
        font-size: 13px;
        padding: 8px 16px;
        background: #282828;
        border-radius: 20px;
        display: inline-block;
    }
    
    /* 搜索结果页面适配 */
    .searchtop {
        font-size: 16px;
        padding: 10px 0;
        text-align: center;
        flex-wrap: wrap;
    }
    
    .searchtop strong,
    .searchtop em {
        font-size: 16px;
    }
    
    .mainlistbox {
        margin-top: 15px;
    }
    
    /* 无搜索结果提示适配 */
    .list li[style*="text-align:center"] {
        padding: 30px 0 !important;
    }
    
    .list li[style*="text-align:center"] p {
        font-size: 14px;
    }
    
    /* 列表页右侧全宽适配 */
    .box .right[style*="width:100%"] {
        margin-left: 0;
        width: 100%;
    }
}

/* 小屏手机适配 (最大480px) */
@media (max-width: 480px) {
    body {
        font-size: 12px;
    }
    
    .box, .kbox, .searchbox {
        width: 98%;
        margin: 8px auto;
        padding: 10px;
    }
    .box{ padding: 0px;}
    
    .left, .right {
        padding: 10px;
    }
    
    /* 头部进一步压缩 */
    .headbox {
        height: 55px;
    }
    
    .headcont {
        height: 55px;
        padding: 0 10px;
    }
    
    img.logo {
        width: 70px;
    }
    
    .topright a {
        height: 26px;
        padding: 0 8px;
        font-size: 11px;
        margin-left: 3px;
    }
    
    /* 详情页进一步优化 */
    .coverbox {
        width: 150px;
        height: 150px;
    }
    
    .musicinfo h1 {
        font-size: 18px;
    }
    
    .detailbtn a {
        height: 40px;
        font-size: 14px;
        padding: 0 15px;
    }
    
    /* 搜索框 */
    .searchleftcont {
        height: 38px;
        padding-left: 8px;
    }
    
    .searchrightbtn {
        height: 38px;
        font-size: 13px;
    }
    
    /* 列表项更紧凑 */
    ul.list li {
        min-height: 50px;
        padding: 8px 0;
    }
    
    a.musiccover {
        width: 40px;
        height: 40px;
    }
    
    .info h3 {
        font-size: 13px;
    }
    
    .info p {
        font-size: 10px;
    }
    
    /* 侧边栏 */
    .left ul li {
        height: 40px;
    }
    
    .left ul li a {
        font-size: 13px;
    }
    
    strong.smalltitle {
        font-size: 14px;
    }
    
    strong.smalltitle i {
        font-size: 16px;
    }
}

/* 横屏手机优化 */
@media (max-width: 768px) and (orientation: landscape) {
    .detailtop {
        flex-direction: row;
        align-items: center;
    }
    
    .coverbox {
        width: 120px;
        height: 120px;
        margin: 0 15px 0 0;
    }
    
    .detailright {
        text-align: left;
    }
    
    .detailbtn {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .detailbtn a {
        width: auto;
        min-width: 100px;
        margin-right: 10px;
        margin-bottom: 5px;
    }
    
}

/* 触摸优化 */
@media (pointer: coarse) {
    .searchrightbtn,
    .detailbtn a,
    .left ul li a,
    ul.list li a,
    .toggle-btn {
        cursor: pointer;
    }
    
    .searchleftcont {
        min-height: 44px;
    }
    
    .topright a {
        min-height: 36px;
    }
}

/* 高分辨率屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .coverbox img,
    a.musiccover img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* 深色模式适配增强 */
@media (prefers-color-scheme: dark) {
    /* 已经是深色主题，无需额外处理 */
}

/* 减少动画的用户偏好 */
@media (prefers-reduced-motion: reduce) {
    .searchleftcont,
    .toggle-btn,
    .detailbtn a,
    .topright a {
        transition: none;
    }
}

/* 防止水平滚动 */
@media (max-width: 768px) {
    html, body {
        width: 100%;
        max-width: 100%;
    }
    
    * {
        max-width: 100%;
    }
    

    /* 优化点击反馈 */
    .detailbtn a,
    .topright a,
    .searchrightbtn,
    .left ul li a,
    ul.list li a,
    .toggle-btn {
        -webkit-tap-highlight-color: rgba(236, 113, 25, 0.2);
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        flex-shrink: 0;
        user-select: none;
    }
    
    /* 链接的激活状态 */
    .detailbtn a:active,
    .topright a:active,
    .searchrightbtn:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
    
    /* 输入框优化 */
    .searchleftcont input {
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        border-radius: 6px;
    }
    
    /* 图片懒加载优化 */
    .coverbox img,
    a.musiccover img {
        loading: lazy;
        will-change: transform;
    }
}

/* 安全区域适配 (iPhone X 等带刘海屏设备) */
@media (max-width: 768px) {
    .headbox {
        padding-top: env(safe-area-inset-top);
    }
    
    .player-controller {
        padding-bottom: env(safe-area-inset-bottom);
        height: calc(80px + env(safe-area-inset-bottom));
    }
}

/* iOS设备特殊优化 */
@supports (-webkit-touch-callout: none) {
    @media (max-width: 768px) {
        /* 防止iOS Safari的弹性滚动 */

        /* 但保持内容可滚动 */
   
        
        /* 优化iOS键盘弹出体验 */
        .searchleftcont input {
            -webkit-appearance: none;
            border-radius: 6px;
        }
        
        /* 修复iOS下的fixed定位问题 */
        .player-controller {
            position: -webkit-sticky;
            position: sticky;
            bottom: 0;
        }
    }
} 