* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: black;
  color: white;
  font-family: "Arial", "Microsoft YaHei", sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  text-align: center;
  line-height: 1.5;
}

/* 防止从微信跳转时出现样式混乱 */
body.loading {
  opacity: 0;
  transition: opacity 0.3s ease;
}

body.loaded {
  opacity: 1;
}

.app-icon {
  margin-top: 60px;
}

.app-text {
  margin-top: 2.5rem;
}

.app-version {
  font-size: 1rem;
  margin: 13px 0;
  color: #fcfcfc;
  opacity: 0.5;
  font-weight: 100;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  z-index: 1000;
  display: none;
}

.overlay img {
  align-self: center;
  width: 50%;
  max-width: 20rem;
  height: auto;
  max-height: 200px;
}

@media (max-width: 720px) {
  .overlay img {
    margin-right: 1.1rem;
    align-self: flex-end;
    width: 80%;
    max-width: none;
    max-height: none;
  }
}

.install-button {
  width: 253px;
  height: 3.125rem;
  margin-top: 4rem;
  padding: 10px 20px;
  background-color: #4d7abf;
  color: white;
  border: none;
  border-radius: 0.75rem;
  font-family: "Inter";
  font-weight: bold;
  font-size: 1rem;
  cursor: pointer;
  display: none; /* 默认隐藏，通过JavaScript控制显示 */
}

.install-button:hover {
  background-color: #0056b3;
}

/* 二维码容器样式 - 修改为相对定位 */
.qr-code-container {
  display: none;
  margin-top: 4rem;
  margin-bottom: 0; /* 确保没有底部间距 */
  align-items: center;
  justify-content: center;
  flex-direction: column;
  position: relative; /* 添加相对定位 */
  width: 100%;
}

.qr-code {
  text-align: center;
  position: relative; /* 相对定位 */
  z-index: 2; /* 确保二维码在上层 */
}

/* 二维码图片样式 */
.qr-code-container .qr-code img,
#qrCodeImage {
  width: 12.5rem;
  height: 12.5rem;
  border: 2px solid #4d7abf;
  border-radius: 8px;
  background-color: white;
  padding: 8px;
  box-shadow: 0 4px 12px rgba(77, 122, 191, 0.3);
}

.qr-text {
  margin-top: 1rem;
  margin-bottom: 0; /* 移除底部边距 */
  font-size: 0.9rem;
  color: #fcfcfc;
  opacity: 0.9; /* 增加透明度让文字更明显 */
  font-weight: 500; /* 增加字重 */
  position: relative;
  z-index: 3; /* 确保文字在最上层 */
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5); /* 添加文字阴影 */
}

/* 打印机背景容器 */
.printer-background {
  position: absolute;
  top: 50%; /* 从二维码中间开始 */
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  z-index: 1; /* 在最底层 */
  margin-top: 2rem; /* 调整与二维码的距离 */
}

.printer-image {
  width: 100%;
  max-width: 500px; /* 限制最大宽度 */
  height: auto;
  opacity: 0.8; /* 稍微透明，作为背景 */
}

/* 打印机图片容器 - 设置为相对定位 */
.printer-container {
  position: relative; /* 相对定位，作为文字绝对定位的参考 */
  margin-top: 0.5rem;
  margin-bottom: 0;
  width: 100%;
  display: flex;
  justify-content: center;
}

.printer-image {
  width: 100%;
  max-width: 500px;
  height: auto;
}

/* 修改footer-text样式 - 浮在图片底部 */
.footer-text {
  position: absolute; /* 绝对定位 */
  bottom: 20px; /* 距离图片底部20px */
  left: 50%; /* 水平居中 */
  transform: translateX(-50%); /* 精确居中 */

  font-size: 1.1rem; /* 稍微增大字体 */
  letter-spacing: 0.1em;
  color: #ffffff; /* 改为纯白色 */
  font-weight: 500; /* 增加字重 */

  /* 添加背景和阴影让文字更清晰 */
  background: rgba(0, 0, 0, 0.6); /* 半透明黑色背景 */
  padding: 0.5rem 1.5rem; /* 内边距 */
  border-radius: 20px; /* 圆角 */
  backdrop-filter: blur(5px); /* 背景模糊效果 */
  -webkit-backdrop-filter: blur(5px); /* Safari 9+ 支持 */

  /* 文字阴影 */
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);

  margin: 0; /* 移除所有外边距 */
  white-space: nowrap; /* 防止文字换行 */
}

/* 底部信息样式 - 优化版 */
.footer-info {
  width: 100%;
  text-align: center;
  margin-top: 1rem;
  margin-bottom: 2rem;
  padding: 1.5rem 20px;
}

