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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background-color: #f7f8fa;
    color: #333;
    display: flex;
    min-height: 100vh;
}

/* ============================================
   Sidebar Wrapper
   ============================================ */
.sidebar {
    width: 260px;
    background-color: #1a1a1a;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 24px 20px 16px;
    border-bottom: 1px solid #2a2a2a;
}

.sidebar-title {
    font-size: 15px;
    font-weight: 600;
    color: #f5f5f5;
    letter-spacing: 0.5px;
}

.sidebar-contact {
    padding: 16px 20px;
    border-bottom: 1px solid #2a2a2a;
    font-size: 12px;
    color: #888;
    line-height: 2;
}

.sidebar-contact a {
    color: #4f9eff;
    text-decoration: none;
}

.sidebar-contact a:hover {
    text-decoration: underline;
}

.sidebar-contact .highlight {
    color: #e8e8e8;
    font-weight: 500;
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #3f3f46;
    border-radius: 2px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #52525b;
}

/* ============================================
   Branched Menu (React Bits official)
   ============================================ */
.branched-menu {
    --bm-w: 240px;
    --bm-ink: #f5f5f5;
    --bm-accent: #f5f5f5;
    --bm-line: #3f3f46;
    --bm-font: 14px;
    --bm-row: 36px;
    --bm-indent: 40px;
    --bm-trunk: 14px;
    --bm-line-w: 1.5;
    --bm-draw: 400ms;
    --bm-fold: 300ms;
    --bm-ease-out: cubic-bezier(0.23, 1, 0.32, 1);
    --bm-muted: color-mix(in srgb, var(--bm-ink) 55%, transparent);

    position: relative;
    display: flex;
    flex-direction: column;
    width: fit-content;
    max-width: min(var(--bm-w), 100%);
    padding: 16px 16px 24px 14px;
    margin-top: 0;
    color: var(--bm-ink);
    font-family: inherit;
    font-size: var(--bm-font);
    line-height: 1.2;
    flex: 1;
}

.branched-menu::before {
    content: '';
    position: absolute;
    top: 8px;
    bottom: 0;
    left: 0;
    width: 2px;
    border-radius: 1px;
    background: linear-gradient(to bottom, var(--bm-line) 0%, var(--bm-line) 55%, transparent 100%);
}

.branched-menu__marker {
    position: absolute;
    top: -1px;
    left: 0;
    z-index: 1;
    width: 2px;
    height: 16px;
    border-radius: 1px;
    background: var(--bm-accent);
    opacity: 0;
    transition:
        top 220ms var(--bm-ease-out),
        opacity 150ms ease;
}

.branched-menu__marker[data-on] {
    opacity: 1;
}

.branched-menu__section {
    display: flex;
    flex-direction: column;
}

.branched-menu__head {
    display: block;
    margin: 0;
    padding: 9px 0;
    border: 0;
    background: none;
    color: var(--bm-muted);
    font: inherit;
    font-size: calc(var(--bm-font) + 1px);
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    transition: color 200ms ease;
}

.branched-menu__section[data-open] .branched-menu__head,
.branched-menu__head[data-active] {
    color: var(--bm-ink);
}

@media (hover: hover) and (pointer: fine) {
    .branched-menu__head:hover {
        color: var(--bm-ink);
    }
}

.branched-menu__body {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows var(--bm-fold) var(--bm-ease-out);
}

.branched-menu__section[data-open] .branched-menu__body {
    grid-template-rows: 1fr;
}

.branched-menu__fold {
    min-height: 0;
    overflow: hidden;
}

.branched-menu__tree {
    position: relative;
    padding: 6px 0;
    box-sizing: border-box;
}

.branched-menu__lines {
    position: absolute;
    top: 0;
    left: 0;
    overflow: visible;
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease;
}

.branched-menu__section[data-open] .branched-menu__lines {
    opacity: 1;
    transition: opacity 250ms ease 100ms;
}

.branched-menu__base,
.branched-menu__reach {
    fill: none;
    stroke-width: var(--bm-line-w);
    stroke-linecap: round;
    stroke-linejoin: round;
}

.branched-menu__base {
    stroke: var(--bm-line);
}

.branched-menu__reach {
    stroke: var(--bm-accent);
    transition: stroke-dashoffset var(--bm-draw) var(--bm-ease-out);
}

.branched-menu__item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    height: var(--bm-row);
    margin: 0;
    padding: 0 0 0 var(--bm-indent);
    border: 0;
    background: none;
    color: var(--bm-muted);
    font: inherit;
    text-align: left;
    cursor: pointer;
    outline: none;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    transition: color 200ms ease;
}

@media (hover: hover) and (pointer: fine) {
    .branched-menu__item:hover {
        color: var(--bm-ink);
    }
}

.branched-menu__item[data-active] {
    color: var(--bm-accent);
    font-weight: 500;
}

.branched-menu__icon {
    display: inline-flex;
    flex: none;
}

.branched-menu__label {
    white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
    .branched-menu__marker {
        transition: opacity 150ms ease;
    }
    .branched-menu__body {
        transition: none;
    }
    .branched-menu__reach {
        transition: none;
    }
}

