/* ============================================
   OOOSCH — CSS
   Aesthetic: Soft Organic Dark
   Warm blacks, amber accents, DM Serif Display
   ============================================ */

:root {
  /* ═══ App shell 度量 ═══
     上面 logo 那排(.feed-header)跟下面 icon 那排(.bottom-nav)是常駐外框，永遠不該被蓋住。
     實際數值由 ooUpdateShellMetrics()（core.js）量出來寫進來——高度會隨 safe-area、
     字級、桌機/手機而變，寫死一定會有裝置對不上。沒有外框時（登入頁）維持 0。 */
  --shell-top: 0px;
  --shell-bottom: 0px;

  /* Backgrounds — warm-toned dark */
  --bg:        #0f0e0b;
  --bg2:       #1a1816;
  --bg3:       #242220;
  --bg4:       #2c2a27;

  /* Borders — warm & subtle */
  --border:    #2e2b26;
  --border-soft: #252320;

  /* Typography */
  --text:      #ede8df;
  --text-muted:#87817a;
  --text-dim:  #4d4a44;

  /* Accent — warm amber (softer than previous gold) */
  --accent:    #c4956a;
  --accent2:   #d9ab82;
  --accent-bg: rgba(196,149,106,0.09);
  --accent-glow: rgba(196,149,106,0.18);

  /* Semantic */
  --danger:    #c47878;
  --danger-bg: rgba(196,120,120,0.09);
  --success:   #7aaa8a;
  --success-bg: rgba(122,170,138,0.1);

  /* Shape */
  --radius:    16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --radius-pill: 999px;

  /* Typography stacks */
  --font-display: 'DM Serif Display', Georgia, 'Times New Roman', serif;
  --font-body:    'DM Sans', system-ui, sans-serif;

  /* Elevation */
  --shadow:    0 4px 28px rgba(0,0,0,0.55);
  --shadow-sm: 0 2px 12px rgba(0,0,0,0.35);
  --shadow-glow: 0 0 0 3px var(--accent-glow);

  --transition: 0.2s ease;
  --transition-fast: 0.12s ease;
}

/* ===== LIGHT THEME ===== */
.theme-icon { filter: brightness(0) invert(1); opacity: 0.55; }
[data-theme="light"] .theme-icon { filter: brightness(0); opacity: 0.45; }

[data-theme="light"] {
  --bg:        #f6f3ee;
  --bg2:       #ffffff;
  --bg3:       #edeae4;
  --bg4:       #e4e0d9;
  --border:    #d6d2ca;
  --border-soft: #e4e0d9;
  --text:      #1c1a17;
  --text-muted:#7a7570;
  --text-dim:  #b0ab9f;
  --accent:    #a07242;
  --accent2:   #c4956a;
  --accent-bg: rgba(160,114,66,0.08);
  --accent-glow: rgba(160,114,66,0.16);
  --danger:    #b05858;
  --success:   #4a8a62;
  --shadow:    0 4px 24px rgba(0,0,0,0.1);
  --shadow-sm: 0 2px 10px rgba(0,0,0,0.07);
}

/* ===== BASE RESET ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  font-feature-settings: 'kern' 1, 'liga' 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  overscroll-behavior-x: none;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* iOS Safari auto-zooms the page when a focused input's font-size is <16px.
   Force 16px on mobile widths regardless of any inline font-size set from JS. */
@media (max-width: 768px) {
  input, textarea, select { font-size: 16px !important; }
}

/* Warm scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--bg4) transparent;
}
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 2px; }

/* ===== LAYOUT ===== */
#app { min-height: 100vh; }

.page { display: none; min-height: 100vh; }
.page.active { display: block; }

/* ===== AUTH PAGE ===== */
.auth-page {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

/* Warm organic glow in corner */
.auth-page::before {
  content: '';
  position: absolute;
  width: 720px;
  height: 720px;
  background: radial-gradient(ellipse at center,
    rgba(196,149,106,0.07) 0%,
    rgba(196,149,106,0.02) 45%,
    transparent 70%);
  top: -160px;
  right: -160px;
  border-radius: 50%;
  pointer-events: none;
}

.auth-page::after {
  content: '';
  position: absolute;
  width: 480px;
  height: 480px;
  background: radial-gradient(ellipse at center,
    rgba(122,170,138,0.04) 0%,
    transparent 65%);
  bottom: -80px;
  left: -80px;
  border-radius: 50%;
  pointer-events: none;
}

.auth-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 52px 44px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow);
  animation: fadeUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
  position: relative;
  z-index: 1;
}

@media (max-width: 480px) {
  .auth-box { padding: 36px 28px; border-radius: 20px; }
}

.auth-logo {
  font-family: var(--font-body);
  font-size: 2.8rem;
  color: var(--accent);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  text-align: center;
  line-height: 1;
}

.auth-tagline {
  color: var(--text-muted);
  font-size: 0.82rem;
  text-align: center;
  margin-bottom: 38px;
  font-weight: 300;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}

.auth-tab {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 10px;
  font-size: 0.88rem;
  font-weight: 500;
  transition: color var(--transition), border-color var(--transition);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  letter-spacing: 0.01em;
}

.auth-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ===== AUTH REDESIGN ===== */
@keyframes authFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

.auth-page { font-family: 'Hanken Grotesk', 'DM Sans', sans-serif; }

.auth-logo img { height: 132px !important; animation: authFloat 7s ease-in-out infinite; filter: drop-shadow(0 8px 24px rgba(0,0,0,.4)); }

.auth-headline-wrap { text-align: center; margin-bottom: 20px; }
.auth-headline-1 { margin: 0; font: 600 32px/1.04 'Space Grotesk', sans-serif; letter-spacing: -0.03em; color: var(--text); }
.auth-headline-2 { margin: 6px 0 0; font: 600 32px/1.04 'Space Grotesk', sans-serif; letter-spacing: -0.03em; color: var(--text-muted); }
.auth-marketing { margin: 10px 0 0; font-size: 13px; line-height: 1.6; color: var(--text-dim); }

