/* ============================================================
   全站基础样式 —— 配合 Bootstrap 5（本地 assets/vendor）使用
   设计令牌 / 响应式 / 无障碍 / 交互规范 集中在此
   ============================================================ */

:root {
  --c-bg: #f6f7f9;
  --c-text: #212529;
  --c-price: #e03131;
  --c-border: #eee;
  --c-radius: .5rem;
  --c-brand: #212529;            /* 前后台统一品牌主色（H-2） */
  --c-shadow-hover: 0 .5rem 1rem rgba(0,0,0,.08);
}

body {
  background: var(--c-bg);
  color: var(--c-text);
}

/* 商品卡片 */
.product-card {
  transition: box-shadow .2s ease, transform .2s ease;
  border: 1px solid var(--c-border);
}
.product-card:hover {
  box-shadow: var(--c-shadow-hover);
  transform: translateY(-2px);
}
.product-img {
  height: 180px;
  object-fit: cover;
  background: #f1f3f5;
}
.product-img-lg {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  background: #f1f3f5;
}

/* 阶梯价表格 */
.tier-table th, .tier-table td {
  text-align: center;
  font-size: .9rem;
}
.tier-table .table-active {
  background-color: #fff3cd !important;
  font-weight: 600;
}

/* 后台紧凑表格 */
.admin-table th { white-space: nowrap; }

/* 表单与卡片微调 */
.card { border-radius: var(--c-radius); }
.navbar-brand { letter-spacing: .5px; }

/* 价格高亮 */
.text-price { color: var(--c-price); font-weight: 700; }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 576px) {
  .product-img { height: 140px; }
  .container { padding-left: 12px; padding-right: 12px; }
}

/* 购物车 / 结算表格：窄屏转为卡片式堆叠，避免横向拥挤 */
@media (max-width: 576px) {
  .cart-table thead { display: none; }
  .cart-table, .cart-table tbody, .cart-table tr, .cart-table td { display: block; width: 100%; }
  .cart-table tr {
    border: 1px solid var(--c-border);
    border-radius: var(--c-radius);
    margin-bottom: .75rem;
    padding: .25rem .5rem;
  }
  .cart-table td {
    border: none;
    padding: .3rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    text-align: right;
  }
  .cart-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #666;
    text-align: left;
  }
  .cart-table td[data-label=""]::before { content: ""; }
}

/* ============================================================
   无障碍（A11y）
   ============================================================ */
/* 跳到主内容 */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 2000;
  background: #fff;
  color: #212529;
  padding: .5rem 1rem;
  border-radius: 0 0 var(--c-radius) 0;
}
.skip-link:focus { left: 0; }

/* 可见焦点样式 */
:focus-visible {
  outline: 3px solid #4dabf7;
  outline-offset: 2px;
}

/* 尊重减弱动效偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}

/* ============================================================
   响应式排版与触控目标（B-4）
   ============================================================ */
/* 流式标题：随视口缩放，避免移动端过大/桌面过小 */
h1, .h1 { font-size: clamp(1.6rem, 1.15rem + 1.6vw, 2.25rem); line-height: 1.2; }
h3, .h3 { font-size: clamp(1.25rem, 1.05rem + 0.8vw, 1.6rem); line-height: 1.25; }
h4, .h4 { font-size: clamp(1.15rem, 1rem + 0.5vw, 1.4rem); }

/* 触控目标最小 44px，方便手指点按（桌面不强制，窄屏启用） */
@media (max-width: 768px) {
  .btn, .form-control, .form-select, .page-link {
    min-height: 44px;
  }
  .btn-sm, .form-control-sm, .form-select-sm, .input-group-sm .form-control, .input-group-sm .btn {
    min-height: 40px;
  }
  /* 数字步进器按钮在移动端更易于点按 */
  .qty-stepper .btn { min-width: 44px; }
}

/* ============================================================
   统一组件库（H-4）
   ============================================================ */
