:root {
  color-scheme: dark;
  --bg: #05040a;
  --panel: rgba(255, 255, 255, 0.075);
  --panel-strong: rgba(13, 17, 32, 0.9);
  --line: rgba(255, 255, 255, 0.15);
  --text: #ffffff;
  --muted: #d8d0e7;
  --green: #7cff78;
  --gold: #ffd86b;
  --cyan: #7df5ff;
  --magenta: #f044d5;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 10% 12%, rgba(125, 245, 255, 0.14), transparent 24rem),
    radial-gradient(circle at 90% 5%, rgba(240, 68, 213, 0.24), transparent 29rem),
    linear-gradient(145deg, #040408 0%, #13081c 42%, #05040a 100%);
  color: var(--text);
}

body.is-lightbox-open {
  overflow: hidden;
}

button,
a {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.plan-shell {
  width: min(1320px, calc(100% - 36px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 0 36px;
}

.plan-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0 22px;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-weight: 900;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(125, 245, 255, 0.38);
  border-radius: 8px;
  color: var(--cyan);
  background: rgba(125, 245, 255, 0.12);
}

.language-tabs {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  width: min(360px, 100%);
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.065);
}

.language-tabs button {
  min-width: 0;
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 950;
  cursor: pointer;
}

.language-tabs button.is-active {
  background: linear-gradient(135deg, var(--green), #dfff78);
  color: #18041f;
}

.stage {
  display: grid;
  grid-template-columns: minmax(300px, 0.58fr) minmax(0, 1fr);
  gap: clamp(22px, 4vw, 48px);
  align-items: start;
  min-height: auto;
  padding-top: clamp(24px, 8vh, 96px);
}

.stage-copy {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--green);
  font-weight: 950;
}

h1 {
  max-width: 560px;
  margin: 0;
  font-size: clamp(2.7rem, 5vw, 5.4rem);
  line-height: 0.98;
  letter-spacing: 0;
  overflow-wrap: anywhere;
  word-break: normal;
}

.quick-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 30px;
}

.quick-facts div {
  min-height: 86px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
}

.quick-facts span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.quick-facts strong {
  display: block;
  margin-top: 8px;
  font-size: 1.25rem;
}

.viewer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.control-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  font-weight: 950;
  cursor: pointer;
}

.control-button.primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--green), #dfff78);
  color: #18041f;
}

.control-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.deck-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
  overflow: hidden;
}

.deck-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22);
}

.deck-label {
  display: block;
  margin-bottom: 4px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 950;
}

#deck-title {
  font-size: clamp(1rem, 1.6vw, 1.35rem);
}

.page-pill {
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--cyan);
  font-weight: 950;
  background: rgba(125, 245, 255, 0.08);
}

.slide-frame {
  margin: 0;
  padding: clamp(8px, 1.6vw, 14px);
  background: rgba(0, 0, 0, 0.3);
}

.slide-zoom-button {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: #111827;
  color: var(--text);
  cursor: zoom-in;
  position: relative;
  overflow: hidden;
}

.slide-zoom-button img {
  display: block;
  width: 100%;
  min-height: 280px;
  border-radius: 6px;
  background: #111827;
  object-fit: contain;
}

.slide-zoom-button span {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(5, 4, 10, 0.72);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 950;
  backdrop-filter: blur(10px);
}

.page-rail-wrap {
  padding: 12px 14px 16px;
}

.page-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 46px;
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
}

.page-rail::-webkit-scrollbar {
  display: none;
}

.page-rail button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--muted);
  font-weight: 950;
  cursor: pointer;
}

.page-rail button.is-active {
  border-color: transparent;
  background: var(--gold);
  color: #211300;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  grid-template-rows: auto 1fr;
  background: rgba(3, 2, 8, 0.96);
}

.lightbox.is-open {
  display: grid;
}

.lightbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px clamp(12px, 3vw, 24px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.055);
}

.lightbox-bar strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lightbox-bar button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 1.7rem;
  font-weight: 900;
  cursor: pointer;
}

.lightbox-scroller {
  overflow: auto;
  overscroll-behavior: contain;
  padding: clamp(10px, 2vw, 24px);
}

.lightbox-image {
  display: block;
}

#lightbox-image {
  display: block;
  width: min(1600px, 96vw);
  max-width: none;
  margin: 0 auto;
  border-radius: 8px;
  background: #111827;
}

@media (max-width: 980px) {
  .stage {
    grid-template-columns: 1fr;
    align-items: start;
    min-height: auto;
  }

  .stage-copy {
    padding-top: 12px;
  }

  h1 {
    max-width: 720px;
  }
}

@media (max-width: 620px) {
  .plan-shell {
    width: 100%;
    padding: 14px 12px 30px;
  }

  .plan-topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .language-tabs {
    width: 100%;
  }

  h1 {
    max-width: 100%;
    font-size: clamp(1.9rem, 9vw, 2.45rem);
    line-height: 1.08;
    overflow-wrap: anywhere;
    word-break: break-all;
  }

  .quick-facts {
    grid-template-columns: 1fr;
  }

  .quick-facts div {
    min-height: auto;
  }

  .viewer-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .control-button {
    min-width: 0;
    padding: 0 8px;
  }

  .deck-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-pill {
    width: 100%;
    text-align: center;
  }

  .slide-zoom-button img {
    min-height: 190px;
  }

  .slide-zoom-button span {
    right: 8px;
    bottom: 8px;
    font-size: 0.76rem;
  }

  #lightbox-image {
    width: 980px;
    margin: 0;
  }
}
