/* 品名计算器引流页：最后加载，强制覆盖首页样式缓存 */

/* 主 styles 未加载/404 时也必须隐藏（勿只依赖 styles.css） */
html.seo-calc-embed .seo-embed-hidden-controls {
  position: absolute !important;
  left: -9999px !important;
  top: 0 !important;
  width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: 0 !important;
  clip: rect(0, 0, 0, 0) !important;
  pointer-events: none !important;
  visibility: hidden !important;
}
html.seo-calc-embed .seo-embed-hidden-controls * {
  pointer-events: none !important;
}

html.seo-calc-embed #steel-plate-collapse-bar,
html.seo-calc-embed #rebar-collapse-bar,
html.seo-calc-embed #collaboration-collapse-bar,
html.seo-calc-embed .mobile-datalist-mode-bar,
html.seo-calc-embed .guest-quota-hint,
html.seo-calc-embed .calc-save-stats,
html.seo-calc-embed .calc-action-extra,
html.seo-calc-embed .calc-action-truck,
html.seo-calc-embed .calc-doc-actions-slot,
html.seo-calc-embed .seo-top-actions {
  display: none !important;
}

html.seo-calc-embed .table-clear-all-bar {
  display: flex !important;
}
html.seo-calc-embed .seo-cta {
  display: flex !important;
  margin-top: 4px !important;
}

/* 隐藏单据占位区，避免手机端 document-section 样式撑出大块空白 */
html.seo-calc-embed #document-section,
html.seo-calc-embed.mobile-home-layout #document-section,
html.seo-calc-embed .calc-save-stats,
html.seo-calc-embed.mobile-home-layout .calc-save-stats,
html.seo-calc-embed .calc-doc-actions-slot {
  display: none !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  overflow: hidden !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* 宣传区与计算器左右对齐：同列宽 1100（与 .seo-wrap 一致），外缘对齐 */
html.seo-calc-embed .container.seo-embed-calc-wrap,
body.seo-calc-embed-body .container.seo-embed-calc-wrap {
  max-width: 1100px !important;
  width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  box-sizing: border-box !important;
}
body.seo-calc-embed-body section.seo-wrap.seo-promo-top {
  max-width: 1100px !important;
  width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box !important;
}
html.seo-calc-embed #rebar-calculator.calculator-section,
html.seo-calc-embed #steel-plate-calculator.calculator-section,
html.seo-calc-embed .calculator-section.active {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  position: relative !important;
  float: none !important;
  clear: both !important;
}
html.seo-calc-embed #rebar-calculator .excel-table-container,
html.seo-calc-embed #steel-plate-calculator .excel-table-container {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  overflow-x: visible !important;
  position: relative !important;
  float: none !important;
  clear: both !important;
  order: 1 !important;
}
html.seo-calc-embed .summary-bar {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  position: relative !important;
  float: none !important;
  clear: both !important;
  order: 3 !important;
}

/* 合计栏与下方 CTA 贴紧 */
html.seo-calc-embed .seo-embed-calc-wrap {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}
html.seo-calc-embed.mobile-home-layout #rebar-calculator.active .summary-bar,
html.seo-calc-embed.mobile-home-layout #steel-plate-calculator.active .summary-bar,
html.seo-calc-embed .summary-bar {
  margin: 0 !important;
  padding-bottom: 8px !important;
}
body.seo-calc-embed-body .seo-wrap.seo-cta-wrap {
  padding-top: 4px !important;
  padding-bottom: 16px !important;
  margin-top: 0 !important;
}

/* 左：新增一行；右：导出（覆盖手机端 btn-purple order:1 导致导出跑到左边） */
html.seo-calc-embed .action-buttons > .btn-purple,
html.seo-calc-embed.mobile-home-layout .action-buttons > .btn-purple {
  order: 1 !important;
}
html.seo-calc-embed .action-buttons > #doc-export-trigger,
html.seo-calc-embed.mobile-home-layout .action-buttons > #doc-export-trigger {
  order: 2 !important;
}
html.seo-calc-embed #doc-export-trigger::after,
html.seo-calc-embed.mobile-home-layout #doc-export-trigger::after,
html.seo-calc-embed .action-buttons #doc-export-trigger::after,
html.seo-calc-embed.mobile-home-layout .action-buttons #doc-export-trigger::after {
  content: none !important;
  display: none !important;
}

