* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
:root {
  --bg: #0d0f14; --bg2: #14171f; --card: #1a1e28; --line: #262c3a;
  --text: #f2f3f5; --muted: #9aa3b2; --accent: #1ed760; --accent2: #ff4d6d;
}
body { background: var(--bg); color: var(--text); font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; padding-bottom: 110px; }
img { display: block; }
button { cursor: pointer; }

/* Top bar */
.topbar { display: flex; align-items: center; gap: 16px; padding: 14px 20px; background: var(--bg2); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.brand { font-size: 24px; font-weight: 800; letter-spacing: .5px; white-space: nowrap; }
.brand .logo { color: var(--accent); }
.search { flex: 1; max-width: 520px; }
.search input { width: 100%; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--text); font-size: 14px; outline: none; }
.search input:focus { border-color: var(--accent); }
.greeting { color: var(--muted); font-size: 14px; white-space: nowrap; }

/* Tabs */
.tabs { display: flex; gap: 8px; padding: 14px 20px 4px; }
.tab { background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 999px; padding: 8px 18px; font-size: 14px; font-weight: 600; }
.tab.active { background: var(--accent); color: #06130a; border-color: var(--accent); }

main { padding: 10px 20px; max-width: 1200px; margin: 0 auto; }
h2 { font-size: 20px; margin: 22px 0 12px; }

/* Hero slider */
.hero { position: relative; border-radius: 16px; overflow: hidden; margin-top: 12px; background: var(--card); }
.hero-track { display: flex; transition: transform .5s ease; }
.hero-slide { min-width: 100%; position: relative; cursor: pointer; }
.hero-slide img { width: 100%; height: 300px; object-fit: cover; }
.hero-slide .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 20px 16px; background: linear-gradient(transparent, rgba(0,0,0,.85)); font-size: 22px; font-weight: 700; }
.hero-arrow { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,.55); color: #fff; border: none; width: 40px; height: 40px; border-radius: 50%; font-size: 24px; line-height: 1; }
.hero-arrow.left { left: 12px; } .hero-arrow.right { right: 12px; }
.hero-dots { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; }
.hero-dots button { width: 8px; height: 8px; border-radius: 50%; border: none; background: rgba(255,255,255,.45); padding: 0; }
.hero-dots button.on { background: #fff; }

/* Categories */
.cat-row { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.cat { min-width: 150px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; text-align: left; color: var(--text); padding: 0; }
.cat img { width: 100%; height: 84px; object-fit: cover; }
.cat span { display: block; padding: 10px 12px; font-weight: 600; font-size: 14px; }
.cat small { display: block; padding: 0 12px 10px; color: var(--muted); font-size: 12px; }

/* Sections / cards */
.sec-row { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.card { min-width: 170px; width: 170px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; text-align: left; color: var(--text); padding: 0; flex-shrink: 0; }
.card img { width: 100%; height: 170px; object-fit: cover; background: #222; }
.card .ct { padding: 10px 12px; }
.card .ct b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .ct span { color: var(--muted); font-size: 12px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; }
.sec-head small { color: var(--muted); }

/* Track list */
.track-list { display: flex; flex-direction: column; }
.track { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; background: transparent; border: none; color: var(--text); text-align: left; width: 100%; font-size: 14px; }
.track:hover { background: var(--card); }
.track.playing { background: #122b1c; }
.track .num { width: 22px; color: var(--muted); text-align: right; flex-shrink: 0; }
.track img { width: 46px; height: 46px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.track .tt { flex: 1; min-width: 0; }
.track .tt b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.track .tt span { color: var(--muted); font-size: 12px; }
.track .dur { color: var(--muted); font-size: 13px; flex-shrink: 0; }
.track .vid { color: var(--accent2); font-size: 11px; border: 1px solid var(--accent2); border-radius: 4px; padding: 1px 5px; flex-shrink: 0; }
.fav-btn { background: none; border: none; color: var(--muted); font-size: 18px; padding: 4px; flex-shrink: 0; }
.fav-btn.on { color: var(--accent2); }

/* Detail overlay */
.detail { position: fixed; inset: 0; background: var(--bg); z-index: 40; overflow-y: auto; padding: 20px; }
.back-btn { background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; font-size: 14px; }
.detail-head { max-width: 900px; margin: 0 auto 16px; }
.detail-info { display: flex; gap: 16px; margin-top: 18px; align-items: center; }
.detail-info img { width: 150px; height: 150px; border-radius: 14px; object-fit: cover; }
.detail-info h2 { margin: 0 0 6px; font-size: 26px; }
.detail-info p { color: var(--muted); }
#detailTracks { max-width: 900px; margin: 0 auto; }

/* Video modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.8); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-box { background: var(--bg2); border: 1px solid var(--line); border-radius: 16px; padding: 16px; width: min(880px, 100%); position: relative; }
.modal-close { position: absolute; top: 10px; right: 12px; background: none; border: none; color: var(--text); font-size: 20px; }
.modal-box h3 { margin: 0 30px 12px 0; font-size: 18px; }
.modal-box video { width: 100%; border-radius: 10px; background: #000; max-height: 70vh; }
.modal-note { color: var(--muted); font-size: 13px; margin-top: 10px; }

/* Bottom player */
.player { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--bg2); border-top: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 10px 16px; }
.player img { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; }
.p-info { min-width: 0; width: 200px; }
.p-title { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-artist { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-btn { background: none; border: none; color: var(--text); font-size: 18px; }
.p-btn.big { font-size: 26px; color: var(--accent); }
.p-btn.on { color: var(--accent2); }
.p-seek { flex: 1; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.p-seek input { flex: 1; accent-color: var(--accent); }

.status { text-align: center; color: var(--muted); padding: 40px 0; }
.err { color: var(--accent2); }

@media (max-width: 640px) {
  .greeting { display: none; }
  .hero-slide img { height: 180px; }
  .p-info { width: 110px; }
  .p-seek span { display: none; }
  .detail-info img { width: 100px; height: 100px; }
}
