/* base.css - 基础样式：重置、排版、颜色变量
 * 风格：干净、留白多、字号大（正文不小于 16px）、对比度高、无花哨动画。
 */

:root {
  --color-bg: #f5f7fa;
  --color-surface: #ffffff;
  --color-text: #1a2233;
  --color-text-soft: #4a5568;
  --color-primary: #1858c8;
  --color-primary-dark: #11439a;
  --color-ok: #0d7a3e;
  --color-warn: #a46100;
  --color-error: #b3261e;
  --color-border: #d5dce6;
  --color-track: #e3e9f2;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(16, 32, 64, 0.08);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  /* BUG-4: 底部导航避让距离（不小于底栏实际高度），与安全区相加使用 */
  --bottom-nav-clearance: 5.5rem;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* BUG-4: 页面级滚动容器是窗口（html），加 scroll-padding-bottom，
   使 scrollIntoView / 聚焦滚动后的可点元素停在底栏遮挡带之上 */
html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-padding-bottom: calc(var(--bottom-nav-clearance) + env(safe-area-inset-bottom));
}

body {
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100vh;
}

h1, h2, h3, h4 { line-height: 1.4; font-weight: 600; }
h2.page-title { font-size: 1.5rem; margin-bottom: 0.5rem; }
h3.card-title { font-size: 1.15rem; margin-bottom: 0.5rem; }
h4.lesson-sub { font-size: 1rem; margin: 0.75rem 0 0.35rem; }

p { margin: 0.35rem 0; }

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

strong { font-weight: 600; }

ul, ol { list-style: none; }

input, textarea, button { font-family: inherit; font-size: 1rem; }

button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.55; }

.sub-text {
  color: var(--color-text-soft);
  font-size: 0.95rem;
}

.icon { vertical-align: -0.25em; }
