/**
 * HTML标签样式
 * 确保根元素铺满整个视口并隐藏溢出
 */
html {
  height: 100%;
  overflow: hidden;
}

/**
 * 页面主体样式
 * 设置字体、背景图片、颜色等基础样式
 */
body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  /* 使用较小的背景图片并添加渐变色作为备用 */
  background-image: url("/background.jpg");
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-size: cover;
  /* 当背景图无法显示时的备选方案 */
  background-color: #667eea;
  margin: 0;
  padding: 0;
  color: #fff;
  min-height: 100vh;
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}

/* 在body前添加一个伪元素用于显示背景图，增强兼容性 */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("/background.jpg");
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-size: cover;
  z-index: -1;
  transition: opacity 0.3s ease;
}

/**
 * 主容器样式
 * 包含所有内容的主容器
 */
.container {
  width: 100%;
  height: 100vh;
  margin: 0;
  padding: 20px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
  position: relative;
}

/* 主题切换按钮 */
.theme-toggle {
  position: absolute;
  top: 16px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #fff;
}

.theme-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

.theme-toggle .sun-icon,
.theme-toggle .moon-icon {
  font-size: 18px;
  line-height: 1;
  transition: opacity 0.2s ease;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.theme-toggle .sun-icon {
  opacity: 0;
}

.theme-toggle .moon-icon {
  opacity: 1;
}

[data-theme="light"] .theme-toggle {
  border-color: rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.9);
  color: #333;
}

[data-theme="light"] .theme-toggle .sun-icon {
  opacity: 1;
}

[data-theme="light"] .theme-toggle .moon-icon {
  opacity: 0;
}

/**
 * 页面主标题样式
 */
