:root {
  --bg-deep: #0b1326;
  --glass-bg: rgba(18, 25, 48, 0.72);
  --glass-border: rgba(255, 222, 148, 0.36);
  --gold: #ffd97d;
  --gold-soft: #ffe8b3;
  --berry: #d94148;
  --pine: #2e7d5b;
  --cream: #fff7e6;
  --text-muted: rgba(255, 247, 230, 0.76);
  --shadow-lg: 0 18px 46px rgba(5, 9, 24, 0.55);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-deep);
  color: var(--cream);
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, sans-serif;
  user-select: none;
}

#canvas-container {
  position: fixed;
  inset: 0;
  z-index: 1;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.hidden {
  display: none !important;
}

/* Top HUD */
.hud-top {
  position: fixed;
  top: 14px;
  left: 16px;
  right: 16px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
  flex-wrap: wrap;
}

.brand-badge {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 15px;
  border-radius: 16px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-lg);
}

.brand-icon {
  font-size: 24px;
  filter: drop-shadow(0 0 8px rgba(255, 217, 125, 0.65));
}

.brand-badge h1 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--gold);
}

.brand-badge p {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.world-nav {
  pointer-events: auto;
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  padding: 6px;
  border-radius: 999px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-lg);
}

.nav-pill {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--cream);
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-pill:hover {
  background: rgba(255, 217, 125, 0.16);
  border-color: rgba(255, 217, 125, 0.35);
}

