/*
 * EasyWork 产品页样式
 * 单栏 960px 容器 + 文档式排版；无外链字体/图片/框架；亮暗随系统。
 */

:root {
  color-scheme: light dark;

  /* 中性色阶：正文接近纯黑，次级信息用中性灰，避免"灰得发蓝" */
  --bg: #ffffff;
  --bg-subtle: #fafbfc;
  --bg-code: #f8f9fa;
  --bg-hover: #f4f6f8;
  --fg: #101418;
  --fg-secondary: #4a525c;
  --fg-muted: #6b7580;
  --line: #e6e9ec;
  --line-strong: #d3d8de;
  --accent: #0b5cd5;
  --accent-soft: #eef3fd;
  --ok: #197a4b;

  --container: 960px;
  --prose: 64ch;
  --radius: 10px;
  --radius-sm: 6px;

  --s1: 0.25rem;
  --s2: 0.5rem;
  --s3: 0.75rem;
  --s4: 1rem;
  --s5: 1.5rem;
  --s6: 2rem;
  --s7: 3rem;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", "Noto Sans Mono CJK SC", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0e12;
    --bg-subtle: #11151b;
    --bg-code: #10151b;
    --bg-hover: #161b22;
    --fg: #e8ebef;
    --fg-secondary: #b6bec8;
    --fg-muted: #8b95a1;
    --line: #212832;
    --line-strong: #2f3844;
    --accent: #7aa9f7;
    --accent-soft: #131d2c;
    --ok: #57c48f;
  }
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 4.5rem; /* 锚点跳转避开 sticky 头部 */
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: tabular-nums;
}

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

p { margin: 0 0 var(--s4); }
p:last-child { margin-bottom: 0; }

h1, h2, h3 {
  margin: 0;
  font-weight: 650;
  letter-spacing: -0.018em;
  text-wrap: balance;
}

a {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
a:hover { text-decoration: underline; }
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

code, pre {
  font-family: var(--font-mono);
  font-variant-ligatures: none;
}

code {
  font-size: 0.86em;
  color: var(--fg);
  background: var(--bg-code);
  border-radius: 4px;
  padding: 0.12em 0.34em;
  white-space: nowrap;
}

pre code {
  background: none;
  padding: 0;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ── 容器 ───────────────────────────────────────────────── */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 2.5rem);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: var(--s4);
  padding: 0.5rem 0.85rem;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  z-index: 20;
}
.skip-link:focus { left: var(--s4); }

/* ── 头部 ───────────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  min-height: 56px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--fg);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  background: var(--fg);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.6vw, 1.75rem);
  font-size: 0.875rem;
}
.nav a {
  color: var(--fg-muted);
  transition: color 0.12s ease;
}
.nav a:hover { color: var(--fg); text-decoration: none; }
.nav .nav-ext { color: var(--fg-secondary); font-weight: 500; }

@media (max-width: 640px) {
  .nav a:not(.nav-ext) { display: none; }
}

/* ── 首屏：宽屏两栏（文案 + 安装） ───────────────────────── */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  align-items: center;
  gap: clamp(1.75rem, 4vw, 3.25rem);
  padding-block: clamp(2.75rem, 6vw, 4.25rem) clamp(2rem, 4vw, 3rem);
}

@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; gap: var(--s5); }
}

.hero h1 {
  font-size: clamp(2.15rem, 1.6rem + 2.4vw, 3.1rem);
  font-weight: 680;
  line-height: 1.08;
  letter-spacing: -0.032em;
  margin-bottom: var(--s3);
}

.lede {
  margin: 0 0 var(--s5);
  max-width: 44ch;
  color: var(--fg-secondary);
  font-size: 1.02rem;
  line-height: 1.65;
  text-wrap: pretty;
}

.spec-list {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.9;
  color: var(--fg-muted);
  font-variant-numeric: normal;
}
.spec-list span { margin-inline: 0.5rem; color: var(--line-strong); }

/* ── 代码块 ─────────────────────────────────────────────── */

.code {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-subtle);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(16, 20, 24, 0.04);
}

@media (prefers-color-scheme: dark) {
  .code { box-shadow: none; }
}

.row {
  padding: 0.7rem 0.85rem 0.8rem 0.95rem;
  transition: background 0.12s ease;
}
.row + .row { border-top: 1px solid var(--line); }
.row:hover { background: var(--bg-hover); }

