/* ===== 樣式 D · 貼紙可愛（Sticker Pop）=====
   規則：2px 框線 + 實心偏移陰影 + 兩個彩色（番茄紅／奶油黃）+ 資訊藍。
   結構（深色模式的前提）：
     --text  = 文字色      ─┐ 淺色時兩者同值，深色時分家：
     --frame = 框線／貼紙邊 ─┘ 文字變亮、框線維持近黑
     --on-accent = 黃底上的文字（深色模式也維持深色，否則字會消失在黃色上）
     --shadow-color = 偏移陰影色（深色改用純黑，見下方 [data-theme="dark"]） */
:root {
  color-scheme: light;
  --page: #F6EDDD;          /* 手機外框之外的桌布 */
  --bg: #FFFCF3;            /* 暖白紙底 */
  --surface: #ffffff;
  --surface-alt: #F6EFE2;   /* 柔底（2026-09-25 視覺收斂）：日格、無框容器、標籤底。
                               框線退場後靠「色階」分層 —— 不要在它上面再加 2px 墨框。 */
  --soft-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);  /* 柔陰影：按鈕用（原本是實心偏移陰影） */
  --text: #221C15;          /* 文字 */
  --frame: #221C15;         /* 框線與貼紙邊 */
  --muted: #8A8071;
  --muted-weak: #CFC5B4;    /* 最弱的字（非本月日期） */
  --text-soft: #4A4234;     /* 長文（簡介／方案說明） */
  --line: #EFE6D4;          /* 卡內細分隔線（淡） */
  --primary: #FF6B4A;       /* 番茄紅：主要動作 */
  --primary-hover: #F2563A;
  --primary-soft: #FFE9E2;
  --on-primary: #ffffff;    /* 紅底上的文字 */
  --mint: #FFC94A;          /* 奶油黃（舊 key；別名 --accent） */
  --mint-soft: #FFF3D4;
  --pink: #FFC94A;          /* 舊 key */
  --pink-soft: #FFF3D4;
  --accent: #FFC94A;
  --accent-soft: #FFF3D4;
  --on-accent: #221C15;     /* 黃底上的文字 */
  --info: #3E8BD8;          /* 資訊藍：日期／狀態／開發提示 */
  --info-soft: #E4F0FB;
  --info-text: #2C5F8F;
  /* ===== 日曆識別色（2026-09-21 A+C 改版）=====
     來源：後端 themes.py 的調色盤 key（cal-1…cal-6）。**後端存 key、色值只存在這裡**
     —— 深淺色模式各一組色值，存色碼會在切換深色時壞掉。
     ⚠️ 使用範圍鐵則：這 6 色**只准用在** ① 月格圓點 ② 當日清單 3px 色條 ③ 小字標籤。
     **不准**當卡片／按鈕／大面積底色 —— 否則會搶走上面三個語意色
     （番茄紅／奶油黃／資訊藍＝「動作與狀態」）的角色。理由見 docs/multi-calendar-design.md §4。 */
  --cal-1: #FF6B4A;         /* 品牌番茄紅（主寵物那一本的預設色） */
  --cal-2: #3F9D77;         /* 鼠尾草綠 */
  --cal-3: #4F86C6;         /* 鋼藍 */
  --cal-4: #C98A3E;         /* 琥珀 */
  --cal-5: #9B6BA8;         /* 灰紫 */
  --cal-6: #C4657A;         /* 藕粉 */
  --danger: #C0392B;
  --nope-bg: #DCE3EA;       /* 左滑「下次再聊」徽章底 */
  --switch-off: #E5DCC9;
  --knob-shadow: rgba(34, 28, 21, 0.28);
  --scrim: rgba(34, 28, 21, 0.5);
  --overlay-scrim: rgba(0, 0, 0, 0.62);
  --shadow-color: #221C15;
  --ph-a: #FFF3D4;          /* 沒有照片時的佔位漸層 */
  --ph-b: #FFE0AE;
  --toast-bg: #221C15;
  --toast-text: #FFFCF3;
  --toast-shadow: rgba(255, 107, 74, 0.95);
  --border: 2px solid var(--frame);
  /* 舊的 --radius-sm/md/lg（12／18／24）已移除：
     值與 tokens.json（8／16／22）及核准稿（--r-sm:8/--r-md:16）都不一致，
     屬半遷移遺留 → 一律改用 tokens.generated.css 的 --r-sm／--r-md／--r-plush。 */
  --shadow: 4px 4px 0 var(--shadow-color);
  --shadow-sm: 3px 3px 0 var(--shadow-color);
  /* 聊天氣泡用的柔陰影（改構 A · 無框極簡）：不用實心偏移，避免一串訊息變成視覺噪音 */
  --bubble-shadow: 0 1px 2px rgba(34, 28, 21, 0.10);
  /* 日曆（2026-09-19 改版）：面板／卡片的柔陰影、日格縮圖遮罩、sheet 陰影。
     日曆是「格子與照片」的密集版面，貼紙風的實心偏移在七欄格子上會變成 49 條黑線，
     所以這一區改用柔陰影 + 圓角方塊（詳見 sketches/README.md 的日曆改版草案 A）。 */
  --panel-shadow: 0 2px 10px rgba(34, 28, 21, 0.07);
  --thumb-scrim: rgba(20, 14, 9, 0.34);
  --sheet-shadow: 0 -8px 30px rgba(0, 0, 0, 0.22);
}

/* ===== 深色模式：方案 B · 深可可 Cocoa（2026-09-16 選定）=====
   只覆寫顏色，不動任何規則。切換靠 <html data-theme="dark">，
   由 index.html 的 pre-paint script 在首次繪製前套用（避免白閃）。 */
[data-theme="dark"] {
  color-scheme: dark;
  --page: #12100E;
  --bg: #1F1A16;
  --surface: #2C251F;
  --surface-alt: #3A322A;
  --soft-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
  --text: #F0E7DA;
  --frame: #100D0A;
  --muted: #9C8F7E;
  --muted-weak: #6B6154;
  --text-soft: #DCD2C2;
  --line: #423830;
  --primary: #E8664A;
  --primary-hover: #F07A5F;
  --primary-soft: rgba(232, 102, 74, 0.18);
  --on-primary: #ffffff;
  --mint: #E8BE5F;
  --mint-soft: rgba(232, 190, 95, 0.18);
  --pink: #E8BE5F;
  --pink-soft: rgba(232, 190, 95, 0.18);
  --accent: #E8BE5F;
  --accent-soft: rgba(232, 190, 95, 0.18);
  --on-accent: #221C15;
  --info: #5E9BD1;
  --info-soft: rgba(94, 155, 209, 0.18);
  --info-text: #8FC0E6;
  /* 日曆識別色：深色模式各一組（低飽和、亮一階，才在深可可底上讀得出來）。 */
  --cal-1: #E8664A;
  --cal-2: #5FB894;
  --cal-3: #7FA8DC;
  --cal-4: #DBA463;
  --cal-5: #B98BC4;
  --cal-6: #DE85A0;
  --danger: #D9564A;
  --nope-bg: #3A342D;
  --switch-off: #423830;
  --knob-shadow: rgba(0, 0, 0, 0.55);
  --scrim: rgba(0, 0, 0, 0.62);
  --overlay-scrim: rgba(0, 0, 0, 0.9);
  --shadow-color: #000000;
  --ph-a: #2A241E;
  --ph-b: #362D24;
  --toast-bg: #F0E7DA;
  --toast-text: #1F1A16;
  --toast-shadow: #E8664A;
  /* 聊天氣泡柔陰影：深色底要更重一點才看得出來（但仍然是柔的） */
  --bubble-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  --panel-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  --thumb-scrim: rgba(0, 0, 0, 0.42);
  --sheet-shadow: 0 -8px 30px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", "PingFang TC", "Microsoft JhengHei", "Helvetica Neue", sans-serif;
  background: var(--page);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ---------- 手機外框 ---------- */
.phone {
  position: relative;
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  border: 2.5px solid var(--frame);
  border-radius: var(--r-plush);
  box-shadow: var(--sticker-shadow);
}

.screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* =====================================================
   登入 / 註冊
===================================================== */
.screen--auth {
  justify-content: center;
  padding: 32px 28px 40px;
  background: var(--bg);
  border-radius: var(--r-plush);
}

.auth-brand { text-align: center; margin-bottom: 30px; }
/* 吉祥物：品牌圖由 SDXL 生成後合成盤面（scripts/make_mascot_plate.py），
   原始出圖保留在 img/brand-mascot-source.png；網頁與 App 共用同一組 PNG。
   圖檔本身已含墨黑外框，所以這裡不再加 CSS border，否則會變雙框。 */
.brand-avatar {
  width: 108px;
  height: 108px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background-image: url('/img/mascot.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: var(--shadow);
}
[data-theme='dark'] .brand-avatar { background-image: url('/img/mascot-dark.png'); }
.brand-name {
  margin: 0;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text);
  text-shadow: 2px 2px 0 var(--mint);
}
.brand-tag { margin: 8px 0 0; color: var(--muted); font-size: 14px; font-weight: 600; }

.auth-tabs {
  display: flex;
  background: var(--surface-alt);
  border: none;
  border-radius: var(--r-md);
  padding: 4px;
  margin-bottom: 24px;
}
.tab {
  flex: 1;
  padding: 10px;
  border: 2px solid transparent;
  background: transparent;
  border-radius: var(--r-md);
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  color: var(--muted);
  transition: 0.12s;
}
.tab.active {
  background: var(--accent-soft);
  color: var(--text);
  border-color: transparent;
}

.auth-form { display: flex; flex-direction: column; gap: 8px; }
.field-label { font-size: 13px; font-weight: 700; color: var(--text); margin-top: 10px; }
.field {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 2px solid var(--frame);
  border-radius: var(--r-md);
  padding: 0 16px;
  height: 52px;
  transition: border-color 0.15s;
}
.field:focus-within { border-color: var(--primary); }
.field-icon { display: inline-flex; }
.field-icon .pp-icon { width: 18px; height: 18px; }   /* 原本靠 font-size:18px 撐 emoji 字型 */
.field input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  outline: none;
  height: 100%;
}
.field input::placeholder { color: var(--muted); font-weight: 500; }

.forgot {
  align-self: flex-end;
  margin: 6px 4px 14px;
  color: var(--primary);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.auth-switch { text-align: center; color: var(--muted); font-size: 14px; margin-top: 18px; font-weight: 600; }
.auth-switch a { color: var(--primary); font-weight: 800; cursor: pointer; text-decoration: none; }
.terms-row { display: flex; align-items: center; gap: 8px; margin-top: 14px; color: var(--muted); font-size: 13px; font-weight: 600; }
.terms-row input { width: 18px; height: 18px; accent-color: var(--primary); flex: 0 0 auto; }
.terms-row a { color: var(--primary); font-weight: 800; cursor: pointer; text-decoration: none; }

/* ---------- 驗證碼 / 忘記密碼 / 重設密碼（auth 子畫面） ---------- */
.auth-pane-title { margin: 0 0 6px; font-size: 22px; font-weight: 800; letter-spacing: -0.3px; }
.auth-pane-note { margin: 0 0 12px; color: var(--muted); font-size: 13px; line-height: 1.6; font-weight: 600; }
.auth-pane-note b { color: var(--text); word-break: break-all; }
#verify-form .btn, #forgot-form .btn, #reset-form .btn { margin-top: 12px; }

/* 開發模式驗證碼提示（dev_code 為 null 時整個區塊隱藏） */
.dev-code {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  background: var(--info-soft);
  border: 2px dashed var(--info);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  margin: 4px 0 6px;
  font-size: 13px; font-weight: 600; color: var(--info-text);
}
.dev-code strong { font-size: 19px; font-weight: 800; letter-spacing: 3px; color: var(--text); }

/* =====================================================
   按鈕
===================================================== */
/* 2026-09-25 視覺收斂：按鈕不再帶 2px 墨框＋實心偏移陰影（框線只留名片卡與主要 CTA）。
   primary／mint ＝ 實心色塊 ＋ 柔陰影；ghost ＝ 1px 髮絲線外框。 */
.btn {
  border: none;
  border-radius: var(--r-md);
  padding: 12px 22px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.1s, background 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: var(--soft-shadow);
}
.btn:active { transform: translate(1px, 1px); }
.btn--primary { background: var(--primary); color: var(--on-primary); }
.btn--primary:hover { background: var(--primary-hover); }
.btn--full { width: 100%; }
.btn--ghost { background: var(--surface); color: var(--text); border: 1px solid var(--line); box-shadow: none; }
.btn--ghost:hover { background: var(--mint-soft); }
.btn--mint { background: var(--mint); color: var(--on-accent); }
/* 破壞性動作（封鎖／永久刪除）。白字在淺色 #C0392B 與深色 #D9564A 上都讀得出來。 */
.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover { background: var(--danger); filter: brightness(0.94); }
.btn--sm { padding: 7px 14px; font-size: 13px; border-radius: var(--r-md); box-shadow: var(--soft-shadow); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }

/* =====================================================
   主應用版面
===================================================== */
.screen--app { position: relative; }

.pane {
  flex: 1;
  overflow-y: auto;
  padding: 20px 20px 100px;
  animation: fade 0.22s;
}

/* 聊天大廳：森林背景（插畫在 img/forest-day.svg / forest-night.svg）
   背景貼在捲動容器上且不隨內容捲動，卡片本身有墨框與實心陰影，對比不受影響。 */
#screen-chats {
  background-image: url('/img/forest-day.svg');
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
}
[data-theme='dark'] #screen-chats { background-image: url('/img/forest-night.svg'); }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; } }

/* ---------- 頁面標題 ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 16px; }
.page-title { margin: 0; font-size: 25px; font-weight: 800; letter-spacing: -0.3px; }
.page-sub { margin: 4px 0 0; color: var(--muted); font-size: 13px; font-weight: 600; line-height: 1.5; }
.icon-btn {
  width: 38px; height: 38px;
  border-radius: var(--r-md);
  border: none;
  background: var(--surface-alt);
  box-shadow: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}
.icon-btn:active { transform: translate(2px, 2px); box-shadow: none; }
.icon-btn.back { background: transparent; border-color: transparent; box-shadow: none; }

/* ---------- 鈴鐺（通知中心入口，四個主分頁右上角） ---------- */
.bell-btn { position: relative; }
.bell-btn.has-unread { background: var(--primary-soft); color: var(--primary); }
.bell-badge {
  position: absolute; top: -7px; right: -7px;
  min-width: 21px; height: 21px; padding: 0 5px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-pill);
  background: var(--primary); color: var(--on-primary);
  font-size: 11px; font-weight: 800; line-height: 1;
}

