@charset "UTF-8";

/* ========================================================
   RESET & FOUNDATION
   ======================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --safe-top: env(safe-area-inset-top, 20px);
  --safe-bottom: env(safe-area-inset-bottom, 20px);
  --gold-primary: #bda06d;
  --gold-accent: #caa677;
  --gold-glow: rgba(212, 175, 55, 0.4);
  --text-dark: #2b231d;
  --text-muted: #8c7e71;
  --glass-bg: rgba(255, 255, 255, 0.52);
  --glass-border: rgba(255, 255, 255, 0.82);
}

html {
  background-color: #fbf9f5 !important;
  min-height: 100%;
}

body {
  width: 100%;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  margin: 0;
  padding: 0;
  background-color: #fbf9f5 !important;
  color: var(--text-dark);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* ========================================================
   100% 纯净维港晨昏薄雾背景 (定稿图 1:1 晨光映水)
   超幅垂直延伸 125vh，彻底封死 iOS Safari 地址栏收放与弹性露白
   ======================================================== */
.ambient-bg {
  position: fixed;
  top: -10vh;
  left: 0;
  right: 0;
  bottom: -15vh;
  width: 100%;
  height: 125vh;
  min-height: -webkit-fill-available;
  z-index: -2;
  background-color: #fbf9f5;
  background-image: url('/assets/images/pure_harbor_bg.jpg?v=final_pure');
  background-position: center 22%;
  background-size: cover;
  background-repeat: no-repeat;
  pointer-events: none;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

.ambient-overlay {
  position: fixed;
  top: -10vh;
  left: 0;
  right: 0;
  bottom: -15vh;
  width: 100%;
  height: 125vh;
  min-height: -webkit-fill-available;
  z-index: -1;
  background: radial-gradient(circle at 50% 12%, rgba(255, 255, 255, 0.05) 0%, rgba(247, 241, 232, 0.28) 100%);
  backdrop-filter: blur(1.5px);
  -webkit-backdrop-filter: blur(1.5px);
  pointer-events: none;
}

/* ========================================================
   主页专有：一屏纯净案头 (100dvh 锁死，彻底消除长下拉)
   ======================================================== */
body.pure-sanctuary-body,
body.nest-app-body {
  height: 100dvh !important;
  max-height: 100dvh !important;
  width: 100% !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  background: transparent !important;
}

.pure-sanctuary-viewport {
  width: 100%;
  max-width: 440px;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: max(8px, var(--safe-top)) 16px calc(max(14px, var(--safe-bottom)) + 58px);
  box-sizing: border-box;
  overflow: hidden;
  position: relative;
  gap: 8px;
}

/* 契约容器 */
.nest-container {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

/* ========================================================
   顶栏：手绘粉白金蔷薇钻戒花冠 (透明悬浮、无大白框、单钻脉冲)
   ======================================================== */
.pure-header-crest,
.nest-header,
.sticky-nest-header {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  user-select: none;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0;
  position: relative;
  z-index: 100;
}

.brand-crest-wrap {
  width: 100%;
  max-width: 420px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.floral-crest-container {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.floral-crest-img {
  width: 94%;
  max-width: 385px;
  height: auto;
  display: block;
  filter: drop-shadow(0 4px 14px rgba(180, 150, 120, 0.18));
}

/* 钻戒正中心灵脉冲星芒 */
.diamond-celestial-pulse,
#diamond-pulse {
  position: absolute;
  top: 48.5%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffffff 30%, rgba(255, 240, 210, 0.95) 65%, rgba(255, 255, 255, 0) 100%);
  box-shadow: 0 0 14px 4px rgba(255, 245, 220, 0.95), 0 0 28px 8px rgba(230, 205, 160, 0.6);
  pointer-events: auto;
  cursor: pointer;
  animation: starburstFlare 4s ease-in-out infinite alternate;
}

.diamond-celestial-pulse::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 28px;
  height: 2px;
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.95) 50%, rgba(255,255,255,0) 100%);
  transform: translate(-50%, -50%);
}

.diamond-celestial-pulse::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2px;
  height: 28px;
  background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.95) 50%, rgba(255,255,255,0) 100%);
  transform: translate(-50%, -50%);
}

@keyframes starburstFlare {
  0%, 100% {
    transform: translate(-50%, -50%) scale(0.92) rotate(0deg);
    opacity: 0.85;
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.8));
  }
  50% {
    transform: translate(-50%, -50%) scale(1.3) rotate(90deg);
    opacity: 1;
    filter: drop-shadow(0 0 12px rgba(255, 240, 200, 1));
  }
}

/* 1:1 定稿图状态胶囊 */
.pure-status-capsule,
.ambient-status-bar {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 14px;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 999px;
  font-family: 'Cormorant Garamond', 'Noto Serif SC', serif;
  font-size: 11.5px;
  color: #736250;
  box-shadow: 0 2px 8px rgba(180, 150, 110, 0.08);
  margin-top: 2px;
}

.status-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #68b479;
  box-shadow: 0 0 8px rgba(104, 180, 121, 0.85);
  animation: candleFlicker 3s ease-in-out infinite;
}

@keyframes candleFlicker {
  0%, 100% { opacity: 0.8; transform: scale(0.95); }
  50% { opacity: 1; transform: scale(1.1); }
}

.status-wardrobe-trigger {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.75;
  transition: all 0.2s ease;
  touch-action: manipulation;
}

.status-wardrobe-trigger:hover,
.status-wardrobe-trigger:active {
  opacity: 1;
  transform: scale(1.15);
}

.status-wreath-icon {
  width: 14px;
  height: 14px;
  filter: drop-shadow(0 1px 2px rgba(212, 175, 55, 0.4));
}

/* ========================================================
   主页核心画卷区：垂直居中弹性排布 (Our morning glow + 漫谈入口)
   ======================================================== */
.pure-cards-section,
.sanctuary-canvas {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: 350px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

/* 主页案头卡片：垂直纵向绝对居中堆叠，彻底杜绝横向位移与溢出 */
.pure-sanctuary-viewport #dialogue-flow,
.pure-sanctuary-viewport #welcome-row,
#welcome-row {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  max-width: 350px !important;
  margin: 0 auto !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  position: relative !important;
}

