/* ==========================================================================
 * 买家端样式
 * 头部 / 类目导航 / 页脚 / 首页 / 列表 / 详情 / 购物车 / 结算 /
 * 支付 / 订单 / 账号 / 条款 / 移动端抽屉与标签栏
 * ========================================================================== */

/* 结构常量：供 sticky 偏移与 scroll-margin 使用 */
:root {
  --header-h: 156px;
  --topbar-h: 36px;
  --bar-h: 72px;
  --catnav-h: 48px;
  --tabbar-h: 66px;
}

/* ==========================================================================
 * 站点头部
 * ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--line);
}

/* ---------- 顶部通告条 ---------- */
.header-topbar {
  height: var(--topbar-h);
  background: linear-gradient(90deg, var(--ink-900) 0%, #221f4a 52%, #2f2560 100%);
  color: rgba(255, 255, 255, 0.82);
  font-size: 12.5px;
  overflow: hidden;
}

.header-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  height: 100%;
}

.topbar-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-note::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(239, 143, 43, 0.24);
  flex: 0 0 auto;
}

.topbar-links {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  flex: 0 0 auto;
}

.topbar-links a {
  position: relative;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12.5px;
}

.topbar-links a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--t) var(--ease);
}

.topbar-links a:hover {
  color: #fff;
}

.topbar-links a:hover::after {
  transform: scaleX(1);
}

/* ---------- 主导航行 ---------- */
.header-bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--sp-6);
  min-height: var(--bar-h);
  padding: 10px 0;
}

.header-brand {
  display: flex;
  align-items: center;
}

/* 移动端汉堡：三条横线 → X */
.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--white);
  cursor: pointer;
  position: relative;
  flex: 0 0 auto;
}

.nav-toggle span {
  position: absolute;
  left: 11px;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--ink-800);
  transition: transform var(--t) var(--ease-spring), opacity var(--t-fast) var(--ease);
}

.nav-toggle span:nth-child(1) {
  top: 15px;
}
.nav-toggle span:nth-child(2) {
  top: 20px;
}
.nav-toggle span:nth-child(3) {
  top: 25px;
}

#navToggle:checked ~ .site-header .nav-toggle span:nth-child(1) {
  transform: translateY(5px) rotate(45deg);
}
#navToggle:checked ~ .site-header .nav-toggle span:nth-child(2) {
  opacity: 0;
}
#navToggle:checked ~ .site-header .nav-toggle span:nth-child(3) {
  transform: translateY(-5px) rotate(-45deg);
}

/* ---------- 搜索区 ---------- */
.header-search {
  min-width: 0;
}

.search-form {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.search-field {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  background: var(--white);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  padding: 0 18px;
  height: 44px;
  box-shadow: var(--sh-1);
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}

.search-field:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--ring);
}

.search-field-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.9;
  stroke-linecap: round;
  transition: stroke var(--t-fast) var(--ease);
}

.search-field:focus-within .search-field-icon {
  stroke: var(--brand);
}

.search-field input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 0 0 10px;
  border: none;
  background: transparent;
  font-size: 14.5px;
  color: var(--text);
  box-shadow: none;
}

.search-field input:focus {
  box-shadow: none;
  border: none;
}

.search-field input::placeholder {
  color: #a3a8bd;
}

.search-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 44px;
  padding: 0 24px;
  border: none;
  border-radius: var(--r-pill);
  background: linear-gradient(135deg, var(--brand) 0%, var(--violet) 100%);
  color: #fff;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--sh-brand);
  transition: transform var(--t) var(--ease-spring), box-shadow var(--t) var(--ease);
}

.search-submit svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
}

.search-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(79, 70, 229, 0.34);
}

.search-hot {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-top: 9px;
  font-size: 12.5px;
  color: var(--muted);
  overflow: hidden;
  white-space: nowrap;
}

.search-hot-label {
  color: var(--muted);
  font-weight: 600;
}

.search-hot-item {
  padding: 2px 10px;
  border-radius: var(--r-pill);
  background: var(--bg-alt);
  color: var(--text-sub);
  transition: all var(--t-fast) var(--ease);
}

.search-hot-item:hover {
  background: var(--brand-soft);
  color: var(--brand-700);
  transform: translateY(-1px);
}

/* ---------- 右侧操作区 ---------- */
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.action-item {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border: 1px solid transparent;
  color: var(--text-sub);
  transition: all var(--t) var(--ease);
}

.action-item:hover {
  color: var(--brand-700);
  background: var(--brand-tint);
  border-color: var(--brand-soft);
}

.action-icon {
  display: inline-flex;
  position: relative;
}

.action-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.action-text {
  font-size: 11px;
  line-height: 1;
}

.cart-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(239, 143, 43, 0.4);
}

/* 用户下拉（纯 CSS） */
.user-dropdown {
  position: relative;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 42px;
  padding: 0 12px 0 6px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--text);
  transition: all var(--t) var(--ease);
}

.user-chip:hover {
  border-color: var(--brand);
  color: var(--brand-700);
  box-shadow: var(--sh-1);
}

.user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand) 0%, var(--violet) 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  flex: 0 0 auto;
}

.user-chip-name {
  font-size: 13px;
  font-weight: 600;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.caret {
  font-size: 10px;
  color: var(--muted);
  transition: transform var(--t) var(--ease);
}

.user-dropdown:hover .caret {
  transform: rotate(180deg);
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 216px;
  padding: var(--sp-2);
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--white);
  box-shadow: var(--sh-3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--t) var(--ease);
  z-index: 60;
}

.user-dropdown-menu::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  height: 12px;
}

.user-dropdown:hover .user-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.user-dropdown-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 14px;
  border-bottom: 1px dashed var(--line);
  margin-bottom: 6px;
}

.user-dropdown-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.35;
  min-width: 0;
}

.user-dropdown-meta strong {
  font-size: 14px;
}

