/* 팬덤 플랫폼 스타일 */
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
    background: #f0f2f5;
    color: #14171a;
    font-size: 15px;
    line-height: 1.6;
}
a { color: #e0245e; text-decoration: none; }
.hashtag-link, .mention-link { font-weight: 600; }
.mention-link:hover, .hashtag-link:hover { text-decoration: underline; }

/* @멘션 자동완성 드롭다운 */
.mention-dropdown {
    position: absolute; z-index: 1300; background: #fff; border: 1px solid #e1e8ed;
    border-radius: 10px; box-shadow: 0 8px 20px rgba(0,0,0,.12); overflow: hidden;
    max-height: 220px; overflow-y: auto;
}
.mention-item { padding: 8px 12px; font-size: 14px; cursor: pointer; color: #14171a; }
.mention-item.on, .mention-item:hover { background: #fce8ef; }
html.dark .mention-dropdown { background: #1e2329; border-color: #2f3640; }
html.dark .mention-item { color: #e7e9ea; }
html.dark .mention-item.on, html.dark .mention-item:hover { background: #2a222a; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ---------- 상단바 ---------- */
.topbar {
    position: sticky; top: 0; z-index: 100;
    background: #fff; border-bottom: 1px solid #e1e8ed;
}
.topbar-inner {
    max-width: 1000px; margin: 0 auto; padding: 0 16px;
    display: flex; align-items: center; gap: 16px; height: 48px;
}
@media (min-width: 901px) {
    body.menu-vertical .topbar-inner,
    body.menu-vertical .menu-row { max-width: 1180px; }
}
.logo { font-weight: 800; font-size: 18px; color: var(--btn-bg, #e0245e); white-space: nowrap; margin-right: auto; display: inline-flex; align-items: center; }
.logo-img { height: 32px; max-width: 200px; object-fit: contain; }
.logo:hover { text-decoration: none; }

/* 메뉴 줄 (2번째 줄) */
.menu-row {
    max-width: 1000px; margin: 0 auto; padding: 0 8px;
    display: flex; align-items: center; gap: 2px;
    border-top: 1px solid #f0f2f5; height: 42px; position: relative;
}
.menu-nav {
    display: flex; gap: 4px; overflow-x: auto; flex: 1;
    scrollbar-width: none; -ms-overflow-style: none; scroll-behavior: smooth;
}
.menu-nav::-webkit-scrollbar { display: none; }
.menu-nav a {
    padding: 6px 12px; border-radius: 999px; color: #444;
    white-space: nowrap; font-size: 14px; flex-shrink: 0;
}
.menu-nav a:hover { background: #f5d3de; text-decoration: none; }
.menu-nav a.active { background: var(--btn-bg, #e0245e); color: var(--btn-text, #fff); font-weight: 600; }
.menu-scroll {
    flex-shrink: 0; width: 26px; height: 26px; border: 1px solid #e1e8ed;
    background: #fff; border-radius: 50%; cursor: pointer; color: #657786;
    font-size: 15px; line-height: 1; padding: 0; visibility: hidden;
}
.menu-scroll:hover { border-color: #e0245e; color: #e0245e; }
.menu-all-btn {
    flex-shrink: 0; border: 1px solid #e1e8ed; background: #fff;
    border-radius: 999px; padding: 5px 12px; font-size: 13px;
    cursor: pointer; color: #444; white-space: nowrap; margin-left: 4px;
}
.menu-all-btn:hover { border-color: #e0245e; color: #e0245e; }
.menu-all-panel {
    position: absolute; left: 0; right: 0; top: 100%;
    max-width: 1000px; margin: 0 auto;
    background: #fff; border: 1px solid #e1e8ed; border-top: 0;
    border-radius: 0 0 12px 12px; box-shadow: 0 8px 20px rgba(0,0,0,.1);
    padding: 12px; z-index: 99;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 4px;
}
.menu-all-panel[hidden] { display: none; }
.menu-all-panel a {
    padding: 9px 12px; border-radius: 8px; color: #333; font-size: 14px;
}
.menu-all-panel a:hover { background: #fce8ef; text-decoration: none; }
.menu-all-cnt { color: #8899a6; font-size: 12px; }
.topbar-right { display: flex; align-items: center; gap: 12px; white-space: nowrap; font-size: 14px; min-width: 0; }
.topbar-right a { color: #444; }
.me-nick {
    color: #888; font-size: 13px;
    max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    background: none; border: 0; padding: 0; font-family: inherit; cursor: pointer;
}
.me-nick:hover { color: #e0245e; text-decoration: underline; }
@media (max-width: 600px) {
    .topbar-inner { gap: 10px; }
    .topbar-right { gap: 10px; }
    .me-nick { display: none; } /* 좁은 화면에선 닉네임 숨겨 레이아웃 밀림 방지 */
    .mobile-gnb-dup { display: none; } /* 검색/글쓰기/쪽지는 하단 GNB로 이동 - 상단에서는 중복 노출 방지 (관리자 페이지 포함 전체 동일) */
    /* iOS Safari는 폼 요소 font-size가 16px 미만이면 탭할 때 화면을 확대하는데,
       이때 select의 네이티브 팝업이 확대된 화면 기준 엉뚱한 위치에 작게 뜨는 것처럼 보인다.
       16px 이상으로 맞춰 자동 확대 자체를 막는다. */
    input:not([type=checkbox]):not([type=radio]), textarea, select { font-size: 16px; }
}
.btn-write {
    background: var(--btn-bg, #e0245e); color: var(--btn-text, #fff) !important; padding: 6px 14px;
    border-radius: 999px; font-weight: 600;
}
.btn-write:hover { filter: brightness(0.9); text-decoration: none; }
.msg-link { position: relative; }
.badge {
    background: #e0245e; color: #fff; font-size: 10px; font-weight: 700;
    border-radius: 999px; padding: 1px 5px; vertical-align: top; margin-left: 2px;
}

/* ---------- 레이아웃 ---------- */
.wrap { max-width: 1000px; margin: 0 auto; padding: 16px; }
body.admin-page .wrap { max-width: none; margin: 0; padding: 0; }
@media (min-width: 901px) {
    body.menu-vertical .wrap { max-width: 1180px; }
}
.layout { display: flex; gap: 20px; align-items: flex-start; }
.main { flex: 1; min-width: 0; max-width: 660px; margin: 0 auto; }
@media (min-width: 901px) {
    body.menu-vertical .main { max-width: 840px; }
}
.sidebar { width: 300px; flex-shrink: 0; }
body.admin-page .main { max-width: 100%; }
@media (max-width: 900px) {
    /* 모바일: 사이드바를 피드 아래로 내리고 출석체크만 노출 */
    /* 세로 배치에선 align-items:flex-start가 가로폭을 콘텐츠 크기로 줄여
       화면보다 넓어질 수 있으므로 stretch로 강제 */
    .layout { flex-direction: column; align-items: stretch; }
    .main { width: 100%; }
    .sidebar { width: 100%; }
    .sidebar > .sidebar-rank,
    .sidebar > .ad-slot { display: none; }
    .sidebar > .attend-panel,
    .sidebar > .recent-comments { width: 100%; max-width: 660px; margin: 0 auto 16px; }
}

/* ---------- 세로 메뉴 (PC 전용, 관리자 설정) ---------- */
.vmenu { display: none; }
@media (min-width: 901px) {
    body.menu-vertical .menu-row { display: none; }
    body.menu-vertical .vmenu {
        display: flex; flex-direction: column; gap: 2px;
        width: 190px; flex-shrink: 0;
        position: sticky; top: 59px;
        max-height: calc(100vh - 70px); overflow-y: auto;
        background: #fff; border: 1px solid #e1e8ed; border-radius: 12px;
        padding: 8px;
    }
}
.vmenu-item {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 9px 10px; border-radius: 8px; color: #444; font-size: 14px;
}
.vmenu-item:hover { background: #f5d3de; text-decoration: none; }
.vmenu-item.active { background: var(--btn-bg, #e0245e); color: var(--btn-text, #fff); font-weight: 600; }
.vmenu-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vmenu-cnt { color: #8899a6; font-size: 12px; flex-shrink: 0; }
.vmenu-item.active .vmenu-cnt { color: var(--btn-text, #fff); opacity: .85; }
html.dark .vmenu { background: #1e2329; border-color: #2f3640; }
html.dark .vmenu-item { color: #c8ccd0; }
html.dark .vmenu-item:hover { background: #2a323c; }

.site-footer { text-align: center; color: #aaa; font-size: 12px; padding: 32px 0; }
.footer-mailing { margin: 8px 0 0; }
.footer-mailing a { color: #999; }
.footer-legal { margin: 8px 0 0; font-size: 11px; }
.footer-legal a { color: #999; }
.footer-custom { max-width: 660px; margin: 0 auto 12px; line-height: 1.6; }
.footer-custom a { color: #999; text-decoration: underline; }

/* ---------- 패널 ---------- */
.panel {
    background: #fff; border: 1px solid #e1e8ed; border-radius: 12px;
    padding: 16px; margin-bottom: 16px;
}
.panel-title { font-size: 16px; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.more-link { margin-left: auto; font-size: 12px; font-weight: 400; }
.feed-title { font-size: 20px; margin: 4px 0 16px; }
.profile-head { display: flex; align-items: center; gap: 12px; margin: 4px 0 16px; flex-wrap: wrap; }
.profile-head .feed-title { margin: 0; }
.btn-msg { background: var(--btn-bg, #e0245e) !important; color: var(--btn-text, #fff) !important; border-color: var(--btn-bg, #e0245e) !important; }
.btn-msg:hover { filter: brightness(0.9); color: var(--btn-text, #fff) !important; }
.empty, .empty-feed { color: #999; text-align: center; padding: 24px 16px; }

/* ---------- 알림 ---------- */
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; }
.alert-error { background: #fdecea; color: #b71c1c; }
.alert-info { background: #e3f2fd; color: #0d47a1; }
.flash-global { max-width: 660px; margin: 0 auto 16px; }

/* ---------- 게시물 ---------- */
.post {
    background: #fff; border: 1px solid #e1e8ed; border-radius: 12px;
    padding: 16px; margin-bottom: 12px;
}
.post-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.avatar {
    width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
    background: var(--btn-bg, #e0245e);
    background: linear-gradient(135deg, var(--btn-bg, #e0245e), color-mix(in srgb, var(--btn-bg, #e0245e) 55%, #fff));
    color: #fff; font-weight: 700; font-size: 18px;
    display: flex; align-items: center; justify-content: center;
}
.post-meta { flex: 1; min-width: 0; }
.post-author { font-weight: 700; color: #14171a; }
.post-sub { display: block; color: #8899a6; font-size: 12px; }
.menu-tag { color: #e0245e; }
.post-tools a { color: #aab8c2; margin-left: 8px; font-size: 14px; }
.post-tools a:hover { color: #e0245e; text-decoration: none; }

.post-content { word-wrap: break-word; overflow-wrap: break-word; }
/* [code] 블록 (자동 언어 감지 하이라이팅, assets/vendor/highlight.min.js) */
.code-block {
    margin: 10px 0; padding: 14px 16px; border-radius: 10px;
    border: 1px solid #e1e8ed; background: #f6f8fa; overflow-x: auto; max-width: 100%;
    font-family: ui-monospace, "SFMono-Regular", "Cascadia Code", Consolas, monospace;
    font-size: 13px; line-height: 1.55;
}
.code-block code { background: none; padding: 0; white-space: pre; }
html.dark .code-block { border-color: #2f3640; background: #0d1117; }
.post-content img {
    border-radius: 10px; margin: 6px 4px 0 0; cursor: zoom-in;
    max-height: 420px; object-fit: cover;
}
.post-content p { margin: 0 0 8px; }
.yt-wrap, .post-content iframe { max-width: 100%; }
.yt-wrap {
    position: relative; padding-bottom: 56.25%; height: 0;
    margin: 8px 0; border-radius: 10px; overflow: hidden; background: #000;
}
.yt-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.post-content > iframe { width: 100%; aspect-ratio: 16/9; border-radius: 10px; margin: 8px 0; }

/* 재생 중 영상이 화면 밖으로 나가면 우하단 미니플레이어(PiP) */
.yt-wrap.yt-pip {
    position: fixed; right: 16px; bottom: 16px; z-index: 900;
    width: 340px; max-width: 46vw; height: auto; padding-bottom: 0; margin: 0;
    aspect-ratio: 16 / 9;
    box-shadow: 0 8px 28px rgba(0,0,0,.4);
    animation: pipIn .25s ease;
}
@supports not (aspect-ratio: 16/9) {
    .yt-wrap.yt-pip { height: 191px; padding-bottom: 0; } /* 340px 폭 16:9 */
}
@keyframes pipIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
.yt-pip-close {
    position: absolute; top: -10px; right: -10px; z-index: 2;
    width: 26px; height: 26px; border-radius: 50%; border: 0;
    background: #14171a; color: #fff; cursor: pointer; font-size: 13px;
    line-height: 26px; padding: 0; box-shadow: 0 2px 6px rgba(0,0,0,.4);
}
.yt-pip-close:hover { background: #e0245e; }
.yt-pip-ph { margin: 8px 0; }
@media (max-width: 600px) {
    .yt-wrap.yt-pip { width: 200px; right: 10px; bottom: 10px; }
}

/* 링크 미리보기 카드 */
.link-card {
    display: flex; align-items: stretch; gap: 0; margin-top: 10px;
    border: 1px solid #e1e8ed; border-radius: 12px; overflow: hidden;
    color: inherit; background: #fafbfc;
}
.link-card:hover { background: #f0f2f5; text-decoration: none; }
.link-thumb { width: 120px; min-height: 90px; object-fit: cover; flex-shrink: 0; }
.link-body { padding: 10px 12px; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.link-title {
    font-size: 14px; overflow: hidden; text-overflow: ellipsis;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.link-desc { color: #657786; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-url { color: #8899a6; font-size: 12px; }
.link-card-edit { position: relative; }
.link-card-edit button {
    position: absolute; top: 6px; right: 6px; border: 0; background: rgba(0,0,0,.5);
    color: #fff; border-radius: 50%; width: 24px; height: 24px; cursor: pointer;
}

/* 액션바 */
.post-actions {
    display: flex; gap: 8px; margin-top: 10px; padding-top: 8px;
    border-top: 1px solid #f0f2f5;
}
.act {
    display: inline-flex; align-items: center; gap: 5px;
    background: none; border: 0; cursor: pointer; color: #657786;
    font-size: 13px; padding: 6px 10px; border-radius: 999px;
}
.act:hover { background: #fce8ef; color: #e0245e; text-decoration: none; }
.act.on { color: #e0245e; font-weight: 700; }
.act.stat { cursor: default; }
.act.stat:hover { background: none; color: #657786; }

/* 모바일: 좋아요/댓글/스크랩/공유/조회수 액션바가 한 줄에 다 안 들어가 깨지는 문제 -
   5개를 한 줄에 균등폭으로 유지하고, 버튼 안에서 아이콘은 윗줄 / 텍스트·숫자는 아랫줄로 세로 배치 */
@media (max-width: 480px) {
    .post-actions { flex-wrap: nowrap; gap: 2px; }
    .post-actions .act {
        flex: 1 1 0; min-width: 0; flex-direction: column; justify-content: center;
        gap: 2px; padding: 6px 2px; font-size: 11px;
    }
    .post-actions .act .cnt { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* ---------- 툴팁 ---------- */
.tip {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; margin-left: 4px; border-radius: 50%;
    background: #000; color: #fff; font-size: 10px; font-weight: 700;
    cursor: help; position: relative; outline: none; flex-shrink: 0;
}
.tip-box {
    position: absolute; top: 130%; left: 0; z-index: 50;
    width: 220px; padding: 10px 12px; border-radius: 8px;
    background: #14171a; color: #fff; font-size: 12px; font-weight: 400;
    line-height: 1.5; box-shadow: 0 4px 14px rgba(0,0,0,.25);
    opacity: 0; visibility: hidden; transform: translateY(-4px);
    transition: opacity .15s, transform .15s, visibility .15s;
    white-space: normal; text-align: left;
}
.tip-box:before {
    content: ""; position: absolute; bottom: 100%; left: 8px;
    border: 6px solid transparent; border-bottom-color: #14171a;
}
.tip:hover .tip-box, .tip:focus .tip-box { opacity: 1; visibility: visible; transform: translateY(0); }
@media (max-width: 340px) { .tip-box { width: 180px; } }

/* ---------- 출석체크 ---------- */
.attend-panel { scroll-margin-top: 104px; } /* 고정 헤더에 안 가리게 */
.attend-panel.attend-flash { animation: attendFlash 1.2s ease; }
@keyframes attendFlash {
    0%, 60% { box-shadow: 0 0 0 3px rgba(224,36,94,.45); }
    100% { box-shadow: 0 0 0 0 rgba(224,36,94,0); }
}
.attend-fab {
    position: fixed; left: 16px; bottom: 16px; z-index: 850;
    width: 48px; height: 48px; border-radius: 50%;
    background: #fff; border: 1px solid #e1e8ed;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; box-shadow: 0 4px 14px rgba(0,0,0,.18);
    transition: opacity .2s, transform .2s;
}
.attend-fab:hover { text-decoration: none; transform: translateY(-2px); }
.attend-fab.hide { opacity: 0; pointer-events: none; }

/* 모바일 하단 고정 GNB: 검색/다크모드/글쓰기/출석체크를 한 줄로 (데스크톱에서는 숨김) */
.mobile-gnb { display: none; }
@media (max-width: 600px) {
    body { padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px)); }
    .mobile-gnb {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 950;
        display: flex; align-items: stretch;
        background: #fff; border-top: 1px solid #e1e8ed;
        padding-bottom: env(safe-area-inset-bottom, 0px);
        box-shadow: 0 -2px 10px rgba(0,0,0,.06);
    }
    .mobile-gnb-item {
        flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
        gap: 2px; padding: 7px 4px; border: 0; background: transparent; color: #444;
        font-size: 11px; cursor: pointer;
    }
    .mobile-gnb-item:hover { text-decoration: none; }
    .mobile-gnb-icon { font-size: 19px; line-height: 1; }
    .mobile-gnb-write .mobile-gnb-icon,
    .mobile-gnb-write .mobile-gnb-label { color: #e0245e; }
    .mobile-gnb-msg .mobile-gnb-icon { position: relative; display: inline-block; }
    .mobile-gnb-msg .msg-badge { position: absolute; top: -4px; right: -9px; margin: 0; }
    .attend-fab { display: none; }
}
html.dark .mobile-gnb { background: #1e2329; border-top-color: #2f3640; }
html.dark .mobile-gnb-item { color: #c8ccd0; }
.attend-panel-loading { padding: 24px; text-align: center; color: #657786; }
html.dark .attend-panel-loading { color: #8899a6; }
.fab-dot {
    position: absolute; top: 2px; right: 2px; width: 11px; height: 11px;
    background: #e0245e; border: 2px solid #fff; border-radius: 50%;
}
.attend-view { display: none; }
.attend-view.on { display: block; }

/* 출석 모달 팝업 */
body.modal-open { overflow: hidden; }
.fd-modal {
    position: fixed; inset: 0; z-index: 1200;
    background: rgba(0,0,0,.5);
    display: flex; align-items: center; justify-content: center;
    padding: 16px; animation: fdModalIn .18s ease;
}
.fd-modal[hidden] { display: none; }
@keyframes fdModalIn { from { opacity: 0; } to { opacity: 1; } }
.fd-modal-box {
    position: relative; width: 100%; max-width: 420px;
    max-height: 88vh; overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.fd-modal-box .attend-panel.in-modal { margin: 0; }
.fd-modal-close {
    position: absolute; top: 10px; right: 10px; z-index: 2;
    width: 30px; height: 30px; border-radius: 50%; border: 0;
    background: #f0f2f5; color: #333; cursor: pointer; font-size: 15px; line-height: 30px; padding: 0;
}
.fd-modal-close:hover { background: #e0245e; color: #fff; }
html.dark .fd-modal-close { background: #3a4250; color: #e7e9ea; }
html.dark .fd-modal-close:hover { background: #e0245e; }
.attend-status { text-align: center; padding: 8px; border-radius: 8px; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.attend-check-btn { padding: 12px; margin-top: 0; margin-bottom: 8px; }
.attend-status.done { background: #e8f5e9; color: #1b5e20; }
.attend-myimg {
    margin: 10px 0; border: 1px solid #e1e8ed; border-radius: 10px; background: #fafbfc;
    overflow: hidden;
}
.attend-myimg > summary {
    list-style: none; cursor: pointer; padding: 9px 12px;
    font-size: 13px; font-weight: 600; display: flex; align-items: center; justify-content: space-between;
}
.attend-myimg > summary::-webkit-details-marker { display: none; }
.attend-myimg-caret { color: #8899a6; transition: transform .2s; }
.attend-myimg[open] .attend-myimg-caret { transform: rotate(180deg); }
.attend-myimg-body {
    display: flex; gap: 10px; align-items: center;
    padding: 0 12px 10px;
}
.attend-myimg-body > img {
    width: 60px; height: 60px; border-radius: 8px; object-fit: cover; flex-shrink: 0;
    border: 1px solid #e1e8ed;
}
.attend-myimg-txt { font-size: 13px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.attend-myimg-txt .attend-imgbtn { align-self: flex-start; margin-top: 2px; }
.attend-top3 {
    display: flex; justify-content: center; align-items: flex-end; gap: 14px;
    margin: 14px 0 6px; text-align: center;
}
.attend-medal { display: flex; flex-direction: column; align-items: center; gap: 3px; flex: 0 1 auto; min-width: 0; position: relative; }
.attend-img {
    position: relative; width: 100px; height: 100px; border-radius: 12px;
    overflow: hidden; background: #f0f2f5; border: 2px solid #ffd24a;
    display: flex; align-items: center; justify-content: center;
}
/* 1등을 가장 크게 + 다른 순위 위로 살짝 띄워 레이어상 맨 위에 있는 것처럼 */
.attend-medal:nth-child(1) { z-index: 2; }
.attend-medal:nth-child(1) .attend-img { box-shadow: 0 6px 16px rgba(255, 210, 74, .45); }
.attend-medal:nth-child(2) { z-index: 1; }
.attend-medal:nth-child(2) .attend-img { width: 90px; height: 90px; border-color: #c4ccd4; }
.attend-medal:nth-child(3) { z-index: 1; }
.attend-medal:nth-child(3) .attend-img { width: 80px; height: 80px; border-color: #d9a06b; }
.attend-img img { width: 100%; height: 100%; object-fit: cover; }
.attend-noimg { font-size: 34px; font-weight: 800; color: #b0b8c0; }
.attend-badge { position: absolute; top: 2px; left: 4px; font-size: 20px; }
.attend-nick {
    font-size: 12px; font-weight: 600; max-width: 100%;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.attend-cnt { color: #8899a6; font-size: 11px; }
.attend-imgbtn {
    margin-top: 2px; font-size: 11px; padding: 2px 8px; border: 1px solid #ccd6dd;
    background: #fff; border-radius: 999px; cursor: pointer; color: #444;
}
.attend-imgbtn:hover { border-color: #e0245e; color: #e0245e; }
.attend-imgbtn-overlay {
    position: absolute; left: 0; right: 0; bottom: 0;
    padding: 4px 2px 5px; border: 0; cursor: pointer;
    background: linear-gradient(to top, rgba(0,0,0,.62), rgba(0,0,0,0));
    color: #fff; font-size: 10px; font-weight: 600;
    line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.attend-imgbtn-overlay:hover { background: linear-gradient(to top, rgba(224,36,94,.82), rgba(224,36,94,0)); }
.attend-rest { list-style: none; margin: 10px 0 0; padding: 0; counter-reset: ar 3; }
.attend-rest li {
    counter-increment: ar; padding: 5px 2px; font-size: 13px;
    border-bottom: 1px solid #f5f8fa;
}
.attend-rest li:before { content: counter(ar); color: #8899a6; font-weight: 700; margin-right: 8px; }
.attend-rest li.me { font-weight: 700; }
.attend-rest .attend-cnt { float: right; }

/* 100px 카드가 좁은 화면에서 넘치지 않게 단계별 축소 (1등과의 10px/20px 크기 차이는 유지) */
@media (max-width: 1000px) and (min-width: 901px) {
    .attend-img { width: 84px; height: 84px; }
    .attend-medal:nth-child(2) .attend-img { width: 74px; height: 74px; }
    .attend-medal:nth-child(3) .attend-img { width: 64px; height: 64px; }
}
@media (max-width: 480px) {
    .attend-img { width: 88px; height: 88px; }
    .attend-medal:nth-child(2) .attend-img { width: 78px; height: 78px; }
    .attend-medal:nth-child(3) .attend-img { width: 68px; height: 68px; }
    .attend-noimg { font-size: 30px; }
}
@media (max-width: 360px) {
    .attend-img { width: 74px; height: 74px; }
    .attend-medal:nth-child(2) .attend-img { width: 64px; height: 64px; }
    .attend-medal:nth-child(3) .attend-img { width: 54px; height: 54px; }
    .attend-noimg { font-size: 26px; }
}

/* ---------- 공지 (상단 고정 핀) ---------- */
.notice-bar {
    display: flex; align-items: center; gap: 4px; margin-bottom: 12px;
}
.notice-track {
    position: relative; /* 카드 offsetLeft 기준을 트랙으로 고정 */
    flex: 1; min-width: 0; display: flex; gap: 8px;
    overflow-x: auto; scroll-snap-type: x mandatory;
    scrollbar-width: none; -ms-overflow-style: none; scroll-behavior: smooth;
}
.notice-track::-webkit-scrollbar { display: none; }
.notice-card {
    flex: 0 0 100%; scroll-snap-align: start;
    display: flex; align-items: center; gap: 8px;
    background: #fff; border: 1px solid #e1e8ed; border-left: 3px solid #e0245e;
    border-radius: 10px; padding: 8px 12px; color: #14171a;
    min-width: 0; box-sizing: border-box;
}
.notice-card:hover { text-decoration: none; background: #fef6f9; }
.notice-pin {
    flex-shrink: 0; color: #e0245e; font-weight: 700; font-size: 12px;
    white-space: nowrap;
}
.notice-text {
    flex: 1; min-width: 0; font-size: 13px; color: #333;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.notice-nav {
    flex-shrink: 0; width: 24px; height: 24px; border: 1px solid #e1e8ed;
    background: #fff; border-radius: 50%; cursor: pointer; color: #657786;
    font-size: 14px; line-height: 1; padding: 0;
}
.notice-nav:hover { border-color: #e0245e; color: #e0245e; }
.notice-count { flex-shrink: 0; font-size: 11px; color: #8899a6; min-width: 34px; text-align: center; }
.js-pin-post.on { color: #e0245e; }

/* 토스트 알림 */
.fd-toast {
    position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%) translateY(20px);
    background: rgba(20,23,26,.92); color: #fff; padding: 10px 20px;
    border-radius: 999px; font-size: 14px; z-index: 1000;
    opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.fd-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 새 쪽지 미니 팝업 */
.msg-toast {
    position: fixed; right: 16px; bottom: 16px; z-index: 1250;
    width: 280px; max-width: calc(100vw - 32px);
    background: #fff; border: 1px solid #e1e8ed; border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,.15); padding: 14px 16px; cursor: pointer;
    animation: msgToastIn .22s ease;
}
@keyframes msgToastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.msg-toast strong { display: block; font-size: 14px; margin-bottom: 4px; padding-right: 20px; }
.msg-toast-preview { display: block; font-size: 13px; color: #657786; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-toast-close {
    position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 50%;
    border: 0; background: #f0f2f5; color: #666; cursor: pointer; font-size: 11px; line-height: 22px; padding: 0;
}
.msg-toast-close:hover { background: #e0245e; color: #fff; }
html.dark .msg-toast { background: #1e2329; border-color: #2f3640; }
html.dark .msg-toast-preview { color: #8b98a5; }
html.dark .msg-toast-close { background: #3a4250; color: #e7e9ea; }
@media (max-width: 600px) {
    .msg-toast { left: 16px; right: 16px; width: auto; bottom: calc(56px + env(safe-area-inset-bottom, 0px) + 12px); }
}

/* ---------- 인기/랭킹 ---------- */
.trend-item {
    display: flex; align-items: center; gap: 10px; padding: 8px 4px;
    color: inherit; border-radius: 8px;
}
.trend-item:hover { background: #f5f8fa; text-decoration: none; }
.trend-rank { color: #e0245e; font-weight: 800; width: 20px; text-align: center; flex-shrink: 0; }
.trend-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trend-meta { color: #8899a6; font-size: 12px; flex-shrink: 0; }

.rank-tabs { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.rank-tab { white-space: nowrap; }
.rank-tab {
    border: 1px solid #e1e8ed; background: #fff; border-radius: 999px;
    padding: 4px 14px; font-size: 13px; cursor: pointer; color: #444;
}
.rank-tab:hover { text-decoration: none; }
.rank-tab.on { background: var(--btn-bg, #e0245e); color: var(--btn-text, #fff); border-color: var(--btn-bg, #e0245e); }
.rank-list { list-style: none; margin: 0; padding: 0; display: none; }
.rank-list.on { display: block; }
.rank-list li { padding: 6px 4px; border-bottom: 1px solid #f5f8fa; counter-increment: rank; }
.rank-list li:before { content: counter(rank); color: #e0245e; font-weight: 800; margin-right: 10px; }
.rank-list li.empty:before { content: none; }
.rank-cnt { float: right; color: #8899a6; font-size: 12px; }

/* 게시물 하단 "작성자의 다른 글/댓글" (클리앙 스타일) */
.author-activity-head {
    display: none; width: 100%; align-items: center; justify-content: space-between;
    background: none; border: 0; padding: 0; font-size: 16px; font-weight: 700; cursor: pointer; color: #14171a;
}
.author-activity-caret { transition: transform .15s; color: #8899a6; }
.author-activity-item {
    display: flex; flex-direction: column; gap: 2px; min-width: 0;
    padding: 8px 4px; border-bottom: 1px solid #f5f8fa; color: #14171a;
}
.author-activity-item:hover { background: #f5f8fa; text-decoration: none; }
.aa-row { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.aa-text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aa-sub { color: #8899a6; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.aa-time { flex: 0 0 auto; color: #8899a6; font-size: 12px; white-space: nowrap; }
.aa-cat {
    display: inline-block; background: #f0f2f5; color: #657786; font-size: 11px;
    padding: 1px 7px; border-radius: 999px; margin-right: 4px; vertical-align: middle;
}
.aa-tabs-label { color: #8899a6; font-size: 13px; align-self: center; margin-right: 2px; }
html.dark .aa-cat { background: #262c34; color: #8899a6; }
@media (max-width: 600px) {
    .author-activity-head { display: flex; }
    .author-activity-body { display: none; }
    .author-activity.open .author-activity-body { display: block; margin-top: 10px; }
    .author-activity.open .author-activity-caret { transform: rotate(180deg); }
}
html.dark .author-activity-head { color: #e7e9ea; }
html.dark .author-activity-item { color: #e7e9ea; }
html.dark .author-activity-item:hover { background: #22262b; }

/* 사이드바 랭킹 (작게) */
.sidebar-rank { font-size: 13px; }
.sidebar-rank .panel-title { font-size: 14px; }
.sidebar-rank .rank-tab { padding: 3px 10px; font-size: 12px; }
.sidebar-rank .rank-list li { padding: 5px 2px; font-size: 13px; }
.sidebar-rank .rank-list li:before { margin-right: 8px; }

/* 홈 베스트 글 패널 */
.best-panel .trend-item { padding: 7px 4px; }

/* ---------- 게시판형 목록 ---------- */
.board-wrap {
    background: #fff; border: 1px solid #e1e8ed; border-radius: 12px;
    overflow: hidden; margin-bottom: 12px;
}
.board-list { width: 100%; border-collapse: collapse; font-size: 14px; }
.board-list thead th {
    background: #f7f9fa; color: #657786; font-weight: 600; font-size: 12px;
    padding: 10px 8px; border-bottom: 1px solid #e1e8ed; text-align: center;
}
.board-list tbody td { padding: 10px 8px; border-bottom: 1px solid #f0f2f5; text-align: center; color: #657786; }
.board-list tbody tr:hover { background: #fafbfc; }
.board-list .c-num { width: 52px; font-size: 13px; }
.board-list .c-cat { width: 78px; font-size: 12px; }
.board-list .c-cat a { color: #8899a6; }
.board-list .c-title { text-align: left; }
.board-list .c-title a { color: #14171a; font-weight: 500; }
.board-list .c-title a:hover { color: #e0245e; }
.board-list .c-author { width: 90px; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 90px; }
.board-list .c-author a { color: #657786; }
.board-list .c-author a:hover { color: #e0245e; }
.board-list .c-date { width: 60px; font-size: 12px; }
.board-list .c-view { width: 52px; font-size: 12px; }
.board-cc { color: #e0245e; font-size: 12px; font-weight: 700; margin-left: 4px; }
.board-notice { background: #e0245e; color: #fff; font-size: 11px; padding: 1px 7px; border-radius: 999px; }
.board-list tr.pinned { background: #fef6f9; }
.board-list tr.pinned .c-title a { font-weight: 700; }
.board-empty { padding: 40px 0 !important; color: #999; }
.board-actions { display: flex; justify-content: flex-end; margin: 12px 0; }

/* 게시판 제목 */
.post-title { font-size: 20px; margin: 2px 0 10px; word-break: break-word; }
.post-title-link { display: block; font-size: 16px; font-weight: 700; color: #14171a; margin: 2px 0 6px; }
.post-title-link:hover { color: #e0245e; text-decoration: none; }

/* 게시판별 추가 필드 (예: 장점/가격) */
.post-fields { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.post-field {
    background: #f5f8fa; border-radius: 8px; padding: 4px 10px; font-size: 13px; color: #444;
}
.post-field strong { color: #e0245e; margin-right: 4px; }
.post-field a { color: #1a73e8; text-decoration: underline; word-break: break-all; }
html.dark .post-field { background: #262c34; color: #c8ccd0; }
.custom-fields-wrap:not(:empty) { margin: 8px 0; display: flex; flex-direction: column; gap: 4px; }
.custom-fields-wrap label { margin: 6px 0 2px; }

/* 첨부파일 */
.attach-list { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.attach-row {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    background: #f5f8fa; border-radius: 8px; padding: 6px 10px; font-size: 13px;
}
.attach-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-remove { border: 0; background: transparent; color: #999; cursor: pointer; font-size: 12px; padding: 0 4px; }
.attach-remove:hover { color: #e0245e; }
.post-attachments { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.post-attachment {
    display: inline-flex; align-items: center; gap: 6px; background: #f5f8fa;
    border-radius: 8px; padding: 8px 12px; font-size: 13px; color: #14171a; width: fit-content; max-width: 100%;
}
.post-attachment:hover { background: #eef1f4; text-decoration: none; }
.attach-size { color: #8899a6; }
html.dark .attach-row, html.dark .post-attachment { background: #262c34; color: #e7e9ea; }
html.dark .attach-remove { color: #8899a6; }

/* 번호형 페이지네이션 */
.pagination { display: flex; justify-content: center; gap: 4px; margin: 18px 0; flex-wrap: wrap; }
.pagination .pg {
    min-width: 34px; height: 34px; padding: 0 8px; border: 1px solid #e1e8ed;
    border-radius: 8px; background: #fff; color: #444; font-size: 13px;
    display: inline-flex; align-items: center; justify-content: center;
}
.pagination .pg:hover { border-color: #e0245e; color: #e0245e; text-decoration: none; }
.pagination .pg.on { background: var(--btn-bg, #e0245e); color: var(--btn-text, #fff); border-color: var(--btn-bg, #e0245e); font-weight: 700; }

@media (max-width: 500px) {
    .board-list .c-cat, .board-list thead .c-cat { display: none; }
    .board-list .c-author, .board-list thead .c-author { display: none; }
}

/* 정렬 바 (카테고리) */
.sort-bar { display: flex; gap: 6px; margin: -4px 0 12px; flex-wrap: wrap; }
.sort-btn {
    border: 1px solid #e1e8ed; background: #fff; border-radius: 999px;
    padding: 5px 14px; font-size: 13px; color: #444; white-space: nowrap;
}
.sort-btn:hover { text-decoration: none; border-color: #e0245e; color: #e0245e; }
.sort-btn.on { background: var(--btn-bg, #e0245e); color: var(--btn-text, #fff); border-color: var(--btn-bg, #e0245e); font-weight: 600; }

/* 최근 댓글 */
.rc-item {
    display: block; padding: 8px 4px; border-bottom: 1px solid #f5f8fa;
    color: inherit; border-radius: 6px;
}
.rc-item:hover { background: #f5f8fa; text-decoration: none; }
.rc-item:last-child { border-bottom: 0; }
.rc-text {
    display: block; font-size: 13px; color: #333;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rc-meta { display: block; color: #8899a6; font-size: 11px; margin-top: 1px; }

/* 게시판 소개 섹션 */
.board-intro { padding: 18px 20px; }
.board-intro-title {
    font-size: 20px; margin: 0;
    display: flex; align-items: center; gap: 8px;
}
.board-intro-desc { margin: 6px 0 0; color: #657786; font-size: 14px; }

/* 소개 페이지 */
.about-content { line-height: 1.8; }
.board-guide { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.board-guide-item {
    display: block; padding: 12px 14px; border: 1px solid #e1e8ed;
    border-radius: 10px; color: inherit;
}
.board-guide-item:hover { background: #f5f8fa; text-decoration: none; border-color: #e0245e; }
.board-guide-item strong { display: flex; align-items: center; gap: 8px; }
.board-guide-desc { display: block; color: #657786; font-size: 13px; margin-top: 2px; }

/* 관리자 메뉴 소개 입력 */
.input-desc { margin-top: 4px; font-size: 12px !important; }
.rank-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.rank-table th, .rank-table td { padding: 8px; border-bottom: 1px solid #f0f2f5; text-align: center; }
.rank-table td:nth-child(2), .rank-table th:nth-child(2) { text-align: left; }

/* ---------- 폼 공통 ---------- */
label { display: block; font-size: 13px; color: #444; margin: 14px 0 4px; font-weight: 600; }
.hint { color: #999; font-size: 12px; font-weight: 400; }
input:not([type=checkbox]):not([type=radio]), textarea, select {
    width: 100%; padding: 10px 12px; border: 1px solid #ccd6dd;
    border-radius: 10px; font-size: 14px; font-family: inherit; background: #fff;
}
.radio-group { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 14px 0 4px; }
.radio-group label {
    display: inline-flex; align-items: center; gap: 6px;
    margin: 0; font-weight: 400; cursor: pointer;
}
.radio-group input[type=radio] { width: auto; margin: 0; }
.checkbox-inline {
    display: inline-flex; align-items: center; gap: 6px;
    margin: 0; font-weight: 400; cursor: pointer; font-size: 14px;
}
.checkbox-inline input[type=checkbox] { width: auto; margin: 0; }
.modal-section-title { margin: 20px 0 4px; }
.modal-section-title:first-child { margin-top: 0; }
input:focus, textarea:focus, select:focus { outline: 2px solid #f5b5c8; border-color: #e0245e; }
.btn-primary {
    background: var(--btn-bg, #e0245e); color: var(--btn-text, #fff); border: 0; border-radius: 999px;
    padding: 10px 24px; font-size: 15px; font-weight: 700; cursor: pointer; margin-top: 16px;
}
.btn-primary:hover { filter: brightness(0.9); }
.btn-sm {
    display: inline-block; background: #fff; border: 1px solid #ccd6dd; color: #444;
    border-radius: 999px; padding: 4px 12px; font-size: 13px; cursor: pointer;
}
.btn-sm:hover { border-color: #e0245e; color: #e0245e; text-decoration: none; }
.btn-primary.btn-sm { background: var(--btn-bg, #e0245e); color: var(--btn-text, #fff); border: 0; }
.btn-primary.btn-sm:hover { filter: brightness(0.9); color: var(--btn-text, #fff); }
.btn-danger { color: #b71c1c; }
.btn-danger:hover { border-color: #b71c1c; color: #b71c1c; }
.input-sm { width: 140px !important; }
.input-xs { width: 70px !important; }
.inline-form { display: flex; gap: 8px; align-items: stretch; margin: 8px 0; }
.inline-form input { width: auto; flex: 1; }
.inline-form button, .inline-form .btn-sm, .inline-form .btn-primary { padding-top: 0; padding-bottom: 0; line-height: 38px; }

/* ---------- 인증 ---------- */
.auth-box {
    max-width: 400px; margin: 24px auto; background: #fff;
    border: 1px solid #e1e8ed; border-radius: 12px; padding: 28px;
}
.auth-box h1 { font-size: 20px; margin: 0 0 16px; }
.auth-alt { text-align: center; color: #888; font-size: 13px; margin-top: 16px; }
.captcha-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }

/* 카카오 로그인 */
.btn-kakao {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; box-sizing: border-box; padding: 12px;
    background: #fee500; color: #191600 !important; border-radius: 10px;
    font-size: 15px; font-weight: 700; margin-bottom: 4px;
}
.btn-kakao:hover { background: #f2da00; text-decoration: none; }
.kakao-icon { font-size: 16px; }
.auth-divider { display: flex; align-items: center; text-align: center; color: #aab8c2; font-size: 12px; margin: 16px 0; }
.auth-divider:before, .auth-divider:after { content: ""; flex: 1; height: 1px; background: #e1e8ed; }
.auth-divider span { padding: 0 12px; }
.tag-kakao { background: #fee500; color: #3a2e00; }
.captcha-row img { border: 1px solid #e1e8ed; border-radius: 8px; }

/* ---------- 에디터 ---------- */
.editor-toolbar { display: flex; gap: 8px; align-items: center; margin: 16px 0 0; }
.editor-toolbar button {
    background: #fff; border: 1px solid #ccd6dd; border-radius: 999px;
    padding: 6px 14px; font-size: 13px; cursor: pointer;
}
.editor-toolbar button:hover { border-color: #e0245e; color: #e0245e; }
.img-count { color: #8899a6; font-size: 12px; margin-left: auto; }
.editor {
    min-height: 160px; border: 1px solid #ccd6dd; border-radius: 10px;
    padding: 12px; margin-top: 8px; background: #fff;
}
.editor:focus { outline: 2px solid #f5b5c8; border-color: #e0245e; }
.editor:empty:before { content: attr(data-placeholder); color: #aab8c2; pointer-events: none; }
.editor img { max-height: 240px; border-radius: 8px; margin: 4px 4px 0 0; }
.editor img[data-pending] { opacity: .4; }
.editor .yt-wrap { pointer-events: none; }
.editor-status { color: #e0245e; font-size: 13px; min-height: 18px; margin-top: 6px; }

/* 첨부 이미지 미리보기 스트립 */
.img-strip { display: none; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.img-thumb {
    position: relative; width: 84px; height: 84px;
    border: 1px solid #e1e8ed; border-radius: 10px;
    overflow: hidden; cursor: zoom-in; background: #f5f8fa;
}
.img-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-thumb.pending { opacity: .45; }
.img-thumb-del {
    position: absolute; top: 4px; right: 4px; width: 20px; height: 20px;
    border: 0; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff;
    cursor: pointer; font-size: 14px; line-height: 20px; padding: 0; text-align: center;
}
.img-thumb-del:hover { background: #e0245e; }

/* ---------- 댓글 ---------- */
.comment { padding: 10px 0; border-bottom: 1px solid #f0f2f5; }
.comment-head { font-size: 13px; display: flex; align-items: center; gap: 8px; }
.comment-time { color: #8899a6; font-size: 12px; }
.comment-del { margin-left: auto; color: #aab8c2; font-size: 12px; }
.comment-body { margin-top: 2px; font-size: 14px; }
.comment-form textarea { margin-bottom: 8px; }

/* ---------- 쪽지 ---------- */
.msg-row { display: flex; align-items: center; border-bottom: 1px solid #f0f2f5; }
.msg-row.unread { background: #fef6f9; }
.msg-link-row {
    flex: 1; display: flex; align-items: center; gap: 10px;
    padding: 10px 6px; color: inherit; min-width: 0;
}
.msg-link-row:hover { text-decoration: none; background: #f5f8fa; }
.msg-preview { flex: 1; color: #657786; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-time { color: #8899a6; font-size: 12px; font-weight: 400; }
.msg-del { color: #aab8c2; padding: 0 8px; }
.msg-body { background: #f8f9fa; border-radius: 10px; padding: 14px; margin-bottom: 12px; }
.msg-form textarea { margin-bottom: 4px; }

/* ---------- 광고 ---------- */
.ad-slot { margin-bottom: 12px; text-align: center; overflow: hidden; border-radius: 12px; }
.ad-frame { width: 100%; height: 90px; border: 0; display: block; }
.ad-sidebar .ad-frame { height: 250px; }
.ad-banner-link { display: block; }
.ad-banner-img { width: 100%; height: auto; display: block; border-radius: 12px; }
.ad-slot-button { padding: 8px 0; }
.ad-button-link { text-decoration: none; }
.ad-popup-button-wrap { padding: 32px 20px; text-align: center; }
.post-content-gated { background: #f7f8fa; border-radius: 10px; padding: 14px; }
.gated-teaser { margin: 0; color: #657786; font-size: 14px; }
html.dark .post-content-gated { background: #1c2129; }
html.dark .gated-teaser { color: #8899a6; }

/* 콘텐츠 게이트 미리보기: 위쪽 70px만 선명하게, 그 아래는 블러 처리 */
.gated-peek {
    position: relative; height: 180px; overflow: hidden; border-radius: 10px; margin-bottom: 10px; background: #000;
    pointer-events: none; cursor: default; user-select: none;
}
.gated-peek img { -webkit-user-drag: none; user-drag: none; }
.gated-peek-bg {
    position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
    filter: blur(16px) brightness(0.85); transform: scale(1.15);
}
.gated-peek-sharp { position: absolute; top: 0; left: 0; right: 0; height: 70px; overflow: hidden; }
.gated-peek-sharp img { width: 100%; height: 180px; object-fit: cover; display: block; }
.gated-firstline { color: #657786; font-size: 14px; margin: 0 0 10px; }
html.dark .gated-firstline { color: #8899a6; }
.gated-divider { border: 0; border-top: 1px dashed #e1e8ed; margin: 14px 0; }
html.dark .gated-divider { border-top-color: #3a4250; }
.content-gate > .panel-title { justify-content: center; text-align: center; }

/* 팝업(레이어) 광고 */
.ad-popup-overlay {
    position: fixed; inset: 0; z-index: 1400;
    background: rgba(0,0,0,.55);
    display: flex; align-items: center; justify-content: center;
    padding: 16px; animation: fdModalIn .18s ease;
}
.ad-popup-box {
    position: relative; width: 100%; max-width: 360px;
    max-height: 88vh; overflow: hidden; border-radius: 14px;
    background: #fff; box-shadow: 0 12px 32px rgba(0,0,0,.25);
}
.ad-popup-close {
    position: absolute; top: 8px; right: 8px; z-index: 2;
    width: 30px; height: 30px; border-radius: 50%; border: 0;
    background: rgba(0,0,0,.5); color: #fff; cursor: pointer; font-size: 14px; line-height: 30px; padding: 0;
}
.ad-popup-close:hover { background: #e0245e; }
.ad-popup-body { display: block; max-height: calc(88vh - 44px); overflow-y: auto; }
.ad-popup-img { width: 100%; display: block; }
.ad-popup-foot {
    display: flex; align-items: center; gap: 6px; padding: 10px 14px;
    font-size: 13px; color: #444; cursor: pointer; border-top: 1px solid #f0f2f5;
}
html.dark .ad-popup-box { background: #1e2329; }
html.dark .ad-popup-foot { color: #c8ccd0; border-top-color: #2f3640; }

/* 광고 후 콘텐츠 보기 게이트 */
.content-gate { text-align: center; padding: 32px 20px; }
.content-gate-ad { margin: 16px 0; }
.content-gate #gateStatus { margin-top: 10px; }
.content-gate-links { display: flex; flex-direction: column; gap: 8px; max-width: 320px; margin: 16px auto; }
.content-gate-link {
    display: block; padding: 12px 16px; border-radius: 10px;
    background: #f5f8fa; color: #14171a; font-weight: 600; font-size: 14px;
    border: 1px solid #e1e8ed;
}
.content-gate-link:hover { border-color: #e0245e; color: #e0245e; text-decoration: none; }
html.dark .content-gate-link { background: #262c34; border-color: #2f3640; color: #e7e9ea; }
html.dark .content-gate-link:hover { border-color: #e0245e; color: #e0245e; }

/* 이벤트 페이지 */
.event-page { text-align: center; }
.event-image { width: 100%; max-width: 640px; display: block; margin: 12px auto; border-radius: 12px; }
.event-cta { display: inline-block; margin: 12px auto; }
.event-text-content { text-align: left; margin: 16px 0; line-height: 1.7; }
.event-prize {
    text-align: left; background: #fef6f9; border: 1px solid #fbd6e1; border-radius: 10px;
    padding: 12px 16px; margin: 12px 0; font-size: 14px;
}
.event-prize strong { display: block; margin-bottom: 4px; color: #e0245e; }
.event-form { text-align: left; margin-top: 24px; }
.event-addr-row { display: flex; gap: 8px; align-items: center; }
.event-addr-row input { flex: 1; }
.event-addr-row .btn-sm { flex-shrink: 0; margin: 0; white-space: nowrap; }
.event-terms {
    background: #f5f8fa; border-radius: 8px; padding: 12px; font-size: 13px; color: #555;
    max-height: 160px; overflow-y: auto; margin: 8px 0;
}
html.dark .event-prize { background: #2a222a; border-color: #3a2a32; }
html.dark .event-terms { background: #262c34; color: #c8ccd0; }

/* 인라인 삭제 폼 (링크처럼 보이는 버튼) */
.inline-del { display: inline; margin: 0; }
.inline-del button {
    background: none; border: 0; padding: 0; cursor: pointer;
    font: inherit; color: inherit;
}
.comment-del { margin-left: auto; color: #aab8c2; font-size: 12px; }
.comment-del:hover { color: #e0245e; }
.msg-del { color: #aab8c2; padding: 0 8px; }
.msg-del:hover { color: #e0245e; }
.msg-row .inline-del { display: flex; align-items: center; }

/* ---------- 관리자 ---------- */
.admin-nav { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.admin-nav a {
    background: #fff; border: 1px solid #e1e8ed; border-radius: 999px;
    padding: 6px 16px; font-size: 14px; color: #444;
}
.admin-nav a:hover { text-decoration: none; border-color: #e0245e; color: #e0245e; }
.admin-nav a.on { background: var(--btn-bg, #e0245e); color: var(--btn-text, #fff); border-color: var(--btn-bg, #e0245e); }

/* 관리자 전체화면 셸: 왼쪽 사이드바 + 콘텐츠 */
.admin-shell { display: flex; min-height: 100vh; background: #f5f6f8; }
.admin-sidebar {
    width: 232px; flex-shrink: 0; background: #1c2129; color: #d7dbe0;
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.admin-sidebar-brand {
    display: flex; align-items: center; gap: 8px; padding: 18px 18px; font-weight: 800; font-size: 15px;
    color: #fff; border-bottom: 1px solid #2f3640; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.admin-sidebar-brand .star { color: var(--btn-bg, #e0245e); }
.admin-sidebar-brand:hover { text-decoration: none; }
.admin-sidebar-nav { display: flex; flex-direction: column; padding: 10px; gap: 2px; flex: 1; }
.admin-sidebar-nav a {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px;
    color: #b3b9c2; font-size: 13.5px; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.admin-sidebar-nav a:hover { background: #262c34; color: #fff; }
.admin-sidebar-nav a.on { background: var(--btn-bg, #e0245e); color: #fff; }
.admin-nav-ic { font-size: 15px; width: 18px; text-align: center; flex-shrink: 0; }
.admin-sidebar-foot { padding: 12px 16px; border-top: 1px solid #2f3640; font-size: 12.5px; }
.admin-sidebar-user { color: #8b98a5; margin-bottom: 6px; }
.admin-sidebar-foot a { color: #8b98a5; text-decoration: none; }
.admin-sidebar-foot a:hover { color: #fff; }
.admin-content { flex: 1; min-width: 0; padding: 24px 28px 60px; }
.admin-sidebar-toggle {
    display: none; position: fixed; top: 10px; left: 10px; z-index: 60;
    width: 38px; height: 38px; border-radius: 10px; border: 1px solid #e1e8ed;
    background: #fff; font-size: 18px; cursor: pointer;
}
.admin-sidebar-backdrop { display: none; }
@media (max-width: 900px) {
    .admin-shell { display: block; }
    .admin-sidebar-toggle { display: block; }
    .admin-sidebar {
        position: fixed; top: 0; left: 0; height: 100vh; z-index: 61; width: 240px;
        transform: translateX(-100%); transition: transform .2s;
    }
    .admin-shell.sidebar-open .admin-sidebar { transform: translateX(0); }
    .admin-sidebar-backdrop {
        display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 55;
    }
    .admin-shell.sidebar-open .admin-sidebar-backdrop { display: block; }
    .admin-content { padding: 56px 16px 80px; }
}
html.dark .admin-shell { background: #0f1216; }
html.dark .admin-sidebar { background: #15181c; border-right: 1px solid #262c34; }

.admin-page-title { font-size: 20px; margin: 4px 0 2px; font-weight: 800; }
.admin-page-sub { color: #8899a6; font-size: 13px; margin: 0 0 20px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { background: #fff; border: 1px solid #e1e8ed; border-radius: 14px; padding: 16px 18px; }
.stat-card .label { font-size: 12.5px; color: #8899a6; font-weight: 700; }
.stat-card .num { font-size: 24px; font-weight: 800; margin: 8px 0 4px; letter-spacing: -0.02em; }
.stat-card .delta { font-size: 12px; font-weight: 600; color: #8899a6; }
.stat-card .delta.up { color: #1b8a4c; }
.admin-dash-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .admin-dash-grid { grid-template-columns: 1fr; } }
.pill-ai { display: inline-block; background: var(--btn-bg, #e0245e); color: #fff; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 999px; margin-left: 4px; vertical-align: middle; }
.dash-user-row { display: flex; justify-content: space-between; padding: 8px 2px; border-bottom: 1px solid #f5f8fa; font-size: 13.5px; }
.dash-user-row:last-child { border-bottom: 0; }
.dash-quicklinks { display: flex; flex-direction: column; gap: 4px; }
.dash-quicklinks a { padding: 9px 8px; border-radius: 8px; font-size: 13.5px; font-weight: 600; color: #444; }
.dash-quicklinks a:hover { background: #f5f8fa; text-decoration: none; color: var(--btn-bg, #e0245e); }
html.dark .stat-card { background: #1e2329; border-color: #2f3640; }
html.dark .dash-user-row { border-bottom-color: #2f3640; }
html.dark .dash-quicklinks a { color: #c8ccd0; }
html.dark .dash-quicklinks a:hover { background: #262c34; }

.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 12px 0; }
.admin-table th, .admin-table td { padding: 8px 6px; border-bottom: 1px solid #f0f2f5; text-align: left; }

/* 메뉴 관리: 두 줄짜리 카드형 레이아웃 (기본 정보 / 상세 설정) */
.menu-card { border: 1px solid #f0f2f5; border-radius: 10px; padding: 10px 12px; margin: 10px 0; }
.menu-bulk-toolbar { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.menu-card-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0; }
.menu-card-row input, .menu-card-row select { width: auto; }
.menu-card-row .input-desc { width: 160px; }
.menu-check { display: inline-flex; align-items: center; gap: 4px; margin: 0; font-weight: 400; white-space: nowrap; font-size: 13px; }
.menu-slug { font-size: 12px; color: #8899a6; white-space: nowrap; }
.menu-postcount { font-size: 12px; color: #8899a6; white-space: nowrap; }
html.dark .menu-card { border-color: #2f3640; }
.settings-group { margin: 24px 0 4px; padding-top: 16px; border-top: 1px solid #f0f2f5; font-size: 14px; color: #e0245e; }
.tag { font-size: 11px; padding: 2px 8px; border-radius: 999px; }
.tag-red { background: #fdecea; color: #b71c1c; }
.tag-green { background: #e8f5e9; color: #1b5e20; }
.tag-gray { background: #eceff1; color: #546e7a; }

/* ---------- 검색 ---------- */
.search-form { flex-shrink: 0; }
.search-form input {
    width: 130px; padding: 6px 12px; border: 1px solid #e1e8ed;
    border-radius: 999px; font-size: 13px; background: #f5f8fa;
}
.search-form input:focus { width: 180px; background: #fff; transition: width .2s; }
.search-link-mobile { display: none; font-size: 15px; }
@media (max-width: 700px) {
    .search-form { display: none; }
    .search-link-mobile { display: inline; }
}
@media (max-width: 600px) {
    .search-link-mobile.mobile-gnb-dup { display: none; } /* 검색은 하단 GNB로 이동 - 상단 아이콘은 중복이므로 숨김 (위 700px 규칙보다 우선) */
}

/* ---------- 레이지 로딩 ---------- */
.feed-loader { text-align: center; color: #8899a6; font-size: 13px; padding: 14px 0; }

/* ---------- 페이저 / 라이트박스 ---------- */
.pager { display: flex; justify-content: center; gap: 12px; margin: 16px 0; }
.lightbox {
    position: fixed; inset: 0; z-index: 999; background: rgba(0,0,0,.85);
    display: flex; align-items: center; justify-content: center; cursor: zoom-out;
}
.lightbox img { max-width: 94vw; max-height: 94vh; border-radius: 8px; object-fit: contain; }

/* ---------- 투표/설문 ---------- */
.poll {
    margin: 10px 0; padding: 14px; border: 1px solid #e1e8ed;
    border-radius: 12px; background: #fafbfc;
}
.poll-q { font-weight: 700; margin-bottom: 4px; }
.poll-meta { color: #8899a6; font-size: 12px; margin-bottom: 10px; }
.poll-choice {
    display: flex; align-items: center; gap: 8px; padding: 10px 12px;
    border: 1px solid #ccd6dd; border-radius: 10px; margin-bottom: 6px;
    cursor: pointer; font-weight: 400; background: #fff;
}
.poll-choice:hover { border-color: #e0245e; }
.poll-choice input { width: auto; }
.poll-submit { margin-top: 6px; }
.poll-result {
    position: relative; padding: 10px 12px; margin-bottom: 6px;
    border-radius: 10px; background: #eceef0; overflow: hidden;
    display: flex; align-items: center; font-size: 14px;
}
.poll-bar {
    position: absolute; left: 0; top: 0; bottom: 0;
    background: #f7c6d6; z-index: 0; transition: width .4s;
}
.poll-result.mine .poll-bar { background: #f28fb0; }
.poll-label { position: relative; z-index: 1; flex: 1; }
.poll-result.mine .poll-label { font-weight: 700; }
.poll-pct { position: relative; z-index: 1; color: #555; font-size: 13px; }
.poll-note { color: #8899a6; font-size: 13px; margin-top: 6px; }

/* 글쓰기 투표 작성 박스 */
.poll-box {
    margin-top: 10px; padding: 14px; border: 1px dashed #ccd6dd;
    border-radius: 12px; background: #fafbfc;
}
.poll-box-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.poll-opt-input { margin-bottom: 6px; }
.poll-box-opts { display: flex; align-items: center; gap: 14px; margin-top: 10px; flex-wrap: wrap; }
.poll-inline { display: inline-flex; align-items: center; gap: 5px; font-weight: 400; margin: 0; }
.poll-inline input { width: auto; }
.poll-expiry { width: auto !important; margin-left: auto; }
.poll-readonly { margin-top: 10px; }
.poll-readonly-opt {
    padding: 8px 12px; border: 1px solid #e1e8ed; border-radius: 8px;
    margin: 4px 0; background: #fff; color: #657786;
}

/* ---------- 다크모드 토글 버튼 ---------- */
.theme-toggle {
    flex-shrink: 0; background: none; border: 0; cursor: pointer;
    font-size: 18px; line-height: 1; padding: 4px; border-radius: 50%;
}
.theme-toggle:hover { background: rgba(128,128,128,.15); }

/* ==================== 다크모드 ==================== */
html.dark body { background: #15181c; color: #e7e9ea; }
html.dark a { color: #ff5c8a; }
html.dark .topbar { background: #1e2329; border-bottom-color: #2f3640; }
html.dark .menu-row { border-top-color: #2f3640; }
html.dark .logo { color: #ff5c8a; }
html.dark .menu-nav a { color: #c8ccd0; }
html.dark .menu-nav a:hover { background: #3a2630; }
html.dark .menu-nav a.active { background: var(--btn-bg, #e0245e); color: var(--btn-text, #fff); }
html.dark .menu-scroll,
html.dark .menu-all-btn { background: #262c34; border-color: #2f3640; color: #c8ccd0; }
html.dark .menu-all-panel { background: #1e2329; border-color: #2f3640; }
html.dark .menu-all-panel a { color: #d8dbde; }
html.dark .menu-all-panel a:hover { background: #3a2630; }
html.dark .topbar-right a { color: #c8ccd0; }
html.dark .me-nick { color: #8b98a5; }
html.dark .search-form input { background: #262c34; border-color: #2f3640; color: #e7e9ea; }

html.dark .panel,
html.dark .post,
html.dark .auth-box,
html.dark .board-intro,
html.dark .board-guide-item { background: #1e2329; border-color: #2f3640; }
html.dark .post-author,
html.dark .panel-title,
html.dark .feed-title,
html.dark .board-intro-title { color: #e7e9ea; }
html.dark .post-sub,
html.dark .post-sub *,
html.dark .comment-time,
html.dark .msg-time,
html.dark .msg-preview,
html.dark .hint,
html.dark .empty,
html.dark .empty-feed,
html.dark .board-intro-desc,
html.dark .board-guide-desc,
html.dark .link-url,
html.dark .link-desc,
html.dark .trend-meta { color: #8b98a5; }
html.dark .post-actions { border-top-color: #2f3640; }
html.dark .act { color: #8b98a5; }
html.dark .act:hover { background: #3a2630; color: #ff5c8a; }
html.dark .comment { border-bottom-color: #2f3640; }

html.dark input:not([type=checkbox]):not([type=radio]),
html.dark textarea,
html.dark select,
html.dark .editor {
    background: #262c34; border-color: #3a4250; color: #e7e9ea;
}
html.dark .editor:empty:before,
html.dark ::placeholder { color: #6b7783; }

html.dark .panel,
html.dark .trend-item:hover,
html.dark .msg-link-row:hover,
html.dark .board-guide-item:hover { background: #262c34; }
html.dark .board-guide-item:hover { background: #2b3138; }

html.dark .btn-sm { background: #262c34; border-color: #3a4250; color: #c8ccd0; }
html.dark .rank-tab { background: #262c34; border-color: #3a4250; color: #c8ccd0; }
html.dark .rank-tab.on { background: var(--btn-bg, #e0245e); color: var(--btn-text, #fff); }
html.dark .rank-list li { border-bottom-color: #2f3640; }
html.dark .rank-table th, html.dark .rank-table td,
html.dark .admin-table th, html.dark .admin-table td { border-bottom-color: #2f3640; }
html.dark .admin-nav a { background: #262c34; border-color: #3a4250; color: #c8ccd0; }
html.dark .admin-nav a.on { background: var(--btn-bg, #e0245e); color: var(--btn-text, #fff); }

html.dark .link-card { background: #262c34; border-color: #2f3640; }
html.dark .link-card:hover { background: #2b3138; }
html.dark .link-title { color: #e7e9ea; }
html.dark .msg-body,
html.dark .comment-body { color: #e7e9ea; }
html.dark .msg-body { background: #262c34; }
html.dark .msg-row.unread { background: #2a222a; }

html.dark .poll,
html.dark .poll-box { background: #262c34; border-color: #2f3640; }
html.dark .poll-choice { background: #1e2329; border-color: #3a4250; }
html.dark .poll-result { background: #313842; }
html.dark .poll-bar { background: #7a3350; }
html.dark .poll-result.mine .poll-bar { background: #a8446a; }
html.dark .poll-pct, html.dark .poll-note, html.dark .poll-meta { color: #9aa5b1; }
html.dark .poll-readonly-opt { background: #1e2329; border-color: #3a4250; color: #9aa5b1; }
html.dark .notice-card { background: #1e2329; border-color: #2f3640; border-left-color: #e0245e; color: #e7e9ea; }
html.dark .notice-card:hover { background: #2b3138; }
html.dark .notice-text { color: #c8ccd0; }
html.dark .notice-nav { background: #262c34; border-color: #3a4250; color: #c8ccd0; }
html.dark .notice-count { color: #8b98a5; }
html.dark .attend-img { background: #262c34; }
html.dark .attend-noimg { color: #55606b; }
html.dark .attend-imgbtn { background: #262c34; border-color: #3a4250; color: #c8ccd0; }
html.dark .attend-rest li { border-bottom-color: #2f3640; }
html.dark .attend-status.done { background: #1f3324; color: #86e0a0; }
html.dark .attend-myimg { background: #262c34; border-color: #2f3640; }
html.dark .attend-myimg > img { border-color: #3a4250; }
html.dark .attend-fab { background: #262c34; border-color: #3a4250; }
html.dark .fab-dot { border-color: #262c34; }
html.dark .sort-btn { background: #262c34; border-color: #3a4250; color: #c8ccd0; }
html.dark .sort-btn.on { background: var(--btn-bg, #e0245e); border-color: var(--btn-bg, #e0245e); color: var(--btn-text, #fff); }
html.dark .rc-item { border-bottom-color: #2f3640; }
html.dark .rc-item:hover { background: #2b3138; }
html.dark .rc-text { color: #c8ccd0; }
html.dark .board-wrap { background: #1e2329; border-color: #2f3640; }
html.dark .board-list thead th { background: #262c34; border-bottom-color: #2f3640; color: #9aa5b1; }
html.dark .board-list tbody td { border-bottom-color: #2f3640; color: #9aa5b1; }
html.dark .board-list tbody tr:hover { background: #262c34; }
html.dark .board-list .c-title a { color: #e7e9ea; }
html.dark .board-list tr.pinned { background: #2a222a; }
html.dark .post-title, html.dark .post-title-link { color: #e7e9ea; }
html.dark .pagination .pg { background: #262c34; border-color: #3a4250; color: #c8ccd0; }
html.dark .pagination .pg.on { background: var(--btn-bg, #e0245e); border-color: var(--btn-bg, #e0245e); color: var(--btn-text, #fff); }
html.dark .auth-divider:before, html.dark .auth-divider:after { background: #2f3640; }
html.dark .tip { background: #3a4250; }
html.dark .tip-box { background: #0b0d0f; }
html.dark .tip-box:before { border-bottom-color: #0b0d0f; }

html.dark .alert-error { background: #3a1f22; color: #ff9a9a; }
html.dark .alert-info { background: #1f2d3a; color: #8fc3ff; }
html.dark .avatar { color: #fff; }
html.dark .site-footer { color: #6b7783; }
html.dark .theme-toggle:hover { background: rgba(255,255,255,.12); }
html.dark .tag-gray { background: #313842; color: #9aa5b1; }
html.dark .settings-group { border-top-color: #2f3640; }
html.dark .editor-toolbar button { background: #262c34; border-color: #3a4250; color: #c8ccd0; }
html.dark .img-thumb { background: #262c34; border-color: #3a4250; }
