/* ===== 阿Z在折腾 个人主页 · Frontend Design Pro 规范打磨版 =====
   设计语言：编辑式极简 · 暖纸底 / 暖墨黑 / 陶土橘强调
   规范遵循：OKLCH 色彩 · 4px 间距体系 · cubic-bezier(0.16,1,0.3,1) 缓动 · 可见 focus · 尊重 reduced-motion
   偏离声明：不引 Google Fonts（国内备案核查不稳），改用系统中文黑体 + 系统中文衬线点缀，零外部依赖
*/

:root {
  /* —— 色彩（OKLCH 定义，中性色均带暖色调，无纯黑纯灰）—— */
  --paper: #f7f5f0;                       /* 暖纸底 */
  --surface: #ffffff;
  --ink: #1b1a17;                         /* 暖近黑，非纯黑 */
  --ink-2: #4f4a43;
  --muted: #6f695d;                       /* 暖灰，带色调 */
  --line: #e7e2d6;                        /* 暖边线 */
  --accent: oklch(0.58 0.17 37);          /* 陶土橘 */
  --accent-strong: oklch(0.52 0.17 37);   /* hover 加深 */
  --accent-soft: #f3e7e0;                 /* 浅橘底 */
  --cool: oklch(0.52 0.06 185);           /* 仅 Hero 图形用的冷调点缀 */

  /* —— 4px 基础间距体系 —— */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px; --s-10: 128px;

  /* —— 圆角 / 阴影 / 缓动 —— */
  --radius: 14px;
  --radius-lg: 22px;
  --shadow: 0 1px 2px rgba(27,26,23,0.04), 0 12px 32px rgba(27,26,23,0.06);
  --shadow-hover: 0 2px 4px rgba(27,26,23,0.05), 0 20px 48px rgba(200,80,46,0.14);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  --font-serif: "Songti SC", "STSong", "SimSun", "Noto Serif SC", serif; /* 编辑式点缀，系统自带 */

  --maxw: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.8;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
em { font-style: normal; color: var(--accent); font-weight: 600; }

/* 可见 focus（键盘可达性） */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: var(--s-3) var(--s-4);
  border-radius: 0 0 10px 0;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* ===== 顶栏 ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--s-4) var(--s-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav__brand { font-size: 22px; font-weight: 800; letter-spacing: 0.5px; }
.nav__brand-accent { color: var(--accent); }
.nav__links { display: flex; gap: var(--s-7); }
.nav__links a {
  position: relative;
  color: var(--ink-2);
  font-size: 15px;
  padding: var(--s-1) 0;
  transition: color 0.16s var(--ease);
}
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.2s var(--ease);
}
.nav__links a:hover { color: var(--ink); }
.nav__links a:hover::after { width: 100%; }

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: var(--s-2);
  background: none;
  border: 0;
  cursor: pointer;
  padding: var(--s-2);
}
.nav__toggle span {
  width: 22px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.25s var(--ease), opacity 0.25s var(--ease);
}
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== Hero ===== */
.hero {
  padding: clamp(var(--s-8), 11vw, 132px) var(--s-6) clamp(var(--s-7), 9vw, 104px);
  background:
    radial-gradient(820px 360px at 88% -8%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 60%),
    radial-gradient(620px 320px at -4% 8%, color-mix(in srgb, var(--cool) 8%, transparent), transparent 55%);
}
.hero__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: var(--s-7);
  align-items: center;
}
.hero__eyebrow {
  margin: 0 0 var(--s-4);
  font-size: 13px;
  letter-spacing: 0.18em;
  color: var(--muted);
  font-weight: 600;
}
.hero__title {
  margin: 0;
  font-size: clamp(56px, 11vw, 116px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 0.98;
}
.hero__title-accent { color: var(--accent); }
.hero__subtitle {
  margin: var(--s-4) 0 0;
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 600;
  color: var(--ink);
}
.hero__desc {
  max-width: 480px;
  margin: var(--s-5) 0 0;
  color: var(--ink-2);
  font-size: 18px;
}
.hero__actions { margin-top: var(--s-6); display: flex; gap: var(--s-4); flex-wrap: wrap; }

.hero__visual { display: flex; justify-content: center; }
.nodes { width: min(360px, 80%); height: auto; }
.nodes__lines {
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
  animation: draw 0.55s var(--ease) forwards;
}
.nodes__dots circle {
  transform-box: fill-box;
  transform-origin: center;
  animation: pop 0.4s var(--ease) backwards;
}
.nodes__dots circle:nth-child(1) { animation-delay: 0.35s; }
.nodes__dots circle:nth-child(2) { animation-delay: 0.42s; }
.nodes__dots circle:nth-child(3) { animation-delay: 0.49s; }
.nodes__dots circle:nth-child(4) { animation-delay: 0.56s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop { from { transform: scale(0); } to { transform: scale(1); } }

/* ===== 按钮 ===== */
.btn {
  display: inline-block;
  padding: var(--s-3) var(--s-6);
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  transition: transform 0.16s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease), color 0.2s var(--ease);
}
.btn--primary { background: var(--accent); color: #fff; box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 22%, transparent); }
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 16px 34px color-mix(in srgb, var(--accent) 30%, transparent); }
.btn--ghost { border: 1px solid var(--line); color: var(--ink); background: var(--surface); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

/* ===== 通用版块 ===== */
.section { padding: clamp(var(--s-8), 9vw, 112px) var(--s-6); }
.section--alt { background: #f1eee6; }
.section__inner { max-width: var(--maxw); margin: 0 auto; }
.section__kicker {
  margin: 0 0 var(--s-3);
  font-family: var(--font-serif);          /* 编辑式衬线点缀 */
  font-size: 15px;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-weight: 600;
}
.section__title {
  font-size: clamp(28px, 4.4vw, 44px);
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 var(--s-4);
}
.section__lead { color: var(--ink-2); margin: 0 0 var(--s-7); max-width: 560px; }

/* ===== 关于 ===== */
.about {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--s-7);
  align-items: start;
}
.about__media { position: relative; }
.about__avatar {
  width: 200px;
  height: 200px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.about__lead { font-size: 20px; line-height: 1.7; margin: 0 0 var(--s-4); }
.about__body p { margin: 0 0 var(--s-4); color: var(--ink-2); }
.tags { list-style: none; padding: 0; margin: var(--s-6) 0 0; display: flex; flex-wrap: wrap; gap: var(--s-3); }
.tags li {
  font-size: 13px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  padding: var(--s-2) var(--s-4);
  border-radius: 999px;
}

/* ===== 作品截图网格 ===== */
.works-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-5);
}
.work {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
}
.work:hover { transform: translateY(-6px); box-shadow: var(--shadow-hover); border-color: transparent; }
.work__media {
  margin: 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--accent-soft);
}
.work__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s var(--ease);
}
.work:hover .work__media img { transform: scale(1.04); }
.work__body {
  position: relative;
  padding: var(--s-5) var(--s-6) var(--s-6);
}
.work__body::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  height: 3px;
  width: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.28s var(--ease);
}
.work:hover .work__body::before { transform: scaleX(1); }
.work__no {
  display: block;
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: var(--s-2);
  transition: color 0.2s var(--ease);
}
.work:hover .work__no { color: var(--accent); }
.work__title { margin: 0 0 var(--s-2); font-size: 19px; font-weight: 700; }
.work__desc { margin: 0; color: var(--ink-2); font-size: 14px; }

