/* ============================================================
   formulations.css — 配方中心详情页 专属样式
   依赖：main.css（全局变量、Reset、Header、Footer、Nav）
         banner.css（Banner 区块）
   ============================================================ */

/* ============================================================
   按钮
   ============================================================ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--color-primary);
  color: var(--color-white);
  border: 2px solid var(--color-primary);
  padding: 11px 26px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), transform 0.15s;
  white-space: nowrap;
  text-decoration: none;
}
.btn-primary:hover {
  background: var(--color-primary-mid);
  border-color: var(--color-primary-mid);
  transform: translateY(-1px);
}
.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
  padding: 11px 26px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), transform 0.15s;
  white-space: nowrap;
  text-decoration: none;
}
.btn-outline:hover {
  background: var(--color-primary-bg);
  transform: translateY(-1px);
}

/* ============================================================
   锚点导航标签栏
   ============================================================ */
.anchor-nav {
  position: sticky;
  top: var(--header-h, 68px);
  z-index: 900;
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.anchor-nav .container {
  padding-top: 0;
  padding-bottom: 0;
}

.anchor-nav-list {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.anchor-nav-list::-webkit-scrollbar { display: none; }

.anchor-nav-item {
  display: inline-flex;
  align-items: center;
  padding: 14px 22px;
  font-size: 16px;
  font-weight: 500;
  color: var(--color-text-mid);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
  text-decoration: none;
  cursor: pointer;
}
.anchor-nav-item:hover {
  color: var(--color-primary);
}
.anchor-nav-item.active {
  color: var(--color-primary);
  font-weight: 600;
  border-bottom-color: var(--color-primary);
}

/* ============================================================
   主内容区
   ============================================================ */
.main-content {
  padding: 0;
  background: var(--color-white);
}

/* ============================================================
   通用 section 块 — 扁平白底风格，底部分隔线
   ============================================================ */
.section-block {
  background: var(--color-white);
  border-radius: 0;
  padding: 32px 0;
  margin-bottom: 0;
  box-shadow: none;
  border-bottom: 1px solid var(--color-border);
  /* 补偿 sticky header + anchor-nav 的高度，确保锁点跳转准确 */
  scroll-margin-top: calc(var(--header-h, 68px) + 49px);
}

/* 最后一个 section-block 不需要底部分隔线 */
.section-block:last-child {
  border-bottom: none;
}

/* 章节标题（黑色粗体，无编号） */
.section-title-block {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
}

/* 章节标题行 */
.section-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
}

/* 标题行左右布局（左标题+右链接） */
.section-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
}

.section-heading-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-num {
  font-size: 22px;
  font-weight: 800;
  color: #b7e4c7;
  line-height: 1;
  min-width: 34px;
}

.section-title-inline {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
}

/* 黑色标题变体 */
.section-title-dark {
  color: var(--color-text);
}

/* 分割线 */
.section-divider {
  height: 1px;
  background: var(--color-border);
  margin-bottom: 18px;
}

/* 更多链接 */
.more-link {
  font-size: 13px;
  color: var(--color-primary-mid);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.more-link:hover { color: var(--color-primary); }

/* ============================================================
   方案概述左列
   ============================================================ */
.overview-table-col .section-heading {
  margin-bottom: 16px;
}

/* 方案概述右列标题：与左侧标题行垂直对齐 */
.overview-right-heading {
  margin-bottom: 16px;
}

/* ============================================================
   01 方案概述
   ============================================================ */
.overview-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  align-items: start;
}

/* 左右两列之间加竖向分隔线 */
.overview-table-col {
  padding-right: 40px;
  border-right: 1px solid var(--color-border);
}

.overview-right-col {
  display: flex;
  flex-direction: column;
  padding-left: 40px;
}

/* 信息表格 */
.info-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}
.info-table td {
  padding: 7px 0;
  border-bottom: none;
  vertical-align: top;
  line-height: 1.6;
  color: var(--color-text-mid);
}
.info-table td.label {
  color: var(--color-text-mid);
  font-weight: 400;
  white-space: nowrap;
  width: 72px;
  background: transparent;
}
.info-table tr:last-child td { border-bottom: none; }

/* 右侧内容：特点靠左、图片靠右 */
.overview-right-inner {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  flex: 1;
}
.overview-right-inner .feature-points {
  flex: 1;
  min-width: 0;
}
.overview-right-inner .overview-img-wrap {
  flex-shrink: 0;
  width: 220px;
}

/* 方案特点勾选列表 */
.check-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.check-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 16px;
  color: var(--color-text-mid);
  padding: 10px 0;
  line-height: 1.5;
}
.check-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-primary-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.check-icon svg { width: 10px; height: 10px; }

/* 概述图片 */
.overview-img-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}
.overview-img {
  width: 280px !important;
  height: 200px !important;
  object-fit: cover;
  border-radius: var(--radius-sm);
  display: block;
  flex-shrink: 0;
  border: none !important;
}

/* ============================================================
   02 核心原料 & 功效
   ============================================================ */
.ingredients-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

.ingredient-card {
  background: var(--color-white);
  border-radius: var(--radius-sm);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid var(--color-border);
  transition: box-shadow var(--transition), transform var(--transition);
}
.ingredient-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.ingredient-card-green {
  background: #f5fbf6;
}

/* 原料图片区域 */
.ingredient-img-wrap {
  width: 100%;
  height: 120px;
  border-radius: var(--radius-sm);
  background: #f0f7f2;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.ingredient-img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
}

