/* ============================================
   Paperfolio 风格个人简历 - 主样式表
   ============================================ */

/* ---------- CSS Variables ---------- */
:root {
  --color-bg: #fafafa;
  --color-bg-alt: #f0f0f5;
  --color-text: #333333;
  --color-text-light: #666666;
  --color-primary: #1a1a2e;
  --color-accent: #e94560;
  --color-white: #ffffff;
  --color-border: #e0e0e0;
  --font-sans: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: 'Noto Serif SC', 'Georgia', serif;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.12);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --max-width: 1200px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

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

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

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

img {
  max-width: 100%;
  display: block;
}

/* ---------- Loader ---------- */
.loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- Header ---------- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: var(--transition);
}

.header.scrolled {
  border-bottom-color: var(--color-border);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: -0.5px;
}

.nav {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-light);
  position: relative;
  padding: 0.25rem 0;
}

.nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  transition: width var(--transition);
}

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

.nav a:hover::after,
.nav a.active::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-primary);
  transition: var(--transition);
}

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding-top: 72px;
}

.hero .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.hero-content {
  animation: fadeInUp 0.8s ease forwards;
}

.hero-greeting {
  font-size: 1.1rem;
  color: var(--color-accent);
  font-weight: 500;
  margin-bottom: 0.5rem;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.2;
  margin-bottom: 1rem;
}

.hero-title span {
  color: var(--color-accent);
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--color-text-light);
  margin-bottom: 1.5rem;
  max-width: 480px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

.hero-meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--color-text-light);
  background: var(--color-white);
  padding: 0.5rem 1rem;
  border-radius: 50px;
  box-shadow: var(--shadow-sm);
}

.hero-meta-item .icon {
  font-size: 1.1rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.85rem 2rem;
  border-radius: 50px;
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--color-accent);
  color: var(--color-white);
  box-shadow: 0 4px 15px rgba(233, 69, 96, 0.3);
}

.btn-primary:hover {
  background: #d63851;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(233, 69, 96, 0.4);
}

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}

.btn-outline:hover {
  background: var(--color-primary);
  color: var(--color-white);
  transform: translateY(-2px);
}

.hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeInUp 0.8s ease 0.2s forwards;
  opacity: 0;
}

.hero-shape {
  width: 350px;
  height: 350px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  animation: morphing 8s ease-in-out infinite;
}

.hero-avatar {
  position: absolute;
}

.hero-avatar-img {
  width: 220px;
  height: 220px;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid rgba(255,255,255,0.5);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

@keyframes morphing {
  0% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
  25% { border-radius: 58% 42% 75% 25% / 76% 46% 54% 24%; }
  50% { border-radius: 50% 50% 33% 67% / 55% 27% 73% 45%; }
  75% { border-radius: 33% 67% 58% 42% / 63% 68% 32% 37%; }
  100% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
}

/* ---------- Section ---------- */
.section {
  padding: 6rem 0;
}

.section-alt {
  background: var(--color-bg-alt);
}

.section-title {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-primary);
  text-align: center;
  margin-bottom: 3rem;
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--color-accent);
  margin: 1rem auto 0;
  border-radius: 2px;
}

/* ---------- About ---------- */
.about-content {
  max-width: 800px;
  margin: 0 auto;
}

.about-intro {
  font-size: 1.1rem;
  color: var(--color-text);
  line-height: 1.9;
  text-align: center;
  margin-bottom: 3rem;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.about-card {
  background: var(--color-white);
  padding: 2rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  text-align: center;
  transition: all var(--transition);
  border: 1px solid var(--color-border);
}

.about-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-accent);
}

.about-card .icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.about-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--color-primary);
}

.about-card p {
  font-size: 0.85rem;
  color: var(--color-text-light);
  line-height: 1.5;
}

/* ---------- Skills ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.skill-category {
  background: var(--color-white);
  padding: 2rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  transition: all var(--transition);
}

.skill-category:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.skill-category-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--color-border);
}

.skill-category-header .icon {
  font-size: 1.5rem;
}

.skill-category-header h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-primary);
}

.skill-item {
  margin-bottom: 0.75rem;
}

.skill-item:last-child {
  margin-bottom: 0;
}

.skill-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.skill-name {
  font-size: 0.85rem;
  font-weight: 500;
}

/* ---------- Timeline (Experience) ---------- */
.timeline {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 20px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--color-border);
}

.timeline-item {
  position: relative;
  padding-left: 60px;
  margin-bottom: 3rem;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: 11px;
  top: 6px;
  width: 20px;
  height: 20px;
  background: var(--color-accent);
  border-radius: 50%;
  border: 4px solid var(--color-bg);
  box-shadow: 0 0 0 3px var(--color-border);
  z-index: 1;
}

