html,
body {
  margin: 0;
  font-family: "Alibaba PuHuiTi", "Ma Shan Zheng", "STXingkai", "KaiTi", "Microsoft YaHei", sans-serif;
  background: #ffffff;
  color: #161515;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
}

* {
  box-sizing: border-box;
}

button,
input {
  font: inherit;
}

#app {
  min-height: 100vh;
}

.app-shell {
  padding: 0;
}

.start-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  z-index: 1000;
  transition: opacity 0.3s ease;
}

.text-animation-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  z-index: 999;
  overflow: hidden;
  transition: opacity 0.5s ease;
  perspective: 600px;
  perspective-origin: 50% 50%;
}

.flying-text-container {
  position: absolute;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
}

.flying-char {
  position: absolute;
  font-size: 48px;
  font-weight: 400;
  font-family: "HarmonyOS Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: #ff6b9d;
  opacity: 0;
  animation: starWars 5s ease-out forwards;
  text-shadow: 0 0 15px rgba(255, 107, 157, 0.6);
  white-space: nowrap;
  transform-style: preserve-3d;
  backface-visibility: visible;
}

@keyframes starWars {
  0% {
    opacity: 0;
    transform: translateZ(-2000px) scale(4);
  }
  15% {
    opacity: 1;
  }
  40% {
    opacity: 1;
    transform: translateZ(0px) scale(1);
  }
  70% {
    opacity: 1;
    transform: translateZ(0px) scale(1);
  }
  90% {
    opacity: 0.5;
  }
  100% {
    opacity: 0;
    transform: translateZ(1500px) scale(0.1);
  }
}

@media (max-width: 768px) {
  .text-animation-overlay {
    perspective: 600px;
  }

  .flying-char {
    font-size: 28px;
    font-weight: 400;
  }

  @keyframes starWars {
    0% {
      opacity: 0;
      transform: translateZ(-1200px) scale(2.5);
    }
    20% {
      opacity: 1;
      transform: translateZ(-400px) scale(1.3);
    }
    45% {
      opacity: 1;
      transform: translateZ(0px) scale(1);
    }
    65% {
      opacity: 1;
      transform: translateZ(0px) scale(1);
    }
    85% {
      opacity: 0.8;
      transform: translateZ(400px) scale(0.5);
    }
    100% {
      opacity: 0;
      transform: translateZ(800px) scale(0.2);
    }
  }
}

@media (max-width: 480px) {
  .text-animation-overlay {
    perspective: 500px;
  }

  .flying-char {
    font-size: 22px;
    font-weight: 400;
    text-shadow: 0 0 10px rgba(255, 107, 157, 0.5);
  }

  @keyframes starWars {
    0% {
      opacity: 0;
      transform: translateZ(-1000px) scale(2.2);
    }
    20% {
      opacity: 1;
      transform: translateZ(-350px) scale(1.2);
    }
    45% {
      opacity: 1;
      transform: translateZ(0px) scale(1);
    }
    65% {
      opacity: 1;
      transform: translateZ(0px) scale(1);
    }
    85% {
      opacity: 0.8;
      transform: translateZ(350px) scale(0.5);
    }
    100% {
      opacity: 0;
      transform: translateZ(700px) scale(0.2);
    }
  }
}

.start-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 20px;
  transition: transform 0.3s ease;
  animation: heartbeat 1.5s ease-in-out infinite;
}

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

.start-button:hover {
  transform: scale(1.15);
  animation: none;
}

.start-button svg {
  filter: drop-shadow(0 4px 20px rgba(255, 107, 157, 0.4));
}

.pause-button {
  position: fixed;
  top: 30px;
  right: 30px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  z-index: 1000;
  transition: transform 0.2s ease;
}

.pause-button:hover {
  transform: scale(1.1);
}

.pause-button svg {
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.15));
}

@media (max-width: 768px) {
  .start-button {
    padding: 20px;
  }

  .start-button svg {
    width: 70px;
    height: 70px;
  }

  .pause-button {
    top: 20px;
    right: 20px;
  }

  .pause-button svg {
    width: 28px;
    height: 28px;
  }
}

@media (max-width: 480px) {
  .start-button {
    padding: 15px;
  }

  .start-button svg {
    width: 60px;
    height: 60px;
  }

  .pause-button {
    top: 15px;
    right: 15px;
  }

  .pause-button svg {
    width: 24px;
    height: 24px;
  }
}

.toolbar,
.status-bar {
  display: none;
}

.heart-transition {
  position: fixed;
  inset: 0;
  z-index: 998;
  pointer-events: none;
  display: none;
  align-items: center;
  justify-content: center;
  background: transparent;
}

.heart-transition.waiting {
  display: flex;
}

.heart-transition.waiting svg {
  width: 80px;
  height: 80px;
  animation: heartbeat 0.8s ease-in-out infinite;
}

.heart-transition.expanding svg {
  width: 100vmax;
  height: 100vmax;
  animation: none;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              height 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.paper-frame {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.paper-frame.visible {
  opacity: 1;
}

.paper {
  position: relative;
  overflow: hidden;
  border-radius: 0;
  padding: 0;
  background: #ffffff;
  box-shadow: none;
}

.text-layer {
  position: absolute;
  inset: 0;
}

.line {
  position: absolute;
  display: block;
  font-size: 19px;
  line-height: 31px;
  letter-spacing: 0.05em;
  color: #2c2c2c;
  white-space: nowrap;
  hyphens: auto;
  text-rendering: optimizeLegibility;
  font-weight: 400;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

@media (max-width: 768px) {
  .line {
    font-size: 16px;
    line-height: 26px;
    letter-spacing: 0.04em;
  }
}

@media (max-width: 480px) {
  .line {
    font-size: 14px;
    line-height: 23px;
    letter-spacing: 0.03em;
  }
}

.line--justify {
  display: flex;
  justify-content: space-between;
  gap: 0.72ch;
}

.line__word {
  flex: 0 0 auto;
}

.drop-cap {
  position: absolute;
  left: 60px;
  top: 50px;
  font-size: 36px;
  line-height: 0.8;
  color: #ff6b9d;
  opacity: 0.9;
  font-weight: 600;
  text-shadow: 0 2px 8px rgba(255, 107, 157, 0.3);
  z-index: 10;
}

@media (max-width: 768px) {
  .drop-cap {
    left: 25px;
    top: 35px;
    font-size: 30px;
  }
}

@media (max-width: 480px) {
  .drop-cap {
    left: 20px;
    top: 25px;
    font-size: 26px;
  }
}

.video-stage {
  position: absolute;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: transparent;
  transition:
    left 160ms ease,
    top 160ms ease,
    width 160ms ease,
    height 160ms ease;
}

.video-stage canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

.video-stage video {
  display: none;
}

.reference-panel {
  position: absolute;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%);
  width: min(420px, calc(100% - 180px));
  padding: 12px 14px 14px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(247, 244, 238, 0.96), rgba(238, 234, 227, 0.92));
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.reference-panel__header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 8px;
  color: rgba(37, 34, 31, 0.88);
}

.reference-panel__eyebrow {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(37, 34, 31, 0.46);
}

.reference-panel__title {
  font-size: 13px;
}

.reference-panel__video {
  display: block;
  width: 100%;
  height: 176px;
  border-radius: 18px;
  background: #080808;
  object-fit: contain;
  box-shadow:
    0 8px 22px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
