/* ============================================
   清音 - 音乐网站样式
   主题：清新简单、移动端友好、快速流畅
============================================ */

/* 颜色变量 - 清新配色方案 */
:root {
    --primary: #10b981;          /* 清新绿 */
    --primary-light: #d1fae5;    /* 浅绿背景 */
    --primary-dark: #059669;     /* 深绿 */
    --accent: #8b5cf6;           /* 紫色点缀 */
    --bg-main: #f0fdf4;          /* 主体背景 - 极浅绿 */
    --bg-card: #ffffff;          /* 卡片背景 */
    --text-primary: #1f2937;     /* 主要文字 */
    --text-secondary: #6b7280;   /* 次要文字 */
    --border: #e5e7eb;           /* 边框 */
    --shadow: rgba(16, 185, 129, 0.1);  /* 阴影 */
}

/* 移动端优先的导航栏 */
.navbar-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    gap: 4px;
}

.navbar-toggle span {
    width: 25px;
    height: 3px;
    background: var(--primary);
    border-radius: 3px;
    transition: all 0.3s;
}

.nav-search {
    font-size: 1.2rem !important;
}

/* 移动端导航 */
@media (max-width: 768px) {
    .navbar-toggle {
        display: flex;
    }

    .navbar-nav {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        padding: 1rem;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
        gap: 0.5rem;
    }

    .navbar-nav.active {
        display: flex;
    }

    .navbar-nav li {
        width: 100%;
    }

    .navbar-nav a {
        display: block;
        padding: 0.75rem;
        border-radius: 0.5rem;
    }
}

/* ============================================
   Hero Section - 音乐广场
============================================ */
.hero-section {
    background: linear-gradient(135deg, var(--primary-light) 0%, white 100%);
    padding: 3rem 1rem;
    text-align: center;
    border-radius: 0 0 2rem 2rem;
    margin-bottom: 2rem;
}

.hero-content h1 {
    font-size: 2.5rem;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.search-form {
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    gap: 0.5rem;
}

.search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: 2rem;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

.search-input:focus {
    border-color: var(--primary);
}

.search-btn {
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 2rem;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s;
}

.search-btn:hover {
    background: var(--primary-dark);
}

@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2rem;
    }

    .search-form {
        flex-direction: column;
    }

    .search-btn {
        width: 100%;
    }
}

/* ============================================
   通用区块样式
============================================ */
.section {
    padding: 2rem 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
}

.view-all {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.view-all:hover {
    color: var(--primary-dark);
}

/* ============================================
   分类卡片
============================================ */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
}

.category-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 1rem;
    text-align: center;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s;
    border: 2px solid transparent;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px var(--shadow);
    border-color: var(--primary);
}

.category-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.category-card h3 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.category-card p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ============================================
   艺术家卡片
============================================ */
.artists-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1.5rem;
}

.artist-card {
    text-decoration: none;
    color: var(--text-primary);
    transition: transform 0.3s;
}

.artist-card:hover {
    transform: translateY(-4px);
}

.artist-avatar {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 1rem;
    overflow: hidden;
    background: var(--primary-light);
    margin-bottom: 0.75rem;
}

.artist-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
}

.artist-card h3 {
    font-size: 1rem;
    text-align: center;
    margin-bottom: 0.25rem;
}

.artist-country {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: center;
}

/* ============================================
   专辑卡片
============================================ */
.albums-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1.5rem;
}

.album-card {
    text-decoration: none;
    color: var(--text-primary);
    transition: transform 0.3s;
}

.album-card:hover {
    transform: translateY(-4px);
}

.album-cover {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 1rem;
    overflow: hidden;
    background: var(--primary-light);
    margin-bottom: 0.75rem;
    box-shadow: 0 4px 15px var(--shadow);
}

.album-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.album-info h3 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.album-artist {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ============================================
   歌曲列表
============================================ */
.songs-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.song-item {
    display: grid;
    grid-template-columns: auto auto 1fr auto auto;
    gap: 1rem;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-card);
    border-radius: 0.75rem;
    transition: all 0.3s;
}

.song-item:hover {
    background: var(--primary-light);
    transform: scale(1.01);
}

.song-number {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    min-width: 2rem;
    text-align: center;
}

.song-cover {
    width: 50px;
    height: 50px;
    border-radius: 0.5rem;
    overflow: hidden;
    background: var(--primary-light);
    flex-shrink: 0;
}

.song-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cover-small {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.song-info {
    min-width: 0;
    flex: 1;
}

.song-title {
    font-size: 1rem;
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.song-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.song-duration {
    font-size: 0.85rem;
    color: var(--text-secondary);
    min-width: 3rem;
    text-align: center;
}

.play-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
}

.play-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .song-item {
        grid-template-columns: auto 1fr auto;
        gap: 0.75rem;
    }

    .song-number {
        display: none;
    }

    .song-duration {
        display: none;
    }
}

