* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
}

body {
    background-color: #050505;
    color: #d0d0d0;
    font-family: "Liberation Sans", Arial, Helvetica, FreeSans, sans-serif;
    line-height: 1.7;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
}

.mirror-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image: url('/world/resources/background/mirror-world/jspy1.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transform: scale(1.03);
    transition: transform 0.1s ease-out;
}

.wiki-layout {
    display: flex;
    width: 100%;
    min-height: 100vh;
    z-index: 10;
}

.wiki-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 240px;
    height: 100vh;
    background-color: rgba(10, 10, 12, 0.95);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem 1.2rem;
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
}

.wiki-logo {
    font-size: 1.3rem;
    font-weight: 300;
    color: #fff;
    letter-spacing: 0.1em;
    margin-bottom: 2rem;
    text-align: center;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.nav-section {
    margin-bottom: 1.5rem;
}

.nav-list {
    list-style: none;
}

.nav-list li a {
    display: block;
    padding: 0.5rem 1rem;
    color: #aaa;
    text-decoration: none;
    font-size: 0.9rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    margin-bottom: 0.4rem;
}

.nav-list li a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: translateX(4px);
}

.nav-list li a.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.accordion {
    border: 1px solid #444;
    border-radius: 2px;
    background-color: #1a1a1a;
    overflow: hidden;
    margin-top: 1rem;
}

.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1rem;
    background-color: #333;
    color: #fff;
    font-weight: bold;
    font-size: 0.95rem;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid #444;
    transition: background-color 0.2s;
}

.accordion-header:hover {
    background-color: #3a3a3a;
}

.accordion-arrow {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
    color: #ccc;
}

.accordion.active .accordion-arrow {
    transform: rotate(-180deg);
}

.accordion-content {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: #2b2b2b;
}

.accordion-inner {
    overflow: hidden;
}

.accordion.active .accordion-content {
    grid-template-rows: 1fr;
}

.accordion-list {
    list-style: none;
    padding: 0.5rem 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.accordion.active .accordion-list {
    opacity: 1;
    transition-delay: 0.1s;
}

.accordion-list li a {
    display: block;
    padding: 0.4rem 1rem;
    color: #ccc;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.2s, color 0.2s;
}

.accordion-list li a:hover,
.accordion-list li a.active {
    background-color: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.wiki-main {
    flex: 1;
    margin-left: 240px;
    padding: 1.5rem 3rem;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: rgba(5, 5, 5, 0.4);
    backdrop-filter: blur(5px);
}

.doc-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.doc-title {
    font-size: 2.2rem;
    font-weight: 400;
    color: #fff;
    font-family: "Linux Libertine", Georgia, Times, serif;
}

.doc-actions {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
}

.doc-actions a {
    color: #4a90e2;
    text-decoration: none;
}

.doc-actions a:hover {
    text-decoration: underline;
}

.notice-box {
    background-color: rgba(255, 255, 255, 0.05);
    border-left: 4px solid #4a90e2;
    padding: 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1rem;
    font-size: 0.95rem;
    color: #ccc;
}

.notice-box .icon {
    font-size: 1.5rem;
}

.doc-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.doc-toc {
    width: 220px;
    flex-shrink: 0;
    position: sticky;
    top: 1.5rem;
    background-color: rgba(15, 15, 20, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 1rem;
    font-size: 0.9rem;
    transition: width 0.3s ease, padding 0.3s ease, border-color 0.3s ease;
}

.doc-toc.is-collapsed {
    width: 100px;
    padding: 0.8rem 0.6rem;
    border-color: rgba(255, 255, 255, 0.05);
}

.toc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    color: #fff;
    margin-bottom: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.doc-toc.is-collapsed .toc-header>span:first-child {
    display: none;
}

.doc-toc.is-collapsed .toc-header {
    justify-content: center;
}

.toc-toggle-btn {
    color: #4a90e2;
    font-size: 0.8rem;
    font-weight: normal;
    cursor: pointer;
    white-space: nowrap;
}

.toc-toggle-btn:hover {
    text-decoration: underline;
}

.toc-content-wrapper {
    display: grid;
    grid-template-rows: 1fr;
    transition: grid-template-rows 0.3s ease;
}

.toc-content-wrapper.collapsed {
    grid-template-rows: 0fr;
}

.toc-content-inner {
    overflow: hidden;
}

.toc-list {
    list-style: none;
    padding-left: 0;
}

.toc-list li {
    margin-bottom: 0.3rem;
}

.toc-list a {
    color: #4a90e2;
    text-decoration: none;
}

.toc-list a:hover {
    text-decoration: underline;
}

.toc-sublist {
    list-style: none;
    padding-left: 1.5rem;
}

.doc-article {
    flex: 1;
    min-width: 0;
    color: #d0d0d0;
}

.doc-article p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

.doc-article a {
    color: #4a90e2;
    text-decoration: none;
}

.doc-article a:hover {
    text-decoration: underline;
}

.doc-article h2 {
    font-size: 1.5rem;
    font-weight: 400;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 0.2rem;
    margin: 2rem 0 1rem 0;
    font-family: "Linux Libertine", Georgia, Times, serif;
}

.wiki-footer {
    text-align: center;
    padding: 2rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.8rem;
    color: #555;
    margin-top: auto;
}

@media (max-width: 900px) {
    .wiki-layout {
        flex-direction: column;
    }

    .wiki-sidebar {
        position: relative;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding: 1rem;
    }

    .wiki-logo {
        text-align: center;
        margin-bottom: 1rem;
    }

    .accordion {
        margin-top: 0.5rem;
    }

    .wiki-main {
        margin-left: 0;
        padding: 1rem;
    }

    .doc-layout {
        flex-direction: column;
        gap: 1rem;
    }

    .doc-toc,
    .doc-toc.is-collapsed {
        width: 100%;
        position: relative;
        top: 0;
        margin-bottom: 0;
        padding: 1rem;
    }
}