/* =====================================================================
 * 个人创意简历网站 · 样式表
 * 主题：简约年轻化 + 轻创意动态 · 低饱和浅科技蓝
 * ===================================================================== */

/* ---------- 主题变量（换配色只改这里） ---------- */
:root {
  --primary: #5b8def;          /* 主色：浅科技蓝 */
  --primary-dark: #3f6fd1;
  --primary-light: #eaf1fe;    /* 主色浅底，用于分区/高亮 */
  --text: #2b3245;             /* 正文深色 */
  --text-light: #8a93a6;       /* 辅助浅文字 */
  --bg: #ffffff;
  --bg-alt: #f6f8fc;           /* 浅灰分区背景 */
  --border: #e6eaf2;
  --shadow: 0 4px 16px rgba(43, 50, 69, 0.06);
  --shadow-hover: 0 12px 32px rgba(91, 141, 239, 0.18);
  --radius: 14px;
  --gradient: linear-gradient(135deg, #5b8def 0%, #7fb0f7 50%, #a5ccf9 100%);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

/* ---------- 基础重置 ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

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

.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* ---------- 顶部导航 ---------- */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(43, 50, 69, 0.04);
  transition: border-color 0.3s, box-shadow 0.3s;
}
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, box-shadow 0.3s;
}
#navbar.scrolled { border-bottom-color: var(--border); box-shadow: var(--shadow); }
#navbar a {
  color: var(--text-light);
  font-size: 14px;
  padding: 6px 14px;
  border-radius: 999px;
  transition: color 0.25s, background 0.25s;
}
#navbar a.active { color: var(--primary); background: var(--primary-light); }
/* 仅在支持悬停的设备（鼠标）上启用 hover 样式，
   避免触屏点击后 hover 残留导致多个菜单同时高亮 */
@media (hover: hover) and (pointer: fine) {
  #navbar a:hover { color: var(--primary); background: var(--primary-light); }
}

/* ---------- 4.1 首屏欢迎模块（融合关于我） ---------- */
.hero {
  padding: 120px 24px 72px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(600px 400px at 15% 20%, rgba(91, 141, 239, 0.10), transparent 60%),
    radial-gradient(700px 500px at 85% 75%, rgba(127, 176, 247, 0.12), transparent 60%),
    var(--bg);
}
/* 首屏加载渐入动画 */
.hero > * { animation: hero-in 0.9s ease both; }
.hero > *:nth-child(2) { animation-delay: 0.12s; }
.hero > *:nth-child(3) { animation-delay: 0.24s; }
.hero > *:nth-child(4) { animation-delay: 0.36s; }
.hero > *:nth-child(5) { animation-delay: 0.48s; }
.hero > *:nth-child(6) { animation-delay: 0.6s; }

