:root {
  --bg: #eef2f6;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #667487;
  --line: #d8e0ea;
  --accent: #0f6d73;
  --accent-strong: #0a5358;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family:
    "PingFang SC",
    "Microsoft YaHei",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

button,
a {
  font: inherit;
}

.deck-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 18px;
  width: 100vw;
  height: 100vh;
  padding: 18px;
}

.stage {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  border: 1px solid var(--line);
  background: #f7f8fa;
}

.slide-frame {
  position: relative;
  display: grid;
  place-items: center;
  width: min(100%, calc((100vh - 36px) * 16 / 9));
  max-height: calc(100vh - 36px);
  margin: 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 18px 55px rgba(23, 32, 51, 0.12);
}

.slide-canvas {
  position: absolute;
  top: 0;
  left: 0;
  overflow: hidden;
  background: #fff;
  transform-origin: 0 0;
}

.slide-element {
  position: absolute;
  box-sizing: border-box;
}

.slide-text {
  white-space: pre-line;
  line-height: 1.14;
  overflow: hidden;
}

.slide-text[data-valign="middle"] {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.nav-button {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 46px;
  height: 58px;
  border: 1px solid rgba(15, 109, 115, 0.2);
  background: rgba(255, 255, 255, 0.88);
  color: var(--accent-strong);
  font-size: 38px;
  line-height: 1;
  transform: translateY(-50%);
  cursor: pointer;
}

.nav-button:hover,
.nav-button:focus-visible {
  border-color: rgba(15, 109, 115, 0.55);
  outline: none;
}

.prev {
  left: 22px;
}

.next {
  right: 22px;
}

.sidebar {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  border: 1px solid var(--line);
  background: var(--panel);
}

.meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.meta h1 {
  margin: 0 0 6px;
  font-size: 18px;
  line-height: 1.2;
}

.meta p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--accent);
  color: var(--accent-strong);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

.download:hover,
.download:focus-visible {
  background: #ddeff0;
  outline: none;
}

.thumbs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  min-height: 0;
  padding: 14px;
  overflow: auto;
}

.thumb {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.thumb[aria-current="true"] {
  border-color: var(--accent);
  box-shadow: inset 4px 0 0 var(--accent);
}

.thumb span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid #edf1f5;
}

@media (max-width: 900px) {
  .deck-shell {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) 164px;
    padding: 10px;
    gap: 10px;
  }

  .slide-frame {
    width: 100%;
    max-height: calc(100vh - 194px);
  }

  .sidebar {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .meta {
    padding: 10px 12px;
  }

  .thumbs {
    grid-template-columns: repeat(8, minmax(116px, 1fr));
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px;
  }

  .thumb {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .nav-button {
    width: 38px;
    height: 50px;
    font-size: 32px;
  }
}