.nav-pill.active {
  background: linear-gradient(135deg, #d94148, #b52b34);
  border-color: rgba(255, 224, 153, 0.7);
  color: #fff;
  box-shadow: 0 4px 14px rgba(217, 65, 72, 0.45);
}

/* Hover Tooltip */
.hover-tooltip {
  position: fixed;
  z-index: 30;
  pointer-events: none;
  padding: 6px 11px;
  border-radius: 10px;
  background: rgba(15, 20, 42, 0.88);
  border: 1px solid rgba(255, 217, 125, 0.55);
  color: var(--gold-soft);
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  transform: translate(14px, 14px);
  white-space: nowrap;
}

/* Gingerbread Speech Bubble */
.speech-bubble {
  position: fixed;
  top: 96px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 28;
  max-width: 360px;
  padding: 12px 18px;
  border-radius: 18px;
  background: rgba(255, 248, 232, 0.95);
  color: #5b2c16;
  border: 2px solid #e09f5a;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  text-align: center;
  animation: popIn 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.bubble-title {
  font-size: 13px;
  font-weight: 800;
  color: #b53a2a;
  margin-bottom: 3px;
}

.bubble-text {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
}

@keyframes popIn {
  from { opacity: 0; transform: translate(-50%, 10px) scale(0.92); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

/* Action Toast */
.action-toast {
  position: fixed;
  top: 86px;
  right: 20px;
  z-index: 27;
  max-width: 320px;
  padding: 10px 15px;
  border-radius: 14px;
  background: rgba(24, 34, 62, 0.88);
  border: 1px solid rgba(255, 217, 125, 0.55);
  color: var(--gold-soft);
  font-size: 13px;
  line-height: 1.45;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(10px);
}

/* Bottom HUD */
.hud-bottom {
  position: fixed;
  bottom: 14px;
  left: 16px;
  right: 16px;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
  flex-wrap: wrap;
}

.guide-card {
  pointer-events: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  max-width: 820px;
  padding: 9px 14px;
  border-radius: 14px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-lg);
}

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

.guide-chip b {
  color: var(--gold);
}

.bottom-actions {
  pointer-events: auto;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-primary, .btn-secondary, .btn-ghost {
  appearance: none;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 15px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-primary {
  border: 1px solid rgba(255, 224, 153, 0.7);
  background: linear-gradient(135deg, #d94148, #ab252e);
  color: #fff;
  box-shadow: 0 6px 18px rgba(217, 65, 72, 0.42);
}

.btn-secondary {
  border: 1px solid rgba(255, 224, 153, 0.7);
  background: linear-gradient(135deg, #2e7d5b, #1d5940);
  color: #fff;
  box-shadow: 0 6px 18px rgba(46, 125, 91, 0.42);
}

.btn-ghost {
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--cream);
  backdrop-filter: blur(10px);
}

.btn-primary:hover, .btn-secondary:hover, .btn-ghost:hover {
  transform: translateY(-1px);
}

.upload-btn.small {
  padding: 6px 12px;
  font-size: 12px;
}

/* Storybook Modal */
.storybook-modal {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: min(390px, calc(100vw - 32px));
  z-index: 35;
  padding: 22px 22px 18px;
  border-radius: 22px;
  background: linear-gradient(170deg, rgba(42, 26, 20, 0.94), rgba(21, 25, 44, 0.94));
  border: 1.5px solid rgba(255, 217, 125, 0.58);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(14px);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(255, 222, 148, 0.4);
  background: rgba(255, 255, 255, 0.08);
  color: var(--cream);
  cursor: pointer;
  font-size: 14px;
}

.story-tag {
  font-size: 12px;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 6px;
}

.storybook-modal h2 {
  font-size: 20px;
  color: #fff6dc;
  margin-bottom: 10px;
}

.story-quote {
  font-size: 13.5px;
  font-style: italic;
  color: var(--gold-soft);
  padding: 8px 12px;
  border-left: 3px solid var(--gold);
  background: rgba(255, 217, 125, 0.09);
  border-radius: 0 10px 10px 0;
  margin-bottom: 12px;
  line-height: 1.5;
}

.story-body {
  font-size: 13.8px;
  line-height: 1.7;
  color: rgba(255, 247, 230, 0.92);
  margin-bottom: 16px;
}

.story-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.story-counter {
  font-size: 12.5px;
  color: var(--text-muted);
}

/* Photo Modal */
.photo-modal {
  position: fixed;
  right: 20px;
  top: 84px;
  bottom: 76px;
  width: min(410px, calc(100vw - 32px));
  z-index: 36;
  padding: 18px;
  border-radius: 22px;
  background: rgba(19, 25, 48, 0.92);
  border: 1.5px solid rgba(255, 217, 125, 0.52);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.photo-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-right: 34px;
}

.photo-modal-header h2 {
  font-size: 18px;
  color: var(--gold-soft);
}

.photo-desc {
  font-size: 12.8px;
  line-height: 1.5;
  color: var(--text-muted);
}

.upload-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.photo-grid {
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding-right: 4px;
}

.photo-item {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 217, 125, 0.25);
  border-radius: 12px;
  padding: 7px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.photo-item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  background: #1a213d;
}

.photo-item input {
  width: 100%;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 217, 125, 0.28);
  color: var(--cream);
  border-radius: 7px;
  padding: 4px 7px;
  font-size: 12px;
}

.photo-item-actions {
  display: flex;
  justify-content: space-between;
  gap: 6px;
}

.mini-btn {
  flex: 1;
  font-size: 11px;
  padding: 4px 6px;
  border-radius: 7px;
  border: 1px solid rgba(255, 217, 125, 0.35);
  background: rgba(255, 217, 125, 0.14);
  color: var(--gold-soft);
  cursor: pointer;
  text-align: center;
}

.mini-btn.danger {
  border-color: rgba(235, 92, 92, 0.45);
  background: rgba(217, 65, 72, 0.2);
  color: #ffc8c8;
}

/* Photo Lightbox */
.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(7, 10, 22, 0.72);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lightbox-card {
  position: relative;
  width: min(480px, 100%);
  background: #fff9ec;
  color: #3f2818;
  padding: 16px 16px 14px;
  border-radius: 18px;
  border: 3px solid #e7b868;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.65);
}

.lightbox-card .modal-close {
  background: #3f2818;
  color: #fff;
}

.lightbox-card img {
  width: 100%;
  max-height: 55vh;
  object-fit: contain;
  border-radius: 10px;
  background: #1a213d;
}

.lightbox-caption-row {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.lightbox-caption-row input {
  flex: 1;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1.5px solid #d4a65a;
  font-size: 13px;
  color: #3f2818;
}

/* Loading Screen */
.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: radial-gradient(circle at center, #1d294f 0%, #090e1d 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease;
}

.loading-card {
  text-align: center;
  padding: 28px 34px;
  border-radius: 24px;
  background: rgba(20, 28, 55, 0.8);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg);
}

.loading-spinner {
  font-size: 42px;
  animation: spin 3.2s linear infinite;
  margin-bottom: 10px;
}

.loading-card h2 {
  font-size: 18px;
  color: var(--gold);
  margin-bottom: 6px;
}

.loading-card p {
  font-size: 13px;
  color: var(--text-muted);
}

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

/* Name Lock Gate Screen */
.lock-screen {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: radial-gradient(circle at 50% 35%, rgba(30, 44, 88, 0.86), rgba(8, 12, 28, 0.94));
  backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lock-card {
  width: min(430px, 100%);
  padding: 28px 26px 24px;
  border-radius: 26px;
  background: linear-gradient(165deg, rgba(32, 40, 74, 0.95), rgba(18, 22, 44, 0.95));
  border: 1.5px solid rgba(255, 217, 125, 0.58);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.72);
  text-align: center;
}

.lock-emblem {
  font-size: 40px;
  margin-bottom: 10px;
  filter: drop-shadow(0 0 12px rgba(255, 217, 125, 0.55));
}

.lock-card h2 {
  font-size: 20px;
  color: var(--gold);
  margin-bottom: 8px;
}

.lock-subtitle {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.lock-hint {
  font-size: 12.2px;
  color: var(--gold-soft);
  background: rgba(255, 217, 125, 0.1);
  border: 1px dashed rgba(255, 217, 125, 0.35);
  border-radius: 10px;
  padding: 6px 10px;
  margin-bottom: 16px;
}

.lock-form {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.lock-form input,
.lock-settings-form input {
  width: 100%;
  padding: 11px 15px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 217, 125, 0.45);
  background: rgba(8, 12, 26, 0.65);
  color: var(--cream);
  font-size: 14px;
  text-align: center;
  outline: none;
}

.lock-form input:focus,
.lock-settings-form input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(255, 217, 125, 0.18);
}

.lock-submit {
  justify-content: center;
  padding: 10px 18px;
}

.lock-error {
  margin-top: 10px;
  font-size: 12.8px;
  color: #ff9a9e;
  font-weight: 600;
}

/* Lock Settings Window */
.lock-settings-modal {
  position: fixed;
  top: 78px;
  right: 20px;
  width: min(350px, calc(100vw - 32px));
  z-index: 42;
  padding: 20px;
  border-radius: 20px;
  background: rgba(20, 26, 52, 0.94);
  border: 1.5px solid rgba(255, 217, 125, 0.55);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(14px);
}

.lock-settings-modal h2 {
  font-size: 17px;
  color: var(--gold-soft);
  margin-bottom: 8px;
}

.lock-settings-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.lock-settings-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.lock-pill {
  border-color: rgba(255, 217, 125, 0.35);
  background: rgba(255, 217, 125, 0.1);
  color: var(--gold-soft);
}

/* Live Stage Subtitle Banner */
.stage-banner {
  position: fixed;
  top: 76px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 15px;
  border-radius: 999px;
  background: rgba(18, 25, 48, 0.88);
  border: 1.5px solid rgba(255, 217, 125, 0.58);
  color: var(--gold-soft);
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(10px);
  max-width: calc(100vw - 32px);
}

.stage-banner-actions {
  display: flex;
  gap: 6px;
}

/* Mobile & Small Screen Responsive Optimization */
@media (max-width: 768px) {
  .hud-top {
    top: 8px;
    left: 8px;
    right: 8px;
    gap: 6px;
  }

  .brand-badge {
    padding: 6px 10px;
    border-radius: 12px;
  }

  .brand-badge h1 {
    font-size: 14px;
  }

  .brand-badge p {
    font-size: 10.5px;
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .world-nav {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding: 4px;
    gap: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .nav-pill {
    flex-shrink: 0;
    font-size: 11.5px;
    padding: 6px 9px;
  }

  .hud-bottom {
    bottom: 8px;
    left: 8px;
    right: 8px;
    gap: 6px;
  }

  .guide-card {
    display: none;
  }

  .bottom-actions {
    width: 100%;
    justify-content: center;
  }

  .btn-primary, .btn-secondary, .btn-ghost {
    font-size: 12px;
    padding: 7px 12px;
  }

  .stage-banner {
    top: 108px;
    font-size: 12px;
    padding: 7px 12px;
    flex-wrap: wrap;
    justify-content: center;
    border-radius: 16px;
  }

  .speech-bubble {
    top: 110px;
    max-width: calc(100vw - 24px);
    padding: 9px 12px;
  }

  .photo-modal {
    left: 10px;
    right: 10px;
    width: auto;
    top: 72px;
    bottom: 64px;
  }
}

/* 圣诞树 2.0 Photo World Studio Overlays */
.pw-art-title {
  position: fixed;
  top: 78px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 16;
  pointer-events: none;
  font-family: Georgia, "Times New Roman", "STKaiti", serif;
  font-style: italic;
  font-size: clamp(26px, 4.2vw, 50px);
  font-weight: 700;
  letter-spacing: 2px;
  background: linear-gradient(180deg, #fff8d6 0%, #ffd24c 65%, #f59c24 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 18px rgba(255, 210, 80, 0.55));
  white-space: nowrap;
}

.pw-studio-bar {
  position: fixed;
  bottom: 68px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: calc(100vw - 24px);
  padding: 8px 14px;
  border-radius: 18px;
  background: rgba(12, 16, 32, 0.82);
  border: 1px solid rgba(255, 215, 110, 0.45);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-lg);
}

.pw-slider-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--gold-soft);
  font-weight: 600;
}

.pw-slider-wrap input[type="range"] {
  width: 96px;
  accent-color: #ffd700;
  cursor: pointer;
}

.pw-studio-bar .mini-btn {
  flex: none;
  padding: 5px 10px;
  font-size: 12px;
}

.pw-studio-bar .mini-btn.active {
  background: linear-gradient(135deg, #ffd700, #f59c24);
  color: #1a1206;
  font-weight: 700;
}

/* Fullscreen Staggered Photo Wall ("回忆铺满") */
.photo-wall-overlay {
  position: fixed;
  inset: 0;
  z-index: 48;
  background: rgba(6, 9, 20, 0.88);
  backdrop-filter: blur(10px);
  padding: 64px 18px 18px;
  display: flex;
  flex-direction: column;
}

.wall-close-btn {
  position: fixed;
  top: 16px;
  right: 20px;
  z-index: 49;
}

.photo-wall-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  overflow-y: auto;
  align-content: center;
}

.wall-tile {
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid rgba(255, 224, 150, 0.55);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
  aspect-ratio: 4 / 3;
  animation: wallPop 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.wall-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@keyframes wallPop {
  from { opacity: 0; transform: scale(0.45) rotate(6deg); }
  to { opacity: 1; transform: scale(1) rotate(0deg); }
}

/* Magic Neon Drawing Canvas */
.magic-draw-canvas {
  position: fixed;
  inset: 0;
  z-index: 22;
  cursor: crosshair;
  touch-action: none;
}

/* Webcam Hand-Tracking Starlight Cursor & Corner Preview */
.hand-star-cursor {
  position: fixed;
  z-index: 60;
  pointer-events: none;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.star-cursor-orb {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: #fffdf0;
  background: radial-gradient(circle, rgba(255, 245, 196, 0.95) 0%, rgba(255, 208, 92, 0.55) 45%, rgba(255, 196, 66, 0) 75%);
  box-shadow: 0 0 28px rgba(255, 224, 122, 0.95), 0 0 56px rgba(140, 210, 255, 0.55);
  animation: starPulse 1.4s ease-in-out infinite;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.hand-star-cursor.fist .star-cursor-orb {
  transform: scale(0.76);
  background: radial-gradient(circle, #fff2c2 0%, rgba(255, 148, 56, 0.85) 55%, rgba(255, 120, 40, 0) 80%);
  box-shadow: 0 0 36px rgba(255, 170, 64, 1), 0 0 70px rgba(255, 215, 100, 0.85);
}

.star-cursor-label {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(14, 19, 40, 0.86);
  border: 1px solid rgba(255, 222, 136, 0.65);
  color: var(--gold-soft);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
}

@keyframes starPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.16); }
}

.hand-cam-wrap {
  position: fixed;
  left: 16px;
  bottom: 126px;
  z-index: 30;
  border-radius: 14px;
  overflow: hidden;
  border: 1.5px solid rgba(255, 218, 125, 0.58);
  background: rgba(10, 14, 28, 0.85);
  box-shadow: var(--shadow-lg);
  width: 164px;
}

.hand-cam-wrap canvas {
  width: 100%;
  height: auto;
  display: block;
}

.hand-cam-tag {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--gold-soft);
  padding: 4px 6px;
  background: rgba(16, 22, 44, 0.92);
}

/* Starlight-Composed Story Narration Panel (小星星组成的文字故事旁白) */
.carol-star-story {
  position: fixed;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  width: min(350px, calc(100vw - 32px));
  z-index: 32;
  padding: 20px 22px 18px;
  border-radius: 22px;
  background: radial-gradient(circle at 20% 10%, rgba(36, 48, 96, 0.88), rgba(11, 15, 34, 0.92));
  border: 1.5px solid rgba(255, 224, 138, 0.52);
  box-shadow:
    0 0 36px rgba(255, 214, 108, 0.2),
    inset 0 0 28px rgba(154, 212, 255, 0.14),
    var(--shadow-lg);
  backdrop-filter: blur(14px);
  overflow: hidden;
  animation: starPanelIn 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes starPanelIn {
  from { opacity: 0; transform: translateY(-44%) scale(0.94); }
  to { opacity: 1; transform: translateY(-50%) scale(1); }
}

.star-story-constellation {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.star-story-constellation .s-dot {
  position: absolute;
  color: #ffe99e;
  text-shadow: 0 0 10px #ffd25a, 0 0 22px rgba(162, 218, 255, 0.85);
  animation: starTwinkle 2.4s ease-in-out infinite;
}

.star-story-constellation .s1 { top: 10px; left: 14px; font-size: 13px; animation-delay: 0s; }
.star-story-constellation .s2 { top: 16px; right: 18px; font-size: 11px; animation-delay: 0.4s; }
.star-story-constellation .s3 { top: 52%; right: 12px; font-size: 12px; animation-delay: 0.8s; }
.star-story-constellation .s4 { bottom: 38px; left: 12px; font-size: 11px; animation-delay: 1.1s; }
.star-story-constellation .s5 { bottom: 12px; right: 24px; font-size: 14px; animation-delay: 1.5s; }
.star-story-constellation .s6 { top: 44%; left: 8px; font-size: 10px; animation-delay: 1.9s; }

@keyframes starTwinkle {
  0%, 100% { opacity: 0.35; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.22); }
}

.star-story-badge {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 1.4px;
  color: #ffe799;
  text-shadow: 0 0 12px rgba(255, 224, 132, 0.7);
  margin-bottom: 8px;
}

.star-story-title {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 700;
  color: #fff8dc;
  text-shadow: 0 0 14px rgba(255, 220, 120, 0.65);
}

.star-story-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.85;
  letter-spacing: 0.6px;
  color: #f8f4ff;
  text-shadow:
    0 0 8px rgba(255, 232, 160, 0.72),
    0 0 18px rgba(145, 210, 255, 0.45);
}

.star-story-text .star-char {
  display: inline-block;
  animation: starCharAppear 0.35s ease both;
}

@keyframes starCharAppear {
  from {
    opacity: 0;
    transform: translateY(4px) scale(1.18);
    text-shadow: 0 0 18px #fff5b8, 0 0 32px #8ed6ff;
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.star-story-footer {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed rgba(255, 226, 150, 0.28);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  color: rgba(255, 238, 190, 0.85);
}

.star-story-dots {
  letter-spacing: 3px;
  color: #ffd86b;
  text-shadow: 0 0 10px rgba(255, 216, 107, 0.8);
}

/* Carol Character Bio Profile Modal (点击人物查看资料卡) */
.carol-bio-modal {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(440px, calc(100vw - 28px));
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  z-index: 44;
  padding: 22px 24px;
  border-radius: 22px;
  background: linear-gradient(155deg, rgba(22, 30, 62, 0.95), rgba(14, 18, 38, 0.96));
  border: 1.5px solid rgba(255, 218, 130, 0.55);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65), 0 0 36px rgba(255, 214, 110, 0.16);
  backdrop-filter: blur(14px);
}

.carol-bio-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.carol-bio-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  background: radial-gradient(circle, rgba(255, 224, 138, 0.24), rgba(130, 188, 255, 0.12));
  border: 1px solid rgba(255, 224, 138, 0.42);
  flex-shrink: 0;
}

.carol-bio-header h2 {
  margin: 4px 0 2px;
  font-size: 20px;
  color: #fff6db;
}

.carol-bio-subtitle {
  margin: 0;
  font-size: 12px;
  color: rgba(206, 224, 255, 0.82);
}

.carol-bio-desc {
  margin: 0 0 14px;
  font-size: 13.5px;
  line-height: 1.7;
  color: #e9eefc;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
}

.carol-bio-deeds-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold-soft);
  margin-bottom: 8px;
}

.carol-bio-deeds {
  margin: 0 0 16px;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.65;
  color: #dce6ff;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.carol-bio-actions {
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 768px) {
  .carol-star-story {
    right: 50%;
    top: auto;
    bottom: 66px;
    transform: translateX(50%);
    padding: 14px 16px;
    width: calc(100vw - 24px);
  }
}
