:root {
  --bg: #f8fafc;
  --panel: #ffffff;
  --ink: #15223a;
  --muted: #66758a;
  --line: #dde6f1;
  --blue: #1769e0;
  --blue-2: #0d4fb3;
  --red: #d94a38;
  --amber: #d89b24;
  --green: #1e8a5a;
  --shadow: 0 18px 46px rgba(31, 48, 78, 0.12);
  font-family: Inter, "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
}

.app-loading {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}

.loading-window {
  display: grid;
  width: min(360px, 100%);
  justify-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 30px 24px;
  text-align: center;
}

.loading-spinner {
  width: 42px;
  height: 42px;
  border: 3px solid #dbe7f5;
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: bbox-spin 0.85s linear infinite;
}

.loading-window strong {
  font-size: 18px;
}

.loading-window p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

@keyframes bbox-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .loading-spinner {
    animation-duration: 1.8s;
  }
}

.bbox-navbar {
  z-index: 40;
  min-height: 66px;
  backdrop-filter: blur(14px);
}

.bbox-navbar .container {
  justify-content: flex-start;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-weight: 850;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font-size: 14px;
}

.desktop-nav {
  display: flex;
  justify-content: flex-end;
  gap: 2px;
}

.nav-link,
.menu-link {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #4d5a70;
  cursor: pointer;
  padding: 10px 14px;
  font-weight: 700;
}

.nav-link.active,
.nav-link:hover,
.menu-link.active,
.menu-link:hover {
  color: var(--blue);
  background: #eaf2ff;
}

