/* ================= 全局變數與重置 (Global Styles) ================= */
:root {
  --primary-color: #3E5448;      /* 清新深苔綠 */
  --primary-light: #6A8273;      /* 柔和植物綠 */
  --accent-gold: #C5A880;        /* 典雅香檳金 */
  --bg-sand: #FAF9F6;            /* 溫暖有機暖白 */
  --bg-card: #FFFFFF;            /* 純白卡片 */
  --text-main: #2C302E;          /* 質感深灰文字 */
  --text-muted: #737875;         /* 柔和次要文字 */
  --border-color: #E8E6E1;       /* 極淺灰邊框 */
  --font-heading: 'Noto Serif TC', serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --max-width: 1700px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-sand);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition-smooth);
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

/* 按鈕樣式 */
.btn-primary {
  display: inline-block;
  background-color: var(--primary-color);
  color: #fff;
  padding: 12px 32px;
  border-radius: 40px;
  font-size: 0.95rem;
  letter-spacing: 1px;
  border: none;
  cursor: pointer;
  transition: var(--transition-smooth);
  text-align: center;
}

.btn-primary:hover {
  background-color: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(62, 84, 72, 0.2);
}

.btn-outline {
  display: inline-block;
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
  padding: 10px 28px;
  border-radius: 40px;
  font-size: 0.9rem;
  transition: var(--transition-smooth);
}

.btn-outline:hover {
  background-color: var(--primary-color);
  color: #fff;
}

.full-width {
  width: 100%;
}


/* ================= 1. Header 樣式 (RWD) ================= */
/*鑽石*/
.header-top {
  padding: 8px;
  text-align: center;
  background-color: #e8e6e1;
}
/* 外層容器 flex 垂直置中 */
.member-status {
  display: inline-flex;
  align-items: center;
  gap: 8px; /* 鑽石與文字之間的間距 */
}

/* 調整鑽石尺寸與垂直微調 */
.diamond-icon {
  display: block;
  flex-shrink: 0;
}

/* 文字樣式設定 */
.member-text {
  font-size: 0.9rem;
  color: #555555; /* 精緻灰色文字 */
  font-weight: 400;
  letter-spacing: 0.5px;
  line-height: 1;
}




.main-header {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  background-color: rgba(250, 249, 246, 0.95);
  backdrop-filter: blur(10px);
  z-index: 1000;
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition-smooth);
}
.header-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* LOGO (圖+文) */
.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--primary-color);
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-text .en {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 2px;
  line-height: 1;
}

.logo-text .zh {
  font-size: 0.65rem;
  letter-spacing: 3px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* 電腦版選單與展開效果 */
.desktop-nav .nav-list {
  display: flex;
  gap: 36px;
}

.desktop-nav .nav-item {
  position: relative;
  padding: 10px 0;
}

.desktop-nav .nav-item > a {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.desktop-nav .nav-item > a i {
  font-size: 0.7rem;
  transition: var(--transition-smooth);
}

.desktop-nav .nav-item:hover > a {
  color: var(--primary-color);
}

.desktop-nav .nav-item:hover > a i {
  transform: rotate(180deg);
}

/* 下拉選單動畫 */
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--bg-card);
  min-width: 180px;
  padding: 12px 0;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  border: 1px solid var(--border-color);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-smooth);
}

.desktop-nav .nav-item:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.dropdown-menu a {
  display: block;
  padding: 10px 24px;
  font-size: 1rem;
  color: var(--text-main);
}

.dropdown-menu a:hover {
  background-color: var(--bg-sand);
  color: var(--primary-color);
}

/* 右側功能按鈕 */
.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.search-box {
  display: flex;
  align-items: center;
  background-color: #EFECE6;
  border-radius: 30px;
  padding: 10px 16px;
}

.search-box input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.85rem;
  width: 140px;
  transition: var(--transition-smooth);
}

.search-box input:focus {
  width: 180px;
}

.search-box button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
}

.action-btn {
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 20px;
  transition: var(--transition-smooth);
}

.action-btn:hover {
  color: var(--primary-color);
  background-color: rgba(62, 84, 72, 0.08);
}

