* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #0d1117;
    color: #f0f6fc;
    line-height: 1.6;
}

.header {
    background-color: #161b22;
    border-bottom: 1px solid #30363d;
    padding: 12px 20px;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #58a6ff;
}

.nav-tabs {
    display: flex;
    gap: 20px;
}

.nav-tab {
    padding: 8px 12px;
    color: #8b949e;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s;
}

.nav-tab:hover,
.nav-tab.active {
    color: #f0f6fc;
    background-color: #21262d;
}

.container {
    display: flex;
    min-height: calc(100vh - 60px);
}

.sidebar {
    width: 280px;
    background-color: #0d1117;
    border-right: 1px solid #30363d;
    padding: 20px 0;
    overflow-y: auto;
    position: sticky;
    top: 0px;
    height: 100vh;
}

.sidebar-section {
    margin-bottom: 24px;
}

.sidebar-title {
    font-size: 14px;
    font-weight: 600;
    color: #8b949e;
    padding: 0 20px 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-item {
    display: block;
    padding: 8px 20px;
    color: #f0f6fc;
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.sidebar-item:hover {
    background-color: #161b22;
    border-left-color: #58a6ff;
}

.sidebar-item.active {
    background-color: #21262d;
    border-left-color: #58a6ff;
    color: #58a6ff;
}

.sidebar-item.nested {
    padding-left: 40px;
    font-size: 14px;
}

.main-content {
    flex: 1;
    padding: 32px 40px;
    max-width: calc(100vw - 280px);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    font-size: 14px;
    color: #8b949e;
}

.breadcrumb a {
    color: #58a6ff;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.page-title {
    font-size: 48px;
    font-weight: 300;
    margin-bottom: 16px;
    color: #f0f6fc;
}

.page-subtitle {
    font-size: 18px;
    color: #8b949e;
    margin-bottom: 32px;
    line-height: 1.5;
}

.content-section {
    margin-bottom: 48px;
}

.section-title {
    font-size: 32px;
    font-weight: 400;
    margin-bottom: 16px;
    color: #f0f6fc;
    border-bottom: 2px solid #30363d;
    padding-bottom: 8px;
}

.subsection-title {
    font-size: 24px;
    font-weight: 500;
    margin: 32px 0 16px;
    color: #f0f6fc;
}

.code-block {
    background-color: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    margin: 16px 0;
    overflow: hidden;
    position: relative;
    font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, monospace;
}

.code-header {
    background-color: #21262d;
    border-bottom: 1px solid #30363d;
    padding: 8px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #8b949e;
}

.code-language {
    font-weight: 500;
}

.copy-button {
    background: none;
    border: 1px solid #30363d;
    color: #8b949e;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s;
}

.copy-button:hover {
    background-color: #30363d;
    color: #f0f6fc;
}

.copy-button.copied {
    color: #3fb950;
    border-color: #3fb950;
}

.code-content {
    padding: 16px;
    overflow-x: auto;
    line-height: 1.45;
    font-size: 14px;
}

.code-line {
    display: block;
    margin: 0;
    padding: 0;
}

.inline-code {
    background-color: #161b22;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, monospace;
    font-size: 14px;
    color: #ff7b72;
}

.note {
    background-color: #1c2128;
    border-left: 4px solid #58a6ff;
    padding: 16px;
    margin: 16px 0;
    border-radius: 0 6px 6px 0;
}

.note-title {
    font-weight: 600;
    color: #58a6ff;
    margin-bottom: 8px;
}

.warning {
    background-color: #2d1b0e;
    border-left: 4px solid #f85149;
    padding: 16px;
    margin: 16px 0;
    border-radius: 0 6px 6px 0;
}

.warning-title {
    font-weight: 600;
    color: #f85149;
    margin-bottom: 8px;
}

.table-container {
    overflow-x: auto;
    margin: 16px 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    background-color: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
}

th,
td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #30363d;
}

th {
    background-color: #21262d;
    font-weight: 600;
    color: #f0f6fc;
}

td {
    color: #e6edf3;
}

tr:last-child td {
    border-bottom: none;
}

.feature-list {
    list-style: none;
    margin: 16px 0;
}

.feature-list li {
    padding: 8px 0;
    padding-left: 24px;
    position: relative;
}

.feature-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #3fb950;
    font-weight: bold;
}

.toc {
    background-color: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 20px;
    margin: 24px 0;
}

.toc-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #f0f6fc;
}

.toc ul {
    list-style: none;
}

.toc li {
    margin: 8px 0;
}

.toc a {
    color: #58a6ff;
    text-decoration: none;
}

.toc a:hover {
    text-decoration: underline;
}

.syntax-highlight {
    white-space: pre-line;
}

.syntax-highlight .keyword {
    color: #ff7b72;
    font-weight: 500;
}

.syntax-highlight .string {
    color: #a5d6ff;
}

.syntax-highlight .comment {
    color: #8b949e;
    font-style: italic;
}

.syntax-highlight .function {
    color: #d2a8ff;
}

