/* ===== 变量与重置 ===== */
:root {
  --bg: #ECECEC;
  --ink: #111;
  --pink: #FF5FA8;
  --blue: #4D7DFE;
  --cream: #F3EBDD;
  --card: #FFFFFF;
  --border: 3px solid var(--ink);
  --shadow-lg: 6px 6px 0 var(--ink);
  --shadow-sm: 4px 4px 0 var(--ink);
  --radius-card: 24px;
  --radius-pill: 999px;
  --mono: ui-monospace, "Courier New", monospace;
  /* 丝滑慢缓动：expo-out，长减速尾，无回弹 */
  --ease-silk: cubic-bezier(.16, 1, .3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  line-height: 1.6;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* 保证 hidden 属性始终生效（防止自定义 display 覆盖） */
[hidden] { display: none !important; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
section { scroll-margin-top: 110px; }

/* ===== 吸顶胶囊导航 ===== */
.nav-wrap {
  position: sticky; top: 16px; z-index: 100;
  display: flex; justify-content: center; padding: 0 16px;
}
.nav {
  display: flex; align-items: center; gap: 4px;
  background: var(--card); border: var(--border); border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm); padding: 8px 14px;
  max-width: 100%; overflow-x: auto;
}
.nav-logo, .nav-gh, .nav-mail {
  display: grid; place-items: center; width: 34px; height: 34px; flex: none;
  border: 2px solid var(--ink); border-radius: 10px; font-weight: 900;
}
.nav-logo { background: var(--pink); }
.nav-gh { background: var(--cream); }
.nav-mail { background: var(--blue); }
.nav-link {
  padding: 6px 14px; border: 2px solid transparent; border-radius: 12px;
  font-weight: 700; white-space: nowrap;
}
.nav-link.is-active { border-color: var(--ink); background: #fff; box-shadow: 2px 2px 0 var(--ink); }

/* ===== 首屏 ===== */
.hero {
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px;
  align-items: center; padding: 72px 24px 88px;
}
.hero h1 {
  font-size: clamp(2.1rem, 5vw, 3.4rem); font-weight: 900;
  line-height: 1.35; text-shadow: 4px 4px 0 #d2d2d2;
}
.hl {
  display: inline-block; padding: .05em .25em;
  border: var(--border); box-shadow: var(--shadow-sm); text-shadow: none;
}
.hl-pink { background: var(--pink); }
.hl-blue { background: var(--blue); color: #fff; }
.hero-sub { margin-top: 28px; font-family: var(--mono); font-size: .92rem; line-height: 1.9; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 28px;
  background: var(--ink); color: #fff; border: var(--border);
  border-radius: var(--radius-pill); padding: 12px 26px;
  font-weight: 700; box-shadow: 4px 4px 0 #c6c6c6; cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 #c6c6c6; }

.avatar-card {
  background: var(--cream); border: var(--border); border-radius: var(--radius-card);
  box-shadow: var(--shadow-lg); padding: 18px; aspect-ratio: 1 / 1;
}
.avatar-card img { width: 100%; height: 100%; object-fit: cover; border-radius: 14px; }
.avatar-fallback {
  height: 100%; display: flex; flex-direction: column; gap: 8px;
  align-items: center; justify-content: center;
  font-family: var(--mono); font-weight: 700;
}
.avatar-fallback-face { font-size: 2.5rem; }

/* ===== 通用区块与卡片 ===== */
.section { padding: 40px 0 72px; }
.section h2 { display: inline-block; font-size: 1.9rem; font-weight: 900; margin-bottom: 28px; }

.grid { display: grid; gap: 28px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--card); border: var(--border); border-radius: var(--radius-card);
  box-shadow: var(--shadow-lg); padding: 26px;
  transition: transform .12s ease, box-shadow .12s ease;
}
.card:hover { transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--ink); }
.card h3 { font-size: 1.15rem; font-weight: 900; margin-bottom: 10px; }
.card .meta { font-family: var(--mono); font-size: .8rem; opacity: .65; margin-bottom: 10px; }
.card p { font-size: .95rem; }

.btn-mini {
  display: inline-block; margin-top: 16px; padding: 6px 16px;
  border: 2px solid var(--ink); border-radius: var(--radius-pill);
  background: var(--pink); font-weight: 700; font-size: .85rem;
  box-shadow: 3px 3px 0 var(--ink); transition: transform .12s ease, box-shadow .12s ease;
}
.btn-mini:hover { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }

/* ===== 标签云 ===== */
.tags { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.tag {
  padding: 4px 14px; border: 2px solid var(--ink); border-radius: var(--radius-pill);
  background: #fff; box-shadow: 2px 2px 0 var(--ink); font-size: .85rem; font-weight: 700;
}
.tag--pink { background: var(--pink); }
.tag--blue { background: var(--blue); color: #fff; }

/* ===== 滚动浮现（区块触发、卡内 stagger；用 animation 实现，不与 hover 的 transition 冲突） ===== */
.js .reveal { opacity: 0; }
.js .reveal.is-in {
  opacity: 1;
  animation: rise .95s var(--ease-silk) var(--d, 0s) both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(64px) scale(.96); }
  to   { opacity: 1; transform: none; }
}

/* 视差元素：仅 transform 由 JS 驱动，提升合成层 */
[data-parallax] { will-change: transform; }

/* ===== 页脚 ===== */
footer {
  border-top: var(--border); margin-top: 40px; padding: 44px 24px 56px;
  text-align: center; font-family: var(--mono); font-size: .9rem; line-height: 2;
}

/* ===== 响应式 ===== */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; gap: 40px; padding-top: 48px; }
  .hero-avatar { width: 100%; max-width: 420px; margin-inline: auto; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; animation: none; }
  [data-parallax] { transform: none !important; will-change: auto; }
}
