/* Tailwind CSS（CDN 引入方式，供工具类使用） */
@import url('https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css');

/* 设计令牌：与安装器 installer_src/ui_style.py 的 palette() 一一对应（三处视觉一致） */
:root {
  --primary: #2B6DF6;
  --primary-light: #3D82FF;
  --primary-dark: #1E5AD6;
  --bg: #FFFFFF;
  --panel: #F5F6F8;
  --track: #EEF0F3;
  --text: #1A1A1A;
  --text-soft: #4A4F57;
  --muted: #8A8F98;
  --success: #12B76A;
  --warning: #F79009;
  --danger: #F04438;
  --border: #E6E9EE;
  --radius: 14px;
  --radius-sm: 10px;
  --font: "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* 背景光晕：极浅渐变，避免纯白单调 */
.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(680px 360px at 18% -8%, rgba(43, 109, 246, 0.10), transparent 62%),
    radial-gradient(620px 340px at 84% 4%, rgba(61, 130, 255, 0.10), transparent 60%),
    linear-gradient(180deg, #FBFCFE 0%, #FFFFFF 46%);
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 56px 20px 64px;
}

/* ── 顶部 ─────────────────────────────────────────────────────────── */
.hero { text-align: center; margin-bottom: 28px; }

.avatar {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(43, 109, 246, 0.16);
  background: var(--panel);
  display: flex;
  align-items: center;
  justify-content: center;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-fallback {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 600; color: var(--primary);
}

.app-name {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.subtitle { margin: 0; color: var(--muted); font-size: 15px; font-weight: 500; }

/* ── 版本卡片 ─────────────────────────────────────────────────────── */
.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 18px 48px rgba(26, 26, 26, 0.07);
  padding: 24px;
  opacity: 0;
  transform: translateY(10px);
  animation: rise 0.22s ease-out forwards;
}

@keyframes rise {
  to { opacity: 1; transform: translateY(0); }
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.version-line { display: flex; align-items: center; gap: 10px; }

.version { font-size: 20px; font-weight: 600; }

.badge {
  background: var(--panel);
  color: var(--text-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
}

.published { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

.logo-chip {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.logo-chip img { width: 28px; height: 28px; object-fit: contain; }

.notes {
  margin: 18px 0 20px;
  padding: 14px 16px;
  background: var(--panel);
  border-radius: var(--radius-sm);
  list-style: none;
  color: var(--text-soft);
}
.notes li { position: relative; padding-left: 16px; line-height: 1.9; }
.notes li::before {
  content: "";
  position: absolute; left: 0; top: 12px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.75;
}

/* ── 下载按钮 ─────────────────────────────────────────────────────── */
.actions { display: flex; gap: 12px; }

.btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: 44px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
  outline: none;
}

.btn-primary {
  color: #FFFFFF;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
  box-shadow: 0 10px 24px rgba(43, 109, 246, 0.24);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(43, 109, 246, 0.30); }
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
}
.btn-ghost:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(26, 26, 26, 0.08); }

.btn:focus-visible { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--primary); }
.btn.is-disabled { opacity: 0.5; pointer-events: none; }

.btn-size { font-weight: 500; font-size: 13px; opacity: 0.9; }

.install-hint { margin: 14px 0 0; color: var(--muted); font-size: 13px; }
.install-hint strong { color: var(--text-soft); }

/* ── 校验区 ───────────────────────────────────────────────────────── */
.verify {
  margin-top: 18px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 16px;
}

.verify summary {
  cursor: pointer;
  padding: 12px 0;
  font-size: 14px;
  color: var(--text-soft);
  list-style: none;
}
.verify summary::-webkit-details-marker { display: none; }
.verify summary::before { content: "▸ "; color: var(--muted); }
.verify details[open] summary::before { content: "▾ "; }

.verify-body {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 8px;
}
.verify-body code {
  flex: 1;
  word-break: break-all;
  background: var(--panel);
  border-radius: 8px;
  padding: 8px 10px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  color: var(--text-soft);
}

.copy {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 13px;
}
.copy:hover { background: var(--panel); }

.verify-tip { margin: 0 0 12px; color: var(--muted); font-size: 12px; }
.verify-tip code { background: var(--panel); border-radius: 4px; padding: 1px 5px; }

/* ── 未签名提示 ───────────────────────────────────────────────────── */
.notice {
  margin-top: 16px;
  background: #FFF9EC;
  border: 1px solid #FCE4B8;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  color: #7A5A12;
}
.notice strong { display: block; margin-bottom: 4px; color: #6B4E0C; }
.notice p { margin: 0; font-size: 13px; line-height: 1.75; }
.notice em { font-style: normal; font-weight: 600; }

/* ── 页脚 ─────────────────────────────────────────────────────────── */
.foot {
  margin-top: 22px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}
.foot .dot { margin: 0 8px; }

/* ── 响应式：窄屏按钮纵向堆叠 ─────────────────────────────────────── */
@media (max-width: 640px) {
  .wrap { padding: 36px 16px 48px; }
  .actions { flex-direction: column; }
  .btn { width: 100%; }
  .card { padding: 18px; }
  .logo-chip { display: none; }
  .version-line { justify-content: space-between; width: 100%; }
}

/* ── 无障碍：尊重"减少动态效果" ───────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .card { animation: none; opacity: 1; transform: none; }
  .btn { transition: none; }
  .btn:hover { transform: none; }
}
