@charset "UTF-8";
/* ==========================================================================
   DPJ Wholesale · 前台主题 · 基础与全站外框
   --------------------------------------------------------------------------
   背景：前台样式此前由 StorefrontRenderer 内联拼接 15 层 CSS，层与层互相覆盖，
   且 :root 里存在两套冲突的调色板（蓝色 #1f5a96 与绿色 #087f5b），导致页眉导航
   在英文长类目名下换行错乱、间距与字阶不统一。

   本文件由 page() 在内联 <style> 之后以 <link> 引入，同优先级下凭"后加载"稳定取胜。
   要覆盖旧层里带 !important 的声明时，本文件显式使用 !important 并就近注释原因。

   文件划分（每个 ≤600 行）：
   - storefront-theme.css（本文件）：设计令牌、基础版式、页眉、页脚、按钮、表单
   - storefront-home.css：首页专属板块（主视觉、买家条、分类与商品栅格、卡片）
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 设计令牌（Design tokens）
   重定义旧层同名变量 → 整站调色板一次性收口为"墨黑 + 品牌绿"体系。
   -------------------------------------------------------------------------- */
:root {
  /* 文本 */
  --sf-ink: #16191c;          /* 主标题 / 深色文本 */
  --sf-ink-soft: #3f474b;     /* 正文 */
  --sf-muted: #6d767a;        /* 次要说明、元信息 */
  --sf-faint: #98a1a5;        /* 更弱的提示 */

  /* 品牌绿（沿用前台既有识别色，统一深浅档位） */
  --sf-accent: #0b7a53;
  --sf-accent-dark: #08603f;
  --sf-accent-soft: #e9f4ee;
  --sf-accent-line: #cfe6db;

  /* 兼容旧层引用（旧层把 --sf-blue/--sf-teal 当品牌色用，这里统一指向品牌绿） */
  --sf-blue: #0b7a53;
  --sf-teal: #0b7a53;
  --sf-gold: #9a6b1f;

  /* 表面与描边 */
  --sf-surface: #ffffff;
  --sf-canvas: #ffffff;
  --sf-soft: #f5f8f6;
  --sf-panel: #f5f8f6;
  --sf-warm: #f7f1e6;
  --sf-line: #e2e7e4;
  --sf-line-soft: #eef1ef;

  /* 圆角 */
  --sf-radius-xs: 4px;
  --sf-radius-sm: 6px;
  --sf-radius: 8px;
  --sf-radius-lg: 12px;
  --sf-pill: 999px;

  /* 版心与栅格 */
  --sf-container: 1240px;
  --sf-gutter: 32px;

  /* 阴影（分层，避免"到处都是重投影"） */
  --sf-shadow-xs: 0 1px 2px rgba(18, 26, 32, .05);
  --sf-shadow-sm: 0 2px 8px rgba(18, 26, 32, .06);
  --sf-shadow-md: 0 10px 28px rgba(18, 26, 32, .10);
  --sf-shadow-lg: 0 18px 48px rgba(18, 26, 32, .16);

  /* 动效 */
  --sf-ease: cubic-bezier(.22, .61, .36, 1);
  --sf-fast: .15s;
  --sf-base: .22s;
  --sf-slow: .34s;

  /* 字体栈：不引入 Web Font，直接用系统字体，零网络开销且各平台观感现代 */
  --sf-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  --sf-font-display: var(--sf-font);
}

/* --------------------------------------------------------------------------
   2. 基础重置与版式
   -------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--sf-font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--sf-ink-soft);
  background: var(--sf-canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; height: auto; }

/* 字阶：标题用更深字重 + 收紧字距，形成清晰视觉层次 */
h1, h2, h3, h4 {
  margin: 0 0 .5em;
  font-family: var(--sf-font-display);
  color: var(--sf-ink);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -.015em;
}

h1 { font-size: clamp(28px, 4vw, 46px); line-height: 1.1; }
h2 { font-size: clamp(21px, 2.3vw, 30px); }
h3 { font-size: 17px; font-weight: 750; line-height: 1.35; letter-spacing: -.005em; }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

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

