/* ============================================
   EDI B2B 商城 - 共享样式系统
   主色：#7A6F97 | 辅助：#B4AFC8 
   强调：#E88C8C | 背景：#F7F6F9
   ============================================ */

/* === CSS 变量 / Design Tokens === */
:root {
  --primary: #7A6F97;
  --primary-light: #9A91B8;
  --primary-dark: #5D5480;
  --secondary: #B4AFC8;
  --secondary-light: #D4D0E0;
  --accent: #E88C8C;
  --accent-light: #F0AAAA;
  --accent-dark: #D47070;
  --bg: #F7F6F9;
  --bg-card: #FFFFFF;
  --text-primary: #333333;
  --text-secondary: #666666;
  --text-light: #999999;
  --border: #E8E6EE;
  --border-light: #F0EFF3;
  --shadow-sm: 0 1px 3px rgba(122, 111, 151, 0.08);
  --shadow-md: 0 4px 12px rgba(122, 111, 151, 0.12);
  --shadow-lg: 0 8px 24px rgba(122, 111, 151, 0.15);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --transition: all 0.3s ease;
  --max-width: 1200px;
  --header-height: 70px;
}

/* === Reset & Base === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; outline: none; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* === Header / 顶部导航 === */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--primary);
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(122, 111, 151, 0.25);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1px;
  flex-shrink: 0;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.15);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

/* Search Bar */
.search-bar {
  flex: 1;
  max-width: 420px;
  display: flex;
  position: relative;
}

.search-bar input {
  width: 100%;
  height: 40px;
  padding: 0 16px;
  border: none;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 14px;
  transition: var(--transition);
}

.search-bar input::placeholder { color: rgba(255,255,255,0.55); }
.search-bar input:focus { background: rgba(255,255,255,0.25); }

.search-bar button {
  position: absolute;
  right: 4px;
  top: 4px;
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255,255,255,0.2);
  border-radius: 4px;
  color: #fff;
  font-size: 14px;
  transition: var(--transition);
}

.search-bar button:hover { background: rgba(255,255,255,0.3); }

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
  flex-shrink: 0;
}

.header-actions a {
  color: rgba(255,255,255,0.85);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
  white-space: nowrap;
}

.header-actions a:hover { color: #fff; }
.header-actions .icon { font-size: 16px; }

.cart-badge {
  position: relative;
}

.cart-badge .badge {
  position: absolute;
  top: -6px;
  right: -8px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  padding: 4px;
}

/* === Navigation === */
.nav-bar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  background: #fff;
  border-bottom: 1px solid var(--border);
  z-index: 999;
  box-shadow: var(--shadow-sm);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  height: 48px;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

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

.nav-inner a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 14px;
  color: var(--text-secondary);
  white-space: nowrap;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  font-weight: 500;
}

.nav-inner a:hover,
.nav-inner a.active {
  color: var(--primary);
  background: rgba(122, 111, 151, 0.08);
}

.nav-inner a .nav-icon { font-size: 16px; }

/* === Main Content === */
.main-content {
  margin-top: calc(var(--header-height) + 48px);
  min-height: calc(100vh - 118px);
}

/* === Page Header === */
.page-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  padding: 60px 0 40px;
  text-align: center;
  color: #fff;
}

.page-header h1 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 8px;
}

.page-header p {
  font-size: 16px;
  opacity: 0.85;
  max-width: 600px;
  margin: 0 auto;
}

/* === Breadcrumb === */
.breadcrumb {
  padding: 12px 0;
  font-size: 13px;
  color: var(--text-light);
}

.breadcrumb a { color: var(--primary); }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { color: var(--text-secondary); }
.breadcrumb .sep { margin: 0 8px; color: var(--secondary); }

/* === Sections === */
.section { padding: 60px 0; }
.section-alt { background: #fff; }
.section-title {
  text-align: center;
  margin-bottom: 40px;
}

.section-title h2 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.section-title p {
  color: var(--text-secondary);
  font-size: 15px;
  max-width: 560px;
  margin: 0 auto;
}

.section-title .accent-line {
  width: 50px;
  height: 3px;
  background: var(--accent);
  margin: 12px auto 0;
  border-radius: 2px;
}

/* === Card Grid === */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

/* === Product Card === */
.product-card {
  background: #fff;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  border: 1px solid var(--border-light);
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.product-card .card-img {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, var(--secondary-light), var(--bg));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: var(--primary);
  position: relative;
  overflow: hidden;
}

.product-card .card-img img {
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
}

.product-card .card-img .tag {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 20px;
  font-weight: 600;
}

.product-card .card-body {
  padding: 16px;
}

.product-card .card-body h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-primary);
  line-height: 1.4;
}

.product-card .card-body .desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card .card-body .meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.product-card .card-body .price {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
}

.product-card .card-body .price .unit {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-light);
}

.product-card .card-body .seller {
  font-size: 12px;
  color: var(--text-light);
}

.product-card .card-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-light);
  display: flex;
  gap: 8px;
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-accent {
  background: var(--accent);
  color: #fff;
}

.btn-accent:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}

.btn-outline:hover {
  background: rgba(122, 111, 151, 0.08);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
}

.btn-block {
  width: 100%;
}

/* === Banner / Carousel === */
.banner {
  background: linear-gradient(135deg, var(--primary) 0%, #8B7FA8 50%, var(--primary-dark) 100%);
  padding: 80px 0;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.banner::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 500px;
  height: 500px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
}

.banner::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 300px;
  height: 300px;
  background: rgba(255,255,255,0.04);
  border-radius: 50%;
}

