/**
 * ============================================================
 * 設計系統 v2（依美編提供的版面設計稿套用，2026-10 更新）
 * 綠色主題、左側邊欄 + 頂部搜尋列的整站版型
 * ============================================================
 */
:root {
  --color-primary: #2f6f4f;
  --color-primary-dark: #1f4d37;
  --color-primary-light: #eaf3ee;
  --color-bg: #f4f5f3;
  --color-text: #1f2a24;
  --color-text-muted: #6b7a72;
  --color-border: #e1e5e2;
  --sidebar-width: 220px;
}

/**
 * style.css — 客戶服務網站前端共用樣式
 *
 * 採用「手機優先」寫法：先寫手機版樣式，畫面變寬時（平板、電腦）
 * 再用 @media 規則放寬版面。之後美編要改版型時，也建議維持這個
 * mobile-first 的寫法，比較不容易漏掉手機版的樣式。
 *
 * 螢幕大小分界（跟主流網站的慣例一致）：
 *   手機：預設（0 ~ 767px）
 *   平板：768px 以上
 *   電腦：1024px 以上
 */

/* ------------------------------------------------------------
   基礎重置與全域設定
------------------------------------------------------------ */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Microsoft JhengHei", sans-serif;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  /* 手機上避免手指觸控時整頁被拖曳出現多餘空白 */
  -webkit-text-size-adjust: 100%;
}

/* ------------------------------------------------------------
   版面容器：手機時貼齊螢幕邊緣留適當邊距，
   螢幕變寬後改為置中並限制最大寬度，避免文字被拉得過寬難以閱讀
------------------------------------------------------------ */
.page-container {
  width: 100%;
  min-height: 100vh;
  padding: 20px 16px;
}

.card {
  background: #fff;
  border-radius: 8px;
  padding: 24px 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  max-width: 480px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .page-container {
    padding: 48px 24px;
  }
  .card {
    padding: 32px 40px;
  }
}

/* ------------------------------------------------------------
   標題與文字
------------------------------------------------------------ */
h1 {
  font-size: clamp(20px, 5vw, 24px); /* 手機小螢幕字稍小，大螢幕字稍大，避免爆版 */
  margin: 0 0 24px;
  text-align: center;
}

p {
  font-size: 14px;
  color: #555;
}

/* ------------------------------------------------------------
   表單元件：所有輸入框、按鈕在手機上都要有足夠的觸控高度（至少 44px）
------------------------------------------------------------ */
label {
  display: block;
  margin-top: 16px;
  margin-bottom: 6px;
  font-weight: bold;
  font-size: 14px;
}

input[type="text"],
input[type="email"],
input[type="password"] {
  width: 100%;
  padding: 12px 10px; /* 手機上輸入框要夠高，方便手指點擊 */
  font-size: 16px; /* 16px 以上可避免 iOS Safari 自動放大畫面的問題 */
  border: 1px solid #ccc;
  border-radius: 6px;
  -webkit-appearance: none; /* 避免 iOS 預設樣式跑版 */
}

input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(47, 111, 79, 0.15);
}

button, .btn {
  display: block;
  width: 100%;
  min-height: 44px; /* 觸控裝置建議的最小可點擊高度 */
  margin-top: 20px;
  padding: 10px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  background: #999;
  cursor: not-allowed;
}

.btn-secondary {
  background: #fff;
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
}

/* ------------------------------------------------------------
   Checkbox 列（例如註冊頁的個資同意）
   手機螢幕窄，文字容易換行，用 flex 確保 checkbox 跟文字對齊美觀
------------------------------------------------------------ */
.checkbox-row {
  display: flex;
  align-items: flex-start;
  margin-top: 20px;
}

.checkbox-row input {
  /* checkbox 本身也要夠大，方便手指點擊，預設太小 */
  width: 20px;
  height: 20px;
  margin: 2px 10px 0 0;
  flex-shrink: 0;
}

.checkbox-row label {
  margin: 0;
  font-weight: normal;
  font-size: 14px;
}

