.main-nav {
  padding-right: 0;
  padding-left: 0;
}

.main-nav .brand-logo {
  position: static;
  display: grid;
  flex: 0 0 50px;
  width: 50px;
  height: 50px;
  padding: 0;
  place-items: center;
  transform: none;
}

.main-nav .brand-logo::after { display: none; }

.embed-frame {
  height: calc(100vh - 112px);
  min-height: 744px;
}

/* Theme switch component in top-left */
.theme-switch-container {
  position: absolute;
  left: 28px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 25;
  display: flex;
  align-items: center;
}

.theme-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.theme-switch:focus-visible .theme-switch-track {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}

.theme-switch-track {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: 100%;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  transition: background-color 200ms ease, border-color 200ms ease;
  overflow: hidden;
}

.theme-switch-thumb {
  position: absolute;
  top: 3px;
  left: 0;
  width: 28px;
  height: 28px;
  border-radius: 9999px;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  z-index: 2;
  transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1), background-color 200ms ease;
  transform: translateX(46px);
}

.theme-switch-icon {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  pointer-events: none;
  transition: color 200ms ease, transform 200ms ease, opacity 200ms ease;
}

.theme-switch-icon--sun {
  left: 2px;
  color: rgba(255, 255, 255, 0.4);
  transform: scale(0.9);
}

.theme-switch-icon--moon {
  right: 2px;
  color: #ffffff;
  transform: scale(1.1);
}

/* Light theme for ThemeSwitch */
[data-theme="light"] .theme-switch-track {
  background: rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.14);
}

[data-theme="light"] .theme-switch-thumb {
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  transform: translateX(4px);
}

[data-theme="light"] .theme-switch-icon--sun {
  color: #09090b;
  transform: scale(1.1);
}

[data-theme="light"] .theme-switch-icon--moon {
  color: rgba(0, 0, 0, 0.35);
  transform: scale(0.9);
}

/* Customer service trigger & popover in topbar */
.customer-service-container {
  position: absolute;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 25;
  display: flex;
  align-items: center;
}

.customer-service-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 16px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #e4e4e7;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease, box-shadow 200ms ease, transform 150ms ease;
  -webkit-tap-highlight-color: transparent;
}

.customer-service-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.28);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.customer-service-btn:active {
  transform: scale(0.97);
}

.customer-service-btn:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}

.customer-service-icon {
  flex-shrink: 0;
  color: currentColor;
}

/* Translucent Frosted Glass Popover */
.customer-service-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px) scale(0.96);
  transform-origin: top right;
  transition: opacity 220ms cubic-bezier(0.16, 1, 0.3, 1), transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.customer-service-popover::before {
  content: "";
  position: absolute;
  top: -14px;
  left: 0;
  right: 0;
  height: 14px;
}

.customer-service-container:hover .customer-service-popover,
.customer-service-container:focus-within .customer-service-popover,
.customer-service-popover.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.customer-service-card {
  width: 272px;
  padding: 16px 16px 14px;
  border-radius: 20px;
  background: rgba(18, 19, 24, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 24px 54px -6px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  text-align: center;
}

.customer-service-qr-frame {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 14px;
  background: #ffffff;
  padding: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
}

.customer-service-qr {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 4px;
}

.customer-service-title {
  margin: 12px 0 4px;
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.customer-service-sub {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.72);
  white-space: nowrap;
}

/* Light Theme overrides */
[data-theme="light"] .customer-service-btn {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.12);
  color: #27272a;
}

[data-theme="light"] .customer-service-btn:hover {
  background: rgba(0, 0, 0, 0.09);
  border-color: rgba(0, 0, 0, 0.2);
  color: #09090b;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .customer-service-card {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 20px 48px -6px rgba(0, 0, 0, 0.14), 0 0 0 1px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .customer-service-title {
  color: #09090b;
}

[data-theme="light"] .customer-service-sub {
  color: rgba(0, 0, 0, 0.6);
}

/* Shell & Topbar - Dark Theme (When Home is active) */
.page-shell.is-home-route,
.page-shell:has(.codexlink-home.is-active) {
  padding: 0;
  color: #f5f5f7;
  background: #07070a;
  transition: background-color 200ms ease, color 200ms ease;
}

