/* 歐拉谷首頁（PHP 版）— 視覺對齊 apps/web/app/page.tsx */

:root {
  --text: #8b4b9c;
  --pink: #ffb6c1;
  --pink-strong: #ff69b4;
  --sky: #87ceeb;
  --lavender: #e6e6fa;
  --mint: #98fb98;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans TC",
    "PingFang TC", "Microsoft JhengHei", sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  background: linear-gradient(
    135deg,
    #ffe4e1 0%,
    #e6e6fa 25%,
    #e0ffff 50%,
    #f0fff0 75%,
    #fff8dc 100%
  );
  color: var(--text);
}

a {
  color: inherit;
}

.page-wrap {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* 漂浮裝飾 */
.floating-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.floating-bg span {
  position: absolute;
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  animation: float 6s ease-in-out infinite;
  opacity: 0.85;
}

.floating-bg .f1 {
  top: 10%;
  left: 10%;
  animation-delay: 0s;
}
.floating-bg .f2 {
  top: 20%;
  right: 15%;
  animation-delay: 1s;
}
.floating-bg .f3 {
  top: 70%;
  left: 5%;
  animation-delay: 2s;
}
.floating-bg .f4 {
  top: 60%;
  right: 10%;
  animation-delay: 3s;
}
.floating-bg .f5 {
  top: 40%;
  left: 85%;
  animation-delay: 4s;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
    opacity: 0.7;
  }
  50% {
    transform: translateY(-20px) rotate(180deg);
    opacity: 1;
  }
}

/* 導覽列 */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 1rem clamp(1rem, 3vw, 2rem);
  border-bottom: 3px solid var(--pink);
  box-shadow: 0 4px 20px rgba(255, 182, 193, 0.2);
}

.nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .nav-inner {
    flex-direction: row;
    justify-content: space-between;
    gap: 1rem;
  }
}

