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

:root {
  --black: #1a1a1a;
  --white: #fafaf8;
  --accent: #1a56db;
  --accent-light: #e8f0fe;
  --gray: #666;
  --light-bg: #f5f4f1;
  --border: #e4e2dd;
  --radius: 12px;
}

html { scroll-behavior: smooth; }
body { font-family: 'Inter', sans-serif; background: var(--white); color: var(--black); line-height: 1.7; font-size: 16px; }

.navbar { position: sticky; top: 0; z-index: 100; display: flex; justify-content: space-between; align-items: center; padding: 1rem 6%; background: rgba(250,250,248,0.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.nav-logo { font-family: 'Noto Serif SC', serif; font-size: 1.1rem; font-weight: 700; }
.nav-links { list-style: none; display: flex; gap: 1.8rem; }
.nav-links a { text-decoration: none; color: var(--gray); font-size: 0.9rem; transition: color 0.2s; }
.nav-links a:hover { color: var(--accent); }

.hero { min-height: 88vh; display: flex; align-items: center; padding: 5rem 6%; position: relative; overflow: hidden; }
.hero-content { max-width: 580px; z-index: 1; }
.hero-tag { font-size: 0.8rem; color: var(--accent); letter-spacing: 2px; margin-bottom: 1rem; }
.hero-name { font-family: 'Noto Serif SC', serif; font-size: clamp(2.8rem, 7vw, 5rem); line-height: 1.1; margin-bottom: 1.2rem; animation: fadeUp 0.7s ease both; }
.hero-desc { font-size: 1.05rem; color: var(--gray); margin-bottom: 2rem; animation: fadeUp 0.7s 0.1s ease both; }
.hero-btns { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 2rem; animation: fadeUp 0.7s 0.2s ease both; }
.hero-tags { display: flex; gap: 0.6rem; flex-wrap: wrap; animation: fadeUp 0.7s 0.3s ease both; }
.hero-tags span { padding: 0.3rem 0.9rem; background: var(--accent-light); color: var(--accent); border-radius: 100px; font-size: 0.8rem; }

.btn-primary { display: inline-block; padding: 0.75rem 1.8rem; background: var(--black); color: var(--white); border-radius: 100px; text-decoration: none; font-size: 0.9rem; transition: transform 0.2s, box-shadow 0.2s; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.15); }
.btn-outline { display: inline-block; padding: 0.75rem 1.8rem; border: 1.5px solid var(--black); color: var(--black); border-radius: 100px; text-decoration: none; font-size: 0.9rem; transition: all 0.2s; }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.hero-deco {
  position: absolute;
  right: 4%;
  top: 50%;
  transform: translateY(-50%);
}

.carousel-stage {
  position: relative;
  width: 460px;
  height: 380px;
  perspective: 700px;
  cursor: ew-resize;
}

.c-card {
  position: absolute;
  width: 220px;
  height: 300px;
  border-radius: 20px;
  overflow: hidden;
  border: 3px solid var(--white);
  transition: all 0.4s cubic-bezier(0.34, 1.2, 0.64, 1);
  pointer-events: none;
}

.c-card img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center top;
}

@media (max-width: 768px) {
  .carousel-stage { display: none; }
}

