/* ==========================================================================
   ZNZBW / Wide layout — 首页与频道页宽幅模式
   --------------------------------------------------------------------------
   只改容器尺寸与宽屏密度：板块顺序、导航项、元素位置、配色、组件一律不动。
   所有规则仅在 body[data-wide="1"] 且视口足够宽时生效；
   窄屏继续走 base / layout / pages 原有断点，不影响已验证的移动端表现。
   把 body 的 data-wide 改为 "0" 即完整回退到标准 1200px 栅格。
   ========================================================================== */

/* 一行变量覆盖全站 .container；未启用宽幅的页面仍是 1200px。
   窄屏保持「不限宽」，让 .container 继续 width:100% 跟随视口，
   绝不能用视口减法把手机端容器压窄（见下方 1440px 断点内的宽屏公式）。 */
body[data-wide="1"] { --container: var(--container-wide); }

/* --------------------------------------------------------------------------
   ≥ 1440px：容器已拉宽，按比例把多出来的宽度分配给各栏，不新增/挪动元素
   -------------------------------------------------------------------------- */
@media (min-width: 1440px) {
  body[data-wide="1"] {
    /* 减去 180px 给右侧固定悬浮工具条（right:16px + 52px 宽）预留留白，
       避免中等宽度视口下容器贴边、工具条压住「平台公告」等内容；
       ≥1860px 自动取到完整 1680px 宽幅。 */
    --container: min(var(--container-wide), calc(100vw - 180px));
    --cat-w: 264px;
    --side-w: 320px;
  }

  /* 首屏三栏：分类与快捷入口适度加宽，焦点图不被拉到失衡 */
  body[data-wide="1"] .hero-grid { grid-template-columns: var(--cat-w) minmax(0, 1fr) 296px; gap: var(--s-5); }
  body[data-wide="1"] .hero-focus { min-height: 360px; }
  body[data-wide="1"] .hero-slide { padding: var(--s-10) var(--s-10); }
  body[data-wide="1"] .hero-slide h2 { max-width: 500px; }
  body[data-wide="1"] .hero-slide p { max-width: 480px; }
  body[data-wide="1"] .hero-slide__art { width: 200px; }
  body[data-wide="1"] .hero-dots { left: var(--s-10); }

  /* 板块节奏：按需求把楼层间距固定为 20px，宽幅下不再随视口放大；
     卡片仍用更扁的图比例避免变高变笨 */
  body[data-wide="1"] .home-section { margin-top: 20px; }
  body[data-wide="1"] .grid { gap: var(--s-5); }
  body[data-wide="1"] .product-card .figure { aspect-ratio: 16 / 10; }

  /* 首页各板块主/侧栏比例（列数不变，只调宽度） */
  body[data-wide="1"] .supply-layout { grid-template-columns: minmax(0, 1fr) var(--side-w); gap: var(--s-6); }
  body[data-wide="1"] .tech-layout { grid-template-columns: 1.3fr .7fr; gap: var(--s-8); }
  body[data-wide="1"] .mall-band { grid-template-columns: 272px minmax(0, 1fr); gap: var(--s-5); }
  body[data-wide="1"] .mall-band__cards { gap: var(--s-4); }
  /* 展会中心三列：宽屏把多出来的宽度主要分给中列展会卡，左右列表保持易读宽度 */
  body[data-wide="1"] .exhibit-layout { grid-template-columns: minmax(0, .8fr) minmax(0, 2fr) minmax(0, .9fr); gap: var(--s-6); }
  /* 中列被拉高后 6 张卡同步长高，略增内边距让日期、标题与右侧标签不显悬空 */
  body[data-wide="1"] .exh-cards .exhibit-card { padding: var(--s-4); }
  /* 工业品牌 6:4 分栏：宽幅只放大间距与卡片留白，左右比例与标准模式一致 */
  body[data-wide="1"] .brand-band { gap: var(--s-6); }
  body[data-wide="1"] .brand-band__wall { gap: var(--s-4); }
  body[data-wide="1"] .brand-story__pic { height: 112px; }
  body[data-wide="1"] .member-grid,
  body[data-wide="1"] .brand-wall { gap: var(--s-4); }
  /* 企业会员三列：宽幅把多出的宽度主要分给中列企业卡，三列仍严格等高；
     加高列高让左/右卡片有足够呼吸，不再像紧凑列表一样挤在一起 */
  body[data-wide="1"] .member-band { grid-template-columns: minmax(0, 1fr) minmax(0, 1.26fr) minmax(0, 1fr); gap: var(--s-6); }
  body[data-wide="1"] .member-col { min-height: 620px; }
  body[data-wide="1"] .member-band .member-grid { gap: var(--s-4); }

  /* 频道页：主栏变宽，侧栏同步加宽；文章图与商品行按新宽度放大 */
  body[data-wide="1"] .two-col { grid-template-columns: minmax(0, 1fr) 336px; gap: var(--s-8); }
  body[data-wide="1"] .list-layout { grid-template-columns: minmax(0, 1fr) var(--side-w); gap: var(--s-6); }
  body[data-wide="1"] .cat-block { padding: var(--s-6); }
  body[data-wide="1"] .cat-block__body { gap: var(--s-6); }
  body[data-wide="1"] .cat-article .figure { width: 152px; }
  body[data-wide="1"] .product-row { grid-template-columns: 196px minmax(0, 1fr) 196px; gap: var(--s-5); }
  body[data-wide="1"] .filter-panel { padding-inline: var(--s-6); }
  /* 频道页卡片式：宽幅把 20 条按整除列数铺开（4/5 行），不留半行空格 */
  body[data-wide="1"] .chan-cards--2 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  body[data-wide="1"] .chan-cards--3 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  body[data-wide="1"] .chan-cards--4 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  body[data-wide="1"] .chan-cards--6 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  /* 品牌频道页卡片式固定 28 张：4 列 × 7 行满铺，不跟随通用 5 列规则出现半行 */
  body[data-wide="1"] .brand-dir-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  /* 采购 / 商城：20 条卡片式按 5 列 × 4 行满铺，结果行与商城分类同步放宽 */
  body[data-wide="1"] .buy-cards,
  body[data-wide="1"] .mall-cards { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  body[data-wide="1"] .buy-row { grid-template-columns: 52px minmax(0, 1fr) 196px; gap: var(--s-5); }
  body[data-wide="1"] .mall-row { grid-template-columns: 196px minmax(0, 1fr) 196px; gap: var(--s-5); }
  body[data-wide="1"] .mall-nav__grid { gap: var(--s-4); }
  body[data-wide="1"] .buy-cta { padding: var(--s-10); }

  /* 公司 / 知道 / 资料 / 动态：20 张卡片式按 5 列 × 4 行满铺，结果行同步放宽 */
  body[data-wide="1"] .co-cards,
  body[data-wide="1"] .q-cards,
  body[data-wide="1"] .d-cards { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  body[data-wide="1"] .company-row { grid-template-columns: 56px minmax(0, 1fr) auto auto; gap: var(--s-6); }
  body[data-wide="1"] .q-row,
  body[data-wide="1"] .d-row { grid-template-columns: 56px minmax(0, 1fr) 180px; gap: var(--s-5); }
  body[data-wide="1"] .co-hero,
  body[data-wide="1"] .expo-hero,
  body[data-wide="1"] .know-hero,
  body[data-wide="1"] .down-hero { padding: var(--s-10); }
  /* 10 个资讯分类在宽幅下仍保持 5 列 × 2 行，不出现半行空格 */
  body[data-wide="1"] .news-cats { gap: var(--s-4); }

  /* 品牌墙增列后与下方板块标题留出呼吸，避免标题横线贴住最后一行卡片 */
  body[data-wide="1"][data-page="brand"] .brand-wall + .section-head { margin-top: var(--s-8); }

  /* 页头与页脚：内容不无限拉伸 */
  body[data-wide="1"] .page-head p { max-width: 760px; }
  body[data-wide="1"] .footer__main { gap: var(--s-16); }
  body[data-wide="1"] .footer__intro p { max-width: 340px; }

  /* 登录/注册宽幅：左右两卡严格等高；间距放大，插画面板文案不被拉宽 */
  body[data-wide="1"] .auth-layout { grid-template-columns: minmax(0, 1fr) 480px; gap: var(--s-10); min-height: 640px; }
  body[data-wide="1"] .auth-visual { min-height: 640px; padding: var(--s-12); }
  body[data-wide="1"] .auth-visual > div:first-child { max-width: 560px; }
  body[data-wide="1"] .auth-visual h2 { font-size: var(--fs-hero); max-width: 560px; }
  body[data-wide="1"] .auth-visual p { max-width: 520px; }
  body[data-wide="1"] .auth-card { padding: var(--s-12); }
}

/* --------------------------------------------------------------------------
   ≥ 1600px：只对卡片数量能被整除的板块增列，绝不出现半行空格
   企业名录 12 张 → 6 列 × 2 行；品牌墙 18 张 → 9 列 × 2 行
   首页各板块（8 / 4 / 3 / 12 / 10 张）列数保持原样
   -------------------------------------------------------------------------- */
@media (min-width: 1600px) {
  body[data-wide="1"] .hero-slide h2 { max-width: 560px; }
  body[data-wide="1"] .hero-slide p { max-width: 530px; }
  body[data-wide="1"] .hero-slide__art { width: 236px; }

  body[data-wide="1"][data-page="company"] .grid--4 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  body[data-wide="1"][data-page="brand"] .brand-wall { grid-template-columns: repeat(9, minmax(0, 1fr)); }
}

/* --------------------------------------------------------------------------
   真机兼容（2026-11-16 v2 / v3 / v4）——只处理「系统注入内容」
   新版页面已在 header.htm 用 $GLOBALS['znui_isolate'] 标记彻底不加载
   DESTOON 旧版 style.css / index.css / home.reset.css，7 个新版样式表与
   设计稿完全一致，因此不再需要 v1 的属性复位层。
   v3：分隔符裸露、资料卡失去绝对定位把 header 顶下去、旧头像外露。
   v4（本轮用户反馈的三处）：
     1) user.png 头像在 flex 顶栏里与姓名不在同一行 → 统一尺寸 + 垂直居中；
     2) .head_t 未读角标被当成普通链接加了 border-right，导致站内信/新交谈后
        的小图标消失、新交谈/退出登录前多出竖线 → 角标独立成图标 + 红数字；
     3) #destoon-card 一列裸文本难看 → site.js 重排为两列数据格 + 蓝白皮肤。
   -------------------------------------------------------------------------- */
.topbar__right { flex-wrap: nowrap; white-space: nowrap; }

/* 会员栏里系统注入的 DOM 有三种角色，必须分开处理：
     > a       普通链接（首个链接内部带 user.png 会员头像）
     > img     未登录态的直接头像
     .head_t   站内信 / 新交谈的未读角标（绝不能套链接分隔线）
   旧版把 .head_t 也归进「a, span, b」统一加 border-right + padding，
   于是角标被撑成一条竖线 —— 这正是「多余分隔符」和「小图标消失」的根因。 */
#destoon_member {
  display: inline-flex !important; align-items: center; flex-wrap: nowrap !important;
  white-space: nowrap !important; float: none !important; height: auto !important;
  margin: 0 !important; padding: 0 !important;
  font-size: 0 !important; color: inherit !important; line-height: 1 !important;
  border-right: 1px solid var(--line-strong);
}
#destoon_member > a {
  display: inline-flex !important; align-items: center;
  font-size: var(--fs-12) !important; font-weight: inherit !important;
  color: inherit !important; line-height: 1 !important; text-decoration: none !important;
  margin: 0 !important; padding: 0 12px !important; float: none !important;
  border-right: 1px solid var(--line-strong);
}
#destoon_member > a:last-child { border-right: 0 !important; }
#destoon_member > a:hover { color: var(--brand-600) !important; }
#destoon_member .is-strong, #destoon_member #destoon-login,
#destoon_member > strong { color: var(--brand-700) !important; font-weight: 650 !important;
  font-size: var(--fs-12) !important; padding: 0 12px !important; }
