body {
  background: #fcfbf8;
}

.article-layout {
  --article-offset-left: 0px;
  position: relative;
  width: min(calc(100% - (var(--page-padding-x) * 2)), var(--content-width));
  margin: 0 auto;
  left: var(--article-offset-left);
}

.toc-column {
  --toc-shift-up: 15px;
}

.toc-column {
  position: absolute;
  top: 48px;
  right: calc(100% + var(--content-gap));
  width: var(--toc-width);
  padding-right: 18px;
  transform: translateY(calc(-48px - var(--toc-shift-up)));
}

.toc-column.is-sticky {
  position: fixed;
  top: calc(48px - var(--toc-shift-up));
  left: calc(
    50% - (var(--content-width) / 2) - var(--content-gap) - var(--toc-width) + var(--article-offset-left)
  );
  right: auto;
  transform: none;
}

.toc-column.is-bottom {
  position: absolute;
  right: calc(100% + var(--content-gap));
  left: auto;
  transform: translateY(calc(-48px - var(--toc-shift-up)));
}

.toc-card {
  position: relative;
  min-height: 248px;
  padding: 6px 0 20px;
}

.toc-nav {
  margin-top: 10px;
}

.content-column {
  width: 100%;
  min-width: 0;
}

.article-surface {
  width: 100%;
}

.article-host {
  position: relative;
  width: 100%;
}


.lazy-video-player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 18px;
  overflow: hidden;
  background: #e9edf3;
  border: 0;
  box-shadow: none;
}

.lazy-video-player__trigger {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: none;
}

.lazy-video-player__poster,
.lazy-video-player__media {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.lazy-video-player__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.12), rgba(15, 23, 42, 0.34));
}

.lazy-video-player__play {
  display: inline-flex;
  width: 74px;
  height: 74px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.78);
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.24);
  backdrop-filter: blur(12px);
}

.lazy-video-player__play::before {
  content: "";
  margin: auto;
  margin-left: 30px;
  width: 0;
  height: 0;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  border-left: 18px solid #fff;
}

.lazy-video-player--no-poster .lazy-video-player__overlay {
  background: linear-gradient(180deg, rgba(36, 58, 96, 0.16), rgba(17, 24, 39, 0.76));
}

.video-embed {
  margin: 1.25em 0;
  border: 0;
}

.prototype-figure {
  margin: 1.25em 0;
}

.prototype-embed {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  border: 1px solid rgba(23, 24, 28, 0.08);
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
  box-shadow: none;
  color: inherit;
  text-decoration: none;
}

.prototype-embed--configured {
  cursor: pointer;
}

.prototype-embed__link {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
}

.prototype-embed--empty .prototype-embed__link {
  display: none;
}

.prototype-embed--portrait {
  aspect-ratio: auto;
}

.prototype-embed--empty {
  aspect-ratio: auto;
  min-height: 420px;
}

.prototype-embed__preview {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0;
  background: #fff;
}

.prototype-embed--configured .prototype-embed__preview {
  padding: 0;
}

.prototype-embed__cover {
  display: block;
  width: 100%;
  height: auto;
  min-height: auto;
  border-radius: 4px 4px 0 0;
  background: #fff;
  border: 0;
  box-shadow: none;
}

.prototype-embed__editor {
  position: relative;
  z-index: 3;
  display: grid;
  gap: 12px;
}

.prototype-embed__placeholder {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 8px;
  min-height: 240px;
  padding: 18px;
  border: 1px dashed rgba(23, 24, 28, 0.16);
  border-radius: 4px;
  background: #fafafa;
}

.prototype-embed__placeholder-title {
  color: #17181c;
  font-size: 1rem;
  line-height: 1.2;
}

.prototype-embed__placeholder-meta {
  color: #737983;
  font-size: 0.92rem;
  line-height: 1.45;
}

.prototype-embed__field {
  display: grid;
  gap: 6px;
  color: #17181c;
  font-size: 0.82rem;
  font-weight: 600;
}

.prototype-embed__input {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(23, 24, 28, 0.12);
  border-radius: 4px;
  background: #fff;
  color: #17181c;
  font: inherit;
}

.prototype-embed__validate {
  justify-self: start;
  padding: 10px 14px;
  border: 0;
  border-radius: 4px;
  background: #17181c;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.prototype-embed__footer {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px 16px;
  border-top: 1px solid rgba(23, 24, 28, 0.08);
  background: #fff;
  color: var(--text-main);
  text-decoration: none;
}

.prototype-embed__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a78bfa, #60a5fa 55%, #34d399);
  color: #fff;
  font-size: 1.15rem;
  font-weight: 500;
}