#welcome-card {
  width: 100% !important;
  max-width: 350px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
}

.pure-sanctuary-viewport #welcome-thought-floater,
.thought-whisper-floater {
  align-self: flex-start !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  margin: 0 0 6px 4px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.dialogue-flow {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 纯文字浅暖灰小字思维手札 (无底色、12px、无边框、悬浮于气泡上方) */
.thought-whisper-floater {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: 'Cormorant Garamond', 'Noto Serif SC', serif;
  font-size: 12px !important;
  color: #9c8e80;
  letter-spacing: 0.3px;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 4px;
  margin-bottom: 3px;
  user-select: none;
}

.whisper-star {
  color: #caa677;
  font-size: 11px;
}

.thought-stream.collapsed {
  display: none !important;
}

/* 核心大卡片：Our morning glow (温润白玉毛玻璃) */
.sanctuary-main-card {
  width: 100%;
  max-width: 350px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.52);
  backdrop-filter: blur(28px) saturate(170%);
  -webkit-backdrop-filter: blur(28px) saturate(170%);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 22px;
  padding: 18px 20px 16px;
  box-shadow: 0 14px 40px rgba(180, 150, 120, 0.12);
  display: flex;
  flex-direction: column;
  position: relative;
  box-sizing: border-box;
}

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.card-title-glow {
  display: flex;
  align-items: center;
  gap: 8px;
}

.title-text {
  font-family: 'Cormorant Garamond', 'Noto Serif SC', serif;
  font-size: 19px;
  font-weight: 500;
  color: #9d8362;
  letter-spacing: 0.6px;
}

.title-sparkle {
  font-size: 13px;
  color: #caa677;
  opacity: 0.9;
}

.card-header-actions-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.candle-icon-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.card-candle-icon {
  width: 16px;
  height: 16px;
  opacity: 0.85;
  filter: drop-shadow(0 0 6px rgba(245, 200, 120, 0.7));
}

.card-body-text {
  font-size: 14px;
  line-height: 1.65;
  color: #2b231d;
  letter-spacing: 0.3px;
  margin-bottom: 12px;
  word-break: break-word;
}

.card-footer-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: 'Cormorant Garamond', serif;
  font-size: 12px;
  color: #8c7f72;
  padding-top: 2px;
}

.meta-sparkle {
  font-size: 11px;
  color: #c4a174;
}

.meta-sign-time {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sign-text {
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #635547;
}

.sign-divider {
  opacity: 0.5;
}

/* ========================================================
   定稿图核心标志：主卡片底部的珍珠柔金流光小弧光与耀眼星芒 (.has-arc)
   ======================================================== */
.sanctuary-main-card.has-arc {
  position: relative;
}

.sanctuary-main-card.has-arc::before {
  content: '';
  position: absolute;
  bottom: -1.5px;
  left: 22%;
  right: 22%;
  height: 2.5px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255, 250, 235, 1) 50%, rgba(255,255,255,0) 100%);
  box-shadow: 0 0 12px 2px rgba(245, 215, 155, 0.95);
  pointer-events: none;
  z-index: 2;
  animation: arcPulse 3.5s ease-in-out infinite alternate;
}

.sanctuary-main-card.has-arc::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 14%;
  right: 14%;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(245, 215, 155, 0.8) 0%, rgba(235, 195, 130, 0.35) 50%, rgba(220, 180, 120, 0) 75%);
  filter: blur(4px);
  pointer-events: none;
  z-index: 1;
  animation: arcSpread 3.5s ease-in-out infinite alternate;
}

@keyframes arcPulse {
  0% { opacity: 0.7; transform: scaleX(0.92); }
  50% { opacity: 1; transform: scaleX(1.04); }
  100% { opacity: 0.7; transform: scaleX(0.92); }
}

@keyframes arcSpread {
  0% { opacity: 0.5; transform: scale(0.94); filter: blur(3.5px); }
  50% { opacity: 0.95; transform: scale(1.08); filter: blur(5px); }
  100% { opacity: 0.5; transform: scale(0.94); filter: blur(3.5px); }
}

/* ========================================================
   3D 翻转抽卡与微型叠卡系统 (60fps 丝滑硬件加速)
   ======================================================== */
.card-flip-container {
  width: 100%;
  max-width: 350px;
  margin: 0 auto;
  perspective: 1200px;
}

.card-flip-inner {
  position: relative;
  width: 100%;
  transform-style: preserve-3d;
  transition: transform 0.65s cubic-bezier(0.34, 1.35, 0.64, 1);
}

.card-flip-inner.is-flipped {
  transform: rotateY(180deg);
}