h1 {
  text-align: center;
  color: #ffffff;
  margin: 20px auto 30px auto;
  padding: 15px 30px;
  width: 90%;
  max-width: 1000px;
  box-sizing: border-box;
  font-size: 2.5rem;
  font-weight: 700;
  position: relative;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/**
 * 名片容器
 * 设置整体尺寸、边框、背景色和圆角
 */
.card-container {
  position: relative;
  width: 90%;
  max-width: 700px;
  height: 400px;
  border: #fff 10px solid;
  background-color: rgb(120, 140, 200);
  margin: 20px auto;
  border-radius: 20px;
  overflow: hidden;
  z-index: 1;
}

/**
 * 名片内容区域
 * 包含文字内容的部分
 */
.card-content {
  position: absolute;
  width: 200px;
  height: 300px;
  left: 0;
  margin: 75px 50px;
  transition: left 1s ease;
}

/**
 * 名片标题链接样式
 */
.card-content a {
  text-decoration: none;
  color: #fff;
  font: 900 28px "";
}

/**
 * 名片副标题样式
 */
.card-content h2 {
  transition: opacity 0.5s 1s ease;
  opacity: 0;
  color: rgb(30, 210, 200);
  margin: 0 0 20px 0;
}

/**
 * 名片描述文字样式
 */
.card-content span {
  transition: top 0.5s 1s ease;
  color: #fff;
  font: 500 15px "";
  position: absolute;
  top: 70px;
}

/**
 * 圆柱体容器
 * 包含构成圆柱效果的所有元素
 */
.card-cylinder {
  position: absolute;
  top: -130px;
  right: -240px;
}

/**
 * 圆柱体片段和装饰元素
 * 构成圆柱体的主要视觉元素
 */
.card-cylinder-piece,
.card-cylinder-accent {
  position: absolute;
  right: calc(var(--i) * 100px);
  width: calc(var(--w) * 40px);
  height: 500px;
  overflow: hidden;
  border-radius: 100px;
  transform: rotateZ(220deg) translate(0, 0);
  background: rgb(240, 220, 150);
  transition: transform 0.5s 0.5s ease;
}

/**
 * 圆柱体第二个片段特殊样式
 */
.card-cylinder-piece:nth-child(2) {
  background: rgb(240, 190, 230);
}

/**
 * 圆柱体装饰元素特殊样式
 */
.card-cylinder-accent {
  left: -470px;
  top: -140px;
  width: 70px;
  background-color: rgb(90, 220, 150);
}

/**
 * 二维码区域
 */
.card-qrcode {
  width: 250px;
  height: 250px;
  position: absolute;
  background-size: cover;
  margin: 70px;
  opacity: 0;
  transition: opacity 0.5s ease;
}

/* 悬停效果 */

/**
 * 悬停时圆柱体元素动画
 */
.card-container:hover .card-cylinder div {
  transition: transform 0.5s calc(var(--i) * 0.1s) ease;
  transform: rotateZ(220deg) translate(-200px, 400px);
}

/**
 * 悬停时内容区域移动
 */
.card-container:hover .card-content {
  transition: left 1s 0.5s ease;
  left: calc(100% - 330px);
}

/**
 * 悬停时描述文字位置变化
 */
.card-container:hover .card-content span {
  transition: top 1s 0.5s ease;
  top: 105px;
}

/**
 * 悬停时副标题显示
 */
.card-container:hover .card-content h2 {
  transition: opacity 1s 0.5s ease;
  opacity: 1;
}

/**
 * 悬停时二维码显示
 */
.card-container:hover .card-qrcode {
  transition: opacity 1s 1.3s ease;
  opacity: 1;
}

/**
 * 软件分类容器
 */
.software-category {
  margin: 20px 0;
  width: 90%;
  max-width: 1000px;
  background-color: rgba(255, 255, 255, 0.7);
  padding: 20px;
  border-radius: 10px;
  box-sizing: border-box;
}

/**
 * 分类标题样式
 */
.software-category h2 {
  color: #495057;
  border-bottom: 2px solid #dee2e6;
  padding-bottom: 10px;
  margin-bottom: 20px;
  text-align: center;
}

/**
 * 软件列表容器
 * 使用弹性布局排列软件项目
 * 增加内边距以适应全屏布局，添加半透明背景提升可读性
 */
.software-list {
  list-style-type: none;
  padding: 30px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 25px;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  margin: 0 auto;
  max-width: 1200px;
}

/**
 * 软件列表项
 * 每个软件项目的容器
 * 提升视觉效果，增加阴影和边框，优化圆角和过渡效果
 */
.software-list li {
  flex: 1 1 calc(33.333% - 25px);
  min-width: 260px;
  max-width: 320px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  background-color: rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  overflow: hidden;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease,
    border-color 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  height: 380px;
  perspective: 1000px;
  will-change: transform, box-shadow;
  transform: translateZ(0);
}

/**
 * 软件列表项悬停效果
 * 增强悬停反馈，添加阴影变化和轻微放大效果
 */
.software-list li:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
}

/**
 * 软件项目详细信息容器
 */
.software-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  height: 100%;
  width: 100%;
  box-sizing: border-box;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s ease;
  cursor: pointer;
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  will-change: transform;
  transform: rotateY(0deg) translateZ(0);
}

/* 亮色模式样式 */
[data-theme="light"] body {
  background-color: #f8fafc;
  color: #0f172a;
}

[data-theme="light"] body::before {
  opacity: 0.12;
}

[data-theme="light"] .software-category {
  background-color: rgba(255, 255, 255, 0.95);
  border: 1px solid #e5e7eb;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.12);
}

[data-theme="light"] .software-list {
  background-color: rgba(15, 23, 42, 0.02);
}

[data-theme="light"] .software-list li {
  background-color: rgba(255, 255, 255, 0.98);
  border-color: rgba(15, 23, 42, 0.06);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

[data-theme="light"] .software-item {
  background-color: rgba(255, 255, 255, 0.98);
}

[data-theme="light"] .software-title {
  color: #0f172a;
}

[data-theme="light"] .software-title:hover {
  color: #2563eb;
}

[data-theme="light"] .software-version,
[data-theme="light"] .software-core {
  color: #1f2937;
}

[data-theme="light"] .software-description p {
  color: #334155;
}

[data-theme="light"] .theme-toggle {
  border-color: rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.95);
  color: #1f2937;
}

[data-theme="dark"] body {
  background-color: #0b1220;
  color: #e5e7eb;
}

[data-theme="dark"] body::before {
  opacity: 0.6;
}