.section.bg-light { background: var(--light-bg); }
.section.bg-dark { background: var(--black); }
.section-inner { max-width: 960px; margin: 0 auto; padding: 5rem 6%; }
.section-title { font-family: 'Noto Serif SC', serif; font-size: 1.8rem; margin-bottom: 2.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.section-title.light { color: var(--white); border-color: #333; }

/* 手风琴 */
.accordion { display: flex; flex-direction: column; gap: 0.8rem; }
.acc-item { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--white); }
.acc-header { display: flex; justify-content: space-between; align-items: center; padding: 1.2rem 1.5rem; cursor: pointer; transition: background 0.2s; }
.acc-header:hover { background: var(--accent-light); }
.acc-left { display: flex; align-items: center; gap: 1.5rem; }
.acc-date { font-size: 0.85rem; color: var(--gray); white-space: nowrap; min-width: 130px; }
.acc-title-wrap h3 { font-size: 1rem; font-weight: 500; margin-bottom: 0.15rem; }
.acc-sub { font-size: 0.85rem; color: var(--accent); }
.acc-arrow { font-size: 0.7rem; color: var(--gray); transition: transform 0.3s; flex-shrink: 0; }
.acc-item.open .acc-arrow { transform: rotate(180deg); }
.acc-body { max-height: 0; overflow: hidden; transition: max-height 0.35s ease, padding 0.35s ease; padding: 0 1.5rem; }
.acc-item.open .acc-body { max-height: 600px; padding: 0.2rem 1.5rem 1.4rem; }

/* 经历卡片 */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.exp-card { display: flex; flex-direction: column; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; text-decoration: none; color: inherit; transition: transform 0.2s, box-shadow 0.2s; position: relative; overflow: hidden; }
.exp-card::after { content: ''; position: absolute; top: 0; left: -100%; width: 60%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent); transition: left 0.5s ease; }
.exp-card:hover::after { left: 150%; }
.exp-card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(0,0,0,0.08); }
.exp-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.8rem; }
.exp-tag { font-size: 0.8rem; padding: 0.2rem 0.7rem; border-radius: 100px; }
.exp-date { font-size: 0.85rem; color: var(--gray); }
.exp-card h3 { font-size: 1rem; font-weight: 500; margin-bottom: 0.3rem; }
.exp-role { font-size: 0.85rem; color: var(--accent); margin-bottom: 0.6rem; }
.exp-desc { font-size: 0.92rem; color: var(--gray); flex: 1; margin-bottom: 1.2rem; line-height: 1.6; }
.exp-link { font-size: 0.85rem; color: var(--accent); font-weight: 500; }

.detail-list { padding-left: 1.2rem; font-size: 0.95rem; color: #555; }
.detail-list li { margin-bottom: 0.4rem; }
.badge-row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 1rem; }
.badge { font-size: 0.8rem; padding: 0.2rem 0.7rem; background: var(--light-bg); border: 1px solid var(--border); border-radius: 100px; color: var(--gray); }

