* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body {
  position: fixed;
  inset: 0;
  width: 100%;
  height: var(--app-height, 100dvh);
  max-height: var(--app-height, 100dvh);
  overflow: hidden;
  overscroll-behavior: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #fdf6e3;
  color: #1c1c1e;
}
body {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: var(--app-height, 100dvh);
  max-height: var(--app-height, 100dvh);
}
.hidden { display: none !important; }

/* 强制所有输入框字体至少为 16px，彻底杜绝 iOS 聚焦时自动放大画面并破坏排版 */
input, textarea, select {
  font-size: 16px !important;
}

/* 顶部栏与 iOS 刘海安全区 */
.topbar {
  position: relative;
  flex-shrink: 0;
  box-sizing: border-box;
  width: 100%;
  max-width: 100vw;
  padding: calc(10px + env(safe-area-inset-top)) 10px 8px;
  background: #fffdf8;
  border-bottom: 1px solid #efe4d6;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  gap: 6px;
  white-space: nowrap;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  flex-shrink: 0;
}
.topbar-left:active { opacity: 0.82; }
.conn-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}
.conn-status-dot.online {
  background-color: #34c759;
  box-shadow: 0 0 6px rgba(52, 199, 89, 0.55);
}
.conn-status-dot.connecting,
.conn-status-dot.offline {
  background-color: #ff9f0a;
  box-shadow: 0 0 8px rgba(255, 159, 10, 0.65);
  animation: statusPulse 1.4s ease-in-out infinite;
}
@keyframes statusPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.5; }
}

/* 顶部轻量浮动提示 */
.toast {
  position: fixed;
  top: calc(14px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  background: rgba(61, 45, 30, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  padding: 6px 14px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  z-index: 1000;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  pointer-events: none;
  animation: toastFadeIn 0.22s ease-out;
  white-space: nowrap;
}
@keyframes toastFadeIn {
  0% { opacity: 0; transform: translate(-50%, -6px); }
  100% { opacity: 1; transform: translate(-50%, 0); }
}

/* 顶部断线重连状态提示条（轻量悬浮，重连成功后平滑收起） */
.conn-banner {
  width: 100%;
  box-sizing: border-box;
  padding: 5px 12px;
  background: #ff9f0a;
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  z-index: 105;
  transition: background-color 0.25s ease, opacity 0.25s ease;
  animation: bannerSlideDown 0.22s ease-out;
}
.conn-banner.reconnected {
  background: #34c759;
}
.conn-banner.offline {
  background: #ff4757;
}
.conn-banner-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffffff;
  display: inline-block;
  animation: statusPulse 1.2s ease-in-out infinite;
}
.conn-banner.reconnected .conn-banner-dot {
  animation: none;
}
@keyframes bannerSlideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.view-switch {
  display: flex;
  background: #f5ece1;
  padding: 3px;
  border-radius: 20px;
  flex-shrink: 0;
}
.tab {
  border: none;
  background: transparent;
  padding: 5px 10px;
  border-radius: 16px;
  font-size: 13.5px;
  font-weight: 600;
  color: #7a6656;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
  line-height: 1.2;
  transition: all 0.16s ease;
  -webkit-font-smoothing: antialiased;
}
.tab.active {
  background: #ffffff;
  color: #4a3525;
  box-shadow: 0 1px 3px rgba(74, 53, 37, 0.12);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.pill-btn {
  border: none;
  background: #fff2e6;
  color: #ff8c42;
  padding: 5px 10px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  box-sizing: border-box;
}
.icon-pill-btn,
#lamp-btn,
#fridge-btn,
#profile-btn {
  box-sizing: border-box;
  width: 32px;
  height: 32px;
  min-width: 32px;
  max-width: 32px;
  min-height: 32px;
  max-height: 32px;
  padding: 0;
  font-size: 15px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  background: #f5ece1;
  color: #6e503d;
  cursor: pointer;
  transition: background-color 0.18s ease, box-shadow 0.18s ease;
  flex-shrink: 0;
}
.icon-pill-btn:active,
#lamp-btn:active,
#fridge-btn:active,
#profile-btn:active {
  transform: scale(0.92);
}

/* 晚安小台灯与睡眠月亮按钮状态（严格共享 32px 盒模型，绝不膨胀） */
.lamp-btn {
  background: #fff8d6;
  color: #b45309;
  box-shadow: 0 0 6px rgba(253, 224, 71, 0.45);
}
.lamp-btn.sleeping {
  background: #1e293b;
  color: #fbbf24;
  box-shadow: 0 0 6px rgba(30, 41, 59, 0.35);
}

