/* --- 1. 品牌基本配色與整體設定 --- */
:root {
  --primary-blue: #003399; 
  --accent-pink: #e60073;  
  --bg-light: #f4f7f6;     
  --text-dark: #333;
  --card-bg: #ffffff;
}

html { 
  scroll-behavior: smooth; 
  scroll-padding-top: 75px; /* 修復：點擊選單時，預留導覽列的高度，標題不再被遮擋 */
}

body {
  font-family: 'Helvetica Neue', Arial, 'Microsoft JhengHei', sans-serif;
  color: var(--text-dark);
  margin: 0;
  padding: 0; 
}

/* --- 導覽列優化：專為直式 Logo 調整的比例 --- */
.navbar { 
  position: fixed; 
  top: 0; 
  width: 100%; 
  background-color: rgba(0, 51, 153, 0.95); 
  z-index: 1000; 
  /* 稍微增加上下 padding，給 Logo 更多空間 */
  padding: 12px 24px; 
  box-sizing: border-box; 
  backdrop-filter: blur(5px); 
  box-shadow: 0 10px 30px rgba(0, 24, 73, 0.18);
}

.nav-container { 
  max-width: 1180px; 
  margin: 0 auto; 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  gap: 24px; 
}

/* Logo 與文字的組合容器 */
.nav-logo { 
  display: flex; 
  align-items: center; 
  /* 縮小 gap，讓中文字更「貼著」Logo */
  flex-shrink: 0;
  gap: 10px; 
  padding: 8px 18px 8px 10px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 18px;
  box-shadow: 0 12px 28px rgba(0, 20, 61, 0.22);
  text-decoration: none; 
}

/* 針對你的 dmc Logo 原圖進行最佳化 */
.nav-logo img { 
  /* 增加高度，確保圖案下方的 CHAN'S MUSIC 清晰可見 */
  height: 58px; 
  width: auto; 
  /* 左右多留一點白邊，讓 Logo 看起來像個精緻的徽章 */
  padding: 2px 4px; 
  border-radius: 14px; 
  /* 確保圖片比例不變形 */
  object-fit: contain; 
}

.nav-brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding-left: 18px;
  border-left: 1px solid rgba(23, 48, 95, 0.22);
  color: transparent;
  font-family: "DFLiShu-SB-Estd-BF", "LiSu", "STLiti", "KaiTi TC", "BiauKai", serif;
  font-size: 0;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
  text-shadow: none;
  min-height: 58px;
}

.nav-brand-text::before {
  content: "陳氏音樂";
  display: block;
  color: #17305f;
  font-size: 1.55rem;
  line-height: 1;
  letter-spacing: 0.12em;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
  transform: translateY(1px);
}

.nav-brand-text::after {
  content: "CHAN'S MUSIC";
  display: block;
  color: rgba(23, 48, 95, 0.72);
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
}

/* 旁邊的「陳氏音樂」文字 */
.logo-text { 
  color: white; 
  /* 字體稍微放大，與 60px 的 Logo 取得視覺平衡 */
  font-size: 1.6rem; 
  font-weight: bold; 
  white-space: nowrap; 
  letter-spacing: 2px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
}
.nav-links a {
  color: white;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.98rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
  padding: 10px 16px;
  border-radius: 999px;
  transition: color 0.3s, background-color 0.3s, transform 0.3s;
}
.nav-links a:hover {
  color: white;
  background-color: rgba(255, 255, 255, 0.14);
  transform: translateY(-1px);
}

/* 手機版優化：稍微縮小避免擠壓 */
@media (max-width: 768px) {
  html { scroll-padding-top: 120px; }
  .navbar { padding: 12px 16px; }
  .nav-container { flex-direction: column; align-items: stretch; gap: 14px; }
  .nav-logo { justify-content: center; gap: 8px; padding: 8px 12px 8px 8px; }
  .nav-logo img { height: 50px; padding: 2px 4px; }
  .nav-brand-text { gap: 1px; padding-left: 12px; min-height: 50px; }
  .nav-brand-text::before { font-size: 1.22rem; letter-spacing: 0.1em; transform: translateY(1px); }
  .nav-brand-text::after { font-size: 0.62rem; letter-spacing: 0.15em; }
  .logo-text { font-size: 1.2rem; }
  .nav-links { justify-content: center; gap: 10px; }
  .nav-links a { font-size: 0.92rem; padding: 8px 12px; }
}

/* --- 3. 滿版首頁視覺大圖 --- */
.hero {
  position: relative;
  width: 100%;
  height: 100vh; 
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: white;
  background-image: url('https://images.unsplash.com/photo-1552422535-c45813c61732?q=80&w=2070&auto=format&fit=crop');
  background-size: cover;
  background-position: center;
  background-attachment: fixed; 
}

.hero-overlay {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(rgba(0, 51, 153, 0.7), rgba(0, 0, 0, 0.6));
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  padding: 20px;
  margin-top: 60px; 
  animation: fadeInUp 1s ease-out;
}

