/* =====================================================================
   우리동네 사랑방 - 디자인 시스템 (2025~2026 트렌드 리디자인)
   뉴모피즘 + 글래스모피즘 / 다크·라이트 모드 / 마이크로 애니메이션
   원칙: 화려함보다 "읽기 편하고 헷갈리지 않는" UI, 고령 사용자 접근성 우선
   ===================================================================== */

/* ---------- 디자인 토큰 (라이트 모드 기본값) ---------- */
:root {
    /* 브랜드 컬러 */
    --color-primary: #FF6B6B;          /* 코랄 - 그라데이션/포인트/배지 */
    --color-primary-600: #E14F4F;      /* 코랄 중간톤 - hover */
    --color-primary-700: #C93E3E;      /* 코랄 진한톤 - 버튼 배경(흰 글씨 AA 대비 확보) */
    --color-secondary: #4ECDC4;        /* 민트 - 그라데이션/포인트/배지(어두운 글씨와 함께 사용) */
    --color-secondary-700: #2E9E96;    /* 민트 진한톤 - 보조 강조 */

    /* 배경/표면 */
    --color-bg: #F7F7F7;
    --color-bg-alt: #FFFFFF;
    --color-surface: #FFFFFF;
    --color-surface-rgb: 255, 255, 255;
    --color-glass: rgba(255, 255, 255, 0.62);
    --color-border: #E9E5E1;

    /* 텍스트 */
    --color-text: #2B2521;
    --color-text-sub: #6B6258;
    --color-on-accent: #17332F;        /* 밝은 민트/코랄 배지 위에 쓰는 어두운 글씨 */

    /* 상태 */
    --color-danger: #C0392B;
    --color-danger-bg: #FDECEA;
    --color-success: #2E7D32;
    --color-success-bg: #EAF6EA;
    --color-notice-bg: #FFF1EA;

    /* 그림자 (뉴모피즘 느낌의 이중 소프트 섀도) */
    --shadow-soft: 0 2px 8px rgba(43, 37, 33, 0.06), 0 8px 24px rgba(43, 37, 33, 0.05);
    --shadow-raised: 0 6px 16px rgba(43, 37, 33, 0.09), 0 14px 32px rgba(43, 37, 33, 0.07);
    --shadow-inset-light: inset 2px 2px 5px rgba(255, 255, 255, 0.6), inset -2px -2px 5px rgba(43, 37, 33, 0.04);

    /* 형태 */
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --blur: 14px;

    /* 타이포그래피 (고령 사용자 가독성을 고려해 모바일 스펙의 clamp 범위를 기본으로 채택) */
    --font-family: "Noto Sans KR", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
    --font-size-base: clamp(15px, 2.6vw, 17px);
    --font-size-h1: clamp(22px, 5vw, 28px);
    --font-scale: 1;
}

/* 글씨 크게 보기 토글 (접근성 - AA 준수를 위해 유지) */
html.font-large {
    --font-size-base: clamp(19px, 3.4vw, 22px);
    --font-size-h1: clamp(26px, 6vw, 32px);
}

/* ---------- 다크 모드 ---------- */
:root:not([data-theme="light"]) {
    /* prefers-color-scheme 기반 - data-theme이 명시되지 않았을 때만 */
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --color-bg: #14161B;
        --color-bg-alt: #1B1E24;
        --color-surface: #1E2128;
        --color-surface-rgb: 30, 33, 40;
        --color-glass: rgba(30, 33, 40, 0.68);
        --color-border: rgba(255, 255, 255, 0.09);
        --color-text: #ECEAE6;
        --color-text-sub: #A7A29C;
        --color-danger-bg: #3A2220;
        --color-success-bg: #1E2E20;
        --color-notice-bg: #2A2320;
        --shadow-soft: 0 2px 8px rgba(0, 0, 0, 0.25), 0 8px 24px rgba(0, 0, 0, 0.22);
        --shadow-raised: 0 6px 18px rgba(0, 0, 0, 0.32), 0 16px 36px rgba(0, 0, 0, 0.28);
        --shadow-inset-light: inset 2px 2px 5px rgba(255, 255, 255, 0.03), inset -2px -2px 5px rgba(0, 0, 0, 0.3);
    }
}
:root[data-theme="dark"] {
    --color-bg: #14161B;
    --color-bg-alt: #1B1E24;
    --color-surface: #1E2128;
    --color-surface-rgb: 30, 33, 40;
    --color-glass: rgba(30, 33, 40, 0.68);
    --color-border: rgba(255, 255, 255, 0.09);
    --color-text: #ECEAE6;
    --color-text-sub: #A7A29C;
    --color-danger-bg: #3A2220;
    --color-success-bg: #1E2E20;
    --color-notice-bg: #2A2320;
    --shadow-soft: 0 2px 8px rgba(0, 0, 0, 0.25), 0 8px 24px rgba(0, 0, 0, 0.22);
    --shadow-raised: 0 6px 18px rgba(0, 0, 0, 0.32), 0 16px 36px rgba(0, 0, 0, 0.28);
    --shadow-inset-light: inset 2px 2px 5px rgba(255, 255, 255, 0.03), inset -2px -2px 5px rgba(0, 0, 0, 0.3);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.7;
    -webkit-text-size-adjust: 100%;
}
body { transition: background-color .25s ease, color .25s ease; }

