:root {
    --bg: #f4f6f9;
    --panel: rgba(255, 255, 255, .92);
    --text: #141821;
    --muted: #7a8291;
    --line: #e8ebf0;
    --accent: #111827;
    --accent-soft: #eef1f5;
    --danger: #d84d4d;
    --shadow: 0 20px 55px rgba(22, 28, 45, .08);
    --radius: 22px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
    background:
        radial-gradient(circle at 12% 0%, rgba(255,255,255,.95), transparent 30%),
        radial-gradient(circle at 92% 8%, rgba(225,231,240,.75), transparent 28%),
        var(--bg);
}

button,
input,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

.page-shell {
    width: min(1440px, calc(100% - 40px));
    margin: 0 auto;
    padding: 34px 0 60px;
}

.topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 26px;
}

.eyebrow {
    margin: 0 0 7px;
    color: #9aa2af;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .2em;
}

h1 {
    margin: 0;
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.1;
    letter-spacing: -.04em;
}

.subtitle {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 15px;
}

.layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 400px;
    gap: 22px;
    align-items: start;
}

.main-column {
    min-width: 0;
    display: grid;
    gap: 22px;
}

.panel {
    border: 1px solid rgba(255,255,255,.75);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.search-panel,
.result-panel,
.player-panel,
.history-panel {
    padding: 22px;
}

.search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
}

.search-box {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #9299a6;
    font-size: 23px;
}

.search-box input {
    width: 100%;
    height: 56px;
    padding: 0 18px 0 50px;
    border: 1px solid var(--line);
    border-radius: 16px;
    outline: none;
    background: #fff;
    color: var(--text);
    transition: .2s ease;
}

.search-box input:focus {
    border-color: #cbd1da;
    box-shadow: 0 0 0 4px rgba(17,24,39,.045);
}

.primary-btn,
.secondary-btn,
.ghost-btn {
    border: 0;
    border-radius: 14px;
    transition: .2s ease;
}

.primary-btn {
    min-width: 112px;
    padding: 0 25px;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
}

.primary-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 9px 22px rgba(17,24,39,.18);
}

.primary-btn:disabled {
    cursor: not-allowed;
    opacity: .55;
    transform: none;
    box-shadow: none;
}

.ghost-btn {
    padding: 12px 16px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,.72);
    color: var(--text);
    font-weight: 650;
}

.count-badge {
    display: inline-grid;
    min-width: 24px;
    height: 24px;
    margin-left: 6px;
    place-items: center;
    padding: 0 7px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 12px;
}

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-top: 16px;
}

.quality-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.toolbar-label {
    margin-right: 2px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.quality-chip input {
    display: none;
}

.quality-chip span {
    display: inline-flex;
    height: 32px;
    align-items: center;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: #707887;
    font-size: 12px;
    font-weight: 700;
    transition: .18s ease;
}

.quality-chip input:checked + span {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
}

.status-text {
    color: var(--muted);
    font-size: 13px;
}

.panel-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 18px;
}

.panel-title-row h2 {
    margin: 0;
    font-size: 20px;
}

.panel-title-row p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.empty-state {
    min-height: 310px;
    display: grid;
    place-items: center;
    align-content: center;
    text-align: center;
    color: var(--muted);
}

.empty-icon {
    width: 66px;
    height: 66px;
    display: grid;
    place-items: center;
    margin-bottom: 13px;
    border-radius: 20px;
    background: var(--accent-soft);
    color: #9aa1ad;
    font-size: 30px;
}

.empty-state h3 {
    margin: 0;
    color: #4d5562;
    font-size: 17px;
}

.empty-state p {
    margin: 8px 0 0;
    font-size: 13px;
}

.song-list {
    display: grid;
    gap: 10px;
}

.song-item {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255,255,255,.78);
    transition: .18s ease;
}

.song-item:hover {
    border-color: #d7dce4;
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(20,24,33,.05);
}

.song-cover {
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 14px;
    background: #eef1f5;
    color: #9098a5;
    font-size: 22px;
}

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

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

