/* SXYZ 主站 — 设计 token 与签名元素参照 u.sb design.md（refs/design-from-u[dot]sb.md） */

@font-face {
  font-family: "Space Grotesk";
  src: url("../fonts/space-grotesk-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("../fonts/space-grotesk-latin-500-normal.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("../fonts/space-grotesk-latin-700-normal.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}

:root {
  --background: #f5f5f5;
  --foreground: #0c0a09;
  --card: #ffffff;
  --secondary: #f0efed;
  --tile: #f0efed;
  --content: #3f3d3a;
  --muted-foreground: #777169;
  --border: #e7e5e4;
  --hairline-strong: #d6d3d1;
  --primary: #292524;
  --primary-hover: #0c0a09;
  --primary-label: #fafaf9;
  --sparkle: #a8a29e;
  --hover-accent: #0c0a09;
  --radius-card: 16px;
  --radius-panel: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 2px 8px rgb(12 10 9 / 0.04);
  --shadow-md: 0 4px 16px rgb(12 10 9 / 0.06);
  --shadow-lg: 0 8px 32px rgb(12 10 9 / 0.08);
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --font-sans: "Space Grotesk", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", "Noto Sans SC", system-ui, sans-serif;
  --link-underline: #777169;
  color-scheme: light;
}

[data-theme="dark"] {
  --background: #0c0a09;
  --foreground: #f5f5f4;
  --card: #231d18;
  --secondary: #292524;
  --tile: #171412;
  --content: #d6d3d1;
  --muted-foreground: #a8a29e;
  --border: #2a2624;
  --hairline-strong: #44403c;
  --primary: #f5f5f4;
  --primary-hover: #ffffff;
  --primary-label: #0c0a09;
  --sparkle: #ffcc00;
  --hover-accent: #ffcc00;
  --shadow-sm: 0 2px 8px rgb(0 0 0 / 0.45);
  --shadow-md: 0 4px 16px rgb(0 0 0 / 0.5);
  --shadow-lg: 0 8px 32px rgb(0 0 0 / 0.55);
  --link-underline: #ffcc00;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background: var(--background);
  color: var(--content);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}

/* ---------- 顶栏 ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 18px clamp(20px, 4vw, 40px);
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 9999px;
  background: transparent;
  color: var(--muted-foreground);
  font-size: 1.15rem;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}
.icon-btn:hover { background: var(--secondary); color: var(--foreground); }

[data-theme="light"] .icon-btn .ri-sun-line { display: none; }
[data-theme="dark"] .icon-btn .ri-moon-line { display: none; }

/* ---------- 主体 ---------- */

.wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
  padding: 12px 20px 36px;
}

.hero { position: relative; text-align: center; }

.title {
  position: relative;
  margin: 0 0 22px;
  color: var(--foreground);
  font-size: clamp(1.6rem, 2.8vw, 2.3rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.35;
}

/* 标题里的站名链接：悬停下划线从左侧滑入（与入口胶囊同一套链接语言） */

.title-link {
  display: inline-block;
  position: relative;
  color: var(--foreground);
  text-decoration: none;
}
.title-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.08em;
  height: 2px;
  border-radius: 1px;
  background: var(--link-underline);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}
.title-link:hover::after,
.title-link:focus-visible::after { transform: scaleX(1); }

/* 星光点缀（签名元素） */

.sparkles {
  position: absolute;
  inset: -26px -64px -30px;
  pointer-events: none;
}

.spark {
  position: absolute;
  fill: var(--sparkle);
  opacity: 0.5;
  animation: twinkle 4s var(--ease) infinite;
}

.s1 { width: 15px; top: 2%;  left: 7%;   animation-duration: 5.4s; animation-delay: 0s; }
.s2 { width: 10px; top: -4%; right: 9%;  animation-duration: 4.2s; animation-delay: 0.8s; }
.s3 { width: 8px;  bottom: 6%; right: 4%; animation-duration: 6.1s; animation-delay: 1.6s; }
.s4 { width: 9px;  bottom: 0; left: 3%;  animation-duration: 4.8s; animation-delay: 2.4s; }
.s5 { width: 6px;  top: 26%; right: 1%;  animation-duration: 3.6s; animation-delay: 1.1s; }

.dot {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--sparkle);
  opacity: 0.35;
  animation: twinkle 5s var(--ease) infinite;
}
.d1 { top: 18%; left: 1%;   animation-delay: 0.5s; }
.d2 { bottom: 22%; right: 12%; animation-delay: 1.9s; }
.d3 { top: 0;  right: 26%;  animation-delay: 3.1s; }

@keyframes twinkle {
  0%, 100% { opacity: 0.12; transform: scale(0.72) rotate(0deg); }
  50%      { opacity: 0.95; transform: scale(1) rotate(16deg); }
}

/* ---------- 入口胶囊 ---------- */

.links {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 24px;
  border: 1px solid var(--hairline-strong);
  border-radius: 9999px;
  color: var(--foreground);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease),
              transform 0.2s var(--ease), color 0.2s var(--ease);
}
.pill i {
  color: var(--muted-foreground);
  font-size: 1.2rem;
  line-height: 1;
  transition: color 0.2s var(--ease);
}
.pill:hover {
  background: var(--secondary);
  border-color: var(--foreground);
  transform: translateY(-1px);
}
.pill:hover i { color: var(--hover-accent); }

.pill-label {
  position: relative;
  overflow: hidden;
}
.pill-label::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.1em;
  height: 1.5px;
  border-radius: 1px;
  background: var(--link-underline);
  transform: translateX(-101%);
  transition: transform 0.35s var(--ease);
}
.pill:hover .pill-label::after { transform: translateX(0); }

/* ---------- 联系方式 ---------- */

.contact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 8px;
  margin: 0;
  color: var(--muted-foreground);
  font-size: 0.92rem;
}

.mail {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--foreground);
  font-weight: 500;
  text-decoration: none;
}
.mail i {
  color: var(--hover-accent);
  font-size: 1.25rem;
  line-height: 1;
}

/* 与入口胶囊同一套链接语言：hover 时下划线从左侧滑入 */
.mail-label {
  position: relative;
  overflow: hidden;
}
.mail-label::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.08em;
  height: 1.5px;
  border-radius: 1px;
  background: var(--link-underline);
  transform: translateX(-101%);
  transition: transform 0.35s var(--ease);
}
.mail:hover .mail-label::after,
.mail:focus-visible .mail-label::after { transform: translateX(0); }

/* ---------- 页脚 ---------- */

.foot {
  padding: 0 20px 22px;
  text-align: center;
  color: var(--muted-foreground);
  font-size: 0.82rem;
}
.foot p { margin: 0; }
/* © 图标与相邻数字的视觉中心对齐（3x 渲染实测标定） */
.foot p i { font-size: 1.15em; line-height: 1; vertical-align: -0.025em; }

/* ---------- 响应式与可访问性 ---------- */

@media (max-width: 720px) {
  .sparkles { display: none; }
  .wrap { gap: 26px; }
}

@media (max-width: 400px) {
  .title { font-size: 1.7rem; }
}

@media (prefers-reduced-motion: reduce) {
  .spark, .dot { animation: none; opacity: 0.5; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