.user-dropdown-meta small {
  color: var(--muted);
  font-size: 12px;
}

.user-dropdown-menu > a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  color: var(--text-sub);
  transition: all var(--t-fast) var(--ease);
}

.user-dropdown-menu > a svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.user-dropdown-menu > a:hover {
  background: var(--brand-tint);
  color: var(--brand-700);
  transform: translateX(2px);
}

.user-dropdown-menu .menu-exit:hover {
  background: #fdedf0;
  color: var(--danger);
}

/* 未登录 */
.header-guest {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.login-link {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-sub);
}

.login-link:hover {
  color: var(--brand);
}

/* 商家入口 */
.merchant-entry {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 42px;
  padding: 0 16px;
  border-radius: var(--r-pill);
  border: 1px solid var(--ink-900);
  color: var(--ink-900);
  font-size: 13.5px;
  font-weight: 600;
  transition: all var(--t) var(--ease);
}

.merchant-entry svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.merchant-entry:hover {
  background: var(--ink-900);
  border-color: var(--ink-900);
  color: #fff;
  transform: translateY(-2px);
}

/* ==========================================================================
 * 类目导航
 * ========================================================================== */
.category-nav {
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
}

.category-nav-inner {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  height: var(--catnav-h);
  overflow-x: auto;
  scrollbar-width: none;
}

.category-nav-inner::-webkit-scrollbar {
  display: none;
}

.cat-all {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 16px;
  margin-right: var(--sp-2);
  border-radius: var(--r-pill);
  background: linear-gradient(135deg, var(--brand) 0%, var(--violet) 100%);
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  box-shadow: var(--sh-brand);
  transition: transform var(--t) var(--ease-spring);
}

.cat-all:hover {
  color: #fff;
  transform: translateY(-2px);
}

.cat-item {
  position: relative;
  flex: 0 0 auto;
}

.cat-item > a {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-sub);
  transition: all var(--t-fast) var(--ease);
}

.cat-item > a:hover {
  background: var(--brand-tint);
  color: var(--brand-700);
}

/* 二级下拉面板 */
.cat-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 80;
  display: flex;
  gap: var(--sp-5);
  min-width: 620px;
  padding: var(--sp-5);
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--white);
  box-shadow: var(--sh-3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all var(--t) var(--ease);
}

.cat-panel::before {
  content: '';
  position: absolute;
  top: -14px;
  left: 0;
  right: 0;
  height: 14px;
}

.cat-item:hover .cat-panel {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.cat-panel-groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-5);
  flex: 1;
}

.cat-group {
  min-width: 0;
}

.cat-group-title {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-900);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.cat-group-title:hover {
  color: var(--brand);
}

.cat-group-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cat-group-links a {
  font-size: 13px;
  color: var(--text-sub);
  padding: 3px 0;
  transition: transform var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}

.cat-group-links a:hover {
  color: var(--brand);
  transform: translateX(3px);
}

.cat-panel-pic {
  flex: 0 0 150px;
  border-radius: var(--r);
  overflow: hidden;
  background: var(--bg-alt);
  text-align: center;
  padding: 10px;
}

.cat-panel-pic img {
  width: 100%;
  border-radius: var(--r-sm);
  margin-bottom: 8px;
  transition: transform var(--t-slow) var(--ease);
}

.cat-panel-pic:hover img {
  transform: scale(1.06);
}

.cat-panel-pic span {
  font-size: 12.5px;
  color: var(--text-sub);
  font-weight: 600;
}

/* ==========================================================================
 * 移动端分类抽屉（纯 CSS，由 #navToggle 控制）
 * ========================================================================== */
.mobile-drawer {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
}

.drawer-mask {
  position: absolute;
  inset: 0;
  background: rgba(15, 17, 32, 0.45);
  opacity: 0;
  transition: opacity var(--t) var(--ease);
  backdrop-filter: blur(2px);
}

.mobile-drawer-inner {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(84vw, 340px);
  padding: var(--sp-5);
  overflow-y: auto;
  background: var(--white);
  box-shadow: var(--sh-3);
  transform: translateX(-100%);
  transition: transform var(--t) var(--ease);
}

#navToggle:checked ~ .site-header .mobile-drawer {
  display: block;
  pointer-events: auto;
}

#navToggle:checked ~ .site-header .drawer-mask {
  opacity: 1;
}

#navToggle:checked ~ .site-header .mobile-drawer-inner {
  transform: none;
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: var(--sp-4);
  margin-bottom: var(--sp-4);
  border-bottom: 1px solid var(--line);
}

.drawer-head strong {
  font-size: 16px;
}

.drawer-close {
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}

.drawer-group {
  padding: 12px 0;
  border-bottom: 1px dashed var(--line);
}

.drawer-group-title {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-900);
  margin-bottom: 8px;
}

.drawer-group-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.drawer-group-links a {
  padding: 5px 12px;
  border-radius: var(--r-pill);
  background: var(--bg-alt);
  font-size: 13px;
  color: var(--text-sub);
}

.drawer-group-links a.lv2 {
  font-weight: 600;
  color: var(--ink-700);
  background: var(--brand-soft);
}

.drawer-group-links a.lv3 {
  background: transparent;
  border: 1px solid var(--line);
}

/* ==========================================================================
 * 首页
 * ========================================================================== */
.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}

/* ---------- 焦点图 ---------- */
.hero-slider {
  position: relative;
  grid-column: 1 / -1;
  aspect-ratio: 16 / 7;
  min-height: 300px;
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--sh-3);
  background: var(--ink-800);
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t-slow) var(--ease), visibility var(--t-slow) var(--ease);
}

.hero-slide.active {
  opacity: 1;
  visibility: visible;
}

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  transition: transform 6s linear;
}

.hero-slide.active img {
  transform: scale(1.08);
}