.auth-pill-track { position: relative; display: flex; background: var(--bg); border: 1px solid var(--border); border-radius: 11px; padding: 4px; margin-bottom: 22px; }
.auth-pill { position: absolute; top: 4px; bottom: 4px; width: calc(50% - 4px); left: 4px; background: var(--bg3); border-radius: 8px; transition: left .28s cubic-bezier(.4,0,.2,1); box-shadow: inset 0 1px 0 rgba(255,255,255,.04); pointer-events: none; }
.auth-pill.right { left: calc(50%); }
.auth-pill-btn { position: relative; z-index: 1; flex: 1; padding: 9px 0; background: transparent; border: 0; cursor: pointer; font: 600 14px 'Hanken Grotesk', 'DM Sans', sans-serif; color: var(--text-muted); transition: color .2s; }
.auth-pill-btn.active { color: var(--text); }

.auth-google-btn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 13px; background: #fff; color: #1a1a1a; border: 0; border-radius: 11px; cursor: pointer; font: 600 14.5px 'Hanken Grotesk', 'DM Sans', sans-serif; transition: transform .12s, box-shadow .2s, background .15s; margin-bottom: 14px; }
.auth-google-btn:hover { background: #f3f3f3; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,0,0,.35); }

.auth-input-wrap { display: flex; align-items: center; gap: 10px; padding: 13px 14px; background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius-sm); transition: border-color .2s; }
.auth-input-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.auth-input-wrap input { flex: 1; background: transparent; border: 0; outline: none; color: var(--text); font: 500 15px 'Hanken Grotesk', 'DM Sans', sans-serif; min-width: 0; }
.auth-input-wrap input::placeholder { color: var(--text-dim); }
.auth-input-icon { flex-shrink: 0; color: var(--text-dim); display: flex; align-items: center; }
.auth-pw-toggle { background: transparent; border: 0; padding: 0; cursor: pointer; color: var(--text-dim); display: flex; align-items: center; flex-shrink: 0; }
.auth-pw-toggle:hover { color: var(--text-muted); }

.auth-remember-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.auth-remember-label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: var(--text-muted); }
.auth-remember-label input[type=checkbox] { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; }
.auth-forgot-btn { background: none; border: none; padding: 0; font-size: 13px; color: var(--accent); font-weight: 600; cursor: pointer; font-family: inherit; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 18px; }

.form-group label {
  display: block;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 7px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 13px 15px;
  font-size: 0.95rem;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--accent);
  background: var(--bg2);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group textarea { resize: vertical; min-height: 100px; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  transition: all var(--transition);
  letter-spacing: 0.01em;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--accent);
  color: #0f0e0b;
  width: 100%;
  padding: 15px;
  font-size: 0.92rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  letter-spacing: 0.02em;
}

.btn-primary:hover {
  background: var(--accent2);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(196,149,106,0.3);
}
.btn-primary:active { transform: translateY(0); box-shadow: none; }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  border-color: var(--text-muted);
  color: var(--text);
  background: var(--accent-bg);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover { opacity: 0.9; }

/* ===== STATUS MESSAGES ===== */
.error-msg {
  background: var(--danger-bg);
  border: 1px solid rgba(196,120,120,0.3);
  color: var(--danger);
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 16px;
  display: none;
}
.error-msg.show { display: block; }

.success-msg {
  background: var(--success-bg);
  border: 1px solid rgba(122,170,138,0.3);
  color: var(--success);
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 16px;
  display: none;
}
.success-msg.show { display: block; }

/* ===== MAIN APP LAYOUT ===== */
.app-layout {
  display: block;
  min-height: 100vh;
  max-width: 600px;
  margin: 0 auto;
  /* safe-area 由 sticky 的 .feed-header 自己處理，這裡不再加，避免上方出現雙倍留白 */
}

@media (min-width: 640px) {
  .app-layout { max-width: 800px; }
}

/* 頁面型全螢幕視窗（氏族詳情、群聊、好友地圖…）：畫在常駐外框之間，不蓋住上下兩排。
   靠幾何避開，不是靠 z-index 疊高——所以視窗之間原本的前後關係都不受影響。
   沉浸型視窗（看大圖、限時動態、修圖、PDF）刻意不套這個 class：它們就是要全螢幕，
   而且關閉的 X 鈕釘在右上角，被 logo 排壓住會變成關不掉。
   GPS 強制關卡也不套——那本來就該蓋住全部，不然用戶繞得過去。 */
.shell-page {
  position: fixed;
  top: var(--shell-top);
  bottom: var(--shell-bottom);
  left: 0;
  right: 0;
}

body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }

/* ===== BOTTOM NAV ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 600px;
  height: calc(64px + env(safe-area-inset-bottom));
  /* Warm glass effect */
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border-top: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 8px 16px;
  cursor: pointer;
  transition: color var(--transition);
  font-family: var(--font-body);
  border-radius: var(--radius-sm);
  position: relative;
}

.nav-item svg { width: 22px; height: 22px; flex-shrink: 0; }
#nav-feed svg { width: 28px; height: 28px; color: var(--accent); }
.nav-item:not(.active) { opacity: 0.72; }
.nav-item:hover { color: var(--accent2); opacity: 1; }
.nav-item.active { color: var(--accent); }

/* Active dot indicator */
.nav-item.active::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  animation: dotPop 0.2s ease both;
}

@keyframes dotPop {
  from { transform: translateX(-50%) scale(0); opacity: 0; }
  to   { transform: translateX(-50%) scale(1); opacity: 1; }
}

/* ── 通知鈴鐺：新通知進來時搖擺 + 角標彈出 ── */
.bell-icon { transform-origin: top center; }
.bell-icon.ringing  { animation: bellRing 0.9s cubic-bezier(.36,.07,.19,.97); }
#notif-badge.popping { animation: badgePop 0.45s cubic-bezier(.34,1.56,.64,1); }

@keyframes bellRing {
  0%   { transform: rotate(0); }
  10%  { transform: rotate(14deg); }
  20%  { transform: rotate(-12deg); }
  30%  { transform: rotate(10deg); }
  40%  { transform: rotate(-8deg); }
  50%  { transform: rotate(6deg); }
  60%  { transform: rotate(-4deg); }
  70%  { transform: rotate(2deg); }
  80%  { transform: rotate(-1deg); }
  100% { transform: rotate(0); }
}

@keyframes badgePop {
  0%  { transform: scale(0); }
  60% { transform: scale(1.35); }
  80% { transform: scale(0.9); }
  100%{ transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .bell-icon.ringing, #notif-badge.popping { animation: none; }
}

.nav-me-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-post-btn {
  background: var(--accent);
  color: #0f0e0b;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(196,149,106,0.35);
}
.nav-post-btn svg { width: 24px; height: 24px; }
.nav-post-btn:hover {
  background: var(--accent2);
  transform: scale(1.06);
  box-shadow: 0 6px 24px rgba(196,149,106,0.45);
}
.nav-post-btn:active { transform: scale(0.97); }

.bnav-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--border);
  transition: border-color var(--transition);
}
.nav-item.active .bnav-avatar { border-color: var(--accent); }