/* 核心列表格：取消首页 1600px 最小宽度，避免电脑端横滑 */
html.seo-calc-embed #steel-plate-excel-table,
html.seo-calc-embed #rebar-excel-table {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  table-layout: fixed !important;
}
html.seo-calc-embed #rebar-calculator .rebar-collapse-bar,
html.seo-calc-embed #steel-plate-calculator .steel-plate-collapse-bar,
html.seo-calc-embed #rebar-calculator .table-clear-all-bar,
html.seo-calc-embed #steel-plate-calculator .table-clear-all-bar {
  min-width: 0 !important;
  width: auto !important;
}

/* 按钮：整行在表格下方（勿居中浮在空表中间） */
html.seo-calc-embed #rebar-calculator .action-buttons,
html.seo-calc-embed #steel-plate-calculator .action-buttons,
html.seo-calc-embed.mobile-home-layout #rebar-calculator .action-buttons,
html.seo-calc-embed.mobile-home-layout #steel-plate-calculator .action-buttons {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  justify-content: stretch !important;
  align-items: stretch !important;
  gap: 10px !important;
  grid-template-columns: none !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  margin: 8px 0 0 !important;
  padding: 8px 0 !important;
  overflow: visible !important;
  box-shadow: none !important;
  background: transparent !important;
  position: relative !important;
  float: none !important;
  clear: both !important;
  order: 2 !important;
  z-index: 2 !important;
}
html.seo-calc-embed .action-buttons > *:not(.calc-action-core) {
  display: none !important;
}
html.seo-calc-embed .action-buttons > .calc-action-core {
  flex: 1 1 0 !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  min-height: 44px !important;
  height: auto !important;
  padding: 10px 12px !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  line-height: 1.25 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 12px !important;
  transform: none !important;
  position: relative !important;
  float: none !important;
}
html.seo-calc-embed .action-buttons > .calc-action-core:hover,
html.seo-calc-embed .action-buttons > .calc-action-core:active {
  transform: none !important;
  filter: brightness(1.06);
}
html.seo-calc-embed .action-buttons > .calc-action-core::before {
  display: none !important;
  content: none !important;
}

html.seo-calc-embed #steel-plate-excel-table thead th,
html.seo-calc-embed #steel-plate-excel-table tbody td,
html.seo-calc-embed #rebar-excel-table thead th,
html.seo-calc-embed #rebar-excel-table tbody td {
  display: none !important;
}

html.seo-calc-embed #steel-plate-excel-table thead th:nth-child(1),
html.seo-calc-embed #steel-plate-excel-table thead th:nth-child(2),
html.seo-calc-embed #steel-plate-excel-table thead th:nth-child(3),
html.seo-calc-embed #steel-plate-excel-table thead th:nth-child(6),
html.seo-calc-embed #steel-plate-excel-table thead th:nth-child(7),
html.seo-calc-embed #steel-plate-excel-table thead th:nth-child(9),
html.seo-calc-embed #steel-plate-excel-table tbody td:nth-child(1),
html.seo-calc-embed #steel-plate-excel-table tbody td:nth-child(2),
html.seo-calc-embed #steel-plate-excel-table tbody td:nth-child(3),
html.seo-calc-embed #steel-plate-excel-table tbody td:nth-child(6),
html.seo-calc-embed #steel-plate-excel-table tbody td:nth-child(7),
html.seo-calc-embed #steel-plate-excel-table tbody td:nth-child(9),
html.seo-calc-embed #rebar-excel-table thead th:nth-child(1),
html.seo-calc-embed #rebar-excel-table thead th:nth-child(2),
html.seo-calc-embed #rebar-excel-table thead th:nth-child(3),
html.seo-calc-embed #rebar-excel-table thead th:nth-child(7),
html.seo-calc-embed #rebar-excel-table thead th:nth-child(8),
html.seo-calc-embed #rebar-excel-table tbody td:nth-child(1),
html.seo-calc-embed #rebar-excel-table tbody td:nth-child(2),
html.seo-calc-embed #rebar-excel-table tbody td:nth-child(3),
html.seo-calc-embed #rebar-excel-table tbody td:nth-child(7),
html.seo-calc-embed #rebar-excel-table tbody td:nth-child(8) {
  display: table-cell !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
}

