/* ============================================================
   匠心企业 — 暗色模式组件修复（合法 CSS，覆盖 preset 硬编码）
   ============================================================ */

/* —— Hero 语义色：浅 Hero 风格在暗色下切回浅字 + 深遮罩 —— */
[data-theme="dark"] body.theme-corporate-pro[data-visual-style="nordic"] {
  --hero-fg: #f0f4f2;
  --hero-fg-muted: rgba(240, 244, 242, 0.85);
  --hero-btn-outline-fg: #fff;
  --hero-btn-outline-border: rgba(255, 255, 255, 0.5);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body.theme-corporate-pro[data-visual-style="nordic"] {
    --hero-fg: #f0f4f2;
    --hero-fg-muted: rgba(240, 244, 242, 0.85);
    --hero-btn-outline-fg: #fff;
    --hero-btn-outline-border: rgba(255, 255, 255, 0.5);
  }
}

[data-theme="dark"] body.theme-corporate-pro[data-visual-style="nordic"] .header-top,
[data-theme="dark"] body.theme-corporate-pro[data-visual-style="nordic"] .header-top .util-link,
[data-theme="dark"] body.theme-corporate-pro[data-visual-style="nordic"] .header-tagline {
  background: var(--color-surface);
  color: var(--color-muted);
  border-color: var(--color-border);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body.theme-corporate-pro[data-visual-style="nordic"] .header-top,
  :root:not([data-theme="light"]) body.theme-corporate-pro[data-visual-style="nordic"] .header-top .util-link,
  :root:not([data-theme="light"]) body.theme-corporate-pro[data-visual-style="nordic"] .header-tagline {
    background: var(--color-surface);
    color: var(--color-muted);
    border-color: var(--color-border);
  }
}

[data-theme="dark"] body.theme-corporate-pro[data-visual-style="nordic"] .corp-hero-carousel .corp-hero-slide-overlay {
  background: linear-gradient(90deg, rgba(18, 22, 20, 0.94) 0%, rgba(18, 22, 20, 0.72) 55%, transparent 100%);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body.theme-corporate-pro[data-visual-style="nordic"] .corp-hero-carousel .corp-hero-slide-overlay {
    background: linear-gradient(90deg, rgba(18, 22, 20, 0.94) 0%, rgba(18, 22, 20, 0.72) 55%, transparent 100%);
  }
}

/* —— 墨韵 editorial —— */
[data-theme="dark"] body.theme-corporate-pro[data-visual-style="editorial"] {
  --hero-fg: var(--color-text);
  --hero-fg-muted: var(--color-muted);
  --hero-btn-outline-fg: var(--color-text);
  --hero-btn-outline-border: var(--color-border-strong);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body.theme-corporate-pro[data-visual-style="editorial"] {
    --hero-fg: var(--color-text);
    --hero-fg-muted: var(--color-muted);
    --hero-btn-outline-fg: var(--color-text);
    --hero-btn-outline-border: var(--color-border-strong);
  }
}

[data-theme="dark"] body.theme-corporate-pro[data-visual-style="editorial"] .corp-hero-carousel .corp-hero-slide-overlay {
  background: linear-gradient(90deg, rgba(10, 10, 10, 0.94) 0%, rgba(10, 10, 10, 0.82) 45%, transparent 100%);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body.theme-corporate-pro[data-visual-style="editorial"] .corp-hero-carousel .corp-hero-slide-overlay {
    background: linear-gradient(90deg, rgba(10, 10, 10, 0.94) 0%, rgba(10, 10, 10, 0.82) 45%, transparent 100%);
  }
}

[data-theme="dark"] body.theme-corporate-pro[data-visual-style="editorial"] .corp-header,
[data-theme="dark"] body.theme-corporate-pro[data-visual-style="editorial"] .news-grid .corp-card {
  border-color: var(--color-border-strong);
}

[data-theme="dark"] body.theme-corporate-pro[data-visual-style="editorial"] .corp-nav .nav-cta {
  background: var(--color-text);
  color: var(--color-bg);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body.theme-corporate-pro[data-visual-style="editorial"] .corp-header,
  :root:not([data-theme="light"]) body.theme-corporate-pro[data-visual-style="editorial"] .news-grid .corp-card {
    border-color: var(--color-border-strong);
  }
  :root:not([data-theme="light"]) body.theme-corporate-pro[data-visual-style="editorial"] .corp-nav .nav-cta {
    background: var(--color-text);
    color: var(--color-bg);
  }
}

