@font-face {
  font-family: "Museo300";
  src: url("fonts/Museo300-Regular.otf") format("opentype");
  font-weight: 300;
  font-style: normal;
}

@font-face {
  font-family: "MonaLine";
  src: url("fonts/蒙纳简正线.otf") format("opentype");
  font-weight: normal;
  font-style: normal;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #dcdcdc;
  font-family: "Museo300", "MonaLine", sans-serif;
}

.page {
  position: relative;
  width: 100%;
  max-width: 750px;
  margin: 0 auto;
}

.bg {
  width: 100%;
  display: block;
}

/* 首页蜡烛区域 */
.candle-area {
  position: absolute;
  left: 50%;
  top: 73.46%;
  transform: translateX(-50%);
  width: 16%;
  max-width: 120px;
}

.candle {
  width: 100%;
  display: block;
  cursor: pointer;
}

.flame {
  position: absolute;
  left: 50%;
  top: 10%;
  width: 31.6%;
  opacity: 0;
  transform: translateX(-50%) scale(1.8);
  transform-origin: center bottom;
}

.flame.on {
  opacity: 1;
  animation: ignite 2.4s ease-out, flicker 2.2s infinite;
}

.popup {
  position: absolute;
  left: 50%;
  top: -16%;
  transform: translateX(-50%);
  opacity: 0;
  font-size: clamp(12px, 2.6vw, 20px);
  color: #d38f6e;
  white-space: nowrap;
  z-index: 999;
}

.popup.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-20px);
  transition: 0.6s;
}

.action-text {
  position: absolute;
  top: 79.46%;
  left: 61%;
  font-size: clamp(13px, 2.4vw, 18px);
  color: #777;
  line-height: 1.6;
}

.count-text {
  position: absolute;
  top: 93.7%;
  left: 50%;
  transform: translateX(-50%);
  font-size: clamp(16px, 2.9vw, 22px);
  color: #777;
  white-space: nowrap;
}

#countNumber {
  font-size: clamp(20px, 3.5vw, 26px);
  font-family: "Museo300", sans-serif;
}

#musicToggle {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 999;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
}

@keyframes ignite {
  0% { transform: translateX(-50%) scale(0.1); opacity: 0; }
  30% { transform: translateX(-50%) scale(0.5); opacity: 0.3; }
  60% { transform: translateX(-50%) scale(1.2); opacity: 0.7; }
  80% { transform: translateX(-50%) scale(2); opacity: 1; }
  100% { transform: translateX(-50%) scale(1.8); opacity: 1; }
}

@keyframes flicker {
  0% { transform: translateX(-50%) scale(1.8) rotate(-1deg); }
  50% { transform: translateX(-50%) scale(1.9) rotate(1deg); }
  100% { transform: translateX(-50%) scale(1.8) rotate(-1deg); }
}

/* ===== 双箭头（呼吸动画）===== */
.scroll-hint {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  pointer-events: none;
}

.arrow {
  position: relative;
  width: 24px;
  height: 40px;
}

.arrow::before,
.arrow::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 14px;
  height: 14px;
  border-left: 2px solid rgba(180, 180, 180, 0.8);
  border-bottom: 2px solid rgba(180, 180, 180, 0.8);
  transform: translateX(-50%) rotate(-45deg);
  animation: arrow-breathe 1.6s infinite;
}

.arrow::before {
  top: 0;
}

.arrow::after {
  top: 12px;
  animation-delay: 0.3s;
}

@keyframes arrow-breathe {
  0% {
    opacity: 0.2;
    transform: translateX(-50%) translateY(0) rotate(-45deg);
  }
  50% {
    opacity: 1;
    transform: translateX(-50%) translateY(8px) rotate(-45deg);
  }
  100% {
    opacity: 0.2;
    transform: translateX(-50%) translateY(0) rotate(-45deg);
  }
}

.section-image {
  width: 100%;
  max-width: 750px;
  display: block;
  margin: 0 auto;
  height: auto;
}

/* ===== 第四页：记忆墙 ===== */
.memory-section {
  position: relative;
  width: 100%;
  max-width: 750px;
  margin: 0 auto;
  padding-bottom: 0px;
}

.memory-wall {
  background: #efefef;
  position: relative;
  margin-top: -930px;
  width: 100%;
  padding: 0 18px 40px;
}

.gallery {
  column-count: 4;
  column-gap: 10px;
}

.wall-img {
  width: 100%;
  display: block;
  margin-bottom: 10px;
  border-radius: 2px;
  break-inside: avoid;
  filter: grayscale(100%);
  cursor: pointer;
  transition: filter 0.3s ease, transform 0.3s ease;
}

.wall-img:hover { filter: grayscale(0%); }
.wall-img:active { filter: grayscale(0%); }