/* ===== FEED HEADER ===== */
.feed-col {
  border-right: none;
  min-height: 100vh;
  /* header 現在是 fixed（脫離文件流），內容要往下讓出 header 高度，否則會被蓋住。
     --shell-top 由 ooUpdateShellMetrics() 量 header 實際高度後寫入（含 safe-area）。 */
  padding-top: var(--shell-top);
}

.feed-header {
  /* 真・固定（不是 sticky）：sticky 在手機瀏覽器配上 body overflow-x:hidden 容易失效、
     捲動時被帶著跑。改 fixed 後上排永遠釘在頂端，跟下面 .bottom-nav 一樣。
     內容不被蓋住：靠 .feed-col 的 padding-top: var(--shell-top)（= 量出來的 header 高度）。
     背景／底線橫跨整個視窗寬度（left:0 right:0）→ 看起來是一整條 bar，不是浮在中間的區塊；
     裡面內容靠 .feed-header-inner 收回到中間那欄，跟下方內容對齊。 */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  border-bottom: 1px solid var(--border-soft);
  padding-top: env(safe-area-inset-top);
  z-index: 60;
}

/* header 內層：把 logo／標題／icon 收回中間那欄，寬度跟 .app-layout 一致 */
.feed-header-inner {
  max-width: 600px;
  margin: 0 auto;
  padding: 14px 20px;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-style: italic;
  color: var(--text);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
/* 桌機內容欄變寬 → header 內層跟著變寬，logo/icon 才對得齊下方 800px 內容欄。
   ⚠️ 這條 media 一定要放在 .feed-header-inner 基礎規則「之後」：media 不加 specificity，
   同分時後者贏，放前面會被下面的 max-width:600 蓋掉（踩過這坑）。 */
@media (min-width: 640px) {
  .feed-header-inner { max-width: 800px; }
}

.header-menu-wrap { position: relative; }

.header-menu-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 6px;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  width: 34px;
  height: 34px;
}
.header-menu-btn:hover {
  background: var(--bg3);
  color: var(--text);
}

.header-dropdown {
  display: none;
  position: fixed;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  min-width: 170px;
  z-index: 9000;
  overflow: hidden;
}
.header-dropdown.show {
  display: block;
  animation: fadeUp 0.15s ease both;
}

.header-dropdown-item {
  display: block;
  width: 100%;
  padding: 12px 16px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 0.88rem;
  text-align: left;
  cursor: pointer;
  transition: background var(--transition);
  font-family: var(--font-body);
}
.header-dropdown-item:hover { background: var(--bg3); }
.header-dropdown-item.danger { color: var(--danger); }
.header-dropdown-item.danger:hover { background: var(--danger-bg); }

/* ===== FEED EMPTY STATE ===== */
.feed-empty {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-muted);
}

.feed-empty h3 {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.4rem;
  font-weight: 400;
  margin-bottom: 10px;
  color: var(--text);
}

/* ===== TODAY STRIP ===== */
.today-strip {
  margin: 14px 16px 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(196,149,106,0.1), rgba(122,170,138,0.05)), var(--bg2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.today-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.today-strip-bare .today-head {
  margin-bottom: 0;
}

.today-kicker {
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
}

.today-title {
  color: var(--text);
  font-size: 0.96rem;
  font-weight: 700;
  line-height: 1.35;
  margin-top: 3px;
}

.today-refresh {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: rgba(0,0,0,0.16);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.today-refresh svg {
  width: 15px;
  height: 15px;
}

.today-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.today-cards.today-single {
  grid-template-columns: 1fr;
}

.today-card {
  min-width: 0;
  min-height: 86px;
  padding: 10px;
  border: 1px solid rgba(196,149,106,0.22);
  border-radius: 10px;
  background: rgba(15,14,11,0.46);
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  text-align: left;
  transition: transform var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
}

.today-single .today-card {
  min-height: 74px;
  flex-direction: row;
  align-items: center;
}

.today-single .today-copy {
  flex: 1;
}

.today-single .today-copy strong {
  font-size: 0.95rem;
}

.today-single .today-meta {
  margin-top: 0;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--accent-bg);
  white-space: nowrap;
}

.today-card:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  background: rgba(196,149,106,0.08);
}

.today-icon {
  width: 27px;
  height: 27px;
  border-radius: 9px;
  background: var(--accent-bg);
  color: var(--accent2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.today-icon svg {
  width: 15px;
  height: 15px;
}

.today-copy {
  min-width: 0;
  display: block;
}

.today-copy strong {
  display: block;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.today-copy small {
  display: block;
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.35;
  margin-top: 3px;
}

.today-meta {
  margin-top: auto;
  color: var(--accent2);
  font-size: 0.68rem;
  font-weight: 700;
}

@media (max-width: 560px) {
  .today-strip {
    margin-left: 12px;
    margin-right: 12px;
    padding: 10px;
  }
  .today-cards {
    display: flex;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    padding-bottom: 1px;
  }
  .today-cards::-webkit-scrollbar { display: none; }
  .today-card {
    flex: 0 0 148px;
  }
  .today-cards.today-single {
    display: grid;
  }
  .today-cards.today-single .today-card {
    flex: none;
  }
}

/* ===== POST CARD ===== */
.post-card {
  border-bottom: 1px solid var(--border-soft);
  padding: 22px 0;
  transition: background var(--transition-fast);
}

.post-card:hover { background: rgba(196,149,106,0.02); }

.post-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  margin-bottom: 14px;
}

.post-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg3);
  border: 1.5px solid var(--border);
  object-fit: cover;
  flex-shrink: 0;
  transition: border-color var(--transition);
}
.post-avatar:hover { border-color: var(--accent); }

.post-user { flex: 1; }
.post-user .name { font-weight: 600; font-size: 0.9rem; color: var(--text); }
.post-user .handle { color: var(--text-muted); font-size: 0.8rem; margin-top: 1px; }

.post-time { color: var(--text-dim); font-size: 0.76rem; }

.post-type-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: var(--bg4);
  border: 1px solid var(--border);
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.post-caption {
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 14px;
  color: var(--text);
  padding: 0 20px;
}

