:root {
  --bg-center: #1b1510;
  --bg-edge: #090807;
  --accent: #d4af70;
  --accent-soft: rgba(212, 175, 112, 0.24);
  --accent-line: rgba(212, 175, 112, 0.36);
  --text-main: #f6f0e6;
  --text-sub: rgba(246, 240, 230, 0.72);
  --text-muted: rgba(246, 240, 230, 0.45);
  --glass-bg: rgba(15, 13, 11, 0.62);
  --glass-card: rgba(16, 14, 12, 0.74);
  --glass-strong: rgba(12, 10, 9, 0.94);
  --grad-1: #fdf8ee;
  --grad-2: #e2c288;
  --grad-3: #b78f4e;
  --font-display: "Cormorant Garamond", "Noto Serif SC", Georgia, serif;
  --font-cn: "Noto Serif SC", "PingFang SC", "Songti SC", serif;
  --font-sans: "Inter", -apple-system, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

[hidden] { display: none !important; }

html, body {
  width: 100%;
  height: 100%;
  background: var(--bg-edge);
  color: var(--text-main);
  font-family: var(--font-cn);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  user-select: none;
}

/* 桌面端切换“手机视口框”模式 */
body.phone-frame {
  background: #060505;
  display: flex;
  align-items: center;
  justify-content: center;
}
.phone-shell {
  position: relative;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
}
body.phone-frame .phone-shell {
  width: 390px;
  height: min(844px, 95dvh);
  border-radius: 40px;
  border: 1px solid rgba(212, 175, 112, 0.34);
  box-shadow: 0 36px 96px rgba(0, 0, 0, 0.85), 0 0 0 8px #12100e;
}

.studio-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(circle at 36% 42%, var(--bg-center) 0%, var(--bg-edge) 74%);
  transition: background 1s var(--ease);
}

.studio-grain {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.03;
  background-image: radial-gradient(rgba(255, 255, 255, 0.7) 0.5px, transparent 0.5px);
  background-size: 3px 3px;
}

#scene-container {
  position: absolute;
  inset: 0;
  z-index: 2;
  cursor: grab;
  touch-action: none;
}
#scene-container:active { cursor: grabbing; }

.icon {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  stroke-width: 1.3;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* ==================== 加载蒙层 ==================== */
.loading-mask {
  position: absolute;
  inset: 0;
  z-index: 95;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: var(--bg-edge);
  transition: opacity 0.45s ease;
}
.loading-mask.gone { opacity: 0; pointer-events: none; }
.loading-ring {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--accent-soft);
  border-top-color: var(--accent);
  animation: spin 1s linear infinite;
}
.loading-text { font-size: 12.5px; letter-spacing: 0.2em; color: var(--text-sub); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ==================== 开场高定丝绒幕布 ==================== */
#opening-gate {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(circle at 50% 42%, rgba(20, 16, 13, 0.74) 0%, rgba(7, 6, 5, 0.95) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 1;
  transition: opacity 0.8s var(--ease), visibility 0.8s;
}
#opening-gate.hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.gate-frame {
  position: relative;
  width: 100%;
  max-width: 400px;
  padding: 40px 26px 34px;
  text-align: center;
  border-radius: 8px;
  border: 1px solid var(--accent-line);
  background: linear-gradient(165deg, rgba(24, 20, 17, 0.90), rgba(11, 10, 9, 0.97));
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.78);
  transition: transform 0.75s var(--ease), opacity 0.65s ease;
}
#opening-gate.hidden .gate-frame {
  transform: translateY(-16px) scale(0.97);
  opacity: 0;
}
.gate-frame::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(212, 175, 112, 0.14);
  border-radius: 5px;
  pointer-events: none;
}

.gate-seal {
  width: 42px;
  height: 42px;
  margin: 0 auto 18px;
  border-radius: 50%;
  border: 1px solid var(--accent-line);
  background: radial-gradient(circle at 35% 30%, rgba(212, 175, 112, 0.25), rgba(140, 102, 48, 0.08));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}
