:root {
  --bg-color: #0b0c10;
  --bg-subtle: rgba(18, 20, 29, 0.82);
  --bg-card: rgba(22, 25, 36, 0.65);
  --bg-input: rgba(24, 27, 40, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #ef4444;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;

  --primary: #ef4444;
  --primary-hover: #dc2626;
  --primary-light: rgba(239, 68, 68, 0.15);
  --primary-glow: 0 0 16px rgba(239, 68, 68, 0.35);

  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.12);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.12);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.14);
  --info: #06b6d4;
  --info-bg: rgba(6, 182, 212, 0.12);

  --sidebar-width: 280px;
  --toc-width: 240px;
  --header-height: 64px;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Inter", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

[data-theme="light"] {
  --bg-color: #ffffff;
  --bg-subtle: #f8fafc;
  --bg-card: #f1f5f9;
  --bg-input: #f1f5f9;
  --border-color: #e2e8f0;
  --border-focus: #2563eb;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-subtle: #94a3b8;

  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: rgba(37, 99, 235, 0.1);

  --success: #059669;
  --success-bg: rgba(5, 150, 105, 0.1);
  --warning: #d97706;
  --warning-bg: rgba(217, 119, 6, 0.1);
  --danger: #dc2626;
  --danger-bg: rgba(220, 38, 38, 0.1);
  --info: #0891b2;
  --info-bg: rgba(8, 145, 178, 0.1);
}

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

html {
  scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
  background: rgba(239, 68, 68, 0.28);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(239, 68, 68, 0.55);
}

/* Background Rising Particles Canvas */
#particles-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  background-image: 
    radial-gradient(circle at 50% -10%, rgba(239, 68, 68, 0.12) 0%, transparent 60%),
    radial-gradient(circle at 100% 40%, rgba(239, 68, 68, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 0% 80%, rgba(239, 68, 68, 0.04) 0%, transparent 50%);
  background-attachment: fixed;
  color: var(--text-main);
  line-height: 1.6;
  font-size: 15px;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

[data-theme="light"] body {
  background-image: 
    radial-gradient(circle at 50% -10%, rgba(37, 99, 235, 0.08) 0%, transparent 60%);
}

/* ================= HEADER ================= */
.header {
  position: sticky;
  top: 0;
  height: var(--header-height);
  background: rgba(11, 12, 16, 0.78);
  border-bottom: 1px solid var(--border-color);
  z-index: 50;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

[data-theme="light"] .header {
  background: rgba(255, 255, 255, 0.85);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 1.5rem;
  max-width: 1500px;
  margin: 0 auto;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.brand-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #fff;
}

.brand-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  display: block;
}

.menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.search-box {
  position: relative;
  width: 280px;
}

.search-box input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.45rem 5.5rem 0.45rem 2.2rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  outline: none;
  transition: all 0.2s ease;
}

.search-box input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-subtle);
  pointer-events: none;
  font-size: 0.85rem;
}

.search-clear-btn {
  position: absolute;
  left: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: var(--text-subtle);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  line-height: 1;
  transition: all 0.15s ease;
  z-index: 2;
}

.search-clear-btn:hover {
  background: var(--primary);
  color: #fff;
}

.search-count-badge {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-subtle);
  pointer-events: none;
  display: none;
  white-space: nowrap;
}

.search-kbd {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-subtle);
  font-size: 0.7rem;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

/* ================= SEARCH DROPDOWN POPUP ================= */
.search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 460px;
  max-width: calc(100vw - 2rem);
  background: rgba(15, 17, 26, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.65), 0 0 24px rgba(239, 68, 68, 0.08);
  z-index: 1000;
  overflow: hidden;
  display: none;
  animation: searchDropIn 0.15s ease-out;
}

[data-theme="light"] .search-dropdown {
  background: rgba(255, 255, 255, 0.98);
  border-color: #cbd5e1;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15);
}

@keyframes searchDropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.search-dropdown.active {
  display: block;
}

.search-results-list {
  max-height: 380px;
  overflow-y: auto;
  list-style: none;
  padding: 0.5rem;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.search-result-item {
  display: block;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-main);
  background: transparent;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.search-result-item:hover,
.search-result-item.selected {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
}

[data-theme="light"] .search-result-item:hover,
[data-theme="light"] .search-result-item.selected {
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.35);
}

.search-result-category {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-subtle);
  margin-bottom: 0.25rem;
  padding-left: 1.6rem;
}

.search-result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.search-result-title-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  flex: 1;
}

