/* 永夜回声 - 共享样式表 (暗黑童趣风) */

:root {
  --color-purple: #2E1A47; /* 午夜紫 */
  --color-red: #C94C4C;    /* 血珀红 */
  --color-bone: #F2E3C6;   /* 骨白 */
  --color-black: #1A1A1A;  /* 鸦羽黑 */
  --color-dark-gray: #252525;
  --font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Courier New", Courier, monospace, sans-serif;
}

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

body {
  background-color: var(--color-black);
  color: var(--color-bone);
  font-family: var(--font-family);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image: radial-gradient(circle at center, var(--color-purple) 0%, var(--color-black) 80%);
  position: relative;
}

/* 顶部返回导航 */
.top-nav {
  padding: 15px 20px;
  background: rgba(26, 26, 26, 0.85);
  border-bottom: 1px solid rgba(242, 227, 198, 0.15);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
}

.top-nav a {
  color: var(--color-bone);
  text-decoration: none;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  padding: 6px 12px;
  border: 1px dashed var(--color-bone);
  border-radius: 4px;
}

.top-nav a:hover {
  color: var(--color-red);
  border-color: var(--color-red);
  background: rgba(201, 76, 76, 0.1);
  transform: translateY(-2px);
}

.nav-title {
  font-size: 1.1rem;
  letter-spacing: 2px;
  color: var(--color-red);
  text-shadow: 0 0 8px rgba(201, 76, 76, 0.5);
}

/* 容器 */
.container {
  max-width: 1000px;
  width: 100%;
  margin: 0 auto;
  padding: 30px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* 标题样式 */
h1, h2, h3 {
  color: var(--color-bone);
  text-align: center;
  letter-spacing: 3px;
  margin-bottom: 20px;
}

.glow-text {
  text-shadow: 0 0 10px rgba(242, 227, 198, 0.3), 0 0 20px rgba(201, 76, 76, 0.2);
}

/* 按钮基础 */
.btn {
  background: var(--color-dark-gray);
  color: var(--color-bone);
  border: 2px solid var(--color-bone);
  padding: 12px 24px;
  font-size: 1rem;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  outline: none;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn:hover {
  background: var(--color-red);
  color: var(--color-black);
  border-color: var(--color-red);
  box-shadow: 0 0 15px rgba(201, 76, 76, 0.6);
  transform: scale(1.03);
}

/* 裂开的壁纸与分岔楼梯剪影按钮 (抉择按钮) */
.choice-btn {
  position: relative;
  background: #221533;
  border: 2px solid #5a3a80;
  color: var(--color-bone);
  padding: 20px 30px;
  margin: 15px 0;
  border-radius: 12px;
  cursor: pointer;
  font-size: 1.1rem;
  text-align: left;
  overflow: hidden;
  transition: all 0.4s ease;
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.6);
}

.choice-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, transparent 45%, rgba(26, 26, 26, 0.8) 50%, transparent 55%);
  background-size: 10px 10px;
  opacity: 0.15;
  pointer-events: none;
}

/* 楼梯剪影装饰 */
.choice-btn::after {
  content: '';
  position: absolute;
  right: -20px;
  bottom: -10px;
  width: 80px;
  height: 80px;
  background: currentColor;
  opacity: 0.05;
  clip-path: polygon(100% 100%, 0% 100%, 0% 80%, 20% 80%, 20% 60%, 40% 60%, 40% 40%, 60% 40%, 60% 20%, 80% 20%, 80% 0%, 100% 0%);
  transition: all 0.4s ease;
}

.choice-btn:hover {
  border-color: var(--color-red);
  box-shadow: 0 0 25px rgba(201, 76, 76, 0.4), inset 0 0 10px rgba(201, 76, 76, 0.2);
  transform: translateX(5px);
  color: #fff;
}

.choice-btn:hover::after {
  opacity: 0.15;
  right: -10px;
  color: var(--color-red);
}

/* 墨渍阴影效果 */
.ink-shadow {
  position: absolute;
  border-radius: 50%;
  background: rgba(26, 26, 26, 0.85);
  transform: scale(0);
  transition: transform 0.5s ease-out;
  pointer-events: none;
  z-index: 0;
}

.choice-btn:active .ink-shadow {
  transform: scale(4);
}

/* 荆棘心形图腾 */
.totem-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 20px 0;
}

.heart-totem {
  width: 120px;
  height: 120px;
  position: relative;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.1s ease;
}

.heart-totem svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 8px rgba(201, 76, 76, 0.6));
}

.heart-totem:active {
  transform: scale(0.92);
}

