/* 온오프뮤직 디자인: 살짝 밝은 검은색 바탕에 파란색 포인트. 기본은 어두운 화면. */
:root {
  --bg:#1B1D22; --surface:#24272E; --surface2:#2E323B; --line:#383D48; --line2:#5A6172;
  --text:#E8EAF0; --muted:#A6ADBB; --primary:#6EA8FF; --onprimary:#0C1B33; --hi:#25364F; --onhi:#CFE2FF;
  --nav:#17191D; --good:#7FD6B5; --goodbg:#1F3A32; --danger:#FF8A80; --warnbg:#3A3320; --warntext:#F2DC9B;
  --title:'Hahmlet','Noto Serif KR',serif; --player-h:84px;
  color-scheme: dark;
}
:root[data-theme=light] {
  --bg:#F4F6FA; --surface:#FFFFFF; --surface2:#E9EDF5; --line:#DBE1EC; --line2:#A7B1C4;
  --text:#171A21; --muted:#555E70; --primary:#2563EB; --onprimary:#FFFFFF; --hi:#DCE8FF; --onhi:#173A8C;
  --nav:#FFFFFF; --good:#0F6B5C; --goodbg:#DDF3EE; --danger:#B3261E; --warnbg:#FFF6DB; --warntext:#5C4300;
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin:0; font-family:'Noto Sans KR',system-ui,sans-serif; font-size:16px; line-height:1.5; color:var(--text); background:var(--bg); word-break:keep-all; }
a { color:inherit; text-decoration:none; }
a:hover { text-decoration:underline; }
button, input, select, textarea { font:inherit; color:inherit; }
button { cursor:pointer; }
:focus-visible { outline:3px solid var(--primary); outline-offset:2px; }
h1, h2, h3, p { margin:0; }
ol, ul { margin:0; padding:0; list-style:none; }
.skip { position:absolute; left:-999px; }
.skip:focus { left:12px; top:12px; z-index:20; background:var(--primary); color:var(--onprimary); padding:10px 14px; border-radius:8px; }