.brand {
  font-size: clamp(1.25rem, 4vw, 2.2rem);
  font-weight: 700;
  flex-shrink: 0;
  background: linear-gradient(90deg, #ff69b4, #87ceeb, #98fb98);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  width: 100%;
}

@media (min-width: 640px) {
  .nav-links {
    width: auto;
    justify-content: flex-end;
    gap: 0.75rem;
  }
}

.nav-btn {
  text-decoration: none;
  color: var(--text);
  padding: 0.5rem clamp(0.75rem, 2vw, 1.25rem);
  border-radius: 20px;
  font-size: clamp(0.7rem, 2vw, 0.875rem);
  font-weight: 500;
  white-space: nowrap;
  background: rgba(255, 182, 193, 0.1);
  border: 2px solid transparent;
  transition: transform 0.3s, box-shadow 0.3s, background 0.3s, color 0.3s;
  cursor: pointer;
  font-family: inherit;
}

.nav-btn:hover {
  background: linear-gradient(90deg, #ffb6c1, #e6e6fa);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 182, 193, 0.4);
}

.user-pill {
  color: var(--text);
  font-size: clamp(0.7rem, 2vw, 0.875rem);
  padding: 0.5rem clamp(0.75rem, 2vw, 1.25rem);
  background: linear-gradient(
    90deg,
    rgba(255, 182, 193, 0.2),
    rgba(230, 230, 250, 0.2)
  );
  border-radius: 20px;
  font-weight: 600;
  border: 2px solid rgba(255, 182, 193, 0.3);
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-auth-guest,
.nav-auth-user {
  display: contents;
}

.nav-auth-guest.hidden,
.nav-auth-user.hidden {
  display: none;
}

/* 主內容區 */
.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 3vw, 2rem);
  position: relative;
  z-index: 10;
}

/* 區塊標題漸層 */
.section-title {
  text-align: center;
  font-weight: 600;
  margin: 0 0 clamp(1rem, 3vw, 2rem);
  font-size: clamp(1.5rem, 5vw, 3rem);
  background: linear-gradient(90deg, #ff69b4, #87ceeb);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Hero */
.hero {
  text-align: center;
  padding: clamp(2rem, 5vw, 4rem) 1rem;
  margin: clamp(1rem, 3vw, 2rem) 0;
  color: var(--text);
  background: rgba(255, 255, 255, 0.7);
  border-radius: clamp(20px, 3vw, 30px);
  box-shadow: 0 10px 40px rgba(255, 182, 193, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.hero-deco-tl {
  position: absolute;
  top: 1rem;
  left: clamp(0.75rem, 2vw, 2rem);
  font-size: clamp(1.5rem, 6vw, 3rem);
  opacity: 0.3;
}

.hero-deco-br {
  position: absolute;
  bottom: 0.75rem;
  right: clamp(0.75rem, 3vw, 2.5rem);
  font-size: clamp(1.25rem, 5vw, 2.5rem);
  opacity: 0.4;
}

.hero h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.5rem, 5vw, 3.75rem);
  font-weight: 700;
  background: linear-gradient(90deg, #ff69b4, #87ceeb);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  margin: 0;
  font-size: clamp(1rem, 3vw, 1.5rem);
  opacity: 0.8;
  font-weight: 400;
}

/* 特色卡片列 */
.features {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(1rem, 3vw, 2rem);
  justify-content: center;
  margin: clamp(1.5rem, 4vw, 3rem) 0;
}

.feature-card {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 3px solid rgba(255, 182, 193, 0.3);
  border-radius: clamp(20px, 3vw, 25px);
  padding: clamp(1rem, 3vw, 2.5rem);
  text-align: center;
  max-width: 360px;
  box-shadow: 0 10px 40px rgba(255, 182, 193, 0.2);
  transition: transform 0.3s, box-shadow 0.3s;
}

.feature-card:hover {
  transform: scale(1.05);
  box-shadow: 0 15px 50px rgba(255, 182, 193, 0.4);
}

.feature-card .emoji {
  font-size: clamp(2.5rem, 8vw, 3.75rem);
  margin-bottom: 0.75rem;
}

.feature-card h3 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.25rem, 4vw, 1.875rem);
  font-weight: 600;
  background: linear-gradient(90deg, #ff69b4, #87ceeb);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.feature-card p {
  margin: 0;
  color: var(--text);
  opacity: 0.8;
  font-size: clamp(0.875rem, 2.5vw, 1.125rem);
  line-height: 1.6;
}

/* 消息／下載／社群 區塊 */
.panel {
  margin: clamp(1.5rem, 4vw, 4rem) 0;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 3px solid rgba(255, 182, 193, 0.3);
  border-radius: clamp(20px, 3vw, 25px);
  padding: clamp(1rem, 4vw, 3rem);
  box-shadow: 0 10px 40px rgba(255, 182, 193, 0.2);
}

.news-list {
  display: flex;
  flex-direction: column;
  gap: clamp(1rem, 2vw, 1.5rem);
}

.news-item {
  background: rgba(255, 182, 193, 0.15);
  padding: clamp(1rem, 3vw, 1.5rem);
  border-radius: clamp(12px, 2vw, 15px);
  color: var(--text);
  border-left: 4px solid var(--pink);
  transition: background 0.3s, transform 0.3s;
}

.news-item:hover {
  background: rgba(255, 182, 193, 0.25);
  transform: translateX(4px);
}

.news-item .date {
  font-size: clamp(0.875rem, 2vw, 1rem);
  opacity: 0.7;
  font-weight: 500;
  color: var(--pink-strong);
}

.news-item .body {
  margin: 0.5rem 0 0;
  font-size: clamp(0.875rem, 2.5vw, 1.125rem);
  line-height: 1.6;
}

.btn-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: clamp(0.75rem, 2vw, 2rem);
  justify-content: center;
}

@media (min-width: 640px) {
  .btn-row {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }
}

.cta-btn {
  display: inline-block;
  text-align: center;
  text-decoration: none;
  color: #fff;
  font-weight: 600;
  font-size: clamp(0.875rem, 2.5vw, 1.125rem);
  padding: clamp(0.75rem, 2vw, 1.5rem) clamp(1.25rem, 4vw, 2.5rem);
  border-radius: clamp(25px, 3vw, 30px);
  background: linear-gradient(90deg, #ffb6c1, #e6e6fa);
  border: 3px solid transparent;
  box-shadow: 0 6px 20px rgba(255, 182, 193, 0.3);
  transition: transform 0.3s, box-shadow 0.3s, background 0.3s;
}

.cta-btn:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 15px 35px rgba(255, 182, 193, 0.5);
  background: linear-gradient(90deg, #ff69b4, #87ceeb);
}

.contact-box {
  text-align: center;
  margin-top: clamp(1.5rem, 3vw, 2rem);
  padding: clamp(1rem, 3vw, 1.5rem);
  background: rgba(255, 182, 193, 0.15);
  border-radius: clamp(12px, 2vw, 15px);
  border: 2px solid rgba(255, 182, 193, 0.3);
}

.contact-box h3 {
  margin: 0 0 0.75rem;
  color: var(--text);
  font-size: clamp(1.25rem, 3vw, 1.5rem);
}

.contact-box p {
  margin: 0 0 0.5rem;
  color: var(--text);
  font-size: clamp(0.875rem, 2.5vw, 1.125rem);
}

.contact-box a.mail {
  color: var(--pink-strong);
  font-weight: 600;
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  text-decoration: none;
  word-break: break-all;
  transition: color 0.3s;
}

.contact-box a.mail:hover {
  color: #ff1493;
}
