:root {
  --primary-color: #2563eb;
  --secondary-color: #64748b;
  --success-color: #10b981;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;
  --bg-color: #f8fafc;
  --text-color: #1e293b;
  --border-color: #e2e8f0;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.navbar {
  background: white;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
}

.logo h1 {
  color: var(--primary-color);
  font-size: 1.5rem;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 30px;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
  transition: color 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary-color);
}

.auth-buttons {
  display: flex;
  gap: 10px;
  align-items: center;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

.user-name {
  font-weight: 600;
  color: var(--text-color);
}

.user-role {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
}

.language-switcher select {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background-color: white;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-color);
  cursor: pointer;
  transition: all 0.3s ease;
}

.language-switcher select:hover {
  border-color: var(--primary-color);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.language-switcher select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.user-menu select {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background-color: white;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-color);
  cursor: pointer;
  transition: all 0.3s ease;
}

.user-menu select:hover {
  border-color: var(--primary-color);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.user-menu select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* 会员徽章样式 */
.membership-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.membership-badge.free {
  background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
  color: white;
}

.membership-badge.basic {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: white;
}

.membership-badge.premium {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
  color: white;
  box-shadow: 0 2px 4px rgba(251, 191, 36, 0.3);
}

.btn {
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
  border: none;
  font-size: 0.95rem;
}

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

.btn-primary:hover {
  background: #1d4ed8;
}

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

.btn-outline:hover {
  background: var(--primary-color);
  color: white;
}

.btn-lg {
  padding: 15px 30px;
  font-size: 1.1rem;
}

.hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 100px 0;
  text-align: center;
}

.hero h2 {
  font-size: 2.5rem;
  margin-bottom: 20px;
}

.hero p {
  font-size: 1.2rem;
  margin-bottom: 30px;
  opacity: 0.9;
}

.hero-actions {
  display: flex;
  gap: 20px;
  justify-content: center;
}

.inquiries-section {
  padding: 60px 0;
}

.inquiries-section h2,
.about-section h2 {
  text-align: center;
  margin-bottom: 40px;
  font-size: 2rem;
}

.filter-bar {
  display: flex;
  gap: 15px;
  margin-bottom: 30px;
  justify-content: center;
}

.filter-bar select,
.filter-bar input {
  padding: 10px 15px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 1rem;
}

.inquiry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 24px;
}

.inquiry-card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.inquiry-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.inquiry-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.inquiry-header h3 {
  font-size: 1.3rem;
  color: var(--text-color);
  margin: 0;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80%;
}

.status-badge {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
}

.status-pending {
  background: #fef3c7;
  color: #92400e;
}

.status-matched {
  background: #dbeafe;
  color: #1e40af;
}

.status-quoted {
  background: #ddd6fe;
  color: #5b21b6;
}

.status-ordered {
  background: #c4b5fd;
  color: #4c1d95;
}

.status-paid {
  background: #a7f3d0;
  color: #065f46;
}

.status-shipped {
  background: #bfdbfe;
  color: #1e3a8a;
}

.status-completed {
  background: #d1fae5;
  color: #065f46;
}

.status-payment_confirmed {
  background: #a7f3d0;
  color: #065f46;
}

.status-delivered {
  background: #d1fae5;
  color: #065f46;
}

.status-cancelled {
  background: #fee2e2;
  color: #991b1b;
}

.status-pending_payment {
  background: #fef3c7;
  color: #92400e;
}

.inquiry-description {
  color: var(--secondary-color);
  line-height: 1.6;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.inquiry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
  padding-top: 16px;
  border-top: 1px solid #f0f0f0;
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.meta-label {
  font-size: 0.85rem;
  color: var(--secondary-color);
}

.meta-value {
  font-size: 0.95rem;
  color: var(--text-color);
  font-weight: 500;
}

.inquiry-actions {
  display: flex;
  gap: 12px;
  margin-top: auto;
  padding-top: 16px;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.9rem;
}

.loading {
  text-align: center;
  padding: 40px;
  color: var(--secondary-color);
}

.inquiry-detail {
  padding: 8px;
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 2px solid #f0f0f0;
}

.detail-header h2 {
  margin: 0;
  color: var(--text-color);
  flex: 1;
  padding-right: 20px;
}

.detail-section {
  margin-bottom: 24px;
}

.detail-section h4 {
  color: var(--text-color);
  margin-bottom: 12px;
  font-size: 1.1rem;
}

.detail-section p {
  color: var(--secondary-color);
  line-height: 1.8;
  margin: 0;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.detail-item {
  background: #f8f9fa;
  padding: 16px;
  border-radius: 8px;
}

.detail-label {
  display: block;
  font-size: 0.85rem;
  color: var(--secondary-color);
  margin-bottom: 6px;
}

.detail-value {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-color);
}

.detail-meta p {
  margin: 8px 0;
}

.detail-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 2px solid #f0f0f0;
}

.products-section {
  padding: 60px 0;
  background: white;
}

.products-section h2 {
  text-align: center;
  margin-bottom: 10px;
  font-size: 2rem;
}

