/* ================================================================
   VERITAS · 12 套参考级排版（Stripe / Linear / Notion / …）
   配合 template-layout-engine.js · 必须晚于 site-tech-polish
   ================================================================ */

.layout-section-collapsed { display: none !important; }

/* ═══ STRIPE · 鸢尾 — 双栏 + Hero Bento + 三列服务 ═══════════ */
html[data-layout-ref="stripe"] .hero-shell {
  display: grid !important;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr) !important;
  gap: clamp(40px, 5vw, 72px) !important;
  align-items: center !important;
  max-width: 1240px !important;
}
html[data-layout-ref="stripe"] .layout-bento-hero {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  grid-template-rows: auto auto auto !important;
  gap: 12px !important;
  position: static !important;
}
html[data-layout-ref="stripe"] .layout-bento-hero .hero-float-card--geo { grid-row: span 2 !important; }
html[data-layout-ref="stripe"] .layout-bento-hero .hero-float-card--lg { grid-column: span 1 !important; }
html[data-layout-ref="stripe"] #services .services-grid {
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 20px !important;
}
html[data-layout-ref="stripe"] #services .service-card {
  border-radius: 16px !important;
  border-top: 3px solid var(--g) !important;
}

/* ═══ LINEAR · 午夜 — 首映巨标 + 浮层统计 + 列表式服务 ═══════ */
html[data-layout-ref="linear"] .hero {
  min-height: 100vh !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding-bottom: 88px !important;
}
html[data-layout-ref="linear"] .hero-shell {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
  max-width: 920px !important;
  margin: 0 auto !important;
  position: relative !important;
}
html[data-layout-ref="linear"] .hero-content { width: 100% !important; }
html[data-layout-ref="linear"] .hero-title--ladder .hero-title-inner {
  align-items: center !important;
}
html[data-layout-ref="linear"] .hero-title-glyph {
  font-family: 'Inter', system-ui, sans-serif !important;
  font-size: clamp(2.8rem, 9.5vw, 6.5rem) !important;
  font-weight: 800 !important;
  letter-spacing: -0.045em !important;
  line-height: 0.95 !important;
}
html[data-layout-ref="linear"] .hero-desc { max-width: 540px !important; margin-inline: auto !important; }
html[data-layout-ref="linear"] .hero-stats-dock {
  position: absolute !important;
  left: 50% !important;
  bottom: -56px !important;
  transform: translateX(-50%) !important;
  width: min(920px, calc(100vw - 48px)) !important;
  z-index: 5 !important;
}
html[data-layout-ref="linear"] .hero-stats-dock .stats-grid {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 0 !important;
  border-radius: 16px !important;
  backdrop-filter: blur(20px) !important;
  border: 1px solid var(--ln) !important;
  background: color-mix(in srgb, var(--d1) 88%, transparent) !important;
  box-shadow: 0 24px 64px color-mix(in srgb, var(--g10) 55%, transparent) !important;
}
html[data-layout-ref="linear"] .hero-visual,
html[data-layout-ref="linear"] .hero-engines-row,
html[data-layout-ref="linear"] .ticker-wrap { display: none !important; }
html[data-layout-ref="linear"] #services { padding-top: 96px !important; }
html[data-layout-ref="linear"] #services .services-grid {
  grid-template-columns: 1fr !important;
  gap: 6px !important;
}
html[data-layout-ref="linear"] #services .service-card {
  display: grid !important;
  grid-template-columns: 52px 1fr auto !important;
  gap: 8px 20px !important;
  align-items: center !important;
  padding: 18px 22px !important;
  border-radius: 12px !important;
  box-shadow: none !important;
}
html[data-layout-ref="linear"] #services .service-desc,
html[data-layout-ref="linear"] #services .service-features,
html[data-layout-ref="linear"] #services .service-metrics { display: none !important; }
html[data-layout-ref="linear"] #services .service-link { grid-column: 3 !important; white-space: nowrap !important; }
html[data-layout-ref="linear"] .value-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 12px !important; }

