/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #1a5496;
  --primary-light: #2a6ab8;
  --accent: #78b520;
  --accent-light: #8ecc2a;
  --text: #1e1e1e;
  --text-muted: #666;
  --bg: #f8f7f4;
  --white: #ffffff;
  --border: #e0ddd8;
  --card-bg: #ffffff;
  --shadow: 0 2px 16px rgba(0,0,0,0.08);
  --radius: 8px;
}

html { scroll-behavior: smooth; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  font-size: 15px;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

.container {
  width: 75%;
  margin: 0 auto;
  padding: 0;
}

/* ===== Navbar ===== */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  box-shadow: 0 1px 8px rgba(0,0,0,0.07);
  transition: background 0.3s;
}

.nav-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo { display: flex; align-items: center; }
.nav-logo-img { height: 52px; width: auto; display: block; }

.nav-links {
  list-style: none;
  display: flex;
  gap: 8px;
  align-items: center;
}
.nav-links a {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 14px;
  color: var(--text);
  transition: color 0.2s;
  position: relative;
}
.nav-links a:not(.nav-cta)::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 14px;
  right: 14px;
  height: 2px;
  background: var(--primary);
  transform: scaleX(0);
  transition: transform 0.2s;
}
.nav-links a:not(.nav-cta):hover::after { transform: scaleX(1); }
.nav-links a:not(.nav-cta):hover { color: var(--primary); }
.nav-links a.nav-cta {
  background: var(--accent);
  color: var(--white);
  font-weight: 600;
}
.nav-links a.nav-cta:hover { background: var(--accent-light); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--primary);
}

/* ===== Buttons ===== */
.btn-primary {
  display: inline-block;
  background: var(--accent);
  color: var(--white);
  padding: 12px 28px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 15px;
  transition: background 0.2s, transform 0.15s;
  border: none;
  cursor: pointer;
}
.btn-primary:hover { background: var(--accent-light); transform: translateY(-1px); }

.btn-secondary {
  display: inline-block;
  background: transparent;
  color: var(--white);
  padding: 12px 28px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 15px;
  border: 2px solid rgba(255,255,255,0.6);
  transition: background 0.2s;
}
.btn-secondary:hover { background: rgba(255,255,255,0.15); }

.btn-sm { padding: 8px 18px; font-size: 13px; }

/* ===== Hero ===== */
.hero {
  min-height: 100vh;
  background: url('../assets/bg.png') center center / cover no-repeat;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  text-align: left;
  padding: 100px 80px 60px;
  color: var(--white);
}

.hero-content { max-width: 600px; }
.hero h1 {
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 20px;
}
.hero-sub {
  font-size: 22px;
  color: var(--accent-light);
  margin-bottom: 14px;
  font-weight: 500;
}
.hero-desc {
  font-size: 17px;
  color: rgba(255,255,255,0.8);
  margin-bottom: 32px;
  line-height: 1.8;
}
.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.hero-stats {
  display: flex;
  gap: 40px;
  margin-top: 60px;
  padding-top: 40px;
  border-top: 1px solid rgba(255,255,255,0.2);
  flex-wrap: wrap;
  justify-content: center;
}
.stat { text-align: center; }
.stat-num {
  display: block;
  font-size: 32px;
  font-weight: 700;
  color: var(--accent-light);
  line-height: 1;
}
.stat-label {
  font-size: 12px;
  color: rgba(255,255,255,0.7);
  margin-top: 4px;
  display: block;
}

/* ===== Section Titles ===== */
.section-title {
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 700;
  color: var(--primary);
  text-align: center;
  margin-bottom: 48px;
  padding-bottom: 16px;
  position: relative;
}
.section-title::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 48px; height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