.hero-slide-mask {
  position: absolute;
  inset: auto 0 0 0;
  padding: var(--sp-10) var(--sp-10) var(--sp-8);
  background: linear-gradient(
    to top,
    rgba(10, 11, 22, 0.88) 0%,
    rgba(10, 11, 22, 0.55) 42%,
    transparent 100%
  );
  color: #fff;
}

.hero-slide.active .hero-slide-mask > * {
  animation: rise var(--t-slow) var(--ease) both;
}

.hero-slide-tag {
  display: inline-block;
  padding: 5px 14px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.3);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  backdrop-filter: blur(6px);
  margin-bottom: var(--sp-3);
}

.hero-slide-mask h2 {
  color: #fff;
  font-size: clamp(26px, 2.6vw, 40px);
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}

.hero-slide-mask p {
  color: rgba(255, 255, 255, 0.82);
  font-size: 14.5px;
  margin-bottom: var(--sp-3);
}

.hero-slide-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  transition: gap var(--t) var(--ease);
}

.hero-slide:hover .hero-slide-cta {
  gap: 12px;
}

/* 轮播箭头与指示点 */
.hero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink-900);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--sh-2);
  opacity: 0;
  transition: all var(--t) var(--ease);
  z-index: 5;
}

.hero-prev {
  left: var(--sp-5);
}
.hero-next {
  right: var(--sp-5);
}

.hero-slider:hover .hero-arrow {
  opacity: 1;
}

.hero-arrow:hover {
  background: #fff;
  transform: translateY(-50%) scale(1.08);
}

.hero-dots {
  position: absolute;
  left: 50%;
  bottom: var(--sp-5);
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 5;
}

.hero-dots button {
  width: 26px;
  height: 4px;
  padding: 0;
  border: none;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: all var(--t) var(--ease);
}

.hero-dots button.active {
  width: 44px;
  background: #fff;
}

/* ---------- 焦点图下方：保障条 ---------- */
.hero-side {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: var(--sp-6);
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: linear-gradient(120deg, #ffffff 0%, #f7f6ff 60%, #fdf4e8 100%);
  box-shadow: var(--sh-1);
}

.hero-side-head {
  display: flex;
  flex-direction: column;
  line-height: 1.35;
  padding-right: var(--sp-5);
  border-right: 1px solid var(--line);
  flex: 0 0 auto;
}

.hero-side-head strong {
  font-size: 16px;
}

.hero-side-head span {
  font-size: 12.5px;
  color: var(--muted);
}

.hero-points {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--sp-4);
  margin: 0;
  padding: 0;
  flex: 1;
  min-width: 0;
}

.hero-points li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-sub);
  margin: 0;
}

.hero-points .ico {
  font-size: 16px;
  filter: saturate(1.1);
}

.hero-side-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex: 0 0 auto;
}

.hero-side-actions .btn {
  padding: 9px 18px;
}

/* ---------- 类目滑轨 ---------- */
.cat-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 108px;
  gap: var(--sp-3);
  overflow-x: auto;
  padding: var(--sp-4) 2px var(--sp-5);
  margin-top: var(--sp-6);
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.cat-rail::-webkit-scrollbar {
  display: none;
}

.cat-rail-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 14px 8px;
  border-radius: var(--r);
  background: var(--white);
  border: 1px solid var(--line);
  scroll-snap-align: start;
  transition: all var(--t) var(--ease);
}

.cat-rail-item:hover {
  border-color: transparent;
  box-shadow: var(--sh-2);
  transform: translateY(-4px);
}

.cat-rail-pic {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 3px var(--white), 0 0 0 4px var(--brand-soft);
  transition: transform var(--t) var(--ease-spring);
}

.cat-rail-item:hover .cat-rail-pic {
  transform: rotate(-6deg) scale(1.06);
}

.cat-rail-pic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cat-rail-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sub);
  text-align: center;
  white-space: nowrap;
}

.cat-rail-item:hover .cat-rail-name {
  color: var(--brand-700);
}

/* ---------- 双促销卡 ---------- */
.promo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-4);
  margin-top: var(--sp-5);
}

.promo-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: var(--sp-6);
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  min-height: 158px;
  transition: all var(--t) var(--ease);
}

.promo-card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: radial-gradient(circle at 14px 14px, rgba(255, 255, 255, 0.42) 2px, transparent 2.4px);
  background-size: 22px 22px;
}

.promo-card > * {
  position: relative;
  z-index: 1;
}

.promo-tent {
  background: linear-gradient(128deg, #4f46e5 0%, #7c3aed 100%);
  color: #fff;
  border-color: transparent;
}

.promo-cook {
  background: linear-gradient(128deg, #f6a23c 0%, #ef6f2b 100%);
  color: #fff;
  border-color: transparent;
}

.promo-card:hover {
  transform: translateY(-5px) scale(1.01);
  box-shadow: var(--sh-3);
}

.promo-tag {
  align-self: flex-start;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.22);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.promo-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}

.promo-desc {
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.86);
}

.promo-go {
  margin-top: auto;
  font-size: 13.5px;
  font-weight: 700;
  transition: transform var(--t) var(--ease);
}

.promo-card:hover .promo-go {
  transform: translateX(5px);
}

/* ---------- 服务保障条 ---------- */
.service-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.service-item {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-5);
  background: var(--white);
  transition: background-color var(--t) var(--ease);
}

.service-item:hover {
  background: var(--brand-tint);
}

.service-ico {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: var(--brand-soft);
  transition: transform var(--t) var(--ease-spring);
}

.service-item:hover .service-ico {
  transform: rotate(-8deg) scale(1.08);
}

.service-item strong {
  display: block;
  font-size: 14.5px;
  margin-bottom: 2px;
}

.service-item p {
  font-size: 12.5px;
  line-height: 1.6;
}

