:root {
  --bg: #0f0f14;
  --surface: #17171f;
  --border: #2a2a38;
  --text: #f2f2f7;
  --muted: #9999aa;
  --accent: #7C5CFC;
  --accent-soft: rgba(124, 92, 252, 0.14);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #ffffff;
    --surface: #f6f6fa;
    --border: #e3e3ec;
    --text: #15151c;
    --muted: #5f5f72;
    --accent: #6a4be0;
    --accent-soft: rgba(106, 75, 224, 0.1);
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 17px;
}

a { color: var(--accent); text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; }

.nav {
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
}
.nav-inner {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.brand {
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
  letter-spacing: -0.3px;
}
.nav-links { display: flex; gap: 18px; font-size: 15px; }
.nav-links a { color: var(--muted); }
.nav-links a[aria-current="page"] { color: var(--text); font-weight: 600; }

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

h1 { font-size: 34px; letter-spacing: -0.6px; line-height: 1.2; margin-bottom: 8px; }
h2 { font-size: 22px; letter-spacing: -0.3px; margin: 40px 0 12px; }
h3 { font-size: 18px; margin: 24px 0 8px; }
p { margin-bottom: 14px; }
ul, ol { margin: 0 0 16px 22px; }
li { margin-bottom: 6px; }

.meta { color: var(--muted); font-size: 15px; margin-bottom: 28px; }

.summary {
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 28px;
}
.summary p:last-child { margin-bottom: 0; }

.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 32px;
}
.toc strong { display: block; margin-bottom: 8px; }
.toc ol { margin-bottom: 0; columns: 2; column-gap: 24px; }
.toc li { break-inside: avoid; }
@media (max-width: 560px) { .toc ol { columns: 1; } }

table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 20px;
  font-size: 15px;
}
th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
th { color: var(--muted); font-weight: 600; }

details {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 18px;
  margin-bottom: 10px;
  background: var(--surface);
}
summary {
  cursor: pointer;
  padding: 14px 0;
  font-weight: 600;
  list-style: none;
}
summary::-webkit-details-marker { display: none; }
summary::before {
  content: '+';
  display: inline-block;
  width: 20px;
  color: var(--accent);
  font-weight: 700;
}
details[open] summary::before { content: '–'; }
details > *:not(summary) { margin-bottom: 14px; }
details p:last-child { margin-bottom: 16px; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin: 16px 0 8px;
}
.card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  color: var(--text);
}
.card:hover { border-color: var(--accent); text-decoration: none; }
.card strong { display: block; margin-bottom: 4px; }
.card span { color: var(--muted); font-size: 14px; }

.contact {
  margin-top: 40px;
  padding: 20px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.contact p:last-child { margin-bottom: 0; }

footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
  padding: 24px 20px 40px;
}
footer .nav-inner { justify-content: center; gap: 18px; }
footer a { color: var(--muted); }