/* ═══ NOTION · 翡翠 — Bento 置顶 + 2×2 服务 ═══════════════════ */
html[data-layout-ref="notion"] .hero-shell {
  flex-direction: column !important;
  text-align: center !important;
}
html[data-layout-ref="notion"] .hero-visual {
  order: -1 !important;
  width: 100% !important;
  margin-bottom: 32px !important;
}
html[data-layout-ref="notion"] .hero-float-zone {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 14px !important;
  max-width: 960px !important;
  margin: 0 auto !important;
}
html[data-layout-ref="notion"] .hero-float-card {
  min-height: 128px !important;
  border-radius: 24px !important;
}
html[data-layout-ref="notion"] #services {
  background: var(--d2) !important;
  border-radius: 40px !important;
  margin-inline: clamp(12px, 3vw, 40px) !important;
  padding-block: clamp(48px, 6vw, 72px) !important;
}
html[data-layout-ref="notion"] #services .services-grid {
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 16px !important;
}
html[data-layout-ref="notion"] #services .service-card--geo {
  grid-column: 1 / -1 !important;
  display: grid !important;
  grid-template-columns: 200px 1fr !important;
  gap: 24px !important;
  align-items: start !important;
}
html[data-layout-ref="notion"] #kmo .services-grid--kmo {
  grid-template-columns: repeat(3, 1fr) !important;
}

/* ═══ MAGAZINE · 琥珀 — 刊头 + 左右交替通栏 ═══════════════════ */
html[data-layout-ref="magazine"] .layout-mag-head {
  text-align: left !important;
  max-width: 720px !important;
}
html[data-layout-ref="magazine"] .layout-mag-head .section-sub { margin-inline: 0 !important; }
html[data-layout-ref="magazine"] .hero-shell {
  grid-template-columns: 1fr 1fr !important;
  gap: clamp(32px, 5vw, 64px) !important;
}
html[data-layout-ref="magazine"] #services .services-grid {
  grid-template-columns: 1fr !important;
  gap: 0 !important;
}
html[data-layout-ref="magazine"] #services .service-card {
  display: grid !important;
  grid-template-columns: minmax(120px, 200px) 1fr !important;
  gap: 28px !important;
  padding: clamp(40px, 6vw, 64px) clamp(24px, 5vw, 80px) !important;
  margin-bottom: 20px !important;
  border-left: 6px solid var(--g) !important;
  border-radius: 0 18px 18px 0 !important;
  box-shadow: 8px 8px 0 color-mix(in srgb, var(--g10) 80%, transparent) !important;
}
html[data-layout-ref="magazine"] #services .service-card:nth-child(even) {
  direction: rtl;
  border-left: none !important;
  border-right: 6px solid var(--g) !important;
  border-radius: 18px 0 0 18px !important;
  box-shadow: -8px 8px 0 color-mix(in srgb, var(--g10) 80%, transparent) !important;
}
html[data-layout-ref="magazine"] #services .service-card:nth-child(even) > * { direction: ltr; }
html[data-layout-ref="magazine"] .stats-grid { grid-template-columns: repeat(4, 1fr) !important; }

/* ═══ APPLE · 皇家 — 720px 书卷列表 ═══════════════════════════ */
html[data-layout-ref="apple"] #world-main {
  max-width: 720px !important;
  margin-inline: auto !important;
  padding-inline: 28px !important;
}
html[data-layout-ref="apple"] .navbar .nav-inner {
  max-width: 720px !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 12px !important;
}
html[data-layout-ref="apple"] .nav-logo { width: 100%; justify-content: center !important; }
html[data-layout-ref="apple"] .nav-menu {
  width: 100%;
  justify-content: center !important;
  border-top: 1px solid var(--ln);
  padding-top: 12px !important;
}
html[data-layout-ref="apple"] .hero { min-height: min(85vh, 780px) !important; }
html[data-layout-ref="apple"] .hero-title-glyph {
  font-family: 'Noto Serif SC', Georgia, serif !important;
  font-size: clamp(2.4rem, 6vw, 4.2rem) !important;
  font-weight: 600 !important;
  line-height: 1.12 !important;
}
html[data-layout-ref="apple"] .services-grid,
html[data-layout-ref="apple"] .value-grid,
html[data-layout-ref="apple"] .clients-grid,
html[data-layout-ref="apple"] .process-steps,
html[data-layout-ref="apple"] .news-grid {
  grid-template-columns: 1fr !important;
  gap: 0 !important;
}
html[data-layout-ref="apple"] .service-card,
html[data-layout-ref="apple"] .value-card,
html[data-layout-ref="apple"] .client-card,
html[data-layout-ref="apple"] .process-step,
html[data-layout-ref="apple"] .news-card {
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
  border-bottom: 1px solid var(--ln) !important;
  border-radius: 0 !important;
  padding: 32px 0 !important;
  flex-direction: row !important;
  gap: 16px !important;
  text-align: left !important;
}
html[data-layout-ref="apple"] .text-center { text-align: center !important; }