.song-title {
    overflow: hidden;
    margin: 0 0 5px;
    color: var(--text);
    font-size: 15px;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.song-meta {
    overflow: hidden;
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.song-debug {
    margin-top: 6px;
    color: #a0a7b2;
    font-size: 11px;
}

.song-play-btn {
    min-width: 88px;
    height: 40px;
    padding: 0 16px;
    border: 0;
    border-radius: 12px;
    background: var(--accent-soft);
    color: #353b45;
    font-size: 13px;
    font-weight: 750;
    transition: .18s ease;
}

.song-play-btn:hover {
    background: var(--accent);
    color: #fff;
}

.song-play-btn:disabled {
    cursor: wait;
    opacity: .55;
}

.player-panel {
    display: grid;
    gap: 18px;
}

.hidden {
    display: none !important;
}

.now-playing {
    display: flex;
    align-items: center;
    gap: 16px;
}

.cover-wrap {
    position: relative;
    width: 72px;
    height: 72px;
    overflow: hidden;
    flex: 0 0 auto;
    border-radius: 18px;
    background: #eef1f5;
}

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

.cover-fallback {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #9299a5;
    font-size: 28px;
}

.player-info {
    min-width: 0;
}

.playing-label {
    color: #969da8;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .12em;
}

.player-info h2 {
    overflow: hidden;
    margin: 5px 0;
    font-size: 21px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-info p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

audio {
    width: 100%;
}

.url-card {
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fafbfc;
}

.url-heading {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    color: #4e5663;
    font-size: 13px;
    font-weight: 750;
}

.quality-badge {
    padding: 3px 8px;
    border-radius: 999px;
    background: #e8ebf0;
    font-size: 10px;
}

#playUrlInput {
    width: 100%;
    min-height: 82px;
    resize: vertical;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    outline: none;
    background: #fff;
    color: #606875;
    font-size: 12px;
    line-height: 1.55;
}

.url-actions {
    display: flex;
    gap: 9px;
    margin-top: 10px;
}

.secondary-btn {
    min-height: 38px;
    padding: 0 13px;
    border: 1px solid var(--line);
    background: #fff;
    color: #525a66;
    font-size: 12px;
    font-weight: 700;
}

.secondary-btn:hover {
    border-color: #cfd5dd;
    color: var(--text);
}

.history-panel {
    position: sticky;
    top: 22px;
    max-height: calc(100vh - 44px);
    overflow: hidden;
}

.history-list {
    display: grid;
    gap: 10px;
    max-height: calc(100vh - 175px);
    overflow: auto;
    padding-right: 3px;
}

.history-item {
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: #fff;
}

.history-item-title {
    overflow: hidden;
    margin: 0;
    font-size: 14px;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-item-meta {
    margin: 5px 0 9px;
    color: var(--muted);
    font-size: 11px;
}

.history-url {
    overflow: hidden;
    margin-bottom: 10px;
    color: #9097a3;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.history-actions button {
    height: 31px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #f8f9fb;
    color: #626a76;
    font-size: 11px;
    font-weight: 700;
}

.history-actions button:hover {
    background: var(--accent);
    color: #fff;
}

.history-empty {
    padding: 60px 10px;
    color: #a1a8b3;
    text-align: center;
    font-size: 13px;
}

.danger-text-btn {
    padding: 5px 0;
    border: 0;
    background: transparent;
    color: var(--danger);
    font-size: 12px;
    font-weight: 700;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    z-index: 100;
    max-width: min(520px, calc(100% - 36px));
    transform: translate(-50%, 20px);
    padding: 11px 16px;
    border-radius: 12px;
    background: rgba(17,24,39,.94);
    color: #fff;
    font-size: 13px;
    opacity: 0;
    pointer-events: none;
    transition: .22s ease;
}

.toast.show {
    transform: translate(-50%, 0);
    opacity: 1;
}

@media (max-width: 1050px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .history-panel {
        position: static;
        max-height: none;
    }

    .history-list {
        max-height: none;
    }
}

@media (max-width: 680px) {
    .page-shell {
        width: min(100% - 22px, 1440px);
        padding-top: 20px;
    }

    .topbar {
        align-items: flex-end;
    }

    .subtitle {
        display: none;
    }

    .history-toggle {
        padding: 10px 12px;
        white-space: nowrap;
    }

    .search-row {
        grid-template-columns: 1fr;
    }

    .primary-btn {
        min-height: 48px;
    }

    .toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .song-item {
        grid-template-columns: 48px minmax(0, 1fr);
    }

    .song-cover {
        width: 48px;
        height: 48px;
    }

    .song-play-btn {
        grid-column: 1 / -1;
        width: 100%;
    }

    .search-panel,
    .result-panel,
    .player-panel,
    .history-panel {
        padding: 16px;
        border-radius: 18px;
    }
}


.source-badge {
    display: inline-flex;
    align-items: center;
    height: 22px;
    margin-left: 8px;
    padding: 0 8px;
    border-radius: 999px;
    background: #eef2f7;
    color: #5d6673;
    font-size: 10px;
    font-weight: 800;
    vertical-align: middle;
}

.source-badge.local {
    background: #111827;
    color: #fff;
}

.local-format-tip {
    margin-top: 8px;
    color: #9aa1ad;
    font-size: 11px;
}


.row-quality-tip {
    color: #5f6774;
    font-size: 13px;
    font-weight: 600;
}

.song-item {
    grid-template-columns: 56px minmax(0, 1fr) 190px auto;
}

.song-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-self: end;
}

.row-quality-wrap {
    width: 190px;
}

.row-quality-select {
    width: 100%;
    height: 42px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: #444c58;
    outline: none;
    font-size: 13px;
    font-weight: 700;
    transition: .18s ease;
}

.row-quality-select:focus {
    border-color: #c9d0da;
    box-shadow: 0 0 0 4px rgba(17,24,39,.04);
}

.row-quality-select:disabled {
    background: #f5f7fa;
    color: #97a0ad;
    cursor: not-allowed;
}

.song-play-btn {
    min-width: 96px;
}

@media (max-width: 860px) {
    .song-item {
        grid-template-columns: 48px minmax(0, 1fr);
    }

    .song-actions {
        grid-column: 1 / -1;
        justify-self: stretch;
        display: grid;
        grid-template-columns: 1fr 110px;
    }

    .row-quality-wrap {
        width: auto;
    }

    .song-play-btn {
        width: 100%;
    }
}


.row-quality-select[data-loading="1"] {
    opacity: .65;
    cursor: wait;
}


/* =========================
   新播放器
========================= */

.custom-player {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff, #f8f9fb);
}

.player-control-row {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
}

.player-main-btn {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 19px;
    box-shadow: 0 10px 24px rgba(17, 24, 39, .16);
    transition: .18s ease;
}

.player-main-btn:hover {
    transform: scale(1.04);
}

.player-main-btn.is-loading {
    opacity: .6;
    cursor: wait;
}

.player-progress-area {
    min-width: 0;
}

.player-progress,
#playerVolume {
    width: 100%;
    accent-color: var(--accent);
}

.player-progress {
    display: block;
    height: 5px;
}

.player-time-row {
    display: grid;
    grid-template-columns: 55px minmax(0, 1fr) 55px;
    gap: 10px;
    align-items: center;
    margin-top: 8px;
    color: var(--muted);
    font-size: 11px;
}

#playerSourceStatus {
    overflow: hidden;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-top: 15px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.volume-control {
    display: grid;
    grid-template-columns: auto 120px;
    gap: 10px;
    align-items: center;
    color: var(--muted);
    font-size: 12px;
}

.player-extra-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.player-speed {
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    outline: none;
    background: #fff;
    color: #555d69;
    font-size: 12px;
    font-weight: 700;
}

.player-error {
    color: #d84d4d !important;
}

/* 本地歌曲库不显示任何真实 URL */
.history-url {
    display: none !important;
}

.history-item {
    position: relative;
}

.history-item-meta {
    margin-bottom: 12px;
}

.history-actions {
    margin-top: 0;
}

@media (max-width: 680px) {
    .player-bottom-row {
        align-items: stretch;
        flex-direction: column;
    }

    .volume-control {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .player-extra-controls {
        justify-content: space-between;
    }
}


.player-select-group {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.song-actions {
    grid-template-columns: minmax(150px, 190px) auto auto;
}

.song-download-btn {
    min-width: 88px;
    height: 40px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: #515966;
    font-size: 13px;
    font-weight: 750;
    transition: .18s ease;
}

.song-download-btn:hover {
    border-color: #cbd1da;
    background: #f6f7f9;
    color: var(--text);
}

.song-download-btn:disabled {
    cursor: wait;
    opacity: .55;
}

@media (max-width: 860px) {
    .song-actions {
        grid-template-columns: minmax(0, 1fr) 96px 96px;
    }
}

@media (max-width: 560px) {
    .song-actions {
        grid-template-columns: 1fr 1fr;
    }

    .row-quality-wrap {
        grid-column: 1 / -1;
    }

    .player-extra-controls {
        flex-wrap: wrap;
    }
}


/* =========================
   搜索分页
========================= */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.page-numbers {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 7px;
}

.page-number-btn,
.page-nav-btn {
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fff;
    color: #59616e;
    font-size: 12px;
    font-weight: 750;
    transition: .18s ease;
}

.page-number-btn:hover,
.page-nav-btn:hover:not(:disabled) {
    border-color: #c9d0da;
    background: #f6f7f9;
    color: var(--text);
}

.page-number-btn.active {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
}

.page-nav-btn:disabled {
    cursor: not-allowed;
    opacity: .42;
}

.page-ellipsis {
    min-width: 28px;
    height: 38px;
    display: grid;
    place-items: center;
    color: #9aa1ad;
    font-size: 13px;
}

@media (max-width: 680px) {
    .pagination {
        gap: 7px;
    }

    .page-number-btn,
    .page-nav-btn {
        min-width: 34px;
        height: 36px;
        padding: 0 9px;
    }
}


/* =========================
   Plyr 第三方播放器 + 播放模式
========================= */

.plyr-player-shell {
    overflow: visible;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
}

.track-navigation-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    background: #f8f9fb;
}

.track-nav-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.track-nav-btn {
    min-width: 92px;
    height: 38px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fff;
    color: #525a67;
    font-size: 12px;
    font-weight: 750;
    transition: .18s ease;
}

.track-nav-btn:hover:not(:disabled) {
    border-color: #c8ced8;
    background: #f3f5f7;
    color: var(--text);
}

.track-nav-btn:disabled {
    cursor: wait;
    opacity: .5;
}

.play-mode-group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.player-panel .plyr {
    --plyr-color-main: var(--accent);
    --plyr-audio-controls-background: #fff;
    --plyr-audio-control-color: #525a67;
    --plyr-audio-control-color-hover: #fff;
    --plyr-menu-background: #fff;
    --plyr-menu-color: #333b47;
    width: 100%;
}

.player-panel .plyr--audio .plyr__controls {
    padding: 18px 16px;
    background: linear-gradient(180deg, #fff, #fafbfc);
}

.plyr-source-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 11px 16px;
    border-top: 1px solid var(--line);
    background: #f8f9fb;
}

.plyr-source-status {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
}

#playerSourceStatus,
#playModeHint {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#playModeHint {
    color: #8b929e;
}

.plyr-source-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.player-error {
    color: #d84d4d !important;
}

.is-player-loading {
    opacity: .82;
}

@media (max-width: 680px) {
    .track-navigation-bar,
    .plyr-source-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .track-nav-buttons {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .track-nav-btn {
        width: 100%;
    }

    .play-mode-group {
        justify-content: space-between;
    }

    .plyr-source-actions {
        justify-content: space-between;
    }

    .player-panel .plyr--audio .plyr__controls {
        padding: 14px 10px;
    }
}


/* =========================
   Plyr 设置菜单防裁切修复
========================= */

/* Plyr 的倍速/设置菜单会向播放器外部展开，
   外层必须允许 overflow visible。 */
.plyr-player-shell,
.player-panel,
.player-main,
.player-content {
    overflow: visible !important;
}

/* 保证设置弹窗浮在播放器和其他卡片上面 */
.player-panel .plyr {
    position: relative;
    z-index: 20;
}

.player-panel .plyr__menu__container {
    z-index: 99999 !important;
    max-height: min(360px, 70vh);
    overflow-y: auto;
    overscroll-behavior: contain;
    box-shadow: 0 14px 36px rgba(20, 28, 40, .18);
}

/* 设置按钮附近的弹层不要被父级裁切 */
.player-panel .plyr__controls,
.player-panel .plyr__menu,
.player-panel .plyr__menu__container {
    overflow: visible;
}

/* 窄屏下限制菜单宽度，防止超出屏幕 */
@media (max-width: 680px) {
    .player-panel .plyr__menu__container {
        max-width: min(280px, calc(100vw - 28px));
        max-height: 60vh;
    }

    .player-panel .plyr__controls {
        position: relative;
        z-index: 30;
    }

    .plyr-player-shell {
        position: relative;
        z-index: 10;
    }
}


/* =========================
   星耀榜
========================= */

.search-action-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rank-entry-btn {
    height: 46px;
    padding: 0 18px;
    border: 1px solid #e4c46d;
    border-radius: 14px;
    background:
        linear-gradient(
            135deg,
            #fff9e7,
            #f8e7aa
        );
    color: #735515;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
    box-shadow:
        0 8px 22px
        rgba(169, 126, 25, .10);
    transition: .18s ease;
}

.rank-entry-btn:hover {
    transform:
        translateY(-1px);
    border-color:
        #d5ae48;
    background:
        linear-gradient(
            135deg,
            #fff6d4,
            #f4dc89
        );
}

.rank-entry-btn:disabled {
    cursor: wait;
    opacity: .6;
    transform: none;
}

.source-badge.rank {
    border-color:
        #e2c36a;
    background:
        #fff7db;
    color:
        #8c6815;
}

.rank-number-badge {
    display:
        inline-flex;
    align-items:
        center;
    justify-content:
        center;
    min-width:
        34px;
    height:
        24px;
    margin-right:
        7px;
    padding:
        0 8px;
    border:
        1px solid
        #ead17e;
    border-radius:
        999px;
    background:
        #fff8df;
    color:
        #87610e;
    font-size:
        11px;
    font-weight:
        850;
    vertical-align:
        1px;
}

.rank-extra-info {
    color:
        #8c7342;
}

@media (max-width: 680px) {
    .search-row {
        align-items:
            stretch;
    }

    .search-action-buttons {
        width:
            100%;
    }

    .search-action-buttons
    > button {
        flex:
            1;
    }
}


/* =========================
   同步歌词
========================= */

.lyrics-panel {
    margin-top: 16px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
}

.lyrics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 13px 16px;
    border-bottom: 1px solid var(--line);
    background: #f8f9fb;
}

.lyrics-header h3 {
    margin: 0 0 3px;
    font-size: 14px;
    color: var(--text);
}

#lyricsStatus {
    display: block;
    color: var(--muted);
    font-size: 11px;
}