.gate-kicker {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.38em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 12px;
}
.gate-recipient {
  font-size: clamp(28px, 7vw, 38px);
  font-weight: 400;
  letter-spacing: 0.18em;
  padding-left: 0.18em;
  background: linear-gradient(125deg, var(--grad-1) 10%, var(--grad-2) 55%, var(--grad-3) 96%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.gate-rule {
  width: 40px;
  height: 1px;
  background: var(--accent-line);
  margin: 14px auto;
}
.gate-sub {
  font-size: 13.5px;
  letter-spacing: 0.18em;
  color: var(--text-sub);
  margin-bottom: 8px;
}
.gate-edition {
  font-family: var(--font-display);
  font-size: 10.5px;
  letter-spacing: 0.24em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 18px;
}
.gate-badge {
  display: inline-block;
  margin-bottom: 18px;
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid var(--accent-soft);
  background: rgba(212, 175, 112, 0.08);
  color: var(--accent);
  font-size: 11.5px;
  letter-spacing: 0.14em;
}
.gate-lock {
  margin: 4px 0 20px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--accent-soft);
  background: rgba(255, 255, 255, 0.03);
}
.gate-lock.shake { animation: shake 0.38s ease; }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}
.lock-hint { font-size: 11.5px; color: var(--text-sub); letter-spacing: 0.08em; margin-bottom: 8px; }
.lock-input {
  width: 100%;
  padding: 9px 12px;
  border-radius: 6px;
  border: 1px solid var(--accent-line);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text-main);
  text-align: center;
  font-family: var(--font-sans);
  font-size: 14px;
  letter-spacing: 0.24em;
  outline: none;
  user-select: text;
}
.lock-err { margin-top: 6px; font-size: 11px; color: #f58b8b; }

.gate-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 32px;
  border-radius: 999px;
  border: 1px solid var(--accent-line);
  background: rgba(212, 175, 112, 0.13);
  color: var(--text-main);
  font-family: var(--font-cn);
  font-size: 13px;
  letter-spacing: 0.22em;
  cursor: pointer;
  transition: all 0.3s var(--ease);
}
.gate-btn:hover {
  background: rgba(212, 175, 112, 0.24);
  border-color: var(--accent);
}
.gate-btn:active { transform: scale(0.97); }
.gate-sender {
  margin-top: 16px;
  font-size: 11.5px;
  letter-spacing: 0.16em;
  color: var(--text-muted);
}

/* ==================== 顶部高定导航栏 ==================== */
.top-chrome {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 35;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(12px, env(safe-area-inset-top)) clamp(12px, 3vw, 28px) 8px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s var(--ease);
}
.top-chrome.visible { opacity: 1; }
body.in-preview .top-chrome { padding-top: 32px; }
body.in-preview .vinyl-pill { top: 76px; }

.brand-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-cn);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  color: var(--text-sub);
  background: var(--glass-bg);
  border: 1px solid var(--accent-soft);
  padding: 5px 11px;
  border-radius: 999px;
  backdrop-filter: blur(14px);
  white-space: nowrap;
  flex-shrink: 0;
}
.brand-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.top-toolbar {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--glass-bg);
  border: 1px solid var(--accent-soft);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.swatches { display: flex; align-items: center; gap: 6px; }
.swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.24);
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
}
.swatch.active {
  transform: scale(1.2);
  border-color: #fff;
}
.bar-sep { width: 1px; height: 13px; background: var(--accent-soft); }
.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 6px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--text-main);
  font-family: var(--font-cn);
  font-size: 11px;
  letter-spacing: 0.08em;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.tool-btn:hover { color: var(--accent); }
.tool-icon-btn { width: 24px; height: 24px; padding: 0; justify-content: center; }

