:root {
  --ink: #16181a;
  --ink-soft: #4b5257;
  --ink-mute: #8b9398;
  --line: #e3e6e8;
  --bg: #ffffff;
  --bg-soft: #f6f8f9;
  --accent: #1f5f78;
  --accent-ink: #ffffff;
  --radius: 10px;
  --wrap: 1140px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

img { max-width: 100%; display: block; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

/* header */
.site-header {
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 20;
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 64px;
  flex-wrap: wrap;
}
.brand { font-weight: 600; font-size: 19px; letter-spacing: -0.01em; }
.brand small { display: block; font-size: 11px; font-weight: 400; color: var(--ink-mute); letter-spacing: 0.02em; }
.nav { display: flex; gap: 18px; flex-wrap: wrap; margin-left: auto; font-size: 14px; align-items: center; }
.nav a { color: var(--ink-soft); }
.nav a.is-current, .nav .is-current { color: var(--ink); font-weight: 500; }

/* ---- 抽屉专用的「首页」入口：桌面隐藏 ----
   桌面靠左上角品牌名回首页，再加一项会把顶栏挤到换行。
   手机抽屉里补一个显式入口：触屏没有 hover，品牌名看起来只是纯文字。 */
@media (min-width: 701px) {
  .nav-home { display: none; }
}

/* ---- 汉堡按钮：只在窄屏出现（见 ≤700px），桌面完全隐藏 ---- */
.nav-toggle {
  display: none;
  margin-left: auto;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  flex: 0 0 auto;
}
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
  display: block;
  content: "";
  width: 16px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}
.nav-toggle-bars { position: relative; }
.nav-toggle-bars::before { position: absolute; left: 0; top: -5px; }
.nav-toggle-bars::after { position: absolute; left: 0; top: 5px; }
/* 展开时三条杠变叉号，再点一下收起来 */
.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: rotate(45deg); top: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: rotate(-45deg); top: 0; }

/* ---- 下拉菜单（品类 / 语种） ---- */
.nav-item { position: relative; }
.nav-link {
  font: inherit;
  color: var(--ink-soft);
  background: none;
  border: 0;
  padding: 6px 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
}
.nav-link:hover, .nav-link.is-current { color: var(--ink); }
.nav-btn.is-current { font-weight: 500; }
.caret { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid currentColor; opacity: .65; }
.globe {
  width: 13px; height: 13px; border: 1.5px solid currentColor; border-radius: 50%;
  display: inline-block; position: relative; opacity: .7;
}
.globe::before { content: ""; position: absolute; left: 50%; top: -1.5px; bottom: -1.5px; width: 0; border-left: 1.5px solid currentColor; transform: translateX(-50%); }
.nav-menu {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 268px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 28px rgba(0,0,0,0.10);
  padding: 6px;
  z-index: 30;
}
.has-menu.open .nav-menu { display: block; }
/* 桌面端：悬停即展开，同时保留点击展开。
   注意按钮与菜单之间有 10px 间隙，鼠标下移经过间隙会丢失 hover 导致菜单收起，
   所以用一块透明「桥梁」把间隙盖住（见 .has-menu::after）。 */
@media (min-width: 701px) {
  .has-menu:hover .nav-menu { display: block; }
  .has-menu::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 12px;
  }
}
.menu-item { display: block; padding: 8px 12px; border-radius: 7px; font-size: 14px; color: var(--ink-soft); }
.menu-item:hover { background: var(--bg-soft); color: var(--ink); }
.menu-item.is-current { color: var(--ink); font-weight: 500; }
.menu-sep { height: 1px; background: var(--line); margin: 6px 8px; }
.nav-lang { margin-left: 4px; }
.lang-menu { left: auto; right: 0; min-width: 218px; max-height: 70vh; overflow: auto; }
.lang-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lang-label { display: inline-flex; align-items: center; gap: 9px; min-width: 0; }
.lang-code { font-size: 11px; color: var(--ink-mute); letter-spacing: .04em; flex: 0 0 auto; }
.flag {
  width: 20px;
  height: 15px;
  object-fit: cover;
  border-radius: 2px;
  border: 1px solid rgba(0,0,0,0.10);
  display: block;
  flex: 0 0 auto;
}