.card-face {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.card-front {
  transform: rotateY(0deg);
}

.card-back {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  transform: rotateY(180deg);
  background: rgba(255, 255, 255, 0.76) !important;
  backdrop-filter: blur(32px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(32px) saturate(180%) !important;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* 翻开便签角标按钮 */
.draw-memo-trigger-btn {
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 999px;
  padding: 3px 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: 'Cormorant Garamond', 'Noto Serif SC', serif;
  font-size: 11.5px;
  color: #8c734b;
}

.draw-memo-trigger-btn:active {
  transform: scale(0.95);
  background: rgba(212, 175, 55, 0.25);
}

.flip-back-btn {
  background: transparent;
  border: none;
  font-size: 13px;
  color: #8c7e71;
  cursor: pointer;
  padding: 4px 6px;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.memo-body-container {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  padding: 6px 10px;
}

.memo-quote-mark {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 28px;
  line-height: 1;
  color: #caa677;
  opacity: 0.55;
  margin-bottom: -4px;
}

.memo-quote-mark-end {
  align-self: flex-end;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 28px;
  line-height: 1;
  color: #caa677;
  opacity: 0.55;
  margin-top: -4px;
}

.memo-content-text {
  font-family: "Noto Serif SC", "Cormorant Garamond", serif;
  font-size: 14.5px;
  line-height: 1.7;
  color: #2b231d;
  letter-spacing: 0.4px;
  text-align: justify;
  animation: memoFadeIn 0.5s ease-out;
}

@keyframes memoFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.memo-footer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid rgba(212, 175, 55, 0.18);
}

.draw-again-pill-btn {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(246, 238, 222, 0.95) 100%);
  border: 1px solid rgba(212, 175, 55, 0.45);
  box-shadow: 0 4px 12px rgba(180, 150, 110, 0.15);
  border-radius: 999px;
  padding: 4px 14px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: 'Cormorant Garamond', 'Noto Serif SC', serif;
  font-size: 12px;
  color: #7a6344;
  cursor: pointer;
  transition: all 0.25s ease;
}

.draw-again-pill-btn:active {
  transform: scale(0.94);
  box-shadow: 0 2px 6px rgba(180, 150, 110, 0.25);
}

/* ========================================================
   横向微型叠卡视口 (一屏纯净纳尽，绝无纵向拉长)
   ======================================================== */
.nest-carousel-viewport {
  width: 100%;
  max-width: 350px;
  margin: 0 auto;
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 2px 0;
  box-sizing: border-box;
}

.nest-carousel-viewport::-webkit-scrollbar {
  display: none;
}

.carousel-panel {
  flex: 0 0 100%;
  width: 100%;
  max-width: 350px;
  scroll-snap-align: center;
  box-sizing: border-box;
}

.carousel-dots-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 0 0 2px;
}

.carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(180, 150, 120, 0.35);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
}

.carousel-dot.active {
  width: 18px;
  border-radius: 999px;
  background: linear-gradient(90deg, #bfa068 0%, #dfcaa7 100%);
  box-shadow: 0 0 8px rgba(191, 160, 104, 0.6);
}

/* ========================================================
   时光拍立得与深海漂流瓶卡片
   ======================================================== */
.polaroid-photo-frame {
  margin: 4px 0 8px;
  padding: 8px 8px 10px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(160, 130, 90, 0.15), 0 1px 3px rgba(0,0,0,0.06);
  position: relative;
  cursor: pointer;
  transition: transform 0.25s ease;
}

.polaroid-photo-frame:active {
  transform: scale(0.98);
}

.polaroid-img {
  width: 100%;
  height: 136px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

.polaroid-pin-clip {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 16px;
  color: #caa677;
  filter: drop-shadow(0 2px 4px rgba(212, 175, 55, 0.5));
}

.polaroid-caption-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  font-family: 'Cormorant Garamond', 'Noto Serif SC', serif;
  font-size: 12px;
  color: #5c4e42;
}

.add-polaroid-btn {
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11px;
  color: #7d6545;
  cursor: pointer;
}

.whisper-bottle-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 4px 0 8px;
}

.whisper-active-bubble {
  background: rgba(255, 255, 255, 0.65);
  border: 1px dashed rgba(212, 175, 55, 0.4);
  border-radius: 16px;
  padding: 10px 14px;
  font-family: 'Cormorant Garamond', 'Noto Serif SC', serif;
  font-size: 13.5px;
  line-height: 1.6;
  color: #3b3127;
}

.whisper-quick-box {
  display: flex;
  align-items: center;
  gap: 6px;
}

.whisper-quick-input {
  flex: 1;
  min-width: 0;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  color: #2b231d;
  outline: none;
}

.whisper-quick-send-btn {
  background: linear-gradient(135deg, #bfa068 0%, #caa677 100%);
  border: none;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 11.5px;
  color: #ffffff;
  cursor: pointer;
  flex-shrink: 0;
}

.open-drawer-icon-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 2px;
}

.drawer-wreath-icon {
  width: 16px;
  height: 16px;
  opacity: 0.8;
}

/* ========================================================
   双人心跳微共鸣模态框
   ======================================================== */
.heartbeat-dialog-card {
  max-width: 340px;
  text-align: center;
  overflow: hidden;
  position: relative;
}

.heartbeat-icon-wrap {
  position: relative;
  width: 54px;
  height: 54px;
  margin: 0 auto 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.heartbeat-diamond-core {
  font-size: 26px;
  animation: heartPulse 1.1s ease-in-out infinite;
  display: inline-block;
}

.heartbeat-ring-wave {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1.5px solid rgba(212, 175, 55, 0.6);
  animation: ringSpread 2.2s ease-out infinite;
}

@keyframes heartPulse {
  0%, 100% { transform: scale(1); }
  35% { transform: scale(1.22); }
  50% { transform: scale(1.08); }
  65% { transform: scale(1.28); }
}

@keyframes ringSpread {
  0% { transform: scale(0.6); opacity: 1; }
  100% { transform: scale(1.8); opacity: 0; }
}

.heartbeat-metrics-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin: 10px 0;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 14px;
  border: 1px solid rgba(212, 175, 55, 0.25);
}

.metric-block {
  display: flex;
  flex-direction: column;
}

.metric-val {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px;
  font-weight: 600;
  color: #9d8362;
}

.metric-lbl {
  font-size: 10.5px;
  color: #8c7e71;
}

.metric-divider {
  width: 1px;
  height: 26px;
  background: rgba(212, 175, 55, 0.2);
}

.heartbeat-message-bubble {
  background: rgba(255, 250, 242, 0.85);
  border-radius: 14px;
  padding: 10px 14px;
  font-family: 'Noto Serif SC', serif;
  font-size: 12.5px;
  line-height: 1.6;
  color: #3e3226;
  margin-bottom: 12px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.heartbeat-actions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.hb-act-btn {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(212, 175, 55, 0.32);
  border-radius: 14px;
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  transition: all 0.2s;
}

.hb-act-btn:active {
  transform: scale(0.93);
  background: rgba(255, 245, 230, 0.9);
}

.act-emoji {
  font-size: 18px;
}

.act-name {
  font-size: 10.5px;
  color: #7b624b;
}

/* ========================================================
   推门进入漫谈室条目：优雅白玉微光长条卡片
   ======================================================== */
.door-to-chat-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 350px;
  margin: 0 auto;
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.48);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 18px;
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(180, 150, 120, 0.08);
  transition: all 0.25s ease;
  box-sizing: border-box;
}