/* ==========================================================================
 * 商品网格与卡片（首页 / 列表 / 推荐位共用）
 * ========================================================================== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(212px, 1fr));
  gap: var(--sp-5);
}

.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  color: var(--text);
  transition: transform var(--t) var(--ease-spring), box-shadow var(--t) var(--ease),
    border-color var(--t) var(--ease);
}

.product-card:hover {
  transform: translateY(-6px);
  border-color: transparent;
  box-shadow: var(--sh-3);
}

.product-card-cover {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--bg-alt);
}

.product-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--t-slow) var(--ease);
}

.product-card:hover .product-card-cover img {
  transform: scale(1.07);
}

.product-card-flag {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 11px;
  border-radius: var(--r-xs) var(--r-xs) var(--r-xs) 2px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-600) 100%);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: 0 6px 14px rgba(239, 143, 43, 0.34);
}

.product-card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 15px 15px;
  flex: 1;
}

.product-card-shop {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 18px;
}

.shop-tag {
  font-size: 11.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-card-title {
  margin: 0;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--ink-900);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 44px;
}

.product-card:hover .product-card-title {
  color: var(--brand-700);
}

.product-card-sub {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-card-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: auto;
  padding-top: 8px;
}

.product-card-price .price {
  font-size: 19px;
}

.product-card-price .sales {
  margin-left: auto;
}

.product-card-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--brand-600);
}

.product-card-cta::after {
  content: '→';
  transition: transform var(--t) var(--ease);
}

.product-card:hover .product-card-cta::after {
  transform: translateX(4px);
}

/* ==========================================================================
 * 商品列表页
 * ========================================================================== */
.filter-bar {
  position: sticky;
  top: calc(var(--header-h) - 2px);
  z-index: 40;
  padding: var(--sp-4) var(--sp-5);
  margin-bottom: var(--sp-5);
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  box-shadow: var(--sh-1);
}

.filter-row {
  display: flex;
  align-items: baseline;
  gap: var(--sp-4);
  padding: 5px 0;
}

.filter-row + .filter-row {
  border-top: 1px dashed var(--line);
}

.filter-row-label {
  flex: 0 0 76px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-700);
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.chip {
  padding: 5px 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--white);
  font-size: 13px;
  color: var(--text-sub);
  transition: all var(--t-fast) var(--ease);
}

.chip:hover {
  border-color: var(--brand);
  color: var(--brand-700);
  background: var(--brand-tint);
}

.chip.active {
  border-color: transparent;
  background: linear-gradient(135deg, var(--brand) 0%, var(--violet) 100%);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 6px 14px rgba(79, 70, 229, 0.24);
}

.chip-lv2 {
  background: var(--bg-alt);
}

.chip-lv3 {
  background: transparent;
  border-style: dashed;
}

.filter-keyword {
  margin: var(--sp-3) 0 0;
  padding-top: var(--sp-3);
  border-top: 1px dashed var(--line);
  font-size: 13px;
  color: var(--text-sub);
}

.filter-keyword strong {
  color: var(--brand-700);
}

.filter-keyword a {
  margin-left: 10px;
  color: var(--muted);
  font-size: 12.5px;
}

.list-body {
  min-width: 0;
}

.sort-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
  padding: 10px var(--sp-4);
  margin-bottom: var(--sp-5);
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--white);
}

.sort-bar .label {
  font-size: 12.5px;
  color: var(--muted);
  margin-right: 4px;
}

.sort-bar > a {
  padding: 4px 12px;
  border-radius: var(--r-xs);
  font-size: 13px;
  color: var(--text-sub);
  transition: all var(--t-fast) var(--ease);
}

.sort-bar > a:hover {
  background: var(--bg-alt);
  color: var(--brand-700);
}

.sort-bar > a.active {
  background: var(--ink-900);
  color: #fff;
  font-weight: 600;
}

.result-count {
  margin-left: auto;
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
 * 商品详情
 * ========================================================================== */
.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 440px) minmax(0, 1fr);
  gap: var(--sp-8);
  align-items: start;
}

.gallery-main {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--white);
  overflow: hidden;
}

.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-thumbs {
  display: flex;
  gap: 10px;
  margin-top: var(--sp-3);
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.gallery-thumbs::-webkit-scrollbar {
  display: none;
}

.gallery-thumbs img {
  flex: 0 0 auto;
  width: 76px;
  height: 76px;
  object-fit: cover;
  border-radius: var(--r-sm);
  border: 2px solid transparent;
  background: var(--bg-alt);
  cursor: pointer;
  opacity: 0.72;
  transition: all var(--t) var(--ease);
}

.gallery-thumbs img:hover {
  opacity: 1;
  transform: translateY(-2px);
}

.gallery-thumbs img.active {
  opacity: 1;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.detail-title {
  font-size: clamp(22px, 1.4vw + 16px, 30px);
  margin-bottom: 6px;
}

.detail-subtitle {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: var(--sp-5);
}

.detail-price-box {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--r);
  background: linear-gradient(120deg, var(--brand-tint) 0%, #fdf6ec 100%);
  border: 1px solid var(--brand-soft);
  margin-bottom: var(--sp-5);
}

.detail-price-box .price {
  font-size: 32px;
  letter-spacing: -0.03em;
}

.detail-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  font-size: 12.5px;
  color: var(--muted);
}

.detail-meta strong {
  font-variant-numeric: tabular-nums;
  color: var(--ink-800);
}

.spec-group {
  padding: var(--sp-4) 0;
  border-top: 1px dashed var(--line);
}

.spec-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-sub);
  margin-bottom: 10px;
}

.spec-values {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.spec-value {
  padding: 8px 18px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
  background: var(--white);
  font-family: inherit;
  font-size: 13.5px;
  color: var(--text);
  cursor: pointer;
  transition: all var(--t) var(--ease);
}

.spec-value:hover {
  border-color: var(--brand);
  color: var(--brand-700);
}

.spec-value.active {
  border-color: transparent;
  background: linear-gradient(135deg, var(--brand) 0%, var(--violet) 100%);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.26);
}