.ingredient-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.3;
}
.ingredient-tags {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ingredient-tag {
  font-size: 13px;
  color: var(--color-text-light);
  line-height: 1.5;
}

/* ============================================================
   03 + 04 两栏并排
   ============================================================ */
.two-panel-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-bottom: 0;
  border-bottom: 1px solid var(--color-border);
}

.panel-block {
  margin-bottom: 0;
  border-bottom: none;
  border-radius: 0;
}

/* 左侧面板右边加分隔线 */
.two-panel-row .panel-block:first-child {
  border-right: 1px solid var(--color-border);
  padding-right: 40px;
}
.two-panel-row .panel-block:last-child {
  padding-left: 40px;
}

/* 饼图区域 */
.donut-layout {
  display: flex;
  align-items: center;
  gap: 24px;
}
.donut-chart-wrap {
  flex-shrink: 0;
  width: 140px;
  height: 140px;
}
.donut-legend {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--color-text-mid);
}
.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.legend-label { flex: 1; }
.legend-value { font-weight: 600; color: var(--color-text); }

/* 应用建议 */
.application-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}
.app-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 6px;
  background: var(--color-white);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  font-size: 14px;
  color: var(--color-text-mid);
  text-align: center;
  transition: box-shadow var(--transition);
}
.app-item:hover { box-shadow: var(--shadow-sm); }
.app-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-primary-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}
.app-icon svg { width: 22px; height: 22px; }
.app-icon-lg {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--color-primary-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}
.app-icon-lg svg { width: 32px; height: 32px; }

/* ============================================================
   05 推荐原料列表
   ============================================================ */
.ingredients-table-wrap {
  overflow-x: auto;
}
.ingredients-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.ingredients-table th {
  background: transparent;
  color: var(--color-text-light);
  padding: 10px 16px;
  text-align: left;
  font-weight: 500;
  font-size: 13px;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}
.ingredients-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
  line-height: 1.5;
  color: var(--color-text-mid);
  font-size: 14px;
}
.ingredients-table tbody tr:last-child td { border-bottom: none; }
.ingredients-table tbody tr:hover { background: #fafffe; }

.product-link {
  color: var(--color-primary-mid);
  font-weight: 500;
  transition: color var(--transition);
  text-decoration: none;
}
.product-link:hover { color: var(--color-primary); text-decoration: underline; }

/* ============================================================
   06-08 三栏区域
   ============================================================ */
.four-col-section {
  padding: 32px 0;
}
.four-col-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}
.col-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-border);
}
.col-num {
  font-size: 18px;
  font-weight: 800;
  color: #b7e4c7;
  line-height: 1;
}
.four-col-item h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
}

/* 配方工艺 */
.process-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0;
  margin: 0;
}
.process-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  min-width: 22px;
  background: var(--color-primary);
  color: var(--color-white);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.process-list p {
  font-size: 14px;
  color: var(--color-text-mid);
  line-height: 1.6;
  padding-top: 2px;
  margin: 0;
}

/* 稳定性测试 */
.stability-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0;
  margin: 0;
}
.stability-list li {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 14px;
  color: var(--color-text-mid);
  line-height: 1.5;
}
.s-check {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-primary-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.s-check svg { width: 10px; height: 10px; }

/* 包装与存储 */
.storage-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0;
  margin: 0;
}
.storage-list li {
  font-size: 14px;
  color: var(--color-text-mid);
  line-height: 1.6;
}
.storage-list li strong {
  color: var(--color-text);
  font-weight: 600;
  display: block;
  font-size: 12px;
  margin-bottom: 1px;
}

/* ============================================================
   底部 CTA 横幅
   ============================================================ */
.cta-banner {
  background-color: var(--color-bg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-top: 1px solid var(--color-border);
  padding: 32px 0;
  position: relative;
}
.cta-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
}
.cta-left { min-width: 200px; }
.cta-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 4px;
}
.cta-desc {
  font-size: 13px;
  color: var(--color-text-mid);
}
.cta-services {
  display: flex;
  gap: 28px;
  flex: 1;
  flex-wrap: wrap;
  justify-content: center;
}
.cta-service-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--color-text-mid);
  min-width: 100px;
  text-align: left;
}
.cta-service-item svg { width: 36px; height: 36px; flex-shrink: 0; }
.cta-service-item span {
  display: block;
  word-break: break-word;
  line-height: 1.4;
  font-size: 12px;
}
.cta-btn { margin-left: auto; }

/* ============================================================
   响应式适配
   ============================================================ */
@media (max-width: 1100px) {
  .ingredients-grid { grid-template-columns: repeat(3, 1fr); }
  .four-col-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .overview-layout { grid-template-columns: 1fr; }
  .overview-table-col {
    padding-right: 0;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 24px;
    margin-bottom: 24px;
  }
  .overview-right-col { padding-left: 0; }
  .two-panel-row { grid-template-columns: 1fr; }
  .two-panel-row .panel-block:first-child {
    border-right: none;
    padding-right: 0;
    border-bottom: 1px solid var(--color-border);
  }
  .two-panel-row .panel-block:last-child { padding-left: 0; }
  .application-grid { grid-template-columns: repeat(3, 1fr); }
  .anchor-nav-item { padding: 12px 14px; font-size: 13px; }
}

@media (max-width: 640px) {
  .ingredients-grid { grid-template-columns: repeat(2, 1fr); }
  .four-col-grid { grid-template-columns: 1fr; }
  .application-grid { grid-template-columns: repeat(2, 1fr); }
  .section-block { padding: 20px 0; }
  .four-col-section { padding: 20px 0; }
  .cta-inner { flex-direction: column; align-items: flex-start; }
  .cta-btn { margin-left: 0; }
}
