:root {
  --ink: #0b1520;
  --teal: #004051;
  --teal-deep: #003544;
  --cyan: #00bfe5;
  --blue: #007ea8;
  --paper: #f4f7f8;
  --card: #ffffff;
  --line: rgba(0, 126, 168, 0.16);
  --muted: #5c6b73;
  --ok: #0f7b4c;
  --warn: #8a5a00;
  --danger: #9b2c2c;
  --sidebar: 280px;
  --header: 64px;
  --shadow: 0 18px 40px rgba(0, 64, 81, 0.08);
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--paper); color: var(--ink); }
a { color: var(--blue); }
button, input { font: inherit; }

.shell { min-height: 100vh; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--header);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  background: linear-gradient(90deg, var(--teal-deep), var(--teal) 55%, #0b5f73);
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 53, 68, 0.25);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  min-width: 180px;
}
.brand img { width: 36px; height: 36px; object-fit: contain; background: #fff; border-radius: 8px; padding: 2px; }
.brand-name {
  font-weight: 800;
  letter-spacing: 0.14em;
  font-size: 15px;
}
.brand-sub { display: block; letter-spacing: 0.04em; font-size: 11px; font-weight: 500; opacity: 0.85; }
.search {
  flex: 1;
  max-width: 520px;
  margin-left: auto;
}
.search input {
  width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  outline: none;
}
.search input::placeholder { color: rgba(255, 255, 255, 0.75); }
.menu-btn {
  display: none;
  border: 0;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
}

.layout { display: flex; align-items: stretch; min-height: calc(100vh - var(--header)); }
.sidebar {
  width: var(--sidebar);
  flex: 0 0 var(--sidebar);
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 18px 12px 40px;
  position: sticky;
  top: var(--header);
  height: calc(100vh - var(--header));
  overflow: auto;
}
.nav-section { margin-bottom: 8px; }
.nav-parent {
  display: flex;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--teal);
  font-weight: 700;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.nav-parent.active, .nav-child.active { background: rgba(0, 191, 229, 0.14); }
.nav-child {
  display: block;
  margin-left: 8px;
  padding: 7px 10px 7px 16px;
  border-left: 2px solid rgba(0, 126, 168, 0.18);
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  border-radius: 0 8px 8px 0;
}
.nav-child:hover { background: rgba(0, 126, 168, 0.06); }

.main { flex: 1; min-width: 0; padding: 28px 32px 64px; }
.hero {
  background:
    radial-gradient(ellipse 70% 80% at 100% 0%, rgba(0, 191, 229, 0.22), transparent 55%),
    linear-gradient(165deg, #003544, #004051 60%, #0b1520);
  color: #fff;
  border-radius: 18px;
  padding: 36px;
  box-shadow: var(--shadow);
}
.hero h1 { margin: 8px 0 10px; font-size: 36px; letter-spacing: -0.03em; }
.kicker { letter-spacing: 0.16em; font-size: 12px; font-weight: 700; color: var(--cyan); }
.hero p { max-width: 680px; line-height: 1.6; color: rgba(255, 255, 255, 0.88); }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.btn {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 10px 16px;
  text-decoration: none;
  font-weight: 700;
}
.btn-primary { background: var(--cyan); color: #003544; }
.btn-ghost { background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, 0.35); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 18px; }
.card {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
}
.card strong { display: block; color: var(--teal); margin-bottom: 6px; }
.card span { color: var(--muted); font-size: 14px; line-height: 1.45; }

.article {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px 32px 40px;
  box-shadow: var(--shadow);
  max-width: 920px;
}
.crumb { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.article h1 { margin: 0 0 8px; color: var(--teal-deep); letter-spacing: -0.02em; }
.lede { color: var(--muted); font-size: 17px; line-height: 1.55; margin-top: 0; }
.article h2 { margin-top: 28px; color: var(--teal); font-size: 22px; }
.article h3 { margin-top: 22px; color: var(--teal-deep); }
.article p, .article li { line-height: 1.65; }
.article ul, .article ol { padding-left: 22px; }
.article table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 14px; }
.article th, .article td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.article th { background: #eef6f8; color: var(--teal); }
.article code { background: #eef6f8; padding: 1px 5px; border-radius: 4px; font-size: 0.92em; }
.article pre {
  background: #0b1520;
  color: #e8f7fb;
  padding: 14px 16px;
  border-radius: 12px;
  overflow: auto;
}
.article pre code { background: transparent; color: inherit; padding: 0; }
.article img, .shot {
  display: block;
  max-width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  margin: 12px 0;
  background: #f7fbfc;
}
.shot.missing {
  min-height: 160px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 16px 18px;
  color: var(--muted);
  border-style: dashed;
}
.shot.missing strong { color: var(--teal); }
.shot.missing code { margin-top: 6px; }

.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; }
.pager a {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  text-decoration: none;
  color: var(--teal);
  background: #f7fbfc;
}
.pager a span { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }

.component { margin: 16px 0 20px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.component header {
  padding: 10px 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  font-size: 12px;
  text-transform: uppercase;
}
.form-block header { background: #e7f6fb; color: var(--teal); }
.form-block .req { color: var(--danger); font-weight: 700; }
.steps-block header { background: #e8f7ef; color: var(--ok); }
.steps-block ol { margin: 0; padding: 14px 14px 14px 36px; }
.steps-block li { margin: 8px 0; }
.callout { padding: 12px 14px; }
.callout header { padding: 0 0 6px; background: transparent; }
.callout.note { background: #eef6f8; }
.callout.tip { background: #e8f7ef; }
.callout.warning { background: #fff6e8; }
.callout.warning header { color: var(--warn); }
.callout.note header { color: var(--blue); }
.callout.tip header { color: var(--ok); }

.results { display: grid; gap: 8px; }
.result {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  background: #f7fbfc;
}
.result strong { color: var(--teal); }
.result small { display: block; color: var(--muted); }

@media (max-width: 860px) {
  .menu-btn { display: inline-flex; }
  .search { display: none; }
  .sidebar {
    position: fixed;
    z-index: 30;
    left: 0;
    transform: translateX(-105%);
    transition: transform 160ms ease;
    width: min(86vw, 320px);
    height: calc(100vh - var(--header));
  }
  .sidebar.open { transform: none; box-shadow: var(--shadow); }
  .main { padding: 18px 14px 48px; }
  .article { padding: 18px 16px 28px; }
  .hero { padding: 22px; }
  .hero h1 { font-size: 28px; }
}
