/* ============================================================
 *  layout.css — 各板块布局 + 栅格 + 响应式
 * ============================================================ */

/* ---------- Banner 轮播 ---------- */
.banner { position: relative; height: 520px; overflow: hidden; }
.banner-slide {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  background-color: #2b2f38;   /* 无图时的兜底底色 */
  background-image: linear-gradient(135deg, var(--theme), var(--theme-dark)); /* 图片加载前/失败的兜底 */
  display: flex; align-items: center;
  opacity: 0; transition: opacity .8s;
}
.banner-slide.active { opacity: 1; }
.banner-slide::before { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.35); }
.banner-text { position: relative; color: var(--white); max-width: 600px; }
.banner-text h2 { font-size: 42px; margin-bottom: 16px; line-height: 1.3; }
.banner-text p { font-size: 18px; margin-bottom: 28px; opacity: .95; }
.banner-dots { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; z-index: 2; }
.banner-dots span { width: 12px; height: 12px; border-radius: 50%; background: rgba(255,255,255,.5); cursor: pointer; transition: .2s; }
.banner-dots span.active { background: var(--white); width: 28px; border-radius: 6px; }
.banner-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; background: rgba(0,0,0,.3); color: #fff; border: none; width: 46px; height: 46px; border-radius: 50%; font-size: 22px; cursor: pointer; transition: .2s; }
.banner-arrow:hover { background: rgba(0,0,0,.6); }
.banner-arrow.prev { left: 20px; }
.banner-arrow.next { right: 20px; }

/* ---------- 通用栅格 ---------- */
.grid { display: grid; gap: 26px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

/* ---------- 优势 features ---------- */
.feature-item { text-align: center; padding: 34px 20px; }
.feature-item .icon { font-size: 44px; margin-bottom: 16px; }
.feature-item h3 { font-size: 18px; margin-bottom: 10px; }
.feature-item p { color: var(--text-light); font-size: 14px; }

/* ---------- 产品卡片 ---------- */
.product-card .thumb { height: 220px; overflow: hidden; }
.product-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.product-card:hover .thumb img { transform: scale(1.06); }
.product-card .info { padding: 20px; }
.product-card .cat { font-size: 12px; color: var(--theme); background: rgba(200,16,46,.08); padding: 3px 10px; border-radius: 20px; display: inline-block; margin-bottom: 10px; }
.product-card h3 { font-size: 17px; margin-bottom: 8px; }
.product-card p { color: var(--text-light); font-size: 14px; }

/* ---------- 关于我们 ---------- */
.about-flex { display: flex; gap: 50px; align-items: center; }
.about-flex .about-img { flex: 0 0 45%; }
.about-flex .about-img img { border-radius: var(--radius); box-shadow: var(--shadow); }
.about-text h3 { font-size: 24px; margin-bottom: 18px; }
.about-text p { color: var(--text-light); margin-bottom: 16px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 30px; }
.stats .stat { text-align: center; }
.stats .num { font-size: 34px; font-weight: 700; color: var(--theme); }
.stats .label { font-size: 14px; color: var(--text-light); }

/* ---------- 新闻卡片 ---------- */
.news-card .thumb { height: 200px; overflow: hidden; }
.news-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.news-card:hover .thumb img { transform: scale(1.06); }
.news-card .info { padding: 20px; }
.news-card .date { font-size: 13px; color: var(--text-lighter); margin-bottom: 8px; }
.news-card h3 { font-size: 17px; margin-bottom: 10px; line-height: 1.4; }
.news-card p { color: var(--text-light); font-size: 14px; }

/* ---------- 产品详情页 ---------- */
.detail-top { display: flex; gap: 50px; margin-bottom: 50px; }
.detail-gallery { flex: 0 0 45%; }
.detail-gallery .main-img { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); margin-bottom: 14px; }
.detail-gallery .main-img img { width: 100%; height: 380px; object-fit: cover; }
.detail-thumbs { display: flex; gap: 10px; }
.detail-thumbs img { width: 80px; height: 80px; object-fit: cover; border-radius: 6px; border: 2px solid transparent; cursor: pointer; }
.detail-thumbs img.active { border-color: var(--theme); }
.detail-info h1 { font-size: 28px; margin-bottom: 14px; }
.detail-info .cat { color: var(--theme); font-size: 14px; margin-bottom: 20px; }
.param-table { width: 100%; border-collapse: collapse; margin: 20px 0; }
.param-table th, .param-table td { border: 1px solid var(--border); padding: 12px 16px; text-align: left; font-size: 14px; }
.param-table th { background: var(--bg-gray); width: 30%; color: var(--text); font-weight: 600; }
.detail-desc h3 { font-size: 20px; margin-bottom: 16px; padding-left: 12px; border-left: 4px solid var(--theme); }
.detail-desc p { color: var(--text-light); line-height: 1.9; }

