/* ============================================
   MaoRouRou 毛絨絨 - UI Design v3
   Style: Neumorphic / Soft Light / Premium
   Palette: #EFF2F9 base, orange accent
   Shadows: Dual-layer (light + dark)
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@300;400;500;700;900&display=swap');

:root {
  /* Neumorphic 色票 */
  --bg: #EFF2F9;
  --bg-light: #F5F7FC;
  --bg-dark: #E4EBF1;

  --surface: #EFF2F9;
  --surface-raised: #F2F5FB;
  --surface-sunken: #E4E8F0;

  /* 強調色 */
  --primary: #F97316;
  --primary-dark: #EA580C;
  --primary-light: #FFF7ED;
  --primary-glow: rgba(249, 115, 22, 0.2);

  --accent-warm: #FDBA74;
  --accent-cool: #6E7F8D;

  --danger: #EF4444;
  --success: #22C55E;
  --warning: #F59E0B;

  /* 文字 */
  --text: #2D3748;
  --text-secondary: #6E7F8D;
  --text-light: #B5BFC6;
  --text-muted: #CBD5E0;

  /* Neumorphic 陰影 */
  --shadow-light: #FAFBFF;
  --shadow-dark: rgba(22, 27, 29, 0.12);

  --neu-raised:
    -5px -5px 10px var(--shadow-light),
    5px 5px 10px var(--shadow-dark);
  --neu-raised-sm:
    -3px -3px 6px var(--shadow-light),
    3px 3px 6px var(--shadow-dark);
  --neu-raised-lg:
    -10px -10px 20px var(--shadow-light),
    10px 10px 20px var(--shadow-dark);
  --neu-inset:
    inset -3px -3px 6px var(--shadow-light),
    inset 3px 3px 6px var(--shadow-dark);
  --neu-inset-sm:
    inset -2px -2px 4px var(--shadow-light),
    inset 2px 2px 4px var(--shadow-dark);
  --neu-flat:
    -2px -2px 5px var(--shadow-light),
    2px 2px 5px rgba(22, 27, 29, 0.08);

  /* 圓角 */
  --radius-xs: 10px;
  --radius-sm: 14px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-pill: 50px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: "Noto Sans TC", -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", sans-serif;
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding-bottom: 100px;
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0.01em;
}

/* ===== 底部導航 ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg);
  border-top: none;
  display: flex;
  justify-content: space-around;
  padding: 8px 12px 12px;
  z-index: 1000;
  box-shadow:
    0 -4px 12px rgba(22, 27, 29, 0.04),
    0 -1px 0 var(--bg-dark);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 7px;
  border: none;
  background: none;
  color: var(--text-light);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.3s ease;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  border-radius: var(--radius-sm);
}

.nav-item.active {
  color: var(--primary);
  background: var(--surface-raised);
  box-shadow:
    -3px -3px 6px rgba(255,255,255,0.8),
    3px 3px 8px rgba(22,27,29,0.1),
    0 0 16px rgba(249,115,22,0.35),
    0 0 32px rgba(249,115,22,0.15),
    0 0 48px rgba(249,115,22,0.06);
}

.nav-item.active svg {
  filter: drop-shadow(0 0 6px rgba(249,115,22,0.5));
}

.nav-item svg {
  width: 22px;
  height: 22px;
  transition: transform 0.2s ease;
}

.nav-item:active {
  box-shadow: var(--neu-inset-sm);
}

.nav-item:active svg {
  transform: scale(0.92);
}

/* ===== 頁面容器 ===== */
.page {
  display: none;
  padding: 16px 20px;
  max-width: 480px;
  margin: 0 auto;
}

.page.active {
  display: block;
  animation: pageIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Logo Header ===== */
.logo-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  margin-bottom: 16px;
}

.logo-header img {
  width: 74px;
  height: 74px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.08));
}

.logo-header .logo-text {
  display: none;
}

.header-login-btn,
.header-avatar-btn {
  margin-left: auto;
  background: var(--surface-raised);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--neu-raised-sm);
  transition: box-shadow 0.2s;
  padding: 0;
  overflow: hidden;
}
.header-login-btn:active,
.header-avatar-btn:active {
  box-shadow: inset 2px 2px 4px var(--shadow-dark), inset -2px -2px 4px var(--shadow-light);
}
#header-avatar-inner { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
#header-avatar-inner img,
#header-avatar-inner > div { width: 32px !important; height: 32px !important; border-radius: 50%; }

