/* ==========================================================================
   深色科技风 · 个人简历/作品集
   ========================================================================== */

:root {
  --bg: #0a0e17;
  --bg-soft: #0f1524;
  --bg-card: rgba(17, 24, 39, 0.55);
  --border: rgba(148, 163, 184, 0.15);
  --text: #e2e8f0;
  --text-dim: #94a3b8;
  --accent-1: #22d3ee;
  --accent-2: #6366f1;
  --accent-3: #a855f7;
  --gradient: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  --font-sans: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
  --radius: 14px;
  --nav-h: 68px;
  --shadow-glow: 0 0 24px rgba(34, 211, 238, 0.18);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

.mono { font-family: var(--font-mono); }
.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.accent { color: var(--accent-1); }

/* ---------- 背景网格 ---------- */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 100%);
}

/* ==========================================================================
   导航栏
   ========================================================================== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 100;
  background: rgba(10, 14, 23, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background 0.3s;
}
.navbar.scrolled { border-bottom-color: var(--border); background: rgba(10, 14, 23, 0.88); }

.nav-inner {
  max-width: 1100px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; }
.nav-logo-dot {
  font-family: var(--font-mono);
  font-size: 13px;
  color: #050a12;
  background: var(--gradient);
  padding: 3px 8px;
  border-radius: 8px;
  box-shadow: var(--shadow-glow);
}
.nav-logo-name { letter-spacing: 0.3px; }

.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-link {
  font-size: 14.5px;
  color: var(--text-dim);
  padding: 8px 14px;
  border-radius: 10px;
  transition: color 0.25s, background 0.25s;
}
.nav-link:hover { color: var(--text); background: rgba(148, 163, 184, 0.08); }
.nav-link.active { color: var(--accent-1); }
.nav-link-cta {
  color: #050a12;
  background: var(--gradient);
  font-weight: 600;
  margin-left: 8px;
  box-shadow: var(--shadow-glow);
}
.nav-link-cta:hover { color: #050a12; background: var(--gradient); filter: brightness(1.1); }

/* 汉堡按钮 */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 8px;
}
.hamburger span {
  width: 22px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
#particle-canvas { position: absolute; inset: 0; z-index: 0; }

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 120px 24px 80px;
  max-width: 820px;
}

.hero-eyebrow {
  color: var(--accent-1);
  font-size: 15px;
  letter-spacing: 2px;
  margin-bottom: 16px;
}
.hero-title { font-size: clamp(52px, 10vw, 96px); font-weight: 800; line-height: 1.1; letter-spacing: 2px; }

.hero-role { font-size: clamp(18px, 3vw, 26px); color: var(--text-dim); margin: 20px 0; min-height: 40px; }
.hero-prefix { color: var(--accent-1); }
.cursor { color: var(--accent-1); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.hero-desc { max-width: 560px; margin: 0 auto 32px; color: var(--text-dim); font-size: 16.5px; }

.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 13px 30px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  color: #050a12;
  background: var(--gradient);
  box-shadow: var(--shadow-glow);
}
.btn-primary:hover { box-shadow: 0 8px 28px rgba(34, 211, 238, 0.32); }
.btn-ghost {
  color: var(--text);
  border: 1px solid var(--border);
  background: rgba(148, 163, 184, 0.06);
}
.btn-ghost:hover { border-color: var(--accent-1); color: var(--accent-1); }