/* ===== 放大层 ===== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 5000;
}

.lightbox.hidden {
  display: none;
}

.lightbox.show {
  display: block !important;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  transition: background 0.28s ease;
}

.lightbox.show .lightbox-backdrop {
  background: rgba(0, 0, 0, 0.75);
}

.lightbox-image {
  position: absolute;
  top: 50%;
  left: 50%;
  max-width: 78vw;
  max-height: 82vh;
  object-fit: contain;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  z-index: 2;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.94);
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.lightbox.show .lightbox-image {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 34px;
  cursor: pointer;
  z-index: 3;
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.28s ease;
}

.lightbox.show .lightbox-arrow {
  opacity: 1;
}

.lightbox-arrow.left {
  left: 24px;
}

.lightbox-arrow.right {
  right: 24px;
}

/* ===== 第五页 ===== */
.echo-section {
  position: relative;
  width: 100%;
  max-width: 750px;
  margin: 0 auto;
}

.echo-open-btn {
  position: absolute;
  top: 300px;
  left: 18px;
  z-index: 2;
  border: none;
  background: #e97821;
  color: #fff;
  font-family: "MonaLine", sans-serif;
  font-size: 14px;
  padding: 8px 12px;
  cursor: pointer;
}

.echo-list {
  position: absolute;
  top: 370px;
  left: 6px;
  right: 6px;
  bottom: 20px;
  overflow-y: auto;
}

/* ===== 留言弹窗 ===== */
.echo-modal {
  position: fixed;
  inset: 0;
  z-index: 6000;
}

.echo-modal.hidden {
  display: none;
}

.echo-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.18);
}

.echo-modal-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(84vw, 620px);
  transform: translate(-50%, -50%);
  background: #f4f4f4;
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  padding: 22px 18px 18px;
}

.echo-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #fafafa;
  color: #aaa;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.echo-modal-title {
  color: #666;
  font-size: 20px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.14);
}

.echo-modal-desc {
  color: #8a8a8a;
  font-size: 13px;
  margin-bottom: 18px;
}

.echo-form-row {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
}

.echo-field {
  flex: 1;
}

.echo-field label {
  display: block;
  font-size: 12px;
  color: #e97821;
  margin-bottom: 6px;
}

.echo-field label span {
  color: #999;
}

.echo-field input,
.echo-field textarea {
  width: 100%;
  border: 1px solid #b8b8b8;
  background: #f6f6f6;
  font-family: "Museo300", "MonaLine", sans-serif;
  font-size: 13px;
  color: #666;
  padding: 8px 10px;
  outline: none;
}

.echo-field textarea {
  min-height: 150px;
  resize: vertical;
}

.echo-field.full {
  margin-bottom: 16px;
}

.echo-modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.echo-upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  background: #f8f8f8;
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: #8c8c8c;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.echo-submit-btn {
  border: none;
  background: #e97821;
  color: #fff;
  padding: 9px 14px;
  font-size: 14px;
  cursor: pointer;
}

/* ===== 手机端 ===== */
@media (max-width: 750px) {
  .memory-wall {
    margin-top: -420px;
  }

  .echo-list {
    top: 370px;
    bottom: 16px;
    overflow-y: auto;
  }

  .echo-modal-panel {
    width: 90vw;
    padding: 20px 14px 16px;
  }

  .echo-form-row {
    flex-direction: column;
    gap: 10px;
  }

  .echo-field textarea {
    min-height: 130px;
  }
}

/* ===== 留言卡片样式 ===== */
.echo-card {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  border-radius: 4px;
  padding: 14px 16px 18px;
  margin-bottom: 16px;
}

.echo-card-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 14px;
}

.echo-date {
  color: #8c8c8c;
  font-size: 12px;
  font-style: italic;
}

.echo-like-btn {
  border: none;
  background: transparent;
  color: #e97821;
  cursor: pointer;
}

.echo-content {
  color: #666;
  font-size: 12px;
  line-height: 1.9;
}

.echo-form-row {
  display: block;
}

.echo-field {
  width: 100%;
  margin-bottom: 14px;
}

.echo-field.full {
  margin-bottom: 16px;
}

.echo-field textarea {
  width: 100%;
  min-height: 150px;
  resize: vertical;
}

#echoName {
  width: 285px;
  max-width: 100%;
}

.echo-upload-btn {
  display: none;
}
/* ===== 最后一页地图定位 ===== */
.page6-wrap {
  position: relative;
  width: 100%;
  max-width: 750px;
  margin: 0 auto;
}

#visitorMap {
  position: absolute;
  left: 50%;
  transform: translateX(-50%) !important;
  bottom: 480px;

  width: 92%;        /* 基本占满手机宽度 */
  max-width: 600px;  /* 电脑上不至于太大 */
  height: 280px;     /* 高度加大，方便点 */

  background: #eee;
  border-radius: 8px;

  z-index: 5;
}
.map-note {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 410px;

  text-align: center;
  font-size: 13px;
  color: #8c8c8c;
  line-height: 1.6;
  width: 90%;
}
@media (max-width: 750px) {
  #visitorMap {
    height: 180px;
    bottom: 230px;
  }

  .map-note {
    bottom: 150px;
    font-size: 11px;
    line-height: 1.5;
    width: 92%;
  }
}
/* ===== 首页语音按钮：昭的告别 ===== */
.farewell-trigger {
  position: absolute;
  left: 50%;
  bottom: 120%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 2;
  white-space: nowrap;
}