.banner .container {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

.banner-text { flex: 1; max-width: 600px; }
.banner-text .badge {
  display: inline-block;
  background: rgba(255,255,255,0.15);
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 12px;
  margin-bottom: 16px;
}

.banner-text h1 {
  font-size: 40px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 16px;
}

.banner-text p {
  font-size: 16px;
  opacity: 0.85;
  line-height: 1.8;
  margin-bottom: 24px;
}

.banner-text .btn-group { display: flex; gap: 12px; flex-wrap: wrap; }

.banner-visual {
  width: 320px;
  height: 240px;
  background: rgba(255,255,255,0.1);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 80px;
  color: rgba(255,255,255,0.4);
  flex-shrink: 0;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.15);
}

/* === Categories Grid === */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.cat-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 30px 20px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  transition: var(--transition);
  cursor: pointer;
}

.cat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.cat-card .cat-icon {
  width: 60px;
  height: 60px;
  background: var(--bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 28px;
  color: var(--primary);
  transition: var(--transition);
}

.cat-card:hover .cat-icon {
  background: var(--primary);
  color: #fff;
}

.cat-card h3 { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.cat-card p { font-size: 13px; color: var(--text-secondary); }

/* === Features === */
.features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.feature-item {
  text-align: center;
  padding: 20px;
}

.feature-item .feat-icon {
  width: 48px;
  height: 48px;
  background: var(--bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  font-size: 22px;
  color: var(--primary);
}

.feature-item h4 { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.feature-item p { font-size: 13px; color: var(--text-secondary); }

/* === Footer === */
.footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.8);
  padding: 50px 0 30px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 30px;
}

.footer-about p { font-size: 14px; line-height: 1.8; margin-top: 12px; opacity: 0.75; }

.footer h4 {
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
}

.footer-links li { margin-bottom: 10px; }
.footer-links a {
  font-size: 14px;
  opacity: 0.75;
  transition: var(--transition);
}
.footer-links a:hover { opacity: 1; color: var(--accent-light); }

.footer-contact li {
  font-size: 14px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.8;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 20px;
  text-align: center;
  font-size: 13px;
  opacity: 0.55;
}

/* === Form Styles === */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-primary);
  background: #fff;
  transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(122, 111, 151, 0.1);
}

.form-group textarea { min-height: 120px; resize: vertical; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* === Table === */
.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

table th {
  background: var(--bg);
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 2px solid var(--border);
}

table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
}

table tr:hover td { background: rgba(122, 111, 151, 0.03); }

/* === Tags === */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.tag-primary { background: rgba(122, 111, 151, 0.1); color: var(--primary); }
.tag-accent { background: rgba(232, 140, 140, 0.12); color: var(--accent); }
.tag-secondary { background: rgba(180, 175, 200, 0.2); color: var(--text-secondary); }

/* === Empty State === */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-light);
}

.empty-state .empty-icon { font-size: 56px; margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { font-size: 18px; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p { font-size: 14px; margin-bottom: 20px; }

/* === Filter Bar === */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 24px;
}

.filter-bar label { font-size: 14px; font-weight: 600; color: var(--text-primary); }

.filter-bar select {
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-primary);
  background: #fff;
}

.filter-bar .filter-btn {
  padding: 8px 16px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  background: #fff;
  color: var(--text-secondary);
  transition: var(--transition);
  cursor: pointer;
}

.filter-bar .filter-btn:hover,
.filter-bar .filter-btn.active {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(122, 111, 151, 0.06);
}

/* === Pagination === */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 40px 0;
}

.pagination a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-secondary);
  transition: var(--transition);
  border: 1px solid var(--border-light);
}

.pagination a:hover,
.pagination a.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.pagination a.disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* === Toast === */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #fff;
  padding: 16px 24px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--accent);
  z-index: 9999;
  transform: translateX(120%);
  transition: transform 0.4s ease;
  max-width: 360px;
}

.toast.show { transform: translateX(0); }
.toast .toast-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.toast .toast-msg { font-size: 13px; color: var(--text-secondary); }

/* === Modal === */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.show { display: flex; }

.modal-content {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-content h3 { font-size: 20px; margin-bottom: 16px; }

.modal-close {
  float: right;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-light);
  line-height: 1;
}

/* === Animations === */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-in {
  animation: fadeInUp 0.5s ease forwards;
}

/* === Responsive === */
@media (max-width: 968px) {
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .features { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .banner .container { flex-direction: column; text-align: center; }
  .banner-text .btn-group { justify-content: center; }
  .banner-visual { width: 100%; max-width: 320px; }
  .banner-text h1 { font-size: 32px; }
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .header-inner { gap: 12px; }
  .search-bar { max-width: 180px; }
  .header-actions a span { display: none; }
  .menu-toggle { display: block; }
  .nav-bar { display: none; }
  .nav-bar.open { display: block; }
  .nav-inner { flex-wrap: wrap; height: auto; padding: 8px 20px; }
  .cat-grid { grid-template-columns: 1fr; }
  .features { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .section-title h2 { font-size: 24px; }
  .page-header h1 { font-size: 26px; }
  .page-header { padding: 50px 0 30px; }
  .section { padding: 40px 0; }
  .card-grid { grid-template-columns: 1fr; }
  .banner { padding: 50px 0; }
  .banner-text h1 { font-size: 26px; }
  .banner-visual { height: 180px; font-size: 60px; }
}

/* === Print === */
@media print {
  .header, .nav-bar, .footer { display: none; }
  .main-content { margin-top: 0; }
}