.lyrics-toggle-btn {
    height: 32px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    color: #626a76;
    font-size: 11px;
    font-weight: 750;
}

.lyrics-viewport {
    position: relative;
    height: 300px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scroll-behavior: smooth;
    padding: 120px 18px;
}

.lyrics-panel.collapsed
.lyrics-viewport {
    display: none;
}

.lyric-line {
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 10px;
    color: #8b929d;
    font-size: 13px;
    line-height: 1.7;
    text-align: center;
    cursor: pointer;
    transition:
        transform .18s ease,
        color .18s ease,
        background .18s ease;
}

.lyric-line:hover {
    color: #555d68;
    background: #f7f8fa;
}

.lyric-line.active {
    color: var(--accent);
    background: rgba(30, 34, 43, .055);
    font-size: 15px;
    font-weight: 800;
    transform: scale(1.025);
}

.lyrics-placeholder {
    display: grid;
    place-items: center;
    min-height: 60px;
    color: #a0a6af;
    font-size: 12px;
    text-align: center;
}

@media (max-width: 680px) {
    .lyrics-viewport {
        height: 250px;
        padding-top: 100px;
        padding-bottom: 100px;
    }

    .lyric-line {
        font-size: 12px;
    }

    .lyric-line.active {
        font-size: 14px;
    }
}


