:root {
    --bg: #030407;
    --panel: #08090d;
    --brd: #15171e;
    --txt: #e0e0e0;
    --txt-sub: #7a8294;
    --acc: #4a90ff;
    --header-h: 56px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background: var(--bg);
    color: var(--txt);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* === HEADER === */
.wiki-header {
    height: var(--header-h);
    background: var(--panel);
    border-bottom: 1px solid var(--brd);
    display: grid;
    grid-template-columns: 48px 1fr 1fr;
    align-items: center;
    padding: 0 16px;
    flex-shrink: 0;
    z-index: 10;
}

.nav-left { display: flex; justify-content: flex-start; align-items: center; }

.nav-center {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    height: 28px;
    width: auto;
    object-fit: contain;
}

.nav-title {
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 0.3px;
    color: var(--txt);
    white-space: nowrap;
}

.nav-right {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.nav-link {
    color: var(--txt-sub);
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--txt);
    background: rgba(255,255,255,0.05);
}

.nav-separator {
    color: var(--brd);
    font-size: 12px;
    user-select: none;
}

.nav-btn {
    background: none;
    border: none;
    color: var(--txt);
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.nav-btn:hover { background: rgba(255,255,255,0.05); }
.nav-btn .material-icons { font-size: 24px; }

/* === IFRAME === */
.wiki-main {
    flex: 1;
    position: relative;
    background: transparent;
    overflow: hidden;
}

#wiki-frame {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    display: block;
}

/* === MOBILE === */
@media (max-width: 900px) {
    .wiki-header {
        grid-template-columns: 44px 1fr;
        grid-template-areas: "left center";
        padding: 0 12px;
    }
    .nav-left { grid-area: left; }
    .nav-center { grid-area: center; justify-content: flex-start; }
    .nav-right { display: none; }
    
    .nav-title { font-size: 14px; }
    .logo-icon { height: 24px; }
}

@media (max-width: 480px) {
    .nav-center { gap: 8px; }
    .logo-icon { height: 22px; }
    .nav-title { font-size: 13px; }
}