:root {
    --accent-color: #7bc9ff;
    --accent-soft: #e2f6ff;
    --accent-cool: #9dffdb;
    --overlay-opacity: 0.48;
    --panel-blur: 20px;
    --text-color: #f7f3ff;
    --text-soft: rgba(247, 243, 255, 0.76);
    --panel-bg: rgba(14, 16, 25, 0.36);
    --panel-border: rgba(255, 255, 255, 0.16);
    --panel-shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    position: relative;
    overflow-x: hidden;
    color: var(--text-color);
    background: #0a0d16;
    font-family: "Outfit", "PingFang SC", "Microsoft YaHei", sans-serif;
}

body.loaded .loader {
    opacity: 0;
    visibility: hidden;
}

.loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    background: #0a0d16;
    transition: opacity 0.45s ease, visibility 0.45s ease;
}

.loader-ring {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.15);
    border-top-color: var(--accent-color);
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.background-layer,
.background-gradient,
.background-mesh,
.orb,
#particle-container {
    position: fixed;
    inset: 0;
}

.background-layer {
    background-image: var(--page-background-image);
    background-size: cover;
    background-position: center;
    transform: scale(1.04);
    filter: saturate(1.04) contrast(1.02);
}

.background-gradient {
    background:
        radial-gradient(circle at 20% 20%, rgba(122, 216, 255, 0.22), transparent 28%),
        radial-gradient(circle at 80% 15%, rgba(157, 255, 219, 0.16), transparent 24%),
        linear-gradient(180deg, rgba(7, 10, 18, 0.18), rgba(7, 10, 18, var(--overlay-opacity)));
}

.background-mesh {
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 30px 30px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.14), rgba(0, 0, 0, 1));
}

.orb {
    filter: blur(60px);
    opacity: 0.55;
    animation: float 18s ease-in-out infinite;
}

.orb-a {
    inset: auto auto 12% 8%;
    width: 240px;
    height: 240px;
    background: rgba(123, 201, 255, 0.26);
}

.orb-b {
    inset: 10% 10% auto auto;
    width: 220px;
    height: 220px;
    background: rgba(157, 255, 219, 0.18);
    animation-duration: 22s;
}

.orb-c {
    inset: auto 20% 18% auto;
    width: 180px;
    height: 180px;
    background: rgba(226, 246, 255, 0.18);
    animation-duration: 20s;
}

@keyframes float {
    0%, 100% {
        transform: translate3d(0, 0, 0);
    }
    50% {
        transform: translate3d(0, -24px, 0);
    }
}

#particle-container {
    pointer-events: none;
    z-index: 10;
}

.particle {
    position: absolute;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.95), rgba(123, 201, 255, 0.4));
    animation: burst 820ms ease-out forwards;
}

@keyframes burst {
    to {
        transform: translate(var(--move-x), var(--move-y)) scale(0.25);
        opacity: 0;
    }
}

.dream-shell {
    position: relative;
    z-index: 3;
    width: min(1280px, calc(100vw - 40px));
    margin: 0 auto;
    padding: 72px 0 132px;
}

.hero-panel,
.glass-card {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    backdrop-filter: blur(var(--panel-blur));
    box-shadow: var(--panel-shadow);
}

.hero-panel {
    padding: 36px;
    border-radius: 32px;
}

.hero-brand {
    margin: 0 0 14px;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--accent-soft);
    font-size: 12px;
}

.hero-title {
    margin: 0;
    font-family: "Noto Serif SC", serif;
    display: block;
    max-width: 100%;
    overflow: hidden;
    font-size: clamp(1.76rem, 2.15vw + 0.38rem, 3rem);
    line-height: 1.18;
    letter-spacing: -0.025em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hero-subtitle {
    width: min(760px, 100%);
    margin: 18px 0 0;
    line-height: 1.8;
    color: var(--text-soft);
    font-size: 1.04rem;
}

.quote-panel {
    margin-top: 28px;
    padding: 20px 22px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.quote-label {
    display: inline-block;
    margin-bottom: 12px;
    color: var(--accent-cool);
    font-size: 13px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.quote-current {
    margin: 0;
    font-size: clamp(1.2rem, 2vw, 1.7rem);
    line-height: 1.7;
}

.quote-meta {
    margin: 12px 0 0;
    color: var(--text-soft);
    font-size: 13px;
    letter-spacing: 0.04em;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

.tag-item {
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-soft);
    font-size: 14px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 22px;
}

.glass-card {
    min-height: 178px;
    padding: 24px;
    border-radius: 24px;
}

.glass-card h2 {
    margin: 0 0 12px;
    font-size: 1.15rem;
}

.glass-card p {
    margin: 0;
    line-height: 1.8;
    color: var(--text-soft);
}

.reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

body.loaded .reveal {
    opacity: 1;
    transform: translateY(0);
}

.player-dock {
    position: fixed;
    left: 18px;
    right: 18px;
    bottom: 18px;
    z-index: 6;
}

.custom-player {
    position: relative;
    width: 100%;
    padding: 16px 18px;
    background: rgba(10, 12, 18, 0.56);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 26px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(var(--panel-blur));
    overflow: hidden;
}

.custom-player[data-playlist-open="true"] .playlist-panel {
    margin-top: 14px;
    max-height: min(320px, 48vh);
    padding-top: 14px;
    opacity: 1;
    border-top-color: rgba(255, 255, 255, 0.08);
}

.player-cover-wrap {
    width: 62px;
}

.player-cover {
    display: block;
    width: 62px;
    height: 62px;
    object-fit: cover;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.06);
}

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

.player-head {
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.player-meta {
    min-width: 0;
    flex: 1 1 auto;
}

.player-title {
    color: var(--text-color);
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-artist {
    margin-top: 4px;
    color: var(--text-soft);
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-self: end;
}

.player-btn {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.player-btn:disabled {
    opacity: 0.46;
    cursor: not-allowed;
}

.player-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.player-btn:disabled:hover {
    background: rgba(255, 255, 255, 0.05);
}

.player-btn svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
    pointer-events: none;
}

.player-progress {
    position: relative;
    height: 8px;
    margin-top: 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
}

.player-progress-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent-color), var(--accent-cool));
}

.player-progress-thumb {
    position: absolute;
    top: 50%;
    left: 0;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.24);
    transform: translate(-50%, -50%);
}

