﻿/* =========================================
   시그니처 — style.css
   구조: 고정 헤더(브랜드+검색+멤버탭) + 좌 패널(필터·정렬) + 우 갤러리
   기본: 라이트 / 다크 토글
========================================= */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@300;400;600&family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600&display=swap');

/* ── 변수 ── */
:root {
    --topbar-h:   52px;   /* 브랜드+검색 행 */
    --navbar-h:   36px;   /* 페이지 네비 탭 행 */
    --tabbar-h:   44px;   /* 멤버 탭 행 */
    --header-h:   calc(var(--topbar-h) + var(--navbar-h) + var(--tabbar-h));
    --header-h-noinner: calc(var(--topbar-h) + var(--navbar-h)); /* org/members/music 용 */
    --panel-w:    180px;
    --lav:        #9575cd;
    --lav-lt:     #ede7f6;
    --lav-mid:    #b39ddb;
    --gold:       #b8954a;

    /* 라이트 */
    --bg:         #f5f4fb;
    --bg2:        #ece9f8;
    --bg-card:    #ffffff;
    --bg-header:  rgba(255,255,255,0.96);
    --bg-panel:   #ffffff;
    --bd:         #e0daf0;
    --bd-s:       #c3bae0;
    --t1:         #1a1728;
    --t2:         #4e4568;
    --t3:         #9990b2;
    --ac:         #7e57c2;
    --ac-bg:      #ede7f6;
    --ac-txt:     #5e35b1;
    --sh-sm:      0 1px 4px rgba(80,60,130,0.07);
    --sh-md:      0 4px 18px rgba(80,60,130,0.10);
    --sh-lg:      0 10px 32px rgba(80,60,130,0.15);
    --sh-header:  0 2px 12px rgba(80,60,130,0.08);
    /* refined header tokens — 액센트는 tokens.css(_super 컬러톤)에서 파생, 하드코딩은 fallback */
    --ac-grad:         linear-gradient(135deg, var(--brand-accent-2, #9575cd) 0%, var(--brand-accent, #7e57c2) 100%);
    --ac-glow:         color-mix(in srgb, var(--brand-accent, #7e57c2) 48%, transparent);
    --on-ac:           #ffffff;
    --header-hairline: linear-gradient(90deg, transparent, color-mix(in srgb, var(--brand-accent, #7e57c2) 20%, transparent) 28%, color-mix(in srgb, var(--brand-accent, #7e57c2) 20%, transparent) 72%, transparent);
    --sh-pop:          0 12px 34px -8px rgba(80,60,130,0.28), 0 2px 8px rgba(80,60,130,0.10);
    --sh-header-stuck: 0 6px 26px rgba(80,60,130,0.16);
}
[data-theme="dark"] {
    --bg:         #0d0d10;
    --bg2:        #131320;
    --bg-card:    #14141f;
    --bg-header:  rgba(13,13,16,0.96);
    --bg-panel:   #111118;
    --bd:         rgba(200,200,230,0.09);
    --bd-s:       rgba(179,157,219,0.22);
    --t1:         #ffffff;
    --t2:         #c2c8d6;
    --t3:         #5e6474;
    --ac:         #b39ddb;
    --ac-bg:      rgba(179,157,219,0.10);
    --ac-txt:     #c9b8e8;
    --sh-sm:      0 1px 4px rgba(0,0,0,0.3);
    --sh-md:      0 4px 18px rgba(0,0,0,0.35);
    --sh-lg:      0 10px 32px rgba(0,0,0,0.5);
    --sh-header:  0 2px 12px rgba(0,0,0,0.4);
    --ac-grad:         linear-gradient(135deg, var(--brand-accent-2, #c4b2ec) 0%, var(--brand-accent, #b39ddb) 100%);
    --ac-glow:         color-mix(in srgb, var(--brand-accent, #b39ddb) 40%, transparent);
    --on-ac:           #14141f;
    --header-hairline: linear-gradient(90deg, transparent, color-mix(in srgb, var(--brand-accent, #b39ddb) 24%, transparent) 28%, color-mix(in srgb, var(--brand-accent, #b39ddb) 24%, transparent) 72%, transparent);
    --sh-pop:          0 12px 34px -8px rgba(0,0,0,0.60), 0 2px 8px rgba(0,0,0,0.40);
    --sh-header-stuck: 0 6px 26px rgba(0,0,0,0.50);
}

/* ── 리셋 ── */
*,*::before,*::after{margin:0;padding:0;box-sizing:border-box;}
html{scroll-behavior:smooth;overflow-y:scroll;}
body{
    font-family:'DM Sans',-apple-system,sans-serif;
    background:var(--bg);
    color:var(--t1);
    min-height:100vh;
    transition:background .3s,color .3s;
    overflow-x:hidden;
}
a{text-decoration:none;color:inherit;}
button{font-family:inherit;cursor:pointer;}

/* ════════════════════════════════
   STICKY HEADER  (두 행 묶음)
════════════════════════════════ */
.sticky-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 500;
    background: var(--bg-header);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--bd);
    box-shadow: var(--sh-header);
    transition: background .3s, border-color .3s;
}

/* ── 1행: 브랜드 + 검색 + 테마 ── */
.topbar {
    display: flex;
    align-items: center;
    gap: 14px;
    height: var(--topbar-h);
    padding: 0 20px;
    border-bottom: 1px solid var(--bd);
}
.brand {
    display: flex;
    align-items: baseline;
    gap: 7px;
    flex-shrink: 0;
}
.brand-mark { color: var(--ac); font-size: 0.9rem; }
.brand-name {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    color: var(--t1);
}
.brand-sub {
    font-size: 0.6rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--t3);
}

.search-wrap {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    max-width: 500px;
}
.search-ico {
    position: absolute; left: 11px;
    color: var(--t3); pointer-events: none;
}
#searchInput {
    width: 100%;
    padding: 8px 34px 8px 33px;
    background: var(--bg2);
    border: 1px solid var(--bd);
    border-radius: 8px;
    font-size: 0.83rem;
    font-family: 'DM Sans', sans-serif;
    color: var(--t1);
    outline: none;
    transition: border-color .2s, background .2s;
}
#searchInput::placeholder { color: var(--t3); }
#searchInput:focus {
    border-color: var(--ac);
    background: var(--bg-card);
    box-shadow: 0 0 0 3px rgba(126,87,194,0.10);
}
.search-x {
    position: absolute; right: 9px;
    background: none; border: none;
    color: var(--t3); font-size: 0.7rem;
    padding: 3px 5px; line-height: 1;
    transition: color .18s;
}
.search-x:hover { color: var(--t1); }

.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    margin-left: auto;
}
.count-badge {
    font-size: 0.76rem;
    color: var(--t3);
    letter-spacing: 0.03em;
    white-space: nowrap;
}
.count-badge span:first-child {
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--ac);
}
.icon-btn {
    width: 32px; height: 32px;
    background: var(--bg2);
    border: 1px solid var(--bd);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.9rem;
    color: var(--t2);
    transition: border-color .2s, background .2s;
}
.icon-btn:hover { border-color: var(--bd-s); }

/* ── 2행: 멤버 탭 바 ── */
.member-tabbar {
    height: var(--tabbar-h);
    display: flex;
    align-items: stretch;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding: 0 20px;
}
.member-tabbar::-webkit-scrollbar { display: none; }

.member-tabs {
    display: flex;
    align-items: stretch;
    gap: 0;
    flex-shrink: 0;
}

.mtab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 16px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--t3);
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: color .18s, border-color .18s;
    cursor: pointer;
}
.mtab:hover { color: var(--t2); }
.mtab-on {
    color: var(--ac);
    border-bottom-color: var(--ac);
    font-weight: 600;
}
.mtab-n {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--t3);
    background: var(--bg2);
    padding: 1px 6px;
    border-radius: 100px;
    transition: background .18s, color .18s;
}
.mtab-on .mtab-n {
    background: var(--ac-bg);
    color: var(--ac);
}

/* ════════════════════════════════
   레이아웃 (패널 + 갤러리)
════════════════════════════════ */
.layout {
    display: flex;
    padding-top: var(--header-h);
    min-height: 100vh;
}

/* ── 왼쪽 사이드 패널 ── */
.side-panel {
    width: var(--panel-w);
    flex-shrink: 0;
    background: var(--bg-panel);
    border-right: 1px solid var(--bd);
    position: sticky;
    top: var(--header-h);
    height: calc(100vh - var(--header-h));
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--bd) transparent;
    transition: background .3s, border-color .3s;
}
.side-panel::-webkit-scrollbar { width: 3px; }
.side-panel::-webkit-scrollbar-thumb { background: var(--bd); border-radius: 3px; }

.side-inner { padding: 16px 0 32px; }

.sp-section { padding: 0 10px 14px; }
.sp-section + .sp-section {
    border-top: 1px solid var(--bd);
    padding-top: 14px;
}
.sp-label {
    font-size: 0.6rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--t3);
    padding: 0 6px 7px;
    display: block;
}
.sp-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    border-radius: 7px;
    font-size: 0.8rem;
    color: var(--t2);
    transition: background .15s, color .15s;
}
.sp-item:hover { background: var(--bg2); color: var(--t1); }
.sp-item.sp-on {
    background: var(--ac-bg);
    color: var(--ac-txt);
    font-weight: 500;
}
.sp-dot {
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--bd-s);
    flex-shrink: 0;
    transition: background .15s;
}
.sp-item.sp-on .sp-dot { background: var(--ac); }
.sp-item:hover .sp-dot { background: var(--t3); }

