/* ============================================================
   dcxjn.asia 信佳诺数码 · xj-* 框架 v2（主推规格表形态）
   2026-10-31：根治 480 窄条（body 全宽+内容区 1200 居中）；
   fixed 栏跟随；详情页桌面 grid+sticky；主推规格表大卡
   ============================================================ */
:root {
  --xj-ink: #1c2430; --xj-sub: #6b7686; --xj-line: #e4e8ee;
  --xj-accent: #0f62d6; --xj-deep: #101b2c; --xj-bg: #f5f7fa; --xj-card: #fff;
  --xj-tabbar-h: 54px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--xj-bg); color: var(--xj-ink); min-height: 100vh; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
.xj-wrap { max-width: 1420px; margin: 0 auto; padding: 0 16px; }

/* 刊头 */
.xj-mast { background: var(--xj-deep); color: #eef3fa; }
.xj-mast-in { max-width: 1420px; margin: 0 auto; padding: 18px 16px 14px; display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap; }
.xj-brand { font-size: 25px; font-weight: 700; letter-spacing: 1px; }
.xj-claim { font-size: 14px; opacity: .8; }
.xj-nav { background: #fff; border-bottom: 1px solid var(--xj-line); }
.xj-nav-in { max-width: 1420px; margin: 0 auto; padding: 0 16px; display: flex; gap: 24px; overflow-x: auto; }
.xj-nav a { padding: 12px 2px; font-size: 14.5px; color: var(--xj-sub); white-space: nowrap; }
.xj-nav a.on { color: var(--xj-accent); font-weight: 600; border-bottom: 2px solid var(--xj-accent); }

/* 主推规格表大卡（首屏价格前置 + 参数即身份） */
.xj-hero { display: grid; grid-template-columns: 1fr 1.1fr; gap: 18px; background: var(--xj-card); border: 1px solid var(--xj-line); border-radius: 12px; padding: 16px; margin: 8px 0; }
.xj-hero-img img { width: 100%; border-radius: 10px; height: 210px; aspect-ratio: auto; object-fit: cover; }
.xj-hero-body { display: flex; flex-direction: column; gap: 6px; }
.xj-kicker { font-size: 12px; color: var(--xj-accent); font-weight: 600; letter-spacing: 1px; }
.xj-hero-title { font-size: 17px; font-weight: 700; line-height: 1.3; }
.xj-hero-price { color: var(--xj-accent); font-size: 22px; font-weight: 700; }
.xj-hero-cta { display: inline-block; align-self: flex-start; background: var(--xj-accent); color: #fff; padding: 8px 22px; border-radius: 8px; font-size: 14px; border: none; }
.xj-spec { width: 100%; border-collapse: collapse; font-size: 12px; line-height: 1.25; }
.xj-spec td { border: 1px solid var(--xj-line); padding: 3px 7px; }
.xj-spec td:first-child { width: 80px; color: var(--xj-sub); background: #f7f9fc; }

/* 楼层 + 商品卡 */
.xj-floor { margin: 10px 0 4px; }
.xj-floor-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 2px; }
.xj-floor-head h2 { font-size: 19px; font-weight: 700; }
.xj-floor-head h2::before { content: ""; display: inline-block; width: 5px; height: 17px; background: var(--xj-accent); border-radius: 3px; margin-right: 9px; vertical-align: -2px; }
.xj-floor-lead { font-size: 13px; color: var(--xj-sub); }
.xj-floor-more { margin-left: auto; font-size: 13px; color: var(--xj-accent); }
.xj-goods { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.xj-card { background: var(--xj-card); border: 1px solid var(--xj-line); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .15s; }
.xj-card:hover { box-shadow: 0 4px 16px rgba(16,27,44,.10); }
.xj-card .xj-thumb { height: 190px; aspect-ratio: auto; width: 100%; object-fit: cover; background: #eef1f5; }
.xj-card .xj-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.xj-card .xj-name { font-size: 14px; line-height: 1.45; height: 40px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.xj-card .xj-pricebar { display: flex; align-items: baseline; gap: 8px; margin-top: 6px; }
.xj-card .xj-price { color: var(--xj-accent); font-weight: 700; font-size: 17px; }
.xj-card .xj-sales { font-size: 12px; color: var(--xj-sub); margin-left: auto; }
.xj-card .xj-view { border: none; border-radius: 6px; padding: 7px 0; width: 100%; background: #eef4fd; color: var(--xj-accent); font-size: 13px; }

/* 详情页桌面：左图右信息 1.4fr/1fr + sticky */
.xj-detail { display: grid; grid-template-columns: 1.4fr 1fr; gap: 26px; margin: 22px auto; align-items: start; }
.xj-gallery { background: #fff; border: 1px solid var(--xj-line); border-radius: 12px; overflow: hidden; position: relative; }
.xj-info { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 14px; }
.xj-info .xj-price-lg { color: var(--xj-accent); font-size: 28px; font-weight: 700; }
.xj-info .xj-title-lg { font-size: 20px; line-height: 1.5; font-weight: 600; }
.xj-info .xj-meta { display: flex; gap: 16px; font-size: 13px; color: var(--xj-sub); }
.xj-info .xj-actions { display: flex; gap: 12px; }
.xj-info .xj-actions button { flex: 1; padding: 12px 0; border: none; border-radius: 8px; font-size: 15px; }
.xj-btn-cart { background: #fff; color: var(--xj-accent); border: 1px solid var(--xj-accent) !important; }
.xj-btn-buy { background: var(--xj-accent); color: #fff; }
.xj-desc { font-size: 14px; line-height: 1.85; color: #333c48; }
.xj-desc p { margin-bottom: 10px; }

/* 页脚 */
.xj-foot { background: #fff; border-top: 1px solid var(--xj-line); margin-top: 40px; }
.xj-foot-in { max-width: 1420px; margin: 0 auto; padding: 22px 16px 26px; text-align: center; font-size: 12.5px; color: var(--xj-sub); line-height: 2; }
.xj-foot-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; padding: 14px 16px 0; font-size: 13px; }
.xj-foot-info { padding: 6px 16px 0; }

/* 移动端 tabbar/弹层/底栏（fixed 栏跟随视口，不再锁 480） */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; display: flex; border-top: 1px solid var(--xj-line); z-index: 90; height: var(--xj-tabbar-h); }
.tabbar a { flex: 1; text-align: center; padding: 8px 0 10px; font-size: 12px; color: var(--xj-sub); }
.tabbar a.on { color: var(--xj-accent); }
.bottom-bar { position: fixed; left: 0; right: 0; bottom: var(--xj-tabbar-h); background: #fff; display: flex; align-items: center; gap: 8px; padding: 8px 12px; box-shadow: 0 -2px 8px rgba(0,0,0,.06); z-index: 95; }
.spec-mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: none; z-index: 99; }
.spec-panel { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-radius: 14px 14px 0 0; padding: 14px; display: none; z-index: 100; max-height: 70vh; overflow: auto; }
body { padding-bottom: 62px; }
body:has(.xj-bottom-bar), body:has(.bottom-bar) { padding-bottom: calc(var(--xj-tabbar-h) + 80px); }
@media (min-width: 900px) {
  .tabbar, .bottom-bar { display: none; }
  body { padding-bottom: 0; }
  .spec-panel { left: 50%; right: auto; bottom: auto; top: 14%; transform: translateX(-50%); width: 430px; border-radius: 14px; box-shadow: 0 12px 48px rgba(0,0,0,.22); }
  /* 规格表双列排布：保留全部参数，高度减半，把首屏网格抬进 820 折叠线 */
  .xj-spec { display: block; }
  .xj-spec tr { display: flex; width: 50%; float: left; box-sizing: border-box; }
  .xj-spec td { display: block; }
  .xj-spec td:first-child { width: 84px; flex: 0 0 84px; }
  .xj-spec::after { content: ""; display: block; clear: both; }
}
@media (max-width: 899px) {
  .xj-nav { display: none; }
  .xj-hero { grid-template-columns: 1fr; padding: 12px; margin: 8px 0; }
  .xj-hero-img img { height: 40px; }
  .xj-floor { margin: 2px 0 0; }
  .xj-goods { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .xj-card .xj-thumb { height: 115px; }
  .xj-detail { grid-template-columns: 1fr; gap: 14px; }
  .xj-info { position: static; }
  .xj-info .xj-actions { display: none; }
}
/* 404 */
.xj-404 { text-align: center; padding: 90px 16px; }
.xj-404 h1 { font-size: 52px; color: var(--xj-deep); }
.xj-404 p { color: var(--xj-sub); margin: 14px 0 24px; }
.xj-404 a { color: var(--xj-accent); }
/* 次级页面兼容段（沿用旧类名不破相，二期 hy 化） */
.card { background: #fff; border: 1px solid var(--xj-line); border-radius: 10px; padding: 14px; margin: 14px 0; }
.goods-grid, .xj-goods-legacy { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.goods-card, .xj-goods-card { background: #fff; border: 1px solid var(--xj-line); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; }
.thumb, .xj-thumb { aspect-ratio: 1/1; width: 100%; object-fit: cover; background: #eef1f5; }
.info, .xj-info-legacy { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.name, .xj-name { font-size: 14px; line-height: 1.45; }
.price, .xj-price { color: var(--xj-accent); font-weight: 700; font-size: 16px; }
.btn-buy, .xj-btn-buy, .btn-primary { border: none; border-radius: 6px; padding: 8px 14px; background: var(--xj-accent); color: #fff; font-size: 13px; }
.form-item { margin: 12px 0; }
.form-item input { width: 100%; padding: 11px 12px; border: 1px solid var(--xj-line); border-radius: 8px; font-size: 14px; }
.xj-trust-bar { background: #fff; border: 1px solid var(--xj-line); border-radius: 10px; padding: 12px 16px; display: flex; gap: 22px; flex-wrap: wrap; font-size: 13px; color: var(--xj-sub); margin: 16px 0; }
@media (max-width: 899px) { .goods-grid, .xj-goods-legacy { grid-template-columns: repeat(2, 1fr); gap: 10px; } }

/* 详情页组件段（xj-* 前缀，product.php 专用） */
.xj-swiper-track { display: flex; transition: transform .25s ease; touch-action: pan-y; }
.xj-swiper-track.dragging { transition: none; }
.xj-swiper-slide { min-width: 100%; }
.xj-swiper-slide img { width: 100%; aspect-ratio: 1/1; object-fit: cover; }
.swiper { position: relative; overflow: hidden; background: #fff; }
.xj-counter { position: absolute; right: 12px; bottom: 12px; background: rgba(0,0,0,.45); color: #fff; font-size: 12px; padding: 2px 9px; border-radius: 10px; z-index: 2; }
.xj-dots { display: flex; gap: 6px; justify-content: center; padding: 10px 0; background: #fff; }
.xj-dots i { width: 7px; height: 7px; border-radius: 50%; background: #d5dce6; }
.xj-dots i.on { background: var(--xj-accent); }
.xj-arrow-btn { position: absolute; top: 42%; width: 36px; height: 36px; line-height: 34px; text-align: center; background: rgba(255,255,255,.92); border-radius: 50%; font-size: 20px; color: var(--xj-ink); box-shadow: 0 2px 8px rgba(0,0,0,.15); cursor: pointer; user-select: none; z-index: 5; }
.xj-arrow-btn.prev { left: 10px; }
.xj-arrow-btn.next { right: 10px; }
.xj-spec-item { display: inline-block; padding: 6px 14px; margin: 0 8px 8px 0; border: 1px solid var(--xj-line); border-radius: 6px; font-size: 13px; cursor: pointer; background: #fff; }
.xj-spec-item.on { border-color: var(--xj-accent); color: var(--xj-accent); background: #eef4fd; }
.xj-num-ctrl button { width: 30px; height: 30px; border: 1px solid var(--xj-line); background: #fff; border-radius: 6px; }
.xj-num-ctrl b { display: inline-block; min-width: 44px; text-align: center; }
.xj-bottom-bar { position: fixed; left: 0; right: 0; bottom: var(--xj-tabbar-h); background: #fff; display: flex; align-items: center; gap: 8px; padding: 8px 12px; box-shadow: 0 -2px 8px rgba(0,0,0,.06); z-index: 95; }
.xj-bottom-bar .xj-op { flex: 0 0 52px; text-align: center; font-size: 11px; color: var(--xj-sub); }
.xj-bottom-bar .xj-op .xj-ico { display: block; font-size: 18px; }
.xj-btn-cart { flex: 1; padding: 10px 14px; border: 1px solid var(--xj-accent); border-radius: 8px; background: #fff; color: var(--xj-accent); font-size: 14px; }
.xj-btn-buy2 { flex: 1; padding: 10px 14px; border: none; border-radius: 8px; background: var(--xj-accent); color: #fff; font-size: 14px; }
.xj-spec-mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: none; z-index: 99; }
.xj-spec-panel { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-radius: 14px 14px 0 0; padding: 14px; display: none; z-index: 100; max-height: 70vh; overflow: auto; }
.xj-spec-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; }
.xj-tag { display: inline-block; padding: 4px 10px; border: 1px solid var(--xj-line); border-radius: 5px; font-size: 12px; color: var(--xj-sub); margin-right: 6px; }
@media (min-width: 900px) {
  .xj-bottom-bar { display: none; }
  .xj-spec-panel { left: 50%; right: auto; bottom: auto; top: 14%; transform: translateX(-50%); width: 430px; border-radius: 14px; box-shadow: 0 12px 48px rgba(0,0,0,.22); }
}

/* xj-tabbar（页脚 TabBar，G7 修复）—— 固定在最底，购买栏叠在其上方 */
.xj-tabbar { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; display: flex; border-top: 1px solid var(--xj-line); z-index: 90; height: var(--xj-tabbar-h); }
.xj-tabbar a { flex: 1; text-align: center; padding: 8px 0 10px; font-size: 12px; color: var(--xj-sub); }
.xj-tabbar a.on { color: var(--xj-accent); }
@media (min-width: 900px) { .xj-tabbar { display: none; } }
/* 2026-11-05 width-fix: 内容区 1420 + 桌面两行 4 列全部进首屏 */
@media (min-width:900px){
  .xj-hero{padding:12px;gap:12px;margin:6px 0}
  .xj-hero-img img{height:130px}
  .xj-hero-title{font-size:15px}
  .xj-hero-price{font-size:20px}
  .xj-hero-cta{padding:6px 16px;font-size:13px}
  .xj-spec td{padding:2px 6px}
  .xj-floor{margin:6px 0 2px}
  .xj-floor-head h2{font-size:16px}
  .xj-floor-lead{font-size:12px}
  .xj-card .xj-thumb{height:120px;object-fit:contain;background:#f4f6fa}
  .xj-card .xj-body{padding:7px 9px 9px;gap:4px}
  .xj-card .xj-name{font-size:13px;height:34px}
  .xj-card .xj-pricebar{margin-top:2px}
  .xj-card .xj-price{font-size:16px}
  .xj-card .xj-view{padding:4px 0;font-size:12px}
}
@media (max-width:899px){
  .xj-mast-in{padding:12px 12px 8px}
  .xj-hero{padding:8px;margin:6px 0}
  .xj-hero-body{gap:3px}
  .xj-hero-title{font-size:14px}
  .xj-hero-price{font-size:18px}
  .xj-hero-cta{padding:5px 14px;font-size:12px}
  .xj-floor{margin:4px 0 0}
  .xj-floor-head h2{font-size:15px}
  .xj-floor-lead{display:none}
  .xj-goods{gap:8px}
  .xj-card .xj-thumb{height:88px;object-fit:contain;background:#f4f6fa}
  .xj-card .xj-body{padding:6px 8px 8px;gap:3px}
  .xj-card .xj-name{font-size:12.5px;height:32px}
  .xj-card .xj-pricebar{margin-top:2px}
  .xj-card .xj-price{font-size:15px}
  .xj-card .xj-view{padding:3px 0;font-size:11.5px}
}

/* 2026-11-05 width-fix: 页脚与内容区同宽 1420 */
@media (min-width:900px){ .xj-foot{max-width:1420px;margin-left:auto!important;margin-right:auto!important} }

/* 2026-11-05 width-fix: 页脚内层与内容区同宽 */
@media (min-width:900px){
  .xj-foot-links,.xj-foot-info{max-width:1420px;margin-left:auto!important;margin-right:auto!important}
}
