/* 主题变量与基础重置 */

:root {
  --bg: #fafaf9;
  --fg: #1c1917;
  --fg-muted: #57534e;
  --fg-subtle: #78716c;
  --border: #e7e5e4;
  --accent: #0f766e;
  --accent-hover: #115e59;
  --code-bg: #f5f5f4;
  --mark-bg: #fef3c7;
  --selection: #ccfbf1;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "SF Mono", Menlo, Consolas, "Liberation Mono",
    "Source Han Mono", monospace;

  --content-width: 704px;
  --toc-width: 200px;
}

html[data-theme="dark"] {
  --bg: #0f1115;
  --fg: #e7e5e4;
  --fg-muted: #a8a29e;
  --fg-subtle: #78716c;
  --border: #292524;
  --accent: #5eead4;
  --accent-hover: #99f6e4;
  --code-bg: #1a1d23;
  --mark-bg: #422006;
  --selection: #134e4a;
}

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  transition: color 200ms ease, background-color 200ms ease;
}

::selection { background: var(--selection); color: var(--fg); }

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 150ms ease, color 150ms ease;
}
a:hover { border-bottom-color: var(--accent); }

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

img { max-width: 100%; height: auto; }

hr { border: 0; border-top: 1px solid var(--border); margin: 2.5em 0; }

.skip-link {
  position: absolute;
  top: -40px;
  left: 8px;
  padding: 6px 12px;
  background: var(--accent);
  color: var(--bg);
  border: 0;
  z-index: 100;
}
.skip-link:focus { top: 8px; }
