* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Pretendard-Light';
    letter-spacing: 0.03em
}

body {
    background-color: #fff;
    height: 100vh;
    display: flex;
    overflow: hidden;
}

a:not(.terms) {
    text-decoration: none;
    color: #fff;
}

.layout {
    display: flex;
    width: 100%;
}



.login-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(to bottom right, rgba(0, 0, 0, 0.7), rgba(30, 30, 30, 0.7));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease-out;
}

.modal {
    background: #fff;
    padding: 2.5rem;
    border-radius: 1.5rem;
    width: 600px;
    text-align: center;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
    animation: scaleUp 0.3s ease-out;
}

.login-modal p {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 1rem;
}

.login-modal .logo {
    width: 200px;
    margin-bottom: 1rem;
}

.login-modal span {
    font-size: 0.7rem;
}



.social-login {
    width: 100%;
    padding: 0.8rem;
    margin-top: 0.7rem;
    margin-bottom: 1rem;
    border-radius: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    font-size: 1rem;
    cursor: pointer;
    background-color: #f9f9f9;
    color: #333;
    border: 1px solid #ccc;
    transition: all 0.2s ease-in-out;
}

.social-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
    background-color: #fff;
}

.social-login img {
    width: 22px;
    height: 22px;
}

.hidden {
    display: none;
}

/* 애니메이션 효과 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes scaleUp {
    from {
        transform: scale(0.95);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}






/* ===== 왼쪽 사이드바 ===== */
.sidebar {
    width: 260px;
    min-width: 260px;
    height: 100vh;
    background-color: #f9fbff;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #dbe4ff;
    display: flex;
    gap: 2rem;
}

.logo {
    gap: 0.5rem;
}

.logo img {
    height: 40px;
}


.balance-section {
    background-color: #eef4ff;
    padding: 1rem;
    border-radius: 0.75rem;
    text-align: center;
}

.balance-label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.2rem;
}

.balance-amount {
    font-size: 1.4rem;
    font-weight: bold;
    color: #3366cc;
    margin-bottom: 0.6rem;
}

.charge-btn {
    background-color: #3366ff;
    color: #fff;
    border: none;
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.charge-btn:hover {
    background-color: #2b5edb;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

/* 인스턴스 섹션 제목 */
.sidebar span {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: -1rem;
    display: block;
}

/* 인스턴스 버튼 스타일 */
.sidebar-menu button,
.sidebar-menu a {
    display: flex;
    align-items: center;
    /* 세로 정렬 중앙 */
    gap: 0.5rem;
    padding: 0.4rem 0.2rem;
    font-size: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #333;
    border-radius: 0.4rem;
    overflow: hidden;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.sidebar-menu button img,
.sidebar-menu a img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    vertical-align: middle;
}

.sidebar-menu button:hover,
.sidebar-menu a:hover {
    color: #3366cc;
    background-color: #f0f4ff;
}






/* ===== 메인 콘텐츠 ===== */
.main-content {
    flex-grow: 1;
    padding: 1.5rem 2rem;
    overflow: auto;
    scroll-behavior: smooth;
}

.header {
    display: flex;
    justify-content: space-between;
    /* 좌우 정렬 */
    align-items: center;
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
    border-bottom: #c2d4ff solid 1px;
}

/* 완쪽 정렬된 부분 */
.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

/* 인스턴스 텍스트 */
.header h2 {
    font-size: 1.4rem;
    color: #333;
    margin-right: 1rem;
    font-weight: bold;
}

/* 오른쪽 정렬된 부분 */
.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.avatar {
    width: 30px;
    height: 30px;
    margin: 5px;
    border-radius: 50%;
    object-fit: cover;
}

.username {
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
    line-height: 40px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    height: 40px;
}



/********************** 메인 **********************/


/* 기본 목차 박스 스타일 */
.toc {
    position: fixed;
    height: calc(100vh - 290px);
    overflow-y: auto;
    top: 130px;
    right: 3rem;
    width: 310px;
    padding: 20px;
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* 목차 제목 */
.toc h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: #111827;
    border-bottom: 1px solid #d1d5db;
    padding-bottom: 0.5rem;
}

/* 항목 목록 스타일 */
.toc ol {
    list-style: decimal;
    padding-left: 1.5rem;
    margin: 0;
    margin-bottom: -0.8rem;
}

/* 항목 링크 스타일 */
.toc li {
    margin-bottom: 0.8rem;
}

.toc a {
    text-decoration: none;
    color: #2563eb;
    font-weight: 500;
    transition: color 0.2s ease;
}

.toc a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}




.text-content {
    width: calc(100vw - 550px - 10rem);
    line-height: 140%;
    margin-left: 8px;
    margin-top: -1rem;
    margin-bottom: 1rem;
    word-break: keep-all;
    /* 영어는 break-all */
}

.title {
    font-size: 1.4rem;
    color: #444;
    margin-top: 4rem;
    margin-bottom: 1rem;
    margin-left: -4px;
    font-weight: bold;
    scroll-margin-top: 25vh;
}

code {
    color: #005cc5;
}




@media (max-width: 768px) {
    .sidebar {
        width: 70vw;
        height: 100vh;
        background-color: #ecf1ff;
        z-index: 999999999999;
        position: fixed;
        left: -75vw;

        transition: 0.4s;
    }

    .sidebar-backdrop {
        position: fixed;
        width: 100vw;
        height: 100vh;
        background-color: black;
        opacity: 0.5;
        z-index: 99999;
    }

    .toc {
        display: none;
    }

    .header {
        margin-bottom: 0;
    }

    .text-content {
        width: calc(100%);
        margin: 0;
        margin-top: -2rem;
    }
    
    iframe {
        margin-top: -1rem;
        width: calc(100%);
        height: calc((100vw - 64px) / 16 * 9);
    }

    .modal {
        width: 85vw;
    }
}




@font-face {
    font-family: 'Pretendard-Light';
    src: url('https://fastly.jsdelivr.net/gh/Project-Noonnu/noonfonts_2107@1.1/Pretendard-Light.woff') format('woff');
    font-weight: 400;
    font-style: normal;
}