/* ============================================================
   开屏动画样式 — intro.css
   配合 js/intro.js 使用
   ============================================================ */

/* ---------- 全局重置 ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #0b0b0b;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: 'Courier New', Courier, monospace;
  padding: 1.5rem;
  box-shadow: inset 0 0 80px rgba(255, 68, 187, 0.06);
  user-select: none;           /* 防止双击选中文字导致格式错乱 */
  -webkit-user-select: none;
}

/* ---------- 终端容器 ---------- */
.terminal {
  max-width: 950px;
  width: 100%;
  background: transparent;
  padding: 2.8rem 3rem;
}

/* ---------- 主文字行 — 放大，霓虹 ---------- */
.glitch-line {
  min-height: 5.6rem;
  display: flex;
  align-items: center;
  color: #ff44bb;
  font-size: clamp(2.4rem, 8vw, 4.2rem);
  font-weight: 600;
  letter-spacing: 3px;
  text-shadow: 0 0 8px #ff44bb, 0 0 24px #ff44bb66, 0 0 50px #ff44bb22;
  border-bottom: 1px dashed rgba(255, 68, 187, 0.08);
  padding-bottom: 0.5rem;
  margin-bottom: 0.6rem;
  transition: all 0.2s;
  white-space: nowrap;
word-break: normal;
  line-height: 1.2;
}

/* 光标闪烁 */
.cursor-blink::after {
  content: "▌";
  color: #ff88cc;
  text-shadow: 0 0 12px #ff44bb, 0 0 30px #ff44bbaa;
  animation: pulse 0.9s infinite alternate;
  margin-left: 4px;
  display: inline-block;
  font-weight: 300;
  font-size: 0.9em;
}

@keyframes pulse {
  0% { opacity: 0.2; transform: scale(0.95); }
  100% { opacity: 1; transform: scale(1.1); }
}

/* ---------- 摩斯密码容器：电报风格 ---------- */
.morse-container {
  background: transparent;
  padding: 0.4rem 0 0.2rem 0;
  margin: 0 0 0.2rem 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.3rem 0.65rem;
  min-height: 2.8rem;
  overflow-x: visible;
  overflow-y: visible;
  scrollbar-width: thin;
  scrollbar-color: #ff44bb44 transparent;
  white-space: normal;
  transition: all 0.2s;
}

.morse-container::-webkit-scrollbar {
  height: 3px;
}
.morse-container::-webkit-scrollbar-track {
  background: transparent;
}
.morse-container::-webkit-scrollbar-thumb {
  background: #ff44bb44;
  border-radius: 20px;
}

/* 每个摩斯单元 */
.morse-char {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  transition: all 0.25s ease;
  flex-shrink: 0;
}

/* 摩斯密码本身 — 电报小字，由浅到明显 */
.morse-code {
  color: #ff88bb;
  font-size: 1.1rem;
  letter-spacing: 3px;
  background: transparent;
  padding: 0;
  border: none;
  text-shadow: 0 0 4px #ff44bb44;
  font-weight: 400;
  transition: all 0.3s ease;
  opacity: 0.12;
  transform: scale(0.95);
  filter: blur(0.6px);
  font-family: 'Courier New', monospace;
  white-space: normal;
}

/* 激活状态：明显发光 */
.morse-code.active {
  opacity: 1;
  transform: scale(1);
  filter: blur(0px);
  text-shadow: 0 0 12px #ff44bb, 0 0 28px #ff44bb88;
  background: transparent;
  box-shadow: none;
}

/* 空格特殊处理 */
.morse-char.space-char .morse-code {
  opacity: 0.20;
  letter-spacing: 10px;
  background: transparent;
  border: none;
  box-shadow: none;
  filter: blur(0px);
  transform: scale(1);
  color: #ff44bb33;
  padding: 0 0.6rem;
}
.morse-char.space-char .morse-code.active {
  opacity: 0.45;
  color: #ff88bb66;
  text-shadow: 0 0 6px #ff44bb44;
}

/* 隐藏字母标签 */
.morse-char .morse-letter {
  display: none;
}

/* ---------- 提示文字 ---------- */
.hint {
  display: flex;
  justify-content: flex-end;
  margin-top: 1.6rem;
  font-size: 0.9rem;
  color: #ff44bb55;
  letter-spacing: 3px;
  text-transform: uppercase;
  border-top: 1px solid #ff44bb0a;
  padding-top: 1.2rem;
}

.hint span {
  opacity: 0.6;
  animation: softPulse 2s infinite alternate;
}

@keyframes softPulse {
  0% { opacity: 0.25; }
  100% { opacity: 0.8; }
}

/* ---------- "继续"模式 ---------- */
.press-key-mode .glitch-line {
  color: #ff77bb;
  text-shadow: 0 0 12px #ff44bb, 0 0 30px #ff44bb66;
}

.press-key-mode .cursor-blink::after {
  content: "▌";
  font-size: 1em;
  filter: none;
  animation: pulse 0.7s infinite alternate;
}

/* ---------- intro 浮层 ---------- */
#introOverlay {
  position: fixed;
  inset: 0;
  background: #0b0b0b;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ff88cc;
  font-size: clamp(2rem, 6vw, 4rem);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s;
  z-index: 9999;
  text-shadow: 0 0 20px #ff44bb;
}
#introOverlay.show { opacity: 1; }
#introOverlay.hide { opacity: 0; }

/* 渐出动画 */
.fadeout {
  animation: fadeout 0.8s forwards;
}
@keyframes fadeout {
  to { opacity: 0; visibility: hidden; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 600px) {
  .terminal { padding: 1.6rem 1.2rem; }
  .glitch-line { font-size: clamp(1.8rem, 6vw, 2.8rem); }
  .morse-container { gap: 0.12rem 0.25rem; }
  .morse-code { font-size: 0.85rem; letter-spacing: 3px; }
}