.install-tip { background: #fff8db; color: #8a6d00; font-size: 12px; padding: 8px 14px; text-align: center; }

/* 主区域 */
.main-area { flex: 1; position: relative; overflow: hidden; }
.view-panel { position: absolute; inset: 0; display: flex; flex-direction: column; }

/* 聊天列表 */
.messages { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; background: #faf4ea; }
.msg-row { display: flex; align-items: flex-end; gap: 8px; max-width: 85%; }
.msg-row.me { align-self: flex-end; flex-direction: row-reverse; }
.msg-av {
  width: 38px; height: 38px; border-radius: 50%; background: #fff;
  border: 2px solid #ffffff; box-shadow: 0 2px 8px rgba(110, 80, 61, 0.12);
  display: flex; align-items: center; justify-content: center; font-size: 20px;
  flex-shrink: 0; overflow: hidden;
}
.msg-av img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.msg-body { display: flex; flex-direction: column; gap: 3px; }
.msg-name { font-size: 11px; color: #8c7362; padding: 0 6px; font-weight: 500; }
.msg-row.me .msg-name { text-align: right; }
.bubble {
  background: #ffffff; padding: 10px 14px; border-radius: 18px; font-size: 15px; line-height: 1.45;
  word-break: break-word; box-shadow: 0 2px 6px rgba(110, 80, 61, 0.08); color: #3d2d1e;
}
.msg-row.me .bubble { background: #ff9f43; color: #fff; }
.bubble img.chat-img { max-width: 220px; max-height: 260px; border-radius: 14px; display: block; }
.bubble audio { width: 200px; height: 36px; display: block; }

/* 消息气泡包裹器与发送状态反馈（乐观上屏状态机） */
.msg-bubble-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}
.msg-row.me .msg-bubble-wrap {
  flex-direction: row-reverse;
  justify-content: flex-start;
}
.msg-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  user-select: none;
  -webkit-user-select: none;
}
.msg-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 140, 66, 0.25);
  border-top-color: #ff8c42;
  border-radius: 50%;
  animation: msgSpin 0.75s linear infinite;
}
@keyframes msgSpin {
  to { transform: rotate(360deg); }
}
.msg-retry-btn {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ff4757;
  color: #ffffff;
  border: none;
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(255, 71, 87, 0.4);
  transition: transform 0.15s ease;
  padding: 0;
  line-height: 1;
}
.msg-retry-btn:active {
  transform: scale(0.85);
}
.msg-row.msg-failed .bubble {
  opacity: 0.92;
}

/* 底部输入栏 */
.composer {
  display: flex; align-items: center; gap: 6px;
  box-sizing: border-box; width: 100%; max-width: 100vw; overflow: hidden;
  padding-left: 8px; padding-right: 8px; padding-top: 8px;
  padding-bottom: max(10px, calc(env(safe-area-inset-bottom) * 0.55));
  background: #fffdf8; border-top: 1px solid #ebdccb; z-index: 20;
}
.composer input[type="text"] {
  min-width: 0; width: 0; flex: 1 1 0%;
  font-size: 16px; padding: 8px 12px; height: 36px;
  border: 1px solid #dfd0be; border-radius: 18px; outline: none; background: #fdfaf6;
}
.voice-hold {
  min-width: 0; width: 0; flex: 1 1 0%;
  font-size: 15px; font-weight: 600; padding: 0 10px; height: 36px;
  border: 1px solid #dfd0be; border-radius: 18px; background: #f5ece1; color: #3d2d1e;
  user-select: none; -webkit-user-select: none; display: flex; align-items: center; justify-content: center;
}
.voice-hold.recording { background: #ff4757; color: #fff; border-color: #ff4757; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 50%; border: none;
  background: #f5ece1; font-size: 17px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; cursor: pointer;
}
.send-btn {
  flex-shrink: 0; white-space: nowrap; padding: 0 14px; height: 36px;
  border: none; border-radius: 18px; background: #ff8c42; color: #fff;
  font-size: 14px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center;
}