/* ==================== 悬浮黑胶语音胶囊 ==================== */
.vinyl-pill {
  position: absolute;
  right: 14px;
  top: max(58px, calc(env(safe-area-inset-top) + 48px));
  z-index: 36;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 6px;
  border-radius: 999px;
  border: 1px solid var(--accent-line);
  background: var(--glass-bg);
  backdrop-filter: blur(14px);
  color: var(--text-main);
  font-family: var(--font-cn);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.36);
}
.vinyl-pill[hidden] { display: none; }
.vinyl-disc {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(circle, #181615 45%, #3a3027 48%, #161413 78%);
  border: 1px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}
.vinyl-disc.spinning { animation: spin 3.2s linear infinite; }
.vinyl-core { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

/* ==================== 主舞台叠加层 ==================== */
.stage-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s var(--ease);
}
.stage-overlay.visible { opacity: 1; }

/* 3D 蛋糕互动控制坞 */
.cake-dock {
  position: absolute;
  left: 33%;
  bottom: max(22px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(500px, 50vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s var(--ease);
}
.cake-bar {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--glass-bg);
  border: 1px solid var(--accent-soft);
  backdrop-filter: blur(16px);
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.cake-bar::-webkit-scrollbar { display: none; }
.cake-bar[hidden] { display: none; }

.cake-pill {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-sub);
  font-family: var(--font-cn);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.24s var(--ease);
}
.cake-pill.active {
  color: var(--text-main);
  border-color: var(--accent-line);
  background: linear-gradient(135deg, rgba(212, 175, 112, 0.25), rgba(212, 175, 112, 0.09));
}

.breath-meter {
  width: min(300px, 84%);
  display: flex;
  flex-direction: column;
  gap: 4px;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.25s, max-height 0.25s;
}
.breath-meter.visible { opacity: 1; max-height: 36px; }
.breath-meta {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-sans);
  font-size: 10px;
  color: var(--accent);
}
.breath-track { width: 100%; height: 2px; background: rgba(255, 255, 255, 0.14); border-radius: 2px; overflow: hidden; }
.breath-fill { width: 0%; height: 100%; background: linear-gradient(90deg, var(--accent), #fff5db); }

.candle-row {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: 999px;
  border: 1px solid var(--accent-soft);
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  color: var(--text-main);
  font-family: var(--font-cn);
  font-size: 12px;
  letter-spacing: 0.1em;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.22s var(--ease);
}
.action-btn.primary {
  border-color: var(--accent-line);
  background: linear-gradient(135deg, rgba(212, 175, 112, 0.25), rgba(212, 175, 112, 0.09));
}
.action-btn.icon-only { width: 36px; height: 36px; padding: 0; }
.action-btn.listening {
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(212, 175, 112, 0.28);
}
.mic-dot { display: none; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.action-btn.listening .mic-dot { display: inline-block; animation: micPulse 1.2s infinite; }
@keyframes micPulse { 50% { transform: scale(1.4); opacity: 0.5; } }
.hint-line { font-size: 10.5px; letter-spacing: 0.14em; color: var(--text-muted); text-align: center; }

/* ==================== 右侧内容面板（桌面常驻 / 手机抽屉） ==================== */
.content-panel {
  position: absolute;
  right: 3.5%;
  top: 52%;
  transform: translateY(-50%);
  width: min(430px, 39vw);
  height: min(640px, calc(100vh - 96px));
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  background: var(--glass-card);
  border: 1px solid var(--accent-line);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.54);
  pointer-events: auto;
  overflow: hidden;
}

.panel-header-mobile { display: none; }

.panel-desktop-tabs {
  display: flex;
  gap: 6px;
  padding: 14px 20px 10px;
  border-bottom: 1px solid var(--accent-soft);
}
.dtab {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-sub);
  font-family: var(--font-cn);
  font-size: 12px;
  letter-spacing: 0.14em;
  cursor: pointer;
}
.dtab.active {
  color: var(--text-main);
  border-color: var(--accent-line);
  background: rgba(212, 175, 112, 0.16);
}
.dtab[hidden] { display: none; }

.panel-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px 22px 24px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-soft) transparent;
}
.tab-pane { display: none; }
.tab-pane.active { display: block; animation: fadeIn 0.35s var(--ease); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* 私信 & 信封 */
.card-head { padding-bottom: 14px; border-bottom: 1px solid var(--accent-soft); }
.card-kicker {
  font-family: var(--font-display);
  font-size: 10.5px;
  letter-spacing: 0.32em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.card-to {
  font-size: clamp(24px, 2.5vw, 32px);
  font-weight: 400;
  letter-spacing: 0.14em;
  background: linear-gradient(125deg, var(--grad-1) 10%, var(--grad-2) 55%, var(--grad-3) 96%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
}
.card-sub { font-size: 13px; letter-spacing: 0.16em; color: var(--text-sub); line-height: 1.6; }

/* 时光纪念与心动清单 */
.story-card {
  margin-top: 14px;
  padding: 13px 14px;
  border-radius: 8px;
  border: 1px solid var(--accent-soft);
  background: rgba(212, 175, 112, 0.06);
}
.story-card[hidden] { display: none; }
.story-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.story-badge {
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-weight: 400;
}
.story-date { font-family: var(--font-display); font-size: 11px; color: var(--text-muted); letter-spacing: 0.12em; }
.story-reasons { display: flex; flex-direction: column; gap: 7px; }
.reason-item {
  display: flex;
  gap: 9px;
  font-size: 12.5px;
  line-height: 1.6;
  color: rgba(246, 240, 230, 0.88);
}
.reason-idx { font-family: var(--font-display); color: var(--accent); font-size: 11px; padding-top: 2px; }

/* 3D 折合信封 */
.env-section { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.env-bar { display: flex; align-items: center; justify-content: space-between; }
.env-tag { font-family: var(--font-display); font-size: 10px; letter-spacing: 0.26em; color: var(--text-muted); }
.env-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--accent-soft);
  background: rgba(212, 175, 112, 0.08);
  color: var(--accent);
  font-family: var(--font-cn);
  font-size: 11px;
  letter-spacing: 0.12em;
  cursor: pointer;
}
.couture-envelope {
  position: relative;
  width: 100%;
  perspective: 1100px;
  padding-top: 22px;
  transition: padding-top 0.65s var(--ease);
}
.couture-envelope.folded { padding-top: 4px; cursor: pointer; }
.env-shell {
  position: relative;
  border-radius: 6px;
  border: 1px solid var(--accent-line);
  background: linear-gradient(170deg, rgba(28, 23, 19, 0.94), rgba(15, 13, 11, 0.97));
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.36);
}
.env-flap {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 76px;
  transform-origin: top center;
  transform-style: preserve-3d;
  z-index: 6;
  pointer-events: none;
  transition: transform 0.72s var(--ease), opacity 0.5s ease;
}
.env-flap-fill {
  position: absolute;
  inset: 0;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  background: linear-gradient(180deg, rgba(42, 34, 28, 0.96), rgba(24, 20, 17, 0.98));
}
.env-flap-line { position: absolute; inset: 0; width: 100%; height: 100%; }
.couture-envelope:not(.folded) .env-flap { transform: rotateX(166deg); opacity: 0.45; z-index: 1; }
.couture-envelope.folded .env-flap { transform: rotateX(0deg); opacity: 1; z-index: 8; }

.wax-seal {
  position: absolute;
  left: 50%;
  top: 58px;
  transform: translateX(-50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  background: radial-gradient(circle at 35% 30%, #e7c98f 0%, #b48a47 58%, #775724 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9;
  pointer-events: none;
  transition: all 0.65s var(--ease);
}
.couture-envelope:not(.folded) .wax-seal { top: -17px; transform: translateX(-50%) scale(0.84); }

.letter-sheet {
  position: relative;
  z-index: 4;
  margin: 0 10px 10px;
  padding: 20px 18px 16px;
  border-radius: 4px;
  background: linear-gradient(170deg, rgba(35, 29, 24, 0.96), rgba(20, 17, 14, 0.98));
  border: 1px solid rgba(212, 175, 112, 0.24);
  transform: translateY(-12px);
  transition: all 0.68s var(--ease);
}
.couture-envelope.folded .letter-sheet {
  transform: translateY(16px);
  max-height: 0;
  opacity: 0;
  padding: 0;
  margin-bottom: 0;
  border-color: transparent;
  overflow: hidden;
}
.letter-text {
  font-size: 13.8px;
  line-height: 1.95;
  letter-spacing: 0.05em;
  color: rgba(246, 240, 230, 0.92);
  white-space: pre-line;
  word-break: break-word;
}
.letter-foot {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid rgba(212, 175, 112, 0.18);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.letter-date { font-family: var(--font-display); font-size: 11px; color: var(--text-muted); letter-spacing: 0.16em; }
.letter-sign { font-size: 13.5px; color: var(--accent); letter-spacing: 0.14em; }

.env-front {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 0;
  opacity: 0;
  overflow: hidden;
  transition: all 0.68s var(--ease);
}
.couture-envelope.folded .env-front { height: 140px; opacity: 1; padding: 88px 16px 16px; }
.env-front-cap { font-family: var(--font-display); font-size: 10.5px; letter-spacing: 0.26em; color: var(--accent); }
.env-front-sub { margin-top: 4px; font-size: 11.5px; color: var(--text-muted); }

/* ==================== 影像画廊 4 种特效 ==================== */
.photo-pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--accent-soft);
  margin-bottom: 14px;
}
.photo-pane-title { font-size: 16px; letter-spacing: 0.14em; }
.effect-pills { display: flex; gap: 4px; }
.ef-pill {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--accent-soft);
  background: transparent;
  color: var(--text-sub);
  font-family: var(--font-cn);
  font-size: 11px;
  cursor: pointer;
}
.ef-pill.active {
  border-color: var(--accent);
  background: rgba(212, 175, 112, 0.2);
  color: var(--text-main);
}

/* 3D 星环索引 */
.orbit-hint {
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.7;
  margin-bottom: 12px;
}
.orbit-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
}
.orbit-thumb {
  flex: 0 0 82px;
  background: #f5efe2;
  padding: 5px 5px 14px;
  border-radius: 4px;
  cursor: pointer;
  color: #2b221a;
  text-align: center;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}