/* ═══ DATADOG · 海洋 — 控制台双栏 + GEO 高卡 ═════════════════ */
html[data-layout-ref="datadog"] .hero-shell {
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr) !important;
  gap: 40px !important;
  max-width: 1320px !important;
  align-items: stretch !important;
}
html[data-layout-ref="datadog"] .layout-hero-panel--dashboard {
  background: var(--d1) !important;
  border: 1px solid var(--ln) !important;
  border-radius: 16px !important;
  padding: 20px !important;
  box-shadow: 0 20px 56px color-mix(in srgb, var(--g10) 50%, transparent) !important;
}
html[data-layout-ref="datadog"] .layout-hero-panel .hero-stats--inline {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 10px !important;
  width: 100% !important;
  margin: 0 !important;
}
html[data-layout-ref="datadog"] .layout-hero-panel .hero-stats--inline > div {
  background: var(--d2) !important;
  border: 1px solid var(--ln) !important;
  border-radius: 10px !important;
  padding: 14px !important;
  text-align: left !important;
}
html[data-layout-ref="datadog"] .hero-stat-num {
  font-family: ui-monospace, monospace !important;
  font-size: 1.6rem !important;
  color: var(--g) !important;
  -webkit-text-fill-color: var(--g) !important;
  background: none !important;
}
html[data-layout-ref="datadog"] .hero-float-zone {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 10px !important;
  margin-top: 16px !important;
}
html[data-layout-ref="datadog"] .hero-float-card--geo { grid-row: span 2 !important; }
html[data-layout-ref="datadog"] #services .services-grid {
  grid-template-columns: 1.15fr 0.85fr !important;
  grid-template-rows: auto auto !important;
  gap: 14px !important;
}
html[data-layout-ref="datadog"] #services .service-card--geo {
  grid-row: 1 / span 2 !important;
  grid-column: 1 !important;
}
html[data-layout-ref="datadog"] #services .service-card--seo { grid-column: 2 !important; grid-row: 1 !important; }
html[data-layout-ref="datadog"] #services .service-card--orm { grid-column: 2 !important; grid-row: 2 !important; }
html[data-layout-ref="datadog"] .stat-num {
  font-family: ui-monospace, monospace !important;
}

/* ═══ GLOSSIER · 玫瑰 — 居中 + 阶梯卡片 ═══════════════════════ */
html[data-layout-ref="glossier"] .hero-shell {
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
  max-width: 880px !important;
  margin-inline: auto !important;
}
html[data-layout-ref="glossier"] .hero-title-glyph {
  font-family: 'Cormorant Garamond', 'Noto Serif SC', serif !important;
  font-style: italic !important;
  font-size: clamp(2.8rem, 7vw, 4.8rem) !important;
}
html[data-layout-ref="glossier"] #services .services-grid {
  grid-template-columns: repeat(3, 1fr) !important;
  align-items: start !important;
}
html[data-layout-ref="glossier"] #services .service-card:nth-child(2) { margin-top: 28px !important; }
html[data-layout-ref="glossier"] #services .service-card:nth-child(3) { margin-top: 56px !important; }
html[data-layout-ref="glossier"] #services .service-card {
  border-radius: 32px !important;
}
html[data-layout-ref="glossier"] .clients-grid {
  display: flex !important;
  overflow-x: auto !important;
  gap: 20px !important;
  scroll-snap-type: x mandatory;
  padding-bottom: 16px;
}
html[data-layout-ref="glossier"] .client-card {
  flex: 0 0 min(300px, 82vw) !important;
  scroll-snap-align: start;
}

