:root {
  --bg-deep: #040b0e;
  --bg-pine: #0b1e1b;
  --emerald: #14533c;
  --emerald-bright: #1e7454;
  --gold: #e3be74;
  --gold-bright: #ffd984;
  --gold-soft: rgba(255, 214, 122, 0.25);
  --wine: #7a1c24;
  --wine-deep: #4e1016;
  --parchment: #fff9f0;
  --parchment-edge: #ecdcc2;
  --ink: #2c211b;
  --ink-muted: #6e5c52;
  --glass: rgba(6, 16, 18, 0.76);
  --glass-elevated: rgba(8, 22, 24, 0.88);
  --glass-border: rgba(227, 190, 116, 0.34);
  --glass-border-strong: rgba(255, 217, 132, 0.68);
  --text-light: #f9f3e7;
  --text-muted: #b8c6be;
  --danger: #e26d6d;
  --font-serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "STSong", Georgia, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(circle at 50% 35%, #112a25 0%, #09171a 48%, #040a10 100%);
  color: var(--text-light);
  font-family: var(--font-sans);
  user-select: none;
}

.hidden {
  display: none !important;
}

/* 3D 画布与浮动标签层 */
#canvas-container {
  position: fixed;
  inset: 0;
  z-index: 1;
  touch-action: none;
}

#canvas-container canvas {
  display: block;
  width: 100%;
  height: 100%;
}

#label-layer {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  overflow: hidden;
}

.floating-name-badge {
  position: absolute;
  transform: translate(-50%, -125%);
  padding: 4px 10px;
  border-radius: 999px;
  background: linear-gradient(145deg, rgba(10, 24, 24, 0.82) 0%, rgba(6, 16, 18, 0.76) 100%);
  border: 1px solid rgba(227, 190, 116, 0.42);
  color: #f7e4b6;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: 0.04em;
  white-space: nowrap;
  pointer-events: auto;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.48), 0 0 12px rgba(227, 190, 116, 0.16), inset 0 1px 0 rgba(255, 240, 200, 0.14);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.floating-name-badge:hover,
.floating-name-badge.active,
.floating-name-badge.hovered,
.floating-name-badge.focused {
  transform: translate(-50%, -125%) scale(1.07);
  background: linear-gradient(145deg, rgba(16, 38, 34, 0.92) 0%, rgba(8, 20, 22, 0.9) 100%);
  border-color: rgba(255, 217, 132, 0.86);
  color: var(--gold-bright);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.56), 0 0 18px rgba(255, 214, 122, 0.35), inset 0 1px 0 rgba(255, 246, 214, 0.26);
  z-index: 6;
}

.floating-name-badge:active {
  transform: translate(-50%, -125%) scale(0.98);
}

/* 顶部 HUD */
.hud-top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) 12px 12px;
  background: linear-gradient(180deg, rgba(4, 10, 14, 0.82) 0%, rgba(4, 10, 14, 0.28) 64%, rgba(4, 10, 14, 0) 100%);
  pointer-events: none;
}

.hud-top > * {
  pointer-events: auto;
}

.brand-cluster {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}

.star-trigger {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 11px;
  border: 1px solid var(--glass-border);
  background: linear-gradient(145deg, rgba(12, 30, 28, 0.84) 0%, rgba(6, 16, 18, 0.76) 100%);
  color: var(--gold-bright);
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4), 0 0 18px rgba(255, 214, 122, 0.16), inset 0 1px 0 rgba(255, 240, 200, 0.14);
  transition: transform 0.15s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.star-trigger:hover {
  border-color: var(--glass-border-strong);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5), 0 0 22px rgba(255, 214, 122, 0.28);
}

.star-trigger:active {
  transform: scale(0.9);
}

.brand-texts {
  min-width: 0;
}

.tree-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text-light);
  letter-spacing: 0.04em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.68);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tree-subtitle {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--gold);
  opacity: 0.92;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.icon-pill-btn,
.pill-btn {
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: linear-gradient(145deg, rgba(12, 28, 28, 0.82) 0%, rgba(6, 16, 18, 0.76) 100%);
  color: var(--text-light);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  white-space: nowrap;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 240, 200, 0.12);
  transition: transform 0.15s ease, background 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, color 0.22s ease;
}

.icon-pill-btn {
  width: 34px;
  font-size: 15px;
}

.icon-pill-btn.muted {
  opacity: 0.74;
}

