/* 全局重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Courier New', Consolas, Monaco, monospace;
}

/* 核心配色与布局：#f00093 粉紫色主题 */
body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: #000;
  color: #f00093;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  letter-spacing: 0.5px;
  margin: 0;
}

/* 径向渐变叠加层 */
body:before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at center, transparent 0%, rgba(0, 0, 0, .3) 100%);
  pointer-events: none;
  z-index: 3;
}

/* 闪烁叠加层 */
body:after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #ffffff03;
  pointer-events: none;
  z-index: 4;
  animation: flicker 3s ease-in-out infinite;
}

/* 扫描线效果 */
.scanlines {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.05) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  background-size: 100% 3px;
  z-index: 10;
  pointer-events: none;
  animation: scanline 6s linear infinite;
}

/* 动画关键帧 */
@keyframes scanline {
  0% { background-position: 0 0; }
  100% { background-position: 0 100%; }
}

@keyframes flicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.95; }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@keyframes pulse {
  0% { opacity: 0.3; }
  100% { opacity: 0.5; }
}

/* 主内容容器 */
#content {
  width: 100%;
  max-width: 700px;
  text-align: center;
  position: relative;
  z-index: 20;
}

/* 初始提示 */
.initial-prompt {
  font-size: 1.3rem;
  margin-bottom: 40px;
  opacity: 0.9;
  transition: opacity 0.3s;
}

.initial-prompt:hover {
  opacity: 1;
}

/* 光标动画 */
.cursor {
  animation: blink 1.2s step-end infinite;
}

/* 统一显示区：摩斯密码、英文短语共用 */
.unified-display {
  font-size: 1.1rem;
  line-height: 2;
  margin: 40px 0;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.8s;
}

/* 英文短语样式（在统一显示区中） */
.unified-display.phrase {
  font-size: 1.5rem;
  font-weight: 300;
  letter-spacing: 1px;
}

/* 输入区域 */
.input-container {
  margin-top: 40px;
  opacity: 0;
  transition: opacity 1s;
}

#user-input {
  background: transparent;
  border: none;
  outline: none;
  color: #f00093;
  font-size: 1.1rem;
  padding: 10px 0;
  border-bottom: 1px solid rgba(240, 0, 147, 0.3);
  width: 80%;
  max-width: 400px;
  text-align: center;
  letter-spacing: 1px;
}

#user-input::placeholder {
  color: rgba(240, 0, 147, 0.5);
  letter-spacing: 2px;
}

/* 版权信息 */
.copyright {
  position: fixed;
  bottom: 25px;
  left: 0;
  width: 100%;
  text-align: center;
  color: rgba(240, 0, 147, 0.3);
  font-size: 0.75rem;
  line-height: 1.6;
  z-index: 20;
}

.copyright a {
  color: rgba(240, 0, 147, 0.4);
  text-decoration: none;
  transition: color 0.3s;
}

.copyright a:hover {
  color: rgba(240, 0, 147, 0.7);
}

/* 图片模态框 */
#image-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.97);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 100;
  padding: 30px;
}

#display-image {
  max-width: 90%;
  max-height: 85vh;
  object-fit: contain;
  opacity: 0;
  transition: opacity 1.2s ease-in-out;
}

#close-modal {
  position: absolute;
  top: 30px;
  right: 30px;
  background: transparent;
  border: 1px solid rgba(240, 0, 147, 0.3);
  color: rgba(240, 0, 147, 0.8);
  padding: 8px 18px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s;
  letter-spacing: 1px;
}

#close-modal:hover {
  border-color: rgba(240, 0, 147, 0.7);
  color: #f00093;
  box-shadow: 0 0 15px rgba(240, 0, 147, 0.1);
}

/* 响应式调整：移动端（≤600px） */
@media (max-width: 600px) {
  .initial-prompt {
    font-size: 1.1rem;
  }

  .unified-display {
    font-size: 1rem;
    line-height: 1.8;
    padding: 0 20px;
    min-height: 100px;
  }

  .unified-display.phrase {
    font-size: 1.3rem;
  }

  #user-input {
    width: 90%;
    font-size: 1rem;
  }

  #user-input::placeholder {
    letter-spacing: 1px;
  }

  .copyright {
    font-size: 0.7rem;
    bottom: 15px;
    padding: 0 10px;
  }

  #close-modal {
    top: 20px;
    right: 20px;
    padding: 6px 14px;
    font-size: 0.8rem;
  }
}

/* 响应式调整：平板端（601px-768px） */
@media (min-width: 601px) and (max-width: 768px) {
  .unified-display {
    font-size: 1.05rem;
    padding: 0 30px;
  }

  .unified-display.phrase {
    font-size: 1.4rem;
  }

  #user-input {
    width: 75%;
  }
}

/* 高亮状态优化 */
::selection {
  background-color: rgba(240, 0, 147, 0.2);
  color: #f00093;
}

/* 输入框聚焦状态优化 */
#user-input:focus {
  border-bottom-color: rgba(240, 0, 147, 0.6);
  transition: border-color 0.3s;
}

/* 模态框图片加载动画 */
#display-image.loading {
  opacity: 0.3;
  animation: pulse 1.5s infinite alternate;
}

/* 隐藏音频元素默认文本 */
audio {
  display: none;
}

/* 统一过渡动画计时函数 */
* {
  transition-timing-function: ease-in-out;
}