/* ---------- 探索（Swipe 卡片堆疊） ---------- */
.discover-stack {
  /* 卡片尺寸＝核准稿 discover-k3.html 的 .deck／.card：330×410（390 寬手機、左右邊距 16）。
     ⚠️ 不要改回「滿寬 ＋ aspect-ratio 4/5」：.pane 的 padding 是 20，滿寬會變成 350×438
     （比核准稿大整整一圈，2026-09-30 對照截圖抓到）。尺寸只認這兩個變數。 */
  --card-w: 330px;
  --card-h: 410px;
  position: relative;
  height: 430px;              /* 核准稿 .deck 高度＝卡片 410 ＋ 堆疊露邊 20 */
  display: flex;
  justify-content: center;
  align-items: flex-start;
}
.pet-card {
  position: absolute;
  top: 0;
  width: var(--card-w);
  height: var(--card-h);
  max-width: 100%;            /* 比核准稿更窄的視窗才不會溢出 */
  border-radius: var(--r-plush);
  overflow: hidden;
  background: var(--surface);
  border: 2.5px solid var(--frame);
  box-shadow: 5px 6px 0 var(--shadow-color);
  transition: transform 0.22s ease-out, opacity 0.22s ease-out;
  will-change: transform;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.pet-card img.card-photo {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.pet-card .placeholder-photo {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 96px;
  background: linear-gradient(160deg, var(--ph-a) 0%, var(--ph-b) 100%);
}
.pet-card .card-overlay {
  position: absolute; inset: auto 0 0 0;
  padding: 60px 20px 20px;
  background: linear-gradient(transparent, var(--overlay-scrim));
  color: #fff;
}
.card-overlay .pet-name { margin: 0; font-size: 28px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.card-overlay .age-pill {
  background: var(--mint); color: var(--on-accent);
  border: 1.5px solid var(--frame);
  font-size: 12px; font-weight: 800;
  padding: 2px 10px; border-radius: var(--r-pill);
}
.card-overlay .pet-meta { margin: 4px 0 8px; font-size: 14px; font-weight: 700; opacity: 0.95; }
.card-overlay .pet-bio { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.5; opacity: 0.92; }
.card-overlay .pet-owner { margin-top: 8px; font-size: 12px; font-weight: 600; opacity: 0.8; }
.card-overlay .pet-distance {
  margin-top: 8px;
  display: inline-block;
  background: var(--mint); color: var(--on-accent);
  border: 1.5px solid var(--frame);
  font-size: 12px; font-weight: 800;
  padding: 2px 10px; border-radius: var(--r-pill);
}
.nearby-hint {
  margin: -4px 0 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--info-text);
}
.radius-control {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  padding: 8px 12px;
  background: var(--surface);
  border: 2px solid var(--frame);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
}
.radius-control[hidden] { display: none; }
.radius-label { font-size: 12px; font-weight: 800; color: var(--text); white-space: nowrap; }
.radius-control input[type="range"] {
  flex: 1;
  accent-color: var(--primary);
  height: 24px;
  cursor: pointer;
}
.radius-value { font-size: 12px; font-weight: 800; color: var(--info-text); white-space: nowrap; min-width: 76px; text-align: right; }
.radius-unlimited {
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
  background: var(--surface);
  border: 2px solid var(--frame);
  border-radius: var(--r-pill);
  padding: 4px 10px;
  cursor: pointer;
  white-space: nowrap;
}
.radius-unlimited.active { background: var(--mint); color: var(--on-accent); }
.radius-control input[type="range"].dim { opacity: 0.4; }
/* ---------- 探索篩選收合（2026-10-08）：一行＝定位提示＋篩選鈕 ---------- */
.discover-filterbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 12px;
}
.discover-filterbar .nearby-hint { margin: 0; flex: 1; min-width: 0; }
.discover-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--surface);
  border: 2px solid var(--frame);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
}
.discover-filter-count {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-pill);
  background: var(--primary);
  color: var(--on-primary);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}
.discover-filter-count[hidden] { display: none; }
.filter-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.card-badge {
  position: absolute;
  top: 22px;
  z-index: 2;
  padding: 6px 14px;
  border-radius: var(--r-md);
  border: 2.5px solid var(--frame);
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.3px;
  opacity: 0;
  pointer-events: none;
}
.card-badge.like { right: 18px; background: var(--mint); color: var(--on-accent); transform: rotate(8deg); }
.card-badge.nope { left: 18px; background: var(--nope-bg); transform: rotate(-8deg); }

.swipe-actions {
  display: flex;
  justify-content: center;
  gap: 22px;
  margin-top: 6px;
}
.swipe-btn {
  width: 60px; height: 60px;
  border-radius: 50%;
  border: 2.5px solid var(--frame);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  transition: transform 0.1s, box-shadow 0.1s;
}
.swipe-btn:active { transform: translate(3px, 3px); box-shadow: none; }
/* 核准稿（discover-k3.html）：✕（次要）＝1px 髮絲框、**無陰影**（.act.no）；
   ❤（主要）＝2.5px 墨框 ＋ 實心偏移 3px 3px（.act.yes 的 --sticker）。
   只有主要動作保留「貼紙」，卡片才是這一頁唯一的貼紙主角。 */
.swipe-btn.nope { background: var(--surface); color: var(--text); border: 1px solid var(--line); box-shadow: none; }
.swipe-btn.like { background: var(--primary); color: var(--on-primary); border: 2.5px solid var(--frame); box-shadow: var(--shadow-sm); }
.swipe-btn.like svg, .swipe-btn.nope svg { width: 28px; height: 28px; }

/* ---------- 通知中心（鈴鐺）----------
   邀請列沿用 .invite-* 那組樣式（同一個視覺元素），官方訊息用 .notif-row。 */
.notif-list { display: flex; flex-direction: column; gap: var(--sp-s3); }
.invite-row {
  display: flex; align-items: center; gap: var(--sp-s3);
  background: var(--surface);
  border: 2px solid var(--frame);
  border-radius: var(--r-md); padding: var(--sp-s3);
  box-shadow: var(--shadow-sm);
}
.invite-ava { width: 52px; height: 52px; border-radius: var(--r-sm); object-fit: cover; border: 2px solid var(--frame); }
.invite-ava.placeholder {
  display: flex; align-items: center; justify-content: center;
  background: var(--mint-soft); color: var(--text);
}
.invite-ava.placeholder .pp-icon { width: 26px; height: 26px; }
.invite-info { flex: 1; min-width: 0; }
.invite-name { font-weight: var(--fw-semibold); font-size: var(--fs-body); }
.invite-meta { color: var(--muted); font-size: var(--fs-meta); margin-top: 2px; font-weight: var(--fw-regular); }
/* 未回應的邀請：紅框，讓它在列表裡一眼看得出來「還需要我動作」 */
.notif-invite.unread { border-color: var(--primary); }
/* 按鈕不可被壓縮：.btn 預設 flex-shrink:1，會被 flex:1 的資訊欄擠扁 → 「婉拒／接受」文字被切掉 */
.notif-invite .btn { flex-shrink: 0; white-space: nowrap; }
/* 邀請狀態（已接受／已婉拒）：文字是資訊（保留），圖示自繪 —— 不再帶 emoji。 */
.notif-status {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 6px; padding: 2px 9px;
  border-radius: var(--r-pill); border: 2px solid var(--frame);
  font-size: var(--fs-micro); font-weight: var(--fw-semibold);
}
.notif-status .pp-icon { width: 13px; height: 13px; flex: 0 0 auto; }
.notif-status.accepted { background: var(--mint-soft); color: var(--text); }
.notif-status.rejected { background: var(--surface); color: var(--muted); }
.notif-row {
  display: flex; align-items: flex-start; gap: var(--sp-s3);
  background: var(--surface);
  border: 2px solid var(--frame);
  border-radius: var(--r-md); padding: var(--sp-s3);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}
.notif-ico {
  width: 40px; height: 40px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm); border: 2px solid var(--frame);
  background: var(--accent-soft); color: var(--text);
}
.notif-ico .pp-icon { width: var(--icon-row); height: var(--icon-row); }
.notif-body { flex: 1; min-width: 0; }
.notif-title { font-weight: var(--fw-semibold); font-size: var(--fs-body); }
.notif-row.unread .notif-title { color: var(--primary); }
.notif-text { color: var(--text-soft); font-size: var(--fs-label); font-weight: var(--fw-regular); margin-top: 4px; line-height: 1.5; }
.notif-meta { color: var(--muted); font-size: var(--fs-micro); font-weight: var(--fw-regular); margin-top: 6px; }
.notif-dot {
  width: 11px; height: 11px; flex-shrink: 0; margin-top: 5px;
  border-radius: 50%; background: var(--primary); border: 2px solid var(--frame);
}
/* 空狀態：自繪 bellOff ＋ 一行說明（K3：不用 emoji 當佔位圖示）。 */
.empty--notif { display: flex; flex-direction: column; align-items: center; gap: var(--sp-s2); }
.empty--notif .pp-icon { width: 32px; height: 32px; color: var(--muted-weak); }
/* 聊天列表／聊天室的空狀態：自繪心／對話圖示 ＋ 一行說明（K3：不用 emoji 當佔位圖示）。 */
.empty--chat { display: flex; flex-direction: column; align-items: center; gap: var(--sp-s2); }
.empty--chat .pp-icon { width: 30px; height: 30px; color: var(--muted-weak); }

/* ---------- 配對成功 ---------- */
.match-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 28px;
  min-height: 100vh;
}
.match-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--mint); color: var(--on-accent);
  border: 2px solid var(--frame);
  box-shadow: var(--sticker-shadow);
  font-size: var(--fs-label); font-weight: var(--fw-semibold); letter-spacing: 1px;
  padding: 7px 18px; border-radius: var(--r-pill);
  margin-bottom: 18px;
}
.match-badge .pp-icon { width: 15px; height: 15px; }
.match-headline { margin: 0; font-size: var(--fs-display); font-weight: var(--fw-semibold); }
.match-sub { color: var(--muted); font-size: var(--fs-body); font-weight: var(--fw-semibold); line-height: 1.6; margin: 12px 0 28px; }
.match-avatars { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 34px; }
.match-ava {
  width: 96px; height: 96px; border-radius: 50%;
  object-fit: cover; background: var(--bg);
  border: 3px solid var(--frame);
  box-shadow: var(--shadow-sm);
}
.match-ava.right { border-color: var(--primary); }
.match-ava.placeholder {
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft); border: 3px solid var(--frame);
}
.match-ava.placeholder .pp-icon { width: 44px; height: 44px; color: var(--primary); }
.match-heart {
  width: 52px; height: 52px; border-radius: var(--r-md);
  background: var(--primary-soft);
  border: 2px solid var(--frame);
  display: flex; align-items: center; justify-content: center;
}
.match-heart .pp-icon { width: 26px; height: 26px; color: var(--primary); }
.match-screen .btn { width: 100%; margin-bottom: 12px; }

/* ---------- 聊天 ---------- */
/* ---------- 聊天（改構 A · 無框極簡，2026-09-18）----------
   泡泡沒有任何框線與實心偏移陰影 —— 卡片語言用在「一串 20 則訊息」上會變成視覺噪音。
   時間與已讀搬到泡泡外的 .meta（每組最後一則下面出現一次），由 js/app.js 的 appendMessage 維護。 */
