/* Korea SNS — 앱 전역 스타일 (Bootstrap 5.3 호환)
   모던 · 심플 · 가독성 우선 디자인 */

/* Vue.js 템플릿 깜빡임(FOUC) 방지 — 마운트 전까지 숨김
   Hide Vue templates until app mounts to prevent mustache flash (FOUC) */
[v-cloak] { display: none !important; }

/* 전역 키보드 포커스 링 — 접근성을 위한 가시적 포커스 표시
   Global keyboard focus ring — visible focus indicator for a11y */
*:focus-visible {
    outline: 2px solid var(--color-accent, #4f46e5);
    outline-offset: 2px;
    border-radius: 2px;
}
/* 마우스 클릭에는 링 숨김 — Bootstrap 의도와 일치
   Hide ring on mouse click — matches Bootstrap's :focus-visible behavior */
*:focus:not(:focus-visible) {
    outline: none;
}

/* ═══════════════════════════════════════════
   CSS 변수 시스템
   ═══════════════════════════════════════════ */
:root {
    /* 색상 팔레트 */
    --color-bg: #fafbfc;
    --color-text: #1e293b;
    --color-text-secondary: #64748b;
    --color-text-muted: #94a3b8;
    --color-border: #e5e7eb;
    --color-border-light: #f1f5f9;
    --color-surface: #ffffff;
    --color-accent: #4f46e5;
    --color-accent-light: #eef2ff;
    --color-info: #0891b2;
    --color-success: #059669;
    --color-danger: #dc2626;
    --color-warning: #d97706;

    /* 레이아웃 */
    --sidebar-width: 260px;
    --topbar-height: 56px;
    --content-max-width: 1200px;
    --content-padding: 16px;

    /* 타이포그래피 스케일 (5단계) */
    --font-size-xs: 0.75rem;     /* 12px — 메타, 배지, 캡션, 날짜 */
    --font-size-sm: 0.875rem;    /* 14px — 본문 기본, 보조 텍스트 */
    --font-size-md: 1rem;        /* 16px — 섹션 제목, 중요 텍스트 */
    --font-size-lg: 1.125rem;    /* 18px — 페이지 소제목 */
    --font-size-xl: 1.5rem;      /* 24px — 페이지 제목, 히어로 */

    /* 폰트 굵기 */
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

    /* 라운드 — Bootstrap 기본값 수준으로 제한 */
    --radius-sm: 0.375rem;

    /* 전환 */
    --transition-fast: 0.15s ease;
    --transition-base: 0.2s ease;
}

/* ═══════════════════════════════════════════
   기본 리셋 & 타이포그래피
   ═══════════════════════════════════════════ */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans KR', sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { transition: color var(--transition-fast); }

/* ═══════════════════════════════════════════
   탑바
   ═══════════════════════════════════════════ */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #fff;
    border-bottom: 1px solid var(--color-border);
    height: var(--topbar-height);
}

.topbar-inner {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 0 var(--content-padding);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.topbar-logo {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--color-accent);
    text-decoration: none;
    letter-spacing: -0.5px;
    transition: opacity var(--transition-fast);
}
.topbar-logo:hover { opacity: 0.8; }

.topbar-nav {
    display: flex;
    align-items: center;
    gap: 2px;
}

.topbar-nav .btn-link {
    color: var(--color-text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 6px 12px;
    transition: color var(--transition-fast);
}
.topbar-nav .btn-link:hover {
    color: var(--color-accent);
}

/* ═══════════════════════════════════════════
   메인 콘텐츠
   ═══════════════════════════════════════════ */
.main-content {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 24px var(--content-padding);
}

/* 3컬럼 홈 레이아웃(.home-layout)을 포함한 .main-content 는
   좌우 padding 을 제거하여 탑바/메인 메뉴 container 의 경계(좌우 1200px 내부)와
   사이드바 좌우 경계가 일직선으로 정렬되도록 한다.
   모바일(≤992px)에서는 .home-layout 자체에 padding 을 복원한다. */
.main-content:has(.home-layout) {
    padding-left: 0;
    padding-right: 0;
}

/* ═══════════════════════════════════════════
   푸터
   ═══════════════════════════════════════════ */
.footer {
    text-align: center;
    padding: 32px var(--content-padding);
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

/* ─── 서브 사이트 푸터 (센터 스타일 3컬럼) ─── */
.site-footer {
    border-top: 1px solid var(--color-border-light);
    margin-top: 48px;
}

/* 상단 장식 라인 */
.site-footer-accent {
    height: 1px;
    background: var(--color-border);
    width: 100vw;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
}

/* 사이트 로고 배지 */
.site-footer-logo-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    font-size: 0.75rem;
    flex-shrink: 0;
}

/* 사이트 이름 */
.site-footer-title {
    color: var(--color-text-secondary);
    font-size: 0.88rem;
}

/* 사이트 정보 항목 */
.site-footer-info-items {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    line-height: 1.8;
}
.site-footer-info-items i {
    width: 14px;
    text-align: center;
    opacity: 0.6;
}

/* 섹션 제목 */
.site-footer-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-muted);
    letter-spacing: 0.03em;
    margin-bottom: 0.7rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--color-border-light);
}
.site-footer-section-title i {
    opacity: 0.4;
}

/* 링크 목록 */
.site-footer-links li {
    margin-bottom: 1px;
}
.site-footer-links a {
    display: flex;
    align-items: center;
    padding: 5px 6px;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color 0.15s ease;
}
.site-footer-links a:hover {
    color: var(--color-text);
}

/* 링크 아이콘 배지 */
.site-footer-link-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-right: 8px;
    font-size: 0.68rem;
    flex-shrink: 0;
    color: var(--color-text-muted);
}

/* 하단 바 */
.site-footer-bottom {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--color-border-light);
}

/* ═══════════════════════════════════════════
   메인 메뉴 (카테고리 네비게이션)
   ═══════════════════════════════════════════ */
.main-menu {
    background: #fff;
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: var(--topbar-height);
    z-index: 99;
}

.main-menu-inner {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 0 var(--content-padding);
    display: flex;
    align-items: center;
}

.main-menu-item { position: relative; }

.main-menu-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--color-text-secondary);
    text-decoration: none;
    padding: 10px 18px;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    transition: all var(--transition-fast);
    border-bottom: 2px solid transparent;
}

.main-menu-link:hover {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
}

.main-menu-link i:first-child {
    font-size: 0.8rem;
    width: 16px;
    text-align: center;
    opacity: 0.7;
}

.main-menu-arrow {
    font-size: 0.55rem;
    margin-left: 2px;
    opacity: 0.4;
    transition: transform var(--transition-base);
}

.main-menu-item:hover .main-menu-arrow { transform: rotate(180deg); }

/* 드롭다운 */
.main-menu-dropdown {
    position: absolute;
    left: 0;
    top: 100%;
    min-width: 200px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 6px;
    z-index: 1060;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-fast), visibility var(--transition-fast);
}

.main-menu-item:hover .main-menu-dropdown {
    opacity: 1;
    visibility: visible;
}

.main-menu-dropdown-link {
    display: flex;
    align-items: center;
    color: var(--color-text-secondary);
    text-decoration: none;
    padding: 9px 14px;
    font-size: 0.875rem;
    transition: color var(--transition-fast);
    white-space: nowrap;
}

.main-menu-dropdown-link:hover {
    color: var(--color-accent);
}

/* 반응형: 모바일에서 메인 메뉴 숨김 */
@media (max-width: 768px) {
    .main-menu { display: none; }
}

/* ═══════════════════════════════════════════
   서브사이트 상단 — 센터 스타일 (헤더/탑바/메뉴/모바일)
   ═══════════════════════════════════════════ */

/* ─── 사이트 레이아웃 중앙 정렬 통일 ─── */
/* 모든 섹션의 .container max-width를 콘텐츠 영역과 동일하게 맞춤 */
.site-topbar > .container,
.site-topbar-header > .container,
.site-main-menu > .container,
.mobile-topbar > .container,
.mobile-site-header > .container,
.site-footer > .container {
    max-width: var(--content-max-width);
    padding-left: var(--content-padding);
    padding-right: var(--content-padding);
}

/* ─── 메인 메뉴 container 는 좌우 padding 제거 ───
   메뉴 아이템 간격은 각 아이템(.site-menu-link) 자체의 padding/margin 으로 유지된다.
   container 에까지 padding 을 주면 맨 왼쪽·맨 오른쪽 아이템의 박스 경계가
   탑바 container 경계(120/1320)와 사이드바 경계로부터 안쪽으로 밀려 이중 여백이
   누적된다.
   첫 번째 카테고리 링크의 바깥쪽 padding-left 와 마지막 메뉴 액션 아이콘의
   바깥쪽 padding-right 도 상쇄하여 맨 끝 아이템의 텍스트·아이콘이 탑바 경계에
   여백 없이 딱 붙도록 한다. 나머지 아이템의 padding(좌우 14px) 은 아이템 간
   간격과 클릭 영역 확보용으로 유지된다. */
.site-main-menu > .container {
    padding-left: 0;
    padding-right: 0;
}
.site-main-menu-row > .site-menu-items > .site-menu-item:first-child > .site-menu-link {
    padding-left: 0;
}
.site-main-menu-row > .site-menu-actions > .site-menu-link:last-child {
    padding-right: 0;
}

/* ─── 서브사이트 탑바 (맨 위, 네비게이션) ───
   탑바 ↔ 헤더(site-topbar-header) 사이를 매끄럽게 이어지게 하기 위해
   탑바 자체의 하단 가로 구분선(border-bottom)은 제거하고 헤더와 동일한 그라디언트 공유.
   단, container 둘레(좌/우 + 하단 라운드) 보더는 유지하여 탑바 박스 경계는 보이도록 한다. */