.player-foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 10px;
    color: var(--text-soft);
    font-size: 12px;
    min-width: 0;
}

.player-time {
    white-space: nowrap;
}

.playlist-panel {
    margin-top: 0;
    max-height: 0;
    min-width: 0;
    overflow: hidden;
    padding-top: 0;
    opacity: 0;
    border-top: 1px solid transparent;
    transition: max-height 0.28s ease, opacity 0.22s ease, margin-top 0.28s ease, padding-top 0.28s ease, border-top-color 0.28s ease;
}

.playlist-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    color: var(--text-soft);
    font-size: 12px;
    letter-spacing: 0.04em;
}

.playlist-count {
    white-space: nowrap;
}

.playlist-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: min(260px, 36vh);
    overflow: auto;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(123, 201, 255, 0.38) rgba(255, 255, 255, 0.04);
}

.playlist-list::-webkit-scrollbar {
    width: 8px;
}

.playlist-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 999px;
}

.playlist-list::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(123, 201, 255, 0.5), rgba(157, 255, 219, 0.34));
    border: 2px solid transparent;
    border-radius: 999px;
    background-clip: padding-box;
}

.playlist-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(123, 201, 255, 0.7), rgba(157, 255, 219, 0.5));
    border: 2px solid transparent;
    background-clip: padding-box;
}

.playlist-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-color);
    cursor: pointer;
    text-align: left;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.playlist-item:hover {
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-1px);
}

.playlist-item.is-active {
    border-color: rgba(123, 201, 255, 0.34);
    background: linear-gradient(135deg, rgba(123, 201, 255, 0.12), rgba(157, 255, 219, 0.08));
}

.playlist-item-index {
    flex: 0 0 28px;
    color: var(--text-soft);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.playlist-item-body {
    min-width: 0;
    flex: 1 1 auto;
}

.playlist-item-name,
.playlist-item-artist {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-item-name {
    font-size: 14px;
}

.playlist-item-artist {
    margin-top: 4px;
    color: var(--text-soft);
    font-size: 12px;
}

.playlist-empty {
    padding: 10px 4px;
    color: var(--text-soft);
    font-size: 13px;
}

#audio-player {
    display: none;
}

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

    .hero-title {
        overflow: visible;
        white-space: normal;
        text-overflow: clip;
    }
}

@media (max-width: 720px) {
    .dream-shell {
        width: calc(100vw - 24px);
        padding: 18px 0 132px;
    }

    .hero-panel {
        padding: 22px;
        border-radius: 24px;
    }

    .hero-title {
        font-size: clamp(1.8rem, 9vw, 2.6rem);
        overflow: visible;
        white-space: normal;
        text-overflow: clip;
    }

    .player-dock {
        left: 10px;
        right: 10px;
        bottom: 10px;
    }

    .custom-player {
        padding: 14px 12px;
        border-radius: 22px;
        overflow: visible;
    }

    .player-cover-wrap {
        width: 48px;
    }

    .player-cover {
        width: 48px;
        height: 48px;
        border-radius: 14px;
    }

    .player-head {
        grid-template-columns: 48px minmax(0, 1fr);
        gap: 12px;
    }

    .player-controls {
        grid-column: 1 / -1;
        justify-self: stretch;
        justify-content: center;
        flex-wrap: nowrap;
        gap: 10px;
    }

    .playlist-panel {
        position: absolute;
        left: 0;
        right: 0;
        bottom: calc(100% + 12px);
        margin-top: 0;
        padding: 0;
        border: 1px solid transparent;
        border-radius: 24px;
        background: rgba(12, 15, 24, 0.88);
        box-shadow: 0 22px 54px rgba(0, 0, 0, 0.34);
        backdrop-filter: blur(calc(var(--panel-blur) + 6px));
        opacity: 0;
        transform: translateY(18px) scale(0.98);
        pointer-events: none;
        z-index: 2;
        transition:
            max-height 0.32s ease,
            opacity 0.24s ease,
            transform 0.28s ease,
            padding 0.28s ease,
            border-color 0.28s ease;
    }

    .playlist-panel::before {
        content: "";
        display: block;
        width: 42px;
        height: 4px;
        margin: 0 auto 14px;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.18);
    }

    .custom-player[data-playlist-open="true"] .playlist-panel {
        margin-top: 0;
        max-height: min(420px, 62vh);
        padding: 16px 14px 14px;
        border-color: rgba(255, 255, 255, 0.1);
        opacity: 1;
        transform: translateY(0) scale(1);
        pointer-events: auto;
    }

    .playlist-head {
        margin-bottom: 10px;
    }

    .playlist-list {
        max-height: min(320px, 46vh);
        padding-right: 2px;
    }

    .playlist-item {
        padding: 12px 14px;
    }

    .player-foot {
        flex-wrap: wrap;
    }
}
