/* ============================================
   珍妮 CLAW 龍蝦 (珍妮 CLAW 龍蝦) - Global Styles
   ============================================ */

:root {
  /* Colors */
  --primary: #3A36C9;
  --primary-hover: #2e2aa8;
  --primary-light: #A7A5EE;
  --secondary: #ec4899;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;

  /* Neutrals — Light Tiffany Theme */
  --bg:           #f7f8fc;
  --bg-secondary: #eff1f8;
  --bg-tertiary:  #e3e6f2;
  --surface:      #ffffff;
  --surface-hover:#f4f5fb;
  --border:       #d9ddeb;
  --text:         #14163a;
  --text-secondary: #34375c;
  --text-muted:   #5b5f7e;

  /* Sizing */
  --radius: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;
  --sidebar-width: 260px;
  --topbar-height: 56px;

  /* Shadows */
  --shadow: 0 1px 3px rgba(58, 54, 201, 0.1);
  --shadow-lg: 0 4px 12px rgba(58, 54, 201, 0.15);
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  /* Firefox：全站纖細滾動條，色彩跟著主題金色走（會被各容器繼承）*/
  scrollbar-width: thin;
  scrollbar-color: var(--accent-gold, #7A2E5A) transparent;
}

/* ============================================
   全站滾動條 — 纖細、與主題一體、立體絲滑
   取代呆板原生樣式；套用到頁面、側邊欄、彈窗、表格等所有捲動區
   ============================================ */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}
/* 移除原生上下／左右箭頭按鈕（呆板感的來源）
   Windows 版 Chromium 對單純 display:none 偶爾無效，故把各方向按鈕也一併點名歸零 */
::-webkit-scrollbar-button,
::-webkit-scrollbar-button:single-button,
::-webkit-scrollbar-button:start,
::-webkit-scrollbar-button:end,
::-webkit-scrollbar-button:vertical:start,
::-webkit-scrollbar-button:vertical:end,
::-webkit-scrollbar-button:horizontal:start,
::-webkit-scrollbar-button:horizontal:end {
  width: 0;
  height: 0;
  display: none;
}
/* 軌道透明，讓滑塊像浮在裡面 */
::-webkit-scrollbar-track {
  background: transparent;
}
/* 滑塊：金色金屬漸層膠囊 ＋ 內高光 ＋ 外陰影 → 立體浮起 */
::-webkit-scrollbar-thumb {
  border-radius: 12px;
  background: var(--accent-gold-grad, #7A2E5A);
  background-clip: padding-box;          /* 配合透明邊框做出內縮留白 */
  border: 4.5px solid transparent;       /* 12px 軌道 − 兩側 4.5px ＝ 滑塊約 3px（更纖細）*/
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.45),  /* 頂部高光 */
    inset 0 -1px 1px rgba(0, 0, 0, 0.22),       /* 底部暗邊 */
    0 1px 4px rgba(0, 0, 0, 0.28);              /* 外陰影：浮起感 */
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
/* hover：滑塊略變飽滿 ＋ 金色光暈 */
::-webkit-scrollbar-thumb:hover {
  border-width: 4px;
  box-shadow:
    inset 0 1px 1.5px rgba(255, 255, 255, 0.6),
    inset 0 -1px 1.5px rgba(0, 0, 0, 0.25),
    0 0 8px rgba(201, 169, 110, 0.55),          /* 金色光暈 */
    0 1px 5px rgba(0, 0, 0, 0.34);
}
::-webkit-scrollbar-thumb:active {
  border-width: 4px;
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.7),
    0 0 10px rgba(201, 169, 110, 0.7),
    0 1px 6px rgba(0, 0, 0, 0.38);
}
/* 兩條捲軸交會的角落保持透明，不要白色方塊 */
::-webkit-scrollbar-corner {
  background: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--primary-hover);
  text-decoration: none;
}

a:hover {
  color: var(--primary);
}

/* Typography */
h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.3;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1rem; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text);
}

