:root {
    --primary: #A4CAF1;
    --secondary: #77B9FC;
    --fgb-dark: #081849;
    --bg: #000000;
    --text: #ffffff;
    --card-bg: rgba(255, 255, 255, 0.1);
    --card-hover: rgba(255, 255, 255, 0.5);
    --border: #ffffff;
    --font-main: 'PayboocFont', sans-serif;
    --font-header: 'Cafe24Decoschool', sans-serif;
}

@font-face {
    font-family: 'Cafe24Decoschool';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/2405-3@1.1/Cafe24Decoschool.woff2') format('woff2');
    font-weight: normal;
    font-display: swap;
}

@font-face {
    font-family: 'PayboocFont';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_20-07@1.0/paybooc-Medium.woff') format('woff');
    font-weight: 500;
    font-display: swap;
}

@font-face {
    font-family: 'Dooneun';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2205@1.0/Donoun-Medium.woff2') format('woff2');
    font-weight: normal;
    font-display: swap;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Video Background */
.video-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
}

/* Header */
header,
.site-header {
    position: relative;
    z-index: 1;
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 2px solid var(--border);
    width: 100%;
}

.site-header-brand {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    flex: 1;
    min-width: 0;
}

.logo-text {
    font-family: var(--font-header);
    font-size: 2rem;
    color: var(--text);
}

.header-logo-link {
    text-decoration: none;
    color: inherit;
}

.header-test-notice {
    display: none;
    font-family: var(--font-main);
    font-size: 0.8rem;
    line-height: 1.45;
    color: var(--text);
    margin: 0;
    max-width: 22rem;
    flex-shrink: 0;
}

html.env-test-site .header-test-notice {
    display: block;
}

.header-test-notice a {
    color: rgb(0, 0, 255);
    text-decoration: underline;
}

.header-test-notice a:hover {
    color: rgb(0, 0, 255);
}

.header-auth .header-auth-link.is-current {
    opacity: 0.9;
    pointer-events: none;
}

.header-auth {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    font-family: var(--font-main);
    font-size: 0.95rem;
}

.header-auth-sep {
    opacity: 0.6;
    user-select: none;
}

.header-auth-link {
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s ease;
}

.header-auth-link:hover {
    color: var(--secondary);
}

.header-auth-logout {
    font-family: var(--font-main);
    font-size: 0.95rem;
    cursor: pointer;
    color: var(--text);
    background: transparent;
    border: none;
    padding: 0;
}

.header-auth-logout:hover {
    color: var(--secondary);
}

.text-emphasis {
    color: rgb(0, 0, 255);
}

/* Main Content */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    container-type: inline-size;
    container-name: main;
}

.main-layout {
    width: 100%;
    max-width: 1200px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 4rem;
}

/* 목차 start */
.link-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
    max-width: 600px;
    box-sizing: border-box;
}

.link-row {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
}

.link-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.link-header {
    font-family: var(--font-main);
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-align: left;
    line-height: 1.2;
    padding-left: 0.5rem;
}

.link-divider {
    width: 100%;
    height: 1px;
    border-bottom: 2px solid var(--border);
    padding-top: 0.3rem;
}

.link-body {
    display: flex;
    flex-direction: column;
    padding-top: 0.3rem;
}

.link-item {
    width: 100%;
    padding: 0.2rem 0.5rem;

    font-family: var(--font-main);
    font-size: 1.1rem;
    font-weight: 400;
    letter-spacing: 0.04em;
    text-align: left;
    line-height: 1.2;
    color: white;
    text-decoration: none;
    transition: 0.2s ease;
}

.link-item:hover {
    font-weight: bold;
    color: var(--fgb-dark);
    background-color: rgba(255, 255, 255, 0.3);
}

/* 하늘색 네온 링크 */
/* ── 복마트 네온사인 ── */

/* 래퍼: SVG 아크가 텍스트 바깥으로 삐져나올 수 있도록 overflow visible */
.link-item-neon-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

/* 네온 텍스트 — 흰색 중심 + 하늘색 glow */
@keyframes neon-flicker {
    0%, 100% { opacity: 1; }
    85%       { opacity: 1; }
    86%       { opacity: 0.5; }
    87%       { opacity: 1; }
    91%       { opacity: 1; }
    92%       { opacity: 0.6; }
    93%       { opacity: 1; }
}

