:root {
    --bg: #080a18;
    --bg-soft: #11152a;
    --glass: rgba(19, 24, 45, 0.72);
    --glass-strong: rgba(22, 28, 54, 0.88);
    --glass-soft: rgba(255, 255, 255, 0.08);
    --line: rgba(255, 255, 255, 0.11);
    --line-strong: rgba(255, 255, 255, 0.18);
    --text: #f7f7ff;
    --text-soft: rgba(247, 247, 255, 0.74);
    --text-muted: rgba(247, 247, 255, 0.52);
    --accent: #8a7cff;
    --accent-2: #46b7ff;
    --accent-3: #ff6db4;
    --success: #51e1b7;
    --danger: #ff7a97;
    --radius-lg: 26px;
    --radius-md: 18px;
    --radius-sm: 14px;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
    --shadow-soft: 0 14px 38px rgba(0, 0, 0, 0.24);
    --player-height: 174px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    overflow-x: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    min-height: 100%;
    margin: 0;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 50% -12%, rgba(138, 124, 255, 0.34), transparent 34%),
        linear-gradient(155deg, #070815 0%, #121631 45%, #080a18 100%);
    color: var(--text);
    font-size: 14px;
    letter-spacing: 0;
}

body::before {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    content: "";
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 28%),
        linear-gradient(90deg, rgba(70, 183, 255, 0.1), transparent 40%, rgba(255, 109, 180, 0.08));
}

button,
input {
    font: inherit;
}

button {
    border: 0;
    -webkit-tap-highlight-color: transparent;
}

button:disabled {
    cursor: default;
    opacity: 0.65;
}

input,
button {
    outline: none;
}

svg {
    display: block;
}

.app-shell {
    position: relative;
    width: 100%;
    max-width: 480px;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0 auto;
    padding: 14px 14px calc(24px + env(safe-area-inset-bottom));
}

.app-shell.has-player {
    padding-bottom: calc(var(--player-height) + 38px + env(safe-area-inset-bottom));
}

.brand-intro {
    padding: 4px 2px 16px;
}

.brand-intro h1,
.brand-intro p {
    margin: 0;
}

.brand-kicker {
    color: var(--success);
    font-size: 13px;
    font-weight: 800;
}

.brand-intro h1 {
    margin-top: 5px;
    color: var(--text);
    font-size: 26px;
    line-height: 1.16;
}

.brand-intro > p:not(.brand-kicker) {
    margin-top: 8px;
    color: var(--text-soft);
    font-size: 14px;
    line-height: 1.6;
}

.listen-first-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 48px;
    margin-top: 14px;
    border-radius: 999px;
    background: linear-gradient(135deg, #ffe08a, #ff8fb8 52%, #7bd7ff);
    color: #ffffff;
    font-size: 16px;
    font-weight: 900;
    box-shadow: 0 16px 34px rgba(255, 143, 184, 0.26);
    transition: transform 160ms ease, filter 160ms ease;
}

.listen-first-button:active {
    transform: scale(0.98);
}

.listen-first-button:disabled {
    filter: grayscale(0.18);
}

.listen-tip {
    margin-top: 9px;
    color: rgba(247, 247, 255, 0.66);
    font-size: 12px;
    line-height: 1.55;
}

.scene-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.scene-tags span {
    min-height: 28px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 700;
    line-height: 26px;
}

.seo-song-guide {
    display: grid;
    gap: 10px;
    margin: 0 0 16px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.07);
}

.seo-song-guide h2,
.seo-song-guide h3,
.seo-song-guide p {
    margin: 0;
}

.seo-song-guide h2 {
    color: var(--text);
    font-size: 17px;
    line-height: 1.35;
}

.seo-song-guide article {
    display: grid;
    gap: 4px;
}

.seo-song-guide article.is-featured {
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
}

.seo-song-guide h3 {
    color: var(--text);
    font-size: 14px;
    line-height: 1.4;
}

