:root {
  --bg: #0b1020;
  --bg-2: #0f1630;
  --panel: #141b36;
  --panel-2: #1b2447;
  --text: #e8eeff;
  --muted: #a9b4d0;
  --brand: #4fb3ff;
  --brand-2: #6a5cff;
  --accent: #ffb86b;
  --ok: #42d392;
  --danger: #ff6b6b;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --grid: 1200px;
}
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  background: radial-gradient(
        1200px 800px at 10% -10%,
        #18224a 0%,
        transparent 55%
      )
      no-repeat,
    radial-gradient(1000px 700px at 110% 10%, #1a2754 0%, transparent 55%)
      no-repeat,
    var(--bg);
  color: var(--text);
  font: 16px/1.6 ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto,
    Helvetica, Arial, PingFang SC, Hiragino Sans GB, Microsoft YaHei, sans-serif;
}
a {
  color: inherit;
  text-decoration: none;
}
img {
  max-width: 100%;
  display: block;
}
.container {
  max-width: var(--grid);
  margin: auto;
  padding: 0 20px;
}

/* Navbar */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(160%) blur(10px);
  background: linear-gradient(
    180deg,
    rgba(15, 22, 48, 0.9),
    rgba(15, 22, 48, 0.65)
  );
  border-bottom: 1px solid #1e2a5e;
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
}
.brand:focus {
  outline: none;
}
.brand:focus-visible {
  outline: none;
}
.logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: conic-gradient(
    from 220deg at 50% 50%,
    var(--brand),
    var(--brand-2),
    var(--accent),
    var(--brand)
  );
  box-shadow: inset 0 0 30px rgba(255, 255, 255, 0.15),
    0 8px 20px rgba(79, 179, 255, 0.25);
  position: relative;
  overflow: hidden;
}
.logo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    60% 60% at 30% 30%,
    rgba(255, 255, 255, 0.25),
    transparent 40%
  );
  mix-blend-mode: screen;
}
.nav-links {
  display: flex;
  gap: 22px;
  align-items: center;
}
.nav-links a {
  color: var(--muted);
  font-weight: 600;
}
.nav-links a:hover {
  color: #fff;
}
.gh {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: linear-gradient(180deg, #202a55, #18224a);
  border: 1px solid #263065;
  box-shadow: var(--shadow);
}
.menu-btn {
  display: none;
  cursor: pointer;
  background: none;
  border: none;
  color: #fff;
}
.mobile-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 20px;
  border-top: 1px solid #1e2a5e;
  background: linear-gradient(
    180deg,
    rgba(15, 22, 48, 0.95),
    rgba(15, 22, 48, 0.85)
  );
}
.mobile-menu a {
  padding: 10px 6px;
  color: var(--muted);
  font-weight: 600;
}
.mobile-menu a:hover {
  color: #fff;
}

/* Hero */
.hero {
  padding: 72px 0 48px;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 28px;
  align-items: center;
}
.title {
  font-size: 48px;
  line-height: 1.15;
  margin: 0 0 12px;
  font-weight: 900;
  letter-spacing: 0.2px;
}
.title .grad {
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.subtitle {
  color: var(--muted);
  font-size: 18px;
  margin: 0 0 22px;
}
.kicker {
  color: var(--accent);
  letter-spacing: 0.18em;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 12px;
}
.cta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin: 10px 0 28px;
}
.btn {
  padding: 12px 18px;
  border-radius: 12px;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-block;
}
.btn.primary {
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  box-shadow: 0 10px 25px rgba(106, 92, 255, 0.35);
}
.btn.ghost {
  border-color: #2a366f;
  background: #121833;
}
.bullets {
  padding-left: 18px;
  margin: 0;
}
.bullets li {
  margin: 4px 0;
}
.muted {
  color: var(--muted);
}
/* Visibility utilities */
.hidden {
  display: none !important;
}
.video-card {
  border: 1px solid #27306a;
  border-radius: 18px;
  background: linear-gradient(180deg, #121a39, #0e152f);
  box-shadow: var(--shadow);
  padding: 14px;
}
/* 保持原有 .video 样式的前提下，确保是一个固定比例的容器 */
.video {
  position: relative;
  width: 100%;
  /* 16:9 比例，高度由 padding-top 模拟 */
  padding-top: 56.25%;
  overflow: hidden;
  border-radius: 12px; /* 如果之前有圆角可保持/微调 */
}

/* 让 <video> 绝对定位填满容器，避免撑破布局 */
.video-el,
.video > video {
  position: absolute;
  inset: 0; /* 相当于 top:0; right:0; bottom:0; left:0; */
  width: 100%;
  height: 100%;
  object-fit: cover; /* 或者用 contain，看你是否需要裁剪 */
  display: block;
}

/* 如果 video 默认有边框/阴影，可以清一下 */
.video-el {
  border: none;
  background-color: #000;
}

.play {
  width: 74px;
  height: 74px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, var(--brand), var(--brand-2));
  box-shadow: 0 18px 40px rgba(79, 179, 255, 0.35);
  position: absolute;
  inset: auto; /* center via transform */
}
.video-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}

