:root {
    --hc-primary: #2563eb;
    --hc-primary-light: #3b82f6;
    --hc-primary-soft: #eff6ff;
    --hc-bg: #ffffff;
    --hc-bg-subtle: #f8fafc;
    --hc-sidebar: #fbfbfc;
    --hc-border: #e2e8f0;
    --hc-text: #0f172a;
    --hc-text-muted: #64748b;
    --hc-topbar-h: 56px;
    --hc-sidebar-w: 280px;
    --hc-toc-w: 220px;
    --hc-font: 'Inter', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.help-center {
    margin: 0;
    font-family: var(--hc-font);
    font-size: 15px;
    line-height: 1.65;
    color: var(--hc-text);
    background: var(--hc-bg);
}

.hc-topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--hc-topbar-h);
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 1rem 0 0.75rem;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-bottom: 1px solid #334155;
}

.hc-topbar-start {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: var(--hc-sidebar-w);
}

.hc-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 8px;
    background: rgba(255,255,255,0.08);
    color: #e2e8f0;
    cursor: pointer;
}

.hc-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    color: #fff;
}

.hc-brand img { height: 28px; width: auto; }

.hc-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.hc-brand-text strong { font-size: 0.9375rem; font-weight: 600; }
.hc-brand-text small { font-size: 0.6875rem; color: #94a3b8; font-weight: 500; }

.hc-topbar-search {
    flex: 1;
    max-width: 420px;
    position: relative;
}

.hc-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    pointer-events: none;
}

.hc-topbar-search input {
    width: 100%;
    height: 36px;
    padding: 0 12px 0 36px;
    border: 1px solid #334155;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.6);
    color: #f1f5f9;
    font: inherit;
    font-size: 0.875rem;
}