.chat-head {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.chat-ava {
  width: 40px; height: 40px; border-radius: 50%;
  object-fit: cover; background: var(--cal, var(--mint));
  box-shadow: inset 0 0 0 2px var(--frame);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.chat-ava .pp-icon { width: 22px; height: 22px; color: var(--on-primary); }
.chat-who { flex: 1; min-width: 0; }
.chat-who .name { font-weight: var(--fw-semibold); font-size: var(--fs-body); }
.chat-who .uname { color: var(--muted); font-weight: var(--fw-regular); font-size: var(--fs-label); }
/* 在線狀態：圓點用 CSS 畫（與列表的 .presence-dot 同一種語意），不再用 ●／○ 字型符號。 */
.chat-who .status { display: flex; align-items: center; gap: 5px;
  font-size: var(--fs-meta); color: var(--info); font-weight: var(--fw-semibold); }
.chat-who .status .status-dot { width: 8px; height: 8px; border-radius: 50%;
  background: var(--info); flex-shrink: 0; }
.chat-who .status.offline { color: var(--muted); }
.chat-who .status.offline .status-dot { background: var(--muted-weak); }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px 8px;
  display: flex;
  flex-direction: column;
  /* A 稿：線條背景＝紙底點格（本產品自己的紙）。點格用 --dot token，不是寫死的色碼。 */
  background-image: radial-gradient(var(--dot) 1px, transparent 1px);
  background-size: 16px 16px;
}

/* 日期分隔（小紙膠帶）：奶油黃底＋髮絲框＋微轉 -1.5°，不再是一條線夾字 */
.day-sep { display: flex; justify-content: center; margin: 4px 0 16px; }
.day-sep span {
  display: inline-block;
  background: var(--tape); color: var(--text);
  border: 1px solid var(--line);
  font-size: var(--fs-micro); font-weight: var(--fw-semibold);
  padding: 2px 10px; border-radius: var(--r-pill);
  transform: rotate(-1.5deg);
}

/* 訊息分組：同一個人 60 秒內的連續訊息放同一組，組內只留 4px、組與組之間 16px */
.msg-group { display: flex; flex-direction: column; gap: 4px; margin-bottom: 16px; align-items: flex-start; }
.msg-group.mine { align-items: flex-end; }

.msg {
  position: relative;   /* 尾巴（::after）的定位基準 */
  max-width: 74%; padding: 10px 16px; border-radius: var(--r-plush);
  border: 1px solid var(--line);                  /* ← 對方＝奶油紙＋1px 髮絲框（貼紙泡泡 v2） */
  background: var(--surface); color: var(--text);
  font-size: 15px; font-weight: 600; line-height: 1.45; word-wrap: break-word;
}
.msg.mine {
  /* 深字：白字壓主色只有 3.27（深）／2.82（淺），--on-sel（#221C15）是 5.99／5.17 → 過 4.5:1。
     --on-sel 就是「有色底上的字」那個 token（App 的 colors.onAccent 同值）。 */
  background: var(--primary); color: var(--on-sel);
  border: 1px solid var(--frame);                 /* 自己＝1px 墨框 */
  box-shadow: var(--sticker-shadow);      /* ＋2px 實心偏移（貼紙泡泡） */
}
/* 靠近「自己那一側」的角落收小當作方向暗示
   ⚠️ 用 .first／.last 這兩個 class，不要用 :first-child／:last-child ——
   每組尾端會插入 .meta 元素，`:last-child` 就不再是最後一則泡泡了。 */
.msg-group .msg.first { border-top-left-radius: 7px; }
.msg-group.mine .msg.first { border-top-right-radius: 7px; }
.msg-group .msg.last { border-bottom-left-radius: 7px; }
.msg-group.mine .msg.last { border-bottom-right-radius: 7px; }
/* 尾巴（A 稿）：群組第一顆泡泡的上方外角伸出一個 12×12 旋轉 45° 的小尖角，
   自己的在右上、對方的在左上（指向說話的人／頭像）。
   ⚠️ 只有群組第一顆有尾巴、圖片訊息不給（媒體泡泡的方形邊緣接尾巴會像破圖）。 */
.msg-group .msg.first::after,
.msg-group.mine .msg.first::after {
  content: ""; position: absolute; top: 0; width: 12px; height: 12px;
  background: inherit; border-radius: 2px; transform: rotate(45deg);
  pointer-events: none;
}
.msg-group .msg.first::after { left: -5px; }
.msg-group.mine .msg.first::after { left: auto; right: -5px; }
.msg-group .msg.first.media::after, .msg-group.mine .msg.first.media::after { content: none; }

/* 新訊息的抵達動畫（＝A 稿唯一的刻意時刻；只套即時收到的訊息，見 appendMessage 的 opts.fresh）
   320ms：scale .4 → 1.05（頂點）→ 1、translateY +30 → 0、opacity 0 → 1。
   減少動態時退化成純透明度（animations 的守門員會檢查這條）。 */
@keyframes pp-msg-pop {
  0%   { opacity: 0; transform: scale(0.4) translateY(30px); }
  55%  { opacity: 1; transform: scale(1.05) translateY(0); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes pp-msg-fade { from { opacity: 0; } to { opacity: 1; } }
.msg-fresh { animation: pp-msg-pop 320ms cubic-bezier(0.175, 0.885, 0.32, 1.275) both; }
@media (prefers-reduced-motion: reduce) {
  .msg-fresh { animation: pp-msg-fade 180ms linear both; }
}

/* 圖片訊息：只有一層圓角，不再被「泡泡框 + 圖片框」雙層包住 */
.msg.media { padding: 4px; }
.msg .msg-img { max-width: 100%; border-radius: var(--r-md); border: none; display: block; }
.msg .msg-text { display: block; }

/* 時間與已讀：在泡泡外面，每組最後一則下方出現一次 */
.meta { display: flex; align-items: center; gap: 6px; padding: 2px 4px 0;
  font-size: 10.5px; font-weight: 600; color: var(--muted); }
.meta .tick { color: var(--info); font-weight: 800; }
.meta .tick.pending { color: var(--muted); }

/* 輸入列（A 稿）：左＝44pt 圓形相機、中＝獨立膠囊輸入框、右＝完全獨立的 44pt 圓形送出鈕。
   三者垂直置中；整列**不再有上緣髮絲線**（點格紙只填到訊息區，輸入列本身就是分界）。 */
.chat-input {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px 14px;
  background: var(--bg);
}
.chat-input .cam {
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  cursor: pointer; font-size: 17px;
  display: flex; align-items: center; justify-content: center;
}
.chat-input .cam .pp-icon { width: 22px; height: 22px; }
.chat-input input {
  flex: 1; height: 44px;
  border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--surface); color: var(--text);
  padding: 0 16px; font-size: var(--fs-label); font-family: inherit; font-weight: var(--fw-semibold); outline: none;
}
.chat-input input:focus { border-color: var(--primary); }
.send-btn {
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--frame);                 /* 送出鈕＝貼紙圓（1px 墨框） */
  background: var(--primary); color: var(--on-primary);
  box-shadow: var(--sticker-shadow);      /* ＋2px 實心偏移 */
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 17px; transition: transform 0.12s;
}
.send-btn:hover { transform: scale(1.06); }
.send-btn:active { transform: scale(0.94); }

/* ---------- 指定回覆（quote reply）+ 回覆列 + 表情回應（2026-09-19 改版）----------
   色碼語意：引用塊／回覆列的左色條與名字都用 --qc（自己＝番茄紅、對方＝資訊藍），
   在「自己的泡泡內」另外用 --on-primary 覆寫（紅底上的紅字看不見）。 */
.reply-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; background: var(--surface);
  border-top: 1px solid var(--line);
}
.reply-bar.hidden { display: none; }
.reply-bar-body {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px;
  border-left: 3px solid var(--qc, var(--info)); padding-left: 9px;
}
.reply-bar-body .rb-name { font-size: 12px; font-weight: 800; color: var(--qc, var(--info)); flex-shrink: 0; }
.reply-bar-body .rb-text { font-size: 13px; color: var(--muted); font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.reply-bar-body .rb-thumb { width: 30px; height: 30px; border-radius: var(--r-sm); object-fit: cover; flex-shrink: 0; }
.reply-bar-x { border: none; background: none; color: var(--muted); cursor: pointer; padding: 4px;
  display: flex; align-items: center; }
.reply-bar-x .pp-icon { width: 16px; height: 16px; }

/* 引用塊（泡泡內）：左色條 + 同色名字 + 最多 2 行內容 + 可選縮圖 */
.msg .quote {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 6px; padding: 6px 9px;
  border-left: 3px solid var(--qc, var(--info));
  background: rgba(0, 0, 0, 0.10);
  border-radius: var(--r-sm); cursor: pointer; max-width: 250px;
}
.msg .quote:hover { background: rgba(0, 0, 0, 0.16); }
.msg.mine .quote { background: rgba(255, 255, 255, 0.16); border-left-color: var(--on-sel); }
.msg.mine .quote:hover { background: rgba(255, 255, 255, 0.24); }
.quote-body { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.quote-who { font-size: 11.5px; font-weight: 800; color: var(--qc, var(--info)); }
.msg.mine .quote .quote-who { color: var(--on-sel); }
.quote-text {
  font-size: 12.5px; opacity: 0.9;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.quote-thumb { width: 34px; height: 34px; border-radius: var(--r-sm); object-fit: cover; flex-shrink: 0; }

/* ---------- 跨頁視差（計畫 §3，2026-10-17）：只套子畫面推入，分頁切換維持即時 ----------
   380ms、A/B 並存重疊：A scale 1→0.94／opacity 1→0.3；B translateX 100%→0／opacity .8→1。
   只動 transform 與 opacity（合成層），不動 layout。 */
@keyframes pp-push-a { from { transform: scale(1); opacity: 1; } to { transform: scale(0.94); opacity: 0.3; } }
@keyframes pp-push-b { from { transform: translateX(100%); opacity: 0.8; } to { transform: translateX(0); opacity: 1; } }
@keyframes pp-push-fade-out { from { opacity: 1; } to { opacity: 0.3; } }
@keyframes pp-push-fade-in { from { opacity: 0.8; } to { opacity: 1; } }
.pp-leave-a { animation: pp-push-a 380ms cubic-bezier(0.25, 1, 0.5, 1) both; }
.pp-enter-b { position: relative; z-index: 60; animation: pp-push-b 380ms cubic-bezier(0.25, 1, 0.5, 1) both; }
.pp-leave-a-reduced { animation: pp-push-fade-out 180ms linear both; }
.pp-enter-b-reduced { position: relative; z-index: 60; animation: pp-push-fade-in 180ms linear both; }
@media (prefers-reduced-motion: reduce) {
  .pp-leave-a { animation: pp-push-fade-out 180ms linear both; }
  .pp-enter-b { animation: pp-push-fade-in 180ms linear both; }
}

/* 聊天室上排的卡片 chip（A 稿 2026-10-17）：壓在標頭下緣、齊左、22px。
   ⚠️ 只有真的帶資訊時才畫；`.chat-head` 本身是 position: sticky（已是定位元素），所以 chip 直接定位在它身上。 */
.card-chip {
  position: absolute; left: 16px; bottom: -11px; height: 22px; max-width: 82%;
  display: inline-flex; align-items: center; padding: 0 9px; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--line);
  font-size: 11px; font-weight: 800; color: var(--muted); z-index: 6;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* chip 凸出標頭下緣 11px → 訊息區多讓開 8px，第一則訊息不會被壓到 */
.chat-head:has(.card-chip) + .chat-messages { padding-top: 24px; }

/* 表情回應徽章（A 稿 2026-10-17）：躺在泡泡下緣上、齊外側。
   ⚠️ 絕對定位的基準是 .msg（泡泡盒子）—— 不要讓 .msg-group 變成定位基準：群組寬度是全寬，
   徽章會跑到螢幕邊或掉到時間列下面（本稿第一版就是掛在群組上，量測才抓到重疊 0、間隙 −40px）。 */
.rx-badges { position: absolute; bottom: -11px; display: flex; gap: 4px; z-index: 2; }
.msg-group .rx-badges { left: -6px; }
.msg-group.mine .rx-badges { left: auto; right: -6px; }
.rx-badge {
  position: relative; display: inline-flex; align-items: center; gap: 3px;
  height: 23px; padding: 0 8px; border-radius: var(--r-pill);
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
/* 觸控區補到 44pt（徽章只有 23px 高，但視覺不變大；stopPropagation 在 bindReactionBadges 裡） */
.rx-badge::before { content: ""; position: absolute; inset: -11px -5px; }
.rx-badge.mine { border-color: var(--primary); border-width: 1.5px; }
.rx-badge.more { padding: 0 7px; cursor: default; }
.rx-badge .rx-emoji { font-size: 12.5px; }
.rx-badge .rx-count { font-size: 11px; font-weight: 800; color: var(--muted); }
/* 徽章往下凸 10px → 群組尾的「時間／已讀」讓開 19px（實測淨空 9px） */
.msg:has(.rx-badges) + .meta { margin-top: 19px; }

/* 長按／右鍵的動作選單（emoji 列 + 動作，由註冊表產生） */
.msg-menu {
  position: fixed; z-index: 300;
  background: var(--surface); border: 2px solid var(--frame);
  border-radius: var(--r-md); box-shadow: var(--shadow);
  overflow: hidden; min-width: 170px;
}
.msg-menu-emos { display: flex; gap: 2px; padding: 6px 8px; border-bottom: 1.5px solid var(--line); }
.msg-menu-emos .emo {
  border: none; background: none; font-size: 20px; line-height: 1;
  padding: 3px 4px; border-radius: 50%; cursor: pointer;
}
.msg-menu-emos .emo:hover { transform: scale(1.18); }
.msg-menu .act {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: none; border: none; padding: 10px 14px;
  font: inherit; font-size: var(--fs-label); font-weight: var(--fw-semibold); color: var(--text);
  cursor: pointer; text-align: left;
}
.msg-menu .act:hover { background: var(--bg); }
.msg-menu .act + .act { border-top: 1.5px solid var(--line); }
.msg-menu .act .em { display: flex; align-items: center; width: 18px; }
.msg-menu .act .em .pp-icon { width: 18px; height: 18px; }

/* 向右滑＝回覆：拖曳時泡泡跟著位移，左側浮出 ↩ 圓標 */
.msg { position: relative; touch-action: pan-y; }
.msg.swiping { transition: none; }
.msg:not(.swiping) { transition: transform 0.15s ease; }
.msg.swiping::before {
  content: ""; position: absolute; left: -34px; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent);
  /* 回覆箭頭＝自繪 SVG 遮罩（K3：UI chrome 不用字型 emoji／符號）；形狀與 PP_ICONS.reply 一致。 */
  -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22%20viewBox=%220%200%2024%2024%22%20fill=%22none%22%20stroke=%22%23000%22%20stroke-width=%221.9%22%20stroke-linecap=%22round%22%20stroke-linejoin=%22round%22%3E%3Cpath%20d=%22M10%207%205%2012l5%205%22/%3E%3Cpath%20d=%22M5%2012h9a5.5%205.5%200%200%201%205.5%205.5V19%22/%3E%3C/svg%3E") center / 15px 15px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22%20viewBox=%220%200%2024%2024%22%20fill=%22none%22%20stroke=%22%23000%22%20stroke-width=%221.9%22%20stroke-linecap=%22round%22%20stroke-linejoin=%22round%22%3E%3Cpath%20d=%22M10%207%205%2012l5%205%22/%3E%3Cpath%20d%3D%22M5%2012h9a5.5%205.5%200%200%201%205.5%205.5V19%22/%3E%3C/svg%3E") center / 15px 15px no-repeat;
}

/* 點引用卡 → 捲到原訊息時的一圈黃光淡出（用 box-shadow，不動泡泡底色） */
.msg.flash { animation: msgflash 1.4s ease; }
@keyframes msgflash {
  0%, 45% { box-shadow: 0 0 0 3px var(--accent); }
  100% { box-shadow: 0 0 0 3px transparent; }
}

/* 圖片發送前預覽（bottom sheet 內） */
.chat-img-preview {
  width: 100%; max-height: 320px; object-fit: contain;
  border-radius: var(--r-md); margin-bottom: 14px; background: var(--bg); display: block;
}

/* ---------- 日曆（K3 · 貼紙手帳，2026-09-29）----------
   這一頁的規則（來自核准稿 sketches/ui-cute-2026-09-29/calendar-k3.html）：
     ① 抬頭左對齊、大數字用粉圓體（單一字重 → 層級只用字級與顏色）
     ② 當日第一張照片＝拍立得（紙膠帶），是這一頁的主角
     ③ 月格＝白紙面板＋格線；顏色只標記「今天／選中／有紀錄」
     ④ 當日清單＝髮絲線分隔的列（不再是每列一張卡）
     ⑤ 貼紙（2px 墨框＋實心偏移）只給底部 CTA 一個主角；FAB 退役
     ⑥ UI 內零 emoji；圖示一律 ppIcon() 的自繪線性 SVG */
.page-head--hero { position: relative; display: block; text-align: left; padding: 4px 0 2px; }
.page-head--hero .page-title {
  font-family: var(--font-display);
  font-size: var(--fs-display); line-height: 1.05; letter-spacing: 0.02em;
  color: var(--text); font-weight: var(--fw-regular);
}
.page-head--hero .page-sub { margin-top: 2px; font-size: var(--fs-meta); color: var(--muted); }
.page-head--hero .bell-btn { position: absolute; top: 4px; right: 0; }
/* 日曆頁右上角的「日曆分享」鈕：跟鈴鐺同一排（左對齊抬頭之後，inline 會被擠到下一行） */
.page-head--hero #cal-share { position: absolute; top: 4px; right: 48px; }
.page-head--hero .head-jump {
  display: inline-block; margin-top: 8px; border: none; background: transparent;
  color: var(--action); font-family: inherit; font-size: var(--fs-meta); font-weight: var(--fw-semibold);
  cursor: pointer; padding: 2px 4px;
}

/* 換月列（2026-09-30 依核准稿）：面板最上方一列**置中**的「‹ 2026 年 9 月 ›」。
   核准稿 calendar-k3.html 的 **web** 手機就是這一列（App 沒有這一列，用滑動）。
   箭頭保留給滑鼠；刻意不做成貼紙鈕＝不做成「網頁工具列」。 */
.cal-monthnav { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0 0 6px; }
.cal-month { font-size: var(--fs-meta); color: var(--muted); }
.cal-toggle {
  display: block; width: 100%; margin-top: 4px; padding: 4px;
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-family: inherit; font-size: var(--fs-micro); font-weight: var(--fw-medium);
}
/* 箭頭本體＝核准稿裡那兩個純文字「‹」「›」（muted、不帶底），不是圓形鈕；
   :hover 只提亮顏色，畫面靜態時與核准稿一致。 */
.cal-arrow {
  border: none; background: transparent; color: var(--muted); padding: 0 4px;
  font-family: inherit; font-size: var(--fs-body); font-weight: var(--fw-regular); line-height: 1;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: color 0.12s;
}
.cal-arrow:hover { color: var(--text); }

/* 紙底點格（核准稿 .phone 的 `radial-gradient(var(--dot) 1px, transparent 1px)`）：
   貼在日曆頁的**捲動容器**上（.phone 之下那一層）。卡片／面板都有自己的底面
   （--surface／--sel-soft…），所以點格只出現在「紙」上，不會蓋過它們。 */
#screen-calendar {
  background-color: var(--canvas);
  background-image: radial-gradient(var(--dot) 1px, transparent 1px);
  background-size: 16px 16px;
}

/* ===== 當日主角：拍立得（紙膠帶）=====
   只在「選取日的第一則有照片」時出現；沒有照片時整塊不出現（不畫空框）。 */
.snap { position: relative; display: flex; justify-content: center; padding: 10px 16px 2px; }
.snap .tape {
  position: absolute; top: 4px; width: 62px; height: 18px; background: var(--tape);
  border-left: 1px dashed rgba(255, 255, 255, 0.7); border-right: 1px dashed rgba(255, 255, 255, 0.7);
}
.snap .tape--l { left: 72px; transform: rotate(-6deg); }
.snap .tape--r { right: 72px; transform: rotate(5deg); }
.snap .polaroid {
  margin: 0; width: 238px; padding: 8px 8px 22px; background: var(--surface);
  border-radius: var(--r-paper); box-shadow: var(--paper-shadow); transform: rotate(-2.2deg);
}
.snap .polaroid-ph { position: relative; height: 150px; border-radius: var(--r-paper); overflow: hidden; background: var(--ph-a); }
.snap .polaroid-ph img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* 拍立得一天多張照片：橫向分頁（scroll-snap）＋右上角「1/3」序號。
   捲軸隱藏 —— 這不是可以自由捲的清單，而是「一張一頁」的翻頁。 */
.snap .polaroid-track {
  display: flex;
  height: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.snap .polaroid-track::-webkit-scrollbar { display: none; }
.snap .polaroid-track img { flex: 0 0 100%; scroll-snap-align: start; }
.snap .polaroid-count {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--thumb-scrim);
  color: var(--on-action);
  font-size: 11px;
  font-weight: 700;
  pointer-events: none;
}
.snap figcaption {
  margin-top: 7px; font-family: var(--font-display); font-size: 13px;
  color: var(--text); text-align: center;
}

/* ===== 日曆篩選列（A 案 · 合併檢視，2026-09-21）=====
   [全部] ＋ 每本日曆一顆 chip（帶該色圓點）。**多選**：點 chip = 顯示／隱藏那一本，
   點「全部」＝全部顯示。與 TimeTree 的多曆模型一致（合併顯示 + 用顏色區分 + 可勾選篩掉），
   取代舊的「單選切換」——單選會消滅「這天有幾隻寵物有紀錄」這個資訊，而那正是多寵物日曆的價值。
   ⚠️ 只有 1 本日曆（免費）時**不出現圓點 chip**，只留一顆低調的「＋ 其他日曆」提示。 */
.cal-filters { display: flex; gap: 6px; overflow-x: auto; padding: 0 14px 10px; scrollbar-width: none; }
.cal-filters::-webkit-scrollbar { display: none; }
.cal-chip {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px;
  font-family: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer;
  padding: 5px 11px 5px 9px; border-radius: var(--r-pill);
  background: var(--surface); color: var(--text); border: 1.5px solid var(--line);
}
.cal-chip .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--cal, var(--muted)); flex: 0 0 auto; }
/* 全部顯示中 → 「全部」看起來是已達成；有隱藏時變回可點。 */
.cal-chip.on { background: var(--accent-soft); border-color: var(--frame); color: var(--text); }
/* 被關掉的那一本：圓點變空心、字變淡（看得出「關掉了」，但不刺眼——不用刪除線）。 */
.cal-chip.off { color: var(--muted); }
.cal-chip.off .dot { background: transparent; box-shadow: inset 0 0 0 2px var(--cal, var(--muted)); }
/* 免費使用者的低調提示：灰字 + 虛線框、**透明底（連白底都不要）**、不閃動
   —— 使用者要求「要，但不要太明顯」。 */
