/* ============================================================
   APK 下载站点 - 样式表
   橘红渐变主题 · 参考图像风格还原
   ============================================================ */

/* ---------- CSS 变量 ---------- */
:root {
  --color-primary: #FFFFFF;
  --color-on-primary: #FF5A4D;
  --color-secondary: rgba(255, 255, 255, 0.72);
  --color-accent: #FFFFFF;
  --color-background: linear-gradient(160deg, #FF7A3D 0%, #FF5A4D 45%, #FF4D6A 100%);
  --color-foreground: #FFFFFF;
  --color-muted: rgba(255, 255, 255, 0.24);
  --color-border: rgba(255, 255, 255, 0.32);
  --color-destructive: #FFE4E6;
  --color-ring: #FFFFFF;
  --color-success: #FFFFFF;
  --color-card-bg: rgba(255, 255, 255, 0.12);
  --color-card-border: rgba(255, 255, 255, 0.22);
  --color-text-primary: #FFFFFF;
  --color-text-secondary: rgba(255, 255, 255, 0.82);
  --color-text-muted: rgba(255, 255, 255, 0.62);
  --color-surface: rgba(255, 255, 255, 0.14);
  --color-surface-hover: rgba(255, 255, 255, 0.22);

  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-xl: 28px;

  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.1);
  --shadow-card-hover: 0 8px 32px rgba(0, 0, 0, 0.14);
  --shadow-btn: 0 4px 16px rgba(0, 0, 0, 0.15);
  --shadow-btn-hover: 0 6px 24px rgba(0, 0, 0, 0.22);

  --font-heading: "Lora", "Noto Sans SC", Georgia, serif;
  --font-sans: "Raleway", "Noto Sans SC", -apple-system, BlinkMacSystemFont, sans-serif;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- 基础重置 ---------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: #FF5A4D;
  background: -webkit-linear-gradient(160deg, #FF7A3D 0%, #FF5A4D 45%, #FF4D6A 100%);
  background: -moz-linear-gradient(160deg, #FF7A3D 0%, #FF5A4D 45%, #FF4D6A 100%);
  background: -o-linear-gradient(160deg, #FF7A3D 0%, #FF5A4D 45%, #FF4D6A 100%);
  background: linear-gradient(160deg, #FF7A3D 0%, #FF5A4D 45%, #FF4D6A 100%);
  background-attachment: fixed;
  background-size: cover;
  color: var(--color-text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

/* ---------- 背景装饰 ---------- */
.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.18;
  pointer-events: none;
  z-index: 0;
}

.bg-orb--1 {
  width: 340px;
  height: 340px;
  background: rgba(255, 255, 255, 0.18);
  top: -80px;
  right: -60px;
  animation: orbFloat1 14s ease-in-out infinite;
}

.bg-orb--2 {
  width: 280px;
  height: 280px;
  background: rgba(255, 255, 255, 0.14);
  bottom: 15%;
  left: -100px;
  animation: orbFloat2 18s ease-in-out infinite;
}

@keyframes orbFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-30px, 40px) scale(1.08); }
  66% { transform: translate(20px, -20px) scale(0.95); }
}

@keyframes orbFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(50px, -30px) scale(1.12); }
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.06) 1px, transparent 0);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* 参考图像中的同心圆环装饰 */
.bg-rings {
  position: fixed;
  bottom: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 140vw;
  height: 140vw;
  pointer-events: none;
  z-index: 0;
  opacity: 0.18;
  background:
    repeating-radial-gradient(
      circle at center,
      transparent 0,
      transparent 18px,
      rgba(255, 255, 255, 0.35) 19px,
      rgba(255, 255, 255, 0.35) 20px
    );
}

/* ---------- 主容器 ---------- */
.container {
  position: relative;
  z-index: 1;
  max-width: 500px;
  margin: 0 auto;
  padding: 30px 18px 60px;
}

/* ---------- App 品牌区域 ---------- */
.brand-section {
  text-align: center;
  padding: 24px 0 32px;
  animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.app-icon-wrapper {
  position: relative;
  display: inline-block;
  margin-bottom: 20px;
}

.app-icon {
  width: 84px;
  height: 84px;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.15);
  position: relative;
  z-index: 1;
  animation: iconPulse 4s ease-in-out infinite;
}

.app-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.app-icon img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

@keyframes iconPulse {
  0%, 100% { box-shadow: 0 8px 28px rgba(0, 0, 0, 0.15); }
  50% { box-shadow: 0 8px 40px rgba(0, 0, 0, 0.22); }
}

.app-icon-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 110px;
  height: 110px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.45);
  filter: blur(28px);
  opacity: 0.35;
  z-index: 0;
}

.app-name {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}

.app-desc {
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  max-width: 320px;
  margin: 0 auto 16px;
  line-height: 1.5;
  font-weight: 500;
}

.brand-meta {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

.meta-item svg {
  flex-shrink: 0;
  color: var(--color-primary);
  opacity: 0.6;
}

/* ---------- 下载卡片 ---------- */
.download-card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-xl);
  padding: 24px 20px;
  margin-bottom: 16px;
  position: relative;
  box-shadow: var(--shadow-card);
  animation: fadeInUp 0.6s ease-out 0.15s both;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.download-card:hover {
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: var(--shadow-card-hover);
}

.card-badge {
  position: absolute;
  top: -1px;
  right: 24px;
  background: rgba(255, 255, 255, 0.95);
  color: #FF5A4D;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 14px;
  border-radius: 0 0 10px 10px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 18px;
  padding-top: 4px;
}