.btn-secondary:hover {
  background: var(--surface-hover);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  background: var(--bg-secondary);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-lg {
  padding: 12px 24px;
  font-size: 1rem;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 0.75rem;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Forms */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.form-input {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.875rem;
  transition: border-color 0.15s;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(58, 54, 201, 0.2);
}

textarea.form-input {
  min-height: 100px;
  resize: vertical;
}

select.form-input {
  cursor: pointer;
}

/* Cards */
.card {
  box-shadow: var(--card-shadow);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-success { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.badge-info { background: rgba(59, 130, 246, 0.15); color: var(--info); }
.badge-primary { background: rgba(58, 54, 201, 0.15); background: color-mix(in srgb, var(--primary) 15%, transparent); color: var(--primary-hover); }

/* Tables */
.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}

th {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

tr:hover td {
  background: var(--surface-hover);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  /* AgentDesk 西裝版：明亮淡紫霧面（企業簡約），卡片以陰影分層 */
  background: linear-gradient(135deg, #eceefc 0%, #dedbf6 42%, #f4f0fa 100%);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  visibility: hidden;
  pointer-events: none;
}

.modal-overlay.active {
  visibility: visible;
  pointer-events: auto;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

/* 公告彈窗內文 — Markdown 排版（marked.js 產出的 <p>/<ul>/<strong>/<h*> 等元素） */
#ann-popup-content p { margin: 0 0 0.6em; }
#ann-popup-content > :last-child { margin-bottom: 0; }
#ann-popup-content ul,
#ann-popup-content ol { margin: 0.4em 0 0.6em; padding-left: 1.4em; }
#ann-popup-content li { margin: 0.25em 0; }
#ann-popup-content h1,
#ann-popup-content h2,
#ann-popup-content h3,
#ann-popup-content h4 { margin: 0.7em 0 0.4em; line-height: 1.35; color: var(--text); font-weight: 700; }
#ann-popup-content h1 { font-size: 1.15rem; }
#ann-popup-content h2 { font-size: 1.05rem; }
#ann-popup-content h3 { font-size: 0.98rem; }
#ann-popup-content h4 { font-size: 0.92rem; }
#ann-popup-content strong { color: var(--text); font-weight: 700; }
#ann-popup-content a { color: var(--primary); text-decoration: underline; }
#ann-popup-content code { background: var(--bg); padding: 1px 5px; border-radius: 4px; font-size: 0.85em; }
#ann-popup-content hr { border: none; border-top: 1px solid var(--border); margin: 0.8em 0; }
#ann-popup-content blockquote { margin: 0.5em 0; padding: 0.2em 0 0.2em 0.8em; border-left: 3px solid var(--primary); color: var(--text-muted); }
#ann-popup-content img { max-width: 100%; height: auto; border-radius: 6px; }
#ann-popup-content table { border-collapse: collapse; width: 100%; margin: 0.5em 0; }
#ann-popup-content th,
#ann-popup-content td { border: 1px solid var(--border); padding: 4px 8px; text-align: left; }

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.25rem;
  padding: 4px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

/* App Layout */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg, #FAF7F2);
  border-right: 1px solid var(--divider, #E8E2D8);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 100;
}

.sidebar-logo {
  padding: 18px 20px;
  border-bottom: 1px solid var(--divider, #E8E2D8);
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--accent-gold, #7A2E5A);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo-img {
  width: 32px;
  height: 32px;
  border-radius: 0;
  object-fit: cover;
  flex-shrink: 0;
}

.sidebar-nav {
  flex: 1;
  padding: 14px 10px;
  overflow-y: auto;
  min-height: 0;
}

.nav-section {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Nunito Sans', sans-serif;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--sidebar-muted, #8A8578);
  opacity: 0.7;
  padding: 16px 16px 6px;
  user-select: none;
}
.nav-section::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--divider, #E8E2D8);
}
.sidebar-nav > .nav-section:first-child { padding-top: 4px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 0;
  color: var(--sidebar-muted, #8A8578);
  font-family: 'Nunito Sans', sans-serif;
  font-size: 0.98rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.25s ease;
  margin-bottom: 1px;
  position: relative;
  overflow: hidden;
}

.nav-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--accent-gold, #7A2E5A);
  transform: scaleY(0);
  transition: transform 0.3s ease;
  transform-origin: top;
}

.nav-item:hover {
  background: var(--sidebar-active-bg, rgba(201, 169, 110, 0.06));
  color: var(--sidebar-text, #1A1A1A);
}

.nav-item:hover::before {
  transform: scaleY(1);
}

.nav-item.active {
  background: var(--sidebar-active-bg, transparent);
  color: var(--accent-gold, #7A2E5A);
  font-weight: 600;
  border-left: none;
  padding-left: 16px;
}

.nav-item.active::before {
  transform: scaleY(1);
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--divider, #E8E2D8);
}

.sidebar-user-info {
  padding: 8px 14px 10px;
  margin-bottom: 4px;
}

.sidebar-user-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--sidebar-text, #1A1A1A);
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-tier {
  font-family: 'Nunito Sans', sans-serif;
  font-size: 0.72rem;
  font-weight: 300;
  color: var(--sidebar-muted, #8A8578);
  letter-spacing: 0.08em;
  margin-top: 2px;
}

.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--topbar-height);
  background: var(--surface, #FAF7F2);
  border-bottom: 1px solid var(--divider, #E8E2D8);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-credits {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
}

.topbar-credits .amount {
  color: var(--success);
  font-weight: 600;
}

.content-area {
  padding: 24px;
  flex: 1;
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.empty-state h3 {
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.empty-state p {
  color: var(--text-muted);
  max-width: 400px;
  margin-bottom: 20px;
}

/* Loading */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================================
   任務歷程：乾淨預設 + 可展開細節（2026-07-22）
   「珍妮工作中」動畫面板 + 折疊執行歷程 + 逐步展開原始輸出。
   全部沿用主題色票，淺色 / 深色 noir 都可讀。
   ============================================================ */
.agent-live {
  background: color-mix(in srgb, var(--surface) 90%, var(--primary) 10%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin: 10px 0;
  margin-right: 15%;
}
.agent-live-head { display: flex; align-items: center; gap: 12px; }
.agent-live-orb-wrap {
  position: relative;
  width: 38px; height: 38px; flex: 0 0 38px;
  display: grid; place-items: center;
}
.agent-live-orb-wrap::before {
  content: '';
  position: absolute; inset: 0;
  border: 3px solid color-mix(in srgb, var(--primary) 30%, transparent);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
.agent-live-orb {
  font-size: 1.05rem;
  animation: agentBreathe 2.2s ease-in-out infinite;
}
@keyframes agentBreathe {
  0%, 100% { transform: scale(1);    opacity: 0.85; }
  50%      { transform: scale(1.12); opacity: 1; }
}
.agent-live-text { flex: 1; min-width: 0; }
.agent-live-title { font-weight: 700; font-size: 0.95rem; color: var(--text); }
.agent-live-action {
  font-size: 0.85rem; color: var(--text-muted); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.agent-live-count {
  flex: 0 0 auto;
  font-size: 0.72rem; font-weight: 600;
  color: var(--primary-hover);
  background: color-mix(in srgb, var(--primary) 15%, transparent);
  padding: 3px 10px; border-radius: var(--radius-full); white-space: nowrap;
}

.agent-history {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  margin: 8px 0;
  margin-right: 15%;
  overflow: hidden;
}
.agent-history-live {
  margin-top: 12px; margin-right: 0;
  background: transparent;
  border-color: color-mix(in srgb, var(--border) 70%, transparent);
}
.agent-history > summary,
.agent-step > summary {
  cursor: pointer; list-style: none; user-select: none;
  display: flex; align-items: center; gap: 8px;
}
.agent-history > summary::-webkit-details-marker,
.agent-step > summary::-webkit-details-marker { display: none; }
.agent-history-summary {
  padding: 10px 14px;
  font-size: 0.86rem; font-weight: 600; color: var(--text-secondary);
}
.agent-history-summary::before {
  content: '\25B8';  /* ▸ */
  display: inline-block;
  color: var(--text-muted);
  transition: transform 0.15s ease;
}
.agent-history[open] > .agent-history-summary::before { transform: rotate(90deg); }
.agent-history-body { padding: 0 12px 8px; }

.agent-step { border-top: 1px dashed var(--border); }
.agent-step:first-child { border-top: none; }
.agent-step-summary {
  padding: 8px 4px;
  font-size: 0.84rem; color: var(--text);
}
.agent-step-summary::after {
  content: '\203A';  /* › */
  margin-left: auto;
  color: var(--text-muted);
  transition: transform 0.15s ease;
}
.agent-step[open] > .agent-step-summary::after { transform: rotate(90deg); }
.agent-step-ok { color: var(--success); font-weight: 700; }
.agent-step-raw { padding: 2px 4px 10px; }
.agent-step-raw pre {
  background: color-mix(in srgb, var(--text) 6%, transparent);
  border-radius: 6px;
  padding: 10px;
  max-height: 260px; overflow: auto;
  font-size: 0.78rem; line-height: 1.5;
  white-space: pre-wrap; word-break: break-word;
  color: var(--text-secondary);
  margin: 0;
}
.agent-step-reason { font-size: 0.85rem; color: var(--text-secondary); }

/* 手機：不留右側縮排，滿版較好讀 */
@media (max-width: 768px) {
  .agent-live { margin-right: 0; }
  .agent-history { margin-right: 0; }
}

.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

/* Toast notifications */
.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  /* 20000：必須高於全部彈窗（場景 onboarding overlay 是 10000）——
     否則彈窗內操作失敗的錯誤提示被壓在後面，用戶完全看不到
     （2026-07-19 歡迎彈窗 403 連打 10 次實案） */
  z-index: 20000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.2s ease;
  max-width: 360px;
}

.toast-success { background: var(--success); color: white; }
.toast-error { background: var(--danger); color: white; }
.toast-info { background: var(--info); color: white; }
.toast-warning { background: var(--warning, #f59e0b); color: white; }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* App 有新版本：常駐底部小卡（點一下更新，不自動硬刷）。
   用主題變數著色，自動適配 jennie-themes.css 的各皮膚（含 noir 深色）。 */
.update-toast {
  position: fixed;
  left: 50%;
  bottom: calc(92px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 2100;
  display: flex;
  align-items: center;
  gap: 12px;
  width: calc(100% - 32px);
  max-width: 360px;
  padding: 11px 12px 11px 16px;
  background: var(--surface, #fff);
  color: var(--text, #14163a);
  border: 1px solid var(--primary-light, var(--primary, #3A36C9));
  border-radius: var(--radius-lg, 12px);
  box-shadow: var(--card-shadow, 0 12px 32px rgba(58, 54, 201, 0.28));
  animation: updateRise 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes updateRise {
  from { opacity: 0; transform: translate(-50%, 16px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
.update-toast .ut-icon { font-size: 18px; line-height: 1; }
.update-toast .ut-text { flex: 1; font-size: 13.5px; line-height: 1.35; }
.update-toast .ut-text b { font-weight: 700; }
.update-toast .ut-sub { display: block; font-size: 11.5px; color: var(--text-muted, #5b5f7e); margin-top: 1px; }
.update-toast .ut-btn {
  flex-shrink: 0;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: var(--radius-full, 9999px);
  background: var(--primary, #3A36C9);
  color: #fff;
}
.update-toast .ut-btn:hover { background: var(--primary-hover, #2e2aa8); }
.update-toast .ut-btn:disabled { opacity: 0.7; cursor: default; }
.update-toast .ut-close {
  flex-shrink: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 18px;
  line-height: 1;
  width: 26px;
  height: 26px;
  color: var(--text-muted, #5b5f7e);
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}

.pagination button {
  padding: 6px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
}

.pagination button:hover {
  background: var(--surface-hover);
}

.pagination button.active {
  background: var(--primary);
  border-color: var(--primary);
}

.pagination button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-center { text-align: center; }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* Language Switcher (dropdown) */
.lang-select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--bg-tertiary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%230f3a38' stroke-width='1.5' fill='none'/%3E%3C/svg%3E") no-repeat right 8px center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 5px 28px 5px 10px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  outline: none;
}

.lang-select:hover {
  border-color: var(--primary);
  color: var(--text);
}

.lang-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(58, 54, 201, 0.15);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Responsive */

/* Hamburger button — hidden on desktop, visible on mobile */
.hamburger-btn {
  display: none; /* hidden on desktop */
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 5px;
  z-index: 201;
}

.hamburger-line {
  display: block;
  width: 24px;
  height: 2.5px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.25s ease;
}

/* Sidebar overlay (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

@media (max-width: 768px) {
  .hamburger-btn {
    display: flex; /* show on mobile */
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  /* When sidebar is open, animate hamburger to X */
  .sidebar.open ~ .main-content .hamburger-btn .hamburger-line:nth-child(1) {
    transform: translateY(7.5px) rotate(45deg);
  }
  .sidebar.open ~ .main-content .hamburger-btn .hamburger-line:nth-child(2) {
    opacity: 0;
  }
  .sidebar.open ~ .main-content .hamburger-btn .hamburger-line:nth-child(3) {
    transform: translateY(-7.5px) rotate(-45deg);
  }
}


/* ============================================
   Skills Marketplace
   ============================================ */
.skills-page { max-width: 1200px; }

.skills-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.skills-tabs { display: flex; gap: 8px; }

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.skill-card {
  box-shadow: var(--card-shadow);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}

.skill-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(58, 54, 201, 0.15);
}

.skill-card.skill-installed {
  border-color: var(--success);
  background: linear-gradient(135deg, var(--surface), rgba(34, 197, 94, 0.05));
}

.skill-card.skill-pro:not(.skill-installed) {
  background: linear-gradient(135deg, var(--surface), rgba(245, 180, 40, 0.06));
  border-color: rgba(245, 180, 40, 0.3);
  padding: 24px;
  min-height: 200px;
}

.skill-card.skill-pro:not(.skill-installed):hover {
  border-color: rgba(245, 180, 40, 0.7);
  box-shadow: 0 4px 20px rgba(245, 180, 40, 0.15), 0 0 40px rgba(245, 180, 40, 0.05);
  transform: translateY(-3px);
}

.skill-card.skill-pro .skill-icon { font-size: 2rem; }

/* Pro section golden title */
.skills-section:last-child .skills-section-title {
  background: linear-gradient(90deg, #f5b428, #e8a317, #d4941a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Pro tier badge — gold */
.tier-badge.tier-pro {
  background: linear-gradient(135deg, rgba(245, 180, 40, 0.15), rgba(212, 148, 26, 0.15));
  color: #f5b428;
  border: 1px solid rgba(245, 180, 40, 0.4);
}

.skill-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.skill-icon { font-size: 1.75rem; }

.skill-badges { display: flex; gap: 6px; flex-wrap: wrap; }

.tier-badge, .category-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}

.tier-badge.tier-starter {
  background: rgba(34, 197, 94, 0.12);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.tier-badge.tier-pro {
  background: rgba(139, 92, 246, 0.12);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.skill-name {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.skill-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
  flex: 1;
  margin-bottom: 16px;
}

.skill-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.skill-installs, .skill-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover { background: #16a34a; }

/* Smart skill tip */
.smart-skill-tip {
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 0.85rem;
  color: #c4b5fd;
  line-height: 1.5;
}
.smart-skill-tip strong { color: #a78bfa; }

/* Skill priority slider */
.skill-priority {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  margin-bottom: 8px;
}
.skill-priority label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  min-width: 42px;
}
.priority-slider {
  flex: 1;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--border);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.priority-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 2px solid var(--bg);
  box-shadow: 0 0 4px rgba(139, 92, 246, 0.4);
}
.priority-value {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  min-width: 20px;
  text-align: center;
}
.priority-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
  min-width: 30px;
}

/* Install progress bar */
.install-bar {
  margin-bottom: 20px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.install-bar-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.install-bar-track {
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  overflow: hidden;
}

.install-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 3px;
  transition: width 0.3s ease;
}

.installed-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

/* Skills sections */
.skills-section { margin-bottom: 16px; }

.skills-section-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.skills-section-count {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 8px;
}

.skills-section-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

/* Auth - Google Button */
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: #3c4043;
  border: 1px solid #dadce0;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-google:hover {
  background: #f8f9fa;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

/* Auth divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.8rem;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Email verification banner */
/* ---- Email Verification Gate ---- */
.verify-gate {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.verify-gate.hidden { display: none !important; }

.verify-gate-card {
  box-shadow: var(--card-shadow);
  background: var(--surface);
  border: 1px solid rgba(58, 54, 201, 0.3);
  border-radius: 20px;
  padding: 48px 40px 36px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow:
    0 0 0 1px rgba(58, 54, 201, 0.1),
    0 20px 60px rgba(58, 54, 201, 0.12),
    0 0 80px rgba(58, 54, 201, 0.08);
  animation: gateSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes gateSlideIn {
  from { opacity: 0; transform: translateY(24px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.verify-gate-icon {
  font-size: 3.5rem;
  margin-bottom: 20px;
  animation: gateBounce 2s ease-in-out infinite;
}

@keyframes gateBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.verify-gate-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #b2edeb, #A7A5EE);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.verify-gate-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 28px;
}

.verify-gate-desc strong {
  color: var(--primary-hover);
  font-weight: 600;
}

.verify-gate-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.verify-gate-actions .btn {
  width: 100%;
  padding: 12px;
  font-size: 0.9rem;
}

.verify-gate-logout {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 4px;
  transition: color 0.2s;
}
.verify-gate-logout:hover { color: var(--danger); }

/* ============================================
   Pricing / Subscription Page
   ============================================ */
.pricing-page {
  max-width: 1200px;
  margin: 0 auto;
}

.pricing-page-header {
  text-align: center;
  margin-bottom: 36px;
}

.pricing-page-header h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--primary-light), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.pricing-page-header p {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* Grid */
.claw-pricing-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

@media (max-width: 1300px) {
  .claw-pricing-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .claw-pricing-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .claw-pricing-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin: 0 auto;
  }
}

/* Flagship card — luxury shimmer */
.claw-pricing-card.flagship {
  border: 2px solid #7A2E5A !important;
  background: linear-gradient(170deg, #FFFDF7 0%, #FFF9EC 30%, #FFFDF7 60%, #FFF5E0 100%) !important;
  position: relative;
  overflow: visible !important;
  box-shadow: 0 4px 24px rgba(201,169,110,0.15), 0 0 0 1px rgba(201,169,110,0.1) !important;
}

.claw-pricing-card.flagship::after {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  bottom: -1px;
  background: linear-gradient(
    135deg,
    transparent 20%,
    rgba(201,169,110,0.08) 30%,
    rgba(255,255,255,0.6) 40%,
    rgba(201,169,110,0.08) 50%,
    transparent 60%
  );
  background-size: 300% 300%;
  animation: flagshipShimmer 8s ease infinite;
  pointer-events: none;
  z-index: 1;
}

@keyframes flagshipShimmer {
  0% { background-position: 100% 100%; }
  50% { background-position: 0% 0%; }
  100% { background-position: 100% 100%; }
}

/* 旗艦卡永遠是淺色（金底）底，但 .claw-pricing-features li 直接吃 color:var(--text)，
   深色模式下 var(--text) 變淺 → 淺字配淺底＝看不見（只有寫死深色的 highlight 項看得到）。
   旗艦卡的功能文字改吃寫死深棕，兩種主題都可讀；highlight 項的 inline 色仍會蓋過此規則。 */
.claw-pricing-card.flagship .claw-pricing-features li {
  color: #5a4a2e;
}

/* Card */
.claw-pricing-card {
  box-shadow: var(--card-shadow);
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: all 0.25s ease;
}

.claw-pricing-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(58, 54, 201, 0.15);
}

/* Featured (Starter) */
.claw-pricing-card.featured {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary), 0 4px 20px rgba(58, 54, 201, 0.12);
}

.claw-pricing-card.featured:hover {
  box-shadow: 0 0 0 1px var(--primary), 0 12px 40px rgba(58, 54, 201, 0.25);
}

/* Current plan glow */
.claw-pricing-card.current-plan {
  border-color: var(--success);
  box-shadow: 0 0 0 1px var(--success), 0 4px 12px rgba(34, 197, 94, 0.1);
}

/* Enterprise */
.claw-pricing-card.enterprise {
  border-color: #f59e0b;
  box-shadow: 0 0 0 1px #f59e0b, 0 4px 12px rgba(245, 158, 11, 0.1);
}

.claw-pricing-card.enterprise:hover {
  box-shadow: 0 0 0 1px #f59e0b, 0 12px 40px rgba(245, 158, 11, 0.2);
}

/* Popular badge */
.claw-pricing-popular {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--primary), #A7A5EE);
  color: white;
  padding: 4px 18px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.claw-pricing-popular.enterprise-pop {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

/* Header */
.claw-pricing-header {
  text-align: center;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.claw-pricing-header h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
}

.claw-pricing-price {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 2px;
}

.claw-price-currency {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  vertical-align: super;
}

.claw-price-amount {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

.claw-price-period {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.claw-pricing-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 8px;
}

/* Feature list */
.claw-pricing-features {
  list-style: none;
  flex: 1;
  margin-bottom: 24px;
}

.claw-pricing-features li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 0;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--text);
}

.claw-pricing-features li.disabled {
  color: var(--text-muted);
}

.feat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}

.feat-icon.check {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.feat-icon.cross {
  background: rgba(100, 116, 139, 0.15);
  color: var(--text-muted);
}

/* Buttons */
.claw-pricing-btn {
  width: 100%;
  padding: 14px;
  font-size: 0.95rem;
  font-weight: 600;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.claw-pricing-btn:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary-hover);
  background: rgba(58, 54, 201, 0.08);
}

.claw-pricing-btn.primary {
  background: linear-gradient(135deg, var(--primary), #A7A5EE);
  color: white;
  border-color: transparent;
}

.claw-pricing-btn.primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--primary-hover), #3A36C9);
  box-shadow: 0 4px 16px rgba(58, 54, 201, 0.3);
  transform: translateY(-1px);
}

.claw-pricing-btn.enterprise-btn {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  border-color: transparent;
}

.claw-pricing-btn.enterprise-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #d97706, #b45309);
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.3);
}

.claw-pricing-btn.current {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  cursor: default;
  border-color: transparent;
}

.claw-pricing-btn:disabled {
  opacity: 0.7;
  cursor: default;
  transform: none !important;
  box-shadow: none !important;
}

/* Reward banner */
.claw-reward-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 32px;
  padding: 20px 24px;
  background: linear-gradient(135deg, rgba(58, 54, 201, 0.1), rgba(236, 72, 153, 0.1));
  border: 1px solid rgba(58, 54, 201, 0.3);
  border-radius: var(--radius-lg);
  animation: rewardPulse 3s ease-in-out infinite;
}

@keyframes rewardPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(58, 54, 201, 0); }
  50% { box-shadow: 0 0 20px rgba(58, 54, 201, 0.1); }
}

.reward-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.reward-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.reward-text strong {
  font-size: 1rem;
  color: var(--primary-hover);
}

.reward-text span {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Billing Toggle */
.billing-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
}

.toggle-label {
  font-size: 0.95rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.3s;
  user-select: none;
}

.toggle-label.active {
  color: var(--text-primary);
  font-weight: 600;
}

.toggle-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--success), #10b981);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  margin-left: 4px;
  vertical-align: middle;
}

.toggle-switch {
  width: 48px;
  height: 26px;
  background: var(--bg-tertiary);
  border-radius: 13px;
  cursor: pointer;
  position: relative;
  transition: background 0.3s;
  border: 1px solid rgba(255,255,255,0.1);
}

.toggle-switch.on {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
}

.toggle-knob {
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 3px;
  transition: transform 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-switch.on .toggle-knob {
  transform: translateX(22px);
}

.annual-equiv {
  font-size: 0.8rem;
  color: var(--success);
  margin-top: 4px;
  font-weight: 500;
}

/* ============================================
   Unlock Guide Page
   ============================================ */
.unlock-guide-page {
  max-width: 900px;
  margin: 0 auto;
}

.unlock-guide-header {
  text-align: center;
  margin-bottom: 32px;
}

.unlock-guide-header h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #f59e0b, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.unlock-guide-header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* Current plan badge */
.unlock-current-plan {
  text-align: center;
  margin-bottom: 28px;
}

.unlock-plan-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--primary), #3A36C9);
  color: #fff;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 0.95rem;
  box-shadow: 0 4px 16px rgba(58, 54, 201, 0.3);
}

.unlock-plan-badge strong {
  font-size: 1.1rem;
}

/* Section card */
.unlock-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
  transition: border-color 0.2s;
}

.unlock-section:hover {
  border-color: rgba(58, 54, 201, 0.3);
}

.unlock-section-highlight {
  border-color: rgba(245, 158, 11, 0.3);
  background: linear-gradient(135deg, var(--surface), rgba(245, 158, 11, 0.03));
}

.unlock-section-highlight:hover {
  border-color: rgba(245, 158, 11, 0.5);
}

.unlock-section-hdr {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.unlock-section-icon {
  font-size: 1.3rem;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.unlock-section-hdr h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.unlock-section-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: -6px 0 16px 38px;
  line-height: 1.5;
}

/* Tables */
.unlock-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.unlock-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.unlock-table th {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-weight: 600;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.unlock-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.unlock-table tbody tr:hover {
  background: var(--surface-hover);
}

/* My tier row highlight */
.unlock-row-mine {
  background: rgba(58, 54, 201, 0.08) !important;
}

.unlock-row-mine td {
  color: var(--primary-hover);
  font-weight: 600;
}

/* Status indicators */
.unlock-yes {
  color: var(--success);
  font-weight: 700;
}

.unlock-no {
  color: var(--text-muted);
  font-size: 1rem;
}

.unlock-section-note {
  margin-top: 0.75rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Model chips */
.model-chip {
  display: inline-block;
  padding: 3px 10px;
  margin: 2px 4px 2px 0;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 500;
  background: rgba(58, 54, 201, 0.1);
  color: var(--primary-hover);
  border: 1px solid rgba(58, 54, 201, 0.35);
}

/* Cost level badges */
.cost-low {
  color: var(--success);
  font-weight: 600;
}

.cost-mid {
  color: #f59e0b;
  font-weight: 600;
}

.cost-high {
  color: #f97316;
  font-weight: 600;
}

.cost-premium {
  color: #ef4444;
  font-weight: 600;
}

/* CTA */
.unlock-cta {
  text-align: center;
  margin: 32px 0 16px;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

/* Responsive */
@media (max-width: 768px) {
  .unlock-section {
    padding: 16px;
    border-radius: 12px;
  }

  .unlock-section-hdr h2 {
    font-size: 1rem;
  }

  .unlock-table {
    font-size: 0.8rem;
  }

  .unlock-table th,
  .unlock-table td {
    padding: 8px 10px;
  }

  .unlock-section-desc {
    padding-left: 0;
    margin-left: 0;
  }

  .unlock-plan-badge {
    font-size: 0.85rem;
    padding: 10px 18px;
  }

  .unlock-plan-badge strong {
    font-size: 0.95rem;
  }

  .model-chip {
    font-size: 0.72rem;
    padding: 2px 8px;
  }
}

/* ============================================
   Tutorial Card System (YJ教學卡片模組-01)
   ============================================ */

/* -- Progress Bar -- */
.tutorial-progress-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 22px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.tutorial-progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.tutorial-progress-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

#tutorialProgressCount {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--primary-hover);
}

.tutorial-progress-track {
  height: 10px;
  background: #e8f5f4;
  border-radius: 6px;
  overflow: hidden;
}

.tutorial-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 6px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* -- Reward Summary -- */
.tutorial-reward-summary {
  background: linear-gradient(135deg, #fff7ed, #fef3c7);
  border: 1px solid #fbbf24;
  border-radius: 10px;
  padding: 12px 18px;
  margin-bottom: 20px;
  font-size: 0.88rem;
  color: #92400e;
  text-align: center;
}
.tutorial-reward-summary strong { color: #d97706; }

/* -- Category -- */
.tutorial-category {
  margin-bottom: 28px;
}

.tutorial-category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.tutorial-category-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}

.tutorial-category-reward {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: #fff7ed;
  color: #ea580c;
  border: 1px solid #fdba74;
}
.tutorial-category-reward.claimed {
  background: #f0fdf4;
  color: #16a34a;
  border-color: #86efac;
}

/* -- Tutorial Grid -- */
.tutorial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

/* -- Tutorial Card -- */
.tutorial-card {
  box-shadow: var(--card-shadow);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
}

.tutorial-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--card-shadow-hover);
}

.tutorial-card.completed {
  background: #f0fdf4;
  border-color: #86efac;
}

.tutorial-card.completed:hover {
  border-color: #4ade80;
}

.tutorial-card-new {
  position: absolute;
  top: -6px;
  right: 12px;
  background: linear-gradient(135deg, #F59E0B, #FBBF24);
  color: white;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  letter-spacing: 0.05em;
  animation: newPulse 2s ease-in-out infinite;
}

@keyframes newPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.tutorial-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.tutorial-card-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.tutorial-card-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.tutorial-card-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  line-height: 1.5;
}

.tutorial-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.tutorial-card-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.tutorial-card-time i { margin-right: 4px; }

.tutorial-card-status {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.tutorial-card-status.todo {
  background: rgba(58, 54, 201, 0.1);
  color: var(--primary-hover);
}

.tutorial-card-status.done {
  background: #dcfce7;
  color: #16a34a;
}

/* ============================================
   Spotlight Overlay
   ============================================ */

.spotlight-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
}

.spotlight-overlay::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  pointer-events: none;
}

.spotlight-overlay.active {
  opacity: 1;
}

.spotlight-highlight {
  position: fixed;
  border-radius: var(--radius);
  box-shadow: 0 0 0 4000px rgba(0, 0, 0, 0.55);
  z-index: 99999;
  pointer-events: none;
  animation: spotlightPulse 2s ease-in-out infinite;
  border: 2px solid var(--primary);
}

@keyframes spotlightPulse {
  0%, 100% { border-color: var(--primary); box-shadow: 0 0 0 4000px rgba(0,0,0,0.55), 0 0 8px rgba(58, 54, 201, 0.4); }
  50% { border-color: var(--primary-light); box-shadow: 0 0 0 4000px rgba(0,0,0,0.55), 0 0 16px rgba(58, 54, 201, 0.6); }
}

.spotlight-tooltip {
  background: linear-gradient(135deg, #eff1f8, #f7f8fc);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 22px;
  width: 340px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  z-index: 100000;
  animation: spotlightTooltipIn 0.3s ease;
}

@keyframes spotlightTooltipIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.spotlight-tooltip-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.spotlight-step-badge {
  background: var(--primary);
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.spotlight-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}

.spotlight-close-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text);
}

.spotlight-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.spotlight-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
}

.spotlight-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.spotlight-btn-skip {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 7px 16px;
  border-radius: var(--radius);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.15s;
}

.spotlight-btn-skip:hover {
  background: var(--bg-tertiary);
  color: var(--text);
}

.spotlight-btn-next {
  background: var(--primary);
  color: white;
  border: none;
  padding: 7px 20px;
  border-radius: var(--radius);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.spotlight-btn-next:hover {
  background: var(--primary-hover);
}

/* ============================================
   Nav Tip Bubble (Shrimp Red)
   ============================================ */

.nav-tip-bubble {
  position: absolute;
  top: 50%;
  left: 128px;
  transform: translateY(-50%);
  background: linear-gradient(135deg, #EC4899, #F472B6);
  color: white;
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  max-width: 100px;
  white-space: normal;
  line-height: 1.4;
  text-align: center;
  z-index: 10;
  animation: navTipPulse 2.5s ease-in-out infinite;
  pointer-events: none;
}

.nav-tip-bubble::after {
  content: '';
  position: absolute;
  top: 50%;
  left: -5px;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-right: 5px solid #EC4899;
}

/* Teal variant — used for the feedback channel ("問題申訴與鼓勵").
   The label always shows in pink (see .nav-item[data-route="/feedback"]
   below) for permanent visual emphasis; this bubble only appears on
   hover as supplementary tooltip-style messaging. */
.nav-tip-bubble--teal {
  background: linear-gradient(135deg, #3A36C9, #5EEAD4);
  max-width: 132px;
  box-shadow: 0 2px 10px rgba(58, 54, 201, 0.28);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease-out, visibility 0.18s;
  animation: none;
}
.nav-tip-bubble--teal::after {
  border-right-color: #3A36C9;
}
.nav-item:hover > .nav-tip-bubble--teal {
  opacity: 1;
  visibility: visible;
}

/* Permanent pink emphasis on the feedback nav item — this is the
   primary user-feedback channel and the company wants it to stand
   out without requiring an always-on bubble. */
.nav-item[data-route="/feedback"] {
  color: #EC4899;
  font-weight: 600;
}
.nav-item[data-route="/feedback"]:hover {
  color: #DB2777;
}
.nav-item[data-route="/feedback"].active {
  color: #BE185D;
}

/* ── Gold shimmering "蝦教室" tab — boutique flagship-card treatment.
   Solid gold gradient fill with dark text for high contrast (比照訂閱方案
   旗艦卡的金底深字), a card-like rounded shape + glow, and a periodic
   light sweep (::after) for the "閃耀" shine. The base .nav-item already
   sets position:relative + overflow:hidden, so the sweep stays clipped. ── */
.nav-item[data-route="/classroom"] {
  background: linear-gradient(135deg, #7A2E5A 0%, #E8D5B0 50%, #7A2E5A 100%);
  color: #1A1A1A !important;
  font-weight: 700;
  border-radius: 0;
  margin: 3px 6px 5px;
  box-shadow: 0 2px 10px rgba(201, 169, 110, 0.35),
              inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.nav-item[data-route="/classroom"] > span {
  color: #1A1A1A !important;
  position: relative;
  z-index: 1;
}
/* whole tab is gold, so drop the 3px left accent bar */
.nav-item[data-route="/classroom"]::before { display: none; }
.nav-item[data-route="/classroom"]:hover {
  background: linear-gradient(135deg, #D4B57A 0%, #F0E0C0 50%, #D4B57A 100%);
  color: #1A1A1A;
  box-shadow: 0 4px 16px rgba(201, 169, 110, 0.5),
              inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
.nav-item[data-route="/classroom"].active {
  background: linear-gradient(135deg, #7A2E5A 0%, #E8D5B0 50%, #7A2E5A 100%);
  color: #1A1A1A !important;
  font-weight: 700;
}
.nav-item[data-route="/classroom"]::after {
  content: '';
  position: absolute;
  top: 0;
  left: -130%;
  width: 55%;
  height: 100%;
  background: linear-gradient(100deg,
              transparent 0%,
              rgba(255, 255, 255, 0.65) 50%,
              transparent 100%);
  transform: skewX(-20deg);
  pointer-events: none;
  z-index: 0;
  animation: classroomShine 4s ease-in-out infinite;
  animation-delay: 1.2s;
}
@keyframes classroomShine {
  0%   { left: -130%; }
  55%  { left: 150%; }
  100% { left: 150%; }
}
@media (prefers-reduced-motion: reduce) {
  .nav-item[data-route="/classroom"]::after { animation: none; }
}

/* ── Gold shine on 蝦教室 course「一鍵試做」CTA — same flagship treatment as the
   sidebar 蝦教室 tab (gold fill + dark text + periodic light-sweep, reusing
   @keyframes classroomShine above) so the primary action reads as important
   across all themes. Overrides btn-primary's var(--primary) for this button. ── */
.cc-try-btn {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #7A2E5A 0%, #E8D5B0 50%, #7A2E5A 100%) !important;
  color: #1A1A1A !important;
  font-weight: 700;
  /* 置中（父層 .cc-try 已 flex justify-center）＋放大為原尺寸 1.2 倍；
     以中心為原點縮放故仍維持水平置中。周圍留白充足，不會與上方 meta／下方
     步驟區重疊。 */
  transform: scale(1.2);
  transform-origin: center;
  box-shadow: 0 2px 12px rgba(201, 169, 110, 0.4),
              inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.cc-try-btn:hover {
  background: linear-gradient(135deg, #D4B57A 0%, #F0E0C0 50%, #D4B57A 100%) !important;
  color: #1A1A1A !important;
  box-shadow: 0 4px 18px rgba(201, 169, 110, 0.55),
              inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.cc-try-btn .cc-try-label {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.cc-try-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -130%;
  width: 55%;
  height: 100%;
  background: linear-gradient(100deg,
              transparent 0%,
              rgba(255, 255, 255, 0.65) 50%,
              transparent 100%);
  transform: skewX(-20deg);
  pointer-events: none;
  z-index: 0;
  animation: classroomShine 4s ease-in-out infinite;
  animation-delay: 1.2s;
}
@media (prefers-reduced-motion: reduce) {
  .cc-try-btn::after { animation: none; }
}

@keyframes navTipPulse {
  0%, 100% { opacity: 1; transform: translateY(-50%); }
  50% { opacity: 0.82; transform: translateY(-50%); }
}

/* Mobile: bubble positioned to the right */
@media (max-width: 768px) {
  .nav-tip-bubble {
    position: absolute;
    top: 50%;
    left: auto;
    right: -4px;
    transform: translateY(-50%);
    max-width: 140px;
    white-space: normal;
    text-align: left;
    animation: navTipPulseMobile 2.5s ease-in-out infinite;
  }

  .nav-tip-bubble::after {
    bottom: auto;
    top: 50%;
    left: -5px;
    right: auto;
    transform: translateY(-50%);
    border-left: none;
    border-right: 5px solid #EC4899;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
  }

  /* Teal feedback bubble stays hover-only on mobile (where hover ≈ tap).
     Inherits right-anchored position from base .nav-tip-bubble. */
  .nav-tip-bubble--teal {
    animation: none;
  }

  @keyframes navTipPulseMobile {
    0%, 100% { opacity: 1; transform: translateY(-50%); }
    50% { opacity: 0.82; transform: translateY(-50%); }
  }

  .tutorial-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   Zodiac Picker (龍蝦星座選擇器)
   ============================================ */

.zodiac-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.zodiac-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 6px;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--surface);
  user-select: none;
}

.zodiac-item:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(58, 54, 201, 0.15);
}

.zodiac-item.selected {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(58, 54, 201, 0.08), rgba(129, 216, 208, 0.12));
  box-shadow: 0 0 0 1px var(--primary), 0 4px 16px rgba(58, 54, 201, 0.2);
  transform: translateY(-2px);
}

.zodiac-item.locked {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.zodiac-item-emoji {
  font-size: 1.5rem;
  line-height: 1;
}

.zodiac-item-name {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.zodiac-item.selected .zodiac-item-name {
  color: var(--primary-hover);
}

/* Preview card shown after selecting */
.zodiac-preview {
  margin-top: 14px;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(58, 54, 201, 0.06), rgba(236, 72, 153, 0.06));
  border: 1px solid rgba(58, 54, 201, 0.25);
  border-radius: var(--radius);
  text-align: center;
  animation: zodiacPreviewIn 0.3s ease;
}

@keyframes zodiacPreviewIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.zodiac-preview-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-hover);
  margin-bottom: 4px;
}

.zodiac-preview-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Settings page zodiac section */
.zodiac-settings-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
}

.zodiac-settings-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.zodiac-settings-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.zodiac-settings-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* Locked state for free users */
.zodiac-locked-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(236, 72, 153, 0.08));
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.zodiac-locked-banner .lock-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .zodiac-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .zodiac-item {
    padding: 10px 4px;
  }

  .zodiac-item-emoji {
    font-size: 1.3rem;
  }
}

/* ============================================
   Personality System Tabs + MBTI Grid
   ============================================ */

.personality-system-tabs {
  display: flex;
  gap: 10px;
  padding: 6px;
  background: linear-gradient(135deg, rgba(58,54,201,0.06) 0%, rgba(58,54,201,0.02) 100%);
  border-radius: 14px;
  border: 1px solid rgba(58, 54, 201, 0.12);
  margin-bottom: 18px;
}

.personality-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 14px 16px 12px;
  border: 1.5px solid transparent;
  background: transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  overflow: hidden;
}

.personality-tab::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 10px;
  background: radial-gradient(circle at 50% 120%, rgba(58,54,201,0.08) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.personality-tab:hover::before {
  opacity: 1;
}

.personality-tab-icon {
  font-size: 1.5rem;
  line-height: 1;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.personality-tab:hover .personality-tab-icon {
  transform: scale(1.12) translateY(-1px);
}

.mbti-geo-icon {
  color: var(--text-muted);
  transition: color 0.3s ease;
}

.personality-tab.active .mbti-geo-icon {
  color: var(--primary-hover);
}

.personality-tab-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  transition: color 0.3s ease;
}

.personality-tab-desc {
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--text-muted);
  opacity: 0.55;
  transition: opacity 0.3s ease;
}

.personality-tab.active {
  background: var(--surface);
  border-color: #DDAA00;
  box-shadow:
    0 1px 4px rgba(221, 170, 0, 0.15),
    0 4px 12px rgba(221, 170, 0, 0.08);
}

.personality-tab.active .personality-tab-label {
  color: var(--primary-hover);
}

.personality-tab.active .personality-tab-desc {
  opacity: 0.8;
  color: var(--primary);
}

.personality-tab.active .personality-tab-icon {
  animation: tabIconPulse 2s ease-in-out infinite;
}

@keyframes tabIconPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.personality-tab.locked {
  opacity: 0.55;
}

.personality-tab:hover:not(.active) {
  background: rgba(255,255,255,0.6);
  border-color: rgba(58, 54, 201, 0.15);
}

.personality-tab:hover:not(.active) .personality-tab-label {
  color: var(--text-secondary);
}

.personality-tab:active:not(.locked) {
  transform: scale(0.97);
}

/* MBTI Grid */
.mbti-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.mbti-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 6px;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--surface);
  user-select: none;
}

.mbti-item:hover {
  border-color: var(--group-color, var(--primary));
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.mbti-item.selected {
  border-color: var(--group-color, var(--primary));
  background: linear-gradient(135deg, color-mix(in srgb, var(--group-color, var(--primary)) 8%, transparent), color-mix(in srgb, var(--group-color, var(--primary)) 14%, transparent));
  box-shadow: 0 0 0 1px var(--group-color, var(--primary)), 0 4px 16px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

.mbti-item-emoji {
  font-size: 1.3rem;
  line-height: 1;
}

.mbti-item-code {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--group-color, var(--text));
  letter-spacing: 0.05em;
}

.mbti-item-name {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.mbti-item.selected .mbti-item-code,
.mbti-item.selected .mbti-item-name {
  color: var(--group-color, var(--primary-hover));
}

@media (max-width: 768px) {
  .mbti-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
  .mbti-item {
    padding: 8px 4px;
  }
  .personality-tab {
    padding: 10px 8px 8px;
  }
  .personality-tab-icon {
    font-size: 1.25rem;
  }
  .personality-tab-label {
    font-size: 0.78rem;
  }
  .personality-tab-desc {
    font-size: 0.65rem;
  }
}

/* ============================================
   Mobile Chat UI (LINE/Telegram-style)
   ============================================ */
@media (max-width: 768px) {
  /* --- Global mobile overflow fix --- */
  body,
  .main-content,
  .content-area {
    overflow-x: hidden;
    max-width: 100vw;
  }

  /* --- Task List: compact cards --- */
  .content-area {
    padding: 12px;
    box-sizing: border-box;
    width: 100%;
  }

  .content-area h2 {
    font-size: 1.2rem;
  }

  .card {
    max-width: 100%;
    overflow: hidden;
    word-break: break-word;
    box-sizing: border-box;
  }

  .content-area .card.mb-2 {
    padding: 12px;
  }

  .content-area .card.mb-2 strong {
    font-size: 0.9rem;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60vw;
  }

  .content-area .card.mb-2 .text-sm {
    word-break: break-word;
    overflow-wrap: break-word;
  }

  /* Task list flex row — prevent overflow */
  .content-area .card .flex.justify-between {
    flex-wrap: nowrap;
    gap: 8px;
  }

  .content-area .card .flex.justify-between > div:first-child {
    flex: 1;
    min-width: 0;
    overflow: hidden;
  }

  /* --- Task Detail: Chat Layout --- */
  .chat-mobile-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
  }

  .chat-mobile-header h2 {
    font-size: 1rem;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
  }

  /* Chat messages container */
  #task-messages {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 8px;
    min-height: calc(100vh - 200px);
  }

  /* Chat bubble base */
  .chat-bubble {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 1.05rem;
    line-height: 1.6;
    word-break: break-word;
    position: relative;
    animation: bubbleIn 0.2s ease;
  }

  @keyframes bubbleIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
  }

  /* User bubble: right side, teal */
  .chat-bubble-user {
    align-self: flex-end;
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 4px;
  }

  .chat-bubble-user .bubble-time {
    color: rgba(255,255,255,0.7);
  }

  /* Bot bubble: left side, surface (theme-aware so 深色 noir 不會白底淺字看不見) */
  .chat-bubble-bot {
    align-self: flex-start;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  }

  /* Tool bubble: left side, warm tint over surface (theme-aware; 暖橘味在淺/深色都保留且可讀) */
  .chat-bubble-tool {
    align-self: flex-start;
    background: color-mix(in srgb, var(--surface) 88%, #ff9800 12%);
    color: var(--text);
    border: 1px solid rgba(255,152,0,0.2);
    border-bottom-left-radius: 4px;
    font-size: 0.95rem;
    max-width: 90%;
  }

  .chat-bubble .bubble-role {
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 4px;
    opacity: 0.75;
  }

  .chat-bubble .bubble-time {
    font-size: 0.75rem;
    margin-top: 4px;
    text-align: right;
    opacity: 0.6;
  }

  /* Override card-based message layout on mobile */
  .chat-bubble .msg-content {
    font-size: 1.05rem;
    line-height: 1.7;
  }

  .chat-bubble .msg-content pre {
    font-size: 0.88rem !important;
    padding: 8px !important;
  }

  /* Sticky chat input at bottom */
  #chat-input-area {
    position: sticky;
    bottom: 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 8px 12px !important;
    margin: 0 -12px !important;
    border-radius: 0 !important;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
    z-index: 10;
  }

  #chat-input-area .form-control {
    font-size: 1rem;
    border-radius: 20px;
    padding: 8px 16px;
    min-height: 38px !important;
  }

  #chat-input-area .btn-primary {
    border-radius: 50%;
    width: 38px;
    height: 38px;
    padding: 0;
    font-size: 0.85rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Thinking indicator */
  #thinking-indicator {
    padding: 8px 14px !important;
    background: white;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border);
    max-width: 60%;
    align-self: flex-start;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  }

  /* Task info card — compact on mobile */
  .task-info-compact {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-align: center;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    margin: 0 auto 8px;
    max-width: 90%;
  }

  /* New task form mobile */
  #new-task-form {
    padding: 12px !important;
  }

  #new-task-form .flex.gap-2 {
    flex-direction: column;
  }

  #new-task-form .form-group[style*="width:160px"] {
    width: 100% !important;
  }

  /* Hide topbar credits on mobile to save space */
  .topbar {
    padding: 0 12px;
    height: 48px;
  }

  .topbar-credits {
    font-size: 0.75rem;
    padding: 4px 8px;
  }

  .topbar-credits span[data-i18n] {
    display: none;
  }
}

/* ============================================
   Crawfish Mascot Walker (topbar)
   ============================================ */

.topbar-left {
  display: flex;
  align-items: center;
}

.crawfish-walker {
  flex: 1;
  position: relative;
  height: 100%;
  margin: 0 16px;
  overflow: hidden;
  pointer-events: auto;
  --walk-distance: 0px;
  --walk-duration: 39s;
}

.crawfish-sprite {
  position: absolute;
  top: 50%;
  left: 0;
  width: 62px;
  height: 34px;
  color: var(--text-secondary);
  transform: translate(0, -50%) scaleX(1);
  animation: crawfish-walk var(--walk-duration) linear infinite;
  will-change: transform;
}

.crawfish-body {
  width: 100%;
  height: 100%;
  transform-origin: 50% 100%;
}

.crawfish-svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

/* Walking — translate across, flip at the ends */
@keyframes crawfish-walk {
  0%,  5%   { transform: translate(0, -50%) scaleX(1); }
  45%       { transform: translate(var(--walk-distance), -50%) scaleX(1); }
  50%, 55%  { transform: translate(var(--walk-distance), -50%) scaleX(-1); }
  95%       { transform: translate(0, -50%) scaleX(-1); }
  100%      { transform: translate(0, -50%) scaleX(1); }
}

/* Legs — alternating step */
.crawfish-leg {
  transform-box: fill-box;
  transform-origin: 50% 0%;
  animation: crawfish-step 1.11s ease-in-out infinite;
}
.leg-1, .leg-3 { animation-delay: 0s; }
.leg-2, .leg-4 { animation-delay: -0.55s; }

@keyframes crawfish-step {
  0%, 100% { transform: rotate(-14deg); }
  50%      { transform: rotate(14deg); }
}

/* Antennae — gentle wave */
.crawfish-antenna {
  transform-box: fill-box;
  transform-origin: 0% 100%;
  animation: crawfish-antenna 2.4s ease-in-out infinite;
}
.crawfish-antenna-b { animation-delay: -0.9s; animation-duration: 2.8s; }

@keyframes crawfish-antenna {
  0%, 100% { transform: rotate(-3deg); }
  50%      { transform: rotate(4deg); }
}

/* Eye default state */
.crawfish-eye-closed { opacity: 0; }
.crawfish-eye-open   { opacity: 1; }

/* Hidden easter-egg props by default */
.crawfish-zzz,
.crawfish-tea,
.crawfish-bed,
.crawfish-breakfast,
.crawfish-dinner,
.crawfish-fitness,
.crawfish-mj,
.crawfish-shopping,
.crawfish-reading,
.crawfish-music,
.crawfish-umbrella,
.crawfish-gaming,
.crawfish-bath,
.crawfish-writing,
.crawfish-photo,
.crawfish-hiking,
.crawfish-fishing,
.crawfish-swim,
.crawfish-weights,
.crawfish-yoga,
.crawfish-bike,
.crawfish-scooter,
.crawfish-sick,
.crawfish-travel,
.crawfish-date,
.crawfish-celebrate,
.crawfish-xmas,
.crawfish-newyear,
.crawfish-valentine { opacity: 0; transition: opacity 0.4s ease; }

/* Hover — pause to look at you (but magnifier keeps animating so detail stays lively) */
.crawfish-walker:not(.crawfish-magnifier-mode):hover .crawfish-sprite,
.crawfish-walker:not(.crawfish-magnifier-mode):hover .crawfish-leg,
.crawfish-walker:not(.crawfish-magnifier-mode):hover .crawfish-antenna {
  animation-play-state: paused;
}

/* ==========================================================================
   CRAWFISH MAGNIFIER
   Circular 4× live copy shown on desktop hover or mobile long-press.
   Inherits every state-class animation (is-swim, is-fitness, ...) via the
   shared `.crawfish-walker` class, but overrides walking + sizing to stay
   stationary as a detail lens.
   ========================================================================== */
.crawfish-walker.crawfish-magnifier-mode {
  position: fixed;
  top: 0;
  left: 0;
  flex: none;
  width: 280px;
  height: 280px;
  margin: 0;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-card, #fff);
  border: 2px solid var(--border-color, rgba(0, 0, 0, 0.12));
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18), 0 2px 6px rgba(0, 0, 0, 0.08);
  opacity: 0;
  visibility: hidden;
  transform: scale(0.6);
  transform-origin: top right;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s;
  pointer-events: none;
  z-index: 9500;
}

.crawfish-walker.crawfish-magnifier-mode.is-visible {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0s;
}

/* Render at 4× intrinsic size instead of CSS transform scale. iOS Safari
   and some Android browsers rasterize transformed elements onto a bitmap
   at the *original* 62×34 size, then stretch — which looks blurry on
   high-DPR mobile screens. Letting the SVG render at 248×136 directly
   keeps vector crispness on every platform. */
.crawfish-walker.crawfish-magnifier-mode .crawfish-sprite {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 248px;
  height: 136px;
  animation: none !important;
  transform: translate(-50%, -50%) !important;
  transform-origin: 50% 50%;
  will-change: auto;
}

/* Touch: stop the browser's default long-press context menu / text selection. */
.crawfish-walker {
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* Sleeping state (nap / midnight / occasional) — in bed */
.crawfish-walker.is-sleeping .crawfish-sprite,
.crawfish-walker.is-sleeping .crawfish-leg {
  animation-play-state: paused;
}
.crawfish-walker.is-sleeping .crawfish-eye-open   { opacity: 0; }
.crawfish-walker.is-sleeping .crawfish-eye-closed { opacity: 1; }
.crawfish-walker.is-sleeping .crawfish-legs      { opacity: 0; transition: opacity 0.3s ease; }
.crawfish-walker.is-sleeping .crawfish-bed {
  opacity: 0.85;
  animation: crawfish-bed-in 0.45s ease-out;
}
.crawfish-walker.is-sleeping .crawfish-zzz {
  opacity: 0.75;
  animation: crawfish-zzz 3s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: 50% 100%;
}
.crawfish-walker.is-sleeping .crawfish-body {
  animation: crawfish-breathe 3s ease-in-out infinite;
}

@keyframes crawfish-breathe {
  0%, 100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(0.5px) scale(1.015); }
}
@keyframes crawfish-zzz {
  0%, 100% { transform: translate(0, 0); opacity: 0.35; }
  50%      { transform: translate(1px, -2px); opacity: 0.8; }
}
@keyframes crawfish-bed-in {
  0%   { opacity: 0; transform: translateY(3px); }
  100% { opacity: 0.85; transform: translateY(0); }
}

/* Tea-time state (afternoon / occasional) */
.crawfish-walker.is-tea .crawfish-sprite,
.crawfish-walker.is-tea .crawfish-leg {
  animation-play-state: paused;
}
.crawfish-walker.is-tea .crawfish-tea {
  opacity: 0.9;
  animation: crawfish-tea-in 0.45s ease-out;
}
.crawfish-walker.is-tea .crawfish-claw-big {
  transform-box: fill-box;
  transform-origin: 0% 100%;
  transform: rotate(-4deg);
  transition: transform 0.4s ease;
}
@keyframes crawfish-tea-in {
  0%   { opacity: 0; transform: translateY(-2px); }
  100% { opacity: 0.9; transform: translateY(0); }
}

/* Happy jump (credits increased) */
.crawfish-walker.is-happy .crawfish-body {
  animation: crawfish-jump 0.9s cubic-bezier(0.28, 0.84, 0.42, 1);
}
@keyframes crawfish-jump {
  0%   { transform: translateY(0) scaleY(1); }
  18%  { transform: translateY(0) scaleY(0.82); }
  42%  { transform: translateY(-9px) scaleY(1.08); }
  62%  { transform: translateY(-4px) scaleY(0.98); }
  82%  { transform: translateY(0)   scaleY(1.04); }
  100% { transform: translateY(0)   scaleY(1); }
}

/* ============================================
   Tap reaction + speech bubble (interaction)
   ============================================ */
.crawfish-walker.is-reacting .crawfish-body {
  animation: crawfish-wiggle 0.7s ease-in-out;
}
@keyframes crawfish-wiggle {
  0%   { transform: rotate(0deg); }
  20%  { transform: rotate(-9deg); }
  40%  { transform: rotate(7deg); }
  60%  { transform: rotate(-5deg); }
  80%  { transform: rotate(3deg); }
  100% { transform: rotate(0deg); }
}

.crawfish-bubble {
  position: fixed;
  z-index: 9600;
  max-width: min(240px, 72vw);
  padding: 7px 12px;
  background: #fff;
  color: #b03a6e;
  font-size: 0.82rem;
  line-height: 1.35;
  font-weight: 600;
  border: 1.5px solid #ffd0e2;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(176, 58, 110, 0.18);
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px) scale(0.96);
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.crawfish-bubble.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.crawfish-bubble::after {
  content: "";
  position: absolute;
  left: var(--tail-x, 24px);
  top: -6px;
  width: 11px; height: 11px;
  background: #fff;
  border-left: 1.5px solid #ffd0e2;
  border-top: 1.5px solid #ffd0e2;
  transform: rotate(45deg);
}
.crawfish-bubble.tail-down::after {
  top: auto;
  bottom: -6px;
  border-left: none; border-top: none;
  border-right: 1.5px solid #ffd0e2;
  border-bottom: 1.5px solid #ffd0e2;
}
@media (max-width: 768px) {
  .crawfish-bubble { font-size: 0.8rem; max-width: 78vw; padding: 6px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .crawfish-walker.is-reacting .crawfish-body { animation: none; }
  .crawfish-bubble { transition: opacity 0.12s ease; transform: none; }
}

/* Hungry: low 蝦飼料 balance — subtle desaturated look (filter only, so it
   never fights the body/sprite transform animations). */
.crawfish-walker.is-hungry .crawfish-sprite {
  filter: saturate(0.6) brightness(0.95);
}

/* ============================================
   Scheduled meal moods (Phase 1)
   ============================================ */

/* Breakfast (7-8 AM) */
.crawfish-walker.is-breakfast .crawfish-sprite,
.crawfish-walker.is-breakfast .crawfish-leg {
  animation-play-state: paused;
}
.crawfish-walker.is-breakfast .crawfish-breakfast { opacity: 0.9; }

/* Dinner (6-7 PM) */
.crawfish-walker.is-dinner .crawfish-sprite,
.crawfish-walker.is-dinner .crawfish-leg {
  animation-play-state: paused;
}
.crawfish-walker.is-dinner .crawfish-dinner { opacity: 0.9; }
.crawfish-walker.is-dinner .crawfish-steam {
  animation: crawfish-steam 2.2s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: 50% 100%;
}
.crawfish-walker.is-dinner .crawfish-steam-b { animation-delay: -0.7s; }
.crawfish-walker.is-dinner .crawfish-steam-c { animation-delay: -1.4s; }

@keyframes crawfish-steam {
  0%, 100% { transform: translateY(0) scaleY(1); opacity: 0.25; }
  50%      { transform: translateY(-1.2px) scaleY(1.15); opacity: 0.65; }
}

/* ============================================
   Activity moods (Phase 2+3) — 10-min rotation
   ============================================ */

/* Pause walking for seated/standing activities */
.crawfish-walker.is-fitness .crawfish-sprite,
.crawfish-walker.is-reading .crawfish-sprite,
.crawfish-walker.is-gaming .crawfish-sprite,
.crawfish-walker.is-bath .crawfish-sprite,
.crawfish-walker.is-writing .crawfish-sprite,
.crawfish-walker.is-photo .crawfish-sprite,
.crawfish-walker.is-fishing .crawfish-sprite,
.crawfish-walker.is-weights .crawfish-sprite,
.crawfish-walker.is-yoga .crawfish-sprite,
.crawfish-walker.is-sick .crawfish-sprite,
.crawfish-walker.is-fitness .crawfish-leg,
.crawfish-walker.is-reading .crawfish-leg,
.crawfish-walker.is-gaming .crawfish-leg,
.crawfish-walker.is-bath .crawfish-leg,
.crawfish-walker.is-writing .crawfish-leg,
.crawfish-walker.is-photo .crawfish-leg,
.crawfish-walker.is-fishing .crawfish-leg,
.crawfish-walker.is-weights .crawfish-leg,
.crawfish-walker.is-yoga .crawfish-leg,
.crawfish-walker.is-sick .crawfish-leg {
  animation-play-state: paused;
}

/* Walk-speed variants */
.crawfish-walker.is-shopping .crawfish-sprite { animation-duration: 26s; }
.crawfish-walker.is-umbrella .crawfish-sprite { animation-duration: 68s; }
.crawfish-walker.is-hiking   .crawfish-sprite { animation-duration: 61s; }
.crawfish-walker.is-swim     .crawfish-sprite { animation-duration: 60s; }
.crawfish-walker.is-bike     .crawfish-sprite { animation-duration: 28s; }
.crawfish-walker.is-scooter  .crawfish-sprite { animation-duration: 30s; }
.crawfish-walker.is-travel   .crawfish-sprite { animation-duration: 38s; }
.crawfish-walker.is-date     .crawfish-sprite { animation-duration: 48s; }

/* Prop visibility */
.crawfish-walker.is-fitness  .crawfish-fitness  { opacity: 0.95; }
.crawfish-walker.is-mj       .crawfish-mj       { opacity: 0.95; }
.crawfish-walker.is-shopping .crawfish-shopping { opacity: 0.95; }
.crawfish-walker.is-reading  .crawfish-reading  { opacity: 0.95; }
.crawfish-walker.is-music    .crawfish-music    { opacity: 0.95; }
.crawfish-walker.is-umbrella .crawfish-umbrella { opacity: 0.9; }
.crawfish-walker.is-gaming   .crawfish-gaming   { opacity: 0.95; }
.crawfish-walker.is-bath     .crawfish-bath     { opacity: 0.95; }
.crawfish-walker.is-writing  .crawfish-writing  { opacity: 0.95; }
.crawfish-walker.is-photo    .crawfish-photo    { opacity: 0.95; }
.crawfish-walker.is-hiking   .crawfish-hiking   { opacity: 0.9; }
.crawfish-walker.is-fishing  .crawfish-fishing  { opacity: 0.95; }
.crawfish-walker.is-swim     .crawfish-swim     { opacity: 0.9; }
.crawfish-walker.is-weights  .crawfish-weights  { opacity: 0.95; }
.crawfish-walker.is-yoga     .crawfish-yoga     { opacity: 0.9; }
.crawfish-walker.is-bike     .crawfish-bike     { opacity: 0.95; }
.crawfish-walker.is-scooter  .crawfish-scooter  { opacity: 0.95; }
.crawfish-walker.is-sick     .crawfish-sick     { opacity: 0.95; }
.crawfish-walker.is-travel   .crawfish-travel   { opacity: 0.95; }
.crawfish-walker.is-date     .crawfish-date     { opacity: 0.95; }

/* Fitness: body bobs (squat motion) */
.crawfish-walker.is-fitness .crawfish-body {
  animation: crawfish-squat 1s ease-in-out infinite;
}
@keyframes crawfish-squat {
  0%, 100% { transform: translateY(0) scaleY(1); }
  50%      { transform: translateY(1px) scaleY(0.94); }
}

/* MJ: moonwalk + notes + sparkles */
.crawfish-walker.is-mj .crawfish-sprite {
  animation: crawfish-moonwalk 5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes crawfish-moonwalk {
  0%, 100% { transform: translate(var(--walk-distance), -50%) scaleX(1); }
  50%      { transform: translate(0, -50%) scaleX(1); }
}
.crawfish-walker.is-mj .crawfish-mj-note {
  animation: crawfish-note-float 2.4s ease-in-out infinite;
  transform-box: fill-box;
}
.crawfish-walker.is-mj .crawfish-mj-note-b { animation-delay: -0.8s; }
.crawfish-walker.is-mj .crawfish-mj-note-c { animation-delay: -1.6s; }
@keyframes crawfish-note-float {
  0%   { opacity: 0; transform: translate(0, 3px); }
  25%  { opacity: 0.85; }
  75%  { opacity: 0.85; }
  100% { opacity: 0; transform: translate(-4px, -7px); }
}
.crawfish-walker.is-mj .crawfish-mj-spark {
  animation: crawfish-sparkle 0.8s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: 50% 50%;
}
.crawfish-walker.is-mj .crawfish-mj-spark-b { animation-delay: -0.28s; }
.crawfish-walker.is-mj .crawfish-mj-spark-c { animation-delay: -0.53s; }
@keyframes crawfish-sparkle {
  0%, 100% { opacity: 0.15; transform: scale(0.5); }
  50%      { opacity: 1;    transform: scale(1.5); }
}

/* Reading: eye dot scans left-right */
.crawfish-walker.is-reading .crawfish-eye-open {
  animation: crawfish-scan 2.4s ease-in-out infinite;
  transform-box: fill-box;
}
@keyframes crawfish-scan {
  0%, 100% { transform: translateX(-0.8px); }
  50%      { transform: translateX(0.8px); }
}

/* Music: notes float + body sway */
.crawfish-walker.is-music .crawfish-music-note {
  animation: crawfish-note-float 2.8s ease-in-out infinite;
  transform-box: fill-box;
}
.crawfish-walker.is-music .crawfish-music-note-b { animation-delay: -0.93s; }
.crawfish-walker.is-music .crawfish-music-note-c { animation-delay: -1.86s; }
.crawfish-walker.is-music .crawfish-body {
  animation: crawfish-music-sway 0.7s ease-in-out infinite;
}
@keyframes crawfish-music-sway {
  0%, 100% { transform: rotate(-2.5deg) translateY(0); }
  50%      { transform: rotate(2.5deg)  translateY(-0.4px); }
}

/* Umbrella: falling raindrops */
.crawfish-walker.is-umbrella .crawfish-raindrop {
  animation: crawfish-rainfall 1s linear infinite;
  transform-box: fill-box;
}
.crawfish-walker.is-umbrella .crawfish-raindrop-b { animation-delay: -0.2s; }
.crawfish-walker.is-umbrella .crawfish-raindrop-c { animation-delay: -0.45s; }
.crawfish-walker.is-umbrella .crawfish-raindrop-d { animation-delay: -0.7s; }
.crawfish-walker.is-umbrella .crawfish-raindrop-e { animation-delay: -0.35s; }
@keyframes crawfish-rainfall {
  0%   { opacity: 0; transform: translateY(-6px); }
  25%  { opacity: 0.6; }
  75%  { opacity: 0.6; }
  100% { opacity: 0; transform: translateY(4px); }
}

/* Gaming: slight side rocking */
.crawfish-walker.is-gaming .crawfish-body {
  animation: crawfish-game-rock 2s ease-in-out infinite;
}
@keyframes crawfish-game-rock {
  0%, 100% { transform: translateX(-0.6px); }
  50%      { transform: translateX(0.6px); }
}

/* Bath: hide legs + bubbles up + wavering steam */
.crawfish-walker.is-bath .crawfish-legs { opacity: 0; }
.crawfish-walker.is-bath .crawfish-bath-bubble {
  animation: crawfish-bubble 3s ease-in-out infinite;
  transform-box: fill-box;
}
.crawfish-walker.is-bath .crawfish-bath-bubble-b { animation-delay: -0.75s; }
.crawfish-walker.is-bath .crawfish-bath-bubble-c { animation-delay: -1.5s; }
.crawfish-walker.is-bath .crawfish-bath-bubble-d { animation-delay: -2.25s; }
@keyframes crawfish-bubble {
  0%   { opacity: 0; transform: translateY(2px); }
  25%  { opacity: 0.65; }
  75%  { opacity: 0.65; }
  100% { opacity: 0; transform: translateY(-4px); }
}
.crawfish-walker.is-bath .crawfish-bath-steam {
  animation: crawfish-steam 2.2s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: 50% 100%;
}
.crawfish-walker.is-bath .crawfish-bath-steam-b { animation-delay: -0.7s; }
.crawfish-walker.is-bath .crawfish-bath-steam-c { animation-delay: -1.4s; }

/* Writing: quill scribbles */
.crawfish-walker.is-writing .crawfish-writing-quill {
  animation: crawfish-write 0.55s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: 50% 100%;
}
@keyframes crawfish-write {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50%      { transform: translate(0.6px, 0.8px) rotate(-3deg); }
}

/* Photo: flash burst every 3s */
.crawfish-walker.is-photo .crawfish-photo-flash {
  animation: crawfish-flash 3s ease-in-out infinite;
  opacity: 0;
}
@keyframes crawfish-flash {
  0%, 7%, 100% { opacity: 0; }
  3%           { opacity: 1; }
}

/* Hiking: slight uphill tilt */
.crawfish-walker.is-hiking .crawfish-body {
  transform: rotate(-4deg);
}

/* Fishing: small fish wiggles */
.crawfish-walker.is-fishing .crawfish-fishing-fish {
  animation: crawfish-fish-wiggle 2s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: 50% 50%;
}
@keyframes crawfish-fish-wiggle {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50%      { transform: translateY(-1.5px) rotate(4deg); }
}

/* Swim: hide legs (in water) + body bob + bubbles rise */
.crawfish-walker.is-swim .crawfish-legs { opacity: 0; }
.crawfish-walker.is-swim .crawfish-body {
  animation: crawfish-swim-bob 3.2s ease-in-out infinite;
}
@keyframes crawfish-swim-bob {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50%      { transform: translateY(-1px) rotate(1deg); }
}
.crawfish-walker.is-swim .crawfish-swim-bubble {
  animation: crawfish-bubble 2.6s ease-in-out infinite;
  transform-box: fill-box;
}
.crawfish-walker.is-swim .crawfish-swim-bubble-b { animation-delay: -0.65s; }
.crawfish-walker.is-swim .crawfish-swim-bubble-c { animation-delay: -1.3s; }
.crawfish-walker.is-swim .crawfish-swim-bubble-d { animation-delay: -1.95s; }

/* Weights: body trembles from strain */
.crawfish-walker.is-weights .crawfish-body {
  animation: crawfish-strain 0.18s ease-in-out infinite;
}
@keyframes crawfish-strain {
  0%, 100% { transform: translate(-0.3px, 0); }
  50%      { transform: translate(0.3px, 0.2px); }
}

/* Yoga: zen aura ripples expand outward (calm, slow) */
.crawfish-walker.is-yoga .crawfish-yoga-aura {
  animation: crawfish-zen-aura 4s ease-in-out infinite;
  transform-box: fill-box;
}
.crawfish-walker.is-yoga .crawfish-yoga-aura-b { animation-delay: -2s; }
@keyframes crawfish-zen-aura {
  0%   { opacity: 0;    transform: translateY(2px)  scaleX(0.85); }
  35%  { opacity: 0.5; }
  70%  { opacity: 0.5; }
  100% { opacity: 0;    transform: translateY(-3px) scaleX(1.15); }
}

/* Bike: hide legs (sitting) + speed lines streak past */
.crawfish-walker.is-bike .crawfish-legs { opacity: 0; }
.crawfish-walker.is-bike .crawfish-bike-line {
  animation: crawfish-speed-streak 0.55s linear infinite;
  transform-box: fill-box;
}
.crawfish-walker.is-bike .crawfish-bike-line-b { animation-delay: -0.18s; }
.crawfish-walker.is-bike .crawfish-bike-line-c { animation-delay: -0.36s; }
@keyframes crawfish-speed-streak {
  0%   { opacity: 0;   transform: translateX(2px); }
  25%  { opacity: 0.6; }
  75%  { opacity: 0.6; }
  100% { opacity: 0;   transform: translateX(-6px); }
}

/* Scooter: hide legs (standing on deck) + speed lines */
.crawfish-walker.is-scooter .crawfish-legs { opacity: 0; }
.crawfish-walker.is-scooter .crawfish-scooter-line {
  animation: crawfish-speed-streak 0.6s linear infinite;
  transform-box: fill-box;
}
.crawfish-walker.is-scooter .crawfish-scooter-line-b { animation-delay: -0.2s; }

/* Sick: eyes closed + body shivers from fever + sweat drops fall */
.crawfish-walker.is-sick .crawfish-eye-open   { opacity: 0; }
.crawfish-walker.is-sick .crawfish-eye-closed { opacity: 1; }
.crawfish-walker.is-sick .crawfish-body {
  animation: crawfish-shiver 0.35s ease-in-out infinite;
}
@keyframes crawfish-shiver {
  0%, 100% { transform: translate(-0.35px, 0) rotate(-0.4deg); }
  50%      { transform: translate(0.35px, 0.2px) rotate(0.4deg); }
}
.crawfish-walker.is-sick .crawfish-sick-sweat {
  animation: crawfish-sweat-fall 1.6s ease-in-out infinite;
  transform-box: fill-box;
}
.crawfish-walker.is-sick .crawfish-sick-sweat-b { animation-delay: -0.5s; }
.crawfish-walker.is-sick .crawfish-sick-sweat-c { animation-delay: -1s; }
@keyframes crawfish-sweat-fall {
  0%   { opacity: 0;    transform: translateY(-2px); }
  25%  { opacity: 0.65; }
  70%  { opacity: 0.65; }
  100% { opacity: 0;    transform: translateY(6px); }
}

/* Travel: gentle body bob (rolling suitcase) + airplane contrail streaks */
.crawfish-walker.is-travel .crawfish-body {
  animation: crawfish-travel-bob 1.4s ease-in-out infinite;
}
@keyframes crawfish-travel-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-0.4px); }
}
.crawfish-walker.is-travel .crawfish-travel-trail {
  animation: crawfish-speed-streak 1.2s linear infinite;
  transform-box: fill-box;
}
.crawfish-walker.is-travel .crawfish-travel-trail-b { animation-delay: -0.45s; }

/* Date: hearts float up and fade + gentle romantic sway */
.crawfish-walker.is-date .crawfish-body {
  animation: crawfish-date-sway 2.4s ease-in-out infinite;
}
@keyframes crawfish-date-sway {
  0%, 100% { transform: rotate(-1.5deg) translateY(0); }
  50%      { transform: rotate(1.5deg)  translateY(-0.3px); }
}
.crawfish-walker.is-date .crawfish-date-heart {
  animation: crawfish-heart-rise 2.6s ease-in-out infinite;
  transform-box: fill-box;
}
.crawfish-walker.is-date .crawfish-date-heart-b { animation-delay: -0.85s; }
.crawfish-walker.is-date .crawfish-date-heart-c { animation-delay: -1.7s; }
@keyframes crawfish-heart-rise {
  0%   { opacity: 0;    transform: translate(0, 3px)  scale(0.8); }
  25%  { opacity: 0.7;  transform: translate(-1px, 0) scale(1); }
  75%  { opacity: 0.7;  transform: translate(1px, -3px) scale(1.05); }
  100% { opacity: 0;    transform: translate(-1px, -6px) scale(0.9); }
}

/* ============================================
   Event (celebrate) + Festival overlays (Phase 4)
   Festivals are ADDITIVE — they stack with any active mood.
   ============================================ */

/* Celebration: jump + confetti fall (2.5s transient) */
.crawfish-walker.is-celebrating .crawfish-celebrate {
  opacity: 1;
}
.crawfish-walker.is-celebrating .crawfish-body {
  animation: crawfish-celebrate-jump 2.5s ease-in-out;
}
@keyframes crawfish-celebrate-jump {
  0%, 100% { transform: translateY(0) scaleY(1); }
  15%      { transform: translateY(-8px) scaleY(1.08); }
  30%      { transform: translateY(0)    scaleY(0.96); }
  50%      { transform: translateY(-5px) scaleY(1.05); }
  65%      { transform: translateY(0)    scaleY(0.98); }
  80%      { transform: translateY(-2px) scaleY(1.02); }
}
.crawfish-walker.is-celebrating .crawfish-confetti {
  animation: crawfish-confetti-fall 1.8s ease-in infinite;
  transform-box: fill-box;
}
.crawfish-walker.is-celebrating .crawfish-confetti-b { animation-delay: -0.15s; }
.crawfish-walker.is-celebrating .crawfish-confetti-c { animation-delay: -0.35s; }
.crawfish-walker.is-celebrating .crawfish-confetti-d { animation-delay: -0.55s; }
.crawfish-walker.is-celebrating .crawfish-confetti-e { animation-delay: -0.75s; }
.crawfish-walker.is-celebrating .crawfish-confetti-f { animation-delay: -0.95s; }
.crawfish-walker.is-celebrating .crawfish-confetti-g { animation-delay: -1.15s; }
.crawfish-walker.is-celebrating .crawfish-confetti-h { animation-delay: -1.35s; }
@keyframes crawfish-confetti-fall {
  0%   { opacity: 1; transform: translateY(-4px) rotate(0deg); }
  100% { opacity: 0; transform: translateY(28px) rotate(360deg); }
}

/* Festivals — always visible when class present, stack on any mood */
.crawfish-walker.is-xmas      .crawfish-xmas      { opacity: 1; }
.crawfish-walker.is-newyear   .crawfish-newyear   { opacity: 0.9; }
.crawfish-walker.is-valentine .crawfish-valentine { opacity: 0.9; }

.crawfish-walker.is-newyear .crawfish-newyear {
  animation: crawfish-fireworks 1.8s ease-in-out infinite;
}
@keyframes crawfish-fireworks {
  0%, 100% { opacity: 0.25; }
  50%      { opacity: 1; }
}
.crawfish-walker.is-valentine .crawfish-valentine {
  animation: crawfish-heart-float 2s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: 50% 100%;
}
@keyframes crawfish-heart-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-1.8px); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .crawfish-sprite,
  .crawfish-leg,
  .crawfish-antenna,
  .crawfish-body {
    animation: none !important;
  }
}

/* Mobile — keep the lobster visible, just a touch smaller */
@media (max-width: 768px) {
  .crawfish-walker { margin: 0 8px; }
  .crawfish-sprite { width: 52px; height: 28px; }
}

/* ============================================
   Feedback (意見回饋) Page
   ============================================ */

/* Upload zone */
.fb-upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--bg-tertiary);
}

.fb-upload-zone:hover,
.fb-upload-zone.fb-dragover {
  border-color: var(--primary);
  background: rgba(58, 54, 201, 0.06);
}

.fb-upload-placeholder {
  text-align: center;
  color: var(--text-muted);
  padding: 10px;
}

.fb-upload-placeholder p {
  margin: 4px 0 0;
  font-size: 0.85rem;
}

/* Screenshot preview grid */
.fb-screenshot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
}

.fb-screenshot-thumb {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  aspect-ratio: 4/3;
}

.fb-screenshot-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.fb-screenshot-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 0.7rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.fb-screenshot-remove:hover {
  background: var(--danger);
}

.fb-screenshot-idx {
  position: absolute;
  bottom: 4px;
  left: 4px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: 10px;
}

/* History list */
.fb-history-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.fb-history-item:last-child {
  border-bottom: none;
}

.fb-history-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.fb-cat-tag {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.fb-status-tag {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border: 1px solid;
  border-radius: 12px;
}

.fb-history-message {
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 8px;
  white-space: pre-wrap;
}

.fb-history-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.fb-history-screenshots {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.fb-history-thumb {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.15s;
}

.fb-history-thumb:hover {
  transform: scale(1.05);
  border-color: var(--primary);
}

/* Reply block */
.fb-reply-block {
  margin-top: 12px;
  padding: 12px 16px;
  background: rgba(58, 54, 201, 0.06);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.fb-reply-header {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.fb-reply-time {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 400;
}

.fb-reply-content {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  white-space: pre-wrap;
}

/* Screenshot lightbox */
.fb-lightbox {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fb-lightbox-bg {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  cursor: pointer;
}

.fb-lightbox-img {
  position: relative;
  z-index: 1;
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: fbLightboxIn 0.2s ease;
}

.fb-lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 2;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.fb-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

@keyframes fbLightboxIn {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}

/* ============================================
   Iris 客服助理 — 嵌入式對話框（站內客服中心）
   採龍蝦粉 + 金線點綴，呼應 luxury feedback 主題
   ============================================ */

.iris-chat-card {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #E8E2D8);
  border-radius: 0;
  padding: 20px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  overflow: hidden;
  animation: lxFbFadeUp 0.5s ease both;
}

.iris-chat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: #7A2E5A;
  transform: scaleY(1);
  transform-origin: top;
}

.iris-chat-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.iris-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-tertiary, #FAF7F2);
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(196, 114, 127, 0.18);
}

/* ─── Iris 講話浮層（回覆期間影片放大 5x，置中浮在頁面上方）───
   參考 .crawfish-walker.crawfish-magnifier-mode 模式：
   ❶ 用 intrinsic width/height 放大，不用 transform: scale()
      （後者在 iOS Safari / 高 DPR Android 會 rasterize 後拉伸→模糊）
   ❷ 圓形 portrait frame + 邊框 + shadow，視覺上像「Iris 探出畫面」
   ❸ 只在進場退場用 subtle scale（0.85→1）做彈跳感，不靠 scale 放大本體
*/

/* container：固定置中，不放大；圓框 + 卡片風格 */
.iris-avatar-overlay {
  position: fixed;
  top: 64px;             /* 留出 topbar 高度 */
  left: 50%;
  width: 320px;          /* 5x of 64px — intrinsic size, sharp on retina */
  height: 320px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface, #fff);
  border: 4px solid rgba(255, 255, 255, 0.95);
  box-shadow:
    0 16px 48px rgba(236, 72, 153, 0.32),
    0 4px 12px rgba(0, 0, 0, 0.12);
  z-index: 99999;        /* 蓋過 sidebar / modal-overlay（後者 1000）*/
  pointer-events: none;  /* 不擋住用戶點擊或繼續打字 */
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -10px) scale(0.85);
  transform-origin: 50% 0%;
  transition:
    opacity 0.32s ease,
    transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1),  /* slight overshoot */
    visibility 0s linear 0.32s;
}

.iris-avatar-overlay--active {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0) scale(1);
  transition:
    opacity 0.32s ease,
    transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1),
    visibility 0s linear 0s;
}

/* video：intrinsic 320×320，sharp on every device（不依賴 CSS transform） */
.iris-avatar-overlay video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--surface, #fff);
}

/* RWD：手機螢幕窄，320px 會撐爆 — 直接縮 intrinsic size */
@media (max-width: 640px) {
  .iris-avatar-overlay {
    top: 56px;
    width: 220px;
    height: 220px;
  }
}
@media (max-width: 380px) {
  .iris-avatar-overlay {
    width: 180px;
    height: 180px;
  }
}

/* a11y：用戶若偏好減少動態，改 instant fade-only（無 scale 彈跳） */
@media (prefers-reduced-motion: reduce) {
  .iris-avatar-overlay {
    transition: opacity 0.2s ease, visibility 0s linear 0.2s;
    transform: translate(-50%, 0) scale(1);
  }
  .iris-avatar-overlay--active {
    transition: opacity 0.2s ease, visibility 0s linear 0s;
  }
}

.iris-header-info {
  flex: 1;
  min-width: 0;
}

.iris-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text, #1A1A1A);
  display: flex;
  align-items: center;
  gap: 8px;
}

.iris-badge {
  font-family: 'Nunito Sans', sans-serif;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  background: transparent;
  color: #7A2E5A;
  border: 1px solid #7A2E5A;
  padding: 2px 8px;
  border-radius: 0;
}

.iris-tagline {
  font-family: 'Nunito Sans', sans-serif;
  font-size: 0.82rem;
  color: #8A8578;
  margin-top: 4px;
  line-height: 1.5;
}

.iris-chat-messages {
  background: var(--bg-tertiary, #FAF7F2);
  border: 1px solid var(--border, #E8E2D8);
  border-radius: 0;
  padding: 14px;
  min-height: 80px;
  max-height: 340px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.iris-msg {
  max-width: 86%;
  padding: 9px 13px;
  border-radius: 12px;
  font-family: 'Nunito Sans', sans-serif;
  font-size: 0.92rem;
  line-height: 1.55;
  word-wrap: break-word;
  white-space: pre-wrap;
}

.iris-msg-user {
  align-self: flex-end;
  background: linear-gradient(135deg, #C4727F, #B85F6E);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.iris-msg-bot {
  align-self: flex-start;
  background: var(--surface, #fff);
  color: var(--text, #1A1A1A);
  border: 1px solid var(--border, #E8E2D8);
  border-bottom-left-radius: 4px;
  /* bot 走 renderMarkdown HTML → 不要 pre-wrap，讓 <p>/<br>/<ul> 各自控制間距 */
  white-space: normal;
}

/* Markdown 元素樣式（bot 回覆專用） */
.iris-msg-bot strong { font-weight: 600; }
.iris-msg-bot em { font-style: italic; }
.iris-msg-bot p { margin: 0 0 6px 0; }
.iris-msg-bot p:last-child { margin-bottom: 0; }
.iris-msg-bot ul, .iris-msg-bot ol { margin: 6px 0; padding-left: 22px; }
.iris-msg-bot li { margin: 2px 0; }
.iris-msg-bot a { color: #C4727F; text-decoration: underline; }
.iris-msg-bot code {
  background: rgba(0, 0, 0, 0.05);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.88em;
  font-family: ui-monospace, 'SF Mono', Consolas, 'Liberation Mono', monospace;
}
.iris-msg-bot pre {
  margin: 6px 0;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 6px;
  overflow-x: auto;
  font-size: 0.85em;
}
.iris-msg-bot pre code { background: none; padding: 0; }

.iris-msg-typing {
  align-self: flex-start;
  color: #8A8578;
  font-family: 'Nunito Sans', sans-serif;
  font-size: 0.85rem;
  font-style: italic;
  padding: 4px 0;
}

.iris-form-hint {
  align-self: flex-start;
  background: #FDF6E3;
  border: 1px solid #E8D5B0;
  color: #6B4F2C;
  padding: 9px 12px;
  border-radius: 0;
  font-family: 'Nunito Sans', sans-serif;
  font-size: 0.84rem;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 95%;
  flex-wrap: wrap;
}

.iris-form-hint-icon { font-size: 1rem; }
.iris-form-hint-text { font-weight: 600; }

.iris-form-hint button {
  background: #1A1A1A;
  color: #FAF7F2;
  border: none;
  padding: 6px 14px;
  border-radius: 0;
  font-family: 'Nunito Sans', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.25s ease;
}

.iris-form-hint button:hover {
  background: #7A2E5A;
  color: #fff;
}

.iris-chat-input-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.iris-chat-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border, #E8E2D8);
  border-radius: 0;
  font-family: 'Nunito Sans', sans-serif;
  font-size: 0.95rem;
  outline: none;
  background: var(--surface, #fff);
  color: var(--text, #1A1A1A);
  transition: border-color 0.25s ease;
}

.iris-chat-input:focus {
  border-color: #7A2E5A;
}

.iris-chat-input:disabled {
  background: #F5F2EC;
  color: #B5B0A5;
  cursor: not-allowed;
}

.iris-send-btn {
  background: #1A1A1A;
  color: #FAF7F2;
  border: none;
  padding: 10px 18px;
  border-radius: 0;
  font-family: 'Nunito Sans', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.25s ease;
  position: relative;
  overflow: hidden;
}

.iris-send-btn::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: #7A2E5A;
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.iris-send-btn:hover:not(:disabled) {
  background: #2A2A2A;
}

.iris-send-btn:hover:not(:disabled)::after {
  transform: scaleX(1);
}

.iris-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.iris-send-icon { font-size: 1rem; }

/* 撥話按鈕（Phase 1 disabled — 視覺保留、灰調，hover 顯示 tooltip） */
.iris-voice-call-btn {
  flex-shrink: 0;
  /* 2026-05-17: 改為「綠底白字 + 白話筒」— 對齊 WhatsApp / iOS Phone app
     接聽按鈕的全球認知，視覺更突出（從原本白底灰邊改成 filled style）。
     locked 狀態仍是金邊灰調（明確區別「解鎖中」與「可撥打」）。 */
  background: #16a34a;          /* tailwind green-600 */
  color: #fff;
  border: 1px solid #15803d;    /* green-700，比底色深一階 */
  border-radius: 24px;
  padding: 8px 16px;
  font-family: 'Nunito Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 1px 3px rgba(22, 163, 74, 0.25);
}

.iris-voice-call-btn:hover {
  background: #15803d;          /* green-700 hover 加深 */
  border-color: #14532d;        /* green-900 邊框再深一階 */
  color: #fff;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.4);
}

.iris-voice-call-btn--disabled {
  opacity: 0.6;
  cursor: help;
}

/* tier_locked 狀態：tier < pro 用戶看到此樣式
   - 整體灰調 + 金色描邊（暗示「升級」）
   - 右上角 🔒 emoji overlay
   - hover 變金色，提示可點按了解升級 */
.iris-voice-call-btn--locked {
  position: relative;
  background: var(--bg-secondary, #fafaf7);
  color: #8A8578;
  border: 1px solid #7A2E5A;
  cursor: pointer;
}
.iris-voice-call-btn--locked:hover {
  background: #fef9eb;
  color: #6B4F2C;
  border-color: #B8941C;
}
.iris-voice-call-btn--locked .iris-voice-icon { color: #8A8578; }
.iris-voice-call-btn--locked:hover .iris-voice-icon { color: #6B4F2C; }
.iris-voice-call-btn--locked .iris-voice-lock {
  position: absolute;
  top: -6px;
  right: -6px;
  font-size: 0.8rem;
  background: var(--surface, #fff);
  border: 1px solid #7A2E5A;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 1px 3px rgba(201, 169, 110, 0.3);
}

/* 撥話 icon — 綠底按鈕內顯示白話筒（對齊 WhatsApp / iOS Phone app）。
   tier-locked 狀態另外用灰色 icon（見上方 .iris-voice-call-btn--locked
   .iris-voice-icon 規則覆蓋）。 */
.iris-voice-icon { font-size: 0.95rem; color: #fff; }
.iris-voice-call-btn:hover .iris-voice-icon { color: #fff; }

/* RWD: <= 640px — 撥話按鈕收為純 icon 圓形，騰出 chat header 空間 */
@media (max-width: 640px) {
  .iris-chat-card { padding: 16px; gap: 12px; }
  .iris-chat-header { gap: 10px; }
  .iris-avatar { width: 52px; height: 52px; }
  .iris-name { font-size: 1.1rem; }
  .iris-tagline { font-size: 0.78rem; line-height: 1.4; }
  .iris-voice-call-btn {
    width: 40px; height: 40px; border-radius: 50%;
    padding: 0; justify-content: center;
  }
  .iris-voice-label { display: none; }
  .iris-send-label { display: none; }
  .iris-send-btn { padding: 10px 14px; }
  .iris-chat-messages { max-height: 280px; padding: 12px; }
  .iris-msg { max-width: 92%; font-size: 0.9rem; padding: 8px 12px; }
  .iris-chat-input { padding: 9px 12px; font-size: 0.92rem; }
}

/* RWD: <= 380px — 進一步壓縮 */
@media (max-width: 380px) {
  .iris-chat-card { padding: 14px; }
  .iris-chat-header { gap: 8px; }
  .iris-avatar { width: 46px; height: 46px; }
  .iris-name { font-size: 1.02rem; }
  .iris-tagline { font-size: 0.72rem; }
  .iris-badge { font-size: 0.55rem; padding: 1px 6px; }
  .iris-voice-call-btn { width: 36px; height: 36px; }
}

/* ============================================
   Iris 客服語音通話 Modal（Phase 2）
   自洽元件 — 不依賴 SaaS 的 voice-call-* 既有類別
   採與 Iris chat card 同套配色（粉金 luxury）
   ============================================ */

.iris-voice-overlay {
  background: rgba(0, 0, 0, 0.45) !important;
  align-items: center;
  justify-content: center;
}

.iris-voice-modal-card {
  width: calc(100% - 32px);
  max-width: 380px !important;
  border-radius: 16px;
  padding: 0 1.5rem 1.5rem;
  text-align: center;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #E8E2D8);
  position: relative;
  overflow: hidden;
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  animation: irisVoiceFadeIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes irisVoiceFadeIn {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* 頭像影片容器 — modal 內最上方的大圓 */
.iris-voice-avatar-wrap {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  overflow: hidden;
  margin: 1.5rem auto 1.25rem;
  position: relative;
  background: var(--bg-tertiary, #FAF7F2);
  border: 4px solid #fff;
  box-shadow: 0 8px 24px rgba(196, 114, 127, 0.25);
}

.iris-voice-avatar-image,
.iris-voice-avatar-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.iris-voice-header h3 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: 0.06em;
  color: var(--text, #1A1A1A);
  margin: 0 0 4px;
}

.iris-voice-subtitle {
  font-family: 'Nunito Sans', sans-serif;
  font-size: 0.78rem;
  color: #8A8578;
  margin: 0 0 12px;
  letter-spacing: 0.05em;
}

.iris-voice-status {
  font-family: 'Nunito Sans', sans-serif;
  font-size: 0.9rem;
  color: #475569;
  margin: 12px 0;
  min-height: 1.4em;
}

.iris-voice-timer {
  font-family: 'Nunito Sans', sans-serif;
  font-size: 2.4rem;
  font-weight: 700;
  color: #C4727F;
  font-variant-numeric: tabular-nums;
  margin: 12px 0;
  letter-spacing: 0.05em;
}

.iris-voice-overlay #irisVoiceTimer.iris-voice-urgent {
  color: #dc2626;
  animation: irisVoicePulse 1s ease-in-out infinite;
}

@keyframes irisVoicePulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.08); }
}

.iris-voice-error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 8px 12px;
  margin: 12px 0;
  font-family: 'Nunito Sans', sans-serif;
  font-size: 0.85rem;
  line-height: 1.5;
  text-align: left;
}

.iris-voice-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 16px;
}

.iris-voice-btn-primary,
.iris-voice-btn-danger,
.iris-voice-btn-secondary,
.iris-voice-btn-toggle {
  padding: 10px 22px;
  border-radius: 0;
  border: none;
  font-family: 'Nunito Sans', sans-serif;
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.iris-voice-btn-primary {
  background: #C4727F;
  color: #fff;
}
.iris-voice-btn-primary:hover { background: #B85F6E; }
.iris-voice-btn-primary:disabled {
  background: #C5C0B5;
  cursor: not-allowed;
}

.iris-voice-btn-danger {
  background: #dc2626;
  color: #fff;
}
.iris-voice-btn-danger:hover { opacity: 0.88; }

.iris-voice-btn-secondary {
  background: var(--bg-tertiary, #FAF7F2);
  color: #475569;
  border: 1px solid var(--border, #E8E2D8);
}
.iris-voice-btn-secondary:hover { background: #E8E2D8; }

.iris-voice-btn-toggle {
  background: var(--bg-tertiary, #FAF7F2);
  color: #8A8578;
  border: 1px solid var(--border, #E8E2D8);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.iris-voice-btn-toggle:hover { background: #E8E2D8; color: #1A1A1A; }
.iris-voice-btn-toggle #irisVoiceSpeakerIcon { font-size: 1rem; }

.iris-voice-hint {
  font-family: 'Nunito Sans', sans-serif;
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 14px;
  line-height: 1.5;
  letter-spacing: 0.03em;
}

/* 小螢幕：縮頭像、字體 */
@media (max-height: 700px) {
  .iris-voice-avatar-wrap {
    width: 140px;
    height: 140px;
    margin: 1rem auto 0.875rem;
  }
}

@media (max-width: 640px) {
  .iris-voice-overlay #irisVoiceTimer { font-size: 2rem; }
  .iris-voice-avatar-wrap { width: 150px; height: 150px; }
  .iris-voice-header h3 { font-size: 1.2rem; }
  .iris-voice-btn-primary,
  .iris-voice-btn-danger,
  .iris-voice-btn-secondary,
  .iris-voice-btn-toggle {
    padding: 9px 16px;
    font-size: 0.72rem;
  }
}

/* ============================================
   Iris 迎賓詞推送（全螢幕居中覆蓋層 + 粉色溫馨主題）
   進入 /feedback 路由時顯示一次，per-session 控制
   ============================================ */
.iris-welcome-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.5s ease;
}

.iris-welcome-overlay.show {
  opacity: 1;
}

.iris-welcome-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  transform: scale(0.8);
  opacity: 0;
  animation: irisWelcomeEnter 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s forwards;
}

.iris-welcome-avatar {
  position: relative;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.7);
  box-shadow:
    0 0 30px rgba(236, 72, 153, 0.4),
    0 0 60px rgba(236, 72, 153, 0.15);
  background: linear-gradient(135deg, #ec4899, #fb7185);
  animation: irisWelcomeGlow 3s ease-in-out infinite alternate;
}

.iris-welcome-video,
.iris-welcome-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.iris-welcome-video {
  display: none;
}

.iris-welcome-card {
  background: linear-gradient(135deg, #ec4899, #f472b6);
  color: #fff;
  padding: 18px 32px;
  border-radius: 20px;
  box-shadow: 0 8px 40px rgba(236, 72, 153, 0.4);
  max-width: 420px;
  width: 90vw;
  text-align: center;
  font-size: 16px;
  line-height: 1.6;
}

.iris-welcome-card .iris-welcome-text {
  font-weight: 500;
}

.iris-welcome-card .iris-welcome-label {
  font-size: 12px;
  opacity: 0.85;
  margin-bottom: 6px;
}

.iris-welcome-dismiss {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 1px;
  margin-top: 4px;
}

@keyframes irisWelcomeEnter {
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes irisWelcomeGlow {
  from {
    box-shadow:
      0 0 30px rgba(236, 72, 153, 0.4),
      0 0 60px rgba(236, 72, 153, 0.15);
  }
  to {
    box-shadow:
      0 0 40px rgba(251, 113, 133, 0.45),
      0 0 80px rgba(251, 113, 133, 0.18);
  }
}

.iris-welcome-overlay.hiding .iris-welcome-center {
  animation: irisWelcomeExit 0.4s ease-in forwards;
}

@keyframes irisWelcomeExit {
  to {
    transform: scale(0.85);
    opacity: 0;
  }
}

@media (max-width: 768px) {
  .iris-welcome-avatar {
    width: 120px;
    height: 120px;
  }

  .iris-welcome-card {
    padding: 14px 24px;
    font-size: 15px;
  }
}

/* ============================================
   站內客服中心 — 淡粉紅溫馨主題
   （對齊 Jennie SaaS feedback page 視覺）
   ============================================ */

#feedbackPage {
  background: linear-gradient(180deg, #fff5f8 0%, #fff0f5 50%, #ffe8ef 100%);
  border-radius: 16px;
  padding: 24px 20px;
  min-height: 100%;
  box-shadow: inset 0 0 40px rgba(236, 72, 153, 0.04);
}

/* Page header：粉色主標 + 綠色副標 */
.feedback-page-header {
  padding: 8px 4px 0;
  margin-bottom: 20px;
}

.feedback-page-header h1 {
  font-family: 'Nunito Sans', sans-serif;
  font-weight: 800;
  font-size: 2rem;
  color: #ec4899;
  margin: 0 0 6px;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 2px rgba(236, 72, 153, 0.08);
}

.feedback-page-header p {
  font-family: 'Nunito Sans', sans-serif;
  font-size: 0.95rem;
  color: #16a34a;
  margin: 0;
  font-weight: 500;
}

/* Iris chat card 在粉底上保持白色，加柔和粉色 shadow */
#feedbackPage .iris-chat-card {
  background: #ffffff;
  border-color: rgba(236, 72, 153, 0.15);
  box-shadow: 0 4px 16px rgba(236, 72, 153, 0.08);
}

#feedbackPage .iris-chat-card::before {
  /* 粉底頁面下 iris card 左側金條改為粉色 accent */
  background: linear-gradient(180deg, #ec4899, #f472b6);
}

#feedbackPage .iris-chat-messages {
  background: #fffafc;  /* 訊息區帶極微粉，比 card 底色更柔 */
  border-color: rgba(236, 72, 153, 0.12);
}

/* Iris bot 訊息泡泡邊框微帶粉 */
#feedbackPage .iris-msg-bot {
  border-color: #fce7f0;
}

/* Iris user 訊息泡泡：粉紫漸層更貼合主題（覆蓋原本龍蝦粉） */
#feedbackPage .iris-msg-user {
  background: linear-gradient(135deg, #ec4899, #a855f7);
}

/* Iris 送出按鈕：粉紫漸層 */
#feedbackPage .iris-send-btn {
  background: linear-gradient(135deg, #ec4899, #a855f7);
  color: #fff;
  letter-spacing: 0.06em;
}

#feedbackPage .iris-send-btn:hover:not(:disabled) {
  filter: brightness(1.08);
  background: linear-gradient(135deg, #db2777, #9333ea);
}

#feedbackPage .iris-send-btn::after {
  background: rgba(255, 255, 255, 0.4);
}

/* 提交意見 / 回饋歷史卡片：白底 + 粉色 hover accent */
#feedbackPage .feedback-form-card,
#feedbackPage .feedback-history-card,
#feedbackPage .card {
  background: #ffffff !important;
  border: 1px solid rgba(236, 72, 153, 0.15) !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 16px rgba(236, 72, 153, 0.08) !important;
  margin-bottom: 20px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.25s ease;
}

#feedbackPage .card:hover {
  box-shadow: 0 6px 20px rgba(236, 72, 153, 0.14) !important;
}

#feedbackPage .card-header {
  border-bottom: 1px solid #fce7f0;
  padding: 0 0 14px;
  margin-bottom: 18px;
}

#feedbackPage .card-title {
  font-family: 'Nunito Sans', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: #be185d;
  letter-spacing: 0.02em;
}

/* 表單 label + input */
#feedbackPage .form-label {
  font-family: 'Nunito Sans', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  color: #6b4f5a;
  margin-bottom: 6px;
  letter-spacing: normal;
  text-transform: none;
}

#feedbackPage .form-input,
#feedbackPage select,
#feedbackPage textarea {
  font-family: 'Nunito Sans', sans-serif;
  border: 1px solid rgba(236, 72, 153, 0.2);
  border-radius: 8px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#feedbackPage .form-input:focus,
#feedbackPage select:focus,
#feedbackPage textarea:focus {
  border-color: #ec4899;
  box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.12);
  outline: none;
}

/* 送出回饋按鈕：粉紫漸層 */
#feedbackPage .btn-primary {
  background: linear-gradient(135deg, #ec4899, #a855f7) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 10px !important;
  padding: 10px 24px !important;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  transition: filter 0.2s ease, transform 0.1s ease;
}

#feedbackPage .btn-primary:hover {
  filter: brightness(1.08);
  background: linear-gradient(135deg, #db2777, #9333ea) !important;
}

#feedbackPage .btn-primary:active { transform: translateY(1px); }

#feedbackPage .btn-primary::after { display: none; }

/* 截圖上傳區拖放邊框配色 */
#feedbackPage .fb-upload-zone {
  border: 2px dashed rgba(236, 72, 153, 0.3) !important;
  border-radius: 12px !important;
  background: #fffafc;
  transition: border-color 0.2s ease, background 0.2s ease;
}

#feedbackPage .fb-upload-zone:hover,
#feedbackPage .fb-upload-zone.fb-dragover {
  border-color: #ec4899 !important;
  background: #fff5f8;
}

/* 回饋歷史條目：粉色淡邊 */
#feedbackPage .fb-history-item {
  border: 1px solid rgba(236, 72, 153, 0.15) !important;
  border-radius: 10px !important;
  background: #fffafc;
}

#feedbackPage .fb-cat-tag,
#feedbackPage .fb-status-tag {
  border-radius: 12px !important;
  font-weight: 600;
  letter-spacing: normal;
  text-transform: none;
}

#feedbackPage .fb-reply-block {
  border-left: 3px solid #ec4899 !important;
  background: #fff5f8 !important;
  border-radius: 8px !important;
}

/* RWD：手機版收緊 padding */
@media (max-width: 640px) {
  #feedbackPage {
    padding: 16px 12px;
    border-radius: 12px;
  }
  .feedback-page-header h1 { font-size: 1.6rem; }
  .feedback-page-header p { font-size: 0.85rem; }
  #feedbackPage .card { padding: 18px; }
}

/* ============================================
   Authorizations 蝦授權 — Purchase Ledger
   ============================================ */

/* Intro banner */
.auth-intro-banner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid #DDAA00;
  border-radius: 12px;
  padding: 20px 22px 16px;
  margin-bottom: 18px;
}

.auth-intro-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.auth-intro-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
}

.auth-intro-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.auth-intro-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-tertiary);
  border-radius: 8px;
}

.auth-intro-item-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.auth-intro-item strong {
  font-size: 0.82rem;
  color: var(--text);
  display: block;
  margin-bottom: 2px;
}

.auth-intro-item p {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
}

.auth-intro-toggle {
  font-size: 0.7rem;
  color: var(--text-muted);
  transition: transform 0.3s ease;
  flex-shrink: 0;
  user-select: none;
}

.auth-intro-body {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 0.3s ease, opacity 0.3s ease;
  opacity: 1;
}

.auth-intro-body > .auth-intro-grid {
  overflow: hidden;
  margin-top: 16px;
}

.auth-intro-body > .auth-timeline {
  overflow: hidden;
  margin-top: 16px;
}

.auth-intro-body.collapsed {
  grid-template-rows: 0fr;
  opacity: 0;
}

.auth-intro-body.collapsed > * {
  margin-top: 0;
}

/* Example flow timeline */
.auth-intro-example {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed rgba(201,169,110,0.3);
  overflow: hidden;
}

.auth-intro-example-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #8B6914;
  margin-bottom: 12px;
}

.auth-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-left: 4px;
}