/* 頭像浮動資訊卡 */
.logo-header { position: relative; }
.header-avatar-popover {
  position: absolute;
  top: 44px;
  right: 0;
  width: 240px;
  background: var(--surface-raised);
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12), var(--neu-raised-sm);
  padding: 20px 16px;
  z-index: 5000;
  opacity: 0;
  transform: translateY(-8px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  text-align: center;
}
.header-avatar-popover.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.header-popover-avatar {
  width: 52px; height: 52px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FFF7ED, #FDBA74);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.header-popover-avatar img,
.header-popover-avatar > div { width: 52px !important; height: 52px !important; border-radius: 50%; }
.header-popover-name { font-size: 14px; font-weight: 700; color: var(--text-primary); margin-bottom: 2px; }
.header-popover-email { font-size: 11px; color: var(--text-secondary); margin-bottom: 8px; word-break: break-all; }
.header-popover-divider { height: 1px; background: var(--shadow-light); margin: 8px 0; }
.header-popover-label { font-size: 10px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.header-popover-subid {
  font-size: 14px; font-weight: 700; font-family: monospace;
  color: var(--primary); letter-spacing: 0.5px;
  background: var(--bg);
  border-radius: 8px;
  padding: 6px 10px;
  box-shadow: inset 1px 1px 3px var(--shadow-dark), inset -1px -1px 3px var(--shadow-light);
}
.header-popover-action {
  margin-top: 10px;
  width: 100%;
  padding: 8px;
  border: none;
  border-radius: 10px;
  background: var(--primary);
  color: white;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--neu-raised-sm);
}
.header-popover-action:active { opacity: 0.85; }
.header-popover-apple {
  margin-top: 6px;
  background: #000;
  color: #fff;
  font-size: 13px;
}
.header-popover-apple:active { opacity: 0.85; }

/* ===== 頂部標題 ===== */
.page-header {
  text-align: left;
  padding: 8px 0 20px;
}

.page-header.with-icon {
  display: flex;
  align-items: center;
  gap: 14px;
}

.page-header h1 {
  font-size: 26px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.page-header p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
  font-weight: 400;
}

/* Header Glass Icon */
.header-icon.glass-icon {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.55) 0%,
    rgba(255, 255, 255, 0.2) 40%,
    rgba(249, 115, 22, 0.06) 100%
  );
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  box-shadow:
    -3px -3px 6px rgba(255, 255, 255, 0.8),
    3px 3px 8px rgba(22, 27, 29, 0.08),
    inset 0 1px 1px rgba(255, 255, 255, 0.9),
    inset 0 -1px 2px rgba(0, 0, 0, 0.03);
  position: relative;
  overflow: hidden;
}

.header-icon.glass-icon::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.6) 0%,
    transparent 60%
  );
  border-radius: inherit;
  pointer-events: none;
}

.header-icon.glass-icon svg {
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 1px 2px rgba(249, 115, 22, 0.15));
}

/* ===== Hero Card ===== */
.hero-card {
  background: var(--surface-raised);
  border-radius: var(--radius-xl);
  padding: 24px 20px 24px;
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--neu-raised-lg);
}

.hero-card::before {
  content: "";
  position: absolute;
  top: -60px;
  right: -60px;
  width: 200px;
  height: 200px;
  background: var(--primary);
  border-radius: 50%;
  opacity: 0.07;
  filter: blur(10px);
}

.hero-card::after {
  content: "";
  position: absolute;
  bottom: -40px;
  left: -40px;
  width: 120px;
  height: 120px;
  background: var(--primary);
  border-radius: 50%;
  opacity: 0.04;
  filter: blur(8px);
}

.hero-title {
  font-size: 32px;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -0.04em;
  color: var(--text);
  margin-bottom: 8px;
}

.hero-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 14px;
  font-weight: 400;
}

/* ===== Floating Badge ===== */
.floating-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-raised);
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  box-shadow: var(--neu-raised-sm);
}

.floating-badge .badge-icon {
  font-size: 13px;
}

/* ===== 卡片（Neumorphic） ===== */
.card {
  background: var(--surface-raised);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 14px;
  border: none;
  box-shadow: var(--neu-raised);
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: var(--neu-raised-lg);
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.card-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 400;
}

/* ===== 標籤 ===== */
.badge {
  display: inline-block;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  box-shadow: var(--neu-flat);
}

.badge-success {
  background: linear-gradient(135deg, #E8FAF0, #D1FAE5);
  color: #16A34A;
}

.badge-warning {
  background: linear-gradient(135deg, #FFF8E1, #FEF3C7);
  color: #D97706;
}

.badge-danger {
  background: linear-gradient(135deg, #FEE8E8, #FEE2E2);
  color: #DC2626;
}

.badge-info {
  background: linear-gradient(135deg, #FFF7ED, #FFEDD5);
  color: var(--primary-dark);
}

/* ===== 按鈕（Neumorphic） ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 13px 28px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  -webkit-tap-highlight-color: transparent;
  letter-spacing: 0.01em;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(145deg, #FB923C, #EA580C);
  color: #FFFFFF;
  box-shadow:
    -3px -3px 6px var(--shadow-light),
    3px 3px 6px rgba(234, 88, 12, 0.25),
    0 0 16px var(--primary-glow);
  text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

.btn-primary:hover {
  background: linear-gradient(145deg, #F97316, #DC5F09);
  box-shadow:
    -3px -3px 8px var(--shadow-light),
    4px 4px 10px rgba(234, 88, 12, 0.3),
    0 0 24px var(--primary-glow);
  transform: translateY(-1px);
}

.btn-primary:active {
  box-shadow:
    inset -2px -2px 4px rgba(255,255,255,0.2),
    inset 2px 2px 4px rgba(0,0,0,0.15);
  transform: scale(0.97);
}

.btn-outline {
  background: var(--surface-raised);
  color: var(--text-secondary);
  box-shadow: var(--neu-raised-sm);
}

.btn-outline:hover {
  color: var(--primary);
  box-shadow: var(--neu-raised);
}

.btn-outline:active {
  box-shadow: var(--neu-inset-sm);
}

.btn-danger {
  background: linear-gradient(145deg, #F87171, #DC2626);
  color: white;
  box-shadow:
    -3px -3px 6px var(--shadow-light),
    3px 3px 6px rgba(239, 68, 68, 0.25);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 9px 18px;
  font-size: 12px;
  border-radius: var(--radius-xs);
}

/* ===== 統計數字區 ===== */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.stat-item {
  text-align: center;
  padding: 18px 8px;
  background: var(--surface-raised);
  border-radius: var(--radius-md);
  box-shadow: var(--neu-raised-sm);
}

.stat-number {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.stat-number.primary { color: var(--primary); }
.stat-number.success { color: var(--success); }
.stat-number.warning { color: var(--warning); }

.stat-label {
  font-size: 10px;
  color: var(--text-secondary);
  margin-top: 4px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ===== 功能格子 ===== */
.feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.feature-card {
  background: var(--surface-raised);
  border: none;
  border-radius: var(--radius-md);
  padding: 24px 16px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--neu-raised);
  position: relative;
  overflow: hidden;
}

.feature-card:active {
  box-shadow: var(--neu-inset);
  transform: scale(0.98);
}

.feature-card:hover {
  box-shadow: var(--neu-raised-lg);
}

.feature-card .feature-icon {
  width: 58px;
  height: 58px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin: 0 auto 14px;
}

/* Glassmorphic icon */
.feature-card .feature-icon.glass-icon {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.5) 0%,
    rgba(255, 255, 255, 0.2) 40%,
    rgba(249, 115, 22, 0.06) 100%
  );
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  box-shadow:
    -3px -3px 6px rgba(255, 255, 255, 0.8),
    3px 3px 8px rgba(22, 27, 29, 0.08),
    inset 0 1px 1px rgba(255, 255, 255, 0.9),
    inset 0 -1px 2px rgba(0, 0, 0, 0.03);
  position: relative;
  overflow: hidden;
}

.feature-card .feature-icon.glass-icon::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.6) 0%,
    transparent 60%
  );
  border-radius: inherit;
  pointer-events: none;
}

