:root {
  --accent: #e53935; --accent-light: #ef4444;
  --bg: #0c0c0e; --panel: rgba(18, 18, 18, 0.97); --panel-2: rgba(24, 24, 26, 0.98);
  --border: rgba(255,255,255,.08);
  --text: #ffffff; --text-2: rgba(255,255,255,0.78); --muted: rgba(255,255,255,0.45);
  --font: 'Inter', system-ui, -apple-system, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--bg); background-image: radial-gradient(circle at 50% 12%, rgba(150, 22, 22, 0.16) 0%, rgba(14, 14, 16, 0.88) 45%, rgba(8, 8, 10, 0.98) 100%); background-attachment: fixed; color: var(--text); font-family: var(--font); font-size: 14.5px; line-height: 1.7; -webkit-font-smoothing: antialiased; }
a { color: var(--accent-light); text-decoration: none; border-bottom: 1px dotted var(--accent-light); }
a:hover { color: #fff; border-bottom-style: solid; }
:focus-visible { outline: 2px solid var(--accent-light); outline-offset: 2px; border-radius: 1px; }

.lg-top { position: sticky; top: 0; z-index: 10; background: linear-gradient(180deg, rgba(28, 24, 26, 0.98) 0%, rgba(18, 18, 20, 0.98) 100%); backdrop-filter: blur(16px); border-bottom: 1px solid rgba(229, 57, 53, 0.25); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(229, 57, 53, 0.25); }
.lg-top-in { max-width: 1120px; margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.lg-brand { color: #fff; font-weight: 800; text-decoration: none; letter-spacing: -.02em; border-bottom: none; }
.lg-brand span { color: var(--accent); }
.lg-back { font-size: 13.5px; text-decoration: none; color: var(--text-2); border-bottom: none; }
.lg-back:hover { color: #fff; }

.lg-wrap { max-width: 1120px; margin: 0 auto; padding: 40px 24px 80px; display: grid; grid-template-columns: 250px minmax(0,1fr); gap: 48px; align-items: start; }
.lg-side { position: sticky; top: 90px; font-size: 13.5px; }
.lg-side h4 { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; font-weight: 700; }
.lg-side ul { list-style: none; margin-bottom: 28px; }
.lg-side a { display: block; padding: 7px 12px; border-radius: 2px; color: var(--text-2); text-decoration: none; border-bottom: none; }
.lg-side a:hover { background: rgba(255,255,255,.05); color: #fff; }
.lg-side a.on { background: rgba(229, 57, 53, 0.16); color: #fff; box-shadow: inset 0 1px 0 rgba(229, 57, 53, 0.35); }
.lg-toc a { font-size: 13px; padding: 5px 12px; }

.lg-doc { background: var(--panel); border: 1px solid var(--border); border-radius: 2px; padding: 48px 52px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.60), inset 0 1px 0 rgba(255, 255, 255, 0.05); }
.lg-doc h1 { font-size: 32px; letter-spacing: -.03em; line-height: 1.15; margin-bottom: 8px; font-weight: 800; }
.lg-meta { color: var(--muted); font-size: 13px; margin-bottom: 32px; padding-bottom: 24px; border-bottom: 1px solid var(--border); font-family: var(--font-mono); }
.lg-doc h2 { font-size: 20px; letter-spacing: -.02em; margin: 40px 0 12px; scroll-margin-top: 90px; font-weight: 700; color: #fff; }
.lg-doc h3 { font-size: 16px; margin: 24px 0 8px; font-weight: 600; color: #fff; }
.lg-doc p { color: var(--text-2); margin-bottom: 14px; }
.lg-doc ul, .lg-doc ol { color: var(--text-2); margin: 0 0 16px 22px; }
.lg-doc li { margin-bottom: 6px; }
.lg-doc strong { color: #fff; }
.lg-doc table { width: 100%; border-collapse: collapse; margin: 8px 0 20px; font-size: 13.5px; display: block; overflow-x: auto; }
.lg-doc th, .lg-doc td { text-align: left; padding: 10px 14px; border: 1px solid var(--border); vertical-align: top; }
.lg-doc th { background: var(--panel-2); color: #fff; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; font-weight: 700; }
.lg-doc td { color: var(--text-2); }
.lg-note { background: rgba(251, 191, 36, 0.08); border: 1px solid rgba(251, 191, 36, 0.3); border-radius: 2px; padding: 14px 18px; margin: 18px 0; color: #fde68a; font-size: 13.5px; }
.lg-note p { color: inherit; margin: 0; }
mark.todo { background: #fbbf24; color: #1a1300; padding: 1px 6px; border-radius: 1px; font-weight: 700; font-family: var(--font-mono); }

.lg-foot { border-top: 1px solid var(--border); padding: 28px 24px; text-align: center; color: var(--muted); font-size: 12.5px; }
.lg-foot a { color: var(--text-2); margin: 0 8px; border-bottom: none; }
.lg-foot a:hover { color: #fff; }

@media (max-width: 900px) {
  .lg-wrap { grid-template-columns: 1fr; gap: 24px; padding: 24px 16px 60px; }
  .lg-side { position: static; }
  .lg-doc { padding: 28px 22px; border-radius: 2px; }
  .lg-doc h1 { font-size: 26px; }
}
@media print {
  .lg-top, .lg-side, .lg-foot { display: none; }
  body { background: #fff; color: #000; }
  .lg-wrap { display: block; padding: 0; }
  .lg-doc { border: 0; padding: 0; background: #fff; }
  .lg-doc p, .lg-doc li, .lg-doc td { color: #000; }
  .lg-doc h1, .lg-doc h2, .lg-doc h3, .lg-doc strong, .lg-doc th { color: #000; }
}
