* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --navy: #001f63;
    --cyan: #12b7de;
    --bg: #f4f6f8;
    --text: #1f2b3a;
    --muted: #6c7a89;
    --glass: rgba(255,255,255,0.08);
    --border: rgba(255,255,255,0.12);
}

body {
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    background: 
        url('/background.jpg') no-repeat center center fixed,
        radial-gradient(circle at top left, rgba(18,183,222,0.08), transparent 35%),
        radial-gradient(circle at bottom right, rgba(0,31,99,0.08), transparent 35%),
        linear-gradient(135deg, #f5f7fa 0%, #eef2f7 100%);
    background-size: cover, auto, auto, auto;
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}
/* background.jpg 없으면 배경이 깨지지 않도록 fallback */
@media (max-width: 768px) {
    body {
        background: radial-gradient(circle at top left, rgba(18,183,222,0.08), transparent 35%),
                    radial-gradient(circle at bottom right, rgba(0,31,99,0.08), transparent 35%),
                    linear-gradient(135deg, #f5f7fa 0%, #eef2f7 100%);
    }
}

.bg-shape {
    position: fixed;
    inset: 0;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}
.bg-shape::before,
.bg-shape::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.12;
}
.bg-shape::before {
    width: 500px;
    height: 500px;
    background: var(--cyan);
    top: -120px;
    left: -120px;
}
.bg-shape::after {
    width: 500px;
    height: 500px;
    background: var(--navy);
    bottom: -150px;
    right: -100px;
}

/* 네비게이션 */
.navbar {
    position: relative;
    z-index: 10;
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 24px 24px 0 24px;
    flex-wrap: wrap;
}
.nav-btn {
    padding: 10px 24px;
    border-radius: 999px;
    background: rgba(255,255,255,0.55);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0,31,99,0.1);
    color: var(--navy);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}
.nav-btn:hover {
    background: var(--cyan);
    color: white;
    border-color: var(--cyan);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(18,183,222,0.25);
}

/* 메인 컨테이너 & 글래스 카드 (홈페이지 hero 스타일 계승) */
.container {
    position: relative;
    z-index: 1;
    min-height: calc(100vh - 80px);
    padding: 40px 24px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}
.glass-card {
    width: 100%;
    max-width: 1200px;
    background: rgba(255,255,255,0.65);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 32px;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.06);
    position: relative;
    overflow: hidden;
}
/* 장식 배경 텍스트 (선택) */
.glass-card::before {
    content: "AI";
    position: absolute;
    bottom: 10px;
    right: 20px;
    font-size: 8rem;
    font-weight: 800;
    color: rgba(0,31,99,0.03);
    pointer-events: none;
    user-select: none;
}

/* 타이포그래피 */
h1, h2, h3 {
    color: var(--navy);
}
h1 {
    font-size: clamp(1.8rem, 5vw, 3rem);
    text-align: center;
    margin-bottom: 0.5rem;
}
.divider {
    width: 100px;
    height: 4px;
    margin: 1rem auto 2rem;
    background: linear-gradient(90deg, var(--navy), var(--cyan));
    border-radius: 999px;
}

/* 게시판 컨트롤 */
.board-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}
.select-category {
    padding: 8px 20px;
    border-radius: 40px;
    background: rgba(255,255,255,0.9);
    border: 1px solid #ccc;
    font-size: 0.9rem;
    cursor: pointer;
}

/* 버튼 */
.btn-primary, .btn-secondary {
    padding: 8px 20px;
    border-radius: 40px;
    background: white;
    color: var(--navy);
    border: 1px solid var(--cyan);
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-weight: 600;
    transition: all 0.2s;
}
.btn-primary:hover, .btn-secondary:hover {
    background: var(--cyan);
    color: white;
    transform: translateY(-1px);
}
.btn-disabled {
    padding: 8px 20px;
    border-radius: 40px;
    background: #e9ecef;
    color: #adb5bd;
    border: 1px solid #dee2e6;
    cursor: not-allowed;
}

/* 게시글 카드 */
.post-card {
    background: rgba(255,255,255,0.85);
    border-radius: 24px;
    padding: 1.2rem 1.5rem;
    margin-bottom: 1.2rem;
    border: 1px solid rgba(0,31,99,0.1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: all 0.2s;
}
.post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    background: white;
}
.post-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--navy);
}
.post-meta {
    font-size: 0.8rem;
    color: var(--muted);
    margin: 0.5rem 0;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}
.post-category {
    background: rgba(18,183,222,0.15);
    color: var(--cyan);
    padding: 0.15rem 0.7rem;
    border-radius: 30px;
    font-size: 0.7rem;
    display: inline-block;
}
.read-more {
    display: inline-block;
    margin-top: 0.8rem;
    color: var(--cyan);
    font-weight: 600;
    text-decoration: none;
}
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--muted);
}