/* —— 午夜 midnight：暗色恢复深色奢雅 —— */
[data-theme="dark"] body.theme-corporate-pro[data-visual-style="midnight"] {
  --hero-fg: #ffffff;
  --hero-fg-muted: rgba(255, 255, 255, 0.88);
  background-image: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(212, 175, 55, 0.08), transparent);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body.theme-corporate-pro[data-visual-style="midnight"] {
    --hero-fg: #ffffff;
    --hero-fg-muted: rgba(255, 255, 255, 0.88);
    background-image: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(212, 175, 55, 0.08), transparent);
  }
}

[data-theme="dark"] body.theme-corporate-pro[data-visual-style="midnight"] .header-top {
  background: linear-gradient(90deg, #0c1929, #152238);
  color: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

[data-theme="dark"] body.theme-corporate-pro[data-visual-style="midnight"] .header-top .util-link,
[data-theme="dark"] body.theme-corporate-pro[data-visual-style="midnight"] .header-tagline {
  color: rgba(255, 255, 255, 0.85);
}

[data-theme="dark"] body.theme-corporate-pro[data-visual-style="midnight"] .corp-header {
  background: rgba(18, 26, 36, 0.92);
}

[data-theme="dark"] body.theme-corporate-pro[data-visual-style="midnight"] .corp-hero,
[data-theme="dark"] body.theme-corporate-pro[data-visual-style="midnight"] .corp-hero-carousel .corp-hero-slide-overlay {
  background: linear-gradient(125deg, #060a10 0%, #0c1929 40%, #152238 100%);
}

[data-theme="dark"] body.theme-corporate-pro[data-visual-style="midnight"] .section-label,
[data-theme="dark"] body.theme-corporate-pro[data-visual-style="midnight"] .stat-value {
  color: var(--color-accent);
}

[data-theme="dark"] body.theme-corporate-pro[data-visual-style="midnight"] .btn-primary {
  background: linear-gradient(135deg, #d4af37, #b8941f);
  color: #0c1929;
}

[data-theme="dark"] body.theme-corporate-pro[data-visual-style="midnight"] .corp-cta-band .cta-band-card {
  background: linear-gradient(135deg, #152238 0%, #0c1929 100%);
  border: 1px solid rgba(212, 175, 55, 0.25);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body.theme-corporate-pro[data-visual-style="midnight"] .header-top {
    background: linear-gradient(90deg, #0c1929, #152238);
    color: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
  }
  :root:not([data-theme="light"]) body.theme-corporate-pro[data-visual-style="midnight"] .header-top .util-link,
  :root:not([data-theme="light"]) body.theme-corporate-pro[data-visual-style="midnight"] .header-tagline {
    color: rgba(255, 255, 255, 0.85);
  }
  :root:not([data-theme="light"]) body.theme-corporate-pro[data-visual-style="midnight"] .corp-header {
    background: rgba(18, 26, 36, 0.92);
  }
  :root:not([data-theme="light"]) body.theme-corporate-pro[data-visual-style="midnight"] .corp-hero,
  :root:not([data-theme="light"]) body.theme-corporate-pro[data-visual-style="midnight"] .corp-hero-carousel .corp-hero-slide-overlay {
    background: linear-gradient(125deg, #060a10 0%, #0c1929 40%, #152238 100%);
  }
  :root:not([data-theme="light"]) body.theme-corporate-pro[data-visual-style="midnight"] .section-label,
  :root:not([data-theme="light"]) body.theme-corporate-pro[data-visual-style="midnight"] .stat-value {
    color: var(--color-accent);
  }
  :root:not([data-theme="light"]) body.theme-corporate-pro[data-visual-style="midnight"] .btn-primary {
    background: linear-gradient(135deg, #d4af37, #b8941f);
    color: #0c1929;
  }
  :root:not([data-theme="light"]) body.theme-corporate-pro[data-visual-style="midnight"] .corp-cta-band .cta-band-card {
    background: linear-gradient(135deg, #152238 0%, #0c1929 100%);
    border: 1px solid rgba(212, 175, 55, 0.25);
  }
}

/* —— 北欧亮色 Hero：强制亮色模式下保持深字（防系统暗色污染） —— */
[data-theme="light"] body.theme-corporate-pro[data-visual-style="nordic"] {
  --hero-fg: var(--color-text);
  --hero-fg-muted: var(--color-muted);
  --hero-btn-outline-fg: var(--color-primary);
  --hero-btn-outline-border: var(--color-primary);
}

[data-theme="light"] body.theme-corporate-pro[data-visual-style="nordic"] .corp-hero-carousel .corp-hero-slide-overlay {
  background: linear-gradient(90deg, rgba(247, 248, 246, 0.97) 0%, rgba(247, 248, 246, 0.75) 55%, transparent 100%);
}

[data-theme="light"] body.theme-corporate-pro[data-visual-style="editorial"] {
  --hero-fg: var(--color-text);
  --hero-fg-muted: var(--color-muted);
}

[data-theme="light"] body.theme-corporate-pro[data-visual-style="editorial"] .corp-hero-carousel .corp-hero-slide-overlay {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.97) 0%, rgba(255, 255, 255, 0.85) 45%, transparent 100%);
}

/* —— 其他风格暗色微调 —— */
[data-theme="dark"] body.theme-corporate-pro[data-visual-style="sunrise"] .corp-partners {
  background: var(--color-surface);
  border-color: var(--color-border);
}

[data-theme="dark"] body.theme-corporate-pro[data-visual-style="aurora"] .service-card-icon {
  background: linear-gradient(135deg, rgba(165, 180, 252, 0.15), rgba(103, 232, 249, 0.12));
  color: var(--color-primary);
}

[data-theme="dark"] body.theme-corporate-pro[data-visual-style="slate"] .hero-label {
  background: var(--color-accent);
  color: #fff;
}

/* 轮播控件对比度 */
[data-theme="dark"] body.theme-corporate-pro .corp-hero-dot,
[data-theme="dark"] body.theme-corporate-pro .corp-hero-arrow,
[data-theme="dark"] body.theme-corporate-pro .corp-hero-arrow-side {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
}

[data-theme="dark"] body.theme-corporate-pro .corp-hero-dot.is-active {
  background: #fff;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body.theme-corporate-pro .corp-hero-dot,
  :root:not([data-theme="light"]) body.theme-corporate-pro .corp-hero-arrow,
  :root:not([data-theme="light"]) body.theme-corporate-pro .corp-hero-arrow-side {
    border-color: rgba(255, 255, 255, 0.35);
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
  }
  :root:not([data-theme="light"]) body.theme-corporate-pro .corp-hero-dot.is-active {
    background: #fff;
  }
  :root:not([data-theme="light"]) body.theme-corporate-pro[data-visual-style="sunrise"] .corp-partners {
    background: var(--color-surface);
    border-color: var(--color-border);
  }
}

/* 内页 / 导航 */
body.theme-corporate-pro .corp-page-hero .section-label {
  color: var(--color-accent);
}

body.theme-corporate-pro .corp-page-hero h1 {
  color: var(--color-text);
}

body.theme-corporate-pro .corp-page-lead,
body.theme-corporate-pro .page-lead {
  color: var(--color-muted);
}

[data-theme="dark"] body.theme-corporate-pro .corp-logo,
[data-theme="dark"] body.theme-corporate-pro .corp-nav a {
  color: var(--color-text);
}

[data-theme="dark"] body.theme-corporate-pro .corp-nav a:hover {
  color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 12%, transparent);
}

[data-theme="dark"] body.theme-corporate-pro .logo-text small {
  color: var(--color-muted);
}

/* 顶栏工具区暗色 */
[data-theme="dark"] body.theme-corporate-pro .header-top .theme-toggle {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

/* 浅色 Hero 风格在暗色下：静态 Hero 文字 */
[data-theme="dark"] body.theme-corporate-pro[data-visual-style="nordic"] .corp-hero,
[data-theme="dark"] body.theme-corporate-pro[data-visual-style="editorial"] .corp-hero {
  color: var(--hero-fg);
}