.cal-chip.hint { border-style: dashed; border-color: var(--muted-weak); color: var(--muted); font-weight: 600; padding: 5px 12px; background: transparent; }

/* ===== 月格圓點：那一天有紀錄的日曆（A 案）=====
   只在「≥1 個額外日曆」時才畫（單一日曆＝零改變，不動現有免費使用者的畫面）。
   絕對定位在格子內 —— 不要去動 .cal-cell 的 aspect-ratio（web 端版面靠它）。 */
.cal-dots {
  position: absolute; left: 0; right: 0; bottom: 3px; z-index: 3;
  display: flex; gap: 3px; justify-content: center; pointer-events: none;
}
.cal-dots i {
  width: 6px; height: 6px; border-radius: 50%; display: block;
  background: var(--cal, var(--muted));
  /* 白細框：圓點常常壓在照片上，沒有它會吃掉（瀏覽器驗收對照過）。 */
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.85);
}
/* 選中日是奶油黃實心 → 圓點不需要再白框（反而變髒）。 */
.cal-cell.selected .cal-dots i { box-shadow: none; }

/* ===== 日曆管理（C 案）：我的日曆（提案 C-2 的版面）=====
   副標寫「N / M 本（含主寵物）」；每列＝色塊＋名稱＋（主寵物／物種 · N 則紀錄）＋顯示開關。
   ⚠️ 改名／換色／刪除**收在「點名稱」之後的子面板**，不在列表上常駐 ——
   常駐一顆紅色刪除鈕會讓整個面板看起來像危險操作區（每一列都在喊「刪除」）。 */
.cal-rows { margin-top: 10px; }
/* 每列＝一張小卡（surface 底＋1px 髮絲框＋圓角＋列距；v2 核准稿） */
.cal-row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; margin-bottom: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
}
.cal-row:last-child { margin-bottom: 0; }
.cal-row.off { opacity: 0.45; }   /* 隱藏起來的那一本：整列淡化（提案裡「被關掉」的那一列；開關本身用自繪 eye/eyeOff） */
/* 色票＝爪印圓點：圓形＋2px 墨框（內縮，等同 RN 的 borderWidth） */
.cal-rdot { width: 16px; height: 16px; border-radius: 50%; flex: 0 0 auto; background: var(--cal, var(--muted)); box-shadow: inset 0 0 0 2px var(--frame); }
.cal-rmain { flex: 1; min-width: 0; display: block; text-align: left; background: transparent; border: none; padding: 0; cursor: pointer; font-family: inherit; }
.cal-rname { display: flex; align-items: center; gap: 7px; font-size: var(--fs-label); font-weight: var(--fw-semibold); color: var(--text); }
/* 「主寵物」小標籤（核准稿的 .chip：微字級、柔底、柔字色） */
.cal-chip-tag {
  font-size: var(--fs-micro); font-weight: var(--fw-regular);
  border-radius: var(--r-pill); padding: 1px 7px;
  background: var(--surface-alt); color: var(--text-soft); white-space: nowrap;
}
.cal-rsub { display: block; font-size: var(--fs-micro); font-weight: var(--fw-semibold); color: var(--muted); margin-top: 2px; }
.cal-eye {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--surface-alt); color: var(--muted);
  padding: 5px 10px; cursor: pointer; line-height: 1;
  font-size: var(--fs-micro); font-weight: var(--fw-semibold);
  font-family: inherit; white-space: nowrap; flex-shrink: 0;
}
.cal-eye.on { color: var(--text-soft); }
.cal-eye .pp-icon { width: 14px; height: 14px; }
/* ghost（外框）按鈕＝提案的「＋ 新增日曆（進階會員可到 3 本）」 */
.cal-ghost {
  width: 100%; margin-top: 12px; height: 40px; border-radius: var(--r-md);
  background: var(--surface); color: var(--text); border: 2px solid var(--frame);
  font-family: inherit; font-size: 12.5px; font-weight: 800; cursor: pointer;
}
/* 點名稱後的子面板（改名／換色／刪除） */
.cal-edit { padding: 12px 0; border-bottom: 1px solid var(--line); }
.cal-edit-head { display: flex; align-items: center; gap: 8px; font-size: var(--fs-label); font-weight: var(--fw-semibold); color: var(--text); }
.cal-edit-x { margin-left: auto; border: none; background: transparent; color: var(--muted); cursor: pointer; padding: 2px 6px; }
.cal-edit-x .pp-icon { width: 15px; height: 15px; }
.cal-edit input, .cal-edit select, .cal-edit textarea, .cal-create input {
  width: 100%; margin-top: 6px; padding: 10px 12px; border-radius: var(--r-md);
  border: 1.5px solid var(--line); background: var(--bg); color: var(--text);
  font-family: inherit; font-size: 13.5px; font-weight: 600;
}
.cal-edit textarea { min-height: 64px; resize: vertical; line-height: 1.5; }
/* 動物卡片化（2026-09-23）：編輯子面板裡的「開關列」（已絕育／顯示在探索） */
.cal-fieldrow { display: flex; align-items: center; justify-content: space-between; padding: 12px 0 2px; }
.cal-fieldrow-label { font-size: 13px; font-weight: 700; color: var(--text); }
.cal-edit-actions { display: flex; gap: 8px; margin-top: 10px; }
.cal-edit-actions .btn { flex: 1; }
.cal-del {
  display: block; width: 100%; margin-top: 10px; border: none;
  background: var(--primary-soft); color: var(--primary);
  font-family: inherit; font-size: 12.5px; font-weight: 800;
  padding: 10px 12px; border-radius: var(--r-pill); cursor: pointer;
}
/* 6 色色票（在編輯子面板裡） */
.cal-palette { display: flex; gap: 8px; padding: 9px 0 4px; }
.cal-palette button {
  width: 24px; height: 24px; border-radius: 50%; cursor: pointer; padding: 0;
  background: var(--cal); border: 2px solid transparent;
}
.cal-palette button.picked { border-color: var(--frame); box-shadow: 0 0 0 2px var(--surface) inset; }
/* ===== 月格面板：白紙＋格線（顏色留給資訊）===== */
.cal-panel {
  margin: 12px 14px 0; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 10px 10px 8px; box-shadow: none;
}
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-dow {
  text-align: center; font-size: var(--fs-micro); font-weight: var(--fw-medium);
  color: var(--muted); padding: 0 0 6px;
}
.cal-cell {
  position: relative; aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm); border: none; background: transparent;
  cursor: pointer; font-family: inherit;
  font-size: var(--fs-label); font-weight: var(--fw-regular); color: var(--text-soft);
  transition: background 0.12s;
}
.cal-cell:hover { background: var(--surface-alt); }
.cal-cell.other { color: var(--muted-weak); cursor: default; background: transparent; }
.cal-cell.other:hover { background: transparent; }
/* 有紀錄（無照片）＝奶油淡底；有照片＝縮圖鋪滿格子 */
.cal-cell.has { background: var(--sel-soft); }
.cal-cell.has:hover { background: var(--sel-soft); }
/* 今天＝動作色數字 ＋ 格下小圓點（不用整格底色，避免和「選中」搶） */
.cal-cell.today { color: var(--action); font-weight: var(--fw-semibold); }
.cal-cell .today-dot {
  position: absolute; left: 50%; bottom: 4px; width: 4px; height: 4px; margin-left: -2px;
  border-radius: 50%; background: var(--action); z-index: 4; pointer-events: none;
}
.cal-cell.selected { background: var(--sel); color: var(--on-sel); font-weight: var(--fw-semibold); }
.cal-cell .num { position: relative; z-index: 2; }
.cal-cell .thumb { position: absolute; inset: 3px; border-radius: var(--r-sm); overflow: hidden; }
.cal-cell .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cal-cell .thumb::after { content: ""; position: absolute; inset: 0; background: var(--thumb-scrim); }
.cal-cell.photo .num { color: #fff; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85); font-weight: var(--fw-semibold); }
.cal-cell.selected .thumb, .cal-cell.today .thumb { display: none; }
.cal-cell .count-badge {
  position: absolute; top: 3px; right: 3px; z-index: 3;
  min-width: 15px; height: 15px; padding: 0 3px;
  border-radius: var(--r-pill); line-height: 15px; text-align: center;
  background: var(--sel); color: var(--on-sel); font-size: 10px; font-weight: var(--fw-semibold);
}
.cal-cell.selected .count-badge { background: var(--action); color: var(--on-action); }

/* ===== 當日清單：髮絲線分隔的列（不是卡片）===== */
.memory-head { display: flex; align-items: baseline; gap: 8px; margin: 16px 16px 2px; }
.memory-head h3 {
  margin: 0; font-family: var(--font-display); font-size: var(--fs-body);
  font-weight: var(--fw-regular); color: var(--text);
}
.memory-head .date, .memory-head .count { color: var(--muted); font-size: var(--fs-meta); font-weight: var(--fw-regular); }
.memory-head .jump {
  margin-left: auto; border: none; background: transparent; padding: 2px 4px;
  color: var(--action); font-family: inherit; font-size: var(--fs-meta);
  font-weight: var(--fw-semibold); cursor: pointer;
}
#memory-list { display: flex; flex-direction: column; margin: 0 16px; }
.memory-card {
  position: relative; display: flex; align-items: center; gap: 11px;
  padding: 9px 0; background: transparent; border: none; border-bottom: 1px solid var(--line);
  border-radius: 0; box-shadow: none; cursor: pointer;
}
.memory-card:last-child { border-bottom: none; }
.memory-card:active { transform: none; }
/* 這一則屬於哪一本日曆：左緣 3px 色條（多日曆時才出現） */
.memory-card .cal-bar {
  position: absolute; left: -8px; top: 8px; bottom: 8px; width: 3px;
  border-radius: var(--r-paper); background: var(--cal, var(--muted));
}
.memory-card .mem-cal {
  font-size: var(--fs-micro); font-weight: var(--fw-semibold); color: var(--cal, var(--muted));
  display: inline-flex; align-items: center; gap: 4px;
}
.memory-card .mem-cal::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--cal, var(--muted)); flex: 0 0 auto;
}
.memory-card .mem-media {
  width: 46px; height: 46px; flex-shrink: 0; border-radius: var(--r-sm);
  background: var(--surface-alt); overflow: hidden; position: relative;
  display: flex; align-items: center; justify-content: center; color: #B7A98F;
}
.memory-card .mem-media img, .memory-card .mem-media video {
  /* 2026-10-01：明確 px，不用 100%。在 flex 容器裡直式照片（360x900）的 used width 會依原比例
     變成 18.39px（橫式剛好 46）→ 縮圖大小不一致；與下方 `.memory-card > img` 寫法一致。
     再加 `flex: 0 0 auto` 是防禦：`.mem-media` 是 flex 容器，日後若有同層元素（例如里程碑標籤）
     被塞進來，只會讓容器溢出/裁切，不會把照片擠窄 —— 縮圖尺寸不該由容器裡有幾個兄弟決定。 */
  width: 46px; height: 46px; flex: 0 0 auto; object-fit: cover; display: block; background: var(--surface-alt);
}
.memory-card > img, .memory-card > video {
  width: 46px; height: 46px; flex-shrink: 0; object-fit: cover; display: block;
  border-radius: var(--r-sm); background: var(--surface-alt);
}
.memory-card .mem-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.memory-card .mem-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.memory-card .mem-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.memory-card .mem-time { font-size: var(--fs-micro); color: var(--muted); font-weight: var(--fw-regular); }
.memory-card .mem-cap {
  font-size: var(--fs-label); font-weight: var(--fw-medium); line-height: 1.45; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
/* 里程碑標籤：改到「列的右側」（自繪圖示 ＋ 文字），不再壓在縮圖上遮照片 */
.memory-card .ms-tag, .ms-tag {
  display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto;
  background: var(--sel-soft); color: var(--on-sel);
  font-size: var(--fs-micro); font-weight: var(--fw-semibold);
  padding: 2px 8px; border-radius: var(--r-pill); border: none;
}
.memory-card .ms-tag .pp-icon, .mem-detail-row .ms-tag .pp-icon { width: 13px; height: 13px; }
/* ⚠️ 沒有「標籤疊在縮圖上」這個變體（舊的 `.ms-tag.on-thumb` 已隨 K3 刪除）：
   里程碑標籤一律在**列的右側**（memoryCardHtml() 產生的 .mem-top 內），
   放進 `.mem-media` 會被 flex 同層元素把照片擠窄（直式 360x900 只剩 18px）。 */

/* ===== 底部 CTA（這一頁唯一的貼紙主角）＋ 提示 ===== */
.cal-cta {
  margin: 14px 16px 0; height: 48px; width: calc(100% - 32px);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--action); color: var(--on-action);
  border: 2px solid var(--frame); border-radius: var(--r-md);
  box-shadow: var(--sticker-shadow);
  font-family: inherit; font-size: var(--fs-body); font-weight: var(--fw-semibold); cursor: pointer;
}
.cal-cta:active { transform: translate(2px, 2px); box-shadow: var(--sticker-shadow); }
.cal-cta .pp-icon { width: 18px; height: 18px; }
.upload-hint {
  text-align: center; color: var(--muted); font-size: var(--fs-meta);
  font-weight: var(--fw-regular); margin: 12px 16px 0;
}