.auth-tl-node {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 0;
  position: relative;
}

.auth-tl-node::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 28px;
  bottom: -6px;
  width: 2px;
  background: rgba(201,169,110,0.25);
}

.auth-tl-node:last-child::before {
  display: none;
}

.auth-tl-dot {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
  z-index: 1;
}

.auth-tl-content {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.5;
  padding-top: 1px;
}

.auth-tl-content strong {
  color: var(--text);
}

.auth-tl-node-highlight .auth-tl-content {
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text);
}

/* Branch (fork) */
.auth-tl-branch {
  display: flex;
  gap: 8px;
  margin: 4px 0 4px 32px;
  position: relative;
}

.auth-tl-branch::before {
  content: '';
  position: absolute;
  left: -22px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(201,169,110,0.25);
}

.auth-tl-branch-item {
  flex: 1;
  font-size: 0.72rem;
  padding: 8px 10px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.4;
}

.auth-tl-branch-muted {
  background: var(--bg-tertiary);
  color: var(--text-muted);
}

.auth-tl-branch-alert {
  background: rgba(221, 170, 0, 0.1);
  color: #8B6914;
  font-weight: 600;
  border: 1px solid rgba(221, 170, 0, 0.25);
}

@media (max-width: 640px) {
  .auth-intro-grid {
    grid-template-columns: 1fr;
  }
  .auth-intro-banner {
    padding: 16px 14px 12px;
  }
}

