@charset "utf-8";
/* 用途：设计令牌（契约 §3，全站只读）/ 重置 / 排版层级 / 占位块 / 按钮 / 进度条 / 自定义光标 /
   加载页 / Toast / 入场动画 / 通用工具类。对应契约 §3、§7。 */

/* ============ 1. 设计令牌 ============ */
:root {
  --bg: #0a0b0d;      --bg-1: #0f1113;    --panel: #14171a;     --panel-2: #191d21;
  --line: #242a31;    --line-soft: #1a1f24;
  --text: #e9ebee;    --text-2: #a7afb8;  --text-3: #6d7681;
  --accent: #c9b189;  --accent-2: #8aa8c0;
  --wall: #f3f1ec;    --wall-ink: #1b1c1e; --wall-line: #ddd8cf;
  --radius: 10px;     --radius-sm: 6px;
  --ease: cubic-bezier(.22,.61,.36,1);
  --dur: .45s;        --dur-fast: .22s;
  --nav-h: 64px;      --maxw: 1240px;
  --font-sans: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", Consolas, "Courier New", monospace;
  --gutter: clamp(18px, 4vw, 56px);
  --overlay-1: rgba(255, 255, 255, .03);
  --overlay-2: rgba(255, 255, 255, .06);
}

/* ============ 2. 重置 ============ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body[data-pf-ready="1"] { cursor: auto; }
h1, h2, h3, h4, p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg, video, canvas { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
hr { border: 0; border-top: 1px solid var(--line); margin: 0; }
::selection { background: var(--accent); color: var(--bg); }

/* 焦点可见性：任何情况下键盘用户都能看到焦点（自定义光标不参与这里） */
:focus-visible { outline: 1px solid var(--accent-2); outline-offset: 2px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 1px solid var(--accent-2); outline-offset: 1px; }

/* 滚动条（克制：细线） */
html { scrollbar-color: var(--line) transparent; scrollbar-width: thin; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--line); border: 3px solid var(--bg); border-radius: 99px; }

/* ============ 3. 排版层级 ============ */
h1, .pf-h1 { font-size: clamp(38px, 7vw, 92px); font-weight: 500; line-height: 1.06; letter-spacing: .01em; }
h2, .pf-h2 { font-size: clamp(24px, 3.4vw, 38px); font-weight: 500; line-height: 1.2; letter-spacing: .01em; }
h3, .pf-h3 { font-size: clamp(18px, 2vw, 22px); font-weight: 500; line-height: 1.3; }
h4, .pf-h4 { font-size: 16px; font-weight: 500; line-height: 1.4; }
.pf-lead { font-size: 16px; line-height: 1.9; color: var(--text-2); }
.pf-body { font-size: 14.5px; line-height: 1.95; color: var(--text-2); }
.pf-small { font-size: 12.5px; line-height: 1.7; color: var(--text-3); }
.pf-mono, .pf-label { font-family: var(--font-mono); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--text-3); }
.pf-eyebrow { font-family: var(--font-mono); font-size: 11px; letter-spacing: .26em; text-transform: uppercase; color: var(--text-3); }

/* ============ 4. 通用工具类 ============ */
.pf-wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.pf-hr { height: 1px; background: var(--line-soft); border: 0; }
.pf-hidden { display: none; }
.pf-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; }
.pf-tagline { display: inline-flex; align-items: center; gap: 10px; }
.pf-tagline::before { content: ""; width: 26px; height: 1px; background: var(--line); }

/* ============ 5. 按钮族 ============ */
.pf-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-2);
  font-size: 13px; letter-spacing: .04em; line-height: 1.2;
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}
.pf-btn:hover { color: var(--text); border-color: var(--accent); background: var(--overlay-1); background: color-mix(in srgb, var(--text) 5%, transparent); }
.pf-btn:active { background: var(--overlay-2); }
.pf-btn[disabled], .pf-btn:disabled { opacity: .45; pointer-events: none; }
.pf-btn--primary { color: var(--accent); border-color: var(--accent); }
.pf-btn--primary:hover { color: var(--accent); border-color: var(--accent); background: var(--overlay-1); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.pf-btn--ghost { border-color: transparent; color: var(--text-3); padding: 8px 12px; }
.pf-btn--ghost:hover { color: var(--text); border-color: var(--line); }
.pf-btn--sm { padding: 7px 13px; font-size: 12px; }

/* ============ 6. 滚动进度条 ============ */
.pf-progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 60; pointer-events: none; background: var(--overlay-1); }
.pf-progress__bar { display: block; height: 100%; width: 0; background: var(--accent); transition: width .1s linear; }