/* 头像：保留系统图标，强制与姓名在同一行垂直居中 */
#destoon_member img[data-znui-avatar] {
  display: inline-block !important; width: 16px; height: 16px;
  margin: 0 6px 0 0 !important; padding: 0 !important; border: 0 !important;
  border-radius: 50%; object-fit: cover; vertical-align: middle;
  background: var(--brand-50, #eef5ff);
}
/* 站内信 / 新交谈：常驻线性小图标 + 未读数字红角标 */
#destoon_member .head_t {
  display: inline-flex !important; align-items: center; justify-content: center;
  position: relative; width: 16px; height: 16px; min-width: 16px;
  margin: 0 0 0 5px !important; padding: 0 !important; border: 0 !important;
  border-radius: 4px; vertical-align: middle; float: none !important;
  font-size: 0 !important; color: transparent !important;
  background-repeat: no-repeat; background-position: center; background-size: 14px 14px;
}
#destoon_member .head_t[data-znui-badge="message"] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23788aa3' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='m3.5 7 8.5 6 8.5-6'/%3E%3C/svg%3E");
}
#destoon_member .head_t[data-znui-badge="chat"] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23788aa3' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 15a2 2 0 0 1-2 2H8l-4 3V6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2z'/%3E%3Cpath d='M8 10h8M8 13h5'/%3E%3C/svg%3E");
}
#destoon_member .head_t b {
  position: absolute; top: -7px; right: -9px;
  min-width: 15px; height: 15px; padding: 0 3px !important; margin: 0 !important;
  border: 0 !important; border-radius: 999px; background: #d92d20;
  color: #fff !important; font-size: 10px !important; font-weight: 700 !important;
  font-family: inherit; line-height: 15px !important; text-align: center;
  white-space: nowrap; float: none !important;
}

