:root {
  --bg: #030506;
  --panel: rgba(10, 15, 20, 0.78);
  --panel-strong: rgba(18, 26, 34, 0.92);
  --line: rgba(255, 255, 255, 0.16);
  --line-strong: rgba(255, 255, 255, 0.28);
  --text: #f6fbff;
  --muted: rgba(246, 251, 255, 0.66);
  --subtle: rgba(246, 251, 255, 0.46);
  --cyan: #32dccd;
  --blue: #3c7fff;
  --amber: #ffbd57;
  --font-cjk: "FZLanTingHei", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: #000;
  color: var(--text);
  font-family: var(--font-cjk);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button {
  font: inherit;
}

.deck {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 22% 18%, rgba(50, 220, 205, 0.17), transparent 31%),
    radial-gradient(circle at 80% 78%, rgba(60, 127, 255, 0.16), transparent 34%),
    linear-gradient(145deg, #071015 0%, #020304 58%, #000 100%);
}

.deck::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.85), transparent 86%);
}

.deck-stage {
  position: relative;
  z-index: 1;
  width: min(100vw, 177.7778dvh);
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  padding: 0;
}

.slide-shell {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.72);
}

.slide-frame {
  position: absolute;
  inset: 0 auto auto 0;
  display: block;
  width: 1280px;
  height: 720px;
  border: 0;
  background: #000;
  transform: scale(var(--frame-scale, 1));
  transform-origin: top left;
}

.deck-ui {
  position: fixed;
  z-index: 10;
  left: 50%;
  bottom: 18px;
  width: min(720px, calc(100vw - 32px));
  transform: translateX(-50%);
  display: grid;
  gap: 10px;
  color: var(--text);
  transition: opacity 180ms ease, transform 180ms ease;
}

.deck-ui.is-idle {
  opacity: 0.22;
  transform: translateX(-50%) translateY(8px);
}

.progress {
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--blue), var(--amber));
  transition: width 280ms ease;
}

.controls {
  display: grid;
  grid-template-columns: 42px minmax(142px, 1fr) 42px 42px 42px;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 58px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(18px);
}

.controls button,
.overview button {
  min-width: 0;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.controls button:hover,
.overview button:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.14);
}

.controls button:active,
.overview button:active {
  transform: translateY(1px);
}

.controls button:disabled {
  color: var(--subtle);
  cursor: not-allowed;
  opacity: 0.45;
}

.page-indicator {
  justify-self: center;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
}

.page-dots {
  display: grid;
  grid-template-columns: repeat(var(--page-count, 23), minmax(0, 1fr));
  gap: 4px;
}

.page-dot {
  height: 7px;
  border: 0;
  border-radius: 999px;
  padding: 0;
  background: rgba(255, 255, 255, 0.22);
  cursor: pointer;
  transition: background 180ms ease, transform 180ms ease;
}

.page-dot:hover,
.page-dot.is-active {
  background: var(--cyan);
}

.page-dot.is-active {
  transform: scaleY(1.45);
}

.overview {
  width: min(760px, calc(100vw - 32px));
  max-height: min(760px, calc(100dvh - 64px));
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0;
  color: var(--text);
  background: var(--panel-strong);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(22px);
}

.overview::backdrop {
  background: rgba(0, 0, 0, 0.62);
}

.overview-head {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(18, 26, 34, 0.98);
}

.overview-head b {
  font-size: 16px;
}

.overview-head button {
  width: 36px;
}

.overview-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 16px;
  list-style: none;
}

.overview-list button {
  width: 100%;
  height: auto;
  min-height: 48px;
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  text-align: left;
}

.overview-list b {
  color: var(--cyan);
  font-size: 13px;
}

.overview-list span {
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overview-list button.is-active {
  border-color: rgba(50, 220, 205, 0.58);
  background: rgba(50, 220, 205, 0.12);
}

@media (max-width: 760px) {
  .deck-stage {
    width: 100vw;
  }

  .deck-ui {
    bottom: 10px;
  }

  .controls {
    grid-template-columns: 38px minmax(110px, 1fr) 38px 38px 38px;
    gap: 6px;
    padding: 6px;
  }

  .controls button {
    height: 34px;
  }

  .page-dots {
    gap: 3px;
  }

  .overview-list {
    grid-template-columns: 1fr;
  }
}
