:root {
  --color-brand-red: #CC0000;
  --color-brand-dark: #151515;
  --color-brand-blue: #0066CC;
  --color-bg-page: #f0f2f5;
  --color-bg-content: #ffffff;
}
html { background: var(--color-bg-page); }
.body {
  display: flex;
  margin: 0 !important;
}
main.article { }
.body .nav-container {
  width: 230px;
  min-width: 230px;
  flex-shrink: 0;
  background: var(--color-brand-dark);
  border-right: 1px solid #333;
}
.nav-panel-menu { background: var(--color-brand-dark); }
.nav-panel-menu .nav-list { padding: 4px 0; }
.nav-panel-menu .nav-item { border-bottom: 1px solid rgba(255,255,255,0.05); }
.nav-panel-menu .nav-link {
  color: #ccc !important;
  font-size: 0.82rem;
  padding: 6px 16px;
  transition: background 0.15s, color 0.15s;
}
.nav-panel-menu .nav-link:hover {
  background: rgba(255,255,255,0.08);
  color: #fff !important;
}
.nav-panel-menu .nav-link.is-current-page {
  border-left: 3px solid var(--color-brand-red);
  font-weight: 700;
  color: #fff !important;
  background: rgba(204,0,0,0.08);
}
.nav-panel-explore { display: none !important; }
.nav-menu > .nav-list > .nav-item[data-depth="0"] ~ .nav-item[data-depth="0"] { display: none; }
.body .content {
  flex: 1;
  max-width: 1100px;
  background: var(--color-bg-content);
}
.doc {
  max-width: 960px;
  margin: 0 auto !important;
  padding: 2rem 3rem !important;
  overflow-wrap: break-word;
}
.article { }
.toolbar { display: none; }
.toc-sidebar {
  width: 220px;
  min-width: 220px;
  flex-shrink: 0;
  background: #f8f9fa;
  border-left: 1px solid #e0e0e0;
  padding-top: 1rem;
}
.toc-sidebar .toc-menu a { font-size: 0.8rem; color: #555; }
.toc-sidebar .toc-menu a:hover { color: var(--color-brand-blue); }
.navbar {
  background: var(--color-brand-dark) !important;
  border-bottom: 3px solid var(--color-brand-red);
  max-width: none !important;
  padding: 0 16px;
}
.navbar-brand { max-width: none !important; }
.navbar .navbar-brand { color: #fff !important; font-weight: 700; }
.navbar .navbar-item { color: #fff !important; }
.navbar .navbar-burger { color: #fff !important; }
.navbar .navbar-burger span { background-color: #fff !important; }
.navbar-menu { background: var(--color-brand-dark) !important; }
.navbar-menu .navbar-item { color: #ddd !important; }
.doc h1 {
  color: var(--color-brand-dark);
  border-bottom: 3px solid var(--color-brand-red);
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}
.doc h2 {
  color: #1a1a1a;
  border-left: 4px solid var(--color-brand-red);
  padding-left: 12px;
  margin-top: 1.5rem;
}
.doc h3 { color: #333; }
.doc a { color: var(--color-brand-blue); }
.doc th { background: var(--color-brand-dark); color: #fff; }
.doc td { border-bottom: 1px solid #e8e8e8; }
.doc table { max-width: 100%; width: auto; border-collapse: collapse; table-layout: auto; }
.doc .tableblock { overflow-x: auto; }
.admonitionblock {
  border-radius: 6px;
  margin: 1rem 0;
}
.admonitionblock .icon { background: var(--color-brand-blue); }
.doc .imageblock img, .doc img { max-width: 100%; height: auto; }
pre.highlight {
  background: #f6f8fa !important;
  border-radius: 8px;
  border: 1px solid #d0d7de;
  padding: 16px !important;
}
pre.highlight code { font-size: 0.85rem; color: #24292f; }
.three-container {
  width: 100%;
  min-height: 350px;
  height: auto;
  border: 1px solid #333;
  border-radius: 12px;
  margin: 1.5rem 0;
  background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 100%);
  position: relative;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
[id^="scene-"] {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  border: 1px solid #333;
}
.fullscreen-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 9999;
  background: #CC0000;
  color: #fff;
  border: 2px solid #fff;
  border-radius: 8px;
  padding: 10px 20px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  font-family: RedHatDisplay, Arial, sans-serif;
  letter-spacing: 0.5px;
  transition: background 0.2s, border-color 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 2px 12px rgba(204,0,0,0.5);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: fs-pulse 2s ease-in-out 3;
}
@keyframes fs-pulse {
  0%, 100% { box-shadow: 0 2px 12px rgba(204,0,0,0.5); }
  50% { box-shadow: 0 2px 24px rgba(204,0,0,0.9); }
}
.fullscreen-btn:hover {
  background: #ee0000;
  border-color: #fff;
  transform: scale(1.08);
  box-shadow: 0 4px 20px rgba(204,0,0,0.7);
}
.doc .imageblock img { cursor: pointer; transition: transform 0.2s; border-radius: 6px; }
.doc .imageblock img:hover { transform: scale(1.02); }
.img-overlay {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.92);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
.img-overlay img {
  max-width: 95vw;
  max-height: 95vh;
  border-radius: 8px;
  box-shadow: 0 0 40px rgba(0,102,204,0.3);
}
[id^="scene-"]:fullscreen,
.three-container:fullscreen {
  background: #0a0a1a;
  width: 100vw !important;
  height: 100vh !important;
  border: none !important;
  border-radius: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}
:fullscreen .fullscreen-btn {
  top: 16px;
  right: 16px;
  padding: 10px 22px;
  font-size: 16px;
  background: #CC0000;
  animation: none;
}
:fullscreen canvas {
  width: 100vw !important;
  height: 100vh !important;
}
@media (max-width: 768px) {
  .body .nav-container {
    position: fixed;
    top: 0; left: -260px;
    width: 260px;
    height: 100vh;
    z-index: 1000;
    transition: left 0.3s ease;
    box-shadow: 4px 0 20px rgba(0,0,0,0.5);
    background: var(--color-brand-dark);
  }
  .body .nav-container.is-active {
    left: 0;
  }
  .toc-sidebar { display: none; }
  .navbar { padding: 0 8px; }
  .navbar .navbar-burger {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 4px;
  }
  .doc { padding: 1rem !important; }
  .doc table { display: block; overflow-x: auto; }
  .doc table th, .doc table td { font-size: 0.8rem; padding: 6px 8px; }
  .doc pre { font-size: 0.75rem; overflow-x: auto; }
  .navbar-item { font-size: 0.85rem; }
  .three-container, [id^="scene-"] { height: 280px !important; min-height: 280px !important; }
  .doc h1 { font-size: 1.4rem; }
  .doc h2 { font-size: 1.15rem; }
  #user-info { display: none !important; }
}
@media (max-width: 480px) {
  .three-container, [id^="scene-"] { height: 200px !important; min-height: 200px !important; }
  .doc { padding: 0.5rem !important; }
  .doc h1 { font-size: 1.2rem; }
}