/* ════════════════════════════════
   갤러리 영역
════════════════════════════════ */
.gallery-wrap {
    flex: 1;
    min-width: 0;
    padding: 0 18px 60px;
}

/* 갤러리 바 */
.gbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0 14px;
    gap: 8px;
    border-bottom: 1px solid var(--bd);
    margin-bottom: 16px;
    position: sticky;
    top: var(--header-h);
    background: var(--bg);
    z-index: 100;
    transition: background .3s;
}
.gbar-left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 26px; }
.gbar-member {
    font-size: 0.8rem; font-weight: 600;
    color: var(--ac-txt);
    background: var(--ac-bg);
    padding: 3px 11px; border-radius: 100px;
}
.gbar-search {
    font-size: 0.77rem; color: var(--t3);
    background: var(--bg2);
    padding: 3px 9px; border-radius: 100px;
}
.gbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* 뷰 전환 */
.view-sw {
    display: flex;
    border: 1px solid var(--bd);
    border-radius: 7px;
    overflow: hidden;
}
.vs {
    width: 28px; height: 26px;
    background: none; border: none;
    display: flex; align-items: center; justify-content: center;
    color: var(--t3);
    transition: all .18s;
}
.vs + .vs { border-left: 1px solid var(--bd); }
.vs:hover { background: var(--ac-bg); color: var(--ac); }
.vs.active { background: var(--ac-bg); color: var(--ac-txt); }

