:root {
  color-scheme: light;
  --ink: #10263a;
  --muted: #5d7184;
  --blue: #2f5f91;
  --blue-dark: #173653;
  --blue-soft: #eaf2fa;
  --line: #dce6ef;
  --surface: #ffffff;
  --soft: #f5f8fb;
  --shadow: 0 18px 50px rgba(28, 55, 82, .10);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 10% 0%, rgba(73, 131, 185, .12), transparent 30rem),
    #f8fafc;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

button, input { font: inherit; }

a { color: inherit; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 74px;
  padding: 12px max(22px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid rgba(220, 230, 239, .85);
  background: rgba(248, 250, 252, .88);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: linear-gradient(145deg, #3f77aa, var(--blue-dark));
  color: #fff;
  font-weight: 900;
  box-shadow: 0 10px 25px rgba(47, 95, 145, .24);
}

.brand > span:last-child { display: grid; line-height: 1.15; }
.brand small { color: var(--muted); font-size: 12px; }

.site-header nav { display: flex; align-items: center; gap: 16px; }
.site-header nav a { color: var(--muted); font-weight: 750; text-decoration: none; }
.site-header .button-link { padding: 10px 15px; border-radius: 10px; background: var(--blue); color: #fff; }

main { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }

.hero { padding: clamp(54px, 8vw, 94px) 0 44px; text-align: center; }
.eyebrow { margin: 0 0 8px; color: var(--blue); font-size: 12px; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.hero h1 { margin: 0; font-size: clamp(36px, 6vw, 64px); line-height: 1.05; letter-spacing: -.04em; }
.hero > p:not(.eyebrow) { max-width: 700px; margin: 18px auto 28px; color: var(--muted); font-size: clamp(16px, 2vw, 19px); }

.search-box {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: min(760px, 100%);
  min-height: 62px;
  margin: 0 auto;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--muted);
}

.search-box:focus-within { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(47, 95, 145, .12), var(--shadow); }
.search-box span { font-size: 26px; line-height: 1; }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 16px; }
.search-box kbd { padding: 3px 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--soft); color: var(--muted); }

.role-filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 20px; }
.role-filters button, #categoryNav button, .empty-state button {
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}
.role-filters button.active { border-color: var(--blue); background: var(--blue); color: #fff; }

.knowledge-shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 34px; padding: 28px 0 80px; }
.knowledge-shell > * { min-width: 0; }
aside { align-self: start; position: sticky; top: 96px; }
.aside-title { margin: 0 0 10px; font-size: 12px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
#categoryNav { display: grid; gap: 5px; }
#categoryNav button { width: 100%; border-color: transparent; border-radius: 10px; background: transparent; text-align: left; }
#categoryNav button:hover, #categoryNav button.active { background: var(--blue-soft); color: var(--blue-dark); }

.support-card { margin-top: 26px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.support-card p { color: var(--muted); font-size: 13px; }
.support-card a { color: var(--blue); font-size: 13px; font-weight: 800; }

.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-heading h2 { margin: 0; font-size: clamp(25px, 3vw, 34px); letter-spacing: -.025em; }
#resultCount { color: var(--muted); font-size: 13px; font-weight: 750; }

.article-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.article-card {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 9px;
  min-height: 220px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 8px 25px rgba(28, 55, 82, .06);
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.article-card:hover { transform: translateY(-3px); border-color: rgba(47, 95, 145, .46); box-shadow: var(--shadow); }
.article-card .meta { color: var(--blue); font-size: 11px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.article-card h3 { margin: 0; font-size: 19px; line-height: 1.25; }
.article-card p { margin: 0; color: var(--muted); font-size: 14px; }
.article-card .read-more { color: var(--blue); font-size: 13px; font-weight: 850; }

.empty-state { padding: 46px 22px; border: 1px dashed var(--line); border-radius: 18px; text-align: center; background: var(--surface); }
.empty-state p { color: var(--muted); }

.article-view { max-width: 820px; scroll-margin-top: 96px; }
.article-open .hero,
.article-open .knowledge-shell > aside { display: none; }
.article-open .knowledge-shell { grid-template-columns: minmax(0, 820px); justify-content: center; padding-top: 46px; }
.back-button { margin-bottom: 20px; padding: 9px 0; border: 0; background: transparent; color: var(--blue); font-weight: 850; cursor: pointer; }
.article-header { margin-bottom: 28px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.article-header h1 { margin: 7px 0 13px; font-size: clamp(30px, 5vw, 48px); line-height: 1.08; letter-spacing: -.035em; }
.article-header p { color: var(--muted); font-size: 17px; }
.article-body h2 { margin: 34px 0 10px; font-size: 23px; }
.article-body p, .article-body li { color: #334b61; }
.steps { display: grid; gap: 12px; margin: 18px 0 30px; padding: 0; list-style: none; counter-reset: steps; }
.steps li { position: relative; min-height: 56px; padding: 14px 16px 14px 58px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); counter-increment: steps; }
.steps li::before { content: counter(steps); position: absolute; left: 15px; top: 13px; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--blue); color: #fff; font-weight: 900; }
.tip { margin: 26px 0; padding: 17px 19px; border-left: 4px solid var(--blue); border-radius: 0 12px 12px 0; background: var(--blue-soft); color: var(--blue-dark); }

footer { display: flex; justify-content: space-between; gap: 20px; width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 38px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }

@media (max-width: 820px) {
  .knowledge-shell { grid-template-columns: 1fr; }
  aside { position: static; }
  #categoryNav { display: flex; width: 100%; max-width: 100%; overflow-x: auto; padding-bottom: 7px; }
  #categoryNav button { width: auto; white-space: nowrap; border-color: var(--line); background: var(--surface); }
  .support-card { display: none; }
}

@media (max-width: 620px) {
  .site-header { min-height: 66px; padding-inline: 16px; }
  .site-header nav > a:first-child { display: none; }
  .brand-mark { width: 38px; height: 38px; }
  main { width: min(100% - 24px, 1180px); }
  .hero { padding-top: 42px; }
  .search-box { min-height: 58px; padding-inline: 14px; border-radius: 15px; }
  .search-box kbd { display: none; }
  .article-grid { grid-template-columns: 1fr; }
  .article-card { min-height: 190px; }
  .section-heading { align-items: start; }
  footer { display: grid; width: calc(100% - 24px); }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