/* 只有键盘导航才显示焦点环，鼠标点击不出现，兼顾可访问性与观感 */
:focus-visible {
  outline: 2px solid var(--sf-accent);
  outline-offset: 2px;
  border-radius: var(--sf-radius-xs);
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* 跳转到主内容：键盘用户第一个 Tab 命中 */
.skip-link {
  position: absolute;
  left: 50%; top: 0;
  transform: translate(-50%, -120%);
  z-index: 200;
  padding: 10px 18px;
  background: var(--sf-ink);
  color: #fff;
  border-radius: 0 0 var(--sf-radius-sm) var(--sf-radius-sm);
  font-size: 14px;
  font-weight: 700;
  transition: transform var(--sf-fast) var(--sf-ease);
}
.skip-link:focus, .skip-link:focus-visible { transform: translate(-50%, 0); color: #fff; }

/* 通栏容器：所有 section 共用同一版心与左右留白 */
.band,
.hero,
.page-hero,
.product-detail,
.breadcrumbs,
.section-jump,
.category-tools {
  width: 100%;
  max-width: var(--sf-container);
  margin-inline: auto;
  padding-inline: var(--sf-gutter);
}

/* 通用文本件 */
.eyebrow {
  margin: 0 0 8px;
  color: var(--sf-accent-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.freshness,
.updated { color: var(--sf-muted); font-size: 13px; }
.price {
  margin: 6px 0 8px;
  color: var(--sf-ink);
  font-size: 19px;
  font-weight: 850;
  letter-spacing: -.01em;
}
.mini-score { margin: 0 0 6px; color: var(--sf-muted); font-size: 13px; }

/* --------------------------------------------------------------------------
   3. 公告条
   -------------------------------------------------------------------------- */
.announcement {
  padding: 7px 24px;
  background: var(--sf-ink);
  color: #f1f4f2;
  text-align: center;
  font-size: 12.5px;
  letter-spacing: .01em;
}

/* --------------------------------------------------------------------------
   4. 页眉（品牌 / 搜索 / 导航，单行栅格，永不换行错乱）
   旧实现把 8 个长英文类目名平铺进 flex 容器，窄屏必然折成多行且右对齐参差；
   现改为「Departments + Help」两个下拉菜单，结构稳定、观感克制。
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "brand search nav";
  align-items: center;
  gap: clamp(16px, 2.4vw, 40px);
  /* 左右留白与 .band/.hero 的版心内容边缘严格对齐（否则页眉会比正文宽出 32px） */
  padding: 12px max(var(--sf-gutter), calc((100vw - var(--sf-container)) / 2 + var(--sf-gutter)));
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(1.6) blur(10px);
  border-bottom: 1px solid var(--sf-line);
  box-shadow: none;
}

/* 品牌区 */
.site-header .brand { grid-area: brand; }
.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  text-decoration: none;
}
.brand:before { display: none; }               /* 关闭旧层的装饰方块 */
.brand-mark { display: block; width: 38px; height: 38px; flex: 0 0 38px; }
.brand-wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  color: var(--sf-ink);
  font-size: 17px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
}
.brand-wordmark strong { font-size: 21px; font-weight: 900; letter-spacing: -.02em; }

/* 搜索表单 */
.site-header .site-search { grid-area: search; }
.site-search {
  display: flex;
  min-width: 0;
  max-width: 520px;
  width: 100%;
  justify-self: start;
}
.site-search input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--sf-ink);
  background: var(--sf-surface);
  border: 1px solid var(--sf-line);
  border-right: 0;
  border-radius: var(--sf-radius-sm) 0 0 var(--sf-radius-sm);
  transition: border-color var(--sf-fast) var(--sf-ease), box-shadow var(--sf-fast) var(--sf-ease);
}
.site-search input::placeholder { color: var(--sf-faint); }
.site-search input:focus {
  outline: none;
  border-color: var(--sf-accent);
  box-shadow: inset 0 0 0 1px var(--sf-accent);
}
.site-search button {
  flex: 0 0 auto;
  min-width: 84px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  color: #fff;
  background: var(--sf-accent);
  border: 1px solid var(--sf-accent);
  border-radius: 0 var(--sf-radius-sm) var(--sf-radius-sm) 0;
  cursor: pointer;
  transition: background var(--sf-fast) var(--sf-ease);
}
.site-search button:hover { background: var(--sf-accent-dark); border-color: var(--sf-accent-dark); }

/* 导航区：两个下拉菜单 */
.site-header > nav {
  grid-area: nav;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  justify-content: flex-end;
  overflow: visible;
  padding-bottom: 0;
}

.header-menu { position: relative; }