/* 系统 Dcard() 只设置 left 与 fadeIn，定位/皮肤原本依赖旧 style.css。
   这里固定为右上角浮层，绝不进入文档流，避免把整页顶下去。
   v4：系统塞进来的是一列纯文本，site.js 的 buildCard() 会解析成
   「标题 / 身份区 / 签名 / 两列数据格」，下面就是这套卡片的皮肤。 */
#destoon-card {
  position: absolute !important; top: var(--topbar-h, 38px) !important;
  left: auto !important; right: auto !important; z-index: 500;
  display: none; width: 460px; max-width: calc(100vw - 24px);
  padding: 0; background: #fff; overflow: hidden;
  border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 16px 40px rgba(16, 42, 80, .18);
  font-size: 12px; line-height: 1.5; color: var(--ink-600);
  text-align: left; white-space: normal;
  /* 系统 Dcard() 先 fadeIn，再用 JS 定位到会员名下方；淡入期间先藏到视口外避免闪现在右上角 */
  visibility: hidden;
}
#destoon-card[data-znui-placed] { visibility: visible; }
#destoon-card::before { content: none !important; }
#destoon-card a { color: var(--brand-600); text-decoration: none; }
#destoon-card a:hover { text-decoration: underline; }
/* 会员资料卡：设计稿 1:1 —— ①标题行(竖条+姓名+ID胶囊) ②主体(左头像会员名/右4数字+昵称姓名) ③底部通栏签名 */
.zn-card { display: block; padding: 0; }