.auth-filter-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.auth-filter-btn {
  padding: 6px 14px;
  border: 1.5px solid var(--border);
  background: transparent;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-filter-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.auth-filter-btn:hover:not(.active) {
  border-color: var(--primary-light);
  color: var(--primary-hover);
}

/* Empty state */
.auth-empty-state {
  text-align: center;
  padding: 48px 20px;
}

.auth-empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.6;
}

.auth-empty-state h3 {
  margin-bottom: 8px;
  color: var(--text);
}

.auth-empty-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 20px;
}

.auth-example-chip {
  padding: 8px 16px;
  background: var(--bg-tertiary);
  border-radius: 20px;
  font-size: 0.82rem;
  color: var(--primary-hover);
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-example-chip:hover {
  background: var(--primary);
  color: #fff;
}

/* Card list */
.auth-ledger-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  transition: box-shadow 0.2s ease;
}

.auth-card:hover {
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.auth-card-header {
  margin-bottom: 0;
}

.auth-card-toggle {
  font-size: 0.7rem;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-left: auto;
  transition: transform 0.2s ease;
}

.auth-card-body {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 0.3s ease, opacity 0.3s ease;
  opacity: 1;
  overflow: hidden;
  margin-top: 10px;
}

.auth-card-body.collapsed {
  grid-template-rows: 0fr;
  opacity: 0;
  margin-top: 0;
}

.auth-card-body-inner {
  overflow: hidden;
}

.auth-card-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.auth-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.auth-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  flex: 1;
}