.farewell-line {
  width: 34px;
  height: 1px;
  background: rgba(140, 140, 140, 0.45);
}

.farewell-btn {
  border: none;
  background: rgba(255, 255, 255, 0.18);
  color: #7b7b7b;
  font-family: "MonaLine", "Museo300", sans-serif;
  font-size: 13px;
  letter-spacing: 1px;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(2px);
}

.farewell-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.farewell-btn.playing {
  color: #d38f6e;
}

@media (max-width: 750px) {
  .farewell-trigger {
    bottom: 118%;
    gap: 8px;
  }

  .farewell-line {
    width: 24px;
  }

  .farewell-btn {
    font-size: 12px;
    padding: 5px 10px;
  }
}
/* ===== 播放按钮样式优化 ===== */
.farewell-btn {
  display: flex;
  align-items: center;
  gap: 8px;

  font-size: 15px;
  padding: 8px 16px;
}

/* ▶ 图标 */
.play-icon {
  font-size: 18px;
  opacity: 0.8;
  display: inline-block;
  animation: playPulse 1.6s ease-in-out infinite;
}

/* 呼吸动画 */
@keyframes playPulse {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.25);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 0.6;
  }
}

/* 播放中状态（暂停图标） */
.farewell-btn.playing .play-icon {
  animation: none;
  opacity: 1;
}

/* ===== 第二页：真实文字版纪念页 ===== */
.memorial-text-section {
  width: 100%;
  max-width: 750px;
  margin: 0 auto;
  background: #efefef;
  color: #7f7f7f;
  padding: 82px 34px 96px;
  font-family: "MonaLine", "Museo300", sans-serif;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.memorial-quote {
  position: relative;
  text-align: center;
  margin-bottom: 58px;
}

.quote-image {
  position: absolute;
  display: block;
  user-select: none;
  pointer-events: none;
}

.quote-image-left {
  left: -6px;
  top: -16px;
  width: 36px;
  height: auto;
}

.quote-en {
  margin: 0 0 16px;
  color: #5d5d5d;
  font-family: "Museo300", sans-serif;
  font-size: clamp(17px, 3.1vw, 23px);
  letter-spacing: 0.4px;
  line-height: 1.45;
}

.quote-cn {
  margin: 0;
  color: #8a8a8a;
  font-size: clamp(22px, 4.4vw, 34px);
  line-height: 1.35;
  letter-spacing: 1px;
}

.memorial-ribbon {
  display: block;
  width: 176px;
  max-width: 34%;
  margin: 0 auto 92px;
}

.memorial-heading {
  position: relative;
  text-align: center;
  margin-bottom: 70px;
}

.memorial-words {
  position: relative;
  display: inline-block;
  text-align: right;
}

.memorial-line-main {
  color: #777;
  font-size: clamp(48px, 7.2vw, 66px);
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: 5px;
}

.memorial-line-sub {
  color: #8a8a8a;
  font-size: clamp(28px, 4.8vw, 40px);
  font-weight: 300;
  line-height: 1.28;
  letter-spacing: 4px;
  margin-top: 10px;
}

.memorial-orange-comma {
  position: absolute;
  right: -44px;
  bottom: -16px;
  width: 29px;
  height: auto;
  display: block;
  user-select: none;
  pointer-events: none;
}

.memorial-body {
  font-size: clamp(18px, 3.55vw, 27px);
  line-height: 1.85;
  letter-spacing: 1px;
  color: #858585;
}

.memorial-body p {
  margin: 0 0 46px;
}

.memorial-body p:last-child {
  margin-bottom: 0;
}

@media (max-width: 750px) {
  .memorial-text-section {
    padding: 66px 27px 82px;
  }

  .memorial-quote {
    margin-bottom: 52px;
  }

  .quote-image-left {
    width: 32px;
    left: -2px;
    top: -13px;
  }

  .memorial-ribbon {
    width: 150px;
    max-width: 35%;
    margin-bottom: 82px;
  }

  .memorial-heading {
    margin-bottom: 66px;
  }

  .memorial-line-main {
    font-size: clamp(42px, 10vw, 56px);
    letter-spacing: 4px;
  }

  .memorial-line-sub {
    font-size: clamp(25px, 6.4vw, 34px);
    letter-spacing: 3px;
    margin-top: 8px;
  }

  .memorial-orange-comma {
    right: -34px;
    bottom: -14px;
    width: 24px;
  }

  .memorial-body p {
    margin-bottom: 42px;
  }
}
