/* 공통 셸: 밝은 테마 + 상단 메뉴 (모든 페이지 동일) */
:root {
  color-scheme: light;
  --sh-bg: #f7f8fa;
  --sh-surface: #ffffff;
  --sh-surface2: #f1f3f6;
  --sh-text: #1c2430;
  --sh-muted: #6b7482;
  --sh-border: #e3e6eb;
  --sh-accent: #2563eb;
}

html, body {
  background: var(--sh-bg) !important;
  color: var(--sh-text);
}

a { color: var(--sh-accent); }

/* ── 상단 메뉴 ── */
.sh-nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--sh-surface);
  border-bottom: 1px solid var(--sh-border);
}
.sh-nav-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; gap: 36px;
  height: 58px; padding: 0 20px;
}
.sh-brand {
  font-size: 17px; font-weight: 700; color: var(--sh-text);
  text-decoration: none; white-space: nowrap; letter-spacing: -0.01em;
}
.sh-brand span { color: var(--sh-accent); font-weight: 600; }
.sh-menu {
  list-style: none; display: flex; align-items: stretch; gap: 26px;
  height: 100%; margin: 0; padding: 0;
}
.sh-item { position: relative; display: flex; align-items: center; }
.sh-top {
  font-size: 15px; font-weight: 600; color: var(--sh-text);
  cursor: default; padding: 8px 0;
  border-bottom: 2px solid transparent;
}
.sh-item:hover > .sh-top,
.sh-item:focus-within > .sh-top { color: var(--sh-accent); border-bottom-color: var(--sh-accent); }

/* 마우스를 올리면 하위 메뉴가 바로 아래로 펼쳐진다 */
.sh-drop {
  position: absolute; left: 0; top: 100%;
  min-width: 260px;
  background: var(--sh-surface);
  border: 1px solid var(--sh-border);
  border-radius: 0 0 12px 12px;
  box-shadow: 0 16px 36px rgba(20, 30, 50, 0.12);
  padding: 8px;
  display: none;
  z-index: 60;
}
.sh-item:hover > .sh-drop,
.sh-item:focus-within > .sh-drop { display: block; }
.sh-drop-link {
  display: block; padding: 10px 12px; border-radius: 8px;
  text-decoration: none; color: var(--sh-text);
}
.sh-drop-link:hover { background: var(--sh-surface2); }
.sh-drop-link b { display: block; font-size: 14px; font-weight: 600; color: var(--sh-text); margin-bottom: 2px; }
.sh-drop-link small { display: block; font-size: 12px; color: var(--sh-muted); line-height: 1.4; }
.sh-drop-sep {
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em; color: var(--sh-muted);
  padding: 12px 12px 4px; margin-top: 4px; border-top: 1px solid var(--sh-border);
}

/* ── 페이지 제목 줄 ── */
.sh-titlebar {
  max-width: 1200px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap;
  padding: 22px 20px 14px;
}
.sh-cat { font-size: 12px; font-weight: 600; color: var(--sh-accent); letter-spacing: 0.02em; margin-bottom: 4px; }
.sh-title { font-size: 24px; font-weight: 700; color: var(--sh-text); margin: 0; line-height: 1.25; letter-spacing: -0.02em; }
.sh-bar-right { display: flex; gap: 12px; align-items: center; font-size: 13px; color: var(--sh-muted); flex-wrap: wrap; }
.sh-link { color: var(--sh-accent); text-decoration: none; white-space: nowrap; font-weight: 600; }
.sh-sub { font-size: 14px; color: var(--sh-muted); max-width: 1200px; margin: 0 auto 6px; padding: 0 20px; }

/* ── 공통 카드 ── */
.sh-card {
  background: var(--sh-surface); border: 1px solid var(--sh-border);
  border-radius: 12px; padding: 16px;
}

@media (max-width: 900px) {
  .sh-nav-inner { gap: 16px; overflow-x: auto; }
  .sh-menu { gap: 16px; }
}

/* 글꼴 통일: 모든 페이지 본문을 같은 산세리프로 (페이지별 세리프/모노 지정을 덮음) */
body {
  font-family: "Pretendard", "Noto Sans KR", "Malgun Gothic", "Segoe UI", system-ui, -apple-system, sans-serif !important;
}

/* 밝은 테마 고정: 시스템이 어두워도 페이지별 어두운 색 변수를 밝은 값으로 덮는다 */
:root {
  --bg: #f7f8fa !important;
  --surface: #ffffff !important;
  --surface2: #f1f3f6 !important;
  --panel: #ffffff !important;
  --panel-2: #f1f3f6 !important;
  --card: #ffffff !important;
  --line: #e3e6eb !important;
  --border: #e3e6eb !important;
  --border2: #cfd5dd !important;
  --text: #1c2430 !important;
  --text-muted: #6b7482 !important;
  --text-dim: #9aa2ae !important;
  --muted: #6b7482 !important;
  --accent: #2563eb !important;
  --accent2: #1d4ed8 !important;
  --accent-2: #1d4ed8 !important;
  --good: #15803d !important;
  --bad: #b91c1c !important;
  --warn: #b45309 !important;
  --warn-bg: #fff4e0 !important;
  --up: #d8372b !important;
  --down: #1f6fe0 !important;
  --success: #15803d !important;
  --ok: #1d7a3a !important;
  --ok-bg: #e7f6ec !important;
  --on: #15803d !important;
  --off: #9aa2ae !important;
  --danger: #d8372b !important;
}

/* 가운데 정렬 레이아웃(.layout) 안의 제목 줄은 카드 폭에 맞춘다 */
.layout > .sh-titlebar { width: 100%; max-width: none; margin: 0; padding: 22px 0 14px; }
.layout > .sh-sub { width: 100%; max-width: none; margin: 0 0 6px; padding: 0; }

/* 페이지 길이에 따라 세로 스크롤바가 생겼다 사라져도 화면이 옆으로 밀리지 않게 스크롤바 자리를 항상 확보 */
html { overflow-y: scroll !important; }
.sh-nav { height: 58px; }

/* 상단 메뉴·제목 줄·설명 줄은 모든 페이지에서 같은 가로 기준선을 쓴다 */
.sh-nav-inner, .sh-titlebar, .sh-sub {
  width: min(1200px, 100% - 40px);
  margin-left: auto; margin-right: auto;
  box-sizing: border-box;
}
.sh-nav-inner { padding: 0; }
.sh-titlebar { padding-left: 0; padding-right: 0; }
.sh-sub { padding: 0; }

/* 누르면 여는 메뉴 (터치 기기) */
.sh-item.open > .sh-drop { display: block; }
.sh-top { cursor: pointer; user-select: none; }

/* 휴대폰: 메뉴를 한 줄로, 하위 메뉴는 누르면 열림 */
@media (max-width: 720px) {
  .sh-nav-inner {
    height: auto; min-height: 52px; padding: 10px 14px;
    gap: 12px; flex-wrap: nowrap; overflow: visible;
  }
  .sh-brand { font-size: 15px; flex: 0 0 auto; }
  .sh-brand span { display: none; }
  .sh-menu { gap: 14px; flex: 0 0 auto; }
  .sh-top { font-size: 14px; white-space: nowrap; padding: 6px 0; }
  /* 휴대폰: 하위 메뉴는 화면 가로폭 안에 맞춰 펼친다 (메뉴 위치와 무관하게 잘리지 않도록 고정) */
  .sh-drop { position: fixed; top: 56px; left: 12px; right: 12px; min-width: 0; border-radius: 0 0 12px 12px; }
  .sh-titlebar { padding-top: 16px; }
  .sh-title { font-size: 20px; }
}
