/* Shared stylesheet for 棒球规则入门 lessons */
:root {
  --bg: #f7f3ea;
  --paper: #fffdf8;
  --ink: #182230;
  --muted: #667085;
  --line: #e2d6c3;
  --grass: #2f7d4f;
  --dirt: #c7823b;
  --accent: #b42318;
  --accent-soft: #fff1ed;
  --good: #166534;
  --warn: #9a3412;
  --shadow: 0 18px 50px rgba(24,34,48,.09);
}
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(circle at 20% 0%, #fff7dd, var(--bg) 48%); color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", sans-serif; line-height: 1.68; }
main { max-width: 940px; margin: 0 auto; padding: 56px 22px 82px; }
article { background: rgba(255,253,248,.96); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); padding: 40px; }
h1, h2, h3 { line-height: 1.18; margin: 0 0 14px; }
h1 { font-size: clamp(2rem, 5vw, 3.3rem); letter-spacing: -0.04em; }
h2 { font-size: 1.52rem; margin-top: 34px; border-top: 1px solid var(--line); padding-top: 28px; }
h3 { font-size: 1.08rem; margin-top: 22px; color: var(--accent); }
p, ul, ol { margin-top: 0; }
a { color: var(--accent); text-decoration-thickness: .08em; text-underline-offset: .18em; }
.kicker { color: var(--accent); text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 760; }
.lede { font-size: 1.18rem; color: #344054; max-width: 68ch; }
.card, .practice, .quiz, .note, .field-card { border: 1px solid var(--line); border-radius: 18px; padding: 20px; background: #fff; margin: 18px 0; }
.note { background: var(--accent-soft); }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.term { font-weight: 780; color: var(--accent); }
.small { color: var(--muted); font-size: .92rem; }
.score { display: inline-flex; align-items: center; gap: 10px; border: 1px solid var(--line); background: #101828; color: #fff; border-radius: 14px; padding: 10px 14px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; }
.diamond { width: min(100%, 360px); aspect-ratio: 1; margin: 14px auto; position: relative; border-radius: 45% 45% 55% 55%; background: radial-gradient(circle at 50% 58%, #d99b55 0 29%, transparent 30%), linear-gradient(#3d9460, #2f7d4f); border: 3px solid #276749; overflow: hidden; }
.base { position: absolute; width: 9%; aspect-ratio: 1; background: #fff; border: 1px solid #c8b79d; transform: rotate(45deg); box-shadow: 0 2px 5px rgba(0,0,0,.18); }
.home { left: 45.5%; top: 78%; }
.first { left: 72%; top: 51%; }
.second { left: 45.5%; top: 24%; }
.third { left: 19%; top: 51%; }
.base-label { position: absolute; transform: none; font-size: .78rem; font-weight: 800; color: #101828; background: rgba(255,255,255,.86); border-radius: 999px; padding: 2px 7px; }
.l-home { left: 41%; top: 88%; } .l-first { left: 78%; top: 47%; } .l-second { left: 40%; top: 14%; } .l-third { left: 8%; top: 47%; }
.arrow { font-weight: 900; color: var(--accent); }
button { appearance: none; border: 1px solid #c8b79d; background: #fff; color: var(--ink); border-radius: 999px; padding: 9px 14px; margin: 5px 6px 5px 0; cursor: pointer; font: inherit; }
button:hover { background: var(--accent-soft); }
button.correct { border-color: var(--good); background: #ecfdf3; }
button.incorrect { border-color: var(--warn); background: #fff4e8; }
.feedback { font-weight: 760; margin-top: 10px; }
footer { margin-top: 34px; color: var(--muted); font-size: .95rem; }
.skip-link { position: absolute; left: 16px; top: -80px; z-index: 30; background: var(--ink); color: white; padding: 10px 12px; border-radius: 12px; }
.skip-link:focus { top: 16px; }
.course-topbar { width: min(940px, calc(100% - 44px)); margin: 18px auto 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--muted); font-size: .94rem; }
.course-topbar a, .lesson-bottom-nav a { color: var(--ink); text-decoration: none; border: 1px solid var(--line); background: rgba(255,255,255,.72); border-radius: 999px; padding: 8px 12px; }
.course-topbar a:hover, .lesson-bottom-nav a:hover { background: var(--accent-soft); }
.lesson-bottom-nav { width: min(940px, calc(100% - 44px)); margin: -42px auto 54px; display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; }
.lesson-bottom-nav .next { justify-self: end; }
.lesson-bottom-nav .prev { justify-self: start; }
@media print { body { background: #fff; } main { padding: 0; } article { box-shadow: none; border: none; } button, .course-topbar, .lesson-bottom-nav { display: none; } }
@media (max-width: 700px) { article { padding: 26px; } main { padding-top: 34px; } .course-topbar { flex-wrap: wrap; } }


/* Readable code blocks: inline code stays highlighted, code inside <pre> does not inherit that pale chip background. */
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: rgba(226, 214, 195, .55); padding: .1em .35em; border-radius: 5px; }
pre { overflow-x: auto; background: #182230; color: #edf3f4; padding: 16px; border-radius: 14px; font-size: 15px; line-height: 1.55; }
pre code { background: transparent; color: inherit; padding: 0; border-radius: 0; }
