/* ================= 底部 HUD ================= */
.hud {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 8px 10px;
  background: rgba(243, 242, 239, 0.92);
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.55);
  border-radius: 3px;
  z-index: 60;
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
}

body.ready .hud {
  opacity: 1;
  pointer-events: auto;
}

/* 鼠标静止后自动淡出，避免挡住页面内容 */
body.hud-idle .hud {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
}

body.hud-idle {
  cursor: none;
}

.hud-left,
.hud-right {
  display: flex;
  gap: 6px;
  align-items: center;
}

.hud-mid {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border-left: 1.5px solid rgba(13, 13, 13, 0.16);
  border-right: 1.5px solid rgba(13, 13, 13, 0.16);
}

.hud-btn,
.hud-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 32px;
  padding: 0 10px;
  border: 1.5px solid var(--ink);
  background: var(--white);
  color: var(--ink);
  font-family: var(--px);
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s, background 0.12s;
}

.hud-btn:hover,
.hud-arrow:hover {
  background: var(--yellow);
}

.hud-btn:active,
.hud-arrow:active {
  transform: translate(1px, 1px);
}

.hud-count {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  font-family: var(--en);
  font-size: 12px;
  color: var(--muted);
  min-width: 58px;
  justify-content: center;
}

.hud-count b {
  font-size: 16px;
  color: var(--ink);
}

.hud-count i {
  font-style: normal;
  opacity: 0.5;
}

.progress-wrap {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 5px;
  background: rgba(0, 0, 0, 0.35);
  z-index: 61;
}

.progress {
  height: 100%;
  width: 0;
  background: var(--pink);
  transition: width 0.34s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ================= 总览 ================= */
.overview {
  position: fixed;
  inset: 0;
  z-index: 80;
  padding: 72px 56px 100px;
  background: rgba(23, 22, 26, 0.96);
  backdrop-filter: blur(6px);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
  align-content: start;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: opacity 0.24s, visibility 0.24s, transform 0.24s;
}

.overview.open {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.ov-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 16px 18px;
  min-height: 108px;
  text-align: left;
  cursor: pointer;
  border: 2px solid #3a383f;
  background: #211f25;
  color: #e8e4dd;
  transition: border-color 0.16s, background 0.16s, transform 0.16s;
}

.ov-cell:hover {
  border-color: var(--yellow);
  transform: translateY(-2px);
}

.ov-cell.current {
  border-color: var(--pink);
  background: #2c2430;
}

.ov-cell.current::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--pink);
}

.ov-no {
  font-family: var(--en);
  font-size: 11px;
  color: var(--pink);
  letter-spacing: 0.1em;
}

.ov-t {
  font-family: var(--px);
  font-size: 17px;
  line-height: 1.4;
}

.ov-type {
  margin-top: auto;
  font-family: var(--en);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6d6874;
}

/* ================= 帮助 ================= */
.help {
  position: fixed;
  right: 26px;
  bottom: 86px;
  z-index: 82;
  width: 300px;
  padding: 22px 24px;
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
}

.help.open {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.help h3 {
  margin: 0 0 14px;
  font-family: var(--px);
  font-size: 18px;
}

.help dl {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 7px 14px;
  font-size: 13px;
}

.help dt {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--pink-deep);
  white-space: nowrap;
}

.help dd {
  margin: 0;
  color: var(--muted);
}

.help p {
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1.5px dashed rgba(13, 13, 13, 0.2);
  font-size: 12px;
  line-height: 1.7;
  color: #8a8580;
}

/* ================= 打印 ================= */
@media print {
  @page {
    size: 1600px 900px;
    margin: 0;
  }

  html,
  body {
    overflow: visible;
    background: #fff;
    height: auto;
  }

  #viewport {
    position: static;
    display: block;
  }

  #stage {
    transform: none !important;
    box-shadow: none;
    width: 1600px;
    height: auto;
  }

  .slide {
    position: relative;
    inset: auto;
    width: 1600px;
    height: 900px;
    opacity: 1 !important;
    visibility: visible !important;
    page-break-after: always;
    break-after: page;
  }

  .slide .rise {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .hud,
  .progress-wrap,
  .overview,
  .help {
    display: none !important;
  }
}
