/* OfferWink v3 — lesson content styles (extracted from site.css, light theme only, scoped to .ow-reader) */
.ow-reader{
  --bg:#FFFFFF;--bg-subtle:#F7F9FB;--surface:#FFFFFF;--surface-2:#F3F6F9;--text:#0F172A;--text-secondary:#526071;--text-muted:#7A8696;
  --border:#E3E8EE;--border-strong:#CDD5DF;--brand:#1E3A5F;--brand-ink:#15304F;--brand-soft:#EDF2F8;--accent:#0F8A7E;--accent-strong:#0B7268;--accent-soft:#E7F6F4;
  --danger:#DC2626;--danger-soft:#FEF2F2;--code-bg:#0E1626;--code-head:#141E31;--code-text:#E2E8F0;--radius-sm:8px;--radius:12px;--radius-lg:16px;
  --shadow-sm:0 1px 2px rgba(15,23,42,.04);--shadow:0 1px 2px rgba(15,23,42,.04),0 4px 16px rgba(15,23,42,.05);--header-h:64px;
  --font-sans:var(--font);--font-code:var(--mono);
}
.md-body { max-width: 740px; font-size: 16px; line-height: 1.85; color: var(--text); letter-spacing: .005em; }
.ow-reader .md-body h1 { display: none; }
.ow-reader .md-body h2 {
  font-size: 23px; color: var(--text); margin: 48px 0 14px; font-weight: 700;
  letter-spacing: -.01em; line-height: 1.4; scroll-margin-top: calc(var(--header-h) + 20px);
}
.ow-reader .md-body h2:first-child { margin-top: 0; }
.ow-reader .md-body h3 { font-size: 18px; color: var(--text); margin: 32px 0 10px; font-weight: 650; line-height: 1.45; scroll-margin-top: calc(var(--header-h) + 20px); }
.ow-reader .md-body h4 { font-size: 16px; margin: 24px 0 8px; font-weight: 650; }
.ow-reader .md-body p { margin-bottom: 18px; }
.ow-reader .md-body strong { font-weight: 650; color: var(--text); }
.ow-reader .md-body ul, .ow-reader .md-body ol { margin: 0 0 18px 1.4em; }
.ow-reader .md-body li { margin-bottom: 6px; padding-left: 2px; }
.ow-reader .md-body li::marker { color: var(--text-muted); }
.ow-reader .md-body a { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); text-underline-offset: 3px; }
.ow-reader .md-body a:hover { text-decoration-color: var(--accent); }
.ow-reader .md-body blockquote {
  position: relative; border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
  background: var(--accent-soft);
  padding: 14px 18px 14px 20px; border-radius: var(--radius); margin: 0 0 24px;
  color: var(--text); font-size: 15.5px; line-height: 1.75;
}
.ow-reader .md-body blockquote::before { content: ""; position: absolute; left: -1px; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--accent); }
.ow-reader .md-body blockquote p:last-child { margin-bottom: 0; }
.ow-reader .md-body code {
  font-family: var(--font-code); font-size: .86em;
  background: var(--surface-2); border: 1px solid var(--border);
  padding: .1em .38em; border-radius: 5px; color: var(--brand-ink);
  word-break: break-word;
}
.ow-reader .md-body pre {
  background: var(--code-bg); color: var(--code-text);
  border-radius: var(--radius); padding: 16px 18px; overflow-x: auto;
  font-family: var(--font-code);
  font-size: 13.5px; line-height: 1.65; margin: 0; position: relative;
  scrollbar-width: thin; scrollbar-color: #334155 transparent;
}
.ow-reader .md-body pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; word-break: normal; }
.code-wrap {
  position: relative; margin: 20px 0 24px; border-radius: var(--radius);
  border: 1px solid #1B2638; overflow: hidden; background: var(--code-bg);
}
.code-head {
  display: flex; align-items: center; justify-content: space-between;
  height: 38px; padding: 0 8px 0 16px; background: var(--code-head);
  border-bottom: 1px solid #1B2638;
  font: 500 12px/1 var(--font-code); color: #8A97AB; letter-spacing: .02em;
}
.code-wrap pre { border-radius: 0; }
.code-wrap .copy-btn {
  font-size: 12px; padding: 5px 10px; border-radius: 6px;
  background: transparent; color: #9AA6B8; border: 1px solid transparent;
  cursor: pointer; font-family: var(--font-sans);
}
.code-wrap .copy-btn:hover { background: #1E293B; color: #E2E8F0; border-color: #334155; }
.table-wrap { overflow-x: auto; margin: 20px 0 24px; border: 1px solid var(--border); border-radius: var(--radius); }
.ow-reader .md-body table { border-collapse: collapse; width: 100%; font-size: 14px; line-height: 1.6; }
.table-wrap table { margin: 0 !important; }
.ow-reader .md-body th, .ow-reader .md-body td { border-bottom: 1px solid var(--border); padding: 10px 14px; text-align: left; vertical-align: top; }
.ow-reader .md-body tr:last-child td { border-bottom: 0; }
.ow-reader .md-body th { background: var(--bg-subtle); font-weight: 600; color: var(--text); font-size: 13px; white-space: nowrap; }
.ow-reader .md-body td + td, .ow-reader .md-body th + th { border-left: 1px solid var(--border); }
.ow-reader .md-body tbody tr:hover td { background: var(--bg-subtle); }
.ow-reader .md-body img { max-width: 100%; border-radius: var(--radius); border: 1px solid var(--border); }
.ow-reader .md-body hr { border: none; border-top: 1px solid var(--border); margin: 36px 0; }
.lesson-figure { margin: 28px 0; }

/* Mermaid diagrams rendered from language-mermaid fences */
.ow-reader .md-body .mermaid {
  margin: 24px 0; text-align: center; overflow-x: auto;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 16px;
}
.ow-reader .md-body .mermaid svg { max-width: 100%; height: auto; }
.ow-reader .md-body .mermaid.mermaid-error {
  text-align: left; white-space: pre-wrap; font-family: var(--font-code);
  font-size: 12px; color: var(--text-secondary);
}

/* Quiz */
.quiz-card {
  margin-top: 56px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px 28px 24px;
  box-shadow: var(--shadow); max-width: 740px;
}
.quiz-card h3 { font-size: 20px; color: var(--text); margin-bottom: 4px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.quiz-card h3::before { content: ""; width: 4px; height: 18px; border-radius: 2px; background: var(--accent); }
.quiz-card > p { font-size: 13.5px; color: var(--text-muted); margin-bottom: 8px; }
.quiz-q { padding: 20px 0 4px; font-size: 15.5px; border-top: 1px solid var(--border); margin-top: 16px; line-height: 1.7; }
.quiz-q > div:first-child strong { color: var(--accent-strong); margin-right: 2px; font-variant-numeric: tabular-nums; }
.quiz-q .opts { list-style: none; margin: 12px 0 0; counter-reset: opt; display: grid; gap: 8px; }
.quiz-q .opts li {
  counter-increment: opt; position: relative;
  padding: 11px 14px 11px 48px; border: 1px solid var(--border);
  border-radius: 10px; cursor: pointer; background: var(--surface); font-size: 14.5px; line-height: 1.6;
  transition: border-color 120ms, background 120ms;
}
.quiz-q .opts li::before {
  content: counter(opt, upper-alpha); position: absolute; left: 12px; top: 10px;
  width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center;
  font: 600 12px/1 var(--font-code); color: var(--text-secondary);
  background: var(--surface-2); border: 1px solid var(--border);
}
.quiz-q .opts li:hover { border-color: var(--border-strong); background: var(--bg-subtle); }
.quiz-q .opts li.selected { border-color: var(--brand); background: var(--brand-soft); }
.quiz-q .opts li.selected::before { background: var(--brand); color: #fff; border-color: var(--brand); }
.quiz-q .opts li.correct { border-color: var(--accent); background: var(--accent-soft); }
.quiz-q .opts li.correct::before { content: "✓"; background: var(--accent); color: #fff; border-color: var(--accent); }
.quiz-q .opts li.wrong { border-color: var(--danger); background: var(--danger-soft); }
.quiz-q .opts li.wrong::before { content: "✕"; background: var(--danger); color: #fff; border-color: var(--danger); }
.quiz-card #quizCheck { margin-top: 20px; }
.loading { padding: 80px 20px; text-align: center; color: var(--text-muted); }
.error-box {
  padding: 24px; background: var(--danger-soft); border: 1px solid #FECACA;
  border-radius: var(--radius); color: #991B1B; margin: 20px 0;
}

/* LF figure theme aliases (consumed by figures-*.js) */
.ow-reader .md-body, .ow-reader .lesson-figure {
  --blueprint: var(--accent, #0D9488);
  --blueprint-tint: var(--accent-soft, rgba(13,148,136,.12));
  --rule-soft: var(--border, #E6E8EC);
  --ink: var(--text, #1A1D26);
  --ink-soft: var(--text-secondary, #5C6370);
  --ink-mute: var(--text-secondary, #5C6370);
  --font-body: "PingFang SC", "Noto Sans SC", "Source Han Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ease-out: cubic-bezier(.23,1,.32,1);
}
.ow-reader .md-body{max-width:none}
.ow-reader .quiz-card{max-width:none}
.ow-reader .md-body a{color:var(--accent)}
.ow-reader .btn-accent{background:var(--teal);color:#fff}