.hero h1 { font-size: 3.5rem; margin-bottom: 15px; letter-spacing: 2px; text-shadow: 0 2px 4px rgba(0,0,0,0.5); }
.hero p { font-size: 1.3rem; margin-bottom: 40px; line-height: 1.6; color: #eaf3fb; }

.hero-buttons { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; }
.btn {
  padding: 15px 35px; border-radius: 30px; font-size: 1.2rem; font-weight: bold;
  text-decoration: none; transition: all 0.3s ease; border: 2px solid transparent;
}
.btn-primary { background-color: var(--accent-pink); color: white; box-shadow: 0 4px 15px rgba(230, 0, 115, 0.4); }
.btn-primary:hover { background-color: transparent; border-color: var(--accent-pink); transform: translateY(-3px); }
.btn-secondary { background-color: transparent; color: white; border-color: white; }
.btn-secondary:hover { background-color: white; color: var(--primary-blue); transform: translateY(-3px); }

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

/* --- 4. 內容區塊共用設定 --- */
.section-container { 
  padding: 80px 20px; /* 微調上下留白，視覺更緊湊 */
  text-align: center; 
}

.section-title { color: var(--primary-blue); font-size: 2.2rem; margin-bottom: 10px; font-weight: bold; }
.section-subtitle { color: #666; font-size: 1.1rem; margin-bottom: 50px; }

.grid-container {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 25px; max-width: 1100px; margin: 0 auto;
}

.card {
  background-color: var(--card-bg); border-radius: 12px; padding: 30px 25px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08); transition: transform 0.3s ease, box-shadow 0.3s ease; text-align: left;
}
.card:hover { transform: translateY(-5px); box-shadow: 0 10px 25px rgba(0,51,153,0.15); }
.card-title { font-size: 1.4rem; color: var(--primary-blue); margin-bottom: 15px; border-bottom: 2px solid #eee; padding-bottom: 10px; font-weight: bold; }
.card-text { color: #555; line-height: 1.6; }

/* --- 5. 音樂課程專屬 --- */
#music-section { background-color: #ffffff; }
.music-card { border-top: 4px solid var(--primary-blue); }
.music-card:hover { border-top: 4px solid var(--accent-pink); }
.tag-list { margin: 0 0 20px 0; padding: 0; list-style: none; }
.tag-list li {
  display: inline-block; margin: 0 8px 8px 0; background: #eaf3fb;
  padding: 6px 14px; border-radius: 20px; font-size: 0.95rem; font-weight: bold; color: #444;
}

/* --- 6. 補習區塊專屬 --- */
#tutorial-section { background-color: var(--bg-light); }
.tutorial-card { border-left: 5px solid var(--primary-blue); }
.interest-card { border-left: 5px solid var(--accent-pink); background: #fff5f8; }
.interest-card .card-title { color: var(--accent-pink); }

.badge {
  display: inline-block; background-color: var(--accent-pink); color: white;
  padding: 6px 16px; border-radius: 20px; font-size: 0.9rem; font-weight: bold; margin-bottom: 20px;
}
.target-group { color: var(--accent-pink); font-weight: bold; margin-top: -5px; }
.feature-list { list-style: none; padding: 0; margin: 0; line-height: 1.8; color: #555; }
.feature-list li::before { content: "✓ "; color: var(--accent-pink); font-weight: bold; margin-right: 5px; }
.interest-card .feature-list li::before { content: "🎨 "; }

/* --- 7. 頁尾聯絡資訊 (Footer) --- */
footer { background-color: var(--primary-blue); color: white; padding: 60px 20px 30px; text-align: center; }
.footer-content { display: flex; flex-wrap: wrap; justify-content: center; gap: 40px; max-width: 1000px; margin: 0 auto; text-align: left; }
.footer-box { flex: 1; min-width: 300px; }
.footer-box h3 { color: var(--accent-pink); font-size: 1.5rem; margin-top: 0; margin-bottom: 15px; }
.footer-box p { line-height: 1.8; margin: 5px 0; font-size: 1rem; color: #eaf3fb; }
.footer-bottom { margin-top: 40px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.2); font-size: 0.9rem; color: #ccc; }

/* --- 8. 懸浮聯絡按鈕 --- */
.floating-contact {
  position: fixed; bottom: 30px; right: 30px; display: flex; flex-direction: column; gap: 15px; z-index: 9999;
}
.float-btn {
  width: 50px; height: 50px; border-radius: 50%; display: flex; justify-content: center; align-items: center;
  color: white; text-decoration: none; box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s;
}
.float-btn:hover { transform: translateY(-5px) scale(1.05); box-shadow: 0 8px 25px rgba(0,0,0,0.3); }

.btn-top { background-color: var(--primary-blue); }
.btn-whatsapp { background-color: #25D366; }
.btn-email { background-color: var(--accent-pink); }
.float-btn svg { width: 24px; height: 24px; fill: currentColor; }

/* 響應式設計 (手機版) */
@media (max-width: 768px) {
  .hero { background-attachment: scroll; } /* 修復：防止 iOS Safari 背景圖片顯示異常 */
  .hero h1 { font-size: 2.5rem; }
  .footer-content { flex-direction: column; text-align: center; }
  
  .float-btn { width: 45px; height: 45px; }
  .float-btn svg { width: 20px; height: 20px; }
  .floating-contact { bottom: 20px; right: 20px; gap: 10px; }
}