h1, h2, h3 { font-family: var(--font-family); font-weight: 700; line-height: 1.35; }
h1 { font-size: var(--font-size-h1); }
h2 { font-size: clamp(19px, 3.6vw, 22px); }

a { color: var(--color-primary-700); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ---------- 헤더 (Sticky + 스크롤 시 블러) ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--color-bg-alt);
    background: color-mix(in srgb, var(--color-bg-alt) 88%, transparent);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    border-bottom: 1px solid transparent;
    transition: background-color .3s ease, backdrop-filter .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.site-header.scrolled {
    background: var(--color-bg-alt);
    background: color-mix(in srgb, var(--color-bg-alt) 72%, transparent);
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
    border-bottom-color: var(--color-border);
    box-shadow: var(--shadow-soft);
}
.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
    max-width: 1080px;
    margin: 0 auto;
    flex-wrap: wrap;
}
.site-logo {
    font-size: 1.5em;
    font-weight: 800;
    color: var(--color-primary-700);
    letter-spacing: -0.02em;
}
.header-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.header-actions .user-name {
    font-weight: 700;
    margin-right: 2px;
}
.icon-toggle-btn {
    min-width: 44px;
    min-height: 44px;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    box-shadow: var(--shadow-soft);
    cursor: pointer;
    font-size: 1.1em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform .15s ease, box-shadow .15s ease;
}
.icon-toggle-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-raised); }

/* 햄버거 버튼 (기본 숨김, 모바일에서만 노출) */
.hamburger-btn {
    display: none;
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    border-radius: var(--radius-sm);
}
.hamburger-btn span {
    display: block;
    width: 24px;
    height: 3px;
    border-radius: 3px;
    background: var(--color-text);
}
.hamburger-btn:hover { background: var(--color-notice-bg); }

/* 메인 내비게이션: 1단계, 게시판 7개 + 이벤트 (데스크톱) */
.main-nav {
    background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-secondary) 100%);
}
.main-nav ul {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    margin: 0;
    padding: 0;
    max-width: 1080px;
    margin: 0 auto;
}
.main-nav li { flex: 1 1 auto; }
.main-nav a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 10px;
    text-align: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.98em;
    text-shadow: 0 1px 2px rgba(0,0,0,0.12);
}
.main-nav a:hover,
.main-nav a.active {
    background: rgba(0, 0, 0, 0.14);
    text-decoration: none;
}

/* ---------- 모바일 풀스크린 드로어 ---------- */
.mobile-drawer-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 199;
    opacity: 0;
    transition: opacity .25s ease;
}
.mobile-drawer-backdrop.open { display: block; opacity: 1; }

.mobile-drawer {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: min(86vw, 360px);
    background: var(--color-bg-alt);
    z-index: 200;
    transform: translateX(100%);
    transition: transform .3s cubic-bezier(.4,0,.2,1);
    display: flex;
    flex-direction: column;
    padding: 18px;
    overflow-y: auto;
    box-shadow: -8px 0 30px rgba(0,0,0,0.15);
}
.mobile-drawer.open { transform: translateX(0); }
.mobile-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}
.drawer-close-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    font-size: 1.2em;
    cursor: pointer;
}
.mobile-drawer-nav {
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.mobile-drawer-nav a {
    display: block;
    min-height: 48px;
    line-height: 48px;
    padding: 0 14px;
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-weight: 700;
}
.mobile-drawer-nav a.active,
.mobile-drawer-nav a:hover {
    background: var(--color-notice-bg);
    text-decoration: none;
    color: var(--color-primary-700);
}
.mobile-drawer-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 14px;
    border-top: 1px solid var(--color-border);
}

