/* 音乐魔石 - 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #fff;
    color: #333;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

.container {
    max-width: 880px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ===== 头部 ===== */
.header {
    background: #fff;
    border-bottom: 1px solid #f2f2f2;
}

.header-top {
    padding: 16px 0;
}

.header-top .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.logo a {
    display: flex;
    align-items: baseline;
    gap: 8px;
    white-space: nowrap;
}

.logo h1 {
    font-size: 24px;
    color: #222;
    font-weight: 700;
}

.logo .domain {
    font-size: 13px;
    color: #999;
}

.header-download {
    color: #ff6b6b;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    transition: color 0.2s;
}

.header-download:hover {
    color: #ff4757;
}

.header-search {
    padding-bottom: 16px;
}

/* ===== 搜索栏 ===== */
.search-form {
    display: flex;
    width: 100%;
    max-width: 600px;
    border-radius: 28px;
    overflow: hidden;
    background: #f0f0f0;
    transition: box-shadow 0.2s, background 0.2s;
}

.search-form:focus-within {
    background: #fff;
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.2);
}

.header-search-form {
    width: 100%;
    max-width: none;
}

.search-input {
    flex: 1;
    border: none;
    padding: 12px 20px;
    font-size: 15px;
    background: transparent;
    outline: none;
    color: #333;
}

.search-input::placeholder {
    color: #aaa;
}

.search-btn {
    border: none;
    background: transparent;
    padding: 0 20px;
    cursor: pointer;
    color: #666;
}

.search-btn:hover {
    color: #ff6b6b;
}

/* ===== 导航栏 ===== */
.main-nav {
    background: #fff;
    border-top: 1px solid #f0f0f0;
    padding: 10px 0;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 30px;
    flex-wrap: wrap;
}