.pill-btn {
  padding: 0 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.pill-btn.share-invite-btn {
  width: 34px;
  padding: 0;
  font-size: 14px;
}

.pill-btn.active {
  border-color: rgba(255, 217, 132, 0.9);
  background: linear-gradient(135deg, rgba(255, 224, 148, 0.28) 0%, rgba(196, 144, 52, 0.34) 100%);
  color: #ffeaad;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45), 0 0 18px rgba(255, 214, 122, 0.35), inset 0 1px 0 rgba(255, 246, 214, 0.35);
}

.pill-btn.gold-outline {
  border-color: rgba(255, 214, 122, 0.65);
  color: var(--gold-bright);
  background: linear-gradient(145deg, rgba(44, 34, 14, 0.84) 0%, rgba(22, 18, 10, 0.8) 100%);
  padding: 0 9px;
}

.icon-pill-btn:hover,
.pill-btn:hover {
  border-color: var(--gold-bright);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.48), 0 0 14px rgba(227, 190, 116, 0.24), inset 0 1px 0 rgba(255, 244, 214, 0.2);
}

.icon-pill-btn:active,
.pill-btn:active {
  transform: scale(0.95);
}

.btn-label-desktop {
  display: none;
}

@media (min-width: 640px) {
  .hud-top {
    gap: 12px;
    padding: calc(14px + env(safe-area-inset-top)) 20px 14px;
  }
  .brand-cluster {
    gap: 10px;
  }
  .star-trigger {
    width: 38px;
    height: 38px;
    font-size: 18px;
  }
  .top-actions {
    gap: 8px;
  }
  .icon-pill-btn,
  .pill-btn {
    height: 38px;
  }
  .icon-pill-btn {
    width: 38px;
    font-size: 16px;
  }
  .pill-btn,
  .pill-btn.gold-outline {
    padding: 0 14px;
    font-size: 13px;
  }
  .pill-btn.share-invite-btn {
    width: auto;
    padding: 0 13px;
    font-size: 13px;
  }
  .btn-label-desktop {
    display: inline;
  }
  .tree-title {
    font-size: 20px;
  }
  .tree-subtitle {
    font-size: 12px;
  }
}

/* 选位提示横幅 */
.placement-banner {
  position: fixed;
  top: calc(74px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 22;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(12, 32, 26, 0.86);
  border: 1px solid rgba(255, 214, 122, 0.55);
  color: var(--gold-bright);
  font-size: 13px;
  white-space: nowrap;
  max-width: calc(100vw - 32px);
  overflow: hidden;
  text-overflow: ellipsis;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.45);
}

.banner-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold-bright);
  box-shadow: 0 0 10px var(--gold-bright);
  animation: pulseDot 1.4s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { opacity: 0.45; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* 底部悬浮操作栏 */
.hud-bottom {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 16px calc(18px + env(safe-area-inset-bottom));
  background: linear-gradient(0deg, rgba(4, 10, 16, 0.78) 0%, rgba(4, 10, 16, 0) 100%);
  pointer-events: none;
}

.hud-bottom > * {
  pointer-events: auto;
}

.cta-primary-btn,
.cta-glass-btn {
  min-height: 46px;
  padding: 0 20px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  border: none;
  transition: transform 0.16s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.cta-primary-btn {
  background: linear-gradient(135deg, #ffeaad 0%, #e5b762 52%, #c98f32 100%);
  color: #241507;
  box-shadow: 0 10px 26px rgba(227, 190, 116, 0.34), inset 0 1px 0 rgba(255, 252, 236, 0.68);
}

.cta-primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(255, 214, 122, 0.46), inset 0 1px 0 rgba(255, 252, 236, 0.78);
}

.cta-primary-btn:active,
.cta-glass-btn:active {
  transform: scale(0.97);
}

.cta-primary-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.cta-glass-btn {
  background: linear-gradient(145deg, rgba(10, 26, 26, 0.82) 0%, rgba(6, 16, 18, 0.76) 100%);
  color: var(--text-light);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 240, 200, 0.12);
}

.cta-glass-btn:hover {
  border-color: var(--gold-bright);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 16px rgba(227, 190, 116, 0.2);
}

@media (max-width: 479px) {
  .hud-bottom {
    gap: 10px;
    padding: 12px 12px calc(16px + env(safe-area-inset-bottom));
  }
  .cta-primary-btn,
  .cta-glass-btn {
    padding: 0 16px;
    font-size: 14px;
    min-height: 44px;
  }
}

.cta-primary-btn.compact,
.cta-glass-btn.compact {
  padding: 0 14px;
  font-size: 13px;
  min-height: 44px;
}

.full-width {
  width: 100%;
}

/* 开场红金火漆信封 */
.overlay-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(circle at 50% 34%, rgba(12, 36, 32, 0.92) 0%, rgba(4, 10, 14, 0.97) 100%);
  backdrop-filter: blur(12px);
  transition: opacity 0.55s ease, visibility 0.55s ease;
}

