:root {
    --bg: #0b1220;
    --panel: rgba(255, 255, 255, 0.03);
    --panelBorder: rgba(255, 255, 255, 0.08);
    --side: #0f172a;
    --side2: #0b1327;
    --text: #e8eefc;
    --muted: rgba(232, 238, 252, 0.75);
    --active: #ff4b4b;
    --link: #ff8b8b;
}

html, body { height: 100%; }
body {
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

.shell {
    display: flex;
    min-height: 100vh;
    height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    width: 260px;
    background: linear-gradient(180deg, var(--side) 0%, var(--side2) 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    padding: 18px 14px;
    box-sizing: border-box;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.account {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    padding: 10px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
}

.avatar {
    height: 30px;
    width: auto;
    display: block;
}

.sideNav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    overflow-y: auto;
    padding-right: 6px;
}

.sideItem {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 12px;
    background: transparent;
    border: 0;
    color: var(--text);
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease;
    font-size: 13px;
}

.sideItem:hover { background: rgba(255, 255, 255, 0.05); }

.sideItem.active {
    background: rgba(255, 255, 255, 0.06);
}

.sideText { font-weight: 650; }

.content {
    flex: 1;
    padding: 22px;
    box-sizing: border-box;
    overflow-y: auto;
    min-width: 0;
    scroll-behavior: auto;
    overscroll-behavior: contain;
}

html.docs-hydrated .tabPanel.is-active {
    animation: docsPageIn 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes docsPageIn {
    from {
        opacity: 0.55;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    html.docs-hydrated .tabPanel.is-active {
        animation: none;
    }
}

.panel {
    background: var(--panel);
    border: 1px solid var(--panelBorder);
    border-radius: 18px;
    padding: 20px 22px 28px;
    min-height: 400px;
}

.docHeader {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--panelBorder);
}

.docHeader h1 {
    margin: 0 0 4px;
    font-size: 22px;
}

.docHeader p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.panelActions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.ghostBtn {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text);
    text-decoration: none;
    font-weight: 650;
    font-size: 13px;
}

.ghostBtn:hover { background: rgba(255, 255, 255, 0.08); }

.tabPanel { display: none; }
.tabPanel.is-active { display: block; }

.docPage h2 {
    font-size: 18px;
    margin: 0 0 10px;
}

.docPage h3 {
    font-size: 15px;
    margin: 22px 0 8px;
}

.docPage h4 {
    font-size: 13px;
    margin: 14px 0 6px;
    opacity: 0.95;
}

.docPage p, .docPage li {
    color: rgba(232, 238, 252, 0.92);
    line-height: 1.55;
    font-size: 14px;
}

.docPage p { margin: 8px 0; }
.docPage ul, .docPage ol { margin: 8px 0 12px; padding-left: 20px; }
.docPage li { margin: 4px 0; }

.docPage a { color: var(--link); }
.docPage a:hover { color: var(--active); }

.docPage code {
    background: rgba(255, 255, 255, 0.08);
    padding: 1px 6px;
    border-radius: 6px;
    font-size: 12px;
}

.docPage blockquote {
    margin: 12px 0;
    padding: 10px 14px;
    border-left: 3px solid rgba(255, 75, 75, 0.7);
    background: rgba(255, 255, 255, 0.03);
    color: var(--muted);
    border-radius: 0 10px 10px 0;
}

.banner {
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.5;
    margin: 12px 0 16px;
}

.banner.info {
    background: rgba(56, 189, 248, 0.16);
    border: 1px solid rgba(56, 189, 248, 0.38);
    color: #d7f3ff;
}

.banner.success {
    background: rgba(52, 211, 153, 0.16);
    border: 1px solid rgba(52, 211, 153, 0.38);
    color: #d8ffe9;
}

.banner.warn {
    background: rgba(251, 191, 36, 0.16);
    border: 1px solid rgba(251, 191, 36, 0.42);
    color: #fff4cc;
}

.banner.danger {
    background: rgba(255, 75, 75, 0.16);
    border: 1px solid rgba(255, 75, 75, 0.42);
    color: #ffd6d6;
}

.tableWrap {
    overflow: auto;
    border: 1px solid var(--panelBorder);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    margin: 10px 0 16px;
}

.tableWrap table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 520px;
}

.tableWrap th, .tableWrap td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--panelBorder);
    vertical-align: top;
}

.tableWrap th {
    color: #fff;
    font-weight: 700;
    background: rgba(255, 75, 75, 0.12);
}

.tableWrap tbody tr:last-child td { border-bottom: none; }

.codeBlock {
    position: relative;
    margin: 10px 0 16px;
}

.codeBlock .copyBtn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1;
    border: 1px solid rgba(255, 75, 75, 0.35);
    background: rgba(255, 75, 75, 0.12);
    color: #ffd7d7;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.codeBlock .copyBtn:hover { background: rgba(255, 75, 75, 0.2); }

.docPage pre:not(.mermaid) {
    margin: 0;
    overflow: auto;
    background: #07101f;
    border: 1px solid var(--panelBorder);
    border-radius: 12px;
    padding: 14px 16px;
    padding-right: 84px;
    font-size: 12.5px;
    line-height: 1.5;
}

.docPage pre code {
    background: none;
    padding: 0;
    font-size: inherit;
}

.mermaid-wrap {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--panelBorder);
    border-radius: 12px;
    padding: 16px;
    margin: 12px 0 18px;
    overflow: auto;
}

.mermaid-wrap svg { max-width: 100%; height: auto; }

@media (max-width: 820px) {
    .shell { flex-direction: column; height: auto; min-height: 100vh; }
    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        max-height: 42vh;
    }
    .docHeader { flex-direction: column; }
}
