:root {
    --primary: #1b63d6;
    --primary-dark: #134aa3;
    --accent: #16a571;
    --ink: #1f2733;
    --muted: #6b7480;
    --line: #e6e9ef;
    --bg: #f5f7fa;
    --radius: 10px;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: "Malgun Gothic", "맑은 고딕", system-ui, sans-serif;
    color: var(--ink);
    background: var(--bg);
}
a { color: inherit; text-decoration: none; }

/* ===== 상단 유틸바 ===== */
.topbar { background: #fff; border-bottom: 1px solid var(--line); }
.topbar .inner {
    max-width: 1200px; margin: 0 auto; padding: 6px 20px;
    display: flex; justify-content: flex-end; gap: 14px; font-size: 13px; color: var(--muted);
}
.topbar a:hover { color: var(--primary); }
.topbar form { display: inline; }
.topbar button { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 13px; padding: 0; }
.topbar a.admin-link {
    background: var(--accent); color: #fff; padding: 4px 12px; border-radius: 14px;
    font-weight: 700; font-size: 12px;
}
.topbar a.admin-link:hover { background: #128a5e; color: #fff; }

/* ===== 헤더 ===== */
.header { background: #fff; border-bottom: 1px solid var(--line); }
.header .inner {
    max-width: 1200px; margin: 0 auto; padding: 16px 20px;
    display: flex; align-items: center; gap: 28px;
}
.logo { font-size: 24px; font-weight: 800; color: var(--primary); white-space: nowrap; }
.logo span { color: var(--accent); }
.search { flex: 1; display: flex; max-width: 560px; }
.search input {
    flex: 1; border: 2px solid var(--primary); border-right: 0;
    border-radius: var(--radius) 0 0 var(--radius); padding: 11px 14px; font-size: 15px; outline: none;
}
.search button {
    border: 0; background: var(--primary); color: #fff; font-size: 15px; font-weight: 600;
    padding: 0 22px; border-radius: 0 var(--radius) var(--radius) 0; cursor: pointer;
}

/* ===== 메뉴(GNB) — 2·3뎁스 드롭다운 ===== */
.gnb { background: var(--primary); }
.gnb .inner { max-width: 1200px; margin: 0 auto; padding: 0 20px; display: flex; flex-wrap: wrap; }
.gnb-item { position: relative; }
.gnb-item > a {
    color: #fff; padding: 14px 18px; font-size: 15px; font-weight: 600;
    display: block; transition: background .15s; text-decoration: none;
}
.gnb-item:hover > a { background: var(--primary-dark); }
.gnb-item.active > a { background: var(--primary-dark); box-shadow: inset 0 -3px 0 #fff; }
/* 2뎁스 */
.gnb-sub {
    display: none; position: absolute; top: 100%; left: 0; min-width: 168px; z-index: 200;
    background: #fff; border: 1px solid var(--line, #e5e8ee);
    box-shadow: 0 8px 20px rgba(0,0,0,.14); padding: 4px 0;
}
.gnb-item:hover .gnb-sub { display: block; }
.gnb-sub > a, .gnb-item3 > a {
    display: block; padding: 10px 16px; color: #333; font-size: 14px; font-weight: 500;
    text-decoration: none; white-space: nowrap;
}
.gnb-sub > a:hover, .gnb-item3 > a:hover { background: #f0f4fa; color: var(--primary); }
/* 3뎁스 (플라이아웃) */
.gnb-item3 { position: relative; }
.gnb-item3 > a { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.gnb-arr { color: var(--muted, #8a94a3); font-size: 12px; }
.gnb-sub3 {
    display: none; position: absolute; top: -5px; left: 100%; min-width: 132px;
    background: #fff; border: 1px solid var(--line, #e5e8ee);
    box-shadow: 0 8px 20px rgba(0,0,0,.14); padding: 4px 0;
}
.gnb-item3:hover .gnb-sub3 { display: block; }
.gnb-sub3 > a { display: block; padding: 10px 16px; color: #333; font-size: 14px; text-decoration: none; white-space: nowrap; }
.gnb-sub3 > a:hover { background: #f0f4fa; color: var(--primary); }

/* ===== 본문 ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 24px 20px 60px; }

/* 지도 히어로 */
.hero {
    position: relative; height: 380px; border-radius: var(--radius); overflow: hidden;
    background: linear-gradient(135deg, #1b63d6 0%, #16a571 100%);
    display: flex; align-items: center; justify-content: center; color: #fff; text-align: center;
    margin-bottom: 28px;
}
.hero .map-ph {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px);
    background-size: 40px 40px;
}
.hero .msg { position: relative; z-index: 1; }
.hero .msg h2 { font-size: 28px; margin: 0 0 8px; }
.hero .msg p { margin: 0; opacity: .9; }
.legend { position: absolute; left: 16px; bottom: 16px; z-index: 1; display: flex; gap: 8px; flex-wrap: wrap; }
.legend span { background: rgba(255,255,255,.92); color: var(--ink); border-radius: 20px; padding: 5px 12px; font-size: 12px; font-weight: 600; }

/* 카드 그리드 */
.section-tit { font-size: 19px; font-weight: 700; margin: 0 0 14px; }
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 32px; }
.card {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px;
    transition: box-shadow .15s, transform .15s;
}
.card:hover { box-shadow: 0 6px 18px rgba(0,0,0,.07); transform: translateY(-2px); }
.card .ico { font-size: 26px; }
.card h3 { font-size: 16px; margin: 10px 0 6px; }
.card p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.5; }

/* 두 컬럼 정보 */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.panel h3 { margin: 0 0 12px; font-size: 16px; display: flex; justify-content: space-between; }
.panel h3 a { font-size: 12px; color: var(--muted); font-weight: 400; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.list li:last-child { border-bottom: 0; }
.list .v { color: var(--primary); font-weight: 700; }
.badge { font-size: 11px; background: #eef3fe; color: var(--primary); border-radius: 4px; padding: 2px 7px; margin-right: 6px; }

/* ===== 로그인/회원가입 레이어 팝업(모달) ===== */
.modal-overlay {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(20, 30, 45, .55);
    display: flex; align-items: center; justify-content: center;
    /* 페이드 애니메이션 (display 대신 opacity/visibility 토글) */
    opacity: 0; visibility: hidden;
    transition: opacity .2s ease, visibility .2s ease;
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal-box {
    position: relative; background: #fff;
    width: 360px; max-width: calc(100% - 32px);
    border-radius: var(--radius); padding: 30px 30px 24px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .28);
    /* 살짝 떠오르며 슬라이드 인 */
    transform: translateY(12px) scale(.98);
    transition: transform .22s cubic-bezier(.2, .8, .25, 1);
}
.modal-overlay.open .modal-box { transform: none; }
.modal-box h2 {
    font-size: 21px; margin: 0 0 4px; color: var(--ink);
    cursor: move; user-select: none;            /* 헤더를 잡고 드래그 이동 */
    padding-right: 24px;                          /* 닫기 버튼과 겹침 방지 */
}
.modal-sub { margin: 0 0 18px; font-size: 13px; color: var(--muted); }
.modal-close {
    position: absolute; top: 10px; right: 12px;
    border: 0; background: none; font-size: 24px; line-height: 1;
    color: var(--muted); cursor: pointer;
}
.modal-close:hover { color: var(--ink); }
.modal-box input {
    width: 100%; box-sizing: border-box; padding: 11px 12px; margin: 5px 0;
    border: 1px solid var(--line); border-radius: 6px; font-size: 14px;
    transition: border-color .15s, box-shadow .15s;
}
.modal-box input:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(27, 99, 214, .12);
}
.modal-submit {
    width: 100%; padding: 12px; margin-top: 14px; border: 0; border-radius: 6px;
    background: var(--primary); color: #fff; font-size: 15px; font-weight: 600; cursor: pointer;
    transition: background .15s;
}
.modal-submit:hover { background: var(--primary-dark); }
.modal-msg { font-size: 13px; margin: 8px 0; padding: 8px 10px; border-radius: 6px; }
.modal-msg.err { color: #c0392b; background: #fdecec; }
.modal-msg.ok { color: #0f7a52; background: #e8f7f0; }
.modal-foot {
    margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--line);
    font-size: 13px; color: var(--muted); text-align: center;
}
.modal-foot a { color: var(--primary); font-weight: 600; }
.modal-foot a:hover { text-decoration: underline; }

/* ===== 푸터 ===== */
.footer { background: #1f2733; color: #aeb6c2; font-size: 13px; }
.footer .inner { max-width: 1200px; margin: 0 auto; padding: 24px 20px; line-height: 1.7; }
.footer b { color: #fff; }

@media (max-width: 900px) {
    .cards { grid-template-columns: repeat(2, 1fr); }
    .two-col { grid-template-columns: 1fr; }
    .header .inner { flex-wrap: wrap; }
}
