/* iCloud 风格下载页面样式 */
:root {
  --primary-color: #007aff;
  --primary-hover: #0051d5;
  --text-primary: #1d1d1f;
  --text-secondary: #86868b;
  --bg-primary: #ffffff;
  --bg-secondary: #f5f5f7;
  --border-color: #d2d2d7;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
}

/* 深色模式 */
@media (prefers-color-scheme: dark) {
  :root {
    --primary-color: #0a84ff;
    --primary-hover: #409cff;
    --text-primary: #f5f5f7;
    --text-secondary: #98989d;
    --bg-primary: #1c1c1e;
    --bg-secondary: #2c2c2e;
    --border-color: #38383a;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  }
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

/* 页面容器 */
.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* 头部 */
.header {
  text-align: center;
  margin-bottom: 48px;
}

.header h1 {
  font-size: 48px;
  font-weight: 600;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.header p {
  font-size: 21px;
  color: var(--text-secondary);
  font-weight: 400;
}

/* 应用列表 */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 60px;
}

/* 应用卡片 */
.app-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}

.app-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.app-icon {
  width: 80px;
  height: 80px;
  border-radius: 18px;
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--primary-color), #5e5ce6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  color: white;
  font-weight: 600;
}

.app-name {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}

.app-description {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.app-meta {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.app-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* 详情页面 */
.detail-container {
  max-width: 680px;
  margin: 0 auto;
  padding: 60px 20px;
}

.app-detail {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: 48px;
  box-shadow: var(--shadow-md);
  text-align: center;
}

.app-detail .app-icon {
  width: 120px;
  height: 120px;
  margin: 0 auto 24px;
  font-size: 48px;
}

.app-detail .app-name {
  font-size: 40px;
  margin-bottom: 12px;
}

.app-detail .app-description {
  font-size: 17px;
  margin-bottom: 32px;
  -webkit-line-clamp: unset;
  display: block;
  color: var(--text-secondary);
}

.app-info {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border-color);
}

.app-info-item {
  text-align: center;
}

.app-info-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.app-info-value {
  font-size: 17px;
  font-weight: 600;
}

/* 平台选择 */
.platforms {
  margin-bottom: 32px;
}

.platforms-title {
  font-size: 21px;
  font-weight: 600;
  margin-bottom: 20px;
  text-align: left;
}

.platform-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

/* 平台按钮链接样式 */
.platform-btn-link {
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.platform-btn-link:hover {
  border-color: var(--primary-color);
  background: var(--bg-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.platform-btn-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.platform-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
}

.platform-size {
  font-size: 13px;
  color: var(--text-secondary);
}

.platform-arrow {
  font-size: 18px;
  color: var(--text-secondary);
  margin-left: 12px;
}

/* 下载按钮 */
.download-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: 16px 48px;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.download-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 122, 255, 0.4);
}

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

.download-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 返回链接 */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary-color);
  text-decoration: none;
  font-size: 17px;
  font-weight: 500;
  margin-top: 32px;
  transition: opacity 0.2s ease;
}

.back-link:hover {
  opacity: 0.7;
}

/* 页脚 */
.footer {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
  font-size: 13px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .container {
    padding: 24px 16px;
  }

  .header h1 {
    font-size: 36px;
  }

  .header p {
    font-size: 17px;
  }

  .apps-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .app-card {
    padding: 24px;
  }

  .detail-container {
    padding: 24px 16px;
  }

  .app-detail {
    padding: 32px 24px;
  }

  .app-detail .app-name {
    font-size: 32px;
  }

  .app-info {
    flex-direction: column;
    gap: 16px;
  }

  .platform-buttons {
    grid-template-columns: 1fr;
  }

  .download-btn {
    width: 100%;
    justify-content: center;
  }
}

/* 加载动画 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.app-card, .app-detail {
  animation: fadeIn 0.5s ease;
}

/* 下载图标 */
.download-icon::before {
  content: "↓";
  font-size: 20px;
}

