/* ================================================================
   首页恢复层 — 修复模板 CSS 与 style.css 冲突导致的「首页消失/错乱」
   必须最后加载
   ================================================================ */

/* ── 非 A/D 模板：解除阶梯标题错位、nowrap 裁切 ── */
html[data-template]:not([data-template="classic-iris"]):not([data-template="sunset-amber"]) .hero-title--ladder .hero-title-inner {
  display: flex !important;
  flex-direction: column !important;
  align-items: var(--w-h1-align, flex-start) !important;
  gap: .1em !important;
  width: 100% !important;
}
html[data-template]:not([data-template="classic-iris"]):not([data-template="sunset-amber"]) .hero-title--ladder .hero-title-row,
html[data-template]:not([data-template="classic-iris"]):not([data-template="sunset-amber"]) .hero-title--ladder .hero-title-row--core,
html[data-template]:not([data-template="classic-iris"]):not([data-template="sunset-amber"]) .hero-title--ladder .hero-title-row--finale {
  margin-left: 0 !important;
  white-space: normal !important;
  width: 100% !important;
}
html[data-template]:not([data-template="classic-iris"]):not([data-template="sunset-amber"]) .hero-title--ladder .hero-title-rule {
  display: none !important;
}

/* ── 浮动卡仅用于双栏 Hero，避免 column 模板里卡片乱飞 ── */
html[data-template]:not([data-template="classic-iris"]):not([data-template="ocean-teal"]):not([data-template="neon-cyber"]) .hero-visual--float {
  display: none !important;
}

/* ── 模板×配色：区块背景由 template-covers 统一驱动，此处仅兜底文字色 ── */

/* 暗色配色才允许白字 Hero */
html[data-color="midnight"] .hero-desc,
html[data-color="neon-volt"] .hero-desc,
html[data-template="midnight-slate"][data-color="midnight"] .hero-desc,
html[data-template="neon-cyber"][data-color="neon-volt"] .hero-desc {
  color: rgba(255, 255, 255, .72) !important;
}

/* 浅色配色 + 暗场模板：取消模板写死的白字/暗底 */
html[data-template="midnight-slate"]:not([data-color="midnight"]):not([data-color="neon-volt"]) .hero-title--flat .hero-title-glyph,
html[data-template="midnight-slate"]:not([data-color="midnight"]):not([data-color="neon-volt"]) .hero-title--ladder .hero-char {
  color: var(--t1) !important;
  -webkit-text-fill-color: var(--t1) !important;
  text-shadow: none !important;
}
html[data-template="midnight-slate"]:not([data-color="midnight"]):not([data-color="neon-volt"]) .hero-desc {
  color: var(--t2) !important;
}
html[data-template="crimson-bold"]:not([data-color="vermilion"]) .hero-title--flat .hero-title-glyph,
html[data-template="crimson-bold"]:not([data-color="vermilion"]) .hero-title--ladder .hero-char {
  color: var(--t1) !important;
  -webkit-text-fill-color: var(--t1) !important;
}

/* ── 玫瑰轻奢：居中 Hero + 恢复 GEO/SEO/ORM 芯片行 ── */
html[data-template="rose-blush"] .hero-shell {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
  gap: 24px !important;
}
html[data-template="rose-blush"] .hero-content {
  width: 100% !important;
  max-width: 820px !important;
}
html[data-template="rose-blush"] .hero-engines-row {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  margin: 16px auto !important;
}
html[data-template="rose-blush"] .hero-desc {
  margin-inline: auto !important;
  text-align: center !important;
}
html[data-template="rose-blush"] .hero-actions {
  justify-content: center !important;
}
html[data-template="rose-blush"] .hero-foot {
  justify-content: center !important;
}

/* ── 保证主内容区可见 ── */
#world-shell,
#world-main {
  display: block !important;
  min-height: 0 !important;
  visibility: visible !important;
  opacity: 1 !important;
}
html[data-template="calligraphy"] #world-shell {
  display: grid !important;
}