.prototype-embed__copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.prototype-embed__title {
  color: #1b1d22;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prototype-embed__meta {
  color: #8b9098;
  font-size: 0.96rem;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prototype-embed--portrait .prototype-embed__badge {
  display: none;
}

.mobile-toc-trigger,
.mobile-sheet {
  display: none;
}

@media (max-width: 820px) {
  .article-layout {
    width: 100%;
    padding: 0 var(--page-padding-x);
    left: 0;
  }

  .toc-column {
    display: none;
  }

  .mobile-toc-trigger {
    position: fixed;
    left: 18px;
    bottom: 22px;
    z-index: 40;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    border: 0;
    border-radius: 999px;
    background: #243a60;
    box-shadow: 0 18px 36px rgba(36, 58, 96, 0.24);
    color: white;
  }

  .mobile-toc-trigger__icon,
  .mobile-toc-trigger__icon::before,
  .mobile-toc-trigger__icon::after {
    display: block;
    width: 22px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    content: "";
  }

  .mobile-toc-trigger__icon {
    position: relative;
  }

  .mobile-toc-trigger__icon::before {
    position: absolute;
    top: -7px;
    left: 0;
  }

  .mobile-toc-trigger__icon::after {
    position: absolute;
    top: 7px;
    left: 0;
  }

  .mobile-sheet {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: block;
    pointer-events: none;
  }

  .mobile-sheet.is-open {
    pointer-events: auto;
  }

  .mobile-sheet__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(32, 26, 18, 0.34);
    opacity: 0;
    transition: opacity 220ms ease;
  }

  .mobile-sheet.is-open .mobile-sheet__backdrop {
    opacity: 1;
  }

  .mobile-sheet__panel {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    max-height: 72vh;
    padding: 14px 18px 26px;
    border-radius: 26px 26px 0 0;
    background: var(--surface);
    box-shadow: 0 -18px 42px rgba(23, 24, 28, 0.14);
    transform: translateY(102%);
    transition: transform 240ms ease;
  }

  .mobile-sheet.is-open .mobile-sheet__panel {
    transform: translateY(0);
  }

  .mobile-sheet__handle {
    width: 54px;
    height: 6px;
    margin: 0 auto 16px;
    border-radius: 999px;
    background: rgba(123, 116, 109, 0.35);
  }

  .mobile-sheet__header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 16px;
  }

  .mobile-sheet__close {
    padding: 10px 14px;
    border: 0;
    border-radius: 999px;
    background: #eef2f7;
    color: #334155;
    font-weight: 700;
  }

  .mobile-sheet__nav {
    margin-top: 18px;
    overflow-y: auto;
    max-height: calc(72vh - 110px);
    padding-bottom: 10px;
  }

  .lazy-video-player__play {
    width: 62px;
    height: 62px;
  }

  .lazy-video-player__label {
    font-size: 0.88rem;
  }
}

/* ── Scroll-to-top ──────────────────────────────────────────── */

.scroll-top-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(148, 163, 184, 0.55);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  color: #6b7280;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
  backdrop-filter: blur(10px);
  transition:
    opacity 240ms ease,
    transform 240ms ease,
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.scroll-top-btn.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.scroll-top-btn:hover {
  background: #fff;
  border-color: rgba(100, 116, 139, 0.75);
  color: #4b5563;
}

.scroll-top-btn::before {
  content: "";
  display: block;
  width: 9px;
  height: 9px;
  border-top: 2.5px solid currentColor;
  border-right: 2.5px solid currentColor;
  transform: rotate(-45deg) translateY(2px);
}

.has-image-lightbox {
  overflow: hidden;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.image-lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.image-lightbox__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(17, 24, 39, 0.82);
  cursor: zoom-out;
}

.image-lightbox__dialog {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  width: min(100%, 1320px);
  max-height: calc(100vh - 32px);
  justify-items: center;
}

.image-lightbox__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(148, 163, 184, 0.55);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: #6b7280;
  font: inherit;
  font-weight: 500;
  font-size: 1.65rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
  backdrop-filter: blur(10px);
}

.image-lightbox__close:hover {
  background: #fff;
  border-color: rgba(100, 116, 139, 0.75);
  color: #4b5563;
}

.image-lightbox__image {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 96px);
  width: auto;
  height: auto;
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.32);
  background: #fff;
}

.image-lightbox__caption {
  max-width: min(100%, 840px);
  padding: 0 12px 4px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.95rem;
  line-height: 1.5;
  text-align: center;
}

.image-lightbox__caption a {
  color: inherit;
}