.feature-card .feature-icon.glass-icon svg {
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 1px 2px rgba(249, 115, 22, 0.15));
}

.feature-card:hover .feature-icon.glass-icon {
  border-color: rgba(249, 115, 22, 0.25);
  box-shadow:
    -3px -3px 8px rgba(255, 255, 255, 0.9),
    4px 4px 10px rgba(22, 27, 29, 0.1),
    inset 0 1px 1px rgba(255, 255, 255, 0.9),
    0 0 16px rgba(249, 115, 22, 0.08);
}

.feature-card .feature-icon.orange { background: linear-gradient(135deg, #FFF7ED, #FFEDD5); }
.feature-card .feature-icon.green { background: linear-gradient(135deg, #F0FDF4, #DCFCE7); }
.feature-card .feature-icon.blue { background: linear-gradient(135deg, #EFF6FF, #DBEAFE); }
.feature-card .feature-icon.purple { background: linear-gradient(135deg, #FAF5FF, #F3E8FF); }

.feature-card .feature-name {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text);
}

.feature-card .feature-desc {
  font-size: 11px;
  color: var(--text-secondary);
}

/* ===== 寵物照片展示 ===== */
.pet-photo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}

.pet-photo-item {
  border-radius: var(--radius-lg);
  overflow: hidden;
  height: 160px;
  position: relative;
  background: var(--surface-raised);
  box-shadow: var(--neu-raised);
}

.pet-photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.pet-photo-item:hover img {
  transform: scale(1.06);
}

.pet-photo-label {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(239, 242, 249, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius-pill);
  padding: 5px 14px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  box-shadow: var(--neu-flat);
}

/* ===== 表單（Neumorphic Input）===== */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

.form-select, .form-input {
  width: 100%;
  padding: 13px 16px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text);
  background: var(--surface-raised);
  box-shadow: var(--neu-inset);
  appearance: none;
  -webkit-appearance: none;
  transition: all 0.25s ease;
  font-family: inherit;
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236E7F8D' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

.form-select:focus, .form-input:focus {
  outline: none;
  box-shadow:
    var(--neu-inset),
    0 0 0 3px var(--primary-glow);
}

/* ===== 補助金額 ===== */
.amount-display {
  font-size: 26px;
  font-weight: 900;
  color: var(--primary);
  letter-spacing: -0.03em;
}

.amount-display small {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 400;
}

/* ===== 需求清單 ===== */
.requirement-list {
  list-style: none;
  padding: 0;
}

.requirement-list li {
  padding: 7px 0;
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.requirement-list li::before {
  content: "";
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #E8FAF0, #D1FAE5);
  flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2316A34A' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  box-shadow: var(--neu-flat);
}

/* ===== 保險對照表 ===== */
.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.compare-table th {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 2px solid var(--bg-dark);
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.compare-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--bg-dark);
}

.compare-table tr:last-child td {
  border-bottom: none;
}

/* ===== AI 聊天介面 ===== */
.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 170px);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
  scroll-behavior: smooth;
}

.chat-bubble {
  max-width: 85%;
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
  font-size: 14px;
  line-height: 1.7;
  word-wrap: break-word;
}

.chat-bubble.assistant {
  background: var(--surface-raised);
  box-shadow: var(--neu-raised-sm);
  border-bottom-left-radius: 6px;
  align-self: flex-start;
  color: var(--text);
}

.chat-bubble.user {
  background: linear-gradient(145deg, #FB923C, #EA580C);
  color: #FFFFFF;
  border-bottom-right-radius: 6px;
  align-self: flex-end;
  margin-left: auto;
  box-shadow:
    3px 3px 8px rgba(234, 88, 12, 0.2),
    -2px -2px 6px var(--shadow-light);
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.chat-bubble.emergency {
  background: linear-gradient(135deg, #FEE8E8, #FEE2E2);
  border: 2px solid var(--danger);
  border-bottom-left-radius: 6px;
  box-shadow:
    0 0 16px rgba(239, 68, 68, 0.15),
    var(--neu-raised-sm);
}

.chat-input-area {
  display: flex;
  gap: 10px;
  padding: 14px 0;
}

.chat-input {
  flex: 1;
  padding: 13px 20px;
  border: none;
  border-radius: var(--radius-pill);
  font-size: 14px;
  outline: none;
  transition: all 0.25s ease;
  background: var(--surface-raised);
  box-shadow: var(--neu-inset);
  font-family: inherit;
  color: var(--text);
}

.chat-input:focus {
  box-shadow:
    var(--neu-inset),
    0 0 0 3px var(--primary-glow);
}

.chat-input::placeholder {
  color: var(--text-light);
}

.chat-send-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(145deg, #FB923C, #EA580C);
  border: none;
  color: #FFFFFF;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.25s ease;
  box-shadow:
    -3px -3px 6px var(--shadow-light),
    3px 3px 6px rgba(234, 88, 12, 0.2),
    0 0 12px var(--primary-glow);
}

.chat-send-btn:hover {
  box-shadow:
    -3px -3px 8px var(--shadow-light),
    4px 4px 10px rgba(234, 88, 12, 0.3),
    0 0 20px var(--primary-glow);
  transform: scale(1.05);
}

.chat-send-btn:active {
  box-shadow:
    inset -2px -2px 4px rgba(255,255,255,0.2),
    inset 2px 2px 4px rgba(0,0,0,0.15);
  transform: scale(0.95);
}

/* ===== 快捷按鈕（Pill） ===== */
.quick-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0;
}

.quick-action-btn {
  padding: 9px 18px;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--surface-raised);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: var(--neu-raised-sm);
  font-family: inherit;
}

.quick-action-btn:hover {
  color: var(--primary);
  box-shadow: var(--neu-raised);
}

.quick-action-btn:active {
  box-shadow: var(--neu-inset-sm);
  transform: scale(0.97);
}

/* ===== 免責聲明 ===== */
.disclaimer {
  background: var(--surface-raised);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 11px;
  color: var(--text-secondary);
  margin: 16px 0;
  line-height: 1.7;
  box-shadow: var(--neu-flat);
}

/* ===== 來源連結 ===== */
.source-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  margin-top: 8px;
  transition: all 0.2s;
}

.source-link:hover {
  color: var(--primary-dark);
  text-shadow: 0 0 8px var(--primary-glow);
}

/* ===== 更新時間 ===== */
.update-time {
  font-size: 10px;
  color: var(--text-light);
  margin-top: 10px;
}

/* ===== 保險篩選標籤 ===== */
.ins-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ins-chip {
  padding: 7px 16px;
  border-radius: 20px;
  border: none;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  background: var(--surface-raised);
  color: var(--text-light);
  box-shadow:
    -2px -2px 4px rgba(255,255,255,0.8),
    2px 2px 6px rgba(22,27,29,0.08);
  transition: all 0.25s ease;
}
.ins-chip.active {
  background: linear-gradient(135deg, #F97316, #FB923C);
  color: white;
  box-shadow: 0 2px 8px rgba(249,115,22,0.3);
}
.ins-no-results {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-light);
  font-size: 14px;
}

/* ===== 保險警語 ===== */
/* 保險警語方塊 - 浮凸橘色光暈 */
.insurance-warning {
  margin-top: 14px;
  padding: 14px 16px;
  background: var(--surface-raised);
  border: 1.5px solid rgba(255,255,255,0.6);
  border-radius: 14px;
  box-shadow:
    -3px -3px 6px rgba(255,255,255,0.8),
    3px 3px 8px rgba(22,27,29,0.08),
    0 0 12px rgba(249,115,22,0.2),
    0 0 24px rgba(249,115,22,0.08);
}

.insurance-warning p {
  font-size: 12px;
  color: #c2650f;
  line-height: 1.7;
  margin: 0;
}

.insurance-warning p strong {
  color: var(--primary);
}

/* ===== 通知提示 ===== */
.data-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--surface-raised);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 14px;
  box-shadow: var(--neu-flat);
}

/* 玻璃質感 (i) 圖示 */
span.glass-info-icon {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 26px !important;
  height: 26px !important;
  min-width: 26px !important;
  border-radius: 7px;
  background: linear-gradient(
    135deg,
    rgba(255,255,255,0.55) 0%,
    rgba(255,255,255,0.2) 40%,
    rgba(249,115,22,0.06) 100%
  );
  border: 1.5px solid rgba(255,255,255,0.6);
  box-shadow:
    -2px -2px 4px rgba(255,255,255,0.8),
    2px 2px 6px rgba(22,27,29,0.08),
    inset 0 1px 1px rgba(255,255,255,0.9);
  flex-shrink: 0 !important;
}

span.glass-info-icon svg {
  width: 14px !important;
  height: 14px !important;
  min-width: 14px !important;
  flex-shrink: 0;
  display: block;
}

.data-notice .notice-icon {
  flex-shrink: 0;
  font-size: 14px;
}

/* ===== EULA 彈窗 ===== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(200, 210, 225, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 20px 0;
  padding: 24px;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: var(--surface-raised);
  border-radius: var(--radius-xl);
  padding: 28px 24px;
  max-width: 400px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: var(--neu-raised-lg);
  animation: modalIn 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.94) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-content h2 {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 16px;
  color: var(--text);
}

.modal-content p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 12px;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  cursor: pointer;
  margin: 20px 0;
  line-height: 1.5;
  color: var(--text);
}

.checkbox-label input[type="checkbox"] {
  margin-top: 2px;
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  flex-shrink: 0;
}

/* ===== 緊急按鈕 ===== */
.emergency-btn {
  display: block;
  width: 100%;
  padding: 16px;
  background: linear-gradient(145deg, #F87171, #DC2626);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 10px;
  animation: emergencyPulse 2s infinite;
  box-shadow:
    -3px -3px 6px var(--shadow-light),
    3px 3px 6px rgba(239, 68, 68, 0.3),
    0 0 20px rgba(239, 68, 68, 0.2);
  font-family: inherit;
}

@keyframes emergencyPulse {
  0%, 100% { box-shadow: -3px -3px 6px var(--shadow-light), 3px 3px 6px rgba(239, 68, 68, 0.3), 0 0 20px rgba(239, 68, 68, 0.15); }
  50% { box-shadow: -3px -3px 6px var(--shadow-light), 4px 4px 10px rgba(239, 68, 68, 0.4), 0 0 40px rgba(239, 68, 68, 0.3); }
}

/* ===== 寵物檔案 ===== */
.pet-avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FFF7ED, #FDBA74);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
  box-shadow: var(--neu-raised-sm);
  overflow: hidden;
}
.pet-avatar.has-img {
  background: none;
  font-size: 0;
}
.pet-avatar.has-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ===== 頭像選擇器 ===== */
.avatar-picker-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s;
}
.avatar-picker-overlay.show { opacity: 1; }
.avatar-picker-sheet {
  width: 100%;
  max-width: 420px;
  max-height: 80vh;
  background: var(--surface-raised);
  border-radius: 20px 20px 0 0;
  padding: 20px 16px 28px;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.12);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  overflow-y: auto;
}
.avatar-picker-overlay.show .avatar-picker-sheet {
  transform: translateY(0);
}
.avatar-picker-title {
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 4px;
}
.avatar-picker-subtitle {
  font-size: 12px;
  color: var(--text-light);
  text-align: center;
  margin-bottom: 16px;
}
.avatar-tab-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.avatar-tab {
  flex: 1;
  padding: 10px 8px;
  border: none;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: var(--surface-raised);
  color: var(--text-light);
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  box-shadow:
    -3px -3px 6px rgba(255,255,255,0.8),
    3px 3px 8px rgba(22,27,29,0.1);
}
.avatar-tab .tab-icon {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  opacity: 0.35;
  transition: all 0.3s ease;
}
.avatar-tab.active .tab-icon {
  opacity: 1;
  filter: invert(48%) sepia(89%) saturate(2000%) hue-rotate(348deg) brightness(97%) contrast(96%);
}
.avatar-tab:active { transform: scale(0.95); }
.avatar-tab.active {
  color: var(--primary);
  background: var(--surface-raised);
  box-shadow:
    -3px -3px 6px rgba(255,255,255,0.8),
    3px 3px 8px rgba(22,27,29,0.1),
    0 0 16px rgba(249,115,22,0.35),
    0 0 32px rgba(249,115,22,0.15),
    0 0 48px rgba(249,115,22,0.06);
}
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.avatar-option {
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all 0.2s;
  box-shadow:
    -2px -2px 4px rgba(255,255,255,0.8),
    2px 2px 6px rgba(22,27,29,0.1);
}
.avatar-option img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.avatar-option:active {
  transform: scale(0.92);
}
.avatar-option.selected {
  border-color: var(--primary);
  box-shadow:
    0 0 0 2px var(--primary),
    0 0 16px rgba(249,115,22,0.35),
    0 0 32px rgba(249,115,22,0.15);
}
.avatar-confirm-bar {
  display: flex;
  gap: 8px;
}
.avatar-confirm-bar .btn { flex: 1; }

