/* =========================================================
   bento.css — 首页 Bento 流重排（覆盖层，最后加载）
   依赖 theme-dark.css 的深色令牌
   ========================================================= */

/* =========================================================
   五处修复（2026-09-13）
   ========================================================= */

/* ---- 修复①：产品卡 View More / Save 按钮挨太紧 ---- */
.product-card .card-body {
  display: flex; flex-direction: column; align-items: center;
  padding: 0 18px 22px;
}
.product-card .card-body > a,
.product-card .card-body > button.mini-action {
  display: inline-flex; align-items: center; justify-content: center;
  margin: 0 !important;
  padding: 8px 18px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition: all .2s ease;
}
.product-card .card-body > a {
  margin-top: 6px !important;
  color: #22d3ee !important;
  border: 1px solid rgba(34, 211, 238, .4);
  background: rgba(34, 211, 238, .08);
}
.product-card .card-body > a:hover { background: rgba(34, 211, 238, .2); border-color: #22d3ee; }
.product-card .card-body > button.mini-action {
  margin-top: 9px !important;
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, .4);
  background: rgba(139, 92, 246, .09);
  cursor: pointer;
  min-width: 96px;
}
.product-card .card-body > button.mini-action:hover { background: rgba(139, 92, 246, .22); border-color: #8b5cf6; }

/* 无 card-body 结构的变体（styles.css 风格） */
.product-card > a:not(:first-child), .product-card > button.mini-action {
  display: inline-flex; align-items: center; justify-content: center;
  margin: 8px 12px 22px !important;
  padding: 8px 18px; border-radius: 9px;
  font-size: 12.5px; font-weight: 600;
}

/* ---- 修复②：分类卡网格末行留白 ---- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  align-items: stretch;
}
.category-grid > * { display: flex; }
.category-grid .category-card { width: 100%; }

/* ---- 修复③：对比表手机端横向滞动 ---- */
.compare-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 14px;
  border: 1px solid rgba(80, 120, 180, .2);
  background: rgba(11, 17, 30, .72);
  scrollbar-width: thin;
  scrollbar-color: rgba(34, 211, 238, .45) transparent;
}
.compare-wrap::-webkit-scrollbar { height: 8px; }
.compare-wrap::-webkit-scrollbar-track { background: rgba(255, 255, 255, .04); border-radius: 999px; }
.compare-wrap::-webkit-scrollbar-thumb { background: rgba(34, 211, 238, .42); border-radius: 999px; }
.compare-wrap::-webkit-scrollbar-thumb:hover { background: rgba(34, 211, 238, .68); }