.timeline-card {
  background: var(--color-white);
  padding: 2rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  transition: all var(--transition);
}

.timeline-card:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
  border-left: 3px solid var(--color-accent);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.timeline-company {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--color-primary);
}

.timeline-period {
  font-size: 0.85rem;
  color: var(--color-accent);
  font-weight: 500;
  background: rgba(233, 69, 96, 0.08);
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
}

.timeline-title {
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text-light);
  margin-bottom: 0.5rem;
}

.timeline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.timeline-meta-item {
  font-size: 0.8rem;
  color: var(--color-text-light);
  background: var(--color-bg-alt);
  padding: 0.2rem 0.7rem;
  border-radius: 50px;
}

.timeline-desc {
  font-size: 0.9rem;
  color: var(--color-text);
  line-height: 1.8;
  white-space: pre-line;
}

.timeline-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.tag {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  background: rgba(26, 26, 46, 0.06);
  color: var(--color-primary);
  border-radius: 50px;
  font-weight: 500;
}

/* ---------- Projects ---------- */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.project-card {
  background: var(--color-white);
  border-radius: var(--radius-md);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  transition: all var(--transition);
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-accent);
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.project-name {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--color-primary);
}

.project-period {
  font-size: 0.8rem;
  color: var(--color-accent);
  font-weight: 500;
  white-space: nowrap;
}

.project-summary {
  font-size: 0.9rem;
  color: var(--color-text);
  line-height: 1.7;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
}

.project-responsibilities {
  list-style: none;
  padding: 0;
}

.project-responsibilities li {
  font-size: 0.85rem;
  color: var(--color-text);
  padding: 0.35rem 0;
  padding-left: 1.5rem;
  position: relative;
  line-height: 1.6;
}

.project-responsibilities li::before {
  content: '▹';
  position: absolute;
  left: 0;
  color: var(--color-accent);
  font-weight: 700;
}

/* ---------- Contact ---------- */
.contact-content {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.contact-text {
  font-size: 1.1rem;
  color: var(--color-text-light);
  margin-bottom: 3rem;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.contact-card {
  background: var(--color-white);
  padding: 2rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  transition: all var(--transition);
  text-align: center;
}

.contact-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-accent);
}

.contact-card .icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.contact-card .label {
  font-size: 0.8rem;
  color: var(--color-text-light);
  margin-bottom: 0.25rem;
}

.contact-card .value {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-primary);
  word-break: break-all;
}

/* ---------- Footer ---------- */
.footer {
  background: var(--color-primary);
  color: var(--color-white);
  text-align: center;
  padding: 2rem 0;
}

.footer-text {
  font-size: 0.85rem;
  opacity: 0.8;
}

.footer-filing {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  opacity: 0.7;
}

.filing-link {
  color: var(--color-white);
  text-decoration: none;
  transition: opacity var(--transition);
}

.filing-link:hover {
  opacity: 1;
}

.filing-sep {
  margin: 0 0.5rem;
}

/* ---------- Animations ---------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .hero .container {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-subtitle {
    margin: 0 auto 1.5rem;
  }
  .hero-meta {
    justify-content: center;
  }
  .hero-actions {
    justify-content: center;
  }
  .hero-visual {
    order: -1;
  }
  .hero-shape {
    width: 250px;
    height: 250px;
  }
  .hero-avatar-img {
    width: 160px;
    height: 160px;
  }
  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .about-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  html {
    font-size: 15px;
  }
  .container {
    padding: 0 1.5rem;
  }
  .nav {
    position: fixed;
    top: 72px;
    left: 0;
    width: 100%;
    background: var(--color-white);
    flex-direction: column;
    padding: 1.5rem;
    gap: 1rem;
    box-shadow: var(--shadow-md);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
  }
  .nav.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  .nav-toggle {
    display: flex;
  }
  .hero-title {
    font-size: 2.5rem;
  }
  .hero-shape {
    width: 200px;
    height: 200px;
  }
  .hero-avatar-img {
    width: 130px;
    height: 130px;
  }
  .section-title {
    font-size: 2rem;
  }
  .skills-grid,
  .about-grid,
  .projects-grid {
    grid-template-columns: 1fr;
  }
  .contact-grid {
    grid-template-columns: 1fr;
  }
  .timeline::before {
    left: 15px;
  }
  .timeline-item {
    padding-left: 45px;
  }
  .timeline-dot {
    left: 6px;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2rem;
  }
  .hero-actions {
    flex-direction: column;
    align-items: center;
  }
  .section {
    padding: 4rem 0;
  }
}