[data-theme="dark"] .software-category {
  background-color: rgba(17, 24, 39, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .software-list {
  background-color: rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .software-list li {
  background-color: rgba(30, 41, 59, 0.85);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.55);
}

[data-theme="dark"] .software-item {
  background-color: rgba(30, 41, 59, 0.85);
}

[data-theme="dark"] .software-title {
  color: #f9fafb;
}

[data-theme="dark"] .software-title:hover {
  color: #93c5fd;
}

[data-theme="dark"] .software-version,
[data-theme="dark"] .software-core {
  color: #d1d5db;
}

[data-theme="dark"] .software-description p {
  color: #cbd5e1;
}

[data-theme="dark"] .theme-toggle {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(15, 23, 42, 0.7);
  color: #e5e7eb;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
  .software-item,
  .software-list li {
    transform: translateZ(0) !important;
  }
}

.software-item:hover {
  transform: rotateY(180deg);
}

.software-item:active {
  transform: rotateY(180deg);
}

/**
 * 软件正面信息（默认显示）
 */
.software-front {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  backface-visibility: hidden;
  transform: rotateY(0deg);
  position: relative;
}

/**
 * 软件背面信息（滑动后显示）
 */
.software-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  backface-visibility: hidden;
  transform: rotateY(180deg);
  padding: 20px;
  box-sizing: border-box;
}

/* 软件图标样式 */
.software-icon {
  width: 70px;
  height: 70px;
  border-radius: 15px;
  margin-bottom: 15px;
  object-fit: contain;
  /* 添加压缩质量优化 */
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

/* 响应式设计 - 移动端适配 */
@media screen and (max-width: 768px) {
  .software-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    margin-bottom: 10px;
  }
}

/**
 * 软件标题链接样式
 */
.software-title {
  font-size: 20px;
  font-weight: 600;
  color: #343a40;
  text-decoration: none;
  margin-bottom: 12px;
  transition: color 0.3s ease;
}

.software-title:hover {
  color: #007bff;
}

.software-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #42a5f5, #7e57c2);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  box-shadow: 0 4px 10px rgba(66, 165, 245, 0.3);
}

/**
 * 软件版本号样式
 */
.software-version {
  font-size: 16px;
  color: #6c757d;
  margin-bottom: 8px;
}

/**
 * 软件内核样式
 */
.software-core {
  font-size: 16px;
  color: #007bff;
  font-weight: bold;
  margin-bottom: 15px;
}

/**
 * 软件描述样式
 */
.software-description {
  margin-top: 20px;
  font-size: 15px;
  color: #555;
}

.software-description p {
  margin: 10px 0;
}

/**
 * 下载按钮容器
 */
.download-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  width: 100%;
}

/**
 * 下载按钮基础样式
 */
.glow-on-hover {
  width: 100%;
  max-width: 200px;
  margin: 0 auto;
  padding: 10px;
  text-align: center;
  color: #fff;
  background: none;
  border: 2px solid transparent;
  border-radius: 10px;
  position: relative;
  z-index: 0;
  transition: color 0.3s ease;
  text-decoration: none;
  display: inline-block;
  box-sizing: border-box;
}

/**
 * 下载按钮渐变动画层
 */
.glow-on-hover::before {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(
    45deg,
    #ff0000,
    #00ff00,
    #0000ff,
    #ffff00,
    #00ffff,
    #ff00ff
  );
  background-size: 400%;
  z-index: -1;
  filter: blur(5px);
  transition: opacity 0.3s ease;
  opacity: 0;
  border-radius: 10px;
}

/**
 * 下载按钮悬停时显示渐变层
 */
.glow-on-hover:hover::before {
  opacity: 1;
  animation: gradient-animation 3s linear infinite;
}

/**
 * 渐变动画关键帧
 */