.seo-song-guide p {
    color: var(--text-soft);
    font-size: 13px;
    line-height: 1.6;
}

.naming-link {
    padding-top: 2px;
}

.naming-link a {
    color: var(--success);
    font-weight: 800;
    text-decoration: none;
}

.naming-link a:active {
    opacity: 0.8;
}

.mini-cover,
.song-cover {
    background:
        radial-gradient(circle, rgba(255, 255, 255, 0.92) 0 8%, transparent 9% 18%, rgba(255, 255, 255, 0.12) 19% 20%, transparent 21%),
        conic-gradient(from 130deg, #8a7cff, #46b7ff, #ff6db4, #8a7cff);
}

.mini-cover span,
.song-cover span {
    position: absolute;
    inset: 28%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    background: rgba(7, 8, 20, 0.72);
}

.search-panel {
    margin-top: 2px;
}

.search-box {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) 34px;
    align-items: center;
    min-height: 46px;
    padding: 0 7px 0 15px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.09);
    box-shadow: var(--shadow-soft);
}

@supports (backdrop-filter: blur(16px)) {
    .search-box,
    .category-tab,
    .song-item,
    .empty-state,
    .load-more,
    .list-feedback,
    .player-bar,
    .favorite-button,
    .toast {
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
    }
}

.search-box svg,
.clear-button svg,
.control-button svg,
.play-chip svg,
.favorite-button svg {
    width: 20px;
    height: 20px;
    color: currentColor;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.search-box > svg {
    color: var(--text-muted);
}

.search-box input {
    min-width: 0;
    height: 44px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--text);
    caret-color: var(--accent-2);
    font-size: 15px;
}

.search-box input::placeholder {
    color: rgba(247, 247, 255, 0.44);
}

.search-box input::-webkit-search-cancel-button {
    appearance: none;
}

.clear-button,
.control-button,
.play-chip {
    display: grid;
    place-items: center;
    color: var(--text-soft);
    background: transparent;
}

.clear-button {
    width: 34px;
    height: 34px;
    border-radius: 50%;
}

.clear-button:active,
.control-button:active,
.category-tab:active,
.song-item:active,
.load-more:active {
    transform: scale(0.98);
}

