/* ---------- 下载 ---------- */

.download-section {
  background: linear-gradient(180deg, #eff5ff 0%, var(--bg) 100%);
}

.download-area {
  margin-top: 40px;
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.download-card {
  display: flex;
  flex-direction: column;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 12px 24px rgba(10, 17, 32, 0.04);
}

.download-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.download-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 12px;
  background: rgba(26, 115, 232, 0.08);
  color: var(--primary);
}

.download-icon .icon {
  width: 22px;
  height: 22px;
}

.download-head h3 {
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
}

.download-head p {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 11.5px;
}

.download-version {
  margin-top: 18px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
}

.download-version.missing {
  color: var(--text-muted);
  font-weight: 400;
}

.download-meta {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
}

.download-notes {
  display: -webkit-box;
  min-height: 38px;
  margin-top: 10px;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.download-actions {
  margin-top: 14px;
}

.download-actions .btn {
  height: 44px;
  font-size: 14px;
}

.btn-disabled,
.btn-disabled:hover {
  background: #e9edf4;
  color: var(--text-muted);
  cursor: not-allowed;
}

/* 下载按钮 + 架构菜单（只有 android 拆包、且这一版发了多个包时才有）。
 *
 * 两颗控件拼成一颗药丸：左边下载当前选中的包，右边的箭头开菜单换架构。
 * 摆成一行而不是上下两行，是为了让三张卡片的下载按钮齐平 —— 卡片是 grid
 * 等高，但内容各流各的，中间多插一行按钮就会往下掉一截。 */
.download-split {
  position: relative;
  display: flex;
  width: 100%;
}

/* 内圆角抹平，外圆角由两颗控件各自的那一侧留着 */
.download-split .btn {
  flex: 1;
  min-width: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.download-caret {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  /* 卡片最窄 280px，减掉两侧 padding 只剩 236px。「下载 .apk」加最长的
   * armeabi-v7a 刚刚好放得下，所以这里抠得紧一点。 */
  height: 44px;
  padding: 0 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  color: #fff;
  background: var(--primary);
  /* 用左边框而不是右边框：主按钮那颗药丸的 border 是透明的，
   * 分隔线得从箭头这一侧画出来才挨得上。 */
  border: none;
  border-left: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 0 999px 999px 0;
  cursor: pointer;
  transition: background-color 0.18s ease;
}

.download-caret:hover {
  background: #1666d0;
}

.download-caret svg {
  width: 13px;
  height: 13px;
  flex: none;
  transition: transform 0.18s ease;
}

.download-caret[aria-expanded='true'] svg {
  transform: rotate(180deg);
}

/* 菜单浮在卡片内容之上，宽度与按钮对齐 —— 绝对定位挂在 .download-split
 * 上，不用去猜卡片的 padding 是多少。 */
.download-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 16px 32px rgba(10, 17, 32, 0.14);
}

.download-menu[hidden] {
  display: none;
}

.download-menu-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  width: 100%;
  padding: 9px 10px;
  font: inherit;
  text-align: left;
  color: var(--text);
  background: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.download-menu-item:hover {
  background: rgba(26, 115, 232, 0.06);
}

/* 勾始终占着位置，有没有勾名字都对齐 */
.download-menu-check {
  flex: none;
  color: var(--primary);
  visibility: hidden;
}

.download-menu-item[aria-checked='true'] .download-menu-check {
  visibility: visible;
}

.download-menu-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.download-menu-name {
  font-size: 13px;
  font-weight: 600;
}

.download-menu-hint {
  color: var(--text-muted);
  font-size: 11.5px;
}

.download-menu-size {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
}

.download-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 20px;
  color: var(--text-secondary);
  font-size: 13px;
}

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  flex: none;
  border: 2px solid rgba(26, 115, 232, 0.18);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner.small {
  width: 18px;
  height: 18px;
  border-color: rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
}

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

.download-notice {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.download-notice > .icon {
  width: 22px;
  height: 22px;
  color: var(--text-muted);
}

.download-notice div {
  flex: 1;
  min-width: 0;
}

.download-notice strong {
  display: block;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 500;
}

.download-notice span {
  display: block;
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 12px;
}

.retry-button {
  flex: none;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
}

.retry-button:hover {
  border-color: #c9d3e2;
  color: var(--text);
}

.download-note {
  margin-top: 22px;
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.7;
  text-align: center;
}