.search-result-icon {
  font-size: 0.95rem;
  flex-shrink: 0;
}

.search-result-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-action {
  flex-shrink: 0;
}

.search-return-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: var(--primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: bold;
}

.search-arrow-icon {
  color: var(--text-subtle);
  font-size: 0.9rem;
}

.search-result-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-left: 1.6rem;
}

.search-highlight {
  background: transparent;
  color: inherit;
  padding: 0;
  font-weight: inherit;
}

[data-theme="light"] .search-highlight {
  background: transparent;
  color: inherit;
}

.search-no-results {
  padding: 1.75rem 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.search-footer {
  padding: 0.5rem 0.85rem;
  background: rgba(0, 0, 0, 0.3);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1.25rem;
  font-size: 0.72rem;
  color: var(--text-subtle);
}

.search-footer-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 3px;
  padding: 0.05rem 0.35rem;
  font-size: 0.68rem;
  margin-right: 0.25rem;
  color: var(--text-muted);
}

.theme-toggle-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
  color: var(--text-main);
  border-color: var(--text-subtle);
}

/* ================= LANGUAGE SELECTOR ================= */
.lang-selector {
  position: relative;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  height: 36px;
  transition: all 0.2s ease;
}

.lang-btn:hover {
  border-color: var(--primary);
  background: var(--bg-card);
}

.lang-btn .lang-flag {
  font-size: 1rem;
  line-height: 1;
}

.lang-btn .lang-chevron {
  font-size: 0.65rem;
  color: var(--text-subtle);
  transition: transform 0.2s ease;
}

.lang-selector.open .lang-chevron {
  transform: rotate(180deg);
}

.lang-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 200px;
  background: rgba(15, 17, 26, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), 0 0 20px rgba(239, 68, 68, 0.08);
  padding: 0.35rem;
  display: none;
  flex-direction: column;
  gap: 2px;
  z-index: 1000;
  animation: searchDropIn 0.15s ease-out;
}

[data-theme="light"] .lang-dropdown {
  background: rgba(255, 255, 255, 0.98);
  border-color: #cbd5e1;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15);
}

.lang-selector.open .lang-dropdown {
  display: flex;
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.5rem 0.7rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.lang-option:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
  color: var(--text-main);
}

[data-theme="light"] .lang-option:hover {
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.35);
}

.lang-option.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}

.lang-option .lang-tag {
  margin-left: auto;
  font-size: 0.65rem;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  color: var(--text-subtle);
}

/* Google Translate Widget UI Cleanup */
body {
  top: 0 !important;
  position: static !important;
}

.goog-te-banner-frame {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
}

iframe.skiptranslate,
.goog-te-balloon-frame {
  display: none !important;
}

#goog-gt-tt {
  display: none !important;
  visibility: hidden !important;
}

.goog-text-highlight {
  background: none !important;
  box-shadow: none !important;
}

/* ================= MAIN LAYOUT ================= */
.layout-container {
  display: flex;
  max-width: 1500px;
  margin: 0 auto;
  position: relative;
  min-height: calc(100vh - var(--header-height));
}

/* ================= LEFT SIDEBAR ================= */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  border-right: 1px solid var(--border-color);
  background: rgba(11, 12, 16, 0.45);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 1.5rem 1rem;
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  transition: transform 0.25s ease;
  z-index: 10;
}

[data-theme="light"] .sidebar {
  background: rgba(255, 255, 255, 0.65);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.nav-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-subtle);
  letter-spacing: 0.05em;
  padding: 0 0.5rem;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

.nav-section-title .chevron {
  transition: transform 0.2s;
  font-size: 0.7rem;
}

.nav-section.collapsed .chevron {
  transform: rotate(-90deg);
}

.nav-section.collapsed .nav-list {
  display: none;
}

.nav-divider {
  height: 1px;
  background: var(--border-color);
  margin: 0.75rem 0.5rem;
}

.nav-section.distinct .nav-section-title {
  color: #ff4d4d;
  font-weight: 800;
  letter-spacing: 0.08em;
}

[data-theme="light"] .nav-section.distinct .nav-section-title {
  color: #dc2626;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.75rem;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.15s ease;
}

.nav-link:hover {
  background: var(--bg-card);
  color: var(--text-main);
}

.nav-link.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
  border-left: 2px solid var(--primary);
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.nav-link .icon {
  font-size: 1rem;
  line-height: 1;
}