/* ════════════════════════════════
   카드 그리드
════════════════════════════════ */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
    gap: 13px;
}

/* 빈 상태 */
.empty {
    grid-column: 1/-1;
    text-align: center;
    padding: 80px 20px;
}
.empty-ico { font-size: 2.4rem; margin-bottom: 14px; }
.empty-txt { font-size: 0.9rem; color: var(--t3); }

/* 카드 */
.sig-card {
    background: var(--bg-card);
    border: 1px solid var(--bd);
    border-radius: 11px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color .25s, transform .25s, box-shadow .25s;
    animation: cardIn .38s cubic-bezier(.22,1,.36,1) both;
}
.sig-card:hover {
    border-color: var(--bd-s);
    transform: translateY(-3px);
    box-shadow: var(--sh-lg);
}
@keyframes cardIn {
    from { opacity:0; transform:translateY(12px); }
    to   { opacity:1; transform:translateY(0); }
}

.sig-img {
    position: relative;
    overflow: hidden;
    background: var(--bg2);
    aspect-ratio: 4/3;
}
.sig-img img {
    width:100%; height:100%;
    object-fit: cover; display: block;
    transition: transform .3s ease;
}
.sig-card:hover .sig-img img { transform: scale(1.04); }

/* 개수 칩 */
.sig-chip {
    position: absolute; top: 7px; right: 7px;
    padding: 2px 8px;
    border-radius: 100px;
    font-size: 0.67rem; font-weight: 700;
    letter-spacing: 0.02em;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background: rgba(255,255,255,0.88);
    color: #3c2c6e;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
[data-theme="dark"] .sig-chip {
    background: rgba(20,20,32,0.84);
    color: #c9b8e8;
}
.sig-card.t-gold   .sig-chip { background:rgba(184,149,74,0.13); color:#c8a050; border:1px solid rgba(184,149,74,0.28); }
.sig-card.t-purple .sig-chip { background:rgba(126,87,194,0.12); color:#b39ddb; border:1px solid rgba(126,87,194,0.25); }

.sig-foot {
    display: flex; align-items: center;
    justify-content: space-between;
    padding: 9px 10px; gap: 5px;
    border-top: 1px solid var(--bd);
}
.sig-name {
    font-size: 0.77rem; font-weight: 500;
    color: var(--t2);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    flex:1; min-width:0;
}
.sig-acts { display:flex; align-items:center; gap:4px; flex-shrink:0; }
.sig-copy {
    width: 24px; height: 24px;
    background: var(--bg2);
    border: 1px solid var(--bd);
    border-radius: 6px;
    display: inline-flex; align-items:center; justify-content:center;
    color: var(--t3);
    transition: all .18s;
}
.sig-copy:hover { background:var(--ac-bg); border-color:var(--bd-s); color:var(--ac-txt); }
.sig-copy.copied { background:rgba(16,185,129,0.1); border-color:rgba(16,185,129,0.28); color:#10b981; }
.sig-mbadge {
    font-size: 0.64rem; font-weight: 500;
    color: var(--ac); background: var(--ac-bg);
    padding: 2px 6px; border-radius: 100px;
    white-space: nowrap; max-width:60px;
    overflow:hidden; text-overflow:ellipsis;
}

/* 리스트 뷰 */
.gallery.list-view { grid-template-columns:1fr; gap:6px; }
.list-view .sig-card { display:flex; border-radius:9px; transform:none!important; }
.list-view .sig-img { width:76px; aspect-ratio:auto; height:58px; flex-shrink:0; border-radius:0; }
.list-view .sig-img img { height:100%; }
.list-view .sig-chip { display:none; }
.list-view .sig-foot { flex:1; border-top:none; border-left:1px solid var(--bd); padding:0 13px; }
.list-view .sig-name { font-size:0.84rem; white-space:normal; }

/* ════════════════════════════════
   로더 / 토스트
════════════════════════════════ */
.loader-wrap { text-align:center; padding:36px; }
.loader-ring {
    width:28px; height:28px;
    border:3px solid var(--bd);
    border-top-color:var(--ac);
    border-radius:50%;
    animation:spin .8s linear infinite;
    margin:0 auto;
}
@keyframes spin { to{transform:rotate(360deg);} }

.toast {
    position:fixed; bottom:20px; right:20px;
    padding:10px 18px; border-radius:9px;
    font-size:0.8rem; font-weight:500;
    opacity:0; transform:translateY(10px);
    transition:opacity .22s,transform .22s;
    pointer-events:none; z-index:9999;
}
.toast.show { opacity:1; transform:translateY(0); }
.toast.t-ok  { background:rgba(16,185,129,0.11); border:1px solid rgba(16,185,129,0.26); color:#10b981; }
.toast.t-err { background:rgba(239,68,68,0.11);  border:1px solid rgba(239,68,68,0.26);  color:#ef4444; }

/* ════════════════════════════════
   반응형
════════════════════════════════ */

/* 태블릿 이하: 패널 너비 축소 */
@media (max-width:900px) {
    .layout { --panel-w: 148px; }
    .brand-sub { display:none; }
    .gallery { grid-template-columns:repeat(auto-fill,minmax(155px,1fr)); gap:10px; }
}

/* 모바일: 패널 숨기고 하단 고정 바로 대체 */
@media (max-width:600px) {
    :root {
        --topbar-h: 50px;
        --tabbar-h: 40px;
    }
    .brand-sub { display:none; }
    .search-wrap { max-width:none; }
    .topbar-right .count-badge { display:none; }

    /* 사이드 패널 → 하단 고정 바 */
    .side-panel {
        position: fixed;
        bottom: 0; left: 0; right: 0;
        top: auto;
        width: 100%;
        height: auto;
        border-right: none;
        border-top: 1px solid var(--bd);
        box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
        z-index: 400;
        overflow: hidden;
    }
    .side-inner {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 0;
        padding: 6px 10px;
        overflow-x: auto;
        scrollbar-width: none;
    }
    .side-inner::-webkit-scrollbar { display:none; }
    .sp-section {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 6px;
        padding: 4px 10px;
        border-top: none;
        flex-shrink: 0;
    }
    .sp-section + .sp-section {
        border-top: none;
        border-left: 1px solid var(--bd);
        border-right: none;
    }
    .sp-label {
        font-size: 0.6rem;
        letter-spacing: 0.1em;
        padding: 0;
        margin-right: 2px;
        writing-mode: horizontal-tb;
        transform: none;
        color: var(--t3);
        flex-shrink: 0;
        white-space: nowrap;
    }
    .sp-item {
        padding: 5px 10px;
        border-radius: 100px;
        font-size: 0.72rem;
        border: 1px solid transparent;
        white-space: nowrap;
        flex-shrink: 0;
    }
    .sp-item.sp-on {
        border-color: var(--bd-s);
    }
    .sp-dot { display:none; }

    /* 갤러리 하단 여백 (하단 바 높이만큼) */
    .gallery-wrap { padding-bottom: 70px; }
    .layout { padding-top: var(--header-h); }

    .gallery { grid-template-columns:repeat(2,1fr); gap:8px; }
    .gallery-wrap { padding: 0 12px 70px; }
    .gbar { padding: 10px 0 10px; }
}

@media (hover:none) and (pointer:coarse) {
    .sig-card:hover { transform:none; box-shadow:none; }
    .sig-card:hover .sig-img img { transform:none; }
}
/* ══════════════════════════════════════════════════
   page-navbar  (2행 탭: 전체 | 멤버 조직도 | 멤버 리스트 | 음원 목록)
══════════════════════════════════════════════════ */
.page-navbar {
    display: flex;
    align-items: center;
    height: var(--navbar-h);
    padding: 0 16px;
    gap: 2px;
    border-bottom: 1px solid var(--bd);
    background: var(--bg-card);
    overflow-x: auto;
    scrollbar-width: none;
}
.page-navbar::-webkit-scrollbar { display: none; }

.pnav {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 12px; border-radius: 20px;
    font-size: 0.72rem; font-weight: 500;
    color: var(--t3); letter-spacing: 0.04em;
    white-space: nowrap; text-decoration: none;
    transition: color .18s, background .18s;
    border: 1px solid transparent;
}
.pnav:hover { color: var(--t2); background: var(--bg2); }
.pnav-on {
    color: var(--ac);
    background: var(--ac-bg);
    border-color: var(--bd-s);
    font-weight: 600;
}
.pnav-icon { font-size: 0.78rem; }

/* org / members / music: 새 sticky 헤더(_nav)는 흐름 내 위치 → 옛 fixed 헤더용 상단 패딩 제거 */
.org-body, .ml-body, .music-body {
    padding-top: 0 !important;
}

/* ══════════════════════════════════════════════════
   sig-play  재생 버튼 (sig-copy 와 동일 사이즈)
══════════════════════════════════════════════════ */
.sig-play {
    width: 24px; height: 24px;
    background: var(--bg2);
    border: 1px solid var(--bd);
    border-radius: 6px;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--t3); cursor: pointer;
    transition: all .18s; flex-shrink: 0;
}
.sig-play:hover       { background: var(--ac-bg); border-color: var(--bd-s); color: var(--ac); }
.sig-play.playing     { background: rgba(126,87,194,.12); border-color: var(--bd-s); color: var(--ac); }

/* ══════════════════════════════════════════════════
   미니 플레이어 바  (index.php / music.php 공통)
══════════════════════════════════════════════════ */
.mp-bar {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
    background: var(--bg-card);
    border-top: 1px solid var(--bd);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 10px 20px;
    display: flex; align-items: center; gap: 14px;
    transform: translateY(100%);
    transition: transform .28s cubic-bezier(.4,0,.2,1);
    box-shadow: 0 -4px 24px rgba(0,0,0,.08);
}
.mp-bar.mp-visible { transform: translateY(0); }

.mp-cover {
    width: 40px; height: 40px; border-radius: 8px;
    background: var(--ac-bg); flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; overflow: hidden; color: var(--ac);
}
.mp-cover img { width: 100%; height: 100%; object-fit: cover; }

.mp-info { flex: 1; min-width: 0; }
.mp-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.98rem; font-weight: 600; color: var(--t1);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mp-count { font-size: 0.68rem; color: var(--t3); margin-top: 1px; }

.mp-controls { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.mp-btn {
    width: 30px; height: 30px; border-radius: 50%;
    background: var(--bg2); border: 1px solid var(--bd);
    display: flex; align-items: center; justify-content: center;
    color: var(--t2); cursor: pointer; transition: all .18s;
}
.mp-btn:hover { background: var(--ac-bg); border-color: var(--bd-s); color: var(--ac); }
.mp-btn.mp-play-main {
    width: 36px; height: 36px;
    background: var(--ac); border-color: var(--ac); color: #fff;
}
.mp-btn.mp-play-main:hover { opacity: .85; }

.mp-progress-wrap {
    flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0;
}
.mp-time { font-size: 0.66rem; color: var(--t3); flex-shrink: 0; font-variant-numeric: tabular-nums; }
.mp-progress {
    flex: 1; height: 4px; border-radius: 2px;
    background: var(--bd); cursor: pointer;
    appearance: none; -webkit-appearance: none; accent-color: var(--ac);
}
.mp-progress::-webkit-slider-thumb { appearance: none; width: 12px; height: 12px; border-radius: 50%; background: var(--ac); cursor: pointer; }
.mp-progress::-moz-range-thumb     { width: 12px; height: 12px; border-radius: 50%; background: var(--ac); cursor: pointer; border: none; }

.mp-vol { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.mp-vol-ico { color: var(--t3); cursor: pointer; transition: color .18s; }
.mp-vol-ico:hover { color: var(--ac); }
.mp-vol-slider {
    width: 72px; height: 4px; cursor: pointer; border-radius: 2px;
    accent-color: var(--ac);
    appearance: none; -webkit-appearance: none; background: var(--bd);
}
.mp-vol-slider::-webkit-slider-thumb { appearance: none; width: 10px; height: 10px; border-radius: 50%; background: var(--ac); cursor: pointer; }

@media (max-width: 600px) {
    .mp-progress-wrap { display: none; }
    .mp-vol           { display: none; }
    .mp-bar           { padding: 10px 14px; gap: 10px; }
    .page-navbar      { gap: 0; padding: 0 8px; }
    .pnav             { padding: 4px 9px; font-size: 0.67rem; }
}

/* ── music-search-outer (topbar 안 flex item) ── */
.music-search-outer {
    flex: 1;
    display: flex;
    align-items: center;
    max-width: 480px;
    position: relative;
}
@media (max-width: 600px) {
    .music-search-outer { max-width: none; }
}

/* ═══════════════════════════════════════
   modal/modal_style.css (통합됨) - 비디오 모달
═══════════════════════════════════════ */
/* 비디오 모달 스타일 */
.video-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    overflow-y: auto;
    padding: 20px;
}

.video-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.video-modal-content {
    background: var(--bg-card);
    border-radius: 20px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
}

.video-modal-header {
    padding: 24px 28px;
    border-bottom: 1px solid var(--bd);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: var(--bg-card);
    border-radius: 20px 20px 0 0;
    z-index: 10;
}

.video-modal-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--t1);
    margin: 0;
}

.video-modal-close {
    background: var(--bg2);
    border: 1px solid var(--bd);
    border-radius: 10px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--t2);
    font-size: 1.5rem;
}

.video-modal-close:hover {
    background: var(--ac);
    color: white;
    border-color: var(--ac);
    transform: rotate(90deg);
}

.video-modal-body {
    padding: 28px;
}

/* 비디오 플레이어를 위로 */
.video-player-container {
    margin-bottom: 24px;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
}

.video-player-container iframe {
    width: 100%;
    height: 450px;
    border: none;
    display: block;
}

/* 비디오 리스트를 가로 스크롤로 (텍스트 전용) */
.video-list {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 16px 4px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* 스크롤바 스타일 */
.video-list::-webkit-scrollbar {
    height: 6px;
}

.video-list::-webkit-scrollbar-track {
    background: var(--bg2);
    border-radius: 3px;
}

.video-list::-webkit-scrollbar-thumb {
    background: var(--ac);
    border-radius: 3px;
}

.video-list::-webkit-scrollbar-thumb:hover {
    background: var(--ac-txt);
}

/* 비디오 아이템 - 텍스트 칩 형태 */
.video-item {
    background: var(--bg2);
    border: 2px solid var(--bd);
    border-radius: 20px;
    padding: 10px 20px;
    flex-shrink: 0;
    transition: all 0.2s ease;
    cursor: pointer;
    white-space: nowrap;
}

.video-item:hover {
    background: var(--ac-bg);
    border-color: var(--ac);
    transform: translateY(-2px);
}

.video-item.active {
    background: var(--ac);
    border-color: var(--ac);
    color: white;
}

.video-item-thumbnail {
    display: none;
}

.video-item-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.video-item-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--t1);
}

.video-item.active .video-item-title {
    color: white;
}

.video-item-play-icon {
    font-size: 1rem;
    opacity: 0.7;
}

.video-item-url {
    display: none;
}

.no-videos {
    text-align: center;
    padding: 60px 20px;
    color: var(--t2);
}

.no-videos-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.no-videos-text {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.no-videos-subtext {
    font-size: 0.9rem;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 모바일 최적화 */
/* ══════════════════════════════════════════════════
   SOOP 라이브 뱃지 (member_list / org 공통)
══════════════════════════════════════════════════ */
.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    border-radius: 100px;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.32);
    transition: transform .18s, box-shadow .22s;
    white-space: nowrap;
    vertical-align: middle;
    line-height: 1;
    margin-left: 4px;
    font-family: 'DM Sans', sans-serif;
}
.live-badge:hover {
    transform: translateY(-1px) scale(1.04);
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.5);
}
.live-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #fff;
    flex-shrink: 0;
    animation: livePulse 1.3s ease-in-out infinite;
}
.live-viewers {
    font-size: 0.62rem;
    font-weight: 600;
    background: rgba(0,0,0,0.22);
    padding: 1px 6px;
    border-radius: 100px;
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
}
@keyframes livePulse {
    0%, 100% { opacity: 1;    transform: scale(1); }
    50%      { opacity: 0.5;  transform: scale(0.72); }
}