/* =========================
   星耀榜入口与播放器位置
========================= */

.rank-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.rank-toolbar-tip {
    color: var(--muted);
    font-size: 12px;
}

#playerPanel {
    margin-top: 18px;
    margin-bottom: 18px;
}

@media (max-width: 680px) {
    .rank-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .rank-entry-btn {
        width: 100%;
    }

    .rank-toolbar-tip {
        padding-left: 2px;
    }
}


/* =========================
   精确同步歌词 / 卡拉 OK 颜色推进
========================= */

.lyric-line {
    --lyric-progress: 0%;
}

.lyric-line .lyric-line-text {
    display: inline-block;
    max-width: 100%;
    color: #8b929d;
    transition:
        transform .15s ease,
        font-weight .15s ease;
}

.lyric-line.active {
    background:
        rgba(30, 34, 43, .045);
    transform:
        scale(1.025);
}

/* 当前正在唱的歌词：
   左边已唱部分使用主色，
   右边未唱部分保持灰色。 */
.lyric-line.active
.lyric-line-text {
    color: transparent;
    background:
        linear-gradient(
            90deg,
            var(--accent)
                0%,
            var(--accent)
                var(--lyric-progress),
            #8b929d
                var(--lyric-progress),
            #8b929d
                100%
        );
    -webkit-background-clip:
        text;
    background-clip:
        text;
    font-size: 15px;
    font-weight: 850;
}

/* 已唱完的歌词保持较深颜色 */
.lyric-line:not(.active) {
    color:
        #8b929d;
}

@media (max-width: 680px) {
    .lyric-line.active
    .lyric-line-text {
        font-size:
            14px;
    }
}


/* =========================
   歌词实时同步最终修复
========================= */

.lyric-line {
    --lyric-progress: 0%;
}

.lyric-line .lyric-line-text {
    display: inline-block;
    max-width: 100%;
    color: #8b929d;
}

.lyric-line.active {
    color: inherit !important;
    background: rgba(30, 34, 43, .055);
    transform: scale(1.025);
}