.overlay-backdrop.closing {
  opacity: 0;
  pointer-events: none;
}

.envelope-stage {
  width: 100%;
  max-width: 390px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: fadeUpIn 0.7s ease;
}

.envelope-kicker {
  margin: 0 0 8px;
  font-size: 11px;
  letter-spacing: 0.24em;
  color: var(--gold);
  opacity: 0.9;
}

.envelope-heading {
  margin: 0 0 26px;
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-light);
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.6);
}

.wax-envelope {
  position: relative;
  width: 310px;
  height: 204px;
  cursor: pointer;
  perspective: 1000px;
  filter: drop-shadow(0 24px 44px rgba(0, 0, 0, 0.72)) drop-shadow(0 0 26px rgba(227, 190, 116, 0.14));
  transition: transform 0.28s ease, filter 0.28s ease;
}

.wax-envelope:hover {
  transform: translateY(-4px);
  filter: drop-shadow(0 28px 48px rgba(0, 0, 0, 0.76)) drop-shadow(0 0 34px rgba(255, 214, 122, 0.22));
}

.env-back {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: linear-gradient(155deg, #5c131a 0%, #3d0b10 100%);
  border: 1px solid rgba(227, 190, 116, 0.45);
}

.env-letter-peek {
  position: absolute;
  left: 16px;
  right: 16px;
  top: 14px;
  height: 150px;
  border-radius: 10px;
  background: linear-gradient(180deg, #fffaf1 0%, #f5e6cf 100%);
  border: 1px solid #dfd0b8;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 22px;
  color: #5b3b28;
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
  transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 2;
}

.env-pocket-left,
.env-pocket-right,
.env-pocket-bottom {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  z-index: 3;
  pointer-events: none;
}

.env-pocket-left {
  background: linear-gradient(135deg, #831f28 0%, #5c1219 100%);
  clip-path: polygon(0 0, 52% 52%, 0 100%);
}

.env-pocket-right {
  background: linear-gradient(225deg, #7c1c25 0%, #561017 100%);
  clip-path: polygon(100% 0, 48% 52%, 100% 100%);
}

.env-pocket-bottom {
  background: linear-gradient(0deg, #6b151d 0%, #8c232d 100%);
  clip-path: polygon(0 100%, 50% 44%, 100% 100%);
}

.env-gold-trim {
  position: absolute;
  inset: 6px;
  border-radius: 10px;
  border: 1px solid rgba(255, 217, 132, 0.44);
  box-shadow: inset 0 0 18px rgba(255, 214, 122, 0.12);
  z-index: 4;
  pointer-events: none;
}

.env-flap {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 118px;
  background: linear-gradient(180deg, #982530 0%, #6d151d 100%);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  border-top-left-radius: 14px;
  border-top-right-radius: 14px;
  transform-origin: top center;
  transition: transform 0.65s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 5;
  box-shadow: inset 0 2px 0 rgba(255, 214, 122, 0.45);
}

.wax-seal {
  position: absolute;
  left: 50%;
  top: 106px;
  transform: translate(-50%, -50%);
  width: 66px;
  height: 66px;
  border-radius: 50%;
  border: 2px solid #ffe7a3;
  background: radial-gradient(circle at 35% 30%, #ffe69c 0%, #d9a441 55%, #9f6d1e 100%);
  color: #4f1419;
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 6;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45), 0 0 22px rgba(255, 214, 122, 0.45);
  transition: transform 0.45s ease, opacity 0.45s ease;
  animation: sealBreathe 2.4s ease-in-out infinite;
}

.seal-ring {
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  border: 1px solid rgba(92, 24, 29, 0.34);
  pointer-events: none;
}

@keyframes sealBreathe {
  0%, 100% { box-shadow: 0 8px 20px rgba(0,0,0,0.45), 0 0 18px rgba(255,214,122,0.38); }
  50% { box-shadow: 0 8px 24px rgba(0,0,0,0.45), 0 0 30px rgba(255,214,122,0.75); }
}

.wax-envelope.opened .env-flap {
  transform: rotateX(175deg);
  z-index: 1;
}

.wax-envelope.opened .wax-seal {
  opacity: 0;
  transform: translate(-50%, -50%) scale(1.25);
  pointer-events: none;
}

.wax-envelope.opened .env-letter-peek {
  transform: translateY(-48px);
}

.envelope-tap-hint {
  margin: 22px 0 10px;
  font-size: 13px;
  color: var(--gold-bright);
  letter-spacing: 0.04em;
}

.text-link-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  padding: 8px 14px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* 羊皮纸贺卡正文卡片 */
.parchment-letter {
  position: relative;
  width: 100%;
  max-width: 420px;
  padding: 28px 24px 24px;
  border-radius: 18px;
  background: linear-gradient(175deg, #fffbf4 0%, #f8ebd6 100%);
  color: var(--ink);
  border: 1px solid #e3c99b;
  box-shadow: 0 26px 64px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.6) inset;
  animation: fadeUpIn 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  max-height: 86vh;
  overflow-y: auto;
}

.letter-corner {
  position: absolute;
  width: 18px;
  height: 18px;
  border-color: #c99746;
  border-style: solid;
  pointer-events: none;
}

.letter-corner.tl { top: 10px; left: 10px; border-width: 1.5px 0 0 1.5px; }
.letter-corner.tr { top: 10px; right: 10px; border-width: 1.5px 1.5px 0 0; }
.letter-corner.bl { bottom: 10px; left: 10px; border-width: 0 0 1.5px 1.5px; }
.letter-corner.br { bottom: 10px; right: 10px; border-width: 0 1.5px 1.5px 0; }

.letter-header {
  text-align: center;
  margin-bottom: 14px;
}

.letter-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(122, 28, 36, 0.08);
  border: 1px solid rgba(122, 28, 36, 0.22);
  color: #7a1c24;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
}

.letter-salutation {
  margin: 0 0 12px;
  font-family: var(--font-serif);
  font-size: 18px;
  color: #4f181d;
}

.letter-body {
  margin: 0 0 18px;
  font-family: var(--font-serif);
  font-size: 15.5px;
  line-height: 1.85;
  color: #362922;
  white-space: pre-wrap;
}

.letter-signoff {
  text-align: right;
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  color: #6b1a22;
  margin-bottom: 22px;
}

.signoff-dash {
  margin-right: 6px;
  opacity: 0.7;
}

/* 抽屉与弹窗通用样式 */
.sheet-backdrop,
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  background: rgba(3, 8, 13, 0.66);
  backdrop-filter: blur(6px);
  animation: fadeIn 0.2s ease;
}

.sheet-backdrop {
  align-items: flex-end;
  justify-content: center;
}

.modal-backdrop {
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.sheet-panel {
  width: 100%;
  max-width: 540px;
  max-height: 86vh;
  background: linear-gradient(175deg, rgba(10, 26, 26, 0.94) 0%, rgba(6, 16, 18, 0.98) 100%);
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  border: 1px solid var(--glass-border);
  border-bottom: none;
  box-shadow: 0 -16px 48px rgba(0, 0, 0, 0.72), 0 0 0 1px rgba(255, 240, 200, 0.06) inset;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom);
  animation: slideUpSheet 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (min-width: 640px) {
  .sheet-backdrop {
    align-items: center;
    padding: 20px;
  }
  .sheet-panel {
    border-radius: 24px;
    border-bottom: 1px solid var(--glass-border);
    max-height: 84vh;
  }
}

.sheet-handle {
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  margin: 10px auto 2px;
}

.sheet-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sheet-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 18px;
  color: var(--text-light);
}

.sheet-subtitle {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

.sheet-body {
  padding: 16px 20px 22px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.close-circle-btn {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-light);
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.close-circle-btn.dark {
  position: absolute;
  top: 14px;
  right: 14px;
  border-color: rgba(44, 33, 27, 0.18);
  background: rgba(44, 33, 27, 0.07);
  color: var(--ink);
}

/* 表单字段 */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--gold);
}

.field-hint {
  font-size: 12px;
  color: var(--text-muted);
}

input[type="text"],
input[type="password"],
input[type="search"],
textarea {
  width: 100%;
  padding: 11px 13px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(4, 12, 14, 0.6);
  color: var(--text-light);
  font-family: var(--font-sans);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  user-select: text;
}

input:focus,
textarea:focus {
  border-color: var(--gold-bright);
  box-shadow: 0 0 0 3px rgba(255, 214, 122, 0.16);
}

textarea {
  resize: vertical;
  line-height: 1.55;
}

/* 8 款造型网格 & 5 种配色 */
.shape-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.shape-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px 4px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.15s ease;
}

.shape-card.selected {
  border-color: var(--gold-bright);
  background: rgba(255, 214, 122, 0.14);
  color: var(--gold-bright);
  box-shadow: 0 0 14px rgba(255, 214, 122, 0.18);
}

.shape-card svg {
  width: 32px;
  height: 32px;
}

.shape-card span {
  font-size: 11px;
}

.color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.color-swatch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-light);
  font-size: 12px;
  cursor: pointer;
}

.color-swatch.selected {
  border-color: var(--gold-bright);
  background: rgba(255, 214, 122, 0.14);
}

.swatch-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.45);
}