.post-location {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.76rem;
  padding: 0 20px;
  color: var(--accent);
  margin-bottom: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.post-media {
  border-radius: 0;
  overflow: hidden;
  margin-bottom: 0;
  background: var(--bg3);
  padding: 0 16px;
}

.post-media img {
  width: 100%;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  border-radius: var(--radius-sm);
}

/* ===== POST ACTIONS ===== */
.post-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px 0;
  border-top: 1px solid var(--border-soft);
  margin-top: 8px;
}

.post-action-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.post-action-btn:hover {
  color: var(--text);
  background: var(--bg3);
}
.post-action-btn.liked { color: var(--danger); }
.post-action-btn svg { width: 20px; height: 20px; }

.like-heart {
  font-size: 1.25rem;
  line-height: 1;
  display: inline-block;
  transition: transform 0.15s ease;
}
.post-action-btn:hover .like-heart { transform: scale(1.15); }
.like-pop .like-heart {
  animation: like-pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes like-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.65); }
  70%  { transform: scale(0.88); }
  100% { transform: scale(1); }
}

/* ===== LIKED BY ===== */
.liked-by-row {
  padding: 6px 20px 2px;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.liked-by-row strong { color: var(--text); font-weight: 600; }

/* ===== COMMENTS ===== */
.comments-panel {
  border-top: 1px solid var(--border-soft);
  padding: 14px 20px 6px;
  animation: fadeIn 0.15s ease;
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 14px;
}

.comment-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.comment-author {
  font-weight: 600;
  font-size: 0.84rem;
  color: var(--text);
}

.comment-body {
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.55;
}

.comment-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.comment-delete-btn {
  background: none;
  border: none;
  color: var(--danger);
  font-size: 0.72rem;
  cursor: pointer;
  padding: 0 4px;
  opacity: 0.55;
  transition: opacity var(--transition);
}
.comment-delete-btn:hover { opacity: 1; }

.comment-compose {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-soft);
}

.comment-input {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 9px 16px;
  font-size: 0.85rem;
  color: var(--text);
  outline: none;
  font-family: var(--font-body);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.comment-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
textarea.comment-input {
  resize: none;
  line-height: 1.35;
  max-height: 120px;
  overflow-y: auto;
  display: block;
  width: 100%;
  box-sizing: border-box;
}

.comment-post-btn {
  background: var(--accent);
  color: #0f0e0b;
  border: none;
  border-radius: var(--radius-pill);
  padding: 8px 18px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
}
.comment-post-btn:hover {
  background: var(--accent2);
  transform: translateY(-1px);
}

/* ===== COMPOSER V2 ===== */
.cv2-modal {
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  height: min(620px, 88vh);
  overflow: hidden;
}

.cv2-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-soft);
  flex-shrink: 0;
}

.cv2-title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--text);
}

.cv2-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--bg3);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.cv2-close:hover { color: var(--text); background: var(--bg4); }

.cv2-tabs {
  display: flex;
  padding: 12px 14px 0;
  gap: 3px;
  flex-shrink: 0;
}

.cv2-tab {
  flex: 1;
  padding: 9px 4px 10px;
  border-radius: 10px 10px 0 0;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  color: var(--text-muted);
  background: var(--bg3);
  border: 1px solid var(--border);
  border-bottom: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  opacity: 0.6;
  transition: all 0.15s;
}

.cv2-tab.active {
  color: var(--accent);
  background: var(--bg2);
  opacity: 1;
  border-bottom: 2px solid var(--accent);
}

.cv2-tab svg { display: block; }

.cv2-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain none;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-top: 1px solid var(--border-soft);
  background: var(--bg2);
}

.cv2-input {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  color: var(--text);
  font-size: 0.88rem;
  outline: none;
  box-sizing: border-box;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.cv2-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.cv2-textarea {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  color: var(--text);
  font-size: 0.88rem;
  outline: none;
  resize: none;
  min-height: 90px;
  box-sizing: border-box;
  line-height: 1.6;
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.cv2-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.cv2-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.cv2-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 7px 14px;
  font-size: 0.76rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.cv2-chip:hover,
.cv2-chip.has-location { border-color: var(--accent); color: var(--accent); }
.cv2-chip.has-exif { border-color: var(--accent); border-style: dashed; color: var(--accent); opacity: 0.75; }

/* ── 圖片投票的格子 ──────────────────────────────
   主路徑：點圖放大 → 放大檢視裡按「投這張」（手機桌面通用）。
   另外給兩種快捷，各配各的裝置能力，靠 hover media query 分流不用 JS 判斷裝置：
     觸控 → 長按 650ms（.poll-hold-hint 教他）
     桌面 → 滑過去浮出 .poll-hover-vote
*/
.poll-photo-cell {
  position: relative; aspect-ratio: 1;
  border-radius: 8px; overflow: hidden; cursor: pointer;
  border: 2px solid transparent;
  -webkit-touch-callout: none; user-select: none; -webkit-user-select: none;
}
.poll-photo-cell.is-my-vote { border-color: var(--accent); }

/* 百分比看得清楚要壓暗，但暗久了看不到照片本身 → 桌面滑過去幾乎全亮 */
.poll-photo-veil {
  position: absolute; inset: 0; border-radius: 8px;
  background: rgba(0,0,0,0.3);
  display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: 6px;
  transition: background 0.15s;
}
.poll-photo-cell.is-my-vote .poll-photo-veil { background: rgba(0,0,0,0.5); }
@media (hover: hover) and (pointer: fine) {
  .poll-photo-cell:hover .poll-photo-veil,
  .poll-photo-cell.is-my-vote:hover .poll-photo-veil { background: rgba(0,0,0,0.06); }
}

.poll-hold-hint {
  position: absolute; top: 6px; right: 6px; z-index: 3;
  background: rgba(0,0,0,0.55); color: #fff; font-size: 0.62rem;
  padding: 2px 7px; border-radius: 999px; pointer-events: none;
}

.poll-hover-vote {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  z-index: 5; padding: 7px 15px; border-radius: 999px;
  background: var(--accent); color: #111; border: none;
  font-size: 0.78rem; font-weight: 700; font-family: inherit;
  cursor: pointer; white-space: nowrap;
  opacity: 0; transition: opacity 0.15s;
  box-shadow: 0 3px 12px rgba(0,0,0,0.45);
}
.poll-photo-cell:hover .poll-hover-vote { opacity: 1; }

/* 有滑鼠 → 不要叫他長按 */
@media (hover: hover) and (pointer: fine) {
  .poll-hold-hint { display: none; }
}
/* 純觸控 → hover 鈕沒有意義，而且 tap 會觸發 sticky hover 讓它卡住不消失 */
@media (hover: none) {
  .poll-hover-vote { display: none; }
}

/* 圖片投票的長按進度環：壓住 650ms 轉完一圈 = 投這張（見 feed.js pollPressStart） */
.poll-press-ring {
  position: absolute; inset: 0; z-index: 4; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.4);
}
.poll-press-ring svg { width: 46px; height: 46px; transform: rotate(-90deg); }
.poll-press-ring .ring-bg { fill: none; stroke: rgba(255,255,255,0.25); stroke-width: 3; }
/* stroke-dasharray 107 ≈ 圓周長 (2π×17)，dashoffset 從滿到 0 就是繞完一圈 */
.poll-press-ring .ring-fg {
  fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round;
  stroke-dasharray: 107; stroke-dashoffset: 107;
}
.poll-press-ring.go .ring-fg { transition: stroke-dashoffset 0.65s linear; stroke-dashoffset: 0; }

.poll-opt-row { display: flex; align-items: center; gap: 7px; margin-bottom: 7px; }
.poll-opt-row .cv2-input { flex: 1; margin-bottom: 0; }

.poll-opt-cam {
  width: 40px; height: 40px; flex-shrink: 0;
  border-radius: var(--radius-xs); background: var(--bg3);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; overflow: hidden; position: relative;
  transition: all 0.15s;
  color: var(--text-muted);
}
.poll-opt-cam:hover { border-color: var(--accent); color: var(--accent); }
.poll-opt-cam.has-photo { border-color: var(--accent); }
/* 上傳中：只把圖／icon 壓暗，別整塊 opacity —— 那會把百分比字一起淡到看不清 */
.poll-opt-cam.uploading { pointer-events: none; }
.poll-opt-cam.uploading > svg,
.poll-opt-cam.uploading > img { opacity: 0.25; }
.poll-cam-pct { display: none; }
.poll-opt-cam.uploading .poll-cam-pct {
  display: flex; position: absolute; inset: 0; z-index: 2;
  align-items: center; justify-content: center;
  background: rgba(0,0,0,0.45);
  color: #fff; font-size: 0.6rem; font-weight: 700;
}
.poll-opt-cam input[type="file"] {
  position: absolute; inset: 0; opacity: 0;
  cursor: pointer; width: 100%; height: 100%;
}

.cv2-sticky-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 16px;
  border-top: 1px solid var(--border-soft);
  background: var(--bg2);
  flex-shrink: 0;
}

