/* 下载页面样式 - 白色主题 */

:root {
  --primary       : #2563EB;
  --primary-light : #3B82F6;
  --primary-dark  : #1D4ED8;
  --accent        : #0EA5E9;
  --bg-primary    : #FFFFFF;
  --bg-secondary  : #F8FAFC;
  --card-bg       : #FFFFFF;
  --card-border   : #E2E8F0;
  --card-shadow   : rgba(15, 23, 42, 0.08);
  --text-primary  : #0F172A;
  --text-secondary: #475569;
  --text-muted    : #94A3B8;
}

* {
  margin    : 0;
  padding   : 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background : var(--bg-primary);
  min-height : 100vh;
  color      : var(--text-primary);
  overflow-x : hidden;
  position   : relative;
}

/* 背景装饰 - 淡雅渐变 */
body::before {
  content : '';
  position: fixed;
  top     : 0;
  left    : 0;
  width   : 100%;
  height  : 100%;
  background:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(37, 99, 235, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(14, 165, 233, 0.05) 0%, transparent 50%),
    linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 30%);
  z-index: -1;
}

/* 顶部装饰线 */
body::after {
  content   : '';
  position  : fixed;
  top       : 0;
  left      : 0;
  right     : 0;
  height    : 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent), var(--primary-light));
  z-index   : 100;
}

.download-container {
  max-width: 1200px;
  margin   : 0 auto;
  padding  : 4rem 1.5rem 3rem;
}

/* 头部 */
.header {
  text-align   : center;
  margin-bottom: 4rem;
  animation    : fadeInDown 0.8s ease-out;
}

