/* ===== 手机端专用样式 (宽度 ≤ 768px) ===== */
@media (max-width: 768px) {
    /* 全局调整 */
    body {
        padding: 8px;
    }
    
    .container {
        border-radius: 12px;
        overflow: hidden;
    }
    
    /* 头部区域 - 压缩 */
    .header {
        padding: 10px 12px;
    }
    
    .header-left h1 {
        font-size: 16px;
        margin-bottom: 2px;
    }
    
    .update-info {
        font-size: 9px;
    }
    
    /* 隐藏统计按钮 */
    .stats-btn {
        display: none;
    }
    
    /* 来源卡片 - 保留但压缩 */
    .source-card {
        min-width: auto;
        padding: 5px 8px;
        font-size: 8px;
        backdrop-filter: blur(4px);
    }
    
    .source-card-title {
        font-size: 8px;
        margin-bottom: 2px;
    }
    
    .source-card-line {
        gap: 3px;
    }
    
    .source-label {
        width: 50px;
        font-size: 8px;
    }
    
    .source-links a {
        font-size: 8px;
    }
    
    /* 分类标签 - 横向滚动 */
    .category-tabs {
        padding: 0 10px;
        overflow-x: auto;
        white-space: nowrap;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        gap: 2px;
    }
    
    .category-tab {
        padding: 6px 10px;
        font-size: 11px;
        flex-shrink: 0;
    }
    
    /* 控制栏 */
    .controls {
        padding: 8px 12px;
    }
    
    .search-box input {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    /* 主内容区 */
    .main-content {
        flex-direction: column;
        padding: 8px 12px;
        gap: 0;
    }
    
    /* 隐藏封面区域 */
    .cover-section {
        display: none;
    }
    
    .song-list-section {
        flex: 1;
        width: 100%;
    }
    
    /* ===== 卡片式歌曲列表 ===== */
    #songTable {
        display: block;
    }
    
    #songTable thead {
        display: none;
    }
    
    #songTable tbody,
    #songTable tr,
    #songTable td {
        display: block;
        width: 100%;
    }
    
    /* 卡片容器 */
    #songTable tr {
        margin-bottom: 8px;
        background: white;
        border-radius: 10px;
        padding: 8px 10px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        border: 1px solid #e8e8e8;
        transition: all 0.2s;
        cursor: pointer;
    }
    
    #songTable tr:active {
        background: #f0f0f0;
        transform: scale(0.99);
    }
    
    #songTable tr.selected {
        background: #e8eaf6;
        border-color: #667eea;
    }
    
    /* 卡片内只显示两列：封面区域 + 文字区域 */
    #songTable td {
        display: inline-block;
        border: none;
        padding: 0;
        white-space: normal;
        vertical-align: middle;
    }
    
    /* 隐藏所有普通单元格的标签 */
    #songTable td:before {
        display: none;
    }
    
    /* 封面列 - 放在左边 */
    #songTable td:first-child {
        display: inline-block;
        width: 48px;
        height: 48px;
        margin-right: 10px;
        vertical-align: middle;
    }
    
    /* 封面图片 */
    #songTable td:first-child img {
        width: 48px;
        height: 48px;
        object-fit: cover;
        border-radius: 6px;
        background: #f0f0f0;
    }
    
    /* 无封面占位符 */
    #songTable td:first-child .no-cover-small {
        width: 48px;
        height: 48px;
        background: #e0e0e0;
        border-radius: 6px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 10px;
        color: #999;
        text-align: center;
    }
    
    /* 信息列（艺术家和标题放在一起） */
    #songTable td:nth-child(2) {
        display: inline-block;
        width: calc(100% - 62px);
        vertical-align: middle;
    }
    
    #songTable td:nth-child(2) {
        font-size: 13px;
        line-height: 1.4;
    }
    
    .mobile-artist {
        font-weight: 500;
        color: #667eea;
    }
    
    /* 隐藏其他列 */
    #songTable td:nth-child(3),
    #songTable td:nth-child(4),
    #songTable td:nth-child(5),
    #songTable td:nth-child(6),
    #songTable td:nth-child(7),
    #songTable td:nth-child(8) {
        display: none;
    }
    
    /* 加载更多 */
    .loading-more {
        padding: 12px;
        font-size: 11px;
    }
    
    /* ===== 手机端详情弹窗 ===== */
    .mobile-detail-modal {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.85);
        z-index: 2000;
        justify-content: center;
        align-items: center;
        backdrop-filter: blur(5px);
    }
    
    .mobile-detail-content {
        background: white;
        border-radius: 20px;
        width: 90%;
        max-width: 350px;
        max-height: 85vh;
        overflow-y: auto;
        padding: 20px;
        position: relative;
        animation: fadeInUp 0.2s ease;
    }
    
    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    .mobile-detail-close {
        position: absolute;
        top: 12px;
        right: 16px;
        font-size: 24px;
        cursor: pointer;
        color: #999;
        z-index: 1;
    }
    
    .mobile-detail-close:hover {
        color: #333;
    }
    
    .mobile-detail-cover {
        text-align: center;
        margin-bottom: 20px;
    }
    
    .mobile-detail-cover img {
        max-width: 180px;
        max-height: 180px;
        border-radius: 12px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    }
    
    .mobile-detail-cover .no-cover {
        width: 180px;
        height: 180px;
        background: #e0e0e0;
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 0 auto;
        font-size: 12px;
        color: #999;
    }
    
    .mobile-detail-info {
        text-align: left;
        margin-bottom: 20px;
        padding-bottom: 15px;
        border-bottom: 1px solid #e8e8e8;
    }
    
    .mobile-detail-info p {
        margin: 8px 0;
        font-size: 13px;
        line-height: 1.5;
        display: flex;
        flex-wrap: wrap;
    }
    
    .mobile-detail-info strong {
        width: 65px;
        flex-shrink: 0;
        color: #666;
        font-weight: 500;
    }
    
    .mobile-detail-info span {
        flex: 1;
        color: #333;
        word-break: break-word;
    }
    
    /* 手机端调校信息样式 - 与普通信息一致 */
    .mobile-detail-info .badge {
        display: inline;
        padding: 0;
        background: none;
        border-radius: 0;
        font-size: 13px;
        color: #333;
        font-weight: normal;
    }
    
    /* 歌词区域 - 无独立滚动，跟随弹窗整体滚动 */
    .mobile-detail-lyrics {
        text-align: left;
    }
    
    .mobile-detail-lyrics .lyrics-label {
        font-weight: 600;
        font-size: 14px;
        color: #333;
        margin-bottom: 8px;
        padding-bottom: 4px;
        border-bottom: 1px solid #e8e8e8;
    }
    
    .mobile-detail-lyrics .lyrics-content {
        padding: 4px 0;
    }
    
    /* 歌词内容样式 */
    .mobile-detail-lyrics pre {
        white-space: pre-wrap;
        word-break: break-word;
        font-family: inherit;
        font-size: 13px;
        line-height: 1.6;
        margin: 0;
        color: #444;
    }
    
    /* 统计模态框 - 手机端隐藏 */
    .modal-stats {
        display: none !important;
    }
}

/* ===== 平板端适配 (宽度 769px - 1024px) ===== */
@media (min-width: 769px) and (max-width: 1024px) {
    /* 平板端保持电脑端布局，但稍微压缩 */
    .container {
        max-width: 100%;
        margin: 0 10px;
    }
    
    .cover-section {
        max-width: 280px;
    }
    
    .category-tab {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .controls {
        padding: 15px 20px;
    }
}