.hc-topbar-search input::placeholder { color: #64748b; }
.hc-topbar-search input:focus {
    outline: none;
    border-color: var(--hc-primary-light);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

.hc-topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
}

.hc-link-app {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
}

.hc-link-app:hover { color: #fff; }

.hc-btn-app {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.85rem;
    border-radius: 8px;
    background: var(--hc-primary);
    color: #fff;
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 600;
}

.hc-btn-app:hover { background: var(--hc-primary-light); color: #fff; }

.hc-layout {
    display: flex;
    min-height: calc(100vh - var(--hc-topbar-h));
}

.hc-sidebar {
    width: var(--hc-sidebar-w);
    flex-shrink: 0;
    background: var(--hc-sidebar);
    border-right: 1px solid var(--hc-border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: var(--hc-topbar-h);
    height: calc(100vh - var(--hc-topbar-h));
    overflow-y: auto;
}

.hc-nav { padding: 1rem 0.75rem; flex: 1; }

.hc-nav-group { margin-bottom: 1.25rem; }

.hc-nav-group-title {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--hc-text-muted);
    padding: 0 0.75rem 0.5rem;
}

.hc-nav-list { list-style: none; margin: 0; padding: 0; }

.hc-nav-link {
    display: block;
    padding: 0.45rem 0.75rem;
    margin: 1px 0;
    border-radius: 6px;
    color: #334155;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    border-left: 2px solid transparent;
}

.hc-nav-link:hover { background: #f1f5f9; color: var(--hc-text); }

.hc-nav-link.is-active {
    background: var(--hc-primary-soft);
    color: var(--hc-primary);
    border-left-color: var(--hc-primary);
    font-weight: 600;
}

.hc-nav-link.is-hidden { display: none; }
.hc-nav-group.is-hidden { display: none; }

.hc-sidebar-footer {
    padding: 1rem 0.75rem;
    border-top: 1px solid var(--hc-border);
    font-size: 0.75rem;
    color: var(--hc-text-muted);
}
.hc-sidebar-footer a {
    color: var(--hc-primary);
    text-decoration: none;
    font-weight: 500;
}
.hc-sidebar-footer a:hover { text-decoration: underline; }
.hc-sidebar-footer p { margin: 0 0 0.35rem; }
.hc-sidebar-footer p:last-child { margin-bottom: 0; }

.hc-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    top: var(--hc-topbar-h);
    background: rgba(15, 23, 42, 0.45);
    z-index: 90;
}

.hc-backdrop.is-visible { display: block; }

.hc-main {
    flex: 1;
    display: flex;
    gap: 2rem;
    justify-content: center;
    padding: 2rem 2.5rem 4rem;
    min-width: 0;
}

.hc-article {
    flex: 1;
    max-width: 760px;
    min-width: 0;
}

.hc-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8125rem;
    color: var(--hc-text-muted);
    margin-bottom: 1.5rem;
}

.hc-breadcrumb a { color: var(--hc-primary); text-decoration: none; }
.hc-breadcrumb a:hover { text-decoration: underline; }
.hc-breadcrumb-sep { opacity: 0.5; }

.hc-prose h1 {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.25;
    margin: 0 0 1rem;
    letter-spacing: -0.02em;
}

.hc-prose h2 {
    font-size: 1.375rem;
    font-weight: 700;
    margin: 2.25rem 0 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--hc-border);
    scroll-margin-top: calc(var(--hc-topbar-h) + 1rem);
}

.hc-prose h2:first-child { border-top: none; margin-top: 0; padding-top: 0; }

.hc-prose h3 {
    font-size: 1.0625rem;
    font-weight: 600;
    margin: 1.5rem 0 0.5rem;
    scroll-margin-top: calc(var(--hc-topbar-h) + 1rem);
}

.hc-prose p { margin: 0 0 1rem; }
.hc-prose strong { font-weight: 600; color: #1e293b; }
.hc-prose a { color: var(--hc-primary); text-decoration: none; font-weight: 500; }
.hc-prose a:hover { text-decoration: underline; }
.hc-prose ul, .hc-prose ol { margin: 0 0 1rem; padding-left: 1.35rem; }
.hc-prose li { margin-bottom: 0.35rem; }
.hc-prose hr { border: none; border-top: 1px solid var(--hc-border); margin: 2rem 0; }

.hc-prose code {
    font-family: ui-monospace, 'Cascadia Code', monospace;
    font-size: 0.85em;
    background: #f1f5f9;
    padding: 0.15em 0.4em;
    border-radius: 4px;
    color: #be123c;
}

.hc-prose pre {
    background: #0f172a;
    color: #e2e8f0;
    padding: 1rem 1.15rem;
    border-radius: 10px;
    overflow-x: auto;
    margin: 0 0 1.25rem;
    font-size: 0.8125rem;
    line-height: 1.55;
}

.hc-prose pre code { background: none; color: inherit; padding: 0; }

.hc-prose img {
    display: block;
    max-width: 100%;
    width: auto;
    height: auto;
    margin: 0.75rem auto 1.25rem;
    border-radius: 10px;
    border: 1px solid var(--hc-border);
    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.1);
    background: #fff;
}

.hc-prose .table-wrap {
    overflow-x: auto;
    margin: 0 0 1.25rem;
    border: 1px solid var(--hc-border);
    border-radius: 10px;
}

.hc-prose table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.hc-prose th {
    background: var(--hc-bg-subtle);
    font-weight: 600;
    text-align: left;
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid var(--hc-border);
    white-space: nowrap;
}
.hc-prose td {
    padding: 0.6rem 0.85rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: top;
}
.hc-prose tr:last-child td { border-bottom: none; }

.hc-prose .mermaid {
    background: var(--hc-bg-subtle);
    border: 1px solid var(--hc-border);
    border-radius: 10px;
    padding: 1rem;
    margin: 0 0 1.25rem;
    text-align: center;
}

.hc-callout {
    display: grid;
    grid-template-columns: 1.4rem minmax(0, 1fr);
    column-gap: 0.75rem;
    align-items: start;
    margin: 0 0 1.25rem;
    padding: 0.9rem 1.05rem;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: var(--hc-text);
}
.hc-callout::before {
    content: 'i';
    width: 1.35rem;
    height: 1.35rem;
    margin-top: 0.15rem;
    border-radius: 999px;
    background: #2563eb;
    color: #fff;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 0.8rem;
    font-weight: 700;
    font-style: italic;
    line-height: 1.35rem;
    text-align: center;
}
.hc-callout p { margin: 0 0 0.5rem; }
.hc-callout p:last-child { margin-bottom: 0; }
.hc-callout ul,
.hc-callout ol { margin: 0 0 0.5rem; padding-left: 1.2rem; }
.hc-callout-warning {
    background: #fffbeb;
    border-color: #fde68a;
}
.hc-callout-warning::before {
    content: '!';
    background: #d97706;
    font-family: Inter, 'Segoe UI', sans-serif;
    font-style: normal;
}
.hc-callout-danger {
    background: #fef2f2;
    border-color: #fecaca;
}
.hc-callout-danger::before {
    content: '!';
    background: #dc2626;
    font-family: Inter, 'Segoe UI', sans-serif;
    font-style: normal;
}

.hc-search-hit {
    display: block;
    padding: 1rem 1.15rem;
    margin-bottom: 0.75rem;
    border: 1px solid var(--hc-border);
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.hc-search-hit:hover {
    border-color: #bfdbfe;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
    color: inherit;
}
.hc-search-hit small { color: var(--hc-text-muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.hc-search-hit strong { display: block; margin: 0.2rem 0 0.35rem; font-size: 1rem; color: #111827; }
.hc-search-hit p { margin: 0; font-size: 0.875rem; color: var(--hc-text-muted); }

.hc-empty {
    padding: 2rem 0;
    color: var(--hc-text-muted);
}

.hc-pager {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--hc-border);
}

.hc-pager-link {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem;
    border: 1px solid var(--hc-border);
    border-radius: 10px;
    text-decoration: none;
    color: var(--hc-text);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.hc-pager-link span {
    font-size: 0.75rem;
    color: var(--hc-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.hc-pager-link strong { font-size: 0.9375rem; }

.hc-pager-link:hover {
    border-color: var(--hc-primary-light);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
}

.hc-pager-next { text-align: right; }

.hc-toc {
    width: var(--hc-toc-w);
    flex-shrink: 0;
    position: sticky;
    top: calc(var(--hc-topbar-h) + 2rem);
    align-self: flex-start;
    max-height: calc(100vh - var(--hc-topbar-h) - 4rem);
    overflow-y: auto;
}

.hc-toc-title {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--hc-text-muted);
    margin-bottom: 0.75rem;
}

.hc-toc-list { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--hc-border); }

.hc-toc-item a {
    display: block;
    padding: 0.3rem 0 0.3rem 0.85rem;
    margin-left: -1px;
    border-left: 2px solid transparent;
    font-size: 0.8125rem;
    color: var(--hc-text-muted);
    text-decoration: none;
    line-height: 1.4;
}

.hc-toc-item a:hover { color: var(--hc-text); }
.hc-toc-item a.is-active { color: var(--hc-primary); border-left-color: var(--hc-primary); font-weight: 600; }
.hc-toc-level-3 a { padding-left: 1.35rem; font-size: 0.75rem; }

@media (max-width: 1100px) {
    .hc-toc { display: none; }
}

@media (max-width: 900px) {
    .hc-topbar-start { min-width: auto; }
    .hc-menu-toggle { display: inline-flex; }
    .hc-link-app { display: none; }

    .hc-sidebar {
        position: fixed;
        left: 0;
        top: var(--hc-topbar-h);
        z-index: 95;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        box-shadow: 4px 0 24px rgba(0,0,0,0.12);
    }

    .hc-sidebar.is-open { transform: translateX(0); }
    .hc-main { padding: 1.25rem 1rem 3rem; }
    .hc-prose h1 { font-size: 1.625rem; }
}

@media (max-width: 520px) {
    .hc-topbar-search { display: none; }
    .hc-pager { grid-template-columns: 1fr; }
    .hc-pager-next { text-align: left; }
}
