:root {
    --primary: #4361ee;
    --primary-dark: #3a56d4;
    --secondary: #7209b7;
    --dark: #212529;
    --gray: #6c757d;
    --light: #f8f9fa;
    --line: #e8ebf2;
    --white: #fff;
    --radius: 8px;
    --shadow: 0 4px 12px rgba(0, 0, 0, .08);
    --header-height: 70px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--dark);
    background: var(--white);
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, "Microsoft YaHei", sans-serif;
    font-size: 16px;
    line-height: 1.6;
    padding-bottom: 0;
}
body.has-player { padding-bottom: 82px; }
button, input { font: inherit; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
.container { width: min(1200px, calc(100% - 40px)); margin: 0 auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, .96);
    border-bottom: 1px solid rgba(33, 37, 41, .06);
    box-shadow: 0 2px 10px rgba(0, 0, 0, .06);
    backdrop-filter: blur(12px);
}
.navbar { min-height: var(--header-height); display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { color: var(--primary); font-size: 24px; font-weight: 800; letter-spacing: -.5px; }
.brand span { color: var(--secondary); font-size: 16px; margin-left: 5px; letter-spacing: 0; }
.header-actions { display: flex; gap: 12px; }
.button {
    min-height: 42px;
    padding: 9px 20px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 700;
    transition: .2s ease;
}
.button:hover { transform: translateY(-1px); }
.button-primary { color: #fff; background: var(--primary); box-shadow: 0 4px 14px rgba(67, 97, 238, .28); }
.button-primary:hover { background: var(--primary-dark); }
.button-outline { color: var(--primary); background: rgba(67, 97, 238, .03); border-color: var(--primary); }
.button-outline:hover { background: rgba(67, 97, 238, .09); }
.button:disabled { cursor: not-allowed; opacity: .48; transform: none; }
.button-block { width: 100%; margin-top: 10px; }

.library-head { color: #fff; background: linear-gradient(135deg, #667eea, #764ba2); padding: 58px 0 42px; }
.title-row { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 30px; }
.eyebrow { margin: 0 0 6px; color: rgba(255, 255, 255, .78); font-size: 14px; font-weight: 800; letter-spacing: 1.4px; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(30px, 5vw, 48px); line-height: 1.18; letter-spacing: -1px; }
.brand-slogan { margin: 7px 0 0; color: #fff; font-size: clamp(19px, 3vw, 26px); font-weight: 700; letter-spacing: .5px; }
.intro { max-width: 760px; margin: 14px 0 0; color: rgba(255, 255, 255, .9); font-size: 17px; }
.library-count { min-width: 145px; padding: 16px 20px; text-align: center; border: 1px solid rgba(255, 255, 255, .35); border-radius: var(--radius); background: rgba(255, 255, 255, .12); }
.library-count strong { display: block; font-size: 30px; line-height: 1.1; }
.library-count span { font-size: 14px; opacity: .85; }
.search { display: grid; grid-template-columns: 1fr auto; gap: 10px; max-width: 820px; margin-top: 30px; }
.search input { width: 100%; min-height: 48px; border: 0; border-radius: var(--radius); padding: 11px 16px; color: var(--dark); background: #fff; outline: none; box-shadow: 0 6px 20px rgba(26, 25, 73, .16); }
.search input:focus { box-shadow: 0 0 0 3px rgba(255, 255, 255, .35), 0 6px 20px rgba(26, 25, 73, .16); }
.search .button { min-height: 48px; background: #fff; color: var(--primary); box-shadow: 0 6px 20px rgba(26, 25, 73, .16); }
.quick-links { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 20px; font-size: 14px; }
.quick-links a { border-bottom: 1px solid rgba(255, 255, 255, .65); }

.library-section { padding: 45px 0 60px; background: var(--light); }
.library-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
.catalog, .selection { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.catalog { padding: 25px; min-height: 500px; }
.section-heading, .selection-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.section-heading { padding-bottom: 18px; border-bottom: 1px solid var(--line); }
h2 { margin: 0; font-size: 23px; line-height: 1.3; }
.section-heading p, .selection-head p { margin: 4px 0 0; color: var(--gray); font-size: 14px; }
.text-button { padding: 3px; border: 0; background: none; color: var(--primary); font-weight: 700; }
.status-card { margin: 25px 0; padding: 32px; text-align: center; color: var(--gray); background: var(--light); border-radius: var(--radius); }
.status-card.error { color: #9d2525; background: #fff1f1; }
.song-list { list-style: none; padding: 0; margin: 0; }
.song-item { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.song-item:last-child { border-bottom: 0; }
.song-play { width: 42px; height: 42px; border: 0; border-radius: 50%; color: #fff; background: var(--primary); font-size: 15px; box-shadow: 0 3px 10px rgba(67, 97, 238, .25); }
.song-play.playing { background: var(--secondary); }
.song-meta { min-width: 0; }
.song-meta strong, .song-meta span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.song-meta strong { font-size: 16px; }
.song-meta span { color: var(--gray); font-size: 13px; }
.song-actions { display: flex; gap: 8px; }
.small-button { min-height: 36px; padding: 6px 11px; border: 1px solid var(--line); border-radius: 6px; color: var(--dark); background: #fff; font-size: 14px; font-weight: 700; }
.small-button:hover { color: var(--primary); border-color: var(--primary); }
.small-button.selected { color: #fff; background: var(--secondary); border-color: var(--secondary); }
.pagination { display: flex; align-items: center; justify-content: center; gap: 18px; padding-top: 24px; border-top: 1px solid var(--line); margin-top: 10px; }
.pagination span { min-width: 100px; text-align: center; color: var(--gray); font-size: 14px; }

.selection { position: sticky; top: calc(var(--header-height) + 18px); padding: 22px; }
.selection-hint { color: var(--gray); font-size: 14px; line-height: 1.55; }
.selection-list { list-style: none; padding: 0; margin: 14px 0; max-height: 310px; overflow: auto; }
.selection-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.selection-list button { border: 0; background: none; color: #9d2525; }
.selection-empty { margin: 15px 0; padding: 28px 10px; border: 1px dashed #ccd1df; border-radius: var(--radius); text-align: center; color: var(--gray); font-size: 14px; }

.seo-content { padding: 55px 0; }
.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.info-grid article { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); }
.info-grid h2 { color: var(--primary); font-size: 19px; }
.info-grid p { margin: 10px 0 0; color: var(--gray); font-size: 15px; }
.site-footer { padding: 30px 0; text-align: center; color: #d9dbe3; background: #212529; font-size: 14px; }
.site-footer p { margin: 8px 0 0; }
.site-footer a:hover { color: #fff; }
.footer-note { opacity: .75; }

.player { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; color: #fff; background: rgba(25, 28, 37, .98); box-shadow: 0 -4px 22px rgba(0, 0, 0, .2); }
.player-inner { min-height: 82px; display: grid; grid-template-columns: auto minmax(160px, 260px) minmax(150px, 1fr) auto; align-items: center; gap: 16px; }
.play-toggle { width: 44px; height: 44px; border: 1px solid rgba(255, 255, 255, .2); border-radius: 50%; color: #fff; background: var(--primary); }
.player-song { min-width: 0; }
.player-song strong, .player-song span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-song span { color: #b8bdc9; font-size: 13px; }
.progress { width: 100%; accent-color: var(--primary); }
.time { font-size: 13px; color: #d6d9e1; white-space: nowrap; }
.toast { position: fixed; left: 50%; bottom: 100px; z-index: 100; transform: translate(-50%, 18px); padding: 10px 16px; border-radius: var(--radius); color: #fff; background: #212529; opacity: 0; pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 900px) {
    .title-row { grid-template-columns: 1fr; align-items: start; }
    .library-count { display: flex; align-items: baseline; gap: 8px; width: fit-content; }
    .library-count strong { font-size: 24px; }
    .library-layout { grid-template-columns: 1fr; }
    .selection { position: static; }
    .info-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .container { width: min(100% - 28px, 1200px); }
    .brand { font-size: 21px; }
    .brand span { display: none; }
    .header-actions .button { min-height: 38px; padding: 7px 11px; font-size: 14px; }
    .header-actions .button-outline { display: none; }
    .library-head { padding: 36px 0 30px; }
    h1 { font-size: 31px; }
    .intro { font-size: 16px; }
    .search { grid-template-columns: 1fr; }
    .catalog { padding: 18px 14px; }
    .song-item { grid-template-columns: 44px minmax(0, 1fr); gap: 10px; }
    .song-actions { grid-column: 2; flex-wrap: wrap; }
    .small-button { flex: 1; }
    .player-inner { min-height: 90px; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; }
    .player .progress { grid-column: 1 / -1; grid-row: 2; }
    .time { grid-column: 3; grid-row: 1; }
    body.has-player { padding-bottom: 90px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