/* RTL（阿拉伯语）：只做必要镜像，避免布局错乱 */
html[dir="rtl"] .nav { margin-left: 0; margin-right: auto; }
html[dir="rtl"] .nav-menu { left: auto; right: 0; }
html[dir="rtl"] .lang-menu { right: auto; left: 0; }
html[dir="rtl"] .crumbs, html[dir="rtl"] .mini li { direction: rtl; }
html[dir="rtl"] table.spec th, html[dir="rtl"] table.spec td,
html[dir="rtl"] .price-table th, html[dir="rtl"] .price-table td { text-align: right; }
html[dir="rtl"] .outline-list { padding-left: 0; padding-right: 20px; }

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  line-height: 1.2;
}
.btn:hover { border-color: var(--ink-mute); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #174d61; border-color: #174d61; color: var(--accent-ink); }
.btn-sm { padding: 7px 12px; font-size: 13px; }

/* hero */
.hero { padding: 56px 0 40px; border-bottom: 1px solid var(--line); }
.hero h1 { font-size: 34px; line-height: 1.25; margin: 0 0 16px; letter-spacing: -0.02em; max-width: 20em; }
.hero p { font-size: 17px; color: var(--ink-soft); max-width: 44em; margin: 0 0 24px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.facts { display: flex; flex-wrap: wrap; gap: 28px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.fact strong { display: block; font-size: 18px; }
/* 只作用于直接子级标签，避免把内部 .todo-flag 的配色和字号一起覆盖掉 */
.fact > span { font-size: 13px; color: var(--ink-mute); }

section.block { padding: 44px 0; border-bottom: 1px solid var(--line); }
h2.section-title { font-size: 24px; margin: 0 0 6px; letter-spacing: -0.01em; }
p.section-lead { color: var(--ink-soft); margin: 0 0 26px; max-width: 44em; }

/* category tiles */
.cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.cat-tile { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; background: var(--bg-soft); display: flex; flex-direction: column; }
.cat-tile h3 { margin: 0 0 8px; font-size: 16px; }
.cat-tile p { margin: 0 0 14px; font-size: 14px; color: var(--ink-soft); flex: 1; }
.cat-tile .count { font-size: 12px; color: var(--ink-mute); }

/* product grid */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.card { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; background: #fff; }
.card-img { aspect-ratio: 1 / 1; background: var(--bg-soft); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.img-placeholder { font-size: 11px; color: var(--ink-mute); text-align: center; padding: 12px; word-break: break-all; }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-sku { font-size: 12px; color: var(--ink-mute); letter-spacing: 0.04em; }
.card h3 { margin: 0; font-size: 15px; line-height: 1.35; }
.mini { margin: 0; padding: 0; list-style: none; font-size: 13px; color: var(--ink-soft); }
.mini li { display: flex; justify-content: space-between; gap: 10px; border-top: 1px dashed var(--line); padding: 3px 0; }
.mini li:first-child { border-top: 0; }
.mini span { color: var(--ink-mute); flex: 0 0 auto; }
.card-price { font-size: 15px; font-weight: 500; margin-top: auto; }
.card-price em { font-style: normal; font-size: 12px; color: var(--ink-mute); font-weight: 400; }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* product detail */
.crumbs { font-size: 13px; color: var(--ink-mute); padding: 18px 0 0; }
.detail { display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; padding: 26px 0 44px; }
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.gallery .shot { aspect-ratio: 1 / 1; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 8px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.gallery .shot:first-child { grid-column: span 2; }
.gallery img { width: 100%; height: 100%; object-fit: cover; }
/* 细节图区：工厂详情大图，多数是长条。按自然比例整幅显示，不裁切、不并排。 */
.detail-imgs .dshot { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin: 0 0 12px; }
.detail-imgs .dshot img { width: 100%; height: auto; display: block; }
.detail-imgs { max-width: 760px; }
.detail h1 { font-size: 26px; margin: 0 0 6px; line-height: 1.3; }
.detail .sub { color: var(--ink-mute); font-size: 13px; margin-bottom: 20px; }

table.spec { width: 100%; border-collapse: collapse; font-size: 14px; margin-bottom: 24px; }
table.spec th, table.spec td { text-align: left; padding: 9px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
table.spec th { font-weight: 400; color: var(--ink-mute); width: 42%; }
table.spec td { color: var(--ink); }

h3.block-title { font-size: 15px; margin: 0 0 10px; letter-spacing: 0.01em; }
.price-table { width: 100%; border-collapse: collapse; font-size: 14px; margin-bottom: 8px; }
.price-table th, .price-table td { text-align: left; padding: 10px 12px; border: 1px solid var(--line); }
.price-table th { background: var(--bg-soft); font-weight: 500; font-size: 13px; }
.price-table td.qty { color: var(--ink-soft); }
/* 每盒单价区间：放在分档明细表之前，字号要比表格抢眼 —— 买家最先想知道「大概多少钱」 */
.price-range { font-size: 21px; font-weight: 600; margin: 0 0 12px; letter-spacing: -0.2px; }
.price-range em { font-style: normal; font-size: 13px; color: var(--ink-mute); font-weight: 400; }
.muted { color: var(--ink-mute); font-size: 13px; font-weight: 400; }
.note { font-size: 13px; color: var(--ink-mute); margin: 0 0 24px; }
.cta-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 24px; }

.policy { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; background: var(--bg-soft); font-size: 14px; }
.policy dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; }
.policy dt { color: var(--ink-mute); }
.policy dd { margin: 0; }

.outline-list { font-size: 14px; color: var(--ink-soft); padding-left: 20px; }
.outline-list li { margin-bottom: 6px; }

/* inquiry bar + panel */
#inquiry-bar { position: fixed; right: 18px; bottom: 18px; z-index: 40; }
.inq-toggle { box-shadow: 0 6px 20px rgba(0,0,0,0.16); }
.inq-panel { position: fixed; right: 18px; bottom: 74px; width: min(380px, calc(100vw - 36px)); max-height: 70vh; overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 36px rgba(0,0,0,0.18); padding: 16px; z-index: 41; }
.inq-panel h4 { margin: 0 0 4px; font-size: 15px; }
.inq-panel .hint { font-size: 12px; color: var(--ink-mute); margin: 0 0 12px; }
.inq-item { border-top: 1px solid var(--line); padding: 10px 0; }
.inq-item:first-of-type { border-top: 0; }
.inq-item .name { font-size: 13px; margin-bottom: 6px; }
.inq-item .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inq-item input[type="number"] { width: 84px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font-family: inherit; font-size: 13px; }
.inq-item input[type="text"] { flex: 1; min-width: 120px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font-family: inherit; font-size: 13px; }
.inq-item .remove { background: none; border: 0; color: var(--ink-mute); cursor: pointer; font-size: 12px; padding: 0; }
.inq-empty { font-size: 13px; color: var(--ink-mute); }
.inq-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; border-top: 1px solid var(--line); padding-top: 14px; }
.inq-badge { display: inline-block; min-width: 18px; text-align: center; background: rgba(255,255,255,0.25); border-radius: 9px; font-size: 12px; padding: 1px 5px; }

/* ---- 数量步进器：−〔输入框〕+（产品页 + 询价面板共用）---- */
.pick { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stepper { display: inline-flex; align-items: stretch; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.stepper .step { width: 34px; min-height: 34px; border: 0; background: var(--bg-soft); color: var(--ink); font-size: 17px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.stepper .step:hover { background: #e7eef2; }
.stepper .step:active { background: #dbe6ec; }
/* 数量已在下限时，减号的实际含义变成「去掉这一款」——用红色把这个语义说清楚，
   否则用户以为只是不能再减，不知道再按一下会删掉整行 */
.stepper .step.at-min { color: #c0392b; }
.stepper .step.at-min:hover { background: #fdecea; }
/* 输入框在步进器里要去掉自带边框和上下箭头，
   否则会和 ± 按钮的边框叠成三重线，手机上看着很脏 */
.stepper input[type="number"] { width: 76px; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); border-radius: 0; text-align: center; font-family: inherit; font-size: 14px; padding: 7px 4px; -moz-appearance: textfield; }
.stepper input[type="number"]::-webkit-outer-spin-button,
.stepper input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.inq-item .stepper input[type="number"] { width: 76px; border-top: 0; border-bottom: 0; }
/* hidden 必须真的生效：.btn 和 .stepper 都写了 display，
   会盖掉浏览器默认的 [hidden] { display: none }。
   少了这条，卡片加进清单后会出现「按钮和步进器同时显示」。 */
.btn[hidden], .stepper[hidden], .pick[hidden] { display: none; }
/* 列表卡片比详情页窄，步进器收一号 */
.card-actions .stepper .step { width: 30px; min-height: 30px; font-size: 15px; }
.card-actions .stepper input[type="number"] { width: 56px; font-size: 13px; padding: 6px 3px; }

/* ---- 起订量校验（单款 50 / 步长 10 / 整单 500）---- */
.inq-item.has-issue input[type="number"] { border-color: #c0392b; }
.inq-err { font-size: 12px; color: #c0392b; margin-top: 6px; }
.inq-total { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.inq-total span { font-size: 12px; color: var(--ink-mute); }
.inq-total.is-short strong { color: #c0392b; }
.inq-total .bad { color: #c0392b; }
/* 不达标时发送按钮是 disabled，视觉上必须一眼看出点不了 */
.btn[disabled] { opacity: 0.45; cursor: not-allowed; pointer-events: none; }

/* footer */
.site-footer { padding: 36px 0 60px; font-size: 13px; color: var(--ink-mute); }
.site-footer .foot-grid { display: flex; gap: 32px; flex-wrap: wrap; justify-content: space-between; }
.site-footer a { color: var(--ink-soft); }
.site-footer .foot-legal { color: var(--ink-soft); font-size: 12px; }

/* misc */
.pill-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.pill { font-size: 13px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-soft); }
.pill.is-on { border-color: var(--ink); color: var(--ink); }
.todo-flag { display: inline-block; font-size: 11px; font-weight: 500; color: #5c3606; background: #fbedd2; border: 1px solid #d9ad62; border-radius: 4px; padding: 1px 6px; margin-left: 6px; white-space: nowrap; }

@media (max-width: 900px) {
  .grid, .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .detail { grid-template-columns: 1fr; gap: 26px; }
  .hero h1 { font-size: 27px; }
}
@media (max-width: 700px) {
  .header-inner { min-height: 56px; gap: 8px; padding-top: 8px; }
  .brand { font-size: 17px; }
  /* 窄屏与桌面保持一致：六项导航全部显示。
     此前窄屏是「隐藏这四项 → 塞进产品下拉里」，两个问题：
       ① 语义不对——起订量/样品/工厂/联系我们 不是产品，藏在「产品」里没人找得到；
       ② 手机上等于把主要入口埋了两层。
     也没有改用「横滑」：横滑会把后面几项推到屏幕外，手机用户不会知道要滑，
     看不见就等于没有。宁可顶栏占两行，也要每一项都看得见、点得到。 */
  /* 窄屏出现汉堡按钮 */
  .nav-toggle { display: inline-flex; }

  /* 导航收成抽屉：默认隐藏，点汉堡展开。
     抽屉相对 .site-header 定位（top:100% 即顶栏下沿），
     刻意不写死像素值——顶栏高度随语种文案变化，写死的值必然跑位。
     五项导航与语种选择器全部收进抽屉，顶栏因此只剩一行。 */
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-left: 0;
    width: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    font-size: 15px;
    background: #fff;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 14px 30px rgba(0,0,0,0.12);
    padding: 4px 0 8px;
    max-height: calc(100vh - 72px);
    overflow: auto;
    z-index: 30;
  }
  .nav.open { display: flex; }

  /* 抽屉里每一项都整宽、竖向排列，手指好点 */
  .nav a { white-space: normal; }
  .nav > a.nav-link,
  .nav .nav-btn {
    display: flex;
    align-items: center;
    /* 必须是 flex-start，不能是 space-between：
       品类按钮是「文字 + 箭头」两个孩子，space-between 看起来正常；
       但语种按钮是「地球 + 文字 + 箭头」三个孩子，space-between 会把
       文字挤到正中间，整行变成地球在最左、中文在中间、箭头在最右，
       既显得占满一整行，又和品类那行长得不一样。 */
    justify-content: flex-start;
    width: 100%;
    padding: 13px 20px;
    border-radius: 0;
    text-align: left;
    font: inherit;
  }
  .nav-item { position: static; }
  /* 箭头统一推到最右，两行因此长得完全一致 */
  .nav .nav-btn .caret { margin-left: auto; }

  /* 子菜单改成内联手风琴，不再做浮层——抽屉里多层浮层会互相压住 */
  .nav-menu {
    position: static;
    left: auto;
    right: auto;
    min-width: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: var(--bg-soft);
    padding: 4px 0;
    max-height: none;
    overflow: visible;
  }
  .menu-item { padding: 11px 20px 11px 34px; border-radius: 0; }
  .menu-sep { margin: 4px 20px; }

  /* 语种并进抽屉，与其他导航项完全同款（不再单独加分隔线，避免看起来像另一类东西） */
  .nav-lang { margin-left: 0; }
}
@media (max-width: 600px) {
  .grid, .cat-grid { grid-template-columns: 1fr; }
  .hero { padding: 32px 0 26px; }
  .fact strong { font-size: 16px; }
  .inq-toggle { padding: 9px 14px; font-size: 13px; }
}
@media (max-width: 700px) {
  /* 询价入口在手机端必须常驻。
     曾经的写法是「清单为空就隐藏，加了商品才出现」，理由是别遮挡正文——
     但结果是新访客在手机上根本看不到这个按钮，等于不知道站里有询价清单。
     改成始终显示，同时给正文底部留出空间，按钮就不会压住最后一行内容。 */
  body { padding-bottom: 84px; }
}