.link-item--neon {
    color: #ffffff;
    text-shadow:
        /* 텍스트 윤곽 — 얇게 유지 */
        0 0 1px #ffffff,
        /* 네온 테두리 — 안쪽부터 넓게 */
        0 0 4px #7ddfff,
        0 0 8px #7ddfff,
        0 0 14px #38bdf8,
        0 0 22px #38bdf8,
        /* 중간 glow */
        0 0 36px #0ea5e9,
        /* 바깥 번짐 */
        0 0 58px #0ea5e9,
        0 0 90px #0284c7;
    animation: neon-flicker 7s infinite;
}

.link-item--neon:hover {
    color: #ffffff;
    animation: none;
    text-shadow:
        0 0 1px #ffffff,
        0 0 5px #7ddfff,
        0 0 12px #7ddfff,
        0 0 20px #38bdf8,
        0 0 30px #38bdf8,
        0 0 48px #0ea5e9,
        0 0 72px #0ea5e9,
        0 0 140px #0284c7;
}

/* 아크 SVG — 텍스트 위에 겹치되 클릭 통과 */
.neon-arcs {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
}

/* 전기 아크 선 */
.arc {
    fill: none;
    stroke: #ffffff;
    stroke-width: 1.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter:
        drop-shadow(0 0 2px #7ddfff)
        drop-shadow(0 0 5px #38bdf8)
        drop-shadow(0 0 10px #0ea5e9);
    opacity: 0;
}

.a1 { animation: arc-flash  9s infinite; animation-delay: 0.8s; }
.a2 { animation: arc-flash 11s infinite; animation-delay: 3.5s; }
.a3 { animation: arc-flash  9s infinite; animation-delay: 6.2s; }
.a4 { animation: arc-flash 11s infinite; animation-delay: 9.0s; }

@keyframes arc-flash {
    0%, 100% { opacity: 0; }
    1.2%     { opacity: 1; }
    1.6%     { opacity: 0.2; }
    2.0%     { opacity: 1; }
    2.4%     { opacity: 0; }
}

/* 스파크 점 */
.zap {
    fill: #ffffff;
    filter:
        drop-shadow(0 0 3px #7ddfff)
        drop-shadow(0 0 7px #38bdf8);
    opacity: 0;
    transform-origin: center;
}

.z1 { animation: zap-pop  9s infinite; animation-delay: 0.8s; }
.z2 { animation: zap-pop 11s infinite; animation-delay: 3.5s; }
.z3 { animation: zap-pop  9s infinite; animation-delay: 6.2s; }
.z4 { animation: zap-pop 11s infinite; animation-delay: 9.0s; }

@keyframes zap-pop {
    0%, 100% { opacity: 0; transform: scale(0.2); }
    1.2%     { opacity: 1; transform: scale(1.4); }
    2.4%     { opacity: 0; transform: scale(0.5); }
}

/* Banner */
.banner {
    width: fit-content;
    max-width: calc(100% - 2rem);
    margin-top: 1rem;
    padding: 0.75rem 1.25rem;
    text-align: center;
}

.banner-text {
    font-family: var(--font-main);
    font-size: 1rem;
    color: var(--text);
    letter-spacing: 0.1em;
}

.memo-stage {
    position: relative;
    width: 270px;
    max-width: 100%;
    min-height: 360px;
    border: none;
    background:
        linear-gradient(
            135deg,
            rgba(217, 240, 255, 0.97) 0%,
            rgba(173, 220, 255, 0.97) 72%,
            rgba(128, 196, 255, 0.97) 100%
        );
    border-radius: 3px;
    box-shadow: 10px 12px 16px -8px rgba(0, 0, 0, 0.4);
    transform: rotate(-1.2deg);
    box-sizing: border-box;
}

.memo-stage::before {
    content: '';
    position: absolute;
    top: -12px;
    left: calc(50% - 45px);
    width: 90px;
    height: 24px;
    background: rgba(240, 240, 225, 0.58);
    border-radius: 2px;
    transform: rotate(2deg);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.22);
    pointer-events: none;
}

.memo-overlay-text {
    position: absolute;
    left: 1.6rem;
    top: 1.85rem;
    z-index: 3;
    font-family: 'Dooneun', var(--font-main);
    font-size: 0.9rem;
    color: rgba(12, 42, 82, 0.9);
    letter-spacing: 0.04em;
    line-height: 1.45;
    text-shadow: none;
}

.memo-overlay-text p {
    margin: 0 0 0.35rem;
}

.memo-overlay-text p:last-child {
    margin-bottom: 0;
}

@container main (max-width: 650px) {
    .link-row {
        flex-direction: column;
    }

    .link-column {
        width: 100%;
    }

    .main-layout {
        width: 100%;
    }

    .banner {
        margin-top: 1.5rem;
    }
}

@media (max-width: 980px) {
    .main-layout {
        flex-direction: column;
        align-items: center;
        gap: 1.25rem;
    }

    .memo-stage {
        display: none;
    }
}

/* Footer */
footer {
    padding: 1.5rem;
    text-align: center;
    border-top: 2px solid var(--border);
    color: var(--text);
    font-size: 0.9rem;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
}

.modal-overlay.is-open {
    display: flex;
}

.modal-dialog {
    width: 100%;
    max-width: 360px;
    padding: 2rem;
    background: var(--card-bg);
    border: 2px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.modal-message {
    font-family: var(--font-main);
    font-size: 1.15rem;
    text-align: center;
    color: var(--text);
}

.modal-close {
    font-family: var(--font-main);
    font-size: 1rem;
    padding: 0.6rem 1.5rem;
    cursor: pointer;
    color: var(--text);
    background: transparent;
    border: 2px solid var(--border);
    transition: border-color 0.2s ease, color 0.2s ease;
}

.modal-close:hover {
    border-color: var(--secondary);
    color: var(--secondary);
}

/* =============================================================================
   테마 스크롤바 — Firefox scrollbar-* / WebKit ::-webkit-scrollbar
   전역 공통 (wiki 본문·목차·편집기 등 overflow 영역)
   ============================================================================= */

body.wiki-site-page {
    overflow: auto;
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--secondary) 75%, transparent)
        rgba(255, 255, 255, 0.1);
}

body.wiki-site-page::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

body.wiki-site-page::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 100px;
}

body.wiki-site-page::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--secondary), var(--primary));
    border-radius: 100px;
}

