/* ===== 全站共享样式：设计令牌 + 基础重置 + 导航 + 滚动进场 + 加载小窗 + 微信提示条 =====
   令牌与公共组件集中在此，各页仅保留各自的布局样式，
   避免跨页跳色、重复维护，以及无 JS 时的白屏问题。 */

/* ===== 全站设计令牌（唯一来源） ===== */
:root {
  --bg: #111110;
  --ink: #FBFAF7;
  --body-c: #DDDACF;
  --muted: #B9B5AC;
  --dim: #B9B5AC;
  --accent: #FF6A1F;
  --line: rgba(255, 255, 255, 0.16);
  --font-en: "Space Grotesk", sans-serif;
  --font-cn: "PingFang SC", "Microsoft YaHei", sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --pad: clamp(20px, 4vw, 64px);
}

/* ===== 基础重置 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--font-cn); font-weight: 400;
  overflow-x: hidden; -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent); color: var(--bg); }
a { color: inherit; text-decoration: none; }
img { display: block; }

/* ===== 键盘焦点可见 ===== */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }

/* ===== 噪点纹理层（置于导航之下，参数全站统一） ===== */
.noise {
  position: fixed; inset: 0; z-index: 9; pointer-events: none; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ===== 内页顶部导航（顶部暗色渐变，保证任何背景下文字可读） ===== */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px var(--pad);
  background: linear-gradient(to bottom, rgba(17, 17, 16, 0.92), rgba(17, 17, 16, 0));
}
.hd-left, .hd-right { display: flex; align-items: center; gap: 14px; }
.avatar-link {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line); display: flex; align-items: center; justify-content: center;
  transition: border-color 0.4s;
}
.avatar-link svg { display: block; }
.avatar-link:hover { border-color: var(--accent); }
.hd-cv, .hd-back {
  font-size: 12px; font-weight: 500; letter-spacing: 0.14em; color: var(--ink);
  border: 1px solid var(--line); border-radius: 999px; padding: 9px 18px;
  transition: border-color 0.4s, color 0.4s;
}
.hd-back { display: inline-flex; align-items: center; gap: 8px; }
.hd-cv:hover, .hd-back:hover { border-color: var(--accent); color: var(--accent); }

/* ===== 滚动进场（默认可见；仅有 JS 时才隐藏，杜绝无 JS 白屏） ===== */
.reveal { transition: opacity 1s var(--ease-out), transform 1s var(--ease-out); }
html.js .reveal { opacity: 0; transform: translateY(36px); }
html.js .reveal.in { opacity: 1; transform: translateY(0); }

/* ===== 降低动效偏好 ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}

/* ===== 加载小窗：仅首次来访显示（html.seen/warm 时隐藏），主题与整站一致 ===== */
#page-loader {
  position: fixed; inset: 0; z-index: 1200;
  display: flex; align-items: center; justify-content: center;
  background: #111110; opacity: 1; transition: opacity .4s ease;
}
#page-loader.done { opacity: 0; pointer-events: none; }
html.seen #page-loader, html.warm #page-loader { display: none; }

.pl-card {
  min-width: 96px; padding: 19px 18px 15px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 10px; background: #1A1A18;
}
.pl-tree { width: 40px; height: 40px; display: block; transform-origin: 24px 37px; animation: pl-sway 1.6s ease-in-out infinite; }
@keyframes pl-sway { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
.pl-dots { display: flex; gap: 5px; }
.pl-dots i { width: 4px; height: 4px; border-radius: 50%; background: #FF6A1F; opacity: .2; animation: pl-pulse 1.2s ease-in-out infinite; }
.pl-dots i:nth-child(2) { animation-delay: .2s; }
.pl-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes pl-pulse { 0%, 100% { opacity: .2; } 50% { opacity: .95; } }

/* 微信内置浏览器提示条 */
.wx-tip {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1300;
  display: flex; justify-content: center; align-items: center; gap: 10px;
  padding: 10px 16px; font-size: 13px; letter-spacing: .04em;
  background: #1A1A18; color: #DDDACF; border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}
.wx-tip .wx-dots { color: #FF6A1F; font-weight: 700; letter-spacing: .1em; }
.wx-tip .wx-x {
  border: 1px solid rgba(255, 255, 255, 0.16); background: none; color: #ABA69B;
  border-radius: 999px; padding: 3px 10px; font-size: 11px; cursor: pointer;
}
body.wx-tip-on .site-nav, body.wx-tip-on .hero-nav { top: 40px; }

@media (prefers-reduced-motion: reduce) {
  .pl-tree, .pl-dots i { animation: none; }
  .pl-dots i { opacity: .6; }
  #page-loader { transition: none; }
}