/* ---------- 버튼 (리플 효과 포함) ---------- */
.btn {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 22px;
    font-family: inherit;
    font-size: 1em;
    font-weight: 700;
    border-radius: var(--radius-sm);
    border: 2px solid var(--color-primary-700);
    background: var(--color-primary-700);
    color: #fff;
    cursor: pointer;
    line-height: 1.3;
    transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
    box-shadow: var(--shadow-soft);
}
.btn:hover { background: var(--color-primary-600); border-color: var(--color-primary-600); text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-raised); }
.btn:active { transform: translateY(0); }
.btn-outline { background: var(--color-surface); color: var(--color-primary-700); }
.btn-outline:hover { background: var(--color-notice-bg); }
.btn-danger { background: var(--color-danger); border-color: var(--color-danger); }
.btn-danger:hover { background: #96271d; border-color: #96271d; }
.btn-large { padding: 16px 28px; font-size: 1.15em; min-height: 54px; }
.btn-sm { padding: 8px 14px; min-height: 40px; font-size: 0.9em; border-radius: 8px; }
.btn-block { display: flex; width: 100%; text-align: center; }

.btn-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.55);
    transform: scale(0);
    animation: ripple-anim .6s ease-out;
    pointer-events: none;
}
@keyframes ripple-anim {
    to { transform: scale(2.6); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .btn-ripple { animation: none; display: none; }
    .btn, .card, .feed-card, .category-card { transition: none !important; }
}

/* ---------- 카드 (뉴모피즘 + 글래스모피즘 혼합) ---------- */
.card {
    background: var(--color-glass);
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-soft);
    will-change: transform;
}
.flash {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin: 14px 0;
    font-weight: 700;
}
.flash-error { background: var(--color-danger-bg); color: var(--color-danger); border: 1px solid rgba(192,57,43,0.25); }
.flash-success { background: var(--color-success-bg); color: var(--color-success); border: 1px solid rgba(46,125,50,0.25); }

/* ---------- 폼 ---------- */
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 1.05em;
}
.form-control {
    width: 100%;
    padding: 12px 14px;
    font-size: 1.05em;
    min-height: 48px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    background: var(--color-surface);
    color: var(--color-text);
}
.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
}
textarea.form-control { min-height: 220px; resize: vertical; }
.form-hint { color: var(--color-text-sub); font-size: 0.92em; margin-top: 6px; }

/* ---------- 히어로 섹션 ---------- */
.hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    margin: 20px auto 32px;
    padding: clamp(32px, 8vw, 64px) 20px;
    background: linear-gradient(135deg, var(--color-primary) 0%, #FF9B6B 45%, var(--color-secondary) 100%);
    background-size: 200% 200%;
    animation: hero-gradient-shift 12s ease-in-out infinite;
    display: flex;
    justify-content: center;
}
@keyframes hero-gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}
.hero::before, .hero::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    filter: blur(2px);
    animation: hero-blob-float 9s ease-in-out infinite;
}
.hero::before { width: 160px; height: 160px; top: -40px; left: -30px; }
.hero::after { width: 220px; height: 220px; bottom: -70px; right: -40px; animation-delay: -4s; }
@keyframes hero-blob-float {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-16px) scale(1.06); }
}
@media (prefers-reduced-motion: reduce) {
    .hero, .hero::before, .hero::after { animation: none; }
}
.hero-glass {
    position: relative;
    z-index: 1;
    max-width: 640px;
    width: 100%;
    text-align: center;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-lg);
    padding: clamp(24px, 5vw, 40px);
    box-shadow: var(--shadow-raised);
    color: #2B2521;
}
.hero-title {
    font-size: clamp(24px, 6vw, 34px);
    font-weight: 900;
    margin: 0 0 12px;
    color: #2B2521;
}
.hero-sub {
    font-size: clamp(15px, 3vw, 17px);
    color: #5A5148;
    margin: 0 0 22px;
    line-height: 1.7;
}
.hero-cta { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- 카테고리 아이콘 카드 그리드 ---------- */
.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin: 24px 0 32px;
}
.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 18px 10px;
    border-radius: var(--radius-md);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-soft), var(--shadow-inset-light);
    color: var(--color-text);
    font-weight: 700;
    text-align: center;
    transition: transform .2s ease, box-shadow .2s ease;
    will-change: transform;
}
.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-raised);
    text-decoration: none;
}
.category-chip {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
}
.category-card .category-name { font-size: 0.95em; }