.auth-status-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  border: 1px solid;
  white-space: nowrap;
}

.auth-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 20px;
}

.auth-date {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.auth-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 8px;
}

.auth-badge-budget {
  background: rgba(221, 170, 0, 0.12);
  color: #b8860b;
}

.auth-description {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  padding-left: 20px;
}

.auth-conditions {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  padding-left: 20px;
}

/* Recommendations */
.auth-recommendations {
  margin: 12px 0;
  padding-left: 20px;
}

.auth-rec-header {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.auth-rec-wrap {
  margin-bottom: 4px;
}

.auth-rec-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-tertiary);
  border-radius: 8px;
  margin-bottom: 4px;
}

.auth-rec-rank {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.auth-rec-info {
  flex: 1;
  min-width: 0;
}

.auth-rec-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.auth-rec-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 2px;
}

.auth-rec-price {
  font-size: 0.78rem;
  font-weight: 700;
  color: #dc2626;
}

.auth-rec-platform {
  font-size: 0.72rem;
  color: var(--text-muted);
  background: rgba(0,0,0,0.05);
  padding: 1px 6px;
  border-radius: 4px;
}

.auth-rec-link {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  text-decoration: none;
  flex-shrink: 0;
  transition: opacity 0.15s ease;
}

.auth-rec-link:hover {
  opacity: 0.8;
}