/* ===== About ===== */
.about {
  padding: 80px 0;
  background: var(--white);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.about-text p {
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.9;
}
.about-text strong { color: var(--text); }

.about-clients {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.client-label { font-size: 13px; color: var(--text-muted); }
.about-clients span:not(.client-label) {
  font-size: 13px;
  color: var(--text-muted);
}

.about-certs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.cert-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.cert-icon {
  width: 36px; height: 36px;
  background: var(--primary);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.cert-card strong { font-size: 14px; color: var(--primary); display: block; }
.cert-card p { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ===== Carousel ===== */
.carousel {
  position: relative;
  overflow: hidden;
  margin-top: 48px;
  border-radius: 12px;
  background: #000;
  width:75%;
  margin-left: auto;
  margin-right: auto;
}

.carousel-track {
  display: flex;
  transition: transform 0.5s ease;
}

.carousel-track img {
  width: 100%;
  height: 550px;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.85);
  border: none;
  border-radius: 50%;
  width: 44px; height: 44px;
  font-size: 26px;
  cursor: pointer;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, opacity 0.2s;
  opacity: 0;
  z-index: 10;
}
.carousel:hover .carousel-btn { opacity: 1; }
.carousel-prev { left: 14px; }
.carousel-next { right: 14px; }
.carousel-btn:hover { background: var(--white); }

.carousel-dots {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}
.carousel-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s, transform 0.2s;
}
.carousel-dot.active {
  background: var(--white);
  transform: scale(1.3);
}

/* ===== Products ===== */
.products {
  padding: 80px 0;
  background: var(--bg);
}

.product-block {
  background: var(--white);
  border-radius: 12px;
  padding: 36px;
  margin-bottom: 32px;
  box-shadow: var(--shadow);
}

.block-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 24px;
  padding-left: 14px;
  border-left: 4px solid var(--accent);
}

.block-note {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* Knowledge cards */
.knowledge-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.knowledge-card {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}
.k-icon { font-size: 28px; margin-bottom: 8px; }
.knowledge-card h4 { font-size: 14px; font-weight: 700; margin-bottom: 6px; color: var(--primary); }
.knowledge-card p { font-size: 12px; color: var(--text-muted); line-height: 1.6; }
.knowledge-usage { font-size: 14px; color: var(--text-muted); line-height: 1.8; }

.knowledge-intro-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}
.knowledge-text p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.9;
  margin-bottom: 14px;
}
.knowledge-text p:last-child { margin-bottom: 0; }
.knowledge-image-placeholder {
  background: var(--bg);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  min-height: 220px;
  max-width: 300px;
  max-height: 280px;
  overflow: hidden;
  justify-self: center;
}

/* Boxsize image */
.boxsize-img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
}

/* Boxtype image */
.boxtype-img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
}

/* Flute grid */
.flute-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.flute-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
}
.flute-badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 12px;
  margin-bottom: 8px;
  font-weight: 600;
}
.flute-badge.three { background: #e8f0fe; color: #1a3a8c; }
.flute-badge.five { background: #fef3e8; color: #a05a00; }
.flute-card h4 { font-size: 18px; font-weight: 700; color: var(--primary); margin-bottom: 2px; }
.flute-thickness { font-size: 12px; color: var(--accent); font-weight: 600; margin-bottom: 4px; }
.flute-card p:last-child { font-size: 13px; color: var(--text-muted); }

/* Box type grid */
.box-type-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}
.box-type-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 8px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  transition: background 0.2s, border-color 0.2s;
}
.box-type-card:hover { background: var(--primary); color: var(--white); border-color: var(--primary); }