.cv2-privacy-wrap { position: relative; }

.cv2-privacy-menu {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow);
  min-width: 170px;
  z-index: 200;
}
.cv2-privacy-menu.open {
  display: block;
  animation: fadeUp 0.15s ease both;
}

.cv2-privacy-opt {
  display: block;
  width: 100%;
  padding: 11px 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.84rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s;
}
.cv2-privacy-opt:hover { background: var(--bg3); color: var(--text); }
.cv2-privacy-opt-active { color: var(--accent) !important; }

.cv2-privacy-chk {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  color: var(--text);
  font-size: 0.84rem;
  cursor: pointer;
  transition: background 0.12s;
}
.cv2-privacy-chk:hover { background: var(--bg3); }
.cv2-privacy-chk input { accent-color: var(--accent); width: 16px; height: 16px; flex-shrink: 0; cursor: pointer; }
.cv2-privacy-chk input:disabled { opacity: 0.4; cursor: not-allowed; }
.cv2-privacy-chk input:disabled + span { opacity: 0.4; }

.cv2-footer {
  padding: 12px 16px;
  padding-bottom: calc(env(safe-area-inset-bottom) + 12px);
  border-top: 1px solid var(--border-soft);
  background: var(--bg2);
  flex-shrink: 0;
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-overlay.show { display: flex; }

/* 發文 composer 可從底部導覽列「+」在氏族詳情頁(z-index:9990)之上開啟，
   必須蓋過氏族詳情/群聊/編輯氏族(9990~10001)，否則會開在後面、離開氏族頁才看得到 */
#composer-modal { z-index: 10050; }

.modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 32px;
  width: 100%;
  max-width: 540px;
  box-shadow: var(--shadow);
  animation: fadeUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
  max-height: 90vh;
  overflow-y: auto;
}

@media (max-width: 520px) {
  .modal-overlay {
    align-items: flex-start;
    padding: 12px;
    padding-top: max(env(safe-area-inset-top), 12px);
  }
  .modal {
    max-height: calc(100dvh - 24px);
    border-radius: 18px;
    padding: 20px;
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.modal-title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.25rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--text);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 35px;
  line-height: 1;
  padding: 4px;
  transition: color var(--transition);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover { color: var(--text); background: var(--bg3); }

.feed-people-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}
@media (max-width: 520px) {
  .feed-people-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.feed-people-grid-scroll {
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 8px;
  box-sizing: border-box;
}

/* 新加入：固定一排，卡片是網格版的一半大，放不下就往右捲 */
.feed-people-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 10px 8px;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  overscroll-behavior-x: contain;
}
.feed-people-row::-webkit-scrollbar { display: none; }
/* 拖曳時不要拉出圖片的原生拖曳殘影 */
.feed-people-row img { -webkit-user-drag: none; user-drag: none; }
/* 除數帶小數：讓最後一張露半截出來，暗示還可以往右拖 */
.feed-people-row > * {
  flex: 0 0 auto;
  width: calc((100% - 90px) / 7);
}
@media (max-width: 520px) {
  .feed-people-row > * {
    width: calc((100% - 70px) / 5.5);
  }
}

.album-modal-box {
  width: 80vw;
  max-width: 1100px;
  height: 80vh;
}
@media (max-width: 520px) {
  .album-modal-box {
    width: 100%;
    height: 85vh;
  }
}

.album-count-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--accent);
  color: #0f0e0b;
  font-size: 0.68rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  padding: 0 5px;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg);
}

/* Post type grid */
.post-type-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

.type-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  padding: 10px 6px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}
.type-btn:hover { border-color: var(--accent); color: var(--accent); }
.type-btn.selected {
  background: var(--accent-bg);
  border-color: var(--accent);
  color: var(--accent);
}