.syntax-highlight .tag {
    color: #7ee787;
}

.syntax-highlight .attribute {
    color: #79c0ff;
}

.syntax-highlight .value {
    color: #a5d6ff;
}

.syntax-highlight .operator {
    color: #ff7b72;
}

.syntax-highlight .number {
    color: #79c0ff;
}

main button {
    padding: 0.5rem 1rem;
    font-size: 1rem;
    margin-top: 1rem;
    cursor: pointer;
}

main section ul,
main section ol {
    padding-left: 30px;
}

main section table {
    margin-top: 16px;
}

/* 주요 컨테이너 스타일 */
.code-block {
    background-color: #282c34; /* IDE 배경색 */
    color: #abb2bf; /* 기본 텍스트 색상 */
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
    font-family: "Fira Code", "JetBrains Mono", "Consolas", monospace; /* IDE 폰트 */
    font-size: 14px;
}

/* 코드 블록 헤더 스타일 */
.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background-color: #21252b; /* 헤더 배경색 */
    border-bottom: 1px solid #3e4452; /* 헤더 구분선 */
    color: #e0e0e0;
}

.code-language {
    font-weight: bold;
}

.copy-button {
    background: #5c6370;
    color: #fff;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.copy-button:hover {
    background-color: #6a717d;
}

/* 코드 컨텐츠 및 줄 번호 스타일 */
.code-content {
    position: relative; /* 줄 번호의 절대 위치를 위한 설정 */
    padding: 20px;
}

/* syntax-highlight는 기존 스타일 유지 */
.syntax-highlight {
    margin: 0;
    padding: 0;
    line-height: 1.5;
    white-space: pre;
    tab-size: 4; /* 탭 간격 설정 */
    word-break: break-all;
    word-wrap: break-word;
}

/* 줄 번호가 있는 pre 태그에 대한 스타일 */
.syntax-highlight.line-numbers {
    display: flex;
    flex-direction: column;
    padding-left: 60px; /* 줄 번호 공간 확보 */
}

/* 각 줄에 대한 스타일 */
.syntax-highlight.line-numbers .line {
    display: block;
    counter-increment: line; /* 줄 번호 카운터 증가 */
    position: relative; /* 줄 번호의 위치 기준점 */
    padding-left: 10px; /* 코드와 줄 번호 사이 간격 */
    min-height: 21px;
}

/* 줄 번호 생성 */
.syntax-highlight.line-numbers .line::before {
    content: counter(line); /* 카운터 값 표시 */
    position: absolute;
    left: -60px; /* 코드 시작점과 맞추기 */
    width: 50px;
    text-align: right;
    color: #636d83; /* 줄 번호 색상 */
    font-size: 12px;
    padding-right: 10px;
    -webkit-user-select: none; /* 줄 번호 선택 방지 */
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    top: 50%;
    transform: translateY(-50%);
}

/* 문법 강조 스타일 */
.comment {
    color: #8e94a1;
} /* 주석 */
.operator {
    color: #56b6c2;
} /* 연산자 */
.function {
    color: #61afef;
} /* 함수 */
.string {
    color: #98c379;
} /* 문자열 */
.keyword {
    color: #c678dd;
} /* 키워드 */
.red {
    color: red;
}

.sidebar-items {
    overflow: hidden;
    transition: max-height 0.3s ease-in-out; /* 부드러운 애니메이션 효과 */
}

.sidebar-items.collapsed {
    height: 0;
}

@media (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }

    .main-content {
        padding: 24px 32px;
        max-width: calc(100vw - 240px);
    }
}

/* 데스크톱 기본 스타일 */
.hamburger-button {
    display: none; /* 데스크톱에서는 숨김 */
}
.nav-tabs {
    display: flex;
    /* ... 기타 스타일 */
}

/* ------------------------------------------- */
/* 미디어 쿼리: 모바일 환경 */
/* ------------------------------------------- */
@media (max-width: 768px) {
    .header-content {
        justify-content: space-between;
    }

    .hamburger-button {
        display: block; /* 모바일에서 보임 */
        background-color: transparent;
        border: none;
        cursor: pointer;
        padding: 10px;
        z-index: 100;
    }

    .bar {
        display: block;
        width: 25px;
        height: 3px;
        background-color: #333;
        margin: 5px 0;
        transition: 0.4s;
    }

    .nav-tabs {
        position: fixed;
        height: 100dvh;
        width: max-content;
        flex-direction: column;
        transition: 1s;
        left: -100%;
        top: 0;
        background: #161b22;
        padding: 20px;
    }

    /* 메뉴가 활성화되었을 때 */
    .nav-tabs.is-active {
        left: 0;
        z-index: 2;
    }
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: static;
        border-right: none;
        border-bottom: 1px solid #30363d;
    }

    .main-content {
        max-width: 100%;
        padding: 20px;
    }

    .page-title {
        font-size: 36px;
    }
    .nav-tabs {
        right: -100%;
    }
}
