:root {
  --platform-bg: #0f141d;
  --platform-surface: rgba(255, 255, 255, 0.86);
  --platform-surface-strong: rgba(255, 255, 255, 0.94);
  --platform-surface-soft: rgba(255, 255, 255, 0.66);
  --platform-border: rgba(15, 23, 42, 0.12);
  --platform-text: #172033;
  --platform-muted: #65748a;
  --platform-primary: #5867e8;
  --platform-primary-strong: #4655d2;
  --platform-accent: #14b8a6;
  --platform-danger: #dc3545;
  --platform-warning: #f59e0b;
  --platform-sidebar: 248px;
  --platform-radius: 8px;
  --platform-shadow: 0 18px 44px rgba(15, 23, 42, 0.16);
  --platform-blur: blur(18px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --platform-surface: rgba(15, 23, 42, 0.82);
    --platform-surface-strong: rgba(18, 27, 43, 0.94);
    --platform-surface-soft: rgba(30, 41, 59, 0.72);
    --platform-border: rgba(226, 232, 240, 0.14);
    --platform-text: #eef3fb;
    --platform-muted: #a9b4c6;
    --platform-shadow: 0 22px 54px rgba(0, 0, 0, 0.32);
  }
}

* {
  box-sizing: border-box;
}

body.platform-shell {
  min-height: 100vh;
  margin: 0;
  color: var(--platform-text);
  background:
    linear-gradient(135deg, rgba(88, 103, 232, 0.72) 0%, rgba(118, 75, 162, 0.76) 48%, rgba(20, 184, 166, 0.56) 100%),
    var(--platform-bg);
}

body.platform-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.03) 44%, rgba(0, 0, 0, 0.08)),
    var(--platform-wallpaper, none);
  background-size: cover;
  background-position: center;
}

body.platform-shell::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

body.platform-shell a {
  color: inherit;
}

.platform-frame {
  width: min(1480px, calc(100% - 28px));
  min-height: calc(100vh - 28px);
  display: grid;
  grid-template-columns: var(--platform-sidebar) minmax(0, 1fr);
  gap: 18px;
  margin: 14px auto;
}

.platform-sidebar {
  position: sticky;
  top: 14px;
  height: calc(100vh - 28px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
  padding: 14px;
  overflow: hidden;
  color: var(--platform-text);
  background: var(--platform-surface);
  border: 1px solid var(--platform-border);
  border-radius: var(--platform-radius);
  box-shadow: var(--platform-shadow);
  backdrop-filter: var(--platform-blur);
  -webkit-backdrop-filter: var(--platform-blur);
}

.platform-brand {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 4px 2px 12px;
  border-bottom: 1px solid var(--platform-border);
}

.platform-brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(135deg, var(--platform-primary), var(--platform-accent));
  border-radius: var(--platform-radius);
  box-shadow: 0 12px 28px rgba(88, 103, 232, 0.24);
}

.platform-brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.platform-brand-title {
  min-width: 0;
  font-size: 1rem;
  line-height: 1.1;
  font-weight: 800;
}

.platform-brand-subtitle {
  min-width: 0;
  margin-top: 4px;
  color: var(--platform-muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.platform-sidebar-scroll {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 14px;
  overflow: auto;
  padding-right: 2px;
}

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

.platform-nav-label {
  padding: 0 8px;
  color: var(--platform-muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.platform-nav {
  display: grid;
  gap: 5px;
}

.platform-nav-item {
  min-width: 0;
  min-height: 38px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  color: var(--platform-text);
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--platform-radius);
  background: transparent;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.platform-nav-item:hover,
.platform-nav-item:focus-visible {
  color: var(--platform-primary-strong);
  text-decoration: none;
  border-color: var(--platform-border);
  background: rgba(255, 255, 255, 0.42);
  outline: none;
}

.platform-nav-item.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--platform-primary), var(--platform-primary-strong));
  box-shadow: 0 12px 24px rgba(88, 103, 232, 0.24);
}

.platform-nav-icon {
  display: grid;
  place-items: center;
  font-size: 0.98rem;
}

.platform-nav-text {
  min-width: 0;
  overflow: hidden;
  font-size: 0.9rem;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.platform-nav-meta {
  color: currentColor;
  opacity: 0.62;
  font-size: 0.72rem;
}

.platform-sidebar-footer {
  display: grid;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--platform-border);
}

.platform-side-action {
  min-height: 34px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 7px 9px;
  color: var(--platform-text);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.36);
  border: 1px solid var(--platform-border);
  border-radius: var(--platform-radius);
}

.platform-side-action:hover {
  color: var(--platform-primary-strong);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.56);
}

.platform-main {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 18px;
}

.platform-topbar {
  min-height: 72px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  color: var(--platform-text);
  background: var(--platform-surface);
  border: 1px solid var(--platform-border);
  border-radius: var(--platform-radius);
  box-shadow: var(--platform-shadow);
  backdrop-filter: var(--platform-blur);
  -webkit-backdrop-filter: var(--platform-blur);
}