.row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  margin-bottom: 0.35rem;
}

.os {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-muted);
  white-space: nowrap;
}

.row .cmd {
  display: block;
  background: none;
  border-radius: 0;
  padding: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--fg);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  padding: 0.45rem 0.6rem 0.45rem 0.95rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg-code);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.code pre { margin: 0; padding: 0.9rem 1rem; }

/* 终端块：提示符与输出分离，输出用次级色，符号保留语义色 */
.terminal .p { color: var(--fg-muted); user-select: none; }
.terminal .out { color: var(--fg-muted); }
.terminal .ok { color: var(--ok); }

.copy {
  appearance: none;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--fg-muted);
  font-family: var(--font-sans);
  font-size: 11.5px;
  line-height: 1.5;
  padding: 0.12rem 0.5rem;
  cursor: pointer;
  transition: color 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}
.copy:hover {
  color: var(--fg);
  border-color: var(--fg-muted);
  background: var(--bg-hover);
}
.copy[data-done="true"] { color: var(--ok); border-color: var(--ok); }

.note {
  margin: var(--s3) 0 0;
  color: var(--fg-muted);
  font-size: 0.85rem;
  line-height: 1.65;
  text-wrap: pretty;
}

/* ── 区块 ───────────────────────────────────────────────── */

section.container + section.container {
  margin-top: clamp(2.25rem, 4.5vw, 3.25rem);
  padding-top: clamp(1.9rem, 4vw, 2.75rem);
  border-top: 1px solid var(--line);
}

h2 {
  position: relative;
  margin-bottom: var(--s4);
  font-size: 1.0625rem;
  font-weight: 650;
  letter-spacing: -0.008em;
}
h2::before {
  content: "";
  position: absolute;
  left: -0.9rem;
  top: 0.16em;
  bottom: 0.16em;
  width: 2px;
  border-radius: 1px;
  background: var(--accent);
  opacity: 0.75;
}

.prose {
  margin: 0 0 var(--s4);
  max-width: var(--prose);
  color: var(--fg-secondary);
  font-size: 0.95rem;
  text-wrap: pretty;
}

/* ── 说明列表 ───────────────────────────────────────────── */

.facts { margin: var(--s5) 0 0; }

.facts > div {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  gap: 0.3rem var(--s4);
  padding: 0.6rem 0;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
}
.facts > div:first-child { border-top: 0; padding-top: 0; }

.facts dt {
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding-top: 0.28rem;
}
.facts dd {
  margin: 0;
  color: var(--fg-secondary);
  line-height: 1.65;
  text-wrap: pretty;
}
.facts dd code { color: var(--fg); }

@media (max-width: 560px) {
  .facts > div { grid-template-columns: 1fr; gap: 0.1rem; }
  .facts dt { padding-top: 0; }
  /* 窄屏留白有限，竖线会贴边：只保留字号与间距建立的层级 */
  h2::before { display: none; }
}

/* ── 表格 ───────────────────────────────────────────────── */

.table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow-x: auto;
  padding-bottom: 2px;
  box-shadow: 0 1px 2px rgba(16, 20, 24, 0.04);
}

@media (prefers-color-scheme: dark) {
  .table-wrap { box-shadow: none; }
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

thead th {
  text-align: left;
  padding: 0.55rem 1rem;
  border-bottom: 1px solid var(--line-strong);
  background: var(--bg-subtle);
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

tbody td {
  padding: 0.55rem 1rem;
  border-top: 1px solid var(--line);
  vertical-align: top;
  color: var(--fg-secondary);
}
tbody tr:first-child td { border-top: 0; }
tbody tr { transition: background 0.12s ease; }
tbody tr:hover { background: var(--bg-hover); }
tbody td:first-child { white-space: nowrap; }
tbody td:first-child code { color: var(--fg); }

/* ── 页脚 ───────────────────────────────────────────────── */

.site-footer {
  margin-top: clamp(2.5rem, 5vw, 3.75rem);
  border-top: 1px solid var(--line);
  padding-block: var(--s5);
  font-size: 0.82rem;
  color: var(--fg-muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2) var(--s5);
}
.footer-inner p { margin: 0; }

.footer-links { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; }
.footer-links a { color: var(--fg-muted); }
.footer-links a:hover { color: var(--fg); }

.footer-legal { color: var(--fg-muted); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