/* Dimension block */
.dimension-block {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 32px;
  align-items: center;
}
.box-3d {
  position: relative;
  width: 180px;
  height: 140px;
  margin: 0 auto;
}
.box-visual {
  width: 120px;
  height: 80px;
  background: linear-gradient(135deg, #d4a76a 0%, #b8894e 100%);
  position: absolute;
  bottom: 10px;
  left: 30px;
  border-radius: 4px;
  box-shadow: -12px -12px 0 #c49050, -12px 0 0 #b07840;
}
.box-label {
  position: absolute;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
}
.box-length { bottom: -4px; left: 70px; }
.box-width { bottom: 30px; left: 0; }
.box-height { bottom: 50px; right: 10px; }

.formula-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 16px 0;
}
.formula-title { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.formula { font-size: 16px; font-weight: 700; color: var(--primary); }
.mark-info { display: flex; gap: 24px; font-size: 14px; color: var(--text-muted); }
.mark-info strong { color: var(--text); }
.dimension-info p { font-size: 14px; color: var(--text-muted); margin-bottom: 8px; }
.dimension-info strong { color: var(--text); }

/* Spec table */
.table-wrapper { overflow-x: auto; }
.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.spec-table th {
  background: var(--primary);
  color: var(--white);
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
}
.spec-table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}
.spec-table tr:nth-child(even) td { background: var(--bg); }
.spec-table tr:hover td { background: #f0f4f8; }

/* ===== Footer / Contact ===== */
footer#contact {
  background: var(--primary);
  color: rgba(255,255,255,0.85);
  padding: 60px 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  padding-bottom: 40px;
}

footer h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 16px;
}
footer p {
  font-size: 14px;
  line-height: 2;
  color: rgba(255,255,255,0.7);
}

.wechat-qr-placeholder {
  width: 100px; height: 100px;
  background: var(--white);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}
.wechat-qr-placeholder p { color: var(--text-muted); font-size: 11px; line-height: 1.4; }
.wechat-id { font-weight: 700; color: var(--primary) !important; font-size: 13px !important; }
.wechat-hint { font-size: 12px; color: rgba(255,255,255,0.5); }

.map-link {
  display: block;
  transition: opacity 0.2s;
}
.map-link:hover { opacity: 0.8; }
.map-link p { color: rgba(255,255,255,0.7); line-height: 2; font-size: 14px; }
.map-hint {
  color: var(--accent-light) !important;
  font-size: 13px !important;
  margin-top: 4px;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 16px 0;
  text-align: center;
  font-size: 12px;
  color: rgba(255,255,255,0.4);
}

/* ===== Quote Page ===== */
.quote-page {
  padding-top: 64px;
  min-height: 100vh;
  background: var(--bg);
}

.quote-hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  padding: 48px 24px;
  text-align: center;
  color: var(--white);
}
.quote-hero h1 { font-size: clamp(22px, 4vw, 36px); margin-bottom: 8px; }
.quote-hero p { font-size: 15px; color: rgba(255,255,255,0.75); }

.quote-body {
  max-width: 1100px;
  margin: 40px auto;
  padding: 0 24px 60px;
}

.quote-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 28px;
  align-items: start;
}

.quote-form-card {
  background: var(--white);
  border-radius: 12px;
  padding: 36px;
  box-shadow: var(--shadow);
}

.form-section {
  margin-bottom: 28px;
}
.form-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.form-group select,
.form-group input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.2s;
}
.form-group select:focus,
.form-group input:focus {
  outline: none;
  border-color: var(--primary);
}