.header-menu > summary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  color: var(--sf-ink);
  font-size: 13.5px;
  font-weight: 700;
  list-style: none;
  cursor: pointer;
  border-radius: var(--sf-radius-sm);
  transition: background var(--sf-fast) var(--sf-ease), color var(--sf-fast) var(--sf-ease);
}
.header-menu > summary::-webkit-details-marker { display: none; }
.header-menu > summary::marker { content: ""; }
.header-menu > summary:hover { background: var(--sf-soft); color: var(--sf-accent-dark); }
.header-menu > summary:after {
  content: "";
  width: 6px; height: 6px;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform var(--sf-base) var(--sf-ease);
}
.header-menu[open] > summary:after { transform: rotate(225deg) translate(-1px, -1px); }

/* 下拉面板
   注意：<details> 关闭时其内容由浏览器置为不渲染（等价 display:none），
   因此这里不能用 transition 做入场（关闭态没有可过渡的起始计算样式），
   改用 keyframes —— 元素重新参与渲染时动画会重新播放，效果稳定。 */
.header-menu > .header-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 120;
  display: grid;
  gap: 2px;
  min-width: 268px;
  max-width: min(92vw, 680px);
  max-height: min(72vh, 560px);
  overflow: auto;
  padding: 10px;
  background: var(--sf-surface);
  border: 1px solid var(--sf-line);
  border-radius: var(--sf-radius);
  box-shadow: var(--sf-shadow-lg);
}
.header-menu[open] > .header-menu-panel {
  animation: sf-panel-in var(--sf-base) var(--sf-ease) both;
}
@keyframes sf-panel-in { from { opacity: 0; transform: translateY(-6px) scale(.99); } to { opacity: 1; transform: none; } }

/* 页眉工具入口：直接列出公司/政策页面（原 Departments 下拉已移除，
   类目导航由首页左栏 .hero-departments 承担）。 */
.header-utility {
  display: flex;
  align-items: center;
  flex-wrap: wrap;                               /* 窄屏自动换行，避免撑出横向滚动条 */
  gap: clamp(12px, 1.4vw, 18px);
}
.header-utility a {
  color: var(--sf-ink-soft);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--sf-fast) var(--sf-ease);
}
.header-utility a:hover { color: var(--sf-accent-dark); }

.header-menu-panel a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  color: var(--sf-ink) !important;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  border-radius: var(--sf-radius-xs);
  transition: background var(--sf-fast) var(--sf-ease), color var(--sf-fast) var(--sf-ease);
}
.header-menu-panel a:hover {
  background: var(--sf-soft);
  color: var(--sf-accent-dark) !important;
  text-decoration: none;
}
.header-menu-panel a small { color: var(--sf-muted); font-weight: 650; font-size: 12px; }

/* --------------------------------------------------------------------------
   5. 面包屑
   首页只有 "Home" 一级，属冗余信息 → 只在首页隐藏（:has 退化时仍可见，不影响功能）。
   -------------------------------------------------------------------------- */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding-top: 16px;
  padding-bottom: 4px;
  color: var(--sf-muted);
  font-size: 13.5px;
}
.breadcrumbs span { color: var(--sf-faint); } .breadcrumbs a { color: var(--sf-muted); } .breadcrumbs a:hover { color: var(--sf-accent-dark); }
.breadcrumbs:has(+ .home-hero) { display: none; }

/* --------------------------------------------------------------------------
   6. 按钮
   统一为两种：主按钮（品牌绿实心）与次按钮（描边）。三态齐全，过渡克制。
   -------------------------------------------------------------------------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  min-height: 44px;
  padding: 11px 20px;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 750;
  line-height: 1;
  color: #fff;
  background: var(--sf-accent);
  border: 1px solid var(--sf-accent);
  border-radius: var(--sf-radius-sm);
  box-shadow: none;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--sf-fast) var(--sf-ease),
    border-color var(--sf-fast) var(--sf-ease),
    transform var(--sf-fast) var(--sf-ease),
    box-shadow var(--sf-fast) var(--sf-ease);
}
.button:hover {
  background: var(--sf-accent-dark);
  border-color: var(--sf-accent-dark);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: var(--sf-shadow-sm);
  text-decoration: none;
}
.button:active { transform: translateY(0); box-shadow: none; }
.button.secondary {
  color: var(--sf-ink);
  background: var(--sf-surface);
  border-color: var(--sf-line);
  box-shadow: none;
}
.button.secondary:hover {
  color: var(--sf-accent-dark);
  background: var(--sf-accent-soft);
  border-color: var(--sf-accent-line);
}
.text-link { color: var(--sf-accent-dark); font-weight: 750; } .text-link:hover { color: var(--sf-accent); text-decoration: underline; }

/* --------------------------------------------------------------------------
   7. 表单控件（页眉搜索、页脚订阅、询盘表单共用一套外观）
   -------------------------------------------------------------------------- */
