/* ============================================================
   layout.css — 布局与容器：全屏背景层、开场画面、信件排版
   ============================================================ */

/* ── 星空背景层（Canvas 绘制，固定铺满） ─────────────────── */
.bg-stars {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.bg-stars canvas {
  width: 100%;
  height: 100%;
}

/* ── 开场画面（透明背景，透出星空） ──────────────────────── */
.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 42px;
  transition: opacity var(--duration-letter) ease,
              visibility var(--duration-letter) ease;
}

.boot-screen.done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.boot-wordmark {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.5em;
  text-indent: 0.5em;
  color: var(--color-text-dim);
}

/* ── 信号按钮（全息空气投影：半透明自发光线框，无阴影） ──── */
.signal-btn {
  position: relative;
  padding: 18px 44px;
  font-family: var(--font-mono);
  font-size: 15px;
  letter-spacing: 0.18em;
  color: var(--color-text);
  background: transparent;
  border: 1px solid var(--color-line);
  border-radius: 999px;
  transition: border-color 0.35s ease, color 0.35s ease,
              opacity 0.35s ease;
}

/* 呼吸光晕扩散层（光线而非阴影） */
.signal-btn::before {
  content: "";
  position: absolute;
  inset: -12px;
  border-radius: 999px;
  background: radial-gradient(ellipse at center,
              var(--color-glow-soft), transparent 68%);
  opacity: 0.3;
  z-index: -1;
  pointer-events: none;
}

.signal-btn:hover {
  border-color: var(--color-glow-soft);
  color: #fff;
}

.signal-btn:focus-visible {
  outline: 1px dashed var(--color-glow-soft);
  outline-offset: 6px;
}

.signal-btn.is-locked {
  opacity: 0.35;
  pointer-events: none;
}

/* ── 信件主体 ────────────────────────────────────────────── */
.letter {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
  padding: 22vh 24px 26vh;
  opacity: 0;
  transition: opacity var(--duration-letter) ease;
}

.letter.visible {
  opacity: 1;
}

.letter-block {
  margin-bottom: 16vh;
}

.letter-block h2 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--color-text);
  margin-bottom: 22px;
}

.letter-block p {
  font-size: 15px;
  letter-spacing: 0.06em;
  color: var(--color-text-dim);
  margin-bottom: 14px;
}

.letter-block .sign {
  font-family: var(--font-mono);
  color: var(--color-text);
  letter-spacing: 0.3em;
}

/* ── 右下角静音按钮 ──────────────────────────────────────── */
.mute-btn {
  position: fixed;
  right: 24px;
  bottom: 26px;
  z-index: 20;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-line);
  border-radius: 50%;
  color: var(--color-text-dim);
  background: transparent;
  transition: color 0.3s ease, border-color 0.3s ease;
}

.mute-btn:hover {
  color: var(--color-text);
  border-color: var(--color-glow-soft);
}

.mute-btn svg {
  width: 18px;
  height: 18px;
}

.mute-btn .icon-off {
  display: none;
}

.mute-btn.muted .icon-on {
  display: none;
}

.mute-btn.muted .icon-off {
  display: block;
}

/* ── 心电监护仪画面（全屏，低对比光效） ─────────────────── */
.ecg-screen {
  position: fixed;
  inset: 0;
  z-index: 15;
  background: rgba(4, 6, 12, 0.94);
  visibility: hidden;
  opacity: 0;
  transition: opacity 600ms ease, visibility 600ms ease;
  pointer-events: none;
}

.ecg-screen.active {
  visibility: visible;
  opacity: 1;
}

.ecg-screen canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
}

.ecg-head {
  position: absolute;
  z-index: 2;
  top: 22px;
  left: 28px;
  right: 28px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  pointer-events: none;
}

.ecg-label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.4em;
  color: rgba(159, 216, 255, 0.55);
}

.ecg-readout {
  text-align: right;
  font-family: var(--font-mono);
}

.ecg-bpm {
  font-size: 30px;
  color: #bfe0ff;
  letter-spacing: 0.05em;
}

.ecg-unit {
  font-size: 11px;
  color: rgba(159, 216, 255, 0.5);
  margin-left: 4px;
}

.ecg-beat {
  display: block;
  font-size: 11px;
  color: rgba(159, 216, 255, 0.45);
  margin-top: 4px;
  letter-spacing: 0.2em;
}
