/* ==========================================================================
   Lab Page Stylesheet
   Scope: lab.html only
   ========================================================================== */

.lab-page {
  background:
    radial-gradient(circle at 12% 8%, rgba(0, 113, 227, 0.08), transparent 28%),
    radial-gradient(circle at 86% 4%, rgba(139, 92, 246, 0.06), transparent 26%),
    var(--soft, #f5f5f7);
  color: var(--ink, #1d1d1f);
}

.lab-main {
  padding-top: 44px;
  overflow: hidden;
}

.lab-hero,
.language-panel,
.edge-architecture,
.lab-note-list,
.lab-grid {
  width: min(calc(100% - 32px), 1120px);
  margin-inline: auto;
}

.lab-hero {
  padding: clamp(86px, 12vw, 150px) 0 clamp(54px, 8vw, 96px);
  text-align: center;
}

.lab-hero h1 {
  max-width: 980px;
  margin: 0 auto 22px;
  color: var(--blue, #0071e3);
  font-size: clamp(3rem, 7vw, 6.4rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.065em;
}

.lab-hero p:not(.eyebrow) {
  max-width: 760px;
  margin: 0 auto;
  color: var(--muted, #6e6e73);
  font-size: clamp(1.08rem, 2vw, 1.45rem);
  line-height: 1.65;
}

/* GitHub language mix */
.language-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(240px, 0.72fr) minmax(0, 1.36fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  margin-bottom: clamp(34px, 6vw, 72px);
  border-radius: var(--radius-xl, 36px);
  padding: clamp(92px, 7.2vw, 112px) clamp(30px, 5vw, 58px) clamp(48px, 5.8vw, 72px);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.62)),
    radial-gradient(circle at 12% 18%, rgba(0, 113, 227, 0.10), transparent 36%);
  box-shadow: var(--shadow-md, 0 18px 54px rgba(0, 0, 0, 0.08));
}

.language-panel-copy h2 {
  margin: 0;
  color: var(--ink, #1d1d1f);
  font-size: clamp(2.8rem, 6vw, 5.4rem);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.06em;
}

.language-info-toggle {
  position: absolute;
  top: 28px;
  left: 28px;
  z-index: 4;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: var(--blue, #0071e3);
  color: #fff;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(0, 113, 227, 0.2);
  transition: transform var(--duration, 260ms) var(--ease, cubic-bezier(0.2, 0.8, 0.2, 1));
}

.language-info-toggle:hover,
.language-info-toggle.is-open {
  transform: scale(1.06);
}

.language-info-toggle span {
  transition: transform var(--duration, 260ms) var(--ease, cubic-bezier(0.2, 0.8, 0.2, 1));
}

.language-info-toggle.is-open span {
  transform: rotate(45deg);
}

.language-info-popover {
  position: absolute;
  top: 22px;
  left: 76px;
  right: 28px;
  z-index: 3;
  width: auto;
  max-width: none;
  border: 1px solid rgba(0, 113, 227, 0.14);
  border-radius: 24px;
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 44px rgba(29, 29, 31, 0.12);
  opacity: 0;
  transform: translateY(-4px) scale(0.98);
  pointer-events: none;
  transition:
    opacity var(--duration-fast, 180ms) var(--ease, cubic-bezier(0.2, 0.8, 0.2, 1)),
    transform var(--duration-fast, 180ms) var(--ease, cubic-bezier(0.2, 0.8, 0.2, 1));
}

.language-info-popover.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.language-info-popover p {
  margin: 0;
  color: var(--ink-72, rgba(29, 29, 31, 0.72));
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.35;
  white-space: normal;
}

.language-chart {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.language-row {
  display: grid;
  grid-template-columns: minmax(92px, 0.32fr) minmax(0, 1fr) minmax(72px, max-content);
  gap: 16px;
  align-items: center;
}

.language-name,
.language-value {
  color: var(--ink-82, rgba(29, 29, 31, 0.82));
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.15;
}

.language-value {
  justify-self: end;
  color: var(--muted, #6e6e73);
  font-variant-numeric: tabular-nums;
}

.language-track {
  position: relative;
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(29, 29, 31, 0.08);
}

.language-bar {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--language-size, 0%);
  border-radius: inherit;
  background: var(--language-color, var(--blue, #0071e3));
  box-shadow:
    0 3px 12px color-mix(in srgb, var(--language-color, #0071e3) 28%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
  transform: scaleX(0);
  transform-origin: left center;
}

.language-panel.is-visible .language-bar,
.language-panel:not(.reveal) .language-bar {
  animation: language-bar-enter var(--language-duration, 2300ms) var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1)) forwards;
  animation-delay: var(--language-delay, 0ms);
}

@keyframes language-bar-enter {
  0% {
    transform: scaleX(0);
  }

  64% {
    transform: scaleX(var(--language-spring-max, 1.03));
  }

  80% {
    transform: scaleX(var(--language-spring-min, 0.985));
  }

  100% {
    transform: scaleX(1);
  }
}

/* Optional note cards if the page later adds them */
.lab-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding-bottom: 80px;
}

.lab-card {
  min-height: 300px;
  border: 1px solid rgba(29, 29, 31, 0.08);
  border-radius: var(--radius, 8px);
  padding: 26px;
  background: var(--paper, #fff);
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(29, 29, 31, 0.04));
}

.lab-card strong {
  display: block;
  margin: 0 0 16px;
  color: var(--blue, #0071e3);
  font-size: 0.92rem;
}

.lab-card h2 {
  margin-bottom: 14px;
  color: var(--ink, #1d1d1f);
  font-size: clamp(1.35rem, 2.2vw, 1.8rem);
  line-height: 1.2;
}

.lab-card p {
  color: var(--muted, #6e6e73);
  line-height: 1.72;
}

/* Edge AI architecture */
.edge-architecture {
  --edge-line-x: 34px;
  position: relative;
  width: min(calc(100% - 32px), 1240px);
  margin: 72px auto 118px;
  padding: clamp(24px, 4vw, 56px) 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.edge-architecture-head {
  max-width: 980px;
  margin-bottom: clamp(40px, 6vw, 78px);
}

.edge-architecture-head h2 {
  max-width: 1040px;
  margin: 0 0 18px;
  color: var(--ink, #1d1d1f);
  font-size: clamp(42px, 7.4vw, 104px);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.078em;
}

.edge-architecture-head p:not(.eyebrow) {
  max-width: 860px;
  color: var(--ink-68, rgba(29, 29, 31, 0.68));
  font-size: clamp(16px, 2vw, 21px);
  line-height: 1.7;
}

.edge-architecture-body {
  display: grid;
  grid-template-columns: minmax(220px, 0.62fr) minmax(0, 1.9fr);
  gap: clamp(28px, 5vw, 68px);
  align-items: start;
}

.edge-architecture-aside {
  position: sticky;
  top: 84px;
  min-height: 520px;
  padding: 0 0 0 26px;
  border-left: 2px solid rgba(0, 113, 227, 0.62);
}

.edge-architecture-aside::after {
  content: "";
  position: absolute;
  left: -6px;
  top: 0;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--blue, #0071e3);
  box-shadow: 0 0 0 8px rgba(0, 113, 227, 0.12);
}

.edge-architecture-label {
  display: block;
  margin-bottom: 18px;
  color: var(--blue, #0071e3);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.edge-architecture-aside strong {
  display: block;
  max-width: 360px;
  color: var(--ink, #1d1d1f);
  font-size: clamp(26px, 3.2vw, 44px);
  line-height: 1.02;
  letter-spacing: -0.06em;
}

.edge-architecture-aside p {
  max-width: 360px;
  margin: 18px 0 0;
  color: var(--ink-68, rgba(29, 29, 31, 0.68));
  line-height: 1.72;
}

.edge-flow {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.edge-flow::before {
  content: "";
  position: absolute;
  left: var(--edge-line-x);
  top: 0;
  bottom: 0;
  width: 2px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(0, 113, 227, 0), rgba(0, 113, 227, 0.58), rgba(139, 92, 246, 0.42), rgba(0, 140, 90, 0));
  transform: translateX(-50%);
  pointer-events: none;
}

.edge-flow-item,
.edge-flow-item-lg,
.edge-flow-item-tall,
.edge-flow-item-wide {
  position: relative;
  display: grid;
  width: auto;
  min-height: 0;
  margin: 0;
  padding: clamp(26px, 4vw, 48px) 0 clamp(26px, 4vw, 48px) clamp(78px, 8vw, 124px);
  border: 0;
  background: transparent;
  box-shadow: none;
}

.edge-flow-item::before {
  content: "";
  position: absolute;
  left: var(--edge-line-x) !important;
  top: clamp(34px, 4vw, 56px) !important;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.95);
  border-radius: 999px;
  background: var(--blue, #0071e3);
  box-shadow:
    0 0 0 8px rgba(0, 113, 227, 0.11),
    0 18px 40px rgba(0, 113, 227, 0.18);
  transform: translate(-50%, -50%) !important;
  transition: none !important;
  pointer-events: none;
}

.edge-flow-item::after,
.edge-flow-item:hover::after,
.edge-flow-item:focus-within::after {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  border: 0 !important;
  background: none !important;
  box-shadow: none !important;
  opacity: 0 !important;
  content: none !important;
}

.edge-flow-item,
.edge-flow-item:hover,
.edge-flow-item:focus-within {
  border-top: 0 !important;
  border-bottom: 0 !important;
  outline-offset: 0;
  transform: none !important;
}

.edge-flow-item:hover::before,
.edge-flow-item:focus-within::before,
.edge-flow-item.is-visible::before {
  left: var(--edge-line-x) !important;
  top: clamp(34px, 4vw, 56px) !important;
  transform: translate(-50%, -50%) !important;
}

.edge-flow-item+.edge-flow-item {
  border-top: 0 !important;
}

.edge-flow-item>* {
  transform: none;
}

.edge-flow-item:nth-child(3)::before {
  background: var(--purple, #8b5cf6);
  box-shadow:
    0 0 0 8px rgba(139, 92, 246, 0.12),
    0 18px 40px rgba(139, 92, 246, 0.18);
}

.edge-flow-item:nth-child(5)::before {
  background: var(--green, #008c5a);
  box-shadow:
    0 0 0 8px rgba(0, 140, 90, 0.12),
    0 18px 40px rgba(0, 140, 90, 0.18);
}

.edge-flow-item span {
  display: block;
  margin-bottom: 18px;
  color: var(--blue, #0071e3);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.edge-flow-item h3 {
  max-width: 820px;
  margin: 0 0 14px;
  color: var(--ink, #1d1d1f);
  font-size: clamp(30px, 4.6vw, 64px);
  line-height: 0.96;
  letter-spacing: -0.068em;
}

.edge-flow-item p {
  max-width: 760px;
  margin: 0;
  color: var(--ink-68, rgba(29, 29, 31, 0.68));
  font-size: clamp(16px, 1.8vw, 20px);
  line-height: 1.72;
}

.edge-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.edge-tags b {
  display: inline;
  min-height: 0;
  border: 0;
  border-radius: 0;
  padding: 0;
  color: var(--ink-82, rgba(59, 19, 19, 0.82));
  background: transparent;
  box-shadow: none;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.edge-demo-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  margin-top: 22px;
  padding: 12px 16px;
  border-radius: 999px;
  background: #1d1d1f;
  color: #f5f5f7;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .12);
  transition: transform .2s ease, opacity .2s ease, box-shadow .2s ease;
}

.edge-demo-link small {
  color: rgba(245, 245, 247, .68);
  font-size: 12px;
  font-weight: 700;
}

.edge-demo-link::after {
  content: "↗";
  color: rgba(245, 245, 247, .82);
  font-size: 13px;
  transform: translateY(-1px);
}

.edge-demo-link:hover {
  transform: translateY(-1px);
  opacity: .92;
  box-shadow: 0 16px 34px rgba(0, 0, 0, .16);
}

.edge-demo-link:focus-visible {
  outline: 3px solid rgba(0, 102, 204, .25);
  outline-offset: 4px;
}

.edge-render-visual {
  position: relative;
  width: min(100%, 680px);
  height: 180px;
  margin: 28px 0 4px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 30px;
  background:
    radial-gradient(circle at 50% 50%, rgba(0, 113, 227, 0.18), transparent 42%),
    linear-gradient(135deg, rgba(10, 14, 28, 0.94), rgba(23, 28, 48, 0.84));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 26px 70px rgba(0, 0, 0, 0.14);
}

.edge-render-visual::before,
.edge-render-visual::after {
  content: "";
  position: absolute;
  inset: 24px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  transform: rotateX(62deg) rotateZ(-12deg);
  animation: edge-orbit-spin 12s linear infinite;
}

.edge-render-visual::after {
  inset: 42px;
  opacity: 0.6;
  animation-duration: 8s;
  animation-direction: reverse;
}

.edge-render-visual i {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 28px rgba(0, 113, 227, 0.8);
  animation: edge-node-float 4.8s ease-in-out infinite;
}

.edge-render-visual i:nth-child(1) {
  left: 18%;
  top: 28%;
}

.edge-render-visual i:nth-child(2) {
  left: 44%;
  top: 18%;
  animation-delay: 320ms;
}

.edge-render-visual i:nth-child(3) {
  left: 68%;
  top: 42%;
  animation-delay: 640ms;
}

.edge-render-visual i:nth-child(4) {
  left: 36%;
  top: 68%;
  animation-delay: 960ms;
}

.edge-render-visual i:nth-child(5) {
  left: 82%;
  top: 72%;
  animation-delay: 1280ms;
}

@keyframes edge-orbit-spin {
  from {
    transform: rotateX(62deg) rotateZ(-12deg);
  }

  to {
    transform: rotateX(62deg) rotateZ(348deg);
  }
}

@keyframes edge-node-float {

  0%,
  100% {
    opacity: 0.72;
    transform: translate3d(0, 0, 0) scale(1);
  }

  50% {
    opacity: 1;
    transform: translate3d(0, -10px, 0) scale(1.18);
  }
}

.edge-runtime-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: clamp(28px, 5vw, 56px);
  border-top: 1px solid rgba(29, 29, 31, 0.10);
  border-bottom: 1px solid rgba(29, 29, 31, 0.10);
}

.edge-runtime-strip div {
  border-right: 1px solid rgba(29, 29, 31, 0.10);
  padding: 22px;
}

.edge-runtime-strip div:last-child {
  border-right: 0;
}

.edge-runtime-strip span {
  display: block;
  margin-bottom: 8px;
  color: rgba(29, 29, 31, 0.5);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.edge-runtime-strip strong {
  display: block;
  color: var(--ink, #1d1d1f);
  font-size: 17px;
  line-height: 1.2;
}

.runtime-ok {
  color: var(--green, #008c5a) !important;
}

.runtime-warn {
  color: var(--muted, #6e6e73) !important;
}

@media (max-width: 960px) {
  .language-panel {
    grid-template-columns: 1fr;
  }

  .lab-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .edge-architecture-body {
    grid-template-columns: 1fr;
  }

  .edge-architecture-aside {
    position: relative;
    top: auto;
    min-height: 0;
  }
}

@media (max-width: 640px) {
  .lab-main {
    padding-top: 44px;
  }

  .lab-hero,
  .language-panel,
  .edge-architecture,
  .lab-grid {
    width: min(calc(100% - 24px), 100%);
  }

  .language-panel {
    grid-template-columns: 1fr;
    gap: 26px;
    padding: 42px 20px 28px;
    overflow: hidden;
  }

  .language-info-toggle {
    position: absolute;
    top: 10px;
    left: 18px;
    width: 30px;
    height: 30px;
    min-width: 30px;
    min-height: 30px;
    padding: 0;
    margin: 0;
    border-radius: 999px;
    font-size: 1rem;
    line-height: 1;
    box-shadow: 0 8px 18px rgba(0, 113, 227, 0.16);
  }

  .language-info-toggle span {
    display: block;
    line-height: 1;
  }

  .language-info-popover {
    position: absolute;
    top: 14px;
    left: 56px;
    right: 18px;
    width: auto;
    max-width: none;
    margin: 0;
    border-radius: 14px;
    padding: 7px 10px;
    transform: translateY(-3px) scale(0.98);
  }

  .language-info-popover.is-open {
    transform: translateY(0) scale(1);
  }

  .language-info-popover p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    white-space: normal;
    font-size: 0.78rem;
    line-height: 1.25;
    line-clamp: 1;
  }

  .language-row {
    grid-template-columns: minmax(92px, 0.72fr) minmax(0, 1fr);
    gap: 8px 12px;
  }

  .language-track {
    grid-column: 2;
  }

  .language-value {
    grid-column: 2;
    justify-self: start;
  }

  .lab-grid {
    grid-template-columns: 1fr;
  }

  .edge-architecture {
    --edge-line-x: 18px;
    padding: 30px 20px;
  }

  .edge-flow-item,
  .edge-flow-item-lg,
  .edge-flow-item-tall,
  .edge-flow-item-wide {
    padding-left: 52px;
  }

  .edge-flow-item h3 {
    letter-spacing: -0.052em;
  }

  .edge-demo-link {
    width: 100%;
    justify-content: center;
  }

  .edge-runtime-strip {
    grid-template-columns: 1fr;
  }

  .edge-runtime-strip div,
  .edge-runtime-strip div:last-child {
    border-right: 0;
  }

  .edge-runtime-strip div+div {
    border-top: 1px solid rgba(29, 29, 31, 0.10);
  }
}

@media (max-width: 420px) {
  .lab-hero h1 {
    font-size: clamp(2.2rem, 16vw, 3.2rem);
  }

  .language-panel-copy h2,
  .edge-architecture-head h2 {
    letter-spacing: -0.05em;
  }
}

@media (prefers-reduced-motion: reduce) {

  .language-bar,
  .edge-render-visual::before,
  .edge-render-visual::after,
  .edge-render-visual i {
    animation: none !important;
  }

  .edge-render-visual i {
    transform: none !important;
  }
}

/* Locator dot: final Apple Maps style
   The real dot is rendered by .locator-dot-wrapper in lab.html.
   Old edge-flow pseudo dots are disabled to avoid duplicate markers. */
.lab-page .edge-flow-item::before,
.lab-page .edge-flow-item::after,
.lab-page .edge-flow-item:hover::before,
.lab-page .edge-flow-item:hover::after,
.lab-page .edge-flow-item:focus-within::before,
.lab-page .edge-flow-item:focus-within::after,
.lab-page .edge-flow-item.is-visible::before,
.lab-page .edge-flow-item.is-visible::after {
  content: none !important;
  display: none !important;
}

.lab-page .edge-flow-item,
.lab-page .edge-flow-item:hover,
.lab-page .edge-flow-item:focus-within {
  position: relative;
  overflow: visible;
  transform: none !important;
}

.lab-page .edge-flow-item>.locator-dot-wrapper {
  position: absolute !important;
  left: var(--edge-line-x) !important;
  top: clamp(34px, 4vw, 56px) !important;
  width: 20px;
  height: 20px;
  transform: translate3d(-50%, -50%, 0) !important;
  transform-origin: center center;
  pointer-events: none;
  z-index: 8;
}

.lab-page .locator-dot-wrapper .dot-outer,
.lab-page .locator-dot-wrapper .dot-inner {
  position: absolute;
  left: 50%;
  top: 50%;
  border: 0;
  outline: 0;
  border-radius: 999px;
  pointer-events: none;
}

.lab-page .locator-dot-wrapper .dot-outer {
  width: 20px;
  height: 20px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow:
    0 1px 2px rgba(29, 29, 31, 0.06),
    0 6px 14px rgba(0, 113, 227, 0.08);
  transform: translate(-50%, -50%);
}

.lab-page .locator-dot-wrapper .dot-inner {
  width: 7px;
  height: 7px;
  background: var(--blue, #0071e3);
  box-shadow: 0 2px 6px rgba(0, 113, 227, 0.22);
  transform: translate(-50%, -50%) scale(1);
  transform-origin: center center;
  will-change: transform, opacity;
  animation: locator-dot-breathe 3.2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.lab-page .edge-flow-item:hover>.locator-dot-wrapper,
.lab-page .edge-flow-item:focus-within>.locator-dot-wrapper {
  left: var(--edge-line-x) !important;
  transform: translate3d(-50%, -50%, 0) !important;
}

@keyframes locator-dot-breathe {

  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.92;
  }

  50% {
    transform: translate(-50%, -50%) scale(1.45);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lab-page .locator-dot-wrapper .dot-inner {
    animation: locator-dot-breathe 3.2s cubic-bezier(0, 0, 0.2, 1) infinite !important;
  }
}

@media (max-width: 640px) {
  .lab-page .edge-flow-item>.locator-dot-wrapper {
    width: 18px;
    height: 18px;
  }

  .lab-page .locator-dot-wrapper .dot-outer {
    width: 18px;
    height: 18px;
  }

  .lab-page .locator-dot-wrapper .dot-inner {
    width: 6px;
    height: 6px;
  }
}

/* Final cleanup: waterfall section without card frame or gray divider lines */
.lab-page .edge-architecture {
  overflow: visible !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.lab-page .edge-architecture::before,
.lab-page .edge-architecture::after,
.lab-page .edge-architecture-body::before,
.lab-page .edge-architecture-body::after,
.lab-page .edge-flow::after,
.lab-page .edge-flow-item::after,
.lab-page .edge-runtime-strip::before,
.lab-page .edge-runtime-strip::after {
  content: none !important;
  display: none !important;
}

.lab-page .edge-flow-item,
.lab-page .edge-flow-item:hover,
.lab-page .edge-flow-item:focus-within {
  border: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}

.lab-page .edge-runtime-strip {
  border: 0 !important;
  background: transparent !important;
}

.lab-page .edge-runtime-strip div {
  border: 0 !important;
  background: transparent !important;
}

.lab-page .edge-render-visual {
  border: 0 !important;
}

/* ==========================================================
   Complex UI Architecture
   ========================================================== */

.lab-page .ui-architecture-demo {
  display: grid;
  gap: 16px;
  width: min(100%, 900px);
  margin-top: 24px;
}

.lab-page .ui-architecture-demo span,
.lab-page .ui-architecture-demo pre,
.lab-page .ui-architecture-demo button {
  margin: 0;
  text-transform: none;
  letter-spacing: normal;
  -webkit-text-fill-color: currentColor;
}

.lab-page .ui-arch-flow {
  display: grid;
  grid-template-columns: minmax(118px, 1fr) 16px minmax(138px, 1fr) 16px minmax(126px, 1fr) 16px minmax(150px, 1fr);
  align-items: center;
  gap: 10px;
}

.lab-page .ui-arch-node {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid rgba(0, 113, 227, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  color: rgba(29, 29, 31, 0.62);
  box-shadow: 0 10px 26px rgba(29, 29, 31, 0.055);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.18;
  text-align: center;
  white-space: normal;
  transition:
    color 0.24s ease,
    border-color 0.24s ease,
    background 0.24s ease,
    transform 0.24s ease,
    box-shadow 0.24s ease;
}

.lab-page .ui-arch-node.is-active {
  color: var(--blue, #0071e3);
  border-color: rgba(0, 113, 227, 0.34);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 16px 38px rgba(0, 113, 227, 0.14);
  transform: translateY(-2px);
}

.lab-page .ui-arch-flow i {
  display: block;
  width: 16px;
  height: 1px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(0, 113, 227, 0.16), rgba(0, 113, 227, 0.48));
}

.lab-page .ui-arch-console {
  overflow: hidden;
  border: 1px solid rgba(29, 29, 31, 0.08);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.64)),
    radial-gradient(circle at 12% 0%, rgba(0, 113, 227, 0.08), transparent 34%);
  box-shadow: 0 18px 46px rgba(29, 29, 31, 0.07);
}

.lab-page .ui-arch-console-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(29, 29, 31, 0.08);
  color: rgba(29, 29, 31, 0.78);
}

.lab-page .ui-arch-console-head>span {
  display: inline-flex;
  align-items: center;
  color: rgba(29, 29, 31, 0.78);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.2;
}

.lab-page .ui-arch-run {
  border: 1px solid rgba(0, 113, 227, 0.18);
  border-radius: 999px;
  padding: 7px 13px;
  color: var(--ink, #1d1d1f);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 20px rgba(29, 29, 31, 0.045);
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease,
    opacity 0.2s ease;
}

.lab-page .ui-arch-run:hover {
  border-color: rgba(0, 113, 227, 0.32);
  background: rgba(255, 255, 255, 0.98);
  transform: translateY(-1px);
}

.lab-page .ui-arch-run:disabled {
  cursor: default;
  opacity: 0.58;
  transform: none;
}

.lab-page .ui-arch-log {
  display: flex;
  flex-direction: column;
  gap: 7px;
  height: 122px;
  min-height: 122px;
  max-height: 122px;
  overflow: hidden;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(29, 29, 31, 0.08);
  background: rgba(255, 255, 255, 0.22);
}

.lab-page .ui-arch-log span {
  display: block;
  flex: 0 0 22px;
  min-height: 22px;
  max-height: 22px;
  overflow: hidden;
  color: rgba(29, 29, 31, 0.62);
  font-size: 12px;
  font-weight: 750;
  line-height: 22px;
  text-overflow: ellipsis;
  white-space: nowrap;
  -webkit-text-fill-color: rgba(29, 29, 31, 0.62);
}

.lab-page .ui-arch-log span:first-child {
  color: var(--blue, #0071e3);
  font-weight: 850;
  -webkit-text-fill-color: var(--blue, #0071e3);
}

.lab-page .ui-arch-state {
  display: block;
  max-height: 168px;
  margin: 0 16px 16px;
  overflow: auto;
  padding: 12px 14px;
  border: 1px solid rgba(29, 29, 31, 0.05);
  border-radius: 18px;
  background: rgba(29, 29, 31, 0.045);
  color: rgba(29, 29, 31, 0.68);
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  box-sizing: border-box;
}

@media (max-width: 860px) {
  .lab-page .ui-architecture-demo {
    width: 100%;
  }

  .lab-page .ui-arch-flow {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .lab-page .ui-arch-flow i {
    width: 1px;
    height: 14px;
    margin: 0 auto;
    background: linear-gradient(180deg, rgba(0, 113, 227, 0.16), rgba(0, 113, 227, 0.48));
  }

  .lab-page .ui-arch-node {
    min-height: 40px;
    font-size: 12px;
  }

  .lab-page .ui-arch-log {
    height: 112px;
    min-height: 112px;
    max-height: 112px;
    padding: 12px 14px;
  }

  .lab-page .ui-arch-log span {
    flex-basis: 21px;
    min-height: 21px;
    max-height: 21px;
    line-height: 21px;
  }

  .lab-page .ui-arch-state {
    margin: 0 14px 14px;
    font-size: 11px;
  }
}

.immersive-entry {
  position: relative;
  overflow: hidden;
}

.immersive-entry::before {
  content: "";
  position: absolute;
  inset: -40%;
  background:
    radial-gradient(circle, rgba(120, 166, 255, .28), transparent 34%),
    conic-gradient(from 90deg, transparent, rgba(191, 191, 193, .28), transparent);
  opacity: .72;
  animation: immersivePortalSpin 6s linear infinite;
  pointer-events: none;
}

.immersive-entry span,
.immersive-entry small {
  position: relative;
  z-index: 1;
}

@keyframes immersivePortalSpin {
  to {
    transform: rotate(360deg);
  }
}


.page-transition-door {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  overflow: hidden;
}

.page-transition-door span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 50%;
  background:
    radial-gradient(circle at 50% 100%, rgba(120, 166, 255, .20), transparent 40%),
    linear-gradient(180deg, #05070d, #02030a);
  transform: translateY(-100%);
  transition: transform .62s cubic-bezier(.76, 0, .24, 1);
}

.page-transition-door span:last-child {
  bottom: 0;
  transform: translateY(100%);
  background:
    radial-gradient(circle at 50% 0%, rgba(120, 166, 255, .18), transparent 40%),
    linear-gradient(0deg, #05070d, #02030a);
}

.page-transition-door.is-closing span {
  transform: translateY(0);
}

/* ==========================================================
   Complex UI Architecture hard override
   Fix nested span styles inherited from .edge-flow-item span
   ========================================================== */

.lab-page .edge-flow-item .ui-architecture-demo {
  display: grid !important;
  gap: 16px !important;
  width: min(100%, 900px) !important;
  margin-top: 24px !important;
}

.lab-page .edge-flow-item .ui-architecture-demo span,
.lab-page .edge-flow-item .ui-architecture-demo small,
.lab-page .edge-flow-item .ui-architecture-demo strong,
.lab-page .edge-flow-item .ui-architecture-demo pre,
.lab-page .edge-flow-item .ui-architecture-demo button {
  margin: 0 !important;
  color: inherit !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  -webkit-text-fill-color: currentColor !important;
}

.lab-page .edge-flow-item .ui-arch-flow {
  display: grid !important;
  grid-template-columns: minmax(118px, 1fr) 16px minmax(138px, 1fr) 16px minmax(126px, 1fr) 16px minmax(150px, 1fr) !important;
  align-items: center !important;
  gap: 10px !important;
}

.lab-page .edge-flow-item .ui-arch-node {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 0 !important;
  min-height: 42px !important;
  padding: 10px 14px !important;
  border: 1px solid rgba(0, 113, 227, 0.18) !important;
  border-radius: 18px !important;
  background: rgba(255, 255, 255, 0.72) !important;
  color: rgba(29, 29, 31, 0.62) !important;
  box-shadow: 0 10px 26px rgba(29, 29, 31, 0.055) !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  line-height: 1.18 !important;
  text-align: center !important;
  white-space: normal !important;
  -webkit-text-fill-color: rgba(29, 29, 31, 0.62) !important;
}

.lab-page .edge-flow-item .ui-arch-node.is-active {
  color: var(--blue, #0071e3) !important;
  border-color: rgba(0, 113, 227, 0.34) !important;
  background: rgba(255, 255, 255, 0.94) !important;
  box-shadow: 0 16px 38px rgba(0, 113, 227, 0.14) !important;
  transform: translateY(-2px) !important;
  -webkit-text-fill-color: var(--blue, #0071e3) !important;
}

.lab-page .edge-flow-item .ui-arch-flow i {
  display: block !important;
  width: 16px !important;
  height: 1px !important;
  border-radius: 999px !important;
  background: linear-gradient(90deg, rgba(0, 113, 227, 0.16), rgba(0, 113, 227, 0.48)) !important;
}

.lab-page .edge-flow-item .ui-arch-console {
  overflow: hidden !important;
  border: 1px solid rgba(29, 29, 31, 0.08) !important;
  border-radius: 24px !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.64)),
    radial-gradient(circle at 12% 0%, rgba(0, 113, 227, 0.08), transparent 34%) !important;
  box-shadow: 0 18px 46px rgba(29, 29, 31, 0.07) !important;
}

.lab-page .edge-flow-item .ui-arch-console-head {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 14px !important;
  padding: 14px 16px !important;
  border-bottom: 1px solid rgba(29, 29, 31, 0.08) !important;
  color: rgba(29, 29, 31, 0.78) !important;
}

.lab-page .edge-flow-item .ui-arch-console-head > span {
  display: inline-flex !important;
  align-items: center !important;
  color: rgba(29, 29, 31, 0.78) !important;
  font-size: 13px !important;
  font-weight: 900 !important;
  line-height: 1.2 !important;
  -webkit-text-fill-color: rgba(29, 29, 31, 0.78) !important;
}

.lab-page .edge-flow-item .ui-arch-run {
  border: 1px solid rgba(0, 113, 227, 0.18) !important;
  border-radius: 999px !important;
  padding: 7px 13px !important;
  color: var(--ink, #1d1d1f) !important;
  background: rgba(255, 255, 255, 0.88) !important;
  box-shadow: 0 8px 20px rgba(29, 29, 31, 0.045) !important;
  font: inherit !important;
  font-size: 12px !important;
  font-weight: 850 !important;
  cursor: pointer !important;
  -webkit-text-fill-color: var(--ink, #1d1d1f) !important;
}

.lab-page .edge-flow-item .ui-arch-log {
  display: flex !important;
  flex-direction: column !important;
  gap: 7px !important;
  height: 122px !important;
  min-height: 122px !important;
  max-height: 122px !important;
  overflow: hidden !important;
  padding: 14px 16px !important;
  border-bottom: 1px solid rgba(29, 29, 31, 0.08) !important;
  background: rgba(255, 255, 255, 0.22) !important;
}

.lab-page .edge-flow-item .ui-arch-log span {
  display: block !important;
  flex: 0 0 22px !important;
  min-height: 22px !important;
  max-height: 22px !important;
  overflow: hidden !important;
  color: rgba(29, 29, 31, 0.62) !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important;
  font-size: 12px !important;
  font-weight: 750 !important;
  line-height: 22px !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  -webkit-text-fill-color: rgba(29, 29, 31, 0.62) !important;
}

.lab-page .edge-flow-item .ui-arch-log span:first-child {
  color: var(--blue, #0071e3) !important;
  font-weight: 850 !important;
  -webkit-text-fill-color: var(--blue, #0071e3) !important;
}

.lab-page .edge-flow-item .ui-arch-state {
  display: block !important;
  max-height: 168px !important;
  margin: 0 16px 16px !important;
  overflow: auto !important;
  padding: 12px 14px !important;
  border: 1px solid rgba(29, 29, 31, 0.05) !important;
  border-radius: 18px !important;
  background: rgba(29, 29, 31, 0.045) !important;
  color: rgba(29, 29, 31, 0.68) !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important;
  font-size: 12px !important;
  line-height: 1.55 !important;
  white-space: pre-wrap !important;
  box-sizing: border-box !important;
  -webkit-text-fill-color: rgba(29, 29, 31, 0.68) !important;
}

@media (max-width: 860px) {
  .lab-page .edge-flow-item .ui-arch-flow {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .lab-page .edge-flow-item .ui-arch-flow i {
    width: 1px !important;
    height: 14px !important;
    margin: 0 auto !important;
    background: linear-gradient(180deg, rgba(0, 113, 227, 0.16), rgba(0, 113, 227, 0.48)) !important;
  }
}

/* Apple-style button refinement: compact rectangular controls, not pill-heavy CTAs. */
.lab-page .language-info-toggle {
  border-radius: 11px;
  box-shadow:
    0 10px 24px rgba(0, 113, 227, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.lab-page .edge-demo-link {
  min-height: 44px;
  border-radius: 12px;
  padding: 10px 14px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.1);
}

.lab-page .ui-arch-run,
.lab-page .edge-flow-item .ui-architecture-demo button {
  border-radius: 10px !important;
}

.lab-page .ui-arch-run {
  display: inline-flex !important;
  min-height: 34px !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 12px !important;
  border: 1px solid rgba(0, 113, 227, 0.18) !important;
  background: rgba(255, 255, 255, 0.88) !important;
  color: var(--blue, #0071e3) !important;
  font-size: 13px !important;
  font-weight: 850 !important;
  text-decoration: none !important;
}

/* 这是 Lab 可运行工具的统一控件样式，避免按钮和输出区各自成风格。 */
.lab-page .edge-tool {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.lab-page .edge-tool-button {
  width: min(100%, 220px);
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(0, 113, 227, 0.2);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(245, 249, 255, 0.72)),
    rgba(255, 255, 255, 0.72);
  box-shadow:
    0 14px 28px rgba(0, 113, 227, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
  color: var(--blue, #0071e3);
  cursor: pointer;
  font-size: 13px;
  font-weight: 850;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.lab-page .edge-tool-button:hover {
  border-color: rgba(0, 113, 227, 0.36);
  box-shadow:
    0 18px 34px rgba(0, 113, 227, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.96);
  transform: translateY(-1px);
}

.lab-page .edge-tool-button:active {
  transform: translateY(1px) scale(0.985);
}

.lab-page .edge-tool-output {
  display: block;
  min-height: 72px;
  padding: 14px 16px;
  border: 1px solid rgba(29, 29, 31, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
  color: rgba(29, 29, 31, 0.68);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.6;
  transition:
    border-color 220ms ease,
    box-shadow 220ms ease,
    color 220ms ease;
}

.lab-page .edge-tool-output.is-updated {
  border-color: rgba(0, 113, 227, 0.28);
  box-shadow: 0 12px 28px rgba(0, 113, 227, 0.1);
  color: rgba(29, 29, 31, 0.82);
}