.page-shell.is-home-route .topbar,
.page-shell:has(.codexlink-home.is-active) .topbar {
  z-index: 20;
  width: 100%;
  min-height: 72px;
  padding: 0 28px;
  border-bottom: 1px solid #ffffff10;
  color: #f4f4f5;
  background: #07070a;
  transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease;
}

.page-shell.is-home-route .main-nav,
.page-shell:has(.codexlink-home.is-active) .main-nav { color: #e8e8eb; }
.page-shell.is-home-route .main-nav a.is-current,
.page-shell:has(.codexlink-home.is-active) .main-nav a.is-current { color: #fff; }

/* Home page route visibility: hide completely when inactive */
.site-page.codexlink-home {
  display: none !important;
}

.site-page.codexlink-home.is-active {
  position: relative;
  display: flex !important;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  min-height: calc(100svh - 72px);
  margin: 0;
  overflow-x: clip;
  padding: 0;
  color: #f5f5f7;
  background: #08090b;
  font-family: Inter, Arial, Helvetica, sans-serif;
  transition: background-color 200ms ease, color 200ms ease;
}

/* Shell & Topbar - Light Theme (When Home is active) */
[data-theme="light"] body {
  background: #f8f9fa !important;
  color: #111216 !important;
}

[data-theme="light"] .page-shell.is-home-route,
[data-theme="light"] .page-shell:has(.codexlink-home.is-active) {
  color: #111216 !important;
  background: #f8f9fa !important;
}

[data-theme="light"] .page-shell.is-home-route .topbar,
[data-theme="light"] .page-shell:has(.codexlink-home.is-active) .topbar {
  border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
  color: #111216 !important;
  background: #ffffff !important;
}

[data-theme="light"] .page-shell.is-home-route .main-nav,
[data-theme="light"] .page-shell:has(.codexlink-home.is-active) .main-nav { color: #5a5d6a !important; }
[data-theme="light"] .page-shell.is-home-route .main-nav a.is-current,
[data-theme="light"] .page-shell:has(.codexlink-home.is-active) .main-nav a.is-current { color: #09090b !important; }

[data-theme="light"] .site-page.codexlink-home.is-active {
  color: #111216 !important;
  background: #f8f9fa !important;
}

.grid-pulse {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  --grid-pulse-cell: 24px;
  --grid-pulse-line: rgba(255, 255, 255, 0.07);
  --grid-pulse-line: color-mix(in oklab, var(--color-foreground, currentColor) 7%, transparent);
  background-image:
    linear-gradient(to right, var(--grid-pulse-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-pulse-line) 1px, transparent 1px);
  background-size: var(--grid-pulse-cell) var(--grid-pulse-cell);
  -webkit-mask-image: linear-gradient(to bottom, #000 92%, transparent);
  mask-image: linear-gradient(to bottom, #000 92%, transparent);
}

[data-theme="light"] .grid-pulse {
  --grid-pulse-line: rgba(0, 0, 0, 0.06);
  -webkit-mask-image: linear-gradient(to bottom, #000 90%, transparent);
  mask-image: linear-gradient(to bottom, #000 90%, transparent);
}

.grid-pulse-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.ailink-home-content {
  --eye-size: clamp(88px, 6.2vw, 128px);
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 100%;
  margin: auto auto;
  padding: 4px clamp(10px, 1.2vw, 24px) 14px;
}

.ailink-hero {
  position: relative;
  z-index: 2;
  width: min(100%, 1120px);
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ailink-hero .lift-card { opacity: 1; transform: none; animation: none; will-change: auto; }

.mouse-following-eyes {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: center;
  width: max-content;
  height: calc(var(--eye-size) + 8px);
  margin: 0 auto clamp(18px, 2.2vh, 32px);
  padding: 0 0 2px;
  pointer-events: none;
  filter: drop-shadow(0 10px 20px #0005);
}

[data-theme="light"] .mouse-following-eyes {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: center;
  width: max-content;
  height: calc(var(--eye-size) + 8px);
  margin: 0 auto clamp(18px, 2.2vh, 32px);
  padding: 0 0 2px;
  pointer-events: none;
  filter: drop-shadow(0 10px 20px #0005);
}

.mouse-following-eye {
  position: relative;
  display: flex;
  width: var(--eye-size);
  height: var(--eye-size);
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: clamp(3px, 0.28vw, 4.5px) solid #050505;
  border-radius: 50%;
  background: #fff;
}

.mouse-following-pupil {
  position: absolute;
  width: 32%;
  height: 32%;
  border-radius: 50%;
  background: #050505;
  transition: transform 5ms linear;
}

.mouse-following-highlight {
  position: absolute;
  right: 10%;
  bottom: 10%;
  width: 36%;
  height: 36%;
  border-radius: 50%;
  background: #fff;
}

.codexlink-title,
.codexlink-description {
  text-shadow:
    0 0 6px #08090b,
    0 0 14px #08090b,
    0 0 30px #08090b,
    0 0 52px #08090b;
}

[data-theme="light"] .codexlink-title,
[data-theme="light"] .codexlink-description {
  text-shadow: none;
}

.ailink-title {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(48px, 4.4vw, 86px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.04em;
  color: #f5f5f7;
  transition: color 200ms ease;
}

.ailink-title .dancing-letters {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  color: inherit;
  user-select: none;
  perspective: 1000px;
}

.ailink-title .dancing-letter {
  font-size: inherit;
  font-weight: 800;
  line-height: inherit;
  letter-spacing: inherit;
  color: inherit;
  display: inline-block;
}

[data-theme="light"] .ailink-title,
[data-theme="light"] .ailink-title .dancing-letters,
[data-theme="light"] .ailink-title .dancing-letter {
  color: #09090b;
}

.dancing-space {
  display: inline-block;
  width: 0.35em;
}

.ailink-description {
  max-width: 980px;
  min-height: auto;
  margin: 14px auto 0;
  color: #a4a6ae;
  font-size: clamp(14px, 1.05vw, 16px);
  line-height: 1.8;
  text-align: center;
  transition: color 200ms ease;
}

[data-theme="light"] .ailink-description {
  max-width: 980px;
  min-height: auto;
  margin: 14px auto 0;
  color: #a4a6ae;
  font-size: clamp(14px, 1.05vw, 16px);
  line-height: 1.8;
  text-align: center;
  transition: color 200ms ease;
}

.ailink-actions {
  margin-top: 18px;
}

.ailink-videos-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
  max-width: 100%;
  margin-top: clamp(20px, 2.2vh, 32px);
  gap: clamp(16px, 1.6vw, 36px);
  padding: 0 clamp(8px, 1vw, 20px);
}

.ailink-video-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

/* 垂直分隔线仅存在于三个视频卡片之间，上方介绍语和统称区域无分隔线 */
.ailink-video-card + .ailink-video-card::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: calc(-0.5 * clamp(16px, 1.6vw, 36px));
  width: 1px;
  background: linear-gradient(transparent, #ffffff32 15%, #ffffff32 85%, transparent);
  pointer-events: none;
  transition: background 200ms ease;
}

[data-theme="light"] .ailink-video-card + .ailink-video-card::before {
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.12) 15%, rgba(0, 0, 0, 0.12) 85%, transparent);
}

.ailink-video-info {
  width: 100%;
  margin-top: 14px;
  text-align: left;
  padding: 0 2px;
}

.ailink-video-title {
  margin: 0;
  text-align: left;
  font-size: clamp(17px, 1.25vw, 22px);
  font-weight: 600;
  line-height: 1.45;
  color: #f4f4f6;
  letter-spacing: -0.02em;
  transition: color 200ms ease;
}

[data-theme="light"] .ailink-video-title {
  color: #111216;
}

.codexlink-title > span { display: block; white-space: nowrap; }
.codexlink-title .dancing-letters {
  display: inline-flex;
  align-items: center;
  perspective: 1000px;
  user-select: none;
  white-space: nowrap;
}
.codexlink-title .codexlink-subtitle {
  display: block;
  margin-top: 12px;
  color: #94969f;
  font-size: clamp(18px, 1.45vw, 28px);
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -.03em;
  transition: color 200ms ease;
}

[data-theme="light"] .codexlink-title .codexlink-subtitle {
  color: #2e3038;
}

.codexlink-description {
  min-height: 54px;
  margin: 20px 0 0;
  color: #a4a6ae;
  font-size: clamp(13px, 0.8vw, 15px);
  line-height: 1.8;
  transition: color 200ms ease;
}

[data-theme="light"] .codexlink-description {
  color: #353842;
}

.codexlink-actions { margin-top: 24px; }
.codexlink-action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

/* Download buttons:
   - Dark theme: white background (#ffffff), dark text/icon (#17171b)
   - Light theme: dark background (#17171b), white text/icon (#ffffff)
*/
.codexlink-button {
  display: inline-flex;
  min-width: 136px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 12px 18px;
  border: 1px solid #ffffff24;
  border-radius: 999px;
  color: #17171b;
  background: #ffffff;
  font: 600 13px/1.3 Inter, Arial, sans-serif;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.codexlink-button:hover { transform: translateY(-2px); background: #e7f1ff; }
.codexlink-button:focus-visible { outline: 2px solid #93c5fd; outline-offset: 3px; }
.tool-download-icon { flex: 0 0 15px; width: 15px; height: 15px; }

.codexlink-button[aria-disabled="true"] {
  color: #4b4d58;
  background: #ffffff;
  cursor: default;
  transform: none;
}

/* In Light Theme: Download buttons become dark */
[data-theme="light"] .codexlink-button {
  color: #ffffff;
  background: #17171b;
  border-color: rgba(0, 0, 0, 0.2);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .codexlink-button:hover {
  background: #27272f;
  transform: translateY(-2px);
}

[data-theme="light"] .codexlink-button[aria-disabled="true"] {
  color: #a1a1aa;
  background: #17171b;
  cursor: default;
  transform: none;
}

.codexlink-platforms {
  margin: 12px 2px 0;
  color: #797c87;
  font: 10px/1.7 ui-monospace, monospace;
  transition: color 200ms ease;
}

[data-theme="light"] .codexlink-platforms {
  color: #4b4d5a;
}

.codexlink-video-section--hero { width: 100%; margin: 18px 0 0; }
.codexlink-video-heading, .codexlink-video-caption { display: none; }
.codexlink-video-player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid #ffffff24;
  border-radius: 12px;
  background: #111216;
  box-shadow: 0 18px 44px #0004;
  outline: none;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

[data-theme="light"] .codexlink-video-player {
  border-color: rgba(0, 0, 0, 0.14);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.12);
}

.codexlink-video-player:focus-visible { outline: 2px solid #93c5fd; outline-offset: 3px; }
.codexlink-video-player video { display: block; width: 100%; height: 100%; object-fit: cover; }
.codexlink-video-player video[hidden] { display: none; }
.codexlink-video-play-overlay { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.codexlink-video-player.is-playing .codexlink-video-play-overlay { display: none; }
.codexlink-video-play-button { display: grid; width: 64px; height: 64px; padding: 0 0 0 3px; place-items: center; border: 0; border-radius: 50%; color: #050506; background: #fff; font-size: 23px; cursor: pointer; pointer-events: auto; }
.codexlink-video-controls { position: absolute; right: 0; bottom: 0; left: 0; padding: 30px 10px 6px; color: #fff; background: linear-gradient(to top, #000c, transparent); transition: opacity 200ms ease; }
.codexlink-video-player.is-playing:not(:hover):not(:focus-within) .codexlink-video-controls { opacity: 0; }
.codexlink-video-progress-row { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; font: 9px/1 ui-monospace, monospace; }
.codexlink-video-range { width: 100%; height: 3px; margin: 0; accent-color: #fff; cursor: pointer; }
.codexlink-video-control-row { display: flex; align-items: center; justify-content: space-between; gap: 5px; }
.codexlink-video-control-group { display: flex; align-items: center; gap: 2px; }
.codexlink-video-control { display: grid; min-width: 26px; min-height: 28px; padding: 0 4px; place-items: center; border: 0; border-radius: 6px; color: #fff; background: transparent; font-size: 13px; cursor: pointer; }
.codexlink-video-control:hover, .codexlink-video-control:focus-visible { background: #ffffff25; }
.codexlink-video-volume { width: 48px; height: 3px; accent-color: #fff; cursor: pointer; }
.codexlink-video-error { position: absolute; z-index: 3; inset: 0; display: grid; align-content: center; margin: 0; padding: 24px; color: #ddd; background: #101116f2; text-align: center; font-size: 12px; }
.codexlink-video-error[hidden], .tool-video-placeholder[hidden] { display: none; }
.tool-video-placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; background: radial-gradient(ellipse at center, #25272e, #121318 75%); color: #7e818b; font-size: 10px; }
.tool-video-placeholder strong { color: #c2c4cc; font-size: 12px; font-weight: 500; }
.tool-video-placeholder-icon { display: grid; width: 42px; height: 42px; margin-bottom: 2px; padding-left: 2px; place-items: center; border: 1px solid #ffffff24; border-radius: 50%; color: #9a9ca6; font-size: 14px; }
[data-theme="light"] .tool-video-placeholder { background: radial-gradient(ellipse at center, #edf0f5, #e0e3ea 75%); color: #555762; }
[data-theme="light"] .tool-video-placeholder strong { color: #111216; }
[data-theme="light"] .tool-video-placeholder-icon { border-color: rgba(0, 0, 0, 0.18); color: #3b3d45; }
.is-pending .codexlink-video-controls { display: none; }
.codexlink-video-player:fullscreen { aspect-ratio: auto; border-radius: 0; background: #000; }
.codexlink-video-player:fullscreen video { object-fit: contain; }

@media (max-width: 1100px) and (min-width: 861px) {
  .ailink-title { font-size: clamp(42px, 4.6vw, 56px); }
  .ailink-description { font-size: 13.5px; max-width: 760px; }
  .ailink-videos-grid { gap: 16px; padding: 0 10px; }
  .ailink-video-title { font-size: clamp(16px, 1.3vw, 19px); }
  .codexlink-button { min-width: 120px; min-height: 40px; padding: 10px 14px; font-size: 12px; }
  .codexlink-action-row { gap: 8px; }
}

@media (max-width: 860px) {
  .ailink-home-content { --eye-size: clamp(74px, 11vw, 92px); padding: 8px 16px 24px; }
  .mouse-following-eyes { margin-bottom: 12px; }
  .ailink-title { font-size: clamp(38px, 8.5vw, 56px); }
  .ailink-description { font-size: 14px; line-height: 1.7; }
  .ailink-description br { display: none; }
  .ailink-videos-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
    padding: 0;
  }
  .ailink-video-card + .ailink-video-card::before { display: none; }
  .ailink-video-card + .ailink-video-card {
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }
  [data-theme="light"] .ailink-video-card + .ailink-video-card {
    border-top-color: rgba(0, 0, 0, 0.08);
  }
  .ailink-video-title { font-size: 18px; text-align: left; }
  .marquee-section { padding: 0 16px 24px; }
  .codexlink-actions { margin-top: 20px; }
  .codexlink-button { min-width: 140px; min-height: 46px; padding: 12px 20px; font-size: 13px; }
  .codexlink-video-control { min-width: 28px; min-height: 32px; font-size: 14px; }
  .codexlink-video-volume { width: 64px; }
}

@media (max-width: 620px) {
  .page-shell:has(.codexlink-home.is-active) .topbar { min-height: 64px; padding: 8px 12px; }
  .theme-switch-container { left: 12px; }
  .theme-switch { width: 70px; height: 32px; }
  .theme-switch-thumb { width: 24px; height: 24px; transform: translateX(40px); }
  [data-theme="light"] .theme-switch-thumb { transform: translateX(4px); }
  .main-nav .brand-logo { flex-basis: 42px; width: 42px; height: 42px; }
  .embed-frame { height: calc(100vh - 126px); min-height: 640px; }
  .ailink-title { font-size: clamp(32px, 9vw, 44px); }
  .ailink-video-title { font-size: 16px; text-align: left; }
  .codexlink-button { min-width: 0; min-height: 44px; padding: 10px 14px; font-size: 12px; }
  .customer-service-container { right: 12px; }
  .customer-service-btn { height: 32px; padding: 0 10px; font-size: 12px; }
  .customer-service-card { width: 236px; padding: 14px 14px 12px; border-radius: 18px; }
  .customer-service-sub { white-space: normal; font-size: 11px; }
  .codexlink-action-row { gap: 8px; }
  .codexlink-video-play-button { width: 48px; height: 48px; font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .codexlink-button, .mouse-following-pupil, .theme-switch-thumb, .theme-switch-track { transition: none; }
}

/* Marquee Section Styles (Dual Staggered Rows & Increased Spacing) */
.marquee-section {
  grid-column: 1 / -1;
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 clamp(8px, 1vw, 20px) 24px;
  margin-top: clamp(20px, 2.2vh, 32px);
  z-index: 2;
}

.marquee-root {
  position: relative;
  display: flex;
  width: 100%;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 2.5%, #000 97.5%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 2.5%, #000 97.5%, transparent);
  cursor: grab;
  user-select: none;
  --marquee-gap: 12px;
  --marquee-copies: 2;
}

.marquee-track {
  display: flex;
  width: max-content;
  flex-shrink: 0;
  animation: marquee-x 34s linear infinite;
  will-change: transform;
}

/* 上面一排往左滑动 */
.marquee-track--left,
[data-direction="left"] .marquee-track {
  animation-direction: normal;
  animation-duration: 34s;
}

/* 下面一排往右滑动 */
.marquee-track--right,
[data-direction="right"] .marquee-track {
  animation-direction: reverse;
  animation-duration: 38s; /* 略微不同速度，形成错落有致的交错节奏 */
}

.marquee-root:hover .marquee-track,
.marquee-root:focus-within .marquee-track {
  animation-play-state: paused;
}

.marquee-group {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: var(--marquee-gap);
  padding-right: var(--marquee-gap);
}

.marquee-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #cfd1da;
  font: 500 12.5px/1.2 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  white-space: nowrap;
  letter-spacing: -0.01em;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.marquee-badge:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
  color: #ffffff;
  transform: translateY(-1px);
}

.marquee-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 6px rgba(52, 211, 153, 0.7);
}

/* Light Theme adaptations for Marquee */
[data-theme="light"] .marquee-badge {
  border-color: rgba(0, 0, 0, 0.1);
  background: rgba(0, 0, 0, 0.04);
  color: #3f424e;
}

[data-theme="light"] .marquee-badge:hover {
  background: rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.22);
  color: #09090b;
}

[data-theme="light"] .marquee-badge-dot {
  background: #059669;
  box-shadow: 0 0 5px rgba(5, 150, 105, 0.5);
}

@keyframes marquee-x {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(calc(-100% / var(--marquee-copies, 2)), 0, 0);
  }
}

@media (max-width: 860px) {
  .marquee-section {
    gap: 10px;
    padding: 0 20px 28px;
    margin-top: 24px;
  }
  .marquee-badge {
    padding: 5px 11px;
    font-size: 11.5px;
  }
}

.video-pending-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  z-index: 999;
  padding: 10px 22px;
  border-radius: 9999px;
  background: rgba(18, 19, 24, 0.92);
  color: #f5f5f7;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.16);
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(8px);
  transition: opacity 200ms ease, transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.video-pending-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

[data-theme="light"] .video-pending-toast {
  background: rgba(255, 255, 255, 0.96);
  color: #111216;
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
}

/* Dancing Letters - Physics-based Interactive Animations */
.dancing-letters {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  user-select: none;
  perspective: 1000px;
  white-space: nowrap;
}

.dancing-letter {
  position: relative;
  display: inline-block;
  cursor: pointer;
  user-select: none;
  transform-style: preserve-3d;
  will-change: transform, opacity;
  transition: color 200ms ease;
}

.dancing-letter.is-active {
  z-index: 10;
}

/* 1. Rubber Band (Snap) */
.dancing-letter.anim-0 {
  transform-origin: center center;
  animation: dancing-rubber-band 0.8s ease-in-out both;
}

@keyframes dancing-rubber-band {
  0% { transform: scale3d(1, 1, 1); }
  30% { transform: scale3d(1.25, 0.75, 1); }
  40% { transform: scale3d(0.75, 1.25, 1); }
  50% { transform: scale3d(1.15, 0.85, 1); }
  65% { transform: scale3d(0.95, 1.05, 1); }
  75% { transform: scale3d(1.05, 0.95, 1); }
  100% { transform: scale3d(1, 1, 1); }
}

/* 2. The Hinge (Falling effect) */
.dancing-letter.anim-1 {
  transform-origin: bottom left;
  animation: dancing-hinge 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

@keyframes dancing-hinge {
  0% { transform: rotate(0deg) translate3d(0, 0, 0); }
  20% { transform: rotate(80deg) translate3d(0, 10px, 0); }
  40% { transform: rotate(60deg) translate3d(0, -5px, 0); }
  60% { transform: rotate(80deg) translate3d(0, 5px, 0); }
  80% { transform: rotate(60deg) translate3d(0, -2px, 0); }
  100% { transform: rotate(0deg) translate3d(0, 0, 0); }
}

/* 3. Squash and Jump */
.dancing-letter.anim-2 {
  transform-origin: bottom center;
  animation: dancing-squash-jump 0.6s ease-out both;
}

@keyframes dancing-squash-jump {
  0% { transform: scale3d(1, 1, 1) translate3d(0, 0, 0); }
  30% { transform: scale3d(1, 0.6, 1) translate3d(0, 20px, 0); }
  60% { transform: scale3d(1, 1.2, 1) translate3d(0, -40px, 0); }
  100% { transform: scale3d(1, 1, 1) translate3d(0, 0, 0); }
}

/* 4. Falling (Requests 3D spin) */
.dancing-letter.anim-3 {
  transform-origin: 50% 80%;
  animation: dancing-falling 2s ease-out both;
}

@keyframes dancing-falling {
  0% { transform: perspective(1000px) rotateX(0deg) scale(1); }
  12% { transform: perspective(1000px) rotateX(240deg) scale(1.1); }
  24% { transform: perspective(1000px) rotateX(150deg) scale(1.1); }
  36% { transform: perspective(1000px) rotateX(200deg) scale(1.1); }
  48% { transform: perspective(1000px) rotateX(175deg) scale(1.05); }
  60% { transform: perspective(1000px) rotateX(180deg) scale(1.02); }
  85% { transform: perspective(1000px) rotateX(180deg) scale(1); }
  100% { transform: perspective(1000px) rotateX(0deg) scale(1); }
}

/* 5. Elastic Slide */
.dancing-letter.anim-4 {
  transform-origin: center center;
  animation: dancing-elastic-slide 0.8s ease-in-out both;
}

@keyframes dancing-elastic-slide {
  0% { transform: translate3d(0, 0, 0); }
  20% { transform: translate3d(-20px, 0, 0); }
  40% { transform: translate3d(15px, 0, 0); }
  60% { transform: translate3d(-10px, 0, 0); }
  80% { transform: translate3d(5px, 0, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

/* 6. Impact Shake */
.dancing-letter.anim-5 {
  transform-origin: center center;
  animation: dancing-impact-shake 0.5s linear both;
}

@keyframes dancing-impact-shake {
  0% { transform: translate3d(0, 0, 0) rotate(0deg); }
  15% { transform: translate3d(-5px, -2px, 0) rotate(-1deg); }
  30% { transform: translate3d(5px, 2px, 0) rotate(1deg); }
  45% { transform: translate3d(-5px, -1px, 0) rotate(-0.5deg); }
  60% { transform: translate3d(5px, 1px, 0) rotate(0.5deg); }
  75% { transform: translate3d(-2px, 0, 0) rotate(-0.2deg); }
  90% { transform: translate3d(2px, 0, 0) rotate(0.2deg); }
  100% { transform: translate3d(0, 0, 0) rotate(0deg); }
}

/* 7. Pop (Scale) */
.dancing-letter.anim-6 {
  transform-origin: center center;
  animation: dancing-pop 0.5s ease-in-out both;
}

@keyframes dancing-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.4); }
  100% { transform: scale(1); }
}

/* 8. Levitate */
.dancing-letter.anim-7 {
  transform-origin: center center;
  animation: dancing-levitate 1.2s ease-in-out both;
}

@keyframes dancing-levitate {
  0% { transform: translate3d(0, 0, 0) scale(1); text-shadow: 0 0 0 rgba(0, 0, 0, 0); }
  50% { transform: translate3d(0, -30px, 0) scale(1.1); text-shadow: 0 20px 20px rgba(0, 0, 0, 0.25); }
  100% { transform: translate3d(0, 0, 0) scale(1); text-shadow: 0 0 0 rgba(0, 0, 0, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .dancing-letter { animation: none !important; transform: none !important; }
}



/* TextEffect - motion-primitives blur & slide entrance animation */
.text-effect {
  position: relative;
  cursor: pointer;
}

.text-effect-item {
  display: inline-block;
  opacity: 0;
  filter: blur(10px);
  transform: translateY(6px);
  animation: text-effect-blur-slide 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: calc(var(--char-index, 0) * 0.015s + 0.12s);
  will-change: opacity, filter, transform;
}

@keyframes text-effect-blur-slide {
  0% {
    opacity: 0;
    filter: blur(10px);
    transform: translateY(6px);
  }
  100% {
    opacity: 1;
    filter: blur(0px);
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .text-effect-item {
    opacity: 1 !important;
    filter: none !important;
    transform: none !important;
    animation: none !important;
  }
}