/* ============================================================
   PickQue 共用樣式標準(pickque-style.css)
   所有頁面(rich 開頭、link 開頭的 .html)都應該 <link rel="stylesheet" href="pickque-style.css">
   引用這份檔案,頁面自己的 <style> 只保留真的獨有、跟這頁特定畫面綁死的樣式
   (例如某個頁面專屬的版面排列),顏色、字級、卡片、按鈕、彈窗這些共用元件一律
   用這裡定義的 class,不要在個別頁面重新刻一份。

   設計原則:名片(卡片)區域外——淺色背景 + 深色文字,乾淨易讀;
            名片(卡片)區域內——深色背景 + 淺色文字,拉出視覺焦點,
            角色/結餘這類重點數字用高對比亮色標出來。
   ============================================================ */

:root {
  /* ===== 大地色系(10/25,坑 #85):橄欖灰綠主色、米白底、同色系深淺,不用對比色 ===== */
  --brand: #66755A;          /* 主色:按鈕、選中頁籤、連結、底部選單 */
  --brand-deep: #4A5640;     /* 深藍:漸層起點、重點標題 */
  --brand-light: #E7ECE0;    /* 淡藍:標籤底色、預設頭像底色 */
  --brand-gradient: linear-gradient(135deg, #4A5640 0%, #8E9E80 100%);
  --brand-green: var(--brand);   /* 舊名稱保留相容(以前是綠色品牌色) */
  --accent-blue: var(--brand);
  --accent-orange: #B89A68;

  /* 頁面底色與文字 */
  --page-bg: #F4F0E7;
  --page-text: #3E4636;
  --page-text-muted: #747A6A;
  --page-text-faint: #9BA08F;

  /* 卡片 */
  --card-bg: #ffffff;
  --card-border: #DDE2D5;

  /* 名冊清單:改成 DUPR 的白底列表(變數名稱沿用 dark-card,避免改動各頁程式) */
  --dark-card-bg: #ffffff;
  --dark-card-border: #ECEFE6;
  --dark-card-text: #3E4636;
  --dark-card-text-muted: #868C7C;

  /* 語意色:身份標籤、結餘正負 */
  --role-badge-color: #66755A;
  --balance-positive: #6E8A5C;
  --balance-negative: #A8574C;
  --balance-positive-light: #6E8A5C;
  --balance-negative-light: #A8574C;
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang TC', sans-serif;
  background-color: var(--page-bg);
  color: var(--page-text);
  font-size: 16px;
  margin: 0;
  padding: 16px;
  padding-bottom: 76px; /* 幫底部選單留空間 */
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.page-container { background-color: var(--page-bg); color: var(--page-text); }

/* ===================== 淺色卡片(一般資訊卡) ===================== */
.card {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* ===================== 深色名片(俱樂部成員清單) ===================== */
.member-card-list {
  background-color: var(--dark-card-bg);
  border-radius: 12px;
  padding: 6px 12px;
  margin-bottom: 14px;
  border: 1px solid var(--card-border);
}

.member-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 2px;
  border-bottom: 1px solid var(--dark-card-border);
  color: var(--dark-card-text);
  font-size: 16px;
}

.member-item:last-child { border-bottom: none; }
/* 多筆清單單雙列(10/25 大地色系,坑 #85):同色系深淺交錯,不用對比色 */
.member-item:nth-child(even) { background: #F1F4EC; }
.member-item { padding-left: 6px; padding-right: 6px; border-radius: 6px; }

.member-item .avatar {
  width: 26px; height: 26px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
}

.member-item .avatar-fallback {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--brand-light); color: var(--brand); font-weight: 700; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}

.member-item .name { flex: 1; }
.member-item .name-muted { color: var(--dark-card-text-muted); }

/* 身份標籤(領隊/隊務/隊員/臨打)——亮黃色,在深色卡片上仍然清楚可讀 */
.role-badge { color: var(--role-badge-color); font-weight: 700; font-size: 15px; margin-right: 4px; }

/* 結餘數字——正負分開用亮色標,深色卡片專用 */
.balance-positive { color: var(--balance-positive); font-weight: 700; }
.balance-negative { color: var(--balance-negative); font-weight: 700; }

/* 淺色卡片內如果也要顯示結餘(不在深色名片裡),沿用舊的紅綠配色,不要用上面那組亮色
   (在白底上太刺眼、對比度也不對) */
.balance-positive-light { color: var(--balance-positive-light); font-weight: 700; }
.balance-negative-light { color: var(--balance-negative-light); font-weight: 700; }

/* ===================== 按鈕 ===================== */
.btn {
  display: inline-block;
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 16px;
  border: none;
  color: #fff;
  cursor: pointer;
  background: var(--brand);
}
.btn:disabled { background: #ccc; cursor: default; }
.btn-write { background: var(--accent-blue); }
.btn-write:disabled { background: #A9B79B; }
.btn-danger { background: var(--balance-negative-light); }
.btn-danger:disabled { background: #CFA79F; }

/* ===================== 表單元件 ===================== */
label { display: block; font-size: 16px; color: var(--page-text-muted); margin: 10px 0 4px; }
label:first-child { margin-top: 0; }
input, select, textarea {
  width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 6px;
  box-sizing: border-box; font-size: 16px; background: #fff; color: var(--page-text);
}
input:disabled, select:disabled, textarea:disabled { background: #f5f5f5; color: #999; }

/* ===================== 彈窗(Modal) ===================== */
.modal-bg {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.45); display: flex; align-items: flex-end;
  justify-content: center; z-index: 200;
}
.modal-bg.hidden { display: none; }
.modal {
  background: #fff; border-radius: 16px 16px 0 0; width: 100%; max-width: 520px;
  max-height: 88vh; overflow-y: auto; padding: 0 0 20px;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid #eee; position: sticky; top: 0; background: #fff;
}
.modal-header h3 { margin: 0; font-size: 17px; }
.modal-close { cursor: pointer; font-size: 18px; color: #999; }
.modal-body { padding: 16px 20px; }
.modal-submit-btn {
  display: block; width: calc(100% - 40px); margin: 16px 20px 0; padding: 12px;
  border-radius: 8px; border: none; background: var(--accent-blue); color: #fff;
  font-size: 16px; font-weight: 700; cursor: pointer;
}
.form-error { color: var(--balance-negative-light); font-size: 16px; min-height: 18px; margin: 6px 0; }

/* ===================== 頁籤(頂部大頁籤、內部子頁籤統一長相) =====================
   膠囊式分段按鈕:整排頁籤包在一個有底色的外框裡,選中的那顆是實心品牌綠膠囊。
   不放小圖示(舊頁面如果還留著 <span class="icon">,這裡直接藏起來)。 */
.top-tabs, .tabs {
  display: flex; gap: 4px; padding: 4px; margin-bottom: 14px;
  background: #E4E9DD; border: 1px solid #D9DFD0; border-radius: 999px;
}
.top-tab, .tab {
  flex: 1; text-align: center; padding: 8px 4px; border-radius: 999px; border: none;
  color: var(--page-text-muted); font-weight: 700; font-size: 16px; cursor: pointer; white-space: nowrap;
  -webkit-tap-highlight-color: transparent; transition: background-color .15s, color .15s;
}
.top-tab.active, .tab.active {
  background: var(--brand); color: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.18);
}
.top-tab .icon, .tab .icon { display: none; }

/* ===================== 子頁面標題列(左上角返回鍵 + 標題) ===================== */
.sub-header {
  display: flex; align-items: center; gap: 4px; position: sticky; top: 0; z-index: 50;
  background: var(--page-bg); margin: -16px -16px 12px; padding: 10px 8px;
  border-bottom: 1px solid #eceef1;
}
.back-btn {
  width: 40px; height: 40px; border: none; background: transparent; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--page-text);
  -webkit-tap-highlight-color: transparent;
}
.back-btn:active { background: #e4e7eb; }
.sub-title { font-size: 19px; font-weight: 800; color: var(--page-text); }

/* ===================== 底部選單 ===================== */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid #eee;
  display: flex; z-index: 100; padding-bottom: env(safe-area-inset-bottom, 0px);
}
.bottom-nav a {
  flex: 1; text-align: center; padding: 8px 0 6px; text-decoration: none;
  color: var(--page-text-faint); font-size: 16px; font-weight: 700; /* 10/30:放大一號＋加粗(長輩好認) */
}
.bottom-nav a.active { color: var(--brand); font-weight: 700; }
.bottom-nav .nav-icon { font-size: 20px; display: block; margin-bottom: 2px; }

/* ===================== 骨架載入畫面 ===================== */
@keyframes skeleton-pulse { 0% { opacity: 1; } 50% { opacity: 0.55; } 100% { opacity: 1; } }
.skeleton-block { background: #e2e2e2; border-radius: 6px; animation: skeleton-pulse 1.2s ease-in-out infinite; height: 16px; margin-bottom: 10px; }

/* ===================== 小工具 class ===================== */
.hidden { display: none !important; }
.status-line { font-size: 16px; color: var(--balance-negative-light); }
.action-btn {
  display: inline-block; padding: 4px 10px; border-radius: 6px; font-size: 15px;
  font-weight: 700; color: #fff; background: var(--brand); cursor: pointer; border: none;
}

/* ===================== 兩段式切換開關(編輯俱樂部的開放方式、個人資料的大頭貼)=====================
   左右兩段膠囊,選中的那段實心;切換當下就生效,不用另外按儲存 */
.seg-toggle { display: flex; border: 1px solid #D2D8C9; border-radius: 999px; overflow: hidden; background: #fff; padding: 3px; gap: 3px; }
.seg-toggle button { flex: 1; padding: 10px 0; border: none; background: transparent; font-size: 16px; font-weight: 700; color: var(--page-text); cursor: pointer; border-radius: 999px; -webkit-tap-highlight-color: transparent; }
.seg-toggle button.active { background: var(--brand); color: #fff; }
.seg-toggle button:disabled { cursor: default; opacity: 0.6; }
.seg-hint { font-size: 15px; color: var(--page-text-faint); margin-top: 6px; line-height: 1.6; }

/* ===== 活動類型標籤(坑 #45):📌 範本 / 🔁 固定團 / ⚡ 臨時團;舊活動(沒標)不顯示 ===== */
.kind-tag { display: inline-block; font-size: 14px; font-weight: 700; line-height: 1.5; border-radius: 999px; padding: 1px 8px; white-space: nowrap; vertical-align: middle; }
.kind-template { background: #EFE7DF; color: #7D6A5C; }
.kind-fixed { background: #E5ECDD; color: #556B47; }
.kind-dupr { background: #66755A; color: #fff; } /* DUPR 場(坑 #90) */
.kind-temp { background: #F2EBDD; color: #866A48; }