.orbit-thumb img { width: 72px; height: 72px; object-fit: cover; display: block; border-radius: 2px; }
.orbit-thumb span { display: block; font-size: 10px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 心动轨迹拼图 */
.heart-canvas {
  position: relative;
  width: 100%;
  height: 330px;
  margin: 6px auto;
}
.heart-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.heart-item {
  position: absolute;
  width: 68px;
  height: 68px;
  margin: -34px 0 0 -34px;
  padding: 3px;
  background: #f7f0e2;
  border-radius: 6px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  transition: transform 0.25s ease;
}
.heart-item:hover { transform: scale(1.12) !important; z-index: 5; }
.heart-item img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; display: block; }

/* 35mm 电影胶片 */
.film-strip {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 18px 8px;
  background: linear-gradient(180deg, #171412, #0d0b0a);
  border-top: 8px dashed rgba(212, 175, 112, 0.28);
  border-bottom: 8px dashed rgba(212, 175, 112, 0.28);
  border-radius: 6px;
}
.film-frame {
  flex: 0 0 210px;
  scroll-snap-align: center;
  background: #1e1915;
  border: 1px solid var(--accent-soft);
  border-radius: 4px;
  padding: 8px;
  cursor: pointer;
}
.film-frame img { width: 100%; height: 220px; object-fit: cover; border-radius: 2px; display: block; }
.film-cap {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--accent);
}

