/* home.css - 强制标题截断 */

/* ============================================
   Hero 区域
   ============================================ */
.hero-section {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    padding: 3.5rem 2rem;
    border-radius: 1rem;
    margin-bottom: 3rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.08) 0%, transparent 70%);
    border-radius: 50%;
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: -40%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.06) 0%, transparent 70%);
    border-radius: 50%;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 700px;
    margin: 0 auto;
}

.hero-title {
    font-size: 2.8rem;
    font-weight: 800;
    color: white;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.hero-title span {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: #94a3b8;
    margin-bottom: 1.75rem;
}

.hero-search {
    max-width: 600px;
    margin: 0 auto 1.25rem;
}

.hero-search-form {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 999px;
    padding: 0.25rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.hero-search-input {
    flex: 1;
    border: none;
    padding: 0.875rem 1rem 0.875rem 2.75rem;
    font-size: 1rem;
    background: transparent;
    border-radius: 999px;
}

.hero-search-input:focus {
    outline: none;
}

.hero-search-input::placeholder {
    color: #94a3b8;
}

.hero-search-form .search-icon {
    left: 1.25rem;
    color: #94a3b8;
}

.hero-search-btn {
    padding: 0.625rem 1.5rem;
    border-radius: 999px;
    font-weight: 600;
    background: #3b82f6;
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.hero-search-btn:hover {
    background: #2563eb;
    transform: scale(1.02);
}

.hero-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    align-items: center;
}

.hero-tags-label {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 500;
}

.hero-tag {
    display: inline-block;
    padding: 0.25rem 0.875rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    text-decoration: none;
    transition: all 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.hero-tag:hover {
    background: rgba(59, 130, 246, 0.25);
    color: white;
    border-color: rgba(59, 130, 246, 0.3);
}

/* ============================================
   通用区域标题
   ============================================ */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-title-home {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.section-title-home i {
    margin-right: 0.5rem;
}

.view-all-link {
    font-size: 0.85rem;
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: all 0.2s;
}

.view-all-link:hover {
    color: #2563eb;
    gap: 0.5rem;
}

/* ============================================
   Featured 精选推荐（强制标题截断）
   ============================================ */
.featured-section {
    margin-bottom: 3rem;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
}

.featured-card {
    text-decoration: none;
    transition: transform 0.3s;
    display: flex;
    flex-direction: column;
    min-width: 0; /* 关键：允许内容收缩 */
    width: 100%;
    overflow: hidden; /* 关键：防止内容溢出 */
}

.featured-card:hover {
    transform: translateY(-6px);
}

.featured-card:hover .featured-overlay {
    opacity: 1;
}

.featured-cover {
    position: relative;
    aspect-ratio: 1/1;
    width: 100%;
    border-radius: 0.5rem;
    overflow: hidden;
    background: #f1f5f9;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
}

.featured-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

.featured-card:hover .featured-cover img {
    transform: scale(1.05);
}

.featured-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.featured-overlay i {
    font-size: 3rem;
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ============================================
   Featured 信息区域 - 固定高度，强制截断
   ============================================ */
.featured-info {
    padding: 0.6rem 0.25rem 0;
    height: 4.5rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow: hidden;
    flex-shrink: 0;
    width: 100%;
    min-width: 0;
}

/* ============================================
   Featured 标题 - 强制单行截断
   ============================================ */
.featured-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #0f172a;
    display: block;
    white-space: nowrap !important; /* 强制不换行 */
    overflow: hidden !important; /* 强制隐藏溢出 */
    text-overflow: ellipsis !important; /* 强制显示省略号 */
    line-height: 1.3;
    flex-shrink: 0;
    max-width: 100%;
    width: 100%;
    min-width: 0;
}

.featured-artist {
    font-size: 0.75rem;
    color: #64748b;
    display: block;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: 1.4;
    margin-top: 0.05rem;
    flex-shrink: 0;
    max-width: 100%;
    width: 100%;
    min-width: 0;
}

.featured-year {
    font-size: 0.65rem;
    color: #94a3b8;
    margin-top: 0.1rem;
    line-height: 1.3;
    min-height: 1.2rem;
    flex-shrink: 0;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.featured-year:empty::before {
    content: '\00a0';
}

/* ============================================
   Genres 分类浏览（无 tracks 计数）
   ============================================ */
.genres-section-home {
    margin-bottom: 3rem;
}

.genres-grid-home {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0.75rem;
}

.genre-card-home {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.25rem 0.5rem;
    background: white;
    border-radius: 0.5rem;
    text-decoration: none;
    border: 1px solid #f1f5f9;
    transition: all 0.25s;
    text-align: center;
}

.genre-card-home:hover {
    border-color: #3b82f6;
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.genre-icon-home {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3b82f6;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    transition: background 0.25s;
}

.genre-card-home:hover .genre-icon-home {
    background: #dbeafe;
}

.genre-name-home {
    font-size: 0.8rem;
    font-weight: 600;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* ============================================
   Latest 最新发布（无 tracks 计数）
   ============================================ */
.latest-section {
    margin-bottom: 2rem;
}

.latest-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1.25rem;
}

.latest-card {
    background: white;
    border-radius: 0.5rem;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.latest-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.latest-cover-link {
    display: block;
    text-decoration: none;
    flex-shrink: 0;
}

.latest-cover {
    position: relative;
    aspect-ratio: 1/1;
    width: 100%;
    overflow: hidden;
    background: #f1f5f9;
    flex-shrink: 0;
}

.latest-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

.latest-card:hover .latest-cover img {
    transform: scale(1.05);
}

.latest-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.latest-card:hover .latest-overlay {
    opacity: 1;
}

.latest-overlay i {
    font-size: 2.5rem;
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.latest-year-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 0.6rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    backdrop-filter: blur(4px);
}

.latest-info {
    padding: 0.6rem 0.75rem 0.75rem;
    height: 4.8rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow: hidden;
    flex-shrink: 0;
    width: 100%;
    min-width: 0;
}

.latest-title {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #0f172a;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s;
    line-height: 1.3;
    flex-shrink: 0;
    max-width: 100%;
    width: 100%;
    min-width: 0;
}

.latest-title:hover {
    color: #3b82f6;
}

.latest-artist {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
    flex-shrink: 0;
    max-width: 100%;
    width: 100%;
    min-width: 0;
}

.latest-artist a {
    color: #64748b;
    text-decoration: none;
}

.latest-artist a:hover {
    color: #3b82f6;
}

.latest-genre {
    font-size: 0.65rem;
    color: #94a3b8;
    margin-top: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    min-height: 1.1rem;
    flex-shrink: 0;
    max-width: 100%;
    width: 100%;
}

.latest-genre a {
    color: #94a3b8;
    text-decoration: none;
}

.latest-genre a:hover {
    color: #3b82f6;
}

.latest-genre:empty::before {
    content: '\00a0';
}

/* ============================================
   Pagination
   ============================================ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2.5rem;
    flex-wrap: wrap;
}

.pagination-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    border: 1px solid #e2e8f0;
    background: white;
    color: #334155;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
}

.pagination-link:hover {
    background: #f8fafc;
    border-color: #3b82f6;
}

.pagination-link.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.pagination-link.active:hover {
    background: #2563eb;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1200px) {
    .featured-grid,
    .latest-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .genres-grid-home {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .hero-section {
        padding: 2.5rem 1.5rem;
        border-radius: 0.75rem;
        margin-bottom: 2rem;
    }
    
    .hero-title {
        font-size: 1.8rem;
    }
    
    .hero-subtitle {
        font-size: 0.95rem;
    }
    
    .hero-search-form {
        flex-direction: column;
        background: transparent;
        box-shadow: none;
        gap: 0.5rem;
        padding: 0;
    }
    
    .hero-search-input {
        background: white;
        border-radius: 999px;
        padding: 0.75rem 1rem 0.75rem 2.75rem;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    }
    
    .hero-search-btn {
        width: 100%;
        justify-content: center;
        padding: 0.75rem;
    }
    
    .hero-tags {
        gap: 0.35rem;
    }
    
    .hero-tag {
        font-size: 0.65rem;
        padding: 0.15rem 0.6rem;
    }
    
    .featured-grid,
    .latest-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
    }
    
    .genres-grid-home {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .section-title-home {
        font-size: 1.2rem;
    }
    
    .featured-overlay i,
    .latest-overlay i {
        font-size: 2rem;
    }
    
    .featured-info {
        height: 4rem;
        padding: 0.4rem 0.15rem 0;
    }
    
    .featured-title {
        font-size: 0.75rem;
    }
    
    .featured-artist {
        font-size: 0.65rem;
    }
    
    .featured-year {
        font-size: 0.6rem;
        min-height: 1rem;
    }
    
    .latest-info {
        height: 4rem;
        padding: 0.4rem 0.5rem 0.5rem;
    }
    
    .latest-title {
        font-size: 0.75rem;
    }
    
    .latest-artist {
        font-size: 0.65rem;
    }
    
    .latest-genre {
        font-size: 0.6rem;
        min-height: 1rem;
    }
    
    .pagination-link {
        padding: 0.35rem 0.75rem;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .hero-section {
        padding: 2rem 1rem;
    }
    
    .hero-title {
        font-size: 1.4rem;
    }
    
    .featured-grid,
    .latest-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
    }
    
    .genres-grid-home {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .genre-card-home {
        padding: 0.75rem 0.25rem;
    }
    
    .genre-name-home {
        font-size: 0.7rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .featured-info {
        height: 3.8rem;
    }
    
    .latest-info {
        height: 3.8rem;
    }
    
    .featured-title {
        font-size: 0.7rem;
    }
    
    .latest-title {
        font-size: 0.7rem;
    }
}