.door-to-chat-btn:hover,
.door-to-chat-btn:active {
  background: rgba(255, 255, 255, 0.65);
  transform: translateY(-1.5px);
  box-shadow: 0 10px 26px rgba(180, 150, 120, 0.14);
}

.door-left-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.door-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Cormorant Garamond', 'Noto Serif SC', serif;
  font-size: 15px;
  font-weight: 600;
  color: #4a3e35;
  letter-spacing: 0.4px;
}

.door-desc {
  font-size: 11px;
  color: #8c7e71;
}

.door-arrow-pill {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(212, 175, 55, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9d8362;
  font-size: 14px;
}

.dual-doors-row {
  display: flex;
  gap: 10px;
  width: 100%;
  max-width: 350px;
  margin: 0 auto;
  flex-shrink: 0;
}
.door-split-btn {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 18px;
}
.door-split-btn .door-title {
  font-size: 13.5px;
}
.door-split-btn .door-desc {
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.door-split-btn .door-arrow-pill {
  width: 22px;
  height: 22px;
  font-size: 11px;
}

/* ========================================================
   底部通透一体水晶输入栏：1:1 严格复刻定稿图
   ======================================================== */
.input-dock-crystal,
.nest-input-dock {
  position: fixed !important;
  bottom: max(12px, var(--safe-bottom)) !important;
  left: 0 !important;
  right: 0 !important;
  margin: 0 auto !important;
  width: calc(100% - 28px) !important;
  max-width: 420px !important;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.68);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  padding: 4px 6px 4px 18px;
  box-shadow: 0 10px 32px rgba(180, 150, 120, 0.14), 0 2px 6px rgba(0, 0, 0, 0.04);
  box-sizing: border-box !important;
  z-index: 300 !important;
  transition: transform 0.22s cubic-bezier(0.2, 0.9, 0.3, 1), opacity 0.2s ease;
}

.dock-input-capsule {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dock-text-input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: 'Cormorant Garamond', 'Noto Serif SC', serif;
  font-size: 14.5px;
  color: #2b231d;
  outline: none;
  padding: 8px 0;
}

.dock-text-input::placeholder {
  font-style: italic;
  color: #a69888;
}

.dock-plane-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.dock-plane-btn:active {
  transform: scale(1.15);
}

.dock-plane-icon {
  width: 18px;
  height: 18px;
  opacity: 0.8;
  filter: drop-shadow(0 1px 2px rgba(212, 175, 55, 0.3));
}

.dock-divider-glow {
  width: 1px;
  height: 20px;
  background: rgba(212, 175, 55, 0.3);
  margin: 0 8px;
  flex-shrink: 0;
}

.dock-media-btn {
  background: transparent;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 6px 8px 6px 0;
  font-family: 'Cormorant Garamond', serif;
  font-size: 13.5px;
  color: #7b624b;
  flex-shrink: 0;
  white-space: nowrap;
}

.media-plus-icon {
  font-size: 14px;
  color: #caa677;
}

/* 打字机流式指示胶囊 */
.live-typing-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 20px;
  font-size: 12px;
  color: #bfa068;
  box-shadow: 0 4px 14px rgba(191, 160, 104, 0.12);
  align-self: center;
}

.pulse-star {
  width: 12px;
  height: 12px;
  animation: starSpin 2s linear infinite;
}

@keyframes starSpin {
  0% { transform: rotate(0deg); opacity: 0.7; }
  50% { transform: rotate(180deg); opacity: 1; }
  100% { transform: rotate(360deg); opacity: 0.7; }
}

/* ========================================================
   DEDICATED CHAT PAGE: 独立沉浸漫谈室专有样式 (/chat)
   ======================================================== */
body.dedicated-chat-body {
  min-height: 100dvh !important;
  min-height: -webkit-fill-available !important;
  width: 100% !important;
  background-color: #fbf9f5 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

.dedicated-chat-viewport {
  width: 100%;
  max-width: 390px;
  height: 100dvh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
}

.dedicated-chat-messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 14px 16px;
  box-sizing: border-box;
}

/* 漫谈室整页 App 视口架构 */
#chat-app {
  height: 100dvh !important;
  max-height: 100dvh !important;
  overflow: hidden !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  margin: 0 auto !important;
  padding: 0 !important;
}

#chat-app .sanctuary-canvas {
  position: absolute !important;
  top: calc(max(10px, var(--safe-top)) + 52px) !important;
  bottom: calc(max(12px, var(--safe-bottom)) + 62px) !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  max-width: 460px !important;
  margin: 0 auto !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  padding: 12px 16px 16px !important;
  box-sizing: border-box !important;
}

.dedicated-chat-viewport #input-dock {
  flex: 0 0 auto;
  margin-bottom: max(10px, var(--safe-bottom));
}

.dedicated-chat-header {
  position: sticky;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  z-index: 250 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: max(8px, var(--safe-top)) 12px 8px !important;
  background: rgba(255, 255, 255, 0.76) !important;
  backdrop-filter: blur(28px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(28px) saturate(180%) !important;
  border-bottom: 1px solid rgba(220, 205, 185, 0.4) !important;
  box-shadow: 0 4px 18px rgba(180, 150, 120, 0.06) !important;
  box-sizing: border-box !important;
  gap: 6px !important;
}

.chat-back-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(212, 175, 55, 0.32);
  border-radius: 999px;
  font-family: 'Cormorant Garamond', 'Noto Serif SC', serif;
  font-size: 12px;
  color: #7b624b;
  text-decoration: none;
  cursor: pointer;
  flex-shrink: 0 !important;
  white-space: nowrap !important;
}

.chat-header-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  text-align: center;
  overflow: hidden !important;
}

.chat-room-title {
  font-family: 'Cormorant Garamond', 'Noto Serif SC', serif;
  font-size: 14px;
  font-weight: 600;
  color: #4a3e35;
  letter-spacing: 0.3px;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 100%;
}

.chat-room-subtitle {
  font-size: 10.5px;
  color: #8c7e71;
  margin-top: 1px;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 100%;
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0 !important;
}

