/* 
 Theme Name:   AI编程子主题
 Theme URI:    https://dahaida.top
 Description:  zy子主题demo
 Author:       zycode
 Author URI:   https://dahaida.top
 Template:     woostify
 Version:      1.0
 License:      GNU General Public License v2 or later
 License URI:  http://www.gnu.org/licenses/gpl-2.0.html

 /* == Add your own styles below this line ==
--------------------------------------------*/

.ai-home-contact {
  background: linear-gradient(135deg, #f8fbff 0%, #eef5ff 100%);
  padding: 64px 20px;
  border-top: 1px solid #e6ecf5;
}

/* ==============================
   按需求隐藏网站头部与底部
================================= */
#masthead,
.site-header,
#colophon,
.site-footer,
.topbar,
.site-topbar,
.header-top,
.header-topbar,
.woostify-topbar,
.woostify-announcement-bar,
.announcement-bar,
.notice-bar,
.footer-widget,
.footer-widgets,
.footer-copyright,
.site-info,
#secondary-footer,
#colophon,
#woostify-footer,
.woostify-footer,
.scroll-to-top,
.back-to-top {
  display: none !important;
}

.ai-home-contact__inner {
  max-width: 980px;
  margin: 0 auto;
  background: #fff;
  border-radius: 16px;
  padding: 36px;
  box-shadow: 0 12px 40px rgba(29, 53, 87, 0.08);
}

.ai-home-contact__title {
  margin: 0;
  font-size: 32px;
  line-height: 1.2;
  color: #1d3557;
}

.ai-home-contact__desc {
  margin: 12px 0 28px;
  color: #5b6777;
  font-size: 16px;
}

.ai-home-contact__notice {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
}

.ai-home-contact__notice--success {
  background: #ecfdf3;
  border: 1px solid #9ce7b4;
  color: #196a35;
}

.ai-home-contact__notice--error {
  background: #fff1f1;
  border: 1px solid #ffc0c0;
  color: #a12626;
}

.ai-home-contact__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.ai-home-contact__field {
  margin-bottom: 18px;
}

.ai-home-contact__field label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #334155;
}

.ai-home-contact__field input,
.ai-home-contact__field textarea {
  width: 100%;
  border: 1px solid #d4deea;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 15px;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fff;
}

.ai-home-contact__field input:focus,
.ai-home-contact__field textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.ai-home-contact__form {
  display: flex;
  flex-direction: column;
}

.ai-home-contact__submit-wrap {
  width: 100%;
  display: flex;
  justify-content: flex-end !important;
}

.ai-home-contact__submit {
  border: none;
  border-radius: 10px;
  padding: 12px 24px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ai-home-contact__submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.28);
}

@media (max-width: 768px) {
  .ai-home-contact {
    padding: 48px 16px;
  }

  .ai-home-contact__inner {
    padding: 24px;
  }

  .ai-home-contact__title {
    font-size: 26px;
  }

  .ai-home-contact__grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

/* ==============================
   全站图片自适应优化（PC/手机）
================================= */
img {
  max-width: 100%;
  height: auto;
}

.wp-block-image img,
.elementor-widget-image img,
.attachment-post-thumbnail,
.woocommerce div.product div.images img,
.woocommerce ul.products li.product img {
  width: 100%;
  height: auto;
  display: block;
}

/* 轮播、横幅等需要裁切场景：防止拉伸变形 */
.hero img,
.banner img,
.slider img,
.swiper-slide img,
.slick-slide img,
.elementor-image-box-img img,
.elementor-widget-container img {
  object-fit: cover;
}

/* 内容区图片默认完整显示，避免被裁掉 */
.entry-content img,
.post-content img,
.elementor-text-editor img {
  object-fit: contain;
}

/* 小屏优化，减少图片突兀高度 */
@media (max-width: 768px) {
  .hero img,
  .banner img,
  .slider img,
  .swiper-slide img,
  .slick-slide img {
    max-height: 52vh;
  }
}

/* ==============================
   强制移动端版式修正（Woostify/Elementor）
================================= */
@media (max-width: 767px) {
  html,
  body {
    overflow-x: hidden;
  }

  .container,
  .site-content,
  .content-area,
  .elementor-section,
  .elementor-container,
  .elementor-column,
  .elementor-widget-wrap,
  .woocommerce,
  .woocommerce-page {
    max-width: 100% !important;
  }

  .elementor-section,
  .elementor-container,
  .elementor-column,
  .elementor-widget-wrap {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .elementor-top-section .elementor-column,
  .woocommerce ul.products li.product,
  .wp-block-columns {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
  }

  .wp-block-columns {
    display: block !important;
  }

  img,
  video,
  iframe,
  .wp-block-image img,
  .elementor-widget-image img,
  .elementor-image img,
  .attachment-post-thumbnail,
  .woocommerce div.product div.images img,
  .woocommerce ul.products li.product img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    object-fit: cover;
  }

  .entry-content img,
  .post-content img,
  .elementor-text-editor img {
    object-fit: contain !important;
  }

  table,
  pre {
    display: block;
    width: 100%;
    overflow-x: auto;
  }

  .ai-home-contact {
    padding: 36px 12px;
  }

  .ai-home-contact__inner {
    padding: 18px;
    border-radius: 12px;
  }

  .ai-home-contact__title {
    font-size: 22px;
  }

  .ai-home-contact__field input,
  .ai-home-contact__field textarea,
  .ai-home-contact__submit {
    font-size: 16px;
  }

  .ai-home-contact__submit-wrap {
    justify-content: flex-end !important;
  }
}

/* 全局兜底，避免主题按钮规则覆盖 */
.ai-home-contact .ai-home-contact__submit-wrap {
  display: flex !important;
  justify-content: flex-end !important;
}

.ai-home-contact .ai-home-contact__submit {
  display: inline-block !important;
  margin-left: auto !important;
  margin-right: 0 !important;
  float: none !important;
}