.platform-menu-button {
  width: 40px;
  height: 40px;
  display: none;
  place-items: center;
  color: var(--platform-text);
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid var(--platform-border);
  border-radius: var(--platform-radius);
  cursor: pointer;
}

.platform-page-title {
  min-width: 0;
}

.platform-kicker {
  color: var(--platform-muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.platform-page-title h1,
.platform-page-title h2 {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
  font-size: clamp(1.28rem, 2.2vw, 2rem);
  line-height: 1.14;
  letter-spacing: 0;
}

.platform-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.platform-button {
  min-height: 36px;
  display: inline-grid;
  grid-auto-flow: column;
  gap: 8px;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  color: var(--platform-text);
  text-decoration: none;
  border: 1px solid var(--platform-border);
  border-radius: var(--platform-radius);
  background: rgba(255, 255, 255, 0.42);
  cursor: pointer;
}

.platform-button:hover {
  color: var(--platform-primary-strong);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.62);
}

.platform-button.primary {
  color: #fff;
  border-color: transparent;
  background: var(--platform-primary);
}

.platform-content {
  min-width: 0;
}

.platform-panel {
  color: var(--platform-text);
  background: var(--platform-surface);
  border: 1px solid var(--platform-border);
  border-radius: var(--platform-radius);
  box-shadow: var(--platform-shadow);
  backdrop-filter: var(--platform-blur);
  -webkit-backdrop-filter: var(--platform-blur);
}

.platform-feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 18px;
}

.platform-feature-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 14px;
  color: var(--platform-text);
  text-decoration: none;
  background: var(--platform-surface);
  border: 1px solid var(--platform-border);
  border-radius: var(--platform-radius);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.1);
  backdrop-filter: var(--platform-blur);
  -webkit-backdrop-filter: var(--platform-blur);
}

.platform-feature-card:hover {
  color: var(--platform-primary-strong);
  text-decoration: none;
  border-color: rgba(88, 103, 232, 0.34);
  transform: translateY(-1px);
}

.platform-feature-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--platform-primary), var(--platform-accent));
  border-radius: var(--platform-radius);
}

