/* ==========================================================================
   main.css — 前台样式（参考 xrbk.cn 清新个人博客风）
   设计语言：干净白底 + 淡网格 · 两栏 Hero · 圆润头像 · 兴趣 bullet ·
            保留轻柔 reveal 动画与粒子点缀，但克制不抢戏
   ========================================================================== */
:root {
  --bg: #fafaf9;
  --bg-soft: #ffffff;
  --bg-soft2: #f5f5f4;
  --ink: #1c1c1e;
  --ink-dim: #5b5b66;
  --line: rgba(28, 28, 30, .08);
  --accent: #ff7a9c;          /* 珊瑚粉 主强调 */
  --accent-2: #6366f1;        /* 靛蓝 */
  --accent-dim: rgba(255, 122, 156, .12);
  /* 柔和彩色板（标签 / 技能 / 光晕） */
  --c-pink: #ff9eb1;
  --c-blue: #9bc1ff;
  --c-green: #9fe6c0;
  --c-yellow: #ffd98a;
  --c-purple: #c8b0f5;
  --serif: "Noto Serif SC", serif;
  --sans: "Noto Sans SC", system-ui, sans-serif;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --glow: rgba(255, 122, 156, .32);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.75;
  overflow-x: hidden;
  /* xrbk 感的极淡网格背景 */
  background-image:
    linear-gradient(rgba(28,28,30,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(28,28,30,.03) 1px, transparent 1px);
  background-size: 56px 56px;
  background-attachment: fixed;
}
::selection { background: var(--accent); color: #fff; }

/* ---- 背景层 ---- */
#particles { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.noise {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='0.8' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
}
main, .nav, .footer { position: relative; z-index: 2; }

/* ---- 导航（xrbk 式干净顶部栏） ---- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: clamp(14px, 2vw, 20px) clamp(20px, 5vw, 64px);
  background: rgba(250, 250, 249, .92);
  border-bottom: 1px solid var(--line);
}
.nav-logo {
  font-family: var(--serif); font-weight: 900; font-size: 1.45rem;
  color: var(--ink); text-decoration: none; letter-spacing: .02em;
  display: inline-flex; align-items: center; gap: 2px;
}
.nav-logo span { color: var(--accent); }
.nav-links { display: flex; gap: clamp(20px, 3vw, 44px); }
.nav-links a {
  color: var(--ink-dim); text-decoration: none; font-size: .9rem;
  letter-spacing: .04em; transition: color .25s;
}
.nav-links a:hover { color: var(--ink); }

/* ---- Hero（xrbk 式两栏） ---- */
.hero {
  min-height: 100svh;
  display: flex; align-items: center;
  padding: clamp(100px, 12vh, 160px) clamp(20px, 6vw, 80px) clamp(60px, 8vh, 120px);
  position: relative;
}
.hero-inner {
  width: 100%; max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: 1.1fr .9fr;
  gap: clamp(36px, 6vw, 80px); align-items: center;
}
.hero-copy { display: flex; flex-direction: column; gap: clamp(18px, 3vh, 28px); }
.hero-eyebrow {
  color: var(--ink-dim); font-size: .84rem; letter-spacing: .18em;
  text-transform: uppercase;
}
.hero-title {
  font-family: var(--serif); font-weight: 900;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1.15; letter-spacing: .02em;
}
.hero-emoji {
  display: inline-block; margin-left: .15em;
  font-size: .85em; font-family: var(--sans);
  animation: wave 2.2s ease-in-out infinite;
  transform-origin: 70% 80%;
}
@keyframes wave {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(18deg); }
  40% { transform: rotate(-8deg); }
  60% { transform: rotate(14deg); }
  80% { transform: rotate(0); }
}
.hero-tagline {
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  color: var(--ink-dim); max-width: 52ch; line-height: 1.7;
}
.hero-interests {
  margin-top: clamp(8px, 1.5vh, 16px);
}
.interests-title {
  font-weight: 600; font-size: .95rem; color: var(--ink);
  margin-bottom: 10px;
}
.hero-interests ul {
  list-style: none; display: flex; flex-direction: column; gap: 8px;
}
.hero-interests li {
  position: relative; padding-left: 18px;
  font-size: .92rem; color: var(--ink-dim); line-height: 1.6;
}
.hero-interests li::before {
  content: ""; position: absolute; left: 0; top: .55em;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
}
.hero-interests li strong { color: var(--ink); font-weight: 600; }
.hero-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
  margin-top: clamp(8px, 2vh, 16px);
}
.hero-blog {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px;
  font-size: .9rem; font-weight: 500; letter-spacing: .02em;
  text-decoration: none; color: #fff; background: var(--ink);
  transition: transform .3s var(--ease-out), background .3s;
}
.hero-blog svg { opacity: .8; }
.hero-blog:hover { transform: translateY(-2px); background: #333; }
.hero-more {
  color: var(--ink-dim); text-decoration: none; font-size: .88rem;
  padding: 10px 16px; border-radius: 999px;
  border: 1px solid var(--line); transition: all .25s;
}
.hero-more:hover { color: var(--ink); border-color: var(--ink); }

/* ---- Hero 头像/插画 ---- */
.hero-visual { display: flex; justify-content: center; align-items: center; }
.hero-portrait {
  width: min(100%, 360px); aspect-ratio: 5/6;
  border-radius: 28px; overflow: hidden;
  border: 2px dashed rgba(28, 28, 30, .16);
  background: linear-gradient(145deg, #ffffff 0%, var(--bg-soft2) 100%);
  box-shadow: 0 28px 70px -28px rgba(28, 28, 30, .12);
  position: relative;
}
.hero-portrait img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.hero-portrait-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; color: var(--ink-dim);
  padding: 24px;
}
.hero-portrait-placeholder svg {
  width: 70%; height: auto; color: var(--ink-dim);
  opacity: .55;
}
.hero-portrait-placeholder p {
  font-size: .8rem; letter-spacing: .05em;
  color: var(--ink-dim);
}

/* ---- 通用 Section ---- */
.section { padding: clamp(72px, 14vh, 160px) clamp(20px, 8vw, 120px); }
.section-head {
  display: flex; align-items: baseline; gap: 18px;
  margin-bottom: clamp(36px, 6vh, 72px);
}
.section-index {
  font-family: var(--serif); color: var(--accent);
  font-size: clamp(.9rem, 1.6vw, 1.15rem); font-weight: 600;
}
.section-head h2 {
  font-family: var(--serif); font-weight: 900;
  font-size: clamp(1.8rem, 4.5vw, 3.2rem);
  position: relative;
}
.section-head h2::after {
  content: ""; position: absolute; left: 0; bottom: -10px;
  width: 48px; height: 3px; border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

/* ---- 简介 ---- */
.about-grid {
  display: grid; grid-template-columns: 1.7fr 1fr;
  gap: clamp(32px, 6vw, 96px); align-items: start;
}
.about-text p {
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  color: var(--ink-dim); margin-bottom: 1.4em; max-width: 62ch;
}
.about-text p:first-child { color: var(--ink); font-weight: 500; }
.about-meta {
  border-left: 1px solid var(--line);
  padding-left: clamp(20px, 3vw, 40px);
  display: flex; flex-direction: column; gap: 22px;
}
.about-avatar {
  width: 110px; height: 110px; border-radius: 50%; overflow: hidden;
  border: 3px solid #fff; box-shadow: 0 0 0 4px var(--accent-dim);
}
.about-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.meta-row { display: flex; flex-direction: column; gap: 2px; }
.meta-row span {
  font-size: .75rem; letter-spacing: .25em; color: var(--ink-dim);
  text-transform: uppercase;
}
.meta-row strong { font-weight: 600; font-size: 1.02rem; }

/* ---- 技能 ---- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: clamp(28px, 4vw, 56px);
}
.skill-category {
  font-family: var(--serif); font-size: 1.1rem; font-weight: 600;
  color: var(--ink); margin-bottom: 20px; letter-spacing: .05em;
}
.skill { margin-bottom: 18px; }
.skill-top {
  display: flex; justify-content: space-between;
  font-size: .92rem; margin-bottom: 7px;
}
.skill-name { font-weight: 500; color: var(--ink); }
.skill-pct { color: var(--ink-dim); font-size: .8rem; }
.skill-bar {
  height: 8px; background: var(--bg-soft2); border-radius: 999px;
  overflow: hidden; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .04);
}
.skill-bar i {
  display: block; height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 1.2s var(--ease-out);
}
.skill-group:nth-child(5n+2) .skill-bar i { background: linear-gradient(90deg, var(--c-blue), var(--c-purple)); }
.skill-group:nth-child(5n+3) .skill-bar i { background: linear-gradient(90deg, var(--c-green), var(--c-yellow)); }
.skill-group:nth-child(5n+4) .skill-bar i { background: linear-gradient(90deg, var(--c-pink), var(--accent)); }
.in-view .skill-bar i { width: var(--w); }

/* ---- 项目 ---- */
.projects { display: flex; flex-direction: column; }
.project {
  --glow: rgba(255, 122, 156, .30);
  display: grid; grid-template-columns: auto 1fr;
  gap: clamp(18px, 4vw, 56px);
  padding: clamp(28px, 4vh, 48px) clamp(18px, 3vw, 32px);
  border: 1px solid var(--line); border-radius: 18px; margin-bottom: 20px;
  background: var(--bg-soft);
  transition: transform .4s var(--ease-out), box-shadow .4s var(--ease-out), border-color .4s var(--ease-out);
}
.project:hover {
  transform: translateY(-6px);
  box-shadow: 0 22px 48px -20px var(--glow);
  border-color: transparent;
}
.project-num {
  font-family: var(--serif); font-weight: 900;
  font-size: clamp(1.6rem, 3.5vw, 2.6rem);
  color: transparent; -webkit-text-stroke: 1px var(--ink-dim);
  line-height: 1;
}
.project:hover .project-num { -webkit-text-stroke-color: var(--accent); }
.project-head {
  display: flex; flex-wrap: wrap; align-items: baseline;
  gap: 8px 20px; margin-bottom: 10px;
}
.project-head h3 {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(1.2rem, 2.4vw, 1.6rem);
}
.project-period { color: var(--ink-dim); font-size: .85rem; letter-spacing: .1em; }
.project-desc { color: var(--ink-dim); max-width: 68ch; margin-bottom: 10px; }
.project-result { color: var(--accent); font-size: .95rem; margin-bottom: 14px; font-weight: 500; }
.project-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-size: .76rem; letter-spacing: .04em; padding: 5px 13px;
  border-radius: 999px; border: 1px solid transparent;
  background: var(--bg-soft2); color: var(--ink-dim);
}
.project-tags .tag:nth-child(4n+1) { background: rgba(255, 158, 177, .16); color: #d65b7c; border-color: rgba(255, 158, 177, .3); }
.project-tags .tag:nth-child(4n+2) { background: rgba(143, 184, 255, .16); color: #3f6fd0; border-color: rgba(143, 184, 255, .32); }
.project-tags .tag:nth-child(4n+3) { background: rgba(159, 230, 192, .20); color: #2f9168; border-color: rgba(159, 230, 192, .36); }
.project-tags .tag:nth-child(4n+4) { background: rgba(194, 168, 240, .18); color: #7a5bc4; border-color: rgba(194, 168, 240, .34); }

/* ---- 项目封面图 ---- */
.project-cover {
  grid-column: 1 / -1; display: block; overflow: hidden;
  border-radius: 14px; border: 1px solid var(--line); margin-bottom: 6px;
}
.project-cover img {
  width: 100%; max-height: 360px; object-fit: cover; display: block;
  transition: transform .6s var(--ease-out);
}
.project-cover:hover img { transform: scale(1.03); }

/* ---- 作品图集 ---- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: clamp(14px, 2vw, 22px);
}
.gallery-item {
  --glow: rgba(194, 168, 240, .45);
  margin: 0; border: 1px solid var(--line); border-radius: 14px;
  overflow: hidden; background: var(--bg-soft);
  transition: border-color .35s var(--ease-out), transform .35s var(--ease-out), box-shadow .35s var(--ease-out);
}
.gallery-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 42px -18px var(--glow);
  border-color: transparent;
}
.gallery-item a { display: block; aspect-ratio: 4 / 3; overflow: hidden; }
.gallery-item img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .6s var(--ease-out);
}
.gallery-item:hover img { transform: scale(1.06); }
.gallery-item figcaption {
  padding: 12px 16px; display: flex; flex-direction: column; gap: 2px;
}
.gallery-item figcaption strong { font-weight: 600; font-size: .98rem; }
.gallery-item figcaption span { color: var(--ink-dim); font-size: .82rem; }

/* ---- 灯箱（点击图片放大预览）---- */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: rgba(40, 38, 46, .86); padding: 5vmin;
  opacity: 0; pointer-events: none; transition: opacity .3s var(--ease-out);
  backdrop-filter: blur(4px);
}
.lightbox.open { opacity: 1; pointer-events: auto; cursor: zoom-out; }
.lightbox img {
  max-width: 92vw; max-height: 92vh; border-radius: 12px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .4);
}
.lightbox-close {
  position: absolute; top: 22px; right: 26px; color: #fff;
  font-size: 2rem; line-height: 1; background: none; border: none;
  cursor: pointer; opacity: .7;
}
.lightbox-close:hover { opacity: 1; }

/* ---- 联系 ---- */
.contact-lead {
  font-size: clamp(1.05rem, 2vw, 1.35rem); color: var(--ink-dim);
  margin-bottom: clamp(28px, 5vh, 48px);
}
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}
.contact-card {
  --glow: rgba(143, 184, 255, .45);
  border: 1px solid var(--line); border-radius: 14px;
  padding: clamp(20px, 3vw, 32px);
  display: flex; flex-direction: column; gap: 6px;
  background: var(--bg-soft);
  transition: border-color .35s var(--ease-out), transform .35s var(--ease-out), box-shadow .35s var(--ease-out);
}
.contact-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 42px -18px var(--glow);
  border-color: transparent;
}
.contact-icon { font-size: 1.5rem; }
.contact-label {
  font-size: .78rem; letter-spacing: .22em; color: var(--ink-dim);
  text-transform: uppercase;
}
.contact-value { font-weight: 600; font-size: 1.02rem; word-break: break-all; }

/* ---- 页脚 ---- */
.footer {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 10px;
  padding: 28px clamp(20px, 8vw, 120px);
  border-top: 1px solid var(--line);
  color: var(--ink-dim); font-size: .82rem;
}
.footer-admin { color: var(--ink-dim); text-decoration: none; transition: color .3s; }
.footer-admin:hover { color: var(--accent); }
.footer-links { display: flex; gap: 18px; align-items: center; }
.footer-links a { color: var(--ink-dim); text-decoration: none; transition: color .3s; }
.footer-links a:hover { color: var(--accent); }

/* ---- 滚动进场动画 ---- */
.reveal {
  opacity: 0; transform: translateY(28px);
  transition: opacity .9s var(--ease-out), transform .9s var(--ease-out);
  transition-delay: var(--d, 0ms);
}
.reveal.in-view, .in-view > .reveal { opacity: 1; transform: none; }

/* ---- 减少动效偏好 ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---- 移动端 ---- */
@media (max-width: 720px) {
  .nav-links { gap: 14px; }
  .nav-links a { font-size: .8rem; }
  .hero { padding-top: 90px; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { order: -1; }
  .hero-portrait { width: min(80%, 260px); }
  .hero-actions { justify-content: center; }
  .about-grid { grid-template-columns: 1fr; }
  .about-meta { border-left: none; border-top: 1px solid var(--line); padding: 24px 0 0; }
  .project { grid-template-columns: 1fr; gap: 8px; }
  .project:hover { transform: none; }
}