/* 上傳照片面板 */
.avatar-upload-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 0 16px;
  gap: 12px;
}
.avatar-upload-preview {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--card-bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow:
    -3px -3px 6px rgba(255,255,255,0.8),
    3px 3px 8px rgba(22,27,29,0.1);
}
.avatar-upload-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.avatar-upload-hint {
  font-size: 12px;
  color: var(--text-light);
  text-align: center;
}
.avatar-upload-btn {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  justify-content: center;
  max-width: 200px;
  cursor: pointer;
}

.pet-profile-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

/* ===== 健康日誌 ===== */
.log-entry {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--bg-dark);
}

.log-date {
  font-size: 11px;
  color: var(--text-light);
  min-width: 50px;
  font-weight: 500;
}

.log-content {
  font-size: 14px;
  flex: 1;
  line-height: 1.5;
}
.log-actions {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-shrink: 0;
  opacity: 0.4;
  transition: opacity 0.2s;
}
.log-entry:hover .log-actions { opacity: 1; }
.log-action-btn {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  background: var(--card-bg-alt);
  color: var(--text-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.log-action-btn:active { transform: scale(0.9); }
.log-action-btn:hover { color: var(--primary); }
.log-action-delete:hover { color: #ef4444; }
.log-edit-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.log-edit-input { font-size: 14px !important; padding: 8px 10px !important; }
.log-edit-btns { display: flex; gap: 6px; }

/* ===== 空白狀態 ===== */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-secondary);
}

/* ===== 動畫 ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
  width: 3px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--text-light);
  border-radius: 3px;
}

/* ===== 社群頁 ===== */
/* 地區篩選條 */
.community-region-bar {
  margin-bottom: 12px;
}
.region-select-wrap {
  padding: 2px 0;
  position: relative;
}
.region-select-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 1;
}
.region-select {
  width: 100%;
  padding: 10px 16px 10px 40px;
  border-radius: 14px;
  border: 1.5px solid var(--bg-dark);
  background: var(--surface-raised);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23F97316' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  box-shadow: var(--neu-raised-sm);
  transition: all 0.2s;
}
.region-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(249,115,22,0.15), var(--neu-raised-sm);
}

