/* 全局基础样式 */
* {
  box-sizing: border-box;
}

/* 全屏背景容器（解决移动端背景图不加载问题） */
.bg-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-image: url(../img/bg.jpg);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  z-index: -1;
}

/* 页面主体样式（移除原有背景图，避免冲突） */
body {
  color: #2b2c48;
  font-family: 'Noto Serif SC', serif;
  min-height: 100vh;
  display: -webkit-box;
  display: flex;
  flex-wrap: wrap;
  padding: 20px;
  margin: 0; /* 新增：重置默认边距，避免留白 */
}

/* 核心：禁止页面滚动（兼容移动端） */
html.no-scroll,
body.no-scroll {
  overflow: hidden !important;
  height: 100vh !important;
  -webkit-overflow-scrolling: touch !important;
  touch-action: none !important;
}

/* 卡片容器样式 */
.card {
  width: 340px;
  max-width: 100%;
  height: 430px;
  margin: auto;
  overflow: hidden;
  position: relative;
  z-index: 1;
  background-color: #ffffff8f;
  display: -webkit-box;
  display: flex;
  -webkit-transition: 0.3s;
  transition: 0.3s;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  flex-direction: column;
  border-radius: 10px;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.card[data-state="#about"] .card-main {
  padding-top: 0;
}

/* 卡片激活状态样式 */
.card.is-active .card-header {
  height: 80px;
}
.card.is-active .card-cover {
  height: 100px;
  top: -50px;
}
.card.is-active .card-avatar {
  -webkit-transform: none;
  transform: none;
  left: 20px;
  width: 50px;
  height: 50px;
  bottom: 10px;
}
.card.is-active .card-fullname,
.card.is-active .card-jobtitle {
  left: 86px;
  -webkit-transform: none;
  transform: none;
}
.card.is-active .card-fullname {
  bottom: 18px;
  font-size: 19px;
}
.card.is-active .card-jobtitle {
  bottom: 16px;
  letter-spacing: 1px;
  font-size: 10px;
}

/* 卡片头部样式 */
.card-header {
  position: relative;
  display: -webkit-box;
  display: flex;
  height: 200px;
  flex-shrink: 0;
  width: 100%;
  -webkit-transition: 0.3s;
  transition: 0.3s;
}
.card-header * {
  -webkit-transition: 0.3s;
  transition: 0.3s;
}

.card-cover {
  width: 100%;
  height: 100%;
  position: absolute;
  height: 160px;
  top: -20%;
  left: 0;
  will-change: top;
  background-size: cover;
  background-position: center;
  -webkit-filter: blur(30px);
  filter: blur(30px);
  -webkit-transform: scale(1.2);
  transform: scale(1.2);
  -webkit-transition: 0.5s;
  transition: 0.5s;
}
.card-avatar {
  width: 100px;
  height: 100px;
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(-64px);
  border-radius: 50%;
  overflow: hidden; /* 圆形裁剪 */
  box-shadow: 0 8px 8px rgba(0, 0, 0, 0.2);
}

/* 原图层 */
.avatar-base {
  width: 100%;
  height: 100%;
  background-image: url('https://tianquan.gtimg.cn/face/item/6486/medium.png');
  background-size: cover;
  background-position: center;
  position: absolute;
  top: 0;
  left: 0;
  transition: opacity 1.5s ease; /* 淡出 */
  z-index: 1;
}

/* Hover 图层 */
.avatar-hover {
  width: 100%;
  height: 100%;
  background-image: url('/img/converted-1773317951746.webp');
  background-size: cover;
  background-position: center;
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0; /* 初始透明 */
  transition: opacity 1.5s ease; /* 淡入 */
  z-index: 2;
}

/* Hover效果 */
.card-avatar:hover .avatar-base {
  opacity: 0; /* 原图慢慢消失 */
}

.card-avatar:hover .avatar-hover {
  opacity: 1; /* 新图慢慢显示 */
}


.card-fullname {
  position: absolute;
  bottom: 0;
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  -webkit-transform: translateY(-10px) translateX(-50%);
  transform: translateY(-10px) translateX(-50%);
  left: 50%;
}

.card-jobtitle {
  position: absolute;
  bottom: 0;
  font-size: 11px;
  white-space: nowrap;
  font-weight: 500;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin: 0;
  left: 50%;
  -webkit-transform: translateX(-50%) translateY(-7px);
  transform: translateX(-50%) translateY(-7px);
}

/* 卡片主体样式 */
.card-main {
  position: relative;
  -webkit-box-flex: 1;
  flex: 1;
  display: -webkit-box;
  display: flex;
  min-height: 0;
  padding-top: 10px;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  flex-direction: column;
}

.card-subtitle {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 8px;
}

.card-content {
  padding: 20px;
}

.card-desc {
  line-height: 1.6;
  color: #636b6f;
  font-size: 14px;
  margin: 0;
  font-weight: 400;
}

/* 社交链接样式 */
.card-social {
  display: -webkit-box;
  display: flex;
  -webkit-box-align: center;
  align-items: center;
  padding: 0 20px;
  margin-bottom: 30px;
}
.card-social svg {
  fill: #a5b5ce;
  width: 16px;
  display: block;
  -webkit-transition: 0.3s;
  transition: 0.3s;
}
.card-social a {
  color: #8797a1;
  height: 32px;
  width: 32px;
  border-radius: 50%;
  display: -webkit-inline-box;
  display: inline-flex;
  -webkit-box-align: center;
  align-items: center;
  -webkit-box-pack: center;
  justify-content: center;
  -webkit-transition: 0.3s;
  transition: 0.3s;
  background-color: rgba(93, 133, 193, 0.05);
  border-radius: 50%;
  margin-right: 10px;
}
.card-social a:hover svg {
  fill: #637faa;
}
.card-social a:last-child {
  margin-right: 0;
}

/* 卡片按钮样式 */
.card-buttons {
  display: -webkit-box;
  display: flex;
  background-color: #ffffff00;
  margin-top: auto;
  position: -webkit-sticky;
  position: sticky;
  bottom: 0;
  left: 0;
}
.card-buttons button {
  -webkit-box-flex: 1;
  flex: 1 1 auto;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  background: 0;
  font-size: 13px;
  border: 0;
  padding: 15px 5px;
  cursor: pointer;
  color: #5c5c6d;
  -webkit-transition: 0.3s;
  transition: 0.3s;
  font-family: "Jost", sans-serif;
  font-weight: 500;
  outline: 0;
  border-bottom: 3px solid transparent;
}
.card-buttons button:hover {
  color: #2b2c48;
}
.card-buttons button.is-active {
    color: #2b2c48;
    border-bottom: 3px solid #000000;
}
/* 卡片内容区域样式（核心：确保卡片内可滚动） */
.card-section {
  display: none;
  -webkit-box-flex: 1;
  flex: 1;
  min-height: 0;
}
.card-section.is-active {
  display: block;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  touch-action: auto !important;
  -ms-overflow-style: none;
  scrollbar-width: none;
  -webkit-animation: fadeIn 0.6s both;
  animation: fadeIn 0.6s both;
  height: 100%;
  min-height: 0;
}
.card-section.is-active::-webkit-scrollbar {
  width: 0;
  height: 0;
}

/* 淡入动画 */
@-webkit-keyframes fadeIn {
  0% {
    opacity: 0;
    -webkit-transform: translatey(40px);
    transform: translatey(40px);
  }
  100% {
    opacity: 1;
  }
}
@keyframes fadeIn {
  0% {
    opacity: 0;
    -webkit-transform: translatey(40px);
    transform: translatey(40px);
  }
  100% {
    opacity: 1;
  }
}

/* 时间轴样式 */
.card-timeline {
  margin-top: 30px;
  position: relative;
}
.card-timeline:after {
  background: -webkit-gradient(linear, left bottom, left top, from(rgba(134, 214, 243, 0)), to(#516acc));
  background: linear-gradient(to top, rgba(134, 214, 243, 0) 0%, #516acc 100%);
  content: "";
  left: 42px;
  width: 2px;
  top: 0;
  height: 100%;
  position: absolute;
  content: "";
}

.card-item {
  position: relative;
  padding-left: 60px;
  padding-right: 20px;
  padding-bottom: 30px;
  z-index: 1;
}
.card-item:last-child {
  padding-bottom: 5px;
}
.card-item:after {
  content: attr(data-year);
  width: 10px;
  position: absolute;
  top: 0;
  left: 37px;
  width: 8px;
  height: 8px;
  line-height: 0.6;
  border: 2px solid #fff;
  font-size: 11px;
  text-indent: -35px;
  border-radius: 50%;
  color: rgba(134, 134, 134, 0.7);
  background: -webkit-gradient(linear, left top, left bottom, from(#a0aee3), to(#516acc));
  background: linear-gradient(to bottom, #a0aee3 0%, #516acc 100%);
}

.card-item-title {
  font-weight: 500;
  font-size: 14px;
  margin-bottom: 5px;
}

.card-item-desc {
  font-size: 13px;
  color: #6f6f7b;
  line-height: 1.5;
  font-family: "DM Sans", sans-serif;
}

/* 联系方式样式 */
.card-contact-wrapper {
  margin-top: 20px;
}

.card-contact {
  display: -webkit-box;
  display: flex;
  -webkit-box-align: center;
  align-items: center;
  font-size: 13px;
  color: #6f6f7b;
  font-family: "DM Sans", sans-serif;
  line-height: 1.6;
  cursor: pointer;
}
.card-contact + .card-contact {
  margin-top: 16px;
}
.card-contact svg {
  flex-shrink: 0;
  width: 30px;
  min-height: 34px;
  margin-right: 12px;
  -webkit-transition: 0.3s;
  transition: 0.3s;
  padding-right: 12px;
  border-right: 1px solid #dfe2ec;
}

.contact-me {
  border: 0;
  outline: none;
  background: -webkit-gradient(linear, left top, right top, from(rgba(83, 200, 239, 0.8)), color-stop(96%, rgba(81, 106, 204, 0.8)));
  background: linear-gradient(to right, rgba(83, 200, 239, 0.8) 0%, rgba(81, 106, 204, 0.8) 96%);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
  color: #fff;
  padding: 12px 16px;
  width: 100%;
  border-radius: 5px;
  margin-top: 25px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  font-family: "Jost", sans-serif;
  -webkit-transition: 0.3s;
  transition: 0.3s;
}

/* 网站链接样式 */
.card-websites {
  display: -webkit-box;
  display: flex;
  gap: 12px;
  margin-top: 20px;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  flex-direction: column;
}

.card-website {
  display: -webkit-box;
  display: flex;
  gap: 12px;
  -webkit-box-align: center;
  align-items: center;
  padding: 14px;
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(92, 92, 109, 0.12);
  -webkit-transition: 0.3s;
  transition: 0.3s;
}
.card-website:hover {
  -webkit-transform: translateY(-2px);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(43, 44, 72, 0.12);
}

.card-website-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex-shrink: 0;
}

.card-website-body {
  min-width: 0;
}

.card-website-name {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
}

.card-website-desc {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.5;
  color: #6f6f7b;
  font-family: "DM Sans", sans-serif;
}

/* 友链样式（核心：歪歪边框 + 自适应换行） */
.card-link-group + .card-link-group {
  margin-top: 18px;
}

.card-link-group-title {
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #5c5c6d;
}

.card-links-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
}

.card-link-tile {
  min-height: 50px;
  padding: 8px 10px;
  display: -webkit-box;
  display: flex;
  -webkit-box-align: center;
  align-items: center;
  -webkit-box-pack: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  color: #2b2c48;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  border: 2px solid rgba(43, 44, 72, 0.65);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: none;
  -webkit-transition: 0.25s;
  transition: 0.25s;
  /* 歪歪边框核心 */
  border-top-left-radius: 250px 10px;
  border-top-right-radius: 15px 204px;
  border-bottom-left-radius: 15px 257px;
  border-bottom-right-radius: 230px 15px;
}
.card-link-tile:hover {
  -webkit-transform: translateY(-2px);
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.28);
  box-shadow: 3px 3px 0 rgba(43, 44, 72, 0.14);
}