/* 工业精工 — 内页与专用页面 */

.if-page-head {
  background: var(--if-primary);
  color: var(--hero-fg);
  padding: 2.5rem 0 2rem;
  border-bottom: 3px solid var(--if-accent);
  position: relative;
  overflow: hidden;
}

.if-page-head::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(color-mix(in srgb, var(--hero-fg) 6%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--hero-fg) 6%, transparent) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}

.if-page-head .if-container { position: relative; }
.if-page-head h1 {
  font-size: clamp(1.5rem, 3.5vw, 2.15rem);
  font-weight: 700;
  margin-top: 0.5rem;
}
.if-page-head .if-lead {
  color: var(--hero-muted);
  margin-top: 0.5rem;
  max-width: 40rem;
}
.if-page-head .breadcrumb a { color: var(--hero-muted); }
.if-page-head .breadcrumb a:hover { color: var(--hero-fg); }
.if-page-head .breadcrumb .sep,
.if-page-head .breadcrumb span { color: var(--hero-muted); }

.if-page-body { padding: 2rem 0 3rem; }

/* 产品列表（ datasheet 行） */
.if-product-list { display: flex; flex-direction: column; gap: 0.75rem; }

.if-product-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  padding: 1.15rem;
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  transition: border-color 0.15s;
}
.if-product-row:hover { border-color: var(--if-accent); }
@media (min-width: 768px) {
  .if-product-row {
    grid-template-columns: auto 1fr auto;
    align-items: center;
  }
}

.if-product-row-mark {
  flex-shrink: 0;
  width: 3.5rem;
  height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--if-accent-soft);
  color: var(--if-accent);
  font-size: 1.5rem;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
  overflow: hidden;
  text-decoration: none;
}
.if-product-row-mark img { width: 100%; height: 100%; object-fit: cover; }

.if-product-row-main h3 { font-size: 1.05rem; font-weight: 650; margin-bottom: 0.25rem; }
.if-product-detail-head { padding-bottom: 0; }
.if-product-detail { max-width: var(--if-content-max, 72rem); margin: 0 auto; }

.if-product-detail-hero {
  display: grid;
  gap: 1.5rem;
  margin-bottom: 2rem;
}
@media (min-width: 768px) {
  .if-product-detail-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: start; }
}

.if-product-detail-media {
  aspect-ratio: 4 / 3;
  border: 1px solid var(--color-border);
  background: var(--color-surface-elevated);
  overflow: hidden;
}
.if-product-detail-media img { width: 100%; height: 100%; object-fit: cover; }
.if-product-detail-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--if-accent);
  opacity: 0.7;
}

.if-product-detail-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--if-accent);
  margin-bottom: 0.5rem;
}
.if-product-detail-intro h1 {
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  font-weight: 700;
  margin-bottom: 0.75rem;
}
.if-product-detail-lead {
  color: var(--color-muted);
  font-size: 0.9375rem;
  line-height: 1.65;
  margin-bottom: 1rem;
}

.if-product-specs {
  display: grid;
  gap: 0.65rem;
  margin: 0 0 1rem;
  padding: 1rem;
  border: 1px solid var(--color-border);
  background: var(--color-surface-elevated);
}
.if-product-specs > div {
  display: grid;
  grid-template-columns: 5rem 1fr;
  gap: 0.5rem;
  font-size: 0.875rem;
}
.if-product-specs dt {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-muted);
}
.if-product-specs dd { margin: 0; font-weight: 500; }

.if-product-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
}
.if-product-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.if-product-detail-body {
  margin-bottom: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}
.if-product-detail-body h2 {
  font-size: 1.15rem;
  font-weight: 650;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.if-product-detail-body .if-section-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--if-accent);
}

.if-product-row-main h3 a {
  color: inherit;
  text-decoration: none;
}
.if-product-row-main h3 a:hover { color: var(--if-accent); }

.if-product-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
  flex: 1;
}
.if-product-card-link:hover h3 { color: var(--if-accent); }