.auth-track-btn {
  background: rgba(58,54,201,0.1);
  color: var(--primary-hover);
  border: 1px solid rgba(58,54,201,0.2);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 0.75rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.auth-track-btn:hover {
  background: var(--primary);
  color: #fff;
}

.auth-track-input {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 6px 44px;
  background: rgba(58,54,201,0.04);
  border-radius: 0 0 8px 8px;
  margin-top: -4px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.auth-track-price-input {
  width: 90px;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.78rem;
  text-align: center;
}

.auth-track-price-input:focus {
  border-color: var(--primary);
  outline: none;
}

/* Selected product */
.auth-selected {
  margin: 10px 0;
  padding: 10px 14px 10px 20px;
  background: rgba(34, 197, 94, 0.08);
  border-left: 3px solid #22c55e;
  border-radius: 0 8px 8px 0;
  font-size: 0.85rem;
}

.auth-selected-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #22c55e;
  margin-bottom: 2px;
}

.auth-notes {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding-left: 20px;
  margin-top: 8px;
  font-style: italic;
}

/* Actions */
.auth-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  padding-left: 20px;
}

/* Price tracking */
.auth-tracking {
  margin: 12px 0;
  padding: 10px 14px 10px 20px;
  background: rgba(58, 54, 201, 0.06);
  border-left: 3px solid var(--primary);
  border-radius: 0 8px 8px 0;
}

