/* ========== 全局样式 ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #4A90E2;
  --primary-dark: #357ABD;
  --success-color: #52C41A;
  --warning-color: #FAAD14;
  --text-primary: #333333;
  --text-secondary: #666666;
  --text-light: #999999;
  --bg-light: #F7F9FC;
  --border-color: #E8E8E8;
  --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-medium: 0 4px 16px rgba(0, 0, 0, 0.12);
  --shadow-heavy: 0 8px 24px rgba(0, 0, 0, 0.16);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 
    'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========== 工具类 ========== */
.hidden {
  display: none !important;
}

.fade-in {
  animation: fadeIn 0.5s ease-in;
}

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

/* ========== 主容器 ========== */
.container {
  background: white;
  border-radius: 24px;
  padding: 40px 30px;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-heavy);
  animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* ========== 头部区域 ========== */
.header {
  text-align: center;
  margin-bottom: 32px;
}

.logo-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 12px;
}

.logo {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  box-shadow: var(--shadow-medium);
}

.app-name {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 1px;
}

.slogan {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 8px;
}

/* ========== 功能特点 ========== */
.features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 32px;
}

.feature-item {
  background: var(--bg-light);
  padding: 14px 20px;
  border-radius: 10px;
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
  text-align: center;
  transition: all 0.3s ease;
}

.feature-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-light);
  background: #e8f4f8;
}

/* ========== 下载区域 ========== */
.download-section {
  margin-bottom: 32px;
}

.download-card {
  background: var(--bg-light);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
}

.platform-badge {
  display: inline-block;
  background: white;
  padding: 8px 20px;
  border-radius: 20px;
  margin-bottom: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
  box-shadow: var(--shadow-light);
}

.download-btn {
  width: 100%;
  padding: 20px 32px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.download-btn.primary {
  background: var(--primary-color);
  color: white;
  box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

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

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

.download-hint {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 12px;
}

.safety-tip {
  margin-top: 16px;
  padding: 10px 16px;
  background: #f0f9ff;
  border-left: 3px solid #52c41a;
  border-radius: 4px;
  font-size: 12px;
  color: #2d5016;
  text-align: center;
  font-weight: 400;
}

/* ========== PC 二维码 ========== */
.qrcode-section {
  padding: 20px 0;
}

.qrcode-placeholder {
  width: 200px;
  height: 200px;
  margin: 0 auto 16px;
  background: white;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-light);
}

.qrcode-hint {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ========== 底部 ========== */
.footer {
  text-align: center;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
}

.version {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 8px;
}

.copyright {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.link {
  font-size: 12px;
  color: var(--text-light);
  text-decoration: none;
  transition: color 0.3s ease;
}

.link:hover {
  color: var(--primary-color);
}

.separator {
  color: var(--border-color);
}

/* ========== 微信提示遮罩 ========== */
.wechat-tip {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 20px;
  padding-right: 0;
}

.wechat-tip-content {
  position: relative;
}

.wechat-arrow {
  width: 0;
  height: 0;
  border-left: 15px solid transparent;
  border-right: 15px solid transparent;
  border-bottom: 20px solid white;
  position: absolute;
  top: -15px;
  right: 15px;
}

.wechat-text {
  background: white;
  padding: 24px;
  margin-right: 10px;
  border-radius: 12px;
  box-shadow: var(--shadow-heavy);
}

.wechat-text p {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-primary);
  margin: 0;
}

.wechat-text strong {
  color: var(--primary-color);
  font-size: 18px;
}

/* ========== 加载提示 ========== */
.loading {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.95);
  z-index: 9998;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading p {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ========== 响应式设计 ========== */
@media (max-width: 480px) {
  body {
    padding: 0;
  }

  .container {
    border-radius: 0;
    min-height: 100vh;
    padding: 30px 20px;
  }

  .app-name {
    font-size: 28px;
  }

  .features {
    grid-template-columns: 1fr;
  }

  .download-card {
    padding: 20px;
  }
}

/* ========== iOS Safari 优化 ========== */
@supports (-webkit-touch-callout: none) {
  .download-btn {
    -webkit-appearance: none;
  }
}

/* ========== 暗色模式支持 ========== */
@media (prefers-color-scheme: dark) {
  /* 可选：后期添加暗色模式支持 */
}