.if-product-row-model {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-muted);
  margin-bottom: 0.35rem;
}
.if-product-row-spec { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--if-accent); }
.if-product-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  color: var(--color-muted);
}
.if-product-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

/* 工厂页 */
.if-factory-detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
@media (min-width: 768px) { .if-factory-detail-grid { grid-template-columns: repeat(2, 1fr); } }

.if-factory-detail-card {
  border: 1px solid var(--color-border);
  background: var(--color-surface-elevated);
}
.if-factory-detail-card .if-factory-media { aspect-ratio: 16 / 9; }
.if-factory-detail-card .if-factory-body { padding: 1.25rem; }

.if-factory-highlight {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--color-border);
  border: 1px solid var(--color-border);
  margin-top: 2rem;
}
@media (min-width: 640px) { .if-factory-highlight { grid-template-columns: repeat(4, 1fr); } }
.if-factory-highlight-item {
  background: var(--color-surface-elevated);
  padding: 1.25rem;
  text-align: center;
}
.if-factory-highlight-item strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.35rem;
  color: var(--if-accent);
}
.if-factory-highlight-item span { font-size: 0.8125rem; color: var(--color-muted); }

/* 资质页 */
.if-cert-list { display: flex; flex-direction: column; gap: 0.75rem; }

.if-cert-row {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.15rem 1.25rem;
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--if-accent);
}

.if-cert-row-icon {
  font-size: 1.75rem;
  color: var(--if-accent);
  flex-shrink: 0;
}

.if-cert-row h3 { font-size: 1rem; font-weight: 650; margin-bottom: 0.25rem; }
.if-cert-row p { font-size: 0.875rem; color: var(--color-muted); }
.if-cert-row-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-muted);
  margin-top: 0.35rem;
}

/* 下载页 */
.if-download-list { display: flex; flex-direction: column; gap: 0.65rem; }

.if-download-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem;
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
}

.if-download-type {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.25rem 0.5rem;
  background: var(--if-accent-soft);
  color: var(--if-accent);
  border: 1px solid color-mix(in srgb, var(--if-accent) 30%, transparent);
  flex-shrink: 0;
}

.if-download-info { flex: 1; min-width: 12rem; }
.if-download-info h3 { font-size: 0.9375rem; font-weight: 650; }
.if-download-info p { font-size: 0.8125rem; color: var(--color-muted); margin-top: 0.15rem; }

/* 联系页 */
.if-contact-page-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  align-items: start;
}
@media (min-width: 960px) {
  .if-contact-page-grid {
    grid-template-columns: minmax(16rem, 22rem) 1fr;
    gap: 1.5rem;
  }
}

.if-contact-side {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.if-contact-form-panel {
  min-width: 0;
}

.if-contact-form-panel:not(:has(.contact-form-plugin)):not(:has(.yh-crm-form-block)) {
  display: none;
}

.if-contact-page-grid:not(:has(.contact-form-plugin)):not(:has(.yh-crm-form-block)) {
  grid-template-columns: 1fr;
  max-width: 40rem;
  margin: 0 auto;
}

.if-contact-page-content {
  font-size: 0.9375rem;
}

.if-contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
@media (min-width: 768px) { .if-contact-grid { grid-template-columns: 1fr 1fr; } }

/* yh-contact-form / yh-crm 插件 */
body.theme-industrial-forge .contact-form-plugin,
body.theme-industrial-forge .if-contact-form-panel .yh-crm-form-block { margin: 0; }

body.theme-industrial-forge .if-contact-form-panel .yh-crm-form-block {
  padding: 0;
  border: none;
  background: transparent;
}

body.theme-industrial-forge .contact-form-plugin > h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
  letter-spacing: 0.02em;
}

body.theme-industrial-forge .contact-form-desc {
  color: var(--color-muted);
  margin-bottom: 1.15rem;
  font-size: 0.875rem;
  line-height: 1.55;
}

body.theme-industrial-forge .contact-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

body.theme-industrial-forge .contact-form-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted);
}

body.theme-industrial-forge .contact-form-grid label span {
  color: var(--color-muted);
}