.auth-tracking-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.auth-tracking-badge {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary-hover);
}

.auth-tracking-target {
  font-size: 0.75rem;
  font-weight: 600;
  color: #dc2626;
  background: rgba(220, 38, 38, 0.08);
  padding: 1px 8px;
  border-radius: 8px;
}

.auth-price-history {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  overflow-x: auto;
}

.auth-price-point {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 52px;
  padding: 4px 6px;
  background: var(--surface);
  border-radius: 6px;
  border: 1px solid var(--border);
}

.auth-price-date {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.auth-price-val {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text);
}

.auth-price-hit {
  color: #22c55e;
}

/* Responsive */
@media (max-width: 640px) {
  .auth-filter-tabs {
    gap: 4px;
  }
  .auth-filter-btn {
    font-size: 0.75rem;
    padding: 5px 10px;
  }
  .auth-card {
    padding: 14px 16px;
  }
  .auth-card-title-row {
    flex-wrap: wrap;
  }
  .auth-rec-item {
    padding: 6px 8px;
  }
  .auth-rec-name {
    font-size: 0.8rem;
  }
}

/* ============================================
   Vertical Scenarios — Picker, Templates, Manager
   ============================================ */

/* --- Scenario Picker Grid --- */
.scenario-picker-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

@media (max-width: 640px) {
  .scenario-picker-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.scenario-card {
  position: relative;
  background: var(--surface, #fff);
  border: 2px solid var(--border, #E8E2D8);
  border-radius: 12px;
  padding: 20px 14px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  overflow: hidden;
}

.scenario-card:hover {
  border-color: var(--primary, #3a36c9);
  box-shadow: 0 4px 18px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

.scenario-card.selected {
  border-color: transparent;
  box-shadow: 0 0 0 2.5px var(--primary, #3a36c9), 0 6px 24px rgba(58,54,201,0.18);
}

.scenario-card-accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: 10px 10px 0 0;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.scenario-card:hover .scenario-card-accent,
.scenario-card.selected .scenario-card-accent {
  opacity: 1;
}

.scenario-card-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.scenario-card-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text, #1A1A1A);
  margin-bottom: 4px;
}

.scenario-card-desc {
  font-size: 0.72rem;
  color: var(--text-muted, #8A8578);
  line-height: 1.4;
}

.scenario-card-check {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary, #3a36c9);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.25s ease;
}

.scenario-card.selected .scenario-card-check {
  opacity: 1;
  transform: scale(1);
}

/* --- Template Button Grid --- */
.template-section {
  margin-bottom: 24px;
  animation: lxTaskFadeUp 0.4s ease both;
}

.template-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.template-section-icon {
  font-size: 1.4rem;
}

.template-section-title {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--text, #1A1A1A);
  letter-spacing: 0.03em;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

@media (max-width: 480px) {
  .template-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.template-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 10px;
  background: var(--surface, #fff);
  border: 1.5px solid var(--border, #E8E2D8);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.22s ease;
}

.template-btn:hover {
  border-color: var(--primary, #3a36c9);
  background: rgba(58,54,201,0.04);
  box-shadow: 0 3px 14px rgba(0,0,0,0.06);
  transform: translateY(-1px);
}

.template-btn:active {
  transform: scale(0.97);
}

.template-btn-icon {
  font-size: 1.5rem;
}

.template-btn-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text, #1A1A1A);
  text-align: center;
  line-height: 1.3;
}

.template-btn-custom {
  border-style: dashed;
  opacity: 0.7;
}

.template-btn-custom:hover {
  opacity: 1;
}

/* --- Template Form Modal --- */
.template-modal {
  animation: lxTaskFadeUp 0.3s ease both;
}

.template-modal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border, #E8E2D8);
}

.template-modal-icon {
  font-size: 1.8rem;
}

.template-modal-title {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--text, #1A1A1A);
  flex: 1;
}

.template-modal-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--text-muted, #8A8578);
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.15s;
}

.template-modal-close:hover {
  color: var(--text, #1A1A1A);
}

.template-form-field {
  margin-bottom: 16px;
}

.template-form-label {
  display: block;
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--text-muted, #8A8578);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.template-form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border, #E8E2D8);
  border-radius: 8px;
  font-size: 0.88rem;
  color: var(--text, #1A1A1A);
  background: var(--surface, #fff);
  transition: border-color 0.2s ease;
  box-sizing: border-box;
}

.template-form-input:focus {
  border-color: var(--primary, #3a36c9);
  outline: none;
}

textarea.template-form-input {
  resize: vertical;
  min-height: 80px;
}

.template-radio-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.template-radio-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border, #E8E2D8);
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.82rem;
  transition: all 0.2s ease;
}

.template-radio-item:has(input:checked) {
  border-color: var(--primary, #3a36c9);
  background: rgba(58,54,201,0.06);
  color: var(--primary-hover, #089a96);
}

.template-radio-item input[type="radio"] {
  margin: 0;
  accent-color: var(--primary, #3a36c9);
}

.template-submit-btn {
  margin-top: 8px;
}

/* --- Scenario Tags (Settings page) --- */
.scenario-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--border, #E8E2D8);
  border-radius: 10px;
  font-size: 0.85rem;
  background: var(--surface, #fff);
  transition: all 0.2s ease;
}

.scenario-tag-active {
  border-color: var(--primary, #3a36c9);
  background: rgba(58,54,201,0.05);
}

.scenario-tag-badge {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--primary, #3a36c9);
  padding: 1px 6px;
  border: 1px solid var(--primary, #3a36c9);
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.scenario-tag-switch {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted, #8A8578);
  background: none;
  border: 1px solid var(--border, #E8E2D8);
  border-radius: 6px;
  padding: 2px 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.scenario-tag-switch:hover {
  background: var(--primary, #3a36c9);
  color: #fff;
  border-color: var(--primary, #3a36c9);
}