@keyframes hero-in {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero__inner {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 56px;
  max-width: 1080px;
  margin: 0 auto;
  align-items: start;
}

.hero__left {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.hero__avatar {
  width: 100%;
  height: auto;
  aspect-ratio: 3/4;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: var(--shadow-hover);
  animation: hero-in 0.9s ease both;
}

.hero__basics {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 20px;
  box-shadow: var(--shadow);
}

.hero__basic-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.hero__basic-item:last-child {
  border-bottom: none;
}
.hero__basic-item .label {
  font-size: 13px;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 8px;
}
.hero__basic-item .value {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}


.hero__right {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-top: 8px;
}

.hero__name { font-size: 30px; font-weight: 700; letter-spacing: 1px; }

.hero__tagline {
  font-size: clamp(20px, 3.4vw, 30px);
  font-weight: 700;
  margin-top: 4px;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__intro {
  color: var(--text-light);
  margin-top: 10px;
  max-width: 560px;
  white-space: pre-line;
}

.hero__right h3 {
  font-size: 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.hero__right h3::before {
  content: "";
  width: 4px; height: 18px;
  border-radius: 2px;
  background: var(--gradient);
}

.hero__actions { display: flex; gap: 14px; margin-top: 24px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 999px;
  font-size: 15px;
  cursor: pointer;
  border: none;
  transition: transform 0.25s, box-shadow 0.25s, background 0.25s;
}
.btn--primary { background: var(--gradient); color: #fff; box-shadow: var(--shadow-hover); }
.btn--primary:hover { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(91, 141, 239, 0.3); }
.btn--ghost { background: #fff; color: var(--primary); border: 1px solid var(--border); }
.btn--ghost:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

/* ---------- 通用分区 ---------- */
.section { padding: 96px 0; }
.section--alt { background: var(--bg-alt); }

.section__title {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 700;
  text-align: center;
  margin-bottom: 12px;
}
.section__title::after {
  content: "";
  display: block;
  width: 44px; height: 4px;
  border-radius: 2px;
  margin: 14px auto 0;
  background: var(--gradient);
}

/* 滚动渐入（由 main.js 添加 .visible） */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ---------- 4.2 个人基础信息（已融合到首页） ---------- */
.about__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-top: 44px;
}
.about__card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 18px;
  text-align: center;
  transition: transform 0.25s, box-shadow 0.25s;
}
.about__card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.about__card .label { font-size: 13px; color: var(--text-light); }
.about__card .value { font-size: 16px; font-weight: 600; margin-top: 6px; }

.about__block { margin-top: 44px; }
.about__block h3 {
  font-size: 18px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.about__block h3::before {
  content: "";
  width: 4px; height: 18px;
  border-radius: 2px;
  background: var(--gradient);
}

.tags { display: flex; flex-wrap: wrap; gap: 12px; }
.tag {
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 14px;
  cursor: default;
  transition: transform 0.25s, box-shadow 0.25s, background 0.25s;
}
.tag:hover { transform: translateY(-3px) scale(1.04); box-shadow: var(--shadow-hover); background: #dce8fd; }

/* 核心优势卡片（融合技能标签：标题 + 描述 + 标签行） */
.strength-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
}
.strength-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  font-size: 15px;
  transition: transform 0.25s, box-shadow 0.25s;
}
.strength-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.strength-card__title { font-weight: 600; color: var(--text); margin-bottom: 6px; }
.strength-card__desc { color: var(--text-light); font-size: 14px; line-height: 1.7; margin: 0 0 12px; }
.strength-card__tags { display: flex; flex-wrap: wrap; gap: 8px; }
/* 卡片内的小号标签 */
.tag--sm { padding: 4px 12px; font-size: 12.5px; }

/* ---------- 4.3 工作履历（时间轴） ---------- */
.timeline { position: relative; margin-top: 52px; padding-left: 34px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 8px; top: 6px; bottom: 6px;
  width: 2px;
  background: linear-gradient(var(--primary), var(--primary-light));
}
.timeline__item { position: relative; margin-bottom: 36px; }
.timeline__item:last-child { margin-bottom: 0; }
.timeline__item::before {
  content: "";
  position: absolute;
  left: -32px; top: 28px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
}
.job-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 28px;
  box-shadow: var(--shadow);
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.job-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: #cfdffc; }
.job-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
}
.job-card__company { font-size: 19px; font-weight: 700; }
.job-card__role { color: var(--primary); font-weight: 600; font-size: 15px; }
.job-card__period { margin-left: auto; color: var(--text-light); font-size: 13px; }
.job-card__intro { color: var(--text-light); font-size: 14px; margin-top: 6px; }
.job-card h4 {
  font-size: 14px;
  color: var(--text);
  margin: 16px 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.job-card h4::before { content: ""; width: 3px; height: 13px; border-radius: 2px; background: var(--primary); }
.job-card ul li {
  position: relative;
  padding-left: 18px;
  font-size: 14.5px;
  color: #4a5266;
  margin-bottom: 4px;
}
.job-card ul li::before {
  content: "";
  position: absolute;
  left: 2px; top: 11px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--primary-light);
  border: 1.5px solid var(--primary);
}
.job-card .achievements li::before { background: #ffe9c7; border-color: #f0a63c; }

/* ---------- 4.4 项目作品集 ---------- */
.projects__tabs {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 36px 0 28px;
  flex-wrap: wrap;
}
.projects__tab {
  padding: 10px 28px;
  border-radius: 999px;
  font-size: 15px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-light);
  transition: all 0.25s;
  font-family: var(--font);
}
.projects__tab.active {
  background: var(--gradient);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--shadow-hover);
}
.projects__tab:hover:not(.active) {
  background: var(--primary-light);
  color: var(--primary-dark);
  border-color: #c8d9f7;
}

.projects__panel { display: none; }
.projects__panel.active { display: block; animation: hero-in 0.5s ease both; }
.projects__panel.active .reveal {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.projects__grid {
  display: grid;
  grid-template-columns: 1fr; /* 单列竖排 */
  gap: 26px;
  margin: 52px auto 0;
  max-width: 760px;
}
.project-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s, box-shadow 0.3s;
}
.project-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-hover); }
/* 顶部画廊：横向图片条，最多展示 4 张，超出以 +N 角标提示 */
.project-card__gallery { display: flex; gap: 4px; background: var(--bg-alt); }
.project-card__thumb {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 190px;
  overflow: hidden;
  cursor: zoom-in;
}
.project-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.25s;
}
.project-card__thumb:hover img { opacity: 0.85; }
.project-card__more {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(43, 50, 69, 0.55);
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  pointer-events: none;
}
.project-card__body { padding: 22px 24px 26px; display: flex; flex-direction: column; flex: 1; }
.project-card__name { font-size: 18px; font-weight: 700; }
.project-card__meta { color: var(--text-light); font-size: 13px; margin-top: 4px; }
.project-card__intro { font-size: 14.5px; color: #4a5266; margin-top: 12px; }
.project-card h4 {
  font-size: 13.5px;
  margin: 14px 0 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.project-card h4::before { content: ""; width: 3px; height: 12px; border-radius: 2px; background: var(--primary); }
.project-card ul li {
  position: relative;
  padding-left: 16px;
  font-size: 13.5px;
  color: #4a5266;
  margin-bottom: 3px;
}
.project-card ul li::before {
  content: "";
  position: absolute;
  left: 2px; top: 10px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--primary);
}
.project-card .results { margin-top: auto; padding-top: 4px; }
.project-card .results li { color: var(--primary-dark); font-weight: 500; }
.project-card .results li::before { background: #f0a63c; }

/* ---------- 4.5 个人爱好生活 ---------- */
.hobbies__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 52px;
}
.hobby-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
}
.hobby-card:hover { transform: translateY(-6px) rotate(-0.5deg); box-shadow: var(--shadow-hover); }
.hobby-card img { height: 150px; width: 100%; object-fit: cover; }
.hobby-card__body { padding: 16px 18px 20px; }
.hobby-card__title { font-size: 16px; font-weight: 700; }
.hobby-card__desc { font-size: 13.5px; color: var(--text-light); margin-top: 6px; }

