/* 基础重置与变量 */
:root {
  --primary-purple: #9c6cff;
  --primary-pink: #ff7eb3;
  --primary-gradient: linear-gradient(135deg, #9c6cff 0%, #ff7eb3 100%);
  --bg-gradient: linear-gradient(180deg, #c9a8ff 0%, #f5c6ff 40%, #ffe6f3 100%);
  --card-bg: rgba(255, 255, 255, 0.72);
  --card-border: rgba(255, 255, 255, 0.85);
  --text-primary: #4a3267;
  --text-secondary: #7a628f;
  --text-light: #ffffff;
  --shadow: 0 8px 32px rgba(123, 74, 203, 0.22);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

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

html {
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg-gradient);
  color: var(--text-primary);
  overflow-x: hidden;
  position: relative;
  /* 为底部固定按钮留出空间：按钮高度 + 上下间距 + 安全区 */
  padding-bottom: calc(96px + env(safe-area-inset-bottom, 0));
}

/* 背景装饰圆 */
.bg-decoration {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.circle {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
}

.circle-1 {
  width: 320px;
  height: 320px;
  background: #b388ff;
  top: -80px;
  right: -80px;
}

.circle-2 {
  width: 260px;
  height: 260px;
  background: #ff9ed2;
  top: 35%;
  left: -90px;
}

.circle-3 {
  width: 360px;
  height: 360px;
  background: #d6b8ff;
  bottom: -120px;
  right: -60px;
}

/* 品牌区 */
.brand-section {
  position: relative;
  z-index: 1;
  text-align: center;
  padding-top: 40px;
  padding-bottom: 20px;
}

.app-icon {
  display: inline-block;
  margin-bottom: 16px;
}

.app-icon-placeholder {
  width: 96px;
  height: 96px;
  border-radius: 24px;
  background: var(--primary-gradient);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  position: relative;
  overflow: hidden;
}

.app-icon-placeholder::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.35) 0%, transparent 60%);
}

.app-icon-text {
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
  position: relative;
}

.app-icon-tag {
  font-size: 11px;
  font-weight: 600;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.25);
  position: relative;
}

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

.app-slogan {
  font-size: 15px;
  color: var(--text-secondary);
  margin-top: 6px;
  font-weight: 500;
}

/* 主视觉区 */
.hero-section {
  position: relative;
  z-index: 1;
  padding: 0 24px 16px;
}

.hero-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 12px;
  overflow: hidden;
}

.hero-image-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #f0e1ff 0%, #ffe0f0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-image-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.hero-emoji {
  font-size: 64px;
  line-height: 1;
}

.hero-text {
  font-size: 15px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* 功能亮点 */
.features-section {
  position: relative;
  z-index: 1;
  padding: 0 24px 20px;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 14px;
  text-align: center;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.feature-item {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(123, 74, 203, 0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: rgba(156, 108, 255, 0.12);
}

.feature-icon-1 { background: rgba(156, 108, 255, 0.14); }
.feature-icon-2 { background: rgba(255, 126, 179, 0.14); }
.feature-icon-3 { background: rgba(255, 158, 210, 0.14); }
.feature-icon-4 { background: rgba(179, 136, 255, 0.14); }

.feature-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

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

.feature-text span {
  font-size: 12px;
  color: var(--text-secondary);
}

/* 底部操作区：悬浮固定到底部 */
.action-section {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  padding: 12px 32px calc(16px + env(safe-area-inset-bottom, 0));
  text-align: center;
  /* 透明背景，让页面渐变背景透出来 */
  background: transparent;
}

.open-app-btn {
  width: 100%;
  max-width: 360px;
  height: 54px;
  border: none;
  border-radius: 27px;
  background: var(--primary-gradient);
  color: var(--text-light);
  font-size: 18px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 10px 28px rgba(156, 108, 255, 0.45);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.open-app-btn:active {
  transform: scale(0.97);
  box-shadow: 0 6px 18px rgba(156, 108, 255, 0.35);
}

.open-app-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-icon {
  font-size: 20px;
}

.action-tip {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-secondary);
}

/* 微信/QQ 浏览器提示蒙层 */
.browser-tip {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.72);
  display: none;
  flex-direction: column;
  align-items: flex-end;
  padding: 24px 32px;
}

.browser-tip.show {
  display: flex;
}

.browser-tip-arrow {
  width: 64px;
  height: 64px;
  margin-right: -8px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath fill='%23fff' d='M48 8 L56 8 L56 32 L48 32 Z'/%3E%3Cpath fill='none' stroke='%23fff' stroke-width='4' stroke-linecap='round' d='M48 16 L32 32 L16 48'/%3E%3C/svg%3E") no-repeat center;
  background-size: contain;
}

.browser-tip-content {
  margin-top: 16px;
  text-align: right;
  color: #fff;
}

.browser-tip-content p {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.6;
}

/* 全局 Loading */
.page-loading {
  position: fixed;
  inset: 0;
  z-index: 1999;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.page-loading.show {
  display: flex;
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(156, 108, 255, 0.2);
  border-top-color: var(--primary-purple);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

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

/* 适配小屏 */
@media (max-width: 360px) {
  .brand-section {
    padding-top: 32px;
    padding-bottom: 16px;
  }

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

  .hero-section {
    padding: 0 20px 12px;
  }

  .features-section {
    padding: 0 20px 16px;
  }

  .features-grid {
    gap: 10px;
  }

  .feature-item {
    padding: 12px;
  }

  .action-section {
    padding: 10px 24px calc(12px + env(safe-area-inset-bottom, 0));
  }
}

/* 适配大屏（平板横屏等） */
@media (min-width: 600px) {
  body {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .brand-section,
  .hero-section,
  .features-section {
    width: 100%;
    max-width: 480px;
  }

  .action-section {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
  }
}
