/* ============================================================
   个人简历网站 —— 样式表（简洁学术风 · 官网式布局）
   布局：顶部轮播图 → 个人信息条 → 左侧菜单 + 右侧内容面板
   ============================================================ */

:root {
  --primary: #1e5fa8;       /* 主色：学术蓝 */
  --primary-dark: #174a86;
  --primary-light: #eaf2fb;
  --accent: #2c7be5;
  --text: #2b3440;
  --text-muted: #6b7683;
  --bg: #ffffff;
  --bg-alt: #eef4fa;
  --border: #e5eaf1;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(30, 60, 120, 0.08);
  --shadow-hover: 0 8px 24px rgba(30, 60, 120, 0.14);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg-alt);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

/* ===== 顶部轮播图 ===== */
.banner {
  position: relative;
  height: clamp(260px, 34vw, 440px);
  overflow: hidden;
  background: var(--primary-dark);
}
.banner-slides { position: absolute; inset: 0; }
.banner-slides img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1s ease;
}
.banner-slides img.active { opacity: 1; }
.banner-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(rgba(20, 45, 85, 0.25), rgba(20, 45, 85, 0.35));
  pointer-events: none;
}
.banner-overlay h1 {
  color: #fff;
  font-size: clamp(22px, 3.2vw, 38px);
  font-weight: 700;
  letter-spacing: 4px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}
.banner-dots {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 5;
}
.banner-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.25s;
}
.banner-dots span.active {
  background: #fff;
  width: 26px;
  border-radius: 6px;
}

/* ===== 个人信息条（上移叠加在轮播图底部） ===== */
.infobar-wrap {
  max-width: 1080px;
  margin: -64px auto 0;
  padding: 0 24px;
  position: relative;
  z-index: 10;
}
.infobar {
  display: flex;
  align-items: center;
  gap: 24px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
  padding: 24px 28px;
}
.infobar-avatar {
  width: 132px;
  height: 132px;
  border-radius: 12px;
  object-fit: cover;
  border: 3px solid var(--primary-light);
}
.infobar-info { flex: 1; min-width: 0; }
.infobar-name { font-size: 28px; font-weight: 800; }
.infobar-role {
  color: var(--primary);
  font-weight: 600;
  font-size: 16px;
  margin-top: 4px;
}

/* ===== 信息条姓名下方标签 ===== */
.infobar-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.infobar-tags span {
  background: var(--primary-light);
  color: var(--primary);
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 13px;
}

/* ===== 信息条右侧：个人信息网格（出生年月/政治面貌/电话/籍贯） ===== */
.infobar-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 24px;
  flex-shrink: 0;
}
.detail-item { display: flex; flex-direction: column; min-width: 150px; }
.detail-label { font-size: 12px; color: var(--text-muted); }
.detail-value { font-size: 15px; font-weight: 600; color: var(--text); }