.chat-action-icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(212, 175, 55, 0.32);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0 !important;
}

.chat-action-icon-btn img {
  width: 15px;
  height: 15px;
  opacity: 0.85;
}

/* 漫谈对话流：周鲤气泡与 Winston 回复 (外层轻盈微光时间，告别黑体与内嵌占用) */
.bubble-outer-wrap {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  width: 100%;
}

.dialogue-content-col-li {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex: 1;
  min-width: 0;
}

.dialogue-content-col-li .bubble-outer-wrap {
  justify-content: flex-end;
}

.dialogue-content-col-winston {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 1;
  min-width: 0;
}

.dialogue-content-col-winston .bubble-outer-wrap {
  justify-content: flex-start;
}

.bubble-outer-time {
  font-family: 'Cormorant Garamond', 'Noto Serif SC', serif;
  font-size: 11.5px;
  color: #6d5b4a;
  opacity: 0.9;
  flex-shrink: 0;
  margin-bottom: 5px;
  letter-spacing: 0.03em;
  user-select: none;
  line-height: 1;
  text-shadow: 0 1px 3px rgba(255, 255, 255, 0.9);
}

.li-bubble-card {
  max-width: 82%;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 18px 18px 4px 18px;
  padding: 12px 16px;
  box-shadow: 0 6px 18px rgba(180, 150, 120, 0.08);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.li-card-text, .li-bubble-text {
  font-family: 'Noto Serif SC', 'Songti SC', 'STSong', serif;
  font-size: 14.5px;
  line-height: 1.68;
  color: #2b231d;
  font-weight: 400;
  word-break: break-word;
}

.winston-sanctuary-card {
  max-width: 88%;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 18px 18px 18px 4px;
  padding: 14px 18px;
  box-shadow: 0 8px 24px rgba(180, 150, 120, 0.09);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.winston-sanctuary-card .card-body-text {
  font-family: 'Noto Serif SC', 'Songti SC', 'STSong', serif;
  font-size: 14.5px;
  line-height: 1.78;
  color: #2b231d;
  word-break: break-word;
}

.dialogue-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  margin: 0 auto 14px;
  box-sizing: border-box;
}

.dialogue-row-user, .dialogue-row-li {
  justify-content: flex-end;
}

.dialogue-row-winston {
  justify-content: flex-start;
}

.dialogue-content-col {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

/* 头像与高定框 */
.avatar-frame-wrap {
  position: relative;
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  user-select: none;
  cursor: pointer;
  flex-shrink: 0;
}

.avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.avatar-frame-svg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 130%;
  height: 130%;
  pointer-events: none;
}

/* ========================================================
   MODALS: 白玉更衣匣与测试断言支持
   ======================================================== */
.crystal-modal-overlay {
  position: fixed;
  top: -10vh;
  left: 0;
  right: 0;
  bottom: -15vh;
  width: 100%;
  height: 125vh;
  min-height: -webkit-fill-available;
  z-index: 10000;
  background: rgba(28, 22, 16, 0.42);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px 16px max(24px, env(safe-area-inset-bottom, 20px));
  box-sizing: border-box;
}

.crystal-modal-overlay.active {
  display: flex !important;
}

.crystal-modal-card {
  width: 100%;
  max-width: 380px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 24px;
  padding: 22px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
  position: relative;
  box-sizing: border-box;
}

.wardrobe-dialog-card {
  max-height: 85vh;
  overflow-y: auto;
}

.crystal-modal-header {
  text-align: center;
  margin-bottom: 16px;
}

.crystal-modal-title {
  font-family: 'Cormorant Garamond', 'Noto Serif SC', serif;
  font-size: 18px;
  color: #3b3026;
  margin-bottom: 4px;
}

.crystal-modal-subtitle {
  font-size: 12px;
  color: #8c7e71;
}

.modal-top-sparkle {
  position: absolute;
  top: 12px;
  right: 16px;
  color: #caa677;
  font-size: 14px;
}

/* ========================================================
   WARDROBE DIALOG: 白玉更衣匣与装扮系统
   ======================================================== */
.wardrobe-dialog-card {
  width: calc(100% - 32px);
  max-width: 410px;
  max-height: 85vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 22px;
  padding: 20px 18px;
  box-shadow: 0 16px 45px rgba(180, 150, 120, 0.2);
  box-sizing: border-box;
}

.wardrobe-tabs {
  display: flex;
  gap: 8px;
  background: rgba(240, 235, 225, 0.55);
  padding: 3px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.wardrobe-tab-btn {
  flex: 1;
  padding: 6px 12px;
  border: none;
  background: transparent;
  border-radius: 999px;
  font-family: 'Cormorant Garamond', 'Noto Serif SC', serif;
  font-size: 13px;
  color: #7b6a58;
  cursor: pointer;
  transition: all 0.2s ease;
}

.wardrobe-tab-btn.active {
  background: #ffffff;
  color: #3b2e24;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(180, 150, 110, 0.15);
}

.wardrobe-panel {
  display: flex;
  flex-direction: column !important;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
}

.wardrobe-avatar-preview-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.65);
  border-radius: 16px;
  border: 1px solid rgba(212, 175, 55, 0.25);
  margin-bottom: 8px;
  box-sizing: border-box;
  width: 100%;
}

.wardrobe-preview-frame-wrap {
  position: relative;
  width: 64px !important;
  height: 64px !important;
  min-width: 64px !important;
  min-height: 64px !important;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wardrobe-preview-frame-wrap .avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.avatar-upload-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  flex-wrap: wrap;
}

.avatar-upload-btn-subtle {
  padding: 5px 14px;
  font-size: 12px;
  color: #7a6855;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.avatar-upload-btn-subtle:active {
  transform: scale(0.96);
  background: #ffffff;
}

.frame-options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 4px;
  margin-bottom: 12px;
  width: 100%;
  box-sizing: border-box;
}

.frame-option-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(220, 205, 185, 0.45);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 0;
  box-sizing: border-box;
}