body.theme-industrial-forge .contact-form-grid label.full { grid-column: 1 / -1; }

body.theme-industrial-forge .contact-form-grid input,
body.theme-industrial-forge .contact-form-grid textarea {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.6rem 0.75rem;
  font: inherit;
  font-size: 0.9375rem;
  background: var(--color-bg);
  color: var(--color-text);
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}

body.theme-industrial-forge .contact-form-grid input:focus,
body.theme-industrial-forge .contact-form-grid textarea:focus {
  outline: none;
  border-color: var(--if-accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--if-accent) 20%, transparent);
}

body.theme-industrial-forge .contact-form-grid textarea {
  resize: vertical;
  min-height: 7.5rem;
}

body.theme-industrial-forge .contact-form-grid label.hp {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  overflow: hidden;
}

body.theme-industrial-forge .contact-form .btn,
body.theme-industrial-forge .contact-form-plugin button[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.35rem;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font-sans);
  border: 1px solid var(--if-accent);
  background: var(--if-accent);
  color: #fff;
  cursor: pointer;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 0 100%);
  transition: filter 0.15s;
}

body.theme-industrial-forge .contact-form .btn:hover,
body.theme-industrial-forge .contact-form-plugin button[type="submit"]:hover {
  filter: brightness(1.08);
}

body.theme-industrial-forge .contact-form-status {
  margin-top: 0.85rem;
  font-size: 0.875rem;
  font-family: var(--font-mono);
}

body.theme-industrial-forge .contact-form-status.ok { color: #15803d; }
body.theme-industrial-forge .contact-form-status.err { color: #dc2626; }

@media (max-width: 640px) {
  body.theme-industrial-forge .contact-form-grid {
    grid-template-columns: 1fr;
  }
  body.theme-industrial-forge .contact-form-grid label.full {
    grid-column: auto;
  }
}

.if-contact-card {
  padding: 1.25rem;
  border: 1px solid var(--color-border);
  background: var(--color-surface-elevated);
}

.if-contact-card h3 {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--color-muted);
  margin-bottom: 0.75rem;
}

.if-contact-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
  font-size: 0.9375rem;
}
.if-contact-item i { color: var(--if-accent); margin-top: 0.15rem; }

.if-inline-cta {
  margin-top: 2.5rem;
  padding: 1.5rem;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  text-align: center;
}
.if-inline-cta h2 { font-size: 1.15rem; margin-bottom: 0.35rem; }
.if-inline-cta p { color: var(--color-muted); font-size: 0.9375rem; margin-bottom: 1rem; }
.if-inline-cta-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; }

/* 文章页 */
.if-article { max-width: var(--article-readable-width, 44rem); }
.if-article-cover {
  margin-bottom: 1.5rem;
  border: 1px solid var(--color-border);
}
.if-article-cover img { width: 100%; display: block; }

.if-post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  font-size: 0.8125rem;
  color: var(--hero-muted);
  margin-top: 0.75rem;
  font-family: var(--font-mono);
}
.if-post-meta a { color: var(--hero-muted); }
.if-post-meta a:hover { color: var(--hero-fg); }

.if-post-tags { margin-top: 0.75rem; }
.if-page-head--compact { padding: 1.75rem 0 1.5rem; }

.if-post-pin {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: var(--if-accent);
  margin-bottom: 0.5rem;
}

/* 列表页 */
.if-list-head { margin-bottom: 1.5rem; }
.if-list-head h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.35rem; }
.if-list-head p { color: var(--color-muted); font-size: 0.9375rem; }

