/* 追星交易小帳本 — 樣式(手機優先,粉嫩追星風) */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #e0447f;
  --primary-soft: #fde8f1;
  --ink: #3d2b3d;
  --muted: #a3899a;
  --warn: #c07b18;
  --warn-bg: #fff3dd;
  --good: #189a6c;
  --good-bg: #e0f7ec;
  --danger: #e05c5c;
  --radius: 18px;
  --shadow: 0 4px 16px rgba(236, 95, 157, 0.10);
}

html, body { height: 100%; }

/* iOS 由 Capacitor scrollEnabled:false 關閉外殼滾動;網頁層用常規文件流鎖定(不用 position:fixed,iOS 有坑) */
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  /* 禁用 double-tap 放大(點擊 filter 等按鈕時快速兩下會觸發 iOS 縮放),保留滾動 */
  touch-action: manipulation;
}

#app {
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", system-ui, sans-serif;
  color: var(--ink);
  background: linear-gradient(160deg, #ffe4f0 0%, #fdeef6 45%, #f6effb 100%);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* 全域圖標:一律粉色線性,與底部 4 個主標籤一致;按鈕內跟隨按鈕文字色 */
svg.icz { color: var(--primary); }
button svg.icz { color: inherit; }


#app {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100dvh;
  position: relative;
  background:
    radial-gradient(circle at 10% 4%, rgba(255, 182, 213, 0.28), transparent 26%),
    radial-gradient(circle at 92% 3%, rgba(198, 166, 255, 0.22), transparent 30%),
    linear-gradient(180deg, #fff5fa 0%, #fdf3f8 100%);
  box-shadow: 0 0 44px rgba(216, 74, 134, 0.10);
}

/* ---------- 頂欄 ---------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  padding-top: calc(14px + env(safe-area-inset-top, 0px)); /* 避開 iPhone 劉海/狀態欄 */
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 240, 247, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid #f8dfec;
  flex-shrink: 0;
}

.brand {
  font-weight: 900;
  font-size: 18px;
  letter-spacing: 1px;
  color: var(--primary);
  cursor: pointer;
  user-select: none;
}

.installchip {
  margin-left: auto;
  background: linear-gradient(135deg, #ff86b3, #f5578f);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 4px 10px rgba(245, 87, 143, 0.35);
  white-space: nowrap;
}
.installchip:active { transform: scale(0.95); }
.installchip + .userchip { margin-left: 0; }

.userchip {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #8a5b74;
  background: #fff;
  border: 1px solid #f5d9e7;
  padding: 4px 12px 4px 5px;
  border-radius: 999px;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 2px 8px rgba(236, 95, 157, 0.08);
}

/* ---------- 頭像 ---------- */

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  flex-shrink: 0;
  user-select: none;
}
.avatar-sm { width: 26px; height: 26px; font-size: 12px; }
.avatar-lg { width: 54px; height: 54px; font-size: 24px; }

/* ---------- 內容區 ---------- */

.content { padding: 16px 16px 160px; flex: 1 1 0; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; } /* 160px 底 padding:避開 FAB+導航 */

.login-wrap { flex: 1; min-height: 0; overflow-y: auto; }

.muted { color: var(--muted); }
.small { font-size: 12px; }
.warn { color: var(--warn); }
.good { color: var(--good); }