/* ---- 修复④：对比表分类筛选按钮——深色化 ---- */
.compare-filter { display: flex; flex-wrap: wrap; gap: 9px; margin: 0 0 22px; }
.compare-filter a {
  padding: 8px 17px;
  border-radius: 999px;
  border: 1px solid rgba(80, 120, 180, .26);
  background: rgba(18, 28, 46, .8);
  color: #a9bdd1;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all .2s ease;
}
.compare-filter a:hover {
  border-color: rgba(34, 211, 238, .55);
  background: rgba(34, 211, 238, .1);
  color: #bdeaf5;
}
.compare-filter a.active {
  background: linear-gradient(135deg, #22d3ee, #8b5cf6);
  border-color: transparent;
  color: #05121b;
  font-weight: 700;
  box-shadow: 0 6px 18px -8px rgba(34, 211, 238, .7);
}

/* ---- 修复⑤：评价区小标题 + 人名对比度 ---- */
.fb-head h3 { color: #e8f2fa; font-weight: 700; }
.fb-head p { color: #9fb3c8; }
.fb-col figure {
  background: rgba(14, 22, 38, .82);
  border: 1px solid rgba(80, 120, 180, .18);
}
.fb-b2c figure { background: rgba(12, 19, 33, .82); }
.fb-col figure:hover { border-color: rgba(139, 92, 246, .45); box-shadow: 0 8px 26px -14px rgba(139, 92, 246, .5); }
.fb-col blockquote { color: #dbe8f4; }
.fb-col figcaption strong { color: #e8f2fa; font-weight: 700; }
.fb-col figcaption span { color: #9fb3c8; }

/* ---- 修复⑥：trust-strip 末行留白 + 深色化 ---- */
.trust-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: rgba(80, 120, 180, .18);
  border: 1px solid rgba(80, 120, 180, .18);
  border-radius: 14px;
  overflow: hidden;
}
.trust-strip > div {
  background: rgba(12, 19, 33, .9);
  transition: background .2s ease;
}
.trust-strip > div:hover { background: rgba(20, 31, 52, .95); }
@media (max-width: 1080px) {
  .trust-strip { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .trust-strip { grid-template-columns: 1fr; }
}

/* ---------- 产品卡排版对齐修正 ---------- */
.bn-featured .product-card,
.product-grid .product-card { text-align: center; }
.bn-featured .product-card .card-body,
.product-grid .product-card .card-body { padding: 0 18px 20px; text-align: center; }
.bn-featured .product-card h3,
.product-grid .product-card h3 { margin: 18px 16px 8px; text-align: center; }
.bn-featured .product-card p,
.product-grid .product-card p { margin: 0 16px 16px; text-align: center; }
.bn-featured .product-card .pill,
.product-grid .product-card .pill { margin: 16px 0 2px; }
.bn-featured .product-card a,
.product-grid .product-card a { margin: 0 0 20px; }

/* ---------- 通用 Bento 容器 ---------- */
.bn-wrap { padding-top: 4px; }
.bn-wrap-head { margin-bottom: 26px; }

.bento {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: minmax(96px, auto);
  gap: 16px;
}

.bn {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 24px;
  border-radius: 18px;
  background: linear-gradient(158deg, rgba(20, 30, 50, .92) 0%, rgba(11, 17, 30, .96) 100%);
  border: 1px solid rgba(80, 120, 180, .18);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .035) inset, 0 18px 40px -28px rgba(0, 0, 0, .9);
  overflow: hidden;
  transition: border-color .25s ease, transform .25s ease, box-shadow .25s ease;
}
.bn::before {
  content: "";
  position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(34, 211, 238, .5), rgba(139, 92, 246, .5), transparent);
  opacity: .75;
}
.bn:hover {
  border-color: rgba(34, 211, 238, .38);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .05) inset, 0 24px 56px -30px rgba(34, 211, 238, .45);
}

.bn-tag {
  margin: 0 0 12px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .17em;
  text-transform: uppercase;
  color: #22d3ee;
}
.bn h3 {
  margin: 0 0 10px;
  font-size: 21px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -.015em;
  color: #eef5fb;
}
.bn-desc { margin: 0 0 16px; font-size: 14px; line-height: 1.6; color: #9fb3c8; }

/* ---------- 网格占位（显式锁定位置，避免自动流错位） ---------- */
.bn-query   { grid-column: 1 / span 5;  grid-row: 1 / span 2; }
.bn-stats   { grid-column: 6 / span 7;  grid-row: 1; }
.bn-paths   { grid-column: 6 / span 7;  grid-row: 2 / span 2; }
.bn-cert    { grid-column: 1 / span 5;  grid-row: 3 / span 2; }
.bn-reports { grid-column: 6 / span 7;  grid-row: 4 / span 2; }
.bn-method  { grid-column: 1 / span 12; grid-row: 6; }

/* ---------- 1) 查询卡 ---------- */
.bn-query { justify-content: center; background: linear-gradient(150deg, rgba(24, 38, 62, .95), rgba(10, 16, 28, .97)); }
.bn-query h3 { margin-bottom: 18px; }
.bn-query .bn-chips { margin-top: 16px; padding-top: 0; }
.bn-form { display: flex; gap: 10px; margin-top: 4px; }
.bn-form input {
  flex: 1 1 auto; min-width: 0;
  height: 48px; padding: 0 16px;
  border-radius: 11px;
  border: 1px solid rgba(90, 130, 190, .3);
  background: rgba(6, 11, 20, .85);
  color: #eaf3fb;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 13.5px;
}
.bn-form input::placeholder { color: #6d829a; }
.bn-form input:focus { outline: none; border-color: #22d3ee; box-shadow: 0 0 0 3px rgba(34, 211, 238, .16); }
.bn-form .button { flex: 0 0 auto; height: 48px; padding: 0 22px; }
.bn-sample { margin-top: 14px; }
.bn-chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 16px; font-size: 12.5px; color: #7b8ea6; }
.bn-query .bn-form { margin-top: 0; }
.bn-query .bn-sample { margin-top: 12px; }
.bn-query h3 { margin-bottom: 14px; }
.bn-chips .ev-chip {
  padding: 5px 12px; border-radius: 999px;
  border: 1px solid rgba(90, 130, 190, .32);
  background: rgba(34, 211, 238, .07);
  color: #8fd8ea; font-family: 'JetBrains Mono', monospace; font-size: 11.5px;
  cursor: pointer; transition: all .2s ease;
}
.bn-chips .ev-chip:hover { background: rgba(34, 211, 238, .16); border-color: #22d3ee; color: #c8eef8; }

/* ---------- 2) 指标卡 ---------- */
.bn-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 0; padding: 0;
}
.bn-stat {
  display: flex; flex-direction: column; justify-content: center; gap: 6px;
  padding: 22px 20px;
  border-right: 1px solid rgba(80, 120, 180, .14);
}
.bn-stat:last-child { border-right: 0; }
.bn-stat strong {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 34px; line-height: 1; font-weight: 600;
  color: #eef5fb; letter-spacing: -.02em;
}
.bn-stat span {
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: #8ba0b8; line-height: 1.35;
}
.bn-stat-live strong { font-size: 23px; color: #22d3ee; }
.bn-stat-live { position: relative; }
.bn-stat-live::after {
  content: ""; position: absolute; top: 22px; right: 20px;
  width: 7px; height: 7px; border-radius: 50%;
  background: #22d3ee; box-shadow: 0 0 0 4px rgba(34, 211, 238, .16);
  animation: bnPulse 2.2s ease-in-out infinite;
}
@keyframes bnPulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

/* ---------- 3) 双通道卡 ---------- */
.bn-paths { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 18px; align-content: stretch; }
.bn-path {
  display: flex; flex-direction: column; gap: 8px;
  padding: 22px 20px; border-radius: 14px;
  background: rgba(9, 15, 26, .7);
  border: 1px solid rgba(80, 120, 180, .16);
  text-decoration: none;
  transition: all .25s ease;
}
.bn-path:hover { border-color: rgba(139, 92, 246, .45); background: rgba(16, 24, 42, .85); transform: translateY(-2px); }
.bn-path-tag {
  align-self: flex-start;
  padding: 4px 10px; border-radius: 999px;
  background: linear-gradient(90deg, rgba(139, 92, 246, .24), rgba(34, 211, 238, .16));
  color: #c4b5fd;
  font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase;
}
.bn-path strong { font-size: 18px; color: #eef5fb; letter-spacing: -.01em; }
.bn-path-desc { font-size: 13px; line-height: 1.55; color: #93a8bf; }
.bn-path { justify-content: center; }
.bn-path-tag { align-self: flex-start; }
.bn-path-cta { margin-top: 14px; padding-top: 10px; border-top: 1px solid rgba(80,120,180,.16); font-size: 13.5px; font-weight: 600; color: #22d3ee; }
.bn-path:hover .bn-path-cta { color: #7dd3fc; }

/* ---------- 4) 文档卡 ---------- */
.bn-list { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.bn-cert { align-content: start; }
.bn-reports { align-content: start; }
.bn-list li { display: flex; flex-direction: column; gap: 2px; padding-left: 18px; position: relative; }
.bn-list li::before {
  content: ""; position: absolute; left: 0; top: 7px;
  width: 6px; height: 6px; border-radius: 2px;
  background: linear-gradient(135deg, #22d3ee, #8b5cf6);
}
.bn-list strong { font-size: 13.5px; font-weight: 600; color: #dbe8f4; }
.bn-list span { font-size: 12.5px; color: #8ba0b8; }
.bn-cert .button { align-self: flex-start; margin-top: auto; }

/* ---------- 5) 报告缩略图 ---------- */
.bn-reports-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.bn-reports-head a { font-size: 12.5px; font-weight: 600; color: #22d3ee; text-decoration: none; }
.bn-reports-head .bn-tag { margin-bottom: 0; }
.bn-report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.bn-report {
  display: flex; flex-direction: column; gap: 7px;
  padding: 9px; border-radius: 11px;
  background: rgba(9, 15, 26, .72);
  border: 1px solid rgba(80, 120, 180, .16);
  text-decoration: none;
  transition: all .22s ease;
}
.bn-report:hover { border-color: rgba(34, 211, 238, .45); transform: translateY(-2px); }
.bn-report img {
  width: 100%; height: 130px; object-fit: contain; object-position: center;
  border-radius: 7px; background: #0d1524;
}
.bn-report span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px; letter-spacing: .03em;
  color: #9fb3c8; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---------- 6) 方法横条 ---------- */
.bn-method { padding: 22px 24px 24px; }
.bn-method-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.bn-method-head h3 { margin: 0; }
.bn-method-head .bn-tag { margin-bottom: 8px; }
.bn-method-head a { font-size: 13px; font-weight: 600; color: #22d3ee; text-decoration: none; white-space: nowrap; }
.bn-method-track { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.bn-method-step {
  position: relative;
  display: flex; flex-direction: column; gap: 7px;
  padding: 14px; border-radius: 13px;
  background: rgba(9, 15, 26, .66);
  border: 1px solid rgba(80, 120, 180, .14);
  transition: all .25s ease;
}
.bn-method-step:hover { border-color: rgba(34, 211, 238, .35); transform: translateY(-2px); }
.bn-method-step > span {
  position: absolute; top: 12px; right: 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 20px; font-weight: 600;
  color: rgba(139, 92, 246, .35);
}
.bn-method-step img { width: 100%; height: 96px; object-fit: cover; border-radius: 9px; }
.bn-method-step strong { font-size: 14px; color: #e6eff8; }
.bn-method-step p { margin: 0; font-size: 12.5px; line-height: 1.5; color: #8ba0b8; }

/* ---------- 收尾区：FAQ + 技术笔记并排 ---------- */
.bn-tail { display: grid; grid-template-columns: 1.15fr 1fr; gap: 28px; align-items: start; }
.bn-tail-col > .section, .bn-tail-col > section { padding-top: 0; padding-bottom: 0; }
.bn-tail .faq-list { max-width: none; }
.bn-tail .blog-grid { grid-template-columns: 1fr; }

/* ---------- 区块节奏统一 ---------- */
.bn-shelf-section, .bn-featured, .bn-cats, .bn-about, .bn-tail { padding-top: 68px; padding-bottom: 68px; }
.bn-about { display: grid; grid-template-columns: 1fr 1.1fr; gap: 44px; align-items: center; }
.bn-about .about-image img { width: 100%; border-radius: 18px; }

/* ---------- 响应式 ---------- */
@media (max-width: 1180px) {
  .bn-query   { grid-column: 1 / span 12; grid-row: auto; }
  .bn-stats   { grid-column: 1 / span 12; grid-row: auto; }
  .bn-paths   { grid-column: 1 / span 12; grid-row: auto; }
  .bn-cert    { grid-column: 1 / span 7;  grid-row: auto; }
  .bn-reports { grid-column: 8 / span 5;  grid-row: auto; }
  .bn-method  { grid-column: 1 / span 12; grid-row: auto; }
  .bn-duo, .bn-tail, .bn-about { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .bn-tail { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .bn-cert, .bn-reports { grid-column: 1 / span 12 !important; }
  .bn-stats { grid-template-columns: 1fr 1fr; }
  .bn-stat { border-bottom: 1px solid rgba(80, 120, 180, .14); }
  .bn-stat:nth-child(2n) { border-right: 0; }
  .bn-paths { grid-template-columns: 1fr; }
  .bn-method-track { grid-template-columns: 1fr 1fr; }
  .bn-report-grid { grid-template-columns: 1fr 1fr; }
  .bn-form { flex-direction: column; }
  .bn-form .button { width: 100%; }
}
@media (max-width: 560px) {
  .bn { padding: 18px; border-radius: 15px; }
  .bn-stats, .bn-method-track, .bn-report-grid { grid-template-columns: 1fr; }
  .bn-method-head { flex-direction: column; align-items: flex-start; }

  /* 产品/分类卡：手机端降为 2 列 */
  .product-grid, .category-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 12px !important; }
  .product-card h3 { font-size: 15px; }
  .product-card .card-body p { font-size: 12.5px; line-height: 1.5; }
  .blog-grid { grid-template-columns: 1fr !important; }
}
@media (max-width: 420px) {
  /* 小屏手机（≤420px）：产品/分类卡保持 2 列（原为 1 列，用户要求改两行排布） */
  .product-grid, .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }
  /* 2 列下收紧卡片内边距与字号，避免拥挤 */
  .product-grid .product-card .card-body,
  .bn-featured .product-card .card-body { padding: 0 10px 14px; }
  .product-grid .product-card h3,
  .bn-featured .product-card h3 { margin: 12px 8px 6px; font-size: 14px; }
  .product-grid .product-card p,
  .bn-featured .product-card p { margin: 0 8px 12px; font-size: 11.5px; line-height: 1.45; }
  .product-grid .product-card .pill,
  .bn-featured .product-card .pill {
    margin: 12px 0 2px;
    font-size: 10.5px;
    padding: 3px 7px;
    white-space: normal;          /* 允许换行，长分类名不截断 */
    line-height: 1.3;
    text-align: center;
    max-width: 100%;
    overflow-wrap: break-word;
  }
  .product-grid .product-card a,
  .bn-featured .product-card a { margin: 0 0 14px; font-size: 12.5px; }
  /* 产品图：2 列下统正方形容器，避免高度悬殊 */
  .product-grid .product-card img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: contain;
  }
  /* 底部留出空间，避免右下角卡片被 WhatsApp 悬浮按钮遮挡 */
  .product-grid { padding-bottom: 130px; }
}

/* 手机端（≤780px）产品区同样给悬浮按钮留位 */
@media (max-width: 780px) {
  .product-grid { padding-bottom: 130px; }
}