/* SOOP ID는 등록됐지만 현재 방송 안 함 */
.offline-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    background: var(--bg2);
    color: var(--t3);
    border: 1px solid var(--bd);
    border-radius: 100px;
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    white-space: nowrap;
    vertical-align: middle;
    line-height: 1;
    margin-left: 4px;
    font-family: 'DM Sans', sans-serif;
}
[data-theme="dark"] .offline-badge {
    background: rgba(255,255,255,0.04);
    color: var(--t3);
    border-color: rgba(255,255,255,0.08);
}

/* member_list: 라이브 행 강조 */
.ml-row-live {
    border-color: rgba(239, 68, 68, 0.35) !important;
    background: linear-gradient(90deg,
        var(--bg-card) 70%,
        rgba(239, 68, 68, 0.06)) !important;
}
.ml-row-live:hover {
    border-color: rgba(239, 68, 68, 0.55) !important;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.12) !important;
}

/* org: 라이브 카드 강조 */
.org-card-live {
    position: relative;
    border-color: rgba(239, 68, 68, 0.4) !important;
    background: linear-gradient(135deg,
        var(--bg-card) 70%,
        rgba(239, 68, 68, 0.07)) !important;
    box-shadow: 0 4px 18px rgba(239, 68, 68, 0.12) !important;
}
.org-card-live:hover {
    box-shadow: 0 8px 28px rgba(239, 68, 68, 0.22) !important;
}
.org-card-live::before {
    content: '';
    position: absolute;
    top: -1px; right: -1px;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.8);
    animation: livePulse 1.3s ease-in-out infinite;
    z-index: 1;
}
@media (max-width: 600px) {
    .live-badge       { font-size: 0.56rem; padding: 2px 7px; }
    .live-viewers     { display: none; }
    .offline-badge    { font-size: 0.56rem; padding: 2px 7px; }
}

