/* ==========================================================================
   base.css：设计变量、重置、排版、按钮
   方格纸和笔记本的感觉：暖白底色配淡格线，深蓝主色，橙色强调。
   ========================================================================== */

:root {
  --paper: #FBF9F4;
  --grid: #EEEAE0;
  --card: #FFFFFF;
  --ink: #1F2933;
  --ink-2: #52606D;
  --line: #D9DEE5;
  --primary: #1D4E89;
  --primary-ink: #153A66;
  --primary-soft: #E3ECF7;
  --accent: #D9622B;
  --accent-ink: #A8431A;
  --accent-soft: #FBE9DF;
  --success: #2A7449;                              /* 在白色和浅绿底上对比度都不低于 4.5 */
  --success-soft: #E2F1E8;
  --warn: #8A5A00;
  --warn-soft: #FBF0D6;
  --danger: #B3372B;
  --danger-soft: #F8E2DF;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(31, 41, 51, .06), 0 8px 24px rgba(31, 41, 51, .07);
  --font: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif;
  --content-width: 1080px;

  /* 图表用色。系列色是数据可视化规范里校验过的分类色板的前两槽（蓝、橙）；
     状态色固定不变，使用时一定配上图标和文字。 */
  --chart-1: #2a78d6;
  --chart-2: #eb6834;
  --chart-point: #1F2933;
  --chart-good: #0ca30c;
  --chart-bad: #d03b3b;
  --chart-grid: #e1e0d9;
  --chart-axis: #c3c2b7;
  --chart-text: #52606D;
  --chart-ref: #898781;
  --chart-track: #eef2f7;
}

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

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

body {
  margin: 0;
  font: 1rem/1.75 var(--font);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  margin: 0 0 .5em;
  font-weight: 700;
  line-height: 1.3;
}
h1 { font-size: 2rem; letter-spacing: -.01em; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }

p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.5em; }
li { margin: .25em 0; }

a { color: var(--primary); text-underline-offset: .2em; }
a:hover { color: var(--primary-ink); }

strong { font-weight: 700; }
svg { max-width: 100%; }

button, input, select, textarea {
  font: inherit;
  color: inherit;
}
button { cursor: pointer; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

[hidden] { display: none !important; }

/* 只给读屏软件看的文字 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* 用键盘时，第一下 Tab 到达这里，可以跳过导航 */
.skip-link {
  position: absolute;
  left: 12px;
  top: -80px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--primary);
  color: #fff;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  text-decoration: none;
}
.skip-link:focus { top: 0; color: #fff; }

.icon {
  width: 1.3em;
  height: 1.3em;
  flex: none;
  vertical-align: -.25em;
}

/* ---------- 几个通用的文字样式 ---------- */

.eyebrow {
  margin: 0 0 .35em;
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--accent-ink);
}

.lead {
  max-width: 38em;                                 /* 每行不超过 42 个汉字 */
  font-size: 1.12rem;
  color: var(--ink-2);
}

.num { font-variant-numeric: tabular-nums; }

/* ---------- 按钮 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45em;
  min-height: 44px;
  padding: .5em 1.15em;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--ink);
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-ink); border-color: var(--primary-ink); color: #fff; }

.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
.btn-danger:hover { background: #8F2B22; border-color: #8F2B22; color: #fff; }

.btn-lg { padding: .65em 1.5em; font-size: 1.06rem; }
.btn-small { padding: .3em .85em; font-size: .9rem; }

/* 只放一个图标的按钮 */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  text-decoration: none;
}
.icon-btn:hover { border-color: var(--line); background: var(--card); color: var(--primary); }
.icon-btn .icon { width: 22px; height: 22px; }

/* ---------- 尊重系统的"减少动态效果"设置 ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0s !important;
    animation-duration: 0s !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
