/* MV-auto 통합 사이트 공통 스타일
   공개 사이트(정적 생성)와 로컬 콘솔이 이 파일 하나를 함께 씁니다. */
:root {
  --bg: #151021; --surface: #1E1830; --ink: #EFEAF7; --muted: #9C93B5;
  --line: #322A49; --pink: #FF5C8A; --cyan: #3BC9DB;
  --ok: #4ADE80; --warn: #FBBF24; --danger: #F87171;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: linear-gradient(180deg, #100C1B 0%, #241238 100%);
  color: var(--ink); line-height: 1.6; min-height: 100vh;
  font-family: "Apple SD Gothic Neo", Pretendard, "Noto Sans KR", "Malgun Gothic", sans-serif;
}
a { color: var(--cyan); }
.wrap { max-width: 760px; margin: 0 auto; padding: 40px 20px 60px; }
.wrap.wide { max-width: 1040px; }

/* 헤더 / 네비게이션 */
.masthead { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.eyebrow { color: var(--cyan); font-size: 13px; font-weight: 700; letter-spacing: 0.16em; }
h1 { font-size: 38px; margin: 6px 0 10px; letter-spacing: -0.02em; }
h1 .hundred { color: var(--pink); }
.lede { color: var(--muted); font-size: 15.5px; max-width: 40em; margin: 0 0 22px; }
.nav-menu { display: flex; gap: 6px; border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 26px; flex-wrap: wrap; }
.nav-menu a { color: var(--muted); text-decoration: none; font-size: 15px; font-weight: 700; padding: 5px 10px; border-radius: 8px; }
.nav-menu a:hover { color: var(--pink); }
.nav-menu a.active { color: var(--pink); background: rgba(255,92,138,.1); }
.nav-menu a.console-only::after { content: "·콘솔"; font-size: 10px; color: var(--line); margin-left: 4px; vertical-align: super; }

/* 공통 요소 */
h2 { font-size: 19px; margin: 44px 0 14px; }
h2:first-of-type { margin-top: 28px; }
h2 .period, h2 .sub { color: var(--muted); font-size: 13.5px; font-weight: 400; margin-left: 8px; }
.btn {
  display: inline-block; background: var(--pink); color: #fff; text-decoration: none; border: none;
  font-weight: 800; padding: 10px 22px; border-radius: 999px; font-size: 14.5px; cursor: pointer;
  font-family: inherit;
}
.btn:hover { filter: brightness(1.1); }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.btn.ghost:hover { border-color: var(--pink); color: var(--pink); filter: none; }
.btn.small { padding: 5px 13px; font-size: 12.5px; font-weight: 700; }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.card {
  display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; text-decoration: none; color: var(--ink);
}
a.card:hover { border-color: var(--pink); }
.card-title { font-weight: 700; font-size: 14.5px; }
.card-count { color: var(--muted); font-size: 12.5px; margin-top: 3px; }

table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
td, th { padding: 9px 14px; border-bottom: 1px solid var(--line); font-size: 14px; text-align: left; }
th { color: var(--muted); font-size: 12.5px; font-weight: 700; }
tr:last-child td { border-bottom: none; }
td.rank { width: 44px; text-align: center; font-weight: 800; color: var(--cyan); font-variant-numeric: tabular-nums; }
td a { color: var(--ink); text-decoration: none; }
td a:hover { color: var(--pink); }
.artist { font-weight: 700; }
.pub-date { color: var(--muted); font-size: 13.5px; font-variant-numeric: tabular-nums; text-align: center; white-space: nowrap; }
.scroll-x { overflow-x: auto; }

footer { margin-top: 48px; color: var(--muted); font-size: 12.5px; border-top: 1px solid var(--line); padding-top: 16px; }
footer a { color: var(--cyan); }

.weeknav { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 14px 0 0; }
select.weeksel {
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 12px; font-size: 14px; font-family: inherit; max-width: 100%;
}
.weeknav a { color: var(--cyan); text-decoration: none; font-size: 14px; font-weight: 700; }
.weeknav a:hover { color: var(--pink); }

.pagination { display: flex; justify-content: center; align-items: center; gap: 8px; margin: 30px 0 10px; flex-wrap: wrap; }
.pagination a, .pagination span {
  display: inline-block; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 700;
}
.pagination a:hover { border-color: var(--pink); color: var(--pink); }
.pagination span.current { background: var(--pink); border-color: var(--pink); color: #fff; }
.pagination span.disabled { color: var(--line); }

/* 상태 배지 */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge.ok { background: rgba(74,222,128,.14); color: var(--ok); }
.badge.warn { background: rgba(251,191,36,.14); color: var(--warn); }
.badge.danger { background: rgba(248,113,113,.14); color: var(--danger); }
.badge.muted { background: rgba(156,147,181,.14); color: var(--muted); }

/* 콘솔 전용 */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 18px 0; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.stat .num { font-size: 26px; font-weight: 800; color: var(--pink); font-variant-numeric: tabular-nums; }
.stat .label { color: var(--muted); font-size: 12.5px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin: 14px 0; }
.panel h3 { margin: 0 0 10px; font-size: 15px; }
.notice { border-left: 3px solid var(--cyan); padding: 10px 14px; background: rgba(59,201,219,.07); border-radius: 0 8px 8px 0; margin: 14px 0; font-size: 14px; }
.notice.warn { border-color: var(--warn); background: rgba(251,191,36,.07); }
.notice.danger { border-color: var(--danger); background: rgba(248,113,113,.07); }
pre.log { background: #0D0A16; border: 1px solid var(--line); border-radius: 10px; padding: 14px; overflow-x: auto;
  font-size: 12px; line-height: 1.55; color: #C9C0DE; margin: 0; }
.inline-form { display: inline; }
.muted { color: var(--muted); }
.samples { color: var(--muted); font-size: 12.5px; }

/* ---------- 걸그룹 메인·그룹 페이지 ---------- */
.small { font-size: 12.5px; }
.crumb { color: var(--muted); font-size: 13px; margin: 0 0 4px; }
.crumb a { color: var(--cyan); text-decoration: none; }

/* 연속 듣기 — 차 안에서 휴대폰으로 누르기 쉽도록 크게 */
.listen-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin: 18px 0 8px; }
.listen { display: flex; align-items: center; gap: 14px; min-height: 76px; padding: 14px 18px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.listen:hover { border-color: var(--pink); }
.listen.accent { background: var(--pink); border-color: var(--pink); color: #fff; }
.listen-icon { flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255,255,255,.12); font-size: 16px; }
.listen.accent .listen-icon { background: rgba(255,255,255,.25); }
.listen-text { display: flex; flex-direction: column; line-height: 1.35; }
.listen-text strong { font-size: 16px; }
.listen-text small { opacity: .8; font-size: 12.5px; }

.anniv { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.anniv-item { padding: 7px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line);
  color: var(--muted); text-decoration: none; font-size: 13.5px; }
.anniv-item strong { color: var(--ink); }
.anniv-item.today { border-color: var(--pink); color: var(--ink); }

/* MV 카드 */
.mv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.mv-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; overflow: hidden; text-decoration: none; color: var(--ink); }
.mv-card:hover { border-color: var(--pink); }
.mv-thumb { position: relative; display: block; aspect-ratio: 16 / 9; background: #0D0A16; }
.mv-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mv-body { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px 12px; }
.mv-title { font-size: 13.5px; font-weight: 700; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; }
.mv-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; }
.mv-group { color: var(--cyan); font-weight: 700; }
.badge.solo { background: rgba(255,92,138,.14); color: var(--pink); }

/* 그룹 카드 */
.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.group-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; overflow: hidden; text-decoration: none; color: var(--ink); }
.group-card:hover { border-color: var(--pink); }
.group-card[hidden] { display: none; }
.gen-tag { position: absolute; left: 8px; top: 8px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px;
  font-weight: 700; background: rgba(21,16,33,.8); color: var(--cyan); }
.group-body { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px 12px; }
.group-name { font-size: 16px; font-weight: 800; }
.group-name small { color: var(--muted); font-weight: 400; font-size: 12.5px; }
.group-meta { color: var(--muted); font-size: 12.5px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* 필터 */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 8px 0 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 999px;
  padding: 6px 13px; font-size: 13px; font-weight: 700; cursor: pointer; font-family: inherit; }
.chip.on { background: var(--pink); border-color: var(--pink); color: #fff; }

/* 그룹 페이지 */
.group-head { margin: 4px 0 8px; }
.group-title { font-size: 32px; margin: 0; letter-spacing: -0.01em; }
.group-title small { color: var(--muted); font-size: 17px; font-weight: 400; }
.group-badges { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.member { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 6px 0 6px 18px; font-size: 14px; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 13px; width: 10px; height: 10px; border-radius: 50%; background: var(--cyan); }
.timeline li.ev-leave::before, .timeline li.ev-disband::before { background: var(--danger); }
.timeline li.ev-hiatus::before, .timeline li.ev-dispute::before { background: var(--warn); }
.timeline li.ev-debut::before, .timeline li.ev-join::before, .timeline li.ev-return::before { background: var(--ok); }
.ev-date { color: var(--muted); font-variant-numeric: tabular-nums; margin-right: 8px; }
@media (max-width: 560px) { .group-title { font-size: 26px; } .listen { min-height: 68px; } }

/* ---------- 멤버 타임라인 (member_timeline.py) ---------- */
.timeline-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 6px; }
.member-timeline { display: block; width: 100%; min-width: 640px; height: auto; }
.member-timeline .tl-grid { stroke: var(--line); stroke-width: 1; }
.member-timeline .tl-year { fill: var(--muted); font-size: 12px; }
.member-timeline .tl-name { fill: var(--ink); font-size: 13px; font-weight: 700; }
.member-timeline .tl-name.former { fill: var(--muted); font-weight: 400; }
.member-timeline .tl-bar.tl-departure { fill: #A78BFA; }
.member-timeline .tl-bar.tl-contract { fill: var(--cyan); }
.member-timeline .tl-bar.tl-project, .member-timeline .tl-bar.tl-former { fill: var(--muted); }
.member-timeline .tl-other { fill: var(--cyan); font-size: 11.5px; }
.member-timeline .tl-event { stroke: var(--warn); stroke-width: 1; stroke-dasharray: 3 3; opacity: .55; }
.member-timeline .tl-event.ev-debut { stroke: var(--ok); }
.member-timeline .tl-event.ev-disband { stroke: var(--danger); }
.member-timeline rect:hover { filter: brightness(1.25); }
.tl-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 8px 0 0; }
.tl-legend .sw { display: inline-block; width: 18px; height: 9px; border-radius: 3px; margin-right: 4px; vertical-align: middle; }
.tl-legend .sw.current { background: var(--pink); }
.tl-legend .sw.tl-departure { background: #A78BFA; }
.tl-legend .sw.tl-contract { background: var(--cyan); }
.tl-legend .sw.tl-project { background: var(--muted); }
.tl-legend .sw.line { height: 0; border-top: 2px dashed var(--warn); border-radius: 0; }
a.badge { text-decoration: none; }