@media (max-width: 768px) {
    .video-modal {
        padding: 10px;
        align-items: flex-start;
    }
    
    .video-modal-content {
        max-height: 95vh;
        margin-top: 20px;
    }
    
    .video-modal-header {
        padding: 20px;
    }
    
    .video-modal-header h2 {
        font-size: 1.2rem;
    }
    
    .video-modal-body {
        padding: 20px;
    }
    
    .video-player-container iframe {
        height: 250px;
    }
    
    .video-item {
        padding: 8px 16px;
    }
    
    .video-item-title {
        font-size: 0.85rem;
    }
    
    .video-item-play-icon {
        font-size: 0.9rem;
    }
}

/* =========================================================
   광우상사 스타일 메인 헤더 (_nav.php — 모든 포털 페이지 공통)
========================================================= */
.site-header {
    position: sticky; top: 0; z-index: 200;
    background: var(--bg-header);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
    box-shadow: var(--sh-header);
    transition: box-shadow .3s ease;
}
.site-header::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
    background: var(--header-hairline); pointer-events: none;
}
.site-header.is-stuck { box-shadow: var(--sh-header-stuck); }
.header-shell {
    max-width: 1180px; margin: 0 auto;
    height: 66px;
    display: flex; align-items: center; gap: 16px;
    padding: 0 24px;
}
.nav-brand { display: flex; align-items: center; gap: 5px; text-decoration: none; flex: 0 0 auto; transition: transform .18s ease; }
.nav-brand:hover { transform: translateY(-1px); }
.nav-brand:hover .nav-brand-mark { box-shadow: 0 6px 18px -4px var(--ac-glow); }
.nav-brand-mark {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 11px;
    background: var(--ac-grad); color: var(--on-ac); font-size: 1.05rem; line-height: 1;
    box-shadow: 0 4px 13px -4px var(--ac-glow);
    transition: box-shadow .18s ease;
}
.nav-brand-name { font-family: 'Cormorant Garamond', serif; font-size: 1.6rem; font-weight: 600; color: var(--t1); letter-spacing: 0.015em; }
/* 로고 기호가 업로드 이미지(mark.svg)일 때: 그라데이션 배지 대신 이미지 자체를 크게 표시 */
.nav-brand-mark-img { background: none; padding: 0; overflow: visible; width: auto; height: 84px; border-radius: 0; }
.nav-brand-mark-img, .nav-brand:hover .nav-brand-mark-img { box-shadow: none; }
.nav-brand-mark-img img { height: 100%; width: auto; max-width: 220px; object-fit: contain; display: block; }
/* 브랜드명이 업로드 이미지(wordmark.svg)일 때: 텍스트 대신 워드마크 이미지 */
.nav-brand-name-img { display: inline-flex; align-items: center; }
.nav-brand-name-img img { height: 48px; width: auto; max-width: 320px; object-fit: contain; display: block; }