.stock-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 var(--sp-4);
  margin: var(--sp-4) 0;
  border-radius: var(--r-sm);
  background: var(--bg-alt);
  border: 1px dashed var(--line-strong);
  font-size: 13px;
  color: var(--text-sub);
}

.stock-hint.ok {
  background: #e7f7f1;
  border-style: solid;
  border-color: #bfe9d8;
  color: var(--success);
}

.buy-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
  margin-top: var(--sp-4);
}

.quantity-box {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--white);
}

.quantity-box > button {
  width: 38px;
  height: 42px;
  border: none;
  background: transparent;
  color: var(--text-sub);
  font-size: 17px;
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}

.quantity-box > button:hover {
  background: var(--brand-tint);
  color: var(--brand-700);
}

.quantity-box input {
  width: 56px;
  height: 42px;
  border: none;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  border-radius: 0;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.quantity-box input:focus {
  box-shadow: none;
  border-color: var(--line);
}

.buy-row .btn-lg {
  flex: 1;
  min-width: 150px;
}

.shop-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
  margin-top: var(--sp-5);
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--white);
}

.shop-box strong {
  font-size: 15px;
}

.detail-section {
  margin-top: var(--sp-10);
}

.detail-section h3 {
  padding-left: 14px;
  border-left: 4px solid var(--brand);
  border-radius: 2px;
}

.detail-content {
  padding: var(--sp-5) var(--sp-6);
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--white);
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--text-sub);
  white-space: pre-wrap;
}

.detail-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--r-sm);
  margin: var(--sp-3) 0;
}

.detail-content p:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
 * 购物车
 * ========================================================================== */
.cart-group {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--white);
  margin-bottom: var(--sp-4);
  overflow: hidden;
}

.cart-group-head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 12px var(--sp-5);
  background: var(--bg-alt);
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  font-weight: 600;
}

.cart-row {
  display: grid;
  grid-template-columns: 40px 84px minmax(0, 1fr) 110px 132px 118px 56px;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  border-top: 1px solid var(--line);
}

.cart-group > .cart-row:first-of-type {
  border-top: none;
}

.cart-row:hover {
  background: var(--brand-tint);
}

.cart-row input[type='checkbox'] {
  width: 17px;
  height: 17px;
  accent-color: var(--brand);
  cursor: pointer;
}

.cart-row img {
  width: 84px;
  height: 84px;
  object-fit: cover;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
}

.cart-row a.title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-900);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cart-row .spec {
  font-size: 12.5px;
  color: var(--muted);
}

.cart-row.invalid {
  background: repeating-linear-gradient(
    135deg,
    transparent 0 12px,
    rgba(220, 47, 69, 0.03) 12px 24px
  );
}

.cart-row.invalid img {
  filter: grayscale(1);
  opacity: 0.6;
}

.cart-row > div.subtotal {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-900);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.cart-bar {
  position: sticky;
  bottom: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  flex-wrap: wrap;
  margin-top: var(--sp-5);
  padding: var(--sp-4) var(--sp-5);
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  box-shadow: var(--sh-2);
}

.cart-bar input[type='checkbox'] {
  width: 17px;
  height: 17px;
  accent-color: var(--brand);
  cursor: pointer;
}

.total-box {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  margin-left: auto;
}

.total-box .price {
  font-size: 26px;
}

.cart-bar form {
  margin: 0;
}

/* ==========================================================================
 * 结算页
 * ========================================================================== */
.checkout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: var(--sp-5);
  align-items: start;
}

.address-list {
  display: grid;
  gap: 10px;
}

.address-item {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--sp-3);
  padding: 14px var(--sp-4);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--white);
  cursor: pointer;
  transition: all var(--t) var(--ease);
}

.address-item:hover {
  border-color: var(--brand);
}

.address-item input[type='radio'] {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--brand);
  cursor: pointer;
}

.address-item .name {
  font-size: 14px;
  font-weight: 600;
}

.address-item .addr {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.6;
}

.address-item .default-tag {
  align-self: start;
}

.address-item:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-tint);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.order-preview-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: var(--sp-3);
  align-items: center;
  padding: 10px 0;
  border-top: 1px dashed var(--line);
}

.order-preview-item:first-of-type {
  border-top: none;
}

.order-preview-item img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: var(--r-xs);
  border: 1px solid var(--line);
}

.summary-box {
  position: sticky;
  top: calc(var(--header-h) + var(--sp-4));
}

/* ==========================================================================
 * 支付 / 结果
 * ========================================================================== */
.pay-box,
.result-box {
  max-width: 680px;
  margin: 0 auto;
}

.pay-box .card,
.result-box .card {
  padding: var(--sp-8);
}

.pay-amount {
  text-align: center;
  padding: var(--sp-5) 0 var(--sp-6);
  border-bottom: 1px dashed var(--line);
  margin-bottom: var(--sp-5);
}

.pay-amount .label {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pay-amount .price {
  font-size: 40px;
  letter-spacing: -0.04em;
}

.pay-amount strong {
  font-variant-numeric: tabular-nums;
}

.pay-methods {
  display: grid;
  gap: 10px;
  margin-bottom: var(--sp-5);
}

.pay-method {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 14px var(--sp-4);
  border: 1px solid var(--brand);
  border-radius: var(--r-sm);
  background: var(--brand-tint);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.pay-method > span {
  font-size: 22px;
}

.pay-actions,
.pay-action {
  display: flex;
  gap: var(--sp-3);
  justify-content: center;
  flex-wrap: wrap;
  margin-top: var(--sp-5);
}

.result-box .result-icon {
  width: 62px;
  height: 62px;
  margin: 0 auto var(--sp-4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  color: #fff;
  background: linear-gradient(135deg, var(--success) 0%, #0b7a55 100%);
  box-shadow: 0 12px 26px rgba(15, 154, 110, 0.32);
  animation: float-y 3.6s var(--ease) infinite;
}

.result-box h2,
.result-box > .card > p {
  text-align: center;
}

/* ==========================================================================
 * 订单
 * ========================================================================== */
.order-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: var(--sp-5);
  scrollbar-width: none;
}

.order-tabs::-webkit-scrollbar {
  display: none;
}

.order-tabs > a {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 18px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--white);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-sub);
  transition: all var(--t) var(--ease);
}

.order-tabs > a:hover {
  border-color: var(--brand);
  color: var(--brand-700);
}

.order-tabs > a.active {
  border-color: transparent;
  background: var(--ink-900);
  color: #fff;
}

.order-tabs .count {
  padding: 0 7px;
  border-radius: var(--r-pill);
  background: var(--brand-soft);
  color: var(--brand-700);
  font-size: 11.5px;
  font-weight: 700;
}

.order-tabs > a.active .count {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.order-card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--white);
  margin-bottom: var(--sp-4);
  overflow: hidden;
  transition: box-shadow var(--t) var(--ease), transform var(--t) var(--ease);
}