/* 詳細檢視（點開一列）：大圖在這個 sheet 裡 */
.mem-detail-media {
  width: 100%; aspect-ratio: 4 / 3; background: var(--surface-alt);
  border-radius: var(--r-md); overflow: hidden; margin-bottom: 12px;
}
.mem-detail-media img, .mem-detail-media video {
  width: 100%; height: 100%; object-fit: cover; display: block; background: var(--surface-alt);
}
.mem-detail-cap { font-size: var(--fs-label); font-weight: var(--fw-regular); line-height: 1.6; color: var(--text); }
.mem-detail-row { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; }
.mem-detail-row .mem-time { font-size: var(--fs-meta); color: var(--muted); font-weight: var(--fw-regular); }

/* 列右側 ⋯ 選單（編輯／刪除）：輕量文字鈕 */
.mem-actions { position: relative; flex-shrink: 0; }
.mem-more {
  width: 30px; height: 30px; border-radius: 50%; border: none; background: transparent;
  cursor: pointer; font-size: 17px; line-height: 1; color: var(--muted); font-family: inherit;
  display: flex; align-items: center; justify-content: center;
}
.mem-more:hover { background: var(--surface-alt); color: var(--text); }
.mem-menu {
  position: absolute; right: 0; top: 34px; z-index: 20;
  display: flex; flex-direction: column; gap: 2px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 5px; box-shadow: var(--paper-shadow); min-width: 116px;
}
.mem-menu button {
  border: none; background: transparent; text-align: left;
  font-size: var(--fs-label); font-weight: var(--fw-medium); color: var(--text);
  padding: 8px 10px; border-radius: var(--r-sm); cursor: pointer; font-family: inherit;
  display: flex; align-items: center; gap: 8px;
}
.mem-menu button .pp-icon { width: 15px; height: 15px; }
.mem-menu button:hover { background: var(--surface-alt); }
.mem-menu button.mem-del { color: var(--danger); }
.mem-menu button.mem-del:hover { background: var(--action-soft); }

/* ---------- 對方日曆共享橫幅 ---------- */
.shared-banner {
  display: flex; align-items: center; gap: 8px;
  background: var(--info-soft); color: var(--info-text);
  border: 2px solid var(--frame);
  font-size: var(--fs-label); font-weight: var(--fw-semibold);
  padding: 9px 14px; border-radius: var(--r-sm); margin-bottom: 16px;
}
.shared-banner .pp-icon { width: 15px; height: 15px; flex: 0 0 auto; }

/* ---------- 檔案（改構 C · 名片＋就地編輯，2026-09-19） ----------
   樣板：sketches/profile-c-inline-edit/index.html。三條規則：
   ① 閱讀態／編輯態共用同一張卡（.idcard / .idcard--editing）—— 不要另一個畫面。
   ② 編輯態的「第二步」是 .peditbar（sticky，浮在底部導覽列之上）。
   ③ 顏色一律走 token：框線用 --frame、黃底文字用 --on-accent（深色模式才不會壞）。 */
.psec { display: flex; align-items: baseline; gap: 8px; margin: 24px 0 10px; }
.psec h3 { margin: 0; font-size: var(--fs-body); font-weight: var(--fw-semibold); flex: 1; }
.psec-more {
  border: none; background: transparent; cursor: pointer; padding: 0;
  color: var(--info); font: inherit; font-size: var(--fs-meta); font-weight: var(--fw-semibold);
}

/* 名片 */
.idcard {
  position: relative; text-align: center; cursor: pointer;
  background: var(--surface);
  border: 2px solid var(--frame); border-radius: var(--r-plush);
  box-shadow: var(--sticker-shadow);
  padding: 22px 18px 18px;
}
.idcard:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
.idcard--editing { border-style: dashed; border-color: var(--primary); cursor: default; }
.idcard-ava {
  position: relative; width: 96px; height: 96px; margin: 0 auto;
  border: 2px solid var(--frame); border-radius: 50%;
  background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center;
}
.idcard-ava .pp-icon { width: 44px; height: 44px; color: var(--primary); }
.idcard-ava img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.idcard-cam {
  position: absolute; right: -3px; bottom: -3px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--primary); color: var(--on-primary);
  border: 2px solid var(--surface);
  display: flex; align-items: center; justify-content: center;
}
.idcard-cam .pp-icon { width: 16px; height: 16px; }
.idcard-name { margin: 12px 0 0; font-size: var(--fs-title); font-weight: var(--fw-semibold); }
.idcard-namefield { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 12px; }
.idcard-namefield input {
  width: 170px; text-align: center; padding: 2px 0;
  font: inherit; font-size: var(--fs-title); font-weight: var(--fw-semibold); color: var(--text);
  background: transparent; border: none; border-bottom: 2px solid var(--primary); outline: none;
}
.pencil { color: var(--primary); }
.pencil .pp-icon { width: 16px; height: 16px; }
.idcard-camhint { margin: 6px 0 0; font-size: var(--fs-meta); font-weight: var(--fw-semibold); color: var(--muted); }
.idcard-camhint .pp-icon { width: 13px; height: 13px; }
.idcard-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 10px; }
.idcard-chip {
  display: flex; align-items: center; gap: 4px;
  border-radius: var(--r-pill);
  padding: 6px 12px; background: var(--accent-soft); color: var(--text);
  font-size: var(--fs-meta); font-weight: var(--fw-semibold);
}
.idcard-chip--plain { background: var(--surface-alt); color: var(--text-soft); }
/* ⚠️ 編輯態自己帶框（base 已經沒有 border，只寫 border-style 不會畫出東西）。 */
.idcard-chip--edit { border: 1px dashed var(--primary); background: var(--surface); }
.idcard-chip--edit input {
  width: 64px; text-align: center; padding: 0;
  font: inherit; font-size: var(--fs-meta); font-weight: var(--fw-semibold); color: var(--text);
  background: transparent; border: none; outline: none;
}
.idcard-bio {
  margin: 14px 0 0; padding-top: 14px; border-top: 1px solid var(--line);
  font-size: var(--fs-body); font-weight: var(--fw-semibold); line-height: 1.6; color: var(--text-soft);
}
.idcard-bio--empty { color: var(--muted); }
.idcard-foot { margin: 12px 0 0; font-size: var(--fs-meta); font-weight: var(--fw-semibold); color: var(--muted); }
.idcard-foot .pp-icon { width: 13px; height: 13px; }
.idcard-bioarea { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); text-align: left; }
.idcard-bioarea textarea {
  width: 100%; min-height: 74px; resize: none;
  font: inherit; font-size: var(--fs-body); font-weight: var(--fw-semibold); line-height: 1.6; color: var(--text);
  background: transparent; border: none; outline: none;
}
.idcard-biocount { margin: 4px 0 0; font-size: var(--fs-micro); font-weight: var(--fw-semibold); color: var(--muted); }

/* 三個數字（2026-09-25 視覺收斂）：**無框數字列**，原本是三張 2px 墨框＋實心偏移陰影的貼紙票。
   層級改由字重＋色階＋髮絲分隔線承擔；它們不可點，長得像按鈕本來就是誤導。 */
.pstats { display: flex; margin-top: 16px; }
.psticker { flex: 1; text-align: center; padding: 2px 6px; }
.psticker + .psticker { border-left: 1px solid var(--line); }
.psticker b { display: block; font-size: var(--fs-title); font-weight: var(--fw-semibold); }
.psticker span { font-size: var(--fs-micro); font-weight: var(--fw-semibold); color: var(--muted); }

/* 精選（里程碑圓圈） */
.phl { display: flex; gap: 10px; }
.phl-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  border: none; background: transparent; cursor: pointer; padding: 0; font: inherit;
}

/* ---------- 他人名片（唯讀；2026-09-19）----------
   ⚠️ 這兩個 class 存在的唯一目的：**把「可編輯」的視覺暗示拿掉**。
   看他人檔案時不得看起來像可以操作（使用者明確要求避免誤解）；
   內容與編輯入口的取捨見 app.js 的 renderOtherProfile()。 */
.idcard--readonly { cursor: default; }
.phl-item--static { cursor: default; }
/* 精選圓圈（2026-09-25 視覺收斂）：統一成柔底、無框 —— 原本三顆髮絲框＋一顆 2px 墨框，
   「粗框＝有內容」但畫面沒有任何說明。現在「有內容＝奶油填色、沒有＝柔底」。 */
.phl-cir {
  width: 62px; height: 62px; border-radius: 50%;
  background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center;
}
.phl-cir .pp-icon { width: 26px; height: 26px; }
.phl-cir--empty { background: var(--surface-alt); }
.phl-n { margin-top: 6px; font-size: var(--fs-micro); font-weight: var(--fw-semibold); color: var(--text); }
.phl-c { font-size: var(--fs-micro); font-weight: var(--fw-medium); color: var(--muted); }

/* 相簿（九宮格 + 新增格） */
.pgallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pgallery-item { aspect-ratio: 1; border-radius: var(--r-sm); overflow: hidden; background: var(--ph-a); }
.pgallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pgallery-add {
  aspect-ratio: 1; border-radius: var(--r-sm); cursor: pointer;
  border: 2px dashed var(--muted); background: transparent;
  color: var(--muted);
}
.pgallery-add .pp-icon { width: 24px; height: 24px; }
.pempty { margin: 0; font-size: var(--fs-label); font-weight: var(--fw-regular); color: var(--muted); line-height: 1.6; }

/* 頁尾兩列（設定／登出） */
.prowlist { margin-top: 24px; border-top: 1px solid var(--line); }
.prow {
  width: 100%; display: flex; align-items: center; gap: 10px; text-align: left;
  padding: 15px 2px; border: none; border-bottom: 1px solid var(--line);
  background: transparent; cursor: pointer;
  font: inherit; font-size: var(--fs-body); font-weight: var(--fw-semibold); color: var(--text);
}
/* 第一格＝圖示＋文字（.pp-icon 預設 display:block，這裡要 inline-flex 才會同排）。 */
.prow span:first-child { flex: 1; display: inline-flex; align-items: center; gap: 9px; }
.prow .pp-icon { width: 17px; height: 17px; color: var(--muted); }
.prow-arrow { color: var(--muted); font-size: 16px; }
.prow--danger { color: var(--danger); }

/* 就地編輯的浮動列：sticky 讓它留在底部導覽列之上，又跟著這個 pane 一起消失 */
.peditbar {
  position: sticky; bottom: 78px; z-index: 5;
  display: flex; align-items: center; gap: 10px; margin-top: 18px;
  background: var(--bg); border: 2px solid var(--frame); border-radius: var(--r-pill);
  padding: 9px 9px 9px 16px;
  box-shadow: var(--sticker-shadow);
}
.peditbar-note { flex: 1; font-size: var(--fs-micro); font-weight: var(--fw-semibold); color: var(--muted); line-height: 1.35; }
.peditbar .btn { padding: 9px 14px; font-size: var(--fs-label); border-radius: var(--r-pill); }

/* 名片上的事實膠囊（性別／絕育／地區／主人性別，閱讀態） */
.idcard-facts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 10px; }
.fact-pill {
  /* 單行不折：圖示與文字並排（inline-flex＋nowrap）。
     ⚠️ 少了這行，`.pp-icon{display:block}` 會讓 pin 圖示自己佔一行、
     3 字地名（例「臺北市」）被擠到第二行，膠囊就比別人高（實測 46 → 31）。 */
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
  border: 1.5px solid var(--line); border-radius: var(--r-pill);
  padding: 4px 10px; background: var(--surface);
  font-size: var(--fs-meta); font-weight: var(--fw-semibold); color: var(--text-soft);
}
/* 滑卡上的事實膠囊（性別／已絕育／地區／主人性別）。
   ⚠️ 底是**照片**（不是 surface），所以固定用淺色膠囊＋深字 —— 跟著深色模式走會在深色 scrim 上糊掉
   （照片背景與主題無關；與 `.cal-cell.photo .num` 固定白字是同一個理由，不是漏用 token）。 */
.card-overlay .idcard-facts { justify-content: flex-start; margin-top: 8px; }
.card-overlay .fact-pill { background: rgba(255, 252, 243, 0.94); color: #221C15; border-color: transparent; }

/* 編輯態的欄位（物種／品種／性別／絕育／地區／主人性別） */
.idcard-fields { width: 100%; margin-top: 12px; text-align: left; display: flex; flex-direction: column; gap: 10px; }
.fld { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 800; color: var(--muted); }
.fld select, .fld-custom {
  width: 100%; padding: 9px 11px; border: 2px solid var(--frame); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text); font: inherit; font-size: 14.5px; font-weight: 600;
}
.fld-custom { border-style: dashed; border-color: var(--primary); margin-top: 4px; }
.fld-check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); }
.fld-check input { width: 18px; height: 18px; accent-color: var(--primary); }
.fld-region { display: flex; gap: 8px; align-items: center; }
.fld-region select { flex: 1; }
.fld-locate {
  white-space: nowrap; border: 2px solid var(--frame); border-radius: var(--r-sm);
  background: var(--info-soft); color: var(--info-text); padding: 9px 11px;
  font: inherit; font-size: var(--fs-label); font-weight: var(--fw-semibold); cursor: pointer;
}