/* 滚动提示 */
.scroll-hint {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
}
.scroll-mouse {
  width: 24px; height: 38px;
  border: 2px solid var(--text-dim);
  border-radius: 12px;
  display: block;
  position: relative;
}
.scroll-mouse::after {
  content: "";
  position: absolute;
  top: 6px; left: 50%;
  width: 4px; height: 8px;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--accent-1);
  animation: scrollDot 1.6s ease-in-out infinite;
}
@keyframes scrollDot {
  0% { transform: translateY(0); opacity: 1; }
  70% { transform: translateY(12px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}

/* ==========================================================================
   通用区块
   ========================================================================== */
.section { padding: 100px 24px; position: relative; }
.container { max-width: 1100px; margin: 0 auto; }

.section-label { color: var(--accent-1); font-size: 13.5px; margin-bottom: 8px; opacity: 0.8; }
.section-title {
  font-size: clamp(32px, 5vw, 44px);
  font-weight: 800;
  letter-spacing: 1px;
  margin-bottom: 48px;
}
.section-title::after {
  content: "";
  display: block;
  width: 56px; height: 3px;
  background: var(--gradient);
  border-radius: 2px;
  margin-top: 14px;
}

/* 滚动渐入 */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ==========================================================================
   关于我
   ========================================================================== */
.about-grid {
  display: grid;
  grid-template-columns: 240px 1.1fr 1fr;
  gap: 40px;
  align-items: start;
}

.about-avatar { text-align: center; }
.avatar-img {
  width: 100%;
  max-width: 220px;
  border-radius: 50%;
  filter: drop-shadow(0 0 24px rgba(34, 211, 238, 0.25));
}
.about-text p { color: var(--text-dim); margin-bottom: 16px; font-size: 16px; }

.about-tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

.tag {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent-1);
  border: 1px solid rgba(34, 211, 238, 0.35);
  background: rgba(34, 211, 238, 0.07);
  padding: 4px 12px;
  border-radius: 999px;
}

.about-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 20px;
  text-align: center;
  backdrop-filter: blur(10px);
  transition: transform 0.3s, border-color 0.3s;
}
.stat-card:hover { transform: translateY(-4px); border-color: rgba(34, 211, 238, 0.4); }
.stat-num { font-size: 34px; font-weight: 800; }
.stat-label { color: var(--text-dim); font-size: 14px; margin-top: 4px; }

/* ==========================================================================
   技能
   ========================================================================== */
.skills-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }

.skill-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 26px;
  backdrop-filter: blur(10px);
  transition: transform 0.3s, border-color 0.3s;
}
.skill-card:hover { transform: translateY(-4px); border-color: rgba(99, 102, 241, 0.4); }
.skill-title { font-size: 18px; margin-bottom: 24px; display: flex; align-items: center; gap: 10px; }
.skill-title::before {
  content: "▹";
  color: var(--accent-1);
  font-family: var(--font-mono);
}

.skill-desc {
  color: var(--text-dim);
  font-size: 14.5px;
  line-height: 1.8;
}

.skill-bar-wrap { margin-bottom: 18px; }
.skill-bar-head { display: flex; justify-content: space-between; font-size: 14px; color: var(--text-dim); margin-bottom: 8px; }
.skill-bar {
  height: 8px;
  background: rgba(148, 163, 184, 0.12);
  border-radius: 4px;
  overflow: hidden;
}
.skill-bar-fill {
  height: 100%;
  width: 0;
  background: var(--gradient);
  border-radius: 4px;
  transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: var(--shadow-glow);
}

.skill-cloud { display: flex; flex-wrap: wrap; gap: 10px; }

/* ==========================================================================
   项目作品集
   ========================================================================== */
.projects-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  backdrop-filter: blur(10px);
  transition: transform 0.35s, border-color 0.35s, box-shadow 0.35s;
}
.project-card:hover {
  transform: translateY(-6px);
  border-color: rgba(34, 211, 238, 0.4);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}
.project-thumb {
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.project-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(10, 14, 23, 0.25);
}
.project-thumb-icon { font-size: 44px; color: rgba(255, 255, 255, 0.85); z-index: 1; text-shadow: 0 2px 12px rgba(0,0,0,0.3); }

.project-body { padding: 24px; }
.project-title { font-size: 19px; margin-bottom: 10px; }
.project-desc { color: var(--text-dim); font-size: 14.5px; margin-bottom: 16px; min-height: 66px; }
.project-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.project-tags .tag { font-size: 12px; padding: 3px 10px; }

