/* 나무위키 기본 테마 스타일 */
* { box-sizing: border-box; }
html { font-size: 15px; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', Roboto, sans-serif;
  background: #f5f5f5;
  color: #373a3c;
  line-height: 1.5;
}
a { color: #0275d8; text-decoration: none; }
a:hover { text-decoration: underline; }
a.not-exist, .wiki-link-internal.not-exist { color: #ff0000; }
img { max-width: 100%; }
code, pre, textarea.raw-text, #editText { font-family: 'Menlo', 'Consolas', 'D2Coding', 'NanumGothicCoding', monospace; }
.muted { color: #777; }
.inline { display: inline; }

/* ---------- 상단 바 ---------- */
.navbar { background: #008275; color: #fff; }
.navbar-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 12px;
  display: flex; align-items: center; height: 48px; gap: 6px;
}
.navbar a { color: #fff; }
.navbar a:hover { text-decoration: none; background: rgba(255,255,255,.12); }
.navbar-brand { font-size: 18px; font-weight: bold; padding: 0 12px; line-height: 48px; }
.navbar-brand:hover { background: transparent !important; }
.navbar-menu, .navbar-user, .dropdown-menu { list-style: none; margin: 0; padding: 0; }
.navbar-menu { display: flex; }
.navbar-menu > li > a, .navbar-user > li > a { display: block; padding: 0 12px; line-height: 48px; font-size: 14px; white-space: nowrap; }
.navbar-user { display: flex; margin-left: auto; }
.navbar-user small { opacity: .8; }
.navbar-user form { display: inline; }
.navbar-user button, .dropdown-menu button { background: none; border: none; color: inherit; font: inherit; cursor: pointer; padding: 0; text-align: left; width: 100%; }

.dropdown { position: relative; }
.dropdown-menu {
  display: none; position: absolute; top: 100%; left: 0; z-index: 50;
  min-width: 190px; background: #fff; border: 1px solid #ccc; box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.dropdown-menu.dropdown-right { left: auto; right: 0; }
.dropdown.open > .dropdown-menu, .dropdown:hover > .dropdown-menu { display: block; }
.dropdown-menu li > a, .dropdown-menu li > form > button { display: block; padding: 7px 14px; color: #373a3c; font-size: 14px; line-height: 1.4; }
.dropdown-menu li > a:hover, .dropdown-menu li > form > button:hover { background: #f0f0f0; color: #373a3c; text-decoration: none; }

.navbar-search { position: relative; display: flex; flex: 1; max-width: 420px; margin: 0 8px; }
.navbar-search input {
  flex: 1; min-width: 80px; height: 32px; padding: 0 10px; border: none; border-radius: 3px 0 0 3px;
  font-size: 14px; font-family: inherit; color: #373a3c;
}
.navbar-search button {
  height: 32px; padding: 0 10px; border: none; background: #e6e6e6; color: #444;
  cursor: pointer; font-size: 13px; font-family: inherit; border-left: 1px solid #ccc;
}
.navbar-search button:last-of-type { border-radius: 0 3px 3px 0; }
.navbar-search button:hover { background: #d8d8d8; }
.search-suggest {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 60; margin-top: 2px;
  background: #fff; border: 1px solid #ccc; list-style: none; padding: 0;
}
.search-suggest li { padding: 6px 10px; font-size: 14px; color: #373a3c; cursor: pointer; }
.search-suggest li:hover, .search-suggest li.active { background: #eef3fa; }

/* ---------- 본문 틀 ---------- */
.wiki-wrap { max-width: 1200px; margin: 0 auto; padding: 16px 12px 40px; }
.wiki-main { display: flex; gap: 16px; align-items: flex-start; }
.wiki-article {
  flex: 1; min-width: 0; background: #fff; border: 1px solid #e0e0e0;
  padding: 16px 20px 24px;
}
.wiki-side { width: 240px; flex-shrink: 0; background: #fff; border: 1px solid #e0e0e0; font-size: 13px; }
.wiki-side-title { padding: 7px 10px; border-bottom: 1px solid #e0e0e0; font-weight: bold; }
.wiki-side-list { list-style: none; margin: 0; padding: 0; }
.wiki-side-list li { display: flex; justify-content: space-between; gap: 6px; padding: 4px 10px; border-bottom: 1px solid #f0f0f0; }
.wiki-side-list li a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wiki-side-list .time { color: #999; flex-shrink: 0; }
@media (max-width: 900px) { .wiki-side { display: none; } }

.wiki-article-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.wiki-title { font-size: 30px; font-weight: bold; margin: 0 0 4px; line-height: 1.25; word-break: break-all; }
.wiki-title a { color: inherit; }
.wiki-title a:hover { text-decoration: none; }
.wiki-title small { font-size: 16px; font-weight: normal; }
.wiki-last-edit { margin: 0 0 6px; font-size: 13px; color: #777; text-align: right; }
.wiki-notice-from { margin: 0 0 8px; font-size: 13px; color: #777; }

.wiki-tabs { display: flex; flex-shrink: 0; border: 1px solid #ccc; border-radius: 3px; overflow: visible; margin-top: 6px; }
.wiki-tab { display: block; padding: 5px 12px; font-size: 13px; color: #373a3c; background: #fff; border-right: 1px solid #ccc; }
.wiki-tab:hover { background: #eee; text-decoration: none; }
.wiki-tab.active { background: #e8e8e8; }
.wiki-tabs > :last-child .wiki-tab, .wiki-tabs > a:last-child { border-right: none; }
.wiki-tab-more .dropdown-menu { min-width: 120px; }

.wiki-alert { background: #f6f6f6; border: 1px solid #ddd; border-left: 4px solid #999; padding: 8px 12px; margin: 8px 0 12px; font-size: 14px; }
.wiki-alert-danger { background: #fdf3f3; border-color: #e6b8b8; border-left-color: #c9302c; }

.wiki-category { border: 1px solid #ccc; padding: 6px 10px; margin: 6px 0 14px; font-size: 14px; }
.wiki-category .sep { color: #999; margin: 0 6px; }

/* ---------- 문서 본문 ---------- */
.wiki-content { font-size: 15px; word-break: break-word; }
.wiki-paragraph { margin: 0; line-height: 1.6; }
.wiki-heading { font-weight: bold; margin: 24px 0 10px; padding-bottom: 6px; border-bottom: 1px solid #ccc; line-height: 1.3; overflow: hidden; }
h1.wiki-heading { font-size: 28px; }
h2.wiki-heading { font-size: 24px; }
h3.wiki-heading { font-size: 20px; }
h4.wiki-heading { font-size: 18px; }
h5.wiki-heading { font-size: 16px; }
h6.wiki-heading { font-size: 15px; }
.wiki-heading > a:first-child { color: inherit; }
.wiki-heading > a:first-child:hover { text-decoration: none; }
.wiki-edit-section { font-size: 13px; font-weight: normal; margin-left: 4px; }
.wiki-edit-section a { color: #888; }
.wiki-heading-fold { margin-bottom: 8px; }
.wiki-heading-fold > summary { cursor: pointer; color: #777; font-size: 13px; list-style: none; }
.wiki-heading-fold > summary::-webkit-details-marker { display: none; }

.wiki-macro-toc {
  display: inline-block; min-width: 200px; max-width: 100%;
  border: 1px solid #ccc; background: #f5f5f5; padding: 7px 12px 8px; margin: 4px 0 16px; font-size: 14px;
}
.toc-title { font-weight: bold; margin-bottom: 3px; }
.toc-item { line-height: 1.6; }
.toc-indent-1 { padding-left: 0; }
.toc-indent-2 { padding-left: 0; }
.toc-indent-3 { padding-left: 16px; }
.toc-indent-4 { padding-left: 32px; }
.toc-indent-5 { padding-left: 48px; }
.toc-indent-6 { padding-left: 64px; }

.wiki-list { margin: 4px 0; padding-left: 26px; }
.wiki-list li { margin: 1px 0; }
.wiki-list .wiki-list { margin: 0; }
.plain-list { list-style: disc; }
.wiki-indent { margin-left: 26px; }
.wiki-quote {
  margin: 8px 0; padding: 8px 12px; border-left: 5px solid #ccc; background: #fafafa; color: #555;
}
.wiki-hr { border: none; border-top: 1px solid #ccc; margin: 14px 0; overflow: hidden; }
.wiki-macro-toc, .wiki-quote, .wiki-pre, .wiki-code, .wiki-footnote { overflow: hidden; }
.wiki-literal { background: #f2f2f2; padding: 1px 4px; border-radius: 2px; font-size: .92em; }
.wiki-pre, .wiki-code { background: #f8f8f8; border: 1px solid #ddd; padding: 8px 12px; margin: 6px 0; overflow-x: auto; font-size: 13px; line-height: 1.45; white-space: pre; }
.wiki-size-up-1 { font-size: 1.2em; } .wiki-size-up-2 { font-size: 1.4em; } .wiki-size-up-3 { font-size: 1.6em; } .wiki-size-up-4 { font-size: 1.8em; } .wiki-size-up-5 { font-size: 2em; }
.wiki-size-down-1 { font-size: .9em; } .wiki-size-down-2 { font-size: .8em; } .wiki-size-down-3 { font-size: .7em; } .wiki-size-down-4 { font-size: .6em; } .wiki-size-down-5 { font-size: .5em; }
.wiki-style { margin: 4px 0; }
.wiki-folding { margin: 6px 0; }
.wiki-folding > summary { cursor: pointer; color: #555; }
.wiki-folding-content { padding: 6px 0 0 4px; }
.wiki-include { display: contents; }
.wiki-image { vertical-align: middle; }
.wiki-image-align-center { display: block; text-align: center; }
.wiki-image-align-right { float: right; margin: 0 0 8px 12px; }
.wiki-image-align-left { float: left; margin: 0 12px 8px 0; }
.wiki-youtube { max-width: 100%; }
.wiki-link-external::after { content: ''; display: inline-block; width: 9px; height: 9px; margin-left: 3px; background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%230275d8' d='M7 1h4v4L9.6 3.6 5.5 7.7 4.3 6.5l4.1-4.1zM1 3h3v1.5H2.5v5h5V7H9v3H1z'/%3E%3C/svg%3E"); }
.wiki-self-link { font-weight: bold; }

.wiki-table-wrap { margin: 6px 0; overflow-x: auto; }
.wiki-table-wrap.table-center { display: flex; justify-content: center; }
.wiki-table-wrap.table-right { float: right; margin: 0 0 12px 16px; max-width: 100%; }
.wiki-table-wrap.table-left { float: left; margin: 0 16px 12px 0; max-width: 100%; }
.wiki-table { border-collapse: collapse; border: 2px solid #ccc; background: #fff; }
.wiki-table td, .wiki-table th { border: 1px solid #ccc; padding: 3px 8px; vertical-align: middle; }
.wiki-table th { background: #f4f4f4; text-align: left; }
.wiki-table caption { font-weight: bold; padding: 4px; }
.wiki-content::after { content: ''; display: block; clear: both; }

.wiki-fn-content { font-size: .85em; vertical-align: super; line-height: 0; }
.wiki-footnote { margin-top: 24px; padding-top: 8px; border-top: 1px solid #ccc; font-size: 14px; }
.footnote-list { margin: 2px 0; line-height: 1.6; }
.footnote-anchor a { margin-right: 4px; }
.footnote-anchor:target { background: #fff3c0; }

/* 분류 문서 */
.wiki-category-list { margin-top: 16px; }
.category-group { margin: 8px 0; }
.category-group-title { font-weight: bold; font-size: 16px; margin-bottom: 2px; }

/* ---------- 편집 ---------- */
.edit-toolbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 12px 0 6px; }
.edit-toolbar .edit-tools { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
#tabEdit[data-active="1"], #tabPreview[data-active="1"] { background: #ddd; }
#editText { width: 100%; padding: 8px 10px; border: 1px solid #ccc; font-size: 14px; line-height: 1.5; resize: vertical; }
.preview-pane { border: 1px solid #ccc; padding: 12px 16px; min-height: 200px; }
.edit-bottom { margin-top: 12px; }
.edit-log { display: block; font-size: 14px; }
.edit-log input { width: 100%; margin-top: 4px; }
.edit-agree { display: block; margin: 12px 0; font-size: 13px; color: #555; line-height: 1.5; }
.edit-actions { display: flex; gap: 8px; }

.btn, .btn-primary, .btn-danger {
  display: inline-block; padding: 6px 14px; border: 1px solid #ccc; background: #fff; color: #373a3c;
  font-size: 14px; font-family: inherit; cursor: pointer; border-radius: 3px; line-height: 1.4;
}
.btn:hover { background: #eee; text-decoration: none; }
.btn-primary { background: #0275d8; border-color: #0275d8; color: #fff; }
.btn-primary:hover { background: #025aa5; color: #fff; }
.btn-danger { background: #d9534f; border-color: #d9534f; color: #fff; }
.btn-danger:hover { background: #c9302c; }
.btn-sm { padding: 2px 8px; font-size: 12px; }
.tool-group { display: inline-flex; gap: 3px; padding-right: 6px; margin-right: 2px; border-right: 1px solid #ddd; }
.tool-group:last-child { border-right: none; }
.tool-pop { position: relative; }
.tool-popover { position: absolute; top: 100%; left: 0; z-index: 40; margin-top: 4px; background: #fff; border: 1px solid #bbb; box-shadow: 0 2px 8px rgba(0,0,0,.15); padding: 8px 10px; min-width: 220px; font-size: 13px; }
.tool-pop-title { font-weight: bold; margin-bottom: 6px; }
.tool-pop-hint { color: #777; font-size: 12px; margin-top: 6px; }
.tool-popover label { display: flex; align-items: center; gap: 6px; margin: 4px 0; }
.tool-popover label input[type=number] { width: 60px; padding: 3px 6px; }
.tool-popover .btn { margin-top: 6px; }
.pop-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 5px 6px; border: none; background: none; cursor: pointer; text-align: left; font-family: inherit; }
.pop-item:hover { background: #f0f0f0; }
.pop-item code { color: #888; font-size: 12px; }
.h-sample { font-weight: bold; }
.h-sample.h2 { font-size: 18px; } .h-sample.h3 { font-size: 16px; } .h-sample.h4 { font-size: 14px; }
.btn-upload { border-color: #008275; color: #008275; }
.btn-upload:hover { background: #e6f4f2; }
.upload-status { font-size: 12px; align-self: center; }

input[type=text], input[type=password], select, textarea {
  padding: 6px 8px; border: 1px solid #ccc; border-radius: 2px; font-size: 14px; font-family: inherit; color: #373a3c; background: #fff;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: #66afe9; }
.simple-form { max-width: 560px; }
.simple-form label { display: block; margin: 12px 0; font-size: 14px; }
.simple-form label input[type=text], .simple-form label input[type=password], .simple-form textarea { display: block; width: 100%; margin-top: 4px; }
.simple-form .inline-check { display: flex; align-items: center; gap: 6px; }
.simple-form .inline-check input { width: auto; margin: 0; }
.auth-article { max-width: 480px; margin: 0 auto; }
.raw-text { width: 100%; padding: 8px 10px; border: 1px solid #ccc; font-size: 13px; line-height: 1.5; background: #fafafa; margin-top: 8px; }

/* ---------- 역사 / 비교 / 최근 변경 ---------- */
.history-list { list-style: none; padding: 0; margin: 8px 0; font-size: 14px; }
.history-item { padding: 5px 0; border-bottom: 1px solid #eee; line-height: 1.6; }
.history-date { color: #555; }
.history-links { color: #777; }
.history-rev { margin-left: 4px; }
.history-delta.plus { color: #2e8b2e; }
.history-delta.minus { color: #d9534f; }
.history-type { color: #999; font-size: 13px; }
.history-editor { margin-left: 2px; }
.history-comment { color: #555; }
.pager { margin-top: 12px; display: flex; gap: 8px; }

.diff-wrap { overflow-x: auto; margin-top: 8px; }
.diff-table { border-collapse: collapse; width: 100%; font-size: 13px; }
.diff-table td { padding: 1px 6px; vertical-align: top; }
.diff-table .ln { width: 40px; text-align: right; color: #999; background: #f7f7f7; border-right: 1px solid #ddd; user-select: none; }
.diff-table .code { white-space: pre-wrap; word-break: break-all; font-family: Menlo, Consolas, monospace; }
.diff-add { background: #e6ffed; }
.diff-del { background: #ffeef0; }
.diff-skip td { text-align: center; color: #999; background: #f0f4f8; padding: 3px; }

.filter-bar { display: flex; gap: 4px; flex-wrap: wrap; margin: 8px 0 12px; font-size: 14px; }
.filter-bar a { padding: 4px 10px; border: 1px solid #ccc; border-radius: 3px; color: #373a3c; }
.filter-bar a.active { background: #e8e8e8; }
.filter-bar a:hover { text-decoration: none; background: #f0f0f0; }
.rc-table { width: 100%; font-size: 14px; }
.rc-table th { text-align: left; }
.rc-comment { color: #777; font-size: 13px; }
.rc-func { white-space: nowrap; color: #999; }
.rc-date { white-space: nowrap; color: #555; }
.rc-delete td:first-child > a { text-decoration: line-through; }

/* ---------- 토론 ---------- */
.thread-list { list-style: none; padding: 0; margin: 4px 0 12px; font-size: 14px; }
.thread-list li { padding: 5px 0; border-bottom: 1px solid #eee; }
.thread-topic { font-size: 22px; margin: 8px 0 2px; }
.thread-closed { color: #d9534f; font-size: 14px; }
.thread-form { margin-top: 12px; max-width: 760px; }
.thread-form label { display: block; margin: 8px 0; font-size: 14px; }
.thread-form input[type=text], .thread-form textarea { display: block; width: 100%; margin-top: 4px; }
.thread-form textarea { margin-bottom: 8px; }
.thread-status { margin-top: 16px; }
.comments { margin: 12px 0; }
.comment { border: 1px solid #ddd; margin-bottom: 8px; }
.comment-head { display: flex; gap: 10px; align-items: center; padding: 5px 10px; background: #f6f6f6; border-bottom: 1px solid #ddd; font-size: 13px; }
.comment-no { color: #999; }
.comment-author { font-weight: bold; }
.comment-date { color: #999; margin-left: auto; }
.comment-body { padding: 10px 12px; font-size: 14px; }
.comment-status .comment-body { color: #888; font-style: italic; }

/* ---------- 기타 ---------- */
.search-results { list-style: none; padding: 0; }
.search-results li { padding: 8px 0; border-bottom: 1px solid #eee; }
.search-title { font-size: 17px; }
.search-snippet { color: #555; font-size: 14px; margin-top: 2px; }
.stats-table td:first-child, .acl-table td:first-child { width: 160px; background: #f6f6f6; }
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 8px; }
.file-card { display: block; border: 1px solid #ddd; padding: 6px; text-align: center; font-size: 12px; color: #373a3c; }
.file-card img { width: 100%; height: 100px; object-fit: contain; display: block; margin-bottom: 4px; }
.special-list li { margin: 3px 0; }

.wiki-footer { border-top: 1px solid #ddd; background: #f5f5f5; color: #777; font-size: 12px; }
.wiki-footer-inner { max-width: 1200px; margin: 0 auto; padding: 16px 12px 24px; }
.wiki-footer p { margin: 3px 0; }

@media (max-width: 720px) {
  .navbar-inner { flex-wrap: wrap; height: auto; padding-bottom: 6px; }
  .navbar-search { order: 3; flex-basis: 100%; max-width: none; margin: 4px 0 0; }
  .navbar-menu > li > a, .navbar-user > li > a { padding: 0 8px; line-height: 40px; }
  .navbar-brand { line-height: 40px; }
  .wiki-article { padding: 12px; }
  .wiki-title { font-size: 24px; }
  .wiki-table-wrap.table-right, .wiki-table-wrap.table-left { float: none; margin: 8px 0; }
}