/* 心跳波纹 */
.pulse-ring {
  position: absolute;
  border: 2px solid var(--color-red);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: pulse-anim 2s infinite linear;
  pointer-events: none;
  opacity: 0;
}

@keyframes pulse-anim {
  0% {
    width: 120px;
    height: 120px;
    opacity: 0.8;
  }
  100% {
    width: 350px;
    height: 350px;
    opacity: 0;
  }
}

/* 屏幕边缘心率波纹 */
.screen-vignette {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  box-shadow: inset 0 0 60px rgba(201, 76, 76, 0);
  transition: box-shadow 0.5s ease;
  z-index: 999;
}

.screen-vignette.panic {
  animation: panic-vignette 1.5s infinite alternate;
}

@keyframes panic-vignette {
  0% {
    box-shadow: inset 0 0 40px rgba(201, 76, 76, 0.4);
  }
  100% {
    box-shadow: inset 0 0 100px rgba(201, 76, 76, 0.95);
  }
}

/* 碎纸屑粒子 */
.particle {
  position: absolute;
  width: 6px;
  height: 6px;
  background: var(--color-bone);
  pointer-events: none;
  opacity: 1;
  transform: translate(-50%, -50%);
}

/* 记忆污染介质 */
.diary-book {
  background: var(--color-bone);
  color: var(--color-black);
  padding: 40px;
  border-radius: 16px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.8), inset 0 0 40px rgba(0, 0, 0, 0.15);
  min-height: 300px;
  position: relative;
  border: 4px solid #d4c4a8;
  font-family: "Courier New", Courier, monospace;
  line-height: 1.6;
}

.diary-text {
  font-size: 1.15rem;
  transition: opacity 0.5s ease;
}

.diary-text.corrupted {
  font-family: inherit;
  font-weight: bold;
  letter-spacing: 1px;
  animation: jitter 0.15s infinite alternate;
}

@keyframes jitter {
  0% { transform: translate(1px, 1px) rotate(0deg); }
  100% { transform: translate(-1px, -1px) rotate(0.5deg); }
}

/* 照片污染 */
.photo-frame {
  background: #fff;
  padding: 15px 15px 45px 15px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  border-radius: 4px;
  transform: rotate(-3deg);
  transition: all 0.8s ease;
  cursor: pointer;
  max-width: 280px;
  margin: 20px auto;
  position: relative;
}

.photo-img {
  width: 100%;
  height: 200px;
  background-color: #333;
  background-size: cover;
  background-position: center;
  transition: filter 2s ease, opacity 2s ease;
}

.photo-caption {
  font-family: "Courier New", Courier, monospace;
  color: #333;
  text-align: center;
  margin-top: 15px;
  font-size: 0.9rem;
}

/* 火漆信函 */
.letter-container {
  perspective: 1000px;
  margin: 30px auto;
  max-width: 600px;
  width: 100%;
}

.envelope {
  background: #3d245c;
  border: 2px solid #52337a;
  border-radius: 12px;
  padding: 40px;
  position: relative;
  box-shadow: 0 15px 30px rgba(0,0,0,0.6);
  cursor: pointer;
  transition: transform 0.6s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 250px;
}

.envelope.opened {
  transform: rotateX(-10deg) translateY(-20px);
}

.wax-seal {
  width: 80px;
  height: 80px;
  background: var(--color-red);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5), inset 0 0 10px rgba(0,0,0,0.3);
  cursor: pointer;
  position: relative;
  transition: all 0.5s ease;
  z-index: 10;
}

.wax-seal::before {
  content: '☠';
  color: var(--color-bone);
  font-size: 2rem;
}

.wax-seal.cracked {
  transform: scale(0.9) rotate(15deg);
  opacity: 0;
  pointer-events: none;
}

.letter-content {
  background: var(--color-bone);
  color: var(--color-black);
  padding: 40px;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  margin-top: 20px;
  display: none;
  font-family: "Courier New", Courier, monospace;
  line-height: 1.6;
  border-left: 5px solid var(--color-red);
}

.letter-content.visible {
  display: block;
  animation: slide-down 0.6s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

@keyframes slide-down {
  0% { opacity: 0; transform: translateY(-30px); }
  100% { opacity: 1; transform: translateY(0); }
}

.burnt-corner {
  position: relative;
}

.burnt-corner::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, transparent 45%, #1a1a1a 50%, #000 70%);
  clip-path: polygon(100% 100%, 0% 100%, 100% 0%);
  pointer-events: none;
}

/* 底部声明 */
footer {
  text-align: center;
  padding: 20px;
  font-size: 0.8rem;
  color: rgba(242, 227, 198, 0.4);
  border-top: 1px solid rgba(242, 227, 198, 0.05);
  margin-top: auto;
}
