/* 2026-11-18 姐姐機：底部 Tab（聊天／肥魚狀態／我的） */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  background: rgba(255, 255, 255, .96);
  border-top: 1px solid #e3e9f4;
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 9999;
  backdrop-filter: blur(8px);
}
.tabbar button {
  flex: 1;
  border: 0;
  background: none;
  padding: 10px 0 8px;
  font-size: 12px;
  color: #7b8798;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
}
.tabbar button .ti { font-size: 18px; line-height: 1; }
.tabbar button.active { color: #2f6fed; font-weight: 600; }
.tabbar button:disabled { opacity: .45; }

body.has-tabbar .app-view { height: calc(100% - 56px); box-sizing: border-box; }
/* 任何情況都顯示，避免進聊天後找不到 Tab */

.tab-page {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: #f5f8fd;
  overflow-y: auto;
  padding: 16px 16px 90px;
  display: none;
}
.tab-page.show { display: block; }
.tab-page h2 {
  font-size: 18px;
  margin: 6px 0 14px;
  color: #1f2a3d;
}
.tab-page .card {
  background: #fff;
  border: 1px solid #e3e9f4;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
}
.tab-page .card h3 {
  font-size: 14px;
  margin: 0 0 10px;
  color: #4a5a72;
  font-weight: 600;
}
.tab-page .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px dashed #eef2f9;
  font-size: 14px;
  color: #26324a;
}
.tab-page .row:last-child { border-bottom: 0; }
.tab-page .muted { color: #8b95a5; font-size: 12px; }
.tab-page .mem {
  font-size: 13px;
  line-height: 1.55;
  color: #2b3750;
  padding: 8px 0;
  border-bottom: 1px dashed #eef2f9;
}
.tab-page .mem:last-child { border-bottom: 0; }
.tab-page .pill {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef3ff;
  color: #2f6fed;
  margin-right: 6px;
}
.tab-page input[type="text"],
.tab-page input[type="time"] {
  border: 1px solid #dbe3f0;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 14px;
  width: 100%;
  box-sizing: border-box;
}
.tab-page .btn {
  border: 0;
  border-radius: 10px;
  padding: 9px 14px;
  background: #2f6fed;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}
.tab-page .btn.ghost {
  background: #eef3ff;
  color: #2f6fed;
}
.tab-page .btn.warn {
  background: #fff1f0;
  color: #d4380d;
}
.tab-page .switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #4a5a72;
}

/* Tab 高度留白：整個 app 區塊往上縮，輸入列貼齊 Tab 上緣 */

/* 肥魚狀態：兩張卡 */
.fish-cards { display: flex; flex-direction: column; gap: 12px; }
.fish-card {
  display: flex; align-items: center; gap: 14px;
  background: #fff; border: 1px solid #e3e9f4; border-radius: 16px;
  padding: 14px; cursor: pointer; text-align: left; width: 100%;
  box-shadow: 0 6px 18px rgba(46, 78, 140, .06);
}
.fish-card:active { transform: scale(.99); }
.fish-avatar { width: 54px; height: 54px; border-radius: 50%; object-fit: cover; background: #eef3ff; }
.fish-avatar.big { width: 64px; height: 64px; }
.fish-info { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.fish-info strong { font-size: 16px; color: #1f2a3d; }
.fish-state { font-size: 12px; color: #7b8798; }
.fish-arrow { font-size: 22px; color: #b9c4d6; }
.fish-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.fish-head .btn { flex: 0 0 auto; }
/* 我的：個人卡與選單 */
.me-head {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(135deg, #ffffff, #f2f7ff);
  border: 1px solid #e3e9f4; border-radius: 18px;
  padding: 18px 16px; margin-bottom: 14px;
}
.me-avatar {
  width: 62px; height: 62px; border-radius: 50%; object-fit: cover;
  background: #eaf1ff; display: grid; place-items: center;
  font-size: 22px; color: #2f6fed; font-weight: 600;
}
.me-head-info { display: flex; flex-direction: column; gap: 4px; }
.me-head-info strong { font-size: 19px; color: #1b2436; }
.me-role { font-size: 12px; color: #2f6fed; background: #eaf1ff; border-radius: 999px; padding: 2px 9px; align-self: flex-start; }
.me-id { font-size: 11px; color: #9aa6b9; }
.me-list { background: #fff; border: 1px solid #e3e9f4; border-radius: 16px; overflow: hidden; }
.me-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 15px 16px; background: #fff; border: 0; border-bottom: 1px solid #f0f4fa;
  font-size: 15px; color: #1f2a3d; text-align: left; cursor: pointer;
}
.me-item:last-child { border-bottom: 0; }
.me-item:active { background: #f7faff; }
.me-item-label { flex: 1; }
.me-item-hint { font-size: 12px; color: #9aa6b9; }
.chev { color: #c3cde0; font-size: 18px; }
.me-out { margin-top: 18px; }
.sub-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.sub-head strong { font-size: 16px; color: #1f2a3d; }
/* 按鈕與上方卡片同寬（登出、儲存…） */
.me-out .btn {
  display: block; width: 100%; padding: 14px 16px; border-radius: 14px;
  font-size: 15px; text-align: center;
}
.tab-page .card .btn {
  display: block; width: 100%; padding: 12px 16px; border-radius: 12px;
  font-size: 14px; text-align: center;
}
.sub-head .btn { display: inline-block; width: auto; padding: 8px 14px; }
/* 個人資料編輯 */
.avatar-edit { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.avatar-edit .me-avatar { width: 72px; height: 72px; font-size: 26px; }
.avatar-edit .btn { width: auto !important; display: inline-block !important; }
.field-label { font-size: 12px; color: #7b8798; margin: 12px 0 6px; }
/* 記憶修正按鈕 */
.mem-acts { display: flex; gap: 8px; margin-top: 6px; }
.mini-btn {
  border: 1px solid #dbe6fb; background: #f4f8ff; color: #2f6fed;
  border-radius: 999px; padding: 3px 10px; font-size: 12px; cursor: pointer;
}
.mini-btn.warn { border-color: #ffd9d0; background: #fff5f2; color: #d4380d; }
/* 子頁標題列：左箭頭、標題置中 */
.sub-head {
  position: relative; display: flex; align-items: center; justify-content: center;
  height: 48px; margin-bottom: 12px;
}
.sub-head .icon-back {
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border: 0; background: transparent;
  font-size: 26px; line-height: 1; color: #2f6fed; cursor: pointer;
}
.sub-head .sub-title {
  font-size: 17px; color: #1f2a3d; font-weight: 600; text-align: center;
}
/* 頁面大標題置中 */
.tab-page .page-title {
  text-align: center; font-size: 18px; margin: 4px 0 14px; color: #1f2a3d;
}
/* 肥魚詳情：頭像卡（不當標題列用） */
.fish-card-static {
  display: flex; align-items: center; gap: 14px; background: #fff;
  border: 1px solid #e3e9f4; border-radius: 16px; padding: 16px; margin-bottom: 12px;
}
/* 行程可點開看她的記憶 */
.row-btn { width: 100%; background: none; border: 0; border-bottom: 1px dashed #eef2f9; cursor: pointer; text-align: left; }
.row-btn:active { background: #f7faff; }
.event-mem {
  font-size: 13px; line-height: 1.6; color: #4a5a72;
  background: #f7faff; border-left: 3px solid #cfe0ff;
  padding: 8px 10px; margin: 4px 0 8px; border-radius: 8px;
}
.event-mem.hidden { display: none; }
/* 記憶卡片：乾淨的分區 */
.mem-card {
  border: 1px solid #eef2f9; border-radius: 12px; padding: 10px 12px;
  margin-bottom: 10px; background: #fff;
}
.mem-top { display: flex; gap: 6px; margin-bottom: 6px; }
.mem-tag {
  font-size: 11px; color: #6b7a91; background: #f2f5fa;
  border-radius: 6px; padding: 1px 7px;
}
.mem-pin {
  font-size: 11px; color: #d48806; background: #fff7e6;
  border-radius: 6px; padding: 1px 7px;
}
.mem-text {
  font-size: 13.5px; line-height: 1.6; color: #26324a; cursor: pointer;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}
.mem-card.open .mem-text { -webkit-line-clamp: unset; overflow: visible; }
.mem-acts { display: flex; gap: 8px; margin-top: 8px; }
/* 舊的側欄個人列：一律隱藏（已搬到「設定」） */
#profileBtn { display: none !important; }
/* 手機：聊天面板（fixed 全螢幕）留出底部 Tab 的高度，否則輸入列被蓋住 */
@media (max-width: 800px) {
  body.has-tabbar .chat-pane {
    bottom: 56px !important;
    padding-bottom: 0 !important;
  }
}