/* ============================================
   个人作品集 - 单页滚动式网站
   配色: 深色背景 + 青色强调色

   修改指南:
   - 主题色在 :root 中修改
   - 字体在 body 中修改
   - 各板块间距通过 .section 的 padding 调整
   ============================================ */

/* ===== CSS Variables ===== */
:root {
  --bg-primary: #0a192f;
  --bg-secondary: #112240;
  --bg-tertiary: #0d1f3c;
  --text-primary: #ccd6f6;
  --text-secondary: #8892b0;
  --text-bright: #e6f1ff;
  --accent: #64ffda;
  --accent-hover: #4cd9b5;
  --white: #ffffff;
  --font-mono: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', monospace;
  --shadow: 0 10px 30px -15px rgba(2, 12, 27, 0.7);
  --transition: all 0.25s cubic-bezier(0.645, 0.045, 0.355, 1);
  --nav-height: 70px;
  --border-radius: 4px;
}

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

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-secondary);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--accent-hover);
}

ul { list-style: none; }
img { max-width: 100%; display: block; }

::selection {
  background: rgba(100, 255, 218, 0.15);
  color: var(--text-bright);
}

/* ===== Utility ===== */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section {
  padding: 6rem 0;
}

.section-label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
  letter-spacing: 1px;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(100, 255, 218, 0.15);
  max-width: 300px;
}

.section-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 3rem;
}

/* ===== Scroll Animations ===== */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* stagger children */
.stagger-children .fade-up:nth-child(1) { transition-delay: 0.1s; }
.stagger-children .fade-up:nth-child(2) { transition-delay: 0.2s; }
.stagger-children .fade-up:nth-child(3) { transition-delay: 0.3s; }
.stagger-children .fade-up:nth-child(4) { transition-delay: 0.4s; }
.stagger-children .fade-up:nth-child(5) { transition-delay: 0.5s; }
.stagger-children .fade-up:nth-child(6) { transition-delay: 0.6s; }

/* ===== Navigation ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 1000;
  background: rgba(10, 25, 47, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: var(--transition);
}

.navbar.scrolled {
  background: rgba(10, 25, 47, 0.97);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 2px;
}

.nav-logo:hover {
  color: var(--accent);
  opacity: 0.8;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-links a {
  color: var(--text-primary);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  position: relative;
  transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}

.btn-resume {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 0.5rem 1.25rem;
  border-radius: var(--border-radius);
  background: transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-resume:hover {
  background: rgba(100, 255, 218, 0.1);
  color: var(--accent);
}

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  z-index: 1001;
}

.nav-toggle span {
  width: 26px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transition: var(--transition);
  transform-origin: center;
}

.nav-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ===== Hero Section ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--nav-height);
  position: relative;
}

/* subtle grid pattern */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(rgba(100, 255, 218, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

/* glow orbs */
.hero::after {
  content: '';
  position: absolute;
  top: 15%;
  right: 5%;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(100, 255, 218, 0.04) 0%, transparent 60%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 680px;
}

.hero-greeting {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--accent);
  margin-bottom: 1.25rem;
  opacity: 0;
  animation: fadeInUp 0.6s ease 0.2s forwards;
}

.hero-name {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
  color: var(--text-bright);
  line-height: 1.1;
  margin-bottom: 0.75rem;
  opacity: 0;
  animation: fadeInUp 0.6s ease 0.4s forwards;
}

.hero-tagline {
  font-size: clamp(1.1rem, 3vw, 1.6rem);
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  min-height: 2.5rem;
  opacity: 0;
  animation: fadeInUp 0.6s ease 0.6s forwards;
}

.hero-tagline .typed-text {
  color: var(--accent);
  border-right: 2px solid var(--accent);
  padding-right: 4px;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% { border-color: transparent; }
}

.hero-description {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 520px;
  margin-bottom: 2.5rem;
  line-height: 1.8;
  opacity: 0;
  animation: fadeInUp 0.6s ease 0.8s forwards;
}

.hero-buttons {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeInUp 0.6s ease 1s forwards;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(25px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.9rem 2rem;
  border-radius: var(--border-radius);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  font-family: inherit;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg-primary);
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: var(--bg-primary);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(100, 255, 218, 0.3);
}

.btn-ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn-ghost:hover {
  background: rgba(100, 255, 218, 0.1);
  color: var(--accent);
  transform: translateY(-2px);
}

.btn-sm {
  font-size: 0.82rem;
  padding: 0.5rem 1.25rem;
  font-family: var(--font-mono);
}

.btn-link {
  background: none;
  border: none;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  padding: 0.5rem 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-link:hover {
  text-decoration: underline;
}

.btn-disabled {
  opacity: 0.4;
  cursor: default;
  pointer-events: none;
}

/* ===== About Section ===== */
#about .about-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 4rem;
  align-items: start;
}

.about-text p {
  font-size: 1rem;
  line-height: 1.85;
  margin-bottom: 1.25rem;
  color: var(--text-secondary);
}

.about-text .highlight-quote {
  border-left: 3px solid var(--accent);
  padding: 0.75rem 1.25rem;
  margin: 1.75rem 0;
  background: rgba(100, 255, 218, 0.03);
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
  color: var(--text-primary);
  font-style: italic;
  line-height: 1.85;
}

/* Tech Grid */
.tech-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.tech-category h4 {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 0.75rem;
}

.tech-category ul {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tech-category ul li {
  font-size: 0.9rem;
  color: var(--text-secondary);
  padding-left: 1.25rem;
  position: relative;
}

.tech-category ul li::before {
  content: '\25B9';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.75rem;
}

/* ===== Projects Section ===== */
.project-list {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.project-card {
  background: var(--bg-secondary);
  border: 1px solid rgba(100, 255, 218, 0.05);
  border-radius: 8px;
  overflow: hidden;
  transition: var(--transition);
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
  border-color: rgba(100, 255, 218, 0.15);
}

/* 项目图片展示 */
.project-images {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
  border-radius: 8px;
  overflow: hidden;
}

.project-images img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 6px;
  transition: var(--transition);
}

.project-images img:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.project-card-inner {
  padding: 2.5rem;
}

.project-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 0.75rem;
}

.project-card h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 1rem;
}