/* 拍立得叠层抽卡 */
.polaroid-deck {
  position: relative;
  width: min(260px, 76vw);
  height: 320px;
  margin: 8px auto 12px;
  perspective: 900px;
}
.polaroid-card {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #fbf6ec, #ede3d1);
  border: 1px solid rgba(212, 175, 112, 0.45);
  border-radius: 8px;
  padding: 12px 12px 44px;
  color: #2b2219;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.45);
  transition: transform 0.42s var(--ease), opacity 0.42s ease;
  cursor: pointer;
}
.polaroid-card img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; display: block; }
.polaroid-cap {
  position: absolute;
  left: 12px; right: 12px; bottom: 12px;
  text-align: center;
  font-size: 12.5px;
  letter-spacing: 0.08em;
}
.polaroid-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  font-size: 12px;
  color: var(--text-sub);
}
.polaroid-nav button {
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid var(--accent-soft);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-family: var(--font-cn);
  font-size: 11.5px;
}

/* ==================== 亲声语音黑胶播放器 ==================== */
.voice-stage { text-align: center; padding: 8px 4px; }
.voice-title { font-size: 17px; letter-spacing: 0.14em; margin-bottom: 18px; }
.vinyl-hero {
  position: relative;
  width: 176px;
  height: 176px;
  margin: 0 auto 20px;
}
.vinyl-ring-outer {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 1.5px solid var(--accent-line);
  background: radial-gradient(circle, #141110 26%, #2b231b 28%, #151210 34%, #241d17 52%, #110f0d 72%, #2b231b 96%);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
}
.vinyl-hero.playing .vinyl-ring-outer { animation: spin 7s linear infinite; }
.vinyl-label {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  background: radial-gradient(circle at 35% 30%, #e7c98f, #9c7435);
  color: #1f1407;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 0.16em;
  font-weight: 600;
}
.tonearm {
  position: absolute;
  right: -8px;
  top: -6px;
  width: 10px;
  height: 78px;
  border-radius: 6px;
  background: linear-gradient(180deg, var(--accent), #7c5f32);
  transform-origin: top center;
  transform: rotate(12deg);
  transition: transform 0.5s var(--ease);
}
.vinyl-hero.playing .tonearm { transform: rotate(26deg); }

.voice-viz {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 46px;
  margin: 0 auto 18px;
}
.voice-viz i {
  display: block;
  width: 3px;
  height: 8px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--grad-1), var(--accent));
  transition: height 0.08s linear;
}
.voice-controls { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.voice-play-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 26px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: linear-gradient(135deg, rgba(212, 175, 112, 0.25), rgba(212, 175, 112, 0.09));
  color: var(--text-main);
  font-family: var(--font-cn);
  font-size: 13px;
  letter-spacing: 0.14em;
  cursor: pointer;
}
.voice-time { font-family: var(--font-sans); font-size: 11.5px; color: var(--text-muted); letter-spacing: 0.08em; }

/* ==================== 移动端底部 Dock & 抽屉响应式 ==================== */
.mobile-dock { display: none; }

@media (max-width: 959px), (hover: none) and (max-width: 1024px) {
  .hide-sm { display: none; }
}

/* 手机端或开启手机模拟框时的移动端布局 */
@media (max-width: 959px) {
  .studio-bg {
    background: radial-gradient(circle at 50% 34%, var(--bg-center) 0%, var(--bg-edge) 74%);
  }
  .cake-dock {
    left: 50%;
    bottom: calc(68px + env(safe-area-inset-bottom));
    width: calc(100% - 24px);
    max-width: 440px;
  }
  .cake-bar {
    justify-content: flex-start;
    padding: 4px 10px;
  }
  body.tab-not-cake .cake-dock {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(16px);
  }
  .content-panel {
    left: 10px;
    right: 10px;
    top: auto;
    bottom: calc(66px + env(safe-area-inset-bottom));
    width: auto;
    height: min(64dvh, 520px);
    transform: translateY(115%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.42s var(--ease), opacity 0.35s ease;
    border-radius: 16px;
  }
  body.tab-not-cake .content-panel {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  /* 影像页时：抽屉压缩到底部只留特效切换与索引条，让用户完整欣赏绕蛋糕旋转的3D照片墙 */
  body.tab-photo-compact .content-panel {
    height: auto;
    max-height: 220px;
  }
  .panel-header-mobile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px 8px;
    border-bottom: 1px solid var(--accent-soft);
    position: relative;
  }
  .panel-grab {
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 34px;
    height: 3px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.22);
  }
  .panel-title-sm { font-size: 12.5px; letter-spacing: 0.14em; color: var(--accent); padding-top: 4px; }
  .panel-close-sm {
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--accent-soft);
    background: transparent;
    color: var(--text-sub);
    font-family: var(--font-cn);
    font-size: 11px;
    cursor: pointer;
  }
  .panel-desktop-tabs { display: none; }
  .panel-scroll { padding: 14px 16px 20px; }

  .mobile-dock {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: max(10px, env(safe-area-inset-bottom));
    z-index: 40;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 4px;
    border-radius: 999px;
    background: var(--glass-strong);
    border: 1px solid var(--accent-line);
    backdrop-filter: blur(18px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s ease;
  }
  .mobile-dock.visible { opacity: 1; pointer-events: auto; }
  .dock-btn {
    flex: 1;
    height: 100%;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--text-sub);
    font-family: var(--font-cn);
    font-size: 11.5px;
    letter-spacing: 0.08em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    transition: all 0.24s var(--ease);
  }
  .dock-btn[hidden] { display: none; }
  .dock-btn.active {
    color: var(--text-main);
    background: linear-gradient(135deg, rgba(212, 175, 112, 0.28), rgba(212, 175, 112, 0.1));
  }
}