/* ---------- 최신 글 피드 (카드형) ---------- */
.feed-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
.feed-card {
    display: flex;
    flex-direction: column;
    background: var(--color-glass);
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: transform .2s ease, box-shadow .2s ease;
    will-change: transform;
}
.feed-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-raised); text-decoration: none; }
.feed-thumb {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2em;
    color: rgba(255,255,255,0.9);
}
.feed-thumb img { width: 100%; height: 100%; object-fit: cover; }
.feed-body { padding: 14px 16px 16px; color: var(--color-text); }
.feed-board-tag {
    display: inline-block;
    font-size: 0.78em;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    background: var(--color-notice-bg);
    color: var(--color-primary-700);
    margin-bottom: 8px;
}
.feed-title {
    font-size: 1.05em;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--color-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.feed-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.85em;
    color: var(--color-text-sub);
}

/* ---------- 게시글 목록 (테이블형 - 게시판 상세 목록에서 사용) ---------- */
.board-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
}
.board-title-row h1 { margin: 0; }

table.post-list {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}
table.post-list th, table.post-list td {
    padding: 14px 10px;
    border-bottom: 1px solid var(--color-border);
    text-align: center;
    color: var(--color-text);
}
table.post-list th { background: var(--color-notice-bg); font-size: 0.95em; }
table.post-list td.title-cell { text-align: left; }
table.post-list td.title-cell a { font-size: 1.05em; font-weight: 700; color: var(--color-text); }
table.post-list td.title-cell a:hover { color: var(--color-primary-700); }
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.78em;
    font-weight: 700;
    margin-right: 6px;
}
.badge-notice { background: var(--color-primary-700); color: #fff; }
.badge-hot { background: #FFE1E1; color: var(--color-danger); }
.badge-comment { color: var(--color-primary-700); font-weight: 700; }
.meta { color: var(--color-text-sub); font-size: 0.9em; }

/* 모바일에서는 카드형으로 전환 */
@media (max-width: 640px) {
    table.post-list thead { display: none; }
    table.post-list, table.post-list tbody, table.post-list tr, table.post-list td {
        display: block;
        width: 100%;
    }
    table.post-list tr {
        border: 1px solid var(--color-border);
        border-radius: var(--radius-sm);
        margin-bottom: 10px;
        padding: 10px;
    }
    table.post-list td {
        border: none;
        text-align: left !important;
        padding: 4px 4px;
    }
}

/* ---------- 글 상세 ---------- */
.back-to-list-btn { margin-bottom: 14px; }
.post-detail-header h1 { margin-bottom: 6px; }
.post-detail-meta { color: var(--color-text-sub); margin-bottom: 16px; }
.post-content { font-size: 1.08em; line-height: 1.9; white-space: pre-wrap; word-break: break-word; }
.post-content img { border-radius: var(--radius-sm); margin: 10px 0; }
.post-images img { border-radius: var(--radius-sm); margin: 10px 0; }
.post-actions { display: flex; gap: 10px; margin: 20px 0; flex-wrap: wrap; }

/* ---------- 댓글 ---------- */
.comment-list { margin-top: 20px; }
.comment-item { padding: 14px 0; border-bottom: 1px solid var(--color-border); }
.comment-item.reply { margin-left: 32px; background: var(--color-notice-bg); border-radius: var(--radius-sm); padding: 12px; }
.comment-author { font-weight: 700; margin-right: 8px; }
.comment-date { color: var(--color-text-sub); font-size: 0.85em; }
.comment-body { margin-top: 6px; }
.comment-actions a, .comment-actions button {
    font-size: 0.85em;
    color: var(--color-text-sub);
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 2px;
    margin-right: 10px;
    min-height: 32px;
}

/* ---------- 페이지네이션 ---------- */
.pagination { display: flex; justify-content: center; gap: 6px; margin: 24px 0; flex-wrap: wrap; }
.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-weight: 700;
    background: var(--color-surface);
}
.page-link.active { background: var(--color-primary-700); color: #fff; border-color: var(--color-primary-700); }

/* ---------- 등급/마이페이지 ---------- */
.grade-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.85em;
    background: var(--color-notice-bg);
    color: var(--color-primary-700);
}
.progress-bar-outer {
    background: var(--color-border);
    border-radius: 10px;
    height: 16px;
    overflow: hidden;
    margin: 6px 0;
}
.progress-bar-inner { background: var(--color-success); height: 100%; }

/* ---------- 출석체크 ---------- */
.attendance-box { text-align: center; padding: 40px 20px; }
.attendance-box .streak-num { font-size: 3em; color: var(--color-primary-700); font-weight: 800; }

/* ---------- 관리자 ---------- */
.admin-layout { display: flex; gap: 20px; align-items: flex-start; }
.admin-sidebar {
    width: 190px;
    flex-shrink: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 10px;
}
.admin-sidebar a {
    display: block;
    min-height: 44px;
    line-height: 24px;
    padding: 10px 10px;
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-weight: 700;
}
.admin-sidebar a:hover, .admin-sidebar a.active {
    background: var(--color-notice-bg);
    text-decoration: none;
}
.admin-content { flex: 1; min-width: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 18px; text-align: center; box-shadow: var(--shadow-soft); }
.stat-card .num { font-size: 1.9em; font-weight: 800; color: var(--color-primary-700); }
.stat-card .label { color: var(--color-text-sub); margin-top: 4px; }

table.admin-table { width: 100%; border-collapse: collapse; background: var(--color-surface); }
table.admin-table th, table.admin-table td {
    padding: 12px 8px;
    border-bottom: 1px solid var(--color-border);
    text-align: center;
    font-size: 0.95em;
    color: var(--color-text);
}
table.admin-table th { background: var(--color-notice-bg); }

@media (max-width: 700px) {
    .admin-layout { flex-direction: column; }
    .admin-sidebar { width: 100%; display: flex; overflow-x: auto; gap: 4px; }
    .admin-sidebar a { white-space: nowrap; }
}

/* ---------- 광고 배너 ---------- */
.ad-zone { margin: 16px 0 24px; display: flex; flex-direction: column; gap: 10px; }
.ad-banner {
    display: block;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-soft);
    text-decoration: none;
}
.ad-banner:hover { box-shadow: var(--shadow-raised); text-decoration: none; }
.ad-banner img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ad-banner-large { height: 140px; }
.ad-small-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ad-banner-small { height: 80px; }
.ad-banner-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 100%;
    width: 100%;
    padding: 0 14px;
    text-align: center;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
}
.ad-badge {
    font-size: 0.7em;
    font-weight: 800;
    background: rgba(255,255,255,0.35);
    padding: 2px 6px;
    border-radius: 4px;
}
@media (max-width: 600px) {
    .ad-small-row { grid-template-columns: 1fr; }
}

