/*
Theme Name: DEYE Battery
Theme URI: https://www.deye-battery.com
Author: DEYE Battery
Author URI: https://www.deye-battery.com
Description: 新能源储能 B2B 官网主题，按 rpt-power.com 的结构复刻。深蓝 + 青绿品牌配色，含首页 Hero、产品分类、热销产品、企业数据、关于我们、认证、新闻、询价 CTA 与四栏页脚。兼容 Spectra Pro 区块插件与 WooCommerce。
Requires at least: 6.2
Tested up to: 6.7
Requires PHP: 7.4
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: deye-battery
Tags: full-site-editing, block-theme, e-commerce, business
*/

/* ============================================================
   1. 设计令牌（Design tokens）
   ============================================================ */
:root {
  --deye-navy: #0A2540;
  --deye-navy-light: #1A3A5C;
  --deye-teal: #00C896;
  --deye-teal-dark: #00A87E;
  --deye-gray-50: #F5F7FA;
  --deye-gray-100: #EDF0F5;
  --deye-gray-300: #CBD5E0;
  --deye-gray-500: #718096;
  --deye-gray-700: #2D3748;
  --deye-footer: #06182E;
  --deye-white: #FFFFFF;
  --deye-shadow-sm: 0 1px 3px rgba(10, 37, 64, 0.08);
  --deye-shadow-md: 0 4px 12px rgba(10, 37, 64, 0.10);
  --deye-shadow-lg: 0 12px 32px rgba(10, 37, 64, 0.12);
  --deye-radius: 8px;
  --deye-radius-lg: 16px;
  --deye-container: 1200px;
}

/* ============================================================
   2. 基础排版
   ============================================================ */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--deye-gray-700);
  background: var(--deye-white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  margin: 0;
}

h1, h2, h3, h4 {
  color: var(--deye-navy);
  letter-spacing: -0.01em;
}

a { color: var(--deye-navy); }

img { max-width: 100%; height: auto; }

/* 区块自带的外边距清零，间距统一由本文件控制 */
.wp-block-image,
.wp-block-image figure,
.deye-section .wp-block-image figure { margin: 0; }

/* ============================================================
   3. 页头
   ============================================================ */
.deye-header-fixed {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--deye-white);
  box-shadow: var(--deye-shadow-sm);
}

.deye-header-wrap { padding: 0 24px; }

.deye-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: var(--deye-container);
  margin: 0 auto;
  min-height: 72px;
}

.deye-logo { flex: 0 0 auto; }
.deye-logo img {
  height: 40px;
  width: auto;
  display: block;
}

.deye-nav { flex: 1 1 auto; justify-content: flex-end; }
.deye-nav ul.wp-block-navigation__container { gap: 32px; justify-content: flex-end; }
.deye-nav .wp-block-navigation-item__content {
  font-size: 15px;
  font-weight: 500;
  color: var(--deye-navy);
  padding: 8px 0;
}
.deye-nav .wp-block-navigation-item__content:hover { color: var(--deye-teal); }

.deye-header-cta { flex: 0 0 auto; }

/* ============================================================
   4. 首屏 Hero
   ============================================================ */
.deye-hero {
  position: relative;
  background-image:
    linear-gradient(120deg, rgba(10, 37, 64, 0.95) 0%, rgba(10, 37, 64, 0.78) 46%, rgba(0, 200, 150, 0.30) 100%),
    url("assets/hero-bg.jpg");
  background-size: cover, cover;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
  padding: 0;
}

.deye-hero-inner {
  max-width: var(--deye-container);
  margin: 0 auto;
  padding: 132px 24px 118px;
}

.deye-tag {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(0, 200, 150, 0.15);
  color: var(--deye-teal);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 24px;
}

.deye-hero h1 {
  font-size: 52px;
  line-height: 1.12;
  font-weight: 800;
  color: var(--deye-white);
  max-width: 760px;
  margin: 0 0 20px;
}

.deye-hero p:not(.deye-tag) {
  font-size: 18px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.82);
  max-width: 580px;
  margin: 0 0 36px;
}

.deye-hero-actions .wp-block-buttons { gap: 16px; }

.deye-hero-actions { display: flex; flex-wrap: wrap; gap: 16px; }

/* ============================================================
   5. 通用分节
   ============================================================ */
.deye-section { padding: 84px 0; }
.deye-section-alt { background: var(--deye-gray-50); }

.deye-container {
  max-width: var(--deye-container);
  margin: 0 auto;
  padding: 0 24px;
}

