/* ==========================================================================
   PAI Lab 통합 스타일시트 (중복 제거 및 구조 최적화)
   ========================================================================== */

:root {
    --charcoal: #121214;
    --gold: #d4af37;
    --gold-soft: rgba(212, 175, 55, 0.15);
}

html {
    font-size: 112.5%;
}

body {
    background-color: var(--charcoal);
    color: #e2e8f0;
    font-family: 'Pretendard', sans-serif;
    margin: 0;
    overflow-x: hidden;
    -webkit-text-size-adjust: none;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

h1,
h2,
h3,
.serif {
    font-family: 'Noto Serif KR', serif;
}

/* 1. 헤더 및 아코디언 메뉴 스타일 (중복 통합) */
.mhw-header {
    background-color: #1a1a1e;
    border-bottom: 2px solid var(--gold);
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 50;
    min-height: 70px;
}

.mhw-header nav#nav-menu {
    display: none !important;
    flex-direction: column !important;
    width: 100% !important;
    background-color: #1a1a1e !important;
    border-top: 1px solid #2d3748 !important;
}

.mhw-header nav#nav-menu.active {
    display: flex !important;
}

.mhw-header .nav-item {
    display: block;
    padding: 1rem;
    color: #94a3b8 !important;
    text-align: center;
    border-bottom: 1px solid #2d3748;
    text-decoration: none;
    cursor: pointer;
    font-weight: 500;
}

.mhw-header .nav-item:hover {
    color: var(--gold) !important;
    background-color: #2d3748;
}

/* 2. 화면 분리 및 기본 레이아웃 */
#welcome-screen {
    height: 85vh !important;
    width: 90vw !important;
    margin: 7.5vh auto !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
    background: radial-gradient(circle at center, #1a1a1e 0%, #121214 100%) !important;
    border-radius: 20px !important;
    padding: 2rem !important;
    box-sizing: border-box !important;
}

#main-dashboard {
    display: none !important;
    flex: 1 !important;
    flex-direction: column;
    padding: 20px;
}

#main-dashboard.active {
    display: flex !important;
}

.sub-page-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    color: #e2e8f0;
    box-sizing: border-box;
}

.main-heading {
    font-size: 1.8rem !important;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 20px 0;
    line-height: 1.4;
}

.sub-title {
    font-size: 0.85rem !important;
    color: #d4af37;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 8px;
    font-weight: 700;
}

.essay-paragraph {
    font-size: 1rem !important;
    line-height: 1.75;
    color: #a0aec0;
    margin-bottom: 15px;
    text-align: justify;
}

/* 3. 테이블 및 UI 요소 */
.paper-table-wrapper {
    overflow-x: auto !important;
    display: block !important;
    width: 100% !important;
    white-space: nowrap !important;
}

.paper-table {
    width: 100% !important;
    min-width: 600px !important;
    border-collapse: collapse;
}

.paper-table th {
    background-color: #1a1a1e;
    color: var(--gold);
    border-bottom: 2px solid #2d2d33;
    padding: 14px 15px;
    text-align: left;
}

.paper-table td {
    padding: 14px 15px;
    border-bottom: 1px solid #2d3748;
    cursor: pointer;
}

/* 4. 미디어 쿼리 (통합) */
@media (min-width: 1024px) {
    .mhw-header nav#nav-menu {
        display: flex !important;
        flex-direction: row !important;
        width: auto !important;
        background-color: transparent !important;
        border-top: none !important;
    }

    .mhw-header .nav-item {
        border-bottom: none !important;
        padding: 1rem 1.5rem !important;
    }

    #menu-toggle {
        display: none !important;
    }

    .character-pure-wrapper {
        height: 58vh;
        max-height: 620px;
    }

    .welcome-title-gold {
        font-size: 4.8rem;
    }
}

@media (max-width: 768px) {
    .mhw-header {
        height: auto !important;
        min-height: 60px !important;
    }

    .mobile-flex-col {
        flex-direction: column !important;
    }

    .mobile-hide {
        display: block !important;
    }
}

/* 모달 레이아웃 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}



/* 마스킹 효과 (이미지 하단 가림) */
.image-mask-wrapper {
    position: relative;
    overflow: hidden;
}

.mask-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 33.33%;
    /* 이미지 하단 1/3을 가림 */
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.4) 100%);
    backdrop-filter: blur(8px);
    /* 흐림 처리 */
    display: flex;
    justify-content: center;
    align-items: center;
    color: #d4af37;
    /* Gold 색상 */
    font-weight: bold;
    border-top: 1px solid #d4af37;
    font-size: 1.2rem;
}

/* 학술 아카이브 보안 마스킹 스타일 */
.secure-lens-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    border: 1px solid #d4af37;
}

.blur-secure-curtain {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 33.33%;
    /* 하단 1/3 높이 */
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.4) 100%);
    backdrop-filter: blur(8px);
    /* 흐림 효과 */
    display: flex;
    justify-content: center;
    align-items: center;
    border-top: 1px solid #d4af37;
    box-sizing: border-box;
}

.curtain-text {
    color: #d4af37;
    /* 금색 글자 */
    font-weight: 700;
    font-size: 1.1rem;
    text-align: center;
}

.modal-open {
    display: flex !important;
}

@media (max-width: 768px) {

    /* 모바일에서 컨테이너 좌우 여백 제거 */
    .sub-page-container {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin: 0 !important;
    }

    /* 웰컴 스크린 최적화 */
    #welcome-screen {
        width: 100vw !important;
        height: 100vh !important;
        margin: 0 !important;
        border-radius: 0 !important;
    }

    /* 대시보드 전체 패딩 제거 */
    #main-dashboard {
        padding: 0 !important;
        margin-left: 0px !important;
        margin-right: 0px !important;
    }

    /* 헤더와의 충돌을 막기 위한 강제 여백 및 위치 조정 */
    .hero-banner {
        background: linear-gradient(rgba(18, 18, 20, 0.85), rgba(18, 18, 20, 0.85)), url('https://images.unsplash.com/photo-1451187580459-43490279c0fa?auto=format&fit=crop&q=80');
        background-size: cover;
        background-position: center;
        padding: 60px 0;
        border-bottom: 1px solid #2d2d33;
        width: 100%;
    }

    /* 다음 섹션의 여백 추가 (하단 밀림 방지) */
    #pai-sub-content {
        margin-top: 20px !important;
    }

    .mhw-header {
        min-height: 80px !important;
    }

    /* 텍스트가 화면 끝에 닿는 것을 방지하기 위해 내부 요소에만 여백 적용 */
    .main-heading,
    .essay-paragraph {
        padding-left: 5px !important;
        padding-right: 5px !important;
    }
}