:root,
:root[data-theme="dark"] {
  --bg: #17212b;
  --bg-card: #1f2b38;
  --border: #243342;
  --text: #d1d8e4;
  --text-dim: #6e8095;
  --accent: #7c3aed;
  --accent-light: #a78bfa;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f8f6ff;
  --bg-card: #ffffff;
  --border: #e4dff7;
  --text: #2d1f5e;
  --text-dim: #6b5fa0;
  --accent: #7c3aed;
  --accent-light: #6d28d9;
  color-scheme: light;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  transition: background 0.15s ease, color 0.15s ease;
}

.theme-toggle {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 50;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  cursor: pointer;
}
.theme-toggle .icon-sun,
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: inline; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: inline; }
.wrap { max-width: 880px; margin: 0 auto; padding: 0 20px; }
.wrap.narrow { max-width: 720px; }

a { color: var(--accent-light); }

header.pagehead {
  padding: 56px 0 48px;
  background: radial-gradient(ellipse 600px 300px at 50% 0%, rgba(124,58,237,0.2), transparent 70%);
}
.crumbs { font-size: 13px; color: var(--text-dim); margin-bottom: 24px; }
.crumbs a { color: var(--text-dim); text-decoration: none; }
.crumbs a:hover { color: var(--accent-light); }

h1 { font-size: clamp(26px, 4vw, 38px); font-weight: 700; letter-spacing: -0.02em; margin-bottom: 16px; }
header.pagehead .lead { font-size: 17px; color: var(--text-dim); max-width: 640px; margin-bottom: 28px; }

.cta {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--accent); color: #fff; text-decoration: none;
  font-weight: 600; font-size: 15px; padding: 13px 26px; border-radius: 12px;
  transition: background 0.15s ease, transform 0.15s ease;
}
.cta:hover { background: #6d28d9; transform: translateY(-1px); }

section { padding: 48px 0; border-top: 1px solid var(--border); }
h2 { font-size: 20px; font-weight: 700; margin-bottom: 24px; }

.qa { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 20px 24px; margin-bottom: 14px; }
.qa .q { font-weight: 600; margin-bottom: 8px; color: var(--accent-light); font-size: 15px; }
.qa .a { color: var(--text); font-size: 15px; }

.article p { margin-bottom: 18px; color: var(--text); font-size: 15px; }

.cta-bottom { text-align: center; }
.cta-bottom p { color: var(--text-dim); margin-bottom: 20px; }

footer { padding: 36px 0; border-top: 1px solid var(--border); text-align: center; font-size: 13px; color: var(--text-dim); }
footer a { color: var(--text-dim); text-decoration: underline; margin: 0 8px; }
footer .links { margin-top: 10px; }

.indexgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.indexgrid a {
  display: block; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px; text-decoration: none; color: var(--text);
  font-size: 14px; transition: border-color 0.15s ease;
}
.indexgrid a:hover { border-color: var(--accent); }
.indexgrid .num { color: var(--accent-light); font-weight: 700; margin-right: 6px; }

.linegroup { margin-bottom: 26px; }
.linegroup h3 { font-size: 15px; margin-bottom: 10px; }
.linegroup h3 a { color: var(--text); text-decoration: none; }
.linegroup h3 a:hover { color: var(--accent-light); }
.linegroup .indexgrid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.linegroup .indexgrid a { padding: 9px 10px; font-size: 13px; }