/* ---------- Floating 글쓰기 버튼 (FAB) ---------- */
.fab-btn {
    position: fixed;
    right: 20px;
    bottom: 24px;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-600) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-raised);
    z-index: 90;
    transition: transform .2s ease, box-shadow .2s ease;
}
.fab-btn:hover { transform: translateY(-3px) scale(1.05); text-decoration: none; box-shadow: 0 10px 26px rgba(201,62,62,0.4); }
.fab-icon { font-size: 1.5em; }

/* ---------- 푸터 ---------- */
.site-footer {
    margin-top: 40px;
    padding: 24px 16px 90px;
    text-align: center;
    color: var(--color-text-sub);
    border-top: 1px solid var(--color-border);
    font-size: 0.9em;
}

/* ---------- 글씨 크게 보기 토글 ---------- */
.font-toggle-btn {
    background: var(--color-surface);
    border: 2px solid var(--color-primary-700);
    color: var(--color-primary-700);
    border-radius: 20px;
    padding: 8px 14px;
    min-height: 44px;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.9em;
}

/* =====================================================================
   반응형 브레이크포인트: 768px(태블릿), 480px(모바일)
   ===================================================================== */
@media (max-width: 768px) {
    .main-nav { display: none; }
    .hamburger-btn { display: flex; }
    .category-grid { grid-template-columns: repeat(2, 1fr); }
    .feed-grid { grid-template-columns: 1fr; }
    .header-actions .user-name { display: none; }
}

@media (max-width: 480px) {
    .header-actions .grade-badge { display: none; }
    .hero { margin-left: -16px; margin-right: -16px; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
    .fab-btn { right: 14px; bottom: 18px; width: 54px; height: 54px; }
    .category-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}