/* ===== 联系 ===== */
.contact {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 320px));
  gap: var(--s-4);
}
.contact li {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--s-4) var(--s-5);
  box-shadow: var(--shadow);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.contact li:hover { border-color: var(--accent); transform: translateY(-2px); }
.contact a:hover { color: var(--accent); }
.contact__label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  background: var(--ink);
  padding: var(--s-1) var(--s-3);
  border-radius: 999px;
  flex: 0 0 auto;
}

/* ===== 页脚 + 备案 ===== */
.footer {
  background: #efece4;
  border-top: 1px solid var(--line);
  padding: var(--s-7) var(--s-6);
  text-align: center;
}
.footer__inner { max-width: var(--maxw); margin: 0 auto; }
.beian { margin: var(--s-1) 0; font-size: 13px; color: var(--muted); }
.beian a { color: var(--muted); }
.beian a:hover { color: var(--accent); }
.beian__icon { vertical-align: -3px; margin-right: var(--s-1); }
.footer__copy { margin: var(--s-4) 0 0; font-size: 13px; color: var(--muted); }

/* ===== 回到顶部 ===== */
.to-top {
  position: fixed;
  right: var(--s-6);
  bottom: var(--s-6);
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  box-shadow: var(--shadow-hover);
  opacity: 0;
  transition: opacity 0.25s var(--ease), transform 0.2s var(--ease), background 0.2s var(--ease);
  z-index: 60;
}
.to-top[hidden] { display: none; }
.to-top.show { opacity: 1; }
.to-top:hover { transform: translateY(-3px); background: var(--accent); }

/* ===== 滚动渐入（≤500ms，符合规范）===== */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ===== 响应式 ===== */
@media (max-width: 880px) {
  .hero__inner { grid-template-columns: 1fr; gap: var(--s-6); }
  .hero__visual { order: -1; }
  .nodes { width: min(280px, 70%); }
  .works-grid { grid-template-columns: repeat(2, 1fr); }
  .about { grid-template-columns: 1fr; gap: var(--s-6); }
  .about__avatar { width: 160px; height: 160px; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .nav__toggle { display: flex; }
  .nav__links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s var(--ease);
  }
  .nav__links.open { max-height: 240px; }
  .nav__links a { padding: 15px var(--s-6); border-top: 1px solid var(--line); }
  .works-grid { grid-template-columns: 1fr; }
  .contact { grid-template-columns: 1fr; }
}

/* ===== 动效偏好 ===== */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
