/* styles.css - 星空音乐搜索样式文件 */

/* Tailwind配置注入 */
tailwind.config = {
    theme: {
        extend: {
            colors: {
                star: {
                    dark: '#0a0e27',
                    blue: '#1a237e',
                    purple: '#303f9f',
                    light: '#7986cb'
                },
                neon: {
                    blue: '#4fc3ff',
                    purple: '#ce93d8'
                }
            },
            fontFamily: {
                inter: ['Inter', 'sans-serif']
            }
        }
    }
}

/* 基础样式 */
.content-auto {
    content-visibility: auto;
}

.star-animation {
    animation: twinkle 3s infinite alternate;
}

.snow-animation {
    animation: snowfall linear infinite;
}

.float-animation {
    animation: float 6s ease-in-out infinite;
}

.search-glow {
    box-shadow: 0 0 15px rgba(79, 195, 247, 0.5);
}

.btn-glow {
    box-shadow: 0 0 10px rgba(206, 147, 216, 0.7);
}

.playing-indicator {
    animation: pulse 1.5s infinite;
}

.nav-shadow {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* 动画定义 */
@keyframes twinkle {
    0% { opacity: 0.3; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1.2); }
}

@keyframes snowfall {
    0% { transform: translateY(-10px) rotate(0deg); }
    100% { transform: translateY(100vh) rotate(360deg); }
}

@keyframes float {
    0% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-15px) rotate(2deg); }
    100% { transform: translateY(0px) rotate(0deg); }
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

/* 粒子背景容器 */
#particles-js {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 0;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

/* 背景样式 */
.background {
    opacity: 1.0;
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: rgba(10, 14, 39, 0.85);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 0.8rem 2rem;
    transition: all 0.3s ease;
}

.navbar-container {
    max-width: 80rem;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    height: 2.5rem;
    width: auto;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    padding: 0.5rem 0;
    position: relative;
    transition: color 0.3s ease;
}

.nav-link:hover, .nav-link.active {
    color: #4fc3f7;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #4fc3f7;
    transition: width 0.3s ease;
}

.nav-link:hover::after, .nav-link.active::after {
    width: 100%;
}

.menu-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.menu-btn:hover {
    transform: rotate(90deg);
}

/* 栏目页面样式 */
.category-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(79, 195, 247, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-title {
    font-size: 2rem;
    font-weight: 600;
    color: #4fc3f7;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.category-description {
    color: rgba(255, 255, 255, 0.7);
    margin-top: 0.5rem;
}

.filter-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.filter-select {
    background-color: rgba(26, 35, 126, 0.5);
    color: white;
    border: 1px solid rgba(79, 195, 247, 0.3);
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    backdrop-filter: blur(5px);
}

/* 数据网格样式 - 优化移动端显示 */
.data-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.data-card {
    background-color: rgba(26, 35, 126, 0.3);
    backdrop-filter: blur(5px);
    border-radius: 1rem;
    border: 1px solid rgba(79, 195, 247, 0.3);
    overflow: hidden;
    cursor: pointer;
}

.card-image {
    height: 160px;
    background-color: rgba(79, 195, 247, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.data-card:hover .card-image img {
    transform: scale(1.1);
}

.card-content {
    padding: 1rem;
}

.card-title {
    font-weight: 600;
    color: white;
    margin-bottom: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.95rem;
}

.card-subtitle {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.5rem;
}

.card-info {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 0.8rem;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.card-tag {
    font-size: 0.7rem;
    background-color: rgba(206, 147, 216, 0.2);
    color: #ce93d8;
    padding: 0.2rem 0.5rem;
    border-radius: 1rem;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 3rem;
    flex-wrap: wrap;
}

.pagination-btn {
    background-color: rgba(26, 35, 126, 0.5);
    border: 1px solid rgba(79, 195, 247, 0.3);
    color: white;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-btn:hover {
    background-color: rgba(79, 195, 247, 0.3);
}

.pagination-btn.active {
    background-color: #4fc3f7;
    color: #0a0e27;
    font-weight: bold;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 响应式调整 */
@media (max-width: 1024px) {
    .data-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@media (max-width: 768px) {
    /* 导航栏响应式 */
    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        flex-direction: column;
        background-color: rgba(10, 14, 39, 0.95);
        padding: 1.5rem;
        gap: 1rem;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-out;
        align-items: flex-start;
        width: 100%;
    }
    
    .nav-links.active {
        max-height: 400px;
    }
    
    .menu-btn {
        display: block;
    }
    
    /* 栏目页面响应式 */
    .category-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .filter-controls {
        margin-top: 1rem;
        width: 100%;
        justify-content: space-between;
    }
    
    /* 移动端每行3张卡片 */
    .data-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.8rem;
    }
    
    .data-card {
        border-radius: 0.5rem;
    }
    
    .card-image {
        height: 120px;
    }
    
    .card-content {
        padding: 0.6rem;
    }
    
    .card-title {
        font-size: 0.8rem;
    }
    
    .card-subtitle {
        font-size: 0.7rem;
    }
    
    .card-info {
        font-size: 0.65rem;
    }
    
    .card-tag {
        font-size: 0.6rem;
        padding: 0.15rem 0.4rem;
    }
}

@media (max-width: 480px) {
    /* 更小屏幕的优化 */
    .data-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.6rem;
    }
    
    .card-image {
        height: 100px;
    }
    
    .card-content {
        padding: 0.5rem;
    }
    
    .card-title {
        font-size: 0.75rem;
    }
    
    .navbar {
        padding: 0.8rem 1rem;
    }
    
    .logo {
        height: 2rem;
    }
    
    .category-title {
        font-size: 1.5rem;
    }
    
    .pagination-btn {
        width: 2rem;
        height: 2rem;
        font-size: 0.8rem;
    }
}

/* 加载状态样式 */
.loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem;
}

.loading-spinner {
    font-size: 3rem;
    color: rgba(79, 195, 247, 0.5);
    margin-bottom: 1rem;
}

.loading-text {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.7);
}

/* 空状态样式 */
.empty-container {
    text-align: center;
    padding: 3rem;
}

.empty-icon {
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.3);
    margin-bottom: 1rem;
}

.empty-text {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.7);
}

/* 激活歌曲样式 */
.active-song {
    background-color: rgba(79, 195, 247, 0.1);
    border: 1px solid rgba(79, 195, 247, 0.3);
}

/* 音频播放器容器 */
.audio-player-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(26, 35, 126, 0.3);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(79, 195, 247, 0.3);
    padding: 1rem;
    z-index: 100;
}

/* 响应式音频播放器 */
@media (max-width: 768px) {
    .audio-player-container {
        padding: 0.8rem;
    }
}

/* 浮动联系按钮 */
.float-animation {
    animation: float 6s ease-in-out infinite;
}

.contact-float {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    z-index: 50;
    background: linear-gradient(135deg, #4fc3f7, #ce93d8);
    border-radius: 50%;
    padding: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.contact-float:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(206, 147, 216, 0.5);
}

.contact-icon {
    font-size: 1.5rem;
    color: white;
}

.contact-text {
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s ease;
    white-space: nowrap;
}

.contact-float:hover .contact-text {
    opacity: 1;
}
/* 歌词高亮 */
.lyric-line {
  padding: 0.25rem 0;
  color: rgba(255,255,255,.6);
  transition: all .3s;
}
.lyric-line.active {
  color: #4fc3f7;
  font-size: 1.1em;
  font-weight: 600;
}