/* 6 套农业视觉风格预设 */

body.theme-agriculture-hub {
  --style-btn-radius: 10px;
  --style-card-radius: var(--ag-radius, 16px);
}

body.theme-agriculture-hub[data-visual-style="harvest"] {
  --color-primary: #2d6a4f;
  --color-accent: #f4a261;
  --gradient-hero: linear-gradient(135deg, #1b4332 0%, #2d6a4f 50%, #40916c 100%);
}

body.theme-agriculture-hub[data-visual-style="field"] {
  --color-primary: #386641;
  --color-accent: #a7c957;
  --gradient-hero: linear-gradient(135deg, #386641 0%, #6a994e 100%);
}

body.theme-agriculture-hub[data-visual-style="coop"] {
  --color-primary: #1d4e89;
  --color-accent: #64b5f6;
  --gradient-hero: linear-gradient(135deg, #1d4e89 0%, #2a6fbb 100%);
}

body.theme-agriculture-hub[data-visual-style="eco"] {
  --color-primary: #1b5e20;
  --color-accent: #81c784;
  --gradient-hero: linear-gradient(135deg, #1b5e20 0%, #43a047 100%);
}

body.theme-agriculture-hub[data-visual-style="rice"] {
  --color-primary: #8d6e63;
  --color-accent: #d7ccc8;
  --gradient-hero: linear-gradient(135deg, #6d4c41 0%, #a1887f 100%);
}

body.theme-agriculture-hub[data-visual-style="gov"] {
  --color-primary: #b71c1c;
  --color-accent: #ffc107;
  --gradient-hero: linear-gradient(135deg, #b71c1c 0%, #d32f2f 55%, #e53935 100%);
}

/* 浅色模式：各风格页面背景/边框微调（勿在暗色下生效） */
:root:not([data-theme="dark"]) body.theme-agriculture-hub[data-visual-style="field"] {
  --color-bg: #f8faf5;
}

:root:not([data-theme="dark"]) body.theme-agriculture-hub[data-visual-style="coop"] {
  --color-bg: #f0f7ff;
  --color-border: #bbdefb;
}

:root:not([data-theme="dark"]) body.theme-agriculture-hub[data-visual-style="eco"] {
  --color-bg: #f1f8e9;
}

:root:not([data-theme="dark"]) body.theme-agriculture-hub[data-visual-style="rice"] {
  --color-bg: #faf8f5;
  --color-text: #4e342e;
  --color-muted-text: #795548;
  --color-border: #d7ccc8;
}

:root:not([data-theme="dark"]) body.theme-agriculture-hub[data-visual-style="gov"] {
  --color-bg: #fff8f8;
  --color-border: #ffcdd2;
}

body.theme-agriculture-hub .ag-hero-title,
body.theme-agriculture-hub .ag-page-header h1 {
  font-family: var(--font-serif);
}

body.theme-agriculture-hub .ag-product-card,
body.theme-agriculture-hub .ag-service-card,
body.theme-agriculture-hub .ag-post-card {
  border-radius: var(--style-card-radius);
}

body.theme-agriculture-hub .ag-btn {
  border-radius: var(--style-btn-radius);
}

/* ── 暗色模式：按视觉风格覆盖（必须高于浅色 body 变量） ── */
:root[data-theme="dark"] body.theme-agriculture-hub[data-visual-style="harvest"] {
  --color-bg: #081c15;
  --color-surface: #1b4332;
  --color-text: #d8f3dc;
  --color-muted-text: #95d5b2;
  --color-border: #2d6a4f;
  --color-primary: #74c69d;
  --gradient-hero: linear-gradient(135deg, #081c15 0%, #1b4332 50%, #2d6a4f 100%);
}

:root[data-theme="dark"] body.theme-agriculture-hub[data-visual-style="field"] {
  --color-bg: #0a1a0c;
  --color-surface: #1a3320;
  --color-text: #e8f5e9;
  --color-muted-text: #a7c957;
  --color-border: #2d5016;
  --color-primary: #8bc34a;
  --gradient-hero: linear-gradient(135deg, #0a1a0c 0%, #386641 100%);
}

:root[data-theme="dark"] body.theme-agriculture-hub[data-visual-style="coop"] {
  --color-bg: #0a1929;
  --color-surface: #132f4c;
  --color-text: #e3f2fd;
  --color-muted-text: #90caf9;
  --color-border: #1e4976;
  --color-primary: #64b5f6;
  --gradient-hero: linear-gradient(135deg, #0a1929 0%, #1d4e89 100%);
}

:root[data-theme="dark"] body.theme-agriculture-hub[data-visual-style="eco"] {
  --color-bg: #0a1a0c;
  --color-surface: #1b3a1b;
  --color-text: #e8f5e9;
  --color-muted-text: #81c784;
  --color-border: #2e7d32;
  --color-primary: #66bb6a;
  --gradient-hero: linear-gradient(135deg, #0a1a0c 0%, #1b5e20 100%);
}

:root[data-theme="dark"] body.theme-agriculture-hub[data-visual-style="rice"] {
  --color-bg: #1a1410;
  --color-surface: #3e2723;
  --color-text: #efebe9;
  --color-muted-text: #bcaaa4;
  --color-border: #5d4037;
  --color-primary: #a1887f;
  --gradient-hero: linear-gradient(135deg, #1a1410 0%, #6d4c41 100%);
}

:root[data-theme="dark"] body.theme-agriculture-hub[data-visual-style="gov"] {
  --color-bg: #1a0a0a;
  --color-surface: #3e1010;
  --color-text: #ffebee;
  --color-muted-text: #ef9a9a;
  --color-border: #7f1d1d;
  --color-primary: #ef5350;
  --gradient-hero: linear-gradient(135deg, #1a0a0a 0%, #b71c1c 55%, #7f1d1d 100%);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body.theme-agriculture-hub[data-visual-style="harvest"] {
    --color-bg: #081c15;
    --color-surface: #1b4332;
    --color-text: #d8f3dc;
    --color-muted-text: #95d5b2;
    --color-border: #2d6a4f;
    --color-primary: #74c69d;
    --gradient-hero: linear-gradient(135deg, #081c15 0%, #1b4332 50%, #2d6a4f 100%);
  }

  :root:not([data-theme="light"]) body.theme-agriculture-hub[data-visual-style="field"] {
    --color-bg: #0a1a0c;
    --color-surface: #1a3320;
    --color-text: #e8f5e9;
    --color-muted-text: #a7c957;
    --color-border: #2d5016;
    --color-primary: #8bc34a;
    --gradient-hero: linear-gradient(135deg, #0a1a0c 0%, #386641 100%);
  }

  :root:not([data-theme="light"]) body.theme-agriculture-hub[data-visual-style="coop"] {
    --color-bg: #0a1929;
    --color-surface: #132f4c;
    --color-text: #e3f2fd;
    --color-muted-text: #90caf9;
    --color-border: #1e4976;
    --color-primary: #64b5f6;
    --gradient-hero: linear-gradient(135deg, #0a1929 0%, #1d4e89 100%);
  }

  :root:not([data-theme="light"]) body.theme-agriculture-hub[data-visual-style="eco"] {
    --color-bg: #0a1a0c;
    --color-surface: #1b3a1b;
    --color-text: #e8f5e9;
    --color-muted-text: #81c784;
    --color-border: #2e7d32;
    --color-primary: #66bb6a;
    --gradient-hero: linear-gradient(135deg, #0a1a0c 0%, #1b5e20 100%);
  }

  :root:not([data-theme="light"]) body.theme-agriculture-hub[data-visual-style="rice"] {
    --color-bg: #1a1410;
    --color-surface: #3e2723;
    --color-text: #efebe9;
    --color-muted-text: #bcaaa4;
    --color-border: #5d4037;
    --color-primary: #a1887f;
    --gradient-hero: linear-gradient(135deg, #1a1410 0%, #6d4c41 100%);
  }

  :root:not([data-theme="light"]) body.theme-agriculture-hub[data-visual-style="gov"] {
    --color-bg: #1a0a0a;
    --color-surface: #3e1010;
    --color-text: #ffebee;
    --color-muted-text: #ef9a9a;
    --color-border: #7f1d1d;
    --color-primary: #ef5350;
    --gradient-hero: linear-gradient(135deg, #1a0a0a 0%, #b71c1c 55%, #7f1d1d 100%);
  }
}
