.wiki-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

/* Sidebar Styles */
.wiki-sidebar {
    width: 280px;
    flex-shrink: 0;
    position: sticky;
    top: 20px;
}

.sidebar-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid #e9ecef;
}

.sidebar-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #495057;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f1f3f5;
}

.sidebar-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-list li {
    padding: 6px 0;
    font-size: 0.85rem;
    border-bottom: 1px dashed #f1f3f5;
}

.sidebar-list li:last-child { border-bottom: none; }

.sidebar-list li a {
    color: #339af0;
    text-decoration: none;
    cursor: pointer;
}

.sidebar-list li a:hover { text-decoration: underline; }

/* Content Area Styles */
.wiki-content {
    flex-grow: 1;
    min-height: 700px;
    padding: 30px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.wiki-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    margin-bottom: 25px;
    border-bottom: 2px solid #339af0;
}

.wiki-page-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: #222222;
    margin: 0;
}

.wiki-actions {
    display: flex;
    gap: 10px;
}

.wiki-last-update {
    font-size: 0.85rem;
    color: #888888;
    margin-bottom: 10px;
    text-align: right;
}

/* Table of Contents (TOC) */
.wiki-toc {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 15px;
    margin-bottom: 30px;
    display: inline-block;
    min-width: 200px;
    border-radius: 4px;
}

.toc-title {
    font-weight: 700;
    text-align: center;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

#tocList {
    padding-left: 20px;
    margin: 0;
    font-size: 0.85rem;
}

#tocList li { margin: 4px 0; }
#tocList a { color: #339af0; text-decoration: none; }
#tocList a:hover { text-decoration: underline; }

/* Wiki Body (Markdown Styles) */
.wiki-body {
    line-height: 1.8;
    color: #343a40;
    font-size: 1rem;
}

.wiki-body h1, .wiki-body h2, .wiki-body h3, .wiki-body h4, .wiki-body h5, .wiki-body h6 {
    scroll-margin-top: 80px;
}

.wiki-body h2 {
    font-size: 1.4rem;
    padding-bottom: 4px;
    margin-top: 40px;
    margin-bottom: 15px;
    font-weight: 700;
}

.wiki-body h3 {
    font-size: 1.2rem;
    margin-top: 30px;
    margin-bottom: 10px;
    font-weight: 700;
}

.wiki-body p { margin-bottom: 15px; }

.wiki-body ul, .wiki-body ol {
    margin-bottom: 15px;
    padding-left: 25px;
}

.wiki-body blockquote {
    border-left: 4px solid #339af0;
    background: #f1f3f5;
    padding: 10px 20px;
    margin: 20px 0;
    color: #495057;
}

.wiki-body table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.wiki-body th, .wiki-body td {
    border: 1px solid #dee2e6;
    padding: 10px;
    text-align: left;
}

.wiki-body th { background: #f8f9fa; font-weight: 700; }

.wiki-body code {
    background: #ddd;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    color: #444;
    font-size: 0.9em;
}

.wiki-body pre {
    background: #343a40;
    color: #e9ecef;
    padding: 15px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 20px 0;
    line-height: 1.5;
    border: 1px solid #495057;
}

.wiki-body pre code {
    background: transparent;
    padding: 0;
    color: inherit;
    font-size: 0.9rem;
    border: none;
}

.wiki-img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 10px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.wiki-internal-link {
    color: #339af0;
    text-decoration: none;
    font-weight: 600;
}

.wiki-internal-link:hover {
    text-decoration: underline;
}

/* Footnote Styles */
.footnote-ref {
    font-size: 0.75em;
    vertical-align: super;
    margin-left: 2px;
    color: #339af0;
    text-decoration: none;
    font-weight: bold;
}

.footnote-ref:hover {
    text-decoration: underline;
}

.footnotes-section {
    margin-top: 50px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
    font-size: 0.9rem;
    color: #495057;
}

.footnotes-section .footnotes-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: #212529;
}

.footnote-list {
    padding-left: 0;
    margin: 0;
    list-style: none;
}

.footnote-item {
    margin-bottom: 8px;
    display: flex;
    gap: 8px;
}

.footnote-backlink {
    color: #339af0;
    text-decoration: none;
    font-weight: bold;
    white-space: nowrap;
}

.footnote-backlink:hover {
    text-decoration: underline;
}

/* Editor Styles */
.wiki-title-input {
    font-size: 1.5rem;
    font-weight: 700;
    width: 100%;
    padding: 10px;
    border: none;
    border-bottom: 2px solid #dee2e6;
}

.wiki-title-input:focus {
    outline: none;
    border-bottom-color: #339af0;
}

.wiki-textarea {
    width: 100%;
    min-height: 500px;
    padding: 15px;
    font-family: 'Pretendard', sans-serif;
    font-size: 0.95rem;
    line-height: 1.6;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    resize: vertical;
}

.wiki-textarea:focus {
    outline: none;
    border-color: #339af0;
}

/* Button and Input Styles */
.btn-action {
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-save {
    background-color: #339af0;
    color: white;
}

.btn-save:hover {
    background-color: #228be6;
    box-shadow: 0 4px 12px rgba(51, 154, 240, 0.3);
}

.btn-cancel {
    background-color: #e9ecef;
    color: #495057;
}

.btn-cancel:hover {
    background-color: #dee2e6;
}

.btn-minimal-xs {
    background: transparent;
    border: 1px solid #dee2e6;
    color: #495057;
    padding: 4px 10px;
    font-size: 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-minimal-xs:hover {
    background-color: #f8f9fa;
    border-color: #adb5bd;
}

.btn-minimal-xs.text-danger {
    color: #fa5252;
}

.btn-minimal-xs.text-danger:hover {
    background-color: #fff5f5;
    border-color: #ffa8a8;
}

.form-control-custom {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.2s;
    background-color: #fcfcfc;
}

.form-control-custom:focus {
    outline: none;
    border-color: #339af0;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(51, 154, 240, 0.1);
}

.w-100 { width: 100%; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mt-3 { margin-top: 1rem; }
.me-2 { margin-right: 0.5rem; }

.hidden { display: none !important; }
