@tailwind base;
@tailwind components;
@tailwind utilities;

/* Primitive 设计令牌（Layer 1）— 白名单文件，定义原始色板 */
:root {
  --bg-paper: hsl(40, 20%, 98%);
  --color-ink: hsl(25, 3%, 15%);
  --color-ink-muted: hsl(30, 5%, 45%);
  --color-accent: hsl(220, 60%, 35%);
  --color-accent-light: hsl(220, 60%, 95%);
  --color-rule: hsl(30, 10%, 90%);
  --color-danger: hsl(0, 70%, 45%);
  --color-danger-light: hsl(0, 70%, 95%);
  --color-success: hsl(140, 50%, 35%);
  --color-success-light: hsl(140, 50%, 95%);
  --color-warning: hsl(35, 80%, 45%);
  --color-warning-light: hsl(35, 80%, 95%);
  --font-serif: 'Fraunces', Georgia, serif;
  --font-sans: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

html, body {
  background: var(--bg-paper);
  color: var(--color-ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* 纸感分隔线 */
.rule {
  border-top: 1px solid var(--color-rule);
}

.rule-thin {
  border-top: 2px solid var(--color-rule);
}

/* 左侧竖线标记 */
.mark-left {
  border-left: 2px solid var(--color-rule);
  padding-left: 12px;
}

/* 焦点样式（A11y WCAG 2.2 AA）*/
*:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* 跳过导航链接（A11y）*/
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-ink);
  color: var(--bg-paper);
  padding: 8px 16px;
  z-index: 100;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 0;
}
