:root {
  /* base: extracted from reference palette */
  --bg: #ffffff;
  --bg-elev: #f7f8fa;
  --text: #0b1320;
  --muted: #5b667a;
  --brand: #4f46e5;
  --accent: #4f46e5;
  /* reference tokens */
  --primary: #4f46e5;
  --primary-weak: #eef2ff;
  --card: #f7f8fa;
  --card-border: #e6e9ef;
  --chip: #eef2ff;
  --border: #e6e9ef;
  --divider: #e9edf2;
  --shadow-elev: 0 10px 25px rgba(2, 6, 23, 0.06), 0 2px 8px rgba(2, 6, 23, 0.04);
  --shadow: 0 10px 25px rgba(2, 6, 23, 0.06), 0 2px 8px rgba(2, 6, 23, 0.04);
  /* tags keep contrast on light bg */
  --tag-bg: #475569;
  --tag-text: #ffffff;

  /* 让浏览器原生控件跟随暗黑模式配色 */
  color-scheme: light dark;
}

/* optional dark theme tokens to match reference */
[data-theme="dark"] {
  --bg: #0b0f17;
  --bg-elev: #111623;
  --text: #e7ecf3;
  --muted: #a5b0c6;
  --brand: #8b7dff;
  --accent: #8b7dff;
  --primary: #8b7dff;
  --primary-weak: #181a2a;
  --card: #111623;
  --card-border: #1c2335;
  --chip: #181a2a;
  --border: #1c2335;
  --divider: #1b2232;
  --shadow-elev: 0 10px 25px rgba(0,0,0,0.35), 0 2px 8px rgba(0,0,0,0.25);
  --shadow: 0 10px 25px rgba(0,0,0,0.35), 0 2px 8px rgba(0,0,0,0.25);
}

/* 自动跟随系统暗黑模式（无需 data-theme） */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f17;
    --bg-elev: #111623;
    --text: #e7ecf3;
    --muted: #a5b0c6;
    --brand: #8b7dff;
    --accent: #8b7dff;
    --primary: #8b7dff;
    --primary-weak: #181a2a;
    --card: #111623;
    --card-border: #1c2335;
    --chip: #181a2a;
    --border: #1c2335;
    --divider: #1b2232;
    --shadow-elev: 0 10px 25px rgba(0,0,0,0.35), 0 2px 8px rgba(0,0,0,0.25);
    --shadow: 0 10px 25px rgba(0,0,0,0.35), 0 2px 8px rgba(0,0,0,0.25);
  }
  /* Header 在暗色下使用深色半透明背景 */
  .site-header { background: rgba(8,12,21,.85); }
  /* Hero 背景发光在暗色下更亮一些 */
  .hero::before {
    filter: blur(24px) saturate(120%);
    background:
      radial-gradient(60% 60% at 50% 20%, rgba(139, 125, 255, 0.28), transparent 60%),
      radial-gradient(40% 40% at 80% 10%, rgba(56, 189, 248, 0.24), transparent 60%),
      radial-gradient(35% 35% at 20% 5%,  rgba(244, 114, 182, 0.22), transparent 60%);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, Noto Sans, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: var(--bg);
}

/* Typography refinements (reference style akin to MOSS site) */
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { letter-spacing: .1px; }
h1, h2, h3 { letter-spacing: .2px; }
p, li { font-size: 17px; line-height: 1.5; }
.section h2 { font-size: 32px; letter-spacing: .2px; }
h3 { font-size: 20px; margin: 18px 0 10px; color: var(--text); }

.container { width: 100%; max-width: 980px; margin: 0 auto; padding: 0 20px; }

.site-header { position: sticky; top: 0; z-index: 10; background: rgba(255,255,255,.95); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.logo { width: 28px; height: 28px; }
.brand-name { letter-spacing: .2px; }
.nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;              /* 12px -> rem */
  flex-wrap: nowrap;         /* 不换行 */
  white-space: nowrap;       /* 链接单行显示 */
  overflow-x: auto;          /* 超出时横向滚动 */
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;     /* 隐藏滚动条(Firefox) */
}
.nav::-webkit-scrollbar { display: none; } /* 隐藏滚动条(WebKit) */
.nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.5rem 0.75rem;   /* 8px 10px -> rem */
  border-radius: 0.5rem;     /* 8px -> rem */
  font-size: clamp(0.875rem, 1.8vw, 1rem);
  line-height: 1;            /* 避免行高导致视觉换行 */
}
.nav a:hover { color: var(--text); background: var(--card); }

