/* =============================
   1. 動畫效果
============================= */
@keyframes fadeSlideUp {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeBounceUp {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.fade-in {
    animation: fadeInUp 0.8s ease-out both;
  }
  @keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  
  /* =============================
     2. Hero 區塊
  ============================= */
  .hero-section {
    background: linear-gradient(135deg, #e0f0ff 0%, #ffffff 100%);
    padding: 80px 20px;
    text-align: center;
    border-radius: 20px;
    margin-bottom: 60px;
  }
  .hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--brand-blue);
    margin-bottom: 1rem;
    line-height: 1.2;
    animation: fadeSlideUp 0.8s ease-out forwards;
    animation-delay: 0.2s;
    opacity: 0;
  }
  
  .hero-subtitle {
    font-size: 1.25rem;
    color: var(--gray-600);
    margin-bottom: 2rem;
    line-height: 1.6;
    animation: fadeSlideUp 0.8s ease-out forwards;
    animation-delay: 0.4s;
    opacity: 0;
  }
  
  .hero-cta {
    padding: 14px 28px;
    font-size: 1.125rem;
    border-radius: 999px;
    transition: all 0.3s ease;
    animation: fadeBounceUp 0.8s ease-out forwards;
    animation-delay: 0.6s;
    opacity: 0;
  }
  
  
  .hero-cta:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  }
  /* =============================
   2.5 Home 主容器設計
============================= */
  .home-container {
    max-width: 1024px;
    margin: 40px auto;
    padding: 0 20px;
  }
  
  /* =============================
     3. About 區塊
  ============================= */
  .about-section {
    position: relative; /* ⭐ 加上定位，給 ::before 用 */
    overflow: hidden;   /* ⭐ 防止星點溢出 */
    z-index: 1;         /* ⭐ 讓內容蓋過星星背景 */
  
    background: radial-gradient(circle at center, #0d1b2a, #1b263b);
    color: white;
    border-radius: 16px;
    padding: 60px 24px;
    margin: 64px auto;
    max-width: 960px;
    text-align: center;
  }
  .about-section::before {
    content: "";
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    background-image:
      radial-gradient(1px 1px at 5% 10%, white 60%, transparent 100%),
      radial-gradient(1px 1px at 20% 30%, white 60%, transparent 100%),
      radial-gradient(1px 1px at 35% 80%, white 60%, transparent 100%),
      radial-gradient(1px 1px at 50% 50%, white 60%, transparent 100%),
      radial-gradient(1px 1px at 65% 20%, white 60%, transparent 100%),
      radial-gradient(1px 1px at 80% 60%, white 60%, transparent 100%),
      radial-gradient(1px 1px at 90% 90%, white 60%, transparent 100%),
      radial-gradient(1px 1px at 15% 65%, white 60%, transparent 100%),
      radial-gradient(1px 1px at 55% 75%, white 60%, transparent 100%),
      radial-gradient(1px 1px at 75% 15%, white 60%, transparent 100%),
      radial-gradient(1px 1px at 25% 45%, white 60%, transparent 100%),
      radial-gradient(1px 1px at 40% 25%, white 60%, transparent 100%);
    background-repeat: no-repeat;
    opacity: 0.7;                /* ⭐ 提高亮度 */
    z-index: 0;
    pointer-events: none;
    animation: twinkle 6s ease-in-out infinite;
  }
  .about-section::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 150%;
    height: 150%;
    background-image:
      radial-gradient(0.5px 0.5px at 12% 12%, rgba(255,255,255,0.4) 60%, transparent 100%),
      radial-gradient(1px 1px at 30% 30%, rgba(255,255,255,0.4) 50%, transparent 100%),
      radial-gradient(1px 1px at 60% 60%, rgba(255,255,255,0.2) 40%, transparent 100%),
      radial-gradient(1px 1px at 90% 90%, rgba(255,255,255,0.1) 30%, transparent 100%);
    background-repeat: no-repeat;
    background-size: 100% 100%;
    animation: sparkle 2.5s infinite ease-in-out alternate;
    z-index: 0;
    pointer-events: none;
  }  
    
  .about-section h2 {
    color: #ffffff;
  }
  .about-section p {
    color: #ccd6f6;
  }
  .about-section img {
    color: white;
  }  
  
  /* =============================
     4. Features 區塊
  ============================= */
  .features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 32px;
    margin-top: 48px;
  }

  .feature-card {
    background: var(--color-surface);
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    padding: 24px;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  
    /* ⭐ 新增：動畫初始狀態 */
    opacity: 0;
    transform: translateY(30px);
    animation: fadeSlideUp 0.8s ease-out forwards;
  }

  .feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.08);
  }

  .feature-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--color-text-primary);
  }

  .feature-card p {
    font-size: 1rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
  }

  /* ⭐ 新增：各卡片延遲出場時間 */
  .features-grid .feature-card:nth-child(1) {
    animation-delay: 0.2s;
  }
  .features-grid .feature-card:nth-child(2) {
    animation-delay: 0.4s;
  }
  .features-grid .feature-card:nth-child(3) {
    animation-delay: 0.6s;
  }
  
  /* =============================
     5. 最後行動呼籲區 CTA
  ============================= */
  .final-cta {
    text-align: center;
    margin: 64px 0;
  }
  .final-cta a {
    padding: 16px 32px;
    font-size: 1.125rem;
    border-radius: 999px;
    transition: all 0.3s ease;
  }
  .final-cta a:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  }
  
  /* =============================
     6. 響應式 (小螢幕版)
  ============================= */
  @media (max-width: 768px) {
    .features-grid {
      flex-direction: column;
      align-items: center;
    }
  }
  .features-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 48px;
    padding: 80px 20px;
    max-width: 960px;
    margin: 0 auto;
  }
  
  .feature-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  
  .feature-image {
    width: 100%;
    max-width: 220px;
    height: auto;
    margin-bottom: 24px;
  }
  
  .feature-text h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--brand-blue);
    margin-bottom: 0.5rem;
  }
  
  .feature-text p {
    font-size: 1rem;
    color: var(--gray-600);
    line-height: 1.6;
  }
  .feature-image {
    max-width: 180px;
    margin-bottom: 20px;
  }
  .feature-image:hover {
    transform: scale(1.05);
    transition: transform 0.3s ease;
  }
  .brand-logo {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--brand-blue); /* 預設主色 */
  }
  
  .xyz-highlight {
    color: #f99b1d; /* 亮橘色，也可以換成 #6a5acd 藍紫色等 */
  }
  /* 品牌 Logo 樣式（手機預設） */
