/* ==========================================================================
   临沂商城 · 设计系统（tokens / 版式 / 头部 / 导航 / 通用组件 / 页脚 / 响应式）
   海外采购门户版式：奶白底 + 大圆角卡片 + 药丸控件 + 浅蓝导航条
   主色改为深蓝 #1F3C70，强调色琥珀 #FFC21F
   ========================================================================== */
:root {
  /* 主色：深蓝 */
  --brand: #1F3C70;
  --brand2: #2C5698;
  --brand3: #4A79C4;
  --brand-d: #16305C;
  --brand-l: #4A79C4;
  --bsoft: #EAF2FD;
  --bsoft2: #E2EDFC;
  /* 强调色：琥珀 */
  --accent: #FFC21F;
  --accent2: #FFD94A;
  --asoft: #FFF7D6;
  --accent-ink: #233048;
  --gold: #C89A3C;
  --gold-l: #E8C87E;
  /* 文本与线 */
  --ink: #232B3A;
  --ink2: #465062;
  --ink3: #8791A3;
  --line: #E7EAF3;
  --line2: #F0F3F9;
  --bg: #FAFBFD;
  --paper: #F3F7FD;
  --card: #FFFFFF;
  /* 语义色 */
  --ok: #2BA05F;
  --oksoft: #E3F7EC;
  --warn: #D98A00;
  --warnsoft: #FFF3D6;
  --bad: #E04B34;
  --badsoft: #FDEAE6;
  --hot: #E8443A;
  --hotsoft: #FDEAE6;
  /* 圆角与阴影 */
  --r: 20px;
  --r-s: 12px;
  --r-xs: 10px;
  --sh: 0 1px 2px rgba(31, 60, 112, .04), 0 10px 30px -18px rgba(31, 60, 112, .22);
  --sh-h: 0 22px 44px -22px rgba(31, 60, 112, .40);
  /* 字体：统一无衬线，标题靠字重与字距拉开层级（与参考站一致） */
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Noto Sans SC", Roboto, Helvetica, Arial, sans-serif;
  --serif: var(--sans);
  --max: 1200px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 15px; line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--ink); }
h1, h2, h3, h4, h5 { margin: 0; font-weight: 800; line-height: 1.22; letter-spacing: -.02em; }
p { margin: 0; }
::selection { background: rgba(31, 60, 112, .14); }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.serif { font-family: var(--serif); }
.lbl { color: var(--ink3); font-size: 13px; }
.mono { font-variant-numeric: tabular-nums; }
.hide { display: none !important; }

/* ------------------------------------------------------------------ 顶栏 -- */
.topbar {
  background: var(--brand); color: #D9E4F6; font-size: 12.5px;
  letter-spacing: .01em; padding: 8px 0; text-align: center;
}
.topbar b { color: var(--accent); font-weight: 700; }

/* ---------------------------------------------------------------- 页头 -- */
header.site {
  position: sticky; top: 0; z-index: 60;
  background: rgba(250, 251, 253, .94);
  backdrop-filter: saturate(150%) blur(10px);
}
.hd { display: flex; align-items: center; gap: 22px; padding: 14px 24px 12px; max-width: var(--max); margin: 0 auto; }
.logo { display: flex; align-items: center; gap: 12px; flex: none; }
.logo img {
  width: 56px; height: 56px; border-radius: 0; object-fit: contain; flex: none;
}
.logo-tx b {
  display: block; font-size: 19px; letter-spacing: -.01em; font-weight: 800;
  line-height: 1.15; color: var(--brand);
}
.logo-tx span {
  display: block; font-size: 9px; letter-spacing: .1em; color: var(--ink3);
  text-transform: uppercase; margin-top: 3px; font-weight: 600;
}