.action-btn .btn-text {
  font-size: 0.85rem;
  font-weight: 500;
}

.cart-btn {
  position: relative;
}

.cart-count {
  position: absolute;
  top: 2px;
  right: 2px;
  background-color: var(--accent-gold);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-toggle-btn {
  display: none;
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--text-main);
  cursor: pointer;
}

/* 手機版抽屜式選單 */
.mobile-nav-drawer {
  position: fixed;
  top: 0;
  right: -320px;
  width: 300px;
  height: 100vh;
  background-color: var(--bg-card);
  z-index: 2000;
  padding: 30px;
  box-shadow: -5px 0 25px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition-smooth);
  overflow-y: auto;
}

.mobile-nav-drawer.active {
  right: 0;
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

.close-drawer-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}

.mobile-menu-list {
  margin-top: 20px;
}

.mobile-menu-item {
  border-bottom: 1px solid var(--border-color);
}

.mobile-menu-item .menu-title, .mobile-menu-item > a {
  padding: 16px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 500;
  cursor: pointer;
}

.mobile-menu-item .submenu {
  display: none;
  background-color: var(--bg-sand);
  padding: 10px 16px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.mobile-menu-item .submenu a {
  display: block;
  padding: 12px 0;
  font-size: 1rem;
  color: var(--text-muted);
}
.mobile-menu-item .submenu a:hover {
  background-color: rgba(62, 84, 72, 0.08);
  padding: 10px;
}

.mobile-contact-info {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.mobile-contact-info h4 {
  color: var(--primary-color);
  margin-bottom: 10px;
}

.mobile-contact-info p {
  margin-bottom: 6px;
}

.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(2px);
  z-index: 1500;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-smooth);
}

.drawer-overlay.active {
  opacity: 1;
  visibility: visible;
}


/* ================= 1. 手機版搜尋列樣式 ================= */
.mobile-search-row {
  display: none; /* 電腦版隱藏 */
  padding: 8px 16px 12px;
  background-color: var(--bg-sand);
  border-top: 1px solid var(--border-color);
}

.mobile-search-box {
  display: flex;
  align-items: center;
  background-color: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  overflow: hidden;
}

.mobile-search-box input {
  flex-grow: 1;
  border: none;
  padding: 10px 14px;
  font-size: 0.9rem;
  outline: none;
  background: transparent;
}

.mobile-search-box button {
  background-color: #EFECE6;
  border: none;
  padding: 11px 16px;
  color: var(--text-muted);
  cursor: pointer;
  border-left: 1px solid var(--border-color);
}

/* RWD 斷點設定 */
@media (max-width: 1180px) {
  .desktop-search {
    display: none; /* 隱藏電腦版 Header 內的搜尋欄 */
  }
  .mobile-search-row {
    display: block; /* 手機與平板顯示獨立搜尋欄 */
  }
}

/* 1. 徹底防止手機版畫面產生橫向滾動/滑出側欄的效果 */
html, body {
  max-width: 100%;
  overflow-x: clip;
  position: relative;
}


/* 2. 確保選單在隱藏狀態下完全不佔用空間，並關閉觸控滑動干擾 */
@media (max-width: 1180px) {
  /* 假設您的手機側欄選單 class 是 .mobile-nav 或 .desktop-nav */
  .desktop-nav:not(.active),
  .mobile-nav:not(.active) {
    visibility: hidden; /* 未開啟選單時徹底隱藏，防止手勢滑出 */
    pointer-events: none; /* 防止誤觸點擊 */
  }

  /* 當點擊漢堡選單展開時 (通常會加 .active) 再還原顯示 */
  .desktop-nav.active,
  .mobile-nav.active {
    visibility: visible;
    pointer-events: auto;
  }
}

.main-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0px 40px;
}



/* ===中間 Content (max-width 1700px) === */
/* =====內容=========================================================================*/