.site-topbar {
    font-size: 0.85rem;
    background: linear-gradient(135deg, #ffffff 0%, #fafbff 50%, #f5f7ff 100%);
}

/* 탑바 콘텐츠 영역 — 좌우 + 하단 보더(둥근 모서리)로 container 박스 경계를 표시.
   상단만 열려 있어 탑바 배경과 자연스럽게 이어진다. 색상은 약간 진한 슬레이트 톤. */
.site-topbar > .container {
    border-left: 1px solid rgba(148, 163, 184, 0.45);
    border-right: 1px solid rgba(148, 163, 184, 0.45);
    border-bottom: 1px solid rgba(148, 163, 184, 0.45);
    border-radius: 0 0 10px 10px;
}

/* ─── 서브사이트 탑바 헤더 (로고 + 검색 + 배너) ─── */
.site-topbar-header {
    background: linear-gradient(135deg, #ffffff 0%, #fafbff 50%, #f5f7ff 100%);
    border-bottom: 1px solid rgba(99, 102, 241, 0.18);
    padding: 20px 0;
    position: relative;
    z-index: 101;
}

/* 헤더 3컬럼 그리드: 사이드바 | 콘텐츠 | 사이드바
   - grid-template-columns 의 좌/우 240px 는 홈 레이아웃 사이드바(.home-sidebar) 폭과 동일.
   - padding 을 0 으로 두어야 좌/우 헤더 배너가 탑바 container 경계(120/1320) 및
     사이드바 좌우 경계와 완전 일직선으로 정렬된다. padding 을 주면 이중 여백 발생. */
.site-header-grid {
    display: grid;
    grid-template-columns: 240px 1fr 240px;
    gap: 20px;
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 0;
    align-items: center;
}

.site-header-logo-area {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    position: relative;
    z-index: 1;
}

/* 디자인 모드: 로고 설정 아이콘은 중앙 로고 행(.site-header-logo-row) 내에서 로고 바로 옆에 인라인 배치 */
.site-header-center .site-header-logo-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
}

.site-header-center #header-settings-app {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.site-header-banner-area {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 광고 모집 fallback — 실제 광고가 없는 자리에 은은하게 노출.
   실 콘텐츠를 방해하지 않도록 옅은 회색 + 1px dashed 로 미니멀하게 디자인,
   크기는 실 배너와 동일한 360×120 (3:1) 로 유지. */
/* Ad-recruit placeholder — low-contrast fallback shown in empty header cells.
   Neutral gray + dashed border keeps focus on real content; size stays at
   360×120 (3:1) to match the real header banner. */
.site-header-banner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    max-width: 360px;
    aspect-ratio: 3 / 1;
    padding: 0 14px;
    background: #f8fafc;
    color: #94a3b8;
    font-weight: 500;
    font-size: 0.82rem;
    letter-spacing: 0.3px;
    text-decoration: none;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    transition: color .15s ease, border-color .15s ease, background .15s ease;
}

.site-header-banner i { font-size: 0.9rem; opacity: 0.7; }

.site-header-banner:hover {
    color: #64748b;
    background: #f1f5f9;
    border-color: #94a3b8;
}

/* 포럼(카테고리) 대형 배너 — 정사각형 그리드, 컨테이너 너비에 맞게 자동 채움.
   모든 레이아웃(default/facebook/blog)에서 공통 사용하므로 전역 CSS 에 배치. */
/* Category (forum) large banners — square auto-fill grid, shared across
   default/facebook/blog layouts so the rules live in the global stylesheet. */
.category-banner-large-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 4px;
    padding-bottom: 8px;
    margin-bottom: 12px;
}
.category-banner-large-item {
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    display: block;
}
.category-banner-large-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 카테고리 배너 placeholder — 실배너가 부족한 자리에 은은한 회색 dashed UI 로 렌더. */
/* Category banner placeholder — low-contrast ad-recruit shown in empty grid cells. */
.category-banner-large-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    aspect-ratio: 1 / 1;
    padding: 8px;
    background: #f8fafc;
    color: #94a3b8;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    text-align: center;
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.2px;
    line-height: 1.2;
    text-decoration: none;
    transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.category-banner-large-placeholder i {
    font-size: 1.1rem;
    opacity: 0.7;
}
.category-banner-large-placeholder:hover {
    color: #64748b;
    background: #f1f5f9;
    border-color: #94a3b8;
}

.site-topbar-logo {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--color-text);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: -0.5px;
    transition: color var(--transition-fast);
}

.site-topbar-logo:hover {
    color: var(--color-accent);
}

/* 중앙 로고(텍스트 버전)는 그라데이션 텍스트로 시선을 끈다 — 이미지 로고에는 영향 없음 */
.site-topbar-logo-centered > span {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #ec4899 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
    font-size: 1.4rem;
    font-weight: 800;
    transition: opacity var(--transition-fast);
}

.site-topbar-logo-centered:hover > span {
    opacity: 0.85;
}

.site-topbar-logo-img {
    max-height: 80px;
    max-width: 100%;
    object-fit: contain;
}

.site-topbar-search {
    width: 100%;
    position: relative;
    max-width: 560px;
    margin: 0 auto;
}