.footer-links {
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.footer-links a {
  color: #b0b0b0 !important;
  text-decoration: none !important;
  font-size: 0.9rem;
  padding: 0.8rem 1.2rem;
  border-radius: 6px;
  transition: color 0.3s ease; /* 只对颜色进行过渡 */
  position: relative;
}

.footer-links a:hover {
  color: #ffffff !important; /* 只改变颜色为白色 */
  text-decoration: none !important;
}

.footer-links a:visited {
  color: #b0b0b0 !important;
  text-decoration: none !important;
}

.footer-links a:link {
  color: #b0b0b0 !important;
  text-decoration: none !important;
}

.separator {
  color: rgba(135, 135, 135, 0.5);
  margin: 0 0.5rem;
  font-size: 0.8rem;
  font-weight: 300;
}

.copyright {
  color: #999;
  font-size: 0.8rem;
  line-height: 1.6;
  font-weight: 300;
}

.copyright p {
  margin: 0.3rem 0;
}

.icp-info {
  margin-top: 1rem !important;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(135, 135, 135, 0.1);
}

.icp-info a {
  color: #aaa !important;
  text-decoration: none !important;
  font-size: 0.75rem;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  transition: color 0.3s ease; /* 只对颜色进行过渡 */
  display: inline-block;
  position: relative;
}

.icp-info a:hover {
  color: #ffffff !important; /* 只改变颜色为白色 */
  text-decoration: none !important;
}

.icp-info a:visited {
  color: #aaa !important;
  text-decoration: none !important;
}

.icp-info a:link {
  color: #aaa !important;
  text-decoration: none !important;
}

/* 移除active状态的额外效果 */
.footer-links a:active {
  /* 移除所有active效果 */
}

.icp-info a:active {
  /* 移除所有active效果 */
}

/* 响应式设计 - 简化版 */
@media (max-width: 768px) {
  .footer-info {
    padding: 1.5rem 15px;
  }

  .footer-links {
    flex-direction: column;
    gap: 0.8rem;
  }

  .footer-links a {
    padding: 0.8rem 1.5rem;
    width: auto;
    font-size: 0.95rem;
  }

  /* 移动端hover效果只改变颜色 */
  .footer-links a:hover {
    color: #ffffff !important; /* 只改变颜色 */
  }

  .separator {
    display: none;
  }

  .copyright {
    font-size: 0.75rem;
  }

  .icp-info a {
    font-size: 0.7rem;
    padding: 0.5rem 1rem;
  }

  /* ICP链接移动端hover效果 */
  .icp-info a:hover {
    color: #ffffff !important; /* 只改变颜色 */
  }

  .printer-background {
    margin-top: 1.5rem;
  }
}

@media (max-width: 480px) {
  .app-icon {
    margin-top: 40px;
  }

  .footer-info {
    padding: 1.2rem 10px;
  }

  .footer-text {
    margin-bottom: 1rem;
    font-size: 0.95rem;
  }

  .footer-links a {
    padding: 0.7rem 1.2rem;
    font-size: 0.9rem;
  }

  .copyright {
    font-size: 0.7rem;
  }

  .printer-background {
    margin-top: 1rem;
  }

  .printer-image {
    max-width: 350px;
  }
}

#wechat-alert {
  display: none;
}

/* 语言切换器现代化样式 */
.language-switch {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
}

.custom-select {
  position: relative;
  width: 140px;
  font-family: "Inter", "Arial", sans-serif;
}

.select-trigger {
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(77, 122, 191, 0.3);
  border-radius: 12px;
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  position: relative;
  overflow: hidden;
}

.select-trigger::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(77, 122, 191, 0.1) 0%,
    rgba(77, 122, 191, 0.05) 100%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}

.select-trigger:hover::before {
  opacity: 1;
}

.select-trigger:hover {
  border-color: rgba(77, 122, 191, 0.6);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(77, 122, 191, 0.2);
}

.selected-option {
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.select-arrow {
  width: 16px;
  height: 16px;
  color: rgba(255, 255, 255, 0.7);
  transition: transform 0.3s ease, color 0.3s ease;
}

.custom-select.open .select-arrow {
  transform: rotate(180deg);
  color: #4d7abf;
}

.select-options {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(77, 122, 191, 0.3);
  border-radius: 12px;
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.custom-select.open .select-options {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.option {
  display: flex;
  align-items: baseline; /* 改为基线对齐 */
  padding: 12px 14px;
  cursor: pointer; /* 手形光标 */
  border-radius: 0; /* 移除圆角 */
  transition: none; /* 移除所有过渡效果 */
  position: relative;
  border-bottom: 1px solid transparent; /* 为下划线做准备 */
}

/* 简洁的hover效果：只显示下划线 */
.option:hover {
  cursor: pointer; /* 确保鼠标为手形 */
  border-bottom-color: #ffffff; /* hover时显示白色下划线 */
}

/* 选中状态：只有下划线，无背景色 */
.option.selected {
  border-bottom-color: #4d7abf; /* 选中状态的蓝色下划线 */
}

.lang-code {
  font-size: 0.8rem;
  font-weight: 600;
  color: #ffffff;
  margin-right: 10px;
  line-height: 1; /* 添加行高确保基线对齐 */
  letter-spacing: 0.05em;
}

.lang-name {
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1; /* 添加行高确保基线对齐 */
}

/* 选中状态：语言代码和语言名称都变蓝色 */
.option.selected .lang-name {
  color: #4d7abf;
  font-weight: 600;
}

.option.selected .lang-code {
  color: #4d7abf; /* CN/EN 也变蓝色 */
  font-weight: 700;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .language-switch {
    top: 15px;
    right: 15px;
  }

  .custom-select {
    width: 120px;
  }

  .select-trigger {
    padding: 10px 12px;
    border-radius: 10px;
  }

  .selected-option {
    font-size: 0.8rem;
  }

  .select-arrow {
    width: 14px;
    height: 14px;
  }

  .option {
    padding: 10px 12px;
  }

  .lang-code {
    font-size: 0.7rem;
    margin-right: 8px;
  }

  .lang-name {
    font-size: 0.8rem;
  }
}

/* 暗色主题优化 */
@media (prefers-color-scheme: dark) {
  .select-trigger {
    background: rgba(0, 0, 0, 0.9);
  }

  .select-options {
    background: rgba(0, 0, 0, 0.95);
  }
}