/* Sections */
.section {
  padding: 56px 0;
}
.h2 {
  font-size: 34px;
  line-height: 1.25;
  margin: 10px 0 8px;
}
.h3 {
  font-size: 20px;
  margin: 10px 0 6px;
}
.lead {
  color: var(--muted);
  max-width: 800px;
}
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 28px;
}
.card {
  background: linear-gradient(180deg, #121838, #0e1430);
  border: 1px solid #263065;
  border-radius: 16px;
  padding: 18px;
  height: 100%;
  box-shadow: var(--shadow);
}
.icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 10px 24px rgba(79, 179, 255, 0.28);
}
.icon.pink {
  background: linear-gradient(135deg, #ffb86b, #ff7eb3);
}
.icon.green {
  background: linear-gradient(135deg, #42d392, #12b886);
}

.feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  align-items: center;
  margin: 36px 0 10px;
}
.mock {
  border: 1px dashed #2c3870;
  border-radius: 16px;
  min-height: 280px;
  background: repeating-linear-gradient(
    45deg,
    rgba(106, 92, 255, 0.08) 0 10px,
    transparent 10px 20px
  );
  display: grid;
  place-items: center;
  color: #aeb7d6;
  text-align: center;
  padding: 12px;
  margin-top: 1rem;
}

/* Footer */
.footer {
  margin-top: 40px;
  padding: 28px 0;
  border-top: 1px solid #243064;
  background: linear-gradient(180deg, #0f1630, #0c1226);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.copy {
  color: var(--muted);
  font-size: 14px;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
  background: #999;
}
.dot.ok {
  background: var(--ok);
}

/* Utilities */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #0c1330;
  border: 1px solid #263065;
  color: #a7b2d7;
  font-weight: 700;
  font-size: 12px;
}

.lang-switch {
  border: none;
  background: transparent;
  padding: 0 0.5rem;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  text-decoration: none;
  white-space: nowrap;
}

.lang-switch:hover,
.lang-switch:focus-visible {
  color: #0070f3; /* 根据你导航链接的主色调调整 */
  text-decoration: underline;
  outline: none;
}

.nav .lang-switch {
  opacity: 0.85;
}

.nav .lang-switch:hover,
.nav .lang-switch:focus-visible {
  opacity: 1;
}

.mobile-menu .lang-switch {
  width: 100%;
  text-align: left;
  padding: 0.75rem 1rem;
  border-radius: 0;
}

.mobile-menu .lang-switch:hover,
.mobile-menu .lang-switch:focus-visible {
  background-color: rgba(
    255,
    255,
    255,
    0.06
  ); /* 参考你 mobile menu 的 hover 颜色 */
  text-decoration: none;
}

/* Center the play button */
.video {
  position: relative;
}
.play {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

/* Responsive */
@media (max-width: 1024px) {
  .hero-grid,
  .feature {
    grid-template-columns: 1fr;
  }
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 720px) {
  .title {
    font-size: 36px;
  }
  .nav-links {
    display: none;
  }
  .menu-btn {
    display: inline-grid;
    place-items: center;
  }
  .cards {
    grid-template-columns: 1fr;
  }
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* === 新增：Demos 样式 === */

.demos-cards {
  /* 复用 .cards 的 grid，仅覆盖必要项 */
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 1024px) {
  .demos-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .demos-cards {
    grid-template-columns: 1fr;
  }
}

.demo-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.15s ease, box-shadow 0.15s ease,
    border-color 0.15s ease;
}

.demo-main-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.demo-main-link:hover,
.demo-main-link:focus-visible {
  text-decoration: none;
}

/* 缩略图容器：固定 16:9 比例 */
.demo-thumb-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 12px;
  background: #050816;
  margin: -6px -6px 8px -6px; /* 让图片稍微贴近卡片边缘，视觉更饱满 */
}

.demo-thumb-wrap::before {
  content: "";
  display: block;
  padding-bottom: 56.25%; /* 16:9 */
}

.demo-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}

/* 标题与卡片 hover 效果 */
.demo-title {
  margin: 6px 0 4px;
}

/* 卡片 hover：略微抬起 + 图片轻微放大 */
.demo-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.6);
  border-color: #334155;
}

.demo-card:hover .demo-thumb {
  transform: scale(1.04);
}

/* 底部操作区域：在编辑器中打开 */
.demo-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 6px;
}

.demo-open-editor {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.8); /* slate-400-ish */
  color: #cbd5f5;
  text-decoration: none;
  line-height: 1.4;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(6px);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background-color 0.15s ease, border-color 0.15s ease,
    color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.demo-open-editor::before {
  content: "📝";
  font-size: 11px;
}

.demo-open-editor:hover,
.demo-open-editor:focus-visible {
  border-color: #4fb3ff;
  color: #e5f0ff;
  background: rgba(46, 86, 158, 0.95);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(79, 179, 255, 0.35);
}

.inline-link {
  color: #7dd3fc; /* 亮一点的蓝色 */
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  cursor: pointer;
}

.inline-link:hover,
.inline-link:focus-visible {
  color: #38bdf8;
  text-decoration-thickness: 2px;
}
