:root {
  --bg: #f7f2e8;
  --bg-soft: #fbf8f1;
  --panel: rgba(255, 252, 247, 0.92);
  --panel-strong: rgba(255, 250, 243, 0.98);
  --line: rgba(126, 105, 74, 0.18);
  --text: #2b2218;
  --muted: #66584a;
  --accent: #1f7a5a;
  --accent-2: #2c6aa0;
  --warning: #9a6a22;
  --shadow: 0 18px 40px rgba(110, 88, 58, 0.08);
  --radius-xl: 8px;
  --radius-lg: 6px;
  --radius-md: 4px;
  --max-width: 1460px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  font: 14px/1.75 "Noto Sans SC", "Source Sans Pro", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(214, 198, 170, 0.35), transparent 34%),
    radial-gradient(circle at 85% 12%, rgba(191, 221, 210, 0.3), transparent 24%),
    linear-gradient(180deg, #fcfaf5 0%, #f6f0e5 58%, #f4ede2 100%);
}

body::before {
  position: fixed;
  inset: 0;
  content: "";
  pointer-events: none;
  background-image:
    linear-gradient(rgba(92, 72, 45, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(92, 72, 45, 0.03) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.22), transparent 85%);
}

img {
  max-width: 100%;
  border: 0;
}

a,
a:link,
a:visited,
a:active {
  color: var(--accent-2);
  text-decoration: none;
}

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

code,
pre,
.name,
#ClassList > ul > li {
  font-family:
    ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
}

code {
  font-size: 0.92em;
}

kbd {
  border: 1px solid rgba(92, 72, 45, 0.2);
  padding: 0.1em 0.42em;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 251, 245, 0.9);
}

kbd + kbd {
  margin-left: 0.3em;
}

th {
  font-weight: 600;
}

form {
  display: block;
}

.hide,
.variation,
.titleCenterer,
.back {
  display: none;
}

.page-shell {
  position: relative;
  width: min(calc(100% - 20px), var(--max-width));
  margin: 0 auto;
  padding-bottom: 48px;
}

.hero {
  padding: 22px 0 30px;
}

.hero-subpage {
  padding-bottom: 10px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(255, 250, 243, 0.82);
  backdrop-filter: blur(10px);
}

.brand,
.topbar-links a {
  text-decoration: none;
}

.brand {
  color: var(--text);
  font-family: "Space Grotesk", "Noto Sans SC", sans-serif;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.topbar-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.topbar-links a {
  color: var(--muted);
  font-size: 0.95rem;
}

.hero-main {
  display: grid;
  gap: 28px;
  padding: 36px 0 12px;
}

.hero-main-single {
  grid-template-columns: 1fr;
}

.hero-copy h1,
.doc-panel h1,
.doc-panel h2,
.doc-panel h3,
.doc-panel h4,
.doc-panel h5 {
  font-family: "Space Grotesk", "Noto Sans SC", sans-serif;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.76rem;
  font-weight: 700;
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(1.9rem, 3.6vw, 3rem);
  line-height: 1.08;
}

.hero-text {
  max-width: 72ch;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.docs-layout {
  display: grid;
  grid-template-columns: minmax(250px, 280px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  position: relative;
}

.docs-layout-index {
  margin-top: 8px;
}

.docs-nav-toggle,
.docs-nav-backdrop {
  display: none;
}

.docs-nav-toggle {
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 250, 243, 0.94);
  box-shadow: var(--shadow);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.back-to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 25;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 250, 243, 0.94);
  box-shadow: var(--shadow);
  color: var(--text);
  font: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition:
    opacity 180ms ease,
    transform 180ms ease,
    background 180ms ease;
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.nav {
  position: sticky;
  top: 18px;
  max-height: calc(100vh - 36px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.embedded .nav {
  display: none;
}

.menu {
  height: 100%;
  max-height: calc(100vh - 36px);
  padding: 20px;
  overflow: auto;
}

.api-home-link {
  display: inline-flex;
  margin-bottom: 16px;
}

.cesiumLogo {
  display: block;
  width: 191px;
  height: 40px;
}

.search-wrapper {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-strong);
}

.classFilter {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
}

.classFilter::placeholder {
  color: rgba(102, 88, 74, 0.72);
}

.shortcut {
  white-space: nowrap;
}

#ClassList h5 {
  margin: 20px 0 8px;
  color: var(--warning);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

#ClassList ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

#ClassList li {
  margin: 0;
}

#ClassList li a {
  display: block;
  padding: 8px 10px;
  border-radius: 12px;
  color: var(--text);
  word-break: break-word;
}

#ClassList li a:hover,
#ClassList li a:focus {
  background: rgba(31, 122, 90, 0.08);
}

#main,
.index-main {
  min-width: 0;
}