:root {
  --news-primary: #3a5a40;          /* 深森林綠 - 主色 */
  --news-primary-light: #588157;    /* 質感中綠 - 輔色 */
  --news-accent: #e9edc9;           /* 柔和米綠 - 點綴 */
  --news-highlight: #d4a373;        /* 暖沙棕 - 強調 tag */
  --news-bg-main: #f8f9fa;          /* 極淺灰背景 */
  --news-bg-card: #ffffff;          /* 純白卡片背景 */
  --news-text-dark: #2b2d42;        /* 深灰色字體 */
  --news-text-muted: #6c757d;       /* 淺灰色說明字 */
  --news-border-color: #e9ecef;     /* 邊框色 */
  --news-shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.04);
  --news-shadow-hover: 0 18px 40px rgba(58, 90, 64, 0.12);
  --news-radius-lg: 16px;
  --news-radius-sm: 8px;
  --news-transition: all 0.35s cubic-bezier(0.25, 1, 0.5, 1);
}

/* 容器寬度限制 */
.news-container {
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ==========================================================================
   頂部導覽列 Header Nav
   ========================================================================== */
.news-header-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  transition: var(--news-transition);
}

.news-header-nav.is-scrolled {
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
  background-color: rgba(255, 255, 255, 0.95);
}

.nav-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
}

.brand-logo {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: 2px;
  color: var(--news-primary);
  text-decoration: none;
}

.main-menu {
  display: flex;
  gap: 28px;
  align-items: center;
}

.main-menu a {
  text-decoration: none;
  color: var(--news-text-dark);
  font-weight: 500;
  font-size: 0.95rem;
  transition: var(--news-transition);
}

.main-menu a:hover,
.main-menu a.active {
  color: var(--news-primary-light);
}

.cart-icon-btn {
  position: relative;
  font-size: 1.1rem;
}

.cart-badge {
  position: absolute;
  top: -8px;
  right: -10px;
  background-color: var(--news-highlight);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   Hero 主視覺區塊
   ========================================================================== */
.news-hero-section {
  padding: 80px 0 60px;
  text-align: center;
  background: linear-gradient(180deg, #f0f4f1 0%, var(--news-bg-main) 100%);
}

.news-sub-title {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 3px;
  color: var(--news-primary-light);
  margin-bottom: 10px;
}

.news-main-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--news-primary);
  letter-spacing: 1px;
  margin-bottom: 16px;
}

.news-main-title span {
  font-family: 'Montserrat', sans-serif;
  font-weight: 400;
  opacity: 0.7;
  font-size: 1.8rem;
  margin-left: 8px;
}

.news-hero-desc {
  color: var(--news-text-muted);
  font-size: 1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* ==========================================================================
   最新消息內容與卡片 (Grid 佈局)
   ========================================================================== */
.news-content-section {
  padding: 20px 0 100px;
}

.news-grid-wrapper {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.news-card {
  background-color: var(--news-bg-card);
  border-radius: var(--news-radius-lg);
  overflow: hidden;
  box-shadow: var(--news-shadow-soft);
  transition: var(--news-transition);
  border: 1px solid var(--news-border-color);
  display: flex;
  flex-direction: column;
}

.news-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--news-shadow-hover);
}

.news-card-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* 圖片容器與 Tag */
.news-img-box {
  position: relative;
  width: 100%;
  padding-top: 62.5%; /* 16:10 黃金長寬比 */
  overflow: hidden;
  background-color: #e0e0e0;
}

.news-img-box img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.news-card:hover .news-img-box img {
  transform: scale(1.06);
}