/* 地區標籤 */
.post-city-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 500;
  color: var(--primary);
  background: rgba(249,115,22,0.08);
  border: 1px solid rgba(249,115,22,0.2);
  border-radius: 10px;
  vertical-align: middle;
}

.community-author-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FFF7ED, #FDBA74);
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: var(--neu-raised-sm);
}
.community-textarea {
  min-height: 60px !important;
  resize: none;
  font-size: 14px !important;
  line-height: 1.6;
}
.compose-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}
.compose-actions {
  display: flex;
  gap: 6px;
}
.compose-action-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--card-bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-light);
  transition: all 0.2s;
}
.compose-action-btn:hover { color: var(--primary); }
.compose-action-btn:active { transform: scale(0.92); }

/* 貼文卡片 */
.post-card {
  background: var(--surface-raised);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--neu-raised);
}
.post-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.post-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: var(--neu-raised-sm);
}
.post-author {
  font-size: 14px;
  font-weight: 600;
}
.post-time {
  font-size: 11px;
  color: var(--text-light);
}
.post-body {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-primary);
  margin-bottom: 10px;
  white-space: pre-wrap;
  word-break: break-word;
}
.post-image {
  width: 100%;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  max-height: 400px;
  object-fit: cover;
}
.post-video-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 10px;
}
.post-video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}
.post-actions {
  display: flex;
  gap: 16px;
  padding-top: 8px;
  border-top: 1px solid var(--bg-dark);
}
.post-action-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 12px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: all 0.2s;
}
.post-action-btn:hover { color: var(--primary); background: rgba(249,115,22,0.06); }
.post-action-btn.liked { color: #ef4444; }
.post-action-btn.liked svg { fill: #ef4444; stroke: #ef4444; }
.post-image-preview-img {
  max-width: 100%;
  max-height: 180px;
  border-radius: 10px;
  object-fit: cover;
}
.post-image-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.post-delete-btn {
  margin-left: auto;
}

/* 留言區 */
.post-comments-section {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--bg-dark);
}
.comments-list {
  max-height: 240px;
  overflow-y: auto;
}
.comment-item {
  padding: 8px 0;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}
.comment-item:last-child { border-bottom: none; }
.comment-author {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.comment-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.comment-time {
  font-size: 10px;
  color: var(--text-light);
  margin-top: 2px;
}
.comment-input-wrap {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.comment-input {
  flex: 1;
  font-size: 13px !important;
  padding: 8px 10px !important;
}

/* 分享 Toast */
.share-toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(0,0,0,0.8);
  color: #fff;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 13px;
  z-index: 9999;
  opacity: 0;
  transition: all 0.3s;
  pointer-events: none;
}
.share-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== 配對浮動按鈕 ===== */
.match-fab {
  position: fixed;
  bottom: 90px;
  right: 16px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #F97316, #ea580c);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 4px 14px rgba(249,115,22,0.4),
    0 0 24px rgba(249,115,22,0.15);
  z-index: 900;
  transition: all 0.25s;
  animation: fab-pulse 2.5s infinite;
}
.match-fab:active { transform: scale(0.9); }
@keyframes fab-pulse {
  0%, 100% { box-shadow: 0 4px 14px rgba(249,115,22,0.4), 0 0 24px rgba(249,115,22,0.15); }
  50% { box-shadow: 0 4px 20px rgba(249,115,22,0.6), 0 0 36px rgba(249,115,22,0.25); }
}

/* 配對選擇面板 */
.match-panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s;
}
.match-panel-overlay.show { opacity: 1; }
.match-panel {
  width: 90%;
  max-width: 380px;
  background: var(--surface-raised);
  border-radius: 20px;
  padding: 24px 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.match-panel-overlay.show .match-panel { transform: scale(1); }
.match-panel-title {
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 4px;
}
.match-panel-subtitle {
  font-size: 12px;
  color: var(--text-light);
  text-align: center;
  margin-bottom: 20px;
}
.match-type-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}
.match-type-card {
  padding: 20px 12px;
  border-radius: 16px;
  background: var(--card-bg-alt);
  text-align: center;
  cursor: pointer;
  border: 2.5px solid transparent;
  transition: all 0.2s;
  box-shadow: var(--neu-raised-sm);
}
.match-type-card:active { transform: scale(0.95); }
.match-type-card.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary), 0 0 16px rgba(249,115,22,0.2);
}
.match-type-emoji { font-size: 36px; margin-bottom: 8px; }
.match-type-label { font-size: 14px; font-weight: 600; }

