/* ================================================================
   服务卡片 · 内容密度 + 交互层（全模板通用，最后加载）
   ================================================================ */

/* ── 取消 flex 撑开造成的「中间大空白」──────────────────────── */
html[data-template] #services .service-card,
html[data-template] #kmo .service-card {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 0 !important;
  height: auto !important;
  min-height: 0 !important;
  padding: clamp(22px, 2.5vw, 28px) clamp(20px, 2.5vw, 26px) !important;
  cursor: pointer;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease !important;
}
html[data-template] .service-desc {
  flex: 0 0 auto !important;
  margin-bottom: 12px !important;
  line-height: 1.65 !important;
}
html[data-template] .service-features {
  flex: 0 0 auto !important;
  margin: 0 0 14px !important;
}
html[data-template] .service-feature {
  padding: 4px 0 4px 14px !important;
  line-height: 1.5 !important;
}
html[data-template] .service-title {
  margin-bottom: 8px !important;
}
html[data-template] .service-icon {
  margin-bottom: 10px !important;
}
html[data-template] .service-tag {
  margin-bottom: 8px !important;
}

/* ── 指标栏：紧凑内嵌，不另占大块 ───────────────────────────── */
html[data-template] .service-metrics {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 8px !important;
  margin: 0 0 14px !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  overflow: visible !important;
}
html[data-template] .service-metric {
  background: var(--d2) !important;
  border: 1px solid var(--ln) !important;
  border-radius: 10px !important;
  padding: 10px 6px !important;
  text-align: center !important;
  transition: border-color .2s, background .2s;
}
html[data-template] .service-metric-val {
  display: block;
  font-size: .95rem;
  font-weight: 800;
  color: var(--g);
  line-height: 1.2;
  letter-spacing: -.02em;
}
html[data-template] .service-metric-lbl {
  display: block;
  font-size: .58rem;
  color: var(--t3);
  margin-top: 2px;
  line-height: 1.3;
}

/* ── 平台标签（填充 GEO 等大卡中间区域）────────────────────── */
.service-platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 14px;
}
.service-platforms__tag {
  font-size: .68rem;
  font-weight: 600;
  color: var(--t2);
  background: var(--d2);
  border: 1px solid var(--ln);
  border-radius: 999px;
  padding: 4px 10px;
  transition: border-color .2s, color .2s, background .2s;
}
.service-card--geo .service-platforms__tag:hover {
  border-color: var(--geo);
  color: var(--geo);
  background: var(--geo-bg);
}

/* ── 底部 CTA 行 ─────────────────────────────────────────────── */
html[data-template] .service-link {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--ln);
  width: 100%;
  font-size: .82rem !important;
  font-weight: 700 !important;
  text-decoration: none !important;
  transition: color .2s, gap .2s;
}
html[data-template] .service-link::after {
  content: '→';
  transition: transform .2s ease;
}
html[data-template] .service-card:hover .service-link {
  color: var(--g) !important;
}
html[data-template] .service-card:hover .service-link::after {
  transform: translateX(4px);
}

/* ── 悬停 / 聚焦交互 ─────────────────────────────────────────── */
html[data-template] .service-card:hover {
  transform: translateY(-3px) !important;
  border-color: var(--ln2) !important;
  box-shadow: 0 12px 36px color-mix(in srgb, var(--g10) 70%, transparent) !important;
}
html[data-template] .service-card:focus-visible {
  outline: 2px solid var(--g);
  outline-offset: 2px;
}
html[data-template] .service-card:active {
  transform: translateY(-1px) !important;
}
html[data-template] .service-card:hover .service-metric {
  border-color: var(--ln2);
}
html[data-template] .service-card:hover .service-icon {
  transform: scale(1.05);
}
html[data-template] .service-icon {
  transition: transform .22s ease;
}

/* ── 默认：三列等高网格（classic-iris 等）────────────────────── */
html[data-template] #services .services-grid {
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 18px !important;
  align-items: stretch !important;
}
html[data-template] #services .service-card--geo,
html[data-template] #services .service-card--seo,
html[data-template] #services .service-card--orm {
  grid-column: auto !important;
  grid-row: auto !important;
}

/* ── 海洋 SaaS：左大右双，内部填满 ─────────────────────────── */
html[data-template="ocean-teal"] #services .services-grid {
  grid-template-columns: 1.05fr .95fr !important;
  gap: 16px !important;
}
html[data-template="ocean-teal"] #services .service-card--geo {
  grid-row: span 2 !important;
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  grid-template-rows: auto auto 1fr auto auto !important;
  gap: 0 20px !important;
  align-content: start !important;
}
html[data-template="ocean-teal"] #services .service-card--geo .service-icon,
html[data-template="ocean-teal"] #services .service-card--geo .service-tag,
html[data-template="ocean-teal"] #services .service-card--geo .service-title,
html[data-template="ocean-teal"] #services .service-card--geo .service-desc,
html[data-template="ocean-teal"] #services .service-card--geo .service-features {
  grid-column: 1 !important;
}
html[data-template="ocean-teal"] #services .service-card--geo .service-platforms,
html[data-template="ocean-teal"] #services .service-card--geo .service-metrics {
  grid-column: 2 !important;
  align-self: start !important;
}
html[data-template="ocean-teal"] #services .service-card--geo .service-platforms {
  margin-top: 28px !important;
  flex-direction: column !important;
  align-items: stretch !important;
}
html[data-template="ocean-teal"] #services .service-card--geo .service-link {
  grid-column: 1 / -1 !important;
}

/* ── 翡翠：ORM 横排仅在全宽时启用 ───────────────────────────── */
html[data-template="forest-jade"] #services .services-grid {
  grid-template-columns: repeat(2, 1fr) !important;
}
html[data-template="forest-jade"] #services .service-card--orm {
  grid-column: 1 / -1 !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) !important;
  gap: 24px !important;
  align-items: start !important;
}
html[data-template="forest-jade"] #services .service-card--orm .service-metrics {
  grid-column: 2 !important;
  margin-top: 0 !important;
}

/* ── 午夜：横条卡片保持单行密度 ─────────────────────────────── */
html[data-template="midnight-slate"] #services .service-card {
  padding: 18px 20px !important;
}
html[data-template="midnight-slate"] .service-metrics {
  margin-bottom: 0 !important;
}

@media (max-width: 992px) {
  html[data-template] #services .services-grid {
    grid-template-columns: 1fr !important;
  }
  html[data-template="ocean-teal"] #services .service-card--geo {
    grid-template-columns: 1fr !important;
    grid-row: auto !important;
  }
  html[data-template="ocean-teal"] #services .service-card--geo .service-platforms,
  html[data-template="ocean-teal"] #services .service-card--geo .service-metrics {
    grid-column: 1 !important;
  }
  html[data-template="forest-jade"] #services .service-card--orm {
    grid-template-columns: 1fr !important;
  }
}
