@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=Noto+Sans+KR:wght@400;500;700&display=swap");

:root {
    --bg: #f7f4ee;
    --panel: #ffffff;
    --panel-soft: #fdfbf7;
    --text: #1e2326;
    --muted: #6c7276;
    --accent: #2f6f6a;
    --accent-soft: #e3efed;
    --border: #e5e0d7;
    --shadow: 0 18px 40px rgba(46, 52, 51, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "IBM Plex Sans", "Noto Sans KR", sans-serif;
    background: var(--bg);
    color: var(--text);
}

a {
    color: inherit;
    text-decoration: none;
}

mark {
    background: rgba(47, 111, 106, 0.2);
    color: inherit;
    padding: 0 2px;
    border-radius: 4px;
}

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 72px;
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 0 28px;
    background: var(--panel-soft);
    border-bottom: 1px solid var(--border);
    z-index: 10;
}

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

.logo {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    letter-spacing: 1px;
}

.brand-title {
    font-weight: 700;
}

.brand-subtitle {
    font-size: 12px;
    color: var(--muted);
}

.main-nav {
    display: flex;
    gap: 16px;
    flex: 1;
}

.main-nav a {
    padding: 8px 14px;
    border-radius: 999px;
    font-weight: 500;
    color: var(--muted);
}

.main-nav a.active {
    background: var(--accent-soft);
    color: var(--accent);
}

.search-box {
    min-width: 260px;
}

.lang-select select {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 12px;
    background: #fff;
    font-size: 14px;
}

.search-box input {
    width: 100%;
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #fff;
}

.sidebar-toggle {
    display: none;
    border: none;
    background: var(--accent-soft);
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 18px;
}

.site-main {
    display: flex;
    gap: 24px;
    padding: 100px 24px 12px;
}

.sidebar {
    width: 280px;
    background: var(--panel);
    border-radius: 24px;
    padding: 20px 18px;
    border: 1px solid var(--border);
    height: calc(100vh - 140px);
    position: sticky;
    top: 96px;
    overflow: auto;
}

.sidebar-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

.tree-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 4px;
    font-size: 14px;
}

.tree-item a,
.tree-item .label {
    padding: 6px 10px;
    border-radius: 10px;
    display: inline-block;
}

.tree-item a.active {
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
}

.tree-children {
    margin-left: 16px;
    border-left: 1px solid #ece6dd;
    padding-left: 8px;
}

.caret {
    width: 16px;
    color: var(--muted);
    text-align: center;
}

.caret.empty {
    visibility: hidden;
}

.content {
    flex: 1;
    background: var(--panel);
    border-radius: 24px;
    border: 1px solid var(--border);
    padding: 28px 32px 24px;
    box-shadow: var(--shadow);
}

.hero {
    background: var(--panel-soft);
    padding: 28px;
    border-radius: 24px;
    border: 1px solid var(--border);
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 20px;
    align-items: stretch;
}

.hero h1 {
    margin-top: 0;
    font-size: 32px;
}