/* 桌面端手动开启“手机视口模拟框”时强制走移动端排版 */
body.phone-frame .hide-sm { display: none; }
body.phone-frame .cake-dock { left: 50%; bottom: 72px; width: calc(100% - 24px); }
body.phone-frame .cake-bar { justify-content: flex-start; padding: 4px 10px; }
body.phone-frame.tab-not-cake .cake-dock { opacity: 0; pointer-events: none; }
body.phone-frame .content-panel {
  left: 10px; right: 10px; top: auto; bottom: 68px; width: auto; height: 500px;
  transform: translateY(115%); opacity: 0; pointer-events: none;
  transition: transform 0.42s var(--ease), opacity 0.35s ease; border-radius: 16px;
}
body.phone-frame.tab-not-cake .content-panel { transform: translateY(0); opacity: 1; pointer-events: auto; }
body.phone-frame.tab-photo-compact .content-panel { height: auto; max-height: 220px; }
body.phone-frame .panel-header-mobile { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px 8px; border-bottom: 1px solid var(--accent-soft); position: relative; }
body.phone-frame .panel-desktop-tabs { display: none; }
body.phone-frame .mobile-dock {
  position: absolute; left: 12px; right: 12px; bottom: 10px; z-index: 40; height: 52px;
  display: flex; align-items: center; justify-content: space-around; padding: 4px;
  border-radius: 999px; background: var(--glass-strong); border: 1px solid var(--accent-line);
}

/* ==================== 全屏灯箱 & Toast ==================== */
.lightbox {
  position: absolute;
  inset: 0;
  z-index: 90;
  background: rgba(5, 4, 4, 0.94);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.lightbox[hidden] { display: none; }
.lb-figure { max-width: 90%; max-height: 82%; text-align: center; }
.lb-figure img { max-width: 100%; max-height: 70dvh; border-radius: 6px; border: 1px solid var(--accent-line); }
.lb-figure figcaption { margin-top: 12px; font-size: 13px; color: var(--text-sub); letter-spacing: 0.1em; }
.lb-close {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--accent-line);
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 52px;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: var(--accent);
  font-size: 28px;
  border-radius: 8px;
  cursor: pointer;
}
.lb-prev { left: 10px; }
.lb-next { right: 10px; }

#toast {
  position: absolute;
  top: max(62px, calc(env(safe-area-inset-top) + 48px));
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  z-index: 96;
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--glass-strong);
  border: 1px solid var(--accent-line);
  color: var(--text-main);
  font-size: 12px;
  letter-spacing: 0.12em;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.3s, transform 0.3s var(--ease);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