.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.checkbox-item {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 13px;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 20px;
  transition: background 0.2s, border-color 0.2s;
  user-select: none;
}
.checkbox-item input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--primary);
  cursor: pointer;
}
.checkbox-item:has(input:checked) {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

.contact-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.submit-btn {
  width: 100%;
  padding: 14px;
  background: var(--accent);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
}
.submit-btn:hover { background: var(--accent-light); }
.submit-btn:disabled { background: #ccc; cursor: not-allowed; }

.field-error { border-color: #e53935 !important; }
.error-tip {
  display: block;
  color: #e53935;
  font-size: 12px;
  margin-top: 4px;
}

/* Price card */
.price-card {
  background: var(--white);
  border-radius: 12px;
  padding: 28px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 84px;
}
.price-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.price-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 10px;
  color: var(--text-muted);
}
.price-row span:last-child { color: var(--text); font-weight: 500; }
.price-total {
  border-top: 2px solid var(--border);
  margin-top: 16px;
  padding-top: 16px;
}
.price-total .price-row {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.price-total .price-row span:last-child { color: var(--accent); font-size: 18px; }
.price-note {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 12px;
  line-height: 1.6;
}
.price-placeholder {
  text-align: center;
  padding: 24px 0;
  color: var(--text-muted);
  font-size: 13px;
}

.spec-summary {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  font-size: 13px;
}
.spec-summary-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}
.spec-summary-row:last-child { border-bottom: none; }
.spec-summary-row span:last-child { font-weight: 500; color: var(--text); }

/* Success message */
.success-msg {
  display: none;
  background: #e8f5e9;
  border: 1px solid #a5d6a7;
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  margin-top: 16px;
}
.success-msg.show { display: block; }
.success-msg h3 { color: #2e7d32; margin-bottom: 6px; }
.success-msg p { font-size: 13px; color: #388e3c; }

.fallback-msg { background: #fff8e1; border-color: #ffe082; text-align: left; }
.fallback-msg h3 { color: #e65100; }
.fallback-msg p { color: #bf360c; }
.fallback-msg textarea {
  width: 100%;
  height: 180px;
  margin-top: 12px;
  padding: 10px;
  font-size: 12px;
  font-family: monospace;
  border: 1px solid #ffe082;
  border-radius: 6px;
  resize: vertical;
  background: #fffde7;
}
.btn-copy {
  margin-top: 10px;
  padding: 8px 20px;
  background: #e65100;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}
.btn-copy:hover { background: #bf360c; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; }
  .knowledge-grid { grid-template-columns: repeat(2, 1fr); }
  .flute-grid { grid-template-columns: repeat(2, 1fr); }
  .box-type-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .quote-layout { grid-template-columns: 1fr; }
  .price-card { position: static; }
  .dimension-block { grid-template-columns: 1fr; }
  .knowledge-intro-layout { grid-template-columns: 1fr; }
  .carousel { width: 100%; }
}

@media (max-width: 600px) {
  /* 容器全宽 */
  .container { width: 92%; }

  /* 导航：汉堡菜单 */
  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 64px; left: 0; right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; padding: 12px 24px; border-radius: 0; font-size: 15px; }
  .nav-toggle { display: block; }

  /* Hero：手机换回纯蓝色，文字居中 */
  .hero {
    background: linear-gradient(160deg, var(--primary) 0%, var(--primary-light) 100%);
    padding: 100px 24px 48px;
    align-items: center;
    text-align: center;
  }
  .hero-content { max-width: 100%; }
  .hero h1 { font-size: 32px; }
  .hero-sub { font-size: 16px; }
  .hero-desc { font-size: 14px; }
  .hero-actions { justify-content: center; }
  .hero-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px 0;
    margin-top: 40px;
    padding-top: 28px;
  }
  .stat-num { font-size: 24px; }

  /* 产品板块 */
  .product-block { padding: 24px 16px; }
  .boxsize-img { max-height: 260px; width: auto; margin: 0 auto; }
  .knowledge-grid { grid-template-columns: 1fr 1fr; }
  .flute-grid { grid-template-columns: 1fr; }
  .box-type-grid { grid-template-columns: repeat(2, 1fr); }
  .knowledge-intro-layout { grid-template-columns: 1fr; }

  /* 表格可横向滑动 */
  .table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* 关于我们 */
  .about-certs { grid-template-columns: 1fr; }
  .carousel { width: 100%; border-radius: 0; }
  .carousel-track img { height: 220px; }

  /* 询价表单 */
  .form-row { grid-template-columns: 1fr; }
  .contact-row { grid-template-columns: 1fr; }
  .quote-form-card { padding: 20px 16px; }
  .quote-body { padding: 0 0 40px; }
  .checkbox-item { font-size: 12px; padding: 6px 10px; }

  /* 页脚 */
  .footer-grid { grid-template-columns: 1fr; }
  footer#contact { padding: 40px 0 0; }
}