.brand-logo {
  font-size: 2.5rem;
  font-weight: 700;
  text-align: center;
  color: var(--brand-blue);
  margin-bottom: 1rem;
}

.brand-logo .xyz-highlight {
  color: #f5a623; /* 橘黃色，代表 XYZ 世代 */
}

/* 桌機版放大樣式 */
@media (min-width: 768px) {
  .brand-logo {
    font-size: 4rem;
  }
}

@keyframes sparkle {
  0%, 100% {
    opacity: 0.2;
    transform: translate(0, 0);
  }
  50% {
    opacity: 0.5;
    transform: translate(0.5px, 0.5px); /* ✅ 更細緻 */
  }
}

.demo-star {
  position: absolute;
  background-color: white;
  border-radius: 50%;
  opacity: 0.6;
  animation: twinkle 3s infinite ease-in-out alternate;
  z-index: 0;
}

.search-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem; /* 8px */
  width: 100%;
  max-width: 600px;
  margin: 2rem auto 0 auto; /* 上方間距 */
}

.search-input {
  width: 100%;
  padding: 0.75rem 1rem; /* 12px 16px */
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  flex-grow: 1;
}

.search-results-container {
  max-width: 600px;
  margin: 1.5rem auto; /* 上下間距 */
  display: flex;
  flex-direction: column;
  gap: 1rem; /* 每個結果之間的間距 */
}

.result-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.result-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.result-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
}

.result-info h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
}

.result-info p {
  font-size: 0.9rem;
  color: #666;
  margin: 0.25rem 0 0 0;
}

/* 精選用戶區塊的標題 */
.section-title {
  font-size: 1.5rem; /* 24px */
  font-weight: 600;
  margin-bottom: 1rem; /* 16px */
  text-align: center;
}

/* ✨【核心】使用 Grid 佈局來實現響應式排版 */
.featured-users-grid {
  display: grid;
  /* * 這行是魔法所在：
   * - repeat: 重複產生欄位
   * - auto-fit: 自動判斷一行能塞進幾個
   * - minmax(280px, 1fr): 每個欄位最小寬度 280px，最大則平分剩餘空間
  */
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem; /* 卡片之間的間距 */
}