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

html,
body {
  width: 100%;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Microsoft YaHei, Source Han Sans SC, Noto Sans CJK SC, WenQuanYi Micro Hei,
    sans-serif;
  font-size: 14px;
  padding: 0;
  margin: 0;
  border: 0;
  min-width: 1280px;
  min-height: 600px;
  overflow: auto;
}

#root,
.download-wrap {
  width: 100%;
  height: 100%;
  color: #58647d;
  position: relative;
}

.download-wrap {
  width: 100%;
  height: 100%;
  background-image: url('./img/download_bg.png');
  overflow: hidden;
  text-align: center;
  background-position-x: center;
  background-position-y: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-size: cover;
}

.logo-text {
  position: absolute;
  top: 48px;
  left: 8%;
  width: 160px;
}

.download-content {
  display: block;
  margin-top: 7%;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  max-width: 1160px;
}

.download-title {
  color: #1a223e;
  font-size: 56px;
  line-height: 56px;
  font-weight: 600;
}

.download-tip {
  margin-top: 22px;
  color: #58647d;
  font-size: 14px;
}

/* ===== 主下载按钮区域 ===== */
.main-download-area {
  margin-top: 32px;
}

.main-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 52px;
  background: #4b4cd3;
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(75, 76, 211, 0.3);
  transition: all 0.2s ease;
  letter-spacing: 0.5px;
}

.main-download-btn:hover {
  background: #3a3bb0;
  box-shadow: 0 6px 24px rgba(75, 76, 211, 0.4);
  transform: translateY(-1px);
}

.main-download-btn:active {
  transform: translateY(0);
}

.main-download-btn.disabled {
  background: #c4c5d6;
  cursor: not-allowed;
  box-shadow: none;
}

.main-download-aux {
  margin-top: 10px;
  font-size: 13px;
  color: #58647d;
}

/* ===== 提示条 ===== */
.tip-bar {
  display: none;
  margin: 14px auto 0;
  max-width: 480px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
}

.tip-bar.visible { display: block; }

.tip-bar.tip-blue {
  background: #dbeafe;
  color: #1d4ed8;
  border: 1px solid #93c5fd;
}

.tip-bar.tip-yellow {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}