/* ================= CONTENT MAIN ================= */
.main-content {
  flex: 1;
  min-width: 0;
  padding: 2.5rem 3rem 5rem 3rem;
  max-width: 860px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-subtle);
  margin-bottom: 1.25rem;
}

.breadcrumb a {
  color: var(--text-subtle);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--text-main);
}

.page-header {
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.5rem;
}

.page-title {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  line-height: 1.2;
}

.page-meta {
  margin-top: 0.75rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--text-subtle);
  font-size: 0.85rem;
}

/* Typography & Content Elements */
.content h2 {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 2.25rem 0 1rem 0;
  padding-top: 1rem;
  display: flex;
  align-items: center;
  position: relative;
}

.content h2 a.anchor-link {
  opacity: 0;
  margin-left: 0.5rem;
  color: var(--text-subtle);
  text-decoration: none;
  font-weight: normal;
  transition: opacity 0.15s;
}

.content h2:hover a.anchor-link {
  opacity: 1;
}

.content p {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  line-height: 1.7;
}

.content strong {
  color: var(--text-main);
}

.content ul, .content ol {
  margin-left: 1.5rem;
  margin-bottom: 1.25rem;
  color: var(--text-muted);
}

.content li {
  margin-bottom: 0.5rem;
}

/* Alert / Callout Boxes (GitBook style) */
.callout {
  display: flex;
  gap: 0.85rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  margin: 1.5rem 0;
  font-size: 0.92rem;
  line-height: 1.55;
  border-left: 4px solid transparent;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.callout > div:last-child {
  min-width: 0;
  flex: 1 1 auto;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.callout-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.callout.callout-warning {
  background: var(--warning-bg);
  border-color: var(--warning);
  color: var(--text-main);
}

.callout.callout-info {
  background: var(--info-bg);
  border-color: var(--info);
  color: var(--text-main);
}

.callout.callout-danger {
  background: var(--danger-bg);
  border-color: var(--danger);
  color: var(--text-main);
}

.callout.callout-success {
  background: var(--success-bg);
  border-color: var(--success);
  color: var(--text-main);
}

/* Inline Code & Code Block */
code:not(pre code) {
  font-family: var(--font-mono);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: #38bdf8;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  font-size: 0.88em;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.code-block {
  position: relative;
  background: rgba(9, 10, 15, 0.85);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin: 1.5rem 0;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.code-block:hover {
  border-color: rgba(239, 68, 68, 0.35);
  box-shadow: 0 4px 24px rgba(239, 68, 68, 0.08);
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-color);
  font-size: 0.75rem;
  color: var(--text-subtle);
  font-family: var(--font-mono);
}

.copy-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.copy-btn:hover {
  background: var(--bg-card);
  color: var(--text-main);
  border-color: var(--primary);
}

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--primary);
  color: #ffffff;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.25);
}

.btn-download:hover {
  background: var(--primary-hover);
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
  transform: translateY(-1px);
}

.code-block pre {
  padding: 1rem 1.25rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: #e2e8f0;
  line-height: 1.5;
}

/* Embedded Media (responsive video/iframe wrapper) */
.media-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
  margin: 1.5rem 0;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.media-container:hover {
  border-color: rgba(239, 68, 68, 0.35);
  box-shadow: 0 8px 32px rgba(239, 68, 68, 0.12);
}

.media-container iframe,
.media-container video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Image preview container */
.img-preview {
  margin: 1.5rem 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  overflow: hidden;
  background: rgba(22, 25, 36, 0.45);
  display: flex;
  justify-content: center;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
}

.img-preview:hover {
  border-color: rgba(239, 68, 68, 0.35);
  box-shadow: 0 8px 30px rgba(239, 68, 68, 0.12);
}

.img-preview img {
  max-width: 100%;
  height: auto;
  display: block;
  transition: transform 0.3s ease;
}