/* 主按钮品牌色（与前台导航 bg-dark 呼应） */
.btn-brand {
  background: var(--c-brand, #212529);
  color: #fff;
  border-color: var(--c-brand, #212529);
}
.btn-brand:hover { filter: brightness(1.12); color: #fff; }

/* 通用徽标（库存等） */
.badge-stock {
  background: #f1f3f5;
  color: #495057;
  border: 1px solid var(--c-border);
  font-weight: 600;
}

/* ============================================================
   空态 / 加载态规范（H-3）
   ============================================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #868e96;
}
.empty-state .empty-icon {
  font-size: 3rem;
  line-height: 1;
  margin-bottom: .5rem;
}

/* ============================================================
   商品详情数量步进器（C-3）
   ============================================================ */
.qty-stepper { display: inline-flex; align-items: stretch; }
.qty-stepper button {
  width: 42px;
  border: 1px solid #ced4da;
  background: #f8f9fa;
  color: #495057;
  font-size: 1.1rem;
  line-height: 1;
}
.qty-stepper button:first-child { border-radius: .375rem 0 0 .375rem; border-right: none; }
.qty-stepper button:last-child  { border-radius: 0 .375rem .375rem 0; border-left: none; }
.qty-stepper input {
  width: 72px;
  text-align: center;
  border-radius: 0;
  -moz-appearance: textfield;
}
.qty-stepper input::-webkit-outer-spin-button,
.qty-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stock-hint { font-size: .8rem; color: #868e96; }
.stock-hint.over { color: var(--c-price); font-weight: 600; }

/* 多规格选择器（SKU） */
.spec-group .spec-values { margin-bottom: .25rem; }
.spec-group .spec-values .spec-value {
  border-radius: .375rem;
  transition: background-color .12s ease, color .12s ease, border-color .12s ease;
}
.spec-group .spec-values .spec-value:hover { border-color: #e8453c; }
.spec-group .spec-values .spec-value.active {
  background: #e8453c;
  color: #fff;
  border-color: #e8453c;
}

/* ============================================================
   顶部搜索实时建议下拉（前后端分离：走 /admin/api/products）
   ============================================================ */
.search-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 1090;
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--c-radius);
  box-shadow: 0 .5rem 1rem rgba(0,0,0,.1);
  max-height: 320px;
  overflow-y: auto;
  padding: .25rem 0;
}
.search-suggest-item {
  display: block;
  padding: .45rem .75rem;
  color: #212529;
  text-decoration: none;
  font-size: .9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-suggest-item:hover,
.search-suggest-item:focus {
  background: #f1f3f5;
  color: #212529;
}

/* ============================================================
   闪途 B2B 装修设计系统（2026-08-12）
   配色：深海蓝(信任) + 转化蓝 + 科技青 + 高亮橙
   ============================================================ */
:root {
  --st-navy: #0A2540;
  --st-navy-2: #0E3158;
  --st-blue: #155BD4;
  --st-blue-600: #1B6EF3;
  --st-cyan: #16C2D5;
  --st-orange: #FF7A45;
  --st-bg: #F4F6FA;
  --st-ink: #0F1E36;
  --st-muted: #5B6B82;
  --st-line: #E6EBF2;
  --st-shadow: 0 10px 30px rgba(15,30,54,.08);
  --st-shadow-sm: 0 4px 14px rgba(15,30,54,.06);
  --st-radius: 16px;
}
body { overflow-x: hidden; }

/* 顶部实用条 */
.st-util { background: var(--st-navy); color: #cdd9ec; font-size: 13px; }
.st-util .wrap { display: flex; justify-content: space-between; align-items: center; min-height: 38px; padding-top: 6px; padding-bottom: 6px; }
.st-util-left span { margin-right: 18px; white-space: nowrap; }
.st-util-right a { color: #cdd9ec; margin-left: 16px; }
.st-util-right a:hover { color: #fff; }

/* 导航（白底品牌） */
.st-nav { background: #fff !important; border-bottom: 1px solid var(--st-line); box-shadow: 0 1px 0 rgba(15,30,54,.03); }
.st-nav .navbar-brand { display: flex; align-items: center; gap: 10px; color: var(--st-navy); font-weight: 800; font-size: 19px; }
.st-nav .brand-mark { width: 38px; height: 38px; border-radius: 10px; background: linear-gradient(135deg, var(--st-blue), var(--st-cyan)); display: grid; place-items: center; color: #fff; font-weight: 900; font-size: 20px; }
.st-nav .brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.st-nav .brand-sub { font-size: 11px; color: var(--st-muted); font-weight: 600; letter-spacing: 1px; }
.st-nav .nav-link { color: #2a3a55; font-weight: 600; border-radius: 9px; padding: .5rem .9rem; }
.st-nav .nav-link:hover,
.st-nav .nav-link.active,
.st-nav .nav-link[aria-current="page"] { color: var(--st-blue); background: rgba(21,91,212,.07); }
.st-nav .navbar-toggler { border-color: #d7deea; }
.st-nav .navbar-toggler:focus { box-shadow: none; }
.st-nav .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(15,30,54,0.7)' stroke-linecap='round' stroke-miterlimit='12' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}
.st-nav .form-control { border-color: var(--st-line); }
.st-nav .st-search-btn { background: var(--st-blue); border-color: var(--st-blue); color: #fff; }
.st-nav .st-search-btn:hover { background: var(--st-blue-600); border-color: var(--st-blue-600); }

/* 全宽 breakout（首页营销区用，脱离 .container 约束） */
.st-breakout { width: 100vw; position: relative; left: 50%; right: 50%; margin-left: -50vw; margin-right: -50vw; }

/* Hero */
.st-hero { background: radial-gradient(1200px 500px at 80% -10%, rgba(22,194,213,.25), transparent), linear-gradient(135deg, var(--st-navy), var(--st-navy-2)); color: #fff; padding: 64px 0 56px; overflow: hidden; }
.st-hero::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px); background-size: 44px 44px; opacity: .5; pointer-events: none; }
.st-hero .container { position: relative; }
.st-hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; }
.st-eyebrow { display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.st-hero h1 { font-size: clamp(34px, 5vw, 54px); line-height: 1.1; margin: 18px 0 16px; letter-spacing: -1px; font-weight: 900; }
.st-hl { background: linear-gradient(90deg, var(--st-cyan), #7FE9F3); -webkit-background-clip: text; background-clip: text; color: transparent; }
.st-hero-lead { font-size: 18px; color: #cfe0f5; max-width: 540px; }
.st-hero-search { display: flex; background: #fff; border-radius: 14px; padding: 7px; gap: 8px; max-width: 540px; margin: 24px 0 8px; box-shadow: var(--st-shadow); }
.st-hero-search input { flex: 1; border: none; outline: none; padding: 0 14px; font-size: 15px; color: var(--st-ink); border-radius: 10px; }
.st-hero-search .btn { background: var(--st-blue); border-color: var(--st-blue); color: #fff; font-weight: 700; padding: 0 22px; border-radius: 10px; }
.st-hero-search .btn:hover { background: var(--st-blue-600); }
.st-hero-trust { display: flex; gap: 22px; margin-top: 24px; flex-wrap: wrap; }
.st-hero-trust div { font-size: 14px; color: #cfe0f5; }
.st-hero-trust b { display: block; font-size: 24px; color: #fff; font-weight: 800; }
.st-hero-cta { display: flex; gap: 14px; margin-top: 24px; flex-wrap: wrap; }
.st-btn-primary { background: var(--st-blue); color: #fff; font-weight: 700; padding: 12px 24px; border-radius: 10px; box-shadow: 0 8px 20px rgba(21,91,212,.28); }
.st-btn-primary:hover { background: var(--st-blue-600); color: #fff; }
.st-btn-ghost { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,.4); font-weight: 700; padding: 12px 24px; border-radius: 10px; }
.st-btn-ghost:hover { background: rgba(255,255,255,.12); color: #fff; }
.st-hero-cards { display: grid; gap: 16px; }
.st-hcard { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); border-radius: var(--st-radius); padding: 18px; backdrop-filter: blur(6px); }
.st-hcard-t { font-weight: 800; font-size: 17px; margin-bottom: 4px; }
.st-hcard-d { font-size: 13px; color: #bcd2ee; }
.st-pill { margin-top: 12px; display: inline-flex; font-size: 12px; font-weight: 700; background: var(--st-orange); color: #fff; padding: 3px 10px; border-radius: 999px; }

/* 数据条 */
.st-stats { background: #fff; border-bottom: 1px solid var(--st-line); }
.st-stats-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; padding: 26px 0; text-align: center; }
.st-stats-grid b { display: block; font-size: 26px; font-weight: 900; color: var(--st-blue); }
.st-stats-grid span { font-size: 13px; color: var(--st-muted); }

/* 通用 section */
.st-section { padding: 60px 0; }
.st-section-soft { background: linear-gradient(180deg, #fff, var(--st-bg)); }
.st-sec-head { text-align: center; max-width: 720px; margin: 0 auto 40px; }
.st-sec-head .st-eyebrow { color: var(--st-blue); font-weight: 700; letter-spacing: 1px; font-size: 13px; text-transform: uppercase; }
.st-sec-head h2 { font-size: clamp(26px, 3.4vw, 36px); margin: 10px 0 12px; letter-spacing: -.5px; color: var(--st-ink); }
.st-sec-head p { color: var(--st-muted); font-size: 16px; }

/* 品类 */
.st-cats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.st-cat { background: #fff; border: 1px solid var(--st-line); border-radius: var(--st-radius); padding: 26px 22px; transition: .2s; box-shadow: var(--st-shadow-sm); color: inherit; text-decoration: none; display: block; }
.st-cat:hover { transform: translateY(-4px); box-shadow: var(--st-shadow); border-color: rgba(21,91,212,.3); }
.st-cat-ic { width: 54px; height: 54px; border-radius: 14px; background: linear-gradient(135deg, rgba(21,91,212,.12), rgba(22,194,213,.14)); display: grid; place-items: center; font-size: 26px; margin-bottom: 16px; }
.st-cat h3 { font-size: 19px; margin-bottom: 6px; color: var(--st-ink); }
.st-cat p { font-size: 13.5px; color: var(--st-muted); }
.st-cat-more { margin-top: 14px; font-size: 14px; font-weight: 700; color: var(--st-blue); display: inline-block; }

/* 价值 */
.st-vals-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.st-val { display: flex; gap: 16px; background: #fff; border: 1px solid var(--st-line); border-radius: var(--st-radius); padding: 22px; box-shadow: var(--st-shadow-sm); }
.st-val-ic { flex: none; width: 46px; height: 46px; border-radius: 12px; background: rgba(21,91,212,.1); display: grid; place-items: center; font-size: 22px; }
.st-val h4 { font-size: 16.5px; margin-bottom: 3px; color: var(--st-ink); }
.st-val p { font-size: 13.5px; color: var(--st-muted); margin: 0; }

/* 双入口 */
.st-dual-wrap { background: var(--st-bg); }
.st-dual { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.st-entry { border-radius: 22px; padding: 36px; color: #fff; }
.st-entry-buy { background: linear-gradient(135deg, var(--st-blue), #0E4BB0); }
.st-entry-sell { background: linear-gradient(135deg, #0E9BAB, var(--st-cyan)); }
.st-entry h3 { font-size: 24px; margin-bottom: 10px; }
.st-entry p { color: rgba(255,255,255,.85); margin-bottom: 18px; font-size: 15px; }
.st-entry ul { list-style: none; padding: 0; display: grid; gap: 8px; margin-bottom: 22px; }
.st-entry li { display: flex; gap: 9px; align-items: center; font-size: 14.5px; }
.st-entry-btn { background: #fff; color: var(--st-navy); font-weight: 700; padding: 12px 22px; border-radius: 10px; }
.st-entry-btn:hover { background: #f0f4fb; color: var(--st-navy); }

/* 页脚 */
.st-footer { background: var(--st-navy); color: #cdd9ec; padding: 54px 0 26px; margin-top: 0; }
.st-footer h6 { color: #fff; font-size: 15px; margin-bottom: 14px; }
.st-foot-brand { font-size: 20px; font-weight: 800; color: #fff; }
.st-foot-brand span { font-size: 12px; color: var(--st-muted); font-weight: 600; margin-left: 8px; }
.st-foot-desc { color: #9fb2cf; margin-top: 12px; max-width: 320px; }
.st-footer a { color: #aebfd8; font-size: 14px; display: block; margin-bottom: 9px; }
.st-footer a:hover { color: #fff; }
.st-foot-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 34px; padding-top: 18px; font-size: 13px; color: #8497b5; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* 响应式 */
@media (max-width: 980px) {
  .st-hero-grid { grid-template-columns: 1fr; }
  .st-hero-cards { order: -1; }
  .st-stats-grid { grid-template-columns: repeat(2, 1fr); gap: 18px; }
  .st-cats-grid { grid-template-columns: repeat(2, 1fr); }
  .st-vals-grid { grid-template-columns: 1fr; }
  .st-dual { grid-template-columns: 1fr; }
  .st-util-left span:nth-child(3) { display: none; }
}
@media (max-width: 560px) {
  .st-cats-grid { grid-template-columns: 1fr; }
  .st-util-left span:nth-child(2) { display: none; }
  .st-hero { padding: 44px 0 40px; }
}