.agreement-box {
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 12px;
  font-size: 13px;
  color: #555;
  max-height: 150px;
  overflow-y: auto;
  margin-top: 8px;
  background: #fafafa;
  -webkit-overflow-scrolling: touch; /* iOS 慣性捲動 */
}

/* ------------------------------------------------------------
   訊息提示區塊
------------------------------------------------------------ */
#message, .message-box {
  margin-top: 16px;
  display: none;
  font-size: 14px;
  padding: 10px 12px;
  border-radius: 6px;
  word-break: break-word; /* 手機小螢幕避免長訊息把版面撐開 */
}

.message-success {
  color: #1e7e34;
  background: #eafaf0;
}

.message-error {
  color: #c0392b;
  background: #fdecea;
}

/* ------------------------------------------------------------
   分頁籤（登入頁：密碼登入 / 驗證碼登入 切換）
------------------------------------------------------------ */
.tabs {
  display: flex;
  border-bottom: 1px solid #ddd;
  margin-bottom: 20px;
}

.tab {
  flex: 1;
  text-align: center;
  padding: 12px 8px; /* 手機上分頁籤要夠高，方便點擊 */
  cursor: pointer;
  font-size: 15px;
  color: #5c6b63;
  border-bottom: 2px solid transparent;
}

.tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  font-weight: bold;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ------------------------------------------------------------
   頁尾連結
------------------------------------------------------------ */
.footer-link {
  margin-top: 20px;
  text-align: center;
  font-size: 14px;
}

.footer-link a {
  color: var(--color-primary);
  text-decoration: none;
}

/* ------------------------------------------------------------
   會員頁面用的資訊列表（member.html）
------------------------------------------------------------ */
.info-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #eee;
  font-size: 14px;
  flex-wrap: wrap; /* 手機窄螢幕時，長內容可以換行而不會被切斷 */
  gap: 4px;
}

.info-row .label {
  color: #5c6b63;
}

.info-row .value {
  font-weight: bold;
  text-align: right;
  word-break: break-word;
}

/* ------------------------------------------------------------
   管理後台專用：資料筆數較多，容器可以比表單頁寬一些
------------------------------------------------------------ */
.wide-card {
  background: #fff;
  border-radius: 8px;
  padding: 20px 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  max-width: 900px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .wide-card {
    padding: 28px 32px;
  }
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.admin-header h1 {
  margin: 0;
  text-align: left;
}

/* 待審核 / 會員 清單卡片：手機上直向堆疊，桌機也維持這樣即可（資料筆數不多，不需要做成表格） */
.list-item {
  border: 1px solid #eee;
  border-radius: 6px;
  padding: 14px;
  margin-bottom: 12px;
}

.list-item-title {
  font-weight: bold;
  font-size: 15px;
  margin-bottom: 6px;
}

.list-item-meta {
  font-size: 13px;
  color: #777;
  margin-bottom: 10px;
  line-height: 1.8;
}

.list-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

/* 按鈕在清單裡是並排小按鈕，不用像表單頁的送出按鈕那麼大 */
.btn-inline {
  display: inline-block;
  width: auto;
  min-height: 38px;
  margin-top: 0;
  padding: 8px 16px;
  font-size: 14px;
}

.btn-approve {
  background: #27ae60;
}

.btn-reject {
  background: #c0392b;
}

select {
  width: 100%;
  padding: 10px;
  font-size: 15px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
}

textarea {
  width: 100%;
  padding: 10px;
  font-size: 15px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-family: inherit;
  resize: vertical;
  min-height: 60px;
}

.empty-hint {
  text-align: center;
  color: #999;
  padding: 20px 0;
}

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  background: #eef2f7;
  color: #555;
}

/* ============================================================
   整站主框架：左側邊欄 + 頂部列 + 內容區
   手機版：側邊欄預設隱藏，點漢堡選單才滑出（overlay）
   桌機版（1024px 以上）：側邊欄常駐顯示
============================================================ */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: #fff;
  border-right: 1px solid var(--color-border);
  padding: 20px 16px;
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform 0.2s ease;
  z-index: 50;
}