.section-h {
  font-size: 14px;
  font-weight: 800;
  color: #c26d97;
  margin: 20px 2px 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.section-h::before {
  content: "";
  width: 4px;
  height: 14px;
  border-radius: 2px;
  background: linear-gradient(180deg, #ff86b3, #f5578f);
}

.month-h {
  font-size: 12px;
  font-weight: 800;
  color: #c26d97;
  margin: 16px 2px 8px;
  letter-spacing: 0.5px;
}

/* ---------- 卡片 ---------- */

.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

/* ---------- 統計卡 ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.stats.two { grid-template-columns: 1fr 1fr; }

.stat {
  background: #fff;
  border-radius: 16px;
  padding: 12px 10px;
  box-shadow: var(--shadow);
  text-align: center;
}
.stat .label { font-size: 11px; color: var(--muted); font-weight: 700; }
.stat .val { font-size: 16px; font-weight: 800; margin-top: 5px; }

/* ---------- 篩選 chips ---------- */

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 0; }
.chips + .chips { margin-top: 8px; }

.chip {
  border: 1.5px solid #f2cfdf;
  background: #fff;
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 13px;
  font-weight: 700;
  color: #9b6f86;
  cursor: pointer;
  transition: all 0.15s;
}
.chip.active {
  background: linear-gradient(135deg, #ff86b3, #f5578f);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 10px rgba(245, 87, 143, 0.35);
}

/* ---------- 交易卡 ---------- */

.trade {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.trade-main { flex: 1; min-width: 0; }
.trade-title { font-weight: 800; font-size: 15px; word-break: break-word; }
.trade-sub { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.5; }
.trade-note { font-size: 12px; color: #b78ea3; margin-top: 4px; line-height: 1.5; }
.trade-note.good { color: var(--good); font-weight: 700; }

.trade-side {
  margin-left: auto;
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
  min-width: 88px;
}
.amount { font-weight: 800; font-size: 15px; white-space: nowrap; }

.pill {
  border: none;
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.1s;
  font-family: inherit;
}
.pill:active { transform: scale(0.94); }
.pill.unpaid { background: var(--warn-bg); color: var(--warn); }
.pill.paid { background: var(--good-bg); color: var(--good); }

.pills { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.trade-ops { font-size: 11px; }
.trade-ops a { color: #cf9bb5; text-decoration: none; font-weight: 600; }
.trade-ops a:hover { color: var(--primary); }

/* ---------- 群組卡 ---------- */

.groupcard { cursor: pointer; margin-bottom: 12px; }
.groupcard:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(236, 95, 157, 0.16); }

.gc-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.gc-name { font-weight: 800; font-size: 16px; color: var(--primary); }
.gc-stack { display: flex; align-items: center; margin-top: 10px; }
.gc-stack .avatar { margin-right: -7px; border: 2px solid #fff; }
.gc-stack .plus { margin-left: 12px; font-size: 12px; color: var(--muted); }
.gc-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.gc-balance { font-size: 13px; font-weight: 800; }

.group-head { margin: 2px 2px 4px; }
.group-head h2 { font-size: 20px; color: var(--primary); margin-bottom: 4px; }

/* ---------- 成員款項 ---------- */

.memberlist { padding: 6px 14px; }
.member-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dashed #f3e0ea;
}
.member-row:last-child { border-bottom: none; }
.mr-name { font-weight: 700; font-size: 14px; flex: 1; }
.me-tag { font-size: 11px; color: var(--primary); font-weight: 800; }
.mr-num { font-size: 12.5px; font-weight: 800; display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; max-width: 60%; }

/* ---------- 邀請框 ---------- */

.invitebox {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #fff0f6;
  border: 1.5px dashed #f5a8c6;
  border-radius: 14px;
  padding: 11px 13px;
  margin: 12px 0 16px;
}
.code { font-size: 16px; font-weight: 900; letter-spacing: 2.5px; color: #d84a86; margin-top: 2px; }

.btn-mini {
  background: #fff;
  border: 1.5px solid #f7b8d3;
  color: var(--primary);
  border-radius: 999px;
  padding: 8px 13px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: all 0.15s;
}
.btn-mini:active { transform: scale(0.95); }

/* ---------- 按鈕 ---------- */

.btn {
  width: 100%;
  margin-top: 16px;
  padding: 13px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #ff86b3, #f5578f);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 1px;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 6px 16px rgba(245, 87, 143, 0.35);
  transition: transform 0.1s, box-shadow 0.15s;
}
.btn:active { transform: scale(0.98); }
.btn.ghost {
  background: #fff;
  color: var(--primary);
  border: 1.5px solid #f7b8d3;
  box-shadow: none;
}

.row-actions { display: flex; gap: 10px; margin-bottom: 16px; }
.row-actions .btn { margin-top: 0; }
.row-actions .half { flex: 1; }

.btn-text {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: #c26d97;
  font-size: 13px;
  font-weight: 700;
  padding: 8px;
  cursor: pointer;
  font-family: inherit;
}

.btn-text-danger {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: var(--danger);
  font-size: 13px;
  font-weight: 800;
  padding: 16px 0 2px;
  cursor: pointer;
  font-family: inherit;
}

.backbtn {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  padding: 0;
  margin-bottom: 10px;
  font-family: inherit;
}

/* ---------- 底部導覽 ---------- */

.bottomnav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 520px;
  display: flex;
  background: rgba(255, 253, 254, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid #f6dfec;
  z-index: 40;
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-item {
  flex: 1;
  background: none;
  border: none;
  padding: 8px 0 10px;
  font-size: 11px;
  font-weight: 800;
  color: #c39cb1;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-family: inherit;
}
.nav-item.active { color: var(--primary); }
.nav-ic { line-height: 1; display: flex; align-items: center; justify-content: center; }
.nav-item .nav-ic svg { display: block; }
.nav-item.active .nav-ic svg { stroke-width: 2.4; }

/* ---------- 浮動新增按鈕 ---------- */

.fab {
  position: fixed;
  bottom: calc(84px + env(safe-area-inset-bottom));
  right: max(16px, calc(50% - 244px));
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #ff86b3, #f5578f);
  color: #fff;
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
  box-shadow: 0 8px 20px rgba(245, 87, 143, 0.45);
  cursor: pointer;
  z-index: 35;
  transition: transform 0.12s;
  font-family: inherit;
}
.fab:active { transform: scale(0.92); }

/* 底部橫幅廣告(免費版):banner 由原生層擺喺導覽欄正上方,佔大約 nav 高+50~90pt。
   以下貼底/浮動元素喺有 banner 時用最壞情況高度(~nav90+banner90)墊高,保證唔會俾 banner 冚住:
   .fab 掣、.sheet 彈窗內容、.toast 提示氣泡 */
body.has-banner .fab { bottom: calc(180px + env(safe-area-inset-bottom)); }
body.has-banner .sheet { padding-bottom: 210px; }
body.has-banner .toast { bottom: 246px; }
/* 列表捲到最底時,最後嗰張卡都唔好掂到 banner 頂(banner 頂最高約 180px) */
body.has-banner .content { padding-bottom: 200px; }

/* ---------- 空狀態 ---------- */

.empty {
  text-align: center;
  color: #bd93aa;
  padding: 44px 20px 30px;
  font-size: 14px;
  line-height: 1.9;
  font-weight: 600;
}
.empty-star { font-size: 30px; color: #f5a8c6; margin-bottom: 6px; }

/* ---------- 彈出表單(底部面板) ---------- */

.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(61, 32, 52, 0.45);
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadein 0.18s ease;
}

.sheet {
  width: 100%;
  max-width: 520px;
  background: #fff;
  border-radius: 24px 24px 0 0;
  padding: 22px 20px calc(26px + env(safe-area-inset-bottom));
  max-height: 88vh;
  max-height: 88dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  animation: slideup 0.22s ease;
  position: relative;
}

.sheet-x {
  position: sticky;
  top: 0;
  float: right;
  margin: -8px -6px 0 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: #fde8f1;
  color: #c26d97;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  z-index: 5;
  font-family: inherit;
  flex-shrink: 0;
}
.sheet-x:active { transform: scale(0.9); }

.sheet h3 { color: var(--primary); font-size: 17px; margin-bottom: 12px; }

.sheet label {
  display: block;
  font-size: 12px;
  font-weight: 800;
  color: #8a5b74;
  margin: 13px 2px 6px;
}

.input {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid #f0dbe8;
  border-radius: 12px;
  font-size: 16px; /* iOS:輸入框 <16px 會自動放大頁面,必須 ≥16 */
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  transition: border-color 0.15s;
}
.input:focus { outline: none; border-color: #f58cb4; }
textarea.input { resize: vertical; }
select.input { appearance: auto; }

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.total-line {
  margin-top: 10px;
  font-size: 13px;
  color: #8a5b74;
  text-align: right;
}
.total-line b { color: var(--primary); font-size: 16px; margin-left: 4px; }

/* ---------- 分攤表單(下拉選人 + 金額) ---------- */

#split-pay, #split-recv { display: flex; flex-direction: column; gap: 8px; }
.split-line { display: flex; gap: 8px; align-items: center; }
.split-line .input:first-child { flex: 1; min-width: 0; }
.split-amt2 { width: 108px; padding: 10px 9px; font-size: 16px; text-align: right; flex-shrink: 0; } /* ≥16 防 iOS 縮放 */
.split-del {
  border: none;
  background: #fde8ef;
  color: #d66;
  width: 34px;
  height: 40px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
  font-family: inherit;
}
.split-del:active { transform: scale(0.92); }

.split-sum {
  margin-top: 10px;
  font-size: 12.5px;
  color: #8a5b74;
  line-height: 1.9;
}
.split-sum b { color: var(--primary); margin: 0 2px; }
.split-ok { color: var(--good); font-weight: 800; margin-left: 4px; }
.split-bad { color: var(--danger); font-weight: 800; margin-left: 4px; }

/* ---------- 收據 / 廣告 ---------- */

.receipt-img {
  width: 100%;
  border-radius: 14px;
  margin-top: 10px;
  display: block;
  background: #fbf3f7;
}

.ad-box { padding-top: 4px; }
.ad-placeholder {
  margin: 12px 0;
  padding: 46px 16px;
  background: linear-gradient(135deg, #fbe9f1, #f3e8fb);
  border: 1.5px dashed #f0b9d2;
  border-radius: 14px;
  text-align: center;
  font-size: 16px;
  font-weight: 800;
  color: #c26d97;
  line-height: 1.9;
}
#ad-done[disabled] { opacity: 0.6; }

/* 表單內收據選擇 */
.receipt-pick {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 2px;
}

/* ---------- 我的頁:設定列表 ---------- */

.set-list { padding: 2px 0; }
.set-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  cursor: pointer;
}
.set-row + .set-row { border-top: 1px solid #f8e8f0; }
.set-row:active { background: #fdf2f7; }
.set-ic { font-size: 19px; width: 26px; text-align: center; flex-shrink: 0; }
.set-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.set-tx b { font-size: 14.5px; font-weight: 700; }
.set-arrow { color: #d8a8c0; font-size: 20px; font-weight: 300; }

.plan-box { padding: 4px 0 8px; }
.plan-name { font-size: 16px; font-weight: 800; color: var(--primary); margin-bottom: 3px; }

/* ---------- 通知鈴鐺 / 新手教學 ---------- */

.bellbtn {
  position: relative;
  background: #fff;
  border: 1.5px solid #f5d9e7;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  font-size: 17px;
  cursor: pointer;
  flex-shrink: 0;
  font-family: inherit;
  color: #c26d97; /* SVG currentColor 跟隨 */
  display: flex;
  align-items: center;
  justify-content: center;
}
.bellbtn:active { transform: scale(0.92); }
.nbadge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #f5578f;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  min-width: 17px;
  height: 17px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}
.notif-item { padding: 10px 0; border-bottom: 1px dashed #f3e0ea; font-size: 13.5px; line-height: 1.6; }
.notif-item:last-of-type { border-bottom: none; }
.notif-unread { background: #fff5fa; border-radius: 10px; padding-left: 10px; padding-right: 10px; }
.notif-unread::before { content: "●"; color: var(--primary); font-size: 9px; margin-right: 6px; }

.onb-step { display: flex; gap: 12px; align-items: flex-start; margin: 14px 0; text-align: left; }
.onb-ic { font-size: 26px; flex-shrink: 0; }
.onb-step b { font-size: 15px; }

/* ---------- 活動行程 ---------- */

.ev-card { display: flex; gap: 10px; margin-bottom: 10px; padding: 12px 12px 12px 14px; }
.ev-main { flex: 1; min-width: 0; cursor: pointer; }
.ev-title { font-weight: 800; font-size: 15px; word-break: break-word; }
.ev-type { font-size: 11px; font-weight: 700; color: #8a5b74; margin-left: 4px; }
.ev-group { font-size: 11px; color: var(--primary); margin-left: 6px; font-weight: 700; }
.ev-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; justify-content: center; }

.cal-card { padding: 14px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-head b { color: var(--primary); font-size: 15px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-dow { text-align: center; font-size: 11px; font-weight: 800; color: #c39cb1; padding: 4px 0; }
.cal-cell {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-height: 54px;
  padding: 3px 2px;
  border-radius: 8px;
  cursor: pointer;
  overflow: hidden;
}
.cal-cell:empty { cursor: default; }
.cal-num { font-size: 12.5px; font-weight: 700; color: var(--ink); align-self: center; margin-bottom: 2px; }
.cal-today .cal-num {
  background: linear-gradient(135deg, #ff86b3, #f5578f);
  color: #fff;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cal-dots { display: flex; gap: 3px; margin-top: 3px; height: 6px; }
.cal-dot { width: 6px; height: 6px; border-radius: 50%; }

.seg {
  display: flex;
  background: #fbe9f1;
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
  margin-top: 4px;
}
.seg-item {
  flex: 1;
  border: none;
  background: transparent;
  padding: 9px 4px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 800;
  color: #a96e8c;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.seg-item.active {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* ---------- 我的頁 ---------- */

.profile { display: flex; align-items: center; gap: 13px; cursor: pointer; }
.profile:hover { transform: translateY(-1px); }
.profile-name { font-weight: 900; font-size: 17px; }

.help p { margin: 9px 0; line-height: 1.75; font-size: 13.5px; }
.help b { color: var(--primary); }

/* ---------- 登入頁 ---------- */

.login-wrap {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  background: #fff;
  border-radius: 26px;
  padding: 38px 28px 30px;
  width: 100%;
  max-width: 370px;
  text-align: center;
  box-shadow: 0 12px 44px rgba(236, 95, 157, 0.20);
}

.login-logo { font-size: 46px; line-height: 1; margin-bottom: 8px; }

.login-card h1 {
  font-size: 21px;
  color: var(--primary);
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.login-sub { font-size: 13.5px; color: var(--muted); margin-bottom: 22px; line-height: 1.7; }
.login-note { font-size: 11.5px; color: #c9aec0; margin-top: 16px; }

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 150px;
  background: rgba(61, 43, 61, 0.94);
  color: #fff;
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 700;
  z-index: 80;
  animation: toastin 0.2s ease;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.25);
  white-space: nowrap;
  max-width: 88vw;
  overflow: hidden;
  text-overflow: ellipsis;
}
.toast-err { background: rgba(198, 57, 80, 0.96); }

/* ---------- 動畫 ---------- */

@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideup { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes toastin { from { transform: translate(-50%, 12px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

/* ---------- Apple 登錄 ---------- */

.apple-divider { text-align: center; color: var(--muted); font-size: 12px; margin: 12px 0 2px; }
.apple-btn { background: #000 !important; box-shadow: none !important; font-size: 16px; }

/* ---------- 頭像圖 / Apple logo ---------- */

.av-img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.av-edit {
  position: absolute;
  bottom: -2px;
  right: -2px;
  background: #fff;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.apple-logo { color: #fff; }

.cal-ev {
  font-size: 9px;
  line-height: 1.3;
  color: #fff;
  border-radius: 4px;
  padding: 1px 3px;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}
.cal-more { font-size: 9px; color: var(--muted); margin-top: 1px; font-weight: 700; }

/* ---------- 折疊標題 / 設定行靠左 ---------- */

.sec-toggle { cursor: pointer; user-select: none; }
.sec-toggle:active { opacity: 0.6; }
.sec-toggle .tog { margin-left: auto; font-size: 12px; color: #cf9bb5; }
.section-h.sec-toggle { display: flex; align-items: center; gap: 6px; }
.month-h.sec-toggle { display: flex; align-items: center; gap: 5px; }

/* 設定行:圖標靠左(與文字對齊),不再固定寬度置中 */
.set-ic { width: auto; min-width: 22px; text-align: left; flex-shrink: 0; display: flex; align-items: center; }
.set-ic svg { display: block; }
.set-row { padding: 13px 14px; }
