
/* ===== Guide layout only: keep existing dark website style ===== */

/* Normal documentation pages: remove landing-card/timeline feel, keep document-like reading flow. */
body:not(:has(.xc-defense-hero)):not(:has(.xc-prod-hero)) .md-content__inner {
  max-width: 900px !important;
  padding-top: 2.4rem !important;
  padding-bottom: 5rem !important;
}

/* More compact and readable document typography, without changing the site color theme. */
body:not(:has(.xc-defense-hero)):not(:has(.xc-prod-hero)) .md-typeset h1 {
  font-size: 1.8rem !important;
  line-height: 1.28 !important;
  margin-bottom: 1rem !important;
  letter-spacing: -0.01em !important;
}

body:not(:has(.xc-defense-hero)):not(:has(.xc-prod-hero)) .md-typeset h2 {
  font-size: 1rem !important;
  line-height: 1.35 !important;
  margin-top: 2.2rem !important;
  margin-bottom: .85rem !important;
  padding-top: 1rem !important;
  border-top: 1px solid rgba(90, 156, 255, .18) !important;
  letter-spacing: 0 !important;
}

body:not(:has(.xc-defense-hero)):not(:has(.xc-prod-hero)) .md-typeset h3 {
  font-size: 1.08rem !important;
  line-height: 1.42 !important;
  margin-top: 1.45rem !important;
  margin-bottom: .42rem !important;
  letter-spacing: 0 !important;
}

body:not(:has(.xc-defense-hero)):not(:has(.xc-prod-hero)) .md-typeset p,
body:not(:has(.xc-defense-hero)):not(:has(.xc-prod-hero)) .md-typeset li {
  font-size: .65rem !important;
  line-height: 1.78 !important;
}

/* Convert the old large card/two-column tutorial overview into simple document sections. */
body:not(:has(.xc-defense-hero)):not(:has(.xc-prod-hero)) .xc-guide-featured,
body:not(:has(.xc-defense-hero)):not(:has(.xc-prod-hero)) .xc-guide-grid,
body:not(:has(.xc-defense-hero)):not(:has(.xc-prod-hero)) .xc-tutorial-grid,
body:not(:has(.xc-defense-hero)):not(:has(.xc-prod-hero)) .xc-doc-grid,
body:not(:has(.xc-defense-hero)):not(:has(.xc-prod-hero)) .xc-guide-steps,
body:not(:has(.xc-defense-hero)):not(:has(.xc-prod-hero)) .xc-setup-grid,
body:not(:has(.xc-defense-hero)):not(:has(.xc-prod-hero)) .md-typeset .grid.cards,
body:not(:has(.xc-defense-hero)):not(:has(.xc-prod-hero)) .md-typeset .grid,
body:not(:has(.xc-defense-hero)):not(:has(.xc-prod-hero)) .md-typeset .cards {
  display: block !important;
  max-width: 900px !important;
  margin: 1rem 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

body:not(:has(.xc-defense-hero)):not(:has(.xc-prod-hero)) .xc-guide-card,
body:not(:has(.xc-defense-hero)):not(:has(.xc-prod-hero)) .xc-tutorial-card,
body:not(:has(.xc-defense-hero)):not(:has(.xc-prod-hero)) .xc-doc-card,
body:not(:has(.xc-defense-hero)):not(:has(.xc-prod-hero)) .xc-step-card,
body:not(:has(.xc-defense-hero)):not(:has(.xc-prod-hero)) .xc-guide-item,
body:not(:has(.xc-defense-hero)):not(:has(.xc-prod-hero)) .md-typeset .grid.cards > *,
body:not(:has(.xc-defense-hero)):not(:has(.xc-prod-hero)) .md-typeset .grid > *,
body:not(:has(.xc-defense-hero)):not(:has(.xc-prod-hero)) .md-typeset .cards > * {
  display: block !important;
  width: auto !important;
  min-height: 0 !important;
  margin: 0 0 1.3rem !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

/* Sidebar/TOC: keep current dark style, only improve density. */
.md-nav__link {
  line-height: 1.45 !important;
}
.md-sidebar--primary .md-nav__link,
.md-sidebar--secondary .md-nav__link {
  font-size: .65rem !important;
}

/* Preserve localized brand */
html[lang^="zh"] .xc-nav-brand,
body:has(.xc-lang a.active[href*="/zh"]) .xc-nav-brand {
  font-size: 0 !important;
}
html[lang^="zh"] .xc-nav-brand::after,
body:has(.xc-lang a.active[href*="/zh"]) .xc-nav-brand::after {
  content: "向成電子";
  font-size: 1.05rem;
  color: #fff;
  font-weight: 850;
  letter-spacing: .08em;
}
html[lang^="ja"] .xc-nav-brand,
body:has(.xc-lang a.active[href*="/ja"]) .xc-nav-brand {
  font-size: 0 !important;
}
html[lang^="ja"] .xc-nav-brand::after,
body:has(.xc-lang a.active[href*="/ja"]) .xc-nav-brand::after {
  content: "向成電子";
  font-size: 1.05rem;
  color: #fff;
  font-weight: 850;
  letter-spacing: .08em;
}
