:root {
  --bg: #f4f5f9;
  --card: #ffffff;
  --line: #e8e9f0;
  --text: #1a1c2b;
  --text-2: #5c6070;
  --text-3: #9095a8;
  --primary: #5b5ef4;
  --primary-d: #464ae0;
  --primary-l: #eef0ff;
  --ok: #12a150;
  --ok-l: #e8f8ee;
  --warn: #d97706;
  --warn-l: #fef6e7;
  --err: #e5484d;
  --err-l: #fdecec;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 22, 40, .04), 0 8px 24px -12px rgba(20, 22, 40, .12);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; font-size: 14px; }

/* 布局 */
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 620px; margin: 0 auto; padding: 0 20px; }

header.top {
  background: rgba(255,255,255,.85); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
}
.top-inner { display: flex; align-items: center; gap: 14px; height: 60px; }
/* 头部客服微信：红字醒目，点击复制 */
.kf-wechat {
  display: inline-flex; align-items: center; gap: 4px; flex: none;
  font-size: 13.5px; font-weight: 700; color: #e02020;
  background: #fff1f0; border: 1px solid #ffc2c0; border-radius: 8px;
  padding: 5px 10px; cursor: pointer; white-space: nowrap;
  transition: background .15s, color .15s;
}
.kf-wechat b { font-family: ui-monospace, Consolas, monospace; font-weight: 700; }
.kf-wechat:hover { background: #ffe3e1; }
.kf-wechat.ok { color: #12a150; background: #e8f8ee; border-color: #b7e6c6; }
/* 客服机器人 QQ：和客服微并排，蓝色区分。点击直接唤起 QQ 加好友 */
.kf-qq {
  display: inline-flex; align-items: center; gap: 4px; flex: none;
  font-size: 13.5px; font-weight: 700; color: #1666c0;
  background: #eaf3ff; border: 1px solid #b9d8ff; border-radius: 8px;
  padding: 5px 10px; white-space: nowrap; text-decoration: none;
  transition: background .15s, color .15s;
}
.kf-qq b { font-family: ui-monospace, Consolas, monospace; font-weight: 700; }
.kf-qq:hover { background: #d9eaff; color: #0f56a8; }
.logo { display: flex; align-items: center; gap: 9px; flex: none; white-space: nowrap; font-weight: 700; font-size: 17px; letter-spacing: -.2px; }
.logo .dot {
  width: 26px; height: 26px; border-radius: 8px; flex: none;
  background: linear-gradient(135deg, #6f72ff, #4b4ee6);
  box-shadow: 0 4px 10px -4px rgba(91,94,244,.7);
  position: relative;
}
.logo .dot::after {
  content: ""; position: absolute; inset: 7px; border-radius: 3px;
  border: 2px solid #fff; border-right-color: transparent; border-bottom-color: transparent;
  transform: rotate(45deg);
}
.top nav { margin-left: auto; display: flex; gap: 4px; }
.top nav a {
  color: var(--text-2); padding: 7px 13px; border-radius: 9px; font-size: 14px; font-weight: 500;
  white-space: nowrap;
}
.top nav a:hover { background: var(--primary-l); color: var(--primary); }
/* 导航里的重点入口（软件下载）：红字高亮 */
.top nav a.nav-hot { color: var(--err); font-weight: 600; }
.top nav a.nav-hot:hover { background: var(--err-l); color: var(--err); }

/* 卡片 */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-pad { padding: 22px; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 42px; padding: 0 20px; border-radius: 10px; border: 1px solid transparent;
  background: var(--primary); color: #fff; font-weight: 600; font-size: 14px;
  cursor: pointer; transition: .16s; white-space: nowrap;
}
.btn:hover { background: var(--primary-d); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn.ghost { background: #fff; border-color: var(--line); color: var(--text-2); }
.btn.ghost:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-l); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn.danger { background: var(--err); }
.btn.danger:hover { background: #cf3a3f; }

/* 表单 */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--text-2); font-weight: 600; margin-bottom: 6px; }
.input, .textarea, .select {
  width: 100%; padding: 10px 13px; border: 1px solid var(--line); border-radius: 10px;
  background: #fbfbfd; color: var(--text); outline: none; transition: .16s;
}
.input:focus, .textarea:focus, .select:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(91,94,244,.1); }
.textarea { min-height: 130px; resize: vertical; font-family: ui-monospace, Consolas, monospace; font-size: 13px; line-height: 1.7; }

/* 下单弹窗里的「微信 / QQ」二选一 + 说明小字 */
.field label .mini { font-weight: 400; color: var(--text-3); font-size: 12px; }
.buyer-seg { display: flex; gap: 8px; margin-bottom: 8px; }
.seg-btn {
  flex: 1; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px;
  background: #fbfbfd; color: var(--text-2); font-size: 13.5px; font-weight: 600;
  cursor: pointer; transition: .16s;
}
.seg-btn:hover { border-color: #c9cbf2; color: var(--primary); }
.seg-btn.on {
  background: var(--primary-l); border-color: #c3c6fb; color: var(--primary-d);
  box-shadow: inset 0 0 0 1px rgba(91,94,244,.25);
}

/* 商品网格 */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 16px; }
.product {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; transition: .2s; display: flex; flex-direction: column;
}
.product:hover { border-color: #c9cbff; box-shadow: 0 12px 30px -16px rgba(70,74,224,.35); transform: translateY(-2px); }
.product .ph { height: 120px; background: linear-gradient(135deg, #eef0ff, #e6f0ff); position: relative; overflow: hidden; }
.product .ph img { width: 100%; height: 100%; object-fit: cover; }
.product .ph .tag {
  position: absolute; top: 10px; left: 10px; background: rgba(255,255,255,.94);
  border-radius: 6px; padding: 2px 8px; font-size: 11px; font-weight: 700; color: var(--primary);
}
.product .body { padding: 16px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
/* 外链商品：封面区文字占位（无封面图时顶上），两行 = 商品名 + 副标题 */
.product .ph .ph-text {
  width: 100%; height: 100%; padding: 14px 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px; text-align: center;
  background: linear-gradient(135deg, var(--primary-l), #e9f3ff);
}
.product .ph .ph-text b {
  font-size: 19px; font-weight: 650; line-height: 1.3; letter-spacing: -.3px;
  color: var(--text); word-break: break-word;
  /* 名字过长时最多两行，避免把 120px 的封面区撑爆被裁掉半截 */
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.product .ph .ph-text span {
  font-size: 19px; font-weight: 650; line-height: 1.3; letter-spacing: -.3px;
  color: var(--text); word-break: break-word;
  max-width: 100%;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
/* 外链卡片：价签位改成「查看详情」行动点 —— 字重沿用 .price 的 750，颜色用主行动色（--err 在本站是价格/售罄语义，容易与价格混淆） */
.product .price.link-cta { font-size: 15.5px; letter-spacing: 0; color: var(--primary); }
.product.product-link:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.product h3 { font-size: 15.5px; font-weight: 650; letter-spacing: -.2px; }
.product .sub { font-size: 12.5px; color: var(--text-3); min-height: 19px; }
.product .foot { margin-top: auto; padding-top: 12px; display: flex; align-items: baseline; gap: 8px; }
.price { color: var(--err); font-weight: 750; font-size: 21px; letter-spacing: -.5px; }
.price small { font-size: 13px; font-weight: 600; margin-right: 1px; }
.stock { margin-left: auto; font-size: 12px; color: var(--text-3); }
.stock.out { color: var(--err); }

/* 提示条 */
.alert { padding: 12px 14px; border-radius: 10px; font-size: 13.5px; display: flex; gap: 9px; align-items: flex-start; line-height: 1.55; }
.alert.info { background: var(--primary-l); color: #3b3fbf; }
.alert.warn { background: var(--warn-l); color: #a15c04; }
.alert.ok { background: var(--ok-l); color: #0c7a3c; }
.alert.err { background: var(--err-l); color: #b3373b; }

/* 徽标 */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 650; }
.badge.gray { background: #f0f1f6; color: var(--text-2); }
.badge.blue { background: var(--primary-l); color: var(--primary); }
.badge.green { background: var(--ok-l); color: var(--ok); }
.badge.orange { background: var(--warn-l); color: var(--warn); }
.badge.red { background: var(--err-l); color: var(--err); }

/* 弹窗 */
.mask {
  position: fixed; inset: 0; background: rgba(18,20,35,.5); backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.mask.show { display: flex; }
.modal {
  background: #fff; border-radius: 16px; width: 100%; max-width: 460px; padding: 24px;
  box-shadow: 0 24px 60px -20px rgba(10,12,30,.45); max-height: 90vh; overflow: auto;
}
.modal h3 { font-size: 17px; margin-bottom: 4px; }
.modal .m-sub { font-size: 13px; color: var(--text-3); margin-bottom: 18px; }

/* 表格 */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
  text-align: left; font-weight: 650; color: var(--text-3); font-size: 12px;
  padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap;
  text-transform: uppercase; letter-spacing: .3px;
}
td { padding: 10px; border-bottom: 1px solid #f2f3f8; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafafe; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }

.toast {
  position: fixed; left: 50%; top: 24px; transform: translate(-50%, -20px);
  background: #1a1c2b; color: #fff; padding: 10px 18px; border-radius: 10px;
  font-size: 13.5px; opacity: 0; pointer-events: none; transition: .25s; z-index: 999;
  box-shadow: 0 10px 30px -10px rgba(0,0,0,.4); max-width: 90vw;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--err); }
.toast.ok { background: var(--ok); }

.muted { color: var(--text-3); font-size: 13px; }
.center { text-align: center; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
.mt24 { margin-top: 24px; } .mb12 { margin-bottom: 12px; } .mb16 { margin-bottom: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.spacer { flex: 1; }
.hide { display: none !important; }

footer.foot { padding: 40px 0 30px; text-align: center; color: var(--text-3); font-size: 12.5px; }
footer.foot p + p { margin-top: 4px; }

/* 中小屏头部改为两行：品牌与客服一行，导航独占一行，避免中文被逐字挤成竖排 */
@media (max-width: 900px) {
  .top-inner { flex-wrap: wrap; height: auto; gap: 6px 12px; padding-top: 10px; padding-bottom: 8px; }
  .kf-wechat { margin-left: auto; }
  .top nav { order: 3; width: 100%; margin-left: 0; gap: 4px; }
  .top nav a { flex: 1; min-width: 0; padding: 7px 4px; text-align: center; }
}

@media (max-width: 640px) {
  .wrap, .narrow { padding: 0 14px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .product .ph { height: 96px; }
  .product .body { padding: 12px; }
  .price { font-size: 18px; }
  /* 手机上封面区只有 96px 高，占位文字要再收紧一点，两行长名字才不会顶出格 */
  .product .ph .ph-text { padding: 8px 10px; gap: 3px; }
  .product .ph .ph-text b { font-size: 15px; }
  .product .ph .ph-text span { font-size: 15px; }
  .product .price.link-cta { font-size: 14px; }
  .logo { font-size: 16px; }
  .top nav a { padding: 6px 2px; font-size: 12.5px; }
  /* 手机上头部空间紧，客服按钮缩一档 */
  .kf-wechat { padding: 4px 8px; font-size: 12.5px; }
  th, td { padding: 8px 6px; font-size: 12.5px; }
}

/* ---------- 全网查价 ---------- */
.quote-box {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 20px;
}
.quote-title { display: flex; align-items: center; gap: 10px; }
/* 标题左边、接口状态徽章右边 */
.quote-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.quote-top .badge { flex-shrink: 0; cursor: pointer; user-select: none; }
.quote-top .badge:hover { filter: brightness(.96); }
.quote-ico {
  width: 34px; height: 34px; border-radius: 10px; background: var(--primary-l);
  display: grid; place-items: center; font-size: 16px; flex-shrink: 0;
}
.quote-h { font-weight: 700; font-size: 16px; letter-spacing: -.2px; }
.quote-sub { color: var(--text-3); font-size: 12.5px; margin-top: 2px; }
.quote-form { display: flex; gap: 10px; margin-top: 14px; }
.quote-form .input { flex: 1; min-width: 0; }
.quote-tip { margin-top: 12px; font-size: 13px; color: var(--text-3); }
.quote-tip.hide { display: none; }
.quote-tip.err { color: var(--err); }
.quote-tip.ok { color: var(--text-2); }

/* 购卡须知（查价框下方） */
.quote-note {
  margin-top: 12px; padding: 10px 12px 10px 13px;
  background: #fbfbfe; border: 1px solid var(--line); border-left: 3px solid #c9cbf2;
  border-radius: 10px; color: var(--text-3); font-size: 12.5px; line-height: 1.75;
}
.quote-note-h {
  color: var(--text-2); font-weight: 700; font-size: 12.5px;
  margin-bottom: 4px; letter-spacing: .2px;
}
.quote-note p { margin: 0; }
.quote-note p + p { margin-top: 3px; }
.quote-note-agree { color: var(--text-2); font-weight: 600; margin-top: 5px !important; }
/* 对总代/技术说的话：不属于条款，用一条分隔线隔开，避免被误读成第 ④ 条免责声明 */
.quote-note-invite {
  margin-top: 7px !important; padding-top: 7px; border-top: 1px dashed var(--line);
  color: var(--primary); font-weight: 600;
}
/* 即时公告：店主随时改的临时通知，位置在购卡须知下方；后台留空则整块不显示 */
.quote-live {
  margin-top: 10px; padding: 10px 13px;
  background: #fff5f5; border: 1px solid #ffd3d3; border-left: 3px solid #e02020;
  border-radius: 10px; font-size: 12.5px; line-height: 1.75;
}
.quote-live.hide { display: none; }
.quote-live-h {
  display: flex; align-items: center; gap: 6px;
  color: #e02020; font-weight: 700; font-size: 12.5px; margin-bottom: 4px;
}
.quote-live-dot {
  width: 6px; height: 6px; border-radius: 50%; background: #e02020;
  box-shadow: 0 0 0 3px rgba(224, 32, 32, .14); flex: 0 0 auto;
}
.quote-live-body { color: var(--text-2); white-space: pre-wrap; word-break: break-word; }
/* 有人同时在查价：渠道排队、价格可能滞后，用醒目但克制的琥珀色提示 */
.quote-warn {
  margin-top: 10px; padding: 9px 12px; border-radius: 9px;
  font-size: 12.5px; line-height: 1.6;
  color: #8a5a00; background: #fff7e6; border: 1px solid #ffe0a3;
}
.quote-warn.hide { display: none; }
.quote-actions { display: flex; justify-content: flex-end; margin-bottom: 2px; }
.quote-list { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.quote-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); transition: border-color .15s, box-shadow .15s;
}
.quote-item:hover { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-l); }
.qi-main { flex: 1; min-width: 0; }
.qi-name { font-weight: 600; font-size: 14.5px; line-height: 1.4; word-break: break-word; }
.qi-meta { color: var(--text-3); font-size: 12px; margin-top: 3px; }
/* 渠道限价：上游要求不得低于某个价，跟客户讲清楚为什么这个价不能更低 */
.qi-limit { color: #e02020; font-weight: 600; }
.qi-side { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.qi-side .price { font-size: 18px; }

@media (max-width: 560px) {
  .quote-box { padding: 14px; }
  .quote-form { flex-direction: column; }
  .quote-item { flex-wrap: wrap; }
  .qi-side { width: 100%; justify-content: space-between; }
  .qi-side .price { font-size: 17px; }
}

/* 窄屏头部排三行：品牌 / 客服微 + QQ机器人 / 导航。
   不使用 flex-basis:100% 强制换行，否则按钮背景会铺满整整一行。
   这段放在文件最后，才能覆盖前面 900px 断点里的 margin-left:auto。 */
@media (max-width: 640px) {
  .top-inner > .logo { flex: 0 0 100%; }
  .top-inner > .kf-wechat { margin-left: 0; font-size: 13px; padding: 5px 8px; }
  .top-inner > .kf-qq { margin-left: auto; font-size: 13px; padding: 5px 8px; }
}