.sidebar.open {
  transform: translateX(0);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: bold;
  color: var(--color-primary-dark);
  margin-bottom: 24px;
  padding: 0 8px;
}

.sidebar-logo .sub {
  display: block;
  font-size: 11px;
  font-weight: normal;
  color: var(--color-text-muted);
}

.logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.topbar-logo-mobile {
  display: none;
  align-items: center;
  gap: 8px;
  font-weight: bold;
  color: var(--color-primary-dark);
  white-space: nowrap;
}

.topbar-logo-mobile .logo-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

@media (max-width: 1023px) {
  .topbar-logo-mobile {
    display: inline-flex;
  }
}

.sidebar-nav {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
}

.sidebar-nav li a {
  display: block;
  padding: 10px 12px;
  border-radius: 6px;
  color: var(--color-text);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 2px;
}

.sidebar-nav li a.active {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  font-weight: bold;
}

.sidebar-nav-divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 16px 0;
}

.sidebar-login-box {
  background: var(--color-bg);
  border-radius: 8px;
  padding: 12px;
  font-size: 13px;
  color: var(--color-text-muted);
}

.sidebar-login-box .btn-inline {
  margin-top: 8px;
  width: 100%;
  text-align: center;
}

/* 手機上點漢堡選單時，側邊欄之外的區域加一層半透明遮罩，點了會關閉選單 */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 40;
}

.sidebar-overlay.open {
  display: block;
}

@media (min-width: 1024px) {
  /* 桌機版：側邊欄改為 sticky，排在全寬橫幅下方，捲動時仍會固定在視窗上緣 */
  .sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    align-self: flex-start;
    flex-shrink: 0;
    transform: translateX(0);
  }
  .sidebar-overlay {
    display: none !important;
  }
  .hamburger-btn {
    display: none;
  }
}

.main-area {
  flex: 1;
  min-width: 0;
}

/* 頂部列：漢堡選單 + Logo（手機顯示）+ 搜尋框 + 使用者狀態 */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 30;
}

.hamburger-btn {
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  margin: 0;
  width: auto;
  min-height: auto;
  color: var(--color-text);
}

.search-box {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 14px;
  color: var(--color-text-muted);
}

.search-box input {
  border: none;
  background: transparent;
  outline: none;
  width: 100%;
  font-size: 14px;
  padding: 0;
}

.user-status {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  font-size: 14px;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: bold;
}

.badge-vip {
  background: var(--color-primary);
  color: #fff;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
}

.content-area {
  padding: 20px 16px 60px;
  max-width: 1200px;
}

/* ============================================================
   首頁（未登入）：主視覺、入會資格步驟、會員權益、範例內容
============================================================ */
.hero-section {
  background: var(--color-primary-light);
  border-radius: 10px;
  padding: 28px 20px;
  margin-bottom: 28px;
}

.hero-section h1 {
  text-align: left;
  font-size: clamp(20px, 4vw, 26px);
  margin-bottom: 10px;
}

.hero-section p {
  margin-bottom: 20px;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-actions .btn-inline {
  margin-top: 0;
}

.section-title {
  font-size: 16px;
  font-weight: bold;
  margin: 32px 0 4px;
}

.section-desc {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: 14px;
}

.step-grid, .benefit-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 640px) {
  .step-grid { grid-template-columns: repeat(3, 1fr); }
  .benefit-grid { grid-template-columns: repeat(2, 1fr); }
}

.step-card, .benefit-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 16px;
}

.step-card .step-num {
  font-size: 20px;
  font-weight: bold;
  color: var(--color-primary);
  margin-bottom: 6px;
}

.step-card .step-title, .benefit-card .benefit-title {
  font-weight: bold;
  margin-bottom: 6px;
}

.benefit-card.highlight {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}

.benefit-card ul {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--color-text-muted);
}

/* ============================================================
   內容卡片網格（Podcast / Video 範例內容、會員中心列表）
   注意：這裡只提供卡片「外觀」樣式；實際 Podcast/Video 資料
   綁定邏輯由對應子系統的對話負責實作，此處先放靜態範例結構
============================================================ */
.category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 16px;
  -webkit-overflow-scrolling: touch;
}

