/* ==========================================================================
   站点商城 (SITE MALL) - 全局极简明淡色清爽样式库
   HTML5 + CSS3 + jQuery 商城页面样式
   ========================================================================== */

:root {
  /* 页面色彩基调 */
  --bg-canvas: #F8FAFC;
  --bg-surface: #FFFFFF;
  --bg-surface-soft: #F1F5F9;
  --bg-surface-warm: #FBFBFA;
  
  /* 边框与分割线 (清爽微细线) */
  --border-subtle: #E2E8F0;
  --border-soft: #EEF2F6;
  --border-active: #94A3B8;

  /* 文字体系 (高清晰度、无光污染、自然墨韵) */
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
  --text-light: #CBD5E1;

  /* 清爽主题自然色 (自然松石青/苔绿调与淡红价格) */
  --brand-primary: #2D6A4F;
  --brand-hover: #1B4332;
  --brand-soft: #EBF5F0;
  --brand-border: #B7E4C7;

  --price-color: #C92A2A;
  --price-light: #FFF5F5;
  --tag-amber: #D97706;
  --tag-amber-bg: #FEF3C7;

  /* 阴影微光 */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
  --shadow-card: 0 1px 3px 0 rgba(15, 23, 42, 0.04), 0 1px 2px -1px rgba(15, 23, 42, 0.03);
  --shadow-hover: 0 8px 16px -4px rgba(15, 23, 42, 0.06), 0 2px 4px -2px rgba(15, 23, 42, 0.03);
  --shadow-modal: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.06);

  /* 圆角规范 */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 9999px;

  /* 容器宽度 */
  --container-max: 1200px;
  --header-height: 72px;
}

/* 基础重置 */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-bottom: 70px; /* 留出底部预览导航栏空间 */
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

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

ul, ol {
  list-style: none;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  border: none;
  background: none;
  outline: none;
}

button {
  cursor: pointer;
}

/* 容器 */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 20px;
}

/* ==========================================================================
   顶部通栏与头部导航 (统一头部)
   ========================================================================== */
.top-notice-bar {
  background-color: #F1F5F9;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 12px;
  color: var(--text-secondary);
  height: 36px;
  display: flex;
  align-items: center;
}
.top-notice-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}
.notice-features {
  display: flex;
  gap: 20px;
}
.notice-features span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.notice-features span::before {
  content: "•";
  color: var(--brand-primary);
}
.top-user-links {
  display: flex;
  align-items: center;
  gap: 16px;
}
.top-user-links a:hover {
  color: var(--brand-primary);
}
.user-logged-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  color: var(--text-primary);
}
.btn-logout-link {
  color: var(--text-muted);
  cursor: pointer;
  margin-left: 4px;
}
.btn-logout-link:hover {
  color: var(--price-color);
}

/* 主头部 */
.main-header {
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.header-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  gap: 32px;
}

/* 品牌Logo */
.site-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.brand-mark {
  width: 38px;
  height: 38px;
  background-color: var(--brand-primary);
  color: #FFF;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.5px;
}
.brand-text {
  display: flex;
  flex-direction: column;
}
.brand-name {
  font-size: 19px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.5px;
}
.brand-sub {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
}

/* 搜索栏 */
.header-search {
  flex: 1;
  max-width: 460px;
  position: relative;
}
.search-form-box {
  display: flex;
  align-items: center;
  background-color: var(--bg-surface-soft);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 4px 6px 4px 16px;
  transition: all 0.2s ease;
}
.search-form-box:focus-within {
  background-color: #FFF;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.12);
}
.search-input {
  width: 100%;
  height: 32px;
  font-size: 14px;
  color: var(--text-primary);
}
.search-btn {
  background-color: var(--brand-primary);
  color: #FFF;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background-color 0.15s ease;
}
.search-btn:hover {
  background-color: var(--brand-hover);
}

/* 头部操作区 (商家入驻、购物车) */
.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}
.btn-action-merchant {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 7px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  background-color: #FFF;
  transition: all 0.15s ease;
}
.btn-action-merchant:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}
.cart-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: var(--brand-soft);
  color: var(--brand-primary);
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--brand-border);
  transition: all 0.15s ease;
}
.cart-pill-btn:hover {
  background-color: #DEEFE7;
}
.cart-badge-count {
  background-color: var(--brand-primary);
  color: #FFF;
  font-size: 11px;
  min-width: 18px;
  height: 18px;
  line-height: 18px;
  text-align: center;
  border-radius: var(--radius-pill);
  padding: 0 4px;
}

/* 分类导航条 */
.category-nav-bar {
  background-color: #FFF;
  border-bottom: 1px solid var(--border-subtle);
}
.category-nav-list {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 48px;
  overflow-x: auto;
}
.nav-item-link {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
  padding: 12px 0;
  position: relative;
  white-space: nowrap;
}
.nav-item-link:hover,
.nav-item-link.active {
  color: var(--brand-primary);
}
.nav-item-link.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--brand-primary);
  border-radius: 2px 2px 0 0;
}