@keyframes gradient-animation {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/**
 * 下载按钮默认状态下的遮罩层
 */
.download-buttons a::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(
    45deg,
    rgba(255, 0, 0, 0.4),
    rgba(0, 255, 0, 0.4),
    rgba(0, 0, 255, 0.4)
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 0;
}

/**
 * 下载按钮悬停时的遮罩层
 */
.download-buttons a:hover::before {
  opacity: 1;
}

/**
 * 下载按钮悬停时的样式变化
 */
.download-buttons a:hover {
  color: #fff;
  background-color: #0056b3;
  border-color: #004080;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

/**
 * 第一个下载按钮颜色（蓝色）
 */
.download-buttons a:nth-child(1) {
  background-color: #007bff;
  border-color: #007bff;
}

/**
 * 第二个下载按钮颜色（绿色）
 */
.download-buttons a:nth-child(2) {
  background-color: #28a745;
  border-color: #28a745;
}

/**
 * 第三个下载按钮颜色（红色）
 */
.download-buttons a:nth-child(3) {
  background-color: #dc3545;
  border-color: #dc3545;
}

/**
 * 中等屏幕设备样式（平板及以下）
 */
@media (max-width: 768px) {
  .container {
    padding: 15px;
  }

  /* 软件列表项全宽显示 */
  .software-list li {
    flex: 1 1 100%;
    max-width: 100%;
  }

  /* 软件项目居中 */
  .software-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 25px;
    height: 100%;
    perspective: 1000px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 8px;
  }

  /* 图标调整 */
  .software-icon {
    width: 70px;
    height: 70px;
    margin-bottom: 15px;
  }

  /* 标题和版本号字体大小调整 */
  .software-title {
    font-size: 18px;
    margin-bottom: 10px;
  }

  .software-version {
    font-size: 14px;
    margin-bottom: 8px;
  }

  .software-core {
    font-size: 14px;
    margin-bottom: 15px;
  }

  /* 下载按钮居中 */
  .download-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    width: 100%;
  }

  /* 按钮样式，设置最大宽度并居中 */
  .download-buttons a {
    padding: 10px 15px;
    font-size: 16px;
    text-align: center;
    max-width: 220px;
    margin: 0 auto;
  }

  /* 调整滑动名片在小屏幕上的显示 */
  .card-container {
    width: 95%;
    height: 320px;
  }

  .card-content {
    width: 160px;
    height: 260px;
    margin: 30px 20px;
  }

  .card-container:hover .card-content {
    left: calc(100% - 200px);
  }

  h1 {
    font-size: 2.2rem;
    padding: 15px 25px;
    margin: 20px auto 30px auto;
    color: #ffffff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
  }

  .software-category h2 {
    font-size: 22px;
    margin-bottom: 15px;
  }

  .software-category {
    width: 95%;
    padding: 20px;
    margin: 15px 0;
  }

  .software-description {
    font-size: 14px;
  }

  .software-description p {
    margin: 8px 0;
  }
}

/**
 * 小屏幕设备样式（手机）
 */
@media (max-width: 480px) {
  .container {
    padding: 10px;
  }

  /* 调整图标大小 */
  .software-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 12px;
  }

  /* 调整标题和按钮的字体大小 */
  .software-title {
    font-size: 16px;
    margin-bottom: 8px;
  }

  .software-version {
    font-size: 13px;
    margin-bottom: 6px;
  }

  .software-core {
    font-size: 13px;
    margin-bottom: 12px;
  }

  .download-buttons a {
    font-size: 14px;
    padding: 9px 12px;
  }

  .card-container {
    height: 280px;
    border-width: 5px;
  }

  .card-content {
    width: 140px;
    height: 220px;
    margin: 25px 15px;
  }

  .card-content a {
    font-size: 26px;
  }

  .card-content h2 {
    font-size: 20px;
  }

  .card-content span {
    font-size: 13px;
    top: 65px;
  }

  .card-container:hover .card-content span {
    top: 90px;
  }

  .card-qrcode {
    width: 140px;
    height: 140px;
    margin: 60px;
  }

  h1 {
    font-size: 1.8rem;
    margin: 15px auto 25px auto;
    padding: 12px 20px;
    color: #ffffff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
  }

  .software-category {
    margin: 12px 0;
    width: 95%;
    padding: 15px;
  }

  .software-category h2 {
    font-size: 20px;
    margin-bottom: 12px;
    padding-bottom: 5px;
  }

  .software-list {
    gap: 12px;
  }

  .software-description {
    font-size: 13px;
  }

  .software-description p {
    margin: 6px 0;
  }
}
