﻿:root {
    --blue: #1769ff;
    --dark: #10233f;
    --text: #1e293b;
    --muted: #64748b;
    --bg: #f6f9ff;
    --card: #fff;
    --line: #dce6f5;
    --accent: #10b981;
    --shadow: 0 16px 40px rgba(16,35,63,.12);
    --radius: 22px;
}

* {
    box-sizing: border-box
}

html {
    scroll-behavior: smooth
}

body {
    margin: 0;
    font-family: Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
    background: linear-gradient(135deg,#f7fbff 0%,#eef6ff 50%,#f7fff9 100%);
    color: var(--text)
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 28px;
    background: rgba(255,255,255,.88);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line)
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--dark);
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -.02em
}

.brand-badge {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: #fff4d6;
    box-shadow: inset 0 0 0 1px #ffe3a3
}

.menu-toggle {
    display: none;
    border: 0;
    border-radius: 12px;
    background: var(--blue);
    color: white;
    padding: 10px 14px;
    font-weight: 700;
    cursor: pointer
}

.layout {
    display: grid;
    grid-template-columns: 230px minmax(0,1fr);
    max-width: 100%;
    width: 100%;
    margin: 0;
    min-height: calc(100vh - 72px);
    align-items: start
}

aside {
    position: sticky;
    top: 72px;
    align-self: start;
    height: calc(100vh - 72px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 18px 14px;
    background: rgba(255,255,255,.7);
    border-right: 1px solid var(--line);
    scrollbar-width: thin;
    scrollbar-color: #c5d3ea transparent
}

    aside::-webkit-scrollbar {
        width: 8px
    }

    aside::-webkit-scrollbar-thumb {
        background: #c5d3ea;
        border-radius: 8px
    }

        aside::-webkit-scrollbar-thumb:hover {
            background: #a9bcdc
        }

    aside::-webkit-scrollbar-track {
        background: transparent
    }

.sidebar-title {
    color: var(--muted);
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .12em;
    margin: 0 0 12px 8px
}

#sideNav {
    display: flex;
    flex-direction: column;
    gap: 2px
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    color: var(--text);
    text-decoration: none;
    font-size: .86rem;
    font-weight: 600;
    line-height: 1.25;
    word-break: break-word
}

    .nav-link:hover {
        background: #eaf2ff;
        color: var(--blue)
    }

    .nav-link.active {
        background: #eaf2ff;
        color: var(--blue)
    }

.nav-no {
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 7px;
    background: #eef4ff;
    color: var(--muted);
    font-size: .7rem;
    font-weight: 800
}

.nav-link.active .nav-no {
    background: var(--blue);
    color: #fff
}

main {
    padding: 42px min(5vw,64px) 80px
}

.hero {
    margin-bottom: 34px;
    padding: 38px;
    border-radius: 30px;
    background: linear-gradient(135deg,#163c73 0%,#1769ff 58%,#17b890 100%);
    color: white;
    box-shadow: var(--shadow);
    overflow: hidden;
    position: relative
}

    .hero::after {
        content: "";
        position: absolute;
        right: -100px;
        top: -90px;
        width: 300px;
        height: 300px;
        border-radius: 999px;
        background: rgba(255,255,255,.16)
    }

.eyebrow {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,.16);
    font-weight: 700;
    font-size: .88rem;
    margin-bottom: 18px
}

h1 {
    margin: 0;
    max-width: 900px;
    font-size: clamp(2rem,5vw,4rem);
    line-height: 1.04;
    letter-spacing: -.06em
}

.hero p {
    max-width: 900px;
    margin: 18px 0 0;
    color: rgba(255,255,255,.88);
    font-size: 1.08rem;
    line-height: 1.75
}

.section-card {
    scroll-margin-top: 96px;
    margin: 26px 0;
    padding: 24px;
    background: rgba(255,255,255,.86);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(16,35,63,.06)
}

.content {
    min-width: 0
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 999px;
    background: #eaf2ff;
    color: var(--blue);
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em
}

h2 {
    margin: 14px 0 10px;
    color: var(--dark);
    font-size: clamp(1.3rem,2.4vw,1.9rem);
    line-height: 1.15;
    letter-spacing: -.03em
}

.content p {
    margin: 0;
    color: #475569;
    font-size: .98rem;
    line-height: 1.7
}

.tip {
    margin-top: 16px;
    padding: 12px 14px;
    border-left: 4px solid var(--accent);
    border-radius: 12px;
    background: #ecfdf5;
    color: #065f46;
    font-weight: 600;
    line-height: 1.5;
    font-size: .92rem
}

.section-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px
}

.media-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 16px;
    border-radius: 999px;
    font-size: .92rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease
}

    .media-link:hover {
        transform: translateY(-1px)
    }

.preview-link {
    border: 1px solid var(--blue);
    background: #eaf2ff;
    color: var(--blue)
}

.video-link {
    border: 1px solid transparent;
    background: var(--blue);
    color: #fff;
    box-shadow: 0 12px 26px rgba(23,105,255,.18)
}

body.preview-open {
    overflow: hidden
}

.image-preview[hidden] {
    display: none
}

.image-preview {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: grid;
    place-items: center;
    padding: 24px
}

