:root {
    color-scheme: dark;
    --ink: #f8fafc;
    --muted: #cbd5e1;
    --panel: rgba(15, 23, 42, 0.74);
    --violet: #8b5cf6;
    --pink: #ec4899;
    --cyan: #22d3ee;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
}

body {
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 12% 18%, rgba(139, 92, 246, 0.34), transparent 26rem),
        radial-gradient(circle at 88% 76%, rgba(34, 211, 238, 0.2), transparent 28rem),
        linear-gradient(145deg, #090b1a 0%, #17143b 48%, #0f2940 100%);
    color: var(--ink);
    font-family: 'Noto Sans TC', 'Microsoft JhengHei', sans-serif;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    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: 40px 40px;
    mask-image: linear-gradient(to bottom, #000, transparent 86%);
}

a {
    color: inherit;
}

.skip-link {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 20;
    padding: 9px 14px;
    border-radius: 8px;
    background: #fff;
    color: #312e81;
    font-weight: 700;
    text-decoration: none;
    transform: translateY(-160%);
}

.skip-link:focus {
    transform: translateY(0);
}

.top-bar {
    position: relative;
    z-index: 2;
    display: flex;
    width: min(1180px, calc(100% - 40px));
    min-height: 74px;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin: 0 auto;
}

.brand,
.home-link {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-weight: 700;
    text-decoration: none;
}

.brand {
    font-size: 1.05rem;
}

.home-link {
    padding: 9px 14px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.9rem;
    transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.home-link:hover,
.home-link:focus-visible {
    border-color: rgba(34, 211, 238, 0.72);
    background: rgba(34, 211, 238, 0.14);
    transform: translateY(-2px);
}

.song-page {
    position: relative;
    z-index: 1;
    display: grid;
    min-height: calc(100vh - 74px);
    place-items: center;
    padding: 34px 20px 72px;
}

.song-card {
    position: relative;
    width: min(1040px, 100%);
    padding: clamp(22px, 4vw, 48px);
    overflow: hidden;
    border: 1px solid rgba(165, 180, 252, 0.3);
    border-radius: 28px;
    background: var(--panel);
    box-shadow: 0 32px 90px rgba(2, 6, 23, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.song-card::before {
    content: '';
    position: absolute;
    top: -120px;
    right: -80px;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: conic-gradient(from 45deg, var(--violet), var(--pink), var(--cyan), var(--violet));
    filter: blur(72px);
    opacity: 0.22;
    animation: ambient-spin 18s linear infinite;
}

.song-heading,
.player-shell {
    position: relative;
    z-index: 1;
}

.song-heading {
    margin-bottom: 28px;
}

.eyebrow {
    margin: 0 0 8px;
    color: #a5f3fc;
    font-size: 0.75rem;
    font-weight: 900;
    letter-spacing: 0.18em;
}

h1 {
    margin: 0;
    background: linear-gradient(105deg, #fff 5%, #ddd6fe 48%, #a5f3fc 94%);
    background-clip: text;
    color: transparent;
    font-size: clamp(2rem, 5vw, 4.2rem);
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 1.08;
}

.song-intro {
    max-width: 620px;
    margin: 14px 0 0;
    color: var(--muted);
    font-size: clamp(0.95rem, 2vw, 1.12rem);
    line-height: 1.8;
}

.player-shell {
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 20px;
    background: rgba(2, 6, 23, 0.76);
    box-shadow: 0 22px 50px rgba(2, 6, 23, 0.4);
}

.player-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #020617;
}

.player-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.player-preview-fallback {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: minmax(180px, 0.75fr) minmax(260px, 1.25fr);
    align-items: center;
    gap: clamp(22px, 4vw, 54px);
    padding: clamp(24px, 4vw, 48px);
    background:
        radial-gradient(circle at 24% 50%, rgba(236, 72, 153, 0.23), transparent 27%),
        radial-gradient(circle at 80% 42%, rgba(34, 211, 238, 0.15), transparent 31%),
        linear-gradient(135deg, #080b1c, #17103b 58%, #0b2938);
}

.player-preview-fallback[hidden] {
    display: none;
}

.player-preview-art {
    position: relative;
    display: grid;
    min-height: 170px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 20px;
    background:
        repeating-radial-gradient(circle, transparent 0 13px, rgba(255, 255, 255, 0.04) 14px 15px),
        conic-gradient(from 35deg, #312e81, #7c3aed, #db2777, #0891b2, #312e81);
    color: rgba(255, 255, 255, 0.9);
    font-size: clamp(2.7rem, 6vw, 5.4rem);
    font-weight: 900;
    letter-spacing: -0.06em;
    box-shadow: 0 20px 44px rgba(2, 6, 23, 0.42);
}

.player-preview-play {
    position: absolute;
    right: 18px;
    bottom: 18px;
    display: grid;
    width: 44px;
    height: 44px;
    padding-left: 3px;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.94);
    color: #6d28d9;
    font-size: 0.9rem;
    box-shadow: 0 8px 22px rgba(2, 6, 23, 0.35);
}

.player-preview-copy strong {
    display: block;
    color: #f8fafc;
    font-size: clamp(1.15rem, 2.4vw, 1.6rem);
}

.player-preview-copy p {
    margin: 10px 0 17px;
    color: #cbd5e1;
    font-size: 0.94rem;
    line-height: 1.75;
}

.player-preview-copy code {
    padding: 2px 6px;
    border: 1px solid rgba(165, 243, 252, 0.2);
    border-radius: 5px;
    background: rgba(15, 23, 42, 0.76);
    color: #a5f3fc;
    font-family: Consolas, monospace;
}

.player-preview-copy a,
.player-noscript a {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    padding: 8px 14px;
    border-radius: 999px;
    background: linear-gradient(120deg, #7c3aed, #db2777);
    color: #fff;
    font-size: 0.88rem;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 8px 22px rgba(124, 58, 237, 0.28);
}

.player-preview-copy a:hover,
.player-preview-copy a:focus-visible,
.player-noscript a:hover,
.player-noscript a:focus-visible {
    filter: brightness(1.12);
}

.player-noscript {
    position: absolute;
    inset: 0;
    display: grid;
    margin: 0;
    place-content: center;
    gap: 12px;
    padding: 24px;
    background: #080b1c;
    color: #e2e8f0;
    text-align: center;
}

.player-meta {
    display: flex;
    min-height: 58px;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 13px 18px;
    color: var(--muted);
    font-size: 0.9rem;
}

.player-meta > span {
    font-weight: 700;
}

.player-meta > span span {
    margin-right: 6px;
    color: #f9a8d4;
}

.player-meta a {
    color: #a5f3fc;
    font-weight: 700;
    text-underline-offset: 4px;
}

.player-meta a:hover,
.player-meta a:focus-visible {
    color: #fff;
}

.lyrics-card {
    position: relative;
    z-index: 1;
    margin-top: 18px;
    overflow: hidden;
    border: 1px solid rgba(165, 180, 252, 0.22);
    border-radius: 20px;
    background: rgba(2, 6, 23, 0.46);
    box-shadow: 0 18px 42px rgba(2, 6, 23, 0.24);
}

.lyrics-card summary {
    display: flex;
    min-height: 66px;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 20px;
    color: #f8fafc;
    cursor: pointer;
    list-style: none;
    transition: background 180ms ease, color 180ms ease;
}

.lyrics-card summary::-webkit-details-marker {
    display: none;
}

.lyrics-card summary:hover,
.lyrics-card summary:focus-visible {
    background: rgba(139, 92, 246, 0.12);
    color: #cffafe;
    outline: none;
}

.lyrics-card summary:focus-visible {
    box-shadow: inset 0 0 0 2px rgba(34, 211, 238, 0.68);
}

.lyrics-summary-title,
.lyrics-summary-action {
    display: inline-flex;
    align-items: center;
}

.lyrics-summary-title {
    gap: 9px;
    font-size: 1.05rem;
    font-weight: 800;
}

.lyrics-summary-title > span {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--violet), var(--pink));
    box-shadow: 0 7px 18px rgba(139, 92, 246, 0.28);
}

.lyrics-summary-action {
    gap: 9px;
    color: #a5f3fc;
    font-size: 0.84rem;
    font-weight: 700;
}

.lyrics-open-label {
    display: none;
}

.lyrics-chevron {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border: 1px solid rgba(165, 243, 252, 0.24);
    border-radius: 50%;
    font-size: 1.1rem;
    line-height: 1;
    transition: transform 220ms ease, background 180ms ease;
}

.lyrics-card[open] summary {
    border-bottom: 1px solid rgba(165, 180, 252, 0.16);
}

.lyrics-card[open] .lyrics-closed-label {
    display: none;
}

.lyrics-card[open] .lyrics-open-label {
    display: inline;
}

.lyrics-card[open] .lyrics-chevron {
    background: rgba(34, 211, 238, 0.12);
    transform: rotate(180deg);
}

.lyrics-content {
    max-width: 780px;
    padding: 10px 24px 30px;
}

.lyric-section {
    margin-top: 22px;
    padding-left: 18px;
    border-left: 2px solid rgba(165, 180, 252, 0.28);
}

.lyric-section h2 {
    margin: 0 0 7px;
    color: #c4b5fd;
    font-size: 0.82rem;
    font-weight: 900;
    letter-spacing: 0.08em;
}

.lyric-section p {
    margin: 0;
    color: #e2e8f0;
    font-size: 0.98rem;
    line-height: 1.9;
}

.lyric-highlight {
    border-left-color: #f472b6;
}

.lyric-highlight h2 {
    color: #f9a8d4;
}

.stage-direction {
    color: #94a3b8;
    font-style: italic;
}

@keyframes ambient-spin {
    to {
        transform: rotate(1turn);
    }
}

@media (max-width: 600px) {
    .top-bar {
        width: min(100% - 28px, 1180px);
    }

    .brand span:last-child {
        display: none;
    }

    .song-page {
        padding: 22px 14px 50px;
    }

    .song-card {
        border-radius: 20px;
    }

    .song-heading {
        margin-bottom: 20px;
    }

    .player-shell {
        border-radius: 14px;
    }

    .player-preview-fallback {
        grid-template-columns: 1fr;
        gap: 0;
        padding: 16px;
        text-align: center;
    }

    .player-preview-art {
        display: none;
    }

    .player-preview-copy strong {
        font-size: 1.05rem;
    }

    .player-preview-copy p {
        margin: 6px 0 11px;
        font-size: 0.78rem;
        line-height: 1.55;
    }

    .player-preview-copy a {
        min-height: 34px;
        padding: 6px 11px;
        font-size: 0.78rem;
    }

    .player-meta {
        align-items: flex-start;
        flex-direction: column;
        gap: 7px;
    }

    .lyrics-card {
        border-radius: 14px;
    }

    .lyrics-card summary {
        min-height: 60px;
        padding: 13px 15px;
    }

    .lyrics-content {
        padding: 6px 16px 24px;
    }

    .lyric-section {
        margin-top: 19px;
        padding-left: 13px;
    }

    .lyric-section p {
        font-size: 0.91rem;
        line-height: 1.85;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