.deye-section-head { text-align: center; margin: 0 0 52px; }

.deye-section-head h2 {
  font-size: 36px;
  line-height: 1.2;
  font-weight: 800;
  margin: 0 0 14px;
}

.deye-section-head p:not(.deye-tag) {
  font-size: 16px;
  color: var(--deye-gray-500);
  max-width: 640px;
  margin: 0 auto;
}

/* 网格 */
.deye-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 64px; align-items: center; }
.deye-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.deye-grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }

/* ============================================================
   6. 产品分类卡
   ============================================================ */
.deye-card {
  background: var(--deye-white);
  border: 1px solid var(--deye-gray-100);
  border-radius: var(--deye-radius-lg);
  padding: 32px 24px;
  text-align: center;
  box-shadow: var(--deye-shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.deye-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--deye-shadow-lg);
  border-color: var(--deye-teal);
}

.deye-cat-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 20px;
  border-radius: 12px;
  background: rgba(0, 200, 150, 0.10);
  display: flex;
  align-items: center;
  justify-content: center;
}
.deye-cat-icon img {
  width: 28px !important;
  height: 28px !important;
  margin: 0;
  display: block;
}

.deye-card h3 {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 8px;
}
.deye-card p {
  font-size: 14px;
  line-height: 1.55;
  color: var(--deye-gray-500);
  margin: 0;
}

/* ============================================================
   7. 产品卡（与 WooCommerce 商品卡视觉一致）
   ============================================================ */
.deye-product-card {
  background: var(--deye-white);
  border-radius: var(--deye-radius-lg);
  overflow: hidden;
  box-shadow: var(--deye-shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.deye-product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--deye-shadow-lg);
}

.deye-media { background: var(--deye-gray-50); overflow: hidden; }
.deye-media img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}
.deye-product-card:hover .deye-media img { transform: scale(1.05); }

.deye-product-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 0;
}

.deye-badge {
  display: inline-block;
  width: fit-content;
  padding: 3px 10px;
  border-radius: 4px;
  background: rgba(0, 200, 150, 0.10);
  color: var(--deye-teal);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.7;
  margin: 0 0 12px;
}

.deye-product-body h3 {
  font-size: 17px;
  line-height: 1.4;
  font-weight: 700;
  margin: 0 0 10px;
}

.deye-product-body > p:not(.deye-badge) {
  font-size: 14px;
  line-height: 1.6;
  color: var(--deye-gray-500);
  margin: 0 0 20px;
}

.deye-specs {
  display: flex;
  gap: 20px;
  padding: 14px 0;
  border-top: 1px solid var(--deye-gray-100);
  border-bottom: 1px solid var(--deye-gray-100);
  margin: 0 0 20px;
}
.deye-specs p {
  margin: 0;
  font-size: 13px;
  color: var(--deye-gray-700);
  line-height: 1.35;
}
.deye-specs strong {
  display: block;
  font-size: 15px;
  color: var(--deye-navy);
}

.deye-product-body .wp-block-button,
.deye-product-cta { margin: 0; width: 100%; }
.deye-product-body .wp-block-button__link {
  display: block;
  width: 100%;
  text-align: center;
  background: var(--deye-navy);
  color: var(--deye-white);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 16px;
}
.deye-product-body .wp-block-button__link:hover {
  background: var(--deye-teal);
  color: var(--deye-white);
}

/* ============================================================
   8. 统计数据条
   ============================================================ */
.deye-stats { background: var(--deye-navy); padding: 64px 0; }
.deye-stats .deye-grid-4 { text-align: center; }
.deye-stat-num {
  font-size: 42px;
  line-height: 1;
  font-weight: 800;
  color: var(--deye-teal);
  margin: 0 0 10px;
}
.deye-stat-label {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.72);
  margin: 0;
}

/* ============================================================
   9. 关于我们
   ============================================================ */
.deye-about-media { border-radius: var(--deye-radius-lg); overflow: hidden; box-shadow: var(--deye-shadow-lg); }
.deye-about-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.deye-about-body h2 {
  font-size: 36px;
  line-height: 1.2;
  font-weight: 800;
  margin: 0 0 20px;
}
.deye-about-body h2 .deye-accent,
.deye-accent { color: var(--deye-teal); }
.deye-about-body p {
  font-size: 16px;
  line-height: 1.8;
  color: var(--deye-gray-500);
  margin: 0 0 18px;
}