.project-links { display: flex; gap: 18px; }
.project-link { font-size: 14px; color: var(--accent-1); transition: text-shadow 0.25s, transform 0.25s; display: inline-block; }
.project-link:hover { text-shadow: 0 0 12px rgba(34, 211, 238, 0.6); transform: translateX(2px); }

/* ==========================================================================
   经历时间线
   ========================================================================== */
.timeline { position: relative; max-width: 720px; margin: 0 auto; padding-left: 28px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 5px; top: 8px; bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, var(--accent-1), var(--accent-3));
  border-radius: 2px;
}

.timeline-item { position: relative; margin-bottom: 32px; }
.timeline-dot {
  position: absolute;
  left: -28px; top: 8px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--accent-1);
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.6);
}

.timeline-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px;
  backdrop-filter: blur(10px);
  transition: border-color 0.3s, transform 0.3s;
}
.timeline-card:hover { border-color: rgba(34, 211, 238, 0.4); transform: translateX(4px); }
.timeline-date { color: var(--accent-1); font-size: 13px; margin-bottom: 6px; }
.timeline-role { font-size: 17px; margin-bottom: 8px; }
.timeline-desc { color: var(--text-dim); font-size: 14.5px; }

/* ==========================================================================
   联系
   ========================================================================== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 48px;
}
.contact-heading { font-size: 24px; margin-bottom: 10px; }
.contact-sub { color: var(--text-dim); margin-bottom: 28px; }

.contact-list li { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.contact-emoji { font-size: 18px; width: 36px; height: 36px; display: grid; place-items: center; background: rgba(148, 163, 184, 0.1); border-radius: 10px; flex-shrink: 0; }
.contact-link { color: var(--text-dim); font-size: 14.5px; transition: color 0.25s; }
.contact-link:hover { color: var(--accent-1); }

.contact-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  backdrop-filter: blur(10px);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.contact-form input,
.contact-form textarea {
  width: 100%;
  background: rgba(148, 163, 184, 0.07);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14.5px;
  margin-bottom: 14px;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent-1);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
}
.contact-form input::placeholder,
.contact-form textarea::placeholder { color: rgba(148, 163, 184, 0.6); }
.form-submit { border: 0; cursor: pointer; width: 100%; }
.form-tip {
  margin-top: 12px;
  font-size: 12px;
  line-height: 1.6;
  color: rgba(148, 163, 184, 0.8);
  text-align: center;
}
.form-tip strong { color: var(--accent-1, #22d3ee); }

/* ==========================================================================
   页脚
   ========================================================================== */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
}
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer p { color: var(--text-dim); font-size: 14px; }

.back-top {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--accent-1);
  padding: 8px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  transition: border-color 0.25s, transform 0.25s;
}
.back-top:hover { border-color: var(--accent-1); transform: translateY(-2px); }

/* ==========================================================================
   响应式
   ========================================================================== */
@media (max-width: 1000px) {
  .about-grid { grid-template-columns: 1fr 1fr; }
  .about-avatar { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .about-avatar { grid-column: auto; }
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .section { padding: 70px 20px; }

  .nav-links {
    position: fixed;
    top: var(--nav-h);
    right: 0;
    width: min(280px, 75vw);
    height: calc(100vh - var(--nav-h));
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 24px;
    background: rgba(10, 14, 23, 0.97);
    backdrop-filter: blur(20px);
    border-left: 1px solid var(--border);
    transform: translateX(100%);
    transition: transform 0.35s ease;
  }
  .nav-links.open { transform: translateX(0); }
  .nav-link { width: 100%; font-size: 16px; padding: 12px 14px; }
  .nav-link-cta { margin-left: 0; margin-top: 8px; text-align: center; }

  .hamburger { display: flex; }

  .projects-grid, .skills-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .project-desc { min-height: 0; }
  .hero-title { letter-spacing: 1px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .skill-bar-fill { transition: none; }
}