/* ═══ BRUTALIST · 墨色 — 全宽表格 ═════════════════════════════ */
html[data-layout-ref="brutalist"] .container {
  max-width: none !important;
  padding-inline: clamp(24px, 6vw, 96px) !important;
}
html[data-layout-ref="brutalist"] .layout-align-left {
  text-align: left !important;
}
html[data-layout-ref="brutalist"] .layout-align-left .section-sub { margin-inline: 0 !important; }
html[data-layout-ref="brutalist"] .hero-title-glyph {
  font-family: 'IBM Plex Sans', sans-serif !important;
  font-size: clamp(2.8rem, 11vw, 7.5rem) !important;
  text-transform: uppercase !important;
  line-height: 0.85 !important;
  letter-spacing: -0.04em !important;
}
html[data-layout-ref="brutalist"] .services-grid,
html[data-layout-ref="brutalist"] .stats-grid,
html[data-layout-ref="brutalist"] .value-grid {
  grid-template-columns: 1fr !important;
  border: 3px solid var(--t1) !important;
  border-radius: 0 !important;
}
html[data-layout-ref="brutalist"] .service-card,
html[data-layout-ref="brutalist"] .stat-item,
html[data-layout-ref="brutalist"] .value-card {
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  border: none !important;
  border-bottom: 2px solid var(--t1) !important;
  padding: 28px 20px !important;
}
html[data-layout-ref="brutalist"] .section-title { text-transform: uppercase !important; }

/* ═══ PALANTIR · 赤红 — 全幅色带通栏 ═══════════════════════════ */
html[data-layout-ref="palantir"].layout-full-bleed-services #services .container,
html[data-layout-ref="palantir"] #services .container {
  max-width: none !important;
  padding-inline: 0 !important;
}
html[data-layout-ref="palantir"] #services .text-center {
  max-width: 960px !important;
  margin-inline: auto !important;
  padding-inline: 24px !important;
  text-align: left !important;
}
html[data-layout-ref="palantir"] #services .text-center .section-sub { margin-inline: 0 !important; }
html[data-layout-ref="palantir"] #services .services-grid {
  grid-template-columns: 1fr !important;
  gap: 0 !important;
}
html[data-layout-ref="palantir"] #services .service-card {
  border-radius: 0 !important;
  padding: clamp(48px, 8vw, 80px) clamp(24px, 6vw, 120px) !important;
  max-width: none !important;
}
html[data-layout-ref="palantir"] .hero-shell {
  grid-template-columns: 1.15fr 0.85fr !important;
  max-width: 1280px !important;
}
html[data-layout-ref="palantir"] .hero-title-glyph {
  border-left: 8px solid var(--g) !important;
  padding-left: 24px !important;
  font-weight: 900 !important;
}

/* ═══ FIGMA · 薄荷 — 统计前置 + 硬阴影 ═════════════════════════ */
html[data-layout-ref="figma"] .layout-stats-top {
  order: -1 !important;
  width: 100% !important;
  max-width: 720px !important;
  margin: 0 auto 24px !important;
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 8px !important;
  border: 3px solid var(--t1) !important;
  border-radius: 999px !important;
  padding: 14px 20px !important;
  box-shadow: 8px 8px 0 var(--g) !important;
  background: var(--d1) !important;
}
html[data-layout-ref="figma"] .hero-shell {
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
}
html[data-layout-ref="figma"] #services .service-card {
  border: 2px solid var(--t1) !important;
  border-radius: 20px !important;
  box-shadow: 6px 6px 0 var(--g10) !important;
  transform: rotate(-0.4deg);
}
html[data-layout-ref="figma"] #services .service-card:nth-child(even) { transform: rotate(0.5deg); }
html[data-layout-ref="figma"] .section-badge {
  transform: rotate(-3deg) !important;
  background: var(--g) !important;
  color: #fff !important;
}