/* Pagination Footer (Next / Previous) */
.page-pagination {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.pagination-card {
  padding: 1rem 1.25rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  text-decoration: none;
  background: var(--bg-subtle);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}

.pagination-card.prev {
  text-align: left;
}

.pagination-card.next {
  text-align: right;
}

.pagination-card:hover {
  border-color: var(--primary);
  background: var(--bg-card);
  transform: translateY(-2px);
}

.pagination-card .direction {
  font-size: 0.75rem;
  color: var(--text-subtle);
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.pagination-card .card-title {
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.95rem;
}

/* ================= RIGHT TABLE OF CONTENTS ================= */
.toc-aside {
  width: var(--toc-width);
  flex-shrink: 0;
  padding: 2.5rem 1.25rem 2rem 1.25rem;
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
}

.toc-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-subtle);
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.toc-list {
  list-style: none;
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toc-link {
  display: block;
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  margin-left: -1px;
  line-height: 1.4;
  transition: all 0.15s ease;
}

.toc-link:hover {
  color: var(--text-main);
}

.toc-link.active {
  color: var(--primary);
  font-weight: 600;
  border-left-color: var(--primary);
}

/* ================= MOBILE OVERLAY ================= */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 40;
}

/* ================= RESPONSIVE ================= */
@media (max-width: 1100px) {
  .toc-aside {
    display: none;
  }
}

@media (max-width: 820px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: var(--header-height);
    transform: translateX(-100%);
    z-index: 45;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.5);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .overlay.active {
    display: block;
  }

  .menu-toggle {
    display: flex;
  }

  .main-content {
    padding: 2rem 1.25rem 4rem 1.25rem;
  }

  .search-box {
    width: 180px;
  }

  .search-kbd {
    display: none;
  }
}

@media (max-width: 600px) {
  .page-pagination {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .pagination-card.next {
    text-align: left;
  }
}

/* ================= SUPPORTED ANTI-CHEATS GRID ================= */
.ac-section-header {
  margin: 2rem 0 1rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ac-section-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.ac-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin: 1.25rem 0 2rem 0;
}

.ac-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.ac-card:hover {
  transform: translateY(-3px);
  border-color: rgba(239, 68, 68, 0.45);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

[data-theme="light"] .ac-card:hover {
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.12);
}

.ac-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.ac-logo-box {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  overflow: hidden;
}

[data-theme="light"] .ac-logo-box {
  background: #ffffff;
}

.ac-logo-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.ac-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.28);
}

.ac-status-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--success);
  box-shadow: 0 0 6px var(--success);
}

.ac-card-body h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.ac-type {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-subtle);
  letter-spacing: 0.05em;
  margin-bottom: 0.65rem;
}

.ac-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 0.85rem;
}

.ac-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  padding-top: 0.75rem;
  margin-top: auto;
}

.ac-features li {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ac-features li span.tick {
  color: var(--success);
  font-weight: bold;
}

/* ================= 3D TILT SHOWCASE CARDS (WELCOME PAGE) ================= */
.tilt-showcase-section {
  margin: 2.5rem 0 3rem 0;
}

.tilt-showcase-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tilt-showcase-subtitle {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
}

.tilt-showcase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  perspective: 1200px;
}

.tilt-card-wrapper {
  perspective: 1200px;
}

.tilt-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform-style: preserve-3d;
  transition: transform 0.12s cubic-bezier(0.2, 0, 0.2, 1), box-shadow 0.25s ease, border-color 0.25s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  will-change: transform;
}

[data-theme="light"] .tilt-card {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.tilt-card:hover {
  border-color: rgba(239, 68, 68, 0.6);
  box-shadow: 0 20px 45px rgba(239, 68, 68, 0.2), 0 0 20px rgba(239, 68, 68, 0.15);
}

[data-theme="light"] .tilt-card:hover {
  border-color: rgba(37, 99, 235, 0.6);
  box-shadow: 0 20px 45px rgba(37, 99, 235, 0.15);
}

.tilt-card-media {
  position: relative;
  width: 100%;
  height: 270px;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 1.25rem;
  border-bottom: 1px solid var(--border-color);
  transform: translateZ(30px);
}

[data-theme="light"] .tilt-card-media {
  background: #0f121a;
}

.tilt-card-media img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-sm);
  transition: transform 0.3s ease;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.6));
}

.tilt-card:hover .tilt-card-media img {
  transform: scale(1.03);
}

.tilt-card-body {
  padding: 1.25rem 1.5rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transform: translateZ(20px);
}

.tilt-card-badge {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 9999px;
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.tilt-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tilt-card-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.tilt-card-action {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: gap 0.2s ease;
}

.tilt-card:hover .tilt-card-action {
  gap: 10px;
}

/* Dynamic Glare Reflection */
.tilt-card-glare {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at var(--glare-x, 50%) var(--glare-y, 50%), rgba(255, 255, 255, 0.18) 0%, transparent 65%);
  opacity: 0;
  transition: opacity 0.25s ease;
  z-index: 5;
  mix-blend-mode: overlay;
}

.tilt-card:hover .tilt-card-glare {
  opacity: 1;
}



