/* =============== 基础变量 =============== */
:root{
    --primary:hsl(210, 100%, 40%);
    --secondary:#f0f7ff;
    --grey:#f7f7f7;
    --text:#222;
    --maxWidth:1100px;
}
/* =============== 全局 Reset =============== */
* {box-sizing:border-box;}
body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif;color:var(--text);background:#fff;}
a{color:var(--primary);text-decoration:none;}
a:hover{text-decoration:underline;}
/* =============== 头部 =============== */
header{display:flex;align-items:center;padding:0 5%;height:70px;border-bottom:1px solid #eaeaea;background:#fff;}
.logo{height:48px;margin-right:12px;}
h1{font-size:22px;font-weight:600;color:var(--primary);}
/* =============== 导航 =============== */
nav{margin-left:auto;}
nav a{margin-left:24px;font-size:16px;color:var(--text);position:relative;}
nav a.active,
nav a:hover{color:var(--primary);}
nav a.active::after{content:'';position:absolute;left:0;bottom:-6px;width:100%;height:2px;background:var(--primary);}
/* =============== 横幅（轮播） =============== */
.carousel {
  position: relative;
  height: 460px;
  width: 100vw; 
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-align: center;
  overflow: hidden; /* 隐藏超出容器的图片 */
}

/* 图片列表：横向排列 + 平滑过渡 */
.carousel-images {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  width: 100%;
  height: 100%;
  object-fit: fill;
  transition: transform 0.5s ease; /* 图片切换的过渡动画 */
  position: relative;
  z-index: 0;
}

.carousel-images li {
  width: 100%;
  height: 100%;
  flex-shrink: 0; /* 防止图片被压缩 */
}

.carousel-images img {
  width: 100%;
  height: 100%;
  object-fit:cover; /* 保持图片比例，避免变形 */
   background-color: #f5f5f5;
}

/* 遮罩层（与原 hero 样式保持一致） */
.carousel::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .35);
  z-index: 0;
  pointer-events: none;
}

/* 文字容器：保持原定位，覆盖在图片上 */
.hero-txt-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  width: 100%;
}
/* 单组文字：默认隐藏，激活时显示 */
.hero-txt {
  display: none;
  color: #fff; /* 文字白色，适配图片背景 */
  text-shadow: 0 2px 4px rgba(0,0,0,0.5); /* 加阴影，提高可读性 */
}
/* 激活的文字显示 */
.hero-txt.active {
  display: block;
}
.hero-txt h2{font-size:48px;margin:0 0 12px;}
.hero-txt p{font-size:20px;margin:0;}
/* =============== 内容区 =============== */
section{padding:60px 5%;max-width:var(--maxWidth);margin:auto;}
h3{font-size:28px;margin-bottom:20px;color:var(--primary);}
/* =============== 卡片 =============== */
.grid{display:grid;gap:30px;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));}
.card{background:var(--secondary);padding:30px;border-radius:8px;}

/* =============== 个人详情页 =============== */
.profile-card{
    max-width:900px;
    margin:40px auto;
    padding:0 5%;
    background:#fff;
    border-radius:8px;
}
.profile-header{
    display:flex;
    gap:40px;
    align-items:flex-start;
    flex-wrap:wrap;
}
.profile-header img{
    width:220px;
    height:220px;
    border-radius:50%;
    object-fit:cover;
    border:6px solid var(--secondary);
    box-shadow:0 4px 15px rgba(0,0,0,.1);
}
.profile-info h2{
    width: 712px;
    font-size:32px;
    color:var(--primary);
    margin:0 0 8px;
}
.profile-info .title{
    font-size:18px;
    color:#555;
    margin-bottom:15px;
}
.profile-info .bio{
    line-height:1.8;
    margin-bottom:20px;
}
.section{
    margin:30px 0;
}
.section h3{
    font-size:22px;
    color:var(--primary);
    border-left:4px solid var(--primary);
    padding-left:10px;
    margin-bottom:12px;
}
.section ul{
    margin:0;
    padding-left:20px;
    line-height:1.8;
}
.back-btn{
    display:inline-block;
    margin:30px 0 10px;
    padding:10px 20px;
    background:var(--primary);
    color:#fff;
    border-radius:4px;
    text-decoration:none;
}
.back-btn:hover{background:#0050a3}
@media(max-width:600px){
    .profile-header{flex-direction:column;align-items:center;text-align:center;}
}
/* =============== 页脚 =============== */
footer{background:var(--grey);text-align:center;padding:30px;font-size:14px;color:#666;}
/* =============== DNA 动画 =============== */
.dna{height:60px;background:url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIwIiBoZWlnaHQ9IjYwIiB2aWV3Qm94PSIwIDAgMTIwIDYwIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0wIDMwYzE1LTEyIDMwLTEyIDQ1IDAgMTUgMTIgMzAgMTIgNDUgME0wIDMwYzE1IDEyIDMwIDEyIDQ1IDAgMTUtMTIgMzAtMTIgNDUgMCIgc3Ryb2tlPSIjMDA2NmNjIiBzdHJva2Utd2lkdGg9IjIiIGZpbGw9Im5vbmUiLz48L3N2Zz4=') 0 0/60px 60px;margin:30px auto 0;animation: scroll 6s linear infinite;}
@keyframes scroll {from {background-position:0 0;} to {background-position:120px 0;}}
.lab {
  width: 150%;
  height: auto;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
}
/* =============== 轮播页码样式 =============== */
.carousel-dots {
  position: absolute;
  bottom: 30px;
  right: 30px;
  display: flex;
  gap: 15px;
  z-index: 3; /* 确保在图片和文字上层 */
}

.dot {
  width: 30px;
  height: 30px;
  border-radius: 30%;
  border: none;
  background: rgba(255, 255, 255, 0.7);
  color: #333;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.dot.active {
  background: #fff;
  color: var(--primary);
}