/* ---------- 4.6 底部联系模块 ---------- */
.footer {
  background: linear-gradient(160deg, #2b3245 0%, #3a4560 100%);
  color: #cfd6e4;
  padding: 72px 24px 36px;
  text-align: center;
}
.footer__title { font-size: 26px; font-weight: 700; color: #fff; }
.footer__message { margin-top: 12px; color: #aeb7c9; }
.footer__contacts {
  display: flex;
  justify-content: center;
  gap: 16px 40px;
  flex-wrap: wrap;
  margin-top: 30px;
  font-size: 15px;
}
.footer__contacts span { color: #fff; }
.footer .btn { margin-top: 30px; }
.footer__meta { margin-top: 44px; font-size: 12.5px; color: #7c879e; }

/* ---------- 回到顶部 ---------- */
#back-to-top {
  position: fixed;
  right: 26px; bottom: 26px;
  z-index: 90;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--gradient);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  box-shadow: var(--shadow-hover);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.3s, transform 0.3s;
}
#back-to-top.show { opacity: 1; pointer-events: auto; transform: translateY(0); }
#back-to-top:hover { transform: translateY(-4px); }

/* ---------- 图片灯箱 ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(20, 25, 38, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.lightbox.open { opacity: 1; pointer-events: auto; }
.lightbox__img {
  max-width: 88vw;
  max-height: 82vh;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.lightbox button {
  position: absolute;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.25s;
}
.lightbox button:hover { background: rgba(255, 255, 255, 0.28); }
.lightbox__close { top: 22px; right: 26px; width: 42px; height: 42px; font-size: 24px; }
.lightbox__prev, .lightbox__next { top: 50%; transform: translateY(-50%); width: 48px; height: 48px; font-size: 28px; }
.lightbox__prev { left: 22px; }
.lightbox__next { right: 22px; }
.lightbox__counter {
  position: absolute;
  bottom: 24px;
  color: #cfd6e4;
  font-size: 14px;
}

/* ---------- 口令解锁门禁 ---------- */
.gate {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(600px 400px at 20% 20%, rgba(91, 141, 239, 0.14), transparent 60%),
    radial-gradient(700px 500px at 80% 80%, rgba(127, 176, 247, 0.16), transparent 60%),
    var(--bg);
  transition: opacity 0.45s ease;
}
.gate.unlocked { opacity: 0; pointer-events: none; }
.gate__card {
  width: 100%;
  max-width: 360px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-hover);
  padding: 40px 32px 32px;
  text-align: center;
  animation: hero-in 0.6s ease both;
}
.gate__lock { font-size: 40px; }
.gate__title { font-size: 20px; font-weight: 700; margin-top: 12px; }
.gate__desc { font-size: 14px; color: var(--text-light); margin-top: 6px; }
.gate__input {
  width: 100%;
  margin-top: 22px;
  padding: 12px 16px;
  font-size: 16px;
  letter-spacing: 4px;
  text-align: center;
  color: var(--text);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.gate__input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.gate__btn { width: 100%; justify-content: center; margin-top: 14px; }
.gate__error {
  display: none;
  margin-top: 12px;
  font-size: 13px;
  color: #e0626e;
}
.gate__error.show { display: block; }
/* 口令错误时的抖动动画 */
.gate__card.shake { animation: gate-shake 0.4s ease; }
@keyframes gate-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  50% { transform: translateX(8px); }
  75% { transform: translateX(-5px); }
}

/* ---------- 响应式适配 ---------- */
@media (max-width: 860px) {
  .hero__inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 40px;
  }
  .hero__left {
    align-items: center;
  }
  .hero__avatar {
    max-width: 260px;
    aspect-ratio: 3/4;
    object-position: top center;
  }
  .hero__basics {
    max-width: 400px;
    width: 100%;
  }
  .hero__actions {
    justify-content: center;
  }
  .strength-cards {
    text-align: left;
  }
}

@media (max-width: 640px) {
  .section { padding: 68px 0; }
  .job-card__period { margin-left: 0; width: 100%; }
  .timeline { padding-left: 26px; }
  .timeline__item::before { left: -24px; }
  #navbar { gap: 2px; padding: 10px 8px; overflow-x: auto; }
  #navbar a { padding: 5px 10px; font-size: 13px; white-space: nowrap; }
  .hero__avatar { max-width: 200px; }
}

/* ---------- 尊重系统“减弱动态效果”设置 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
