* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Pretendard', -apple-system, sans-serif;
    color: #1a1a1a;
    line-height: 1.6;
}

.top-bar {
    display: flex;
    justify-content: flex-end;
    gap: 20px;
    padding: 10px 40px;
    font-size: 13px;
    color: #888;
    border-bottom: 1px solid #eee;
}
.top-bar a { color: #888; text-decoration: none; }

header {
    text-align: center;
    padding: 50px 20px 30px;
}
header h1 {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: 2px;
}
header p {
    font-size: 13px;
    color: #999;
    margin-top: 8px;
    letter-spacing: 4px;
}

nav {
    display: flex;
    justify-content: center;
    gap: 40px;
    padding: 20px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    font-weight: 600;
}
nav a {
    color: #333;
    text-decoration: none;
    font-size: 15px;
}
nav a:hover { color: #c0392b; }

.notice-section {
    max-width: 1000px;
    margin: 60px auto;
    padding: 0 20px;
}
.notice-section h2 {
    font-size: 22px;
    margin-bottom: 20px;
    border-left: 4px solid #c0392b;
    padding-left: 12px;
}
.notice-list { list-style: none; }
.notice-list li {
    display: flex;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid #eee;
}
.notice-list .pinned { color: #c0392b; font-weight: 700; margin-right: 8px; }
.notice-list .date { color: #999; font-size: 13px; }

.popup-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 999;
    justify-content: center;
    align-items: center;
}
.popup-overlay.active { display: flex; }
.popup-box {
    background: #111;
    max-width: 360px;
    width: 90%;
    border-radius: 0;
    overflow: hidden;
}
.popup-box a.popup-link { display: block; }
.popup-box img { width: 100%; display: block; }
.popup-bottom-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #1a1a1a;
    padding: 12px 16px;
}
.popup-dismiss-today {
    background: none;
    border: none;
    color: #ccc;
    font-size: 13px;
    cursor: pointer;
}
.popup-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.quick-menu {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    max-width: 900px;
    margin: 60px auto;
    padding: 0 20px;
    text-align: center;
}
.quick-menu a {
    text-decoration: none;
    color: #333;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 600;
}
.quick-menu svg { width: 40px; height: 40px; stroke: #333; }
.quick-menu a:hover svg { stroke: #c0392b; }
.quick-menu a:hover { color: #c0392b; }

.slogan-band {
    background: #111;
    color: #fff;
    text-align: center;
    padding: 60px 20px;
    margin-top: 60px;
}
.slogan-band h2 {
    font-size: 28px;
    letter-spacing: 3px;
    margin-bottom: 20px;
}
.slogan-band p {
    font-size: 15px;
    color: #ccc;
    line-height: 2;
}

footer {
    padding: 40px 20px;
    text-align: center;
    font-size: 13px;
    color: #999;
}
footer .footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}
footer .footer-links a { color: #666; text-decoration: none; }
footer .footer-info { margin-top: 10px; }
footer .footer-info span { margin: 0 8px; }

/* 모바일 헤더 */
.mobile-header {
    display: none;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}
.hamburger {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}
.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: #333;
    margin: 5px 0;
}

/* 모바일 슬라이드 메뉴 */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100%;
    background: #fff;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    z-index: 1000;
    padding: 20px;
    transition: right 0.3s ease;
    overflow-y: auto;
}
.mobile-menu.active { right: 0; }
.mobile-menu .welcome { font-size: 13px; color: #888; margin-bottom: 15px; }
.mobile-menu .auth-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
}
.mobile-menu .auth-buttons a {
    flex: 1;
    text-align: center;
    padding: 12px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}
.mobile-menu .auth-buttons a:first-child { background: #1a1a1a; color: #fff; }
.mobile-menu .auth-buttons a:last-child { background: #eee; color: #333; }
.mobile-menu .menu-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid #eee;
    color: #333;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
}
.menu-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 999;
}
.menu-overlay.active { display: block; }

/* 반응형 */
@media (max-width: 768px) {
    .top-bar { display: none; }
    .mobile-header { display: flex; }
    header { padding: 25px 20px 15px; }
    header h1 { font-size: 24px; }
    nav { display: none; }
    .quick-menu { grid-template-columns: repeat(2, 1fr); gap: 30px 15px; }
    .slogan-band h2 { font-size: 22px; }
    footer .footer-info { display: flex; flex-direction: column; gap: 6px; }
    footer .footer-info span { margin: 0; }
    .banner-grid { grid-template-columns: repeat(2, 1fr); padding: 0 10px; }
    .notice-section { margin: 30px auto; }
    .notice-header { flex-wrap: wrap; gap: 8px; }
    .policy-wrap table { display: block; overflow-x: auto; white-space: nowrap; }
    .policy-wrap h1 { font-size: 20px; }
    .policy-wrap h2 { font-size: 15px; }
}

.notice-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.notice-header h2 { margin-bottom: 0; }
.admin-write-btn {
    background: #1a1a1a;
    color: #fff;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 13px;
}
.notice-list li {
    align-items: center;
}
.notice-list .item-left { display: flex; align-items: center; gap: 8px; }
.notice-list .item-right { display: flex; align-items: center; gap: 12px; }
.delete-btn {
    background: none;
    border: 1px solid #ddd;
    color: #999;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
}
.delete-btn:hover { border-color: #c0392b; color: #c0392b; }

.help-tooltip {
    position: relative;
    display: inline-block;
    margin-left: 8px;
    vertical-align: middle;
}
.help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #eee;
    color: #666;
    font-size: 12px;
    font-weight: 700;
    cursor: help;
}
.tooltip-box {
    display: none;
    position: absolute;
    left: 26px;
    top: -6px;
    width: 220px;
    background: #1a1a1a;
    color: #fff;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.6;
    padding: 10px 12px;
    border-radius: 6px;
    z-index: 10;
}
.help-tooltip:hover .tooltip-box { display: block; }

/* 팝업 위치 설정 */
.popup-overlay.pos-center { align-items: center; justify-content: center; }
.popup-overlay.pos-top { align-items: flex-start; justify-content: center; padding-top: 60px; background: rgba(0,0,0,0.3); }
.popup-overlay.pos-bottom { align-items: flex-end; justify-content: center; padding-bottom: 40px; background: rgba(0,0,0,0.3); }
.popup-overlay.pos-bottom-right { align-items: flex-end; justify-content: flex-end; padding: 0 20px 20px 0; background: transparent; pointer-events: none; }
.popup-overlay.pos-bottom-right .popup-box { pointer-events: auto; max-width: 280px; }
.popup-overlay.pos-bottom-left { align-items: flex-end; justify-content: flex-start; padding: 0 0 20px 20px; background: transparent; pointer-events: none; }
.popup-overlay.pos-bottom-left .popup-box { pointer-events: auto; max-width: 280px; }

#popup-root {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 999;
    overflow: visible;
}

.popup-box { pointer-events: auto; }

/* 최종 강제 고정 - 이전 규칙과 충돌 방지 */
div#popup-root {
    position: fixed !important;
    top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    pointer-events: none !important;
    z-index: 9999 !important;
}
div#popup-root .popup-box {
    pointer-events: auto !important;
}