.doc-panel {
  position: relative;
  min-width: 0;
  padding: 24px 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.doc-panel-index {
  min-height: 360px;
}

.doc-panel > section,
.doc-panel > article > section,
.doc-panel .container-overview,
.doc-panel .method-member-container,
.doc-panel .nameContainer {
  margin-bottom: 18px;
}

.doc-content-section > article {
  display: grid;
  gap: 28px;
}

.doc-overview {
  min-width: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.doc-subsection {
  display: grid;
  min-width: 0;
  gap: 14px;
}

.subsection-body {
  display: grid;
  min-width: 0;
  gap: 16px;
}

.entry-list {
  gap: 18px;
}

.api-overview,
.api-readme {
  margin-bottom: 24px;
}

.api-overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.api-overview-card {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 251, 245, 0.76);
}

.doc-panel section {
  margin: 0 0 20px;
  padding: 0;
}

.page-title,
.doc-panel h1 {
  margin: 0 0 18px;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  line-height: 1.1;
}

.doc-panel h2,
.doc-panel h3 {
  margin: 28px 0 14px;
  font-size: 1.38rem;
  color: var(--text);
}

.doc-panel h4 {
  margin: 0 0 12px;
  font-size: 1.12rem;
}

.doc-panel h5 {
  margin: 18px 0 8px;
  color: var(--warning);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.class-description,
.summary,
.description,
.doc-panel p,
.doc-panel li,
.doc-panel dd,
.doc-footer {
  color: var(--muted);
}

.class-description,
.description,
.doc-panel p,
.doc-panel li {
  line-height: 1.8;
}

.class-description {
  font-size: 1.08rem;
  color: var(--text);
  font-weight: 500;
}

.description code,
.doc-panel td code,
.doc-panel dd code {
  padding: 0.12rem 0.34rem;
  border-radius: 8px;
  background: #f3ede3;
  color: var(--text);
  white-space: normal;
  overflow-wrap: anywhere;
}

pre {
  max-width: 100%;
  margin: 14px 0;
  padding: 16px;
  overflow: auto;
  border: 1px solid rgba(105, 84, 57, 0.14);
  border-radius: var(--radius-md);
  background: #f3ede3;
  color: #2f2419;
}

table {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 14px 0 22px;
  border-collapse: collapse;
  overflow-x: auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 251, 245, 0.76);
}

th,
td {
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

th {
  color: var(--text);
  background: rgba(31, 122, 90, 0.06);
}

tr:last-child td {
  border-bottom: 0;
}

dl.details {
  margin: 18px 0 0;
}

dl.details dt {
  margin-top: 12px;
  color: var(--text);
  font-weight: 600;
}

dl.details dd {
  margin: 6px 0 0;
}

dl.details ul,
.doc-panel ul {
  padding-left: 18px;
}

.dummy,
.see-list {
  margin: 0;
}

.nameContainer {
  min-width: 0;
  padding: 12px 16px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background:
    linear-gradient(135deg, rgba(31, 122, 90, 0.08), rgba(44, 106, 160, 0.04)),
    rgba(255, 251, 245, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.doc-entry {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  padding: 0 16px 16px;
  border: 1px solid rgba(126, 105, 74, 0.14);
  border-radius: var(--radius-lg);
  background: rgba(255, 252, 247, 0.72);
}

.doc-entry > :not(.nameContainer) {
  padding-left: 6px;
  padding-right: 6px;
}

.name {
  margin: 0;
  color: var(--text);
  line-height: 1.4;
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.signature,
.type-signature,
.ancestors {
  color: var(--accent-2);
  font-weight: 600;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.signature-attributes,
.signature-internal-constructor,
.important {
  color: var(--warning);
}

.subsection-title {
  margin-top: 0;
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(31, 122, 90, 0.08);
  color: var(--text);
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.doc-link {
  display: inline-flex;
  width: 0.85rem;
  height: 0.85rem;
  margin-right: 8px;
  border-radius: 999px;
  border: 1px solid rgba(154, 106, 34, 0.35);
  vertical-align: middle;
  opacity: 0.5;
}

.doc-link::before {
  content: "";
  display: block;
  width: 0.25rem;
  height: 0.25rem;
  margin: auto;
  border-radius: 999px;
  background: var(--warning);
}

.tag-experimental,
.help {
  margin-top: 20px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 250, 243, 0.78);
}

.doc-footer {
  margin-top: 18px;
  padding: 8px 4px;
  font-size: 0.92rem;
}

.summary {
  margin: 12px 2px 8px;
  color: var(--text);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.doc-panel a,
.description,
.doc-panel dd,
.param-type,
.returnType {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.description {
  padding-left: 6px;
  margin-top: 12px;
}

.doc-entry .params,
.doc-entry .details,
.doc-entry .tag-experimental,
.doc-entry .see-list,
.doc-entry pre {
  margin-left: 6px;
  margin-right: 6px;
}

.doc-entry .tag-experimental,
.doc-entry .params,
.doc-entry .details {
  margin-top: 14px;
}

.popout {
  position: absolute;
  top: 24px;
  right: 24px;
  display: block;
  width: 12px;
  height: 12px;
  background: url("../icons/popout.png") bottom;
}

.popout:hover {
  background-position: 0 0;
}

.doc-panel hr,
div.hr {
  height: 1px;
  margin: 18px 0;
  border: 0;
  background: var(--line);
}

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

  .docs-nav-toggle {
    position: sticky;
    top: 16px;
    z-index: 30;
    display: inline-flex;
    justify-self: end;
    margin-bottom: -6px;
  }

  .docs-nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 19;
    background: rgba(43, 34, 24, 0.28);
  }

  body.docs-nav-open {
    overflow: hidden;
  }

  body.docs-nav-open .docs-nav-backdrop {
    display: block;
  }

  .nav {
    position: fixed;
    top: 12px;
    right: 10px;
    bottom: 12px;
    left: auto;
    z-index: 20;
    width: min(86vw, 360px);
    max-height: none;
    border-radius: var(--radius-xl);
    transform: translateX(calc(100% + 20px));
    transition: transform 180ms ease;
  }

  .menu {
    max-height: none;
  }

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

  .api-overview-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(calc(100% - 20px), var(--max-width));
  }

  .topbar {
    border-radius: 0;
    padding: 14px;
  }

  .topbar-links {
    gap: 12px;
  }

  .doc-panel {
    padding: 18px 16px;
  }
}