.inspiration-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.inspiration-label {
  font-size: 11.5px;
  color: var(--text-muted);
}

.inspiration-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip-btn {
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 214, 122, 0.25);
  background: rgba(255, 214, 122, 0.08);
  color: var(--gold);
  font-size: 11.5px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.chip-btn:hover {
  background: rgba(255, 214, 122, 0.18);
}

.compose-actions {
  display: flex;
  gap: 10px;
  padding-top: 4px;
}

.compose-actions > button {
  flex: 1;
}

/* 祝福名册 */
.roster-panel {
  height: 76vh;
}

.roster-search-wrap {
  padding: 12px 20px 6px;
}

.roster-list {
  padding: 8px 20px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.roster-item {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-light);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.roster-item:hover {
  border-color: var(--gold);
  background: rgba(255, 214, 122, 0.08);
}

.roster-item-icon {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
}

.roster-item-icon svg {
  width: 26px;
  height: 26px;
}

.roster-item-body {
  flex: 1;
  min-width: 0;
}

.roster-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.roster-item-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--gold-bright);
}

.roster-item-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

.reply-pill {
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 214, 122, 0.18);
  color: var(--gold-bright);
}

.roster-item-msg {
  margin: 0;
  font-size: 13px;
  color: rgba(249, 243, 231, 0.85);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.empty-state {
  text-align: center;
  padding: 36px 16px;
  color: var(--text-muted);
  font-size: 14px;
}

/* 祝福详情羊皮纸弹窗 */
.parchment-modal {
  position: relative;
  width: 100%;
  max-width: 400px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 24px 22px 22px;
  border-radius: 20px;
  background: linear-gradient(175deg, #fffbf4 0%, #f7e9d3 100%);
  color: var(--ink);
  border: 1px solid #e3c898;
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.65);
  animation: fadeUpIn 0.25s ease;
}

.detail-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 30px;
  margin-bottom: 14px;
}