.frame-option-card .frame-option-name {
  font-family: 'Cormorant Garamond', 'Noto Serif SC', serif;
  font-size: 12px;
  font-weight: 600;
  color: #3b2e24;
  white-space: nowrap;
}

.frame-option-card:active,
.frame-option-card.selected {
  background: rgba(255, 250, 240, 0.95);
  border-color: #caa677;
  box-shadow: 0 2px 10px rgba(202, 166, 119, 0.2);
}

.frame-thumb-wrap {
  position: relative;
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  min-height: 34px !important;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.frame-thumb-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.frame-option-name {
  font-size: 11.5px;
  font-weight: 600;
  color: #3b2e24;
}

.frame-option-desc {
  display: none;
}

.crystal-btn {
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 12.5px;
  font-family: 'Cormorant Garamond', 'Noto Serif SC', serif;
  cursor: pointer;
  transition: all 0.2s ease;
}

.crystal-btn-subtle {
  background: rgba(245, 240, 230, 0.7);
  border: 1px solid rgba(212, 175, 55, 0.3);
  color: #7b6a58;
}

.crystal-btn-primary {
  background: linear-gradient(135deg, #e8d7be 0%, #caa677 100%);
  border: 1px solid rgba(255, 255, 255, 0.8);
  color: #2b1f14;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(202, 166, 119, 0.3);
}

.crystal-btn-danger {
  background: rgba(220, 100, 80, 0.12);
  border: 1px solid rgba(220, 100, 80, 0.35);
  color: #a44238;
}

.crystal-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* ========================================================
   CANDLE DIALOG: 私邸案头 · 烛火守候
   ======================================================== */
.candle-dialog-card {
  max-width: 340px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 24px;
  padding: 22px 20px;
  box-shadow: 0 16px 45px rgba(180, 150, 120, 0.2);
  text-align: center;
}

.candle-glow-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}

.dialog-candle-icon {
  width: 24px;
  height: 24px;
  filter: drop-shadow(0 0 10px rgba(245, 200, 120, 0.9));
  animation: candleFlicker 3s infinite ease-in-out;
}

.candle-status-banner {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  background: rgba(245, 240, 230, 0.6);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 999px;
  font-size: 11.5px;
  color: #7a6855;
  margin-bottom: 12px;
}

.candle-dot-pulsing {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #68b479;
  box-shadow: 0 0 8px rgba(104, 180, 121, 0.9);
}

.candle-winston-quote {
  font-family: 'Cormorant Garamond', 'Noto Serif SC', serif;
  font-size: 13px;
  font-style: italic;
  color: #5c4e40;
  line-height: 1.6;
  padding: 10px 14px;
  background: rgba(255, 250, 240, 0.6);
  border-left: 2px solid #caa677;
  border-radius: 8px;
  margin: 0 0 14px 0;
  text-align: left;
}

.candle-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 16px;
}

.candle-meta-grid .meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 4px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(220, 205, 185, 0.35);
  border-radius: 10px;
}

.candle-meta-grid .meta-label {
  font-size: 10px;
  color: #9c8e80;
}

.candle-meta-grid .meta-val {
  font-size: 11.5px;
  font-weight: 600;
  color: #4a3e35;
}

/* 契约测试必需类名支持 */
.view-switch-capsule {
  display: inline-flex;
  gap: 4px;
}

.crystal-lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: rgba(0,0,0,0.7);
  display: none;
}

.keyboard-lift {
  transform: translateY(-200px);
}

.crystal-btn *,
.dock-plane-btn img,
.status-wardrobe-trigger img {
  pointer-events: none !important;
}

#nest-carousel-viewport,
.nest-carousel-viewport {
  width: 100%;
  overflow: hidden;
  position: relative;
  touch-action: pan-y pinch-zoom;
}

.nest-carousel-track {
  display: flex;
  flex-direction: row;
  width: 100%;
  transition: transform 0.42s cubic-bezier(0.25, 1, 0.5, 1);
  will-change: transform;
}

.carousel-panel {
  flex: 0 0 100%;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

body.nest-app-body {
  overflow-x: clip;
}

/* ========================================================
   1. 3D 丝滑弹性翻转抽卡私房便签系统 (60fps GPU 硬件加速)
   ======================================================== */
.card-flip-container {
  perspective: 1200px;
  -webkit-perspective: 1200px;
  width: 100%;
  position: relative;
}

.card-flip-inner {
  position: relative;
  width: 100%;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transition: transform 0.65s cubic-bezier(0.34, 1.35, 0.64, 1);
  will-change: transform;
}

.card-flip-inner.is-flipped {
  transform: rotateY(180deg);
  -webkit-transform: rotateY(180deg);
}

.card-face {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
}

.card-front {
  transform: rotateY(0deg);
  -webkit-transform: rotateY(0deg);
  width: 100%;
}

.card-back {
  position: absolute !important;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: rotateY(180deg);
  -webkit-transform: rotateY(180deg);
  box-sizing: border-box;
  margin: 0 !important;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 2;
  background: rgba(255, 255, 255, 0.88) !important;
  backdrop-filter: blur(28px) !important;
  -webkit-backdrop-filter: blur(28px) !important;
}

/* 抽卡私房便签右上角灵动胶囊按钮 */
.draw-memo-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 250, 240, 0.95), rgba(246, 238, 225, 0.85));
  border: 1px solid rgba(202, 166, 119, 0.45);
  box-shadow: 0 2px 8px rgba(202, 166, 119, 0.18);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  -webkit-tap-highlight-color: transparent;
}

.draw-memo-trigger-btn:hover {
  transform: scale(1.04);
  background: linear-gradient(135deg, rgba(255, 255, 255, 1), rgba(250, 242, 230, 0.95));
  border-color: rgba(202, 166, 119, 0.7);
  box-shadow: 0 4px 12px rgba(202, 166, 119, 0.28);
}

.draw-memo-trigger-btn:active {
  transform: scale(0.96);
}

.memo-btn-sparkle {
  color: #caa677;
  font-size: 11px;
}

.memo-btn-text {
  font-family: 'Noto Serif SC', 'Cormorant Garamond', serif;
  font-size: 11.5px;
  font-weight: 500;
  color: #5a4b3d;
  letter-spacing: 0.5px;
}

