html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
  background-color: #f7f8fa;
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
  text-align: start;
}

.home-hero {
  background: radial-gradient(circle at top right, rgba(109, 127, 255, 0.2), transparent 55%),
    linear-gradient(135deg, #eef3ff 0%, #fef9f3 100%);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 10px 30px rgba(22, 28, 45, 0.08);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #0d6efd;
  background-color: rgba(13, 110, 253, 0.1);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-visual {
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.7);
  padding: 2rem;
}

.hero-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(13, 110, 253, 0.1), transparent 50%),
    radial-gradient(circle at 80% 30%, rgba(255, 193, 7, 0.15), transparent 55%);
  z-index: 0;
}

.hero-visual-card {
  position: relative;
  z-index: 1;
  background: white;
  border-radius: 1.5rem;
  padding: 1.75rem;
}

.hero-visual-glow {
  position: absolute;
  inset: 15%;
  background: radial-gradient(circle, rgba(13, 110, 253, 0.25), transparent 60%);
  filter: blur(40px);
  z-index: 0;
}

.hero-visual-products {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.hero-product-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #f0f2f5;
  font-weight: 600;
  color: #111827;
}

.hero-product-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.text-bg-primary-soft {
  background-color: rgba(13, 110, 253, 0.15);
  color: #0d6efd;
}

.home-search-card {
  background: white;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 15px 30px rgba(15, 23, 42, 0.06);
}

.feature-card {
  background: white;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 12px 25px rgba(15, 23, 42, 0.05);
}

.feature-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.product-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 35px rgba(15, 23, 42, 0.1);
}

.product-card.sold-out {
  opacity: 0.6;
  filter: grayscale(100%);
  position: relative;
}

.product-card.sold-out::after {
  content: "已售出";
  position: absolute;
  top: 1rem;
  right: 1rem;
  background-color: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  z-index: 10;
  pointer-events: none;
}

.product-card.sold-out:hover {
  transform: none;
}

.product-card.damaged {
  position: relative;
}

.damaged-image {
  filter: drop-shadow(8px 8px 10px red);
}

/* 如果同时有已售出和有傷，调整已售出标签位置 */
.product-card.sold-out.damaged::after {
  top: 4rem;
}

.product-image-wrapper {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 1.25rem;
  background: linear-gradient(135deg, #f3f4f6 0%, #ffffff 100%);
  margin: 1rem;
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  color: #94a3b8;
  background: repeating-linear-gradient(
      45deg,
      rgba(148, 163, 184, 0.15),
      rgba(148, 163, 184, 0.15) 10px,
      rgba(148, 163, 184, 0.05) 10px,
      rgba(148, 163, 184, 0.05) 20px
    ),
    white;
}

.product-price {
  border-top: 1px solid #f1f5f9;
  padding-top: 1rem;
}

.product-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.product-actions .form-control {
  max-width: 90px;
}

.product-actions .btn {
  white-space: nowrap;
}

.alert.rounded-4 {
  border: none;
  box-shadow: 0 15px 25px rgba(15, 23, 42, 0.08);
}

.product-unavailable {
  border: 1px dashed rgba(234, 179, 8, 0.6);
  background: rgba(255, 248, 229, 0.8);
  color: #92400e;
}

.product-unavailable .btn {
  border-color: rgba(148, 163, 184, 0.5);
}

.recommendations-card {
  background: linear-gradient(135deg, #101828, #1d3b6b);
  color: white;
  border: none;
  box-shadow: 0 20px 35px rgba(3, 7, 18, 0.35);
}

.recommendations-card .text-muted {
  color: rgba(255, 255, 255, 0.65) !important;
}

.recommendations-badge {
  background-color: rgba(255, 255, 255, 0.12);
  color: #fff;
  padding: 0.5rem 1.25rem;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.recommendation-product {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 1.5rem;
  transition: transform 0.2s ease, background 0.2s ease;
  color: inherit;
}

.recommendation-product:hover {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.12);
}

.recommendation-product .btn {
  border-color: rgba(255, 255, 255, 0.5);
  color: white;
}

.recommendation-product .btn:hover {
  background: white;
  color: #0f172a;
}

@media (max-width: 767.98px) {
  .home-hero {
    text-align: center;
  }

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

  .product-actions .form-control {
    max-width: 100%;
    width: 100%;
  }

  .feature-card {
    text-align: center;
  }
}