.location-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 16px;
  cursor: pointer;
  transition: all var(--transition);
  font-size: 0.88rem;
  color: var(--text-muted);
}
.location-row:hover { border-color: var(--accent); color: var(--accent); }
.location-row.has-location { color: var(--accent); border-color: var(--accent); }
.location-row svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ===== MEDIA CAROUSEL ===== */
.mc-wrap {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #000;
}

.mc-inner {
  position: relative;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #000;
}

.mc-slide { width: 100%; }

.mc-media {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: min(78vh, 820px);
  height: auto;
  margin: 0 auto;
  cursor: pointer;
}

.mc-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(15,14,11,0.7);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  z-index: 5;
  line-height: 1;
  backdrop-filter: blur(4px);
  transition: all var(--transition);
}
.mc-btn:hover { background: rgba(196,149,106,0.3); border-color: var(--accent); }

.mc-left  { left: var(--mc-left-inset, 10px); }
.mc-right { right: var(--mc-right-inset, 10px); }

.mc-counter {
  position: absolute;
  top: 10px;
  right: var(--mc-right-inset, 12px);
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 0.7rem;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  backdrop-filter: blur(4px);
  letter-spacing: 0.03em;
}

.mc-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
  z-index: 5;
}

.mc-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  transition: all 0.2s;
}
.mc-dot-active {
  background: #fff;
  width: 14px;
  border-radius: 3px;
}

/* ===== PULL TO REFRESH ===== */
#ptr-indicator {
  height: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: height 0.15s ease, opacity 0.15s ease;
}

.ptr-spinner {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
}
#ptr-indicator.ptr-ready .ptr-spinner { border-top-color: var(--accent2); }
#ptr-indicator.ptr-loading .ptr-spinner { animation: spin 0.7s linear infinite; }

/* ===== SPINNER ===== */
.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 40px auto;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
/* 氏族「有新貼文」提示鈕彈入（保留 translateX(-50%) 置中，避免動畫結束時跳位） */
@keyframes clanNewPop {
  from { opacity: 0; transform: translateX(-50%) translateY(-8px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes mapSharePulse {
  0%,100% { transform: scale(1);    box-shadow: 0 2px 8px rgba(0,0,0,0.35); }
  50%     { transform: scale(1.06); box-shadow: 0 2px 14px rgba(224,36,94,0.55); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.fade-in { animation: fadeIn 0.25s ease both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 88px;
  left: 20px;
  right: 20px;
  margin: 0 auto;
  width: fit-content;
  max-width: calc(100% - 40px);
  transform: translateY(20px);
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 11px 22px;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  /* 全站最頂：toast 是即時回饋，被任何全螢幕視窗蓋住就等於沒跳。
     原本 200 → 氏族視窗(9990~10001)；後來又加了 composer(10050)/配樂(10061)/語音(10062)/
     圖片編輯器(10063)，toast 必須在這些之上，否則發文/配樂時的錯誤提示會被蓋住。 */
  z-index: 10100;
  text-align: center;
  opacity: 0;
}
.toast.show {
  transform: translateY(0);
  opacity: 1;
}
.toast.success { border-color: var(--success); color: var(--success); }
.toast.error   { border-color: var(--danger);  color: var(--danger); }

/* ===== BLOCKED SCREEN ===== */
.blocked-page {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

.blocked-page::before {
  content: '';
  position: absolute;
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(196,120,120,0.06) 0%, transparent 70%);
  top: -150px; left: 50%;
  transform: translateX(-50%);
  border-radius: 50%;
  pointer-events: none;
}

.blocked-box {
  background: var(--bg2);
  border: 1px solid rgba(196,120,120,0.25);
  border-radius: 24px;
  padding: 52px 44px;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 4px 40px rgba(196,120,120,0.06);
  animation: fadeUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
  text-align: center;
}

.blocked-icon {
  width: 72px; height: 72px;
  background: var(--danger-bg);
  border: 2px solid rgba(196,120,120,0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  font-size: 2rem;
}

.blocked-title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.7rem;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 10px;
}

.blocked-subtitle { color: var(--text-muted); font-size: 0.88rem; margin-bottom: 24px; }

.blocked-reason {
  background: var(--danger-bg);
  border: 1px solid rgba(196,120,120,0.2);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 0.9rem;
  color: #daa0a0;
  margin-bottom: 32px;
  text-align: left;
  line-height: 1.65;
}
.blocked-reason strong {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--danger);
  margin-bottom: 6px;
}

.blocked-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  color: var(--text-muted);
  font-size: 0.78rem;
}
.blocked-divider::before,
.blocked-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.appeal-submitted {
  background: var(--success-bg);
  border: 1px solid rgba(122,170,138,0.3);
  border-radius: var(--radius-sm);
  padding: 20px;
  text-align: center;
  color: var(--success);
}
.appeal-submitted .check-icon { font-size: 2.4rem; display: block; margin-bottom: 10px; }

/* ===== ADMIN PANEL ===== */
.admin-tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.admin-tab {
  flex: 1; background: none; border: none;
  color: var(--text-muted); padding: 12px;
  font-size: 0.9rem; font-weight: 500;
  transition: var(--transition);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  cursor: pointer;
}
.admin-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.admin-badge {
  display: inline-flex; align-items: center;
  padding: 3px 9px; border-radius: var(--radius-pill);
  font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase;
}
.admin-badge.pending  { background: var(--accent-bg);   color: var(--accent);  border: 1px solid rgba(196,149,106,0.35); }
.admin-badge.approved { background: var(--success-bg);  color: var(--success); border: 1px solid rgba(122,170,138,0.3); }
.admin-badge.rejected { background: var(--danger-bg);   color: var(--danger);  border: 1px solid rgba(196,120,120,0.25); }
.admin-badge.blocked  { background: var(--danger-bg);   color: var(--danger);  border: 1px solid rgba(196,120,120,0.25); }
.admin-badge.active   { background: var(--success-bg);  color: var(--success); border: 1px solid rgba(122,170,138,0.3); }
.admin-badge.admin    { background: var(--accent-bg);   color: var(--accent);  border: 1px solid var(--accent); }

.appeal-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  transition: border-color var(--transition);
}
.appeal-card:hover { border-color: var(--bg4); }
.appeal-card-header { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.appeal-card-header img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); }

.appeal-message {
  background: var(--bg3);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text);
  margin-bottom: 14px;
  border-left: 3px solid var(--accent);
}