/* 相簿精選彈窗 */
.feat-sub { font-size: 12px; color: var(--muted); margin: 0 0 10px; }
.feat-list { display: flex; flex-direction: column; gap: 8px; max-height: 46vh; overflow-y: auto; margin-bottom: 14px; }
.feat-row {
  display: flex; align-items: center; gap: 10px; padding: 8px;
  border: 2px solid var(--line); border-radius: var(--r-sm); cursor: pointer;
}
.feat-row.on { border-color: var(--primary); }
.feat-row img { width: 48px; height: 48px; border-radius: var(--r-sm); object-fit: cover; }
.feat-row span { flex: 1; font-size: 14px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feat-row input { width: 18px; height: 18px; accent-color: var(--primary); flex-shrink: 0; }

/* ---------- 聊天列表 ---------- */
.chatlist { display: flex; flex-direction: column; gap: 10px; }
.chatlist-item {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border-radius: var(--r-md);
  padding: 14px; box-shadow: var(--shadow-sm); cursor: pointer;
  border: 2px solid var(--frame);
  transition: transform 0.1s, box-shadow 0.1s;
}
.chatlist-item:hover { transform: translate(-1px, -1px); box-shadow: var(--shadow); }
.chatlist-item .chatlist-body { flex: 1; min-width: 0; }
.chatlist-item .chatlist-top { display: flex; align-items: center; gap: 8px; }
.chatlist-item .presence-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted-weak); flex-shrink: 0; }
.chatlist-item .presence-dot.on { background: var(--info); }
.chatlist-item .name { font-weight: var(--fw-semibold); }
.chatlist-item .when { margin-left: auto; flex-shrink: 0; font-size: var(--fs-micro); color: var(--muted); font-weight: var(--fw-semibold); }
.chatlist-item .preview {
  margin-top: 2px; font-size: var(--fs-label); color: var(--text-soft); font-weight: var(--fw-semibold);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chatlist-item .preview.is-muted { color: var(--muted); }
/* 動物卡片化（2026-09-23）：聊天列表／聊天室的卡片標籤「我的卡 ⇄ 對方卡」 */
.card-tag {
  display: inline-block;
  margin-top: 3px;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--info-soft);
  color: var(--info-text);
  font-size: var(--fs-micro);
  font-weight: var(--fw-semibold);
  line-height: 1.4;
}
.chatlist-item .unread-badge {
  flex-shrink: 0; min-width: 24px; height: 24px; padding: 0 7px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary); color: var(--on-primary);
  border: 2px solid var(--frame); border-radius: var(--r-pill);
  box-shadow: var(--sticker-shadow);   /* 未讀徽章＝小貼紙（2px 實心偏移） */
  font-size: var(--fs-meta); font-weight: var(--fw-semibold);
}

/* ---------- 底部導航列 ---------- */
/* 2026-09-26 依核准稿 C1：底部導覽改成**懸浮藥丸 dock**（不貼邊、不佔滿寬、浮在內容上）。
   FAB（日曆的「＋」）維持右下 —— 它是主要 CTA，所以仍是唯一帶墨框的圓。 */
.tabbar {
  position: absolute; bottom: calc(10px + env(safe-area-inset-bottom)); left: 14px; right: 14px;
  display: flex;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-plush);
  padding: 6px 8px;
  box-shadow: var(--paper-shadow);
  z-index: 10;
}
.tabbar-btn {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  border: none; background: transparent; cursor: pointer;
  color: var(--muted); font-size: 11px; font-weight: 700;
  padding: 6px 0; border-radius: var(--r-md);
  transition: color 0.15s;
}
.tabbar-btn svg { width: 24px; height: 24px; }
.tabbar-btn.active { color: var(--primary); }
.tabbar-btn.active svg { stroke-width: 2.6; }

/* ---------- 日曆「＋」懸浮新增鈕 ---------- */
/* 2026-09-29：K3 核准稿讓它退役（日曆頁的貼紙主角是底部 CTA「貼上一則回憶」）。
   保留 .fab 給其他頁面沿用；日曆頁的元素帶 .fab--retired，一律不顯示。 */
.fab--retired { display: none !important; }
.fab {
  position: absolute; right: 18px; bottom: 92px;
  width: 56px; height: 56px; border-radius: 50%;
  border: 2px solid var(--frame);
  background: var(--primary); color: var(--on-primary);
  box-shadow: var(--sticker-shadow);
  font-size: 28px; font-weight: 800; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 30;
  transition: transform 0.1s, box-shadow 0.1s;
}
.fab:active { transform: translate(2px, 2px); box-shadow: var(--sticker-shadow); }

/* ---------- 設定 ---------- */
.settings-body { padding-top: 8px; }
.settings-section { margin-bottom: 26px; }
.settings-title { margin: 0 0 12px; font-size: var(--fs-body); font-weight: var(--fw-semibold); color: var(--text); }
.settings-card {
  background: var(--surface);
  border: 2px solid var(--frame);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.settings-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
}
.settings-row.clickable { cursor: pointer; }
.settings-row.clickable:hover { background: var(--mint-soft); }
.settings-row + .settings-row { border-top: 1.5px dashed var(--line); }
.row-icon {
  width: 40px; height: 40px; border-radius: var(--r-md);
  border: 2px solid var(--frame);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.row-icon .pp-icon { width: var(--icon-row); height: var(--icon-row); }
.row-body { flex: 1; min-width: 0; }
.row-title { font-weight: var(--fw-semibold); font-size: var(--fs-body); color: var(--text); }
.row-sub { font-size: var(--fs-meta); color: var(--muted); font-weight: var(--fw-regular); margin-top: 2px; }
.row-chev { color: var(--muted); font-size: 22px; }

/* 開關（刻意做成薄款：與 App 的原生 Switch 一致，不加墨框） */
.switch {
  position: relative;
  width: 46px; height: 28px;
  flex-shrink: 0;
  cursor: pointer;
}
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch .knob {
  position: absolute; inset: 0;
  border-radius: var(--r-pill);
  background: var(--switch-off);
  transition: background 0.18s;
}
.switch .knob::after {
  content: "";
  position: absolute; top: 3px; left: 3px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--bubble-shadow);
  transition: transform 0.18s;
}
.switch input:checked + .knob { background: var(--mint); }
.switch input:checked + .knob::after { transform: translateX(18px); }

/* 訂閱卡（.plan-card / .plan-badge…）：2026-09-21 隨訂閱畫面一起移除
   （App Store 3.1.1：畫面有價格卻不是真交易）。要重做時設計草案見 docs/membership-plan.md。 */

.settings-foot { text-align: center; color: var(--muted); font-size: var(--fs-meta); font-weight: var(--fw-regular); margin-top: 18px; }

/* ---------- Bottom sheet（2026-09-19 日曆改版）----------
   手機的「新增／編輯／檢視」一律由下往上滑出，取代畫面中央的貼紙彈窗
   （置中彈窗是桌機網頁的習慣）。DOM 掛在 .phone 之外，用 fixed + max-width 對齊手機欄。
   ⚠️ 動畫（transform）不能放在外層容器上：有 transform 的祖先會變成 fixed 子元素的
   containing block，遮罩就會跟著 sheet 一起位移。所以滑動動畫放 .sheet-box。 */
.sheet-wrap {
  position: fixed; inset: 0; z-index: 150;
  display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
}
.sheet-scrim { position: absolute; inset: 0; background: var(--scrim); animation: sheetFade 0.18s ease-out; }
.sheet-box {
  position: relative; width: 100%; max-width: 430px;
  background: var(--surface);
  border-radius: var(--r-plush) var(--r-plush) 0 0;
  box-shadow: var(--sheet-shadow);
  display: flex; flex-direction: column;
  max-height: 92%;
  animation: sheetUp 0.22s ease-out;
}
.sheet-grab { width: 42px; height: 4px; border-radius: var(--r-pill); background: var(--line); margin: 10px auto 4px; flex-shrink: 0; }
.sheet-body { overflow-y: auto; padding: 6px 18px 10px; }
.sheet-title { margin: 0; font-size: 18px; font-weight: 800; }
.sheet-sub { margin: 5px 0 0; color: var(--muted); font-size: 12.5px; font-weight: 600; line-height: 1.5; }
.sheet-label { font-size: 12px; font-weight: 800; color: var(--muted); margin: 16px 0 7px; }
.sheet-foot { display: flex; gap: 10px; padding: 12px 18px 18px; border-top: 1px solid var(--line); flex-shrink: 0; }
.sheet-foot .btn { flex: 1; }
.sheet-foot .btn--ghost { flex: 0 0 auto; padding-left: 20px; padding-right: 20px; }
/* sheet 裡不用貼紙風按鈕（2px 墨框＋實心偏移）：一個面板裡兩顆厚按鈕會讓 sheet 看起來像表單頁 */
.sheet-foot .btn, .sheet-box .btn { border: none; box-shadow: none; }
.sheet-foot .btn--ghost { background: var(--line); }

/* ===== 曝光統計（Phase 2 社交加值，2026-09-21）=====
   只給數字不給人。數字用 primary（動作色），標籤用一般文字 —— 
   不要用日曆那 6 個識別色，它們只負責「分辨哪一本」。 */
.stat-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.stat-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--surface); border: 1.5px solid var(--line);
  border-radius: var(--r-md); padding: 10px 12px;
}
.stat-label { font-size: 14px; font-weight: 800; color: var(--text); }
.stat-hint { font-size: 11.5px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.stat-val { font-size: 20px; font-weight: 800; color: var(--primary); white-space: nowrap; }
.stat-regions { font-size: 13.5px; font-weight: 700; color: var(--text-soft); }
/* 免費的曝光統計：數值的鎖住佔位條（**靜態**，不呼吸 —— 呼吸是「載入中」的語意）
   ⚠️ 圓角用既有的 pill（999px），不要新造數值：`scripts/audit_ai_tells.py` 的 R4 在盯「圓角種類數」。 */
.stat-locked-bar { display: block; width: 54px; height: 18px; border-radius: var(--r-pill); background: var(--line); }
.stat-locked-bar.wide { width: 140px; height: 14px; border-radius: var(--r-pill); margin-top: 6px; }
.stat-note--tiny { font-size: 11px; text-align: center; }
.stat-note { font-size: 12px; color: var(--muted); line-height: 1.65; margin: 14px 0 0; }
.stat-feats { margin: 12px 0 0; padding-left: 18px; }
.stat-feats li { font-size: 13px; color: var(--text-soft); line-height: 1.9; }

/* ===== 會員計劃頁 + Paywall（Phase A，2026-09-23）=====
   數字用 primary（動作色），跟曝光統計同一套語言。 */
.plan-table { width: 100%; border-collapse: collapse; margin: 6px 0 2px; }
.plan-table th { font-size: 11px; font-weight: 800; color: var(--muted); text-align: left; padding: 6px 6px; border-bottom: 1.5px solid var(--line); }
.plan-table td { font-size: 13px; color: var(--text-soft); padding: 8px 6px; border-bottom: 1px solid var(--line); }
.plan-table th.c, .plan-table td.c { text-align: center; width: 74px; }
.plan-table td.plus { color: var(--primary); font-weight: 800; }

.plan-now { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-md); padding: 14px; margin-bottom: 4px; }
.plan-now-badge { font-size: 10.5px; font-weight: 800; color: var(--muted); letter-spacing: .4px; }
.plan-now-name { font-size: 20px; font-weight: 800; margin-top: 2px; }
.plan-now-sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; }

.plan-note { font-size: 11.5px; color: var(--muted); line-height: 1.6; margin: 8px 0 0; }

