/* 팬덤 플랫폼 스타일 */
* { 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; }
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;
}
.logo { font-weight: 800; font-size: 18px; color: #e0245e; white-space: nowrap; margin-right: auto; }
.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: #e0245e; color: #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;
}
@media (max-width: 600px) {
    .topbar-inner { gap: 10px; }
    .topbar-right { gap: 10px; }
    .me-nick { display: none; } /* 좁은 화면에선 닉네임 숨겨 레이아웃 밀림 방지 */
}
.btn-write {
    background: #e0245e; color: #fff !important; padding: 6px 14px;
    border-radius: 999px; font-weight: 600;
}
.btn-write:hover { background: #c01e50; 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; }
.layout { display: flex; gap: 20px; align-items: flex-start; }
.main { flex: 1; min-width: 0; max-width: 660px; margin: 0 auto; }
.sidebar { width: 300px; flex-shrink: 0; }
@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; }
}

.site-footer { text-align: center; color: #aaa; font-size: 12px; padding: 32px 0; }

/* ---------- 패널 ---------- */
.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: #e0245e !important; color: #fff !important; border-color: #e0245e !important; }
.btn-msg:hover { background: #c01e50 !important; border-color: #c01e50 !important; color: #fff !important; }
.empty, .empty-feed { color: #999; text-align: center; padding: 24px 0; }

/* ---------- 알림 ---------- */
.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: linear-gradient(135deg, #e0245e, #f78fb3);
    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; }
.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; }

/* ---------- 툴팁 ---------- */
.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; }
.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; }
.attend-status { text-align: center; padding: 8px; border-radius: 8px; font-size: 14px; font-weight: 600; 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: space-around; gap: 6px;
    margin: 14px 0 6px; text-align: center;
}
.attend-medal { display: flex; flex-direction: column; align-items: center; gap: 3px; flex: 1; min-width: 0; }
.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;
}
.attend-medal:nth-child(2) .attend-img { border-color: #c4ccd4; }
.attend-medal:nth-child(3) .attend-img { 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-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 카드가 좁은 화면에서 넘치지 않게 단계별 축소 */
@media (max-width: 1000px) and (min-width: 901px) {
    .attend-img { width: 84px; height: 84px; }
}
@media (max-width: 480px) {
    .attend-img { width: 88px; height: 88px; }
    .attend-noimg { font-size: 30px; }
}
@media (max-width: 360px) {
    .attend-img { width: 74px; height: 74px; }
    .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); }

/* ---------- 인기/랭킹 ---------- */
.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: #e0245e; color: #fff; border-color: #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; }

/* 사이드바 랭킹 (작게) */
.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; }

/* 정렬 바 (카테고리) */
.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: #e0245e; color: #fff; border-color: #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]), textarea, select {
    width: 100%; padding: 10px 12px; border: 1px solid #ccd6dd;
    border-radius: 10px; font-size: 14px; font-family: inherit; background: #fff;
}
input:focus, textarea:focus, select:focus { outline: 2px solid #f5b5c8; border-color: #e0245e; }
.btn-primary {
    background: #e0245e; color: #fff; border: 0; border-radius: 999px;
    padding: 10px 24px; font-size: 15px; font-weight: 700; cursor: pointer; margin-top: 16px;
}
.btn-primary:hover { background: #c01e50; }
.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-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: center; margin: 8px 0; }
.inline-form input { width: auto; flex: 1; }

/* ---------- 인증 ---------- */
.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; }
.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; }

/* 인라인 삭제 폼 (링크처럼 보이는 버튼) */
.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: #e0245e; color: #fff; border-color: #e0245e; }
.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; }
.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; }
}

/* ---------- 레이지 로딩 ---------- */
.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: #e0245e; color: #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: #e0245e; color: #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: #e0245e; color: #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: #e0245e; border-color: #e0245e; color: #fff; }
html.dark .rc-item { border-bottom-color: #2f3640; }
html.dark .rc-item:hover { background: #2b3138; }
html.dark .rc-text { color: #c8ccd0; }
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; }