.appeal-block-reason {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  padding: 8px 12px;
  background: var(--danger-bg);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(196,120,120,0.15);
}

.appeal-actions { display: flex; gap: 10px; }

.btn-approve {
  background: var(--success-bg); color: var(--success);
  border: 1px solid rgba(122,170,138,0.4);
  border-radius: var(--radius-sm); padding: 8px 18px;
  font-size: 0.85rem; font-weight: 600;
  transition: var(--transition); cursor: pointer;
}
.btn-approve:hover { background: rgba(122,170,138,0.2); }

.btn-reject {
  background: var(--danger-bg); color: var(--danger);
  border: 1px solid rgba(196,120,120,0.3);
  border-radius: var(--radius-sm); padding: 8px 18px;
  font-size: 0.85rem; font-weight: 600;
  transition: var(--transition); cursor: pointer;
}
.btn-reject:hover { background: rgba(196,120,120,0.18); }

.admin-user-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 0; border-bottom: 1px solid var(--border-soft);
}
.admin-user-row:last-child { border-bottom: none; }
.admin-user-info { flex: 1; min-width: 0; }
.admin-user-name { font-weight: 600; font-size: 0.92rem; }
.admin-user-meta { color: var(--text-muted); font-size: 0.78rem; margin-top: 2px; }

.nav-admin-badge {
  background: var(--danger);
  color: #fff;
  border-radius: var(--radius-pill);
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 7px;
  margin-left: auto;
  min-width: 18px;
  text-align: center;
}

/* ===== MESSAGES PAGE ===== */
#main-content:has(.msg-layout) {
  overflow: hidden;
  padding: 0 !important;
}

body.msg-open {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  padding-bottom: 0;
}
body.msg-open #app {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}
body.msg-open .app-layout {
  height: calc(100vh - 64px);
  height: calc(100dvh - 64px);
  min-height: 0 !important;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
body.msg-open .feed-col {
  flex: 1;
  min-height: 0 !important;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
body.msg-open #main-content {
  flex: 1;
  min-height: 0 !important;
  overflow: hidden !important;
  padding: 0 !important;
}

.msg-layout {
  display: flex;
  height: 100%;
  overflow: hidden;
}

.msg-sidebar {
  width: 100%;
  max-width: 300px;
  min-width: 220px;
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  background: var(--bg);
  flex-shrink: 0;
  overflow: hidden;
}

.msg-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg);
  flex-shrink: 0;
}

.msg-sidebar-title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--text);
}

.msg-compose-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--accent-bg);
  border: 1px solid rgba(196,149,106,0.25);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}
.msg-compose-btn:hover {
  background: var(--accent-glow);
  border-color: var(--accent);
}

.msg-conv-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain none;
}

.msg-conv-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  cursor: pointer;
  transition: background 0.12s ease;
  border-bottom: 1px solid rgba(255,255,255,0.025);
}
.msg-conv-item:hover { background: rgba(255,255,255,0.03); }
.msg-conv-item.active {
  background: var(--accent-bg);
  border-left: 3px solid var(--accent);
  padding-left: 13px;
}

.msg-conv-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--border);
  flex-shrink: 0;
}

.msg-conv-info { flex: 1; min-width: 0; }

.msg-conv-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.msg-conv-preview {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.msg-conv-preview.unread { color: var(--text); font-weight: 600; }

.msg-conv-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  flex-shrink: 0;
}

.msg-conv-time {
  font-size: 0.7rem;
  color: var(--text-dim);
}

.msg-unread-dot {
  background: var(--accent);
  color: #0f0e0b;
  font-size: 0.62rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

/* Thread panel */
.msg-thread {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  background: var(--bg);
}

.msg-thread-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  text-align: center;
  padding: 40px 24px;
}

.msg-thread-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-soft);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(12px);
  flex-shrink: 0;
  min-height: 60px;
}

.msg-thread-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--border);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color var(--transition);
}
.msg-thread-avatar:hover { border-color: var(--accent); }

.msg-thread-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  cursor: pointer;
  transition: color 0.15s;
}
.msg-thread-name:hover { color: var(--accent); }

/* Bubbles */
.msg-bubbles {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.msg-date-divider {
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  margin: 14px 0 8px;
  position: relative;
}
.msg-date-divider::before,
.msg-date-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 28%;
  height: 1px;
  background: var(--border-soft);
}
.msg-date-divider::before { left: 0; }
.msg-date-divider::after { right: 0; }

.msg-bubble-row {
  display: flex;
  width: 100%;
  margin-bottom: 2px;
  animation: fadeIn 0.15s ease;
}
.msg-bubble-row.me { justify-content: flex-end; }

.msg-bubble-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  cursor: pointer;
  flex-shrink: 0;
  margin-bottom: 2px;
}

.msg-bubble {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  line-height: 1.5;
  word-break: break-word;
  max-width: 100%;
  text-align: left;
  vertical-align: bottom;
}

.msg-bubble-sticker {
  background: none;
  border: none;
  padding: 0;
  display: inline-block;
  max-width: 240px;
}

.msg-bubble-them {
  background: var(--bg3);
  border: 1px solid var(--border-soft);
  border-bottom-left-radius: 6px;
  color: var(--text);
}

.msg-bubble-me {
  background: var(--bg4);
  border: 1px solid rgba(196,149,106,0.12);
  color: var(--text);
  border-bottom-right-radius: 6px;
}

.msg-sent-label {
  font-size: 0.62rem;
  color: var(--text-dim);
  align-self: flex-end;
  padding-bottom: 2px;
  white-space: nowrap;
}

/* Input bar */
.msg-input-bar {
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding: 10px 14px;
  padding-bottom: calc(env(safe-area-inset-bottom) + 10px);
  border-top: 1px solid var(--border-soft);
  background: var(--bg);
  flex-shrink: 0;
}

/* 4 顆附加鈕（照片/貼圖/花字/麥克風）直排成一豎排，輸入框做成一樣高 */
.msg-tools-col {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 4px;
  flex-shrink: 0;
}
.msg-tools-col button { width: 32px; height: 32px; border-radius: 8px; }
.msg-tools-col button:hover { background: rgba(255,255,255,0.06) !important; }

/* 輸入框 + 送出鍵（送出鍵浮在框內右下角） */
.msg-input-wrap { flex: 1; min-width: 0; position: relative; display: flex; }

