:root { --bg: #ffffff; --text: #0a0a0a; --muted: #6b7280; --line: #e5e7eb; --focus: #111111; }
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; color: var(--text); background: var(--bg);
  font-family: "Noto Sans", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  line-height: 1.6; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
/* ...existing styles... */
.site-header {
  position: sticky; top: 0; z-index: 100; backdrop-filter: saturate(1.2) blur(8px);
  background: rgba(255,255,255,0.85); border-bottom: 1px solid var(--line);
  display: grid; grid-template-columns: auto 1fr auto; gap: 1rem; align-items: center; padding: 0.75rem 1rem;
}
.brand h1 { margin: 0; font-family: "Cal Sans", "Noto Sans", sans-serif; font-weight: 700; letter-spacing: -0.02em; }
.subtitle { margin: 0; color: var(--muted); font-size: 0.9rem; }
.header-actions { display: flex; gap: 0.5rem; align-items: center; }
.ghost-btn, .primary-btn, .icon-btn { border: 1px solid var(--line); background: transparent; color: inherit; padding: 0.55rem 0.9rem; border-radius: 10px; cursor: pointer; transition: transform 120ms ease, background 120ms ease, border-color 120ms ease; }
.primary-btn { background: #0a0a0a; color: white; border-color: #0a0a0a; }
.ghost-btn:hover, .icon-btn:hover { background: #f6f6f6; }
.primary-btn:hover { transform: translateY(-1px); }
.icon-btn { padding: 0.35rem 0.55rem; }
.mobile-menu-btn { display: none; background: none; border: none; padding: 0.25rem; cursor: pointer; }
.mobile-menu-btn .bar { display: block; width: 22px; height: 2px; background: var(--text); margin: 4px 0; }

/* layout */
.container { display: grid; grid-template-columns: 280px 1fr; gap: 2rem; max-width: 1200px; margin: 0 auto; padding: 2rem 1rem; }
.sidebar { position: sticky; top: 72px; align-self: start; height: calc(100vh - 88px); overflow: auto; border-right: 1px solid var(--line); padding-right: 1rem; }
.search { position: sticky; top: 0; background: var(--bg); padding: 0.5rem 0; }
.search input { width: 100%; padding: 0.65rem 0.75rem; border-radius: 10px; border: 1px solid var(--line); outline: none; }
.search input:focus { border-color: var(--focus); }
.toc { margin-top: 1rem; display: grid; gap: 0.25rem; }
.toc a { display: block; padding: 0.4rem 0.5rem; border-radius: 8px; text-decoration: none; color: inherit; border: 1px solid transparent; }
.toc a.active, .toc a:hover { background: #f6f6f6; border-color: var(--line); }
.content { min-width: 0; }
.hero { border: 1px solid var(--line); border-radius: 16px; padding: 1.25rem 1rem; margin-bottom: 2rem; }
.hero h2 { font-family: "Cal Sans", "Noto Sans", sans-serif; font-size: clamp(1.6rem, 2.5vw, 2rem); margin: 0 0 0.5rem; }
.hero-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.section { padding: 1.25rem; border: 1px solid var(--line); border-radius: 16px; margin-bottom: 1.25rem; background: white; }
.section h2 { margin-top: 0; font-family: "Cal Sans", "Noto Sans", sans-serif; letter-spacing: -0.01em; }
.meta { color: var(--muted); font-size: 0.9rem; margin-top: -0.25rem; }
.badges { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.5rem 0; }
.badge { border: 1px solid var(--line); border-radius: 999px; padding: 0.2rem 0.6rem; font-size: 0.8rem; color: #111; background: #fafafa; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.card { border: 1px solid var(--line); border-radius: 12px; padding: 0.8rem; }
.details { color: var(--muted); font-size: 0.95rem; }
ul { margin: 0.5rem 0 0.5rem 1.1rem; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Space Mono", monospace; }
pre { background: #0a0a0a; color: white; padding: 0.9rem; border-radius: 12px; overflow: auto; border: 1px solid #161616; }
kbd { border: 1px solid var(--line); padding: 0.1rem 0.35rem; border-radius: 6px; font-size: 0.85em; background: #fafafa; }

/* quiz */
.quiz-section { border: 1px solid var(--line); border-radius: 16px; padding: 1.25rem; margin: 2rem 0; }
.quiz-card { border: 1px solid var(--line); border-radius: 12px; padding: 0.8rem; margin-bottom: 1rem; }
.quiz-options { display: grid; gap: 0.5rem; margin-top: 0.5rem; }
.quiz-option { padding: 0.55rem; border-radius: 10px; border: 1px solid var(--line); background: #fff; cursor: pointer; text-align: left; }
.quiz-option.correct { border-color: #16a34a; }
.quiz-option.incorrect { border-color: #dc2626; }
.quiz-feedback { font-size: 0.95rem; margin-top: 0.35rem; }
.quiz-actions { display: flex; gap: 0.5rem; margin-top: 0.5rem; }

/* modal */
.modal { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,0.5); padding: 1rem; }
.modal[hidden] { display: none; }
.modal-card { background: white; width: min(720px, 100%); border-radius: 16px; border: 1px solid var(--line); max-height: 85vh; display: grid; grid-template-rows: auto 1fr; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 0.8rem 1rem; border-bottom: 1px solid var(--line); }
.modal-body { overflow: auto; padding: 1rem; }
.glossary-list { display: grid; gap: 0.6rem; }
.glossary-item { border: 1px solid var(--line); border-radius: 10px; padding: 0.6rem; }

/* footer */
.site-footer { color: var(--muted); font-size: 0.95rem; border-top: 1px solid var(--line); padding-top: 1rem; margin-top: 2rem; }

/* animations and a11y */
@media (prefers-reduced-motion: no-preference) {
  .toc a.active { transform: translateX(4px); transition: transform 150ms ease; }
  .section { transition: box-shadow 180ms ease; }
  .section:focus-within, .section:hover { box-shadow: 0 4px 24px rgba(0,0,0,0.06); }
}
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 8px; }

/* responsive */
@media (max-width: 960px) {
  .container { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 56px; height: calc(100vh - 56px); width: 85%; max-width: 320px; background: white; transform: translateX(-100%); transition: transform 180ms ease; box-shadow: 0 10px 40px rgba(0,0,0,0.12); }
  .sidebar.open { transform: translateX(0); }
  .mobile-menu-btn { display: inline-block; }
  .grid { grid-template-columns: 1fr; }
}