.desktop-nav { display: flex; align-items: center; gap: 2px; flex: 1; padding-left: 6px; }
.dn-link {
    position: relative; display: inline-flex; align-items: center; gap: 5px;
    padding: 9px 15px; border-radius: 11px;
    font-family: inherit; font-size: 0.98rem; font-weight: 600; letter-spacing: 0.005em;
    color: var(--t2); text-decoration: none; background: transparent; border: none; cursor: pointer;
    transition: background .18s ease, color .18s ease;
}
.dn-link:hover { background: var(--bg2); color: var(--t1); }
.dn-link.active { color: var(--ac-txt); }
.dn-link.active::after {
    content: ''; position: absolute; left: 50%; transform: translateX(-50%); bottom: 2px;
    width: 18px; height: 2.5px; border-radius: 3px; background: var(--ac-grad);
}
.dn-item { position: relative; }
.dn-chev { width: 11px; height: 11px; opacity: .65; transition: transform .2s ease, opacity .2s ease; }
.dn-item:hover .dn-chev { transform: rotate(180deg); opacity: 1; }
.dn-submenu {
    position: absolute; top: calc(100% + 6px); left: 0; min-width: 210px;
    background: var(--bg-card); border: 1px solid var(--bd); border-radius: 15px;
    box-shadow: var(--sh-pop); padding: 8px; z-index: 60;
    display: flex; flex-direction: column; gap: 2px;
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}
.dn-submenu::before { content: ''; position: absolute; top: -8px; left: 0; right: 0; height: 8px; }
.dn-item:hover .dn-submenu { opacity: 1; visibility: visible; transform: translateY(0); }
.dn-sub-link {
    padding: 11px 14px; border-radius: 10px; text-decoration: none;
    font-size: 0.93rem; font-weight: 500; color: var(--t1); white-space: nowrap;
    transition: background .14s ease, color .14s ease, padding-left .14s ease;
}
.dn-sub-link:hover { background: var(--ac-bg); color: var(--ac-txt); padding-left: 18px; }