body.wiki-site-page::-webkit-scrollbar-thumb:hover {
    background: var(--secondary);
}

.wiki-body {
    scrollbar-width: thin;
    scrollbar-color: var(--secondary);
}

.wiki-body::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

.wiki-body::-webkit-scrollbar-track {
    background: rgba(8, 24, 73, 0.07);
    border-radius: 100px;
}

.wiki-body::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--secondary), var(--primary));
    border-radius: 100px;
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--secondary) 25%, transparent);
}

.wiki-body::-webkit-scrollbar-thumb:hover {
    background: var(--secondary);
}

#wikiTocNav.wiki-toc .wiki-toc-list {
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--secondary) 75%, transparent)
        rgba(255, 255, 255, 0.08);
}

#wikiTocNav.wiki-toc .wiki-toc-list::-webkit-scrollbar {
    width: 4px;
}

#wikiTocNav.wiki-toc .wiki-toc-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 100px;
}

#wikiTocNav.wiki-toc .wiki-toc-list::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--secondary), var(--primary));
    border-radius: 100px;
}

#wikiTocNav.wiki-toc .wiki-toc-list::-webkit-scrollbar-thumb:hover {
    background: var(--secondary);
}

#editor .tiptap,
#editor .ProseMirror {
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--secondary) 75%, transparent)
        rgba(255, 255, 255, 0.08);
}

#editor .ql-container {
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--secondary) 75%, transparent)
        rgba(255, 255, 255, 0.08);
}

#editor .ql-container::-webkit-scrollbar,
#editor .ProseMirror::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

#editor .ql-container::-webkit-scrollbar-track,
#editor .ProseMirror::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 100px;
}

#editor .ql-container::-webkit-scrollbar-thumb,
#editor .ProseMirror::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--secondary), var(--primary));
    border-radius: 100px;
}

#editor .ql-container::-webkit-scrollbar-thumb:hover,
#editor .ProseMirror::-webkit-scrollbar-thumb:hover {
    background: var(--secondary);
}

/* util classes */

.input-text {
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
    border-bottom: 1px solid var(--fgb-dark) !important;
    border-radius: 0 !important;
}

.btn-primary {
    background: var(--secondary);
    color: white;
    border: 2px solid var(--secondary);
}

.btn-primary:hover {
    filter: brightness(1.05);
}

.btn-secondary {
    background: white;
    color: var(--fgb-dark);
    border: 2px solid var(--secondary);
}

.btn-secondary:hover {
    color: var(--secondary);
}

.border-blue {
    border-color: var(--secondary) !important;
}

.border-2-solid {
    border-width: 2px !important;
    border-style: solid !important;
}