.msg-input {
  flex: 1;
  width: 100%;
  min-width: 0;
  min-height: 140px;       /* 跟左邊 4 顆按鈕（4×32 + 3×4 gap）同高 */
  max-height: 40vh;
  box-sizing: border-box;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 54px 14px 18px;   /* 右邊留空給浮在框內的送出鍵 */
  color: var(--text);
  font-size: 0.92rem;
  font-family: var(--font-body);
  line-height: 1.35;
  resize: none;
  overflow-y: auto;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.msg-input:focus {
  border-color: rgba(196,149,106,0.4);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: var(--bg2);
}
.msg-input::placeholder { color: var(--text-dim); }

.msg-send-btn {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  color: #0f0e0b;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
  box-shadow: 0 3px 12px rgba(196,149,106,0.3);
  z-index: 2;
}
.msg-send-btn:hover { background: var(--accent2); transform: scale(1.06); }
.msg-send-btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none; box-shadow: none; }

/* User picker */
.msg-user-pick-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 4px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.12s;
  border-bottom: 1px solid var(--border-soft);
}
.msg-user-pick-row:hover { background: rgba(255,255,255,0.04); }
.msg-user-pick-row:last-child { border-bottom: none; }

/* Mobile messages */
@media (max-width: 520px) {
  .msg-sidebar { max-width: 100%; min-width: 0; }
  .msg-thread { display: none; }
  .msg-layout.conv-open .msg-sidebar { display: none; }
  .msg-layout.conv-open .msg-thread { display: flex; }
  .msg-bubble { max-width: 100%; }
}

/* ===== NOTIFICATION PANEL ===== */
.notif-panel {
  position: fixed;
  /* 卡在常駐外框之間，跟其他頁面型視窗一樣不蓋住上下兩排 */
  top: var(--shell-top);
  bottom: var(--shell-bottom);
  right: 0;
  width: 360px;
  max-width: 100%;
  background: var(--bg2);
  border-left: 1px solid var(--border);
  /* 仍要蓋過氏族詳情(9990)/群聊(9992)：兩者在中間那段是重疊的。
     上限是 9999：面板裡的頭像有 hover 卡(.hover-card, 9999)，那個必須留在面板之上。 */
  z-index: 9995;
  display: flex;
  flex-direction: column;
  transform: translateX(110%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -8px 0 40px rgba(0,0,0,0.6);
}
.notif-panel.open { transform: translateX(0); }

.notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* 上緣安全區由 logo 排處理（面板現在從它下方開始），這裡再加會變雙倍留白 */
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-soft);
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}

.notif-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain none;
}

.notif-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-soft);
  transition: background 0.12s;
}
.notif-item:hover { background: rgba(255,255,255,0.03); }

.notif-unread { background: rgba(196,149,106,0.05); }
.notif-unread:hover { background: rgba(196,149,106,0.09); }

@media (max-width: 480px) {
  .notif-panel { width: 100%; }
}

/* ===== PROFILE HEADER ===== */
.profile-name {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.6rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--text);
}

/* ===== RIGHT PANEL ===== */
.right-panel {
  padding: 24px 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.panel-section { margin-bottom: 28px; }
.panel-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

/* ===== RESPONSIVE BREAKPOINTS ===== */
@media (min-width: 640px) {
  .bottom-nav { max-width: 900px; }
  .msg-sidebar { max-width: 320px; min-width: 260px; }
  .msg-bubble { max-width: 100%; }
}

@media (min-width: 1200px) {
  .msg-sidebar { max-width: 380px; min-width: 300px; }
  .msg-bubble { max-width: 100%; }
  .msg-input { font-size: 1rem; padding: 13px 20px; }
}

/* ===== HOVER PROFILE CARD ===== */
img[data-hover-user] {
  -webkit-touch-callout: none;
}
.hover-card {
  position: fixed;
  z-index: 9999;
  width: 300px;
  background: rgba(16,16,16,0.97);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.7);
  backdrop-filter: blur(12px);
  pointer-events: auto;
  animation: hoverCardIn 0.15s ease;
  left: -9999px;
  top: -9999px;
}
@keyframes hoverCardIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

/* ===== VIEW TRANSITIONS ===== */
::view-transition-old(root) {
  animation: 200ms ease both vt-slide-out;
}
::view-transition-new(root) {
  animation: 200ms ease both vt-slide-in;
}
@keyframes vt-slide-out {
  to { transform: translateY(6px); opacity: 0; }
}
@keyframes vt-slide-in {
  from { transform: translateY(-6px); opacity: 0; }
}

/* ===== 當天紅人（Person of the Day）特效 ===== */
/* 大方形卡：金框 + 會動的雙色（粉紅／金）呼吸光暈。box-shadow 不受 overflow:hidden 裁切，所以光暈能溢出卡外 */
.featured-card {
  border: 2px solid #ffd54a !important;
  animation: featPulse 2s ease-in-out infinite;
  z-index: 2;
}
@keyframes featPulse {
  0%, 100% { box-shadow: 0 0 8px 2px rgba(255,120,180,0.55), 0 0 16px 4px rgba(255,213,74,0.35); }
  50%      { box-shadow: 0 0 16px 6px rgba(255,120,180,0.9),  0 0 30px 12px rgba(255,213,74,0.6); }
}

/* 小圓頭像：右上角一朵會輕輕搖擺的粉紅花 */
.featured-avatar-wrap {
  position: relative;
  display: inline-block;
  line-height: 0;
}
.featured-flower {
  position: absolute;
  top: -5px;
  right: -5px;
  font-size: 0.95rem;
  line-height: 1;
  pointer-events: none;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.45));
  transform-origin: 60% 60%;
  animation: featBob 2.4s ease-in-out infinite;
}
@keyframes featBob {
  0%, 100% { transform: rotate(-10deg) scale(1); }
  50%      { transform: rotate(10deg)  scale(1.15); }
}

/* ===== 當天大紅人：花瓣「落在頭像/卡片裡面」（局部，被容器裁切＝標示是這個人）===== */
.feat-petals-layer { position:absolute; inset:0; pointer-events:none; overflow:hidden; z-index:4; }
.feat-petals-layer > span { position:absolute; top:-12%; line-height:1; will-change:top,transform; }
@keyframes featPetalIn {
  0%   { top:-12%; opacity:0; transform:rotate(0deg); }
  12%  { opacity:1; }
  100% { top:112%; opacity:0.9; transform:rotate(360deg); }
}
