/* ==========================================================================
   鑫链五金 · 报价查询 — app.css v2
   方向 B（清爽商务）为主 + C 承诺带 + A 三色数据
   保留全部 JS 契约类名：.quote-table/.c-*/.qcard__*/.badge--*/.stat--*/.code/.v/.num/.muted
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
html, body { max-width: 100%; overflow-x: hidden; }
body {
  font-family: var(--font);
  font-size: 15px; line-height: 1.7; letter-spacing: .01em;
  color: var(--ink-2); background: var(--bg-page); min-height: 100vh;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
a { color: var(--info); text-decoration: none; }
a:hover { color: var(--brand); }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum'; }
.mono { font-family: var(--font-num); }
.muted { color: var(--ink-5); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

.page { max-width: var(--page); margin: 0 auto; padding: 0 24px 40px; }

/* ============================== 顶栏 ============================== */
.site-header { background: #fff; box-shadow: var(--sh-1); position: sticky; top: 0; z-index: 30; }
.site-header__inner { max-width: var(--page); margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand__logo { width: 40px; height: 40px; object-fit: contain; }
.brand__name { font-size: 16px; font-weight: 800; letter-spacing: .02em; color: var(--ink-1); white-space: nowrap; }
.brand__tag { font-size: 11px; color: var(--ink-4); letter-spacing: .4px; }
.header-meta { display: flex; align-items: center; gap: 14px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-4);
        background: var(--ok-bg); border: 1px solid var(--ok-line); padding: 5px 10px; border-radius: 999px; white-space: nowrap; }
.chip__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.chip--ok .chip__dot { background: var(--ok); }
.chip--warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }
.chip--warn .chip__dot { background: var(--warn); }
.chip--bad { background: var(--bad-bg); border-color: var(--bad-line); color: var(--bad); }
.chip--bad .chip__dot { background: var(--bad); }
.chip--ghost { display: none; }
.header-phone { background: var(--brand); color: #fff; font-size: 13px; font-weight: 800;
                padding: 9px 16px; border-radius: 999px; white-space: nowrap; }
.header-phone:hover { background: var(--brand-hov); color: #fff; }

/* ============================== 承诺带（C） ============================== */
.promise { background: #fff; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line); }
.promise__inner { max-width: var(--page); margin: 0 auto; padding: 0 24px; display: grid; grid-template-columns: repeat(4, 1fr); }
.promise__item { padding: 14px 18px 14px 0; border-right: 1px solid var(--line-soft); }
.promise__item:last-child { border-right: 0; }
.promise__item b { display: block; font-size: 13px; color: var(--ink-1); }
.promise__item span { font-size: 12px; color: var(--ink-4); }

/* ============================== 首屏 ============================== */
.hero { background: linear-gradient(120deg, #FFFFFF 58%, #FFF3F4 100%); border-radius: var(--r-lg);
        box-shadow: var(--sh-2); padding: 26px 28px 22px; margin: 22px 0 18px; }
.hero__title { font-size: 24px; font-weight: 800; line-height: 1.35; color: var(--ink-1); }
.hero__title em { font-style: normal; color: var(--brand); }
.hero__sub { margin-top: 6px; font-size: 13px; color: var(--ink-3); }
.hero__sub b { color: var(--brand); }

.search-form { display: flex; gap: 10px; margin-top: 16px; }
.search-field { flex: 1; display: flex; align-items: center; gap: 10px; background: #fff;
                border: 1.5px solid var(--line); border-radius: var(--r); padding: 0 12px;
                min-width: 0; transition: border-color .15s, box-shadow .15s; }
.search-field:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(217,32,47,.10); }
.search-field__icon { width: 18px; height: 18px; color: var(--ink-5); flex: none; }
.search-field input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; height: var(--ctl-h);
                      font-size: 15px; color: var(--ink-1); }
.search-field input::placeholder { color: var(--ink-5); }
.search-clear { border: 0; background: transparent; color: var(--ink-5); padding: 6px; display: none; }
.search-field.has-value .search-clear { display: inline-flex; }
.btn-search { border: 0; background: var(--brand); color: #fff; font-size: 16px; font-weight: 800;
              border-radius: var(--r); padding: 0 30px; height: var(--ctl-h); letter-spacing: .08em;
              box-shadow: 0 6px 16px rgba(217,32,47,.22); }
.btn-search:hover { background: var(--brand-hov); }
.btn-search:disabled { opacity: .6; cursor: not-allowed; box-shadow: none; }

.quick-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.quick-tags__label { font-size: 12px; color: var(--ink-4); margin-right: 2px; }
.tag { border: 1px solid var(--line); background: #fff; color: var(--ink-3); font-size: 12px;
       padding: 5px 11px; border-radius: 999px; }
.tag:hover { border-color: var(--brand); color: var(--brand); background: var(--bg-soft); }

/* ============================== 两栏布局 ============================== */
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 312px; gap: 18px; align-items: start; }
.cols__main { min-width: 0; }
.cols__side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 76px; }

/* ============================== 状态条 ============================== */
.state { display: none; }
.state.is-on { display: block; }
.state--loading { background: #fff; border-radius: var(--r); box-shadow: var(--sh-2); padding: 16px 18px; margin-bottom: 14px; }
.state__row { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); }
.state__timer { margin-left: auto; font-family: var(--font-num); color: var(--ink-4); font-size: 13px; }
.spinner { width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--brand);
           border-radius: 50%; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.progress { height: 3px; margin-top: 12px; background: var(--line-soft); border-radius: 999px; overflow: hidden; }
.progress::after { content: ''; display: block; width: 38%; height: 100%; border-radius: 999px;
                   background: linear-gradient(90deg, var(--brand), var(--brand-2)); animation: slide 1.4s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(320%); } }