.contact-form input, .contact-form textarea, .contact-form select, .newsletter input,
.site-footer input, .filter-grid select, .purchase-controls input, .purchase-controls select {
  width: 100%;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  color: var(--sf-ink);
  background: var(--sf-surface);
  border: 1px solid var(--sf-line);
  border-radius: var(--sf-radius-sm);
  transition: border-color var(--sf-fast) var(--sf-ease), box-shadow var(--sf-fast) var(--sf-ease);
}
.contact-form input:focus, .contact-form textarea:focus, .contact-form select:focus,
.newsletter input:focus, .site-footer input:focus, .filter-grid select:focus,
.purchase-controls input:focus, .purchase-controls select:focus {
  outline: none;
  border-color: var(--sf-accent);
  box-shadow: 0 0 0 3px var(--sf-accent-soft);
}
.site-footer button {
  padding: 10px 18px;
  font-family: inherit;
  font-weight: 700;
  color: #fff;
  background: var(--sf-accent);
  border: 1px solid var(--sf-accent);
  border-radius: var(--sf-radius-sm);
  cursor: pointer;
}
.site-footer button:hover { background: var(--sf-accent-dark); }

/* --------------------------------------------------------------------------
   8. 页脚
   -------------------------------------------------------------------------- */
.site-footer {
  display: grid;
  grid-template-columns: 1.7fr 1fr 1fr;
  gap: 40px;
  margin-top: 24px;
  padding: 52px max(var(--sf-gutter), calc((100vw - var(--sf-container)) / 2 + var(--sf-gutter))) 44px;
  background: var(--sf-ink);
  color: #b9c1bd;
}
.site-footer h2 {
  margin: 0 0 14px;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.site-footer p { color: #9aa39f; font-size: 14.5px; max-width: 42ch; }
.site-footer a { display: block; margin: 9px 0; color: #cfd7d3; font-size: 14.5px; }
.site-footer a:hover { color: #fff; text-decoration: none; }
.footer-brand { margin-bottom: 14px; }
.footer-brand .brand-wordmark { color: #fff; }
.footer-brand .brand-mark {
  width: 36px;
  height: 36px;
  flex-basis: 36px;
  padding: 3px;
  background: #fff;
  border-radius: var(--sf-radius-xs);
}

/* --------------------------------------------------------------------------
   9. 响应式（外框部分）
   断点与旧层保持一致（1050 / 900 / 700 / 560），避免出现"层与层用到不同断点"。
   -------------------------------------------------------------------------- */
@media (max-width: 1050px) {
  :root { --sf-gutter: 24px; }
}

@media (max-width: 900px) {
  .site-header {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "brand nav" "search search";
    row-gap: 10px;
  }
  .site-search { max-width: none; }
  .site-header > nav { flex-wrap: wrap; row-gap: 6px; }
}

@media (max-width: 700px) {
  :root { --sf-gutter: 16px; }
  .site-header {
    position: static;                            /* 移动端不吸顶，给内容让出高度 */
    gap: 10px;
    padding: 12px 16px;
  }
  .site-header > nav { justify-content: flex-end; }
  /* 浮层改为就地展开，避免小屏遮挡内容 */
  .header-menu > .header-menu-panel {
    position: static;
    min-width: 0;
    width: 100%;
    max-width: none;
    margin-top: 6px;
    box-shadow: none;
    transform: none;
  }
  .header-menu-panel a { white-space: normal; }
  .site-footer {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    padding: 40px 16px 90px;                     /* 底部留白避开客服浮窗 */
  }
  .site-footer section:first-child { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .site-header { grid-template-columns: 1fr; grid-template-areas: "brand" "search" "nav"; }
  .site-header > nav { justify-content: flex-start; }
  .site-footer { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   10. 动效降级
   尊重系统「减少动态效果」设置：只保留必要的即时状态变化。
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  .button:hover { transform: none; }
}