/* 配對結果卡片 */
.match-result-card {
  background: var(--surface-raised);
  border-radius: 20px;
  padding: 24px 20px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  width: 90%;
  max-width: 380px;
  max-height: 80vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.match-panel-overlay.show .match-result-card { transform: scale(1); }
.match-avatar-large {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto 12px;
  overflow: hidden;
  box-shadow:
    0 0 0 3px var(--primary),
    0 0 20px rgba(249,115,22,0.3);
}
.match-name { font-size: 20px; font-weight: 700; margin-bottom: 2px; }
.match-info { font-size: 13px; color: var(--text-light); margin-bottom: 16px; }
.match-posts-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: left;
  margin-bottom: 8px;
  letter-spacing: 0.04em;
}
.match-post-item {
  text-align: left;
  padding: 10px 12px;
  background: var(--card-bg-alt);
  border-radius: 10px;
  margin-bottom: 6px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}
.match-post-date {
  font-size: 10px;
  color: var(--text-light);
  margin-top: 4px;
}
.match-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}
.match-actions .btn { flex: 1; }

/* 訊息對話框 */
.match-chat-wrap {
  text-align: left;
  margin-top: 16px;
  border-top: 1px solid var(--bg-dark);
  padding-top: 12px;
}
.match-chat-messages {
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 8px;
}
.match-chat-msg {
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 6px;
  max-width: 85%;
}
.match-chat-msg.sent {
  background: var(--primary);
  color: #fff;
  margin-left: auto;
  border-bottom-right-radius: 4px;
}
.match-chat-msg.received {
  background: var(--card-bg-alt);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}