.tag-blue   { background: #e8f0fe; color: #185FA5; }
.tag-teal   { background: #E1F5EE; color: #0F6E56; }
.tag-amber  { background: #FAEEDA; color: #854F0B; }
.tag-purple { background: #EEEDFE; color: #534AB7; }

.skills-tags-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; }
.skill-group-title { font-size: 0.9rem; font-weight: 500; margin-bottom: 1rem; color: var(--black); }
.tags-cloud { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tag { padding: 0.35rem 0.9rem; border-radius: 100px; font-size: 0.82rem; }

.advantage-list { display: flex; flex-direction: column; gap: 1.5rem; }
.advantage-item { display: flex; gap: 1.2rem; align-items: flex-start; padding: 1.2rem; background: var(--light-bg); border-radius: var(--radius); }
.advantage-icon { font-size: 1.3rem; flex-shrink: 0; margin-top: 2px; }
.advantage-item strong { display: block; font-size: 0.95rem; margin-bottom: 0.3rem; }
.advantage-item p { font-size: 0.92rem; color: var(--gray); }

.other-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.other-card { display: flex; gap: 1rem; align-items: flex-start; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem; }
.other-icon { font-size: 1.5rem; flex-shrink: 0; }
.other-card strong { display: block; font-size: 0.9rem; margin-bottom: 0.3rem; }
.other-card p { font-size: 0.92rem; color: var(--gray); }

.contact-desc { color: #aaa; margin-bottom: 2rem; font-size: 0.95rem; }
.contact-links { display: flex; gap: 1rem; flex-wrap: wrap; }
.contact-item { padding: 0.7rem 1.4rem; border: 1px solid #333; border-radius: 100px; color: var(--white); text-decoration: none; font-size: 0.85rem; transition: border-color 0.2s, color 0.2s; }
.contact-item:hover { border-color: var(--accent); color: #6ea8fe; }

.footer { text-align: center; padding: 1.5rem; background: var(--black); color: #444; font-size: 0.8rem; border-top: 1px solid #222; }

/* 滚动触发淡入 */
.fade-up { opacity: 0; transform: translateY(30px); transition: opacity 0.7s ease, transform 0.7s ease; }
.fade-up.visible { opacity: 1; transform: translateY(0); }

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

@media (max-width: 768px) {
  .acc-left { gap: 0.8rem; }
  .acc-date { min-width: unset; }
  .skills-tags-grid { grid-template-columns: 1fr; }
  .other-grid { grid-template-columns: 1fr; }
  .hero-deco { display: none; }
  .nav-links { gap: 1rem; }
}
/* 专业技能纵向布局 */
.skills-vertical { display: flex; flex-direction: column; gap: 1rem; }

.skill-row {
  display: grid; grid-template-columns: 120px 1fr;
  gap: 1.5rem; align-items: start;
  padding: 1.2rem 1.5rem;
  background: var(--light-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.skill-row-label { padding-top: 2px; }
.skill-row-title { font-size: 0.9rem; font-weight: 500; color: var(--black); margin-bottom: 3px; }
.skill-row-en { font-size: 0.75rem; color: var(--gray); }

.skill-row-content { display: flex; flex-direction: column; gap: 0.8rem; }

@media (max-width: 600px) {
  .skill-row { grid-template-columns: 1fr; gap: 0.8rem; }
}
/* 技能作品卡片 */
.skill-tag-work { cursor: pointer; border: 1.5px solid transparent; transition: all 0.2s; }
.skill-tag-work:hover { border-color: currentColor; transform: translateY(-1px); }
.skill-tag-work.active { border-color: currentColor; font-weight: 600; }

.skill-works { display: flex; flex-direction: row; gap: 0.8rem; align-items: flex-start; }

.skill-work-card {
  width: 140px; max-width: 140px; flex-shrink: 0;
  background: var(--white);
  border: 1.5px solid var(--border); border-radius: var(--radius);
  overflow: hidden; cursor: pointer;
  transition: all 0.3s; opacity: 0.4;
  transform: translateY(6px);
}
.skill-work-card.highlighted {
  opacity: 1; transform: translateY(0);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.skill-work-preview {
  height: 72px; display: flex;
  align-items: center; justify-content: center; font-size: 28px;
}
.skill-work-info { padding: 8px 10px; }
.skill-work-name { font-size: 0.82rem; font-weight: 600; margin-bottom: 2px; }
.skill-work-desc { font-size: 0.72rem; color: var(--gray); }
.skill-work-view { font-size: 0.72rem; margin-top: 4px; }

/* 技能灯箱 - 支持滚动 */
.skill-lightbox {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.88); z-index: 1000;
  align-items: center; justify-content: center;
  padding: 2rem;
}
.skill-lightbox.active { display: flex; }
.skill-lightbox-inner {
  max-width: 780px; width: 100%;
  max-height: 88vh; overflow-y: auto;
  border-radius: 12px; background: #fff;
  scrollbar-width: thin;
}
.skill-lightbox-inner img { width: 100%; display: block; }
.skill-lightbox-close {
  position: fixed; top: 1.5rem; right: 2rem;
  color: #fff; font-size: 1.5rem; cursor: pointer;
  opacity: 0.7; transition: opacity 0.2s; z-index: 1001;
}
.skill-lightbox-close:hover { opacity: 1; }
/* 教育经历直接展开 */
.edu-list { display: flex; flex-direction: column; gap: 2rem; }

.edu-item {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 2rem;
  padding: 1.5rem;
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: box-shadow 0.2s;
}

.edu-item:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.06); }

.edu-left { padding-top: 4px; }
.edu-date { font-size: 0.85rem; color: var(--gray); white-space: nowrap; }

.edu-right h3 { font-size: 1.05rem; font-weight: 500; margin-bottom: 0.3rem; }
.edu-sub { font-size: 0.85rem; color: var(--accent); margin-bottom: 0.8rem; }

@media (max-width: 768px) {
  .edu-item { grid-template-columns: 1fr; gap: 0.5rem; }
}

/* ===== 手机端适配 ===== */
@media (max-width: 768px) {

  /* 1. 导航栏 */
  .nav-links {
    gap: 0.8rem;
  }
  .nav-links a {
    font-size: 0.78rem;
    white-space: nowrap;
  }

  /* 2. Hero 区照片显示 */
  .hero {
    min-height: auto;
    padding-bottom: 3rem;
  }

  .hero-inner {
    position: relative;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-top: 5rem;
    padding-bottom: 2rem;
  }

  .hero-text {
    max-width: 100%;
    position: relative;
    z-index: 1;
  }

  .hero-deco {
    position: relative;
    right: auto;
    top: auto;
    transform: none;
    display: flex;
    justify-content: center;
    margin-top: 2rem;
    width: 100%;
  }

  .carousel-stage {
    width: 300px;
    height: 260px;
    margin: 0 auto;
  }

  .c-card {
    width: 150px;
    height: 210px;
  }

  /* 3. 技能标签和卡片自动换行 */
  .tags-cloud {
    flex-wrap: wrap;
  }

  .skill-works {
    flex-wrap: wrap;
  }

  .skill-work-card {
    width: 130px;
    max-width: 130px;
  }

  .skill-row {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }

}