.platform-feature-title {
  overflow: hidden;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.platform-feature-desc {
  margin-top: 2px;
  color: var(--platform-muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.platform-compact .header,
.platform-compact header.header,
.platform-compact .main-container,
.platform-compact .container,
.platform-compact .container-fluid {
  max-width: none;
}

body.platform-subpage {
  padding: 14px;
}

body.platform-subpage .platform-mini-nav {
  width: min(1320px, 100%);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 auto 14px;
  padding: 10px;
  color: var(--platform-text);
  background: var(--platform-surface);
  border: 1px solid var(--platform-border);
  border-radius: var(--platform-radius);
  box-shadow: var(--platform-shadow);
  backdrop-filter: var(--platform-blur);
  -webkit-backdrop-filter: var(--platform-blur);
}

.platform-mini-nav a {
  min-height: 34px;
  display: inline-grid;
  grid-auto-flow: column;
  gap: 8px;
  align-items: center;
  padding: 7px 10px;
  color: var(--platform-text);
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--platform-radius);
}

.platform-mini-nav a:hover,
.platform-mini-nav a.is-active {
  color: #fff;
  background: var(--platform-primary);
  text-decoration: none;
}

@media (max-width: 1180px) {
  .platform-feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .platform-frame {
    width: min(100% - 20px, 760px);
    grid-template-columns: 1fr;
    margin: 10px auto;
  }

  .platform-sidebar {
    position: fixed;
    inset: 10px auto 10px 10px;
    z-index: 60;
    width: min(288px, calc(100vw - 20px));
    height: auto;
    transform: translateX(calc(-100% - 20px));
    transition: transform 180ms ease;
  }

  body.platform-nav-open .platform-sidebar {
    transform: translateX(0);
  }

  .platform-main {
    gap: 12px;
  }

  .platform-topbar {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .platform-menu-button {
    display: grid;
  }

  .platform-toolbar {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .platform-feature-grid {
    grid-template-columns: 1fr;
  }

  body.platform-nav-open::before {
    filter: brightness(0.72);
  }
}

@media (max-width: 560px) {
  body.platform-subpage {
    padding: 10px;
  }

  .platform-frame {
    width: min(100% - 14px, 760px);
    margin: 7px auto;
  }

  .platform-topbar {
    padding: 10px;
  }

  .platform-feature-card {
    grid-template-columns: 34px minmax(0, 1fr);
    padding: 12px;
  }
}

body.platform-shell .shell.platform-wiki {
  width: min(1480px, calc(100% - 28px));
  min-height: calc(100vh - 28px);
  display: grid;
  grid-template-columns: var(--platform-sidebar) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 18px;
  margin: 14px auto;
}

body.platform-shell .shell.platform-wiki > header {
  position: sticky;
  top: 14px;
  z-index: 30;
  grid-column: 2;
  grid-row: 1;
  color: var(--platform-text);
  background: var(--platform-surface);
  border: 1px solid var(--platform-border);
  border-radius: var(--platform-radius);
  box-shadow: var(--platform-shadow);
  backdrop-filter: var(--platform-blur);
  -webkit-backdrop-filter: var(--platform-blur);
}

body.platform-shell .shell.platform-wiki > header .nav {
  width: 100%;
  max-width: none;
  grid-template-columns: auto minmax(0, 1fr) minmax(260px, 440px);
  padding: 12px 14px;
}

body.platform-shell .shell.platform-wiki > header .brand {
  min-width: 0;
}

body.platform-shell .shell.platform-wiki > header .title {
  min-width: 0;
  overflow: hidden;
  color: var(--platform-text);
  background: none;
  -webkit-text-fill-color: currentColor;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.platform-shell .shell.platform-wiki > header .logo {
  border-radius: var(--platform-radius);
}

body.platform-shell .shell.platform-wiki > header .search {
  width: 100%;
  background: rgba(255, 255, 255, 0.48);
  border-radius: var(--platform-radius);
}

body.platform-shell .shell.platform-wiki > .main {
  display: contents;
  max-width: none;
  margin: 0;
  padding: 0;
}

body.platform-shell .shell.platform-wiki > .main > aside {
  grid-column: 1;
  grid-row: 1 / span 3;
  position: sticky;
  top: 14px;
  height: calc(100vh - 28px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
  padding: 14px;
  overflow: hidden;
  color: var(--platform-text);
  background: var(--platform-surface);
  border: 1px solid var(--platform-border);
  border-radius: var(--platform-radius);
  box-shadow: var(--platform-shadow);
  backdrop-filter: var(--platform-blur);
  -webkit-backdrop-filter: var(--platform-blur);
}

body.platform-shell .shell.platform-wiki .platform-toc {
  margin: 0;
  padding: 12px;
  background: rgba(255, 255, 255, 0.34);
  border: 1px solid var(--platform-border);
  border-radius: var(--platform-radius);
}

body.platform-shell .shell.platform-wiki .platform-toc h2 {
  margin-top: 0;
  font-size: 0.92rem;
}

body.platform-shell .shell.platform-wiki .platform-toc .toc {
  display: grid;
  gap: 4px;
  padding-left: 0;
  list-style: none;
}

body.platform-shell .shell.platform-wiki .platform-toc .toc a,
body.platform-shell .shell.platform-wiki .platform-toc summary {
  display: block;
  padding: 7px 8px;
  color: var(--platform-text);
  text-decoration: none;
  border-radius: 6px;
}

body.platform-shell .shell.platform-wiki .platform-toc .toc a:hover,
body.platform-shell .shell.platform-wiki .platform-toc summary:hover {
  color: var(--platform-primary-strong);
  background: rgba(255, 255, 255, 0.48);
}

body.platform-shell .shell.platform-wiki > .main > .content {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
}

body.platform-shell .shell.platform-wiki > .main > .content .wiki {
  display: grid;
  gap: 18px;
}

body.platform-shell .shell.platform-wiki > .main > .content .wiki > section,
body.platform-shell .shell.platform-wiki .section-card,
body.platform-shell .shell.platform-wiki .subcard {
  border-radius: var(--platform-radius);
}

body.platform-shell .shell.platform-wiki > footer {
  grid-column: 2;
  grid-row: 3;
  margin: 0;
  color: var(--platform-muted);
  background: var(--platform-surface);
  border: 1px solid var(--platform-border);
  border-radius: var(--platform-radius);
  box-shadow: var(--platform-shadow);
  backdrop-filter: var(--platform-blur);
  -webkit-backdrop-filter: var(--platform-blur);
}

@media (max-width: 900px) {
  body.platform-shell .shell.platform-wiki {
    width: min(100% - 20px, 760px);
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr) auto;
    margin: 10px auto;
  }

  body.platform-shell .shell.platform-wiki > header,
  body.platform-shell .shell.platform-wiki > .main > .content,
  body.platform-shell .shell.platform-wiki > footer {
    grid-column: 1;
  }

  body.platform-shell .shell.platform-wiki > .main > aside {
    position: fixed;
    inset: 10px auto 10px 10px;
    z-index: 60;
    width: min(288px, calc(100vw - 20px));
    height: auto;
    transform: translateX(calc(-100% - 20px));
    transition: transform 180ms ease;
  }

  body.platform-nav-open .shell.platform-wiki > .main > aside {
    transform: translateX(0);
  }

  body.platform-shell .shell.platform-wiki > header .nav {
    grid-template-columns: auto minmax(0, 1fr);
  }

  body.platform-shell .shell.platform-wiki > header .search {
    grid-column: 1 / -1;
  }
}