/* 北京市考特色题型讲义 · 样式
   讲义风格：层级只靠粗体、斜体和字号；细线表格；不用色块、阴影、渐变、动画。 */

:root {
  --bg: #ffffff;
  --fg: #1a1a1a;
  --fg-2: #555555;      /* 次要文字，白底对比度 7.4:1 */
  --line: #8c8c8c;      /* 表格细线 */
  --ctl: #666666;       /* 按钮、输入框边线 */
  --link: #1a4a8a;
  --focus: #1a4a8a;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161616;
    --fg: #ececec;
    --fg-2: #b4b4b4;    /* 深色底对比度约 8.6:1 */
    --line: #7a7a7a;
    --ctl: #9a9a9a;
    --link: #a8c7fa;
    --focus: #a8c7fa;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-size: 1rem;
  line-height: 1.75;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.wrap {
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ---- 文字层级 ---- */
h1 { font-size: 1.5rem; line-height: 1.4; margin: 1.25rem 0 .75rem; }
h2 { font-size: 1.25rem; line-height: 1.4; margin: 1.75rem 0 .5rem; }
h3 { font-size: 1.0625rem; line-height: 1.5; margin: 1.25rem 0 .25rem; }
p { margin: .75rem 0; }
ul, ol { margin: .75rem 0; padding-left: 1.5rem; }
li { margin: .25rem 0; }
strong, b, th { font-weight: 700; }
.note { color: var(--fg-2); font-size: .875rem; }

a { color: var(--link); text-decoration: underline; text-underline-offset: .15em; }

mark { background: none; color: inherit; font-weight: 700; }

/* ---- 键盘焦点 ---- */
:focus { outline: 3px solid var(--focus); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
main:focus, main:focus-visible, h1:focus, h1:focus-visible, .stem:focus, .stem:focus-visible { outline: none; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip { position: absolute; left: -999rem; top: .5rem; }
.skip:focus { left: .5rem; z-index: 1; }

/* ---- 页头和导航 ---- */
.site-head { border-bottom: 1px solid var(--line); padding: .75rem 0 .35rem; }
.brand { display: inline-block; padding: .2rem 0; font-size: 1.125rem; font-weight: 700; color: var(--fg); text-decoration: none; }
.site-head ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  margin: .25rem 0 0 -.5rem;
  padding: 0;
}
.site-head li { margin: 0; }
.site-head nav a { display: inline-block; padding: .45rem .5rem; }
.site-head nav a[aria-current="page"] { color: var(--fg); font-weight: 700; text-decoration: none; }

main { padding-bottom: 4rem; }

/* ---- 表格：普通细线表格 ---- */
.table-scroll { overflow-x: auto; margin: .75rem 0 1rem; }
table { width: 100%; border-collapse: collapse; }
th, td {
  border: 1px solid var(--line);
  padding: .4rem .5rem;
  text-align: left;
  vertical-align: top;
}
table.cols-2 th:first-child, table.cols-2 td:first-child { width: 30%; min-width: 4.5em; }

/* 小屏：三列以上的表格改成纵向排列，每格前面带上表头 */
@media (max-width: 40rem) {
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; }
  table.stack thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }
  table.stack { border-top: 1px solid var(--line); }
  table.stack tr { border-bottom: 1px solid var(--line); padding: .5rem 0; }
  table.stack td { border: 0; padding: .1rem 0; }
  table.stack td::before { content: attr(data-label) "\FF1A"; font-weight: 700; }
  table.stack td.empty { display: none; }
}

/* ---- 按钮和输入 ---- */
button {
  -webkit-appearance: none;
  appearance: none;
  font: inherit;
  line-height: 1.5;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--ctl);
  border-radius: 4px;
  min-height: 2.75rem;
  padding: calc(.5rem + 2px) calc(.9rem + 2px);
  margin: 0;
  cursor: pointer;
  text-align: center;
}
button:hover { border-color: var(--fg); }
button[aria-pressed="true"], button.picked {
  border: 3px solid var(--fg);
  padding: .5rem .9rem;
  font-weight: 700;
}
button:disabled { color: var(--fg-2); border-style: dashed; cursor: default; }
button:disabled:hover { border-color: var(--ctl); }

.row { display: flex; flex-wrap: wrap; gap: .5rem; margin: .75rem 0; }

input[type="search"], textarea {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  font: inherit;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--ctl);
  border-radius: 4px;
  padding: .55rem .6rem;
  margin: .5rem 0;
}
textarea { min-height: 7rem; font-size: 1rem; line-height: 1.5; }
::placeholder { color: var(--fg-2); opacity: 1; }
input[type="file"] { display: block; max-width: 100%; font: inherit; color: var(--fg); margin: .5rem 0; }
input[type="checkbox"] { flex: none; width: 1.5rem; height: 1.5rem; margin: .15rem .65rem 0 0; }
label { cursor: pointer; }

/* ---- 知识速查 ---- */
details { border-top: 1px solid var(--line); }
details:last-of-type { border-bottom: 1px solid var(--line); }
summary { cursor: pointer; font-size: 1.125rem; font-weight: 700; padding: .65rem 0; }
summary .note { font-weight: 400; }

/* ---- 练习 ---- */
.stem { font-size: 1.0625rem; margin: 1rem 0 .75rem; }
.opt { display: block; width: 100%; text-align: left; margin: .5rem 0; }
.opt .note { font-weight: 400; }
.verdict { font-size: 1.0625rem; margin: 1rem 0 .25rem; }
.keys { display: none; }
@media (hover: hover) and (pointer: fine) { .keys { display: block; } }
.plain-list { list-style: none; padding-left: 0; }
.plain-list > li { border-top: 1px solid var(--line); padding: .6rem 0; margin: 0; }

/* ---- 闪卡：细线框，不用阴影 ---- */
.card {
  border: 1px solid var(--ctl);
  border-radius: 4px;
  padding: .75rem 1rem;
  margin: .75rem 0;
  min-height: 11rem;
  cursor: pointer;
}
.card-front { font-size: 1.25rem; font-weight: 700; margin: .5rem 0; }

/* ---- 冲刺计划 ---- */
.plan { list-style: none; padding-left: 0; }
.plan li { border-top: 1px solid var(--line); margin: 0; }
.plan label { display: flex; align-items: flex-start; padding: .6rem 0; }

.entries { list-style: none; padding-left: 0; }
.entries a { font-weight: 700; display: inline-block; padding: .2rem 0; }
