:root {
  --primary-color: #2c3e50;
  --accent-color: #e74c3c;
  --hover-color: #3498db;
  --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Helvetica Neue;
}

body {
  background: var(--bg-gradient);
  min-height: 100vh;
}

a {
  color: var(--hover-color);
}

.container {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.collapsed-menu {
  display: none;
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 999;
  color: #666;
  cursor: pointer;
}

.collapsed-menu:hover {
  color: #333;
}

/* 左侧菜单样式 */
.sidebar {
  background: rgba(255, 255, 255, 0.95);
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  height: fit-content;
}

.avatar-wraper {
  position: relative;
  width: 150px;
  height: 150px;
  align-self: center;
}

.avatar-container {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.avatar-bg {
  position: absolute;
  width: 225px;
  top: -34px;
  left: -35px;
  z-index: 999;
}

.avatar {
  border-radius: 50%;
  width: 100%;
  height: 100%;
  will-change: transform;
}

.avatar-wraper:hover .avatar {
  transform: scale(1.1);
  transition: all 0.5s cubic-bezier(0.25, 0.45, 0.45, 0.95);
}

.nav-menu {
  list-style: none;
}

.nav-item {
  margin: 15px 0;
  transition: transform 0.3s ease;
}

.nav-item:hover {
  transform: translateX(10px);
}

.nav-link {
  color: var(--primary-color);
  text-decoration: none;
  font-size: 1.1em;
  display: flex;
  align-items: center;
  padding: 10px;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
  background: var(--hover-color);
  color: white;
}

.nav-link i {
  margin-right: 12px;
  width: 25px;
  text-align: center;
}

/* 右侧内容区域 */
.content-section {
  display: none;
  background: white;
  padding: 30px;
  border-radius: 15px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
  animation: fadeIn 0.5s ease;
  z-index: 998;
}

.active-section {
  display: block;
}

.section-header {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}

.section-title {
  font-size: 2em;
  color: var(--primary-color);
  margin-left: 15px;
  text-decoration: none;
  transition: color 0.3s ease;
  cursor: default;
}

.divider {
  height: 2px;
  background: linear-gradient(90deg, var(--accent-color), transparent);
  border: none;
  margin: 20px 0;
}

.content-wrapper {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
  align-items: center;
  color: #666;
}

.feature-list {
  list-style: none;
  font-size: 1.1em;
}

.feature-list li {
  padding: 12px;
  margin: 10px 0;
  background: #f8f9fa;
  border-radius: 6px;
  position: relative;
  transition: all 0.3s ease;
}

.feature-list li:hover {
  transform: translateX(10px);
  background: var(--hover-color);
  color: white;
}

.content-wrapper li {
  list-style-type: none;
  color: #666;
  letter-spacing: 1px;
}

.content-wrapper .base-info {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px 20px;
  color: #666;
  margin-bottom: 20px;
}

.card-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 30px;
  color: #666;
}

.work-card {
  width: 350px;
  background: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.work-card:hover {
  transform: scale(1.03);
}

.work-content {
  position: relative;
  padding: 10px 15px;
}

.work-content .project-link {
  position: absolute;
  top: 50%;
  right: 20px;
  transform: translateY(-50%);
}

.work-content .project-link:hover {
  color: #333;
}

.work-card .lazy-img {
  width: 350px;
  /* 宽度不固定会导致懒加载异常：非视口区图片也加载了 */
  height: 150px;
  object-fit: cover;
  object-position: top;
}

.work-content p {
  white-space: pre;
  font-style: italic;
  font-size: 14px;
}

#particle {
  position: fixed;
  width: 100%;
  height: 100%;
  background: #f5f5f7;
  /* 白灰色背景 */
}

/* 遮罩层样式 */
.modal-mask {
  opacity: 0;
  visibility: hidden;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* 显示时的遮罩层状态 */
.modal-mask.active {
  opacity: 1;
  visibility: visible;
}

/* 弹框主体 */
.modal {
  background: rgba(0, 0, 0, .7);
  border-radius: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  width: 100%;
  height: 100%;
  padding: 20px;
  position: relative;
  transform: scale(0.7);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 显示时的弹框状态 */
.modal-mask.active .modal {
  transform: scale(1);
  opacity: 1;
}

/* 弹框标题 */
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0;
  padding-bottom: 10px;
}

.modal-header-title {
  color: #999;
}

/* 关闭按钮 */
.close-btn {
  cursor: pointer;
  border: none;
  background: none;
  font-size: 20px;
  color: #999;
  padding: 0 8px;
  transition: color 0.3s;
}

.close-btn:hover {
  color: #333;
}

/* 弹框内容 */
.modal-content {
  margin: 0;
  line-height: 1.6;
  width: 100%;
  height: calc(100% - 17px);
}

.swiper {
  position: relative;
  width: 100%;
  height: 100%;
  margin: 0;
}

.swiper-wrapper {
  height: calc(100% - 30px);
}

.swiper-pagination {
  position: absolute;
  bottom: 20px;
  right: 20px;
  z-index: 100;
}

.swiper-slide {
  width: 100%;
}

.swiper-lazy {
  width: 100%;
  height: 100%;
  object-fit: contain;
  margin: 0 auto;
  align-self: center;
}

.modal-content .preview-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.content-section ul li i {
  color: var(--hover-color);
}

.content-section .company-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 24px;
}

.content-section .company-header .address,
.content-section .job-title .time {
  font-style: italic;
  font-size: 14px;
}

.content-section .job-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 16px;
  margin-top: -20px;
}

.content-wrapper+.content-wrapper {
  margin-top: 30px;
}

#workexperience .content-wrapper {
  border-radius: 4px;
  border: 1px solid #ebeef5;
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1);
  padding: 18px 20px;
}

.content-wrapper .image-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.content-wrapper .image-list .lazy-img {
  width: 180px;
  height: 200px;
  object-fit: contain;
  transform: scale(1);
  transition: transform 0.3s ease;
}

.content-wrapper .image-list .lazy-img:hover {
  transform: scale(1.2);
  z-index: 999;
}

.content-wrapper .image-list.link .lazy-img {
  cursor: pointer;
}

fieldset {
  border: 1px solid #ccc;
  padding: 20px;
  border-radius: 4px;
}

fieldset p {
  white-space: pre-wrap;
}

legend {
  padding: 0 10px;
  font-size: 16px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  .container {
    grid-template-columns: 1fr;
  }

  .collapsed-menu {
    display: block;
  }

  .sidebar {
    position: fixed;
    top: 62px;
    right: 0;
    z-index: 999;
    display: none;
    background: #eee;
    height: auto;
  }

  .sidebar::before {
    position: absolute;
    content: "";
    top: -10px;
    right: 24px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid #eee;
  }

  .sidebar .avatar-wraper {
    display: none;
  }

  .sidebar .nav-item {
    margin: 0;
  }

  .sidebar .nav-item .nav-link {
    font-size: 1em;
  }

  .content-section {
    padding: 15px;
  }

  .work-card,
  .work-card .lazy-img,
  .content-wrapper {
    width: 300px;
    margin: 0 auto;
    word-break: break-all;
    word-break: break-word;
  }

  .content-wrapper .image-list {
    grid-template-columns: 1fr;
  }

  .content-wrapper .image-list .lazy-img {
    width: 100%;
    height: auto;
  }
}