.hero { 
  /* 缩小与导航之间的距离，采用响应式上内边距 */
  padding: clamp(24px, 5vh, 48px) 0 48px; 
  position: relative;           /* 承载渐变背景伪元素 */
  overflow: hidden;             /* 柔化后溢出的光晕不影响布局 */
}
/* 发光云彩式渐变背景 */
.hero::before {
  content: "";
  position: absolute;
  inset: -12% -20% auto -20%;   /* 覆盖范围，向外扩一点让过渡更自然 */
  height: clamp(320px, 60vh, 640px);
  z-index: -1;                  /* 放到内容后面 */
  pointer-events: none;         /* 不影响交互 */
  filter: blur(22px) saturate(110%);
  background:
    radial-gradient(60% 60% at 50% 20%, rgba(79, 70, 229, 0.18), transparent 60%),
    radial-gradient(40% 40% at 80% 10%, rgba(14, 165, 233, 0.16), transparent 60%),
    radial-gradient(35% 35% at 20% 5%,  rgba(236, 72, 153, 0.14), transparent 60%);
}
/* 暗色模式下提升亮度、调整配色以保持可见度 */
[data-theme="dark"] .hero::before {
  filter: blur(24px) saturate(120%);
  background:
    radial-gradient(60% 60% at 50% 20%, rgba(139, 125, 255, 0.28), transparent 60%),
    radial-gradient(40% 40% at 80% 10%, rgba(56, 189, 248, 0.24), transparent 60%),
    radial-gradient(35% 35% at 20% 5%,  rgba(244, 114, 182, 0.22), transparent 60%);
}
.hero-title { margin-bottom: 44px; }
.hero-title h1 { font-size: 44px; margin: 0 auto; text-align: center; line-height: 1.22; max-width: 920px; }
.hero-logo { display: flex; align-items: center; justify-content: center; margin: 0 0 0; }
.hero-logo img { width: clamp(96px, 20vw, 160px); height: auto; filter: drop-shadow(0 4px 12px rgba(0,0,0,0.08)); border-radius: 12px; }
.title-divider {
  width: 120px;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--brand), var(--accent), transparent);
  margin: 24px auto 0;
  border-radius: 2px;
}
.hero-inner {
  display: block; /* 或 grid-template-columns: 1fr; */
}
.subtitle { 
  color: var(--text);            /* 与正文一致 */
  font-size: 17px;               /* 与 p 对齐 */
  line-height: 1.75;             /* 与 p 对齐 */
  margin: 0 0 16px;              /* 更接近正文段落间距 */
  font-weight: 400;
}
.cta-row {
  display: flex;
  gap: 0.75rem;              /* 12px -> rem */
  flex-wrap: nowrap;         /* 不换行 */
  white-space: nowrap;       /* 子元素单行 */
  overflow-x: auto;          /* 超出时横向滚动 */
  -webkit-overflow-scrolling: touch;
}
.btn { 
  display: inline-flex; 
  align-items: center; 
  justify-content: center; 
  /* 采用内边距自适应高度，避免固定高度在小屏导致挤压换行 */
  padding: 0.6rem 1rem;      /* 约 9.6px 16px */
  border-radius: 0.5rem;     /* 8px -> rem */
  border: 1px solid var(--border); 
  color: var(--text); 
  text-decoration: none; 
  background: var(--bg-elev);
  font-weight: 500;
  font-size: clamp(0.875rem, 1.8vw, 1rem);
  line-height: 1;            /* 紧凑行高 */
  white-space: nowrap;       /* 按钮文本不换行 */
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.btn.btn-sm {
  padding: 0.5rem 0.875rem;  /* 约 8px 14px -> rem */
  border-radius: 0.5rem;     /* 10px -> rem */
  box-shadow: none;
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  background: #f1f5f9;
}
.btn.primary {
  background: var(--primary);
  color: #fff;
  border: 1px solid transparent;
  box-shadow: var(--shadow);
}
.btn.primary:hover { filter: saturate(110%); }



.hero-art { 
  position: relative; 
  height: 280px; 
  border-radius: 16px; 
  background: var(--bg-elev); 
  border: 1px solid var(--border); 
  overflow: hidden; 
  display: flex; 
  align-items: center; 
  justify-content: center;
  padding: 16px;
  box-shadow: var(--shadow-elev);
}
.hero-image { 
  width: 100%; 
  height: 100%; 
  object-fit: contain; 
  border-radius: 8px;
  z-index: 2;
  position: relative;
  background: white;
  padding: 12px;
  box-shadow: 
    0 4px 16px rgba(0,0,0,0.1),
    0 0 0 1px rgba(0,0,0,0.05);
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.05));
}
.glow { 
  position: absolute; 
  inset: -20%; 
  background: radial-gradient(closest-side, rgba(59,130,246,.08), transparent), radial-gradient(closest-side, rgba(139,92,246,.06), transparent 60%); 
  filter: blur(20px); 
  z-index: 1; 
}

.section { padding: 56px 0; }
.section h2 { margin: 0; }