.match-chat-input-wrap {
  display: flex;
  gap: 6px;
}
.match-chat-input-wrap .form-input {
  flex: 1;
  font-size: 13px !important;
  padding: 8px 10px !important;
}

/* ===== 響應式 ===== */
@media (min-width: 768px) {
  .page {
    max-width: 600px;
  }

  .bottom-nav {
    max-width: 600px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 24px 24px 0 0;
  }
}

/* ===== 疫苗提醒橫幅 ===== */
.vaccine-reminder-banner {
  background: var(--surface-raised);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 16px;
  animation: pageIn 0.4s ease;
  box-shadow:
    -3px -3px 6px rgba(255,255,255,0.8),
    3px 3px 8px rgba(22,27,29,0.1);
}
.reminder-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 15px;
  color: var(--text-primary);
}
.reminder-header svg {
  flex-shrink: 0;
}
.reminder-body {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.9;
}
.reminder-urgent {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 8px;
  background: rgba(220,38,38,0.1);
  color: #DC2626;
  font-size: 11px;
  font-weight: 600;
}
.reminder-warn {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 8px;
  background: rgba(249,115,22,0.1);
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
}

/* ===== 疫苗紀錄 ===== */
.vaccine-entry {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.vaccine-entry:last-child { border-bottom: none; }
.vaccine-info { flex: 1; }
.vaccine-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.vaccine-dates {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 3px;
}
.vaccine-note {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.vaccine-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
}
.vaccine-overdue {
  background: #FEE2E2;
  color: #DC2626;
}
.vaccine-soon {
  background: #FEF3C7;
  color: #D97706;
}

/* ===== 寵物用品頁 ===== */
.shop-category-bar {
  margin-bottom: 16px;
}
.shop-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}
.shop-chips::-webkit-scrollbar { display: none; }
.shop-chip {
  flex-shrink: 0;
  padding: 8px 18px;
  border-radius: 20px;
  border: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  background: var(--surface-raised);
  color: var(--text-light);
  box-shadow:
    -2px -2px 4px rgba(255,255,255,0.8),
    2px 2px 6px rgba(22,27,29,0.08);
  transition: all 0.25s ease;
}
.shop-chip.active {
  background: linear-gradient(135deg, #F97316, #FB923C);
  color: white;
  box-shadow: 0 2px 8px rgba(249,115,22,0.3);
}

.shop-section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

/* 精選橫滾 */
.shop-featured-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  margin-bottom: 20px;
}
.shop-featured-scroll::-webkit-scrollbar { display: none; }
.shop-featured-card {
  flex-shrink: 0;
  width: 220px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-raised);
  cursor: pointer;
  box-shadow:
    -3px -3px 6px rgba(255,255,255,0.8),
    3px 3px 8px rgba(22,27,29,0.1);
  transition: transform 0.2s;
}
.shop-featured-card:active { transform: scale(0.97); }
.shop-featured-card img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}
.shop-featured-info {
  padding: 10px 14px;
}
.shop-featured-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.shop-featured-price {
  font-size: 13px;
  color: var(--primary);
  font-weight: 700;
  margin-top: 4px;
}

/* Banner 卡片列表 */
.shop-banner-card {
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  background: var(--surface-raised);
  box-shadow:
    -3px -3px 6px rgba(255,255,255,0.8),
    3px 3px 8px rgba(22,27,29,0.1);
  transition: transform 0.2s;
  margin-bottom: 16px;
}
.shop-banner-card:active { transform: scale(0.98); }
.shop-banner-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}
.shop-banner-info {
  padding: 14px 16px;
}
.shop-banner-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.shop-banner-desc {
  font-size: 12px;
  color: var(--text-light);
}
.shop-banner-tag {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 10px;
  border-radius: 10px;
  background: rgba(249,115,22,0.1);
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
}
.shop-banner-placeholder {
  width: 100%;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: white;
  font-weight: 600;
  background: linear-gradient(135deg, #F97316, #FB923C);
}

/* ===== 訂閱系統 ===== */

/* PRO 徽章（導航列 & 內文） */
.nav-lock-badge {
  display: none;
  position: absolute;
  top: 2px;
  right: -2px;
  padding: 1px 4px;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #fff;
  background: linear-gradient(135deg, #F97316, #EA580C);
  border-radius: 4px;
  line-height: 1.3;
}
body[data-tier="free"] .nav-item[data-page="shop"] .nav-lock-badge,
body[data-tier="free"] .nav-item[data-page="assistant"] .nav-lock-badge {
  display: block;
}
body[data-tier="free"] .nav-item[data-page="insurance"],
body[data-tier="free"] .nav-item[data-page="shop"],
body[data-tier="free"] .nav-item[data-page="assistant"] {
  position: relative;
}

.premium-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #F97316, #EA580C);
  border-radius: 6px;
  letter-spacing: 0.5px;
  margin-left: 6px;
  vertical-align: middle;
}

/* 鎖定覆蓋層 */
.feature-locked {
  position: relative;
  pointer-events: none;
  user-select: none;
}
.feature-locked::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(239, 242, 249, 0.65);
  backdrop-filter: blur(3px);
  border-radius: inherit;
  z-index: 10;
}