.header-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.ha-btn {
    width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
    background: var(--bg-card); border: 1px solid var(--bd); border-radius: 12px;
    color: var(--t2); cursor: pointer; font-size: 1.02rem;
    transition: border-color .16s ease, background .16s ease, color .16s ease, transform .16s ease;
}
.ha-btn:hover { border-color: var(--bd-s); background: var(--bg2); color: var(--t1); transform: translateY(-1px); }
.ha-user {
    display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px;
    background: var(--bg2); border: 1px solid var(--bd); border-radius: 12px;
}
.ha-uic { font-size: 0.92rem; }
.ha-nick { font-size: 0.9rem; font-weight: 600; color: var(--t1); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ha-login {
    display: inline-flex; align-items: center; gap: 7px;
    height: 40px; padding: 0 18px; border-radius: 12px;
    background: var(--ac-grad); color: var(--on-ac); font-size: 0.9rem; font-weight: 600; letter-spacing: 0.01em;
    text-decoration: none; border: none; cursor: pointer;
    box-shadow: 0 4px 16px -5px var(--ac-glow);
    transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}
.ha-login:hover { transform: translateY(-1px); box-shadow: 0 9px 22px -7px var(--ac-glow); filter: brightness(1.04); }

.mobile-toggle {
    display: none; width: 42px; height: 42px; align-items: center; justify-content: center;
    margin-left: auto;   /* 모바일에서 항상 우측 상단으로 */
    background: var(--bg-card); border: 1px solid var(--bd); border-radius: 12px; color: var(--t1); cursor: pointer;
    transition: background .16s ease, border-color .16s ease;
}
.mobile-toggle:hover { background: var(--bg2); border-color: var(--bd-s); }

/* 모바일 오버레이 */
.mobile-overlay { display: none; position: fixed; inset: 0; z-index: 1000; } /* 헤더 밖 body 직속 + 페이지 크롬(200·400·500) 위, 토스트/모달(9999) 아래 */
.mobile-overlay.open { display: block; }
.mo-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.45); border: none; cursor: pointer; }
.mobile-nav {
    position: absolute; top: 0; right: 0; height: 100%; width: min(86vw, 330px);
    background: var(--bg-card); border-left: 1px solid var(--bd); box-shadow: var(--sh-lg);
    padding: 18px 16px; display: flex; flex-direction: column; gap: 3px; overflow-y: auto;
    animation: navSlideIn .22s ease;
}
@keyframes navSlideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
.mn-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.mn-brand { font-family: 'Cormorant Garamond', serif; font-size: 1.35rem; font-weight: 600; color: var(--t1); }
.mn-close { width: 40px; height: 40px; background: transparent; border: none; color: var(--t2); font-size: 1.6rem; line-height: 1; cursor: pointer; border-radius: 10px; }
.mn-close:hover { background: var(--bg2); }
.mn-link { position: relative; display: block; padding: 14px; border-radius: 11px; font-size: 1.06rem; font-weight: 600; color: var(--t1); text-decoration: none; transition: background .14s ease, color .14s ease; }
.mn-link:hover { background: var(--bg2); color: var(--t1); }
.mn-link.active { background: var(--ac-bg); color: var(--ac-txt); }
.mn-link.active::before { content: ''; position: absolute; left: 4px; top: 50%; transform: translateY(-50%); width: 3px; height: 18px; border-radius: 3px; background: var(--ac-grad); }
.mn-group-label { padding: 18px 14px 6px; font-size: 0.76rem; font-weight: 700; letter-spacing: 0.06em; color: var(--t3); }
.mn-sub-link { display: block; padding: 11px 14px 11px 30px; border-radius: 10px; font-size: 0.96rem; color: var(--t2); text-decoration: none; transition: background .14s ease, color .14s ease, padding-left .14s ease; }
.mn-sub-link:hover { background: var(--bg2); color: var(--t1); padding-left: 34px; }
.mn-actions { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--bd); display: flex; flex-direction: column; gap: 8px; }
.mn-action { display: flex; align-items: center; gap: 9px; padding: 13px 14px; border-radius: 11px; background: var(--bg2); border: none; color: var(--t1); font-size: 0.96rem; font-weight: 500; cursor: pointer; text-decoration: none; font-family: inherit; transition: background .14s ease, color .14s ease; }
.mn-action:hover { background: var(--ac-bg); color: var(--ac-txt); }

