/* 팬덤 플랫폼 스타일 */
* { 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: 52px;
}
.logo { font-weight: 800; font-size: 18px; color: #e0245e; white-space: nowrap; }
.logo:hover { text-decoration: none; }
.menu-nav { display: flex; gap: 4px; overflow-x: auto; flex: 1; }
.menu-nav a {
    padding: 6px 12px; border-radius: 999px; color: #444;
    white-space: nowrap; font-size: 14px;
}
.menu-nav a:hover { background: #f5d3de; text-decoration: none; }
.menu-nav a.active { background: #e0245e; color: #fff; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 12px; white-space: nowrap; font-size: 14px; }
.topbar-right a { color: #444; }
.me-nick { color: #888; font-size: 13px; }
.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) {
    .sidebar { display: none; }
}

.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; }
.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; }

/* 링크 미리보기 카드 */
.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; }

/* ---------- 인기/랭킹 ---------- */
.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; }
.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; }

/* 게시판 소개 섹션 */
.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; }

/* ---------- 관리자 ---------- */
.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; }
