/* 亮点介绍 deck — hand-written overrides.
   Loaded AFTER highlights-deck.css, which lives in `@layer hl`, so everything
   here wins without needing !important. */

#highlights {
  background: #fff;
}

.hl-shell {
  position: relative;
  border-radius: 1.5rem;
  overflow: hidden;
  border: 1px solid rgba(17, 17, 17, 0.08);
  background: #0b0b0c;
  box-shadow: 0 34px 90px -46px rgba(17, 17, 17, 0.55);
  /* 16:9, but never taller than ~84vh — computed here so JS has nothing to fight */
  max-width: min(100%, calc(84vh * 16 / 9));
  margin-left: auto;
  margin-right: auto;
}

#hl-deck {
  position: relative;
  width: 100%;
  height: 540px;
  overflow: hidden;
  outline: none;
  --ivory: #f5f1ea;
  --night: #0b0b0c;
  --ink: #141312;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-family: var(--font);
}

/* fixed-size stage so the 1920×1080 canvas can be scaled to fit */
#hl-deck .hl-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
#hl-deck .hl-canvas {
  position: absolute;
  left: 0;
  top: 0;
  width: 1920px;
  height: 1080px;
  transform-origin: 0 0;
  transform: translate(0, 0) scale(0.5);
  background: var(--night);
}

/* progress bar sits on the shell, not the page */
#hl-deck .hl-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(92deg, #f3c76e 0%, #ec8f86 48%, #b48cf0 100%);
  z-index: 30;
  transition: width 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}

#hl-deck .hl-prev,
#hl-deck .hl-next {
  position: absolute;
  top: 50%;
  z-index: 32;
  width: 46px;
  height: 46px;
  margin-top: -23px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(12, 12, 14, 0.45);
  color: #fff;
  backdrop-filter: blur(10px);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
  opacity: 0;
}
#hl-deck:hover .hl-prev,
#hl-deck:hover .hl-next,
#hl-deck:focus-within .hl-prev,
#hl-deck:focus-within .hl-next {
  opacity: 1;
}
#hl-deck .hl-prev { left: 16px; }
#hl-deck .hl-next { right: 16px; }
#hl-deck .hl-prev:hover,
#hl-deck .hl-next:hover {
  background: rgba(255, 255, 255, 0.92);
  color: #111;
  transform: scale(1.06);
}
#hl-deck .hl-prev::after,
#hl-deck .hl-next::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 9px;
  height: 9px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
}
#hl-deck .hl-prev::after { transform: rotate(45deg) translate(1px, -1px); }
#hl-deck .hl-next::after { transform: rotate(-135deg) translate(1px, -1px); }

/* ------------------------------------------------------------- mobile mode */
/* On phones the deck stops being a fixed 16:9 frame: the active slide flows
   with the page so nothing gets clipped inside a nested scroller. */
#hl-deck.hl-mobile {
  height: auto;
  min-height: 0;
  border-radius: 1rem;
  overflow: hidden;
}
#hl-deck.hl-mobile .hl-stage {
  position: relative;
  inset: auto;
  width: 100%;
  height: auto;
}
#hl-deck.hl-mobile .hl-canvas {
  transform: none;
  position: relative;
  width: 100%;
  height: auto;
  min-height: 0;
}
#hl-deck.hl-mobile .slide {
  position: absolute;
}
#hl-deck.hl-mobile .slide.on {
  position: relative;
  inset: auto;
  overflow: visible;
  padding: 0 18px 96px;
  animation: none;
}

/* the cover's TOC needs room above the floating arrows */
#hl-deck.hl-mobile .cover .toc {
  grid-template-columns: 1fr 1fr !important;
  gap: 10px 14px !important;
  margin-top: 22px;
}
#hl-deck.hl-mobile .cover .hero .pill {
  width: auto !important;
  flex: 0 0 auto;
}
#hl-deck.hl-mobile .cover .lines {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
#hl-deck.hl-mobile .chrome {
  position: relative;
  top: 0;
  left: 0;
  right: 0;
  height: 46px;
  margin: 0;
  padding: 0 14px;
  background: transparent;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
#hl-deck.hl-mobile .slide.dark .chrome { background: transparent; }

/* compact brand lockup on mobile: logo mark only + name, no wrapping */
#hl-deck.hl-mobile .chrome .mark {
  font-size: 12px;
  font-weight: 600;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 62%;
}
#hl-deck.hl-mobile .chrome .mark img {
  height: 20px !important;
  width: auto !important;
  flex: none;
}
#hl-deck.hl-mobile .chrome .mark .mark-sub {
  display: none;
}
#hl-deck.hl-mobile .chrome .crumb {
  display: none;
}
#hl-deck.hl-mobile .chrome .pg {
  font-size: 12px;
  flex: none;
  opacity: 0.7;
}
#hl-deck.hl-mobile .hl-prev,
#hl-deck.hl-mobile .hl-next {
  opacity: 1;
  top: auto;
  bottom: 16px;
  margin-top: 0;
}
#hl-deck.hl-mobile .hl-prev { left: 12px; }
#hl-deck.hl-mobile .hl-next { right: 12px; }
#hl-deck.hl-mobile .cover .bg {
  position: absolute;
  inset: 0;
}

/* ---------------------------------------------- chapter chips (real text) */
.hl-chips {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.25rem 0 0.75rem;
  margin-top: 1rem;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
}
.hl-chips::-webkit-scrollbar { height: 4px; }
.hl-chips::-webkit-scrollbar-thumb {
  background: rgba(17, 17, 17, 0.18);
  border-radius: 999px;
}
.hl-chip {
  flex: none;
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(17, 17, 17, 0.09);
  background: #fff;
  color: rgba(17, 17, 17, 0.62);
  font-size: 0.8125rem;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  scroll-snap-align: start;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.hl-chip b {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  color: rgba(17, 17, 17, 0.4);
}
.hl-chip:hover {
  border-color: rgba(17, 17, 17, 0.24);
  color: #111;
}
.hl-chip.is-on {
  background: #111;
  border-color: #111;
  color: #fff;
}
.hl-chip.is-on b { color: rgba(255, 255, 255, 0.55); }

/* --------------------------------------- collapsed text version (SEO/GEO) */
.hl-text {
  margin-top: 0.5rem;
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 0.9rem;
  background: #fafafa;
}
.hl-text > summary {
  cursor: pointer;
  padding: 0.85rem 1.1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgba(17, 17, 17, 0.7);
  list-style: none;
}
.hl-text > summary::-webkit-details-marker { display: none; }
.hl-text > summary::before {
  content: "+";
  display: inline-block;
  width: 1rem;
  margin-right: 0.35rem;
  color: rgba(17, 17, 17, 0.35);
}
.hl-text[open] > summary::before { content: "−"; }
.hl-text ol {
  margin: 0;
  padding: 0 1.1rem 1.1rem 2.4rem;
  display: grid;
  gap: 0.7rem;
}
.hl-text li b {
  display: block;
  font-size: 0.8125rem;
  color: #111;
  margin-bottom: 0.15rem;
}
.hl-text li p {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.7;
  color: rgba(17, 17, 17, 0.55);
}

@media (max-width: 900px) {
  .hl-shell { border-radius: 1rem; }
}