/* 背面私房便签排版美学 */
.flip-back-btn {
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(202, 166, 119, 0.25);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #8c7e70;
  cursor: pointer;
  transition: all 0.2s ease;
}

.flip-back-btn:hover {
  background: rgba(202, 166, 119, 0.15);
  color: #3b3026;
  transform: scale(1.1);
}

.memo-body-container {
  padding: 18px 8px;
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.memo-quote-mark, .memo-quote-mark-end {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px;
  color: #caa677;
  opacity: 0.6;
  line-height: 1;
}

.memo-quote-mark {
  margin-right: 6px;
  align-self: flex-start;
}

.memo-quote-mark-end {
  margin-left: 6px;
  align-self: flex-end;
}

.memo-content-text {
  font-family: 'Noto Serif SC', 'Cormorant Garamond', serif;
  font-size: 14.5px;
  line-height: 1.85;
  color: #3d3229;
  letter-spacing: 0.4px;
  margin: 0;
  text-align: justify;
}

.memo-footer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px dashed rgba(202, 166, 119, 0.25);
}

.draw-again-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, #caa677, #b89360);
  border: none;
  color: #ffffff;
  font-family: 'Noto Serif SC', serif;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(202, 166, 119, 0.35);
  transition: all 0.25s ease;
}

.draw-again-pill-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(202, 166, 119, 0.45);
}

.draw-again-pill-btn:active {
  transform: translateY(1px) scale(0.97);
}

.draw-sparkle {
  font-size: 10px;
}

.card-pulse-shake {
  animation: pulseCardShake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes pulseCardShake {
  10%, 90% { transform: rotateY(180deg) translate3d(-1px, 0, 0); }
  20%, 80% { transform: rotateY(180deg) translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: rotateY(180deg) translate3d(-3px, 0, 0); }
  40%, 60% { transform: rotateY(180deg) translate3d(3px, 0, 0); }
}

.text-fade-in {
  animation: memoFadeIn 0.4s ease-out forwards;
}

@keyframes memoFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========================================================
   2. 双人心跳微共鸣浮岛 (Heartbeat Modal)
   ======================================================== */
.heartbeat-modal-overlay {
  z-index: 10005 !important;
}

.heartbeat-dialog-card {
  width: calc(100% - 32px) !important;
  max-width: 326px !important;
  margin: auto !important;
  box-sizing: border-box;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 24px 60px rgba(74, 52, 38, 0.18), 0 0 30px rgba(202, 166, 119, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.95);
  position: relative;
  overflow: hidden;
}

.heartbeat-pulse-aurora {
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 120px;
  background: radial-gradient(circle, rgba(202, 166, 119, 0.25) 0%, rgba(255, 255, 255, 0) 70%);
  pointer-events: none;
}

.heartbeat-icon-wrap {
  width: 50px;
  height: 50px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255, 250, 240, 0.9), rgba(246, 235, 220, 0.9));
  border: 1px solid rgba(202, 166, 119, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 4px 16px rgba(202, 166, 119, 0.2);
}

.heartbeat-diamond-core {
  font-size: 20px;
  animation: heartPulse 1.2s ease-in-out infinite;
}

@keyframes heartPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.heartbeat-metrics-row {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: rgba(250, 246, 240, 0.65);
  border: 1px solid rgba(220, 205, 185, 0.35);
  border-radius: 16px;
  padding: 12px 8px;
  margin-bottom: 14px;
}

.metric-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.metric-val {
  font-family: 'Cormorant Garamond', 'Noto Serif SC', serif;
  font-size: 22px;
  font-weight: 700;
  color: #3b3026;
  letter-spacing: 0.5px;
}

.metric-lbl {
  font-size: 10.5px;
  color: #8c7e70;
}

.metric-divider {
  width: 1px;
  height: 28px;
  background: rgba(202, 166, 119, 0.3);
}

.heartbeat-message-bubble {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(202, 166, 119, 0.3);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.heartbeat-message-bubble p {
  font-family: 'Noto Serif SC', serif;
  font-size: 13px;
  line-height: 1.7;
  color: #4a3e35;
  margin: 0;
  text-align: justify;
}

.heartbeat-actions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.hb-act-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(202, 166, 119, 0.3);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.hb-act-btn:hover {
  background: rgba(255, 250, 240, 0.95);
  border-color: rgba(202, 166, 119, 0.6);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(202, 166, 119, 0.2);
}

.hb-act-btn:active, .hb-act-btn.btn-pressed {
  transform: scale(0.95);
  background: rgba(246, 235, 220, 0.95);
}

.hb-act-btn .act-emoji {
  font-size: 18px;
}

.hb-act-btn .act-name {
  font-family: 'Noto Serif SC', serif;
  font-size: 11px;
  color: #5c4e40;
}

/* ========================================================
   3. 叠卡指示圆点与思考气泡间距微调
   ======================================================== */
.thought-whisper-floater {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 6px auto 14px;
  text-align: center;
  z-index: 10;
  width: 100%;
}

/* ========================================================
   3. 白玉灵动案头分段胶囊 (大触控区 + 柔金动态流光滑块)
   ======================================================== */
.desk-segment-capsule {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  position: relative;
  width: 100%;
  max-width: 340px;
  height: 38px;
  margin: 10px auto 8px;
  padding: 3px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 16px rgba(74, 52, 38, 0.06), 0 1px 2px rgba(202, 166, 119, 0.12);
  border-radius: 20px;
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
}

/* 柔金动态流光滑块 */
.capsule-sliding-pill {
  position: absolute;
  top: 3px;
  left: 3px;
  height: 30px;
  width: calc((100% - 6px) / 3);
  border-radius: 17px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 240, 230, 0.92));
  border: 1px solid rgba(202, 166, 119, 0.4);
  box-shadow: 0 3px 10px rgba(202, 166, 119, 0.25), 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  z-index: 1;
}