.image-preview-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(16,35,63,.62)
}

.image-preview-dialog {
    position: relative;
    width: min(960px,100%);
    max-height: calc(100vh - 48px);
    overflow: auto;
    padding: 22px;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(15,23,42,.3)
}

.image-preview-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 999px;
    background: #eef4ff;
    color: var(--dark);
    font-size: 1.5rem;
    cursor: pointer
}

.image-preview-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    background: #eaf2ff;
    color: var(--blue);
    font-size: .76rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em
}

.image-preview h3 {
    margin: 14px 48px 10px 0;
    color: var(--dark);
    font-size: clamp(1.35rem,2.3vw,2rem);
    line-height: 1.2
}

.image-preview p {
    margin: 0 0 18px;
    color: #475569;
    line-height: 1.7
}

.image-preview-frame {
    border-radius: 18px;
    overflow: hidden;
    background: #eef4ff;
    border: 1px solid #d6e2f2;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 220px
}

    .image-preview-frame img {
        display: block;
        max-width: 100%;
        max-height: calc(100vh - 240px);
        width: auto;
        height: auto;
        object-fit: contain
    }

.back-top {
    position: fixed;
    right: 22px;
    bottom: 22px;
    display: none;
    border: 0;
    border-radius: 999px;
    background: var(--dark);
    color: white;
    padding: 12px 16px;
    font-weight: 800;
    box-shadow: var(--shadow);
    cursor: pointer
}

    .back-top.show {
        display: block
    }

.help-search {
    position: relative;
    flex: 1;
    max-width: 480px;
    margin: 0 18px
}

    .help-search input {
        width: 100%;
        padding: 10px 80px 10px 38px;
        border: 1px solid var(--line);
        border-radius: 999px;
        background: #fff;
        font-size: .95rem;
        color: var(--text);
        outline: none;
        transition: border-color .15s, box-shadow .15s
    }

        .help-search input:focus {
            border-color: var(--blue);
            box-shadow: 0 0 0 3px rgba(23,105,255,.15)
        }

    .help-search .search-icon {
        position: absolute;
        left: 14px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--muted);
        pointer-events: none;
        font-size: 1rem
    }

    .help-search .search-count {
        position: absolute;
        right: 12px;
        top: 50%;
        transform: translateY(-50%);
        font-size: .78rem;
        color: var(--muted);
        font-weight: 700;
        background: #eef4ff;
        padding: 3px 8px;
        border-radius: 999px;
        display: none
    }

        .help-search .search-count.show {
            display: inline-block
        }

    .help-search .search-results {
        position: absolute;
        top: calc(100% + 6px);
        left: 0;
        right: 0;
        background: #fff;
        border: 1px solid var(--line);
        border-radius: 14px;
        box-shadow: var(--shadow);
        max-height: 340px;
        overflow-y: auto;
        display: none;
        z-index: 40
    }

        .help-search .search-results.show {
            display: block
        }

    .help-search .search-result {
        display: block;
        padding: 10px 14px;
        border-bottom: 1px solid #eef2f7;
        color: var(--text);
        text-decoration: none;
        font-size: .9rem;
        cursor: pointer
    }

        .help-search .search-result:last-child {
            border-bottom: 0
        }

        .help-search .search-result:hover, .help-search .search-result.active {
            background: #eaf2ff;
            color: var(--blue)
        }

        .help-search .search-result .sr-title {
            font-weight: 700;
            display: block
        }

        .help-search .search-result .sr-snippet {
            display: block;
            color: var(--muted);
            font-size: .82rem;
            margin-top: 2px
        }

        .help-search .search-result mark {
            background: #fff4a3;
            color: inherit;
            padding: 0 2px;
            border-radius: 3px
        }

.search-empty {
    padding: 14px;
    color: var(--muted);
    font-size: .88rem;
    text-align: center
}

mark.help-hit {
    background: #fff4a3;
    color: inherit;
    padding: 0 2px;
    border-radius: 3px
}

    mark.help-hit.current {
        background: #ffb84d;
        color: #10233f
    }

@media (max-width:980px) {
    .help-search {
        order: 3;
        flex-basis: 100%;
        margin: 10px 0 0;
        max-width: none
    }

    .topbar {
        flex-wrap: wrap
    }
}

@media (max-width:980px) {
    .menu-toggle {
        display: inline-flex
    }

    .layout {
        grid-template-columns: 1fr
    }

    aside {
        position: fixed;
        inset: 72px auto 0 0;
        width: 260px;
        z-index: 30;
        transform: translateX(-105%);
        transition: .22s ease;
        background: white;
        box-shadow: var(--shadow)
    }

        aside.open {
            transform: translateX(0)
        }

    main {
        padding: 26px 16px 70px
    }

    .hero {
        padding: 28px 22px;
        border-radius: 22px
    }

    .section-card, .section-card:nth-child(even) {
        padding: 18px
    }

    .section-actions {
        flex-direction: column
    }

    .media-link {
        width: 100%
    }

    .image-preview {
        padding: 12px
    }

    .image-preview-dialog {
        padding: 18px 16px
    }

    .image-preview h3 {
        margin-right: 36px
    }

    .image-preview-frame img {
        max-height: calc(100vh - 280px)
    }
}