/* 右上角胶囊按钮（参考图：浅描边 + 国旗方块） */
.hd-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* 语言切换器 */
.lang { position: relative; }
.lang-btn {
  display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 15px 0 8px;
  border: 1px solid #E4E8F0; border-radius: 999px; background: #fff;
  cursor: pointer; font-size: 12.5px; color: var(--ink); font-weight: 700; transition: .16s;
  box-shadow: 0 2px 10px -6px rgba(31, 60, 112, .3);
}
.lang-btn:hover { border-color: var(--brand3); box-shadow: var(--sh); }
.lang-flag-cur {
  width: 24px; height: 18px; flex: none; object-fit: cover;
  border-radius: 4px; border: 1px solid rgba(31, 60, 112, .12);
}
.lang-caret { width: 0; height: 0; border: 4px solid transparent; border-top-color: var(--ink3); margin-top: 3px; }
.lang-cur { font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
/* 我的账户：白底浅描边胶囊 */
#acct-btn {
  height: 38px; padding: 0 16px; border-radius: 999px;
  border: 1px solid #DCE4F6; background: #fff; color: var(--brand);
  box-shadow: 0 2px 10px -6px rgba(31, 60, 112, .3);
}
#acct-btn:hover { background: var(--bsoft); border-color: var(--brand3); }
.lang-dd {
  position: absolute; right: 0; top: 44px; width: 214px; max-height: 340px; overflow: auto;
  margin: 0; padding: 6px; list-style: none; background: #fff;
  border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--sh-h);
  display: none; z-index: 80;
}
.lang.open .lang-dd { display: block; }
.lang-dd li {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 10px;
  cursor: pointer; font-size: 13px; color: var(--ink2);
}
.lang-dd li:hover { background: var(--bsoft); }
.lang-dd li.on { color: var(--brand); font-weight: 700; background: var(--bsoft); }
.lang-flag { width: 18px; height: 13px; object-fit: cover; border-radius: 3px; flex: none; }
.lang-fb {
  font-style: normal; font-size: 9px; letter-spacing: .06em; color: var(--ink3);
  border: 1px solid var(--line); border-radius: 3px; padding: 0 3px;
}
/* 部分本地化语种的标注（区别于纯英文承载） */
.lang-fb.is-part { color: #8A6D1F; border-color: #EBD9A8; background: #FFFAED; }
.lang-ck { margin-left: auto; font-size: 11px; opacity: 0; color: var(--brand); }
.lang-dd li.on .lang-ck { opacity: 1; }

/* 语种完整度提示条（非完整语种显示在页头下方，可关闭） */
.lang-note {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 30px; background: #FFFBEF; border-bottom: 1px solid #F2E4BF;
  font-size: 12.5px; line-height: 1.5; color: #7A6220;
}
.lang-note p { flex: 1; margin: 0; }
.lang-note .ln-ico {
  width: 16px; height: 16px; flex: none; border-radius: 50%; display: grid; place-items: center;
  font-size: 10px; font-weight: 800; font-style: normal; color: #fff; background: #D9A81C;
}
.lang-note .ln-x {
  flex: none; width: 24px; height: 24px; border: 0; border-radius: 50%; background: transparent;
  color: #A08A45; font-size: 16px; line-height: 1; cursor: pointer;
}
.lang-note .ln-x:hover { background: rgba(217, 168, 28, .14); color: #7A6220; }

/* -------------------------------------------------------------- 主导航 -- */
/* 浅蓝色带 + 白色激活标签（激活项底部琥珀短线），与参考站一致 */
nav.main {
  width: 100%;
  background: var(--bsoft);
  border-top: 1px solid #DCE8FA;
  border-bottom: 1px solid #DCE8FA;
}
nav.main .wrap {
  display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
  padding: 0 24px;
}
nav.main .wrap::-webkit-scrollbar { display: none; }
nav.main a {
  position: relative; display: flex; align-items: center; gap: 7px; flex: none;
  padding: 11px 16px 12px; font-size: 14px; font-weight: 600; color: #16233A;
  white-space: nowrap; border-radius: 0; transition: background .16s, color .16s;
}
nav.main a .nv-ico { display: none; }
/* 韩语文案较长：导航收紧间距与字号，避免末项在常规桌面宽度下被裁切 */
html[data-lang="ko"] nav.main .wrap { gap: 1px; }
html[data-lang="ko"] nav.main a { padding: 11px 10px 12px; font-size: 13px; letter-spacing: -0.2px; }
@media (max-width: 1240px) {
  html[data-lang="ko"] nav.main a { padding: 10px 8px 11px; font-size: 12.5px; }
}
/* 日语导航同样偏长：轻度收紧，保证 11 项完整显示 */
html[data-lang="ja"] nav.main .wrap { gap: 1px; }
html[data-lang="ja"] nav.main a { padding: 11px 9px 12px; font-size: 13px; letter-spacing: -0.1px; }
@media (max-width: 1240px) {
  html[data-lang="ja"] nav.main a { padding: 10px 7px 11px; font-size: 12.5px; }
}
/* 俄语导航最长：进一步收紧字号与间距 */
html[data-lang="ru"] nav.main .wrap { gap: 1px; }
html[data-lang="ru"] nav.main a { padding: 11px 8px 12px; font-size: 12.5px; letter-spacing: -0.1px; }
@media (max-width: 1240px) {
  html[data-lang="ru"] nav.main a { padding: 10px 6px 11px; font-size: 12px; }
}
/* 西班牙语导航偏长：收紧到与俄语同级 */
html[data-lang="es"] nav.main .wrap { gap: 1px; }
html[data-lang="es"] nav.main a { padding: 11px 8px 12px; font-size: 12.5px; letter-spacing: -0.1px; }
@media (max-width: 1240px) {
  html[data-lang="es"] nav.main a { padding: 10px 6px 11px; font-size: 12px; }
}
/* 法语导航略超基准宽度：只压缩左右内距，字号保持 */
html[data-lang="fr"] nav.main a { padding: 11px 6px 12px; }
nav.main a:hover { background: #DCE8FA; color: #000; }
nav.main a.on {
  background: #fff; color: var(--brand); font-weight: 800;
  box-shadow: inset 0 -3px 0 var(--accent);
}

/* ---------------------------------------------------------------- 按钮 -- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 42px; padding: 0 20px; border-radius: 12px; border: 1.5px solid transparent;
  font-size: 14px; font-weight: 700; cursor: pointer; transition: .16s; white-space: nowrap;
  background: var(--brand); color: #fff;
}
.btn:hover { background: var(--brand2); transform: translateY(-1px); }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.btn-o { background: #fff; color: var(--brand); border-color: var(--line); }
.btn-o:hover { background: var(--bsoft); border-color: var(--brand3); color: var(--brand); }
.btn-p { background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 16px -6px rgba(255, 194, 31, .6); }
.btn-p:hover { background: #F2B100; }
.btn-ghost { background: rgba(255, 255, 255, .16); color: #fff; border-color: rgba(255, 255, 255, .46); }
.btn-ghost:hover { background: rgba(255, 255, 255, .26); }
.btn-dark { background: var(--ink); }
.btn-dark:hover { background: #000; }
.btn-sm { height: 36px; padding: 0 15px; font-size: 13px; border-radius: 999px; }
.btn-lg { height: 50px; padding: 0 28px; font-size: 15px; border-radius: 14px; }
.link { color: var(--brand); font-weight: 700; cursor: pointer; }
.link:hover { text-decoration: underline; }

/* ------------------------------------------------------------ 区块标题 -- */
.sec { padding: 56px 0; }
.sec.tight { padding: 36px 0; }
.sec-paper { background: var(--paper); }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.kicker {
  font-size: 11.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink2);
  font-weight: 800; margin-bottom: 8px;
}
.sec-title { font-size: 27px; letter-spacing: -.022em; font-weight: 800; color: var(--ink); }
.sec-desc { color: var(--ink3); font-size: 14px; margin-top: 8px; max-width: 660px; }
.sec-more { flex: none; font-size: 13px; color: var(--ink2); display: inline-flex; gap: 5px; align-items: center; font-weight: 600; }
.sec-more:hover { color: var(--brand); }

/* ---------------------------------------------------------------- 卡片 -- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.card-pad { padding: 22px; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 11px;
  border-radius: 999px; background: var(--bsoft); color: var(--brand2); font-size: 12px;
  border: 1px solid var(--bsoft2); font-weight: 600;
}
.chip.brand { background: var(--bsoft); color: var(--brand); border-color: #D3E3F9; }
.chip.gold { background: var(--asoft); color: #8A6410; border-color: #F4E3A6; }
.chip.ok { background: var(--oksoft); color: var(--ok); border-color: #CFEEDD; }
.badge {
  display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 7px;
  font-size: 11px; font-weight: 800; letter-spacing: .02em;
}
.badge.hot { background: var(--hotsoft); color: var(--hot); }
.badge.new { background: var(--oksoft); color: var(--ok); }

/* -------------------------------------------------------------- 页脚 -- */
footer.site { background: var(--brand); color: #C9D8EF; margin-top: 44px; }
footer.site .ft { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr 1fr; gap: 32px; padding: 52px 24px 34px; }
footer.site h5 { font-size: 12px; letter-spacing: .14em; color: #fff; margin-bottom: 14px; text-transform: uppercase; font-weight: 800; }
footer.site a { display: block; font-size: 13px; color: #AFC3E0; padding: 4px 0; }
footer.site a:hover { color: var(--accent); }
footer.site .ft-about { font-size: 13px; color: #A0B6D6; line-height: 1.85; max-width: 360px; }
.ft-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.ft-brand img { width: 38px; height: 38px; border-radius: 10px; background: #fff; padding: 3px; }
.ft-brand b { font-size: 18px; color: #fff; letter-spacing: -.01em; font-weight: 800; }
footer .copy {
  border-top: 1px solid rgba(255, 255, 255, .12); padding: 16px 24px; font-size: 12px;
  color: #93AACD; text-align: center;
}
/* 版权行右侧的版本标记：等宽数字 + 细竖线分隔，弱化层级不与版权抢视线 */
footer .copy .ver {
  position: relative; margin-left: 12px; padding-left: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px; letter-spacing: .03em; font-variant-numeric: tabular-nums;
  color: #7E96BB; white-space: nowrap;
}
footer .copy .ver::before {
  content: ''; position: absolute; left: 0; top: 50%; width: 1px; height: 10px;
  margin-top: -5px; background: rgba(255, 255, 255, .18);
}
/* 页脚底部：关注我们（社媒）+ 联系我们（电话 / 邮箱） */
.ft-soc { border-top: 1px solid rgba(255, 255, 255, .12); background: rgba(0, 0, 0, .14); }
.ft-soc-in {
  display: flex; flex-wrap: wrap; align-items: flex-start;
  gap: 30px clamp(48px, 9vw, 110px);
  padding: 26px 24px 30px;
}
footer.site .ft-soc-in h5 { margin-bottom: 14px; }

/* 社媒图标：品牌色圆角方块 + 白色标识（缩小并排一行、整体居中） */
.ft-soc-icons { display: flex; flex-wrap: nowrap; justify-content: center; gap: 10px; }
footer.site .ft-soc-icons a { display: block; padding: 0; line-height: 0; border-radius: 10px; }
footer.site .ft-soc-icons a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.ft-soc-icons svg {
  width: 34px; height: 34px; display: block; border-radius: 10px;
  transition: transform .18s ease, box-shadow .18s ease;
}
footer.site .ft-soc-icons a:hover svg { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(0, 0, 0, .35); }

/* 联系方式行：暗色图标胶囊 + 文字 */
.ft-soc-rows { display: flex; flex-direction: column; gap: 12px; }
footer.site .ft-soc-row { display: flex; align-items: center; gap: 12px; font-size: 13px; color: #C9D8EF; padding: 0; }
footer.site .ft-soc-row .ic {
  width: 34px; height: 34px; flex: none; border-radius: 10px; background: rgba(255, 255, 255, .1);
  display: flex; align-items: center; justify-content: center; color: #E6EEF9;
}
.ft-soc-row .ic svg { width: 17px; height: 17px; }
footer.site .ft-soc-row:hover { color: var(--accent); }
footer.site .ft-soc-row:hover .ic { background: rgba(255, 255, 255, .18); }

/* 窄屏：图标缩到 30px、缩小间距，保证 8 个在同一行居中（390px 下 282px < 可用宽） */
@media (max-width: 620px) {
  .ft-soc-in { padding: 22px 18px 26px; gap: 26px; }
  .ft-soc-icons { gap: 6px; }
  .ft-soc-icons svg { width: 30px; height: 30px; border-radius: 9px; }
}

/* ------------------------------------------------------------ 响应式 -- */
@media (max-width: 1080px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  footer.site .ft { grid-template-columns: 1.4fr 1fr 1fr; row-gap: 26px; }
}
@media (max-width: 900px) {
  .sec { padding: 42px 0; }
  .sec-title { font-size: 22px; }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hd { padding: 10px 16px 10px; gap: 12px; }
  .logo-tx b { font-size: 16px; }
  .logo img { width: 44px; height: 44px; }
  .logo-tx span { font-size: 8px; }
  nav.main .wrap { padding: 0 10px; }
  nav.main a { padding: 10px 12px 11px; font-size: 13px; }
  .sec-head { flex-direction: column; align-items: flex-start; gap: 8px; }
}
@media (max-width: 620px) {
  body { font-size: 14px; }
  .wrap { padding: 0 16px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .sec-title { font-size: 20px; }
  footer.site .ft { grid-template-columns: 1fr 1fr; gap: 22px; padding: 36px 18px 24px; }
  footer.site .ft > div:first-child { grid-column: 1 / -1; }
  .topbar { font-size: 11px; padding: 6px 0; }
  .btn { height: 40px; font-size: 13.5px; }
  /* 窄屏语言切换器保留「全球站点」文字，压缩间距避免挤压 LOGO */
  .hd-actions { gap: 8px; }
  .lang-btn { height: 38px; padding: 0 9px 0 7px; gap: 5px; font-size: 12px; }
  .lang-cur { font-size: 12px; letter-spacing: 0; }
  .lang-flag-cur { width: 22px; height: 16px; }
  /* 移动端隐藏「我的账户」，语言按钮(全球站点)独占右侧 */
  #acct-btn { display: none; }
  .lang-note { padding: 8px 14px; gap: 7px; font-size: 12px; }
  .lang-note .ln-x { width: 22px; height: 22px; }
}
/* 超窄屏：保留「全球站点」文字（移动端用户靠它识别入口）。
   语言按钮不收缩，改让 LOGO 文字区可压缩 + 省略号，避免长语种撑破页头 */
@media (max-width: 420px) {
  .wrap.hd { gap: 12px; }
  .logo { flex: 1 1 auto; min-width: 0; }
  .logo img { width: 44px; height: 44px; }
  .logo-tx { min-width: 0; }
  .logo-tx b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .hd-actions { margin-left: auto; flex: none; gap: 0; }
  .lang-btn { padding: 0 7px 0 6px; gap: 4px; }
  .lang-cur { font-size: 11.5px; letter-spacing: -0.2px; }
  .lang-flag-cur { width: 20px; height: 15px; }
}

/* 网格子项默认 min-width:auto 会被横向内容撑破，统一兜底 */
.catalog > *, .split > *, .pd > *, .ai-shell > *, .entries > *, .g2 > *, .g3 > *, .g4 > * { min-width: 0; }
.pgrid { min-width: 0; }