/* ============================================
   页面头部
============================================ */
.page-header {
    text-align: center;
    padding: 2rem 1rem;
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.page-header p {
    color: var(--text-secondary);
}

.sort-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.sort-btn {
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    text-decoration: none;
    color: var(--text-secondary);
    border: 2px solid var(--border);
    transition: all 0.3s;
}

.sort-btn.active,
.sort-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ============================================
   空状态
============================================ */
.empty-state {
    text-align: center;
    padding: 4rem 1rem;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.empty-state p {
    color: var(--text-secondary);
}

/* ============================================
   大型网格布局
============================================ */
.categories-grid-full,
.artists-grid-full,
.albums-grid-full {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 0 1rem;
}

.category-card-large,
.artist-card-large,
.album-card-large {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border-radius: 1rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s;
    border: 2px solid transparent;
}

.category-card-large:hover,
.artist-card-large:hover,
.album-card-large:hover {
    border-color: var(--primary);
    box-shadow: 0 8px 25px var(--shadow);
}

.category-icon-large {
    font-size: 3rem;
    flex-shrink: 0;
}

.artist-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 1rem;
    overflow: hidden;
    background: var(--primary-light);
    flex-shrink: 0;
}

.artist-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder-large {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.album-cover-large {
    width: 80px;
    height: 80px;
    border-radius: 0.75rem;
    overflow: hidden;
    background: var(--primary-light);
    flex-shrink: 0;
}

.album-cover-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cover-placeholder-large {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

/* ============================================
   详情页面
============================================ */
.artist-header,
.album-header {
    display: flex;
    gap: 2rem;
    padding: 2rem;
    background: var(--bg-card);
    border-radius: 1rem;
    margin-bottom: 2rem;
}

.artist-avatar-xl,
.album-cover-xl {
    width: 200px;
    height: 200px;
    border-radius: 1rem;
    overflow: hidden;
    background: var(--primary-light);
    flex-shrink: 0;
}

.artist-avatar-xl img,
.album-cover-xl img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder-xl,
.cover-placeholder-xl {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    font-weight: 700;
    color: var(--primary);
}

.artist-header-info,
.album-header-info {
    flex: 1;
}

.artist-header-info h1,
.album-header-info h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.artist-bio-full,
.album-description-full {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-top: 1rem;
}

@media (max-width: 768px) {
    .artist-header,
    .album-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .artist-avatar-xl,
    .album-cover-xl {
        width: 150px;
        height: 150px;
    }
}

.albums-grid-small {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
}

.album-card-small {
    text-decoration: none;
    color: var(--text-primary);
}

.album-cover-small {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 0.75rem;
    overflow: hidden;
    background: var(--primary-light);
    margin-bottom: 0.5rem;
}

.album-cover-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cover-placeholder-small {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.album-card-small h4 {
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.album-year {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ============================================
   搜索页面
============================================ */
.search-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.search-header {
    text-align: center;
    margin-bottom: 2rem;
}

.search-form-large {
    max-width: 600px;
    margin: 1.5rem auto 0;
    display: flex;
    gap: 0.5rem;
}

.search-input-large {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 2px solid var(--border);
    border-radius: 2rem;
    font-size: 1.1rem;
    outline: none;
}

.search-input-large:focus {
    border-color: var(--primary);
}

.search-btn-large {
    padding: 1rem 2rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 2rem;
    cursor: pointer;
    font-weight: 500;
}

.search-results h2 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.suggestions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.suggestion-card {
    padding: 2rem;
    background: var(--bg-card);
    border-radius: 1rem;
    text-align: center;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s;
    border: 2px solid transparent;
}

.suggestion-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: 0 8px 25px var(--shadow);
}

/* ============================================
   播放页面
============================================ */
.play-page {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem 1rem;
    text-align: center;
}

.now-playing-cover {
    width: 100%;
    max-width: 400px;
    aspect-ratio: 1;
    margin: 0 auto 2rem;
    border-radius: 1.5rem;
    overflow: hidden;
    background: var(--primary-light);
    box-shadow: 0 20px 60px var(--shadow);
}

.now-playing-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.now-playing-info h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.now-playing-artist {
    font-size: 1.2rem;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.now-playing-album {
    color: var(--text-secondary);
}

.lyrics-section {
    margin-top: 3rem;
    text-align: left;
}

.lyrics-section h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.lyrics-content {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 1rem;
    max-height: 400px;
    overflow-y: auto;
}

.lyrics-content pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: inherit;
    line-height: 2;
    color: var(--text-secondary);
}

.now-playing-actions {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.action-btn {
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 2rem;
    transition: background 0.3s;
}

.action-btn:hover {
    background: var(--primary-dark);
}

/* ============================================
   音频播放器（固定底部）
============================================ */
.audio-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid var(--border);
    padding: 1rem;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.player-cover {
    width: 50px;
    height: 50px;
    border-radius: 0.5rem;
    overflow: hidden;
    background: var(--primary-light);
    flex-shrink: 0;
}

.player-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.player-details h4 {
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-details p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.control-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.control-btn:hover {
    background: var(--primary);
    color: white;
}

.control-btn-main {
    width: 50px;
    height: 50px;
    background: var(--primary);
    color: white;
}

.control-btn-main:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

.player-progress {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.progress-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    min-width: 2.5rem;
}

.progress-bar {
    flex: 1;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    cursor: pointer;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
    transition: width 0.1s linear;
    width: 0%;
}

@media (max-width: 768px) {
    .player-details {
        flex: 1;
        min-width: 0;
    }

    .player-controls {
        gap: 0.75rem;
    }

    .control-btn {
        width: 36px;
        height: 36px;
    }

    .control-btn-main {
        width: 44px;
        height: 44px;
    }
}

/* ============================================
   响应式优化
============================================ */
@media (max-width: 480px) {
    .categories-grid,
    .artists-grid,
    .albums-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .hero-content h1 {
        font-size: 1.75rem;
    }

    .section-header h2 {
        font-size: 1.25rem;
    }
}

/* ============================================
   性能优化 - 平滑滚动和动画
============================================ */
* {
    scroll-behavior: smooth;
}

img {
    loading: lazy;
}

/* 动画优化 */
@media (prefers-reduced-motion: no-preference) {
    .category-card,
    .artist-card,
    .album-card,
    .song-item {
        animation: fadeIn 0.3s ease-in-out;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
