/* =========================================================
   기본 색상
========================================================= */

:root {

    --body-bg: #ffffff;

    --text-color: #222222;

    --menu-bg: #ffffff;

    --menu-border: #e5e7eb;

    --menu-text: #333333;

    --menu-hover: #f7f7f7;

    --menu-active-bg: #222222;

    --menu-active-text: #ffffff;

    --content-bg: #ffffff;

    --content-border: #eeeeee;

    --footer-border: #eeeeee;

    --footer-text: #888888;

}


/* =========================================================
   기본 초기화
========================================================= */

* {
    box-sizing: border-box;
}

html,
body {

    margin: 0;

    padding: 0;
}


body {

    min-width: 990px;

    background: var(--body-bg);

    color: var(--text-color);

    font-family:
        Arial,
        "Malgun Gothic",
        "맑은 고딕",
        sans-serif;

    font-size: 14px;

    line-height: 1.6;

    transition:
        background 0.2s ease,
        color 0.2s ease;
}


/* =========================================================
   전체 레이아웃
========================================================= */

.xe-layout {

    width: 1000px;

    margin: 0 auto;

    padding: 0;
}


/* =========================================================
   상단
========================================================= */

.layout-top {

    display: flex;

    justify-content: flex-end;

    align-items: center;

    width: 100%;

    height: 50px;
}


/* =========================================================
   테마 버튼
========================================================= */

.mode-switch {

    display: flex;

    align-items: center;

    justify-content: flex-end;
}


#theme-toggle {

    display: inline-flex;

    align-items: center;

    justify-content: center;

    gap: 6px;

    height: 34px;

    padding: 0 12px;

    border: 1px solid var(--menu-border);

    border-radius: 17px;

    background: var(--menu-bg);

    color: var(--menu-text);

    cursor: pointer;

    font-family: inherit;

    font-size: 12px;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease;
}


#theme-toggle:hover {

    background: var(--menu-hover);
}


/* =========================================================
   메뉴
========================================================= */

.main-menu {

    width: 100%;

    margin: 0;

    padding: 0 0 20px 0;
}


/* =========================================================
   1차 메뉴
========================================================= */

.main-menu > ul {

    display: grid;

    grid-template-columns: repeat(6, 1fr);

    gap: 8px;

    width: 100%;

    margin: 0;

    padding: 0;

    list-style: none;
}


/* =========================================================
   1차 메뉴 항목
========================================================= */

.main-menu > ul > li {

    position: relative;

    min-width: 0;

    margin: 0;

    padding: 0;
}


/* =========================================================
   1차 메뉴 링크
========================================================= */

.main-menu > ul > li > a {

    display: flex;

    align-items: center;

    justify-content: center;

    width: 100%;

    height: 46px;

    padding: 0 12px;

    border: 1px solid var(--menu-border);

    border-radius: 7px;

    background: var(--menu-bg);

    color: var(--menu-text);

    text-decoration: none;

    font-size: 14px;

    font-weight: 600;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;

    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease;
}


/* =========================================================
   메뉴 Hover
========================================================= */

.main-menu > ul > li > a:hover {

    background: var(--menu-hover);

    border-color: #d1d5db;

    color: var(--menu-text);
}


/* =========================================================
   현재 메뉴
========================================================= */

.main-menu > ul > li.active > a {

    background: var(--menu-active-bg);

    border-color: var(--menu-active-bg);

    color: var(--menu-active-text);
}


/* =========================================================
   하위 메뉴
========================================================= */

.sub-menu {

    display: none;

    position: absolute;

    top: 52px;

    left: 0;

    z-index: 1000;

    width: 100%;

    margin: 0;

    padding: 5px;

    list-style: none;

    background: var(--menu-bg);

    border: 1px solid var(--menu-border);

    border-radius: 7px;

    box-shadow:
        0 6px 18px rgba(0, 0, 0, 0.08);
}


/* =========================================================
   하위 메뉴 표시
========================================================= */

.main-menu > ul > li:hover > .sub-menu {

    display: block;
}