/* 팝업 그룹 위치 지정 - 최종 수정 */
.popup-group.pos-center {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    align-items: center;
}
.popup-group.pos-top {
    position: absolute;
    top: 60px; left: 50%;
    transform: translateX(-50%);
    align-items: center;
}
.popup-group.pos-bottom {
    position: absolute;
    bottom: 40px; left: 50%;
    transform: translateX(-50%);
    align-items: center;
}
.popup-group.pos-bottom-right {
    position: absolute;
    bottom: 20px; right: 20px;
    align-items: flex-end;
}
.popup-group.pos-bottom-left {
    position: absolute;
    bottom: 20px; left: 20px;
    align-items: flex-start;
}

.footer-social {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 16px;
}
.footer-social a {
    color: #666;
    display: inline-flex;
}
.footer-social a:hover { color: #c0392b; }
.footer-social svg { width: 22px; height: 22px; }

.banner-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    max-width: 1100px;
    margin: 40px auto 0;
    padding: 0 20px;
}
.banner-grid a { display: block; overflow: hidden; }
.banner-grid img { width: 100%; display: block; aspect-ratio: 1/1; object-fit: cover; }

@media (max-width: 768px) {
    .banner-grid { grid-template-columns: repeat(2, 1fr); padding: 0 10px; }
}