/* 서브바 (음원 검색 / 시그니처 검색·멤버탭) */
.nav-subbar {
    max-width: 1180px; margin: 0 auto; padding: 10px 22px 2px;
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    border-bottom: 1px solid var(--bd);
}
.nav-subbar .search-wrap { flex: 1 1 260px; max-width: 440px; }
.nav-subbar .count-badge { margin-left: auto; }
.nav-subbar .member-tabbar { flex: 1 1 100%; padding: 0; margin-top: 4px; }
@media (max-width: 820px) {
    .nav-subbar { padding: 9px 16px 2px; }
}

@media (max-width: 820px) {
    .desktop-nav, .header-actions { display: none; }
    .mobile-toggle { display: inline-flex; }
    .header-shell { height: 58px; padding: 0 16px; }
    .nav-brand-name { font-size: 1.35rem; }
    .nav-brand-mark-img { height: 34px; }
    .nav-brand-name-img img { height: 34px; }
}

/* 갤러리(시그니처)에서 새 sticky 헤더 사용 시 옛 fixed-헤더 오프셋 보정 */
.gallery-body .layout { padding-top: 0 !important; }
.gallery-body .side-panel { top: 66px; height: calc(100vh - 66px); }
.gallery-body .gbar { top: 66px; }
@media (max-width: 820px) {
    .gallery-body .layout { padding-top: 0 !important; }
    .gallery-body .side-panel { top: 58px; height: calc(100vh - 58px); }
    .gallery-body .gbar { top: 58px; }
}

/* 모바일: 갤러리 사이드 패널도 하단 고정 바로 (위 820px 규칙의 높은 명시도 무력화) */
@media (max-width: 600px) {
    .gallery-body .side-panel { top: auto; bottom: 0; height: auto; }
}