/* ========== IP968 base: 主题变量、重置、排版 ========== */

:root {
  /* 浅色主题 */
  --c-bg: #ffffff;
  --c-bg-soft: #f6f8fa;
  --c-bg-mute: #eef1f4;
  --c-border: #e3e8ec;
  --c-border-soft: #eef1f4;
  --c-text: #1f2328;
  --c-text-soft: #57606a;
  --c-text-mute: #8c959f;
  --c-brand: #3b82f6;
  --c-brand-soft: #e8f1fe;
  --c-green: #3fb950;
  --c-yellow: #d29922;
  --c-orange: #db6d28;
  --c-red: #f85149;
  --c-bg-code: #f6f8fa;

  --shadow-1: 0 1px 2px rgba(0,0,0,.06);
  --shadow-2: 0 4px 14px rgba(0,0,0,.08);
  --radius: 10px;
  --radius-sm: 7px;
  --maxw: 1200px;
  --header-h: 60px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", Roboto, Helvetica, Arial, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

[data-theme="dark"] {
  --c-bg: #0d1117;
  --c-bg-soft: #161b22;
  --c-bg-mute: #21262d;
  --c-border: #30363d;
  --c-border-soft: #21262d;
  --c-text: #e6edf3;
  --c-text-soft: #9198a1;
  --c-text-mute: #6e7681;
  --c-brand: #4493f8;
  --c-brand-soft: #16283a;
  --c-green: #3fb950;
  --c-yellow: #d29922;
  --c-orange: #db6d28;
  --c-red: #f85149;
  --c-bg-code: #161b22;
  --shadow-1: 0 1px 2px rgba(0,0,0,.4);
  --shadow-2: 0 4px 14px rgba(0,0,0,.5);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--c-bg);
  color: var(--c-text);
  line-height: 1.65;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s, color .25s;
}
a { color: var(--c-brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1,h2,h3,h4 { line-height: 1.3; font-weight: 650; color: var(--c-text); margin: 1.6em 0 .6em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.45rem; border-bottom: 1px solid var(--c-border); padding-bottom: .35em; }
h3 { font-size: 1.15rem; }
p { margin: .7em 0; }
code { font-family: var(--mono); background: var(--c-bg-mute); padding: .15em .4em; border-radius: 5px; font-size: .9em; }
pre { background: var(--c-bg-code); padding: 14px 16px; border-radius: var(--radius-sm); overflow:auto; border:1px solid var(--c-border); }
pre code { background: none; padding: 0; }
ul,ol { padding-left: 1.4em; }
table { width:100%; border-collapse: collapse; margin: 1em 0; font-size: .94em; }
th,td { border:1px solid var(--c-border); padding:8px 12px; text-align:left; }
th { background: var(--c-bg-soft); }
hr { border: none; border-top: 1px solid var(--c-border); margin: 1.8em 0; }
img { max-width: 100%; }

.skip-link {
  position:absolute; left:-9999px; top:0; z-index:9999;
  background: var(--c-brand); color:#fff; padding:8px 14px; border-radius:0 0 6px 0;
}
.skip-link:focus { left:0; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 28px 22px 64px; min-height: calc(100vh - var(--header-h) - 80px); }
.container.narrow { max-width: 860px; }

/* 主题切换避免闪烁：theme.js 在 head 提前执行 */
html[data-theme="dark"] body { background: var(--c-bg); }