/* ==========================================================================
   商品卡片组件 (极简清爽微质感)
   ========================================================================== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
@media (max-width: 992px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 768px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

.product-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
}
.product-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: #CBD5E1;
}
.product-card-cover {
  position: relative;
  aspect-ratio: 1 / 1;
  background-color: #F1F5F9;
  overflow: hidden;
}
.product-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}
.product-card:hover .product-card-cover img {
  transform: scale(1.04);
}
.product-card-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(4px);
  color: var(--brand-primary);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  border: 1px solid rgba(45, 106, 79, 0.2);
}
.product-card-content {
  padding: 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.product-card-category {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.product-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 40px;
}
.product-card-shop {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.product-card-shop a:hover {
  color: var(--brand-primary);
  text-decoration: underline;
}
.product-card-footer {
  margin-top: auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px dashed var(--border-soft);
}
.product-price-box {
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.price-symbol {
  font-size: 13px;
  color: var(--price-color);
  font-weight: 700;
}
.price-integer {
  font-size: 19px;
  color: var(--price-color);
  font-weight: 700;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.price-original {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: line-through;
  margin-left: 4px;
}
.btn-card-add-cart {
  width: 32px;
  height: 32px;
  background-color: var(--bg-surface-soft);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-subtle);
  transition: all 0.15s ease;
}
.btn-card-add-cart:hover {
  background-color: var(--brand-primary);
  color: #FFF;
  border-color: var(--brand-primary);
}

/* ==========================================================================
   面包屑与通用页面头部
   ========================================================================== */
.breadcrumb-bar {
  padding: 16px 0;
  font-size: 13px;
  color: var(--text-muted);
}
.breadcrumb-bar a {
  color: var(--text-secondary);
}
.breadcrumb-bar a:hover {
  color: var(--brand-primary);
}
.breadcrumb-bar span.separator {
  margin: 0 8px;
  color: var(--text-light);
}

.page-header-box {
  background-color: #FFF;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.page-header-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.page-header-desc {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ==========================================================================
   底部服务保障与统一页脚
   ========================================================================== */
.site-guarantee-section {
  background-color: #FFF;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  padding: 36px 0;
  margin-top: 60px;
}
.guarantee-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.guarantee-item {
  display: flex;
  align-items: center;
  gap: 16px;
}
.guarantee-icon-box {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background-color: var(--brand-soft);
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.guarantee-item h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.guarantee-item p {
  font-size: 12px;
  color: var(--text-secondary);
}

.site-footer {
  background-color: #F8FAFC;
  padding: 48px 0 24px;
  font-size: 13px;
  color: var(--text-secondary);
}
.footer-links-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 40px;
  margin-bottom: 40px;
}
.footer-brand h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
}
.footer-brand p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.8;
  max-width: 320px;
}
.footer-col h5 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 14px;
}
.footer-col ul li {
  margin-bottom: 8px;
}
.footer-col ul li a {
  color: var(--text-secondary);
}
.footer-col ul li a:hover {
  color: var(--brand-primary);
}
.footer-bottom {
  border-top: 1px solid var(--border-subtle);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
}

/* ==========================================================================
   全局弹窗、Toast与悬浮快捷导航条
   ========================================================================== */
/* Toast 提示 */
#globalToast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background-color: rgba(15, 23, 42, 0.9);
  color: #FFF;
  padding: 10px 22px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-modal);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 8px;
}
#globalToast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
#globalToast.success {
  background-color: #1B4332;
  border: 1px solid #40916C;
}
#globalToast.warn {
  background-color: #92400E;
}
#globalToast.error {
  background-color: #991B1B;
}

/* 浮动多页面快速体验栏 (AI Studio 预览与审查最佳体验) */
.page-switch-dock {
  position: fixed;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-modal);
  border-radius: var(--radius-pill);
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 9990;
  font-size: 12px;
}
.dock-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  padding: 0 6px;
  letter-spacing: 0.5px;
}
.dock-link {
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  font-weight: 500;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.dock-link:hover {
  background-color: var(--bg-surface-soft);
  color: var(--text-primary);
}
.dock-link.current {
  background-color: var(--brand-primary);
  color: #FFF;
  font-weight: 600;
}

/* 通用模态框 */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9995;
  padding: 20px;
}
.modal-box {
  background-color: #FFF;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  width: 100%;
  max-width: 520px;
  overflow: hidden;
  animation: modalScaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalScaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}
.modal-close-btn {
  font-size: 20px;
  color: var(--text-muted);
  line-height: 1;
  padding: 4px;
}
.modal-close-btn:hover {
  color: var(--text-primary);
}
.modal-body {
  padding: 24px;
}
.modal-footer {
  padding: 16px 24px;
  background-color: var(--bg-surface-soft);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* 通用按钮 */
.btn-primary {
  background-color: var(--brand-primary);
  color: #FFF;
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
}
.btn-primary:hover {
  background-color: var(--brand-hover);
}
.btn-outline {
  background-color: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 14px;
  transition: all 0.15s ease;
}
.btn-outline:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  background-color: #FFF;
}