.if-sidebar {
  font-size: 0.875rem;
}
.if-sidebar .widget {
  padding: 1rem;
  border: 1px solid var(--color-border);
  background: var(--color-surface-elevated);
  margin-bottom: 1rem;
}
.if-sidebar .widget-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--color-muted);
  margin-bottom: 0.75rem;
}
.if-sidebar .widget > h3 {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin: 0 0 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.if-sidebar .widget > h3 i {
  color: var(--if-accent);
}
.if-sidebar .tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.if-sidebar .tag-cloud .tag-pill {
  margin: 0;
}

/* 404 */
.if-404 {
  text-align: center;
  padding: 4rem 1rem;
}
.if-404-code {
  font-family: var(--font-mono);
  font-size: 4rem;
  font-weight: 700;
  color: var(--if-accent);
  line-height: 1;
}
.if-404 h1 { font-size: 1.35rem; margin: 1rem 0 0.5rem; }
.if-404 p { color: var(--color-muted); margin-bottom: 1.5rem; }

.if-filter a.if-filter-btn {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.if-filter a.if-filter-btn:hover { text-decoration: none; }

/* 相关文章（yh-related-posts 插件） */
body.theme-industrial-forge .related-posts {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
}
body.theme-industrial-forge .related-posts > h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
body.theme-industrial-forge .related-posts > h3::before {
  content: "[→]";
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--if-accent);
}
body.theme-industrial-forge .related-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
}
body.theme-industrial-forge .related-card {
  display: flex;
  flex-direction: column;
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  transition: border-color 0.15s, box-shadow 0.15s;
}
body.theme-industrial-forge .related-card:hover {
  border-color: var(--if-accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--if-accent) 40%, transparent);
}
body.theme-industrial-forge .related-card-cover {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--color-surface-muted);
  border-radius: 0;
}
body.theme-industrial-forge .related-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  aspect-ratio: auto;
}
body.theme-industrial-forge .related-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1rem 1.1rem 1.15rem;
  background: var(--color-surface-elevated);
  border-top: 1px solid var(--color-border);
}
body.theme-industrial-forge .related-card .card-cat {
  margin-bottom: 0.1rem;
}
body.theme-industrial-forge .related-card .tag-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--if-accent);
  background: color-mix(in srgb, var(--if-accent) 10%, var(--color-surface-elevated));
  border: 1px solid color-mix(in srgb, var(--if-accent) 30%, var(--color-border));
  text-decoration: none;
}
body.theme-industrial-forge .related-card h3 {
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.4;
  margin: 0;
}
body.theme-industrial-forge .related-card h3 a {
  color: var(--color-text);
  text-decoration: none;
}
body.theme-industrial-forge .related-card h3 a:hover {
  color: var(--if-accent);
}
body.theme-industrial-forge .related-card .excerpt {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--color-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
body.theme-industrial-forge .related-card .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-muted);
  margin-top: auto;
  padding-top: 0.35rem;
}
body.theme-industrial-forge .related-card .meta i {
  margin-right: 0.15rem;
  color: var(--if-accent);
}
body.theme-industrial-forge .related-grid-list .related-card {
  flex-direction: row;
  align-items: stretch;
}
@media (min-width: 640px) {
  body.theme-industrial-forge .related-grid-list .related-card-cover {
    flex: 0 0 10.5rem;
    max-width: 10.5rem;
    aspect-ratio: auto;
    border-right: 1px solid var(--color-border);
  }
  body.theme-industrial-forge .related-grid-list .related-card-cover img {
    height: 100%;
    min-height: 7rem;
  }
  body.theme-industrial-forge .related-grid-list .related-card-body {
    border-top: none;
  }
}
body.theme-industrial-forge .related-posts-sidebar {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
body.theme-industrial-forge .related-posts-sidebar > h3 {
  font-size: 0.9375rem;
  margin-bottom: 0.75rem;
}
body.theme-industrial-forge .related-posts-sidebar > h3::before {
  content: none;
}
body.theme-industrial-forge .related-posts-sidebar .related-grid {
  grid-template-columns: 1fr;
  gap: 0.75rem;
}
body.theme-industrial-forge .related-posts-sidebar .related-card-body {
  padding: 0.75rem 0.85rem;
}
body.theme-industrial-forge .related-posts-sidebar .related-card h3 {
  font-size: 0.875rem;
}
body.theme-industrial-forge .related-posts-sidebar .related-card .excerpt {
  font-size: 0.8125rem;
  -webkit-line-clamp: 2;
}