/* =========================================================
   하위 메뉴 항목
========================================================= */

.sub-menu li {

    margin: 0;

    padding: 0;
}


/* =========================================================
   하위 메뉴 링크
========================================================= */

.sub-menu li a {

    display: block;

    width: 100%;

    padding: 9px 10px;

    border-radius: 5px;

    background: transparent;

    color: var(--menu-text);

    text-decoration: none;

    font-size: 13px;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;
}


/* =========================================================
   하위 메뉴 Hover
========================================================= */

.sub-menu li a:hover {

    background: var(--menu-hover);

    color: var(--menu-text);
}


/* =========================================================
   하위 메뉴 현재 항목
========================================================= */

.sub-menu li.active > a {

    background: var(--menu-hover);

    color: var(--menu-text);

    font-weight: 600;
}


/* =========================================================
   콘텐츠
========================================================= */

.content {

    width: 100%;

    min-height: 400px;

    margin: 5px 0 40px 0;

    padding: 30px;

    background: var(--content-bg);

    border: 1px solid var(--content-border);

    border-radius: 10px;

    box-shadow:
        0 2px 10px rgba(0, 0, 0, 0.03);

    color: var(--text-color);

    overflow-wrap: break-word;

    word-break: break-word;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease;
}


/* =========================================================
   콘텐츠 Clear
========================================================= */

.content:after {

    content: "";

    display: block;

    clear: both;
}


/* =========================================================
   콘텐츠 이미지
========================================================= */

.content img {

    max-width: 100%;

    height: auto;

    border: 0;
}


/* =========================================================
   iframe
========================================================= */

.content iframe {

    max-width: 100%;
}


/* =========================================================
   동영상
========================================================= */

.content video {

    max-width: 100%;
}


/* =========================================================
   테이블
========================================================= */

.content table {

    max-width: 100%;
}


/* =========================================================
   Footer
========================================================= */

.footer {

    width: 100%;

    margin: 0;

    padding: 25px 20px 30px 20px;

    border-top: 1px solid var(--footer-border);

    background: var(--body-bg);

    color: var(--footer-text);

    font-size: 12px;

    line-height: 1.7;

    text-align: center;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease;
}


/* =========================================================
   링크
========================================================= */

a {

    color: inherit;
}


/* =========================================================
   이미지
========================================================= */

img {

    max-width: 100%;

    height: auto;

    border: 0;
}


/* =========================================================
   DARK MODE
   레이아웃 외부만 변경
========================================================= */

body.dark-mode {

    --body-bg: #0f1115;

    --text-color: #d9dce2;

    --menu-bg: #171a21;

    --menu-border: #292e38;

    --menu-text: #d9dce2;

    --menu-hover: #20242d;

    --menu-active-bg: #f1f3f5;

    --menu-active-text: #111318;

    --footer-border: #292e38;

    --footer-text: #858b96;
}


/* =========================================================
   메뉴
========================================================= */

body.dark-mode .main-menu > ul > li > a:hover {

    background: #20242d;

    border-color: #383e4a;

    color: #f0f1f3;
}


body.dark-mode .main-menu > ul > li.active > a {

    background: #f1f3f5;

    border-color: #f1f3f5;

    color: #111318;
}


/* =========================================================
   하위 메뉴
========================================================= */

body.dark-mode .sub-menu {

    background: #171a21;

    border-color: #292e38;

    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.40);
}


body.dark-mode .sub-menu li a {

    color: #d9dce2;
}


body.dark-mode .sub-menu li a:hover {

    background: #20242d;

    color: #ffffff;
}


/* =========================================================
   풋터
========================================================= */

body.dark-mode .footer {

    background: #0f1115;

    border-color: #292e38;

    color: #858b96;
}


/* =========================================================
   테마 버튼
========================================================= */

body.dark-mode #theme-toggle {

    background: #171a21;

    border-color: #292e38;

    color: #d9dce2;
}


body.dark-mode #theme-toggle:hover {

    background: #20242d;

    border-color: #383e4a;

    color: #ffffff;
}