.section-desc {
  text-align: center;
  color: var(--secondary-color);
  margin-bottom: 40px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.product-card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid #f0f0f0;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.product-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.product-header h3 {
  font-size: 1.3rem;
  color: var(--text-color);
  margin: 0;
  flex: 1;
  padding-right: 20px;
}

.product-brand {
  display: inline-block;
  padding: 4px 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

.product-info {
  margin-bottom: 16px;
}

.product-specs {
  color: var(--secondary-color);
  font-size: 0.95rem;
  margin-bottom: 12px;
}

.product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  padding-top: 16px;
  border-top: 1px solid #f0f0f0;
}

.product-meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.product-meta-label {
  font-size: 0.8rem;
  color: var(--secondary-color);
}

.product-meta-value {
  font-size: 0.95rem;
  color: var(--text-color);
  font-weight: 500;
}

.product-price {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 16px;
}

.product-price-label {
  font-size: 0.85rem;
  opacity: 0.9;
  margin-bottom: 8px;
}

.product-price-range {
  font-size: 1.5rem;
  font-weight: 700;
}

.product-price-unit {
  font-size: 0.9rem;
  opacity: 0.9;
}

.product-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid #f0f0f0;
}

.product-quote-count {
  color: var(--secondary-color);
  font-size: 0.9rem;
}

.product-quote-count strong {
  color: var(--primary-color);
}

.about-section {
  padding: 60px 0;
  background: white;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
}

.feature-card {
  text-align: center;
  padding: 30px;
  border-radius: 8px;
  background: var(--bg-color);
}

.feature-card h3 {
  color: var(--primary-color);
  margin-bottom: 15px;
}

footer {
  background: var(--text-color);
  color: white;
  text-align: center;
  padding: 30px 0;
  margin-top: 60px;
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1001;
}

.modal-content {
  background: white;
  padding: 30px;
  border-radius: 10px;
  width: 90%;
  max-width: 500px;
  position: relative;
  margin: auto;
}

.modal-content.modal-lg {
  max-width: 800px;
}

.modal-close {
  font-size: 48px;
  font-weight: bold;
  cursor: pointer;
  color: #666;
  line-height: 1;
  transition: color 0.2s;
  position: absolute;
  top: 10px;
  right: 20px;
  z-index: 10;
}

.modal-close:hover {
  color: #333;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #e8e8e8;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.5rem;
  color: #333;
}

.modal-close {
  font-size: 36px;
  font-weight: bold;
  cursor: pointer;
  color: #666;
  line-height: 1;
  transition: color 0.2s;
  margin-top: -5px;
}

.modal-close:hover {
  color: #333;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 15px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 1rem;
}

.form-group textarea {
  resize: vertical;
}

.form-group small {
  display: block;
  margin-top: 5px;
  color: var(--secondary-color);
  font-size: 0.85rem;
}

.parse-result {
  margin-top: 20px;
  padding: 15px;
  background: #f0f9ff;
  border-radius: 6px;
  display: none;
}

.parse-result.show {
  display: block;
}

.modal-desc {
  margin-bottom: 20px;
  color: var(--secondary-color);
}

.success-message {
  padding: 20px;
  background: #d1fae5;
  border-radius: 6px;
  color: #065f46;
  margin-top: 15px;
}

.success-message h3 {
  margin-bottom: 10px;
}

.success-message p {
  margin: 5px 0;
}

.success-message .password {
  font-weight: bold;
  font-size: 1.1rem;
  color: var(--primary-color);
  background: white;
  padding: 8px 16px;
  border-radius: 4px;
  display: inline-block;
  margin: 10px 0;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .3s;
  border-radius: 26px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: #4CAF50;
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(24px);
}

@media (max-width: 768px) {
  .navbar .container {
    flex-direction: column;
    height: auto;
    padding: 15px;
  }

  .nav-links {
    margin: 15px 0;
  }

  .hero h2 {
    font-size: 1.8rem;
  }

  .hero-actions {
    flex-direction: column;
  }

  /* 移动端按钮优化 - 最小44x44px触摸区域 */
  .btn {
    min-height: 44px;
    padding: 12px 20px;
    font-size: 16px;
  }

  .modal-content {
    margin: 10px;
    max-height: 90vh;
    overflow-y: auto;
  }

  .form-group input,
  .form-group textarea,
  .form-group select {
    min-height: 44px;
    font-size: 16px;
  }

  .product-card {
    padding: 15px;
  }

  .product-card .btn {
    width: 100%;
    margin-top: 10px;
  }
}

/* Image Preview Styles */
.image-preview-container {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.image-preview-item {
  position: relative;
  width: 100px;
  height: 100px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid var(--text-secondary);
}

.image-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.remove-image-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--danger-color);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.remove-image-btn:hover {
  background: var(--text-color);
}

/* Excel Preview Styles */
.excel-preview-container {
  margin-top: 10px;
}

.excel-preview-item {
  position: relative;
  display: inline-block;
  background: #f8f9fa;
  padding: 10px 15px;
  border-radius: 8px;
  border: 2px solid var(--border-color);
  font-size: 0.9rem;
  color: var(--text-color);
}

.remove-excel-btn {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--danger-color);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.remove-excel-btn:hover {
  background: var(--text-color);
}