.mobile-menu-button {
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.mobile-menu-button span,
.mobile-menu-button span::before,
.mobile-menu-button span::after {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
  content: "";
}

.mobile-menu-button span::before {
  transform: translateY(-6px);
}

.mobile-menu-button span::after {
  transform: translateY(4px);
}

.mobile-drawer {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
  width: min(286px, 78vw);
  transform: translateX(-100%);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background: #111827;
  color: #fff;
  padding: 18px;
  transition: transform 160ms ease;
}

.mobile-drawer.open {
  transform: translateX(0);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  background: rgba(10, 15, 24, 0.45);
}

.drawer-backdrop.open {
  display: block;
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.drawer-close {
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font-size: 28px;
}

.drawer-nav {
  display: grid;
  gap: 6px;
}

.drawer-nav .menu-link {
  color: #dbe4f0;
  text-align: left;
}

.site-main {
  background: var(--bg);
}

.template-hero {
  min-height: 650px;
  background:
    linear-gradient(90deg, rgba(248, 251, 255, 0.96) 0%, rgba(248, 251, 255, 0.88) 42%, rgba(230, 241, 255, 0.72) 100%),
    radial-gradient(circle at 85% 20%, rgba(23, 105, 224, 0.18), transparent 35%);
}

.hero-kicker,
.eyebrow,
.section-kicker {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border: 1px solid #cbd8ec;
  border-radius: 999px;
  background: #fff;
  color: var(--blue);
  padding: 7px 11px;
  font-size: 13px;
  font-weight: 800;
}

.page-title {
  margin: 18px 0;
  max-width: 820px;
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.lead {
  max-width: 760px;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.72;
}

.hero-image-card {
  position: relative;
  overflow: hidden;
  margin: 0;
  border: 1px solid rgba(23, 32, 51, 0.08);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.hero-image-card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.hero-metrics {
  position: absolute;
  right: 14px;
  bottom: 14px;
  left: 14px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.hero-metrics div {
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.76);
  color: #fff;
  padding: 12px;
  backdrop-filter: blur(12px);
}

.hero-metrics strong {
  display: block;
  font-size: 18px;
}

.hero-metrics span {
  color: #dbe4f0;
  font-size: 12px;
}

.feature-overlap {
  margin-top: -72px;
  position: relative;
  z-index: 2;
}

.feature-shell {
  border-radius: 8px;
  background: #fff;
  padding: 44px;
}

.feature-tile {
  display: grid;
  width: 100%;
  min-height: 180px;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 14px;
  text-align: center;
}

.feature-tile small {
  display: block;
  color: var(--muted);
  line-height: 1.65;
}

.feature-icon {
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  border-radius: 50%;
  background: #eaf2ff;
  color: var(--blue);
  font-size: 36px;
}

.band {
  padding: 66px clamp(18px, 5vw, 76px);
  border-top: 1px solid var(--line);
}

.page-band {
  background: #fff;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.section-head.compact {
  align-items: center;
  margin-bottom: 16px;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 46px);
}

.workflow-section {
  background: #fff;
}

.workflow-line {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px;
}

.workflow-step {
  position: relative;
  display: grid;
  justify-items: center;
  text-align: center;
}

.workflow-step span {
  display: grid;
  width: 96px;
  height: 96px;
  place-items: center;
  border: 10px solid #edf3fc;
  border-radius: 50%;
  color: var(--blue);
  font-size: 24px;
  font-weight: 900;
}

.workflow-step h3 {
  margin: 18px 0 8px;
  font-size: 20px;
}

.workflow-step p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.feature-card,
.download-row,
.release-row,
.contact-panel,
.admin-panel,
.doc-content,
.doc-sidebar {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.feature-card {
  min-height: 170px;
  padding: 22px;
}

.feature-card h3,
.download-row h3,
.release-row h3 {
  margin: 0 0 10px;
  font-size: 21px;
}

.feature-card p,
.download-row p,
.release-row p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.download-list,
.release-list {
  display: grid;
  gap: 12px;
}

.download-row,
.release-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 18px;
}

.release-row code {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin-top: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7f9fc;
  color: #36435a;
  padding: 6px 8px;
  font-size: 12px;
}

.release-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 13px;
}

.pill {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border-radius: 999px;
  background: #eaf2ff;
  color: var(--blue);
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 850;
}

.docs-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.doc-sidebar {
  position: sticky;
  top: 84px;
  max-height: calc(100vh - 104px);
  overflow: auto;
  padding: 12px;
}

.doc-sidebar h3 {
  margin: 8px 10px 12px;
  color: var(--muted);
  font-size: 13px;
}

.doc-nav-button {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
  padding: 10px;
  text-align: left;
}

.doc-nav-button.active,
.doc-nav-button:hover {
  background: #eaf2ff;
}

.doc-nav-button strong,
.doc-nav-button span {
  display: block;
}

.doc-nav-button span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.doc-content {
  min-height: 520px;
  padding: clamp(22px, 4vw, 42px);
}

.markdown-body {
  color: #252d3d;
  line-height: 1.78;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
  line-height: 1.25;
}

.markdown-body code {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7f9fc;
  padding: 2px 6px;
}

.markdown-body pre {
  overflow: auto;
  border-radius: 8px;
  background: #111827;
  color: #eef4ff;
  padding: 16px;
}

.contact-panel {
  padding: 28px;
  background: #111827;
  color: #fff;
}

.footer-link {
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  padding: 0;
}

.contact-panel p {
  color: #c9d3e2;
  line-height: 1.7;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(250px, 0.3fr) minmax(0, 0.7fr);
  gap: 18px;
}

.release-admin-panel {
  grid-column: 1 / -1;
}

.admin-panel {
  padding: 18px;
}

.analytics-panel {
  margin: 18px auto;
  max-width: min(1180px, calc(100vw - 32px));
}

.analytics-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.analytics-metrics div,
.analytics-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  padding: 14px;
}

.analytics-metrics strong {
  display: block;
  color: var(--ink);
  font-size: clamp(20px, 3vw, 30px);
  line-height: 1.1;
}

.analytics-metrics span,
.analytics-row span,
.analytics-row code {
  color: var(--muted);
  font-size: 13px;
}

.analytics-columns {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(180px, 0.8fr) minmax(260px, 1.4fr);
  gap: 12px;
  margin-top: 14px;
}

.analytics-card h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.analytics-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.analytics-row:first-of-type {
  border-top: 0;
}

.analytics-row.path-row {
  grid-template-columns: minmax(0, 1fr) minmax(90px, 0.7fr) auto;
}

.analytics-row.path-row span,
.analytics-row.path-row code {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-title {
  margin: 18px 0 10px;
  font-size: 15px;
}

.form-grid {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.field.full-line,
.release-current.full-line {
  grid-column: 1 / -1;
}

.field label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 780;
}

.field small {
  color: var(--muted);
  line-height: 1.5;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 11px 12px;
}

.field textarea {
  min-height: 360px;
  resize: vertical;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  line-height: 1.55;
}

.field textarea.short-textarea {
  min-height: 120px;
}

.editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

.doc-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.doc-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px 34px;
  gap: 6px;
  align-items: stretch;
}

.release-list-row {
  grid-template-columns: minmax(0, 1fr);
}

.doc-list-row button {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  cursor: pointer;
  padding: 10px;
  text-align: left;
}

.doc-list-row.active button:first-child {
  border-color: #9dc1f6;
  background: #eaf2ff;
}

.doc-list-row .icon-button {
  display: grid;
  place-items: center;
  padding: 0;
  text-align: center;
}

.status {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.status.error {
  color: var(--red);
}

.release-current {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f9fc;
  padding: 12px;
}

.release-current a {
  color: var(--blue);
  word-break: break-all;
}

.access-gate {
  display: grid;
  min-height: 100vh;
  place-items: center;
  background: #fff;
  padding: 24px;
}

.access-window {
  width: min(440px, 100%);
  border-radius: 8px;
  background: #f7f8fb;
  box-shadow:
    18px 18px 36px rgba(175, 184, 198, 0.38),
    -18px -18px 36px rgba(255, 255, 255, 0.95);
  padding: clamp(24px, 6vw, 38px);
}

.access-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 24px;
}

.access-brand strong,
.access-brand span {
  display: block;
}

.access-brand strong {
  font-size: 24px;
  line-height: 1.1;
}

.access-brand span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.access-form {
  display: grid;
  gap: 12px;
}

.access-form label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.access-form input {
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: #f7f8fb;
  box-shadow:
    inset 7px 7px 14px rgba(178, 187, 202, 0.36),
    inset -7px -7px 14px rgba(255, 255, 255, 0.92);
  color: var(--ink);
  padding: 15px 16px;
  outline: none;
}

.access-form input:focus {
  box-shadow:
    inset 6px 6px 12px rgba(178, 187, 202, 0.42),
    inset -6px -6px 12px rgba(255, 255, 255, 0.95),
    0 0 0 3px rgba(23, 105, 224, 0.14);
}

.access-hint,
.access-status {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.access-status.error {
  color: var(--red);
}

.access-dialog {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.35);
  padding: 18px;
}

.access-dialog-panel {
  width: min(360px, 100%);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 22px;
}

.access-dialog-panel strong {
  display: block;
  margin-bottom: 8px;
  font-size: 18px;
}

.access-dialog-panel p {
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 980px) {
  .feature-overlap {
    margin-top: 0;
  }

  .feature-shell {
    padding: 24px;
  }

  .workflow-line,
  .docs-layout,
  .admin-layout,
  .editor-grid,
  .analytics-columns {
    grid-template-columns: 1fr;
  }

  .analytics-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .doc-sidebar {
    position: relative;
    top: auto;
    max-height: 260px;
  }

  .section-head,
  .download-row,
  .release-row {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .bbox-navbar {
    height: 58px;
  }

  .brand {
    margin-left: auto;
  }

  .brand span:last-child {
    display: inline-block;
    max-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .template-hero .display-5 {
    font-size: 28px;
    line-height: 1.14;
    word-break: break-all;
  }

  .template-hero .lead {
    font-size: 16px;
  }

  .hero-image-card {
    margin-inline: -10px;
  }

  .page-title {
    font-size: 30px;
    line-height: 1.12;
    max-width: 100%;
    word-break: break-all;
  }

  .hero-metrics {
    position: static;
    grid-template-columns: 1fr;
    padding: 10px;
    background: #111827;
  }

  .hero-metrics div {
    background: rgba(255, 255, 255, 0.08);
  }

  .band {
    padding: 48px 0;
  }

  .analytics-metrics {
    grid-template-columns: 1fr;
  }

  .analytics-row.path-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .analytics-row.path-row code {
    grid-column: 1 / -1;
  }
}