.news-category-tag {
  position: absolute;
  top: 16px;
  left: 16px;
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  color: var(--news-primary);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.news-category-tag.highlight {
  background-color: var(--news-highlight);
  color: #ffffff;
}

/* 文字內容區 */
.news-info-box {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.news-date {
  font-size: 0.82rem;
  color: var(--news-text-muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.news-item-title {
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--news-text-dark);
  line-height: 1.45;
  margin-bottom: 12px;
  transition: var(--news-transition);
  
  /* 多行文字省略 (2行) */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card:hover .news-item-title {
  color: var(--news-primary-light);
}

.news-item-excerpt {
  font-size: 0.9rem;
  color: var(--news-text-muted);
  margin-bottom: 20px;
  
  /* 多行文字省略 (3行) */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Course tags from the admin form: up to seven, with wrapping on narrow cards. */
.news-info-box .highlight-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}

.news-info-box .highlight-tag {
  display: block;
  max-width: 100%;
  padding: 4px 10px;
  border: 1px solid #dce5dc;
  border-radius: 16px;
  background: #f0f5ef;
  color: var(--news-primary);
  font-size: 0.78rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.news-read-more {
  margin-top: auto;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--news-primary);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--news-transition);
}

.news-card:hover .news-read-more {
  gap: 12px;
  color: var(--news-primary-light);
}

/* ==========================================================================
   分頁控制 (Pagination)
   ========================================================================== */
.news-pagination-wrapper {
  margin-top: 60px;
  display: flex;
  justify-content: center;
}

.news-pagination-list {
  display: flex;
  list-style: none;
  gap: 10px;
  align-items: center;
}

.news-page-item button {
  border: 1px solid var(--news-border-color);
  background-color: var(--news-bg-card);
  color: var(--news-text-dark);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--news-transition);
}

.news-page-item button:hover {
  background-color: #f1f3f5;
  border-color: #ced4da;
}

.news-page-item.active button {
  background-color: var(--news-primary);
  color: #ffffff;
  border-color: var(--news-primary);
  box-shadow: 0 4px 12px rgba(58, 90, 64, 0.3);
}

.news-page-item button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ==========================================================================
   回到頂部按鈕 & 滾動進場動畫
   ========================================================================== */
.scroll-top-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: var(--news-primary);
  color: #ffffff;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: var(--news-transition);
  z-index: 99;
}

.scroll-top-btn.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-top-btn:hover {
  background-color: var(--news-primary-light);
  transform: translateY(-4px);
}

/* 滾動動畫輔助 Class */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.animate-on-scroll.animated {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   RWD 響應式斷點 (Media Queries)
   ========================================================================== */
@media (max-width: 992px) {
  .news-grid-wrapper {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
}

@media (max-width: 576px) {
  .news-grid-wrapper {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .news-main-title {
    font-size: 1.9rem;
  }
  
  .news-hero-section {
    padding: 80px 0 40px;
  }

  .nav-wrapper {
    height: 60px;
  }
}

/* =====內容=========================================================================*/





/* ================= 4. Footer 樣式 ================= */
.main-footer {
  background-color: #24332B;
  color: #E2E8E4;
  padding-top: 80px;
}

.footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 40px 60px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 50px;
}

.footer-logo {
  color: #fff;
  margin-bottom: 16px;
}

.footer-desc {
  font-size: 0.9rem;
  color: #A3B0A7;
  margin-bottom: 24px;
  max-width: 320px;
}

.social-links {
  display: flex;
  gap: 12px;
}

.social-links a {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.social-links a:hover {
  background-color: var(--accent-gold);
  transform: translateY(-3px);
}

.footer-col h4 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: #fff;
  margin-bottom: 20px;
}

.footer-col ul li {
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.footer-col ul li a {
  color: #A3B0A7;
}

.footer-col ul li a:hover {
  color: var(--accent-gold);
}

.contact-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #A3B0A7;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 24px 0;
  background-color: #1B2721;
}

.footer-bottom-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: #839187;
}

.payment-logistics-badges {
  display: block;
  gap: 20px;
}

.badge-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}


/* ================= 5. Modal 彈出視窗 ================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-smooth);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-box {
  background-color: var(--bg-card);
  width: 90%;
  max-width: 440px;
  padding: 40px;
  border-radius: 20px;
  position: relative;
  transform: translateY(20px);
  transition: var(--transition-smooth);
  box-shadow: 0 20px 50px rgba(0,0,0,0.15);
}

.modal-overlay.active .modal-box {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
}

.modal-box h3 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--primary-color);
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 6px;
  color: var(--text-main);
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  outline: none;
  font-size: 0.9rem;
}

.form-group input:focus {
  border-color: var(--primary-color);
}
/* 分隔線與文字 */
.social-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 24px 0 16px;
  color: #a0a0a0;
  font-size: 12px;
}

.social-divider::before,
.social-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #e0e0e0;
}

.social-divider span {
  padding: 0 10px;
}