/* 검색 input-group: pill 모양 + 보더 강조 (shadow 없음) */
.site-topbar-search .input-group {
    background: #ffffff;
    border-radius: 999px;
    border: 1.5px solid rgba(99, 102, 241, 0.22);
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.site-topbar-search .input-group:focus-within {
    border-color: rgba(99, 102, 241, 0.6);
}

.site-topbar-search .header-search-input {
    border: none;
    background: transparent;
    padding: 0.6rem 1.1rem;
    font-size: 0.95rem;
    color: var(--color-text);
    box-shadow: none !important;
}

.site-topbar-search .header-search-input:focus {
    background: transparent;
    box-shadow: none;
}

.site-topbar-search .header-search-input::placeholder {
    color: var(--color-text-muted);
    font-weight: 400;
}

/* 검색 버튼 — 흑백 + 덜 강조 톤. 주변 입력창과 자연스럽게 어우러지도록 연한 회색 배경 + 중간 회색 아이콘 사용. */
.site-topbar-search .input-group > .btn {
    border: none;
    background: #f3f4f6;
    color: #6b7280;
    padding: 0 1.25rem;
    font-weight: 500;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.site-topbar-search .input-group > .btn:hover {
    background: #e5e7eb;
    color: #374151;
}

.site-topbar-search .input-group > .btn:active {
    transform: scale(0.97);
}

.site-topbar-search .input-group > .btn i {
    font-size: 0.95rem;
}

/* ─── 라이브 검색 드롭다운 ─── */
.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--color-border, #e5e7eb);
    border-top: none;
    border-radius: 0 0 var(--radius-sm, 0.375rem) var(--radius-sm, 0.375rem);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 1050;
    max-height: 420px;
    overflow-y: auto;
}
.search-dropdown-item {
    display: block;
    padding: 10px 14px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid var(--color-border-light, #f1f5f9);
    transition: background 0.15s;
}
.search-dropdown-item:last-of-type {
    border-bottom: none;
}
.search-dropdown-item:hover {
    background: var(--color-accent-light, #eef2ff);
    text-decoration: none;
    color: inherit;
}
.search-dropdown-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text, #1e293b);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.search-dropdown-title em {
    font-style: normal;
    color: #4f46e5;
    text-decoration: underline;
}
.search-dropdown-content {
    font-size: 0.775rem;
    color: var(--color-text-muted, #94a3b8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.search-dropdown-content em {
    font-style: normal;
    color: #4f46e5;
}
.search-dropdown-empty {
    padding: 16px;
    text-align: center;
    color: var(--color-text-muted, #94a3b8);
    font-size: 0.85rem;
}
.search-dropdown-all {
    display: block;
    padding: 10px 14px;
    text-align: center;
    text-decoration: none;
    color: #4f46e5;
    font-size: 0.85rem;
    font-weight: 500;
    background: var(--color-bg, #fafbfc);
    border-top: 1px solid var(--color-border, #e5e7eb);
}
.search-dropdown-all:hover {
    background: var(--color-accent-light, #eef2ff);
    text-decoration: none;
}

/* ─── 탑바 링크 (공유) ─── */
.topbar-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    padding: 6px 14px;
    border-radius: 8px;
    position: relative;
    transition: color 0.2s ease, background-color 0.2s ease, transform 0.15s ease;
}

.topbar-link:hover {
    color: var(--color-accent);
    background-color: rgba(99, 102, 241, 0.06);
}

/* 호버 시 하단에서 살짝 올라오는 언더라인 액센트 */
.topbar-link::after {
    content: "";
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 2px;
    height: 2px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    border-radius: 2px;
    opacity: 0;
    transform: scaleX(0.4);
    transform-origin: center;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.topbar-link:hover::after {
    opacity: 1;
    transform: scaleX(1);
}

/* 탑바 첫/마지막 링크의 바깥쪽 padding 제거 — 콘텐츠 영역과 정렬 일치 */
.site-topbar nav:first-child .topbar-link:first-child { padding-left: 0; }
.site-topbar nav:last-child .topbar-link:last-child { padding-right: 0; }

.topbar-link i {
    font-size: 0.9rem;
}

/* 관리자 링크 */
.topbar-link-admin {
    color: var(--color-warning);
}

.topbar-link-admin:hover {
    color: #b45309;
}

/* 채팅 링크 + 배지 */
.topbar-chat-link {
    position: relative;
}

.topbar-chat-badge {
    position: absolute;
    top: 2px;
    right: -2px;
    font-size: 0.6rem;
    padding: 0.15em 0.4em;
    min-width: 1rem;
    line-height: 1;
}

/* 아이콘 전용 탑바 링크(.topbar-link, .mobile-topbar-icon) 안의 .nav-badge 를
   아이콘 우상단 모서리에 겹쳐 띄운다. 기본 인라인 배치(margin-left 6px)로는
   아이콘과 배지 사이에 빈 공간이 생겨 배지가 오른쪽으로 떠 보이는 문제가 있었다.

   Overlay .nav-badge on the top-right corner of the icon inside icon-only
   topbar links (.topbar-link / .mobile-topbar-icon). The default inline layout
   (margin-left: 6px) leaves empty space between the icon and the badge, making
   the badge appear to float to the right of the icon. */
.topbar-link,
.mobile-topbar-icon {
    position: relative;
}

/* 모바일 탑바 아이콘(.mobile-topbar-icon): 기본 24x24 터치 박스 */
.mobile-topbar-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 1rem;
    border-radius: 6px;
}

.mobile-topbar-icon:hover {
    color: var(--color-accent);
    background-color: rgba(99, 102, 241, 0.06);
}

/* 모바일 탑바 아바타 — 아이콘과 동일한 크기로 좌측 가장자리 여백 확보 */
.mobile-topbar-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 8px;
    margin: 4px 0;
    text-decoration: none;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.mobile-topbar-avatar:hover {
    background-color: rgba(99, 102, 241, 0.06);
}

/* 아바타 이미지 — 다른 탑바 아이콘들과 동일한 시각적 크기 */
.mobile-topbar-avatar-img {
    width: 20px;
    height: 20px;
    object-fit: cover;
    display: block;
}

/* 프로필 이미지 없을 때 이니셜 표시 */
.mobile-topbar-avatar-initial {
    width: 20px;
    height: 20px;
    background-color: var(--color-border, #e9ecef);
    color: var(--color-text-secondary, #6c757d);
    font-size: 10px;
    font-weight: 600;
}

.topbar-link .nav-badge,
.mobile-topbar-icon .nav-badge {
    position: absolute !important;
    margin-left: 0 !important;
    min-width: 12px;
    height: 12px;
    padding: 0 2px;
    font-size: 0.5rem;
    line-height: 1;
    pointer-events: none;
    box-shadow: 0 0 0 1.5px var(--color-bg, #fff);
}

/* 모바일 탑바 배지: 더 작고 아이콘 우상단 코너 밖으로 오프셋하여 겹침 방지 */
.mobile-topbar-icon .nav-badge {
    min-width: 11px;
    height: 11px;
    padding: 0 2px;
    font-size: 0.45rem;
}

/* 데스크톱 탑바 아이콘(.topbar-link): padding 6px 16px → 아이콘 우측 가장자리가
   링크 오른쪽 끝에서 16px 떨어져 있다. translateX(50%) 와 결합해 center 를
   16px 지점에 맞춘다. */
.topbar-link .nav-badge {
    top: 2px;
    right: 16px;
    transform: translate(50%, -40%);
}

/* 모바일 탑바 아이콘 배지: 실제 우상단 코너 바깥으로 밀어내어
   아이콘 픽셀을 가리지 않고 확실히 top-right 에 떠 있게 한다 */
.mobile-topbar-icon .nav-badge {
    top: 6px;
    right: 6px;
    transform: translate(50%, -50%);
}

/* ─── 언어 선택 드롭다운 (탑바 국기) ─── */
.topbar-lang-dropdown {
    display: inline-flex;
    align-items: center;
    margin: 0 6px;
}

/* 탑바 국기 버튼: 배경/테두리 완전 제거 — 국기 이모지만 표시 */
.topbar-lang-btn {
    all: unset;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    cursor: pointer;
}

.topbar-lang-btn:hover,
.topbar-lang-btn:active,
.topbar-lang-btn.show {
    background: none !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

/* 포커스: 마우스는 링 없음, 키보드는 전역 :focus-visible 규칙 적용
   Focus: no ring on mouse, keyboard uses global :focus-visible rule */
.topbar-lang-btn:focus:not(:focus-visible) {
    background: none !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.topbar-lang-btn::after {
    display: none;
}

/* 국기 이모지: 호버 시 살짝 커짐 */
.topbar-lang-flag {
    font-size: 1.4rem;
    line-height: 1;
    display: block;
    transition: transform 0.15s ease;
}

.topbar-lang-btn:hover .topbar-lang-flag {
    transform: scale(1.12);
}

/* 공용 드롭다운의 국기 스타일 (footer/sidebar language-selector 등) */
.lang-flag {
    font-size: 1.1rem;
    line-height: 1;
    display: inline-block;
}

/* 탑바 언어 드롭다운 메뉴 */
.topbar-lang-menu {
    min-width: 170px;
    margin-top: 8px !important;
    padding: 6px !important;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    background-color: #ffffff;
}

.topbar-lang-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    font-size: 0.875rem;
    color: var(--color-text);
    transition: background-color 0.15s ease, color 0.15s ease;
}

.topbar-lang-menu .dropdown-item:hover {
    background-color: var(--color-accent-light);
    color: var(--color-accent);
}

.topbar-lang-menu .dropdown-item.active {
    background-color: var(--color-accent-light);
    color: var(--color-accent);
    font-weight: 600;
}

.topbar-lang-menu .dropdown-item .lang-flag {
    font-size: 1.2rem;
}

/* ─── 서브사이트 메인 메뉴 ─── */
.site-main-menu {
    width: 100vw;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    border-bottom: 1px solid rgba(99, 102, 241, 0.18);
    background: #ffffff;
    z-index: 100;
}

/* 메인 메뉴 행: 인라인 카테고리 + 오버플로우 더보기 + 우측 액션 */
.site-main-menu {
    position: relative;
}

.site-main-menu-row {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 0;
}

/* 인라인 카테고리 영역 — 한 줄로 유지, 넘치면 JS로 숨김.
   overflow: visible로 설정하여 2차 카테고리 드롭다운이 정상 표시되도록 함.
   오버플로우 감지는 JS에서 아이템 위치 기반으로 처리. */
.site-menu-items {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    column-gap: 2px;
    overflow: visible;
}

.site-menu-item.is-hidden {
    display: none !important;
}

/* 오버플로우 "더보기" 버튼 */
.site-browse {
    flex: 0 0 auto;
    position: relative;
}
.site-browse[hidden] { display: none; }

.site-browse-more {
    cursor: pointer;
    background: transparent;
    border: none;
    font-weight: 600;
    color: var(--color-text-secondary);
}
.site-browse.is-open .site-browse-more,
.site-browse-more:hover {
    color: var(--color-accent);
    background-color: var(--color-surface);
}

.site-browse-chevron {
    transition: transform 0.2s ease;
}
.site-browse.is-open .site-browse-chevron {
    transform: rotate(180deg);
}

/* 우측 액션(피드/전체메뉴) */
.site-menu-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 2px;
    padding-left: 12px;
    margin-left: 8px;
    border-left: 1px solid var(--color-border);
}

/* ───── 메가 패널 (더보기 클릭/호버 시 열림) ───── */
.site-browse-panel {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 1070;
    animation: browsePanelIn 0.15s ease;
}

@keyframes browsePanelIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.site-browse-panel-inner {
    max-width: var(--content-max-width, 1200px);
    margin: 0 auto;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.14);
    padding: 12px 16px;
    max-height: 72vh;
    overflow-y: auto;
}

/* 신문식 컬럼 플로우: 각 카테고리가 자연스럽게 열에 흐르며 빈 공간이 없음 */
.site-browse-grid {
    column-count: 5;
    column-gap: 18px;
}
@media (max-width: 1100px) {
    .site-browse-grid { column-count: 4; }
}
@media (max-width: 900px) {
    .site-browse-grid { column-count: 3; }
}

.site-browse-col {
    display: inline-block;
    width: 100%;
    break-inside: avoid;
    page-break-inside: avoid;
    margin: 0 0 4px;
    padding: 0;
}
/* 자식 카테고리가 있는 항목만 추가 여백을 둬서 시각 그룹을 만든다 */
.site-browse-col:has(.site-browse-children) {
    margin-bottom: 10px;
}

.site-browse-parent {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 4px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-text);
    text-decoration: none;
    border-radius: 4px;
    line-height: 1.3;
    transition: color var(--transition-fast);
}
.site-browse-parent:hover {
    color: var(--color-accent);
}
.site-browse-parent i {
    width: 14px;
    text-align: center;
    font-size: 0.78rem;
    color: var(--color-accent);
}

.site-browse-children {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 2px;
}
.site-browse-child {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 4px 2px 16px;
    font-size: 0.78rem;
    color: var(--color-text-secondary);
    text-decoration: none;
    border-radius: 4px;
    line-height: 1.35;
    transition: color var(--transition-fast), background-color var(--transition-fast);
}
.site-browse-child:hover {
    color: var(--color-accent);
    background-color: var(--color-bg);
}
.site-browse-child i {
    width: 12px;
    text-align: center;
    font-size: 0.7rem;
}

/* depth 2 (level 3) — 메가 패널 내부에 한 단계 더 들여쓴 계층. */
.site-browse-grandchildren {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-left: 16px;
    border-left: 1px solid var(--color-border);
    padding-left: 6px;
    margin-bottom: 4px;
}
.site-browse-grandchild {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 4px 2px 12px;
    font-size: 0.74rem;
    color: var(--color-text-muted);
    text-decoration: none;
    border-radius: 4px;
    line-height: 1.35;
    transition: color var(--transition-fast), background-color var(--transition-fast);
}
.site-browse-grandchild:hover {
    color: var(--color-accent);
    background-color: var(--color-bg);
}
.site-browse-grandchild i {
    width: 12px;
    text-align: center;
    font-size: 0.65rem;
}

.site-menu-item {
    flex-shrink: 0;
    position: relative;
}

.site-menu-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    color: var(--color-text);
    text-decoration: none;
    padding: 12px 14px;
    min-height: 44px;
    font-size: 1.25rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    white-space: nowrap;
    border-radius: 0;
    transition: color var(--transition-fast), background-color var(--transition-fast);
}

/* 우측 액션의 피드 링크 — 카테고리보다 덜 강조 (작고 연한 색) */
.site-menu-actions .site-menu-feed {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--color-text-secondary);
    padding: 8px 10px;
    min-height: 0;
    letter-spacing: 0;
}
.site-menu-actions .site-menu-feed::after {
    display: none;
}
.site-menu-actions .site-menu-feed:hover {
    color: var(--color-text);
    background-color: transparent;
}

/* 활성 카테고리 — accent 색상 + 하단 2px 언더라인으로만 표시 (shadow 금지) */
.site-menu-item.is-active > .site-menu-link {
    color: var(--color-accent);
    font-weight: 600;
}
.site-menu-item.is-active > .site-menu-link::after {
    content: "";
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: -1px;
    height: 2px;
    background-color: var(--color-accent);
}

.site-menu-link:hover {
    color: var(--color-accent);
    background-color: transparent;
}

.site-menu-link:active {
    color: var(--color-accent);
}

/* 카테고리 드롭다운 쉐브론 — 호버 시 부드럽게 회전 */
.site-menu-chevron {
    font-size: 0.65rem;
    color: var(--color-text-muted);
    transition: transform var(--transition-fast), color var(--transition-fast);
}
.site-menu-item:hover .site-menu-chevron,
.site-menu-item.is-active > .site-menu-link .site-menu-chevron {
    color: var(--color-accent);
}
.site-menu-item:hover .site-menu-chevron {
    transform: rotate(180deg);
}

/* 2차 카테고리 드롭다운 */
.site-dropdown {
    position: absolute;
    left: 0;
    top: calc(100% + 2px);
    min-width: 200px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 6px 0;
    z-index: 1060;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.15s ease, visibility 0.15s ease, transform 0.15s ease;
}

.site-menu-item:hover .site-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.site-dropdown-link {
    display: flex;
    align-items: center;
    color: var(--color-text);
    text-decoration: none;
    padding: 9px 18px;
    min-height: 40px;
    font-size: 0.9375rem;
    font-weight: 400;
    transition: color 0.15s ease, background-color 0.15s ease;
    white-space: nowrap;
}

.site-dropdown-link:hover {
    color: var(--color-accent);
    background-color: var(--color-accent-light);
}

/* ─── 2-level cascade (depth-1 column + depth-2 column on hover) ─── */
/* UI spec: site-categories.md "Public topbar — cascading category menu". */
.site-dropdown-cascade { padding: 0; }
.site-dropdown-cascade .site-dropdown-col-l1 {
    padding: 8px 0;
    min-width: 200px;
}
.site-dropdown-cascade .site-dropdown-item {
    position: relative;
}
.site-dropdown-cascade .site-dropdown-item > .site-dropdown-link {
    padding-right: 28px;
}
.site-dropdown-branch {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7rem;
    opacity: 0.5;
}
.site-dropdown-cascade .site-dropdown-col-l2 {
    position: absolute;
    left: 100%;
    top: -8px;
    min-width: 200px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 8px 0;
    margin-left: 2px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.12s ease, visibility 0.12s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    z-index: 1061;
}
.site-dropdown-cascade .site-dropdown-item.has-children:hover > .site-dropdown-col-l2,
.site-dropdown-cascade .site-dropdown-item.has-children:focus-within > .site-dropdown-col-l2 {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.site-dropdown-cascade .site-dropdown-item.has-children:hover > .site-dropdown-link {
    background: var(--color-bg);
    color: var(--color-accent);
}

/* 드롭다운 구분선 */
.site-dropdown-divider {
    height: 1px;
    background: var(--color-border);
    margin: 8px 0;
}

/* 전체보기 링크 */
.site-dropdown-view-all {
    font-weight: 600;
    color: var(--color-accent) !important;
}

.site-dropdown-view-all:hover {
    opacity: 0.8;
}

/* 다열 레이아웃 (서브카테고리 개수에 따라) */
.site-dropdown.two-columns {
    display: flex;
    flex-wrap: wrap;
    min-width: 360px;
}
.site-dropdown.two-columns .site-dropdown-link { width: 50%; box-sizing: border-box; }

.site-dropdown.three-columns {
    display: flex;
    flex-wrap: wrap;
    min-width: 540px;
}
.site-dropdown.three-columns .site-dropdown-link { width: 33.333%; box-sizing: border-box; }

/* 메인 메뉴 오른쪽 메뉴 아이콘 */
.site-menu-icon {
    padding: 14px 12px;
    flex-shrink: 0;
}

/* 다열에서 구분선/전체보기는 전체 너비 */
.site-dropdown.two-columns .site-dropdown-divider,
.site-dropdown.three-columns .site-dropdown-divider,
.site-dropdown.two-columns .site-dropdown-view-all,
.site-dropdown.three-columns .site-dropdown-view-all {
    width: 100%;
}

/* ─── 모바일 헤더 (md 미만) ─── */
/* 모바일 탑바: 데스크톱과 동일한 텍스트 네비게이션 스타일 */
.mobile-topbar {
    font-size: 0.8rem;
}
.mobile-topbar > .container {
    border-left: 1px solid var(--color-border);
    border-right: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    border-radius: 0 0 6px 6px;
}
/* 모바일 탑바 내 nav 가로 스크롤 (좁은 화면에서 넘침 방지) */
.mobile-topbar-nav {
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    min-width: 0;
    flex: 1 1 0;
}
.mobile-topbar-nav::-webkit-scrollbar { display: none; }
/* 모바일 탑바 링크: 좁은 화면에서 패딩·폰트 축소 */
.mobile-topbar .topbar-link {
    padding: 4px 6px;
    font-size: 0.75rem;
}
/* 모바일 탑바 오른쪽 nav: 축소 방지 */
.mobile-topbar > .container > .d-flex > nav:last-child {
    flex-shrink: 0;
    white-space: nowrap;
}

/* 모바일 사이트 헤더: 로고 + 검색 (데스크톱 헤더와 동일한 구조) */
.mobile-site-header {
    border-bottom: 1px solid var(--color-border);
    padding: 12px 0;
}
.mobile-site-header-inner {
    display: flex;
    align-items: center;
    gap: 12px;
}
.mobile-site-logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.mobile-site-logo-img {
    max-height: 48px;
    max-width: 120px;
    object-fit: contain;
}
.mobile-site-logo-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}
.mobile-site-search {
    flex: 1;
    min-width: 0;
}

/* ═══════════════════════════════════════════
   오너 없음 안내 배너
   ═══════════════════════════════════════════ */
.no-owner-banner {
    border-bottom: 1px solid var(--color-border);
}

.no-owner-banner-inner {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 10px var(--content-padding);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.875rem;
    color: #92400e;
}

.no-owner-banner-inner i { font-size: 1rem; flex-shrink: 0; }
.no-owner-banner-inner .btn { flex-shrink: 0; margin-left: auto; }

/* ═══════════════════════════════════════════
   3컬럼 위젯 레이아웃
   ═══════════════════════════════════════════ */
.home-layout {
    display: grid;
    grid-template-columns: 240px 1fr 240px;
    gap: 20px;
    max-width: var(--content-max-width);
    margin: 0 auto;
}
/* 사이드바 위젯이 비어 있는 경우 중앙 콘텐츠가 그 영역까지 확장 (뷰 모드 전용) */
.home-layout--no-left { grid-template-columns: 1fr 240px; }
.home-layout--no-right { grid-template-columns: 240px 1fr; }
.home-layout--no-left.home-layout--no-right { grid-template-columns: 1fr; }
.home-sidebar { min-width: 0; overflow: hidden; }
.home-center { min-width: 0; }

/* 사이드바 내 위젯 오버플로우 방지 — 단, 바로가기 위젯은 ADMIN 섹션이 높이를 가변적으로 차지하므로 예외.
   Sidebar widgets clip overflow — except the quick-menu widget, whose ADMIN section grows vertically and must not be cut off. */
.home-sidebar .widget { overflow: hidden; }
.home-sidebar .widget-quick-menu { overflow: visible; }
.home-sidebar .recent-posts-tabs-grid { grid-template-columns: 1fr; }

/* 반응형 */
@media (max-width: 992px) {
    /* 단일 컬럼으로 스택될 때는 .main-content padding 제거 효과를 상쇄하기 위해
       .home-layout 자체에 좌우 여백을 부여한다. */
    .home-layout { grid-template-columns: 1fr; gap: 16px; padding-left: var(--content-padding); padding-right: var(--content-padding); }
    .home-sidebar { order: 1; }
    .home-center { order: 0; }
    /* 헤더: 3컬럼 유지하되 검색바 축소 허용 */
    .site-header-grid { grid-template-columns: auto 1fr auto; gap: 12px; }
}
@media (max-width: 767px) {
    .site-header-grid { grid-template-columns: 1fr; gap: 12px; }
    .site-header-banner-area { display: none; }
}

/* ═══════════════════════════════════════════
   위젯 시스템 — 플랫 디자인 (border + 타이포그래피)
   ═══════════════════════════════════════════ */
.widget-wrapper { margin-bottom: 16px; position: relative; }

.widget {
    background-color: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 16px;
}

/* 위젯 타이틀 */
.widget-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.widget-title i {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    flex-shrink: 0;
}

/* ─── /recent-posts · /recent-comments · /recent-photos 공통 래퍼 ─── */
.recent-list-page {
    background: #fff;
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 0.75rem;
    overflow: hidden;
    margin-bottom: 1rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.recent-list-header {
    padding: 20px 24px 0;
    border-bottom: 1px solid var(--color-border, #e2e8f0);
    background: linear-gradient(180deg, #fafbfc 0%, #ffffff 100%);
}
.recent-list-header-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.recent-list-title {
    font-size: 1.35rem;
    font-weight: 800;
    margin: 0;
    color: #0f172a;
    letter-spacing: -0.01em;
}
.recent-list-title i {
    color: var(--bs-primary, #3b82f6);
    margin-right: 8px;
    font-size: 1.1rem;
}
.recent-list-count-badge {
    font-size: 0.78rem;
    font-weight: 600;
    color: #64748b;
    background: #f1f5f9;
    padding: 3px 10px;
    border-radius: 999px;
}
.recent-list-tabs { display: flex; gap: 4px; padding-top: 2px; }
.recent-list-tab {
    padding: 10px 18px;
    color: #64748b;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.88rem;
    border-bottom: 2px solid transparent;
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.recent-list-tab:hover { color: var(--bs-primary, #3b82f6); background: #f8fafc; }
.recent-list-tab.active {
    color: var(--bs-primary, #3b82f6);
    border-bottom-color: var(--bs-primary, #3b82f6);
    font-weight: 700;
}
.recent-list-tab i { margin-right: 6px; }
.recent-list-empty {
    text-align: center;
    padding: 80px 20px;
    color: #94a3b8;
}
.recent-list-empty i { font-size: 3rem; margin-bottom: 14px; color: #cbd5e1; }
.recent-list-empty p { margin: 0; font-size: 0.95rem; }

/* ─── /recent-posts — 카드형 글 아이템 ─── */
.recent-post-list { padding: 6px 0; }
.recent-post-item {
    display: flex;
    gap: 14px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--color-border-light, #f1f5f9);
    color: inherit;
    text-decoration: none;
    transition: background 0.15s;
}
.recent-post-item:last-child { border-bottom: none; }
.recent-post-item:hover { background: #f8fafc; color: inherit; }
.recent-post-thumb {
    width: 72px; height: 72px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: #f1f5f9;
}
.recent-post-body { flex: 1; min-width: 0; }
.recent-post-title {
    font-size: 0.98rem;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.4;
    margin: 0 0 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.recent-post-item:hover .recent-post-title { color: var(--bs-primary, #3b82f6); }
.recent-post-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.78rem;
    color: #64748b;
}
.recent-post-meta .meta-author {
    color: var(--bs-primary, #3b82f6);
    font-weight: 500;
    text-decoration: none;
}
.recent-post-meta .meta-author:hover { text-decoration: underline; }
.recent-post-meta .meta-sep { color: #cbd5e1; }
.recent-post-meta .meta-stat i { margin-right: 3px; color: #94a3b8; }

/* ─── /recent-comments — 카드형 댓글 아이템 ─── */
.recent-comments-list { padding: 6px 0; list-style: none; margin: 0; }
.recent-comment-item {
    display: flex;
    gap: 14px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--color-border-light, #f1f5f9);
    transition: background 0.15s;
}
.recent-comment-item:last-child { border-bottom: none; }
.recent-comment-item:hover { background: #f8fafc; }
.recent-comment-avatar {
    width: 42px; height: 42px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.recent-comment-avatar-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    color: #64748b;
    font-size: 1.05rem;
}
.recent-comment-body { flex: 1; min-width: 0; }
.recent-comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    margin-bottom: 4px;
}
.recent-comment-author {
    color: #0f172a;
    font-weight: 700;
    text-decoration: none;
    font-size: 0.88rem;
}
.recent-comment-author:hover { color: var(--bs-primary, #3b82f6); }
.recent-comment-date { color: #94a3b8; font-size: 0.78rem; }
.recent-comment-content-link { color: inherit; text-decoration: none; display: block; }
.recent-comment-content {
    font-size: 0.93rem;
    line-height: 1.55;
    color: #1e293b;
    word-break: break-word;
}
.recent-comment-post-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 8px;
    padding: 4px 10px;
    background: #f1f5f9;
    border-radius: 999px;
    font-size: 0.76rem;
    color: #64748b;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}
.recent-comment-post-chip i { font-size: 0.72rem; color: #94a3b8; }
.recent-comment-content-link:hover .recent-comment-post-chip {
    background: #e0eaff;
    color: var(--bs-primary, #3b82f6);
}
.recent-comment-content-link:hover .recent-comment-post-chip i { color: var(--bs-primary, #3b82f6); }

/* ─── /recent-photos · /user/photos — 그리드 + hover 오버레이 ─── */
.recent-photo-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    padding: 16px 20px 20px;
}
.recent-photo-cell {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 8px;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    display: block;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}
.recent-photo-cell:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.12);
}
.recent-photo-cell img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.recent-photo-cell:hover img { transform: scale(1.06); }
.recent-photo-overlay {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 24px 10px 8px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0) 0%, rgba(15, 23, 42, 0.78) 100%);
    color: #fff;
    font-size: 0.78rem;
    line-height: 1.35;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}
.recent-photo-cell:hover .recent-photo-overlay { opacity: 1; }
.recent-photo-overlay .photo-title {
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.recent-photo-overlay .photo-author {
    margin-top: 2px;
    font-size: 0.72rem;
    opacity: 0.85;
}

@media (max-width: 992px) {
    .recent-photo-grid { grid-template-columns: repeat(4, 1fr); }
    .recent-post-item { padding: 14px 16px; }
    .recent-comment-item { padding: 14px 16px; }
}
@media (max-width: 576px) {
    .recent-photo-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 12px; }
    .recent-list-header { padding: 16px 16px 0; }
    .recent-post-thumb { width: 60px; height: 60px; }
}

/* 위젯 타이틀 우측 "더보기" 링크 — 모든 리스트형 위젯이 공유 */
.widget-title-more {
    margin-left: auto;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--color-text-muted);
    text-transform: none;
    letter-spacing: 0;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
    transition: color var(--transition-fast);
}
.widget-title-more:hover { color: var(--color-accent); }
.widget-title-more i {
    font-size: 0.6rem;
    color: inherit;
}

/* 위젯 리스트 */
.widget-list-item {
    border-bottom: 1px solid var(--color-border-light);
}
.widget-list-item:last-child { border-bottom: none; }

.widget-list-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.825rem;
    transition: color var(--transition-fast);
}
.widget-list-link:hover { color: var(--color-accent); }

.widget-list-title {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 450;
}

.widget-list-meta {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
}

/* ─── 위젯: 활동/좋아요 랭킹 (주/월 내부 탭) ─── */
.widget-activity-ranking__metric-label {
    float: right;
    font-size: 0.68rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    background: var(--color-border-light);
    color: var(--color-text-muted);
    letter-spacing: 0.2px;
    line-height: 1.4;
}
.widget-activity-ranking--likes .widget-activity-ranking__metric-label {
    background: #ffe4e8;
    color: #d63956;
}
.widget-activity-ranking__tabs {
    gap: 4px;
    margin-bottom: 10px;
    padding: 3px;
    background: var(--color-border-light);
    border-radius: 8px;
    flex-wrap: nowrap;
}
.widget-activity-ranking__tabs .nav-item { flex: 1; }
.widget-activity-ranking__tabs .nav-link {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 5px 12px;
    color: var(--color-text-muted);
    border-radius: 6px;
    background: transparent;
    border: none;
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.widget-activity-ranking__tabs .nav-link i { font-size: 0.72rem; }
.widget-activity-ranking__tabs .nav-link:hover { color: var(--color-text); }
.widget-activity-ranking__tabs .nav-link.active {
    background: #fff;
    color: var(--color-accent);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.widget-activity-ranking__content { min-height: 120px; }
.widget-empty-sm {
    padding: 20px 8px;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.82rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.widget-empty-sm i { font-size: 1.4rem; opacity: 0.5; }
.widget-activity-ranking__list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.widget-activity-ranking__item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 2px;
    border-bottom: 1px solid var(--color-border-light);
}
.widget-activity-ranking__item:last-child { border-bottom: none; }
.widget-activity-ranking__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.widget-activity-ranking__name {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--color-text);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.widget-activity-ranking__name:hover { color: var(--color-accent); }
.widget-activity-ranking__breakdown {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    display: inline-flex;
    gap: 8px;
    align-items: center;
}
.widget-activity-ranking__breakdown i {
    font-size: 0.65rem;
    margin-right: 2px;
}
.widget-activity-ranking__value {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--color-accent);
    flex-shrink: 0;
    min-width: 36px;
    text-align: right;
}

/* ─── 위젯: 회원 랭킹 (5축 실시간) ─── */
.widget-user-ranking__current {
    font-size: 0.72rem;
    color: var(--color-text-muted);
    font-weight: 500;
    float: right;
}
.widget-user-ranking__current i { margin-right: 3px; }
.widget-user-ranking__list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.widget-user-ranking__item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 2px;
    border-bottom: 1px solid var(--color-border-light);
}
.widget-user-ranking__item:last-child { border-bottom: none; }
.widget-user-ranking__name {
    flex: 1;
    min-width: 0;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--color-text);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.widget-user-ranking__name:hover { color: var(--color-accent); }
.widget-user-ranking__value {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-accent);
    flex-shrink: 0;
}

/* 위젯 목록 — 글/댓글 앞 작성자 아바타 (공용 스타일) */
.widget-feed-avatar,
.widget-list-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.widget-feed-avatar-placeholder,
.widget-list-avatar-placeholder {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--color-border-light);
    color: var(--color-text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    flex-shrink: 0;
}

/* ─── 위젯: 통계 ─── */
.widget-stats .stats-grid {
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: 8px 0 4px;
    gap: 4px;
}

.widget-stats .stat-item {
    flex: 1;
    text-align: center;
    padding: 6px 4px;
    border-radius: 8px;
    transition: background-color var(--transition-fast);
}

.widget-stats .stat-item:hover {
    background: rgba(0, 0, 0, 0.03);
}

.widget-stats .stat-divider {
    width: 1px;
    align-self: center;
    height: 36px;
    background: var(--color-border-light);
}

.widget-stats .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 4px;
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}

.widget-stats .stat-label {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    font-weight: 500;
    letter-spacing: 0.2px;
}

/* ─── 위젯: 날씨 ─── */
/* 배경 그라디언트·전경색·보조 텍스트 색은 --weather-* CSS 변수로 제어한다
   (widgets/weather.php 가 App\Support\Weather::theme() 결과를 inline style 로 주입).
   변수가 없는 기본 상태에서는 기존 카드 배경을 유지한다. */
.widget-weather {
    padding: 12px;
    background: var(--weather-bg, transparent);
    color: var(--weather-text, inherit);
    transition: background 0.4s ease, color 0.4s ease;
    position: relative;
}
.widget-weather .widget-title {
    margin-bottom: 6px;
    color: var(--weather-text, inherit);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.widget-weather .widget-title > span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}
.widget-weather .weather-detail-link {
    color: var(--weather-muted, var(--color-text-muted));
    font-size: 0.9rem;
    padding: 4px 6px;
    border-radius: 6px;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
    line-height: 1;
    flex-shrink: 0;
}
.widget-weather .weather-detail-link:hover,
.widget-weather .weather-detail-link:focus-visible {
    background-color: rgba(255, 255, 255, 0.18);
    color: var(--weather-text, inherit);
    outline: none;
}
.widget-weather .weather-card {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 16px 0 20px;
}

.widget-weather .weather-icon {
    font-size: 2.2rem;
    flex-shrink: 0;
    opacity: 0.9;
    color: var(--weather-text, inherit);
}

.widget-weather .weather-info {
    min-width: 0;
}

.widget-weather .weather-temp {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -1px;
    color: var(--weather-text, inherit);
}

.widget-weather .weather-temp small {
    font-size: 0.75rem;
    font-weight: 600;
    opacity: 0.8;
    vertical-align: super;
    margin-left: 1px;
}

.widget-weather .weather-label {
    font-size: 0.72rem;
    color: var(--weather-muted, var(--color-text-muted));
    margin-top: 2px;
}

.widget-weather .weather-details {
    display: flex;
    gap: 14px;
    justify-content: center;
    font-size: 0.72rem;
    color: var(--weather-muted, var(--color-text-secondary));
    padding-top: 8px;
    margin-top: 2px;
}

.widget-weather .weather-details i {
    margin-right: 3px;
    opacity: 0.75;
}

/* ─── 위젯: 환율 ─── */
.widget-currency .currency-table {
    width: 100%;
    font-size: 0.8rem;
    border-collapse: separate;
    border-spacing: 0;
}

.widget-currency .currency-table thead th {
    color: var(--color-text-muted);
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 0 8px;
    border-bottom: 2px solid var(--color-border);
}

.widget-currency .currency-table tbody td {
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border-light);
    vertical-align: middle;
}

.widget-currency .currency-table tbody tr:last-child td {
    border-bottom: none;
}

.widget-currency .currency-code {
    font-weight: 600;
    color: var(--color-text);
}

.widget-currency .currency-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    color: var(--color-text-secondary);
    font-size: 0.65rem;
    margin-right: 6px;
    flex-shrink: 0;
}

.widget-currency .currency-rate {
    text-align: right;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.widget-currency .currency-change {
    text-align: right;
    font-size: 0.72rem;
    font-weight: 500;
}
.widget-currency .currency-change.up { color: var(--color-success); }
.widget-currency .currency-change.down { color: var(--color-danger); }
.widget-currency .currency-change.flat { color: var(--color-text-muted); }

.widget-currency .currency-footer {
    margin-top: 8px;
    font-size: 0.7rem;
    color: var(--color-text-muted);
    text-align: right;
}

/* ─── 위젯: 로그인 ─── */
.widget-login .user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.widget-login .user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--color-border);
}

.widget-login .user-avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    font-size: 0.85rem;
    flex-shrink: 0;
}

.widget-login .user-name {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.3;
}

.widget-login .user-email {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* ─── 위젯: 퀵 메뉴 (아이콘 그리드) ─── */
.widget-quick-menu .widget-title {
    margin-bottom: 8px;
}

.widget-quick-menu .qm-grid {
    /* 4컬럼 그리드 — 240px 사이드바에서 한 셀 ≈ 50px. 라벨 폰트를 더 작게 유지해 2줄 줄바꿈 허용. */
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px 4px;
}

.widget-quick-menu .qm-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    gap: 3px;
    min-width: 0;
    transition: opacity var(--transition-fast);
}

.widget-quick-menu .qm-item:hover {
    opacity: 0.7;
}

.widget-quick-menu .qm-icon {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.widget-quick-menu .qm-label {
    font-size: 0.58rem;
    font-weight: 500;
    color: var(--color-text);
    text-align: center;
    line-height: 1.15;
    word-break: keep-all;
}

/* ─── 위젯: 인기 글 순위 배지 ─── */
.widget-popular-posts .rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: 700;
    flex-shrink: 0;
    color: #fff;
}
.widget-popular-posts .rank-badge.rank-1 { background: #d97706; }
.widget-popular-posts .rank-badge.rank-2 { background: #64748b; }
.widget-popular-posts .rank-badge.rank-3 { background: #92400e; }
.widget-popular-posts .rank-badge.rank-default { background: var(--color-text-muted); }

/* 인기 글 위젯 — 행 간격과 가독성을 사이드바 다른 위젯보다 여유롭게 */
.widget-popular-posts .widget-list-link {
    padding: 11px 2px;
    gap: 10px;
    font-size: 0.88rem;
}
.widget-popular-posts .widget-list-title {
    line-height: 1.4;
}

/* 인기 글 항목의 댓글·좋아요 meta */
.widget-popular-posts .widget-list-meta { gap: 8px; }
.widget-list-meta__item {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.widget-list-meta__item i {
    font-size: 0.72rem;
    opacity: 0.75;
}

/* ─── 위젯: 카테고리 별 최근 글 (중앙 컬럼 - 탭 레이아웃) ─── */

/* 카테고리 탭 스크롤 래퍼 / Category tabs scroll wrapper */
.category-tabs-wrapper {
    position: relative;
    display: flex;
    align-items: stretch;
}
.tabs-scroll-btn {
    position: absolute;
    top: 0;
    bottom: 2px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    border: none;
    cursor: pointer;
    font-size: 0.7rem;
    color: var(--color-text-muted);
    transition: color 0.15s;
}
.tabs-scroll-btn:hover {
    color: var(--color-accent);
}
.tabs-scroll-left {
    left: 0;
    background: linear-gradient(to right, var(--color-surface, #fff) 60%, transparent);
    padding-right: 6px;
}
.tabs-scroll-right {
    right: 0;
    background: linear-gradient(to left, var(--color-surface, #fff) 60%, transparent);
    padding-left: 6px;
}

/* 카테고리 탭 / Category tabs */
.widget-category-posts .category-tabs {
    border-bottom: 2px solid var(--color-border-light);
    gap: 0;
    margin-bottom: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    flex: 1 1 auto;
    min-width: 0;
}
.widget-category-posts .category-tabs::-webkit-scrollbar { display: none; }
.widget-category-posts .category-tabs .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    padding: 8px 14px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text-muted);
    background: none;
    white-space: nowrap;
    transition: all var(--transition-fast);
}
.widget-category-posts .category-tabs .nav-link:hover {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent-light);
}
.widget-category-posts .category-tabs .nav-link.active {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
    background: none;
}

/* 탭 콘텐츠 */
.widget-category-posts .category-tab-content {
    padding-top: 6px;
}

/* 남은 글 수 힌트 / Remaining posts hint (bottom of active tab) */
.widget-category-posts .category-tab-footer {
    padding: 10px 0 2px;
}
.widget-category-posts .more-posts-hint {
    font-size: 0.78rem;
    color: var(--color-text-muted);
}

.widget-category-posts .post-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--color-border-light);
    text-decoration: none;
    color: var(--color-text);
    transition: color var(--transition-fast), background-color var(--transition-fast);
}
.widget-category-posts .post-item:last-child { border-bottom: none; }
.widget-category-posts .post-item:hover { color: var(--color-accent); }
.widget-category-posts .post-main {
    min-width: 0;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.widget-category-posts .post-main .post-title {
    flex: 1;
    min-width: 0;
}

.widget-category-posts .post-title {
    font-size: 0.94rem;
    font-weight: normal;
    line-height: 1.35;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.widget-category-posts .post-meta {
    font-size: 0.76rem;
    color: var(--color-text-muted);
}

.widget-category-posts .post-stats {
    display: flex;
    gap: 9px;
    align-items: center;
    flex-shrink: 0;
    min-width: max-content;
    padding-top: 3px;
}
.widget-category-posts .badge-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    font-size: 0.74rem;
    font-weight: 700;
    color: #fff;
    background: var(--color-accent);
    border-radius: 999px;
}
.widget-category-posts .badge-views {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    font-size: 0.76rem;
    font-weight: 500;
    color: var(--color-text-muted);
}
.widget-category-posts .badge-views i {
    font-size: 0.84rem;
}

.widget-category-posts .widget-empty-sm {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.85rem;
}
.widget-category-posts .widget-empty-sm i {
    font-size: 1.5rem;
    margin-bottom: 6px;
    color: var(--color-text-muted);
}

.home-sidebar .widget-category-posts {
    padding: 18px;
}

.home-sidebar .widget-category-posts .category-tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    gap: 0;
    border-bottom: 2px solid var(--color-border-light);
    padding-bottom: 0;
}
.home-sidebar .widget-category-posts .category-tabs::-webkit-scrollbar { display: none; }

.home-sidebar .widget-category-posts .category-tab-content {
    padding-top: 8px;
}

.home-sidebar .widget-category-posts .post-item {
    grid-template-columns: minmax(0, 1fr) 64px;
    gap: 10px;
}

.home-sidebar .widget-category-posts .post-title {
    font-size: 0.92rem;
}

.home-sidebar .widget-category-posts .post-stats {
    justify-content: flex-end;
}

@media (max-width: 575px) {
    .widget-category-posts .category-tabs .nav-link {
        padding: 8px 12px;
        font-size: 0.82rem;
    }

    .widget-category-posts .post-item {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px;
    }

    .widget-category-posts .post-title {
        font-size: 0.9rem;
    }
}

/* ─── 위젯: 최근 댓글 ─── */
/* 댓글 본문은 최대 2줄까지만 노출하여 사이드바가 길어지지 않도록 제한한다.
   Cap the comment body to 2 lines so the sidebar doesn't grow unbounded. */
.widget-recent-comments .widget-list-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
}
.widget-recent-comments .comment-meta {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    display: block;
    margin-top: 1px;
}

/* ─── 위젯: 빈 상태 ─── */
.widget-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px 8px;
    color: var(--color-text-muted);
    font-size: 0.8rem;
}
.widget-empty i {
    display: block;
    font-size: 1.5rem;
    margin-bottom: 6px;
    opacity: 0.4;
}

/* ─── 위젯: 최근 사진 그리드 ─── */
.widget-recent-photos .widget-photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}
.widget-recent-photos .widget-photo-cell {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 4px;
    background: var(--color-border-light, #f1f5f9);
    display: block;
    transition: transform 0.15s;
}
.widget-recent-photos .widget-photo-cell:hover { transform: translateY(-1px); }
.widget-recent-photos .widget-photo-cell img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.25s;
}
.widget-recent-photos .widget-photo-cell:hover img { transform: scale(1.06); }

/* ─── 위젯: 최근 알림 ─── */
/* 리스트 하단 여백을 한 단계 작게 — 기본 위젯 padding(16px) 대비 축소 */
.widget-recent-notifications {
    padding-bottom: 8px;
}
/* 읽지 않은 알림 항목의 배경을 위젯 좌우 패딩(16px) 밖까지 확장해
   라인 전체(위젯 edge to edge)를 덮도록 처리 */
.widget-notification-unread {
    background-color: rgba(var(--bs-primary-rgb, 13, 110, 253), 0.06);
    margin-left: -16px;
    margin-right: -16px;
    padding-left: 16px;
    padding-right: 16px;
    border-radius: 0;
}
.widget-recent-notifications .widget-list-link {
    gap: 6px;
}
.widget-more-link {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color var(--transition-fast);
}
.widget-more-link:hover {
    color: var(--color-accent);
}

/* ─── 위젯: 최근 글 탭 (2컬럼 카드) ─── */
.widget-recent-posts-tabs { padding: 0; border: none; background: transparent; box-shadow: none; }
.recent-posts-tabs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.recent-posts-tab-card {
    background: #fff;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    padding: 16px;
}
.tab-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.tab-card-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-text-primary, #1a1a1a);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}
.tab-card-title i {
    color: var(--color-primary, #007aff);
    font-size: 0.8rem;
}
.tab-card-more {
    font-size: 0.7rem;
    color: var(--color-primary, #007aff);
    text-decoration: none;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 3px;
}
.tab-card-more:hover { text-decoration: underline; }
.tab-card-more i { font-size: 0.55rem; }
.tab-card-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.tab-card-list li {
    border-bottom: 1px solid var(--color-border-light, #f0f0f0);
    padding: 0;
    position: relative;
}
.tab-card-list li:last-child { border-bottom: none; }
.tab-card-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 0;
    text-decoration: none;
    color: var(--color-text-primary, #333);
    font-size: 0.78rem;
    gap: 6px;
    position: relative;
}
.tab-card-link:hover { color: var(--color-primary, #007aff); }
.tab-card-post-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tab-card-badge {
    flex-shrink: 0;
    background: var(--color-primary, #007aff);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    border-radius: 6px;
    padding: 0 5px;
}
.tab-card-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px 8px;
    color: var(--color-text-muted, #999);
    font-size: 0.78rem;
}
.tab-card-empty i {
    font-size: 1.5rem;
    margin-bottom: 6px;
    color: var(--color-text-muted, #999);
}

/* 반응형: 작은 화면에서 1컬럼 */
@media (max-width: 575.98px) {
    .recent-posts-tabs-grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════
   디자인 모드 — 종료/레이아웃/팔레트를 하나의 통합 다크 카드로
   ═══════════════════════════════════════════ */
#sidebar-design-mode { margin-top: 0; padding-top: 12px; }

/* ═══════════════════════════════════════════
   site-home.php 디자인 모드 — 컴팩트 통합 카드
   ═══════════════════════════════════════════ */
#site-home-design { padding-top: 0; }

.design-mode-toggle-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 6px 10px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e5e7eb;
    border-bottom: none;
    border-radius: 10px 10px 0 0;
}
.design-mode-toggle-bar .btn-danger.btn-sm {
    font-size: 0.78rem;
    padding: 3px 10px;
    line-height: 1.4;
    font-weight: 600;
    border-radius: 6px;
}

.widget-palette {
    margin: 0 0 10px;
    padding: 6px 10px 8px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.04);
}
.widget-palette h6 {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #475569;
    font-size: 0.72rem;
    font-weight: 600;
    margin: 0 0 6px;
}
.widget-palette h6 i { color: #6366f1; font-size: 0.85rem; }

/* 컴팩트 위젯 버튼 스케일 (site-home 전용 오버라이드) */
.widget-palette .widget-palette-grid { gap: 4px; }
.widget-palette .widget-palette-item {
    padding: 3px 8px;
    gap: 5px;
    border-radius: 6px;
}
.widget-palette .widget-palette-icon { font-size: 0.76rem; width: 13px; }
.widget-palette .widget-palette-label { font-size: 0.72rem; }

/* 레이아웃 픽커 컴팩트 */
#site-home-design .design-mode-layout-picker {
    padding: 2px 8px 2px 10px;
    gap: 6px;
}
#site-home-design .design-mode-layout-label { font-size: 0.72rem; }
#site-home-design .design-mode-layout-picker .btn-group .btn {
    font-size: 0.72rem;
    padding: 2px 9px;
}

@media (max-width: 992px) {
    .design-mode-toggle-bar { padding: 5px 8px; gap: 6px; border-radius: 8px 8px 0 0; }
    .widget-palette { padding: 5px 8px 7px; margin: 0 0 8px; border-radius: 0 0 8px 8px; }
    .widget-palette .widget-palette-item { padding: 3px 7px; }
    .widget-palette .widget-palette-label { font-size: 0.7rem; }
}

.design-mode-card {
    max-width: 1200px;
    margin: 0 auto 16px;
    background: #ffffff;
    color: #1f2937;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
}

/* 카드 상단: 종료 + 레이아웃 선택 + 저장 상태 */
.design-mode-card-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 16px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e5e7eb;
}
.design-mode-exit-btn {
    font-size: 0.8125rem;
    padding: 6px 14px;
    line-height: 1.4;
    font-weight: 600;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(220, 38, 38, 0.18);
}

.design-mode-layout-picker {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 4px 12px 4px 14px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.design-mode-layout-label {
    color: #475569;
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
}
.design-mode-layout-label i { margin-right: 4px; color: #6366f1; }
.design-mode-layout-picker .btn-group { gap: 2px; }
.design-mode-layout-picker .btn-group .btn {
    font-size: 0.8125rem;
    padding: 4px 12px;
    line-height: 1.4;
    font-weight: 500;
    border-radius: 999px;
}
.design-mode-layout-picker .btn-group .btn-outline-secondary {
    border-color: transparent;
    color: #475569;
}
.design-mode-layout-picker .btn-group .btn-outline-secondary:hover {
    background: #eef2ff;
    color: #4338ca;
}

.design-mode-saving-note { color: #6b7280; font-size: 0.8125rem; display: inline-flex; align-items: center; gap: 6px; }
.design-mode-saved-note { color: #10b981; font-size: 0.8125rem; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }

/* 카드 하단: 팔레트 — 라벨 + 위젯 그리드가 한 줄로 이어짐 */
.design-mode-card-palette {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 16px;
    background: #ffffff;
}
.design-mode-card-palette-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #475569;
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}
.design-mode-card-palette-label i { color: #6366f1; font-size: 0.95rem; }

.widget-palette-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.widget-palette-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 6px 12px;
    cursor: grab;
    transition: all 150ms ease;
    user-select: none;
    line-height: 1.3;
    color: #1f2937;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.widget-palette-item:hover {
    background: #eef2ff;
    border-color: #6366f1;
    color: #4338ca;
    box-shadow: 0 3px 8px rgba(99, 102, 241, 0.18);
    transform: translateY(-1px);
}
.widget-palette-item:hover .widget-palette-icon { color: #4338ca; }
.widget-palette-item:active {
    cursor: grabbing;
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.widget-palette-icon {
    font-size: 0.875rem;
    width: 16px;
    text-align: center;
    color: #6366f1;
    flex-shrink: 0;
    transition: color 150ms ease;
}
.widget-palette-label {
    font-size: 0.8125rem;
    font-weight: 500;
    white-space: nowrap;
}

.design-drop-zone {
    border: 2px dashed #93c5fd;
    border-radius: var(--radius-sm);
    min-height: 100px;
    padding: 8px;
    transition: border-color var(--transition-fast);
}
.design-drop-zone.drag-over { border-color: #3b82f6; }

.drop-zone-label {
    font-size: 0.7rem;
    color: #93c5fd;
    font-weight: 600;
    text-align: center;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.drop-placeholder {
    text-align: center;
    padding: 32px 16px;
    color: var(--color-text-muted);
    font-size: 0.8rem;
    border: 1px dashed #cbd5e1;
    border-radius: var(--radius-sm);
}

.widget-wrapper.widget-dragging {
    cursor: grab;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    transition: border-color var(--transition-fast);
}
.widget-wrapper.widget-dragging:hover { border-color: #93c5fd; }
.widget-wrapper.widget-being-dragged { opacity: 0.4; }

.drag-insert-placeholder {
    border: 2px dashed #3b82f6;
    border-radius: var(--radius-sm);
    padding: 12px;
    text-align: center;
    color: #2563eb;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 12px;
    animation: placeholderPulse 1s ease-in-out infinite;
}
.drag-insert-placeholder i { margin-right: 4px; }
@keyframes placeholderPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }

.widget-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-bottom: 1px solid var(--color-border);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    font-size: 0.75rem;
}
.widget-drag-handle { cursor: grab; color: var(--color-accent); padding: 2px 4px; }
.widget-drag-handle:active { cursor: grabbing; }
.widget-type-badge { flex: 1; color: #4338ca; font-weight: 600; }
.widget-remove-btn { padding: 0 4px; font-size: 0.65rem; line-height: 1.2; }

/* 위젯 설정 버튼 */
.widget-settings-btn {
    padding: 0 5px;
    font-size: 0.7rem;
    line-height: 1.2;
    color: #fff;
    background: #6366f1;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.widget-settings-btn:hover { background: #4f46e5; color: #fff; }

/* 위젯 설정 드롭다운 */
.widget-settings-dropdown {
    padding: 12px;
    border-bottom: 1px solid var(--color-border);
    background: #f8fafc;
    font-size: 0.8rem;
}
.widget-settings-group { margin-bottom: 10px; }
.widget-settings-group:last-child { margin-bottom: 0; }
.widget-settings-label {
    display: block;
    font-weight: 600;
    font-size: 0.7rem;
    color: var(--color-text-secondary);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.widget-settings-dropdown .form-control-sm,
.widget-settings-dropdown .form-select-sm {
    font-size: 0.8rem;
    padding: 4px 8px;
}

/* 위젯 아이콘 선택 — 접이식 <details> 구조 */
.widget-icon-collapse {
    margin: 0;
}
.widget-icon-summary {
    cursor: pointer;
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 0;
    user-select: none;
    color: var(--color-text-secondary);
}
.widget-icon-summary::-webkit-details-marker { display: none; }
.widget-icon-summary::marker { content: ''; }
.widget-icon-summary::before {
    content: '\25B8';               /* ▸ — 접힘 상태 화살표 */
    display: inline-block;
    font-size: 0.65rem;
    transition: transform 0.15s ease;
    color: var(--color-text-muted);
    transform: translateY(-1px);
}
.widget-icon-collapse[open] > .widget-icon-summary::before {
    transform: rotate(90deg) translateX(-1px);  /* ▾ 펼침 */
}
.widget-icon-summary__hint {
    font-size: 0.65rem;
    font-weight: 400;
    color: var(--color-accent);
    text-transform: none;
    letter-spacing: 0;
}
.widget-icon-collapse[open] .widget-icon-summary__hint::after { content: attr(data-hide); }
.widget-icon-collapse:not([open]) .widget-icon-summary__hint::after { content: attr(data-show); }
.widget-icon-collapse > .widget-icon-grid {
    margin-top: 6px;
}
/* 브라우저 내장 `details > *:not(summary) { display:none }` 가
   .widget-icon-grid { display:grid } 에 덮여 무시되므로 명시적으로 되돌린다. */
.widget-icon-collapse:not([open]) > .widget-icon-grid {
    display: none !important;
}

/* 위젯 아이콘 선택 그리드 — 콤팩트: 24x24 박스, 그리드로 촘촘하게 */
.widget-icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 24px);
    gap: 3px;
    max-width: 240px;
}
.widget-icon-option {
    width: 24px;
    height: 24px;
    padding: 0;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--color-text-secondary);
    cursor: pointer;
    font-size: 0.7rem;
    line-height: 1;
    transition: all 0.15s;
}
.widget-icon-option i {
    font-size: 0.72rem;
    line-height: 1;
}
.widget-icon-option:hover {
    border-color: #6366f1;
    color: #6366f1;
    background: #eef2ff;
}
.widget-icon-option.active {
    border-color: #6366f1;
    color: #fff;
    background: #6366f1;
}

/* ═══════════════════════════════════════════
   폼 페이지 (로그인, 회원가입, 프로필)
   ═══════════════════════════════════════════ */
.auth-container {
    max-width: 420px;
    margin: 40px auto;
}

.auth-card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 32px;
}

.auth-card h2 {
    font-size: 1.5rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 24px;
    color: var(--color-text);
}

.auth-card .form-control,
.auth-card .form-select {
    border-radius: var(--radius-sm);
    border-color: var(--color-border);
    padding: 10px 14px;
    font-size: 0.9rem;
    transition: border-color var(--transition-fast);
}
.auth-card .form-control:focus,
.auth-card .form-select:focus {
    border-color: var(--color-accent);
}

.auth-card .btn-primary {
    padding: 10px;
    font-weight: 600;
}

.auth-footer {
    text-align: center;
    margin-top: 16px;
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

/* ═══════════════════════════════════════════
   게시판 목록 / 게시글 상세
   ═══════════════════════════════════════════ */
.forum-post-item {
    display: block;
    padding: 14px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    text-decoration: none;
    color: var(--color-text);
    transition: border-color var(--transition-fast);
}
.forum-post-item:hover {
    border-color: var(--color-accent);
    color: var(--color-text);
}

.forum-post-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.forum-post-meta {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: 12px;
}

.forum-post-meta i { margin-right: 3px; }

/* 게시글 상세 */
.post-detail-card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 28px;
}

.post-detail-card h1 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 12px;
    line-height: 1.4;
}

/* ═══════════════════════════════════════════
   관리자 대시보드 — 회원 랭킹 섹션
   ═══════════════════════════════════════════ */
.admin-user-ranking__tabs .nav-link {
    font-size: 0.82rem;
    padding: 6px 12px;
    color: var(--color-text-muted);
}
.admin-user-ranking__tabs .nav-link.active {
    color: var(--color-accent);
    font-weight: 600;
}
.admin-user-ranking__tabs .nav-link i {
    margin-right: 4px;
    font-size: 0.78rem;
}
.admin-user-ranking__list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.admin-user-ranking__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 4px;
    border-bottom: 1px solid var(--color-border-light);
}
.admin-user-ranking__item:last-child { border-bottom: none; }
.admin-user-ranking__name {
    flex: 1;
    min-width: 0;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.admin-user-ranking__name:hover { color: var(--color-accent); }
.admin-user-ranking__value {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--color-accent);
    flex-shrink: 0;
    min-width: 60px;
    text-align: right;
}
.admin-user-ranking__hint {
    font-size: 0.72rem;
    padding-top: 8px;
    border-top: 1px solid var(--color-border-light);
}

/* ═══════════════════════════════════════════
   관리자 대시보드 통계 카드
   ═══════════════════════════════════════════ */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.admin-stat-card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 20px;
    text-align: center;
}

.admin-stat-icon {
    font-size: 1.5rem;
    margin-bottom: 8px;
    opacity: 0.7;
}

.admin-stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--color-text);
    line-height: 1.2;
}

.admin-stat-label {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    font-weight: 500;
    margin-top: 2px;
}

/* 통계 아이콘 색상 유틸리티 */
.stat-icon-accent { color: var(--color-accent); }
.stat-icon-info { color: var(--color-info); }
.stat-icon-success { color: var(--color-success); }
.stat-icon-warning { color: var(--color-warning); }
.stat-icon-danger { color: var(--color-danger); }

/* 빠른 작업 그리드 */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}

/* 빠른 작업 카드 제목/설명 크기 */
.quick-action-title { font-size: 0.95rem; }
.quick-action-desc { font-size: 0.8rem; }

/* ═══════════════════════════════════════════
   404 페이지
   ═══════════════════════════════════════════ */
.error-page {
    text-align: center;
    padding: 80px 20px;
}

.error-page .error-code {
    font-size: 6rem;
    font-weight: 900;
    color: var(--color-border);
    line-height: 1;
    margin-bottom: 8px;
    letter-spacing: -4px;
}

.error-page .error-message {
    font-size: 1.1rem;
    color: var(--color-text-secondary);
    margin-bottom: 24px;
}

/* ═══════════════════════════════════════════
   홈 히어로 (비로그인 상태)
   ═══════════════════════════════════════════ */
.hero-section {
    text-align: center;
    padding: 64px 20px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    margin-bottom: 32px;
}

.hero-section h1 {
    font-size: 2.25rem;
    font-weight: 900;
    color: var(--color-text);
    margin-bottom: 12px;
    letter-spacing: -1px;
}

.hero-section p {
    color: var(--color-text-secondary);
    font-size: 1.05rem;
    margin-bottom: 28px;
}

.hero-section .btn { padding: 10px 24px; font-weight: 600; }

/* ═══════════════════════════════════════════
   섹션 헤더
   ═══════════════════════════════════════════ */
.section-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--color-text);
    margin-bottom: 16px;
    letter-spacing: -0.3px;
}

/* ═══════════════════════════════════════════
   글로벌 Bootstrap 오버라이드
   ═══════════════════════════════════════════ */

/* 카드 */
.card {
    border-color: var(--color-border);
    border-radius: var(--radius-sm);
}

/* 폼 요소 */
.form-control, .form-select {
    border-radius: var(--radius-sm);
    border-color: var(--color-border);
    transition: border-color var(--transition-fast);
}
.form-control:focus, .form-select:focus {
    border-color: var(--color-accent);
}

.form-label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--color-text);
    margin-bottom: 4px;
}

/* 버튼 */
.btn {
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.btn-primary {
    background: var(--color-accent);
    border-color: var(--color-accent);
}
.btn-primary:hover {
    background: #4338ca;
    border-color: #4338ca;
}

/* 배지 */
.badge { font-weight: 600; letter-spacing: 0.3px; }

/* 페이지네이션 */
.pagination .page-link {
    border-radius: var(--radius-sm);
    margin: 0 2px;
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}
.pagination .page-item.active .page-link {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: #fff;
}
.pagination .page-link:hover {
    background: var(--color-accent-light);
    border-color: var(--color-accent);
    color: var(--color-accent);
}
.pagination .page-item.disabled .page-link {
    color: var(--color-text-secondary);
    background-color: #f8fafc;
    border-color: var(--color-border);
    opacity: 1;
}

/* 테이블 */
.table { font-size: 0.875rem; }
.table th {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--color-text-muted);
}

/* 알림 */
.alert {
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    border: none;
}

/* 반응형 */
@media (max-width: 992px) {
    .design-mode-card { margin: 0 12px 12px; border-radius: 10px; }
    .design-mode-card-head { padding: 10px 12px; gap: 10px; }
    .design-mode-card-palette { padding: 10px 12px; gap: 10px; }
    .widget-palette-grid { gap: 5px; }
    .widget-palette-item { padding: 5px 10px; }
    .widget-palette-label { font-size: 0.75rem; }
    .design-mode-layout-picker { padding: 3px 10px 3px 12px; }
    .design-mode-layout-picker .btn-group .btn { padding: 3px 10px; font-size: 0.75rem; }
}

@media (max-width: 768px) {
    .auth-container { margin: 20px auto; }
    .auth-card { padding: 24px 20px; }
    .hero-section { padding: 40px 16px; }
    .hero-section h1 { font-size: 1.75rem; }
}

/* ═══════════════════════════════════════
   피드 무한 스크롤 위젯
   ═══════════════════════════════════════ */
.widget-feed-infinite-scroll { padding: 0; }
.widget-feed-infinite-scroll .widget-title { padding: 16px 16px 12px; margin: 0; }

.feed-scroll-item {
    padding: 16px;
    border-bottom: 1px solid var(--color-border-light);
    transition: background-color 0.15s;
}
.feed-scroll-item:hover { background-color: var(--color-accent-light); }
.feed-scroll-item:last-child { border-bottom: none; }

.feed-scroll-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.feed-scroll-author {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--color-text);
}
.feed-scroll-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}
.feed-scroll-avatar-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    font-size: 14px;
}
.feed-scroll-author-name { font-weight: 600; font-size: 0.9rem; }
.feed-scroll-date { color: var(--color-text-muted); font-size: 0.8rem; }

.feed-scroll-body {
    display: block;
    text-decoration: none;
    color: var(--color-text);
}
.feed-scroll-title {
    margin: 0 0 4px;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
}
.feed-scroll-excerpt {
    margin: 0;
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.feed-scroll-meta {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}
.feed-scroll-stat {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.feed-scroll-loading {
    text-align: center;
    padding: 20px;
    color: var(--color-text-muted);
}
.feed-scroll-end {
    text-align: center;
    padding: 20px;
    color: var(--color-text-muted);
    font-size: 0.85rem;
}
.feed-scroll-sentinel { height: 1px; }

/* ─── 위젯: 공지사항 / 프로모션 공용 ─── */
.widget-event-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.widget-event-card {
    display: flex;
    text-decoration: none;
    color: var(--color-text);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: background-color var(--transition-fast);
}
.widget-event-card:hover {
    background-color: var(--color-bg-hover);
    color: var(--color-text);
}

/* 이미지가 있는 카드 */
.widget-event-card--image {
    flex-direction: column;
    border: 1px solid var(--color-border-light);
}
.widget-event-card__img {
    width: 100%;
    height: 100px;
    object-fit: cover;
}
.widget-event-card--image .widget-event-card__body {
    padding: 8px 10px;
}

/* 이미지가 없는 카드 */
.widget-event-card--text {
    align-items: flex-start;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border-light);
}
.widget-event-card--text:last-child { border-bottom: none; }
.widget-event-card__icon {
    flex-shrink: 0;
    font-size: 0.85rem;
    margin-top: 2px;
}

/* 카드 본문 */
.widget-event-card__body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.widget-event-card__title {
    font-size: 0.825rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.widget-event-card__desc {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 더보기 링크 */
.widget-event-more {
    display: block;
    text-align: right;
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-decoration: none;
    margin-top: 8px;
}
.widget-event-more:hover { color: var(--color-accent); }

/* ─────────────────────────────────────────────────────────
 * 좋아요/댓글 수 강조 스타일
 * - 좋아요·댓글 둘 다 5 이상: 파란색 (중간 강조)
 * - 좋아요·댓글 둘 다 10 초과: 주황색 + bold (최고 강조)
 * span(숫자 컨테이너) 자체에 부여하면 내부 텍스트/아이콘 색상이 함께 변한다.
 * ───────────────────────────────────────────────────────── */
.count-highlight-blue,
.count-highlight-blue i {
    color: #2563eb !important;
    font-weight: 600;
}
.count-highlight-orange,
.count-highlight-orange i {
    color: #ea580c !important;
    font-weight: 700;
}

