/* =========================================================
 * 芯选 ChipMall - 全站样式
 * 纯 CSS，无框架依赖；含响应式与打印样式
 * ========================================================= */

/* ---------------- 变量与基础 ---------------- */
:root {
  --primary: #1f5eff;
  --primary-dark: #1546c8;
  --primary-weak: #eaf0ff;
  --accent: #00c2a8;
  --bg: #f5f7fb;
  --art-bg: #eef2f8;
  --card: #ffffff;
  --text: #1c2333;
  --muted: #6b7487;
  --border: #e3e8f2;
  --danger: #e5484d;
  --ok: #16a34a;
  --warn: #f59e0b;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 10px rgba(28, 42, 84, 0.06);
  --shadow-lg: 0 10px 32px rgba(18, 34, 78, 0.14);
  --mono: ui-monospace, SFMono-Regular, Consolas, "Courier New", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img, svg { display: block; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--text); }

.container { width: min(1200px, 100% - 32px); margin-inline: auto; }

.icon { display: inline-flex; width: 18px; height: 18px; flex: none; }
.icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------- 按钮与通用元素 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 9px 18px; font-size: 14px; font-weight: 600;
  transition: all 0.18s ease; white-space: nowrap; user-select: none;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); transform: translateY(-1px); }
.btn-outline { background: #fff; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover:not(:disabled) { background: var(--primary-weak); }
.btn-ghost { background: #fff; color: var(--text); border-color: var(--border); }
.btn-ghost:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: #fff; color: var(--danger); border-color: #f3c1c3; }
.btn-danger:hover:not(:disabled) { background: #fdf0f0; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 7px; }
.btn-sm .icon { width: 15px; height: 15px; }
.btn-lg { padding: 12px 28px; font-size: 15px; }

.tag {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 600; line-height: 1;
  padding: 4px 7px; border-radius: 5px; letter-spacing: 0.5px;
}
.tag-hot { color: #c2410c; background: #ffedd5; }
.tag-new { color: #047857; background: #d1fae5; }
.brand-tag { color: var(--muted); background: #f1f4fa; }

.input, select.input, textarea.input {
  width: 100%; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 9px 12px; background: #fff; outline: none; transition: border 0.15s, box-shadow 0.15s;
}
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(31, 94, 255, 0.12); }
.input.invalid { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(229, 72, 77, 0.12); }

/* ---------------- 头部 ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: #fff; border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 8px rgba(20, 35, 80, 0.05);
}
.header-inner { display: flex; align-items: center; gap: 22px; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; flex: none; }
.logo-mark {
  width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary), #4f8bff); color: #fff;
  box-shadow: 0 4px 10px rgba(31, 94, 255, 0.35);
}
.logo-mark .icon { width: 22px; height: 22px; }
.logo-mark svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.logo-text { font-size: 19px; font-weight: 800; letter-spacing: 1px; display: flex; flex-direction: column; line-height: 1.15; }
.logo-text em { font-style: normal; font-size: 10px; font-weight: 600; letter-spacing: 2.5px; color: var(--muted); }
.logo-light .logo-text { color: #fff; }
.logo-light .logo-text em { color: rgba(255, 255, 255, 0.6); }

.header-search {
  flex: 1; display: flex; max-width: 480px;
  border: 2px solid var(--primary); border-radius: 10px; overflow: hidden; background: #fff;
}
.header-search input { flex: 1; border: none; outline: none; padding: 8px 14px; font-size: 13px; min-width: 0; }
.header-search button {
  display: flex; align-items: center; gap: 5px;
  border: none; background: var(--primary); color: #fff; padding: 0 16px; font-size: 13px; font-weight: 600;
}
.header-search button:hover { background: var(--primary-dark); }
.header-search .icon { width: 15px; height: 15px; }

.main-nav { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.main-nav a {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 8px; font-weight: 600; color: #3d4660; position: relative;
}
.main-nav a:hover { background: var(--primary-weak); color: var(--primary); }
.main-nav a.active { color: var(--primary); background: var(--primary-weak); }
.cart-link .icon { width: 17px; height: 17px; }
.cart-badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: #d5dbe8; color: #fff; font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; line-height: 1;
  transition: background 0.2s;
}
.cart-badge.show { background: var(--danger); }
.cart-badge.pop { animation: badgePop 0.35s ease; }
@keyframes badgePop { 40% { transform: scale(1.35); } 100% { transform: scale(1); } }

.nav-toggle { display: none; border: 1px solid var(--border); background: #fff; border-radius: 8px; width: 38px; height: 38px; color: var(--text); }
.nav-toggle .icon { width: 20px; height: 20px; }

/* ---------------- 首页 Hero ---------------- */
.hero {
  background:
    radial-gradient(600px 300px at 85% 20%, rgba(0, 194, 168, 0.18), transparent 60%),
    radial-gradient(500px 260px at 10% 90%, rgba(79, 139, 255, 0.25), transparent 60%),
    linear-gradient(135deg, #0b1a3a 0%, #123067 55%, #16408c 100%);
  color: #fff; overflow: hidden; position: relative;
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(700px 400px at 30% 40%, #000 30%, transparent 75%);
}
.hero-inner {
  position: relative; display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 30px;
  align-items: center; padding: 58px 0 34px;
}
.hero-kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; letter-spacing: 2px; color: #8fd7ff; font-weight: 600; margin-bottom: 14px;
}
.hero-kicker::before { content: ""; width: 26px; height: 2px; background: #8fd7ff; border-radius: 2px; }
.hero h1 { font-size: 38px; line-height: 1.25; letter-spacing: 1px; }
.hero h1 strong { color: #6fe3d2; }
.hero p.lead { margin-top: 14px; color: rgba(230, 238, 255, 0.78); font-size: 15px; max-width: 520px; }
.hero-cta { display: flex; gap: 14px; margin-top: 26px; flex-wrap: wrap; }
.hero-cta .btn-primary { background: #4f8bff; box-shadow: 0 6px 18px rgba(79, 139, 255, 0.4); }
.hero-cta .btn-primary:hover { background: #3d7bff; }
.hero-cta .btn-ghost { background: rgba(255, 255, 255, 0.08); color: #fff; border-color: rgba(255, 255, 255, 0.35); }
.hero-cta .btn-ghost:hover { background: rgba(255, 255, 255, 0.16); }
.hero-art { display: flex; justify-content: center; }
.hero-art .chipart { width: min(360px, 80%); height: auto; filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.45)); animation: float 5s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-12px); } }

.hero-stats {
  position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
  padding: 22px 0 30px;
}
.hero-stats .stat {
  background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius); padding: 14px 18px; backdrop-filter: blur(4px);
}
.hero-stats b { display: block; font-size: 24px; color: #6fe3d2; font-family: var(--mono); }
.hero-stats span { font-size: 12px; color: rgba(230, 238, 255, 0.7); }

/* ---------------- 服务承诺条 / 区块 ---------------- */
.feature-strip { background: #fff; border-bottom: 1px solid var(--border); }
.feature-strip .container { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; padding: 18px 0; }
.feature-item { display: flex; align-items: center; gap: 12px; }
.feature-item .icon { width: 34px; height: 34px; padding: 7px; border-radius: 10px; background: var(--primary-weak); color: var(--primary); }
.feature-item b { display: block; font-size: 14px; }
.feature-item span { font-size: 12px; color: var(--muted); }

.section { padding: 42px 0 10px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.section-title { font-size: 24px; letter-spacing: 0.5px; display: flex; align-items: center; gap: 12px; }
.section-title::before { content: ""; width: 5px; height: 22px; border-radius: 3px; background: linear-gradient(180deg, var(--primary), var(--accent)); }
.section-sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.see-all { display: inline-flex; align-items: center; gap: 4px; color: var(--primary); font-weight: 600; font-size: 13px; }
.see-all .icon { width: 15px; height: 15px; }
.see-all:hover { text-decoration: underline; }

/* ---------------- 分类卡片 ---------------- */
.cat-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.cat-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 14px; text-align: center; transition: all 0.2s ease; position: relative; overflow: hidden;
}
.cat-card::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 3px;
  background: var(--c, var(--primary)); opacity: 0; transition: opacity 0.2s;
}
.cat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: transparent; }
.cat-card:hover::after { opacity: 1; }
.cat-icon {
  width: 46px; height: 46px; margin: 0 auto 10px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--c, #3b82f6) 12%, #fff); color: var(--c, #3b82f6);
}
.cat-icon .icon { width: 24px; height: 24px; }
.cat-card b { display: block; font-size: 15px; }
.cat-card .en { font-size: 11px; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; }
.cat-card p { font-size: 12px; color: var(--muted); margin-top: 7px; min-height: 34px; }
.cat-card .count { font-size: 12px; color: var(--c, var(--primary)); font-weight: 700; margin-top: 4px; }

/* ---------------- 产品卡片 ---------------- */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 16px; }
.product-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; transition: all 0.2s ease;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: transparent; }
.card-art { background: var(--art-bg); padding: 10px; }
.card-art .chipart { width: 100%; height: auto; transition: transform 0.25s ease; }
.product-card:hover .chipart { transform: scale(1.045); }
.card-body { padding: 13px 15px 15px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.card-model-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-model { font-family: var(--mono); font-weight: 700; font-size: 14.5px; color: var(--text); }
.card-model:hover { color: var(--primary); }
.card-title { font-size: 12.5px; color: #47506a; }
.card-sub { font-size: 12px; color: var(--muted); }
.card-price { display: flex; align-items: baseline; gap: 10px; margin-top: 2px; }
.price { font-size: 18px; font-weight: 800; color: var(--danger); font-family: var(--mono); }
.stock { font-size: 12px; color: var(--muted); }
.card-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 6px; }
.moq { font-size: 12px; color: var(--muted); }

/* ---------------- 面包屑 ---------------- */
.breadcrumb { padding: 16px 0 0; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { color: #c3cad9; }
.breadcrumb .cur { color: var(--text); font-weight: 600; }

/* ---------------- 分类浏览页 ---------------- */
.catalog-layout { display: grid; grid-template-columns: 232px 1fr; gap: 20px; align-items: start; padding: 20px 0 40px; }
.filters {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 16px; position: sticky; top: 80px;
}
.filters-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.filters-head b { font-size: 15px; display: flex; align-items: center; gap: 7px; }
.filters-head b .icon { width: 16px; height: 16px; color: var(--primary); }
.filters-clear { border: none; background: none; color: var(--muted); font-size: 12px; }
.filters-clear:hover { color: var(--primary); }
.fgroup { padding: 12px 0; border-top: 1px dashed var(--border); }
.fgroup:first-of-type { border-top: none; }
.fgroup > b { display: block; font-size: 13px; margin-bottom: 9px; color: #333d55; }
.fcheck {
  display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 6px;
  font-size: 13px; color: #47506a; cursor: pointer; user-select: none;
}
.fcheck:hover { background: var(--primary-weak); color: var(--primary); }
.fcheck input { accent-color: var(--primary); width: 15px; height: 15px; cursor: pointer; }
.fcheck .cnt { margin-left: auto; font-size: 11px; color: #a2abc0; font-family: var(--mono); }
.flist-scroll { max-height: 220px; overflow: auto; }
.price-inputs { display: flex; align-items: center; gap: 8px; }
.price-inputs input { width: 100%; padding: 7px 9px; border: 1px solid var(--border); border-radius: 7px; outline: none; }
.price-inputs input:focus { border-color: var(--primary); }
.price-inputs span { color: var(--muted); }
.filters-toggle { display: none; }

.toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.result-count { font-size: 13px; color: var(--muted); }
.result-count b { color: var(--primary); font-family: var(--mono); }
.sort-box { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.sort-box select {
  border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; background: #fff; outline: none; cursor: pointer;
}
.sort-box select:focus { border-color: var(--primary); }

.empty-state {
  grid-column: 1 / -1; text-align: center; padding: 70px 20px; color: var(--muted);
  background: var(--card); border: 1px dashed var(--border); border-radius: var(--radius);
}
.empty-state .icon { width: 52px; height: 52px; margin: 0 auto 14px; color: #c3cad9; }
.empty-state b { display: block; font-size: 16px; color: var(--text); margin-bottom: 6px; }
.empty-state .btn { margin-top: 16px; }

/* ---------------- 产品详情页 ---------------- */
.detail-layout { display: grid; grid-template-columns: 430px 1fr; gap: 26px; padding: 22px 0 8px; align-items: start; }
.detail-gallery {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; position: sticky; top: 84px;
}
.detail-gallery .chipart { width: 100%; height: auto; }
.detail-gallery .gallery-note { text-align: center; font-size: 12px; color: var(--muted); margin-top: 10px; }

.detail-info { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px 26px; }
.detail-model { font-family: var(--mono); font-size: 22px; font-weight: 800; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.detail-title { color: #47506a; margin-top: 6px; font-size: 14px; }
.detail-tags { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.info-price {
  margin-top: 16px; background: linear-gradient(90deg, #fff6f0, #fff);
  border: 1px solid #ffe3d2; border-radius: var(--radius-sm); padding: 14px 18px;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.info-price .price { font-size: 26px; }
.info-price .p-label { font-size: 12px; color: var(--muted); }
.meta-row { display: flex; gap: 26px; flex-wrap: wrap; margin-top: 14px; font-size: 13px; color: #47506a; }
.meta-row b { color: var(--text); font-family: var(--mono); }
.meta-row .ok { color: var(--ok); font-weight: 700; }
.qty-box { display: flex; align-items: center; gap: 14px; margin-top: 18px; flex-wrap: wrap; }
.stepper {
  display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #fff;
}
.stepper button {
  width: 34px; height: 36px; border: none; background: #f5f7fb; color: #47506a;
  display: flex; align-items: center; justify-content: center;
}
.stepper button:hover { background: var(--primary-weak); color: var(--primary); }
.stepper button:disabled { opacity: 0.4; cursor: not-allowed; }
.stepper .icon { width: 14px; height: 14px; }
.stepper input {
  width: 64px; height: 36px; border: none; outline: none; text-align: center;
  font-family: var(--mono); font-weight: 700; font-size: 14px;
}
.qty-note { font-size: 12px; color: var(--muted); }
.detail-btns { display: flex; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.detail-desc { margin-top: 18px; font-size: 13.5px; color: #47506a; border-top: 1px dashed var(--border); padding-top: 14px; }

.detail-section { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 26px; margin: 18px 0; }
.detail-section > h3 { font-size: 17px; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.detail-section > h3::before { content: ""; width: 4px; height: 16px; border-radius: 2px; background: var(--primary); }
.param-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.param-table th, .param-table td { border: 1px solid var(--border); padding: 9px 14px; text-align: left; }
.param-table th { background: #f7f9fd; color: #333d55; font-weight: 600; white-space: nowrap; width: 140px; }
.param-table td { color: #47506a; }
.feature-list li {
  display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; color: #47506a; font-size: 13.5px;
}
.feature-list .icon { width: 17px; height: 17px; color: var(--ok); margin-top: 2px; }

/* ---------------- 购物车页 ---------------- */
.cart-layout { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start; padding: 20px 0 46px; }
.cart-list { display: flex; flex-direction: column; gap: 12px; }
.cart-row {
  display: grid; grid-template-columns: 96px 1fr auto auto auto; gap: 16px; align-items: center;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px;
  transition: box-shadow 0.2s;
}
.cart-row:hover { box-shadow: var(--shadow); }
.cart-thumb { background: var(--art-bg); border-radius: var(--radius-sm); padding: 6px; }
.cart-thumb .chipart { width: 100%; height: auto; }
.cart-info b { display: block; font-family: var(--mono); font-size: 14.5px; }
.cart-info .ci-title { font-size: 12.5px; color: #47506a; margin-top: 2px; }
.cart-info .ci-sub { font-size: 12px; color: var(--muted); margin-top: 4px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.cart-price { font-family: var(--mono); font-weight: 700; color: var(--text); }
.cart-price small { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }
.cart-sub { font-family: var(--mono); font-weight: 800; color: var(--danger); font-size: 16px; min-width: 90px; text-align: right; }
.cart-del {
  border: none; background: none; color: #b6bed0; width: 34px; height: 34px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.cart-del:hover { color: var(--danger); background: #fdf0f0; }
.cart-del .icon { width: 18px; height: 18px; }
.cart-head-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px;
}
.cart-head-row b { font-size: 17px; }

.summary-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; position: sticky; top: 84px;
}
.summary-card h3 { font-size: 16px; margin-bottom: 14px; }
.summary-row { display: flex; justify-content: space-between; font-size: 13.5px; color: #47506a; padding: 6px 0; }
.summary-row b { font-family: var(--mono); }
.summary-total { border-top: 1px dashed var(--border); margin-top: 8px; padding-top: 12px; display: flex; justify-content: space-between; align-items: baseline; }
.summary-total span { font-size: 13px; color: var(--muted); }
.summary-total b { font-size: 24px; font-family: var(--mono); color: var(--danger); }
.summary-card .btn { width: 100%; margin-top: 16px; }
.summary-tip { font-size: 12px; color: var(--muted); margin-top: 12px; display: flex; gap: 7px; align-items: flex-start; }
.summary-tip .icon { width: 15px; height: 15px; margin-top: 1px; color: var(--warn); }

/* 采购单历史 */
.history-wrap { padding-bottom: 50px; }
.history-list { display: flex; flex-direction: column; gap: 10px; }
.history-item {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 13px 18px;
}
.history-item .h-no { font-family: var(--mono); font-weight: 700; }
.history-item .h-time { font-size: 12px; color: var(--muted); }
.history-item .h-meta { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.history-item .h-amount { font-family: var(--mono); font-weight: 800; color: var(--danger); }
.history-item .h-status { font-size: 11px; color: var(--warn); background: #fff7e6; border: 1px solid #ffe3ad; padding: 3px 8px; border-radius: 20px; }
.history-item .h-ops { display: flex; gap: 8px; }

/* ---------------- 弹窗（采购清单） ---------------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200; background: rgba(15, 25, 50, 0.55);
  display: none; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto;
  backdrop-filter: blur(2px);
}
.modal-overlay.show { display: flex; }
.modal {
  background: #fff; border-radius: 16px; width: min(860px, 100%);
  box-shadow: var(--shadow-lg); animation: modalIn 0.22s ease;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(18px) scale(0.98); } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 24px; border-bottom: 1px solid var(--border);
}
.modal-head h3 { font-size: 17px; display: flex; align-items: center; gap: 9px; }
.modal-head h3 .icon { color: var(--primary); }
.modal-close { border: none; background: none; color: var(--muted); width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.modal-close:hover { background: #f1f4fa; color: var(--text); }
.modal-body { padding: 22px 24px; }
.modal-foot { padding: 14px 24px 20px; display: flex; gap: 12px; justify-content: flex-end; flex-wrap: wrap; border-top: 1px solid var(--border); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.form-item { display: flex; flex-direction: column; gap: 6px; }
.form-item.full { grid-column: 1 / -1; }
.form-item label { font-size: 13px; font-weight: 600; color: #333d55; }
.form-item label i { color: var(--danger); font-style: normal; margin-left: 2px; }
.form-item .tip { font-size: 11.5px; color: var(--muted); }
textarea.input { resize: vertical; min-height: 64px; }

/* 采购清单排版 */
.order-meta { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 24px; margin-bottom: 16px; }
.order-meta div { font-size: 13px; color: #47506a; display: flex; gap: 8px; }
.order-meta div b { color: var(--text); }
.order-meta .om-no { font-family: var(--mono); color: var(--primary); font-weight: 700; }
.order-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.order-table th, .order-table td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; vertical-align: top; }
.order-table th { background: #f2f5fb; color: #333d55; white-space: nowrap; }
.order-table td.num { font-family: var(--mono); white-space: nowrap; }
.order-table .m { font-family: var(--mono); font-weight: 700; }
.order-table .sub { color: var(--muted); font-size: 11px; display: block; margin-top: 2px; }
.order-table tfoot td { background: #fafbfe; font-weight: 700; }
.order-table tfoot .grand { color: var(--danger); font-size: 14px; font-family: var(--mono); }
.order-remark { margin-top: 14px; font-size: 12.5px; color: var(--muted); background: #f7f9fd; border: 1px dashed var(--border); border-radius: 8px; padding: 10px 14px; }

/* ---------------- Toast ---------------- */
.toast-wrap { position: fixed; top: 76px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 10px; align-items: center; pointer-events: none; }
.toast {
  background: rgba(28, 35, 51, 0.92); color: #fff; font-size: 13.5px; font-weight: 500;
  padding: 10px 20px; border-radius: 24px; box-shadow: var(--shadow-lg);
  animation: toastIn 0.25s ease; max-width: min(88vw, 480px); text-align: center;
}
.toast.out { opacity: 0; transform: translateY(-8px); transition: all 0.35s ease; }
.toast-ok { border-left: 4px solid var(--ok); }
.toast-err { border-left: 4px solid var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } }

/* ---------------- 底部 ---------------- */
.site-footer { background: #10192e; color: #aab4cc; margin-top: 46px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.3fr; gap: 30px; padding: 40px 0 30px; }
.f-col h4 { color: #fff; font-size: 14.5px; margin-bottom: 14px; letter-spacing: 1px; }
.f-col ul li { margin-bottom: 9px; font-size: 13px; }
.f-col ul a { color: #aab4cc; }
.f-col ul a:hover { color: #fff; }
.f-brand .logo { margin-bottom: 14px; }
.f-desc { font-size: 12.5px; line-height: 1.8; margin-bottom: 14px; }
.f-line { display: flex; align-items: center; gap: 8px; font-size: 12.5px; margin-bottom: 7px; }
.f-line .icon { width: 15px; height: 15px; color: #6fe3d2; }
.f-services li { display: flex; align-items: center; gap: 9px; }
.f-services .icon { width: 15px; height: 15px; color: #6fe3d2; }
.footer-bar { border-top: 1px solid rgba(255, 255, 255, 0.09); }
.footer-bar-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 16px 0; font-size: 12.5px;
}
.footer-bar .icp a { color: #8d97b0; }
.footer-bar .icp a:hover { color: #fff; text-decoration: underline; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1024px) {
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
  .detail-layout { grid-template-columns: 1fr; }
  .detail-gallery { position: static; max-width: 480px; margin-inline: auto; }
  .catalog-layout { grid-template-columns: 200px 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .catalog-layout { grid-template-columns: 1fr; }
  .filters { position: static; display: none; }
  .filters.open { display: block; }
  .filters-toggle {
    display: inline-flex; align-items: center; gap: 7px;
    border: 1px solid var(--border); background: #fff; border-radius: 8px; padding: 8px 14px;
    font-size: 13px; font-weight: 600; color: #333d55;
  }
  .filters-toggle .icon { width: 15px; height: 15px; color: var(--primary); }
  .cart-layout { grid-template-columns: 1fr; }
  .summary-card { position: static; }
  .hero-inner { grid-template-columns: 1fr; text-align: center; padding-top: 42px; }
  .hero p.lead { margin-inline: auto; }
  .hero-cta { justify-content: center; }
  .hero-art { display: none; }
}

@media (max-width: 760px) {
  .header-inner { flex-wrap: wrap; height: auto; padding: 10px 0; row-gap: 10px; }
  .logo { order: 1; }
  .nav-toggle { display: flex; order: 2; margin-left: auto; }
  .header-search { order: 3; max-width: none; flex-basis: 100%; }
  .main-nav {
    order: 4; flex-basis: 100%; display: none; flex-direction: column; align-items: stretch; gap: 4px;
    border-top: 1px solid var(--border); padding-top: 8px;
  }
  .main-nav.open { display: flex; }
  .main-nav a { justify-content: center; }
  .nav-toggle .icon { width: 22px; height: 22px; }

  .hero h1 { font-size: 27px; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .feature-strip .container { grid-template-columns: repeat(2, 1fr); }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .section-title { font-size: 20px; }

  .cart-row { position: relative; grid-template-columns: 76px 1fr; grid-template-areas: "thumb info" "thumb price" "qty sub"; row-gap: 10px; padding-right: 46px; }
  .cart-thumb { grid-area: thumb; }
  .cart-info { grid-area: info; }
  .cart-price { grid-area: price; justify-self: start; }
  .cart-qty { grid-area: qty; }
  .cart-sub { grid-area: sub; text-align: left; align-self: end; }
  .cart-del { position: absolute; top: 10px; right: 10px; }

  .form-grid { grid-template-columns: 1fr; }
  .order-meta { grid-template-columns: 1fr; }
  .history-item .h-meta { margin-left: 0; flex-basis: 100%; }
  .modal-overlay { padding: 16px 10px; }
}

@media (max-width: 480px) {
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 10px; }
  .card-body { padding: 10px 11px 12px; }
  .price { font-size: 16px; }
  .card-actions { flex-direction: column; align-items: stretch; gap: 8px; }
  .card-actions .moq { text-align: center; }
  .feature-strip .container { grid-template-columns: 1fr; gap: 10px; }
  .hero-stats { gap: 10px; }
  .footer-grid { grid-template-columns: 1fr; gap: 22px; }
  .order-table { font-size: 11.5px; }
  .order-table th, .order-table td { padding: 6px 7px; }
  .hide-sm { display: none !important; }
}

/* ---------------- 打印样式（仅输出采购清单） ---------------- */
#print-mount { display: none; }
@media print {
  body > *:not(#print-mount) { display: none !important; }
  #print-mount { display: block !important; padding: 0; color: #000; }
  #print-mount h2 { font-size: 18px; margin-bottom: 4px; }
  #print-mount .pm-sub { font-size: 12px; color: #444; margin-bottom: 14px; }
  #print-mount .order-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 20px; margin-bottom: 12px; }
  #print-mount table { width: 100%; border-collapse: collapse; font-size: 11px; }
  #print-mount th, #print-mount td { border: 1px solid #999; padding: 5px 7px; text-align: left; }
  #print-mount tfoot td { font-weight: 700; }
  #print-mount .order-remark { border: 1px dashed #999; padding: 8px 10px; margin-top: 10px; font-size: 11px; }
}
