:root {
  --ink: #111827;
  --muted: #64748b;
  --soft: #f3f6fa;
  --line: #e2e8f0;
  --brand: #00ddff;
  --brand-dark: #2388ff;
  --blue: #5d9dff;
  --violet: #7a4dff;
  --pink: #ff27d7;
  --sidebar: 292px;
  --radius: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #fff;
  font-synthesis: none;
}

html[data-theme="dark"] {
  --ink: #f5f8fb;
  --muted: #aab8c8;
  --soft: #172232;
  --line: #2a394c;
  --brand: #4edfff;
  --brand-dark: #6e7aff;
  --blue: #9db4ff;
  --violet: #9b7dff;
  --pink: #ff6de5;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: #fff; color: var(--ink); transition: background .2s ease, color .2s ease; }
html[data-theme="dark"] body { background: #0d1520; }
a { color: inherit; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 72%, transparent); outline-offset: 3px; }

.topbar { height: 62px; border-top: 5px solid #242424; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 28px; background: rgba(255,255,255,.97); position: sticky; top: 0; z-index: 20; }
html[data-theme="dark"] .topbar, html[data-theme="dark"] .sidebar { background: #101a28; }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.brand-logo { display: block; width: 36px; height: 36px; object-fit: contain; border-radius: 10px; filter: drop-shadow(0 0 8px color-mix(in srgb, var(--brand) 22%, transparent)); }
.top-actions { display: flex; gap: 12px; align-items: center; }
.top-link { color: var(--blue); text-decoration: none; font-size: 14px; font-weight: 700; }
.top-link:hover { text-decoration: underline; }
.theme-button { border: 1px solid color-mix(in srgb, var(--blue) 40%, var(--line)); background: var(--soft); color: var(--blue); width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 17px; display: grid; place-items: center; transition: transform .18s ease, background .18s ease, color .18s ease, border-color .18s ease; }
.theme-button:hover { border-color: var(--brand); color: var(--brand); background: color-mix(in srgb, var(--brand) 13%, var(--soft)); transform: rotate(12deg) scale(1.05); }
.menu-button { display: none; border: 1px solid color-mix(in srgb, var(--blue) 38%, var(--line)); background: var(--soft); color: var(--blue); border-radius: 10px; padding: 9px 11px; cursor: pointer; transition: background .18s ease, color .18s ease, border-color .18s ease; }
.menu-button:hover { color: var(--brand); border-color: var(--brand); background: color-mix(in srgb, var(--brand) 13%, var(--soft)); }

.app-shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: calc(100vh - 62px); }
.sidebar { border-right: 1px solid var(--line); background: #fff; padding: 24px 15px 18px; position: sticky; top: 62px; height: calc(100vh - 62px); overflow: auto; display: flex; flex-direction: column; z-index: 15; }
.sidebar-heading { padding: 2px 14px 14px; display: flex; justify-content: space-between; align-items: center; }
.sidebar-kicker { font-size: 11px; font-weight: 800; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; }
.sidebar-close { display: none; border: 0; background: transparent; font-size: 27px; cursor: pointer; color: var(--muted); }
.category-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.category-button { width: 100%; display: flex; align-items: center; gap: 11px; border: 0; background: transparent; border-radius: 12px; color: var(--ink); text-align: left; padding: 12px 11px; cursor: pointer; font-weight: 750; }
.category-button:hover, .category-button[aria-expanded="true"] { background: color-mix(in srgb, var(--brand-dark) 10%, transparent); color: var(--brand-dark); }
.category-icon { width: 32px; height: 32px; flex: 0 0 32px; display: grid; place-items: center; background: color-mix(in srgb, var(--brand-dark) 13%, transparent); color: var(--brand-dark); border: 1px solid color-mix(in srgb, var(--brand-dark) 20%, transparent); border-radius: 10px; }
.category-icon svg, .topic-icon svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.9; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.category-label { flex: 1; font-size: 14px; }
.category-chevron { width: 17px; height: 17px; display: grid; place-items: center; color: var(--muted); transition: transform .2s ease, color .2s ease; }
.category-chevron svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.category-button[aria-expanded="true"] .category-chevron { transform: rotate(180deg); }
.submenu { display: grid; gap: 2px; padding: 2px 5px 8px 52px; }
.submenu[hidden] { display: none !important; }
.submenu a { color: var(--muted); font-size: 13px; line-height: 1.3; padding: 7px 8px; text-decoration: none; border-radius: 8px; }
.submenu a:hover, .submenu a.active { color: var(--brand-dark); background: color-mix(in srgb, var(--violet) 12%, transparent); }
.sidebar-footer { border-top: 1px solid var(--line); display: grid; gap: 8px; margin: auto 8px 0; padding: 18px 6px 4px; }
.sidebar-footer a { color: var(--blue); text-decoration: none; font-size: 13px; font-weight: 650; }
.sidebar-footer a:hover { text-decoration: underline; }
.sidebar-backdrop { display: none; }

.main-content { width: min(100%, 1180px); padding: 62px clamp(22px, 5vw, 78px) 40px; margin: 0 auto; }
.help-hero { max-width: 850px; margin: 0 auto 58px; text-align: center; }
.eyebrow { margin: 0 0 10px; color: var(--brand-dark); font-size: 11px; font-weight: 850; letter-spacing: .12em; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(30px, 5vw, 47px); letter-spacing: -.045em; margin-bottom: 14px; line-height: 1.05; }
.help-hero > p:not(.eyebrow) { color: var(--muted); font-size: 16px; line-height: 1.6; margin: 0 auto 25px; max-width: 620px; }
.search-box { background: #eef2f6; min-height: 68px; border-radius: 16px; display: flex; align-items: center; gap: 13px; text-align: left; padding: 0 20px; color: var(--muted); box-shadow: inset 0 0 0 1px rgba(100,116,139,.04); }
.search-box > span { font-size: 32px; line-height: 1; transform: rotate(-20deg); }
.search-box input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 15px; }
.search-box input::placeholder { color: #75849a; }
.search-box kbd { border: 1px solid #d6dee8; color: #7c8ba0; background: rgba(255,255,255,.55); border-radius: 6px; padding: 4px 7px; font-size: 11px; white-space: nowrap; }
.hero-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.button { appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 10px 15px; border-radius: 10px; text-decoration: none; font-size: 13px; font-weight: 800; transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease, color .18s ease; }
.button:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(15,23,42,.17); }
.button:active { transform: translateY(0); box-shadow: 0 3px 8px rgba(15,23,42,.13); }
.primary-button { color: #fff !important; background: linear-gradient(135deg, #2388ff 0%, #5c39ff 55%, #7a4dff 100%); border: 1px solid #5c39ff; box-shadow: 0 7px 16px rgba(35,136,255,.22); }
.primary-button:hover { color: #fff !important; background: linear-gradient(135deg, #00ddff 0%, #2388ff 48%, #7a4dff 100%); border-color: #00ddff; box-shadow: 0 12px 25px rgba(35,136,255,.34); }
.secondary-button { color: #1553a6; border: 1px solid #8eb4ed; background: #fff; box-shadow: 0 3px 10px rgba(35,136,255,.06); }
.secondary-button:hover { color: #123a78; border-color: #2388ff; background: #eef5ff; box-shadow: 0 10px 20px rgba(35,136,255,.14); }

.popular-section { margin-bottom: 54px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.section-heading h2 { font-size: 24px; letter-spacing: -.03em; margin: 0; }
.result-count { color: var(--muted); font-size: 13px; }
.popular-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.topic-card { border: 1px solid transparent; background: var(--soft); color: var(--ink); border-radius: var(--radius); padding: 24px 20px 21px; min-height: 188px; cursor: pointer; display: flex; flex-direction: column; text-align: left; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.topic-card:hover, .topic-card:focus-visible { border-color: color-mix(in srgb, var(--brand-dark) 55%, var(--line)); box-shadow: 0 10px 26px color-mix(in srgb, var(--brand-dark) 16%, transparent); transform: translateY(-2px); outline: none; }
.topic-card:active { transform: translateY(0); }
.topic-icon { width: 62px; height: 62px; display: grid; place-items: center; background: color-mix(in srgb, var(--violet) 14%, transparent); border: 1px solid color-mix(in srgb, var(--violet) 24%, transparent); border-radius: 17px; color: var(--brand); margin-bottom: 18px; }
.topic-icon svg { width: 31px; height: 31px; stroke-width: 1.65; }
.topic-card h3 { font-size: 16px; letter-spacing: -.02em; margin-bottom: 7px; }
.topic-card p { color: var(--muted); font-size: 13px; line-height: 1.42; margin: 0; }

.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 52px; border-top: 1px solid var(--line); padding-top: 44px; }
.article-column { min-width: 0; }
.article-breadcrumb { color: var(--muted); font-size: 13px; margin-bottom: 17px; }
.article-breadcrumb a { color: var(--blue); text-decoration: none; }
.article-view { max-width: 760px; }
.article-view .eyebrow { display: inline-flex; align-items: center; gap: 8px; }
.article-view .eyebrow svg { width: 17px; height: 17px; stroke: currentColor; stroke-width: 1.9; fill: none; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 17px; }
.article-view h2 { font-size: clamp(25px, 3vw, 34px); letter-spacing: -.04em; margin-bottom: 14px; line-height: 1.12; }
.article-view .article-lead { color: var(--muted); font-size: 16px; line-height: 1.65; margin-bottom: 28px; }
.article-view h3 { font-size: 18px; margin: 29px 0 10px; }
.article-view p, .article-view li { color: #475569; font-size: 15px; line-height: 1.7; }
.article-view ul, .article-view ol { padding-left: 22px; }
.article-view li + li { margin-top: 7px; }
.article-view strong { color: var(--ink); }
.article-view a { color: var(--blue); }
.article-view code { background: #eef2f6; border-radius: 5px; padding: 2px 5px; color: #0f766e; }
.article-view .tip { background: #effaf5; border-left: 4px solid var(--brand); border-radius: 0 11px 11px 0; padding: 14px 16px; margin: 22px 0; color: #285c4b; }
.article-view .warning { background: #fff8e8; border-left: 4px solid #e7a928; border-radius: 0 11px 11px 0; padding: 14px 16px; margin: 22px 0; color: #76551a; }
.article-view .article-actions { display: flex; flex-wrap: wrap; gap: 9px; margin: 27px 0; }
.article-aside { border-left: 1px solid var(--line); padding-left: 22px; align-self: start; position: sticky; top: 95px; }
.article-aside strong { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 13px; }
.article-aside a { display: block; color: var(--muted); text-decoration: none; font-size: 13px; line-height: 1.4; padding: 7px 0; }
.article-aside a:hover { color: var(--brand-dark); }

.contact-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 17px; background: color-mix(in srgb, var(--violet) 7%, #fff); border: 1px solid color-mix(in srgb, var(--violet) 20%, var(--line)); border-radius: var(--radius); padding: 22px 24px; margin-top: 65px; }
.contact-icon { width: 48px; height: 48px; display: grid; place-items: center; background: #fff; border-radius: 50%; font-size: 24px; }
.contact-card h2 { margin-bottom: 4px; font-size: 19px; }
.contact-card p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 13px; }
.site-footer { border-top: 1px solid var(--line); margin-top: 52px; padding-top: 22px; color: var(--muted); display: flex; justify-content: space-between; gap: 18px; font-size: 12px; }
.site-footer a { color: var(--blue); text-decoration: none; }

.empty-state { padding: 35px 0; color: var(--muted); text-align: center; }
.hidden { display: none !important; }
.main-content.article-mode .help-hero,
.main-content.article-mode .popular-section { display: none; }
.main-content.article-mode .article-layout { border-top: 0; padding-top: 8px; min-height: calc(100vh - 150px); }
.main-content.article-mode .article-view { max-width: 820px; }
.main-content.article-mode .article-view h2 { font-size: clamp(29px, 4vw, 46px); }

html[data-theme="dark"] .search-box,
html[data-theme="dark"] .topic-card { background: #101d3d; }
html[data-theme="dark"] .category-icon { background: #101d3d; }
html[data-theme="dark"] .topic-card:hover, html[data-theme="dark"] .topic-card:focus-visible { border-color: #286d59; }
html[data-theme="dark"] .topic-icon { background: #1a0c3e; color: #4edfff; }
html[data-theme="dark"] .category-button:hover, html[data-theme="dark"] .category-button[aria-expanded="true"] { background: #101d40; }
html[data-theme="dark"] .submenu a:hover, html[data-theme="dark"] .submenu a.active { background: #171044; color: #4edfff; }
html[data-theme="dark"] .secondary-button { color: #c4d4ff; background: #101d3d; border-color: #5268a0; }
html[data-theme="dark"] .secondary-button:hover { color: #fff; background: #17294f; border-color: #4edfff; }
html[data-theme="dark"] .contact-card { background: #101d40; border-color: #2a4276; }
html[data-theme="dark"] .contact-icon { background: #172232; }
html[data-theme="dark"] .article-view .tip { background: #101d40; color: #c4d4ff; }
html[data-theme="dark"] .article-view .warning { background: #3b301a; color: #f9df9a; }
html[data-theme="dark"] .search-box kbd { background: #101a28; border-color: #36485f; }
html[data-theme="dark"] .article-view code { background: #172232; color: #79e7c0; }

@media (max-width: 980px) {
  :root { --sidebar: 270px; }
  .main-content { padding-inline: 34px; }
  .popular-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-layout { grid-template-columns: 1fr; }
  .article-aside { display: none; }
}

@media (max-width: 720px) {
  .topbar { height: 58px; padding: 0 16px; }
  .brand { font-size: 16px; }
  .brand-logo { width: 32px; height: 32px; }
  .top-link { display: none; }
  .menu-button { display: block; }
  .app-shell { display: block; min-height: calc(100vh - 58px); }
  .sidebar { position: fixed; left: 0; top: 58px; width: min(86vw, 310px); height: calc(100vh - 58px); transform: translateX(-105%); transition: transform .25s ease; box-shadow: 12px 0 30px rgba(15,23,42,.12); }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-close { display: block; }
  .sidebar-backdrop { position: fixed; inset: 58px 0 0; background: rgba(15,23,42,.34); z-index: 14; }
  .sidebar.is-open + .sidebar-backdrop { display: block; }
  .main-content { padding: 34px 17px 28px; }
  .help-hero { margin-bottom: 42px; }
  .help-hero > p:not(.eyebrow) { font-size: 14px; }
  .search-box { min-height: 58px; padding-inline: 14px; }
  .search-box kbd { display: none; }
  .hero-actions .button { width: 100%; }
  .section-heading { align-items: start; flex-direction: column; gap: 7px; }
  .popular-grid { grid-template-columns: 1fr; gap: 11px; }
  .topic-card { min-height: 0; padding: 18px; display: grid; grid-template-columns: 52px 1fr; column-gap: 14px; align-items: center; }
  .topic-icon { width: 52px; height: 52px; grid-row: span 2; margin: 0; font-size: 25px; }
  .topic-card h3 { align-self: end; margin: 0 0 4px; }
  .topic-card p { align-self: start; }
  .article-layout { padding-top: 31px; }
  .main-content.article-mode { padding-top: 31px; }
  .main-content.article-mode .article-layout { padding-top: 0; min-height: 0; }
  .article-view h2 { font-size: 27px; }
  .article-view p, .article-view li { font-size: 14px; }
  .contact-card { grid-template-columns: auto 1fr; padding: 18px; }
  .contact-card .button { grid-column: 1 / -1; width: 100%; }
  .site-footer { flex-direction: column; gap: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