.lyric-line.active .lyric-line-text {
    color: transparent !important;
    font-weight: 850;
    background-image:
        linear-gradient(
            90deg,
            var(--accent)
                0%,
            var(--accent)
                var(--lyric-progress),
            #8b929d
                var(--lyric-progress),
            #8b929d
                100%
        );
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.lyric-line:not(.active)
.lyric-line-text {
    color: #8b929d;
    -webkit-text-fill-color: #8b929d;
}



/* ==========================================================
   MV / DPlayer
========================================================== */
.song-mv-btn{min-width:58px;height:38px;padding:0 14px;border:1px solid rgba(123,92,246,.22);border-radius:11px;background:linear-gradient(135deg,#faf7ff,#ede7ff);color:#6746d9;font-size:12px;font-weight:850;box-shadow:0 6px 18px rgba(103,70,217,.08);transition:.18s ease}.song-mv-btn::before{content:"▶";margin-right:5px;font-size:9px}.song-mv-btn:hover:not(:disabled){transform:translateY(-1px);border-color:rgba(103,70,217,.42);box-shadow:0 10px 24px rgba(103,70,217,.14)}.song-mv-btn:disabled{cursor:wait;opacity:.58}
.mv-modal{position:fixed;inset:0;z-index:999999;display:grid;place-items:center;padding:24px}.mv-modal.hidden{display:none}.mv-modal-backdrop{position:absolute;inset:0;background:rgba(8,10,16,.78);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px)}
.mv-dialog{position:relative;z-index:1;width:min(1180px,calc(100vw - 48px));max-height:calc(100vh - 48px);overflow:hidden;border:1px solid rgba(255,255,255,.13);border-radius:26px;background:linear-gradient(180deg,#191b23,#0d0f15);box-shadow:0 40px 120px rgba(0,0,0,.56);color:#fff}.mv-dialog-header{display:flex;justify-content:space-between;align-items:center;gap:20px;min-height:84px;padding:16px 20px 15px 24px;border-bottom:1px solid rgba(255,255,255,.08)}.mv-title-area{min-width:0}.mv-kicker{display:block;margin-bottom:4px;color:#bba9ff;font-size:10px;font-weight:900;letter-spacing:2px}#mvTitle{margin:0;overflow:hidden;font-size:19px;text-overflow:ellipsis;white-space:nowrap}.mv-meta-row{display:flex;align-items:center;gap:7px;margin-top:5px;color:rgba(255,255,255,.55);font-size:11px}.mv-close-btn{width:42px;height:42px;border:1px solid rgba(255,255,255,.1);border-radius:13px;background:rgba(255,255,255,.06);color:#fff;font-size:27px;line-height:1}
.mv-stage-wrap{position:relative;width:100%;aspect-ratio:16/9;max-height:calc(100vh - 220px);overflow:hidden;background:radial-gradient(circle at 50% 45%,#222735,#090a0e 65%)}.mv-dplayer,.mv-dplayer .dplayer,.mv-dplayer .dplayer-video-wrap{width:100%;height:100%}.mv-dplayer .dplayer{background:#000}.mv-dplayer .dplayer-video{object-fit:contain}.mv-loading{position:absolute;inset:0;z-index:20;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:8px;background:radial-gradient(circle at center,#262a38,#07080c);color:rgba(255,255,255,.72)}.mv-loading.hidden{display:none}.mv-loading strong{color:#fff;font-size:14px}.mv-loading span{font-size:11px}.mv-loading-spinner{width:38px;height:38px;border:3px solid rgba(255,255,255,.12);border-top-color:#9277ff;border-radius:50%;animation:mv-spin .75s linear infinite}@keyframes mv-spin{to{transform:rotate(360deg)}}
.mv-control-bar{display:flex;justify-content:space-between;align-items:center;gap:20px;min-height:68px;padding:12px 18px 12px 22px;border-top:1px solid rgba(255,255,255,.07);background:#0e1016}.mv-source-info{min-width:0;display:flex;align-items:center;gap:9px;color:rgba(255,255,255,.58);font-size:11px}#mvStatus{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mv-live-dot{width:7px;height:7px;flex:0 0 auto;border-radius:50%;background:#56d38b;box-shadow:0 0 0 5px rgba(86,211,139,.09)}.mv-actions{display:flex;align-items:center;gap:8px;flex:0 0 auto}.mv-resume-option{display:inline-flex;align-items:center;gap:7px;margin-right:4px;color:rgba(255,255,255,.58);font-size:11px;cursor:pointer}.mv-resume-option input{accent-color:#8d72ff}.mv-tool-btn{height:36px;padding:0 13px;border:1px solid rgba(255,255,255,.11);border-radius:10px;background:rgba(255,255,255,.055);color:rgba(255,255,255,.82);font-size:11px;font-weight:760}.mv-tool-btn.accent{border-color:rgba(141,114,255,.34);background:linear-gradient(135deg,#8265f0,#694fd0);color:#fff}.mv-modal-open{overflow:hidden}
.mv-inline-error{position:absolute;inset:0;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:8px;padding:28px;color:rgba(255,255,255,.65);text-align:center}.mv-inline-error-icon{display:grid;place-items:center;width:58px;height:58px;border:1px solid rgba(141,114,255,.28);border-radius:18px;background:rgba(141,114,255,.1);color:#a995ff;font-weight:900}.mv-inline-error strong{color:#fff;font-size:15px}.mv-inline-error p,.mv-inline-error small{max-width:680px;margin:0;line-height:1.7}
@media(max-width:800px){.mv-modal{padding:0}.mv-dialog{width:100vw;max-height:100vh;border:0;border-radius:0}.mv-dialog-header{min-height:72px;padding:12px 14px 11px 16px}.mv-stage-wrap{max-height:none}.mv-control-bar{align-items:stretch;flex-direction:column;gap:10px;padding:12px}.mv-actions{display:grid;grid-template-columns:repeat(3,1fr)}.mv-resume-option{grid-column:1/-1}.mv-tool-btn{width:100%}}


/* ==========================================================
   MV 页面内嵌播放
========================================================== */

.mv-inline-panel {
    position: relative;
    z-index: 1;
    display: block;
    padding: 0;
    margin-top: 18px;
    margin-bottom: 18px;
    overflow: hidden;
    border: 1px solid rgba(124, 101, 234, .18);
    border-radius: 22px;
    background:
        linear-gradient(
            180deg,
            #191b23,
            #0d0f15
        );
    box-shadow:
        0 18px 48px
        rgba(15, 18, 30, .12);
    color: #fff;
}

.mv-inline-panel.hidden {
    display: none;
}

.mv-inline-header {
    min-height: 78px;
    padding:
        15px
        18px
        14px
        22px;
}

.mv-inline-close-btn {
    height: 38px;
    padding: 0 15px;
    border:
        1px solid
        rgba(255, 255, 255, .12);
    border-radius: 11px;
    background:
        rgba(255, 255, 255, .07);
    color:
        rgba(255, 255, 255, .9);
    font-size: 12px;
    font-weight: 780;
    cursor: pointer;
    transition:
        transform .18s ease,
        background .18s ease;
}

.mv-inline-close-btn:hover {
    transform: translateY(-1px);
    background:
        rgba(255, 255, 255, .13);
}

.mv-inline-panel .mv-stage-wrap {
    width: 100%;
    max-height: none;
    aspect-ratio: 16 / 9;
}

.mv-inline-panel .mv-dplayer {
    min-height: 320px;
}

.mv-inline-panel .mv-control-bar {
    position: relative;
}

.mv-inline-panel + #resultPanel {
    margin-top: 18px;
}

/* 原弹窗逻辑不再使用 */
.mv-modal-backdrop {
    display: none !important;
}

body.mv-modal-open {
    overflow: auto !important;
}

@media (max-width: 800px) {
    .mv-inline-panel {
        margin-top: 14px;
        margin-bottom: 14px;
        border-radius: 16px;
    }

    .mv-inline-header {
        min-height: 68px;
        padding:
            12px
            13px
            11px
            15px;
    }

    .mv-inline-close-btn {
        height: 34px;
        padding: 0 11px;
        font-size: 11px;
    }

    .mv-inline-panel .mv-dplayer {
        min-height: 220px;
    }
}


/* ==========================================================
   猜你喜欢
========================================================== */

.discover-entry-buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
}

.recommend-entry-btn {
    height: 38px;
    padding: 0 17px;
    border:
        1px solid
        rgba(239, 95, 132, .2);
    border-radius: 11px;
    background:
        linear-gradient(
            135deg,
            #fff7f9,
            #ffecef
        );
    color: #d84d72;
    font-size: 12px;
    font-weight: 850;
    box-shadow:
        0 7px 20px
        rgba(216, 77, 114, .08);
    transition:
        transform .18s ease,
        box-shadow .18s ease,
        border-color .18s ease;
}

.recommend-entry-btn:hover:not(:disabled) {
    transform:
        translateY(-1px);
    border-color:
        rgba(216, 77, 114, .4);
    box-shadow:
        0 10px 26px
        rgba(216, 77, 114, .14);
}

.recommend-entry-btn:disabled {
    cursor: wait;
    opacity: .58;
}

.source-badge.recommend {
    border-color:
        rgba(216, 77, 114, .18);
    background:
        rgba(255, 238, 243, .9);
    color: #cc4e70;
}

.recommend-extra-info {
    color: #9d6d7b;
}

@media (max-width: 680px) {
    .discover-entry-buttons {
        width: 100%;
    }

    .recommend-entry-btn,
    .rank-entry-btn {
        flex: 1 1 140px;
    }
}


/* =========================
   本地歌曲库密码清空
========================= */

.library-manage-btn {
    border: 1px solid rgba(148, 163, 184, 0.34);
    background: rgba(255, 255, 255, 0.86);
    color: #64748b;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease,
        color 0.18s ease;
}

.library-manage-btn:hover {
    color: #334155;
    border-color: rgba(59, 130, 246, 0.45);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

.library-clear-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.38);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
}

.library-clear-modal[hidden] {
    display: none;
}

.library-clear-dialog {
    width: min(410px, 100%);
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.22);
    padding: 28px;
    animation: libraryClearDialogIn 0.2s ease;
}

@keyframes libraryClearDialogIn {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.library-clear-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    margin-bottom: 14px;
    border-radius: 15px;
    background: #eff6ff;
    font-size: 21px;
}

.library-clear-dialog h3 {
    margin: 0;
    color: #0f172a;
    font-size: 20px;
}

.library-clear-dialog p {
    margin: 8px 0 20px;
    color: #64748b;
    font-size: 14px;
    line-height: 1.7;
}

.library-clear-label {
    display: block;
    margin-bottom: 8px;
    color: #334155;
    font-size: 13px;
    font-weight: 700;
}

.library-clear-password {
    box-sizing: border-box;
    width: 100%;
    height: 46px;
    border: 1px solid #dbe3ef;
    border-radius: 13px;
    outline: none;
    padding: 0 14px;
    color: #0f172a;
    background: #f8fafc;
    font-size: 15px;
    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        background 0.18s ease;
}

.library-clear-password:focus {
    border-color: #60a5fa;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.11);
}

.library-clear-error {
    min-height: 20px;
    margin-top: 8px;
    color: #ef4444;
    font-size: 13px;
}

.library-clear-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
}

.library-clear-cancel-btn,
.library-clear-confirm-btn {
    min-width: 96px;
    height: 40px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
}

.library-clear-cancel-btn {
    border: 1px solid #dbe3ef;
    background: #fff;
    color: #475569;
}

.library-clear-confirm-btn {
    border: 1px solid #ef4444;
    background: #ef4444;
    color: #fff;
}

.library-clear-confirm-btn:disabled {
    opacity: 0.65;
    cursor: wait;
}

@media (max-width: 560px) {
    .library-clear-dialog {
        padding: 22px;
        border-radius: 20px;
    }

    .library-clear-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .library-clear-cancel-btn,
    .library-clear-confirm-btn {
        width: 100%;
    }
}


/* ==========================================================
   手机优先优化 / UI 美化（v12）
========================================================== */

:root {
    --mobile-safe-top: env(safe-area-inset-top, 0px);
    --mobile-safe-right: env(safe-area-inset-right, 0px);
    --mobile-safe-bottom: env(safe-area-inset-bottom, 0px);
    --mobile-safe-left: env(safe-area-inset-left, 0px);
    --card-shadow-soft: 0 14px 35px rgba(17, 24, 39, .08);
    --card-shadow-strong: 0 18px 45px rgba(17, 24, 39, .12);
    --glass-bg: rgba(255, 255, 255, .82);
}

html {
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.topbar {
    padding: 2px;
}

.panel {
    border: 1px solid rgba(255,255,255,.82);
}

.search-panel,
.player-panel,
.result-panel,
.history-panel,
.mv-inline-panel {
    box-shadow: var(--card-shadow-soft);
}

.search-panel {
    background:
        linear-gradient(180deg, rgba(255,255,255,.96), rgba(249,250,252,.92));
}

.search-box input,
.row-quality-select,
.player-speed,
.song-download-btn,
.song-play-btn,
.song-mv-btn,
.track-nav-btn,
.page-number-btn,
.page-nav-btn,
.recommend-entry-btn,
.rank-entry-btn,
.library-manage-btn,
.ghost-btn,
.primary-btn,
.mv-tool-btn,
.lyrics-toggle-btn {
    -webkit-tap-highlight-color: transparent;
}

.song-item,
.history-item {
    box-shadow: 0 8px 22px rgba(17, 24, 39, .04);
}

.song-item:hover,
.history-item:hover {
    box-shadow: 0 14px 30px rgba(17, 24, 39, .08);
}

.primary-btn {
    background: linear-gradient(135deg, #111827, #273349);
    box-shadow: 0 10px 24px rgba(17,24,39,.16);
}

.primary-btn:hover {
    box-shadow: 0 14px 30px rgba(17,24,39,.22);
}

#playerPanel:not(.hidden) {
    border-color: rgba(120, 136, 167, .18);
    background:
        linear-gradient(180deg, rgba(255,255,255,.97), rgba(247,249,252,.94));
}

.now-playing {
    gap: 18px;
}

.cover-wrap {
    box-shadow: 0 10px 26px rgba(17, 24, 39, .10);
}

.plyr-player-shell,
.lyrics-panel {
    box-shadow: inset 0 1px 0 rgba(255,255,255,.75);
}

.history-panel {
    background:
        linear-gradient(180deg, rgba(255,255,255,.96), rgba(246,248,251,.92));
}

.history-empty {
    min-height: 160px;
    display: grid;
    place-items: center;
    border: 1px dashed #d9dee6;
    border-radius: 16px;
    background: rgba(255,255,255,.64);
}

#resultSummary,
#searchStatus,
.rank-toolbar-tip,
.subtitle,
.panel-title-row p {
    line-height: 1.55;
}

@media (max-width: 900px) {
    .page-shell {
        width: min(100% - 22px, 1440px);
        padding-top: 18px;
        padding-bottom: calc(32px + var(--mobile-safe-bottom));
    }

    .topbar {
        gap: 16px;
        margin-bottom: 18px;
        padding: 14px 14px 12px;
        border: 1px solid rgba(255,255,255,.72);
        border-radius: 22px;
        background: var(--glass-bg);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
        box-shadow: var(--card-shadow-soft);
    }

    .layout,
    .main-column {
        gap: 16px;
    }

    .search-panel,
    .result-panel,
    .player-panel,
    .history-panel {
        padding: 18px;
    }

    .panel-title-row {
        gap: 12px;
        margin-bottom: 14px;
    }

    .panel-title-row h2 {
        font-size: 18px;
    }

    .song-title,
    .history-item-title,
    .player-info h2 {
        white-space: normal;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .song-title {
        -webkit-line-clamp: 2;
        line-height: 1.35;
        min-height: 2.7em;
    }

    .history-item-title,
    .player-info h2 {
        -webkit-line-clamp: 2;
        line-height: 1.35;
    }

    .song-meta,
    .player-info p,
    .history-item-meta {
        white-space: normal;
        line-height: 1.5;
    }

    .track-navigation-bar,
    .plyr-source-toolbar,
    .lyrics-header {
        padding-left: 14px;
        padding-right: 14px;
    }

    .lyrics-viewport {
        padding-left: 14px;
        padding-right: 14px;
    }
}

@media (max-width: 680px) {
    body {
        background:
            radial-gradient(circle at top left, rgba(255,255,255,.94), transparent 32%),
            radial-gradient(circle at top right, rgba(227,233,242,.82), transparent 28%),
            #f4f6f9;
    }

    .page-shell {
        width: auto;
        margin: 0;
        padding:
            calc(12px + var(--mobile-safe-top))
            calc(12px + var(--mobile-safe-right))
            calc(84px + var(--mobile-safe-bottom))
            calc(12px + var(--mobile-safe-left));
    }

    .topbar {
        position: sticky;
        top: calc(8px + var(--mobile-safe-top));
        z-index: 40;
        align-items: flex-start;
        gap: 12px;
        margin-bottom: 14px;
        padding: 14px;
        border-radius: 20px;
        background: rgba(255,255,255,.88);
        box-shadow: 0 12px 32px rgba(17,24,39,.10);
    }

    .topbar h1 {
        font-size: clamp(24px, 7vw, 30px);
    }

    .subtitle {
        display: block;
        margin-top: 8px;
        font-size: 13px;
    }

    .eyebrow {
        margin-bottom: 5px;
        font-size: 11px;
    }

    .history-toggle {
        position: fixed;
        right: calc(14px + var(--mobile-safe-right));
        bottom: calc(18px + var(--mobile-safe-bottom));
        z-index: 60;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 12px 14px;
        border: 1px solid rgba(17,24,39,.12);
        border-radius: 999px;
        background: rgba(17,24,39,.96);
        color: #fff;
        box-shadow: 0 14px 34px rgba(17,24,39,.22);
    }

    .history-toggle .count-badge {
        background: rgba(255,255,255,.14);
        color: #fff;
        margin-left: 0;
    }

    .search-panel,
    .result-panel,
    .player-panel,
    .history-panel {
        padding: 14px;
        border-radius: 18px;
    }

    .search-row {
        gap: 10px;
    }

    .search-box input {
        height: 52px;
        padding-left: 46px;
        border-radius: 15px;
        font-size: 15px;
    }

    .search-icon {
        left: 16px;
        font-size: 20px;
    }

    .primary-btn {
        min-height: 50px;
        border-radius: 15px;
        font-size: 15px;
    }

    .toolbar {
        gap: 10px;
        margin-top: 12px;
    }

    .row-quality-tip,
    .status-text,
    .rank-toolbar-tip {
        font-size: 12px;
    }

    .discover-entry-buttons {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .recommend-entry-btn,
    .rank-entry-btn {
        width: 100%;
        height: 42px;
        padding: 0 12px;
        border-radius: 13px;
        font-size: 13px;
    }

    .song-list {
        gap: 12px;
    }

    .song-item {
        gap: 12px;
        padding: 12px;
        border-radius: 18px;
        background: linear-gradient(180deg, #fff, #fbfcfd);
    }

    .song-cover {
        width: 52px;
        height: 52px;
        border-radius: 15px;
    }

    .song-actions {
        gap: 8px;
        grid-template-columns: 1fr 1fr;
        align-items: stretch;
    }

    .row-quality-wrap {
        grid-column: 1 / -1;
    }

    .row-quality-select,
    .song-play-btn,
    .song-download-btn,
    .song-mv-btn {
        width: 100%;
        height: 44px;
        border-radius: 12px;
        font-size: 13px;
    }

    .song-play-btn,
    .song-download-btn,
    .song-mv-btn {
        min-width: 0;
    }

    .song-debug {
        margin-top: 7px;
        line-height: 1.45;
    }

    .empty-state {
        min-height: 220px;
        padding: 12px;
    }

    .now-playing {
        align-items: flex-start;
        gap: 14px;
    }

    .cover-wrap {
        width: 68px;
        height: 68px;
        border-radius: 16px;
    }

    .playing-label {
        font-size: 10px;
    }

    .player-info h2 {
        margin-top: 4px;
        margin-bottom: 6px;
        font-size: 18px;
    }

    .plyr-player-shell {
        border-radius: 16px;
    }

    .track-navigation-bar,
    .plyr-source-toolbar,
    .lyrics-header {
        gap: 10px;
        padding: 12px;
    }

    .track-nav-buttons {
        gap: 10px;
    }

    .track-nav-btn {
        min-width: 0;
        height: 40px;
        border-radius: 12px;
        font-size: 13px;
    }

    .play-mode-group,
    .player-select-group {
        width: 100%;
        justify-content: space-between;
        font-size: 12px;
    }

    .player-speed {
        min-width: 118px;
        height: 36px;
        border-radius: 10px;
        font-size: 12px;
    }

    .plyr-source-actions {
        width: 100%;
        align-items: stretch;
        flex-direction: column;
    }

    .quality-badge {
        align-self: flex-start;
        padding: 4px 9px;
    }

    .lyrics-panel {
        margin-top: 14px;
        border-radius: 16px;
    }

    .lyrics-header h3 {
        font-size: 15px;
    }

    .lyrics-toggle-btn {
        flex: 0 0 auto;
    }

    .lyrics-viewport {
        height: 220px;
        padding-top: 85px;
        padding-bottom: 85px;
    }

    .lyric-line {
        min-height: 38px;
        padding: 7px 10px;
        font-size: 13px;
        line-height: 1.6;
    }

    .lyric-line.active,
    .lyric-line.active .lyric-line-text {
        transform: none;
    }

    .mv-inline-panel {
        border-radius: 18px;
    }

    .mv-inline-header {
        min-height: 72px;
        padding: 12px 14px;
    }

    .mv-title-area h2,
    #mvTitle {
        font-size: 16px;
    }

    .mv-control-bar {
        gap: 10px;
    }

    .mv-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .mv-resume-option {
        grid-column: 1 / -1;
    }

    .mv-tool-btn {
        width: 100%;
        min-height: 38px;
    }

    .pagination {
        gap: 8px;
        margin-top: 18px;
        padding-top: 16px;
    }

    .page-numbers {
        gap: 6px;
    }

    .page-number-btn,
    .page-nav-btn {
        min-width: 36px;
        height: 36px;
        padding: 0 10px;
        border-radius: 10px;
        font-size: 12px;
    }

    .history-panel {
        scroll-margin-top: 90px;
    }

    .history-list {
        gap: 10px;
        padding-right: 0;
    }

    .history-item {
        padding: 12px;
        border-radius: 16px;
        background: linear-gradient(180deg, #fff, #fbfcfd);
    }

    .history-item-meta {
        margin-top: 6px;
        margin-bottom: 10px;
        font-size: 12px;
    }

    .history-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .history-actions button {
        height: 38px;
        border-radius: 11px;
        font-size: 12px;
    }

    .library-manage-btn {
        padding: 9px 12px;
        font-size: 12px;
    }

    .library-clear-dialog {
        width: min(100%, 360px);
        margin: 0 12px;
        padding: 18px 16px;
    }

    .toast {
        bottom: calc(84px + var(--mobile-safe-bottom));
    }
}

@media (max-width: 420px) {
    .topbar {
        padding: 12px;
        gap: 10px;
    }

    .subtitle {
        font-size: 12px;
    }

    .discover-entry-buttons {
        grid-template-columns: 1fr;
    }

    .song-actions,
    .history-actions,
    .mv-actions {
        grid-template-columns: 1fr;
    }

    .search-panel,
    .result-panel,
    .player-panel,
    .history-panel {
        padding: 13px;
    }

    .track-nav-buttons {
        grid-template-columns: 1fr;
    }

    .page-number-btn,
    .page-nav-btn {
        min-width: 34px;
    }
}