.category-tabs {
    display: flex;
    gap: 9px;
    margin: 14px -14px 0;
    padding: 0 14px 3px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.category-tabs::-webkit-scrollbar {
    display: none;
}

.category-tab {
    flex: 0 0 auto;
    min-width: 52px;
    min-height: 34px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 700;
    line-height: 34px;
    white-space: nowrap;
    transition: transform 160ms ease, background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.category-tab.is-active {
    border-color: rgba(255, 255, 255, 0.26);
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #ffffff;
    box-shadow: 0 12px 28px rgba(70, 183, 255, 0.2);
}

.category-tab.is-favorite {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.category-tab.is-favorite::before {
    width: 12px;
    height: 12px;
    content: "";
    background: currentColor;
    clip-path: polygon(50% 0, 63% 34%, 100% 38%, 72% 61%, 80% 100%, 50% 79%, 20% 100%, 28% 61%, 0 38%, 37% 34%);
}

.content {
    margin-top: 14px;
}

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

.song-item {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    width: 100%;
    min-height: 70px;
    padding: 11px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.04)),
        var(--glass);
    color: var(--text);
    text-align: left;
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.18);
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.song-item.is-active {
    border-color: rgba(138, 124, 255, 0.74);
    background:
        linear-gradient(135deg, rgba(138, 124, 255, 0.22), rgba(70, 183, 255, 0.12)),
        var(--glass-strong);
}

.song-cover {
    position: relative;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    box-shadow: inset 0 0 0 5px rgba(7, 8, 20, 0.5), 0 10px 22px rgba(0, 0, 0, 0.24);
}

.song-item.is-active .song-cover,
.mini-cover.is-playing {
    animation: record-spin 9s linear infinite;
}

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

.song-title {
    display: -webkit-box;
    overflow: hidden;
    color: var(--text);
    font-size: 15px;
    font-weight: 800;
    line-height: 1.35;
    text-overflow: ellipsis;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.song-description {
    display: -webkit-box;
    overflow: hidden;
    margin-top: 4px;
    color: var(--text-soft);
    font-size: 12px;
    line-height: 1.45;
    text-overflow: ellipsis;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.song-meta {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.35;
}

.song-artist,
.song-category {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.song-artist {
    max-width: 54%;
}

.song-category {
    max-width: 44%;
}

.song-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(247, 247, 255, 0.34);
}

.song-side {
    display: grid;
    justify-items: end;
    gap: 7px;
}

.song-duration {
    min-width: 34px;
    color: var(--text-muted);
    font-size: 11px;
    text-align: right;
    white-space: nowrap;
}

.play-chip {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
}

.song-item.is-active .play-chip {
    background: linear-gradient(135deg, var(--accent-3), var(--accent));
    box-shadow: 0 10px 22px rgba(255, 109, 180, 0.24);
}

.play-chip svg {
    width: 17px;
    height: 17px;
}

.play-chip .play-icon {
    fill: currentColor;
    stroke: currentColor;
}

.play-chip .pause-icon {
    fill: currentColor;
    stroke: none;
}

.empty-state {
    display: grid;
    justify-items: center;
    gap: 9px;
    min-height: 210px;
    padding: 30px 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-muted);
    text-align: center;
    box-shadow: var(--shadow-soft);
}

.state-icon {
    position: relative;
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(138, 124, 255, 0.34), rgba(70, 183, 255, 0.18));
}

.state-icon svg {
    width: 34px;
    height: 34px;
    color: #ffffff;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.empty-state h3 {
    margin: 6px 0 0;
    color: var(--text);
    font-size: 15px;
    line-height: 1.25;
}

.empty-state p {
    max-width: 250px;
    margin: 0;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.55;
}

.state-loader {
    width: 34px;
    height: 34px;
    border: 3px solid rgba(255, 255, 255, 0.16);
    border-top-color: var(--accent-2);
    border-radius: 50%;
    animation: record-spin 900ms linear infinite;
}

.load-more,
.list-feedback {
    width: 100%;
    min-height: 42px;
    margin-top: 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 800;
}

.load-more {
    transition: transform 160ms ease, background 160ms ease;
}

.list-feedback {
    display: grid;
    place-items: center;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
}

.player-bar {
    position: fixed;
    right: max(12px, calc((100vw - 480px) / 2 + 12px));
    bottom: max(12px, env(safe-area-inset-bottom));
    left: max(12px, calc((100vw - 480px) / 2 + 12px));
    z-index: 20;
    display: grid;
    gap: 10px;
    max-width: 456px;
    margin: 0 auto;
    padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
    border: 1px solid var(--line-strong);
    border-radius: 24px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.05)),
        rgba(14, 18, 37, 0.86);
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.48);
}

.player-current {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) 38px;
    align-items: center;
    gap: 10px;
}

.mini-cover {
    position: relative;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    box-shadow: inset 0 0 0 5px rgba(7, 8, 20, 0.54), 0 10px 22px rgba(0, 0, 0, 0.28);
}

.current-copy {
    min-width: 0;
}

