/* =========================================
   Apple Style CSS - 专业心理测评
   ========================================= */

/* CSS 变量 */
:root {
  /* Apple 色彩系统 */
  --apple-gray: #F5F5F7;
  --apple-gray-dark: #E8E8ED;
  --calm-blue: #0071E3;
  --calm-blue-soft: #4A90D9;
  --calm-blue-light: rgba(0, 113, 227, 0.08);
  --sage: #7FB06D;
  --sage-soft: #9BC48F;
  --sage-light: rgba(127, 176, 109, 0.08);
  
  /* 文字色彩 */
  --text-primary: #1D1D1F;
  --text-secondary: #6E6E73;
  --text-tertiary: #86868B;
  
  /* 功能色 */
  --success: #34C759;
  --warning: #FF9500;
  --error: #FF3B30;
  
  /* 渐变 */
  --gradient-blue: linear-gradient(135deg, #0071E3 0%, #4A90D9 100%);
  --gradient-sage: linear-gradient(135deg, #7FB06D 0%, #9BC48F 100%);
  --gradient-purple: linear-gradient(135deg, #5856D6 0%, #AF52DE 100%);
  --gradient-hero: linear-gradient(135deg, #0071E3 0%, #7FB06D 100%);
  
  /* 圆角 */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 980px;
  
  /* 阴影 */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.08);
  --shadow-button: 0 2px 12px rgba(0, 113, 227, 0.15);
  
  /* 动画 */
  --ease-apple: cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* =========================================
   Reset + 基础样式
   ========================================= */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 
               'Helvetica Neue', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background-color: var(--apple-gray);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* =========================================
   磨砂玻璃导航栏
   ========================================= */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 52px;
  background: rgba(245, 245, 247, 0.8);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.nav-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text-primary);
}

.nav-brand .brand-icon {
  font-size: 22px;
}

.nav-brand .brand-text {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-link {
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s var(--ease-apple);
}

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

.nav-cta {
  font-size: 14px;
  font-weight: 500;
  color: var(--calm-blue);
  text-decoration: none;
  transition: color 0.2s var(--ease-apple);
}

.nav-cta:hover {
  color: var(--calm-blue-soft);
}

/* 移动端菜单按钮 */
.nav-menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-primary);
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  
  .nav-menu-btn {
    display: flex;
  }
}

/* =========================================
   Hero 区域
   ========================================= */
.hero-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 24px 60px;
  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}

.hero-bg::before {
  content: '';
  position: absolute;
  top: -20%;
  right: -10%;
  width: 60%;
  height: 60%;
  background: radial-gradient(circle, rgba(0, 113, 227, 0.06) 0%, transparent 70%);
  animation: heroFloat 20s ease-in-out infinite;
}

.hero-bg::after {
  content: '';
  position: absolute;
  bottom: -10%;
  left: -5%;
  width: 50%;
  height: 50%;
  background: radial-gradient(circle, rgba(127, 176, 109, 0.08) 0%, transparent 70%);
  animation: heroFloat 25s ease-in-out infinite reverse;
}

@keyframes heroFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(20px, -20px) scale(1.05); }
}

.hero-content {
  max-width: 800px;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: white;
  border-radius: var(--radius-full);
  padding: 8px 16px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.hero-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sage);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.2); }
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 16px;
}

.hero-title .gradient {
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.5;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 32px;
}

/* =========================================
   CTA 按钮
   ========================================= */
.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--gradient-blue);
  border-radius: var(--radius-full);
  padding: 16px 40px;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: white;
  text-decoration: none;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-button);
  transition: transform 0.2s var(--ease-apple),
              box-shadow 0.2s var(--ease-apple);
}

.cta-button:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 20px rgba(0, 113, 227, 0.3);
}

.cta-button:active {
  transform: scale(0.98);
}

.cta-button-secondary {
  background: white;
  color: var(--calm-blue);
  box-shadow: var(--shadow-sm);
}

.cta-button-secondary:hover {
  background: var(--apple-gray);
  box-shadow: var(--shadow-md);
}

/* =========================================
   Bento Grid 卡片
   ========================================= */
.bento-grid {
  display: grid;
  gap: 20px;
}

.bento-grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.bento-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.bento-grid-4 {
  grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 768px) {
  .bento-grid-2,
  .bento-grid-3,
  .bento-grid-4 {
    grid-template-columns: 1fr;
  }
}

.bento-card {
  background: white;
  border-radius: var(--radius-xl);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.4s var(--ease-apple),
              box-shadow 0.4s var(--ease-apple);
}

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

.bento-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 16px;
}

.bento-card-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.bento-card-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* =========================================
   Section 样式
   ========================================= */
.section {
  padding: 80px 24px;
}

.section-white {
  background: white;
}

.section-gray {
  background: var(--apple-gray);
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-title {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.section-subtitle {
  font-size: 17px;
  color: var(--text-secondary);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

/* =========================================
   滚动动画
   ========================================= */
.scroll-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s var(--ease-apple),
              transform 0.8s var(--ease-apple);
}

.scroll-reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* =========================================
   进度条
   ========================================= */
.progress-bar {
  height: 8px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.6s var(--ease-apple);
}

/* =========================================
   表单元素
   ========================================= */
.input-field {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-md);
  background: white;
  color: var(--text-primary);
  transition: border-color 0.2s var(--ease-apple),
              box-shadow 0.2s var(--ease-apple);
}

.input-field:focus {
  outline: none;
  border-color: var(--calm-blue);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.1);
}

/* =========================================
   Toast 提示
   ========================================= */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text-primary);
  color: white;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  opacity: 0;
  transition: transform 0.3s var(--ease-apple),
              opacity 0.3s var(--ease-apple);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* =========================================
   页脚
   ========================================= */
.footer {
  background: white;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  padding: 40px 24px;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  color: var(--text-secondary);
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-link {
  font-size: 14px;
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color 0.2s var(--ease-apple);
}

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

.footer-copyright {
  font-size: 13px;
  color: var(--text-tertiary);
}

/* =========================================
   加载状态
   ========================================= */
.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(0, 113, 227, 0.1);
  border-top-color: var(--calm-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* =========================================
   移动端适配
   ========================================= */
@media (max-width: 480px) {
  .section {
    padding: 60px 16px;
  }
  
  .bento-card {
    padding: 20px;
  }
  
  .cta-button {
    padding: 14px 32px;
    font-size: 16px;
  }
}

/* =========================================
   自定义滚动条
   ========================================= */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

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

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.25);
}
