:root {
    --header-height: 60px;
    --footer-height: 50px;
    --sidebar-width: 240px;
    --primary-color: #6200ee;
    --border-color: #e0e0e0;
}

body {
    margin: 0;
    font-family: 'Pretendard', sans-serif;
    height: 100vh;
    display: grid;
    grid-template-areas: 
        "header header"
        "sidebar main"
        "footer footer";
    grid-template-rows: var(--header-height) 1fr var(--footer-height);
    grid-template-columns: var(--sidebar-width) 1fr;
    line-height: 1.7;
    letter-spacing: -0.02em;
    font-size: 18px;
    color: #444444;
}

/* 상단 헤더 */
header {
    grid-area: header;
    background-color: white;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 100;
}

.header-left { display: flex; align-items: center; gap: 15px; }
.logo-area { font-weight: bold; font-size: 1.2rem; color: var(--primary-color); display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-img { height: 32px; width: auto; border-radius: 4px; }

.top-nav a { text-decoration: none; color: #333; margin-left: 20px; font-size: 0.95rem; }
.top-nav a:hover { color: var(--primary-color); }

/* 햄버거 버튼 (기본 숨김) */
.hamburger {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    color: #333;
}

/* 왼쪽 사이드 메뉴 */
aside {
    grid-area: sidebar;
    background-color: #f8f9fa;
    border-right: 1px solid var(--border-color);
    padding: 20px;
    transition: transform 0.3s ease;
}

.side-menu { list-style: none; padding: 0; }
.side-menu li { margin-bottom: 5px; }
.side-menu a { 
    text-decoration: none; 
    color: #555; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 10px; 
    border-radius: 6px; 
    cursor: pointer;
}
.side-menu a:hover { background-color: #e9ecef; color: #000; }

/* 사용자 프로필 영역 (로그인 시 표시) */
.user-profile {
    display: none; /* 기본 숨김 */
    padding: 0 0 20px 0;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    align-items: center;
    gap: 12px;
}
.user-profile.active { display: flex; }
.user-avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; border: 1px solid #eee; }
.user-info { display: flex; flex-direction: column; overflow: hidden; }
.user-name { font-weight: bold; font-size: 0.95rem; color: #333; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-email { font-size: 0.8rem; color: #888; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 하위 메뉴 (폴더) 스타일 */
.sub-menu { list-style: none; padding-left: 10px; display: none; background-color: transparent; }
.sub-menu.open { display: block; }
.sub-menu li a { font-size: 0.95em; padding: 8px 10px; color: #666; }
.sub-menu li a:hover { color: var(--primary-color); background-color: rgba(0,0,0,0.03); }

/* 화살표 아이콘 */
.arrow { font-size: 12px; transition: transform 0.3s ease; }
.menu-toggle.active .arrow { transform: rotate(180deg); }

/* 중앙 메인 콘텐츠 */
main {
    grid-area: main;
    padding: 30px;
    overflow-y: auto;
    background-color: white;
}

.placeholder-img { width: 100%; max-width: 600px; height: auto; border-radius: 8px; margin: 20px 0; display: block; background-color: #eee; }

main h1 {
    font-size: 56px;
    font-weight: 700;
    line-height: 1.2;
    color: #111111;
    margin-bottom: 40px; /* 제목과 본문 사이 여백 확보 */
}

h2 {
    font-size: 36px;
    font-weight: 700;
    line-height: 1.3;
    color: #111111;
    margin-top: 80px;
    margin-bottom: 30px;
}

p {
    font-size: 18px;
    font-weight: 400;
    line-height: 1.7;
    color: #444444;
}

.test-content {
    height: 800px;
    background: #f9f9f9;
    margin-top: 80px; /* 섹션 간 여백을 과감하게 (80px) */
    padding: 20px;
    border: 1px dashed #ccc;
}

/* 하단 고정 정보 */
footer {
    grid-area: footer;
    background-color: #f8f9fa;
    border-top: 1px solid var(--border-color);
    color: #888888;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
}

/* 모바일 반응형 */
@media (max-width: 768px) {
    body { grid-template-areas: "header" "main" "footer"; grid-template-columns: 1fr; grid-template-rows: var(--header-height) 1fr var(--footer-height); }
    .hamburger { display: block; }
    .top-nav { display: none; } /* 모바일에서는 상단 메뉴 숨김 (공간 부족) */
    
    aside {
        position: fixed; top: var(--header-height); left: 0; bottom: 0; width: var(--sidebar-width);
        z-index: 99; transform: translateX(-100%); box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    }
    aside.active { transform: translateX(0); }
}