.favorite-button {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    transition: transform 160ms ease, background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.favorite-button svg {
    fill: transparent;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linejoin: round;
}

.favorite-button.is-active {
    border-color: rgba(255, 214, 102, 0.56);
    background: rgba(255, 214, 102, 0.16);
    color: #ffd666;
}

.favorite-button.is-active svg {
    fill: currentColor;
}

.favorite-button:active {
    transform: scale(0.94);
}

.current-copy h2 {
    overflow: hidden;
    margin: 0;
    color: var(--text);
    font-size: 15px;
    font-weight: 800;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.current-copy p {
    overflow: hidden;
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.progress-row {
    display: grid;
    grid-template-columns: 39px minmax(0, 1fr) 39px;
    align-items: center;
    gap: 9px;
    color: var(--text-muted);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

.progress-range {
    width: 100%;
    height: 24px;
    margin: 0;
    background: transparent;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    --progress: 0%;
}

.progress-range::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent-3) 0 var(--progress), rgba(255, 255, 255, 0.16) var(--progress) 100%);
}

.progress-range::-webkit-slider-thumb {
    width: 18px;
    height: 18px;
    margin-top: -6px;
    border: 3px solid #ffffff;
    border-radius: 50%;
    background: var(--accent-3);
    box-shadow: 0 8px 16px rgba(255, 109, 180, 0.35);
    appearance: none;
    -webkit-appearance: none;
}

.progress-range::-moz-range-track {
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
}

.progress-range::-moz-range-progress {
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent-3), var(--accent));
}

.progress-range::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border: 3px solid #ffffff;
    border-radius: 50%;
    background: var(--accent-3);
}

.control-row {
    display: grid;
    grid-template-columns: 42px 1fr 42px 66px;
    align-items: center;
    gap: 9px;
}

.control-button {
    min-width: 0;
    height: 42px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.09);
    color: var(--text-soft);
    transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.control-button svg {
    width: 20px;
    height: 20px;
}

.play-toggle {
    height: 48px;
    background: linear-gradient(135deg, var(--accent-3), var(--accent), var(--accent-2));
    color: #ffffff;
    box-shadow: 0 14px 30px rgba(138, 124, 255, 0.28);
}

.play-toggle svg {
    width: 23px;
    height: 23px;
}

#playButtonIcon {
    display: grid;
    place-items: center;
}

.play-toggle .play-icon,
.play-toggle .pause-icon {
    fill: currentColor;
    stroke: none;
}

.loop-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0 10px;
    color: var(--text-muted);
}

.loop-button.is-single {
    color: #ffffff;
    background: rgba(138, 124, 255, 0.22);
}

.loop-button span {
    overflow: hidden;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.toast {
    position: fixed;
    right: max(22px, calc((100vw - 480px) / 2 + 22px));
    bottom: calc(var(--player-height) + 28px + env(safe-area-inset-bottom));
    left: max(22px, calc((100vw - 480px) / 2 + 22px));
    z-index: 30;
    max-width: 436px;
    margin: 0 auto;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(8, 10, 24, 0.86);
    color: var(--text);
    font-size: 13px;
    text-align: center;
    box-shadow: var(--shadow-soft);
}

[hidden] {
    display: none !important;
}

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

@media (max-width: 360px) {
    :root {
        --player-height: 184px;
    }

    .app-shell {
        padding-right: 10px;
        padding-left: 10px;
    }

    .category-tabs {
        margin-right: -10px;
        margin-left: -10px;
        padding-right: 10px;
        padding-left: 10px;
    }

    .song-item {
        grid-template-columns: 44px minmax(0, 1fr) auto;
        gap: 10px;
        min-height: 66px;
        padding: 10px;
    }

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

    .play-chip {
        width: 32px;
        height: 32px;
    }

    .song-duration {
        display: none;
    }

    .player-bar {
        right: 10px;
        left: 10px;
        padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
        border-radius: 24px;
    }

    .player-current {
        grid-template-columns: 42px minmax(0, 1fr) 36px;
    }

    .mini-cover {
        width: 42px;
        height: 42px;
    }

    .favorite-button {
        width: 36px;
        height: 36px;
    }

    .control-row {
        grid-template-columns: 38px 1fr 38px 60px;
        gap: 8px;
    }

    .control-button {
        height: 40px;
    }

    .play-toggle {
        height: 46px;
    }
}

@media (min-width: 481px) {
    body {
        padding-right: 16px;
        padding-left: 16px;
    }

    .app-shell {
        padding-top: 24px;
    }
}

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