/* ============================================================
   XiaoJuClaw 官网样式
   ------------------------------------------------------------
   设计原则：
   - 与 mvp/brand.config.json 的主色保持一致
   - 不依赖外部 CDN，纯原生，适合 U 盘交付与离线演示
   - 适配桌面 / 平板 / 移动
============================================================ */

:root {
  --brand-primary: #2563eb;
  --brand-primary-dark: #1d4ed8;
  --brand-accent: #f59e0b;
  --bg: #f5f7fb;
  --bg-soft: #eef4ff;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --text: #0f172a;
  --text-muted: #475569;
  --text-dim: #94a3b8;
  --success: #16a34a;
  --danger: #dc2626;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 45px rgba(15, 23, 42, 0.12);
  --max-width: 1200px;
  --nav-height: 64px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-primary); text-decoration: none; }
a:hover { color: var(--brand-primary-dark); }

img { max-width: 100%; display: block; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Top Nav ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
  height: var(--nav-height);
}

.site-nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.site-nav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
}

.site-nav__brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-dark));
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 18px;
}

.site-nav__links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.site-nav__links a {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 500;
  transition: all 0.15s ease;
}

.site-nav__links a:hover {
  background: var(--bg-soft);
  color: var(--brand-primary-dark);
}

.site-nav__links a.is-active {
  background: var(--bg-soft);
  color: var(--brand-primary-dark);
}

.site-nav__cta {
  padding: 8px 16px !important;
  background: var(--brand-primary);
  color: #fff !important;
  border-radius: var(--radius-sm);
}

.site-nav__cta:hover {
  background: var(--brand-primary-dark);
}

.site-nav__toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  cursor: pointer;
  font-size: 18px;
}

/* ---------- Hero ---------- */
.hero {
  padding: 80px 0 96px;
  background: radial-gradient(1200px 600px at 10% 0%, #dbeafe 0%, transparent 60%),
              radial-gradient(900px 500px at 90% 20%, #fef3c7 0%, transparent 60%),
              var(--bg);
}

.hero__eyebrow {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}

.hero__title {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 20px;
  letter-spacing: -0.5px;
}

.hero__title em {
  font-style: normal;
  background: linear-gradient(135deg, var(--brand-primary), #7c3aed);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__subtitle {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 720px;
  margin: 0 0 32px;
}

.hero__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 15px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn--primary {
  background: var(--brand-primary);
  color: #fff;
}

.btn--primary:hover {
  background: var(--brand-primary-dark);
  color: #fff;
}

.btn--secondary {
  background: #fff;
  border-color: var(--border-strong);
  color: var(--text);
}

.btn--secondary:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary-dark);
}

.btn--ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn--ghost:hover {
  color: var(--brand-primary-dark);
}

/* ---------- Sections ---------- */
.section {
  padding: 72px 0;
}

.section--alt { background: var(--surface); }

.section__head {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 48px;
}

.section__title {
  font-size: clamp(26px, 3.5vw, 36px);
  font-weight: 800;
  margin: 0 0 12px;
  letter-spacing: -0.3px;
}

.section__subtitle {
  font-size: 16px;
  color: var(--text-muted);
  margin: 0;
}

/* ---------- Feature grid ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all 0.15s ease;
}

.feature-card:hover {
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.feature-card__icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--bg-soft);
  color: var(--brand-primary-dark);
  display: grid;
  place-items: center;
  font-size: 20px;
  margin-bottom: 16px;
}

.feature-card__title {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 8px;
}

.feature-card__desc {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
}

/* ---------- Filter bar ---------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.filter-bar__chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-bar__chip:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary-dark);
}

.filter-bar__chip.is-active {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #fff;
}

.filter-bar__label {
  font-size: 13px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  margin-right: 4px;
}

.search-box {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 16px;
  background: #fff;
}

.search-box:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* ---------- Card grid (skills / tutorials) ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.item-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.15s ease;
}

.item-card:hover {
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-md);
}

.item-card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.item-card__title {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}

.item-card__subtitle {
  font-size: 12px;
  color: var(--text-dim);
  margin: 2px 0 0;
}

.item-card__desc {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
  flex: 1;
}

.item-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.item-card__actions {
  display: flex;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.item-card__actions .btn {
  padding: 7px 12px;
  font-size: 13px;
  flex: 1;
  justify-content: center;
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.badge--primary { background: var(--bg-soft); color: var(--brand-primary-dark); }
.badge--neutral { background: #f1f5f9; color: var(--text-muted); }
.badge--success { background: #dcfce7; color: #166534; }
.badge--warn { background: #fef3c7; color: #92400e; }
.badge--accent { background: #fae8ff; color: #86198f; }

/* ---------- Install command ---------- */
.install-cmd {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  overflow-x: auto;
  white-space: nowrap;
  position: relative;
}

.install-cmd__copy {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(255, 255, 255, 0.1);
  border: 0;
  color: #e2e8f0;
  border-radius: 4px;
  padding: 2px 8px;
  cursor: pointer;
  font-size: 11px;
}

.install-cmd__copy:hover { background: rgba(255, 255, 255, 0.2); }

/* ---------- Compatibility table ---------- */
.compat-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.compat-table th,
.compat-table td {
  padding: 14px 16px;
  text-align: left;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}

.compat-table thead th {
  background: var(--bg-soft);
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
}

.compat-table tbody tr:last-child td { border-bottom: 0; }

.compat-table .yes { color: var(--success); font-weight: 700; }
.compat-table .no { color: var(--danger); font-weight: 700; }
.compat-table .partial { color: var(--brand-accent); font-weight: 700; }

/* ---------- CTA block ---------- */
.cta-block {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-dark));
  color: #fff;
  border-radius: var(--radius);
  padding: 48px;
  text-align: center;
}

