/* DOYEONMATH — DESIGN.md를 웹(모바일 우선)에 맞게 옮긴 스타일
   흑백 + 빨강 #C8372D, 형광펜 3색. 그라데이션·그림자·둥근 모서리·아이콘·이모지 금지 */
:root {
  --ink: #1A1A1A; --sub: #777777; --foot: #999999; --red: #C8372D; --gray: #F1F1EF;
  --line: #DDDDDD; --line2: #CCCCCC; --dash: #BBBBBB;
  --hl-cond: #FFF0A8; --hl-key: #F9D6D0; --hl-ans: #D3E5F6;
  --gutter: 20px; --maxw: 720px;
  color-scheme: light;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: #FFFFFF; color: var(--ink);
  font-family: 'Pretendard', -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  font-weight: 400; font-size: 17px; line-height: 1.7;
  word-break: keep-all; overflow-wrap: break-word;
}
@media (min-width: 768px) { body { font-size: 18px; } }
b, strong { font-weight: 700; }
a { color: inherit; }
.katex { font-size: 1.04em; }
.katex .text { font-family: 'Pretendard', KaTeX_Main, sans-serif; }
.nb { white-space: nowrap; }
.red { color: var(--red); }
.subtle { color: var(--sub); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

/* 머리글 — 왼쪽 로고(글자, 심볼 자리 확보), 오른쪽 링크 1개, 아래 검은 굵은 선 */
.site-head { border-bottom: 3px solid var(--ink); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.logo-mark:empty { display: none; }          /* 나중에 심볼(이미지/SVG)을 넣으면 보임 */
.logo-mark { display: block; height: 24px; }
.logo-text { font-weight: 700; font-size: 18px; letter-spacing: 0.06em; }
.head-link { font-size: 14px; }

main { padding: 24px 0 40px; }
.crumb { font-size: 14px; color: var(--sub); margin-bottom: 4px; }
.crumb a { text-decoration: none; }

/* 라벨 — 빨간 Bold + 밑줄 */
.label { display: inline-block; font-weight: 700; color: var(--red); font-size: 16px; line-height: 1.4;
         border-bottom: 2px solid var(--red); margin-bottom: 10px; }
.plabel { margin-bottom: 8px; }
.plabel .label { margin-bottom: 0; }
.plabel .lv { color: var(--sub); font-size: 14px; }
.plabel .lv.adv { color: var(--red); }

/* 목록 줄 (메인·단원 공통) */
.rows { list-style: none; }
.row { border-bottom: 1px solid var(--line); }
.row > a, .row > span { display: flex; align-items: baseline; gap: 14px; padding: 12px 0; text-decoration: none; }
.row .no { font-weight: 700; color: var(--red); width: 24px; flex: none; }
.row .name { flex: 1; min-width: 0; }
.row .meta { font-size: 13px; color: var(--sub); flex: none; }
.row.off { color: var(--foot); }
.row.off .no { color: var(--foot); }

/* 메인 */
.hero { padding: 16px 0 28px; }
.hero h1 { font-size: 34px; font-weight: 700; letter-spacing: 0.04em; line-height: 1.2; margin-bottom: 12px; }
.hero p { color: var(--sub); white-space: pre-line; }
.section { margin-top: 28px; }

/* 단원 */
.unit-title { font-size: 30px; font-weight: 700; line-height: 1.25; }
.unit-sub { font-size: 14px; color: var(--sub); margin: 4px 0 16px; }

/* 소단원 */
.sub-title { font-size: 26px; font-weight: 700; line-height: 1.35; margin-bottom: 22px; }
.concepts { border-left: 4px solid var(--red); padding-left: 14px; margin-bottom: 28px; }
.concepts div + div { margin-top: 2px; }
.bars { list-style: none; margin-bottom: 28px; }
.bars li + li { margin-top: 6px; }
.bars a { display: flex; background: var(--gray); padding: 9px 14px; text-decoration: none; }
.bars .no { width: 64px; flex: none; font-weight: 700; color: var(--red); }

.filter { display: flex; gap: 20px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.filter a { padding: 8px 0 6px; text-decoration: none; color: var(--sub); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.filter a.on { color: var(--ink); font-weight: 700; border-bottom-color: var(--red); }

.type { padding-top: 28px; scroll-margin-top: 8px; }
.type + .type { border-top: 1px solid var(--line); margin-top: 8px; }
.type-title { font-size: 21px; font-weight: 700; line-height: 1.4; margin-bottom: 14px; }
.freq { font-size: 13px; color: var(--red); font-weight: 700; margin-left: 4px; white-space: nowrap; }
.prob { margin-bottom: 26px; scroll-margin-top: 8px; }
.prob + .prob { border-top: 1px solid var(--line); padding-top: 22px; }
.q-items { margin-top: 6px; }
.q-items div { padding-left: 0; }

/* 해설 접기/펼치기 — <details> */
details.sol { margin-top: 14px; }
details.sol summary { display: inline-block; cursor: pointer; list-style: none; user-select: none;
  border: 1.5px solid var(--ink); padding: 4px 12px; font-size: 15px; font-weight: 700; }
details.sol summary::-webkit-details-marker { display: none; }
details.sol summary .when-open { display: none; }
details.sol[open] summary .when-open { display: inline; }
details.sol[open] summary .when-closed { display: none; }
.sol-body { border-top: 2px dashed var(--dash); margin-top: 14px; padding-top: 14px; font-size: 16px; }
.sol-text div + div { margin-top: 2px; }
.tag { font-size: 0.82em; color: var(--sub); }
.think { background: var(--gray); padding: 12px 14px; margin-top: 16px; font-size: 15px; }
.think .t { font-weight: 700; color: var(--red); }
.sign { text-align: right; font-size: 11px; color: var(--foot); margin-top: 8px; letter-spacing: 0.04em; }

/* 형광펜 (DESIGN.md 8) */
.hl { padding: 0 4px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.hl.cond { background: var(--hl-cond); }
.hl.key { background: var(--hl-key); }
.hl.ans { background: var(--hl-ans); }

/* 심화만 보기 */
body.adv-only .prob.basic { display: none; }
body.adv-only .prob.adv { border-top: 0; padding-top: 0; }

/* 이전/다음 */
.pager { display: flex; justify-content: space-between; gap: 16px; font-size: 14px; margin: 28px 0 8px; }
.pager a:only-child.next { margin-left: auto; }

/* 수업 안내 상자 */
.class-box { border: 2px solid var(--ink); padding: 14px 16px; margin-top: 28px; font-size: 15px; }
.class-box .t { font-weight: 700; color: var(--red); margin-bottom: 6px; }
.class-box .more { display: inline-block; margin-top: 8px; }

/* 수업 안내·강사 소개 페이지 */
.page h1 { font-size: 26px; font-weight: 700; margin-bottom: 14px; }
.page h2 { font-size: 20px; font-weight: 700; margin: 24px 0 8px; }
.page p + p { margin-top: 10px; }
.page ul { padding-left: 1.2em; }
.class-list { list-style: none; margin-top: 20px; }
.class-list li { border-bottom: 1px solid var(--line); padding: 12px 0; }

/* 꼬리말 */
.site-foot { border-top: 1px solid var(--line2); padding: 20px 0 36px; font-size: 13px; color: var(--foot); }
.site-foot .who { color: var(--ink); font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.site-foot a { text-decoration: underline; }
.site-foot .links { display: flex; flex-wrap: wrap; column-gap: 14px; row-gap: 2px; }
.site-foot .copy { margin-top: 10px; }

/* 그림 (figure.py 웹 모드) — 좌표 계산 SVG + 글자 라벨 */
.fig { position: relative; width: 100%; container-type: inline-size; margin: 12px 0 4px; }
.fig svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.fl { position: absolute; line-height: 1; white-space: nowrap;
      font-size: max(13px, calc(100cqw * 28 / var(--w))); }

@media print {
  .site-head .head-link, .filter, .pager, details.sol summary { display: none; }
  details.sol > .sol-body { display: block; }
}