/* 地图视图与悬浮元素 */
.map-canvas { width: 100%; height: 100%; background: #fdf6e3; }
.map-bottom-actions {
  position: absolute;
  right: 14px;
  bottom: 18px;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 8px;
}
.recenter-fab {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #ffffff;
  color: #6e503d;
  border: 2px solid #ebdccb;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(110, 80, 61, 0.18);
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s ease, background-color 0.15s ease;
}
.recenter-fab:active {
  transform: scale(0.92);
  background: #fff5eb;
}
.loc-fab {
  background: #ffffff; color: #6e503d; border: 2px solid #ebdccb; padding: 10px 16px; border-radius: 24px;
  font-size: 14px; font-weight: 700; box-shadow: 0 6px 18px rgba(110, 80, 61, 0.18); cursor: pointer;
  transition: transform 0.15s ease; white-space: nowrap;
}
.loc-fab:active { transform: scale(0.95); }

/* 顶部半透明毛玻璃「天气与穿衣提醒卡片」 */
.weather-card {
  position: absolute; top: 12px; left: 12px; right: 12px; z-index: 15;
  background: rgba(255, 255, 255, 0.88); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.95); border-radius: 20px;
  padding: 10px 14px; box-shadow: 0 6px 20px rgba(110, 80, 61, 0.12);
  cursor: pointer; transition: all 0.25s ease; user-select: none;
}
.weather-card:active { transform: scale(0.99); }
.weather-main-line { display: flex; justify-content: space-between; align-items: center; }
.weather-target { font-size: 13px; font-weight: 700; color: #6e503d; display: flex; align-items: center; gap: 4px; }
.weather-badge { font-size: 13px; font-weight: 700; color: #ff8c42; }
.weather-tip-line { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #574031; margin-top: 4px; font-weight: 500; }
.weather-icon-inline { font-size: 14px; flex-shrink: 0; }
.weather-tip-text { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.weather-toggle-arrow { font-size: 11px; color: #8c7362; transition: transform 0.25s ease; flex-shrink: 0; }
.weather-card.expanded .weather-toggle-arrow { transform: rotate(180deg); }

.weather-details {
  padding-top: 10px; margin-top: 8px; border-top: 1px dashed rgba(223, 208, 190, 0.85);
  animation: popIn 0.25s ease-out;
}
.weather-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.weather-detail-item { display: flex; justify-content: space-between; align-items: center; font-size: 12px; }
.detail-label { color: #8c7362; }
.detail-val { font-weight: 600; color: #3d2d1e; }

/* 全屏纯 CSS 天气动态特效层 (z-index 位于地图底图和标记/卡片之间) */
.weather-fx {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 5;
}

/* 晴天 (sunny): 右上角微光暖阳脉动 */
.fx-sun {
  position: absolute; top: -70px; right: -70px; width: 240px; height: 240px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.45) 0%, rgba(255, 140, 0, 0.22) 45%, rgba(255, 255, 255, 0) 75%);
  filter: blur(10px); animation: sunPulse 5s ease-in-out infinite; display: none;
}
@keyframes sunPulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.12); opacity: 1; }
}

/* 白云 (clouds) */
.fx-clouds { position: absolute; inset: 0; pointer-events: none; display: none; }
.fx-cloud {
  position: absolute; background: rgba(255, 255, 255, 0.65); backdrop-filter: blur(1px);
  border-radius: 50px; box-shadow: 0 6px 18px rgba(255, 255, 255, 0.35);
}
.fx-cloud::before, .fx-cloud::after {
  content: ''; position: absolute; background: inherit; border-radius: 50%;
}
.fx-cloud.c1 { width: 140px; height: 44px; top: 18%; animation: driftCloud1 45s linear infinite; }
.fx-cloud.c1::before { width: 54px; height: 54px; top: -24px; left: 24px; }
.fx-cloud.c1::after { width: 40px; height: 40px; top: -16px; left: 72px; }

.fx-cloud.c2 { width: 190px; height: 54px; top: 48%; animation: driftCloud2 60s linear infinite; }
.fx-cloud.c2::before { width: 74px; height: 74px; top: -32px; left: 34px; }
.fx-cloud.c2::after { width: 56px; height: 56px; top: -20px; left: 96px; }

.fx-cloud.c3 { width: 120px; height: 38px; top: 76%; animation: driftCloud3 50s linear infinite; }
.fx-cloud.c3::before { width: 46px; height: 46px; top: -18px; left: 20px; }
.fx-cloud.c3::after { width: 34px; height: 34px; top: -12px; left: 60px; }

@keyframes driftCloud1 { from { transform: translateX(-160px); } to { transform: translateX(calc(100vw + 60px)); } }
@keyframes driftCloud2 { from { transform: translateX(-220px); } to { transform: translateX(calc(100vw + 80px)); } }
@keyframes driftCloud3 { from { transform: translateX(-140px); } to { transform: translateX(calc(100vw + 50px)); } }

/* 雨滴 (rain) */
.fx-rain {
  position: absolute; inset: 0; pointer-events: none; display: none;
  background-image: repeating-linear-gradient(105deg, rgba(120, 180, 255, 0.5) 0px, rgba(120, 180, 255, 0.5) 2px, transparent 2px, transparent 40px);
  background-size: 60px 100px;
  animation: rainFalling 0.45s linear infinite;
}
@keyframes rainFalling {
  0% { background-position: 0px 0px; }
  100% { background-position: 25px 100px; }
}

/* 雷暴微闪 (lightning) */
.fx-lightning {
  position: absolute; inset: 0; pointer-events: none; display: none;
  background: rgba(255, 255, 255, 0.28); opacity: 0;
  animation: gentleFlash 9s ease-in-out infinite;
}
@keyframes gentleFlash {
  0%, 88%, 92%, 100% { opacity: 0; }
  89% { opacity: 0.6; }
  90% { opacity: 0.15; }
  91% { opacity: 0.75; }
}

/* 雪花 (snow) */
.fx-snow {
  position: absolute; inset: 0; pointer-events: none; display: none;
  background-image: 
    radial-gradient(4px 4px at 20px 30px, rgba(255, 255, 255, 0.85), transparent),
    radial-gradient(6px 6px at 60px 80px, rgba(255, 255, 255, 0.85), transparent),
    radial-gradient(5px 5px at 120px 40px, rgba(255, 255, 255, 0.85), transparent),
    radial-gradient(7px 7px at 180px 110px, rgba(255, 255, 255, 0.85), transparent),
    radial-gradient(4px 4px at 240px 60px, rgba(255, 255, 255, 0.85), transparent);
  background-size: 260px 260px;
  animation: snowFalling 6s linear infinite;
}
@keyframes snowFalling {
  0% { background-position: 0 0; }
  100% { background-position: 30px 260px; }
}

/* 晴朗夜晚/星夜 (night) */
.fx-night-stars {
  position: absolute; inset: 0; pointer-events: none; display: none;
  background: rgba(15, 23, 42, 0.22);
}
.star { position: absolute; color: #ffd700; font-size: 14px; animation: starTwinkle 3s ease-in-out infinite alternate; text-shadow: 0 0 6px rgba(255, 215, 0, 0.8); }
.star.s1 { top: 12%; left: 16%; animation-delay: 0.2s; }
.star.s2 { top: 22%; right: 18%; animation-delay: 0.8s; font-size: 16px; }
.star.s3 { top: 35%; left: 65%; animation-delay: 1.4s; }
.star.s4 { top: 55%; left: 25%; animation-delay: 0.5s; font-size: 12px; }
.star.s5 { top: 68%; right: 28%; animation-delay: 1.8s; }
@keyframes starTwinkle {
  0% { opacity: 0.3; transform: scale(0.8); }
  100% { opacity: 1; transform: scale(1.15); }
}

/* 动效类路由触发 */
.weather-fx.fx-sunny .fx-sun,
.weather-fx.fx-sunny .fx-clouds { display: block; }

.weather-fx.fx-cloudy .fx-clouds { display: block; }
.weather-fx.fx-cloudy .fx-cloud { background: rgba(235, 240, 245, 0.72); }

.weather-fx.fx-rain .fx-rain,
.weather-fx.fx-rain .fx-clouds { display: block; }

.weather-fx.fx-storm .fx-rain,
.weather-fx.fx-storm .fx-lightning,
.weather-fx.fx-storm .fx-clouds { display: block; }

.weather-fx.fx-snow .fx-snow,
.weather-fx.fx-snow .fx-clouds { display: block; }

.weather-fx.fx-night .fx-night-stars { display: block; }

/* 地图卡通人物：正圆形、呼吸浮动、圆润暖棕边框与淡粉投影气泡 */
.cartoon-pin { display: flex; flex-direction: column; align-items: center; position: relative; cursor: pointer; }
.speech-bubble {
  max-width: 170px; background: #ffffff; color: #3d2d1e; border: 2px solid #6e503d;
  border-radius: 16px; padding: 6px 11px; font-size: 12px; font-weight: 600;
  box-shadow: 0 4px 12px rgba(255, 182, 193, 0.45); margin-bottom: 6px; position: relative;
  word-break: break-word; text-align: center;
  animation: popIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.speech-bubble::after {
  content: ''; position: absolute; bottom: -7px; left: 50%; transform: translateX(-50%) rotate(45deg);
  width: 10px; height: 10px; background: #ffffff; border-right: 2px solid #6e503d; border-bottom: 2px solid #6e503d;
}
.cartoon-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ffffff;
  border: 2.5px solid #ffffff;
  box-shadow: 0 4px 14px rgba(110, 80, 61, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  position: relative;
  overflow: visible;
  animation: floatBob 2.6s ease-in-out infinite;
}
.cartoon-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.pin-shadow {
  width: 28px; height: 8px; border-radius: 50%; background: rgba(110, 80, 61, 0.22);
  margin-top: -2px; animation: shadowPulse 2.6s ease-in-out infinite;
}
.pin-tag {
  margin-top: 3px; background: rgba(255, 255, 255, 0.94); padding: 3px 9px; border-radius: 12px;
  font-size: 11px; font-weight: 700; color: #6e503d; box-shadow: 0 2px 6px rgba(110, 80, 61, 0.14);
  white-space: nowrap; border: 1px solid rgba(235, 220, 203, 0.8);
}

@keyframes floatBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes shadowPulse { 0%, 100% { transform: scale(1); opacity: 0.25; } 50% { transform: scale(0.78); opacity: 0.14; } }
@keyframes popIn { 0% { transform: scale(0.3); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

/* 弹窗基类 */
.overlay, .modal {
  position: fixed;
  left: 0;
  right: 0;
  top: var(--vv-offset-top, 0px);
  height: var(--vv-height, 100dvh);
  bottom: auto;
  background: rgba(61, 45, 30, 0.45);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.modal {
  align-items: flex-end;
  padding: 0;
}
.login-card {
  width: 100%;
  max-width: 340px;
  background: #fff;
  border-radius: 24px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: center;
  box-shadow: 0 12px 36px rgba(0,0,0,0.18);
  max-height: calc(var(--vv-height, 100dvh) - env(safe-area-inset-top, 0px) - 16px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.login-card input, .modal-sheet input { font-size: 16px; padding: 11px 14px; border: 1px solid #dfd0be; border-radius: 14px; outline: none; width: 100%; background: #fdfaf6; }
.avatar-picker { display: flex; justify-content: space-between; gap: 6px; }
.av-opt { flex: 1; font-size: 24px; padding: 6px 0; border: 2px solid transparent; border-radius: 12px; background: #f5ece1; cursor: pointer; }
.av-opt.active { border-color: #ff8c42; background: #fff2e6; }
.primary-btn { width: 100%; padding: 12px; border: none; border-radius: 14px; background: #ff8c42; color: #fff; font-size: 16px; font-weight: 600; cursor: pointer; }
.err-msg { color: #ff4757; font-size: 13px; min-height: 18px; }

.modal-sheet {
  width: 100%;
  max-width: 520px;
  background: #fff;
  border-radius: 24px 24px 0 0;
  padding: 18px 18px calc(22px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 -8px 30px rgba(0,0,0,0.15);
  max-height: calc(var(--vv-height, 100dvh) - env(safe-area-inset-top, 0px) - 16px);
  overflow: hidden;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #3d2d1e;
  flex-shrink: 0;
}
.modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 2px;
}
.close-x { border: none; background: #f5ece1; width: 30px; height: 30px; border-radius: 50%; font-size: 14px; cursor: pointer; color: #6e503d; }
.loc-row { display: flex; gap: 8px; }
.small-btn { padding: 0 14px; border: none; border-radius: 14px; background: #ff8c42; color: #fff; font-size: 14px; white-space: nowrap; cursor: pointer; height: 42px; display: inline-flex; align-items: center; justify-content: center; }
.search-results { display: flex; flex-direction: column; gap: 6px; max-height: 140px; overflow-y: auto; }
.search-item { text-align: left; padding: 9px 12px; border: 1px solid #ebdccb; border-radius: 12px; background: #fdfaf6; font-size: 13px; cursor: pointer; color: #3d2d1e; }
.loc-actions { display: grid; grid-template-columns: 1fr; gap: 10px; }
.action-card { padding: 14px 10px; border: 1px solid #ebdccb; border-radius: 16px; background: #fdf8ee; font-size: 14px; font-weight: 600; color: #6e503d; cursor: pointer; text-align: center; }
.action-card.full-width { width: 100%; }
.gps-preview { background: #fff5eb; padding: 12px; border-radius: 14px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; border: 1px solid #ffe3b3; color: #6e503d; }
.section-divider { display: flex; align-items: center; text-align: center; margin: 4px 0; color: #a89485; font-size: 12px; }
.section-divider::before, .section-divider::after { content: ''; flex: 1; border-bottom: 1px solid #ebdccb; }
.section-divider span { padding: 0 8px; }

/* 个人设置弹窗专属样式 */
.profile-avatar-sec { display: flex; align-items: center; gap: 14px; padding: 4px 0; }
.current-avatar-circle {
  width: 68px; height: 68px; border-radius: 50%; background: #fdfaf6;
  border: 3px solid #ff8c42; display: flex; align-items: center; justify-content: center;
  font-size: 38px; overflow: hidden; flex-shrink: 0; box-shadow: 0 4px 12px rgba(255, 140, 66, 0.2);
}
.current-avatar-circle img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.avatar-upload-wrap { display: flex; flex-direction: column; gap: 4px; }
.tip-sub { font-size: 11px; color: #8c7362; }
.section-label { font-size: 12px; font-weight: 700; color: #8c7362; margin-top: 2px; }
.danger-btn { width: 100%; padding: 12px; border: none; border-radius: 14px; background: #fff1f0; color: #ff4757; font-size: 15px; font-weight: 600; border: 1px solid #ffccc7; cursor: pointer; margin-top: 4px; }
.info-msg { font-size: 12px; color: #2ed573; min-height: 16px; text-align: center; }

/* 表情消息大号透明动图展示 */
.bubble.sticker-bubble {
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
  padding: 2px !important;
}
.chat-sticker-img {
  max-width: 135px;
  max-height: 135px;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(110, 80, 61, 0.15));
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.2s ease;
}
.chat-sticker-img:active {
  transform: scale(0.96);
}

/* 消息快捷贴表情（Reactions）胶囊角标与浮动选择条 */
.msg-body {
  position: relative;
}
.reactions-pill-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 3px;
}
.msg-row.me .reactions-pill-bar {
  justify-content: flex-end;
}
.rx-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  background: #fff6ee;
  border: 1.5px solid #ebdccb;
  border-radius: 12px;
  font-size: 11px;
  color: #6e503d;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(110, 80, 61, 0.06);
}
.rx-pill:hover {
  transform: scale(1.05);
}
.rx-pill.active {
  background: #ffe3d1;
  border-color: #ff8c42;
  font-weight: 700;
  color: #ff8c42;
}
.rx-pill .rx-count {
  font-size: 11px;
}

.reaction-picker {
  position: fixed;
  z-index: 120;
  display: flex;
  gap: 6px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 5px 9px;
  border-radius: 24px;
  box-shadow: 0 6px 20px rgba(110, 80, 61, 0.22);
  border: 1.5px solid #ffeedb;
  animation: popIn 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.rx-opt {
  border: none;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  padding: 2px 3px;
  cursor: pointer;
  border-radius: 50%;
  transition: transform 0.15s ease;
}
.rx-opt:hover {
  transform: scale(1.3);
}
.rx-opt:active {
  transform: scale(0.9);
}
.rx-recall-btn {
  border: none;
  background: #fff4eb;
  color: #ff8c42;
  border: 1px solid #ffcca8;
  border-radius: 14px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: 2px;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.rx-recall-btn:hover {
  background: #ff8c42;
  color: #fff;
}
.rx-recall-btn:active {
  transform: scale(0.92);
}

/* 智能居中时间戳 */
.time-divider {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 10px 0 6px;
  width: 100%;
  user-select: none;
  -webkit-user-select: none;
}
.time-divider span {
  font-size: 11px;
  font-weight: 500;
  color: #9b8878;
  background: rgba(110, 80, 61, 0.08);
  padding: 2px 10px;
  border-radius: 10px;
  letter-spacing: 0.3px;
}

/* 消息撤回居中柔和灰字提示 */
.msg-row.recalled-row {
  align-self: center !important;
  max-width: 90% !important;
  justify-content: center !important;
  margin: 4px 0 !important;
}
.recalled-notice {
  font-size: 12px;
  color: #a89485;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(110, 80, 61, 0.06);
  padding: 3px 12px;
  border-radius: 12px;
  user-select: none;
  -webkit-user-select: none;
}
.re-edit-btn {
  border: none;
  background: transparent;
  color: #ff8c42;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 0 2px;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.re-edit-btn:active {
  opacity: 0.75;
}

/* 地图表情泡泡弹性弹跳动效 */
.speech-bubble.has-sticker {
  padding: 5px 8px;
  max-width: 140px;
  border-radius: 18px;
  animation: popInBounce 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.map-sticker-img {
  max-width: 90px;
  max-height: 90px;
  display: block;
  margin: 0 auto;
  border-radius: 8px;
  object-fit: contain;
}
@keyframes popInBounce {
  0% { transform: scale(0.2); opacity: 0; }
  60% { transform: scale(1.15); opacity: 1; }
  85% { transform: scale(0.95); }
  100% { transform: scale(1); }
}

/* 圆润可爱表情包抽屉 */
.sticker-panel {
  position: fixed;
  left: 0;
  right: 0;
  top: var(--vv-offset-top, 0px);
  height: var(--vv-height, 100dvh);
  bottom: auto;
  background: rgba(61, 45, 30, 0.35);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 90;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sticker-sheet {
  width: 100%;
  max-width: 520px;
  background: #ffffff;
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -8px 30px rgba(110, 80, 61, 0.16);
  padding: 12px 16px calc(14px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(55dvh, calc(var(--vv-height, 100dvh) - 60px));
  height: auto;
  animation: slideUpDrawer 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}
@keyframes slideUpDrawer {
  0% { transform: translateY(100%); }
  100% { transform: translateY(0); }
}
.sticker-tabs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.sticker-close-btn {
  border: none;
  background: #f5ece1;
  min-width: 44px;
  height: 40px;
  padding: 0 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: #6e503d;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-shrink: 0;
  transition: background-color 0.15s ease, transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.sticker-close-btn:active {
  background: #ebdccb;
  transform: scale(0.95);
}
.sticker-tabs {
  display: flex;
  gap: 6px;
  background: #f5ece1;
  padding: 3px;
  border-radius: 18px;
}
.sticker-tab-btn {
  border: none;
  background: transparent;
  padding: 6px 14px;
  border-radius: 15px;
  font-size: 13px;
  font-weight: 600;
  color: #8c7362;
  cursor: pointer;
  transition: all 0.2s ease;
}
.sticker-tab-btn.active {
  background: #ffffff;
  color: #ff8c42;
  box-shadow: 0 1px 4px rgba(110, 80, 61, 0.1);
}
.sticker-tab-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  gap: 8px;
}
.sticker-actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.sticker-upload-btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  background: #fff2e6;
  color: #ff8c42;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px dashed #ff8c42;
}
.sticker-count-badge {
  font-size: 11px;
  font-weight: 600;
  color: #8c7362;
  background: #f5ece1;
  padding: 3px 8px;
  border-radius: 10px;
}
.sticker-edit-btn {
  border: none;
  background: #f5ece1;
  color: #6e503d;
  padding: 6px 12px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.sticker-edit-btn.editing {
  background: #ff4757;
  color: #fff;
}
.stickers-scroll-wrap {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 12px;
}
.stickers-grid-inner {
  height: auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 78px;
  gap: 8px;
  align-content: start;
}
.recent-stickers-sec {
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px dashed #ebdccb;
}
.recent-stickers-label,
.all-stickers-label {
  font-size: 11.5px;
  font-weight: 700;
  color: #8c7362;
  margin-bottom: 6px;
}
.stickers-sentinel {
  height: 1px;
  width: 100%;
  pointer-events: none;
}
.sticker-item {
  position: relative;
  height: 78px;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #fdfaf6;
  border: 1.5px solid #ebdccb;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.sticker-item:active {
  transform: scale(0.94);
}
.sticker-item img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  padding: 4px;
  display: block;
}
.sticker-item.editing {
  animation: wiggle 0.3s ease-in-out infinite alternate;
}
@keyframes wiggle {
  0% { transform: rotate(-2deg); }
  100% { transform: rotate(2deg); }
}
.sticker-del-badge {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ff4757;
  color: #fff;
  border: 2px solid #fff;
  font-size: 11px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  cursor: pointer;
}
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  cursor: pointer;
}
.stickers-empty, .stickers-loading {
  text-align: center;
  color: #8c7362;
  font-size: 13px;
  padding: 24px 10px;
}
.giphy-search-bar {
  display: flex;
  gap: 8px;
}
.giphy-search-bar input {
  flex: 1;
  font-size: 14px;
  padding: 9px 12px;
  border: 1px solid #dfd0be;
  border-radius: 14px;
  outline: none;
  background: #fdfaf6;
}
.giphy-search-submit {
  padding: 0 16px;
  border: none;
  border-radius: 14px;
  background: #ff8c42;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.giphy-quick-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.quick-tag {
  background: #fff4eb;
  color: #6e503d;
  border: 1px solid #ffe1cc;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.15s ease;
}
.quick-tag:hover {
  background: #ff8c42;
  color: #fff;
  border-color: #ff8c42;
}

/* 隔空贴贴与爱心航线 */
.hug-card-btn {
  margin-left: auto;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #ff7a90, #ff94a6);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(255, 122, 144, 0.35);
  transition: transform 0.15s ease, opacity 0.2s ease;
  white-space: nowrap;
}
.hug-card-btn:active {
  transform: scale(0.92);
}

.hug-capsule-marker {
  background: linear-gradient(135deg, #ff7a90, #ff94a6);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(255, 122, 144, 0.4);
  white-space: nowrap;
  pointer-events: none;
  animation: hugPopIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  transition: opacity 0.6s ease;
}

@keyframes hugPopIn {
  from {
    transform: scale(0.5);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.floating-hearts-container {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1px;
  height: 1px;
  pointer-events: none;
  z-index: 100;
}

.floating-heart {
  position: absolute;
  user-select: none;
  animation: floatHeart 2.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
  opacity: 0;
}

@keyframes floatHeart {
  0% {
    transform: translate(-50%, -50%) scale(0.6) rotate(0deg);
    opacity: 0;
  }
  15% {
    opacity: 0.95;
    transform: translate(calc(-50% + var(--dx, 0px) * 0.3), calc(-50% - 20px)) scale(1.1) rotate(var(--rot, 0deg));
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% - 90px)) scale(0.8) rotate(var(--rot, 0deg));
  }
}

/* 系统消息提示样式（居中粉/灰色胶囊） */
.msg-row.system-row {
  justify-content: center;
  margin: 6px 0;
}

.system-notice {
  font-size: 12px;
  color: #8c6e65;
  background: rgba(255, 235, 240, 0.85);
  border: 1px solid rgba(255, 192, 203, 0.5);
  padding: 4px 12px;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  text-align: center;
  max-width: 85%;
  line-height: 1.4;
}

/* 全屏掉彩蛋粒子动画 */
.easter-egg-rain-container {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  overflow: hidden;
}

.easter-egg-particle {
  position: absolute;
  top: -60px;
  opacity: 0.95;
  user-select: none;
  animation-name: easterEggFall;
  animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  animation-fill-mode: forwards;
}

@keyframes easterEggFall {
  0% {
    transform: translateY(0) translateX(0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  80% {
    opacity: 0.9;
  }
  100% {
    transform: translateY(105vh) translateX(var(--sway-x, 20px)) rotate(360deg);
    opacity: 0;
  }
}

/* 个人设置弹窗彩蛋暗号管理 */
.eggs-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  margin-bottom: 6px;
}

.text-link-btn {
  background: none;
  border: none;
  color: #ff7a90;
  font-size: 13px;
  cursor: pointer;
  padding: 2px 4px;
  font-weight: 500;
}

.easter-eggs-panel {
  background: rgba(247, 243, 238, 0.8);
  border: 1px solid rgba(230, 220, 210, 0.7);
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 14px;
}

.easter-eggs-list {
  max-height: 140px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.egg-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.egg-info {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.egg-kw {
  font-weight: 600;
  color: #443;
}

.egg-arrow {
  color: #bbb;
  font-size: 11px;
}

.egg-em {
  letter-spacing: 2px;
}

.egg-del-btn {
  background: none;
  border: none;
  color: #bbb;
  font-size: 14px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.15s;
}

.egg-del-btn:hover {
  color: #e55;
}

.egg-empty {
  font-size: 12px;
  color: #999;
  text-align: center;
  padding: 8px 0;
}

.easter-egg-add-form {
  display: flex;
  gap: 6px;
}

.easter-egg-add-form input {
  font-size: 16px !important;
  padding: 8px 10px;
  border: 1px solid #e0d6cb;
  border-radius: 8px;
  background: #fff;
  outline: none;
}

#egg-keyword-input {
  width: 35%;
}

#egg-emojis-input {
  flex: 1;
  min-width: 0;
}

/* 地图睡眠状态小人呼吸动画与微暗滤镜 */
.cartoon-pin.is-sleeping .cartoon-avatar {
  opacity: 0.85;
  filter: brightness(0.88);
  box-shadow: 0 2px 8px rgba(30, 41, 59, 0.25);
}

.sleep-bubble {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ffffff;
  border: 1.5px solid #e6d8c5;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1;
  box-shadow: 0 2px 5px rgba(74, 53, 37, 0.18);
  animation: sleepBreath 2.2s ease-in-out infinite;
  pointer-events: none;
  z-index: 10;
}

@keyframes sleepBreath {
  0%, 100% {
    transform: scale(0.95) translateY(0);
    opacity: 0.88;
  }
  50% {
    transform: scale(1.1) translateY(-3px);
    opacity: 1;
  }
}

/* 个人设置弹窗中的消息推送状态行 */
.profile-push-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fdfaf6;
  border: 1px solid #efe4d6;
  border-radius: 14px;
  padding: 10px 14px;
  gap: 10px;
}
.profile-push-status {
  font-size: 13px;
  font-weight: 500;
  color: #6e503d;
  flex: 1;
}

/* 冰箱贴与倒数日抽屉弹窗 */
.fridge-sheet {
  max-height: calc(var(--vv-height, 100dvh) - env(safe-area-inset-top, 0px) - 16px);
  display: flex;
  flex-direction: column;
  border-radius: 24px 24px 0 0;
  background: #fffcf7;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  overflow: hidden;
  gap: 8px;
}

.fridge-body {
  gap: 8px;
}

.fridge-head-title {
  display: flex;
  flex-direction: column;
}

.fridge-subtitle {
  font-size: 11px;
  color: #9b8878;
  margin-top: 1px;
}

.fridge-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.small-pill-btn {
  background: #fff2e6;
  color: #ff8c42;
  border: 1px solid #ffd8bf;
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.small-pill-btn:active {
  transform: scale(0.94);
}

.fridge-scroll-area {
  flex: 1;
  overflow-y: auto;
  padding-right: 2px;
  margin-top: 10px;
}

.fridge-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  color: #5c4433;
  margin-bottom: 8px;
}

.fridge-badge-count {
  font-size: 11px;
  background: #f5ece1;
  color: #8c7362;
  padding: 1px 7px;
  border-radius: 10px;
}

/* 表单面板 */
.fridge-form-panel {
  background: #fdf6ec;
  border: 1px solid #eedecb;
  border-radius: 14px;
  padding: 12px;
  margin-top: 0;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.fridge-form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 13px;
  color: #6e503d;
}

.fridge-form-panel input[type="text"],
.fridge-form-panel textarea,
.fridge-form-panel input[type="date"] {
  font-size: 16px !important;
  padding: 8px 10px;
  border: 1px solid #dfd0be;
  border-radius: 8px;
  background: #fff;
  outline: none;
  width: 100%;
}

.color-picker-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #6e503d;
}

.color-options {
  display: flex;
  gap: 8px;
}

.color-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.color-dot.active {
  border-color: #6e503d;
  transform: scale(1.15);
}

.color-dot.color-yellow { background: #fef08a; }
.color-dot.color-green { background: #bbf7d0; }
.color-dot.color-pink { background: #fecdd3; }
.color-dot.color-purple { background: #e9d5ff; }

.date-picker-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #6e503d;
}

.fridge-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.secondary-btn.small {
  background: #f5ece1;
  color: #6e503d;
  border: none;
  padding: 6px 12px;
  border-radius: 14px;
  font-size: 12px;
  cursor: pointer;
}

.primary-btn.small {
  background: #ff8c42;
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

/* 倒数日卡片 */
.fridge-countdowns-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.countdown-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  padding: 10px 14px;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(110, 80, 61, 0.06);
  border: 1px solid #f2e7dc;
}

.countdown-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.countdown-title {
  font-size: 14px;
  font-weight: 700;
  color: #3d2d1e;
}

.countdown-date {
  font-size: 11px;
  color: #9b8878;
}

.countdown-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.countdown-badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
}
.countdown-badge.future {
  background: #fff4eb;
  color: #ff8c42;
}
.countdown-badge.today {
  background: linear-gradient(135deg, #ff7a90, #ff94a6);
  color: #fff;
  box-shadow: 0 2px 8px rgba(255, 122, 144, 0.4);
}
.countdown-badge.past {
  background: #f3f4f6;
  color: #9ca3af;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-icon-btn {
  background: none;
  border: none;
  font-size: 13px;
  color: #b0a094;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.15s;
}
.card-icon-btn:hover {
  color: #ff8c42;
}
.card-icon-btn.del:hover {
  color: #ef4444;
}

/* 彩色便利贴网格 */
.fridge-notes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.fridge-note-card {
  padding: 10px 12px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(110, 80, 61, 0.06);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 96px;
  border-left: 4px solid;
  position: relative;
  transition: transform 0.15s ease;
}
.fridge-note-card:active {
  transform: scale(0.98);
}

.fridge-note-card.color-yellow { background: #fefce8; border-color: #facc15; }
.fridge-note-card.color-green { background: #f0fdf4; border-color: #4ade80; }
.fridge-note-card.color-pink { background: #fff1f2; border-color: #fb7185; }
.fridge-note-card.color-purple { background: #faf5ff; border-color: #c084fc; }

.note-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 4px;
}

.note-title {
  font-size: 13px;
  font-weight: 700;
  color: #2e2017;
  word-break: break-word;
}

.note-content {
  font-size: 12px;
  color: #574031;
  line-height: 1.4;
  word-break: break-word;
  white-space: pre-wrap;
  flex: 1;
}

.note-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px dashed rgba(0, 0, 0, 0.08);
}

.note-author {
  font-size: 10px;
  color: #9c8475;
}

.note-actions {
  display: flex;
  gap: 4px;
}

.fridge-empty-tip {
  font-size: 12px;
  color: #999;
  text-align: center;
  padding: 12px 0;
}

/* 全屏图片查看器（Lightbox） */
.lightbox-overlay {
  position: fixed;
  left: 0;
  right: 0;
  top: var(--vv-offset-top, 0px);
  height: var(--vv-height, 100dvh);
  bottom: auto;
  width: 100%;
  background: rgba(0, 0, 0, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  animation: lightboxFadeIn 0.2s ease-out;
}
@keyframes lightboxFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.lightbox-close-btn {
  position: absolute;
  top: calc(env(safe-area-inset-top, 20px) + 12px);
  right: 16px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.38);
  background: rgba(30, 30, 30, 0.65);
  color: #ffffff;
  font-size: 22px;
  font-weight: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10001;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  transition: transform 0.15s ease, background-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.lightbox-close-btn:active {
  transform: scale(0.9);
  background: rgba(255, 255, 255, 0.25);
}
.lightbox-content-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}
.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
  pointer-events: auto;
}

/* iOS 软键盘弹起优化：消除底部安全区冗余留白，最大化可用表单高度 */
html.keyboard-open .modal-sheet,
html.keyboard-open .fridge-sheet,
html.keyboard-open .sticker-sheet {
  padding-bottom: 12px !important;
}
html.keyboard-open .composer {
  padding-bottom: 8px !important;
}