/* 意見回饋（web 版 sheet；與 App 的 FeedbackSheet 對齊） */
.fb-kinds { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.fb-kind { padding: 8px 14px; border-radius: var(--r-pill); border: 1.5px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 700; color: var(--muted); cursor: pointer; }
.fb-kind.active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.fb-body { width: 100%; min-height: 120px; border: 1.5px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; font-size: 14px; font-weight: 600; background: var(--bg); resize: vertical; margin-top: 8px; box-sizing: border-box; }
.fb-contact { width: 100%; border: 1.5px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; font-size: 14px; font-weight: 600; background: var(--bg); margin-top: 8px; box-sizing: border-box; }
.btn.disabled, .btn:disabled { background: var(--line); color: var(--muted); box-shadow: none; border: none; cursor: not-allowed; }

.paywall-cta { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.stat-row.clickable { cursor: pointer; }
.stat-row.clickable:hover { background: var(--mint-soft); }

/* sheet 內的欄位不套 `.form-grid` 的 2px 墨框（那是表單頁的語言，不是手機 sheet 的） */
.sheet-box .form-grid { gap: 0; }
.sheet-box .form-grid input, .sheet-box .form-grid textarea, .sheet-box .form-grid select {
  border: none; background: var(--bg); border-radius: var(--r-md);
  font-size: 13px; font-weight: 600; padding: 11px 12px;
  font-family: inherit; color: var(--text); outline: none;
}
.sheet-box .form-grid input:focus, .sheet-box .form-grid textarea:focus, .sheet-box .form-grid select:focus {
  box-shadow: inset 0 0 0 1.5px var(--accent);
}
.sheet-box .form-grid textarea { min-height: 92px; resize: vertical; }
.sheet-box .form-grid label { font-size: 12px; font-weight: 800; color: var(--muted); margin-top: 14px; }

/* 選好媒體的那一列（挑檔案前後兩種狀態） */
.pick-row { display: flex; align-items: center; gap: 10px; background: var(--bg); border-radius: var(--r-md); padding: 8px; }
.pick-row .pick-pic {
  width: 44px; height: 44px; border-radius: var(--r-sm); overflow: hidden; flex-shrink: 0;
  background: var(--accent-soft); display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.pick-row .pick-pic img, .pick-row .pick-pic video { width: 100%; height: 100%; object-fit: cover; display: block; }
.pick-row .pick-info { min-width: 0; flex: 1; }
.pick-row .pick-name { font-size: 12px; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-row .pick-ok { font-size: 11.5px; font-weight: 800; color: var(--primary); }
.pick-row .pick-swap {
  border: none; background: var(--line); color: var(--text); font-family: inherit;
  font-size: 12px; font-weight: 700; padding: 7px 11px; border-radius: var(--r-pill); cursor: pointer; flex-shrink: 0;
}
.pick-drop {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  border: 1.6px dashed var(--line); border-radius: var(--r-md); background: var(--bg);
  padding: 18px 12px; cursor: pointer; text-align: center;
}
.pick-drop:hover { border-color: var(--primary); }
.pick-drop .ico { font-size: 24px; }
.pick-drop .ico .pp-icon { width: 24px; height: 24px; color: var(--muted); }
.pick-drop .t { font-size: 12.5px; font-weight: 800; color: var(--text); }
.pick-drop .h { font-size: 11px; color: var(--muted); font-weight: 600; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes sheetFade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Modal ---------- */
.modal {
  position: fixed; inset: 0;
  background: var(--scrim);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; padding: 20px;
}
.modal-box {
  background: var(--surface);
  border: 2.5px solid var(--frame);
  border-radius: var(--r-plush);
  box-shadow: var(--sticker-shadow);
  width: 100%; max-width: 400px;
  max-height: 88vh; overflow-y: auto;
  padding: 26px 22px;
  position: relative;
}
.modal-close {
  position: absolute; top: 14px; right: 16px;
  border: none; background: transparent; font-size: 26px;
  cursor: pointer; color: var(--muted); line-height: 1;
}
.modal-close:hover { color: var(--text); }

/* ---------- 表單 ---------- */
.form-grid { display: flex; flex-direction: column; gap: 12px; }
.form-grid label { font-weight: 800; font-size: 14px; }
.form-grid input, .form-grid textarea {
  padding: 12px 14px;
  border: 2px solid var(--frame);
  border-radius: var(--r-sm);
  font-size: 15px; font-family: inherit; font-weight: 600; outline: none;
}
.form-grid input:focus, .form-grid textarea:focus { border-color: var(--primary); box-shadow: 2px 2px 0 var(--primary); }
.form-grid textarea { min-height: 80px; resize: vertical; }
.form-grid select {
  padding: 12px 14px;
  border: 2px solid var(--frame);
  border-radius: var(--r-sm);
  font-size: 15px; font-family: inherit; font-weight: 600; outline: none;
  background: var(--surface); color: var(--text);
}
.form-grid select:focus { border-color: var(--primary); box-shadow: 2px 2px 0 var(--primary); }

/* ---------- 里程碑按鈕（智慧範本）----------
   2026-09-19 日曆改版：改成柔底藥丸（原本 2px 墨框＋偏移陰影在 sheet 裡像一排按鈕標籤）。 */
.milestone-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.ms-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 12px;
  border: none;
  border-radius: var(--r-pill);
  background: var(--line);
  color: var(--text);
  font-size: var(--fs-meta); font-weight: var(--fw-semibold); font-family: inherit;
  cursor: pointer;
  transition: background 0.12s, transform 0.1s;
}
.ms-chip:hover { transform: translateY(-1px); }
.ms-chip.active { background: var(--mint); color: var(--on-accent); font-weight: var(--fw-semibold); }
.ms-chip .pp-icon { width: 15px; height: 15px; flex: 0 0 auto; }
.ms-chip--manual { color: var(--muted); }
.modal-note { margin: 6px 0 0; color: var(--muted); font-size: 13px; font-weight: 600; }

/* ---------- 檢舉／封鎖的圓形單選列（K3，2026-10-03 核准稿 A2）----------
   與 App 的 `components/ReportBlockSheet.tsx` 同一組語意：選中＝動作色、
   列間用髮絲線（不是逐列卡片）、清單第一列不畫上框（不然會貼著說明文字）。
   舊版是五顆 ghost 按鈕、點下去就直接送出 —— 使用者還來不及看清楚就送出了。 */
.safety-list { display: flex; flex-direction: column; margin-top: 10px; }
.safety-rrow {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px 2px;
  border: none; border-top: 1px solid var(--line);
  background: transparent; color: var(--text);
  font-family: inherit; font-size: var(--fs-body); font-weight: var(--fw-semibold);
  text-align: left; cursor: pointer;
}
.safety-rrow:first-child { border-top: none; }
.safety-rrow:hover { background: var(--mint-soft); }
.safety-rd { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--muted); flex-shrink: 0; }
.safety-rrow.on .safety-rd { border: 6px solid var(--primary); }
.safety-rt { flex: 1; min-width: 0; }
.safety-rrow.on .safety-rt { color: var(--primary); }
.ms-tag {
  display: inline-block;
  background: var(--accent-soft); color: var(--text);
  border: none;
  font-size: var(--fs-micro); font-weight: var(--fw-semibold);
  padding: 2px 8px; border-radius: var(--r-pill);
  margin: 0;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 96px; left: 50%; transform: translateX(-50%);
  background: var(--toast-bg); color: var(--toast-text);
  border: 2px solid var(--frame);
  padding: 12px 20px; border-radius: var(--r-md); font-size: 14px; font-weight: 700;
  z-index: 200; box-shadow: 4px 4px 0 var(--toast-shadow); max-width: 90%; text-align: center;
  /* ⚠️ toast 只負責顯示：它壓在畫面上 2.6 秒，若吃點擊就會默默擋掉底下那一下
     （2026-10-17 實測：明信片冊的「第一次打開」提示把第一下點卡片吃掉了）。 */
  pointer-events: none;
}

/* ---------- 其它 ---------- */
.error { color: var(--danger); text-align: center; margin-top: 14px; font-size: 14px; font-weight: 700; }
.empty { text-align: center; color: var(--muted); padding: 48px 0; font-size: 15px; font-weight: 600; }

@media (max-width: 430px) {
  .phone { border-radius: 0; box-shadow: none; border-left: none; border-right: none; }
  /* ⚠️ 不要再把 .tabbar 的圓角歸零：它現在是懸浮藥丸（C1），壓成方的就變成貼邊的舊導覽列。 */
  .toast { bottom: 88px; }
}

/* ── K3 名片頁／對方名片／設定頁（2026-10-01）─────────────────────────
   UI chrome 零 emoji：所有圖示一律收斂到 app.js 的 `ppIcon()`／`PP_ICONS`
   （App 端對應 `pet-app-mobile/src/components/ppIcons.tsx`）。
   ⚠️ `.pp-icon` 預設 `display:block`（那是給 flex 容器用的）—— 圖示要放進**文字流**
   （例：頁尾提示「✏︎ 點名片上的任何一項就能直接改」）時必須加 `.pp-icon--inline`，
   否則圖示會自己佔一行、文字被推到下一行。tokens.generated.css 在 style.css **之後**
   載入，所以這裡要用兩層 class 才蓋得過它（單一 class 同權重、後載入者勝）。 */
.pp-icon.pp-icon--inline { display: inline-block; vertical-align: -0.16em; margin-right: 5px; }

/* ── K3 探索頁（2026-09-30 使用者核可）────────────────────────────────
   ① 卡片是整頁唯一貼紙主角；② 背面卡＝乾淨的紙（不再露出平塗色塊）；
   ③ 佔位照片＝掌印＋說明；④ 滑卡說明移到動作鈕下方。 */
.pet-card.preview{background:var(--surface);border:2.5px solid var(--frame);box-shadow:none;}  /* 背面卡＝乾淨的紙邊：不搶主角（無偏移陰影），也不畫任何內容（子節點由 cardEl() 直接不產生） */
.swipe-hint{margin:10px 0 0;text-align:center;font-size:12px;color:var(--muted)}
.placeholder-photo{display:flex;flex-direction:column;gap:8px;align-items:center;justify-content:center;
  background:var(--surface-alt);color:var(--dot);
  background-image:radial-gradient(var(--dot) 2px,transparent 2px);background-size:20px 20px}
.placeholder-photo span{font-size:12px;color:var(--muted)}
.nearby-hint{display:flex;align-items:center;gap:6px}
.nearby-hint .pp-icon,.pet-distance .pp-icon{flex:0 0 auto}
/* 無照片卡＝核准稿 discover-k3.html 的 `.card.nophoto`：奶油紙底＋墨色字＋髮絲分隔。
   ⚠️ 沒有照片時**不得**沿用照片式的深色 scrim（`.pet-card .card-overlay` 的
   linear-gradient(transparent, var(--overlay-scrim))）：那條漸層會壓在佔位圖上佔掉半張卡，
   讀起來就是「模板灰塊」，正是 K3 要消滅的 AI 味。
   顏色一律走既有變數（--canvas／--text／--line／--surface-alt），深色模式自動跟著走；
   頂部內距收到 14px＝核准稿的「短版」紙帶（貼著內容，不必為了讓照片的漸層淡出而留 60px）。 */
.pet-card.nophoto .card-overlay{padding:14px 20px 18px;background:var(--canvas);color:var(--text);border-top:1px solid var(--line)}
/* 無照片卡的佔位區改成**一般流向**（卡片＝直的 flex、佔位 flex:1、紙帶 auto）：
   掌印與「還沒有照片」因此居中在紙帶**上方**那塊奶油紙裡，不會被紙帶蓋掉一半
   （照片卡維持絕對定位的 scrim 疊在照片上，不動）。 */
.pet-card.nophoto{display:flex;flex-direction:column}
.pet-card.nophoto .placeholder-photo{position:static;height:auto;flex:1 1 auto;min-height:0}
.pet-card.nophoto .card-overlay{position:static;flex:0 0 auto}
.pet-card.nophoto .card-overlay .fact-pill{background:var(--surface-alt);color:var(--text-soft);border-color:transparent}

/* ---------------- 全螢幕圖片檢視器（lightbox） ----------------
   2026-10-11 使用者要求：日曆照片／聊天圖片／聊天頭像／名片相簿都可以點開單獨放大來看。
   底色用 --overlay-scrim（照片在前景，背景壓暗才看得清楚）。 */
.lb {
  position: fixed;
  inset: 0;
  /* 要壓過 sheet(200) 與 modal(150)，但留在 toast(300) 之下 */
  z-index: 250;
  display: flex;
  align-items: center;
  justify-content: center;
  /* 墨黑不透明（--frame 兩色系都是深墨）：半透明的 overlay-scrim 會讓底層日期大字
     與「1/2」序號黏在一起（截圖驗收抓到），照片檢視器本來就該是墨黑底。 */
  background: var(--frame);
}
.lb[hidden] { display: none; }
.lb-backdrop { position: absolute; inset: 0; }
.lb-img {
  position: relative;
  max-width: 100vw;
  max-height: 100vh;
  object-fit: contain;
  transition: transform 0.18s ease;
}
.lb-img.lb-zoom { transform: scale(2); cursor: zoom-out; }
.lb-btn {
  position: absolute;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: var(--scrim);
  color: var(--on-action);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.lb-close { top: 16px; right: 16px; font-size: 24px; }
.lb-prev { left: 12px; top: 50%; margin-top: -20px; }
.lb-next { right: 12px; top: 50%; margin-top: -20px; }
.lb-count {
  position: absolute;
  top: 22px;
  /* 置中：左上角是底層「M / D」日期大字的位置，序號擺那裡會黏在一起。 */
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 10px;
  border-radius: 99px;
  background: var(--scrim);
  color: var(--on-action);
  font-size: 12px;
  font-weight: 700;
}
.lb-cap {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 28px;
  text-align: center;
  color: var(--on-action);
  font-size: 14px;
}


/* ---------------- 新手教學：互動式半透明遮罩 spotlight（2026-10-16 PRD §1）----------------
   舊版是「四頁靜態說明」（.onb-*），現在改成**高亮真實 UI**：一個 `position: fixed` 的
   spotlight 元素用 `box-shadow: 0 0 0 9999px rgba(0,0,0,.62)` 把四周遮暗 —— 單一元素
   （不是四個 div 拼），所以高亮區**不會被遮罩蓋住**、使用者在真實 UI 上點得到。
   ⚠️ 容器與 spotlight 都 `pointer-events: none`：只有說明卡吃點擊（第 2 步要真的點到那顆 tab）。
   ⚠️ 遮罩色用 PRD 指定的 rgba(0,0,0,.62)，不是 `--overlay-scrim`（深色模式下它是 .9，
      會把要高亮的內容一起壓暗）。
   ⚠️ 字級／圓角／陰影一律取既有 token：`scripts/audit_ai_tells.py` 在數「種類數」，
      新造一個值就是回歸（而且很可能視覺一模一樣）。 */
/* 2026-10-17：導引改成「點畫面任何位置都能前進」→ 這一層要吃點擊（hidden 時不會蓋到東西）。 */
.tour { position: fixed; inset: 0; z-index: 180; pointer-events: auto; }
.tour.hidden { display: none; }
/* 遮罩：四塊矩形（上／下／左／右），加起來恰好是全屏扣掉高亮區。
   ⚠️ 不用 `box-shadow: 0 0 0 9999px …` 撐開 —— 那會多一種陰影種類（audit R5 回歸），
   而且四塊的做法與 App 的 spotlight 完全一致（兩個介面同一套）。 */
.tour-dim {
  position: fixed; background: rgba(0, 0, 0, 0.62);
  /* ⚠️ `pointer-events` 是**繼承**屬性：`.tour` 是 none（只有說明卡吃點擊），
     所以這裡一定要明確寫 auto —— 否則四塊遮罩形同虛設（舊版就是這樣：點畫面什麼都不會發生）。
     使用者 2026-10-17：點畫面任何**非高亮**位置＝前進到下一步（最後一步＝完成），
     與右下那顆按鈕同一個動作；高亮區本身仍然是真實 UI、可以操作。 */
  pointer-events: auto; cursor: pointer;
}
.tour-spot {
  position: fixed; border-radius: var(--r-md); pointer-events: none;
  outline: 2px solid var(--primary);
}
.tour-card {
  position: fixed; left: 50%; transform: translateX(-50%);
  width: min(340px, calc(100vw - 32px));
  pointer-events: auto;
  /* 底色**抽成獨立一層**（::before：surface @ 0.92）→ 透出底下的畫面，但文字維持全不透明。
     ⚠️ 不要對整個卡片下 opacity —— 那會把文字一起弄淡（使用者 2026-10-17 明確要求，
        與 App 的做法一致：卡片本身透明底、底色是另一層）。 */
  background: transparent; border: 2px solid var(--frame);
  border-radius: var(--r-plush); box-shadow: var(--sticker-shadow);
  padding: 16px 18px;
}
.tour-card::before {
  content: ""; position: absolute; inset: 0; border-radius: var(--r-plush);
  background: var(--surface); opacity: 0.92;
}
/* 內容排在底色層之上（::before 是絕對定位的子節點，會蓋過 in-flow 的文字）。 */
.tour-card > * { position: relative; }
.tour-step { font-size: var(--fs-meta); font-weight: var(--fw-semibold); color: var(--muted); }
.tour-title {
  font-family: var(--font-display); font-size: var(--fs-title); font-weight: var(--fw-semibold);
  line-height: 1.4; margin: 4px 0 6px;
}
.tour-body { font-size: var(--fs-label); line-height: 1.7; color: var(--text-soft); margin: 0; }
.tour-actions { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.tour-skip {
  flex: 0 0 auto; padding: 10px 18px; border-radius: var(--r-pill);
  border: 1px solid var(--line); background: transparent;
  font: inherit; font-size: var(--fs-label); color: var(--muted); cursor: pointer;
}
.tour-next { flex: 1; }

/* ---------------- 明信片放大檢視 ＋ CSS 3D 翻面（2026-10-16 PRD §3）----------------
   點格子 ＝ 放大檢視（不再就地翻面）；放大後**點卡片本身**才翻面 —— 真的繞 Y 軸轉過去，
   不是瞬間切換內容。格子裡一律是靜態的一面（有照片看正面、只有文字看背面，見 app.js）。 */
.pc-detail {
  position: fixed; inset: 0; z-index: 175;
  display: flex; align-items: center; justify-content: center;
}
.pc-detail.hidden { display: none; }
.pc-detail-scrim { position: absolute; inset: 0; background: var(--overlay-scrim); }
.pc-detail-box { position: relative; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.pc-detail-date { font-size: var(--fs-label); font-weight: var(--fw-semibold); color: var(--on-action); }
.pc-detail { --pcw: min(86vw, 380px); }
.pc-flip { perspective: 1000px; width: var(--pcw); aspect-ratio: 1 / 1.16; }
.pc-flip-card {
  position: relative; width: 100%; height: 100%; cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 420ms cubic-bezier(0.4, 0, 0.2, 1);
}
.pc-flip--back .pc-flip-card { transform: rotateY(180deg); }
.pc-face {
  position: absolute; inset: 0; display: flex; flex-direction: column; gap: 4px; padding: 4px;
  background: var(--pc-paper, var(--surface)); border: 2px solid var(--frame); border-radius: var(--r-paper);
  box-shadow: var(--paper-shadow);
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
.pc-face--back { transform: rotateY(180deg); }
.pc-detail-foot { display: flex; align-items: center; gap: 12px; }
.pc-detail-hint { font-size: var(--fs-meta); color: var(--on-action); }
.pc-detail-close {
  width: 34px; height: 34px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-pill); border: 1px solid var(--line);
  background: var(--surface); color: var(--text); cursor: pointer;
}
.pc-detail-close .pp-icon { width: 16px; height: 16px; }

/* 連續紀錄（streak）＋明信片冊（2026-10-16）。值全部取 tokens.generated.css。 */
.streak-line{display:flex;align-items:center;gap:10px;padding:0 16px 8px}
.streak-num{font-size:16px;font-weight:600}
.streak-dots{display:flex;gap:4px}
.streak-dots i{width:9px;height:9px;border-radius:999px;background:var(--dot)}
.streak-dots i.on{background:var(--action)}
.streak-dots i.today{background:var(--sel)}
.streak-meta{font-size:11px;color:var(--muted)}
.streak-stickers{margin-left:auto}
.streak-grace{font-size:12px;color:var(--info);padding:0 16px 8px;margin:0}
.album-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}
.album-head h3{font-size:22px;margin:0}
.album-month{display:flex;align-items:center;gap:8px;margin-bottom:10px}
.album-month .streak-meta{margin-left:auto}
.album-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.pc{display:flex;flex-direction:column;padding:4px;background:var(--pc-paper,var(--surface));border:2px solid var(--frame);
  border-radius:var(--r-paper);box-shadow:var(--paper-shadow);aspect-ratio:105/122;text-align:left;font:inherit;cursor:pointer;}
.pc--gap{background:transparent;border:2px dashed var(--dot);box-shadow:none;align-items:center;justify-content:center;cursor:default;}
.pc--gap span{font-size:10px;color:var(--muted-weak);}
/* ── 卡內視覺（B · 郵票拼貼）──────────────────────────────────────────────────
   兩套配置＝同一套設計語言、兩組值（不是等比放大）。**數字全部來自 `js/app.js` 的
   `POSTCARD_CELL`／`POSTCARD_LARGE`**（寫成 inline style，與 App 的 PostcardArt.tsx 逐鍵相同）；
   這裡只放「長相」：底色、框線、虛線、圓角、顏色、flex 分配。
   常數（兩尺寸同一組值）：紙卡墨線 2px、紙卡內距 4px、紙卡圓角 --r-paper。
   放大版專屬裝置：齒孔（1.5px 虛線）、紙膠帶腰帶、品牌貼紙、郵戳、手擺角度。
   ⚠️ 齒孔用 dashed 不是 dotted：iOS 的邊框繪製在有圓角時會把 dotted 畫成實線，兩端要同一個長相。 */
.pc-art{position:relative;display:flex;flex-direction:column;width:100%;height:100%;overflow:hidden;}
.pc-photostamp{display:block;flex:1;min-height:0;background:var(--surface);}
.pc-perf{display:block;width:100%;height:100%;overflow:hidden;}
.pc-perf--on{border-style:dashed;border-color:var(--muted-weak);}
.pc-photo{display:block;width:100%;height:100%;object-fit:cover;border-radius:2px;background:var(--surface-alt);}
.pc-foot{display:flex;align-items:flex-end;justify-content:space-between;margin-top:3px;}
.pc-date{font-weight:400;color:var(--muted);font-variant-numeric:tabular-nums;white-space:nowrap;}
.pc-vig{border-radius:var(--r-pill);border:1.5px solid var(--frame);background:var(--surface);box-shadow:var(--shadow-sm);}
.pc-msgs{display:block;flex:1;min-height:0;color:var(--text-soft);overflow:hidden;}
.pc-line{display:block;}
.pc-msgs--cell .pc-line{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden;}
.pc-more{display:block;color:var(--muted-weak);margin-top:1px;}
/* 放大版 330×383（E 版配置） */
.pc-art--large{display:block;}
.pc-art--large>*{position:absolute;}
.pc-art--large .pc-msgs--large{height:100%;overflow-y:auto;}
.pc-msgs--large .pc-line{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:4;overflow:hidden;}
/* 品牌 watermark＝官方 Logo 原圖（不是膠囊標籤）：只留尺寸，不要底／框／陰影，
   否則又會變回使用者說「舊化」的那顆黑膠囊。 */
.pc-lock{display:block;object-fit:contain;width:auto;background:none;border:0;box-shadow:none;}
.pc-art--large .pc-date{color:var(--text-soft);font-variant-numeric:tabular-nums;}
.pc-note{background:var(--pc-note,var(--surface-alt));border:1px solid var(--pc-ink,var(--line));}
.pc-pm-ring{position:absolute;inset:0;border:1px solid var(--muted-weak);border-radius:var(--r-pill);}
.pc-pm-ring--in{inset:15%;}
.pc-pm-bar{position:absolute;height:1px;background:var(--muted-weak);}
.pc-pm-bar--1{left:4%;top:33%;width:30%;}
.pc-pm-bar--2{left:0;top:46%;width:26%;}
.pc-pm-bar--3{left:6%;top:59%;width:30%;}

/* ══════════════════════════════════════════════════════════════════════════
   個人頁 A 稿：紙帶 ＋ 拍立得（2026-10-17 使用者核可，App 與 web 同一套）
   樣板：sketches/profile-v2-2026-10-17/index.html（A 欄）
   ① 容器＝紙帶（本產品自己的紙底點格），不是圓角方塊 → 閱讀態的 .idcard 無框／無底色／無陰影
   ② 招牌動作＝拍立得（紙框＋和紙膠帶＋微傾角）；事實收成一行；編輯入口命名自己的動作
   ③ 三個數字收成一句話（三欄「大數字＋小標籤」是 hero-metric 模板，屬 craft-floor 的拒絕清單）
   ⚠️ 只作用在**自己的檔案頁**（#screen-profile）；對方名片是另一個 surface，這一輪不動。
   ⚠️ 編輯態（.idcard--editing）仍走 K3 的虛線卡 —— 欄位多，需要框。
   ══════════════════════════════════════════════════════════════════════════ */
#screen-profile .idcard:not(.idcard--editing) {
  background: none; border: 0; box-shadow: none; padding: 0; text-align: left;
}
.iband {
  position: relative; display: flex; gap: var(--sp-s5); align-items: flex-start;
  padding: var(--sp-s5) var(--sp-s4) var(--sp-s2);
  background-image: radial-gradient(var(--dot) 1px, transparent 1px); background-size: 16px 16px;
}
/* 拍立得：紙色跟主題走（不得寫死色碼），1px 髮絲框 ＋ 偏移陰影 ＝ 一張實體照片放在紙帶上。 */
.iband .idcard-ava {
  position: relative; flex: 0 0 auto; width: 128px; height: 142px;
  padding: 7px 7px 26px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-paper);
  box-shadow: var(--sticker-shadow); transform: rotate(-1.5deg);
}
.iband .idcard-ava img { width: 112px; height: 112px; object-fit: cover; display: block; border-radius: 0; }
.iband .idcard-ava .pp-icon { width: 40px; height: 40px; color: var(--primary); }
/* 和紙膠帶：壓在拍立得上緣（負 top 安全 —— .iband 沒有 overflow:hidden）。 */
.tape {
  position: absolute; top: -10px; left: 20px; width: 56px; height: 16px;
  background: var(--tape); transform: rotate(-8deg);
}
.iid { flex: 1; padding-top: 12px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
#screen-profile .idcard-name { margin: 0; text-align: left; }
.idcard-meta { margin: 0; font-size: var(--fs-meta); font-weight: var(--fw-semibold); color: var(--muted); }
/* 編輯入口：**命名自己的動作**（不是說明句），44px 可點。 */
#screen-profile .idcard-foot {
  display: inline-flex; align-items: center; height: 44px; padding: 0 16px; margin-top: 4px;
  border: 1px solid var(--line); border-radius: var(--r-pill);
  color: var(--text); font-weight: var(--fw-semibold);
}
#screen-profile .idcard-foot .pp-icon { width: 15px; height: 15px; }
/* 手帳的撕線：虛線髮絲線（不是漸層 —— 專案禁止新增漸層種類）。 */
.perf { height: 0; border-top: 1px dashed var(--line); margin-top: var(--sp-s2); }
#screen-profile .idcard-bio {
  margin: 18px 0 0; padding: 0; border: 0; text-align: left;
  font-size: var(--fs-body); line-height: 26px;
}
/* 三個數字：一句話（數字用色階＋字重站出來，不用 800 —— 那會讓稽核的 R3 更糟）。 */
.psummary { margin: var(--sp-s5) 0 0; font-size: var(--fs-label); font-weight: var(--fw-semibold); color: var(--muted); }
.psummary b { color: var(--text); font-weight: var(--fw-semibold); }

/* 精選＝郵票圈：細圓環 ＋ 環與圓之間 2px 空隙（padding ＋ background-clip）。
   兩個頁面（自己／對方）共用同一個圓，所以改在這裡、不要兩份。 */
.phl-cir {
  width: 56px; height: 56px; padding: 2px;
  border: 1px solid var(--line); background-clip: content-box;
}

/* ── 一個刻意時刻（impeccable · animate）：抵達曲線 cubic-bezier(.16,1,.3,1) ──────────
   只有紙帶與名字兩拍；`pp_arrive`（sessionStorage）讓它一個 session 只播一次。
   ⚠️ 減少動態只留透明度 —— 位移與縮放一律不做（不是把所有動態關掉）。 */
@keyframes pp-arrive { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes pp-arrive-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pp-arrive-fade { from { opacity: 0; } to { opacity: 1; } }
.pp-arrive { animation: pp-arrive 420ms cubic-bezier(0.16, 1, 0.3, 1) both; }
.pp-arrive-rise { animation: pp-arrive-rise 300ms cubic-bezier(0.16, 1, 0.3, 1) 60ms both; }
@media (prefers-reduced-motion: reduce) {
  .pp-arrive, .pp-arrive-rise { animation: pp-arrive-fade 150ms linear both; }
}

/* ── 好友動態（Build 27）── */
.feed-list{display:flex;flex-direction:column;gap:12px;padding:4px 16px 96px;}
.feed-card{display:flex;flex-direction:column;gap:8px;text-align:left;background:var(--surface);border-radius:18px;padding:12px;border:0;cursor:pointer;font:inherit;color:inherit;}
.feed-head{display:flex;align-items:center;gap:8px;}
.feed-ava{width:36px;height:36px;border-radius:50%;object-fit:cover;background:var(--surface-alt);flex:none;}
.feed-ava--empty{display:block;}
.feed-who{display:flex;flex-direction:column;flex:1;min-width:0;}
.feed-who b{font-size:15px;color:var(--text);font-weight:600;}
.feed-who i{font-style:normal;font-size:12px;color:var(--muted);}
.feed-date{font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums;}
.feed-photo{width:100%;aspect-ratio:4/3;object-fit:cover;border-radius:12px;background:var(--surface-alt);}
.feed-caption{font-size:14px;line-height:1.45;color:var(--text);}

/* ============ 官方公告（2026-11）：置頂橫幅 + 全文閱讀 ============ */
.announcement-banner-host{
  position:sticky;top:0;z-index:40;
  display:flex;align-items:stretch;gap:0;
  margin:0 16px 8px;
}
.announcement-banner{
  flex:1;display:flex;align-items:center;gap:7px;
  min-height:36px;padding:6px 10px;
  border:1px solid var(--line);border-radius:var(--r-sm,8px) 0 0 var(--r-sm,8px);
  background:var(--tape);cursor:pointer;
}
.announcement-tag{background:var(--frame);color:var(--on-action);font-size:10px;font-weight:700;border-radius:4px;padding:1px 5px;flex:none;}
.announcement-title{flex:1;font-size:12.5px;font-weight:700;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.announcement-chevron{color:var(--text);opacity:.7;font-size:14px;flex:none;}
.announcement-close{
  background:var(--tape);border:1px solid var(--line);border-left:none;
  border-radius:0 var(--r-sm,8px) var(--r-sm,8px) 0;color:var(--text);
  font-size:14px;width:34px;min-height:36px;cursor:pointer;flex:none;
}
.announcement-view{padding:0 16px 24px;}
.announcement-langs{display:flex;gap:8px;margin-bottom:14px;}
.announcement-lang{min-height:34px;padding:0 14px;border-radius:999px;border:1px solid var(--line);background:var(--surface);color:var(--text-soft);font-size:12.5px;font-weight:600;cursor:pointer;}
.announcement-lang.on{background:var(--sel);border-color:var(--sel);color:var(--on-sel);font-weight:700;}
.announcement-title-lg{font-size:22px;font-weight:700;color:var(--text);line-height:1.4;margin:0 0 12px;}
.announcement-body{font-size:15px;line-height:1.65;color:var(--text-soft);white-space:pre-wrap;}

/* ============ 編輯個人資料（2026-11）============ */
.uprofile{padding:0 16px 24px;}
.uprofile-avatar{position:relative;width:88px;height:88px;border-radius:50%;background:var(--surface-alt);margin:4px auto 20px;display:flex;align-items:center;justify-content:center;cursor:pointer;overflow:hidden;}
.uprofile-avatar img{width:100%;height:100%;object-fit:cover;}
.uprofile-cam{position:absolute;right:-2px;bottom:-2px;width:28px;height:28px;border-radius:50%;background:var(--action);color:var(--on-action);display:flex;align-items:center;justify-content:center;border:2px solid var(--canvas);}
.uprofile .fld{margin-bottom:14px;}
.uprofile .fld textarea{min-height:72px;resize:vertical;}