.deye-feature-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 20px;
  margin: 26px 0 28px;
}
.deye-feature {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.deye-feature img {
  width: 18px !important;
  height: 18px !important;
  margin-top: 4px;
  flex: 0 0 auto;
}
.deye-feature p {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--deye-gray-700);
  line-height: 1.5;
}

/* ============================================================
   10. 认证徽章
   ============================================================ */
.deye-certs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
  margin: 44px 0 0;
}
.deye-cert {
  width: 104px;
  height: 104px;
  border-radius: var(--deye-radius);
  background: var(--deye-white);
  border: 1px solid var(--deye-gray-100);
  box-shadow: var(--deye-shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: var(--deye-navy);
  letter-spacing: 0.02em;
  transition: transform 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.deye-cert:hover {
  transform: translateY(-2px);
  color: var(--deye-teal);
  border-color: var(--deye-teal);
}
.deye-cert p {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  color: inherit;
  letter-spacing: 0.02em;
}

/* ============================================================
   11. 新闻
   ============================================================ */
.deye-news-card {
  background: var(--deye-white);
  border-radius: var(--deye-radius-lg);
  padding: 26px 24px 24px;
  box-shadow: var(--deye-shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.deye-news-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--deye-shadow-lg);
}
.deye-news-date {
  font-size: 13px;
  font-weight: 600;
  color: var(--deye-teal);
  margin: 0 0 10px;
}
.deye-news-card h3 {
  font-size: 16px;
  line-height: 1.55;
  font-weight: 700;
  margin: 0 0 16px;
  flex: 1 1 auto;
}
.deye-news-more {
  font-size: 14px;
  font-weight: 600;
  color: var(--deye-teal);
  margin: 0;
}

/* ============================================================
   12. 询价 CTA
   ============================================================ */
.deye-cta {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--deye-navy) 0%, var(--deye-navy-light) 100%);
  padding: 86px 0;
  text-align: center;
}
.deye-cta::before {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  top: -210px;
  right: -110px;
  background: radial-gradient(circle, rgba(0, 200, 150, 0.18) 0%, rgba(0, 200, 150, 0) 70%);
  pointer-events: none;
}
.deye-cta h2 {
  position: relative;
  font-size: 36px;
  line-height: 1.2;
  font-weight: 800;
  color: var(--deye-white);
  margin: 0 0 16px;
}
.deye-cta p {
  position: relative;
  font-size: 17px;
  color: rgba(255, 255, 255, 0.75);
  max-width: 560px;
  margin: 0 auto 32px;
}

/* 按钮变体（通过区块「附加 CSS 类」选用） */
.wp-block-button.deye-btn-teal .wp-block-button__link {
  background: var(--deye-teal);
  color: var(--deye-white);
}
.wp-block-button.deye-btn-teal .wp-block-button__link:hover {
  background: var(--deye-teal-dark);
  color: var(--deye-white);
}
.wp-block-button.deye-btn-ghost .wp-block-button__link {
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.42);
  color: var(--deye-white);
}
.wp-block-button.deye-btn-ghost .wp-block-button__link:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: var(--deye-white);
  color: var(--deye-white);
}

/* ============================================================
   13. 页脚
   ============================================================ */
.deye-footer {
  background: var(--deye-footer);
  color: rgba(255, 255, 255, 0.62);
  padding: 64px 0 0;
}
.deye-footer-grid {
  display: grid;
  grid-template-columns: 1.9fr 1fr 1fr 1.4fr;
  gap: 48px;
  margin: 0 0 48px;
}
.deye-footer-about img {
  height: 36px;
  width: auto;
  margin: 0 0 16px;
  display: block;
}
.deye-footer-about p {
  font-size: 14px;
  line-height: 1.7;
  margin: 0;
  color: rgba(255, 255, 255, 0.55);
}

.deye-footer-col h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--deye-white);
  margin: 0 0 18px;
}
.deye-footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.deye-footer-col ul li { margin: 0 0 10px; }
.deye-footer-col ul li a,
.deye-footer-link {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.62);
  text-decoration: none;
  transition: color 0.2s ease;
}
.deye-footer-col ul li a:hover,
.deye-footer-link:hover { color: var(--deye-teal); }

.deye-contact p {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  margin: 0 0 12px;
  color: rgba(255, 255, 255, 0.62);
}

.deye-footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  padding: 20px 0;
  text-align: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.45);
  margin: 0;
}

/* ============================================================
   14. WooCommerce 适配
   ============================================================ */
