* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Microsoft YaHei", sans-serif;
}

body {
  background: #f9f6f0;
  color: #333;
}

header {
  background: #8b0000;
  color: white;
  text-align: center;
  padding: 30px 20px;
}

nav {
  background: #6a0000;
  padding: 15px;
  text-align: center;
}

nav a {
  color: white;
  margin: 0 14px;
  text-decoration: none;
  font-size: 16px;
}

.banner img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
}

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

h2 {
  margin-bottom: 20px;
  color: #8b0000;
  border-left: 6px solid #8b0000;
  padding-left: 12px;
}

.card-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  transition: transform 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 20px rgba(0,0,0,0.12);
}

.card h3 {
  color: #8b0000;
  margin-bottom: 8px;
}

.feature-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin: 30px 0;
}

.feature-item {
  background: white;
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  text-align: center;
}

.feature-item h3 {
  color: #8b0000;
  margin-bottom: 12px;
  font-size: 18px;
}

.card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 15px;
}

.news-time {
  font-size: 12px;
  color: #999;
  margin-top: 10px;
  text-align: right;
}

.contact-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin: 30px 0;
}

.contact-info {
  background: white;
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.contact-info h3 {
  color: #8b0000;
  margin-bottom: 20px;
  font-size: 18px;
}

.contact-info p {
  margin-bottom: 12px;
  line-height: 1.6;
}

.contact-form {
  background: white;
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.contact-form h3 {
  color: #8b0000;
  margin-bottom: 20px;
  font-size: 18px;
}

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

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  color: #333;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
}

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

.submit-btn {
  background: #8b0000;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.submit-btn:hover {
  background: #6a0000;
}

.form-message {
  margin-top: 15px;
  padding: 10px;
  border-radius: 6px;
  text-align: center;
}

.form-message.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.form-message.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

footer {
  text-align: center;
  padding: 30px;
  background: #f0ebe4;
  margin-top: 40px;
}

.cart-link {
  background: #8b0000;
  padding: 8px 16px;
  border-radius: 4px;
}

.subtitle {
  color: #666;
  margin-bottom: 30px;
  font-size: 16px;
}

.category-filter {
  margin-bottom: 30px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 20px;
  border: 2px solid #8b0000;
  background: white;
  color: #8b0000;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.filter-btn:hover,
.filter-btn.active {
  background: #8b0000;
  color: white;
}

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

.product-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

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

.product-info {
  padding: 15px;
}

.product-info h3 {
  color: #8b0000;
  font-size: 16px;
  margin-bottom: 8px;
}

.product-desc {
  font-size: 13px;
  color: #666;
  margin-bottom: 12px;
  line-height: 1.5;
}

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

.price {
  font-size: 20px;
  font-weight: bold;
  color: #8b0000;
}

.add-to-cart-btn {
  padding: 6px 12px;
  background: #8b0000;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.3s ease;
}

.add-to-cart-btn:hover {
  background: #6a0000;
}

.add-to-cart-btn.large {
  padding: 12px 30px;
  font-size: 16px;
  margin-top: 15px;
}

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

.modal-content {
  background: white;
  max-width: 900px;
  margin: 50px auto;
  border-radius: 12px;
  padding: 30px;
  position: relative;
}

.close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 30px;
  cursor: pointer;
  color: #999;
}

.close:hover {
  color: #333;
}

.modal-product {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

.modal-product img {
  width: 100%;
  height: 350px;
  object-fit: cover;
  border-radius: 8px;
}

.modal-details h2 {
  border: none;
  padding: 0;
  margin-bottom: 10px;
}

.product-category {
  color: #999;
  margin-bottom: 10px;
}

.product-price {
  font-size: 28px;
  font-weight: bold;
  color: #8b0000;
  margin-bottom: 15px;
}

.product-description {
  color: #666;
  line-height: 1.8;
  margin-bottom: 15px;
}

.product-story {
  background: #f9f6f0;
  padding: 15px;
  border-radius: 8px;
  color: #555;
  line-height: 1.6;
}

.quantity-selector {
  display: flex;
  align-items: center;
  margin: 20px 0;
}

.quantity-selector button {
  width: 35px;
  height: 35px;
  border: 1px solid #ddd;
  background: white;
  font-size: 18px;
  cursor: pointer;
}

.quantity-selector input {
  width: 60px;
  height: 35px;
  text-align: center;
  border: 1px solid #ddd;
  border-left: none;
  border-right: none;
  font-size: 16px;
}

.cart-container {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 30px;
  margin-top: 20px;
}

.cart-items {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.cart-item {
  display: grid;
  grid-template-columns: 80px 1fr auto auto auto;
  gap: 15px;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid #eee;
}

.cart-item:last-child {
  border-bottom: none;
}

.cart-item img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
}

.cart-item-info h3 {
  color: #333;
  font-size: 15px;
  margin-bottom: 5px;
}

.cart-item-price {
  color: #8b0000;
  font-weight: bold;
}

.cart-item-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cart-item-actions button {
  width: 28px;
  height: 28px;
  border: 1px solid #ddd;
  background: white;
  cursor: pointer;
  border-radius: 4px;
}

.cart-item-actions span {
  min-width: 30px;
  text-align: center;
  font-weight: bold;
}

.cart-item-subtotal {
  font-weight: bold;
  color: #8b0000;
  min-width: 80px;
  text-align: right;
}

.cart-item-remove {
  background: none;
  border: none;
  color: #999;
  font-size: 24px;
  cursor: pointer;
  padding: 0 5px;
}

.cart-item-remove:hover {
  color: #8b0000;
}

.cart-empty {
  text-align: center;
  padding: 50px 20px;
}

.cart-empty p {
  color: #999;
  margin-bottom: 20px;
  font-size: 18px;
}

.cart-summary {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  position: sticky;
  top: 20px;
}

.cart-summary h3 {
  color: #8b0000;
  margin-bottom: 15px;
  font-size: 18px;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  font-size: 18px;
  font-weight: bold;
  padding: 15px 0;
  border-bottom: 2px solid #eee;
  margin-bottom: 20px;
}

.cart-total span:last-child {
  color: #8b0000;
}

.checkout-btn {
  width: 100%;
  padding: 15px;
  background: #8b0000;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s ease;
}

.checkout-btn:hover {
  background: #6a0000;
}

.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 15px 25px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.2);
  transform: translateX(400px);
  transition: transform 0.3s ease;
  z-index: 2000;
}

.notification.show {
  transform: translateX(0);
}

.notification.success {
  border-left: 4px solid #28a745;
}

.notification.error {
  border-left: 4px solid #dc3545;
}

.btn-primary {
  display: inline-block;
  padding: 10px 20px;
  background: #8b0000;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: background 0.3s ease;
}

.btn-primary:hover {
  background: #6a0000;
}

@media (max-width: 768px) {
  .modal-product,
  .cart-container {
    grid-template-columns: 1fr;
  }
  
  .cart-item {
    grid-template-columns: 60px 1fr;
    gap: 10px;
  }
  
  .cart-item-actions,
  .cart-item-subtotal,
  .cart-item-remove {
    grid-column: 2;
  }
  
  .contact-container {
    grid-template-columns: 1fr;
  }
}