/* 관리자 폼 모바일 대응 */
@media (max-width: 768px) {
    .admin-wrap { margin: 30px auto; padding: 0 16px; }
    .form-box { padding: 16px; }
    .write-topbar { flex-wrap: wrap; }
    .banner-item, .popup-item {
        flex-wrap: wrap;
        gap: 10px;
    }
    .banner-item .actions, .popup-item .actions {
        width: 100%;
        justify-content: flex-end;
    }
    .login-box { width: 90%; max-width: 320px; }
}

.notice-more-btn {
    color: #999;
    text-decoration: none;
    font-size: 13px;
    margin-left: auto;
    margin-right: 8px;
}
.notice-more-btn:hover { color: #c0392b; }

.admin-toolbar {
    position: relative;
    display: inline-block;
    margin-left: auto;
}
.admin-toolbar-btn {
    background: #1a1a1a;
    color: #fff;
    border: none;
    padding: 8px 14px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
}
.admin-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    background: #fff;
    border: 1px solid #eee;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    min-width: 140px;
    z-index: 50;
    overflow: hidden;
}
.admin-dropdown.active { display: block; }
.admin-dropdown a {
    display: block;
    padding: 10px 14px;
    font-size: 13px;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #f5f5f5;
}
.admin-dropdown a:last-child { border-bottom: none; }
.admin-dropdown a:hover { background: #f8f8f8; color: #c0392b; }

.write-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;
    padding-right: 20px;
}
.write-topbar a { color: #666; text-decoration: none; font-size: 14px; }
.admin-nav { display: flex; gap: 8px; }
.admin-nav a {
    padding: 8px 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}
.admin-nav a:hover { background: #f5f5f5; }

@media (max-width: 600px) {
    .write-topbar { flex-direction: column; align-items: flex-start; gap: 10px; }
    .admin-nav { flex-wrap: wrap; }
}

/* 관리자 편집 패널 (소개/슬로건 공통) */
.cta-edit-toggle { text-align: center; margin: 20px 0; }
.cta-edit-toggle button { padding: 6px 14px; font-size: 12px; border: 1px solid #ddd; background: #fff; cursor: pointer; border-radius: 4px; }
.about-admin-panel { display: none; max-width: 700px; margin: 30px auto; padding: 20px; border: 1px solid #eee; border-radius: 8px; }
.about-admin-panel.active { display: block; }
.about-admin-panel h3 { font-size: 15px; margin: 20px 0 12px; }
.about-admin-panel h3:first-child { margin-top: 0; }
.about-admin-panel label { display: block; font-size: 13px; color: #666; margin: 10px 0 4px; }
.about-admin-panel input { width: 100%; padding: 8px; border: 1px solid #ddd; border-radius: 4px; font-size: 13px; }
.about-admin-panel button { margin-top: 12px; padding: 8px 16px; background: #1a1a1a; color: #fff; border: none; border-radius: 4px; cursor: pointer; font-size: 13px; }

.quick-menu img { width: 40px; height: 40px; object-fit: contain; }

.qm-preset-btn {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 10px 4px; border: 1px solid #ddd; border-radius: 6px;
    background: #fff; cursor: pointer; font-size: 11px; color: #333;
}
.qm-preset-btn svg { width: 22px; height: 22px; stroke: #333; }
.qm-preset-btn.selected { border-color: #1a1a1a; background: #f5f5f5; font-weight: 600; color: #1a1a1a; }
.qm-preset-btn.selected svg { stroke: #1a1a1a; }
