/* ============================================================
   n14-view.css — v14 草稿「产品主区三视图」接入正式页（2026-11-11）
   复刻 展示方案样稿_v14.html 的 Gallery / Squares / Images 视觉参数。
   生产 #catalog 保留为选择 / 价格 / 数量 / 导出的唯一状态源，仅视觉隐藏。
   所有选择器限定 #n14Main，不污染生产 CSS。
   ============================================================ */

/* 生产表格：保留 DOM 与全部事件，只隐藏视觉 */
#catalog.n14-src { display:none !important; }

#n14Main { min-height:200px; }
.n14-loading { padding:40px; text-align:center; color:#8892a4; font-size:13px; }
.n14-viewhead { display:flex; align-items:center; gap:10px; margin:0 0 10px; flex-wrap:wrap; }
.n14-viewhead b { font-size:15px; color:#00185A; letter-spacing:.02em; }
.n14-viewhead span { font-size:11.5px; color:#667085; }

/* ---------- Gallery：4 列板块级大卡（草稿 .grid / .card） ---------- */
.n14-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; }
.n14-card {
  background:#fff; border:1px solid #e3e7ee; border-radius:8px; overflow:hidden;
  position:relative; transition:border-color .15s;
}
.n14-card:hover { border-color:#185FA5; }
.n14-card.sel { border:2px solid #00185A; }
.n14-card.sel::after {
  content:"SELECTED"; position:absolute; top:6px; right:6px; background:#00185A; color:#fff;
  font-size:9px; padding:2px 5px; border-radius:3px; z-index:2; letter-spacing:.04em;
}
.n14-imgbox {
  height:116px; background:#fafbfc; display:flex; align-items:center; justify-content:center;
  padding:6px; position:relative; cursor:zoom-in;
}
.n14-imgbox img { max-width:100%; max-height:100%; object-fit:contain; }
.n14-imgnum {
  position:absolute; right:6px; bottom:6px; background:rgba(0,24,90,.86); color:#fff;
  font-size:9px; padding:2px 6px; border-radius:9px; pointer-events:none; letter-spacing:.03em;
}
.n14-thumbs {
  display:flex; gap:3px; padding:4px 6px; overflow-x:auto; background:#fafbfc;
  border-top:1px solid #eef1f6; scrollbar-width:thin;
}
.n14-thumb {
  width:34px; height:34px; flex:none; border:1px solid #d5dce7; border-radius:4px;
  background:#fff; cursor:pointer; padding:2px; display:block;
}
.n14-thumb.on { border-color:#00185A; box-shadow:0 0 0 1px #00185A; }
.n14-thumb img { width:100%; height:100%; object-fit:contain; }
.n14-capline { font-size:9.5px; color:#667085; height:27px; line-height:1.35; overflow:hidden; padding:4px 9px 0; }
.n14-cbody { padding:7px 9px 10px; }
.n14-ctitle { font-size:11.5px; line-height:1.35; height:32px; overflow:hidden; color:#16233b; font-weight:600; }
.n14-ctag {
  margin-top:4px; font-size:9.5px; color:#fff; background:#00185A; display:inline-block;
  padding:1px 5px; border-radius:3px; max-width:100%; overflow:hidden; white-space:nowrap; text-overflow:ellipsis;
}
.n14-ctag.none { background:#aab3c2; }
.n14-keyattr { margin-top:5px; height:17px; display:flex; gap:4px; align-items:center; flex-wrap:wrap; overflow:hidden; }
.n14-ka { font-size:9.5px; padding:1px 5px; border-radius:3px; background:#e6f4ea; color:#0f6e56; font-weight:600; white-space:nowrap; }
.n14-ka.v { background:#fce8e6; color:#A32D2D; }
.n14-ka.p { background:#fff3cd; color:#854F0B; }
.n14-cprice { margin-top:6px; color:#C00000; font-size:14px; font-weight:700; }
.n14-b2b { margin-top:5px; border-top:1px dashed #e8ebf1; padding-top:5px; font-size:9.5px; color:#667085; line-height:1.4; min-height:32px; }
.n14-b2b b { color:#33405a; font-weight:600; }
.n14-b2b .l1, .n14-b2b .l2 { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.n14-b2b .l2 { font-size:9px; color:#8892a4; }
.n14-expand {
  margin-top:7px; width:100%; border:1px solid #cfd9e7; background:#f4f7fb; color:#00185A;
  border-radius:5px; padding:6px 8px; font-size:10px; font-weight:700; letter-spacing:.03em; cursor:pointer;
}
.n14-expand:hover { background:#e7eef8; border-color:#185FA5; }
.n14-expand b { color:#C00000; }
.n14-expandbody { border-top:1px solid #e8ebf1; background:#f7f9fc; padding:8px; }

/* ---------- 单规格套装卡：一步直选条（2026-11-11 v20261111e） ----------
   不出现 SELECT / HIDE SPECIFICATIONS，勾选框与 QTY 同排、不压主图。 */
.n14-inline { margin-top:7px; border-top:1px dashed #e8ebf1; padding-top:7px; }
.n14-inline .n14-sqrow { margin-top:0; }
.n14-inline .n14-pick { width:17px; height:17px; }
.n14-inline .n14-qty { width:64px; }

/* ---------- Squares：1:1 规格行方卡（草稿 .sqcard，保持行级选择） ---------- */
.n14-blk { margin-bottom:12px; border:1px solid #e3e7ee; border-radius:8px; overflow:clip; background:#fff; }
.n14-blkh {
  background:#f7f9fc; padding:7px 10px; font-size:12px; font-weight:700; color:#16233b;
  display:flex; justify-content:space-between; gap:8px; align-items:center; flex-wrap:wrap;
  position:sticky; top:var(--fbarH, 217px); z-index:9; box-shadow:0 1px 3px rgba(16,32,64,.06);
}
.n14-blkh .cnt { font-weight:400; color:#8892a4; font-size:11px; }
/* v20261117 · 板块折叠按钮（标题栏右侧统计条本体） */
.n14-blkh .n14-fold {
  display:inline-flex; align-items:center; gap:7px;
  margin:-4px -2px -4px 0; padding:5px 10px;
  background:#fff; border:1px solid #b9cfe9; border-radius:6px;
  color:inherit; font:inherit; font-size:11px; line-height:1.2;
  cursor:pointer; white-space:nowrap; user-select:none;
  box-shadow:0 1px 2px rgba(16,32,64,.05);
  transition:border-color .15s, background .15s, box-shadow .15s;
}
.n14-blkh .n14-fold:hover { border-color:#185FA5; background:#eef5ff; box-shadow:0 2px 6px rgba(24,95,165,.16); }
.n14-blkh .n14-fold:focus-visible { outline:2px solid #185FA5; outline-offset:1px; }
.n14-blkh .n14-fold .cnt { color:#33415c; font-weight:600; }
.n14-fold-ico {
  display:inline-block; width:6px; height:6px; flex:none;
  border-right:1.8px solid #185FA5; border-bottom:1.8px solid #185FA5;
  transform:rotate(45deg) translateY(-1px);
  transition:transform .18s ease;
}
.n14-fold.is-folded .n14-fold-ico { transform:rotate(-135deg) translateY(-1px); }
.n14-blk.folded .n14-blkbody { display:none; }
.n14-blk.folded { margin-bottom:8px; }
@media (max-width:960px) { .n14-blkh .n14-fold { padding:5px 10px; } }
/* 大板块内的小板块（subgroup）标题 + 分组网格 */
.n14-subgrp { border-top:1px solid #eef1f6; }
.n14-subgrp:first-of-type { border-top:0; }
.n14-subgrph {
  background:#fbfcfe; padding:6px 10px; font-size:11px; font-weight:700; color:#33415c;
  display:flex; justify-content:space-between; align-items:center; gap:8px; flex-wrap:wrap;
  border-left:3px solid #185FA5;
}
.n14-subgrph .cnt { font-weight:400; color:#98a2b3; font-size:10px; }
.n14-subgrp .n14-sqgrid { padding-top:9px; }
.n14-sqgrid { display:grid; grid-template-columns:repeat(auto-fill,minmax(158px,1fr)); gap:9px; padding:10px; }
.n14-expandbody .n14-sqgrid { grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); padding:4px; }
.n14-sqcard { border:1px solid #e3e7ee; border-radius:8px; background:#fff; overflow:hidden; position:relative; transition:border-color .15s; display:flex; flex-direction:column; }
.n14-sqcard:hover { border-color:#185FA5; }
.n14-sqcard.sel { border:2px solid #00185A; }
.n14-sqbox {
  aspect-ratio:1/1; background:#fafbfc; border-bottom:1px solid #eef1f6; display:flex;
  align-items:center; justify-content:center; padding:5px; cursor:zoom-in; position:relative; flex:none;
}
.n14-sqbox img { width:100%; height:100%; object-fit:contain; }
.n14-noimg { color:#aab3c2; font-size:10px; }
.n14-sqidx { position:absolute; top:4px; left:5px; background:rgba(0,24,90,.75); color:#fff; font-size:9px; padding:1px 5px; border-radius:8px; }
.n14-sqnum { position:absolute; bottom:5px; right:6px; background:rgba(0,24,90,.86); color:#fff; font-size:9px; padding:1px 6px; border-radius:9px; pointer-events:none; }
/* 勾选框：与 QTY 同排（不再绝对定位压在图片右上角） */
.n14-pick { width:16px; height:16px; flex:none; margin:0; cursor:pointer; accent-color:#00185A; }
.n14-sqbody { padding:6px 7px 8px; flex:1; display:flex; flex-direction:column; }
/* v20261126m · 规格行由 2 行(29px) 放到 3 行(43px)：
   长规格（如 105° Adapter / 60mm / Silver / Hanging Card Package）在 160px 卡宽下需 3 行，
   原来第 3 行被 overflow:hidden 裁掉，包装方式等信息看不到；全站 96 卡实测 11 张受影响。 */
.n14-sqparam { font-size:11px; font-weight:800; color:#16233b; line-height:1.3; height:43px; overflow:hidden; }
.n14-sqmeta { font-size:9px; color:#0f6e56; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin-top:2px; min-height:13px; }
.n14-sqpack { font-size:9px; color:#667085; line-height:1.35; margin-top:2px; word-break:break-word; }
.n14-sqmodel { font-size:9px; color:#98a2b3; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin-top:2px; }
/* v20261124a · 价格水平线修复（李总 11-24 指令）：
   auto 原来挂在 QTY 行，价格行会随上方 .n14-sqpack（箱规行）有无/长短上下浮动（实测最大 26.3px）。
   改把 auto 挂到价格行：价格行被推到卡片底部固定位，QTY 行紧随其后且高度一致 →
   同一行所有卡片价格 top 对齐 0px；有 badge / 无 badge、有箱规 / 无箱规均不受影响。 */
.n14-sqprice { color:#C00000; font-size:13px; font-weight:700; margin-top:auto; display:flex; align-items:center; justify-content:space-between; gap:6px; }
.n14-price { white-space:nowrap; }
.n14-new { display:inline-block; background:#E60012; color:#fff; font-size:9px; font-weight:800; padding:2px 6px; border-radius:3px; letter-spacing:.5px; line-height:1.2; flex:none; box-shadow:0 1px 2px rgba(0,0,0,.15); }
.n14-sqrow { display:flex; align-items:center; flex-wrap:nowrap; gap:5px; margin-top:0; padding-top:5px; min-width:0; }
.n14-sqrow label { font-size:9px; font-weight:700; color:#8b98a8; }
.n14-qty { width:58px; background:#FFF2CC; border:1px solid #e0c98a; border-radius:4px; padding:2px 4px; font-size:11px; }

/* ---------- Images：全库图集，按款式分组（草稿 .grp / .galgrid） ---------- */
.n14-grp { margin-bottom:16px; border:1px solid #e3e7ee; border-radius:9px; background:#fff; overflow:hidden; }
.n14-grph {
  background:#f7f9fc; padding:8px 12px; display:flex; justify-content:space-between; gap:10px;
  align-items:center; flex-wrap:wrap; border-bottom:1px solid #e8ebf1;
}
.n14-grph span:first-child { font-size:12.5px; font-weight:700; color:#16233b; }
.n14-grph span:last-child { font-size:10.5px; color:#667085; }
.n14-galgrid { display:grid; grid-template-columns:repeat(auto-fill,minmax(148px,1fr)); gap:9px; padding:10px; }
.n14-ph { border:1px solid #e3e7ee; border-radius:7px; overflow:hidden; background:#fff; position:relative; }
.n14-ph:hover { border-color:#185FA5; }
.n14-pi { height:128px; background:#fafbfc; display:flex; align-items:center; justify-content:center; padding:6px; cursor:zoom-in; }
.n14-pi img { max-width:100%; max-height:100%; object-fit:contain; }
.n14-idx { position:absolute; top:5px; left:6px; background:rgba(0,24,90,.75); color:#fff; font-size:9px; padding:1px 5px; border-radius:8px; }
.n14-pc { font-size:9.5px; color:#5a6577; padding:5px 7px 7px; line-height:1.35; height:39px; overflow:hidden; }

/* ---------- 响应式 ---------- */
@media (max-width:1250px) { .n14-grid { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media (max-width:960px)  { .n14-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } .n14-blkh { position:static; } }
@media (max-width:620px) {
  .n14-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; }
  .n14-sqgrid, .n14-galgrid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; padding:6px; }
  .n14-imgbox, .n14-pi { height:98px; }
}

/* ============================================================
   v20261126m · 移动端上线前摸底修复（李总 11-26「跑一遍移动端」）
   1) 输入框字号 ≥16px：iOS Safari 聚焦 input 时若字号 <16px 会强制放大整页，
      搜索框 13px / 客户表单 14px / QTY 11px 都会触发，导致点一下输入框页面跳动。
   2) 触摸目标：勾选框 16px、QTY 18px、折叠按钮 25px、筛选 chip 17px 过小。
   3) 规格行 2 行 29px 只能容 ~23 字符/行，长规格（如 105° Adapter / 140mm /
      Silver / Hanging Card Package）第 3 行被裁；≤620px 放到 3 行 43px。
   4) iPad 竖屏 768px 走 auto-fill(128px) 得 4~5 列、卡片只剩 139px，
      比手机还窄；621~960px 固定 3 列。
   只作用于窄屏，桌面（>960px）零改动。
   ============================================================ */
/* iPad / 平板同样跑 Safari：输入框字号与触摸目标一并覆盖到 ≤960px */
@media (max-width:960px) {
  /* 1. 防 iOS 聚焦缩放（字号必须 ≥16px） */
  .toolbar.n14-toolbar .search-bar input,
  #searchInput { font-size:16px; }
  #custModal .cust-form input[type="text"],
  #custModal .cust-form input[type="email"],
  #custModal .cust-form input[type="tel"] { font-size:16px; }
  #n14Main .n14-qty { width:64px; height:32px; font-size:16px; padding:3px 6px; }

  /* 2. 触摸目标（WCAG 2.5.8 AA 下限 24×24；关键操作按 32~40px） */
  #n14Main .n14-pick, .n14-inline .n14-pick { width:24px; height:24px; }
  .n14-blkh .n14-fold { min-height:34px; }
  .n14-lightbox .close { min-width:40px; min-height:40px; }
  header button[data-lang] { min-height:28px; }
  .n14-chip { min-height:26px; }
  .n14-morebtn { min-height:26px; }
}

@media (max-width:620px) {
  #mobar button { min-height:38px; }

  /* 4. 吸底条安全区兜底（viewport-fit=cover 时生效，未开启则 env()=0 无影响） */
  #mobar { padding-bottom:calc(9px + env(safe-area-inset-bottom, 0px)); }
  body { padding-bottom:calc(100px + env(safe-area-inset-bottom, 0px)); }
}

/* iPad 竖屏等 621~960px：卡片不再被 auto-fill 挤到 139px */
@media (min-width:621px) and (max-width:960px) {
  .n14-sqgrid { grid-template-columns:repeat(3,minmax(0,1fr)); }
}

/* ============================================================
   v20261126n · 返回顶部按钮（李总 11-26「还需要在网站上做一个返回顶部的按钮」）
   页码高度 1.2~1.3 万 px，滚到中后段必须一键回顶。
   1) 桌面：右下角 44px 圆形，避开右栏 200px（见下方 --totop-right 计算），
      仅在滚动 > 600px 后淡入，滚回顶部自动消失。
   2) ≤960px：站内底部固定操作条 #mobar（实测 48px）会盖住按钮 →
      抬到 66px；≤620px 时 #mobar 两行（实测 102~110px）→ 抬到 124px。
   3) 安全区：叠加 env(safe-area-inset-bottom)，全面屏 Home 条不吃按钮。
   4) 层级 119：低于 #mobar(120) 与弹窗(9999)，不会压住任何既有交互。
   ============================================================ */
.n14-totop {
  position:fixed; right:20px; bottom:20px; z-index:119;
  width:44px; height:44px; padding:0; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  background:#00185A; color:#fff; border:1px solid rgba(231,199,126,.55);
  box-shadow:0 4px 14px rgba(0,24,90,.30);
  cursor:pointer; -webkit-tap-highlight-color:transparent;
  opacity:0; visibility:hidden; transform:translateY(10px);
  transition:opacity .22s ease, transform .22s ease, visibility .22s ease, background .18s ease;
}
.n14-totop.show { opacity:1; visibility:visible; transform:none; }
.n14-totop:hover { background:#1F4E79; }
.n14-totop:active { transform:scale(.96); }
.n14-totop:focus-visible { outline:2px solid #E7C77E; outline-offset:2px; }
.n14-totop svg { width:22px; height:22px; display:block; }
@media (max-width:960px) {
  .n14-totop { right:14px; bottom:calc(66px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width:620px) {
  .n14-totop { right:12px; bottom:calc(124px + env(safe-area-inset-bottom, 0px)); }
}
/* 桌面：右栏（200px，常驻吸顶）贴在视口右缘，按钮若放 right:20 会盖住
   Contact 卡片的 WhatsApp / WeChat（实测 1366×768、1024×768 命中 .ls-qr-hint）。
   改为停在右栏左侧 12px 的间隙里：右侧偏移 = 页面居中留白 + 22 内边距 + 200 右栏 + 12 间隙。
   主区 max-width 1500（styles.css），窄于 1500 时居中留白为 0。 */
@media (min-width:961px) {
  .n14-totop { right: calc(max(0px, (100vw - 1500px) / 2) + 234px); }
}
@media (prefers-reduced-motion: reduce) {
  .n14-totop { transition:none; }
}