/* ============ 7. 自定义光标（仅指针精确设备启用，键盘焦点不受影响） ============ */
.pf-cursor {
  position: fixed; top: 0; left: 0; z-index: 90;
  width: 12px; height: 12px;
  margin: 0;
  border: 1px solid var(--accent); border-radius: 50%;
  background: transparent;
  opacity: 0; pointer-events: none;
  transform: translate(var(--cx, 0px), var(--cy, 0px)) translate(-50%, -50%);
  transition: width var(--dur-fast) var(--ease), height var(--dur-fast) var(--ease), opacity var(--dur-fast) linear, background-color var(--dur-fast) linear, border-radius var(--dur-fast) var(--ease);
  will-change: transform;
}
.pf-cursor[data-active="1"] { opacity: .55; }
.pf-cursor[data-hover="1"] { width: 34px; height: 34px; opacity: .8; background: var(--overlay-1); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.pf-cursor[data-label="1"] { width: auto; min-width: 58px; height: 22px; padding: 0 10px; border-radius: 99px; background: var(--bg-1); opacity: 1; }
.pf-cursor__label { display: block; text-align: center; font-family: var(--font-mono); font-size: 10px; line-height: 20px; letter-spacing: .08em; color: var(--accent); white-space: nowrap; }
html.pf-cursor-on, html.pf-cursor-on body { cursor: none; }
html.pf-cursor-on a, html.pf-cursor-on button { cursor: none; }
html.pf-cursor-on input, html.pf-cursor-on select, html.pf-cursor-on textarea { cursor: auto; }

/* ============ 8. 加载页 ============ */
.pf-loader {
  position: fixed; inset: 0; z-index: 80;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px;
  background: var(--bg);
  transition: opacity var(--dur) var(--ease), visibility var(--dur) linear;
}
.pf-loader[data-state="done"] { opacity: 0; visibility: hidden; pointer-events: none; }
.pf-loader__mark { width: 30px; height: 30px; border: 1px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: pf-spin 1.15s linear infinite; }
.pf-loader__text { margin: 0; font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .2em; color: var(--text-3); text-align: center; max-width: 30ch; line-height: 1.9; }
@keyframes pf-spin { to { transform: rotate(360deg); } }

/* ============ 9. Toast ============ */
.pf-toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 95; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; width: min(92vw, 460px); }
.pf-toast__item {
  max-width: 100%; padding: 9px 16px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--panel); color: var(--text-2);
  font-size: 12.5px; line-height: 1.6; text-align: center;
  transition: opacity var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
  animation: pf-toast-in var(--dur) var(--ease) both;
}
.pf-toast__item--warn { border-color: var(--accent); color: var(--text); }
.pf-toast__item[data-leaving="1"] { opacity: 0; transform: translateY(6px); }
@keyframes pf-toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ============ 10. 页内提示条（file:// 兜底等） ============ */
.pf-notice {
  position: fixed; left: 16px; bottom: 16px; z-index: 70; max-width: min(88vw, 380px);
  padding: 12px 14px; border: 1px solid var(--line); border-left-color: var(--accent);
  border-radius: var(--radius-sm); background: var(--panel); color: var(--text-2);
  font-size: 12px; line-height: 1.75;
}

/* ============ 11. 占位块（契约 §7，全站复用） ============ */
.pf-ph {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  width: 100%; min-height: 140px; padding: 20px 16px;
  border: 1px dashed var(--line); border-radius: var(--radius);
  background: var(--overlay-1); background: color-mix(in srgb, var(--text) 2%, transparent);
  color: var(--text-3); text-align: center;
}
.pf-ph--fill { height: 100%; min-height: 100%; }
.pf-ph__plus { font-size: 17px; line-height: 1; color: var(--accent); }
.pf-ph__label { font-size: 12.5px; letter-spacing: .1em; color: var(--text-2); }
.pf-ph__path { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); word-break: break-all; max-width: 100%; }
.pf-ph__hint { font-family: var(--font-mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); opacity: .8; }

/* ============ 12. 入场动画（淡入上浮，只播一次） ============ */
[data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease); }
[data-reveal].is-in { opacity: 1; transform: none; }

/* ============ 13. 降低动效偏好 ============ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  .pf-loader__mark { animation: none; }
  .pf-toast__item { animation: none; }
  .pf-progress__bar { transition: none; }
  .pf-cursor { transition: none; }
}