/* 게시물 상세 */
.post-detail {
    max-width: 100%;
}
.back-link {
    display: inline-block;
    margin-bottom: 1.5rem;
    color: var(--cyan);
    text-decoration: none;
    font-weight: 500;
}
.post-header {
    margin-bottom: 1.5rem;
}
.post-content {
    line-height: 1.7;
    margin: 1rem 0;
}
.attachments {
    background: rgba(255,255,255,0.5);
    border-radius: 20px;
    padding: 1rem;
    margin: 1.5rem 0;
}
.attach-item {
    margin: 0.5rem 0;
    display: flex;
    gap: 1rem;
    align-items: center;
}
.view-pdf-btn {
    background: var(--navy);
    color: white;
    border: none;
    padding: 4px 12px;
    border-radius: 20px;
    cursor: pointer;
}
.delete-btn {
    background: none;
    border: 1px solid #dc3545;
    color: #dc3545;
    padding: 6px 16px;
    border-radius: 40px;
    cursor: pointer;
    margin: 1rem 0;
}
.delete-btn:hover {
    background: #dc3545;
    color: white;
}

/* 댓글 섹션 */
.comments-section {
    margin-top: 2rem;
}
.comment-box {
    background: rgba(255,255,255,0.7);
    border-radius: 20px;
    padding: 0.8rem 1.2rem;
    margin-bottom: 0.8rem;
    border-left: 3px solid var(--cyan);
}
.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}
.comment-delete {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 0.8rem;
}
.comment-form {
    margin-top: 1rem;
}
.comment-form textarea {
    width: 100%;
    border-radius: 20px;
    padding: 10px;
    border: 1px solid #ccc;
    background: white;
}

/* 인증 폼 */
.auth-form {
    max-width: 450px;
    margin: 0 auto;
}
.auth-form input {
    width: 100%;
    padding: 10px 16px;
    margin-bottom: 1rem;
    border-radius: 40px;
    border: 1px solid #ccc;
    background: white;
}

/* 새 글쓰기 */
.new-post-form {
    max-width: 800px;
    margin: 0 auto;
}
.new-post-form input, .new-post-form select, .new-post-form textarea {
    width: 100%;
    margin-bottom: 1rem;
    border-radius: 40px;
    padding: 10px 16px;
    border: 1px solid #ccc;
}
.new-post-form textarea {
    border-radius: 20px;
}

/* 관리자 테이블 */
.admin-panel {
    max-width: 1000px;
    margin: 0 auto;
}
.stats {
    display: flex;
    gap: 2rem;
    background: rgba(255,255,255,0.6);
    padding: 1rem;
    border-radius: 20px;
    margin-bottom: 2rem;
}
.user-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255,255,255,0.7);
    border-radius: 20px;
    overflow: hidden;
}
.user-table th, .user-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}
.user-table button {
    margin: 0 4px;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid #ccc;
    cursor: pointer;
}

/* 푸터 */
footer {
    text-align: center;
    margin-top: 3rem;
    color: var(--muted);
    font-size: 0.85rem;
}

/* 반응형 */
@media (max-width: 768px) {
    .navbar {
        gap: 6px;
        padding: 16px 12px 0;
    }
    .nav-btn {
        padding: 8px 14px;
        font-size: 0.75rem;
    }
    .glass-card {
        padding: 1rem;
    }
    .board-controls {
        flex-direction: column;
        align-items: stretch;
    }
    .post-meta {
        flex-direction: column;
        gap: 0.2rem;
    }
}


/* 게시판 전용 개선 */
.board-section {
    margin-top: 2rem;
    border-top: 1px solid rgba(0,31,99,0.1);
    padding-top: 2rem;
}
.board-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}
.board-header h2 {
    font-size: 1.6rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--navy), var(--cyan));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.post-card {
    background: rgba(255,255,255,0.8);
    transition: all 0.25s ease;
}
.post-card:hover {
    background: white;
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.1);
}
.post-card-inner {
    position: relative;
}
.post-title {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.3px;
}
.read-more {
    font-weight: 600;
    transition: all 0.2s;
}
.read-more:hover {
    transform: translateX(4px);
    color: var(--navy);
}

/* 카드 전체를 클릭 가능한 링크로 */
.post-card-link {
    text-decoration: none;
    display: block;
    margin-bottom: 1.2rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.post-card-link:hover {
    transform: translateY(-3px);
}
.post-card-link:hover .post-card {
    background: white;
    box-shadow: 0 12px 24px rgba(0,0,0,0.1);
}
.post-card {
    background: rgba(255,255,255,0.8);
    border-radius: 24px;
    padding: 1.2rem 1.5rem;
    border: 1px solid rgba(0,31,99,0.1);
    transition: all 0.2s;
    cursor: pointer;
}
.read-more-indicator {
    display: inline-block;
    margin-top: 0.8rem;
    color: var(--cyan);
    font-weight: 600;
    font-size: 0.9rem;
    transition: transform 0.2s;
}
.post-card-link:hover .read-more-indicator {
    transform: translateX(4px);
    color: var(--navy);
}