.order-card:hover {
  box-shadow: var(--sh-2);
  transform: translateY(-2px);
}

.order-card-head {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  flex-wrap: wrap;
  padding: 12px var(--sp-5);
  background: var(--bg-alt);
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted);
}

.order-no {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  color: var(--ink-700);
  font-weight: 600;
}

.order-card-head .status {
  margin-left: auto;
  font-weight: 700;
  font-size: 13px;
}

.order-card-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
}

.order-items {
  padding: var(--sp-4) var(--sp-5);
}

.order-item {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) auto;
  gap: var(--sp-3);
  align-items: center;
  padding: 10px 0;
}

.order-item + .order-item {
  border-top: 1px dashed var(--line);
}

.order-item img {
  width: 62px;
  height: 62px;
  object-fit: cover;
  border-radius: var(--r-xs);
  border: 1px solid var(--line);
}

.order-item .info a.title {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-900);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-item .info .spec {
  font-size: 12px;
  color: var(--muted);
}

.order-side {
  padding: var(--sp-4) var(--sp-5);
  border-left: 1px dashed var(--line);
  font-size: 13px;
  color: var(--text-sub);
}

.order-side .amount {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink-900);
  font-variant-numeric: tabular-nums;
}

.order-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sp-2);
  flex-wrap: wrap;
  padding: 12px var(--sp-5);
  border-top: 1px solid var(--line);
  background: var(--white);
}

.order-actions form {
  display: inline-block;
  margin: 0;
}

/* ==========================================================================
 * 账号中心
 * ========================================================================== */
.account-grid {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  gap: var(--sp-5);
  align-items: start;
}

.account-side {
  position: sticky;
  top: calc(var(--header-h) + var(--sp-4));
  text-align: center;
  padding: var(--sp-6) var(--sp-5);
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: linear-gradient(170deg, #ffffff 0%, var(--brand-tint) 100%);
}

.account-side .avatar {
  width: 74px;
  height: 74px;
  margin: 0 auto 12px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand) 0%, var(--violet) 100%);
  box-shadow: 0 12px 26px rgba(79, 70, 229, 0.3);
}

.account-side strong {
  display: block;
  font-size: 16px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: var(--sp-3);
}

.stat-card {
  position: relative;
  overflow: hidden;
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--white);
  transition: all var(--t) var(--ease);
}

.stat-card::after {
  content: '';
  position: absolute;
  right: -20px;
  top: -20px;
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background: var(--brand-soft);
  transition: transform var(--t) var(--ease);
}

.stat-card:hover {
  transform: translateY(-4px);
  border-color: var(--brand-soft);
  box-shadow: var(--sh-2);
}

.stat-card:hover::after {
  transform: scale(1.4);
}

.stat-card .value {
  position: relative;
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink-900);
  font-variant-numeric: tabular-nums;
}

.stat-card .label {
  position: relative;
  font-size: 12.5px;
  color: var(--muted);
}

.address-card {
  padding: 14px var(--sp-4);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--white);
  margin-bottom: 10px;
  transition: all var(--t) var(--ease);
}

.address-card:hover {
  border-color: var(--brand-soft);
  box-shadow: var(--sh-1);
}

.address-card .name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

.address-card .addr {
  font-size: 12.5px;
  color: var(--muted);
}

.address-card .ops {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.address-card .ops form {
  display: inline-block;
  margin: 0;
}

/* ==========================================================================
 * 联系客服 / 登录注册 / 条款
 * ========================================================================== */
.card .panel {
  margin-bottom: var(--sp-4);
}

.legal-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
  gap: var(--sp-4);
}

.legal-card {
  position: relative;
  overflow: hidden;
  padding: var(--sp-5);
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--white);
  transition: all var(--t) var(--ease);
}

.legal-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--brand) 0%, var(--violet) 100%);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform var(--t) var(--ease);
}

.legal-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--sh-2);
  border-color: transparent;
}

.legal-card:hover::before {
  transform: scaleY(1);
}

.legal-card h3 {
  margin-bottom: 8px;
}

.legal-card p {
  font-size: 13px;
  line-height: 1.7;
}

.legal-card-more {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--brand-600);
}

.legal-grid {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: var(--sp-5);
  align-items: start;
}

.legal-side {
  position: sticky;
  top: calc(var(--header-h) + var(--sp-4));
  padding: var(--sp-5);
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--white);
}

.legal-side h4 {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.legal-side a {
  display: block;
  padding: 7px 10px;
  margin: 2px 0;
  border-radius: var(--r-xs);
  font-size: 13.5px;
  color: var(--text-sub);
  transition: all var(--t-fast) var(--ease);
}

.legal-side a:hover {
  background: var(--bg-alt);
  color: var(--brand-700);
}

.legal-side a.active {
  background: var(--brand-soft);
  color: var(--brand-700);
  font-weight: 600;
}

.legal-side a.legal-back {
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-size: 12.5px;
  color: var(--muted);
}

.legal-doc {
  padding: var(--sp-8);
  line-height: 1.9;
  color: var(--text-sub);
}

.legal-lead {
  font-size: 15px;
  color: var(--ink-700);
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--line);
}