.category-tabs .cat-btn {
  display: inline-block;
  width: auto;
  min-height: auto;
  flex-shrink: 0;
  margin-top: 0;
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid var(--color-border);
  background: #fff;
  font-size: 13px;
  color: var(--color-text);
  cursor: pointer;
  white-space: nowrap;
}

.category-tabs .cat-btn.active {
  background: var(--color-text);
  color: #fff;
  border-color: var(--color-text);
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 640px) {
  .content-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .content-grid { grid-template-columns: repeat(3, 1fr); }
}

.content-card {
  display: block;
  text-decoration: none;
  color: inherit;
}

.content-card .thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  background: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 8px;
}

.content-card .thumb .play-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  font-size: 16px;
}

.content-card .thumb .duration {
  position: absolute;
  right: 8px;
  bottom: 8px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
}

.content-card .thumb .progress-bar {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  background: #fff;
}

.content-card .ct-title {
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 4px;
}

.content-card .ct-meta {
  font-size: 12px;
  color: var(--color-text-muted);
}

/* ============================================================
   頁尾（網站公開頁使用；會員登入後的內部頁面不需要）
============================================================ */
.site-footer {
  background: var(--color-primary-dark);
  color: #fff;
  padding: 24px 16px;
  margin-top: 40px;
  font-size: 13px;
  line-height: 1.8;
}

.site-footer .footer-title {
  font-size: 15px;
  font-weight: bold;
  margin-bottom: 8px;
}

/* ============================================================
   登入／註冊合併頁：雙欄表單排版（手機自動變單欄）
============================================================ */
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 16px;
}

@media (min-width: 560px) {
  .form-grid-2 { grid-template-columns: 1fr 1fr; }
}

.auth-card {
  max-width: 560px;
}

.auth-card .tabs {
  margin-bottom: 24px;
}

.link-inline {
  color: var(--color-primary);
  text-decoration: none;
  font-size: 14px;
}

.link-row {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

/* ============================================================
   側邊欄「即將推出」項目（尚未上線的頁面不給連結，避免 404）
============================================================ */
.nav-disabled {
  display: block;
  padding: 10px 12px;
  font-size: 14px;
  color: #b7bdb9;
  cursor: default;
}

.nav-disabled small {
  font-size: 11px;
}



/* ============================================================
   全寬品牌橫幅（版面最上方，所有頁面共用）
============================================================ */
/* 手機（< 700px）：圖片左右滿版、高度依比例自動縮放 */
.brand-banner-wrap {
  width: 100%;
  overflow: hidden;
  line-height: 0;
  background: linear-gradient(to right, #181f21, #0c0f12); /* 與圖片左右邊緣同色 */
}

.brand-banner-wrap img {
  width: 100%;
  height: auto;
  display: block;
}

/* 平板／電腦（>= 700px）：橫幅整條仍然左右滿版，但 Logo 圖片限制高度，
   避免在寬螢幕上把內容推到畫面下方。
   想調整高度只要改下面這一行 --banner-height：
   例如 clamp(140px, 15vw, 220px) 更矮、clamp(220px, 24vw, 340px) 更高 */
:root {
  --banner-height: clamp(180px, 19vw, 280px);
}

@media (min-width: 700px) {
  .brand-banner-wrap {
    display: flex;
    justify-content: center;
  }
  .brand-banner-wrap img {
    width: auto;
    max-width: 100%;
    height: var(--banner-height);
    /* 圖片左右邊緣做淡出，和兩側底色自然銜接，不會看到接縫 */
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 12%, #000 88%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0, #000 12%, #000 88%, transparent 100%);
  }
}

/* 連結(<a>)形式的主要按鈕：補上綠色底色，避免看起來像一般藍色超連結 */
a.btn-inline {
  text-decoration: none;
  text-align: center;
  cursor: pointer;
}

a.btn-inline:not(.btn-secondary) {
  background: var(--color-primary);
  color: #fff;
  border: 1px solid var(--color-primary);
  border-radius: 6px;
}