/* Highlights 区域 */
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
/* 提高 Highlights 标题与卡片之间的间距 */
.section h2 + .features-grid { margin-top: 18px; }
/* Highlights 卡片：更精致的版式与对齐 */
.feature {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 1fr; /* 移除图标列，统一为单列布局 */
  align-items: start;
  column-gap: 0;
  row-gap: 6px;
  transition: transform .16s ease, box-shadow .2s ease;
}
.feature:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(2,6,23,0.08); }
/* 隐藏卡片中的 emoji 图标 */
.feature .emoji { display: none; }
.feature h3 {
  margin: 2px 0 6px;
  font-size: 16.5px;
  font-weight: 700;
  color: var(--text);
}
.feature p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5; /* 正文字体间距略小，提升信息密度 */
  font-size: 15.5px;
}

.section-head {
  display: flex;
  flex-direction: column; /* 纵向排列 */
  align-items: flex-start; /* 左对齐所有内容 */
  gap: 12px; /* 标题、说明、筛选之间的间距 */
}

.note-inline {
  margin: 0; /* 由 section-head 的 gap 控制间距 */
  font-size: 15px; /* 放大说明文字 */
  line-height: 1.6;
  color: var(--muted);
}

.filters { display: flex; gap: 0.5rem; flex-wrap: wrap; } /* 8px -> rem */
.chip {
  /* 移除固定高度，改用内边距 + 单行防止换行 */
  padding: 0.375rem 0.75rem; /* 约 6px 12px -> rem */
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--chip);
  color: var(--muted);
  cursor: pointer;
  font-size: clamp(0.8125rem, 1.6vw, 0.9375rem); /* 13px~15px 区间 */
  line-height: 1;
  white-space: nowrap;       /* 芯片文本不换行 */
}
.chip.is-active, .chip:hover { color: var(--text); border-color: #2a2f42; }
.chip.is-active { background: var(--primary-weak); }

.note { 
  flex-basis: 100%;
  margin-top: 8px; 
  color: var(--muted); 
  font-size: 12px; 
  text-align: right; 
  opacity: .85;
}

/* .note-inline { flex-basis: 100%; margin: 4px 0 0; color: var(--muted); font-size: 13px; } */

.demo-grid {
  display: flex;
  flex-direction: column;  /* 纵向排列 */
  gap: 20px;               /* 每个 demo 之间的间距 */
  overflow: visible;       /* 不需要横向滚动 */
  padding: 0;              /* 根据需要留白 */
  margin-top: 14px;        /* 与筛选区分开，避免第一个卡片顶着标签 */
}

.card {
  flex: 1 0 auto;          /* 每行一个，自动撑满宽度 */
  width: 100%;
  max-width: 680px;        /* 默认更宽一些 */
  margin: 0 auto;          /* 居中 */
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-elev);
  transition: transform .16s ease, box-shadow .2s ease, border-color .2s ease;
  overflow: hidden;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(2,6,23,0.10); }
.card-body { padding: 16px; display: grid; gap: 10px; }
.card-title { margin: 0; font-size: 17px; font-weight: 600; color: var(--text); }
.card-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tag { font-size: 12px; color: var(--muted); background: var(--chip); border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px; }

/* 媒体元素更友好显示，视频更大一些（由卡片宽度驱动） */
.card video, .card audio { width: 100%; border-radius: 12px; border: 1px solid var(--border); box-shadow: var(--shadow); background: #000; }
.card audio { background: var(--bg); }

/* 桌面端进一步加宽卡片，视频自然跟随到更大 */
@media (min-width: 960px) {
  .card { max-width: 880px; }
}

.steps { margin: 0; padding-left: 18px; color: var(--muted); }

.intro-card { background: var(--bg-elev); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; color: var(--muted); line-height: 1.8; }
.intro-card p { margin: 0 0 12px; }
.intro-card ul { margin: 0; padding-left: 18px; }
.intro-card li { margin: 6px 0; }

.section-figure { 
  margin-top: 12px; 
  width: 100%; 
  height: auto; 
  object-fit: contain; 
  border-radius: 10px; 
  border: 1px solid var(--border);
  background: #fff;
}

.toc { display: none; }
.toc a { font-size: 13px; color: var(--muted); border: 1px solid var(--border); background: var(--chip); border-radius: 999px; padding: 6px 10px; text-decoration: none; }
.toc a:hover { color: var(--text); }

.badges { display: none; }
.badge { display: none; }


.site-footer { border-top: 1px solid var(--border); padding: 18px 0; color: var(--muted); text-align: center; }
.footer-inner { display: flex; align-items: center; justify-content: center; }

@media (max-width: 960px) {
  .hero-title h1 { font-size: 34px; }
  .hero-inner { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .demo-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .hero-title h1 { font-size: 26px; }
  .features-grid { grid-template-columns: 1fr; }
  .demo-grid { grid-template-columns: 1fr; }
}

/* 确保暗黑模式下导航背景正确（置于文件末尾以赢得层叠） */
@media (prefers-color-scheme: dark) {
  .site-header { background: rgba(8,12,21,.85); }
}
[data-theme="dark"] .site-header { background: rgba(8,12,21,.85); }


