/* ============================================
   木小匠实木大板工厂 — 手机优先响应式样式
   Mobile-First Design
   ============================================ */

/* ===== RESET & BASE ===== */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
  --primary: #5c3d1e;
  --primary-light: #7a5830;
  --accent: #c8922a;
  --accent-light: #e0aa3e;
  --bg: #faf6f1;
  --white: #ffffff;
  --text: #2c2015;
  --text-light: #6b5a47;
  --border: #e0d0c0;
  --shadow: rgba(92, 61, 30, 0.1);
  --bottom-bar-height: 64px;
}
html { scroll-behavior: smooth; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
  font-size: 15px;
  padding-bottom: calc(var(--bottom-bar-height) + 12px); /* 给底部栏留空间 */
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--accent); }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* ===== LAYOUT ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* ===== HEADER ===== */
header {
  background: var(--white);
  border-bottom: 2px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  position: relative;
  flex-wrap: wrap;
}
.logo { font-size: 20px; font-weight: 700; color: var(--primary); letter-spacing: 1px; white-space: nowrap; }
.logo span { color: var(--accent); }
.logo a { color: var(--primary); }

/* Desktop nav hidden on mobile */
nav {
  display: none;
  width: 100%;
  order: 10;
}
nav.show { display: block; }

/* Mobile menu button */
.mobile-menu {
  display: block;
  font-size: 24px;
  cursor: pointer;
  color: var(--primary);
  padding: 4px 8px;
  line-height: 1;
  -webkit-user-select: none;
  user-select: none;
}
/* Mobile nav drawer */
nav ul {
  flex-direction: column;
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 8px 0 12px;
  gap: 0;
  box-shadow: 0 4px 12px var(--shadow);
}
nav ul li a {
  display: block;
  padding: 10px 20px;
  font-size: 15px;
  color: var(--primary);
  text-align: center;
  border-radius: 20px;
  margin: 6px 12px;
  background: rgba(139,90,43,0.08);
  border: 1px solid rgba(139,90,43,0.15);
  transition: all 0.2s ease;
}
nav ul li:last-child a { margin-bottom: 0; }
nav ul li a.active,
nav ul li a:hover {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

/* Header CTA hidden on mobile */
.header-contact { display: none; }

/* ===== PAGE HERO ===== */
.page-hero {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  padding: 40px 0 32px;
  text-align: center;
}
.page-hero h1 { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.page-hero p { font-size: 14px; opacity: 0.85; }

/* ===== BANNER (HOME) ===== */
.banner {
  background: linear-gradient(135deg, var(--primary), #3d2410);
  color: #fff;
  padding: 40px 0 48px;
  text-align: center;
}
.banner h1 { font-size: 24px; font-weight: 700; margin-bottom: 12px; line-height: 1.5; }
.banner h1 span { color: var(--accent-light); }
.banner p { font-size: 14px; opacity: 0.85; margin-bottom: 24px; line-height: 1.8; }
.banner-btns { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.btn-primary, .btn-secondary {
  display: inline-block;
  padding: 13px 32px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-align: center;
  transition: all 0.2s;
  min-width: 180px;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-light); color: #fff; }
.btn-secondary { background: rgba(255,255,255,0.15); color: #fff; border: 1px solid rgba(255,255,255,0.4); }
.btn-secondary:hover { background: rgba(255,255,255,0.25); color: #fff; }

/* ===== SECTION ===== */
.section { padding: 36px 0; }
.section-title {
  text-align: center;
  font-size: 20px;
  color: var(--primary);
  margin-bottom: 6px;
  font-weight: 700;
}
.section-sub {
  text-align: center;
  color: var(--text-light);
  font-size: 13px;
  margin-bottom: 28px;
}
.breadcrumb {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 20px;
  padding-top: 12px;
}
.breadcrumb a { color: var(--primary); }

/* ===== FEATURES ===== */
.features-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 32px; }
.feature-card {
  background: var(--white);
  border-radius: 8px;
  padding: 16px 12px;
  text-align: center;
  box-shadow: 0 2px 8px var(--shadow);
}
.feature-icon { font-size: 28px; margin-bottom: 8px; }
.feature-card h3 { font-size: 14px; font-weight: 600; color: var(--primary); margin-bottom: 4px; }
.feature-card p { font-size: 12px; color: var(--text-light); line-height: 1.6; }

/* ===== PRODUCTS GRID (MOBILE: 2 COLS) ===== */
.product-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.product-card {
  background: var(--white);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}
.product-card:hover { transform: translateY(-3px); box-shadow: 0 6px 16px var(--shadow); }
.product-card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  background: var(--border);
}
.product-card .info { padding: 10px 12px; }
.product-card h3 { font-size: 14px; font-weight: 600; color: var(--primary); margin-bottom: 4px; }
.product-card p { font-size: 12px; color: var(--text-light); line-height: 1.6; margin-bottom: 8px; }
.product-card .price { font-size: 14px; color: var(--accent); font-weight: 700; }
.product-card .more {
  display: inline-block;
  font-size: 12px;
  color: var(--accent);
  margin-top: 6px;
  padding: 4px 12px;
  border: 1px solid var(--accent);
  border-radius: 4px;
}
.product-card .more:hover { background: var(--accent); color: #fff; }

/* ===== PRODUCT DETAIL ===== */
.product-detail-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
.product-detail-grid img { width: 100%; border-radius: 8px; background: var(--border); }
.product-detail-info { }
.product-detail-info h1 { font-size: 20px; font-weight: 700; color: var(--primary); margin-bottom: 8px; }
.price-tag { font-size: 20px; color: var(--accent); font-weight: 700; margin-bottom: 12px; display: block; }
.price-note { font-size: 12px; color: var(--text-light); }
.product-detail-info .desc { font-size: 14px; color: var(--text); line-height: 2; margin-bottom: 16px; }
.spec-table { width: 100%; border-collapse: collapse; margin-bottom: 20px; font-size: 13px; }
.spec-table tr { border-bottom: 1px solid var(--border); }
.spec-table td { padding: 8px 0; }
.spec-table td:first-child { color: var(--text-light); width: 90px; }
.spec-table td:last-child { color: var(--text); font-weight: 500; }

/* ===== ARTICLE LIST (MOBILE) ===== */
.article-list { display: flex; flex-direction: column; gap: 12px; }
.article-card {
  background: var(--white);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 2px 8px var(--shadow);
}
.article-card h3 { font-size: 15px; font-weight: 600; color: var(--primary); margin-bottom: 6px; line-height: 1.5; }
.article-card p { font-size: 13px; color: var(--text-light); line-height: 1.7; margin-bottom: 10px; }
.article-card .meta { font-size: 12px; color: var(--text-light); margin-bottom: 10px; }
.article-card .more { color: var(--accent); font-size: 13px; font-weight: 500; }
.article-card .more:hover { text-decoration: underline; }

/* ===== ABOUT ===== */
.about-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
.about-grid img { width: 100%; border-radius: 8px; background: var(--border); }
.about-text h2 { font-size: 18px; color: var(--primary); font-weight: 700; margin-bottom: 12px; }
.about-text p { font-size: 14px; color: var(--text); line-height: 2; margin-bottom: 12px; }
.about-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.about-tag {
  padding: 4px 12px;
  background: var(--primary);
  color: #fff;
  border-radius: 20px;
  font-size: 12px;
}

/* ===== CONTACT FORM ===== */
.contact-form {
  background: var(--white);
  border-radius: 8px;
  padding: 20px 16px;
  box-shadow: 0 2px 12px var(--shadow);
}
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; color: var(--text-light); margin-bottom: 4px; }
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  transition: border-color 0.2s;
}
.form-group input:focus,
.form-group textarea:focus { outline: none; border-color: var(--accent); }
.form-group textarea { height: 100px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr; gap: 12px; }

/* ===== FOOTER ===== */
footer {
  background: linear-gradient(135deg, var(--primary), #3d2410);
  color: rgba(255,255,255,0.85);
  padding: 28px 0 20px;
  margin-top: 32px;
}
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 20px; padding: 0 16px; }
.footer-brand h3 { font-size: 16px; color: #fff; margin-bottom: 8px; font-weight: 700; }
.footer-brand p { font-size: 13px; line-height: 1.8; opacity: 0.8; }
.footer-col h4 { font-size: 14px; color: #fff; font-weight: 600; margin-bottom: 8px; }
.footer-col ul li { font-size: 13px; margin-bottom: 6px; opacity: 0.8; }
.footer-col ul li a { color: rgba(255,255,255,0.8); }
.footer-col ul li a:hover { color: var(--accent-light); }
.footer-bottom {
  text-align: center;
  padding-top: 16px;
  margin-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.15);
  font-size: 12px;
  opacity: 0.6;
}

/* ===== BOTTOM FIXED BAR (MOBILE ONLY) ===== */
.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--white);
  border-top: 2px solid var(--border);
  display: flex;
  align-items: center;
  padding: 8px 12px;
  gap: 8px;
  z-index: 200;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.1);
}
.bottom-bar-phone {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
}
.bottom-bar-phone .phone-icon {
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  flex-shrink: 0;
}
.bottom-bar-phone .phone-text { font-size: 12px; color: var(--text-light); line-height: 1.3; }
.bottom-bar-phone .phone-num { font-size: 16px; color: var(--primary); font-weight: 700; display: block; }
.bottom-bar-wechat {
  background: #07c160;
  color: #fff;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}
.bottom-bar-tips {
  font-size: 11px;
  color: var(--text-light);
  text-align: center;
  padding: 0 12px;
  line-height: 1.5;
}

/* Hide bottom bar on desktop */
.bottom-bar { display: flex; }

/* ============================================
   DESKTOP OVERRIDES (min-width: 769px)
   ============================================ */
@media (min-width: 769px) {

  body { font-size: 15px; padding-bottom: 0; }

  /* Header */
  .header-inner { padding: 14px 20px; flex-wrap: nowrap; }
  .logo { font-size: 22px; }
  nav {
    display: block;
    width: auto;
    order: 0;
  }
  nav ul {
    display: flex;
    flex-direction: row;
    position: static;
    background: transparent;
    border: none;
    padding: 0;
    gap: 8px;
    box-shadow: none;
  }
  nav ul li { margin-bottom: 0; }
  nav ul li a {
    display: inline-block;
    padding: 7px 18px;
    font-size: 14px;
    color: var(--primary);
    border-radius: 18px;
    background: rgba(139,90,43,0.08);
    border: 1px solid rgba(139,90,43,0.15);
    text-align: center;
    transition: all 0.2s ease;
  }
  nav ul li a:hover,
  nav ul li a.active {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
  }
  .mobile-menu { display: none; }
  .header-contact { display: none; }

  /* Bottom bar hidden on desktop */
  .bottom-bar { display: none !important; }

  /* Container */
  .container { padding: 0 20px; }

  /* Banner */
  .banner { padding: 80px 0 90px; }
  .banner h1 { font-size: 36px; }
  .banner p { font-size: 16px; }
  .banner-btns { flex-direction: row; justify-content: center; }

  /* Page hero */
  .page-hero { padding: 56px 0 48px; }
  .page-hero h1 { font-size: 26px; }
  .page-hero p { font-size: 15px; }

  /* Section */
  .section { padding: 56px 0; }
  .section-title { font-size: 24px; margin-bottom: 8px; }
  .section-sub { font-size: 14px; margin-bottom: 36px; }

  /* Features */
  .features-grid { grid-template-columns: repeat(4, 1fr); gap: 20px; }
  .feature-card { padding: 24px 16px; }
  .feature-icon { font-size: 36px; }
  .feature-card h3 { font-size: 16px; }
  .feature-card p { font-size: 13px; }

  /* Products grid: 3 cols on tablet, 4 on desktop */
  .product-grid { grid-template-columns: repeat(3, 1fr); gap: 20px; }
  .product-card img { height: 180px; }
  .product-card .info { padding: 14px 16px; }
  .product-card h3 { font-size: 16px; }
  .product-card p { font-size: 13px; }

  /* Product detail: side by side on desktop */
  .product-detail-grid { grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
  .product-detail-info h1 { font-size: 26px; }
  .price-tag { font-size: 24px; }
  .spec-table { font-size: 14px; }

  /* Articles */
  .article-list { gap: 16px; }
  .article-card { padding: 20px 24px; }
  .article-card h3 { font-size: 16px; }

  /* About */
  .about-grid { grid-template-columns: 1fr 1fr; align-items: center; gap: 40px; }
  .about-text h2 { font-size: 22px; }
  .about-text p { font-size: 15px; }

  /* Contact page: centered */
  .contact-wrapper { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }

  /* Form */
  .contact-form { padding: 32px; }
  .form-row { grid-template-columns: 1fr 1fr; }
  .form-group input,
  .form-group textarea { font-size: 15px; }

  /* Footer */
  footer { padding: 48px 0 28px; }
  .footer-grid { grid-template-columns: 2fr 1fr 1fr; gap: 40px; padding: 0 20px; }
  .footer-brand h3 { font-size: 18px; }
  .footer-brand p { font-size: 14px; }
  .footer-col h4 { font-size: 15px; }
  .footer-col ul li { font-size: 14px; }
  .footer-bottom { font-size: 13px; }
}

/* Large desktop */
@media (min-width: 1024px) {
  .product-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-center { text-align: center; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.banner h1, .banner p, .banner-btns { animation: fadeInUp 0.6s ease both; }
.banner p { animation-delay: 0.1s; }
.banner-btns { animation-delay: 0.2s; }