.legal-section {
  scroll-margin-top: calc(var(--header-h) + 16px);
  padding-top: var(--sp-5);
}

.legal-section h3 {
  margin-top: var(--sp-4);
  padding-left: 12px;
  border-left: 3px solid var(--brand);
}

.legal-section ul {
  margin-bottom: var(--sp-4);
}

.legal-table {
  margin: var(--sp-4) 0;
}

.legal-table-caption {
  font-size: 12.5px;
  margin-bottom: 8px;
}

.legal-note {
  padding: 10px 14px;
  border-radius: var(--r-sm);
  background: var(--bg-alt);
  border-left: 3px solid var(--brand);
  font-size: 13px;
}

.legal-foot {
  margin-top: var(--sp-6);
  padding-top: var(--sp-4);
  border-top: 1px dashed var(--line);
  font-size: 12.5px;
}

/* 登录 / 注册卡片居中被 inline style 控制，此处仅做视觉补充 */
.form-actions .btn-block {
  height: 48px;
}

/* ==========================================================================
 * 页脚
 * ========================================================================== */
.site-footer {
  position: relative;
  margin-top: var(--sp-16);
  padding-top: var(--sp-12);
  color: rgba(255, 255, 255, 0.76);
  background:
    radial-gradient(720px 340px at 12% 0%, rgba(79, 70, 229, 0.26), transparent 70%),
    radial-gradient(620px 300px at 88% 8%, rgba(239, 143, 43, 0.18), transparent 72%),
    linear-gradient(180deg, var(--ink-900) 0%, #14152c 60%, #0d0e1c 100%);
  overflow: hidden;
}

.site-footer::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand) 0%, var(--violet) 45%, var(--accent) 100%);
}

.footer-ridge {
  display: none;
}

.footer-main {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr);
  gap: var(--sp-10);
  padding-bottom: var(--sp-10);
}

.footer-eyebrow {
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.footer-slogan {
  color: #fff;
  font-size: clamp(24px, 2vw + 14px, 34px);
  letter-spacing: -0.03em;
  margin-bottom: var(--sp-3);
}

.footer-desc {
  font-size: 13.5px;
  line-height: 1.85;
  margin-bottom: var(--sp-5);
}

.footer-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.contact-chip {
  padding: 6px 14px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  font-size: 12.5px;
  transition: all var(--t) var(--ease);
}

.contact-chip:hover {
  background: rgba(255, 255, 255, 0.14);
  transform: translateY(-2px);
}

.footer-trail {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--sp-5);
}

.footer-node {
  position: relative;
  padding-top: var(--sp-5);
}

.node-index {
  position: absolute;
  top: 0;
  left: 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.32);
}

.footer-node h4 {
  color: #fff;
  font-size: 14.5px;
  margin-bottom: 10px;
}

.footer-node p {
  margin: 0 0 6px;
  font-size: 13px;
}

.footer-node a {
  color: rgba(255, 255, 255, 0.68);
  transition: color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
  display: inline-block;
}

.footer-node a:hover {
  color: #fff;
  transform: translateX(3px);
}

.footer-links {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: var(--sp-4) 0;
}

.footer-links-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
  font-size: 12.5px;
}

.footer-links-inner a:hover {
  color: #fff;
}

.footer-links .dot {
  color: rgba(255, 255, 255, 0.28);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: var(--sp-4) 0 var(--sp-10);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}

.footer-bottom-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
}

.footer-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  flex-wrap: wrap;
}

.footer-icp,
.footer-top-link {
  color: rgba(255, 255, 255, 0.62);
}

.footer-icp:hover,
.footer-top-link:hover {
  color: #fff;
}

