/* ===== 리셋 & 기본 설정 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 세련된 컬러 팔레트 */
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #2a2a2a;
    
    /* 글래스모피즘 컬러 */
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-hover: rgba(255, 255, 255, 0.06);
    
    /* 텍스트 컬러 */
    --text-primary: #ffffff;
    --text-secondary: #b8b8b8;
    --text-muted: #6a6a6a;
    
    /* 액센트 컬러 */
    --accent-gold: #d4af37;
    --accent-blue: #4a9eff;
    --accent-purple: #8b5cf6;
    --accent-green: #10b981;
    
    /* 그라데이션 */
    --gradient-gold: linear-gradient(135deg, #d4af37 0%, #f4d03f 100%);
    --gradient-blue: linear-gradient(135deg, #4a9eff 0%, #8b5cf6 100%);
    --gradient-purple: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    
    /* 그림자 */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --glow-gold: 0 0 20px rgba(212, 175, 55, 0.3);
    --glow-blue: 0 0 20px rgba(74, 158, 255, 0.3);
    
    /* 폰트 */
    --font-serif: 'Noto Serif KR', serif;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-serif);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* ===== 배경 효과 ===== */
.bg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 20%, rgba(74, 158, 255, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(212, 175, 55, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.bg-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        radial-gradient(circle at 75% 75%, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 100px 100px, 150px 150px;
    pointer-events: none;
    z-index: 0;
}

.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.01) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.01) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
}

/* ===== 메인 컨테이너 ===== */
.main-container {
    display: grid;
    grid-template-columns: 300px 1fr 280px;
    gap: 30px;
    max-width: 1600px;
    margin: 0 auto;
    padding: 30px;
    position: relative;
    z-index: 10;
    min-height: 100vh;
}

/* ===== 투명 패널 ===== */
.glass-panel {
    background: transparent;
    border: none;
    box-shadow: none;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.glass-panel:hover {
    background: transparent;
    border: none;
    box-shadow: none;
    transform: none;
}

/* ===== 좌측 사이드바 ===== */
.left-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 30px;
    height: fit-content;
}

/* 프로필 섹션 */
.profile-section {
    padding: 25px;
    text-align: center;
    background: transparent;
    border: none;
    box-shadow: none;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 15px;
    border: 2px solid var(--glass-border);
    overflow: hidden;
    position: relative;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar:empty {
    background: var(--gradient-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.profile-name {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 8px;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.profile-title {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 300;
}

/* 네비게이션 메뉴 */
.sidebar-nav {
    padding: 12px 20px;
    background: transparent;
    border: none;
    box-shadow: none;
}

/* 하위 카테고리 접기 기본 */
.nav-menu li ul { display: none; margin-left: 12px; }
.nav-menu li.open > ul { display: block; }
.nav-menu li { list-style: none; }
.nav-menu li > a { cursor: pointer; }

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-nav .nav-menu a,
.nav-link {
    display: block;
    padding: 6px 0;
    color: var(--text-primary) !important;
    text-decoration: none;
    transition: all 0.25s ease;
    position: relative;
    font-weight: 400;
    font-size: 0.98rem;
    border-bottom: 1px solid transparent;
}

.nav-link:visited {
    color: var(--text-primary) !important; /* 방문/활성 모두 흰색 유지 */
}

.nav-link:hover {
    color: var(--accent-gold) !important;
    border-bottom-color: var(--accent-gold);
    padding-left: 10px;
}

.nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 1px;
    background: var(--gradient-gold);
    transition: width 0.3s ease;
}

.nav-link:hover::before {
    width: 20px;
}

/* ===== 메인 컨텐츠 ===== */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 25px;
    background: transparent; /* 메인 영역 투명하게 */
    border: none;
    box-shadow: none;
}

/* 헤더 */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.main-title {
    font-size: 2.6rem;
    font-weight: 700;
    color: #f4d03f; /* 노란색 표기 */
    text-shadow: 0 0 18px rgba(212,175,55,0.55), 0 0 40px rgba(212,175,55,0.35);
}

.header-stats {
    display: flex;
    gap: 20px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.stat-icon {
    font-size: 1rem;
}

.stat-value {
    font-weight: 500;
}

/* ===== 캐릭터 섹션 ===== */
.character-section {
    margin-bottom: 30px;
}

.character-display {
    position: relative;
    width: 100%;
    height: 380px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    backdrop-filter: none;
    border: none;
    border-radius: 0;
    overflow: visible;
}

.character-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.character-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: all 0.3s ease;
}

.character-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.character-animation img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.character-display:hover .character-image img {
    transform: scale(1.05);
}

/* ===== 우측 사이드바 ===== */
.right-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 30px;
    height: fit-content;
    align-items: flex-end;
    text-align: right;
}

/* 바로가기 메뉴 */
.shortcut-menu {
    padding: 20px;
    background: transparent;
    border: none;
    box-shadow: none;
}

.shortcut-menu .section-title {
    display: none; /* "바로가기" 제목 숨기기 */
}

.shortcut-menu .menu-grid {
    background: transparent; /* 배경 박스 투명하게 */
    border: none;
    box-shadow: none;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-primary);
    position: relative;
    padding-bottom: 8px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 30px;
    height: 2px;
    background: var(--gradient-gold);
}

