/* ===== Page Hero ===== */
.page-hero {
  padding: 120px 0 64px;
  background: linear-gradient(180deg, var(--blue-50) 0%, #fff 100%);
  border-bottom: 1px solid var(--gray-100);
}
.page-hero .back-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.875rem; color: var(--gray-500); margin-bottom: 24px;
  transition: color var(--transition);
}
.page-hero .back-link:hover { color: var(--blue-600); }
.page-hero .back-link svg { width: 16px; height: 16px; }
.page-hero h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); letter-spacing: -0.02em; margin-bottom: 12px; }
.page-hero .meta {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin-top: 16px; font-size: 0.875rem; color: var(--gray-400);
}
.page-hero .badge {
  display: inline-flex; align-items: center;
  padding: 4px 12px; border-radius: 999px;
  background: var(--blue-50); color: var(--blue-700);
  font-size: 0.8rem; font-weight: 600; border: 1px solid var(--blue-100);
}

/* ===== Document Layout ===== */
.doc-wrap { max-width: 800px; margin: 0 auto; padding: 60px 24px 96px; }

/* Table of Contents */
.toc {
  background: var(--gray-50); border: 1px solid var(--gray-200);
  border-radius: var(--radius); padding: 24px 28px; margin-bottom: 48px;
}
.toc-title {
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--gray-400); font-weight: 700; margin-bottom: 14px;
}
.toc ol { padding-left: 20px; }
.toc li { margin-bottom: 8px; }
.toc a { font-size: 0.9rem; color: var(--gray-600); }
.toc a:hover { color: var(--blue-600); }

/* Sections */
.doc-section { margin-bottom: 0; }
.doc-section + .doc-section { border-top: 1px solid var(--gray-100); margin-top: 40px; padding-top: 40px; }
.doc-section .section-header { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 20px; scroll-margin-top: 84px; }
.section-num {
  flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%;
  background: var(--blue-600); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8125rem; font-weight: 700; margin-top: 2px;
}
.doc-section h2 { font-size: 1.2rem; padding-top: 4px; }
.doc-section p { font-size: 0.9375rem; line-height: 1.8; margin-bottom: 12px; }
.doc-section p:last-child { margin-bottom: 0; }
.doc-section h3 { font-size: 0.9375rem; font-weight: 600; margin: 20px 0 8px; color: var(--gray-800); }
.doc-section ul, .doc-section ol { padding-left: 22px; margin-bottom: 12px; }
.doc-section li { font-size: 0.9375rem; line-height: 1.8; color: var(--gray-600); margin-bottom: 2px; }

/* Table */
.table-wrapper {
  overflow-x: auto; border-radius: var(--radius); margin: 16px 0 20px;
  border: 1px solid var(--gray-200); box-shadow: var(--shadow-sm);
}
.doc-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; min-width: 500px; }
.doc-table th {
  text-align: left; padding: 10px 16px;
  background: var(--gray-50); color: var(--gray-700);
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em;
  border-bottom: 2px solid var(--gray-200); white-space: nowrap;
}
.doc-table td { padding: 10px 16px; border-bottom: 1px solid var(--gray-100); color: var(--gray-600); vertical-align: top; }
.doc-table tr:last-child td { border-bottom: none; }
.doc-table td strong { color: var(--gray-800); font-weight: 600; }
.doc-table code {
  font-family: 'SF Mono', 'Menlo', monospace; font-size: 0.8125rem;
  background: var(--gray-100); padding: 1px 6px; border-radius: 4px; color: var(--gray-700);
}

/* Callout / Note */
.callout {
  padding: 14px 20px; background: var(--blue-50);
  border-left: 3px solid var(--blue-600);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 16px 0; font-size: 0.9rem; color: var(--gray-700); line-height: 1.7;
}
.note {
  padding: 14px 20px; background: #fffbeb;
  border-left: 3px solid #d97706;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 16px 0; font-size: 0.875rem; color: #92400e; line-height: 1.7;
}

/* Contact card */
.contact-card {
  display: flex; align-items: center; gap: 16px;
  padding: 20px 24px; border: 1px solid var(--gray-200);
  border-radius: var(--radius); background: var(--gray-50); margin-top: 16px;
}
.contact-card a { font-weight: 600; font-size: 1rem; }
.contact-icon {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  background: var(--blue-50); border: 1px solid var(--blue-100);
  display: flex; align-items: center; justify-content: center;
}
.contact-icon svg { width: 20px; height: 20px; stroke: var(--blue-600); fill: none; }

/* Language toggle content */
.lang-content { display: none; }
.lang-content.active { display: block; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .page-hero { padding: 100px 0 48px; }
  .doc-wrap { padding: 40px 20px 64px; }
}

/* ===== Dark Mode ===== */
@media (prefers-color-scheme: dark) {
  /* Page hero */
  .page-hero               { background: linear-gradient(180deg, #0f1628 0%, #0a0a0b 100%); border-bottom-color: #242628; }
  .page-hero .back-link    { color: #6f7882; }
  .page-hero .badge        { background: #162236; color: #93c5fd; border-color: #1e2d4d; }
  .page-hero .meta         { color: #5f6368; }

  /* Table of Contents */
  .toc                     { background: #191b1d; border-color: #3c3c3c; }
  .toc-title               { color: #5f6368; }
  .toc a                   { color: #9aa0a6; }
  .toc a:hover             { color: #8ab4f8; }

  /* Doc sections */
  .doc-section + .doc-section { border-top-color: #242628; }
  .doc-section h3          { color: #bdc1c6; }
  .doc-section li          { color: #9aa0a6; }

  /* Table */
  .table-wrapper           { border-color: #3c3c3c; }
  .doc-table th            { background: #191b1d; color: #9aa0a6; border-bottom-color: #3c3c3c; }
  .doc-table td            { border-bottom-color: #242628; color: #9aa0a6; }
  .doc-table td strong     { color: #e8ebee; }
  .doc-table code          { background: #222426; color: #bdc1c6; }

  /* Callouts */
  .callout                 { background: #0d1f3d; border-left-color: #8ab4f8; color: #bdc1c6; }
  .note                    { background: var(--color-warning-bg); border-left-color: var(--color-warning); color: #fde68a; }

  /* Contact card */
  .contact-card            { background: #191b1d; border-color: #3c3c3c; }
  .contact-icon            { background: #0d1f3d; border-color: #162236; }
}