@keyframes fadeInDown {
  from {
    opacity  : 0;
    transform: translateY(-30px);
  }

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

.logo {
  width        : 180px;
  margin-bottom: 1.5rem;
}

.header h1 {
  font-size              : 2.25rem;
  font-weight            : 700;
  letter-spacing         : 0.02em;
  background             : linear-gradient(135deg, var(--text-primary) 0%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip        : text;
}

.header p {
  margin-top : 0.75rem;
  color      : var(--text-secondary);
  font-size  : 1rem;
  font-weight: 400;
}

/* 下载卡片网格 */
.download-grid {
  display              : grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap                  : 2rem;
  margin-bottom        : 3rem;
}

/* 卡片样式 */
.download-card {
  background   : var(--card-bg);
  border       : 1px solid var(--card-border);
  border-radius: 20px;
  padding      : 2.5rem 2rem;
  text-align   : center;
  transition   : all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  animation    : fadeInUp 0.8s ease-out backwards;
  position     : relative;
  overflow     : hidden;
  box-shadow   :
    0 1px 3px var(--card-shadow),
    0 4px 12px rgba(15, 23, 42, 0.04);
}

.download-card:nth-child(1) {
  animation-delay: 0.1s;
}

.download-card:nth-child(2) {
  animation-delay: 0.2s;
}

.download-card:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes fadeInUp {
  from {
    opacity  : 0;
    transform: translateY(40px);
  }

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

.download-card::before {
  content   : '';
  position  : absolute;
  top       : 0;
  left      : 0;
  right     : 0;
  height    : 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity   : 0;
  transition: opacity 0.4s;
}

.download-card:hover {
  transform   : translateY(-6px);
  border-color: rgba(37, 99, 235, 0.25);
  box-shadow  :
    0 8px 24px rgba(37, 99, 235, 0.12),
    0 16px 48px rgba(15, 23, 42, 0.08);
}

.download-card:hover::before {
  opacity: 1;
}

.card-title {
  font-size     : 1.5rem;
  font-weight   : 700;
  margin-bottom : 0.5rem;
  letter-spacing: 0.01em;
  color         : var(--text-primary);
  position      : relative;
  display       : inline-block;
}

.card-title::after {
  content      : '';
  position     : absolute;
  bottom       : -8px;
  left         : 50%;
  transform    : translateX(-50%);
  width        : 36px;
  height       : 3px;
  background   : linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 2px;
}

.card-desc {
  font-size    : 0.9rem;
  color        : var(--text-secondary);
  margin-bottom: 2rem;
  margin-top   : 1rem;
  line-height  : 1.6;
}

/* 二维码样式 */
.qr-wrapper {
  background   : var(--bg-secondary);
  padding      : 12px;
  border-radius: 14px;
  display      : inline-block;
  border       : 1px solid var(--card-border);
  transition   : all 0.3s ease;
}

.download-card:hover .qr-wrapper {
  transform : scale(1.02);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.1);
}

.qr-wrapper img {
  width        : 120px;
  height       : 120px;
  display      : block;
  border-radius: 8px;
}

.scan-tip {
  display        : flex;
  align-items    : center;
  justify-content: center;
  gap            : 0.5rem;
  font-size      : 0.85rem;
  color          : var(--text-muted);
  margin-bottom  : 1.25rem;
}

.scan-tip svg {
  width : 18px;
  height: 18px;
  color : var(--primary-light);
}

/* 多版本二维码区域 */
.qr-versions {
  display        : flex;
  flex-wrap      : wrap;
  justify-content: center;
  gap            : 1.5rem;
  margin-bottom  : 1.5rem;
}

.qr-version {
  display       : flex;
  flex-direction: column;
  align-items   : center;
  gap           : 0.75rem;
}

.qr-version .version-label {
  font-size    : 0.75rem;
  font-weight  : 500;
  color        : var(--primary);
  padding      : 0.35rem 0.85rem;
  background   : rgba(37, 99, 235, 0.08);
  border-radius: 20px;
  display      : flex;
  align-items  : center;
  gap          : 0.35rem;
  border       : 1px solid rgba(37, 99, 235, 0.15);
}

.qr-version .version-label svg {
  width : 14px;
  height: 14px;
}

.qr-version .qr-wrapper {
  margin-bottom: 0;
}

/* 下载按钮组 */
.btn-group {
  display       : flex;
  flex-direction: column;
  align-items   : center;
  gap           : 0.75rem;
  width         : 100%;
  max-width     : 280px;
  margin        : 0 auto;
}

/* 下载按钮 */
.download-btn {
  display        : inline-flex;
  align-items    : center;
  justify-content: center;
  width          : 100%;
  max-width      : 280px;
  padding        : 0.875rem 1.5rem;
  font-size      : 0.9rem;
  font-weight    : 500;
  letter-spacing : 0.03em;
  color          : #fff;
  background     : linear-gradient(135deg, #3B82F6 0%, #2563EB 50%, #1D4ED8 100%);
  border         : none;
  border-radius  : 12px;
  cursor         : pointer;
  text-decoration: none;
  transition     : all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow     : 0 4px 14px rgba(37, 99, 235, 0.25);
  position       : relative;
  overflow       : hidden;
}

.download-btn::before {
  content   : '';
  position  : absolute;
  top       : 0;
  left      : -100%;
  width     : 100%;
  height    : 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.download-btn:hover {
  transform : translateY(-2px);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
}

.download-btn:hover::before {
  left: 100%;
}

.download-btn:active {
  transform : translateY(0);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* 次要按钮（Chrome 卡片用） */
.download-btn.secondary {
  background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
}

.download-btn.secondary:hover {
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4);
}

/* 页脚 */
.footer {
  text-align : center;
  padding-top: 2rem;
  border-top : 1px solid var(--card-border);
  animation  : fadeIn 1s ease-out 0.5s backwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.footer p {
  color    : var(--text-muted);
  font-size: 0.85rem;
}

.footer a {
  color          : var(--primary);
  text-decoration: none;
  transition     : color 0.3s;
}

.footer a:hover {
  color: var(--accent);
}

/* 遮罩层 */
.mask {
  background     : rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  position       : fixed;
  left           : 0;
  top            : 0;
  width          : 100%;
  height         : 100%;
  z-index        : 998;
  flex-direction : column;
  align-items    : center;
  padding-top    : 120px;
}

.mask.show-flex {
  display: flex;
}

.mask-icon {
  width          : 61px;
  height         : 81px;
  background     : url(../images/arrow.svg) no-repeat;
  background-size: cover;
  position       : absolute;
  right          : 44px;
  top            : 0px;
  filter         : brightness(0.3);
}

.mask-text {
  width        : 280px;
  margin       : 0 auto;
  font-size    : 1.1rem;
  color        : #fff;
  border       : 2px dashed #fff;
  padding      : 1.25rem 2rem;
  border-radius: 16px;
  line-height  : 1.8;
  text-align   : center;
  background   : rgba(37, 99, 235, 0.04);
}

.hide {
  display: none !important;
}

/* Chrome 图标占位区 */
.chrome-placeholder {
  height         : 192px;
  display        : flex;
  align-items    : center;
  justify-content: center;
  margin-bottom  : 1.5rem;
}

.chrome-placeholder svg {
  opacity: 0.9;
}

/* 响应式 */
@media (max-width: 768px) {
  html {
    font-size: 14px;
  }

  .download-container {
    padding: 4rem 1rem 2rem;
  }

  .header {
    margin-bottom: 2rem;
    padding-top  : 1rem;
  }

  .logo {
    width: 140px;
  }

  .header h1 {
    font-size: 1.75rem;
  }

  .download-grid {
    gap: 1.5rem;
  }

  .download-card {
    padding      : 2rem 1.25rem;
    border-radius: 16px;
  }

  .qr-versions {
    gap: 1rem;
  }

  .qr-wrapper {
    padding: 10px;
  }

  .qr-wrapper img {
    width : 100px;
    height: 100px;
  }

  .qr-version .version-label {
    font-size: 0.7rem;
    padding  : 0.25rem 0.6rem;
  }

  .btn-group {
    max-width: 320px;
    gap      : 0.875rem;
    padding  : 0 1rem;
  }

  .btn-group .download-btn {
    max-width    : 320px;
    width        : 100%;
    padding      : 1rem 1.5rem;
    font-size    : 1rem;
    min-height   : 54px;
    border-radius: 14px;
  }

  /* 单独的下载按钮（刷脸签到） */
  .download-btn.mobile-only {
    padding      : 1rem 1.5rem;
    font-size    : 1rem;
    min-height   : 54px;
    border-radius: 14px;
    max-width    : 320px;
  }
}

@media (max-width: 480px) {
  .download-container {
    padding-top: 3.5rem;
  }

  .header {
    padding-top: 0.75rem;
  }

  .download-grid {
    grid-template-columns: 1fr;
  }

  .qr-versions {
    gap: 0.75rem;
  }

  .qr-wrapper img {
    width : 85px;
    height: 85px;
  }

  .btn-group {
    gap      : 0.75rem;
    padding  : 0 0.75rem;
    max-width: 300px;
  }

  .btn-group .download-btn {
    padding   : 0.875rem 1.25rem;
    font-size : 0.9rem;
    min-height: 50px;
    max-width : 300px;
  }

  .download-btn.mobile-only {
    padding   : 0.875rem 1.25rem;
    font-size : 0.9rem;
    min-height: 50px;
    max-width : 300px;
  }
}

/* 桌面端/移动端显示控制 - 由 JS 控制 */
.desktop-only {
  display: none;
}

.mobile-only {
  display: none;
}

/* 显示状态 */
.desktop-only.show {
  display: block;
}

/* 二维码版本区域需要 flex */
.qr-version.desktop-only.show {
  display: flex;
}

.scan-tip.desktop-only.show {
  display: flex;
}

.mobile-only.show {
  display: flex;
}

/* Chrome 卡片特殊样式 */
#chrome-card {
  display       : flex;
  flex-direction: column;
  align-items   : center;
}

#chrome-card .download-btn {
  margin-top   : auto;
  max-width    : 180px;
  padding      : 0.75rem 1.25rem;
  font-size    : 0.85rem;
  min-height   : auto;
  border-radius: 10px;
}

/* Chrome 卡片显隐由 JS 控制 */
#chrome-card.hide {
  display: none !important;
}