.woocommerce ul.products {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
  margin: 0;
}
.woocommerce ul.products li.product {
  background: var(--deye-white);
  border-radius: var(--deye-radius-lg);
  overflow: hidden;
  box-shadow: var(--deye-shadow-sm);
  padding: 0 0 20px;
  margin: 0;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.woocommerce ul.products li.product:hover {
  transform: translateY(-4px);
  box-shadow: var(--deye-shadow-lg);
}
.woocommerce ul.products li.product a img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  margin: 0 0 0;
}
.woocommerce ul.products li.product .woocommerce-loop-product__title {
  font-size: 17px;
  line-height: 1.4;
  font-weight: 700;
  color: var(--deye-navy);
  padding: 18px 24px 8px;
  margin: 0;
}
.woocommerce ul.products li.product .price {
  padding: 0 24px 14px;
  font-size: 15px;
  font-weight: 700;
  color: var(--deye-navy);
  margin: 0;
}
.woocommerce ul.products li.product .button {
  margin: 0 24px;
  background: var(--deye-navy);
  color: var(--deye-white);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  padding: 12px 16px;
}
.woocommerce ul.products li.product .button:hover {
  background: var(--deye-teal);
  color: var(--deye-white);
}
.woocommerce .woocommerce-result-count,
.woocommerce .woocommerce-ordering { margin-bottom: 28px; }

/* ============================================================
   15. Spectra / Spectra Pro 兼容微调
   ============================================================ */
.uagb-block,
.wp-block-uagb-container,
.wp-block-uagb-info-box { box-sizing: border-box; }
.uagb-container-inner-blocks-wrap { max-width: 100%; }
.wp-block-uagb-advanced-heading h2,
.wp-block-uagb-advanced-heading h3 { color: var(--deye-navy); }

/* ============================================================
   15.1 内页与补充细节
   ============================================================ */
.deye-cta-actions { justify-content: center; }

.deye-footer-col p {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.62);
}
.deye-contact p { color: rgba(255, 255, 255, 0.62); }

.deye-page { padding: 76px 24px 88px; }
.deye-page-inner { max-width: 880px; margin: 0 auto; }
.deye-page-inner h1 { font-size: 34px; line-height: 1.25; margin: 0 0 24px; }

/* 商店页（商品列表 / 详情）使用更宽的容器 */
.deye-shop { max-width: var(--deye-container); margin: 0 auto; }
.deye-shop h1,
.deye-shop .woocommerce-products-header__title { font-size: 34px; line-height: 1.25; margin: 0 0 22px; }
.deye-shop .woocommerce-notices-wrapper { margin-bottom: 20px; }
.deye-page-inner h2 { font-size: 26px; margin: 32px 0 14px; }
.deye-page-inner p { margin: 0 0 18px; }
.deye-page-inner .deye-news-card { margin-bottom: 20px; }
.deye-page-inner .wp-block-search { margin: 24px 0; }

/* ============================================================
   16. 响应式
   ============================================================ */
@media (max-width: 1024px) {
  .deye-hero h1 { font-size: 42px; }
  .deye-section { padding: 68px 0; }
  .deye-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .deye-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .deye-grid-2 { gap: 40px; }
  .deye-footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; }
  .woocommerce ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
  .deye-header-inner { min-height: 64px; }
  .deye-logo img { height: 34px; }
  .deye-nav { justify-content: flex-end; }

  .deye-hero-inner { padding: 92px 24px 76px; }
  .deye-hero h1 { font-size: 32px; }
  .deye-hero p:not(.deye-tag) { font-size: 16px; margin-bottom: 28px; }

  .deye-section { padding: 56px 0; }
  .deye-container { padding: 0 18px; }
  .deye-section-head { margin-bottom: 36px; }
  .deye-section-head h2,
  .deye-about-body h2,
  .deye-cta h2 { font-size: 26px; }

  .deye-grid-4,
  .deye-grid-3,
  .deye-grid-2 { grid-template-columns: minmax(0, 1fr); gap: 20px; }

  .deye-stats { padding: 48px 0; }
  .deye-stat-num { font-size: 32px; }

  .deye-feature-list { grid-template-columns: minmax(0, 1fr); gap: 12px; }

  .deye-certs { gap: 14px; }
  .deye-cert { width: 88px; height: 88px; }

  .deye-cta { padding: 64px 0; }

  .deye-footer { padding: 48px 0 0; }
  .deye-footer-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }

  .woocommerce ul.products { grid-template-columns: minmax(0, 1fr); }
}