/* 訂閱 Modal */
.sub-modal {
  max-width: 380px;
  padding: 28px 24px 24px;
}
.sub-badge-wrap {
  display: flex;
  justify-content: center;
}
.sub-badge-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, #F97316, #EA580C);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 4px 14px rgba(249,115,22,0.35),
    0 0 24px rgba(249,115,22,0.15);
}
.sub-features {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
  padding: 16px;
  background: var(--surface-raised);
  border-radius: var(--radius);
  box-shadow:
    inset -2px -2px 4px rgba(255,255,255,0.7),
    inset 2px 2px 4px rgba(22,27,29,0.06);
}
.sub-feature-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
}
.sub-feature-item svg {
  flex-shrink: 0;
}
.sub-pricing {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.pricing-card {
  position: relative;
  padding: 18px 14px;
  border-radius: var(--radius);
  text-align: center;
  cursor: pointer;
  background: var(--surface-raised);
  border: 2px solid transparent;
  box-shadow:
    -3px -3px 6px rgba(255,255,255,0.8),
    3px 3px 8px rgba(22,27,29,0.1);
  transition: all 0.25s ease;
}
.pricing-card.selected {
  border-color: var(--primary);
  box-shadow:
    -3px -3px 6px rgba(255,255,255,0.8),
    3px 3px 8px rgba(22,27,29,0.1),
    0 0 16px rgba(249,115,22,0.2);
}
.pricing-period {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 6px;
}
.pricing-amount {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
}
.pricing-amount span {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-light);
}
.pricing-save {
  margin-top: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
}

/* ===== Payment Page ===== */
.payment-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg);
  z-index: 10000;
  overflow-y: auto;
  animation: pageIn 0.25s ease;
}
.payment-page {
  max-width: 440px;
  margin: 0 auto;
  padding: 20px 18px 40px;
}
.payment-back {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  padding: 6px 0;
  margin-bottom: 12px;
}
.payment-header {
  text-align: center;
  margin-bottom: 20px;
}
.payment-icon {
  font-size: 40px;
  margin-bottom: 6px;
}
.payment-header h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
}
.payment-summary {
  padding: 20px;
  margin-bottom: 20px;
}
.payment-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 14px;
  color: var(--text-secondary);
}
.payment-row strong {
  color: var(--text);
}
.payment-total {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}
.payment-total span:last-child {
  color: var(--primary);
  font-size: 22px;
}
.payment-divider {
  height: 1px;
  background: rgba(0,0,0,0.06);
  margin: 8px 0;
}
.payment-promo-section {
  padding: 10px 0;
}
.payment-promo-section label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  display: block;
}
.payment-promo-input {
  display: flex;
  gap: 8px;
}
.payment-promo-input input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 12px;
  border: none;
  background: var(--bg);
  box-shadow: inset 2px 2px 4px var(--shadow-dark), inset -2px -2px 4px var(--shadow-light);
  font-size: 14px;
  color: var(--text);
  outline: none;
}
.payment-promo-input input::placeholder {
  color: var(--text-light);
}
.payment-promo-input button {
  padding: 10px 16px;
  border-radius: 12px;
  border: none;
  background: var(--surface-raised);
  box-shadow: var(--neu-raised-sm);
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
  white-space: nowrap;
}
.payment-promo-input button:active {
  box-shadow: inset 2px 2px 4px var(--shadow-dark), inset -2px -2px 4px var(--shadow-light);
}
.payment-promo-msg {
  margin-top: 8px;
  font-size: 12px;
  min-height: 16px;
}
.payment-promo-msg.success { color: #16a34a; }
.payment-promo-msg.error { color: #dc2626; }
.payment-discount-note {
  text-align: center;
  font-size: 12px;
  color: #16a34a;
  font-weight: 600;
  padding-top: 6px;
}
.payment-submit {
  margin-top: 8px;
  padding: 16px !important;
  font-size: 16px !important;
  font-weight: 800 !important;
}
.payment-note {
  text-align: center;
  font-size: 11px;
  color: var(--text-light);
  margin-top: 12px;
}

/* TapPay 信用卡輸入 */
.tappay-card-section {
  padding: 16px 18px 14px;
}
.tappay-card-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 12px;
}
.tappay-field {
  height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  background: var(--bg);
  box-shadow: inset 2px 2px 4px var(--shadow-dark), inset -2px -2px 4px var(--shadow-light);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
}
.tappay-row {
  display: flex;
  gap: 10px;
}
.tappay-half {
  flex: 1;
}
.tappay-status {
  font-size: 12px;
  min-height: 16px;
  text-align: right;
  margin-top: -4px;
  margin-bottom: 2px;
}
.tappay-sandbox-notice {
  margin-top: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  box-shadow: var(--neu-flat);
  font-size: 11px;
  line-height: 1.7;
  color: var(--text-secondary);
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* 社群發文區鎖定覆蓋 */
.compose-lock-overlay {
  position: absolute;
  inset: 0;
  background: rgba(239, 242, 249, 0.85);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}
.compose-lock-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}
.pricing-popular {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 10px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #F97316, #EA580C);
  border-radius: 8px;
  white-space: nowrap;
}
