/* 全局样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

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

@media (max-width: 1023px) {
  html {
    font-size: 12px;
  }
}

@media (max-width: 749px) {
  html {
    font-size: 10px;
  }
}

body {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  color: #2c3e50;
  line-height: 1.5;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  height: auto;
}

/* 容器 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

/* 首页样式 */
.home {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.inner {
  flex: 1;
}

/* 头部 */
.head {
  height: 6.25rem;
  display: flex;
  align-items: center;
}

/* 主体内容 */
.cont {
  margin-top: 1.875rem;
  text-align: center;
  /* 品牌色微光晕托住下载面板,低于可察觉饱和度阈值 */
  background: radial-gradient(closest-side at 50% 200px, rgba(115, 83, 229, 0.05), transparent 75%);
}

.title {
  font-size: 3rem;
  font-weight: bold;
  margin-bottom: 3.125rem;
  /* halt:全角逗号收半宽,消除「易链，」后的视觉空档 */
  font-feature-settings: 'halt';
}

.title .line1 {
  color: rgba(94, 91, 113, 1);
}

/* 品牌渐变文字:全页仅标题「易链」一处,不扩散 */
.grad-text {
  background: linear-gradient(90deg, #7353E5, #CE4DA4);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* 下载区：识别胶囊 → 平台切换 → 主按钮 → 版本信息 → 状态/帮助 */
/* 交互控件尺寸用 px：根字号随断点在 10-16px 间跳变,rem 会让按钮高度失控 */
/* 面板复刻旧版渐变描边卡片:淡化描边让位给选中态,圆角规则=容器20px/交互件胶囊 */
.load {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 560px;
  margin: 0 auto;
  padding: 22px 20px 16px;
  border: 1.5px solid transparent;
  border-radius: 20px;
  background:
    linear-gradient(180deg, #ffffff, #fdfcff) padding-box,
    linear-gradient(120deg, rgba(115, 83, 229, 0.35), rgba(206, 77, 164, 0.35)) border-box;
  box-shadow: 0 12px 32px rgba(115, 83, 229, 0.08);
}

.load [hidden] {
  display: none !important;
}

/* 平台切换器图标即标签(平台名由主按钮承载),aria-label 兜可访问性 */
.platform-tabs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.platform-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 16px;
  border: 1.5px solid transparent;
  border-radius: 12px;
  background: #f7f6fb padding-box;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.platform-tab:hover:not(:disabled):not(.is-selected) {
  background: #f1eefb padding-box;
}

.platform-tab img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  filter: grayscale(1);
  opacity: 0.75;
}

/* 选中态 = 旧版签名语言:白底渐变描边 */
.platform-tab.is-selected {
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(120deg, #7353E5, #CE4DA4) border-box;
  box-shadow: 0 4px 12px rgba(115, 83, 229, 0.14);
}

.platform-tab.is-selected img {
  filter: none;
  opacity: 1;
}

.chip-row {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.chip {
  padding: 6px 14px;
  border: 1px solid #e6e3f0;
  border-radius: 999px;
  background: #fff;
  color: #5e5b71;
  font-size: 13px;
  cursor: pointer;
}

.chip.is-selected {
  border-color: #7353E5;
  background: rgba(115, 83, 229, 0.08);
  color: #5b3fd6;
  font-weight: 600;
}

.download-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 320px;
  min-height: 54px;
  margin-top: 4px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #7353E5, #B750C9);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(115, 83, 229, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.download-btn img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.download-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(115, 83, 229, 0.32);
}

.download-btn:active {
  transform: translateY(1px);
  box-shadow: 0 4px 10px rgba(115, 83, 229, 0.22);
}

.download-btn.is-probing {
  cursor: progress;
}

.download-btn.is-probing::before {
  content: '';
  position: absolute;
  left: 16px;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.platform-tab:disabled,
.chip:disabled,
.download-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.download-sub {
  font-size: 12px;
  color: #8a8c97;
}

.download-status {
  font-size: 12px;
  color: #6c47e5;
  opacity: 0;
  transition: opacity 0.2s ease;
}

/* 空状态不占位,避免版本信息与卡片底部之间留大片空白 */
.download-status:empty {
  display: none;
}

.download-status.show {
  opacity: 1;
}

/* 安装帮助：仅所选平台有对应教程时显示 */
.help-link {
  font-size: 13px;
  color: #8a8c97;
  text-decoration: underline;
  cursor: pointer;
}

.help-link:hover {
  color: #6c47e5;
}

/* Banner */
.bg1 {
  margin-top: 2.5rem;
  margin-bottom: 2.5rem;
  text-align: center;
}

.bg1 img {
  width: 80%;
  max-width: 900px;
}

/* 产品优势标题（下载区与本节间原靠插图隔开,插图移走后用 margin 拉开） */
.tit {
  font-size: 2.5rem;
  font-weight: bold;
  margin-top: 3.75rem;
  margin-bottom: 3.125rem;
  color: rgba(94, 91, 113, 1);
}

/* 产品优势卡片 */
.items {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  margin-bottom: 4.375rem;
}

.block {
  width: 48%;
  margin: 0 0 3.125rem;
  text-align: center;
  color: #666;
}

.block img {
  width: 5.3125rem;
}

.block .block-tit {
  font-size: 1.5rem;
  font-weight: bold;
  margin: 0.875rem 0;
  color: rgba(94, 91, 113, 1);
}

.block .content {
  /* #999 对白底对比度仅 2.85:1,提到 #73737d 过 WCAG AA */
  color: #73737d;
  font-size: 1.25rem;
  line-height: 1.6;
}

/* Footer */
.footer {
  width: 100%;
  padding: 32px 16px;
  background: #45464B;
  text-align: center;
}

.agreements {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 6px;
}

.agreement {
  font-size: 14px;
}

.agreement a {
  /* 品牌紫深底提亮一档,保证可读对比度 */
  color: #A99AFF;
  text-decoration: none;
}

.agreement a:hover {
  color: #fff;
  text-decoration: underline;
}

.copyright {
  font-size: 13px;
  color: #C9CBD1;
  margin-top: 14px;
}

/* 加载状态 */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
  font-size: 1.25rem;
  color: #999;
}

.loading::after {
  content: '';
  width: 24px;
  height: 24px;
  margin-left: 10px;
  border: 3px solid #ddd;
  border-top-color: #7353E5;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

#load-container[aria-busy='true'] .help-link {
  pointer-events: none;
  opacity: 0.7;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* 下载模块入场:JS 渲染完成时子元素依次浮现 */
@media (prefers-reduced-motion: no-preference) {
  .load > * {
    animation: rise-in 0.5s cubic-bezier(0.16, 1, 0.3, 1) backwards;
  }

  .load > :nth-child(2) { animation-delay: 0.06s; }
  .load > :nth-child(3) { animation-delay: 0.12s; }
  .load > :nth-child(4) { animation-delay: 0.18s; }
  .load > :nth-child(5) { animation-delay: 0.24s; }
  .load > :nth-child(6) { animation-delay: 0.3s; }
  .load > :nth-child(7) { animation-delay: 0.36s; }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

/* 响应式 - 手机端 */
@media (max-width: 767px) {
  .inner {
    padding: 1.875rem 1.875rem 0;
  }

  .container {
    padding: 0 1.25rem;
  }

  .title {
    /* 主标题按视口收缩,避免窄屏孤字折行;兜底均衡断行 */
    font-size: min(2rem, 5.2vw) !important;
    text-wrap: balance;
  }

  .bg1 img {
    width: 70% !important;
    max-width: 320px;
  }

  /* 窄屏平台切换 4 列等宽宫格 */
  .platform-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
    max-width: 340px;
  }

  .platform-tab {
    padding: 14px 4px;
  }

  .download-btn {
    min-height: 52px;
    font-size: 16px;
  }

  /* 缩小紫色图标块,避免与主按钮抢占同屏形成大片紫色 */
  .block img {
    width: 4rem;
  }

  .block {
    width: 48% !important;
  }

  .items {
    margin-bottom: 1.875rem !important;
  }

  .footer {
    padding: 24px 12px !important;
  }
}

/* 响应式 - 平板端 */
@media (min-width: 768px) and (max-width: 1199px) {
  .inner {
    padding: 1.875rem 1.875rem 0;
  }

  .container {
    padding: 0 1.25rem;
  }

  .block {
    width: 48%;
  }
}

/* PC端大屏 */
@media (min-width: 1200px) {
  .block {
    width: 23%;
  }
}