/* ============================================
   Right Content Area
   ============================================ */
.content {
    margin-left: 260px;
    flex: 1;
    padding: 48px 64px;
    max-width: 920px;
}

.welcome-banner {
    background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
    color: #f5f5f5;
    padding: 40px;
    border-radius: 12px;
    margin-bottom: 40px;
    border: 1px solid #2a2a2a;
}

.welcome-banner h1 {
    font-size: 22px;
    margin-bottom: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.welcome-banner p {
    font-size: 14px;
    color: #a1a1aa;
    line-height: 1.8;
    margin-bottom: 12px;
}

.welcome-banner .pack-link {
    display: inline-block;
    margin-top: 20px;
    background-color: #3f3f46;
    padding: 10px 20px;
    border-radius: 6px;
    color: #f5f5f5;
    text-decoration: none;
    font-size: 13px;
    transition: background-color 0.2s;
    border: 1px solid #52525b;
}

.welcome-banner .pack-link:hover {
    background-color: #52525b;
}

.section {
    background-color: #fff;
    border-radius: 8px;
    padding: 40px 44px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    border: 1px solid #e8e8e8;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: #18181b;
    margin-bottom: 28px;
    padding-bottom: 14px;
    border-bottom: 1px solid #e4e4e7;
}

/* Plugin card grid on index page */
.plugin-card {
    display: block;
    background-color: #fafafa;
    border: 1px solid #e4e4e7;
    border-radius: 8px;
    padding: 18px 22px;
    text-decoration: none;
    transition: all 0.2s;
}

.plugin-card:hover {
    background-color: #fff;
    border-color: #3f3f46;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.plugin-card-title {
    font-size: 15px;
    font-weight: 600;
    color: #18181b;
    margin-bottom: 6px;
}

.plugin-card:hover .plugin-card-title {
    color: #3f3f46;
}

.plugin-card-desc {
    font-size: 13px;
    color: #71717a;
    line-height: 1.6;
}

.subsection-title {
    font-size: 15px;
    font-weight: 600;
    color: #27272a;
    margin: 28px 0 14px;
    padding-left: 12px;
    border-left: 3px solid #3f3f46;
}

.subsection-title:first-child {
    margin-top: 0;
}

p {
    line-height: 1.9;
    margin-bottom: 12px;
    color: #52525b;
    font-size: 14px;
}

.command {
    background-color: #f4f4f5;
    border: 1px solid #e4e4e7;
    border-radius: 4px;
    padding: 2px 8px;
    font-family: "SF Mono", "JetBrains Mono", "Consolas", "Menlo", monospace;
    font-size: 13px;
    color: #27272a;
    display: inline-block;
    margin: 2px 0;
}

.command-block {
    background-color: #1e1e1e;
    border-radius: 6px;
    padding: 16px 20px;
    margin: 14px 0;
    font-family: "SF Mono", "JetBrains Mono", "Consolas", "Menlo", monospace;
    font-size: 13px;
    color: #d4d4d4;
    overflow-x: auto;
    line-height: 1.8;
}

.command-block .cmd {
    color: #9cdcfe;
}

.command-block .desc {
    color: #ce9178;
}

.note-box {
    background-color: #fafafa;
    border: 1px solid #e4e4e7;
    border-left: 3px solid #a1a1aa;
    border-radius: 0 6px 6px 0;
    padding: 14px 18px;
    margin: 16px 0;
    font-size: 13px;
    line-height: 1.8;
    color: #52525b;
}

.note-box strong {
    color: #27272a;
}

.warn-box {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-left: 3px solid #dc2626;
    border-radius: 0 6px 6px 0;
    padding: 14px 18px;
    margin: 16px 0;
    font-size: 13px;
    line-height: 1.8;
    color: #991b1b;
}

.info-box {
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    border-left: 3px solid #2563eb;
    border-radius: 0 6px 6px 0;
    padding: 14px 18px;
    margin: 16px 0;
    font-size: 13px;
    line-height: 1.8;
    color: #1e40af;
}

.success-box {
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-left: 3px solid #16a34a;
    border-radius: 0 6px 6px 0;
    padding: 14px 18px;
    margin: 16px 0;
    font-size: 13px;
    line-height: 1.8;
    color: #15803d;
}

ol, ul {
    padding-left: 24px;
    margin: 12px 0;
}

ol li, ul li {
    line-height: 1.9;
    margin-bottom: 6px;
    color: #52525b;
    font-size: 14px;
}

strong {
    color: #18181b;
    font-weight: 600;
}

code {
    background-color: #f4f4f5;
    border-radius: 3px;
    padding: 1px 6px;
    font-family: "SF Mono", "JetBrains Mono", "Consolas", monospace;
    font-size: 12px;
    color: #27272a;
}

.footer {
    text-align: center;
    color: #a1a1aa;
    font-size: 12px;
    margin-top: 40px;
    padding: 24px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: relative;
        height: auto;
        max-height: 50vh;
    }

    .content {
        margin-left: 0;
        padding: 24px 16px;
    }

    .section {
        padding: 24px 20px;
    }
}