.tip-bar.tip-red {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.tip-bar.tip-gray {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

/* ===== 手动选择区域（无法识别时） ===== */
.manual-select-area {
  display: none;
  margin-top: 28px;
}

.manual-select-area.visible { display: block; }

.manual-title {
  font-size: 16px;
  font-weight: 600;
  color: #1a223e;
  margin-bottom: 16px;
}

.manual-cards {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.manual-card {
  width: 200px;
  height: 168px;
  background: #fff;
  border: 1px solid #f4f5ff;
  border-radius: 12px;
  text-align: center;
  padding-top: 28px;
  cursor: pointer;
  transition: all 0.3s;
}

.manual-card:hover {
  box-shadow: 0 4px 16px rgba(73, 74, 150, 0.1);
  border-color: #4b4cd3;
}

.manual-card-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 8px;
}

.manual-card-name {
  font-size: 13px;
  font-weight: 600;
  color: #1a223e;
  margin-bottom: 6px;
}

.manual-card-tag {
  display: inline-block;
  background: #edeeff;
  color: #4b4cd3;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}

/* ===== 其他版本折叠 ===== */
.other-toggle {
  display: none;
  margin-top: 24px;
  font-size: 13px;
  color: #4b4cd3;
  cursor: pointer;
  user-select: none;
  transition: color 0.2s;
}

.other-toggle.visible { display: inline-block; }

.other-toggle:hover {
  color: #3a3bb0;
  text-decoration: underline;
}

.other-panel {
  display: none;
  max-width: 600px;
  max-height: 28vh;
  overflow-y: auto;
  margin: 16px auto 0;
  text-align: left;
  padding-right: 4px;
}

.other-panel.expanded { display: block; }

.other-panel.safari-all-versions {
  display: block;
  max-width: 760px;
  max-height: none;
  overflow: visible;
  margin-top: 24px;
  padding-right: 0;
}

.other-panel::-webkit-scrollbar { width: 4px; }
.other-panel::-webkit-scrollbar-thumb { background: rgba(75, 76, 211, 0.2); border-radius: 2px; }
.other-panel::-webkit-scrollbar-track { background: transparent; }

.other-section-title {
  font-size: 13px;
  font-weight: 600;
  color: #1a223e;
  padding-bottom: 6px;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 10px;
}

.other-section-title + .other-grid {
  margin-bottom: 16px;
}

.other-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.other-item {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  background: #fff;
  transition: all 0.15s;
}

.other-item:hover {
  border-color: #4b4cd3;
  box-shadow: 0 2px 8px rgba(75, 76, 211, 0.1);
}

.other-item-info {
  flex: 1;
  min-width: 0;
}

.other-item-label {
  font-size: 13px;
  font-weight: 600;
  color: #1a223e;
}

.other-item-desc {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
}

.other-item-action {
  color: #4b4cd3;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
  margin-left: 12px;
}

/* ===== 旧卡片布局（兼容 urls 模式） ===== */
.download-card-wrap {
  margin-top: 40px;
  width: 100%;
  display: none;
}

.download-card-wrap.visible { display: block; }

.download-card {
  width: 264px;
  height: 228px;
  float: left;
  overflow: hidden;
  margin: auto;
  margin-right: 24px;
  position: relative;
  transition: all 0.3s ease;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #f4f5ff;
  backdrop-filter: blur(10px);
  cursor: pointer;
}

.download-card.has-recommended { overflow: visible; }
.download-card::after { clear: both; }
.download-card:hover { box-shadow: 0px 4px 16px 0px rgba(73, 74, 150, 0.1); }
.download-card:hover .download-normal { display: none; }
.download-card:hover .download-hover { display: block; }
.download-card.has-recommended .download-normal { display: block; }
.download-card.has-recommended .download-hover { display: none; }
.download-card.has-recommended:hover .download-normal { display: none; }
.download-card.has-recommended:hover .download-hover { display: block; }

.download-hover,
.download-normal {
  width: 264px;
  height: 228px;
  transition: all 0.5s ease;
  position: absolute;
  top: 0;
}

.download-normal { display: block; }
.download-hover { color: #7d8699; display: none; }

.download-text {
  font-size: 16px;
  color: #1a223e;
  margin-top: 18px;
  margin-bottom: 8px;
  font-weight: 600;
}

.upload-type {
  height: 24px;
  line-height: 24px;
  display: inline-block;
  background: #edeeff;
  border-radius: 4px;
  color: #4b4cd3;
  font-size: 12px;
  padding: 0 8px;
}

.upload-label {
  font-size: 11px;
  color: #7d8699;
  margin-top: 4px;
  line-height: 16px;
}

.download-card-tip {
  color: #7d8699;
  font-size: 14px;
  height: 24px;
  line-height: 24px;
}

.brand-icon,
.download-icon {
  width: 50px;
  height: 50px;
  display: block;
  margin: auto;
  margin-top: 40px;
}

/* ===== 高亮动画（推荐标签） ===== */
@keyframes highlight {
  0% { transform: scale(1); background-color: transparent; }
  50% { transform: scale(1.05); background-color: #4b4ccc; }
  100% { transform: scale(1); background-color: #e6e6ff; }
}

.highlight-animation {
  animation: highlight 0.8s ease-in-out 3;
  position: relative;
  overflow: visible;
  box-shadow: 0 0 10px #4b4cd3;
  border-radius: 10px;
}

.download-card:hover .highlight-animation { animation: none; background-color: #e6e6ff; transform: scale(1); }

.highlight-animation::before {
  content: attr(data-recommended);
  position: absolute;
  top: -10px;
  right: -20px;
  background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(238, 90, 111, 0.4), 0 0 0 2px #ffffff;
  z-index: 10;
  white-space: nowrap;
  transform: rotate(5deg);
  animation: tagPulse 2s ease-in-out infinite;
}

.download-card:hover .highlight-animation::before { animation: none; transform: rotate(5deg) scale(1); }

@keyframes tagPulse {
  0%, 100% { transform: rotate(-10deg) scale(1); }
  50% { transform: rotate(10deg) scale(1.2); }
}

.highlight-animation .download-text { color: #4b4ccc; font-weight: bold; }

/* ===== 安装文档入口 ===== */
.download-install {
  background: #ffffff;
  border-radius: 24px;
  border: 1px solid #f4f5ff;
  backdrop-filter: blur(10px);
  cursor: pointer;
  padding: 14px 24px;
  position: fixed;
  bottom: 80px;
  right: 80px;
  transition: all 0.3s ease;
  display: none;
}

.download-install:hover {
  box-shadow: 0px 6px 24px 0px rgba(58, 59, 134, 0.08);
  border: 1px solid #4b4cd3;
}

.download-install-text-wrap { display: inline-block; }
.icon-anzhuangwendang { color: #3d4962; width: 20px; position: relative; top: 3px; }
.download-install-text { margin-right: auto; font-weight: 600; color: #1a223e; margin-left: 4px; font-size: 16px; }
.icon-arrow-right { color: #3d4962; }
.icon-arrow-right:hover { color: #4b4cd3; }

/* ===== 组织码 ===== */
.org-code-container {
  margin-top: 32px;
  width: 100%;
  display: none;
  justify-content: center;
  padding: 20px 0;
}

.org-code-content {
  background-color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  display: flex;
  align-items: center;
}

#org-code-label { color: #58647d; margin-right: 10px; font-size: 14px; }
#org-code-value { color: #1a223e; font-weight: 500; font-size: 14px; margin-right: 15px; }

.copy-btn {
  background-color: #4b4cd3;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 5px 15px;
  cursor: pointer;
  font-size: 13px;
  transition: background-color 0.3s ease;
  min-width: 72px;
  text-align: center;
  white-space: nowrap;
}

.copy-btn:hover { background-color: #3a3bb0; }
