/* =========================================
   주소모음 — 디자인 시스템
   ========================================= */
:root {
    --bg: #f5f6f8;
    --surface: #ffffff;
    --line: #e8eaee;
    --line-soft: #f2f3f6;
    --text: #171a20;
    --text-2: #5b636f;
    --muted: #98a0ac;
    --primary: #ff3d6e;
    --primary-soft: #fff0f4;

    --radius-lg: 14px;
    --radius-md: 10px;
    --radius-sm: 8px;

    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04);
    --shadow-md: 0 12px 28px -10px rgba(16, 24, 40, .16);

    --font-main: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
                 "Segoe UI", Roboto, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-main);
    text-decoration: none;
    list-style: none;
    word-break: keep-all;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
ol, ul { list-style: none; }

::selection { background: rgba(255, 61, 110, .18); }

/* =========================================
   헤더
   ========================================= */
.header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, .88);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--line);
}
.header-inner {
    max-width: 1480px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-shrink: 0;
}
.logo-mark {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    font-size: 15px;
    font-weight: 800;
    color: #fff;
    background-image: linear-gradient(135deg, #ff6b8f, #ff2f63);
    box-shadow: 0 6px 14px -6px rgba(255, 61, 110, .75);
}
.logo-text {
    font-size: 19px;
    font-weight: 800;
    letter-spacing: -.03em;
    color: var(--text);
    white-space: nowrap;
}
.logo-text em {
    font-style: normal;
    color: var(--primary);
}

.nav {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav-link {
    padding: 7px 11px;
    border-radius: var(--radius-sm);
    font-size: 14.5px;
    font-weight: 600;
    color: var(--text-2);
    white-space: nowrap;
    transition: color .16s ease, background .16s ease;
}
.nav-link:hover { color: var(--text); background: #f3f4f7; }
.nav-link.is-active { color: var(--primary); background: var(--primary-soft); }

.auth-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* 버튼 공통 */
.btn,
.btn-signup {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: transform .16s ease, box-shadow .16s ease, background .16s ease, color .16s ease;
}
.btn:active,
.btn-signup:active { transform: translateY(1px); }

.btn-ghost {
    color: var(--text-2);
    background: #fff;
    border-color: var(--line);
}
.btn-ghost:hover { color: var(--text); border-color: #d9dde4; }

.btn-solid,
.btn-signup {
    color: #fff;
    background-image: linear-gradient(135deg, #ff6b8f, #ff2f63);
    box-shadow: 0 6px 14px -8px rgba(255, 61, 110, .9);
}
.btn-solid:hover,
.btn-signup:hover { box-shadow: 0 10px 20px -10px rgba(255, 61, 110, 1); }

/* 광고문의 — 텔레그램 CTA */
.banner-space {
    max-width: 1432px;
    margin: 18px auto 0;
    padding: 0 24px;
}
.banner-space:empty { display: none; }

.tg-cta {
    display: flex;
    align-items: center;
    gap: 12px;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto;
    padding: 9px 16px 9px 10px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.tg-cta:hover {
    transform: translateY(-1px);
    border-color: #bfe3f5;
    box-shadow: 0 12px 26px -16px rgba(34, 158, 217, .85);
}

.tg-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 11px;
    color: #fff;
    background-image: linear-gradient(135deg, #37bbfe, #007dbb);
    box-shadow: 0 8px 16px -10px rgba(34, 158, 217, 1);
}

.tg-body {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}
.tg-label {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: -.02em;
    color: var(--text);
}
.tg-sub {
    font-size: 11.5px;
    color: var(--muted);
}

.tg-handle {
    margin-left: 4px;
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 700;
    color: #0b7fb8;
    background: #eaf7fd;
    white-space: nowrap;
}

.tg-arrow {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: var(--muted);
}
.tg-cta:hover .tg-arrow { color: #0b7fb8; }

/* =========================================
   메인 상단 소개 (H1) — 화면에서는 숨기고 검색엔진용으로만 유지
   ========================================= */
.hero {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.hero-eyebrow {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .05em;
    color: var(--primary);
}
.hero-title {
    margin-top: 4px;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -.035em;
    color: var(--text);
}
.hero-desc {
    margin-top: 5px;
    font-size: 13px;
    color: var(--text-2);
}

/* =========================================
   배너 (관리자 > 배너 관리)
   카테고리 컬럼(cat-head)과 같은 폭/간격, 높이는 110px 기준으로 폭에 비례
   ========================================= */
.banner-zone {
    max-width: 1480px;
    margin: 16px auto 0;
    padding: 0 24px;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}
.banner-zone-list { margin: 0 0 18px; padding: 0; }
.banner-zone:empty { display: none; }
.list-page-wrapper .banner-zone { max-width: none; padding-left: 0; padding-right: 0; }
.banner-item {
    position: relative;
    display: block;
    min-width: 0;
    aspect-ratio: 274 / 110;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--line);
    background: #fff;
    box-shadow: var(--shadow-sm);
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.banner-item:hover {
    transform: translateY(-2px);
    border-color: #dfe2e8;
    box-shadow: var(--shadow-md);
}
.banner-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* =========================================
   메인 레이아웃
   ========================================= */
.container {
    max-width: 1480px;
    margin: 26px auto 64px;
    padding: 0 24px;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}

/* 카테고리 카드 */
.cat-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.cat-card:hover {
    transform: translateY(-2px);
    border-color: #dfe2e8;
    box-shadow: var(--shadow-md);
}

.cat-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 13px 14px;
    border-bottom: 1px solid var(--line-soft);
}
.cat-icon {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    color: var(--accent, var(--primary));
    background: var(--accent-soft, var(--primary-soft));
}
.cat-icon svg { width: 16px; height: 16px; }

.cat-name {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -.02em;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cat-badge {
    margin-left: auto;
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
    color: var(--accent, var(--primary));
    background: var(--accent-soft, var(--primary-soft));
    white-space: nowrap;
}
.cat-arrow {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 7px;
    color: var(--muted);
    transition: color .16s ease, background .16s ease;
}
.cat-arrow svg { width: 14px; height: 14px; }
.cat-arrow:hover { color: var(--accent, var(--primary)); background: var(--accent-soft, var(--primary-soft)); }

/* 링크 리스트 */
.link-list {
    padding: 6px 8px 8px;
    flex: 1;
}

.link-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: background .14s ease;
}
.link-item:hover { background: #f7f8fa; }
.link-item:hover .site-name { color: var(--accent, var(--primary)); }

.rank {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 6px;
    font-size: 10.5px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #a9b0bb;
}
.rank-1 { color: #d18a00; background: #fdf3dd; }
.rank-2 { color: #7d8794; background: #f0f2f5; }
.rank-3 { color: #b06f3c; background: #fbeee1; }

.site-ico {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .08);
}

.site-name {
    flex: 1;
    min-width: 0;
    font-size: 14.5px;
    font-weight: 500;
    color: #3d444f;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color .14s ease;
}
.link-item.is-top .site-name { font-weight: 700; color: var(--text); }

.cat-foot {
    display: block;
    padding: 9px 12px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .04em;
    color: #9aa2ae;
    background: #fcfcfd;
    border-top: 1px solid var(--line-soft);
    transition: color .16s ease, background .16s ease;
}
.cat-foot:hover { color: var(--accent, var(--primary)); background: var(--accent-soft, var(--primary-soft)); }

/* =========================================
   서브(카테고리) 페이지
   ========================================= */
.list-page-wrapper {
    max-width: 1480px;
    margin: 0 auto;
    padding: 24px 24px 72px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    font-size: 12.5px;
    color: var(--muted);
}
.breadcrumb a { transition: color .16s ease; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { color: #c9cfd8; }
.breadcrumb strong { font-weight: 600; color: var(--text-2); }

.list-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}
.cat-icon-lg {
    width: 40px;
    height: 40px;
    border-radius: 12px;
}
.cat-icon-lg svg { width: 21px; height: 21px; }
.list-head-text h1,
.list-head-text h2 {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -.03em;
    color: var(--text);
}
.list-head-text p {
    margin-top: 2px;
    font-size: 12.5px;
    color: var(--muted);
}
.list-count {
    margin-left: auto;
    padding: 5px 11px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    color: var(--accent, var(--primary));
    background: var(--accent-soft, var(--primary-soft));
    white-space: nowrap;
}

.siteGrid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
}

.site-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.site-card:hover {
    transform: translateY(-3px);
    border-color: #d9dde4;
    box-shadow: var(--shadow-md);
}

.siteLogo {
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 4 / 3;
    padding: 14px;
    background: linear-gradient(180deg, #fafbfc, #f1f3f6);
}
.siteLogo-inner {
    width: 62px;
    height: 62px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    font-size: 25px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -.02em;
    box-shadow: 0 10px 22px -12px rgba(16, 24, 40, .6), inset 0 -2px 6px rgba(0, 0, 0, .12);
    transition: transform .2s ease;
}
.site-card:hover .siteLogo-inner { transform: scale(1.05); }

.siteInfo {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 11px 12px 12px;
    text-align: center;
    border-top: 1px solid var(--line-soft);
}
.site-title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -.01em;
    color: var(--primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.site-desc {
    font-size: 11.5px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rank-chip {
    position: absolute;
    top: 9px;
    left: 9px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    height: 22px;
    padding: 0 7px;
    border-radius: 7px;
    background: rgba(255, 255, 255, .92);
    border: 1px solid rgba(16, 24, 40, .06);
    box-shadow: 0 2px 8px rgba(16, 24, 40, .1);
    backdrop-filter: blur(4px);
    font-size: 11px;
    font-weight: 800;
    color: #8b93a0;
    font-variant-numeric: tabular-nums;
}
.rank-chip svg { width: 12px; height: 12px; }
.rank-chip.rank-1 { color: #d99a00; border-color: #f5e0a8; }
.rank-chip.rank-2 { color: #8b95a3; border-color: #e3e7ed; }
.rank-chip.rank-3 { color: #b87333; border-color: #efd9c3; }

.site-card.is-closed .siteLogo,
.site-card.is-closed .siteInfo { opacity: .38; }
.site-card.is-closed { pointer-events: none; }
.closed-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    padding: 6px 13px;
    border-radius: 20px;
    background: rgba(23, 26, 32, .88);
    color: #fff;
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
}

.empty-state {
    margin: 72px auto;
    text-align: center;
    font-size: 14.5px;
    color: var(--muted);
}

/* =========================================
   로그인 / 회원가입
   ========================================= */
.auth-wrap {
    display: flex;
    justify-content: center;
    padding: 56px 20px 80px;
}
.auth-card {
    width: 100%;
    max-width: 400px;
    padding: 28px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}
.auth-card h2 {
    font-size: 19px;
    font-weight: 800;
    letter-spacing: -.03em;
    margin-bottom: 18px;
}
.auth-card .auth-error {
    margin-bottom: 12px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    background: #fff1f2;
    color: #d92d4b;
    font-size: 12.5px;
    font-weight: 600;
}
.auth-card input {
    width: 100%;
    height: 42px;
    padding: 0 13px;
    margin-bottom: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fbfcfd;
    font-size: 13.5px;
    color: var(--text);
    transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.auth-card input::placeholder { color: #b4bac4; }
.auth-card input:focus {
    outline: none;
    background: #fff;
    border-color: #ffb3c6;
    box-shadow: 0 0 0 3px rgba(255, 61, 110, .12);
}
.auth-card button {
    width: 100%;
    height: 44px;
    margin-top: 8px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14.5px;
    font-weight: 700;
}
.auth-card .auth-foot {
    margin-top: 14px;
    text-align: center;
    font-size: 12.5px;
    color: var(--muted);
}
.auth-card .auth-foot a { color: var(--primary); font-weight: 600; }

/* =========================================
   푸터
   ========================================= */
.footer {
    max-width: 1480px;
    margin: 0 auto;
    padding: 28px 24px 44px;
    border-top: 1px solid var(--line);
    text-align: center;
}
.footer p {
    font-size: 12px;
    line-height: 1.7;
    color: var(--muted);
}
.footer p:first-child { color: var(--text-2); font-weight: 600; margin-bottom: 4px; }

.footer-contact {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 6px;
}
.tg-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    color: #0b7fb8;
    background: #eaf7fd;
    transition: background .16s ease, color .16s ease;
}
.tg-link:hover { color: #fff; background: #229ed9; }
.tg-link svg { flex-shrink: 0; }

/* =========================================
   반응형
   ========================================= */
@media (max-width: 1280px) {
    .container,
    .siteGrid,
    .banner-zone { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
    .container,
    .siteGrid,
    .banner-zone { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .header-inner { gap: 16px; }
}
@media (max-width: 768px) {
    .header-inner { height: 58px; padding: 0 14px; gap: 12px; }
    .logo-text { font-size: 17px; }
    .nav { gap: 0; }
    .nav-link { padding: 6px 9px; font-size: 14px; }
    .auth-buttons { display: none; }

    .container,
    .siteGrid,
    .banner-zone {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        padding-left: 14px;
        padding-right: 14px;
    }
    .container { margin: 16px auto 40px; }

    .list-page-wrapper { padding: 16px 14px 48px; }
    .list-head-text h1,
    .list-head-text h2 { font-size: 18px; }
    .list-head-text p { display: none; }
    .cat-icon-lg { width: 34px; height: 34px; border-radius: 10px; }
    .cat-icon-lg svg { width: 18px; height: 18px; }

    .siteLogo { aspect-ratio: 4 / 3; padding: 10px; }
    .siteLogo-inner { width: 48px; height: 48px; border-radius: 14px; font-size: 20px; }
    .site-title { font-size: 14px; }
    .siteInfo { padding: 9px 8px 10px; }

    .banner-space { margin-top: 12px; padding: 0 14px; }
    .hero-title { font-size: 18px; }
    .hero-desc { font-size: 12px; }
    .banner-zone { margin-top: 12px; padding: 0 14px; gap: 12px; }
    .tg-cta { gap: 9px; padding: 8px 12px 8px 8px; border-radius: 12px; }
    .tg-icon { width: 32px; height: 32px; border-radius: 10px; }
    .tg-label { font-size: 13px; }
    .tg-sub { display: none; }
    .tg-handle { font-size: 12px; padding: 4px 8px; }
}
@media (max-width: 420px) {
    .container,
    .siteGrid { gap: 10px; }
    .cat-name { font-size: 14px; }
    .site-name { font-size: 13.5px; }
}
