/* ==========================================================================
   采购商版首页（行情 + 选品）专属样式
   只被 home.html 引用；底色与令牌继承 mobile.css 的角色主题层
   ========================================================================== */

.by-body {
  background: var(--m-deep);
}

/* ---------- 深色行情头部 ---------- */
.by-hero {
  position: relative;
  padding: 4px 16px 22px;
  color: #fff;
  background: linear-gradient(135deg, var(--m-deep) 0%, var(--m-deep-2) 64%, var(--m-deep-3) 132%);
  overflow: hidden;
}

.by-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: linear-gradient(120deg, rgba(0, 0, 0, 0.9), transparent 76%);
  mask-image: linear-gradient(120deg, rgba(0, 0, 0, 0.9), transparent 76%);
}

.by-hero > * {
  position: relative;
  z-index: 1;
}

/* 搜索条 */
.by-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  margin: 10px 0 14px;
  padding: 0 6px 0 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.by-search__ic {
  flex: none;
  display: inline-flex;
  color: rgba(255, 255, 255, 0.82);
}

.by-search__ph {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.66);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.by-search__btn {
  flex: none;
  height: 28px;
  padding: 0 14px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  font-size: 12.5px;
  font-weight: 500;
  color: #fff;
  background: linear-gradient(135deg, #f5772e, var(--m-accent));
  box-shadow: 0 8px 16px -10px rgba(var(--m-accent-rgb), 0.95);
}

/* 指数主卡 */
.by-idx {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.11);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.by-idx__top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.by-idx__n {
  font-size: 13.5px;
  font-weight: 500;
}

.by-idx__live {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 18px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 10.5px;
  color: #b6f2cd;
  background: rgba(22, 163, 74, 0.26);
  box-shadow: inset 0 0 0 1px rgba(134, 239, 172, 0.3);
}

.by-idx__live i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.24);
}

.by-idx__per {
  margin-left: auto;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
}

.by-idx__v {
  margin-top: 6px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.by-idx__v b {
  font-family: var(--bf-font-number);
  font-variant-numeric: tabular-nums;
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.8px;
  line-height: 38px;
}

.by-idx__v span {
  font-family: var(--bf-font-number);
  font-size: 13px;
  font-weight: 500;
}

.by-idx__chart {
  margin-top: 8px;
  height: 54px;
}

.by-idx__fact {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  text-align: center;
}

.by-idx__fv {
  font-family: var(--bf-font-number);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 600;
  line-height: 18px;
}

.by-idx__fl {
  margin-top: 1px;
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.6);
}

/* 实时报价跑马灯 */
.by-tickwrap {
  margin: 14px -16px 0;
  padding: 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.by-tickwrap__inner {
  display: flex;
  gap: 22px;
  width: max-content;
  animation: byTick 26s linear infinite;
}

@keyframes byTick {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.by-tick {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  white-space: nowrap;
}

.by-tick__n {
  color: rgba(255, 255, 255, 0.7);
}

.by-tick__p {
  font-family: var(--bf-font-number);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: #fff;
}

.by-tick__c {
  font-family: var(--bf-font-number);
  font-size: 11.5px;
}

/* ---------- 浅色卡纸 ---------- */
.by-sheet {
  position: relative;
  margin-top: -14px;
  padding: 14px 0 6px;
  border-radius: 18px 18px 0 0;
  background: #f5f7fb;
}

.by-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 16px 12px;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 12.5px;
  color: #8a3d05;
  background: linear-gradient(135deg, #fff3e8, #ffe2cd);
  box-shadow: inset 0 0 0 1px rgba(232, 89, 12, 0.16);
}

.by-notice__ic {
  flex: none;
  display: inline-flex;
  color: var(--m-accent);
}

.by-notice__tx {
  min-width: 0;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.by-notice__go {
  flex: none;
  display: inline-flex;
  color: rgba(138, 61, 5, 0.6);
}

/* 区块外距 */
.by-sec {
  margin: 0 16px 16px;
}

/* 快捷采购入口宫格 */
.by-qa {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px 0;
  padding: 12px 4px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(15, 32, 64, 0.06);
  box-shadow:
    0 1px 2px rgba(15, 32, 64, 0.05),
    0 12px 26px -20px rgba(15, 32, 64, 0.32);
}

.by-qa__i {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: rgba(0, 0, 0, 0.72);
  position: relative;
}

.by-qa__badge {
  position: absolute;
  top: -3px;
  right: 50%;
  margin-right: -26px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--bf-font-number);
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  background: var(--m-accent);
}

/* 需求广场条目 */
.by-d {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(15, 32, 64, 0.05);
}

.by-d:last-child {
  border-bottom: none;
}

.by-d__b {
  min-width: 0;
  flex: 1;
}

.by-d__t {
  font-size: 13.5px;
  line-height: 19px;
  font-weight: 500;
}

.by-d__m {
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: rgba(0, 0, 0, 0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.by-d__q {
  margin-top: 5px;
  font-size: 11.5px;
  color: rgba(0, 0, 0, 0.62);
}

.by-d__q b {
  font-family: var(--bf-font-number);
  font-weight: 600;
  color: rgba(0, 0, 0, 0.86);
}

.by-d__go {
  flex: none;
  height: 28px;
  padding: 0 12px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--m-accent);
  background: rgba(var(--m-accent-rgb), 0.1);
  box-shadow: inset 0 0 0 1px rgba(var(--m-accent-rgb), 0.18);
}

/* 资讯条目 */
.by-news {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(15, 32, 64, 0.05);
}

.by-news:last-child {
  border-bottom: none;
}

.by-news__d {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--m-primary-ink);
  background: linear-gradient(135deg, var(--m-soft), var(--m-soft-2));
  box-shadow: inset 0 0 0 1px rgba(var(--m-primary-rgb), 0.1);
}

.by-news__dd {
  font-family: var(--bf-font-number);
  font-variant-numeric: tabular-nums;
  font-size: 16px;
  font-weight: 600;
  line-height: 20px;
}

.by-news__dm {
  font-size: 10px;
  color: rgba(0, 0, 0, 0.45);
}

.by-news__b {
  min-width: 0;
  flex: 1;
}

.by-news__t {
  font-size: 13.5px;
  line-height: 19px;
  font-weight: 500;
}

.by-news__m {
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: rgba(0, 0, 0, 0.5);
}

.by-foot {
  margin: 6px 16px;
  text-align: center;
  font-size: 11px;
  line-height: 17px;
  color: rgba(0, 0, 0, 0.34);
}

/* span 版块需要显式成块，才能纵向堆叠 */
.by-d__b,
.by-d__t,
.by-d__m,
.by-d__q {
  display: block;
}

.by-news__b,
.by-news__t,
.by-news__m {
  display: block;
}

.by-news__d {
  display: flex;
}

.by-news__m {
  display: flex;
  align-items: center;
  gap: 6px;
}
