/* 设计样式：与设计画布（重型机械配件官网设计）一致 */
:root {
  --ink: #1b1f24;
  --steel: #2d343c;
  --paper: #f4f3ef;
  --surface: #ffffff;
  --accent: #e8730c;
  --text: #1b1f24;
  --muted: #3d454e;
  --placeholder: #5b636c;
  --border: #d6d9dd;
  --notice-bg: #fff3e0;
  --notice-text: #5c3a0c;
  --error: #b42318;
  --font-head: "Barlow Condensed", "Arial Narrow", sans-serif;
  --font-body: "Barlow", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
}

h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1.05;
  letter-spacing: 0.01em;
}

h1 { font-size: 52px; margin: 0 0 16px; }
h2 { font-size: 36px; margin: 32px 0 12px; }
h3 { font-size: 26px; margin: 0 0 8px; }

a { color: var(--text); }
a:hover { color: var(--steel); }

.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 40px;
}

/* 深色页眉，与设计一致 */
.site-header {
  background: var(--ink);
  color: var(--paper);
  padding: 20px 0;
}

.site-header .container {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  align-items: center;
  justify-content: space-between;
}

.site-header a {
  color: var(--paper);
  text-decoration: none;
}

.site-header a:hover { color: var(--accent); }

.site-header strong {
  font-family: var(--font-head);
  font-size: 22px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.site-header nav a {
  margin-left: 0;
  font-size: 15px;
  font-weight: 500;
}

main.container {
  padding-top: 40px;
  padding-bottom: 56px;
}

.site-footer {
  background: var(--ink);
  color: #c4c9cf;
  padding: 36px 0;
  font-size: 15px;
  line-height: 1.6;
}

.site-footer .container { padding-top: 0; padding-bottom: 0; }

.card-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 32px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card:hover { border-color: var(--accent); }

.card p { margin: 0; color: var(--muted); }

/* 主按钮：安全橙底、深色字，满足对比度 */
.btn {
  display: inline-block;
  background: var(--accent);
  color: var(--ink);
  font-weight: 600;
  font-size: 16px;
  padding: 14px 24px;
  border: 0;
  border-radius: 4px;
  text-decoration: none;
  min-height: 44px;
  font-family: inherit;
  cursor: pointer;
}

.btn:hover { background: #d4660a; color: var(--ink); }

/* 待确认占位：灰色斜体，表示内容尚未核实 */
.placeholder {
  color: var(--placeholder);
  font-style: italic;
}

.notice {
  background: var(--notice-bg);
  color: var(--notice-text);
  border-left: 4px solid var(--accent);
  padding: 12px 16px;
  margin-bottom: 24px;
  font-size: 15px;
}

.hint {
  color: var(--muted);
  font-size: 14px;
}

/* 首页滚动图：横向 scroll-snap，无脚本时仍可滑动 */
.carousel {
  margin: 8px 0 40px;
}

.carousel-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  border-radius: 6px;
  background: var(--ink);
}

.carousel-track::-webkit-scrollbar { display: none; }

.slide {
  position: relative;
  flex: 0 0 100%;
  margin: 0;
  scroll-snap-align: start;
}

.slide img {
  display: block;
  width: 100%;
  height: 420px;
  object-fit: cover;
  object-position: center;
}

.slide figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 36px 24px 16px;
  background: linear-gradient(transparent, rgba(27, 31, 36, 0.88));
  color: #ffffff;
  font-family: var(--font-head);
  font-size: 24px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.carousel-controls {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 12px;
}

.carousel-controls button {
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.carousel-controls button:hover { border-color: var(--accent); }

.carousel-track:focus-visible,
.carousel-controls button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* 产品图：详情页主图与相关件网格 */
.product-photo {
  margin: 24px 0 8px;
  max-width: 800px;
}

.product-photo img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}

.product-photo figcaption {
  margin-top: 8px;
}

.photo-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  margin: 16px 0 0;
}

.photo-card {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.photo-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--surface);
}

.photo-card figcaption {
  padding: 12px 16px;
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 700;
  text-transform: uppercase;
}

@media (max-width: 720px) {
  .slide img { height: 320px; }
  .slide figcaption { font-size: 20px; }
}

@media (max-width: 480px) {
  .slide img { height: 240px; }
  .slide figcaption { font-size: 17px; padding: 28px 16px 12px; }
  .photo-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
}

/* 小图网格：专利证书、荣誉等较多的图片 */
.photo-grid.compact {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}

.photo-card.small figcaption {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  text-transform: none;
  line-height: 1.35;
  color: var(--muted);
}

/* 规格表只在自身容器内横向滚动，不撑破页面 */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 480px;
  font-size: 14px;
}

.spec-table th,
.spec-table td {
  border-bottom: 1px solid #e9e7e1;
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
}

.spec-table th {
  background: var(--steel);
  color: var(--paper);
  font-weight: 600;
  white-space: nowrap;
}

.inquiry-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 36px;
  max-width: 720px;
}

.inquiry-form label {
  display: block;
  font-weight: 600;
  margin-top: 16px;
}

.inquiry-form input,
.inquiry-form textarea,
.inquiry-form select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #8a929b;
  border-radius: 4px;
  font: inherit;
  font-size: 16px;
  margin-top: 6px;
  min-height: 44px;
  background: var(--surface);
  color: var(--text);
}

.inquiry-form .hint {
  font-weight: 400;
  font-size: 14px;
  margin: 4px 0 0;
}

.inquiry-form .error {
  color: var(--error);
  font-size: 14px;
  margin: 4px 0 0;
}

.inquiry-form .status {
  margin-top: 16px;
  font-weight: 600;
}

@media (max-width: 720px) {
  .container { padding: 0 20px; }
  h1 { font-size: 40px; }
  .site-header nav { display: flex; flex-wrap: wrap; gap: 8px 16px; }
  .inquiry-form { padding: 24px; }
}

@media (max-width: 480px) {
  body { font-size: 15px; }
  .container { padding: 0 16px; }
  .site-header nav a { margin-left: 0; margin-right: 12px; }
  .card-grid { grid-template-columns: 1fr; }
  h1 { font-size: 36px; }
}