.state--error { display: none; gap: 8px; align-items: flex-start; background: var(--bad-bg);
                border: 1px solid var(--bad-line); color: var(--bad); border-radius: var(--r);
                padding: 13px 16px; font-size: 14px; margin-bottom: 14px; }
.state--error.is-on { display: flex; }
.state--empty { background: #fff; border-radius: var(--r-lg); box-shadow: var(--sh-2); padding: 46px 24px;
                text-align: center; color: var(--ink-3); }
.state__icon { width: 44px; height: 44px; border-radius: 50%; background: var(--bg-soft); color: var(--brand);
               display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; }
.state--empty__title { font-size: 16px; font-weight: 700; color: var(--ink-1); margin-bottom: 6px; }
.state--empty__desc { font-size: 13px; color: var(--ink-4); max-width: 460px; margin: 0 auto; }

/* ============================== 结果卡 ============================== */
.quote { display: none; background: #fff; border-radius: var(--r-lg); box-shadow: var(--sh-2); overflow: hidden; }
.quote.is-on { display: block; }
.quote__head { display: flex; align-items: center; justify-content: space-between; gap: 14px;
               padding: 16px 18px; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.quote__title { font-size: 15px; font-weight: 800; color: var(--ink-1); }
.quote__head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stats { display: flex; flex-wrap: wrap; gap: 6px; }
.stat { font-size: 12px; color: var(--ink-3); background: var(--bg-hover); border-radius: 999px; padding: 4px 10px; }
.stat b { color: var(--ink-1); font-variant-numeric: tabular-nums; }
.stat--ok { background: var(--ok-bg); color: var(--ok); } .stat--ok b { color: var(--ok); }
.stat--bad { background: var(--bad-bg); color: var(--bad); } .stat--bad b { color: var(--bad); }
.stat--stock-in { background: var(--ok-bg); color: var(--ok); }
.stat--stock-order { background: var(--warn-bg); color: var(--warn); }
.stat--stock-none { background: var(--bad-bg); color: var(--bad); }
.btn { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700;
       border-radius: 10px; padding: 9px 14px; border: 1px solid transparent; }
.btn--primary { background: var(--brand); color: #fff; box-shadow: 0 4px 12px rgba(217,32,47,.20); }
.btn--primary:hover { background: var(--brand-hov); }
.btn--ghost { background: #fff; border-color: var(--line); color: var(--ink-3); }
.btn--ghost:hover { border-color: var(--brand); color: var(--brand); }

/* ---------- 表格视图 ---------- */
.table-scroll { overflow-x: auto; }
/* 固定表格布局 + 百分比列宽：任何宽度下都完整显示，不再需要左右拖动 */
.quote-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px;
               table-layout: fixed; min-width: 0; }
.quote-table th { text-align: left; font-size: 11px; font-weight: 700; color: var(--ink-4);
                  letter-spacing: .03em; background: var(--bg-hover); padding: 9px 7px;
                  border-bottom: 1px solid var(--line); white-space: normal; line-height: 1.35; }
.quote-table td { padding: 10px 7px; border-bottom: 1px solid var(--line-soft);
                  vertical-align: top; overflow-wrap: anywhere; }
.quote-table tr:last-child td { border-bottom: 0; }
.quote-table tbody tr:hover td { background: var(--bg-hover); }
/* 列宽合计 100%：插入「图片」列后重新分配（2026-09-26） */
.c-seq { width: 3.5%; } .c-name { width: 12%; } .c-spec { width: 15%; min-width: 0; }
.c-img { width: 5%; } .c-code { width: 8%; } .c-unit { width: 4%; } .c-stock { width: 7%; }
.c-qty { width: 4.5%; } .c-price { width: 9%; } .c-total { width: 9%; }
.c-note { width: 23%; min-width: 0; font-size: 12px; }
/* 商品缩略图（2026-09-26 加）：表格 44px、手机卡片 64px；点开看原图 */
.thumb { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
         border: 1px solid var(--line); border-radius: 6px; background: #fff; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.thumb--card { width: 64px; height: 64px; }
.thumb--miss { border-style: dashed; border-color: var(--line-in); background: var(--bg-hover); }
.thumb--miss::after { content: "无图"; font-size: 10px; color: var(--ink-5); }
.c-spec__badge { margin-top: 5px; }
.qcard__badge { margin-top: 5px; }
.seq-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px;
             border-radius: 6px; background: var(--bg-hover); color: var(--ink-4); font-size: 12px; font-weight: 700; }
.code { color: var(--info); font-family: var(--font-num); font-size: 12px; cursor: pointer; }
.code.is-copied { color: var(--ok); }
.v { font-weight: 700; color: var(--ink-1); font-variant-numeric: tabular-nums; }
.c-price .v { color: var(--brand); font-size: 14px; }
.c-total .v { color: var(--ink-1); }
.c-note { font-size: 12px; color: var(--ink-4); }
tr.r-bad td { background: var(--bad-bg); }
tr.r-bad .c-price .v, tr.r-bad .c-total .v { color: var(--bad); }
tr.r-warn td { background: #FFFCF5; }

/* ---------- 三色徽章（A） ---------- */
.badge { display: inline-flex; align-items: center; font-size: 11px; font-weight: 800; padding: 3px 8px;
         border-radius: 999px; border: 1px solid transparent; white-space: nowrap; }
.badge--ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.badge--near { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }
.badge--warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }
.badge--bad { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-line); }

/* ---------- 卡片视图（移动端） ---------- */
.cards { display: none; padding: 12px; }
.qcard { border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin-bottom: 10px; background: #fff; }
.qcard:last-child { margin-bottom: 0; }
.qcard--bad { background: var(--bad-bg); border-color: var(--bad-line); }
.qcard--warn { background: #FFFCF5; border-color: var(--warn-line); }
.qcard__head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.qcard__head > div:first-child { min-width: 0; }
.qcard__head .qcard__price { flex: none; }
.qcard__name { font-size: 14px; font-weight: 700; color: var(--ink-1); }
.qcard__name, .qcard__note { overflow-wrap: anywhere; }
.qcard__price { text-align: right; white-space: nowrap; }
.qcard__price .p { color: var(--brand); font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.qcard__price .p--none { color: var(--ink-5); font-size: 15px; }
.qcard__price .t { display: block; font-size: 11px; color: var(--ink-4); }
.qcard__body { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin-top: 10px; }
.qcard__cell { min-width: 0; }
.qcard__cell--full { grid-column: 1 / -1; }
.qcard__k { font-size: 11px; color: var(--ink-5); }
.qcard__v { font-size: 13px; color: var(--ink-2); word-break: break-all; }
.qcard__note { font-size: 12px; color: var(--ink-4); line-height: 1.6; }
.qcard__body .l { font-size: 12px; color: var(--ink-4); }

.quote__foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap;
               padding: 12px 18px; border-top: 1px solid var(--line-soft); background: var(--bg-hover);
               font-size: 12px; color: var(--ink-4); }
.quote__foot b { color: var(--brand); }

/* ============================== 右栏：批量报价 + 微信 ============================== */
.side-card { background: #fff; border-radius: var(--r-lg); box-shadow: var(--sh-2); overflow: hidden;
             border: 1.5px dashed transparent; transition: border-color .15s, box-shadow .15s; }
.side-card:hover, .side-card:focus-visible { border-color: var(--brand); box-shadow: var(--sh-3); }
.side-card__head { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 16px 8px; }
.side-card__head b { font-size: 14px; color: var(--ink-1); }
.side-card__head em { font-style: normal; font-size: 11px; color: var(--ink-5); }
.side-card__body { padding: 0 16px 16px; }
.drop { border: 1.5px dashed var(--line-in); border-radius: var(--r); padding: 20px 14px; text-align: center;
        background: var(--bg-hover); color: var(--ink-3); }
.drop svg { margin: 0 auto 8px; color: var(--brand); }
.drop b { display: block; font-size: 14px; color: var(--ink-1); }
.drop span { display: block; font-size: 12px; margin-top: 3px; }
.drop em { display: block; font-style: normal; font-size: 11px; color: var(--ink-5); margin-top: 8px; }
.side-card__formats { margin-top: 10px; font-size: 11px; color: var(--ink-5); text-align: center; letter-spacing: .04em; }

.side-wechat { background: var(--ink-1); color: #fff; border-radius: var(--r-lg); padding: 16px;
               display: flex; gap: 14px; align-items: center; box-shadow: var(--sh-2); }
.side-wechat__qr { width: 108px; height: 108px; border-radius: 10px; background: #fff; padding: 4px; flex: none; }
.side-wechat__text b { font-size: 14px; }
.side-wechat__text p { font-size: 12px; color: #D0D5DD; margin-top: 3px; }
.side-wechat__name { color: #fff !important; font-weight: 700; }
.side-wechat__hint { color: var(--brand-2) !important; }

/* ============================== 页脚 ============================== */
.site-footer { background: #fff; border-top: 1px solid var(--line); margin-top: 10px; }
.site-footer__inner { max-width: var(--page); margin: 0 auto; padding: 18px 24px; display: flex;
                      justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer__left { display: flex; gap: 10px; align-items: center; }
.site-footer__logo { width: 28px; height: 28px; object-fit: contain; opacity: .9; }
.site-footer__line { font-size: 12px; color: var(--ink-3); }
.site-footer__muted { color: var(--ink-5); }
.site-footer__right { text-align: right; }

/* ============================== Toast ============================== */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 12px); opacity: 0;
         background: var(--ink-1); color: #fff; font-size: 13px; padding: 10px 18px; border-radius: 999px;
         box-shadow: var(--sh-3); pointer-events: none; transition: opacity .18s, transform .18s; z-index: 90; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ============================== 响应式 ============================== */
@media (max-width: 1080px) {
  .cols { grid-template-columns: 1fr; }
  .cols__side { position: static; flex-direction: row; }
  .cols__side > * { flex: 1; }
}
@media (max-width: 860px) {
  /* 手机端：一律单列、禁止任何横向溢出（表格改卡片视图） */
  .cols, .cols__main, .cols__side { display: block !important; width: auto !important; }
  .cols__side { position: static; }
  .cols__side > * { width: auto; }
  .table-scroll, .quote-table { display: none !important; }
  .cards { display: block !important; }
  .page { padding: 0 14px 28px; }
  .site-header__inner { padding: 10px 14px; }
  .brand__logo { width: 34px; height: 34px; }
  .brand__text { min-width: 0; }
  .brand__name { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .brand__tag { display: none; }
  .header-meta { flex: none; }
  .header-meta .chip { display: none; }          /* 手机上状态 chip 让位给电话按钮 */
  .header-meta .header-link { display: none; }      /* 手机上顶栏只留电话，其余入口在页脚 */
  .header-phone { font-size: 11.5px; padding: 7px 11px; }
  .promise__inner { grid-template-columns: 1fr 1fr; padding: 0 14px; }
  .promise__item { padding: 10px 12px 10px 0; }
  .promise__item:nth-child(2) { border-right: 0; }
  .hero { padding: 18px 16px; border-radius: var(--r); }
  .hero__title { font-size: 19px; }
  .search-form { flex-direction: column; }
  .btn-search { width: 100%; padding: 13px 0; height: 46px; }
  .table-scroll { display: none; }
  .cards { display: block; }
  .cols__side { flex-direction: column; }
  .side-wechat__qr { width: 96px; height: 96px; }
  .side-wechat { flex-wrap: wrap; }
  .side-card__head, .drop { padding-left: 12px; padding-right: 12px; }
  .quote__head { padding: 14px; }
  .quote__foot { flex-direction: column; }
  .site-footer__right { text-align: left; }
  /* 空状态：手机端改竖向堆叠，避免标题被挤成竖排（app.js 会设 display:flex） */
  .state--empty { flex-direction: column; align-items: center; padding: 30px 16px; }
  .state--empty__title { white-space: nowrap; }
  .state--empty__desc { max-width: 100%; }
}
/* hidden 属性：保持初始隐藏，且不用内联 style（避免被判隐藏文本）；JS 用内联 style 覆盖来显示 */
.btn[hidden] { display: none; }
/* ================= 无障碍修复（2026-10-01，依据 Lighthouse 报告） ================= */
/* 1）小字浅灰对比度不足（#98A2B3 白底约 2.9:1，未达 AA 4.5:1）→ 换成 #667085（约 4.9:1） */
.side-card__head em,
.side-card__formats,
.drop em,
.site-footer__muted { color: var(--ink-4); }
/* 2）链接不能只靠颜色区分（WCAG 1.4.1）→ 页脚与新增区块的链接加下划线 */
.site-footer__line a,
.fsx a { text-decoration: underline; text-underline-offset: 2px; }
/* 3）触摸目标太小（WCAG 2.5.8 要求 >=24x24px）→ 页脚电话链接加内边距 */
.site-footer__right .site-footer__line a { display: inline-block; padding: 4px 2px; }