/* ---------- 联系我们 ---------- */
.contact-flex { display: flex; gap: 50px; }
.contact-info { flex: 1; }
.contact-info .item { display: flex; gap: 16px; margin-bottom: 26px; }
.contact-info .item .ic { font-size: 24px; color: var(--theme); }
.contact-info .item h4 { font-size: 16px; margin-bottom: 4px; }
.contact-info .item p { color: var(--text-light); }
.contact-map { flex: 1; background: var(--bg-gray); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; min-height: 320px; color: var(--text-lighter); }

/* ---------- 登录 / 注册 ---------- */
.auth-wrap { min-height: calc(100vh - var(--header-h)); display: flex; align-items: center; justify-content: center; background: var(--bg-gray); padding: 40px 20px; }
.auth-box { background: var(--white); width: 100%; max-width: 420px; border-radius: 12px; box-shadow: var(--shadow); padding: 40px; }
.auth-tabs { display: flex; margin-bottom: 30px; border-bottom: 1px solid var(--border); }
.auth-tabs button { flex: 1; padding: 12px; background: none; border: none; font-size: 16px; cursor: pointer; color: var(--text-light); border-bottom: 2px solid transparent; }
.auth-tabs button.active { color: var(--theme); border-bottom-color: var(--theme); font-weight: 600; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 14px; margin-bottom: 6px; color: var(--text-light); }
.form-group input { width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 6px; font-size: 15px; transition: border .2s; }
.form-group input:focus { outline: none; border-color: var(--theme); }
.form-tip { font-size: 13px; margin-top: 6px; min-height: 18px; }
.form-tip.error { color: var(--theme); }
.form-tip.success { color: #2e9e4f; }
.auth-note { text-align: center; font-size: 12px; color: var(--text-lighter); margin-top: 18px; line-height: 1.5; }

/* ---------- 文章详情通用 ---------- */
.article { max-width: 800px; margin: 0 auto; }
.article h1 { font-size: 28px; margin-bottom: 14px; text-align: center; }
.article .meta { text-align: center; color: var(--text-lighter); font-size: 14px; margin-bottom: 30px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.article img { border-radius: var(--radius); margin: 0 auto 24px; }
.article p { color: var(--text-light); line-height: 1.9; margin-bottom: 16px; }

/* ============================================================
 *  响应式 —— 移动端适配
 * ============================================================ */
@media (max-width: 992px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .about-flex, .detail-top, .contact-flex { flex-direction: column; }
  .about-flex .about-img, .detail-gallery { flex: none; width: 100%; }
  .banner-text h2 { font-size: 32px; }
}

@media (max-width: 768px) {
  :root { --header-h: 60px; }
  /* 导航折叠 */
  .menu-toggle { display: flex; }
  .nav-list {
    position: fixed; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--white);
    box-shadow: 0 8px 20px rgba(0,0,0,.1);
    max-height: 0; overflow: hidden; transition: max-height .3s;
  }
  .nav-list.open { max-height: 400px; }
  .nav-list a { padding: 14px 20px; border-radius: 0; border-bottom: 1px solid var(--border); }
  .header-right .user-box { display: none; }

  .banner { height: 380px; }
  .banner-text h2 { font-size: 26px; }
  .banner-text p { font-size: 15px; }
  .banner-arrow { display: none; }

  .section { padding: 45px 0; }
  .section-title h2 { font-size: 24px; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 24px; }
  .detail-gallery .main-img img { height: 260px; }
  .page-hero { height: 180px; }
  .page-hero h1 { font-size: 26px; }
  .footer-cols { flex-direction: column; gap: 28px; }
}

@media (max-width: 480px) {
  .grid-4 { grid-template-columns: 1fr; }
  .auth-box { padding: 28px 22px; }
}
