:root {
    --bg-color: #0d1117; /* 세련된 다크톤 배경 */
    --card-bg: #161b22; /* 카드형 배경 */
    --primary-color: #f85149; /* 강렬한 레드 (먹튀, 경고) */
    --secondary-color: #58a6ff; /* 신뢰감을 주는 블루 (분석, 픽) */
    --accent-color: #238636; /* 수익, 안전 (초록) */
    --text-main: #c9d1d9; /* 주 텍스트 (눈 피로 최소화) */
    --text-title: #ffffff; /* 제목 텍스트 (강조) */
    --text-muted: #8b949e; /* 보조 텍스트 */
    --border-color: #30363d; /* 테두리 */
    --header-bg: #010409; /* 헤더 배경 (가장 어두움) */
    --hover-bg: #21262d;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Helvetica Neue', 'Segoe UI', 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    letter-spacing: -0.02em;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

/* Header */
.top-header {
    background: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    height: 70px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo a {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-title);
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo a span {
    color: var(--primary-color);
}

.nav-menu {
    display: flex;
    gap: 30px;
}

.nav-menu a {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 10px 0;
    position: relative;
}

.nav-menu a:hover, .nav-menu a.highlight {
    color: var(--text-title);
}

.nav-menu a.highlight {
    color: var(--primary-color);
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--secondary-color);
    transition: width 0.3s ease;
}

.nav-menu a:hover::after {
    width: 100%;
}

.nav-menu a.highlight::after {
    background-color: var(--primary-color);
    width: 100%;
}

/* Dropdown */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--card-bg);
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.5);
    z-index: 1001;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-top: 5px;
}

.dropdown-content a {
    color: var(--text-main);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 14px;
    border-bottom: 1px solid var(--border-color);
}

.dropdown-content a:hover {
    background-color: var(--hover-bg);
    color: var(--secondary-color);
}

.dropdown:hover .dropdown-content {
    display: block;
}

.user-menu a {
    margin-left: 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: var(--card-bg);
}

.user-menu a:hover {
    background: var(--hover-bg);
    color: var(--secondary-color);
    border-color: var(--secondary-color);
}

/* Mobile Responsive */
@media screen and (max-width: 768px) {
    .top-header {
        height: auto;
        padding: 15px 20px;
        flex-direction: row; /* 로고와 햄버거 가로 배치 */
        justify-content: space-between;
        flex-wrap: wrap;
    }
    
    .nav-toggle-label {
        display: block !important;
        cursor: pointer;
        font-size: 24px;
        color: var(--text-title);
    }
    
    .nav-menu {
        display: none; /* 기본 숨김 */
        flex-direction: column;
        width: 100%;
        gap: 10px;
        background: var(--header-bg);
        padding: 20px 0;
        border-top: 1px solid var(--border-color);
        order: 3;
    }
    
    #nav-toggle:checked ~ .nav-menu {
        display: flex; /* 체크 시 노출 */
    }
    
    .nav-menu a {
        padding: 12px 20px;
        border-bottom: 1px solid var(--border-color);
        width: 100%;
    }

    .dropdown-content {
        position: static;
        box-shadow: none;
        border: none;
        background: rgba(255,255,255,0.05);
        display: none; /* 모바일도 기본은 숨김 */
        margin-left: 20px;
    }
    
    .user-menu {
        order: 2;
        gap: 10px;
    }
    
    .user-menu a {
        margin: 0;
        padding: 6px 12px;
        font-size: 12px;
    }

    .container {
        display: block;
        grid-template-columns: 1fr !important;
        padding: 0 10px;
        margin: 10px auto;
    }

    .top-banner-grid {
        grid-template-columns: 1fr !important; /* 무조건 한 줄에 하나씩 크게 */
        gap: 10px;
    }

    .top-banner-grid a {
        height: auto;
        min-height: auto;
    }

    .sidebar {
        width: 100% !important;
        margin-top: 30px;
    }

    .board-list li a {
        padding: 15px 10px;
        gap: 10px;
    }

    .list-thumb {
        width: 80px !important;
        height: 60px !important;
    }
}

/* Layout */
.container {
    max-width: 1280px;
    margin: 30px auto;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 30px;
    padding: 0 20px;
}

.widget-section {
    grid-column: 1 / -1;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    overflow: visible;
}

.top-banner-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.top-banner-grid a {
    display: block;
    height: auto;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    transition: transform 0.2s ease;
    background: transparent;
}

.top-banner-grid a:hover {
    transform: translateY(-5px);
}

/* Main Content */
.content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.board-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.board-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255,255,255,0.03);
}

.board-header h2 {
    font-size: 18px;
    font-weight: 700;
}

.board-list {
    list-style: none;
}

.board-list li {
    border-bottom: 1px solid var(--border-color);
}

.board-list li:last-child {
    border-bottom: none;
}

.board-list li a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.board-list li a:hover {
    background: var(--hover-bg);
}

.post-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    color: white;
}

.badge.red { background-color: var(--primary-color); }
.badge.blue { background-color: var(--secondary-color); }
.badge.green { background-color: var(--accent-color); }

.title {
    font-weight: 500;
    font-size: 15px;
    color: var(--text-main);
}

.meta {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    gap: 15px;
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.side-box {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.side-box h3 {
    font-size: 16px;
    margin-bottom: 15px;
    color: var(--text-title);
    border-left: 4px solid var(--secondary-color);
    padding-left: 10px;
}

.side-box img {
    width: 100%;
    margin-bottom: 10px;
    border-radius: 8px;
}

.simple-list {
    list-style: none;
}

.simple-list li {
    padding: 8px 0;
    font-size: 14px;
    border-bottom: 1px dashed var(--border-color);
}

.simple-list li a:hover {
    color: var(--secondary-color);
}

/* Footer */
footer {
    text-align: center;
    padding: 40px 0;
    color: var(--text-muted);
    font-size: 14px;
    border-top: 1px solid var(--border-color);
    margin-top: 50px;
}

/* Detail Page */
.post-detail {
    padding: 30px;
}

.detail-header {
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
}

.detail-header h1 {
    font-size: 28px;
    margin-bottom: 15px;
}

.post-content {
    font-size: 16px;
    color: var(--text-main);
}

.post-content img {
    max-width: 100%;
    border-radius: 12px;
    margin: 20px 0;
}


/* AI Master Grid Consistency Fix */
.top-banner-grid { grid-template-columns: repeat(3, 1fr) !important; }
.top-banner-grid a { height: 120px !important; grid-column: auto !important; width: 100% !important; }