/* 手机 SEO：方案 L — 可横滑，列用 min-width，避免挤压 */
@media (max-width: 768px) {
  html.seo-calc-embed #rebar-calculator .excel-table-container,
  html.seo-calc-embed #steel-plate-calculator .excel-table-container,
  html.seo-calc-embed.mobile-home-layout #rebar-calculator .excel-table-container,
  html.seo-calc-embed.mobile-home-layout #steel-plate-calculator .excel-table-container,
  html.seo-calc-embed.mobile-home-layout .excel-table-container {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  html.seo-calc-embed #steel-plate-excel-table,
  html.seo-calc-embed.mobile-home-layout #steel-plate-excel-table,
  html.seo-calc-embed #rebar-excel-table,
  html.seo-calc-embed.mobile-home-layout #rebar-excel-table,
  html.seo-calc-embed.mobile-home-layout #steel-plate-calculator .excel-table {
    table-layout: fixed !important;
    width: max-content !important;
    min-width: 100% !important;
    max-width: none !important;
  }
  html.seo-calc-embed #steel-plate-excel-table thead th:nth-child(1),
  html.seo-calc-embed #steel-plate-excel-table tbody td:nth-child(1),
  html.seo-calc-embed.mobile-home-layout #steel-plate-calculator .excel-table th:nth-child(1),
  html.seo-calc-embed.mobile-home-layout #steel-plate-calculator .excel-table td:nth-child(1) {
    width: 76px !important;
    min-width: 76px !important;
    max-width: 96px !important;
  }
  html.seo-calc-embed #steel-plate-excel-table thead th:nth-child(2),
  html.seo-calc-embed #steel-plate-excel-table tbody td:nth-child(2),
  html.seo-calc-embed.mobile-home-layout #steel-plate-calculator .excel-table th:nth-child(2),
  html.seo-calc-embed.mobile-home-layout #steel-plate-calculator .excel-table td:nth-child(2) {
    width: 68px !important;
    min-width: 68px !important;
    max-width: 88px !important;
  }
  html.seo-calc-embed #steel-plate-excel-table thead th:nth-child(3),
  html.seo-calc-embed #steel-plate-excel-table tbody td:nth-child(3),
  html.seo-calc-embed.mobile-home-layout #steel-plate-calculator .excel-table th:nth-child(3),
  html.seo-calc-embed.mobile-home-layout #steel-plate-calculator .excel-table td:nth-child(3) {
    width: 132px !important;
    min-width: 120px !important;
    max-width: 160px !important;
  }
  html.seo-calc-embed #steel-plate-excel-table thead th:nth-child(6),
  html.seo-calc-embed #steel-plate-excel-table tbody td:nth-child(6),
  html.seo-calc-embed.mobile-home-layout #steel-plate-calculator .excel-table th:nth-child(6),
  html.seo-calc-embed.mobile-home-layout #steel-plate-calculator .excel-table td:nth-child(6) {
    width: 72px !important;
    min-width: 72px !important;
    max-width: 88px !important;
  }
  html.seo-calc-embed #steel-plate-excel-table thead th:nth-child(7),
  html.seo-calc-embed #steel-plate-excel-table tbody td:nth-child(7),
  html.seo-calc-embed.mobile-home-layout #steel-plate-calculator .excel-table th:nth-child(7),
  html.seo-calc-embed.mobile-home-layout #steel-plate-calculator .excel-table td:nth-child(7) {
    width: 64px !important;
    min-width: 64px !important;
    max-width: 80px !important;
  }
  html.seo-calc-embed #steel-plate-excel-table thead th:nth-child(9),
  html.seo-calc-embed #steel-plate-excel-table tbody td:nth-child(9),
  html.seo-calc-embed.mobile-home-layout #steel-plate-calculator .excel-table th:nth-child(9),
  html.seo-calc-embed.mobile-home-layout #steel-plate-calculator .excel-table td:nth-child(9) {
    width: 76px !important;
    min-width: 76px !important;
    max-width: 96px !important;
  }
  html.seo-calc-embed #rebar-excel-table thead th:nth-child(1),
  html.seo-calc-embed #rebar-excel-table tbody td:nth-child(1) {
    width: 76px !important;
    min-width: 76px !important;
    max-width: 96px !important;
  }
  html.seo-calc-embed #rebar-excel-table thead th:nth-child(2),
  html.seo-calc-embed #rebar-excel-table tbody td:nth-child(2) {
    width: 72px !important;
    min-width: 72px !important;
    max-width: 92px !important;
  }
  html.seo-calc-embed #rebar-excel-table thead th:nth-child(3),
  html.seo-calc-embed #rebar-excel-table tbody td:nth-child(3) {
    width: 132px !important;
    min-width: 120px !important;
    max-width: 160px !important;
  }
  html.seo-calc-embed #rebar-excel-table thead th:nth-child(7),
  html.seo-calc-embed #rebar-excel-table tbody td:nth-child(7) {
    width: 72px !important;
    min-width: 72px !important;
    max-width: 88px !important;
  }
  html.seo-calc-embed #rebar-excel-table thead th:nth-child(8),
  html.seo-calc-embed #rebar-excel-table tbody td:nth-child(8) {
    width: 80px !important;
    min-width: 80px !important;
    max-width: 100px !important;
  }
  html.seo-calc-embed #steel-plate-excel-table input,
  html.seo-calc-embed #steel-plate-excel-table select,
  html.seo-calc-embed #rebar-excel-table input,
  html.seo-calc-embed #rebar-excel-table select {
    min-width: 0 !important;
  }
}

