:root {
  --bg-primary: #0a0b0d;
  --bg-surface: #111317;
  --bg-panel: #161920;
  --bg-hover: #1e222b;
  --border-color: #232733;
  --border-light: #2d3342;
  --accent-cyan: #00d2ff;
  --accent-cyan-dim: rgba(0, 210, 255, 0.12);
  --accent-amber: #ff9d00;
  --accent-amber-dim: rgba(255, 157, 0, 0.14);
  --text-main: #f0f2f5;
  --text-muted: #8c93a0;
  --text-dim: #555c68;
  --code-bg: #181a22;
  --sidebar-w: 280px;
  --header-h: 64px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, -apple-system, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  scroll-behavior: smooth;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-cyan);
}

/* Header */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(14, 16, 21, 0.98);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-color);
  width: 100%;
}

.top-nav-inner {
  max-width: 1440px;
  margin: 0 auto;
  min-height: var(--header-h);
  padding: 0.5rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.brand-logo-img {
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  min-height: 40px !important;
  max-width: 40px !important;
  max-height: 40px !important;
  border-radius: 8px;
  object-fit: cover !important;
  border: 1px solid var(--accent-cyan);
  flex-shrink: 0;
  display: block;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #ffffff;
  line-height: 1.15;
  white-space: nowrap;
}

.brand-subtitle {
  font-size: 0.68rem;
  color: var(--accent-cyan);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  white-space: nowrap;
}

.nav-center {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}

.nav-center a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  transition: all 0.15s ease-in-out;
  white-space: nowrap;
}

.nav-center a:hover {
  color: #ffffff;
  background: var(--bg-hover);
}

.nav-center a.active {
  color: #ffffff;
  background: var(--bg-panel);
  border: 1px solid var(--border-light);
}

.nav-right-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  background: var(--accent-amber-dim);
  border: 1px solid var(--accent-amber);
  color: var(--accent-amber);
  font-weight: 600;
  font-size: 0.82rem;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.nav-cta:hover {
  background: rgba(255, 157, 0, 0.28);
  color: #ffffff;
}

/* Language Dropdown Selector */
.lang-dropdown-wrapper {
  position: relative;
  display: inline-block;
}

.lang-select-box {
  background: var(--bg-panel);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.38rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
}

.lang-select-box:hover, .lang-select-box:focus {
  border-color: var(--accent-cyan);
}

/* Sub-nav for mobile/tablet */
.sub-nav-bar {
  display: none;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  padding: 0.4rem 1rem;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
}

.sub-nav-bar a {
  display: inline-block;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.82rem;
  padding: 0.35rem 0.65rem;
  border-radius: 4px;
  margin-right: 0.35rem;
}

.sub-nav-bar a.active {
  color: #ffffff;
  background: var(--bg-panel);
  border: 1px solid var(--border-light);
}

/* Layout */
.layout-container {
  display: flex;
  flex: 1;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
}

.doc-sidebar {
  width: var(--sidebar-w);
  height: calc(100vh - var(--header-h));
  position: sticky;
  top: var(--header-h);
  border-right: 1px solid var(--border-color);
  padding: 1.25rem 0.85rem;
  overflow-y: auto;
  background: var(--bg-surface);
  flex-shrink: 0;
}

.sidebar-search {
  width: 100%;
  padding: 0.55rem 0.75rem;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: #ffffff;
  font-size: 0.82rem;
  margin-bottom: 1.2rem;
  outline: none;
  transition: border-color 0.15s;
}

.sidebar-search:focus {
  border-color: var(--accent-cyan);
}

.sidebar-group {
  margin-bottom: 1.35rem;
}

.sidebar-group-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-cyan);
  margin-bottom: 0.5rem;
  padding-left: 0.5rem;
}

.sidebar-menu {
  list-style: none;
}

.sidebar-menu li {
  margin-bottom: 0.12rem;
}

.sidebar-menu a {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.35rem 0.55rem;
  border-radius: 5px;
  transition: all 0.15s ease;
  line-height: 1.35;
}

.sidebar-menu a:hover {
  color: #ffffff;
  background: var(--bg-hover);
}

.doc-content {
  flex: 1;
  padding: 2.25rem 3rem;
  max-width: 960px;
  min-width: 0;
}

.doc-hero {
  background: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-primary) 100%);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1.75rem 2rem;
  margin-bottom: 2.5rem;
}

.doc-hero h1 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin-bottom: 0.75rem;
}

.doc-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  padding-top: 1rem;
  margin-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.meta-item {
  font-size: 0.82rem;
}

.meta-label {
  color: var(--text-dim);
  text-transform: uppercase;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 0.2rem;
}

.meta-value {
  color: var(--text-main);
  font-weight: 500;
}

.heading-l1 {
  font-size: 1.6rem;
  font-weight: 800;
  color: #ffffff;
  margin-top: 3rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--border-color);
  letter-spacing: -0.01em;
}

.heading-l2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  margin-top: 2.25rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border-color);
}

.heading-l3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
  margin-top: 1.5rem;
  margin-bottom: 0.65rem;
}

.anchor-link {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.85em;
  opacity: 0;
  margin-left: 0.35rem;
  transition: opacity 0.15s;
}

h1:hover .anchor-link, h2:hover .anchor-link, h3:hover .anchor-link {
  opacity: 1;
}

.doc-p {
  font-size: 0.95rem;
  color: #d1d5db;
  margin-bottom: 1rem;
  line-height: 1.7;
}

.doc-list, .doc-num-list {
  padding-left: 1.4rem;
  margin-bottom: 1.25rem;
}

.doc-list li, .doc-num-list li {
  margin-bottom: 0.4rem;
  color: #d1d5db;
  font-size: 0.95rem;
  line-height: 1.65;
}

.doc-divider {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 2.5rem 0;
}

code {
  font-family: "SF Mono", "Consolas", monospace;
  font-size: 0.88em;
  background: var(--code-bg);
  border: 1px solid var(--border-color);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  color: var(--accent-cyan);
}

strong {
  color: #ffffff;
  font-weight: 600;
}

.site-footer {
  border-top: 1px solid var(--border-color);
  background: var(--bg-surface);
  padding: 2rem 1.5rem;
  margin-top: auto;
}

.footer-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-left {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-right {
  display: flex;
  gap: 1.25rem;
}

.footer-right a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.82rem;
  transition: color 0.15s;
}

.footer-right a:hover {
  color: #ffffff;
}

/* RESPONSIVE BREAKPOINTS */
@media (max-width: 1080px) {
  .nav-center {
    display: none;
  }
  .sub-nav-bar {
    display: flex;
  }
}

@media (max-width: 860px) {
  .doc-sidebar {
    display: none;
  }
  .doc-content {
    padding: 1.5rem 1.25rem;
  }
  .brand-subtitle {
    display: none;
  }
}

@media (max-width: 480px) {
  .top-nav-inner {
    padding: 0.5rem 0.6rem;
    gap: 0.35rem;
  }
  .brand-title {
    font-size: 0.95rem;
  }
  .nav-right-group {
    gap: 0.35rem;
  }
  .nav-cta {
    font-size: 0.72rem;
    padding: 0.35rem 0.45rem;
  }
  .lang-select-box {
    font-size: 0.72rem;
    padding: 0.35rem 0.4rem;
    max-width: 95px;
  }
}