/* 快速登入按鈕容器 */
.social-login-group {
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

/* 按鈕通用基礎樣式 */
.btn-social {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 4px;
  background-color: #ffffff;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s, opacity 0.2s;
  white-space: nowrap;
}

/* 各別品牌顏色樣式 */
/* 1. Google 帳號 */
.btn-social.btn-google {
  border: 1px solid #d1d5db;
  color: #333333;
}
.btn-social.btn-google:hover {
  background-color: #f9fafb;
}

/* 2. LINE 登入 */
.btn-social.btn-line {
  border: 1px solid #00c300;
  color: #00c300;
}
.btn-social.btn-line:hover {
  background-color: #f0fdf4;
}

/* 3. Facebook */
.btn-social.btn-fb {
  border: 1px solid #1877f2;
  color: #1877f2;
}
.btn-social.btn-fb:hover {
  background-color: #f0f6ff;
}

/* 購物車 Modal 特殊設定 */
.cart-modal-box {
  max-width: 500px;
}

.cart-items-list {
  max-height: 260px;
  overflow-y: auto;
  margin-bottom: 20px;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}

.cart-item img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
}

.item-detail {
  flex-grow: 1;
}

.item-detail h4 {
  font-size: 0.9rem;
}

.item-price {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.remove-item {
  background: none;
  border: none;
  color: #d9534f;
  cursor: pointer;
}

.cart-summary {
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.summary-line.highlight {
  color: var(--primary-color);
  font-weight: 600;
  margin-bottom: 20px;
}
/* 上方紅框：忘記密碼 | 驗證信補發 */
.form-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin: 16px 0 20px;
  font-size: 0.9rem;
}

.form-links a {
  color: #555555;
  text-decoration: none;
  transition: color 0.2s ease;
}

.form-links a:hover {
  color: #2b2b2b;
}

.form-links .divider {
  color: #cccccc;
  font-size: 0.8rem;
}

/* 下方紅框：還不是會員嗎？立即註冊 */
.form-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 0.95rem;
  color: #333333;
}

.form-footer .register-link {
  color: #c4a482; /* 棕金色連結 */
  text-decoration: none;
  font-weight: 500;
  margin-left: 4px;
  transition: opacity 0.2s ease;
}

.form-footer .register-link:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* 購物車 Modal 特殊設定 */
.cart-modal-box {
  max-width: 500px;
}

.cart-items-list {
  max-height: 260px;
  overflow-y: auto;
  margin-bottom: 20px;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}

.cart-item img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
}

.item-detail {
  flex-grow: 1;
}

.item-detail h4 {
  font-size: 0.9rem;
}

.item-price {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.remove-item {
  background: none;
  border: none;
  color: #d9534f;
  cursor: pointer;
}

.cart-summary {
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.summary-line.highlight {
  color: var(--primary-color);
  font-weight: 600;
  margin-bottom: 20px;
}
/* 上方紅框：忘記密碼 | 驗證信補發 */
.form-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin: 16px 0 20px;
  font-size: 0.9rem;
}

.form-links a {
  color: #555555;
  text-decoration: none;
  transition: color 0.2s ease;
}

.form-links a:hover {
  color: #2b2b2b;
}

.form-links .divider {
  color: #cccccc;
  font-size: 0.8rem;
}

/* 下方紅框：還不是會員嗎？立即註冊 */
.form-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 0.95rem;
  color: #333333;
}

.form-footer .register-link {
  color: #c4a482; /* 棕金色連結 */
  text-decoration: none;
  font-weight: 500;
  margin-left: 4px;
  transition: opacity 0.2s ease;
}

.form-footer .register-link:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* ================= 6. GO TOP 按鈕 ================= */
.go-top-btn {
  position: fixed;
  bottom: 40px;
  right: 40px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: var(--primary-color);
  color: #fff;
  border: none;
  cursor: pointer;
  z-index: 999;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-smooth);
}

.go-top-btn.visible {
  opacity: 1;
  visibility: visible;
}

.go-top-btn:hover {
  background-color: var(--accent-gold);
  transform: translateY(-4px);
}


/* ================= 滾動顯現特效 Class ================= */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(40px);
  transition: transform 0.8s ease, opacity 0.8s ease;
}