.version-info {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.version-label {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

.version-number {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-text-primary);
}

.version-date {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

/* 文件元信息 */
.file-meta {
  display: flex;
  gap: 12px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.meta-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--color-text-secondary);
  background: var(--color-surface);
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: 500;
}

.meta-row svg {
  flex-shrink: 0;
  color: var(--color-primary);
  opacity: 0.7;
}

/* ---------- 下载按钮 ---------- */
.btn-download {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 24px;
  border: none;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.95);
  color: #FF5A4D;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-btn);
  transition: all var(--transition);
  margin-bottom: 20px;
}

.btn-download::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,90,77,0.08), transparent);
  opacity: 0;
  transition: opacity var(--transition);
}

.btn-download:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-btn-hover);
  background: #FFFFFF;
}

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

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

.btn-download.downloading {
  background: rgba(255, 255, 255, 0.55);
  color: rgba(255, 255, 255, 0.9);
  pointer-events: none;
  box-shadow: none;
}

.btn-download .btn-icon {
  display: flex;
  align-items: center;
}

.btn-download .btn-icon svg {
  transition: transform var(--transition);
}

.btn-download.downloading .btn-icon svg {
  animation: bounceDown 0.6s ease-in-out infinite;
}

@keyframes bounceDown {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}

/* ---------- 下载进度条 ---------- */
.download-progress {
  display: none;
  margin-bottom: 20px;
  animation: fadeIn 0.3s ease-out;
}

.download-progress.active {
  display: block;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #FFFFFF, rgba(255, 255, 255, 0.85));
  border-radius: 4px;
  transition: width 0.3s ease-out;
  position: relative;
}

.progress-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,90,77,0.25), transparent);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
}

.progress-text {
  color: var(--color-text-secondary);
  font-weight: 500;
}

.progress-percent {
  color: #FFFFFF;
  font-weight: 700;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---------- 下载控制按钮 ---------- */
.progress-controls {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.btn-ctrl {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-card-bg);
  color: var(--color-text-secondary);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-ctrl:hover {
  background: var(--color-surface);
  color: var(--color-text-primary);
}

.btn-pause:hover {
  border-color: rgba(255, 255, 255, 0.55);
  color: #FFFFFF;
}

.btn-resume {
  border-color: rgba(255, 255, 255, 0.35);
  color: var(--color-accent);
}

.btn-resume:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.55);
}

.btn-cancel:hover {
  border-color: rgba(255, 255, 255, 0.55);
  color: #FFFFFF;
}

/* ---------- 更新日志 ---------- */
.changelog-section {
  border-top: 1px solid var(--color-border);
  padding-top: 16px;
}

.changelog-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 12px;
}

.changelog-title svg {
  color: var(--color-primary);
  opacity: 0.7;
}

.changelog-list {
  list-style: none;
  padding: 0;
}

.changelog-list li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 8px;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
  font-weight: 500;
}

.changelog-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #FFFFFF;
  opacity: 0.9;
}

/* ---------- 历史版本区域 ---------- */
.history-section {
  margin-bottom: 40px;
  animation: fadeInUp 0.6s ease-out 0.3s both;
}

.history-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  background: var(--color-card-bg);
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-lg);
  color: var(--color-text-secondary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow-card);
}

.history-toggle:hover {
  background: var(--color-surface);
  color: var(--color-text-primary);
  border-color: rgba(255, 255, 255, 0.35);
}

.toggle-icon {
  transition: transform 0.3s ease;
}

.toggle-icon.open {
  transform: rotate(180deg);
}

.history-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, margin 0.3s ease;
}

.history-list.open {
  max-height: 2000px;
  margin-top: 12px;
}

/* 历史版本卡片 */
.history-item {
  background: var(--color-card-bg);
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: all var(--transition);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.history-item:hover {
  background: var(--color-surface);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: var(--shadow-card);
}

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

.history-item-version {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 4px;
}

.history-item-meta {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-weight: 500;
}

.btn-download-sm {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 25px;
  color: #FFFFFF;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-download-sm:hover {
  background: rgba(255, 255, 255, 0.28);
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.btn-download-sm svg {
  width: 14px;
  height: 14px;
}

/* ---------- 页脚 ---------- */
.site-footer {
  text-align: center;
  padding: 30px 0 10px;
  color: var(--color-text-muted);
  font-size: 0.78rem;
  animation: fadeInUp 0.6s ease-out 0.45s both;
  font-weight: 500;
}

.footer-sub {
  margin-top: 6px;
  font-size: 0.72rem;
  opacity: 0.6;
}

/* ---------- Toast 通知 ---------- */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 12px 24px;
  border-radius: 25px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #FF5A4D;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  animation: toastIn 0.35s ease-out, toastOut 0.35s ease-in 2.5s forwards;
  pointer-events: auto;
  text-align: center;
  white-space: nowrap;
}

.toast-success { background: rgba(255, 255, 255, 0.95); }
.toast-error { background: rgba(255, 255, 255, 0.95); }
.toast-info { background: rgba(255, 255, 255, 0.95); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-10px); }
}

/* ---------- 响应式 - 平板及以上 ---------- */
@media (min-width: 640px) {
  .container {
    padding: 50px 32px 80px;
  }

  .app-name {
    font-size: 2.2rem;
  }

  .version-number {
    font-size: 1.5rem;
  }

  .file-meta {
    gap: 12px;
  }

  .download-card {
    padding: 30px 28px;
  }

  .btn-download {
    padding: 18px 28px;
    font-size: 1.05rem;
  }
}

/* ---------- 响应式 - 桌面 ---------- */
@media (min-width: 1024px) {
  .container {
    max-width: 560px;
  }
}

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ---------- 选中文字颜色 ---------- */
::selection {
  background: rgba(255, 255, 255, 0.3);
  color: #FFFFFF;
}
