/* RL Course shared stylesheet */
:root {
  --ink: #1a1a2e;
  --muted: #6b7280;
  --accent: #2563eb;
  --accent-soft: #dbeafe;
  --good: #16a34a;
  --bad: #dc2626;
  --bg: #fdfdfc;
  --card: #ffffff;
  --border: #e5e7eb;
  --maxw: 860px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Source Han Serif SC", "Noto Serif SC", Georgia, "STSong", serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.85;
  font-size: 17px;
}
main { max-width: var(--maxw); margin: 0 auto; padding: 40px 24px 80px; }
header.site {
  border-bottom: 1px solid var(--border);
  background: var(--card);
}
header.site .inner {
  max-width: var(--maxw); margin: 0 auto; padding: 14px 24px;
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: "Noto Sans SC", system-ui, sans-serif;
}
header.site a { color: var(--ink); text-decoration: none; font-weight: 600; }
header.site nav a { margin-left: 18px; font-weight: 400; color: var(--muted); font-size: 14px; }
header.site nav a:hover { color: var(--accent); }
h1 { font-size: 34px; line-height: 1.3; margin: 24px 0 8px; }
h2 { font-size: 25px; margin-top: 2.2em; border-left: 5px solid var(--accent); padding-left: 12px; }
h3 { font-size: 20px; margin-top: 1.8em; }
.subtitle { color: var(--muted); font-family: "Noto Sans SC", sans-serif; font-size: 15px; margin-bottom: 32px; }
p { margin: 1em 0; }
blockquote {
  margin: 1.5em 0; padding: 10px 20px; border-left: 4px solid var(--border);
  color: #374151; background: #fafafa;
}
a { color: var(--accent); }
code, .mono { font-family: Consolas, "JetBrains Mono", monospace; background: var(--accent-soft); padding: 1px 5px; border-radius: 4px; font-size: 0.92em; }
.eq {
  display: block; text-align: center; font-family: "Latin Modern Math", "STIX Two Math", Cambria Math, serif;
  font-size: 20px; margin: 1.4em 0; overflow-x: auto;
}
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 20px 24px; margin: 1.5em 0;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.card.tip { border-left: 4px solid var(--accent); }
.card.warn { border-left: 4px solid var(--bad); }
.card .card-title { font-family: "Noto Sans SC", sans-serif; font-weight: 700; margin-bottom: 6px; display: block; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }
table.cmp { width: 100%; border-collapse: collapse; font-size: 15px; font-family: "Noto Sans SC", sans-serif; }
table.cmp th, table.cmp td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; vertical-align: top; }
table.cmp th { background: var(--accent-soft); }

/* quiz */
.quiz { border: 1px solid var(--border); border-radius: 12px; padding: 18px 22px; margin: 1.6em 0; background: var(--card); }
.quiz .q { font-weight: 700; font-family: "Noto Sans SC", sans-serif; }
.quiz button.opt {
  display: block; width: 100%; text-align: left; margin: 8px 0; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: 8px; background: #fff;
  font: 15px/1.5 "Noto Sans SC", sans-serif; cursor: pointer; transition: all .15s;
}
.quiz button.opt:hover { border-color: var(--accent); }
.quiz button.opt.correct { border-color: var(--good); background: #f0fdf4; }
.quiz button.opt.wrong { border-color: var(--bad); background: #fef2f2; }
.quiz .feedback { display: none; margin-top: 10px; padding: 10px 14px; border-radius: 8px; font-size: 15px; font-family: "Noto Sans SC", sans-serif; }
.quiz .feedback.show { display: block; }
.quiz .feedback.ok { background: #f0fdf4; color: #14532d; }
.quiz .feedback.no { background: #fef2f2; color: #7f1d1d; }

.progress-bar { position: fixed; top: 0; left: 0; height: 3px; background: var(--accent); width: 0; z-index: 99; }
footer.site { border-top: 1px solid var(--border); margin-top: 60px; padding: 24px; text-align: center; color: var(--muted); font-size: 14px; font-family: "Noto Sans SC", sans-serif; }
.toc { font-family: "Noto Sans SC", sans-serif; }
.toc a { text-decoration: none; }
.next-lesson { display: inline-block; margin-top: 2em; padding: 10px 22px; background: var(--accent); color: #fff; border-radius: 8px; text-decoration: none; font-family: "Noto Sans SC", sans-serif; }
.next-lesson:hover { opacity: .9; }
