:root {
  --bg: #f3f5f7;
  --bg-elev: #ffffff;
  --ink: #1a2332;
  --muted: #5c6b7e;
  --line: #d5dbe3;
  --accent: #0DD15D;
  --accent-soft: #eafbf2;
  --card-edge: #c8d0db;
  --radius: 10px;
  --font-display: "Manrope", "Noto Sans SC", sans-serif;
  --font-body: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, #e4ece8 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, #e8ecf2 0%, transparent 50%),
    var(--bg);
  min-height: 100vh;
  line-height: 1.55;
}

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

a:hover {
  color: var(--accent);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* —— Top bar —— */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 14px clamp(16px, 2vw, 32px);
  background: rgba(243, 245, 247, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  color: var(--ink);
}

.brand:hover { color: var(--ink); }

.brand-logo {
  display: block;
  height: 28px;
  width: auto;
}

.search {
  display: flex;
  align-items: stretch;
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
  border: 1px solid var(--card-edge);
  border-radius: 8px;
  background: var(--bg-elev);
  overflow: hidden;
}

.search input {
  flex: 1;
  border: 0;
  outline: 0;
  padding: 10px 14px;
  font: inherit;
  font-size: 14px;
  background: transparent;
  color: var(--ink);
  min-width: 0;
}

.search input::placeholder {
  color: #8a97a8;
}

.search-btn {
  border: 0;
  border-left: 1px solid var(--line);
  padding: 0 16px;
  background: var(--accent-soft);
  color: var(--accent);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.top-links {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--muted);
}

.top-links .lang {
  cursor: default;
}

/* —— Sections —— */
.section {
  width: 100%;
  margin: 0 auto;
  padding: 36px clamp(16px, 2vw, 32px) 8px;
}

.products {
  padding-top: 40px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.product-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px 22px 20px;
  background: var(--bg-elev);
  border: 1px solid var(--card-edge);
  border-radius: var(--radius);
  min-height: 100%;
}

.product-tag {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.product-card h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
}

.product-sub {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.product-desc {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--ink);
}

.product-users {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.quick-links {
  list-style: none;
  margin: 10px 0 16px;
  padding: 12px 0 0;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.quick-links a {
  font-size: 13px;
  color: var(--muted);
}

.quick-links a::before {
  content: "· ";
  color: var(--card-edge);
}

.quick-links a:hover {
  color: var(--accent);
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  width: 50%;
  height: 40px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff !important;
  font-size: 14px;
  font-weight: 600;
}

.cta:hover {
  filter: brightness(1.06);
}

.all-docs-entry {
  display: flex;
  justify-content: center;
  margin-top: 28px;
}

.all-docs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 200px;
  height: 44px;
  padding: 0 28px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.all-docs-btn:hover {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

/* —— All docs catalog —— */
.page-all-docs {
  background: #f5f5f5;
}

.page-all-docs .topbar {
  background: rgba(245, 245, 245, 0.94);
}

.catalog-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 0;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 clamp(16px, 3vw, 40px);
  min-height: calc(100vh - 72px);
}

.catalog-nav {
  position: sticky;
  top: 72px;
  align-self: start;
  max-height: calc(100vh - 72px);
  overflow: auto;
  padding: 28px 12px 40px 0;
}

.catalog-nav-title {
  margin: 0 0 14px 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.catalog-nav-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.catalog-nav-link {
  display: block;
  padding: 8px 12px;
  border-left: 3px solid transparent;
  border-radius: 0 6px 6px 0;
  font-size: 14px;
  color: #3c3c3c;
  line-height: 1.4;
}

.catalog-nav-link:hover {
  color: #0066cc;
  background: rgba(0, 102, 204, 0.04);
}

.catalog-nav-link.is-active {
  border-left-color: #c9190b;
  color: var(--ink);
  font-weight: 600;
  background: rgba(0, 0, 0, 0.03);
}

.catalog-main {
  padding: 28px 8px 80px 28px;
}

.catalog-hero {
  margin-bottom: 28px;
}

.catalog-hero h1 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.catalog-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.catalog-section {
  scroll-margin-top: 88px;
  margin-bottom: 40px;
}

.catalog-section h2 {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.doc-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.doc-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 148px;
  padding: 18px 18px 40px;
  background: #fff;
  border: 1px solid #d2d2d2;
  border-radius: 4px;
  color: inherit;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.doc-card:hover {
  color: inherit;
  border-color: #0066cc;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.doc-card.is-static {
  cursor: default;
  padding-bottom: 18px;
}

.doc-card.is-static:hover {
  border-color: #d2d2d2;
  box-shadow: none;
}

.doc-card.is-static h3 {
  color: var(--ink);
}

.doc-card h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #0066cc;
  line-height: 1.35;
}

.doc-card p {
  margin: 0;
  font-size: 14px;
  color: #151515;
  line-height: 1.55;
}

.doc-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
}

.doc-card-tags li {
  padding: 2px 8px;
  border-radius: 999px;
  background: #f0f0f0;
  color: #4f4f4f;
  font-size: 12px;
}

.doc-card-arrow {
  position: absolute;
  right: 16px;
  bottom: 14px;
  color: #0066cc;
  font-size: 18px;
  line-height: 1;
}

/* —— Homepage architecture —— */
.arch-hero {
  padding-top: 40px;
}

.arch-hero-head {
  margin-bottom: 22px;
}

.arch-hero-head h1 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: clamp(26px, 3vw, 32px);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.arch-hero-head p {
  margin: 0;
  font-size: 15px;
  color: var(--muted);
}

.product-shortcuts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.product-shortcut {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 18px 16px;
  background: var(--bg-elev);
  border: 1px solid var(--card-edge);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.product-shortcut:hover {
  border-color: #b8dfc8;
}

.product-shortcut.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(13, 209, 93, 0.2);
}

.product-shortcut-body {
  flex: 1;
}

.product-shortcut-title {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
}

.product-shortcut-desc {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.product-shortcut-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  min-width: 96px;
  height: 34px;
  padding: 0 14px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff !important;
  font-size: 13px;
  font-weight: 600;
}

.product-shortcut-btn:hover {
  filter: brightness(1.06);
  color: #fff !important;
}

.product-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0 28px;
  margin-bottom: 18px;
  border-bottom: 1px solid #e2e8f0;
}

.product-filter-btn {
  position: relative;
  border: 0;
  border-radius: 0;
  padding: 10px 2px 12px;
  margin-bottom: -1px;
  background: transparent;
  color: #6b7280;
  font: inherit;
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.product-filter-btn::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: transparent;
  transition: background 0.15s ease;
}

.product-filter-btn:hover {
  color: var(--ink);
}

.product-filter-btn.is-active {
  color: var(--ink);
  font-weight: 700;
  background: transparent;
  box-shadow: none;
}

.product-filter-btn.is-active::after {
  background: #2563eb;
}

.arch-wrap {
  padding: 4px 0 8px;
  max-width: 1360px;
  margin: 0 auto;
}

.arch-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 188px;
  gap: 14px;
  align-items: stretch;
}

.arch-main {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.arch-shell {
  position: relative;
  border: 2px solid #6db33f;
  border-radius: 14px;
  background: #fff;
  padding: 22px 18px 18px;
}

.arch-shell-title {
  position: absolute;
  top: -13px;
  left: 18px;
  padding: 0 10px;
  background: #fff;
  font-size: 15px;
  font-weight: 700;
  color: #4f9a2e;
}

.arch-zones {
  display: grid;
  grid-template-columns: 0.9fr 1.5fr 1.2fr;
  gap: 12px;
}

.arch-zones--stacked {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.arch-zones-top {
  display: grid;
  grid-template-columns: 1.65fr 1fr;
  gap: 12px;
}

.arch-zones-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.arch-zone-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.arch-tiles-row,
.arch-tiles.arch-tiles--row-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-items: start;
  width: 100%;
}

.arch-zone--infer .arch-tiles,
.arch-zone--compute .arch-tiles {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
}

.arch-zone--infer .arch-tiles .arch-tile,
.arch-zone--compute .arch-tiles .arch-tile {
  width: 100%;
  flex: 0 0 auto;
  box-sizing: border-box;
}

.arch-zone {
  border: 1.5px solid #d1d5db;
  border-radius: 10px;
  padding: 14px 12px 12px;
  background: #fafafa;
  min-height: 120px;
}

.arch-zone-title {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.arch-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.arch-tiles.arch-tiles--row-pair {
  display: grid;
}

.arch-tile {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 3px;
  min-height: 48px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1.5px solid #d1d5db;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  text-align: left;
  line-height: 1.25;
  background: #fff;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.arch-tile-name {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
}

.arch-tile-desc {
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.35;
}

.arch-side .arch-tile,
.arch-foundation-col .arch-tile {
  align-items: center;
  text-align: center;
}

.arch-zone .arch-tile {
  flex: 0 0 auto;
  max-width: 100%;
}

.arch-tile:hover,
.arch-tile:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-color: #9ca3af;
  outline: none;
}

.arch-tile.is-dimmed {
  opacity: 0.28;
}

.arch-tile.is-highlighted {
  opacity: 1;
  box-shadow: 0 0 0 2px rgba(13, 209, 93, 0.35);
  border-color: var(--accent);
}

[data-arch-root][data-active-product="dce"] .arch-tile.is-highlighted,
[data-arch-root][data-active-product="aios"] .arch-tile.is-highlighted,
[data-arch-root][data-active-product="token"] .arch-tile.is-highlighted {
  box-shadow: 0 0 0 2px rgba(13, 209, 93, 0.35);
  border-color: var(--accent);
}

.arch-foundation {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.arch-foundation-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.arch-foundation-col .arch-tile {
  width: 100%;
}

.arch-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.arch-side-panel {
  flex: 1;
  border: 2px solid #6db33f;
  border-radius: 14px;
  background: #fff;
  padding: 14px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.arch-side-title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: #4f9a2e;
  text-align: center;
}

.arch-side .arch-tiles {
  flex-direction: column;
  align-items: stretch;
}

.arch-side .arch-tile {
  width: 100%;
}

.arch-preview {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: 14px;
  padding: 12px 16px;
  border: 1px solid var(--card-edge);
  border-radius: 10px;
  background: var(--bg-elev);
  min-height: 48px;
}

.arch-preview[hidden] {
  display: none;
}

.arch-preview strong {
  font-size: 14px;
  font-weight: 700;
}

.arch-preview-desc {
  flex: 1 1 200px;
  font-size: 13px;
  color: var(--muted);
}

.arch-preview-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.arch-preview-tag {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.arch-preview-tag--dce { background: #dbeafe; color: #1d4ed8; }
.arch-preview-tag--aios { background: #ede9fe; color: #6d28d9; }
.arch-preview-tag--token { background: #d1fae5; color: #047857; }

.arch-preview-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

.arch-hero .all-docs-entry {
  margin-top: 22px;
}

@media (max-width: 960px) {
  .product-shortcuts {
    grid-template-columns: 1fr;
  }

  .arch-zones-top {
    grid-template-columns: 1fr;
  }

  .arch-tiles-row,
  .arch-tiles.arch-tiles--row-pair {
    grid-template-columns: 1fr;
  }

  .arch-layout {
    grid-template-columns: 1fr;
  }

  .arch-zones {
    grid-template-columns: 1fr;
  }

  .arch-foundation {
    grid-template-columns: 1fr 1fr;
  }

  .arch-side {
    flex-direction: row;
  }

  .arch-side-panel {
    flex: 1;
  }
}

@media (max-width: 560px) {
  .arch-foundation {
    grid-template-columns: 1fr;
  }

  .arch-side {
    flex-direction: column;
  }
}

.scenarios {
  display: none;
}

.scenarios h2 {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
}

.scenario-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.scenario-card {
  display: block;
  width: 100%;
  text-align: left;
  padding: 16px 18px;
  background: var(--bg-elev);
  border: 1px solid var(--card-edge);
  border-radius: var(--radius);
  transition: border-color 0.15s ease;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.scenario-card:hover {
  border-color: var(--accent);
  color: inherit;
}

.scenario-q {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 500;
}

.scenario-a {
  margin: 0;
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
}

/* —— Hot / updates —— */
.extras {
  display: none;
  padding-bottom: 48px;
}

.extras-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 22px 24px;
  background: var(--bg-elev);
  border: 1px solid var(--card-edge);
  border-radius: var(--radius);
}

.extras h3 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
}

.plain-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.plain-list a {
  font-size: 13px;
  color: var(--muted);
}

.plain-list a:hover {
  color: var(--accent);
}

/* —— Footer —— */
.footer {
  border-top: 1px solid var(--line);
  background: #eef1f4;
  padding: 36px clamp(16px, 2vw, 32px) 28px;
}

.footer-inner {
  width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.footer-col h3 {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-display);
}

.footer-copy {
  width: 100%;
  margin: 28px auto 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}

/* —— Toast —— */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 50;
  padding: 12px 18px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  box-shadow: none;
}

.toast[hidden] {
  display: none;
}

/* —— Responsive —— */
@media (max-width: 960px) {
  .topbar {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand links"
      "search search";
  }

  .brand { grid-area: brand; }
  .search { grid-area: search; max-width: none; }
  .top-links { grid-area: links; }

  .product-grid,
  .scenario-grid,
  .extras-grid,
  .footer-inner,
  .doc-card-grid {
    grid-template-columns: 1fr;
  }

  .catalog-shell {
    grid-template-columns: 1fr;
    width: 100%;
    padding: 0 16px;
  }

  .catalog-nav {
    position: static;
    max-height: none;
    padding: 20px 0 0;
    border-bottom: 1px solid var(--line);
  }

  .catalog-nav-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .catalog-main {
    padding: 24px 0 64px;
  }
}

@media (max-width: 560px) {
  .top-links a:last-child {
    display: none;
  }
}