/* ① 标题行 */
.zn-card__hd {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 16px; border-bottom: 1px solid var(--line);
}
.zn-card__hd-title {
  position: relative; padding-left: 11px;
  font-size: 15px; font-weight: 700; color: var(--ink-900);
}
.zn-card__hd-title::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 15px; border-radius: 2px; background: var(--brand-500);
}
.zn-card__badge {
  flex: none; padding: 3px 11px; border-radius: 999px;
  background: #3457a6; color: #fff; font-size: 12px; font-weight: 700;
  letter-spacing: .02em;
}

/* ② 主体：左右两栏 */
.zn-card__body { display: flex; align-items: stretch; }
.zn-card__id {
  flex: 0 0 138px; min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  padding: 18px 12px;
  background: linear-gradient(160deg, #eef5ff, #f7faff);
  border-right: 1px solid var(--line);
}
.zn-card__avatar {
  flex: none; width: 56px; height: 56px; border-radius: 15px; overflow: hidden;
  display: grid; place-items: center;
  background: linear-gradient(145deg, #4b8bf5, #2b5fd6);
  box-shadow: 0 6px 14px rgba(43, 95, 214, .28);
  color: #fff; font-size: 24px; font-weight: 700;
}
.zn-card__avatar img { width: 100%; height: 100%; object-fit: cover; }
.zn-card__avatar.is-fallback { background: linear-gradient(145deg, #4b8bf5, #2b5fd6); }
.zn-card__username {
  max-width: 100%; font-size: 14px; font-weight: 700; color: var(--brand-600);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.zn-card__data {
  flex: 1 1 auto; min-width: 0;
  display: flex; flex-direction: column;
  padding: 18px 18px 14px;
}
.zn-card__stats { display: flex; }
.zn-card__stat {
  flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 2px 2px 12px; border-right: 1px solid var(--line);
}
.zn-card__stat:first-child { flex: 1.3 1 0; } /* 余额带货币符号，给更宽空间 */
.zn-card__stat:last-child { border-right: 0; }
.zn-card__stat b { font-size: 19px; font-weight: 700; line-height: 1.1;
  color: var(--ink-900); font-variant-numeric: tabular-nums;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zn-card__stat b.is-accent { color: var(--brand-600); }
.zn-card__stat span { font-size: 12px; color: var(--ink-400); }
.zn-card__info {
  display: flex; gap: 30px;
  border-top: 1px solid var(--line); padding-top: 12px;
}
.zn-card__info-item {
  display: flex; align-items: baseline; gap: 8px; min-width: 0;
  font-size: 13px;
}
.zn-card__info-item .ik { flex: none; color: var(--ink-400); }
.zn-card__info-item b { min-width: 0; font-weight: 700; color: var(--ink-900);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ③ 底部通栏签名 */
.zn-card__foot {
  padding: 14px 16px; border-top: 1px solid var(--line);
  text-align: center; font-size: 13px; color: #aeb6c4;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* 站内信 / 新交谈等非会员资料卡：只补基础皮肤，不重排系统 DOM */
#destoon-card.zn-card-plain { padding: 12px 16px; line-height: 1.9; }
#destoon-card.zn-card-plain br { display: none; }
#destoon-card.zn-card-plain img { max-width: 42px; max-height: 42px; border-radius: 50%; }

.zn-legacy, .back2top, #destoon-fixon, #destoon-space { display: none !important; }
