:root {
  color-scheme: light;
  font-family: Inter, system-ui, -apple-system, sans-serif;
  --bg: #f7f8fc;
  --surface: #fff;
  --soft: #f1eff9;
  --text: #19142b;
  --muted: #5d5872;
  --line: #dfdcec;
  --accent: #5941d4;
  --accent-text: #fff;
  --highlight: #533bc7;
  --error: #a22442;
  --error-bg: #fff1f3;
  --shadow: 0 24px 64px #32246811;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #100e17;
  --surface: #1b1726;
  --soft: #282238;
  --text: #f7f4ff;
  --muted: #bdb4cf;
  --line: #39314b;
  --accent: #a38bff;
  --accent-text: #1b1230;
  --highlight: #c2afff;
  --error: #ffb5c3;
  --error-bg: #3f2231;
  --shadow: 0 24px 64px #0004;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); line-height: 1.55; }
button, input { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { opacity: .6; cursor: wait; }
:focus-visible { outline: 3px solid var(--highlight); outline-offset: 3px; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; max-width: 1120px; margin: auto; padding: 20px clamp(16px, 5vw, 44px); }
.brand { color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: 10px; font-weight: 900; letter-spacing: .11em; }
.brand-mark { width: 42px; height: 42px; border-radius: 14px; display: flex; align-items: center; justify-content: center; gap: 3px; background: linear-gradient(145deg, #7859ff, #4b32bf); box-shadow: 0 6px 16px #6546e050; }
.brand-mark i { width: 3px; height: 13px; border-radius: 9px; background: #fff; }
.brand-mark i:nth-child(2), .brand-mark i:nth-child(4) { height: 21px; }
.brand-mark i:nth-child(3) { height: 29px; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.theme, #install { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; min-height: 44px; padding: 7px 12px; }
.theme { width: 44px; font-size: 1.2rem; }
#install { font-weight: 650; font-size: .82rem; }
main { width: min(100% - 32px, 744px); margin: auto; padding-bottom: 48px; }
.intro { position: relative; text-align: center; padding: 30px 0 27px; }
.hero-wave { display: flex; align-items: center; justify-content: center; height: 67px; margin: 0 auto 22px; gap: 6px; }
.hero-wave i { width: 6px; height: 18%; border-radius: 16px; background: linear-gradient(#a992ff, #583cda); opacity: .8; }
.hero-wave i:is(:nth-child(2), :nth-child(6), :nth-child(10), :nth-child(14)) { height: 34%; }
.hero-wave i:is(:nth-child(3), :nth-child(5), :nth-child(7), :nth-child(9), :nth-child(11), :nth-child(13)) { height: 58%; }
.hero-wave i:is(:nth-child(4), :nth-child(12)) { height: 76%; }
.hero-wave i:nth-child(8) { height: 100%; }
h1 { margin: 0; font-size: clamp(2.28rem, 7.4vw, 5rem); line-height: 1.02; letter-spacing: -.065em; font-weight: 850; text-wrap: balance; }
h1 em { font-style: normal; color: var(--highlight); }
.intro p { color: var(--muted); max-width: 460px; margin: 17px auto 0; font-size: clamp(.95rem, 3vw, 1.08rem); text-wrap: pretty; }
.panel { padding: clamp(15px, 4vw, 28px); background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); }
.sources { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; background: var(--soft); padding: 5px; border-radius: 15px; margin-bottom: 20px; }
.sources button { min-height: 46px; background: transparent; border: 0; padding: 8px 5px; border-radius: 11px; font-weight: 700; color: var(--muted); }
.sources button[aria-pressed="true"] { background: var(--surface); color: var(--highlight); box-shadow: 0 2px 7px #32246813; }
.sources span { margin-right: 4px; }
form > label:first-child { font-weight: 720; }
#link { display: block; width: 100%; min-height: 54px; margin: 7px 0 8px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 15px; font-size: 16px; background: var(--bg); color: var(--text); }
small, details, #payment-notice { color: var(--muted); }
.primary { display: flex; justify-content: center; align-items: center; gap: 12px; width: 100%; min-height: 54px; border: 0; border-radius: 13px; margin-top: 18px; padding: 11px 17px; font-weight: 800; background: var(--accent); color: var(--accent-text); }
.primary:hover:enabled { filter: brightness(1.12); }
.drop { display: grid; position: relative; place-items: center; gap: 8px; text-align: center; padding: 23px 12px; border: 1px dashed var(--highlight); border-radius: 13px; cursor: pointer; overflow-wrap: anywhere; background: var(--bg); }
.drop:hover, .drop:focus-within, .drop.drag { background: var(--soft); }
.drop input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.upload-icon { display: grid; place-items: center; background: var(--soft); color: var(--highlight); width: 42px; height: 42px; border-radius: 12px; font-size: 1.35rem; }
#status { margin: 16px 0 0; padding: 11px 14px; border-radius: 12px; color: var(--highlight); background: var(--soft); }
#status[data-error] { color: var(--error); background: var(--error-bg); }
#upload-fallback, .payment-actions button { min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--soft); color: var(--highlight); font-weight: 700; }
#upload-fallback { margin-top: 9px; }
.tracks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
article { min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: 14px; }
h2 { margin: 0 0 8px; font-size: 1rem; }
audio { display: block; width: 100%; }
article a { display: inline-block; margin-top: 8px; color: var(--highlight); font-weight: 750; }
#payment { margin-top: 16px; padding: 14px; border-radius: 12px; background: var(--bg); }
.payment-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
#payment-notice { margin-bottom: 0; }
details { margin-top: 14px; }
summary { cursor: pointer; }
@media (max-width: 520px) {
  .top { padding-top: 14px; padding-bottom: 12px; }
  .intro { padding-top: 19px; }
  .hero-wave { height: 49px; margin-bottom: 17px; }
  .tracks { grid-template-columns: 1fr; }
}

.processing { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.processing progress { flex: 1; min-width: 0; height: 10px; accent-color: var(--accent); }
.processing output { min-width: 78px; text-align: right; color: var(--muted); font-size: .86rem; font-variant-numeric: tabular-nums; }

.payment-heading { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 5px 10px; }
.payment-heading > span { color: var(--highlight); font-size: 1.22rem; font-weight: 800; }
.payment-actions button.qpay, .download-all { display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%; min-height: 52px; padding: 10px 14px; background: var(--accent); color: var(--accent-text); border: 0; border-radius: 12px; font-weight: 800; }
.qpay-icon { font-size: 1.25rem; }
.download-all { margin-top: 14px; text-decoration: none; }

#convert-to-upload, .source-export { margin-top: 8px; min-height: 44px; width: 100%; border: 1px solid var(--line); border-radius: 11px; background: var(--soft); color: var(--highlight); font-weight: 700; }

#song-search { padding-bottom: 17px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.search-row { display: flex; gap: 8px; margin-top: 7px; }
.search-row input { min-width: 0; flex: 1; min-height: 48px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--bg); color: var(--text); font-size: 16px; }
.search-row button { border: 1px solid var(--line); border-radius: 12px; background: var(--soft); color: var(--highlight); padding: 8px 14px; font-weight: 750; }
#search-status { margin: 9px 0 0; color: var(--muted); overflow-wrap: anywhere; }
#search-results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; list-style: none; padding: 0; margin: 9px 0 0; }
#search-results button { width: 100%; height: 100%; min-height: 70px; display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: center; gap: 9px; text-align: left; overflow-wrap: anywhere; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); padding: 8px 11px; }
#search-results button:hover { background: var(--soft); border-color: var(--highlight); }

.song-art { position: relative; display: block; background: var(--soft); aspect-ratio: 16 / 9; overflow: hidden; border-radius: 8px; }
.song-art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.song-play { position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%); display: grid; place-items: center; width: 31px; height: 31px; border-radius: 50%; background: #181225de; color: #fff; font-size: .73rem; }
.song-copy { display: grid; gap: 2px; line-height: 1.32; }
.song-copy strong { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.song-copy small { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#song-player { margin-top: 12px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); }
#player-frame { aspect-ratio: 16 / 9; background: #0e0d12; }
#player-frame iframe { display: block; width: 100%; height: 100%; border: 0; }
.player-info { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px 12px; padding: 10px 12px; }
.player-info strong { overflow-wrap: anywhere; }
.player-info a { font-size: .86rem; font-weight: 700; color: var(--highlight); }
@media (max-width: 580px) { #search-results { grid-template-columns: minmax(0, 1fr); } }