/* 틀 */
.app { display:flex; min-height:100vh; }
.side { width:232px; flex:none; background:var(--nav); border-right:1px solid var(--line); padding:24px 16px; display:flex; flex-direction:column; gap:6px; position:sticky; top:0; height:100vh; overflow:auto; }
body.has-player .side { height:calc(100vh - var(--player-h)); }
.logo { display:flex; align-items:center; gap:10px; padding:0 8px; color:var(--primary); }
.logo span { font-family:var(--title); font-weight:700; font-size:28px; color:var(--text); letter-spacing:-0.5px; }
.logo:hover { text-decoration:none; }
.tagline { font-size:14px; line-height:1.5; color:var(--muted); padding:4px 8px 16px; }
.nav { display:flex; flex-direction:column; gap:4px; }
.nav a { height:46px; padding:0 14px; border-radius:8px; display:flex; align-items:center; }
.nav a[hidden] { display:none; }
.nav a:hover { background:var(--surface2); text-decoration:none; }
.nav a[aria-current=page] { background:var(--hi); color:var(--onhi); font-weight:700; }
.visits { margin-top:20px; padding:0 8px; font-size:15px; display:flex; flex-direction:column; gap:2px; }
.visits[hidden] { display:none; }
.visits strong { font-family:var(--title); font-size:22px; font-weight:600; color:var(--primary); }
.visits-main { display:flex; align-items:baseline; gap:6px; }
.visits-sub { font-size:13px; color:var(--muted); }
.visits b { font-weight:500; }
.support-box { margin-top:12px; border:1px solid var(--line2); border-radius:12px; padding:14px; display:flex; flex-direction:column; gap:4px; font-size:14px; color:var(--muted); }
.support-box strong { color:var(--text); font-size:15px; }
.support-box:hover { text-decoration:none; border-color:var(--primary); }
.main { flex:1; min-width:0; display:flex; flex-direction:column; }
.top { position:sticky; top:0; z-index:4; background:var(--bg); border-bottom:1px solid var(--line); padding:14px 32px; display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.grow { flex:1; }
.search { flex:1; min-width:220px; max-width:420px; display:flex; align-items:center; gap:8px; background:var(--surface); border:1.5px solid var(--line); border-radius:12px; padding:0 14px; height:48px; color:var(--muted); }
.search input { border:0; outline:0; background:transparent; width:100%; color:var(--text); }
.search:focus-within { border-color:var(--primary); }
.view { max-width:1160px; width:100%; margin:0 auto; padding:32px 32px 56px; display:flex; flex-direction:column; gap:28px; outline:0; }
body.has-player .view { padding-bottom:calc(56px + var(--player-h)); }

.account { display:flex; align-items:center; gap:10px; min-height:48px; }
.account .me { display:flex; align-items:center; gap:8px; font-weight:700; max-width:200px; }
.account .me span { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.account .me:hover { text-decoration:none; }
/* 알림 종 */
.bell-wrap { position:relative; }
.bell { position:relative; width:48px; height:48px; border:0; border-radius:24px; background:transparent; color:var(--text); display:flex; align-items:center; justify-content:center; }
.bell:hover, .bell[aria-expanded=true] { background:var(--surface2); }
.bell-dot { position:absolute; top:4px; right:2px; min-width:20px; height:20px; padding:0 5px; border-radius:10px; background:var(--danger); color:var(--bg); font-size:12px; font-weight:900; line-height:20px; text-align:center; }
.bell-dot[hidden], .bell-panel[hidden] { display:none; }
.bell-panel { position:absolute; right:0; top:calc(100% + 8px); z-index:8; width:400px; max-width:calc(100vw - 32px); background:var(--surface); border:1px solid var(--line); border-radius:12px; box-shadow:0 12px 32px rgba(0,0,0,0.35); display:flex; flex-direction:column; }
.bell-head { display:flex; align-items:center; justify-content:space-between; padding:14px 16px 8px; font-size:18px; }
.bell-tabs { display:flex; gap:4px; padding:0 12px 8px; border-bottom:1px solid var(--line); }
.bell-tabs button { height:40px; padding:0 12px; border:0; border-radius:8px; background:transparent; color:var(--muted); font-size:15px; font-weight:700; display:flex; align-items:center; gap:6px; }
.bell-tabs button:hover { color:var(--text); }
.bell-tabs button[aria-selected=true] { background:var(--hi); color:var(--onhi); }
.bell-tabs span { min-width:18px; height:18px; padding:0 5px; border-radius:9px; background:var(--danger); color:var(--bg); font-size:11px; line-height:18px; text-align:center; }
.bell-list { max-height:420px; overflow:auto; padding:6px; }
.bell-list a { display:flex; gap:12px; align-items:flex-start; padding:10px; border-radius:8px; }
.bell-list a:hover { background:var(--surface2); text-decoration:none; }
.bell-list a.new { background:var(--hi); }
.bell-text { flex:1; min-width:0; font-size:15px; line-height:1.5; display:flex; flex-direction:column; gap:2px; overflow-wrap:anywhere; }
.bell-text small { font-size:13px; color:var(--muted); }
.bell-rank { background:var(--warnbg); color:var(--warntext); }
.bell-empty { padding:36px 16px; text-align:center; color:var(--muted); font-size:15px; }

/* 화면 전환 스위치 */
.theme { display:flex; align-items:center; gap:8px; height:48px; padding:0 4px; border:0; background:transparent; }
.theme .track { width:54px; height:30px; border-radius:15px; background:var(--surface2); border:1.5px solid var(--line2); display:flex; align-items:center; padding:0 3px; }
.theme .knob { width:22px; height:22px; border-radius:11px; background:var(--primary); transform:translateX(23px); }
.theme .sun { color:var(--muted); } .theme .moon { color:var(--primary); }
:root[data-theme=light] .theme .knob { transform:none; }
:root[data-theme=light] .theme .sun { color:var(--primary); }
:root[data-theme=light] .theme .moon { color:var(--muted); }

/* 버튼 */
.btn { height:48px; padding:0 22px; border-radius:8px; font-weight:700; display:inline-flex; align-items:center; gap:8px; border:1.5px solid var(--line2); background:var(--surface); color:var(--text); white-space:nowrap; }
.btn:hover { text-decoration:none; filter:brightness(1.08); }
.btn.small { height:44px; padding:0 16px; font-size:15px; }
.btn.primary { border-color:transparent; background:var(--primary); color:var(--onprimary); }
.btn.soft { border-color:transparent; background:var(--hi); color:var(--onhi); }
.btn.kakao { border-color:transparent; background:#FEE500; color:#191919; }
.btn.quiet { font-weight:500; }
.btn.right { margin-left:auto; }
.play { width:48px; height:48px; flex:none; border-radius:24px; border:0; background:var(--primary); color:var(--onprimary); display:flex; align-items:center; justify-content:center; }
[data-play] .i-pause, [data-play].on .i-play { display:none; }
[data-play].on .i-pause { display:block; }

/* 공통 조각 */
.card { background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:28px; display:flex; flex-direction:column; gap:14px; }
.card.narrow { max-width:860px; }
.title { font-family:var(--title); font-weight:600; letter-spacing:-0.5px; font-size:34px; line-height:1.25; }
.h2 { font-family:var(--title); font-weight:600; letter-spacing:-0.5px; font-size:22px; }
.muted { color:var(--muted); }
.lead { font-size:17px; line-height:1.8; max-width:62ch; }
.row { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(320px,100%),1fr)); gap:20px; }
.grid.wide { grid-template-columns:repeat(auto-fit,minmax(min(440px,100%),1fr)); gap:28px; }
.notice { background:var(--warnbg); color:var(--warntext); border-radius:12px; padding:14px 18px; font-size:15px; display:flex; gap:12px; align-items:center; flex-wrap:wrap; }
.notice a { margin-left:auto; font-weight:700; text-decoration:underline; }
.badge { font-size:13px; font-weight:700; border-radius:6px; padding:4px 8px; color:var(--good); background:var(--goodbg); }
.chip { font-size:14px; background:var(--surface2); border-radius:8px; padding:6px 12px; }
.tabs { display:flex; gap:6px; background:var(--surface2); border-radius:10px; padding:4px; }
.tabs a { height:40px; padding:0 18px; border-radius:8px; font-size:15px; font-weight:700; color:var(--muted); display:flex; align-items:center; }
.tabs a:hover { text-decoration:none; color:var(--text); }
.tabs a[aria-current=true] { background:var(--primary); color:var(--onprimary); }
.cover { flex:none; object-fit:cover; border-radius:8px; display:flex; align-items:center; justify-content:center; color:rgba(255,255,255,0.8); }
.avatar { flex:none; object-fit:cover; border-radius:50%; display:flex; align-items:center; justify-content:center; font-weight:900; color:#FFFFFF; }
.field { height:48px; border:1.5px solid var(--line2); border-radius:8px; padding:0 14px; background:var(--surface); flex:1; }

/* 입력 양식 */
.form-row { display:flex; flex-direction:column; gap:8px; font-weight:700; }
.form-row .field { flex:none; font-weight:400; }
.form-row .file { font-weight:400; padding:14px; border:1.5px dashed var(--line2); border-radius:8px; background:var(--surface2); }
.hint { font-size:14px; font-weight:400; color:var(--muted); line-height:1.6; }
.btn:disabled { opacity:0.5; cursor:default; }
.btn.danger { border-color:var(--danger); color:var(--danger); }
.state { font-size:14px; font-weight:900; border-radius:8px; padding:6px 12px; }
.state.good { background:var(--goodbg); color:var(--good); }
.state.wait { background:var(--warnbg); color:var(--warntext); }
.state.bad { background:transparent; border:1.5px solid var(--danger); color:var(--danger); }
.steps { display:flex; gap:8px; flex-wrap:wrap; }
.steps li { display:flex; align-items:center; gap:8px; padding:8px 16px 8px 8px; border-radius:22px; background:var(--surface2); color:var(--muted); font-size:15px; }
.steps li span { width:28px; height:28px; border-radius:14px; background:var(--surface); display:flex; align-items:center; justify-content:center; font-weight:700; }
.steps li.now { background:var(--hi); color:var(--onhi); font-weight:700; }
.steps li.now span { background:var(--primary); color:var(--onprimary); }
.steps li.done span { background:var(--goodbg); color:var(--good); }
.cert-card { flex-direction:row; flex-wrap:wrap; gap:24px; align-items:flex-start; }
.shot { width:300px; flex:none; display:flex; flex-direction:column; gap:6px; font-size:14px; color:var(--primary); }
.shot img { width:100%; max-height:300px; object-fit:contain; background:var(--surface2); border-radius:8px; border:1px solid var(--line); }

.form-row textarea.field { height:auto; padding:12px 14px; line-height:1.6; resize:vertical; }
.form-row select.field { max-width:260px; }
.check { display:flex; align-items:center; gap:10px; font-weight:400; }
.check input { width:20px; height:20px; accent-color:var(--primary); }
.btn.liked { border-color:var(--primary); background:var(--primary); color:var(--onprimary); }
.btn.danger.sure { background:var(--danger); color:var(--bg); }

/* 내 스튜디오 */
.tiles { display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:16px; }
.tile { padding:20px; gap:4px; }
.tile strong { font-family:var(--title); font-size:32px; font-weight:600; }
.song-table { width:100%; border-collapse:collapse; font-size:15px; }
.song-table th { text-align:left; font-weight:500; color:var(--muted); font-size:14px; padding:10px 12px; white-space:nowrap; }
.song-table td { padding:10px 12px; border-top:1px solid var(--line); vertical-align:middle; white-space:nowrap; }
.song-table td:first-child { white-space:normal; min-width:280px; }
.song-table .n { text-align:right; font-variant-numeric:tabular-nums; }
.song-table tr.now .song-title { color:var(--primary); }
.song-table .play { width:40px; height:40px; }

/* 곡 목록 */
.grid > * { min-width:0; }
.songs.compact .genre { display:none; }
.songs li { display:flex; min-width:0; align-items:center; gap:16px; padding:12px 0; border-top:1px solid var(--line); }
.songs li.now .song-title { color:var(--primary); }
.rank { font-family:var(--title); font-size:28px; font-weight:600; width:44px; text-align:center; flex:none; color:var(--muted); }
.rank.hot { color:var(--primary); }
.song-name { flex:1; min-width:0; display:flex; flex-direction:column; gap:2px; }
.song-title { font-size:18px; font-weight:700; }
.song-sub { font-size:14px; color:var(--muted); }
.genre { width:84px; flex:none; font-size:14px; background:var(--surface2); border-radius:8px; padding:6px 0; text-align:center; }
.likes { width:76px; flex:none; font-size:15px; font-weight:700; display:flex; align-items:center; gap:6px; justify-content:flex-end; }

/* 홈 */
.hero { justify-content:center; background:#1C2A44 repeating-linear-gradient(to bottom,transparent 0 21px,rgba(255,255,255,0.09) 21px 22px) no-repeat 0 70% / 100% 110px; color:#FFFFFF; border-radius:12px; padding:36px; display:flex; flex-direction:column; gap:22px; }
.hero .eyebrow { font-size:15px; color:#6EA8FF; font-weight:700; }
.hero h1 { font-family:var(--title); font-weight:600; font-size:42px; line-height:1.2; letter-spacing:-0.5px; }
.hero .who { font-size:17px; color:#A6ADBB; }
.hero .btn.primary { background:#6EA8FF; color:#0C1B33; }
.hero .btn.ghost { background:transparent; border-color:#5A6172; color:#FFFFFF; }
.creator-card { padding:22px; }
.creator-card:hover { text-decoration:none; border-color:var(--primary); }
.top-song { display:flex; gap:12px; align-items:center; background:var(--surface2); border-radius:8px; padding:10px; }

/* 글 */
.post-list li { border-top:1px solid var(--line); }
.post-list a, .post-list .hidden-post { display:flex; align-items:center; gap:14px; padding:16px 0; flex-wrap:wrap; }
.post-list a:hover { text-decoration:none; }
.post-list a:hover .post-title { text-decoration:underline; }
.post-title { flex:1; min-width:200px; font-size:17px; font-weight:700; }
.hidden-post { color:var(--muted); }
.body-text { font-size:17px; line-height:1.9; max-width:62ch; white-space:pre-line; }
.comment { display:flex; gap:12px; border-top:1px solid var(--line); padding-top:14px; }
.comment-body { flex:1; min-width:0; display:flex; flex-direction:column; gap:4px; }
.comment-text { line-height:1.6; white-space:pre-line; overflow-wrap:anywhere; }
.comment-tools { display:flex; gap:4px; margin-left:-8px; }
.comment-tools button { min-height:36px; padding:0 8px; border:0; border-radius:6px; background:transparent; color:var(--muted); font-size:14px; }
.comment-tools button:hover { color:var(--text); background:var(--surface2); }
.comment-tools button.sure { color:var(--danger); font-weight:700; }
.comment.reply { border-top:0; padding-top:10px; margin-top:4px; }
.comment-form { display:flex; gap:10px; align-items:flex-end; }
.comment-form textarea { flex:1; height:auto; padding:12px 14px; line-height:1.5; resize:vertical; min-height:52px; }
[data-reply-box] { margin-top:10px; }
[data-reply-box][hidden] { display:none; }
details.faq { border-bottom:1px solid var(--line); }
details.faq summary { min-height:64px; display:flex; align-items:center; gap:12px; font-size:18px; font-weight:700; cursor:pointer; list-style:none; }
details.faq summary::-webkit-details-marker { display:none; }
details.faq summary::after { content:'펼치기'; margin-left:auto; font-size:14px; font-weight:500; color:var(--primary); }
details.faq[open] summary::after { content:'접기'; }
details.faq p { padding:0 0 20px; line-height:1.8; max-width:62ch; white-space:pre-line; }
.empty { text-align:center; padding:56px 20px; display:flex; flex-direction:column; gap:14px; align-items:center; }

/* 독립 플레이어 */
.player { position:fixed; left:0; right:0; bottom:0; z-index:10; min-height:var(--player-h); background:#15171B; color:#FFFFFF; border-top:1px solid #383D48; padding:0 32px; display:flex; align-items:center; gap:18px; }
.player[hidden] { display:none; }
.pl-cover { width:52px; height:52px; border-radius:8px; flex:none; }
.pl-meta { display:flex; flex-direction:column; width:200px; flex:none; overflow:hidden; }
.pl-meta strong, .pl-meta span { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.pl-meta span { font-size:13px; color:#A6ADBB; }
.pl-btn { width:44px; height:44px; flex:none; border:0; border-radius:22px; background:transparent; color:#FFFFFF; display:flex; align-items:center; justify-content:center; }
.pl-btn:hover { background:#2E323B; }
.pl-btn.main { width:48px; height:48px; border-radius:24px; background:#6EA8FF; color:#0C1B33; }
.pl-btn .i-pause, .player.on .pl-btn .i-play { display:none; }
.player.on .pl-btn .i-pause { display:block; }
.pl-time { font-size:14px; color:#A6ADBB; width:38px; flex:none; text-align:center; font-variant-numeric:tabular-nums; }
.pl-seek { flex:1; min-width:100px; accent-color:#6EA8FF; height:24px; }
.pl-vol-icon { color:#A6ADBB; flex:none; }
.pl-vol { width:90px; flex:none; accent-color:#A6ADBB; height:24px; }
.pl-queue-btn { height:44px; padding:0 14px; flex:none; border:1px solid #5A6172; border-radius:8px; background:transparent; color:#FFFFFF; font-size:14px; }
.pl-queue { position:absolute; right:32px; bottom:calc(100% + 8px); width:360px; max-height:420px; overflow:auto; background:#24272E; border:1px solid #383D48; border-radius:12px; padding:8px; box-shadow:0 12px 32px rgba(0,0,0,0.4); }
.pl-queue[hidden] { display:none; }
.pl-queue h2 { font-size:14px; color:#A6ADBB; font-weight:500; padding:8px 10px; }
.pl-queue button { width:100%; border:0; background:transparent; color:#FFFFFF; text-align:left; padding:10px; border-radius:8px; display:flex; flex-direction:column; }
.pl-queue button:hover { background:#2E323B; }
.pl-queue button[aria-current=true] { background:#25364F; color:#CFE2FF; }
.pl-queue button span { font-size:13px; color:#A6ADBB; }

.toast { position:fixed; left:50%; transform:translateX(-50%); bottom:calc(var(--player-h) + 20px); z-index:12; background:var(--text); color:var(--bg); padding:12px 18px; border-radius:8px; font-size:15px; font-weight:500; }
.toast[hidden] { display:none; }

@media (max-width:1100px) { .pl-vol, .pl-vol-icon { display:none; } .pl-meta { width:140px; } }
@media (max-width:860px) {
  .app { flex-direction:column; }
  .side { width:auto; height:auto !important; position:static; flex-direction:row; flex-wrap:wrap; align-items:center; padding:12px 16px; }
  .tagline, .support-box, .visits { display:none; }
  .nav { flex-direction:row; flex-wrap:wrap; }
  .top, .view { padding-left:16px; padding-right:16px; }
  .player { padding:8px 16px; flex-wrap:wrap; gap:10px; }
  .pl-queue-btn { display:none; }
  .genre { display:none; }
}
@media (prefers-reduced-motion:no-preference) { .theme .track, .nav a { transition:background-color .15s, border-color .15s; } }