.cta-block h2 {
  color: #fff;
  font-size: 28px;
  margin: 0 0 12px;
}

.cta-block p {
  color: rgba(255, 255, 255, 0.85);
  margin: 0 0 24px;
  font-size: 16px;
}

.cta-block .btn--primary {
  background: #fff;
  color: var(--brand-primary-dark);
}

.cta-block .btn--primary:hover {
  background: #f1f5f9;
}

.cta-block .btn--secondary {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}

.cta-block .btn--secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* ---------- Footer ---------- */
.site-footer {
  background: #0f172a;
  color: #cbd5e1;
  padding: 48px 0 32px;
  font-size: 14px;
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}

.site-footer h4 {
  color: #fff;
  font-size: 14px;
  margin: 0 0 14px;
}

.site-footer a {
  color: #94a3b8;
  display: block;
  padding: 4px 0;
}

.site-footer a:hover { color: #fff; }

.site-footer__bottom {
  border-top: 1px solid #1e293b;
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  color: #64748b;
  font-size: 12px;
}

/* ---------- Helpers ---------- */
.muted { color: var(--text-muted); }
.dim { color: var(--text-dim); }
.center { text-align: center; }
.hidden { display: none !important; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }

.empty-state {
  padding: 48px;
  text-align: center;
  color: var(--text-dim);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .site-nav__links {
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    padding: 8px;
    gap: 4px;
    display: none;
    box-shadow: var(--shadow-md);
  }
  .site-nav__links.is-open { display: flex; }
  .site-nav__toggle { display: inline-flex; }
  .hero { padding: 56px 0 64px; }
  .section { padding: 48px 0; }
  .cta-block { padding: 32px 20px; }
  .site-footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .site-footer__grid { grid-template-columns: 1fr; }
  .compat-table th,
  .compat-table td { padding: 10px 12px; font-size: 13px; }
}


/* ============================================================
   Inline SVG 图标系统
   - 通过 <use href="#icon-xxx"> 引用 site-common.js 注入的 sprite
   - stroke="currentColor" 让图标继承文字颜色
============================================================ */

.icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.icon--lg { width: 1.5em; height: 1.5em; }
.icon--xl { width: 2em; height: 2em; }
.icon--2xl { width: 2.5em; height: 2.5em; }
.icon--3xl { width: 3em; height: 3em; }

.icon--solid {
  fill: currentColor;
  stroke: none;
}

/* 工具：图标 + 文字内联对齐 */
.with-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
}

/* FAQ 折叠面板前置图标（替代 ❓） */
.faq-item summary::before {
  content: none !important; /* 旧伪元素的 emoji 内容由 SVG 替换接管 */
}

/* 隐藏 sprite 容器 */
.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* path-card / provider-grid 大图标容器（替代 32px emoji） */
.icon-tile {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--bg-soft);
  color: var(--brand-primary-dark);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.icon-tile .icon {
  width: 24px;
  height: 24px;
}

.icon-tile--soft { background: var(--bg-soft); color: var(--brand-primary-dark); }
.icon-tile--success { background: #dcfce7; color: #166534; }
.icon-tile--warn { background: #fef3c7; color: #92400e; }
.icon-tile--danger { background: #fee2e2; color: #991b1b; }
.icon-tile--accent { background: #fae8ff; color: #86198f; }
.icon-tile--neutral { background: #f1f5f9; color: var(--text-muted); }


/* ============================================================
   覆盖：旧版本中以 emoji 占位的图标容器
   原本依赖 font-size 撑出大尺寸；改用 SVG 后需显式给定尺寸。
============================================================ */

/* 大尺寸卡片图标（48x48 容器内的 24px SVG） */
.feature-card__icon > .icon,
.provider-item__icon > .icon,
.guide-card__icon > .icon,
.path-card__icon > .icon {
  width: 24px;
  height: 24px;
}

/* 行动召唤横幅大图标 */
.recommend-banner__icon > .icon {
  width: 32px;
  height: 32px;
}

/* hero eyebrow 中行内 SVG 的尺寸与对齐 */
.hero__eyebrow > .icon {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
  margin-right: 4px;
}

/* FAQ details summary 前置图标——替换原 ::before "❓" */
.faq-item summary > .icon:first-child {
  color: var(--brand-primary);
  width: 16px;
  height: 16px;
  margin-right: 2px;
}

/* tip / warn / danger 行首小图标 */
.step-card__tip > .icon:first-child,
.step-card__warn > .icon:first-child,
.step-card__danger > .icon:first-child {
  vertical-align: -2px;
  margin-right: 4px;
}

/* 区段标题行内的 SVG */
h2 > .icon, h3 > .icon, h4 > .icon {
  vertical-align: -3px;
  margin-right: 6px;
  width: 0.95em;
  height: 0.95em;
}

/* nav brand 图标 */
.site-nav__brand-icon > .icon {
  width: 18px;
  height: 18px;
  color: #fff;
}

/* 移动端菜单按钮 SVG */
.site-nav__toggle > .icon {
  width: 18px;
  height: 18px;
  vertical-align: 0;
}

/* 兼容性页面、其它页面用到的握手 / 检查图标 */
.compat-table .icon { vertical-align: -3px; }