/* ═══ MUSEUM · 墨韵 — 侧栏 + 时间轴 ═══════════════════════════ */
html[data-layout-ref="museum"] #world-shell {
  display: grid !important;
  grid-template-columns: 72px 1fr !important;
}
html[data-layout-ref="museum"] .navbar {
  left: 72px !important;
  width: calc(100% - 72px) !important;
}
html[data-layout-ref="museum"] #world-main {
  max-width: 680px !important;
  margin-inline: auto !important;
}
html[data-layout-ref="museum"] .hero-title-glyph {
  font-family: 'Ma Shan Zheng', 'Noto Serif SC', serif !important;
  font-size: clamp(2.8rem, 7vw, 5rem) !important;
}
html[data-layout-ref="museum"] .layout-timeline-section .process-steps {
  grid-template-columns: 1fr !important;
  max-width: 560px !important;
  margin-inline: auto !important;
  padding-left: 32px !important;
  border-left: 2px solid var(--ln) !important;
}
html[data-layout-ref="museum"] .services-grid { grid-template-columns: 1fr !important; }

/* ═══ RAYCAST · 霓虹 — 终端双栏 + 紧凑面板 ═══════════════════ */
html[data-layout-ref="raycast"] .hero-shell {
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr) !important;
  gap: 24px !important;
  max-width: 1180px !important;
}
html[data-layout-ref="raycast"] .hero-title-glyph {
  font-family: ui-monospace, 'Orbitron', monospace !important;
  font-size: clamp(1.3rem, 3.5vw, 2.2rem) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.1em !important;
}
html[data-layout-ref="raycast"] .hero-title-row { display: block !important; }
html[data-layout-ref="raycast"] .hero-title-row::before {
  content: '> ';
  color: var(--g);
  opacity: 0.8;
}
html[data-layout-ref="raycast"] .hero-float-card,
html[data-layout-ref="raycast"] .service-card,
html[data-layout-ref="raycast"] .stat-item {
  border-radius: 4px !important;
  font-family: ui-monospace, monospace !important;
  font-size: 0.82rem !important;
  border: 1px solid var(--ln) !important;
  background: var(--d1) !important;
}
html[data-layout-ref="raycast"] #services .services-grid {
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 10px !important;
}
html[data-layout-ref="raycast"] .section-title {
  font-family: ui-monospace, 'Orbitron', monospace !important;
  text-transform: uppercase !important;
  letter-spacing: 0.12em !important;
  font-size: 0.95rem !important;
}
html[data-layout-ref="raycast"] .process-step {
  transform: none !important;
}

/* ── 取消 tech-polish 对非 Stripe 模板的卡片统一化 ───────────── */
html[data-layout-ref]:not([data-layout-ref="stripe"]):not([data-layout-ref="datadog"]) .service-card::after,
html[data-layout-ref]:not([data-layout-ref="stripe"]):not([data-layout-ref="datadog"]) .value-card::after {
  display: none !important;
}

@media (max-width: 768px) {
  html[data-layout-ref="stripe"] .hero-shell,
  html[data-layout-ref="datadog"] .hero-shell,
  html[data-layout-ref="raycast"] .hero-shell,
  html[data-layout-ref="palantir"] .hero-shell,
  html[data-layout-ref="magazine"] .hero-shell {
    grid-template-columns: 1fr !important;
  }
  html[data-layout-ref="linear"] .hero-stats-dock {
    position: relative !important;
    bottom: auto !important;
    transform: none !important;
    left: auto !important;
    width: 100% !important;
    margin-top: 32px !important;
  }
  html[data-layout-ref="linear"] .hero-stats-dock .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  html[data-layout-ref="datadog"] #services .services-grid,
  html[data-layout-ref="notion"] #services .services-grid {
    grid-template-columns: 1fr !important;
  }
  html[data-layout-ref="datadog"] #services .service-card--geo { grid-row: auto !important; }
  html[data-layout-ref="glossier"] #services .service-card:nth-child(n) { margin-top: 0 !important; }
  html[data-layout-ref="figma"] .layout-stats-top {
    grid-template-columns: repeat(2, 1fr) !important;
    border-radius: 20px !important;
  }
  html[data-layout-ref="museum"] #world-shell { grid-template-columns: 1fr !important; }
  html[data-layout-ref="museum"] .navbar { left: 0 !important; width: 100% !important; }
}
