:root {
  --bg1: #0b0f25;
  --bg2: #121a3a;
  --card: rgba(255, 255, 255, 0.08);
  --card2: rgba(255, 255, 255, 0.12);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.7);
  --accent: #7cf7ff;
  --warn: #ffdf6e;
  --danger: #ff5a7a;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
  --radius: 18px;
  --max: 1160px;
}

[data-theme="light"] {
  --bg1: #f6f7ff;
  --bg2: #edf0ff;
  --card: rgba(0, 0, 0, 0.05);
  --card2: rgba(0, 0, 0, 0.08);
  --text: rgba(10, 12, 24, 0.92);
  --muted: rgba(10, 12, 24, 0.6);
  --shadow: 0 18px 45px rgba(10, 12, 24, 0.12);
}

* {
  box-sizing: border-box;
}
html, body {
  margin: 0;
  padding: 0;
}
body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, var(--bg1), var(--bg2));
  min-height: 100vh;
}

.bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 600px at 20% 10%, rgba(43, 47, 119, 0.55) 0%, transparent 60%),
    radial-gradient(900px 600px at 85% 25%, rgba(27, 138, 165, 0.35) 0%, transparent 55%),
    linear-gradient(180deg, var(--bg1), var(--bg2));
  z-index: -1;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(255,255,255,0.10);
}

.top-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-icon {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 22px;
  background: linear-gradient(135deg, var(--warn), var(--danger), var(--accent));
  box-shadow: var(--shadow);
  color: rgba(0,0,0,0.8);
}

.app-title {
  margin: 0;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.2px;
}
.app-subtitle {
  margin: 2px 0 0;
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn {
  border: none;
  border-radius: 14px;
  padding: 10px 12px;
  font-weight: 900;
  cursor: pointer;
  color: var(--text);
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.12);
}

.btn:hover {
  background: rgba(255,255,255,0.14);
}

.btn-primary {
  background: linear-gradient(135deg, var(--warn), var(--accent));
  border: none;
  color: rgba(0,0,0,0.85);
}

.btn-ghost {
  background: rgba(255,255,255,0.10);
}

.toolbar {
  max-width: var(--max);
  margin: 0 auto;
  padding: 10px 16px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.lang-tabs {
  display: inline-flex;
  border-radius: 999px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.12);
  overflow: hidden;
}
.tab {
  padding: 8px 12px;
  border: none;
  cursor: pointer;
  color: var(--text);
  background: transparent;
  font-weight: 900;
}
.tab.is-active {
  background: rgba(255,255,255,0.18);
}

.search {
  flex: 1;
  max-width: 520px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  padding: 10px 12px;
}
.search-icon {
  opacity: 0.8;
}
.search input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 14px;
}
.search input::placeholder {
  color: rgba(255,255,255,0.6);
}
.search-clear {
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  opacity: 0.8;
}

.layout {
  max-width: var(--max);
  margin: 0 auto;
  padding: 18px 16px 40px;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 14px;
}

.aside {
  position: sticky;
  top: 116px;
  align-self: start;
  height: calc(100vh - 140px);
  overflow: auto;
  padding-right: 6px;
}

.content {
  min-width: 0;
}

.card {
  background: rgba(0,0,0,0.18);
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}

[data-theme="light"] .card {
  background: rgba(255,255,255,0.75);
  border: 1px solid rgba(10,12,24,0.08);
}

.card-tight {
  padding: 14px;
}

.card-title {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 900;
  color: var(--accent);
}

.meta ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.meta li {
  margin: 8px 0;
  color: var(--text);
}
.note {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.hero-card {
  padding: 18px;
}
.hero-title {
  margin: 0 0 10px;
  font-weight: 900;
}
.hero-text {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.pill-row {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.12);
  font-weight: 900;
  font-size: 12px;
}

.section-title {
  margin: 0 0 10px;
  color: var(--warn);
  font-weight: 900;
}

.muted {
  color: var(--muted);
}

.doc {
  display: none;
}
.doc.is-active {
  display: block;
}

.toc {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.toc a {
  padding: 10px 10px;
  border-radius: 14px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.10);
  color: var(--text);
  font-weight: 900;
  font-size: 13px;
}
.toc a:hover {
  background: rgba(255,255,255,0.12);
}
.toc a.is-active {
  outline: 2px solid rgba(124, 247, 255, 0.35);
}

.accordion {
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.06);
  overflow: hidden;
  margin-top: 10px;
}
.acc-head {
  width: 100%;
  text-align: left;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text);
  padding: 12px 12px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.acc-icon {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.12);
  font-weight: 900;
}
.acc-body {
  display: none;
  padding: 0 12px 12px;
  color: var(--muted);
  line-height: 1.6;
}
.accordion.is-open .acc-body {
  display: block;
}
.accordion.is-open .acc-icon {
  background: rgba(255,255,255,0.14);
}

.footer-note {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.back-to-top {
  position: fixed;
  right: 14px;
  bottom: 14px;
  width: 44px;
  height: 44px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.25);
  color: var(--text);
  font-weight: 900;
  cursor: pointer;
  display: none;
  box-shadow: var(--shadow);
}
.back-to-top.show {
  display: grid;
  place-items: center;
}

/* Responsive */
@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .aside {
    position: relative;
    top: auto;
    height: auto;
  }
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .search {
    max-width: 100%;
  }
  .top-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}

/* Print */
@media print {
  .top, .aside, .back-to-top { display: none !important; }
  .card { box-shadow: none !important; }
  body { background: white !important; color: black !important; }
  a { color: black !important; text-decoration: underline !important; }
}