.hero-search input {
    margin-top: 16px;
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.news-panel {
    background: var(--panel-soft);
    border-radius: 24px;
    border: 1px solid var(--border);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.news-header h2 {
    margin: 0;
    font-size: 20px;
}

.news-body {
    font-size: 13px;
    line-height: 1.5;
    color: var(--text);
    max-height: 240px;
    overflow: auto;
    padding-right: 4px;
}

.news-body h1,
.news-body h2,
.news-body h3 {
    font-size: 14px;
    margin: 12px 0 6px;
}

.news-body p {
    margin: 0 0 8px;
}

.news-body ul,
.news-body ol {
    margin: 0 0 8px 16px;
    padding: 0;
}

.news-empty {
    margin: 0;
    color: var(--muted);
}

.card-grid {
    margin-top: 24px;
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.card {
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 16px;
    background: #fff;
}

.card-title {
    font-weight: 600;
    margin-bottom: 8px;
}

.recent {
    margin-top: 32px;
}

.recent-list {
    display: grid;
    gap: 12px;
    margin-top: 12px;
}

.breadcrumb {
    display: flex;
    gap: 8px;
    font-size: 13px;
    color: var(--muted);
}

.doc-title {
    margin-top: 16px;
    font-size: 30px;
}

.doc-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 12px;
}

.doc-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 32px;
    align-items: start;
}

.markdown {
    line-height: 1.7;
}

.markdown h1,
.markdown h2,
.markdown h3,
.markdown h4 {
    margin-top: 28px;
    scroll-margin-top: 110px;
}

.markdown pre {
    background: #1c1f22;
    color: #f8f8f2;
    padding: 16px;
    border-radius: 12px;
    overflow: auto;
}

.markdown code {
    background: #f1ece3;
    padding: 2px 6px;
    border-radius: 6px;
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.9em;
}

.markdown pre code {
    background: transparent;
    padding: 0;
    color: inherit;
}

.markdown img {
    max-width: 100%;
    border-radius: 12px;
}

.markdown .anchor {
    margin-left: 8px;
    font-size: 0.8em;
    color: var(--muted);
    opacity: 0;
}

.markdown h1:hover .anchor,
.markdown h2:hover .anchor,
.markdown h3:hover .anchor,
.markdown h4:hover .anchor {
    opacity: 1;
}

.tableWrap {
    overflow-x: auto;
}

.tableWrap table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.tableWrap th,
.tableWrap td {
    border: 1px solid var(--border);
    padding: 8px 10px;
    text-align: left;
}

.toc {
    position: sticky;
    top: 120px;
    padding: 16px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--panel-soft);
    font-size: 13px;
}

.toc-title {
    font-weight: 600;
    margin-bottom: 10px;
}

.toc-item {
    display: block;
    padding: 4px 0 4px 8px;
    color: var(--muted);
}

.toc-item.active {
    color: var(--accent);
    font-weight: 600;
}

.toc-item.depth-3 {
    padding-left: 18px;
}

.toc-item.depth-4 {
    padding-left: 28px;
}

.doc-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 32px;
    font-weight: 500;
}

.doc-nav a {
    color: var(--accent);
}

.search-header {
    margin-bottom: 16px;
}

.search-result {
    display: block;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 16px;
    margin-bottom: 12px;
    background: #fff;
}

.result-header {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 6px;
}

.badge {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 999px;
    font-weight: 600;
}

.badge.doc {
    background: #f0efe9;
}

.badge.section {
    background: var(--accent-soft);
    color: var(--accent);
}

.result-title {
    font-weight: 600;
}

.result-section {
    font-size: 12px;
    color: var(--muted);
}

.result-path {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 6px;
}

.result-snippet {
    font-size: 14px;
    color: var(--text);
}

.empty {
    padding: 24px;
    border-radius: 16px;
    background: var(--panel-soft);
    border: 1px solid var(--border);
}

.not-found {
    text-align: center;
    padding: 40px 20px;
}

.button {
    display: inline-block;
    padding: 10px 16px;
    background: var(--accent);
    color: #fff;
    border-radius: 999px;
    margin-top: 12px;
}

.site-footer {
    padding: 8px 24px 10px;
    text-align: center;
    color: var(--muted);
    font-size: 12px;
}

@media (max-width: 1100px) {
    .doc-body {
        grid-template-columns: 1fr;
    }
    .toc {
        display: none;
    }
    .hero-grid {
        grid-template-columns: 1fr;
    }
    .news-body {
        max-height: none;
    }
}

@media (max-width: 900px) {
    .main-nav {
        display: none;
    }
    .search-box {
        flex: 1;
        min-width: 180px;
    }
    .sidebar-toggle {
        display: inline-flex;
    }
    .sidebar {
        position: fixed;
        left: -320px;
        top: 72px;
        height: calc(100vh - 72px);
        transition: left 0.2s ease;
        z-index: 9;
    }
    body.sidebar-open .sidebar {
        left: 16px;
    }
    .site-main {
        padding: 100px 16px 24px;
    }
}

@media (max-width: 720px) {
    .search-box {
        display: none;
    }
}