.footer-top-link {
  padding: 4px 12px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
 * 移动端底部标签栏
 * ========================================================================== */
.mobile-tabbar {
  display: none;
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  z-index: 150;
  width: calc(100% - 24px);
  max-width: 460px;
  padding: 8px;
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(180%) blur(18px);
  border: 1px solid var(--line);
  box-shadow: var(--sh-3);
}

.tabbar-item {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 0;
  border-radius: var(--r-sm);
  font-size: 11px;
  color: var(--muted);
  transition: color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}

.tabbar-ico {
  font-size: 19px;
  line-height: 1;
}

.tabbar-item:hover,
.tabbar-item:active {
  color: var(--brand-700);
  background: var(--brand-tint);
}

.tabbar-text {
  font-size: 11px;
  line-height: 1;
}

.tabbar-dot {
  position: absolute;
  top: 2px;
  right: 50%;
  margin-right: -22px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

/* ==========================================================================
 * 响应式
 * ========================================================================== */
@media (max-width: 1180px) {
  .detail-layout {
    grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
    gap: var(--sp-6);
  }
  .checkout-grid {
    grid-template-columns: minmax(0, 1fr) 320px;
  }
  .footer-main {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--sp-8);
  }
}

@media (max-width: 1024px) {
  :root {
    --header-h: 132px;
  }
  .header-bar {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: 'toggle search' 'brand actions';
    row-gap: var(--sp-3);
  }
  .nav-toggle {
    display: block;
    grid-area: toggle;
    justify-self: start;
  }
  .mobile-drawer {
    display: block;
  }
  .header-brand {
    grid-area: brand;
  }
  .header-search {
    grid-area: search;
  }
  .header-actions {
    grid-area: actions;
    justify-self: end;
  }
  .search-hot {
    display: none;
  }
  .category-nav-inner {
    gap: 4px;
  }
  .cat-panel {
    min-width: 520px;
  }
  .cat-panel-groups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .detail-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .gallery-main {
    max-width: 460px;
  }
  .cart-row {
    grid-template-columns: 36px 72px minmax(0, 1fr) 96px 124px 100px 44px;
    gap: var(--sp-3);
  }
  .cart-row img {
    width: 72px;
    height: 72px;
  }
  .account-grid,
  .legal-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .account-side,
  .legal-side {
    position: static;
  }
  .order-card-body {
    grid-template-columns: minmax(0, 1fr);
  }
  .order-side {
    border-left: none;
    border-top: 1px dashed var(--line);
  }
}

@media (max-width: 900px) {
  .checkout-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .summary-box {
    position: static;
  }
  .hero-side {
    flex-wrap: wrap;
    gap: var(--sp-4);
  }
  .hero-side-head {
    border-right: none;
    padding-right: 0;
    flex: 1 1 100%;
  }
  .hero-points {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--sp-3);
  }
  .hero-side-actions {
    flex: 1 1 100%;
  }
  .service-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .promo-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .footer-trail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  :root {
    --header-h: 116px;
    --catnav-h: 44px;
  }
  body.page-buyer {
    padding-bottom: calc(var(--tabbar-h) + 24px);
  }
  .mobile-tabbar {
    display: flex;
  }
  .topbar-links {
    display: none;
  }
  .header-bar {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: 'toggle brand' 'search search' 'actions actions';
  }
  .header-search {
    margin-top: 2px;
  }
  .header-actions {
    justify-self: stretch;
    justify-content: space-between;
  }
  .search-hot {
    display: none;
  }
  .user-chip-name,
  .merchant-entry-text,
  .action-text {
    display: none;
  }
  .merchant-entry {
    width: 42px;
    padding: 0;
    justify-content: center;
  }
  .hero-slider {
    aspect-ratio: 4 / 3;
    min-height: 240px;
    border-radius: var(--r-lg);
  }
  .hero-slide-mask {
    padding: var(--sp-6) var(--sp-5) var(--sp-6);
  }
  .hero-arrow {
    display: none;
  }
  .hero-points {
    grid-template-columns: minmax(0, 1fr);
  }
  .filter-bar {
    position: static;
    padding: var(--sp-4);
  }
  .filter-row {
    flex-direction: column;
    gap: 8px;
  }
  .filter-row-label {
    flex: none;
  }
  .filter-chips {
    max-height: 92px;
    overflow-y: auto;
  }
  .sort-bar {
    justify-content: space-between;
  }
  .result-count {
    flex: 1 0 100%;
    margin-left: 0;
  }
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
    gap: var(--sp-3);
  }
  .product-card-title {
    min-height: 40px;
    font-size: 13.5px;
  }
  .service-strip {
    grid-template-columns: minmax(0, 1fr);
  }
  .detail-price-box {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--sp-2);
  }
  .buy-row {
    flex-direction: column;
    align-items: stretch;
  }
  .buy-row .quantity-box {
    width: 100%;
    justify-content: space-between;
  }
  .buy-row .btn-lg {
    width: 100%;
    min-width: 0;
  }
  .cart-group-head {
    padding: 10px var(--sp-4);
  }
  /* 购物车行：移动端重排为卡片式（有效行与失效行列数保持一致） */
  .cart-row {
    grid-template-columns: 34px 72px minmax(0, 1fr) auto;
    gap: 10px var(--sp-3);
    padding: var(--sp-4);
  }
  .cart-row > *:nth-child(1) {
    grid-column: 1;
    grid-row: 1 / span 2;
    align-self: start;
    margin-top: 26px;
  }
  .cart-row > *:nth-child(2) {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
  .cart-row > *:nth-child(3) {
    grid-column: 3;
    grid-row: 1;
  }
  .cart-row > *:nth-child(4) {
    grid-column: 3;
    grid-row: 2;
  }
  .cart-row > *:nth-child(5) {
    grid-column: 3;
    grid-row: 3;
  }
  .cart-row > *:nth-child(6) {
    grid-column: 4;
    grid-row: 3;
    text-align: right;
    font-weight: 700;
    color: var(--ink-900);
  }
  .cart-row > *:nth-child(7) {
    grid-column: 4;
    grid-row: 1;
    justify-self: end;
  }
  .cart-row img {
    width: 72px;
    height: 72px;
  }
  .cart-bar {
    padding: var(--sp-3) var(--sp-4);
    gap: var(--sp-3);
    bottom: calc(var(--tabbar-h) + 10px);
  }
  .total-box {
    width: 100%;
    justify-content: space-between;
    margin-left: 0;
  }
  .cart-bar form {
    width: 100%;
  }
  .cart-bar form .btn {
    width: 100%;
  }
  .address-item {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .address-item .default-tag {
    grid-column: 2;
    justify-self: start;
  }
  .pay-box .card,
  .result-box .card {
    padding: var(--sp-5);
  }
  .pay-actions .btn,
  .result-box .pay-actions .btn {
    width: 100%;
  }
  .footer-main {
    gap: var(--sp-6);
    padding-bottom: var(--sp-6);
  }
  .footer-links-inner {
    gap: var(--sp-2);
  }
}

@media (max-width: 520px) {
  :root {
    --gutter: 14px;
  }
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .product-card-body {
    padding: 10px 11px 12px;
  }
  .product-card-title {
    -webkit-line-clamp: 2;
    line-clamp: 2;
    min-height: 38px;
  }
  .product-card-price .price {
    font-size: 17px;
  }
  .product-card-cta {
    font-size: 12px;
  }
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .footer-trail {
    grid-template-columns: minmax(0, 1fr);
  }
  .kv-list {
    grid-template-columns: minmax(0, 1fr);
  }
  .toast {
    top: 88px;
  }
  .pagination a,
  .pagination span {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
  }
  .detail-content {
    padding: var(--sp-4);
  }
  .buy-row .quantity-box input {
    width: 48px;
  }
}

@media (max-width: 380px) {
  .product-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