/* 分段切换按钮 (Apple HIG 36px 舒适触控) */
.segment-tab-btn {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: none;
  background: transparent;
  position: relative;
  z-index: 2;
  cursor: pointer;
  border-radius: 17px;
  color: #8c7e70;
  font-family: 'Noto Serif SC', 'Cormorant Garamond', serif;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.3px;
  transition: color 0.25s ease, transform 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  padding: 0;
}

.segment-tab-btn.active {
  color: #3b3026;
  font-weight: 600;
}

.segment-tab-btn:active {
  transform: scale(0.96);
}

.tab-sparkle {
  color: #caa677;
  font-size: 10px;
}

.tab-icon {
  font-size: 11px;
}

.tab-label {
  line-height: 1;
}

.polaroid-stack-card, .whispers-bottle-card {
  min-height: 240px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.polaroid-photo-frame {
  cursor: pointer;
  padding: 8px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  margin: 8px 0;
  transition: transform 0.25s ease;
}

.polaroid-photo-frame:hover {
  transform: scale(1.02) rotate(-0.5deg);
}

.polaroid-img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
}

.polaroid-caption-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
}

.moment-card-title {
  font-family: 'Noto Serif SC', serif;
  font-size: 11.5px;
  color: #4a3e35;
}

.moment-card-time {
  font-size: 10px;
  color: #9c8e80;
}

.whisper-bottle-body {
  padding: 8px 0;
}

.whisper-active-bubble {
  background: rgba(255, 255, 255, 0.7);
  border-radius: 14px;
  padding: 12px;
  border: 1px solid rgba(202, 166, 119, 0.25);
  margin-bottom: 10px;
}

.whisper-bubble-text {
  font-family: 'Noto Serif SC', serif;
  font-size: 12.5px;
  line-height: 1.6;
  color: #4a3e35;
  margin: 0;
}

.whisper-quick-box {
  display: flex;
  gap: 6px;
}

.whisper-quick-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(202, 166, 119, 0.35);
  border-radius: 12px;
  padding: 6px 10px;
  font-size: 12px;
  outline: none;
  font-family: 'Noto Serif SC', serif;
}

.whisper-quick-send-btn {
  background: linear-gradient(135deg, #caa677, #b89360);
  border: none;
  border-radius: 12px;
  padding: 6px 12px;
  color: #ffffff;
  font-size: 11.5px;
  font-family: 'Noto Serif SC', serif;
  cursor: pointer;
  white-space: nowrap;
}

/* ========================================================
   TOGETHER CHRONO WIDGET (相伴岁月罗盘 · 专属高定白玉卡片)
   ======================================================== */
.chrono-sanctuary-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.chrono-badge-hms {
  font-family: "Cormorant Garamond", "Noto Serif SC", serif;
  font-size: 13px;
  font-weight: 600;
  color: #8c7352;
  background: rgba(202, 166, 119, 0.12);
  border: 1px solid rgba(202, 166, 119, 0.25);
  padding: 2px 10px;
  border-radius: 9999px;
  letter-spacing: 1px;
}

.chrono-hero-wrap {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  margin: 4px 0 2px;
}

.chrono-days-val {
  font-family: "Cormorant Garamond", "Playfair Display", serif;
  font-size: clamp(48px, 11dvh, 64px);
  font-weight: 300;
  line-height: 1;
  letter-spacing: 1px;
  background: linear-gradient(135deg, #2b2826 40%, #a68453 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.chrono-days-unit {
  font-family: "Cormorant Garamond", serif;
  font-size: 18px;
  font-style: italic;
  color: #9d8155;
  font-weight: 400;
}

.chrono-pulse-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 11.5px;
  color: #827566;
  margin-bottom: 8px;
}

.chrono-pulse-row .heart-spark-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
}

.chrono-pulse-row .heart-spark {
  color: #d94861;
  width: 13px;
  height: 13px;
  display: inline-block;
  animation: heartPulse 1.2s infinite ease-in-out;
}

.chrono-pulse-row .heart-ripple {
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid rgba(217, 72, 97, 0.4);
  pointer-events: none;
  animation: ripplePulse 1.2s infinite ease-out;
}

@keyframes heartPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}

@keyframes ripplePulse {
  0% { transform: scale(0.6); opacity: 0.9; }
  100% { transform: scale(1.6); opacity: 0; }
}

.chrono-pillars-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  width: 100%;
  margin-bottom: 4px;
}

.chrono-pillar-item {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(202, 166, 119, 0.22);
  border-radius: 12px;
  padding: 6px 2px;
  text-align: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chrono-pillar-item .pillar-number {
  font-family: "Cormorant Garamond", "Noto Serif SC", serif;
  font-size: 13px;
  font-weight: 600;
  color: #43382c;
  line-height: 1.2;
}

.chrono-pillar-item .pillar-label {
  font-family: "Noto Serif SC", serif;
  font-size: 9.5px;
  color: #9c8e7e;
  letter-spacing: 0.5px;
}

/* ========================================================
   SUBCONSCIOUS DARKROOM CAPSULE (暗室入口灵动长廊小胶囊)
   ======================================================== */
.subconscious-hall-capsule {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 350px;
  margin: 6px auto 0;
  padding: 8px 14px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.7), rgba(246, 241, 233, 0.6));
  border: 1px solid rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 4px 16px rgba(160, 140, 115, 0.08);
  text-decoration: none;
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.25, 1), box-shadow 0.2s ease;
  flex-shrink: 0;
}

.subconscious-hall-capsule:active {
  transform: scale(0.97);
  box-shadow: 0 2px 8px rgba(160, 140, 115, 0.12);
}

.hall-capsule-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.hall-sparkle {
  color: #caa677;
  font-size: 12px;
}

.hall-title {
  font-family: "Noto Serif SC", serif;
  font-size: 12.5px;
  font-weight: 600;
  color: #5a4b3a;
  white-space: nowrap;
}

.hall-divider {
  color: #d1beaa;
  font-size: 12px;
}

.hall-desc {
  font-size: 10.5px;
  color: #928373;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hall-arrow {
  font-family: "Noto Serif SC", serif;
  font-size: 11px;
  font-weight: 600;
  color: #b08d5b;
  white-space: nowrap;
  padding-left: 8px;
}

