*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.7;
  color: #1a1a1a;
  background: #f7f7f7;
}

/* Layout */
#layout {
  display: flex;
  min-height: 100vh;
}

/* Navigation */
nav {
  width: 240px;
  flex-shrink: 0;
  background: #1e1e2e;
  color: #cdd6f4;
  padding: 32px 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
nav .nav-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #89b4fa;
  padding: 0 20px 16px;
}
nav a {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 20px;
  color: #cdd6f4;
  text-decoration: none;
  font-size: 13px;
}
nav a.indent { padding-left: 36px; color: #a6adc8; font-size: 13px; }
nav a:hover { color: #89b4fa; }
nav .nav-current {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 20px;
  color: #89b4fa;
  font-size: 13px;
  font-weight: 600;
  cursor: default;
}
nav .nav-sep {
  border: none;
  border-top: 1px solid #313244;
  margin: 10px 20px;
}

/* Main content */
main {
  flex: 1;
  padding: 48px 60px 80px;
  max-width: 920px;
}

/* Page header */
.page-header { margin-bottom: 48px; }
.page-header h1 {
  font-size: 36px;
  font-weight: 700;
  color: #1e1e2e;
  margin-bottom: 6px;
}
.page-header .version,
.page-header .sub { font-size: 13px; color: #888; }

/* Sections */
section,
.type-section { margin-bottom: 56px; }
section + section,
.type-section + .type-section {
  border-top: 1px solid #e0e0e0;
  padding-top: 48px;
}

/* Headings */
h2 {
  font-size: 24px;
  font-weight: 700;
  color: #1e1e2e;
  margin-bottom: 20px;
}
h3 {
  font-size: 17px;
  font-weight: 600;
  color: #3a3a5c;
  margin: 28px 0 10px;
}
h4 {
  font-size: 14px;
  font-weight: 600;
  color: #555;
  margin: 20px 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Type header (API pages) */
.type-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}
.type-header h2 {
  font-size: 22px;
  font-family: "Cascadia Code", "Fira Code", Consolas, monospace;
  margin-bottom: 0;
}

/* Text */
p { margin-bottom: 12px; }
a { color: #5a8dee; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Lists */
ul { margin: 10px 0 16px 20px; }
ul li { margin-bottom: 6px; }

/* Code */
code {
  font-family: "Cascadia Code", "Fira Code", Consolas, "Courier New", monospace;
  font-size: 13px;
  background: #ebebf0;
  padding: 1px 5px;
  border-radius: 4px;
  color: #5a3e99;
}
pre {
  background: #1e1e2e;
  color: #cdd6f4;
  border-radius: 8px;
  padding: 18px 20px;
  margin: 14px 0 18px;
  overflow-x: auto;
  font-family: "Cascadia Code", "Fira Code", Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.6;
}
pre code { background: none; padding: 0; color: inherit; font-size: inherit; }

/* Syntax highlighting inside pre blocks (dark background) */
pre .kw { color: #cba6f7; }
pre .ty { color: #89dceb; }
pre .cm { color: #6c7086; font-style: italic; }
pre .st { color: #a6e3a1; }
pre .nu { color: #fab387; }

/* Syntax highlighting in API tables (light background) */
.t  { color: #1d4ed8; }
.kw { color: #7c3aed; }
.mn { font-weight: 700; color: #1a1a1a; }
.rt { color: #888; }
.ex { color: #dc2626; font-size: 12px; }

/* Note */
.note {
  background: #fffbeb;
  border-left: 3px solid #f59e0b;
  padding: 12px 16px;
  border-radius: 0 6px 6px 0;
  margin: 14px 0;
  font-size: 14px;
  color: #78350f;
}

/* Formula */
.formula {
  text-align: center;
  font-style: italic;
  font-size: 16px;
  margin: 18px 0;
  color: #3a3a5c;
}

/* Images */
.img-block { margin: 18px 0; }
.img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ebebf0;
  border: 2px dashed #c0c0d0;
  border-radius: 8px;
  padding: 32px 20px;
  color: #888;
  font-size: 13px;
  text-align: center;
  gap: 10px;
}
.img-placeholder .icon { font-size: 22px; }
.img-block img {
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid #ddd;
  display: block;
}
.img-caption {
  font-size: 12px;
  color: #888;
  margin-top: 6px;
}

/* Badges */
.badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.badge-struct    { background: #dbeafe; color: #1d4ed8; }
.badge-interface { background: #fce7f3; color: #9d174d; }
.badge-class     { background: #dcfce7; color: #15803d; }
.badge-static    { background: #fef3c7; color: #92400e; }
.badge-so        { background: #ede9fe; color: #6d28d9; }
.badge-mb        { background: #ffedd5; color: #c2410c; }

/* Type metadata */
.type-desc { color: #444; margin-bottom: 16px; max-width: 720px; }
.type-meta { font-size: 12px; color: #888; margin-bottom: 20px; }
.type-meta code { font-size: 11px; }

/* Member groups */
.member-group { margin-bottom: 22px; }
.member-group-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #888;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid #e8e8e8;
}

/* Member table */
table.mt {
  width: 100%;
  border-collapse: collapse;
}
table.mt tr:hover td { background: #f0f4ff; }
table.mt td {
  padding: 7px 10px;
  vertical-align: top;
  border-bottom: 1px solid #f0f0f0;
}
table.mt td:first-child {
  width: 52%;
  font-family: "Cascadia Code", "Fira Code", Consolas, monospace;
  font-size: 12.5px;
  white-space: pre-wrap;
  word-break: break-word;
}
table.mt td:last-child {
  color: #444;
  font-size: 13px;
}