.detail-icon-badge {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 14px;
  background: rgba(20, 83, 60, 0.1);
  border: 1px solid rgba(20, 83, 60, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.detail-icon-badge svg {
  width: 32px;
  height: 32px;
}

.detail-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.detail-nickname {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 18px;
  color: #4f181d;
}

.detail-tag {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(122, 28, 36, 0.1);
  color: #7a1c24;
  font-size: 11px;
  font-weight: 600;
}

.detail-time {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: var(--ink-muted);
}

.detail-message {
  margin: 0 0 16px;
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.78;
  color: #2f231c;
  white-space: pre-wrap;
  user-select: text;
}

.owner-reply-box {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(227, 190, 116, 0.22);
  border: 1px solid rgba(185, 134, 48, 0.4);
  margin-bottom: 14px;
}

.reply-box-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  color: #7a4b10;
  margin-bottom: 6px;
}

.reply-time {
  font-weight: 400;
  opacity: 0.75;
}

.reply-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  color: #3f2b14;
  white-space: pre-wrap;
}

.detail-action-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.owner-reply-editor {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed rgba(44, 33, 27, 0.2);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.owner-editor-label {
  font-size: 12px;
  font-weight: 700;
  color: #6b1a22;
}

.owner-reply-editor textarea {
  background: #fffdf9;
  color: var(--ink);
  border-color: rgba(44, 33, 27, 0.2);
}

.mini-btn {
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
}

.mini-btn.warm {
  background: rgba(20, 83, 60, 0.12);
  color: #124934;
  border-color: rgba(20, 83, 60, 0.25);
}

.mini-btn.gold {
  background: linear-gradient(135deg, #ffe298 0%, #dca648 100%);
  color: #301b08;
}

.mini-btn.danger {
  background: rgba(185, 48, 48, 0.12);
  color: #9e2222;
  border-color: rgba(185, 48, 48, 0.25);
}

.mini-btn.subtle {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  border-color: rgba(255, 255, 255, 0.14);
}

/* 回礼签卡片弹窗 */
.gift-fortune-card {
  position: relative;
  width: 100%;
  max-width: 390px;
  padding: 28px 22px 22px;
  border-radius: 22px;
  background: linear-gradient(165deg, rgba(12, 34, 30, 0.95) 0%, rgba(6, 16, 18, 0.98) 100%);
  border: 1px solid rgba(255, 217, 132, 0.58);
  box-shadow: 0 28px 68px rgba(0, 0, 0, 0.78), 0 0 48px rgba(227, 190, 116, 0.22), inset 0 1px 0 rgba(255, 242, 204, 0.18);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  text-align: center;
  overflow: hidden;
  animation: fadeUpIn 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.gift-glow-ring {
  position: absolute;
  top: -70px;
  left: 50%;
  transform: translateX(-50%);
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 214, 122, 0.28) 0%, rgba(255, 214, 122, 0) 70%);
  pointer-events: none;
}

.gift-kicker {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--gold-bright);
  margin-bottom: 6px;
}