.project-card .project-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.75;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.project-tags span {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  background: rgba(100, 255, 218, 0.07);
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
}

.project-highlights {
  margin-bottom: 1.75rem;
}

.project-highlights li {
  font-size: 0.9rem;
  color: var(--text-secondary);
  padding: 0.35rem 0 0.35rem 1.5rem;
  position: relative;
  line-height: 1.7;
}

.project-highlights li::before {
  content: '\25B9';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.75rem;
  top: 0.5rem;
}

.project-actions {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

/* ===== Services Section ===== */
#services {
  background: var(--bg-tertiary);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.service-card {
  background: var(--bg-secondary);
  border: 1px solid rgba(100, 255, 218, 0.05);
  border-radius: 8px;
  padding: 2rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.service-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 0.4s ease;
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: rgba(100, 255, 218, 0.15);
}

.service-card:hover::after {
  transform: scaleX(1);
}

.service-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  color: var(--accent);
}

.service-icon svg {
  width: 32px;
  height: 32px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.service-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 0.75rem;
}

.service-card p {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.75;
}

/* ===== Contact Section ===== */
.contact-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.contact-text p {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 2rem;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-link-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  background: var(--bg-secondary);
  border: 1px solid rgba(100, 255, 218, 0.05);
  border-radius: 8px;
  transition: var(--transition);
  color: var(--text-secondary);
}

.contact-link-item:hover {
  border-color: rgba(100, 255, 218, 0.2);
  transform: translateX(4px);
  color: var(--text-primary);
}

.contact-link-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-link-icon svg {
  width: 20px;
  height: 20px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 1.5;
}

.contact-link-label {
  font-size: 0.8rem;
  color: var(--accent);
  font-family: var(--font-mono);
  display: block;
}

.contact-link-value {
  font-size: 0.92rem;
  color: var(--text-primary);
  display: block;
}

/* Contact Form */
.contact-form {
  background: var(--bg-secondary);
  border: 1px solid rgba(100, 255, 218, 0.05);
  border-radius: 8px;
  padding: 2rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-family: var(--font-mono);
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.form-group label .required {
  color: var(--accent);
  margin-left: 2px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  background: var(--bg-primary);
  border: 1px solid rgba(136, 146, 176, 0.2);
  border-radius: var(--border-radius);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.92rem;
  transition: var(--transition);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: rgba(136, 146, 176, 0.4);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(100, 255, 218, 0.08);
}

.form-group textarea {
  min-height: 130px;
  resize: vertical;
}

.form-group.error input,
.form-group.error textarea {
  border-color: #ff6b6b;
}

.form-group .error-msg {
  display: none;
  font-size: 0.78rem;
  color: #ff6b6b;
  margin-top: 0.35rem;
  font-family: var(--font-mono);
}

.form-group.error .error-msg {
  display: block;
}

.form-success {
  display: none;
  text-align: center;
  padding: 2rem;
  color: var(--accent);
  font-family: var(--font-mono);
}

/* ===== Footer ===== */
.footer {
  padding: 2.5rem 0;
  text-align: center;
  border-top: 1px solid rgba(100, 255, 218, 0.05);
}

.footer p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  line-height: 1.8;
}

.footer .credits {
  opacity: 0.5;
  margin-top: 0.25rem;
}

/* ===== Back to Top ===== */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 1px solid rgba(100, 255, 218, 0.2);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: var(--transition);
  z-index: 999;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: rgba(100, 255, 218, 0.1);
  border-color: var(--accent);
  transform: translateY(-3px);
}

.back-to-top svg {
  width: 20px;
  height: 20px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 2;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  #about .about-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .contact-wrapper {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

@media (max-width: 768px) {
  .container { padding: 0 1.5rem; }
  .section { padding: 4.5rem 0; }

  .nav-toggle { display: flex; }

  .nav-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: min(75vw, 320px);
    height: 100vh;
    background: var(--bg-secondary);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.645, 0.045, 0.355, 1);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.3);
  }

  .nav-menu.active {
    transform: translateX(0);
  }

  .nav-links {
    flex-direction: column;
    align-items: center;
    gap: 0;
  }

  .nav-links a {
    font-size: 1rem;
    padding: 0.85rem 2rem;
  }

  .section-title { font-size: 1.6rem; }

  .tech-grid {
    grid-template-columns: 1fr;
  }

  .hero-buttons { flex-direction: column; }
  .hero-buttons .btn { justify-content: center; }
}

@media (max-width: 480px) {
  .project-card-inner { padding: 1.5rem; }
  .service-card { padding: 1.5rem; }
  .contact-form { padding: 1.5rem; }
}