.nav-list a {
    font-size: 14px;
    color: #555;
    padding: 5px 0;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.nav-list a:hover,
.nav-list a.active {
    color: #ff6b6b;
    border-bottom-color: #ff6b6b;
}

/* ===== 主内容区 ===== */
.main-content {
    padding: 18px 0;
    min-height: 500px;
}

.section {
    background: #fff;
    border-radius: 0;
    padding: 18px 0;
    margin-bottom: 0;
    border-bottom: 1px solid #f2f2f2;
}

.section:last-child {
    border-bottom: none;
}

.page-title {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

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

.section-header h2 {
    font-size: 17px;
    color: #222;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.section-header .icon {
    font-size: 18px;
    color: #555;
}

.more {
    font-size: 13px;
    color: #999;
}

.more:hover {
    color: #ff6b6b;
}

/* ===== 标签云 ===== */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    background: #fafafa;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.tag:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 10px 25px rgba(255, 107, 107, 0.35);
    opacity: 1;
    z-index: 1;
}

.tag-time {
    font-size: 12px;
    opacity: 0.75;
}

.tag-yellow { background: #ffd93d; color: #333; }
.tag-dark { background: #4a4a4a; color: #fff; }
.tag-green { background: #6bcb77; color: #fff; }
.tag-blue { background: #4d96ff; color: #fff; }
.tag-red { background: #ff6b6b; color: #fff; }
.tag-cyan { background: #4ecdc4; color: #fff; }
.tag-orange { background: #ff9f43; color: #fff; }
.tag-purple { background: #a29bfe; color: #fff; }

/* ===== 三栏排行榜 ===== */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.chart-box {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #f0f0f0;
}

.chart-header {
    padding: 12px 12px 10px;
    background: #fafafa;
    border-bottom: 1px solid #f0f0f0;
}

.chart-header h3 {
    font-size: 15px;
    color: #222;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

.chart-header .icon {
    font-size: 18px;
    line-height: 1;
}

.chart-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.chart-table thead th {
    padding: 8px 12px;
    text-align: left;
    font-size: 13px;
    color: #666;
    font-weight: normal;
    background: #f0f0f0;
}

.chart-table thead th:first-child {
    border-radius: 16px 0 0 16px;
}

.chart-table thead th:last-child {
    border-radius: 0 16px 16px 0;
}

.chart-table tbody td {
    padding: 9px 12px;
    border-bottom: 1px solid #f2f2f2;
    font-size: 13px;
}

.chart-table tbody tr:hover {
    background: #fafafa;
}

.rank-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #666;
    font-size: 12px;
}

.rank-num.top {
    background: #ff6b6b;
    color: #fff;
}

/* 新版单行列表布局 */
.chart-list {
    display: flex;
    flex-direction: column;
}

.chart-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-bottom: 1px solid #f2f2f2;
    font-size: 13px;
}

.chart-item:last-child {
    border-bottom: none;
}

.chart-item .song-name {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #333;
}

.chart-item .song-name:hover {
    color: #ff6b6b;
}

.update-item {
    justify-content: space-between;
    gap: 10px;
}

.update-item .song-title {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #333;
}

.update-item .song-title:hover {
    color: #ff6b6b;
}

.update-time {
    font-size: 12px;
    color: #999;
    white-space: nowrap;
}

/* 兼容旧表格布局 */
.song-name a {
    color: #333;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.song-name a:hover {
    color: #ff6b6b;
}

.song-info a {
    color: #333;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.song-info a:hover {
    color: #ff6b6b;
}

.format {
    color: #ff6b6b;
    font-size: 11px;
}

/* ===== 分类标签 ===== */
.flag-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.flag-tag {
    padding: 6px 16px;
    background: #f0f0f0;
    border-radius: 20px;
    font-size: 13px;
    color: #555;
    transition: all 0.3s;
}

.flag-tag:hover {
    background: #ff6b6b;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.25);
}

/* ===== 搜索结果页 ===== */
.breadcrumb {
    padding: 10px 0;
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
}

.breadcrumb a {
    color: #ff6b6b;
}

.breadcrumb span {
    margin: 0 5px;
}

.search-page-title {
    font-size: 20px;
    color: #222;
    font-weight: 600;
    margin-bottom: 12px;
}

.search-summary {
    padding: 12px 16px;
    margin-bottom: 15px;
    background: #fafafa;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    font-size: 14px;
    color: #666;
}

.search-summary strong {
    color: #ff6b6b;
    font-weight: 600;
}

.result-list {
    display: flex;
    flex-direction: column;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    overflow: hidden;
}

.result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid #f5f5f5;
    font-size: 14px;
    transition: all 0.2s ease;
}

.result-item:last-child {
    border-bottom: none;
}

.result-item:hover {
    background: #fff8f0;
    transform: translateX(4px);
}

.result-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #666;
    font-size: 12px;
    flex-shrink: 0;
    font-weight: 600;
}

.result-item:nth-child(1) .result-rank {
    background: #ff6b6b;
    color: #fff;
}

.result-item:nth-child(2) .result-rank {
    background: #ff9f43;
    color: #fff;
}

.result-item:nth-child(3) .result-rank {
    background: #4ecdc4;
    color: #fff;
}

.result-title {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #333;
}

.result-artist {
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.result-date {
    color: #999;
    font-size: 13px;
    white-space: nowrap;
    flex-shrink: 0;
}

.empty-result {
    text-align: center;
    padding: 70px 20px;
    color: #999;
    background: #fafafa;
    border-radius: 8px;
    border: 1px dashed #e0e0e0;
}

.empty-result p {
    font-size: 15px;
}

.empty-result p::before {
    content: "🎵";
    display: block;
    font-size: 40px;
    margin-bottom: 15px;
    opacity: 0.6;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.pagination > * {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    margin: 0 4px;
    border: 1px solid #eee;
    border-radius: 4px;
    font-size: 14px;
    color: #666;
}

.pagination > a:hover {
    border-color: #ff6b6b;
    color: #ff6b6b;
}

.pagination > span.current {
    background: #ff6b6b;
    border-color: #ff6b6b;
    color: #fff;
}

.pagination > span.disabled {
    color: #ccc;
}

/* ===== 猜你喜欢 ===== */
.guess-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.guess-item {
    display: flex;
    flex-direction: column;
    padding: 10px 15px;
    background: #fafafa;
    border-radius: 6px;
    font-size: 13px;
    transition: all 0.3s;
}

.guess-item:hover {
    background: #ff6b6b;
    color: #fff;
}

.guess-name {
    font-weight: 500;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.guess-artist {
    font-size: 12px;
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== 音乐详情页 ===== */
.music-detail-section {
    padding: 20px 0;
}

.music-detail {
    display: flex;
    justify-content: center;
}

.music-info-card {
    width: 100%;
    text-align: center;
    padding: 35px 30px;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    background: #fff;
}

.music-title {
    font-size: 28px;
    color: #222;
    margin-bottom: 18px;
    font-weight: 700;
    line-height: 1.3;
    word-break: break-word;
    overflow-wrap: break-word;
}

.music-meta-line {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 25px;
    font-size: 14px;
    color: #666;
}

.music-meta-line a {
    color: #ff6b6b;
    text-decoration: underline;
}

.music-meta-line a:hover {
    color: #ff4757;
}

.meta-icon {
    font-style: normal;
    margin-right: 4px;
}

.promo-tip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    margin-bottom: 25px;
    background: #fff8f0;
    border: 1px solid #ffe4cc;
    border-radius: 8px;
    font-size: 14px;
    color: #e67e22;
}

.promo-icon {
    font-size: 16px;
}

.download-section {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.download-btn {
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    text-align: center;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff4757 100%);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.25);
    transition: transform 0.2s, box-shadow 0.2s;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 107, 107, 0.35);
    color: #fff;
}

.btn-icon {
    font-size: 16px;
}

@media (max-width: 480px) {
    .download-section {
        flex-direction: column;
    }

    .download-btn {
        flex: 1 1 100%;
    }

    .music-meta-line {
        gap: 12px;
        font-size: 13px;
    }

    .music-title {
        font-size: 22px;
    }
}

/* 二维码弹窗 */
.qrcode-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.qrcode-box {
    position: relative;
    background: #fff;
    padding: 25px 30px;
    border-radius: 10px;
    text-align: center;
    max-width: 280px;
    width: 90%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.qrcode-box h4 {
    font-size: 16px;
    color: #333;
    margin-bottom: 15px;
}

.qrcode-box p {
    font-size: 13px;
    color: #999;
    margin-top: 12px;
}

.qrcode-close {
    position: absolute;
    top: 10px;
    right: 14px;
    font-size: 22px;
    color: #999;
    cursor: pointer;
    line-height: 1;
}

.qrcode-close:hover {
    color: #333;
}

#qrcodeContainer img,
#qrcodeContainer canvas {
    display: block;
    margin: 0 auto;
}

/* 人气排行 */
.hot-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hot-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

.hot-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    background: #eee;
    color: #666;
    font-size: 12px;
    font-weight: bold;
}

.hot-rank.top {
    background: #ff6b6b;
    color: #fff;
}

.hot-name {
    color: #333;
    font-size: 14px;
}

.hot-name:hover {
    color: #ff6b6b;
}

/* ===== 页脚 ===== */
.footer {
    background: #fff;
    border-top: 1px solid #eee;
    padding: 30px 0;
    text-align: center;
    margin-top: 40px;
}

.footer p {
    font-size: 13px;
    color: #999;
    margin: 5px 0;
}

.footer-links {
    margin-bottom: 12px;
}

.footer-links a {
    font-size: 13px;
    color: #999;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #ff6b6b;
}

.footer-copyright {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.footer-notice {
    font-size: 12px;
    color: #aaa;
    line-height: 1.7;
    margin: 2px 0;
}

/* ===== 响应式 ===== */
@media (max-width: 992px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header-top .container {
        gap: 15px;
    }

    .header-download {
        font-size: 13px;
    }

    .header-search-form {
        max-width: 100%;
    }

    .nav-list {
        gap: 15px;
        justify-content: center;
    }

    .guess-list {
        grid-template-columns: repeat(2, 1fr);
    }

    .result-artist {
        max-width: 100px;
    }
}

@media (max-width: 480px) {
    .header-top {
        padding: 14px 0;
    }

    .logo h1 {
        font-size: 22px;
    }

    .search-form {
        border-radius: 24px;
    }

    .search-input {
        padding: 10px 16px;
        font-size: 14px;
    }

    .search-btn {
        padding: 0 16px;
    }

    .tag-cloud {
        gap: 5px;
    }

    .tag {
        padding: 4px 8px;
        font-size: 12px;
    }

    .guess-list {
        grid-template-columns: 1fr;
    }

    .section {
        padding: 15px 0;
    }

    .section-header h2 {
        font-size: 16px;
    }

    .result-artist {
        max-width: 80px;
    }

    .result-date {
        display: none;
    }
}