.gift-heading {
  margin: 0 0 18px;
  font-family: var(--font-serif);
  font-size: 19px;
  color: var(--text-light);
}

.gift-ticket {
  position: relative;
  padding: 20px 18px;
  border-radius: 16px;
  background: linear-gradient(175deg, #fffaf0 0%, #f5e5ca 100%);
  color: var(--ink);
  border: 1px dashed #c89444;
  margin-bottom: 20px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.gift-ticket-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: #7a1c24;
  color: #ffe8ad;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.gift-quote-text {
  margin: 0 0 14px;
  font-family: var(--font-serif);
  font-size: 16.5px;
  line-height: 1.78;
  color: #38271e;
}

.gift-ticket-sign {
  text-align: right;
  font-family: var(--font-serif);
  font-size: 13.5px;
  font-weight: 600;
  color: #7a1c24;
}

/* 玻璃弹窗 & 主人工作台 */
.glass-modal {
  position: relative;
  width: 100%;
  max-width: 360px;
  padding: 24px 20px 22px;
  border-radius: 20px;
  background: linear-gradient(175deg, rgba(10, 26, 26, 0.94) 0%, rgba(6, 16, 18, 0.98) 100%);
  border: 1px solid var(--glass-border);
  box-shadow: 0 24px 58px rgba(0, 0, 0, 0.74), inset 0 1px 0 rgba(255, 240, 200, 0.1);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.glass-modal .close-circle-btn {
  position: absolute;
  top: 14px;
  right: 14px;
}

.modal-title {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: 18px;
  color: var(--gold-bright);
}

.modal-desc {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-muted);
}

.admin-auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-sheet {
  height: 84vh;
}

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

.admin-tabs {
  display: flex;
  gap: 6px;
  padding: 10px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-tab {
  flex: 1;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.admin-tab.active {
  border-color: var(--gold-bright);
  background: rgba(255, 214, 122, 0.15);
  color: var(--gold-bright);
}

.admin-tab-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 28px;
}

.admin-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.add-quote-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-card {
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}

.admin-card-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.admin-quote-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-card .mini-btn.danger {
  background: rgba(226, 109, 109, 0.16);
  color: #ffb0b0;
  border-color: rgba(226, 109, 109, 0.35);
}

.admin-card .mini-btn.warm {
  background: rgba(255, 214, 122, 0.16);
  color: var(--gold-bright);
  border-color: rgba(255, 214, 122, 0.35);
}

/* Toast 提示 */
.toast-container {
  position: fixed;
  top: calc(68px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: calc(100vw - 32px);
  max-width: 380px;
}

.toast {
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(6, 16, 18, 0.88);
  border: 1px solid rgba(255, 217, 132, 0.48);
  color: var(--text-light);
  font-size: 13px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55), 0 0 16px rgba(227, 190, 116, 0.16);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: fadeUpIn 0.22s ease;
  text-align: center;
}

.toast.error {
  border-color: rgba(226, 109, 109, 0.65);
  color: #ffd0d0;
}

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

@keyframes fadeUpIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUpSheet {
  from { transform: translateY(28px); opacity: 0.6; }
  to { transform: translateY(0); opacity: 1; }
}