.reveal-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}


/* ================= 響應式 RWD Media Queries ================= */
@media (max-width: 1200px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr); /* 平板改為 3 行 */
  }
  .footer-container {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 1180px) {
  .desktop-nav, .search-box {
    display: none; /* 隱藏電腦版選單與搜尋列 */
  }
  .mobile-toggle-btn {
    display: block; /* 顯示手機版漢堡按鈕 */
  }
  .story-grid, .course-card {
    grid-template-columns: 1fr;
  }
  .slide-content h2 {
    font-size: 2.2rem;
  }
  .news-desc {
    max-width: 400px;
  }
}

/* 電腦版隱藏手機專用的會員/訂單按鈕列 */
@media (min-width: 769px) {
  .mobile-member-tabs {
    display: none !important;
  }
}

@media (max-width: 768px) {
  /* 1. 外層容器設為多層 Flex 佈局 */
  .header-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 0; /* 滿版樣式，由各子元素自訂內邊距 */
  }

  /* 2. 第一列：LOGO 靠左 (order: 1) */
  .brand-logo {
    order: 1;
    padding: 12px 16px;
  }

  /* 3. 第一列右側：只保留 購物車 與 漢堡按鈕 (order: 2) */
  .header-actions {
    order: 2;
    margin-left: auto; /* 擠向最右側 */
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    width: auto; /* 取消滿版 */
  }

  /* 隱藏第一列原本的會員登入與訂單按鈕 (只留購物車與漢堡) */
  .header-actions .action-btn:not(.cart-btn) {
    display: none;
  }

  /* 4. 第二列：會員登入與訂單按鈕列 (order: 3) */
  .mobile-member-tabs {
    order: 3;
    width: 100%;
    display: flex;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
  }

  .mobile-member-tabs .tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 0;
    font-size: 0.95rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
  }

  /* 左側：會員登入（深綠底白字） */
  .mobile-member-tabs .tab-login {
    background-color: #3d5346;
    color: #ffffff;
  }

  /* 右側：訂單查詢（淺灰底黑字） */
  .mobile-member-tabs .tab-order {
    background-color: #e0ded9;
    color: #333333;
  }

  /* 5. 第三列：搜尋欄位 (order: 4) */
  .search-box {
    order: 4;
    width: 100%;
    padding: 12px 16px;
  }


  .main-content {
    padding: 50px 20px;
  }
  .products-grid {
    grid-template-columns: repeat(2, 1fr); /* 手機改為 2 行 */
    gap: 16px;
  }
  .slider-arrow {
    display: none; /* 手機隱藏課程滑動箭頭 */
  }
  /* 1. 調整外框容器：增加上方內邊距 (Padding)，確保第一張圖不被裁切 */
  .news-vertical-carousel {
    height: 580px;         /* 保持固定輪播高度 */
    padding: 24px 16px;    /* 稍微加大上下 padding 留出安全邊界 */
    box-sizing: border-box;
  }
  
  /* 2. 內部軌道容器與滑動區塊 */
  .news-track-wrapper {
    height: 100%;
    overflow: hidden;      /* 確保超出範圍隱藏，但內部足夠容納 3 筆 */
  }

  .news-block {
    height: 332px;         /* 精確設定三筆項目的總高度 */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
  }

  .news-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
  }

  .news-img {
    width: 70px;
    height: 70px;
    border-radius: 10px;
    flex-shrink: 0;
  }

  .news-title {
    font-size: 0.9rem;
    line-height: 1.35;
    margin: 2px 0 0 0;
  }

  .news-desc {
    display: none; /* 手機版隱藏簡述，保持三筆畫面的整潔與高度精準 */
  }

  .footer-container {
    grid-template-columns: 1fr;
    gap: 36px;
    padding: 0 20px 40px;
  }
  .footer-bottom-container {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
}
/* Play course highlight videos directly inside the list. */
.news-card { display: flex; flex-direction: column; }
.highlight-video { position: relative; width: 100%; aspect-ratio: 16 / 9; min-height: 200px; background: #000; flex-shrink: 0; }
.highlight-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.news-card > .news-info-box { flex: 1; }