.menu-grid {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    margin-top: 8px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 6px;
    background: transparent;
    border-radius: 0;
    text-decoration: none;
    transition: all 0.25s ease;
    position: relative;
    overflow: visible;
    border: none;
    box-shadow: none;
}

.menu-item::before { display: none; }

.menu-item:hover::before {
    opacity: 1;
}

.menu-item:hover {
    background: transparent;
    transform: translateX(6px);
    box-shadow: none;
}

.menu-image {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
}

.menu-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.menu-image:empty { background: transparent; }

.menu-content h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* 최근 글 */
.recent-posts {
    display: none; /* 최근글 섹션 숨기기 */
}

.recent-list {
    list-style: none;
    margin-top: 15px;
}

.recent-item {
    margin-bottom: 12px;
}

.recent-item a {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-decoration: none;
    padding: 10px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.recent-item a:hover {
    background: var(--glass-hover);
}

.recent-title {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
}

.recent-date {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-family: var(--font-sans);
}

/* 태그 클라우드 */
.tag-cloud {
    display: none; /* 태그 섹션 숨기기 */
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.tags a {
    background: var(--bg-tertiary);
    color: var(--accent-blue);
    padding: 6px 12px;
    border-radius: 15px;
    text-decoration: none;
    font-size: 0.85rem;
    border: 1px solid var(--glass-border);
    transition: all 0.3s ease;
}

.tags a:hover {
    background: var(--glass-hover);
    border-color: var(--accent-blue);
    box-shadow: var(--glow-blue);
    transform: translateY(-2px);
}

/* 검색 */
.search-section {
    display: none; /* 검색 섹션 숨기기 */
}

.search-box {
    position: relative;
    margin-top: 15px;
}

.search-input {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 12px 45px 12px 15px;
    border-radius: 25px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    font-family: var(--font-serif);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: var(--glow-gold);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--gradient-gold);
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.search-btn:hover {
    box-shadow: var(--glow-gold);
    transform: translateY(-50%) scale(1.1);
}

.search-icon {
    font-size: 1rem;
}

/* ===== 포스트 카드 ===== */
.post-card {
    padding: 25px;
    margin-bottom: 20px;
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.post-category {
    background: var(--gradient-blue);
    color: var(--text-primary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.post-date {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-family: var(--font-sans);
}

.post-title a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.4rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.post-title a:hover {
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.post-summary {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.7;
    margin: 15px 0;
}

.post-footer {
    border-top: 1px solid var(--glass-border);
    padding-top: 15px;
}

.post-stats {
    display: flex;
    gap: 15px;
}

.stat {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-family: var(--font-sans);
}

/* 글 상세 페이지 */
.post-detail {
    padding: 30px;
}

.detail-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 20px 0;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.post-meta {
    display: flex;
    gap: 15px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 30px;
}

.post-body {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.post-body h1, .post-body h2, .post-body h3 {
    color: var(--text-primary);
    margin: 25px 0 15px;
}

.post-body a {
    color: var(--accent-blue);
    text-decoration: none;
    border-bottom: 1px solid var(--accent-blue);
    transition: all 0.3s ease;
}

.post-body a:hover {
    color: var(--accent-gold);
    border-color: var(--accent-gold);
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 30px;
}

.post-tags a {
    background: var(--bg-tertiary);
    color: var(--accent-blue);
    padding: 6px 12px;
    border-radius: 15px;
    text-decoration: none;
    font-size: 0.85rem;
    border: 1px solid var(--glass-border);
    transition: all 0.3s ease;
}

.post-tags a:hover {
    background: var(--glass-hover);
    border-color: var(--accent-blue);
    box-shadow: var(--glow-blue);
}

/* 댓글 섹션 */
.comments-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid var(--glass-border);
}

.comments-section .section-title {
    font-size: 1.3rem;
    margin-bottom: 20px;
}

.count {
    color: var(--accent-blue);
}

/* 페이지네이션 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 40px 0;
}

.page-btn, .page-num {
    background: var(--glass-bg);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    padding: 10px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.page-btn:hover, .page-num:hover {
    background: var(--glass-hover);
    border-color: var(--accent-gold);
    box-shadow: var(--glow-gold);
}

.page-num.selected {
    background: var(--gradient-gold);
    border-color: transparent;
    box-shadow: var(--glow-gold);
}

.page-numbers {
    display: flex;
    gap: 5px;
}

/* 방명록 */
.guestbook {
    padding: 30px;
}

.guestbook-content {
    margin-top: 20px;
}

/* 푸터 */
.main-footer {
    margin-top: 60px;
    padding: 30px 0;
    border-top: 1px solid var(--glass-border);
    background: linear-gradient(0deg, var(--bg-secondary) 0%, transparent 100%);
    text-align: center;
}

.footer-content {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.copyright {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
}

.footer-links a:hover {
    color: var(--accent-gold);
    text-shadow: var(--glow-gold);
}

/* ===== 반응형 디자인 ===== */
@media (max-width: 1400px) {
    .main-container {
        grid-template-columns: 280px 1fr 260px;
        gap: 20px;
        padding: 20px;
    }
}

@media (max-width: 1200px) {
    .main-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .left-sidebar, .right-sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .profile-section {
        grid-column: 1 / -1;
    }
    
    .character-display {
        height: 300px;
    }
}

@media (max-width: 768px) {
    .main-container {
        padding: 15px;
    }
    
    .main-title {
        font-size: 2rem;
    }
    
    .left-sidebar, .right-sidebar {
        grid-template-columns: 1fr;
    }
    
    .header-stats {
        display: none;
    }
    
    .character-display {
        height: 250px;
    }
    
    .menu-grid {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .menu-item {
        flex: 1;
        min-width: 120px;
    }
}

@media (max-width: 480px) {
    .main-title {
        font-size: 1.5rem;
    }
    
    .post-detail {
        padding: 20px;
    }
    
    .character-display {
        height: 200px;
    }
    
    .menu-item {
        flex-direction: column;
        text-align: center;
    }
}

/* ===== 스크롤바 커스터마이징 ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-gold);
    box-shadow: var(--glow-gold);
}

/* ===== 토끼 MUD 미니게임 ===== */
.rabbit-game {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 12px 0;
    margin-bottom: 8px;
    width: 100%;
    max-width: 260px;
}

.rabbit-game .section-title {
    color: var(--accent-gold);
    font-size: 1.2rem;
    margin-bottom: 1rem;
    text-align: center;
    display: block; /* 토끼 게임 제목은 보이게 */
}

.rabbit-status {
    background: transparent;
    border: 1px solid var(--accent-gold);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    text-align: center;
    color: var(--text-secondary);
}

.rabbit-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.rabbit-btn {
    background: transparent;
    border: 1px solid var(--accent-gold);
    color: var(--accent-gold);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-serif);
}

.rabbit-btn:hover {
    background: var(--accent-gold);
    color: var(--bg-primary);
}

/* ===== 선택 영역 스타일 ===== */
::selection {
    background: var(--accent-gold);
    color: var(--bg-primary);
}

::-moz-selection {
    background: var(--accent-gold);
    color: var(--bg-primary);
}