/* ===== 主体区：左菜单 + 右内容 ===== */
.main-area {
  max-width: 1080px;
  margin: 28px auto 60px;
  padding: 0 24px;
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

/* 左侧菜单 */
.sidebar {
  width: 180px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: 24px;
}
.side-link {
  display: block;
  width: 100%;
  padding: 15px 18px;
  background: var(--primary);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}
.side-link:hover { background: var(--primary-dark); transform: translateX(3px); }
.side-link.active {
  background: var(--primary-dark);
  box-shadow: var(--shadow-hover);
  transform: translateX(6px);
}

/* 右侧内容区：所有区块纵向铺开，左侧菜单滚动定位 */
.content-panel {
  flex: 1;
  min-width: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px 40px;
}
.panel-block {
  margin-bottom: 56px;
  scroll-margin-top: 24px; /* 滚动定位时与顶部的间距 */
}
.panel-block:last-child { margin-bottom: 0; }
.panel-title {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 22px;
  padding-left: 14px;
  border-left: 5px solid var(--accent);
}

/* ===== 生活独立页 ===== */
.life-page { display: none; }
.life-page.active { display: block; }
.back-btn {
  display: inline-block;
  margin-bottom: 20px;
  padding: 8px 18px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}
.back-btn:hover { background: var(--primary); color: #fff; }

/* ===== 时间线（教育/工作经历） ===== */
.timeline { position: relative; padding-left: 32px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--border);
}
.timeline-item { position: relative; margin-bottom: 32px; }
.timeline-item:last-child { margin-bottom: 0; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -30px;
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px var(--accent);
}
.timeline-item h3 { font-size: 20px; font-weight: 700; }
.timeline-item .edu-sub { color: var(--primary); font-size: 15px; margin: 4px 0; font-weight: 600; }
.timeline-item .edu-period {
  font-size: 13px; color: var(--text-muted);
  background: var(--primary-light);
  display: inline-block; padding: 2px 12px;
  border-radius: 20px; margin-bottom: 8px;
}
.timeline-item .edu-desc { color: var(--text-muted); font-size: 15px; }

/* ===== 作品集（工作面板内，通栏单列展示） ===== */
.projects-grid {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.project-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  transition: all 0.25s;
}
.project-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); background: #fff; }
.project-main { flex: 1; min-width: 0; }
.project-main h3 { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.project-main p { color: var(--text-muted); font-size: 14px; margin-bottom: 10px; }
.project-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.project-tags span { background: #fff; color: var(--text-muted); padding: 3px 10px; border-radius: 6px; font-size: 12px; border: 1px solid var(--border); }
.project-link {
  flex-shrink: 0;
  padding: 9px 18px;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  border-radius: 8px;
  transition: all 0.2s;
}
.project-link:hover { background: var(--primary-dark); box-shadow: var(--shadow-hover); }

/* ===== 生活碎片（朋友圈） ===== */
.moments-list { max-width: 100%; }
.moment-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 18px;
  transition: all 0.25s;
}
.moment-card:hover { box-shadow: var(--shadow); }
.moment-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.moment-avatar { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--primary-light); }
.moment-time { font-size: 13px; color: var(--text-muted); }
.moment-text { font-size: 15px; margin-bottom: 12px; white-space: pre-line; }
.moment-images { display: grid; gap: 6px; }
.moment-images.grid-1 { grid-template-columns: 1fr; }
.moment-images.grid-2 { grid-template-columns: 1fr 1fr; }
.moment-images.grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.moment-images.grid-4 { grid-template-columns: 1fr 1fr; }
.moment-images.grid-more { grid-template-columns: 1fr 1fr 1fr; }
.moment-images img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; }

/* ===== 联系方式 ===== */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 18px;
}
.contact-item {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  text-align: center;
  transition: all 0.25s;
}
.contact-item:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); background: #fff; }
.contact-item .icon { font-size: 26px; margin-bottom: 6px; }
.contact-item .label { font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.contact-item .value { font-weight: 600; word-break: break-all; font-size: 14px; color: var(--text); }
.contact-item a.value { color: var(--primary); }

/* ===== 页脚 ===== */
.footer {
  background: var(--text);
  color: #cbd5e1;
  text-align: center;
  padding: 28px 24px;
  font-size: 14px;
}

/* ===== 响应式 ===== */
@media (max-width: 860px) {
  .infobar { flex-direction: column; align-items: flex-start; gap: 18px; }
  .infobar-avatar { width: 96px; height: 96px; }
  .infobar-details { width: 100%; grid-template-columns: 1fr 1fr; }

  .main-area { flex-direction: column; }
  .sidebar {
    width: 100%;
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .side-link { width: auto; flex: 1; padding: 12px 10px; font-size: 15px; }
  .side-link.active { transform: none; }
  .content-panel { padding: 24px 20px; }
  .panel-block { margin-bottom: 40px; }
  .project-card { flex-direction: column; align-items: flex-start; }
  .project-link { width: 100%; text-align: center; }
  .banner { height: 220px; }
  .infobar-wrap { margin-top: -48px; }
}