/* 汇总栏：总件数 / 总重量 / 总金额 都显示 */
html.seo-calc-embed .summary-bar .summary-metric {
  display: block !important;
}

html.seo-calc-embed #steel-plate-excel-table input,
html.seo-calc-embed #steel-plate-excel-table select,
html.seo-calc-embed #rebar-excel-table input,
html.seo-calc-embed #rebar-excel-table select {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

@media (max-width: 768px) {
  /* 与理论重量表同级：约 12px 边距，字号舒适，略紧凑 */
  html.seo-calc-embed .seo-topbar {
    justify-content: flex-start;
    padding: 10px 12px !important;
  }
  body.seo-calc-embed-body .seo-wrap.seo-embed-hero {
    padding: 12px 12px 0 !important;
    margin: 0 !important;
  }
  body.seo-calc-embed-body .seo-embed-hero h1,
  html.seo-calc-embed .seo-embed-hero h1 {
    margin: 0 0 6px !important;
    font-size: 1.45rem !important;
    line-height: 1.25 !important;
  }
  body.seo-calc-embed-body .seo-lead,
  html.seo-calc-embed .seo-embed-hero .seo-lead {
    margin: 0 0 8px !important;
    font-size: 16px !important;
    line-height: 1.5 !important;
  }
  /* 手机端：宣传卡与计算器同侧边距，外缘对齐 */
  body.seo-calc-embed-body section.seo-wrap.seo-promo-top,
  html.seo-calc-embed .container.seo-embed-calc-wrap,
  body.seo-calc-embed-body .container.seo-embed-calc-wrap {
    width: auto !important;
    max-width: none !important;
    margin-left: 12px !important;
    margin-right: 12px !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  body.seo-calc-embed-body section.seo-wrap.seo-promo-top {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }
  html.seo-calc-embed .seo-embed-calc-wrap {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }
  html.seo-calc-embed.mobile-home-layout .calculator-section,
  html.seo-calc-embed .calculator-section.active {
    margin: 0 !important;
    padding: 0 !important;
  }
  html.seo-calc-embed #rebar-calculator .excel-table-container,
  html.seo-calc-embed #steel-plate-calculator .excel-table-container,
  html.seo-calc-embed.mobile-home-layout .excel-table-container {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    margin: 0 !important;
    padding: 0 !important;
  }
  html.seo-calc-embed .table-clear-all-bar,
  html.seo-calc-embed.mobile-home-layout .table-clear-all-bar {
    margin: 0 0 4px !important;
    padding: 0 !important;
    min-height: 0 !important;
    gap: 4px !important;
  }

  html.seo-calc-embed #steel-plate-excel-table thead th,
  html.seo-calc-embed #steel-plate-excel-table tbody td,
  html.seo-calc-embed #rebar-excel-table thead th,
  html.seo-calc-embed #rebar-excel-table tbody td {
    font-size: 16px !important;
    padding: 8px 4px !important;
    white-space: normal !important;
    word-break: break-word;
    line-height: 1.35;
  }

  html.seo-calc-embed #steel-plate-excel-table input,
  html.seo-calc-embed #steel-plate-excel-table select,
  html.seo-calc-embed #rebar-excel-table input,
  html.seo-calc-embed #rebar-excel-table select {
    font-size: 16px !important;
    padding: 6px 4px !important;
    min-height: 36px !important;
  }

  html.seo-calc-embed #rebar-calculator .action-buttons,
  html.seo-calc-embed #steel-plate-calculator .action-buttons,
  html.seo-calc-embed.mobile-home-layout #rebar-calculator.active .action-buttons,
  html.seo-calc-embed.mobile-home-layout #steel-plate-calculator.active .action-buttons {
    padding: 8px 0 !important;
    gap: 10px !important;
    margin: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
  }
  html.seo-calc-embed .action-buttons > .calc-action-core {
    max-width: none !important;
    font-size: 16px !important;
    padding: 12px 8px !important;
    min-height: 48px !important;
    border-radius: 10px !important;
  }

  html.seo-calc-embed .summary-bar,
  html.seo-calc-embed.mobile-home-layout #rebar-calculator.active .summary-bar,
  html.seo-calc-embed.mobile-home-layout #steel-plate-calculator.active .summary-bar {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 6px 4px !important;
    padding: 10px 8px !important;
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }
  html.seo-calc-embed .summary-bar .summary-metric {
    display: block !important;
    text-align: center !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
  }
  html.seo-calc-embed .summary-bar .summary-metric:nth-child(1) {
    flex: 1 1 100% !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  html.seo-calc-embed .summary-bar .summary-metric:nth-child(2),
  html.seo-calc-embed .summary-bar .summary-metric:nth-child(3) {
    flex: 1 1 calc(50% - 4px) !important;
    max-width: calc(50% - 4px) !important;
    min-width: 0 !important;
  }
  body.seo-calc-embed-body .seo-wrap.seo-cta-wrap {
    padding: 8px 12px 24px !important;
  }
  html.seo-calc-embed .seo-cta {
    margin-top: 4px !important;
    padding: 14px 16px !important;
    gap: 10px !important;
  }
  html.seo-calc-embed .seo-cta p {
    font-size: 16px !important;
    line-height: 1.5 !important;
  }
  html.seo-calc-embed .seo-cta strong {
    font-size: 17px !important;
  }
  html.seo-calc-embed .seo-cta .seo-btn {
    font-size: 15px !important;
    padding: 10px 14px !important;
  }
}