* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: #101a33;
  font-family: "Segoe UI", "PingFang TC", "Microsoft JhengHei", sans-serif;
  background: #f4f6fb;
}

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

a {
  color: inherit;
}

.page-shell {
  min-height: 100vh;
}

.home-main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 48px;
}

.hero-section {
  position: relative;
  width: 100%;
  margin-bottom: 26px;
  background: #e8edf8;
  overflow: hidden;
}

.banner-slider {
  position: relative;
  width: 100%;
  aspect-ratio: 3648 / 1120;
}

.banner-slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.9s ease;
}

.banner-slide.is-active {
  opacity: 1;
  pointer-events: auto;
}

.banner-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.banner-actions {
  position: absolute;
  left: 42px;
  bottom: 42px;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.banner-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 148px;
  padding: 13px 26px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.banner-btn:hover {
  transform: translateY(-2px);
}

.banner-btn-primary {
  background: linear-gradient(135deg, #255de0 0%, #1c46ae 100%);
  border: 2px solid rgba(255, 255, 255, 0.9);
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(16, 26, 51, 0.28);
}

.banner-btn-ghost {
  background: rgba(255, 255, 255, 0.92);
  border: 2px solid rgba(255, 255, 255, 0.95);
  color: #12235e;
  box-shadow: 0 10px 22px rgba(16, 26, 51, 0.22);
}

.banner-btn-ghost:hover {
  background: #ffffff;
}

.banner-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(15, 25, 50, 0.42);
  color: #ffffff;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, opacity 0.2s ease;
}

.banner-arrow:hover {
  background: rgba(37, 93, 224, 0.85);
}

.banner-arrow.banner-prev {
  left: 18px;
}

.banner-arrow.banner-next {
  right: 18px;
}

.banner-dots {
  position: absolute;
  right: 24px;
  bottom: 18px;
  z-index: 3;
  display: flex;
  gap: 10px;
}

.banner-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  transition: width 0.2s ease, background 0.2s ease;
}

.banner-dots span.is-active {
  width: 28px;
  border-radius: 999px;
  background: #ffffff;
}

.size-selector {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
  align-items: center;
  margin-bottom: 34px;
  padding: 16px;
  border-radius: 18px;
  background: #eef3ff;
}

.size-heading h2 {
  margin: 0 0 8px;
  color: #2a57d5;
  font-size: 32px;
}

.size-heading p {
  margin: 0;
  color: #5c6783;
}

.size-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.size-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 108px;
  padding: 16px 14px;
  border: 1px solid rgba(45, 91, 219, 0.12);
  border-radius: 14px;
  background: #ffffff;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.size-card:hover,
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 26px rgba(35, 56, 107, 0.1);
}

.size-icon {
  width: 42px;
  aspect-ratio: 4 / 3;
  margin-bottom: 8px;
  border: 2px solid #6284e7;
  border-radius: 4px;
  position: relative;
}

.size-icon::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 14px;
  height: 2px;
  background: #6284e7;
  transform: translateX(-50%);
}

.size-card strong {
  color: #2448a3;
  font-size: 20px;
}

.size-card small {
  color: #67728f;
  font-size: 13px;
}

.product-section {
  margin-bottom: 40px;
}

.contact-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 32px 36px;
  border-radius: 20px;
  background: linear-gradient(135deg, #15367b 0%, #255de0 55%, #5b89ff 100%);
  color: #ffffff;
}

.contact-kicker {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.86;
}

.contact-section h2 {
  margin: 0 0 10px;
  font-size: 34px;
}

.contact-section p:last-of-type {
  margin: 0;
  max-width: 720px;
  color: rgba(255, 255, 255, 0.92);
  line-height: 1.7;
}

.contact-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 220px;
  padding: 16px 22px;
  border-radius: 14px;
  background: #ffffff;
  color: #1f56d5;
  font-size: 16px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 12px 26px rgba(9, 25, 66, 0.18);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.section-header h2 {
  margin: 0 0 6px;
  font-size: 34px;
}

.section-header p {
  margin: 0;
  color: #6b7692;
}

.section-header a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border: 1px solid #d8e2ff;
  border-radius: 12px;
  background: #ffffff;
  color: #255de0;
  font-weight: 700;
  text-decoration: none;
}

.section-header a::after {
  content: ">";
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

/* 首頁動態商品卡（home.js 渲染） */
.product-image-link {
  display: block;
  border-radius: 14px;
}

.product-image-link:hover .product-image-wrap img {
  transform: scale(1.03);
}

.product-image-wrap img {
  transition: transform 0.3s ease;
}

.section-empty-tip {
  grid-column: 1 / -1;
  padding: 34px;
  border: 1px dashed #ccd8f6;
  border-radius: 16px;
  background: #ffffff;
  color: #6b7692;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
}

.product-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  border: 1px solid #e8ecf7;
  border-radius: 18px;
  background: #ffffff;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-image-wrap {
  position: relative;
  padding: 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, #f5f7fe 0%, #eef3ff 100%);
}

.product-image-wrap img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 10px;
}

.product-tag {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 6px 10px;
  border-radius: 10px;
  background: #255de0;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
}

.product-card h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.4;
}

.product-meta {
  margin: 0;
  color: #6b7692;
  font-size: 14px;
}

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
}

.product-footer strong {
  color: #255de0;
  font-size: 30px;
}

.product-footer a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 10px;
  background: #255de0;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

@media (max-width: 1100px) {
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .size-selector {
    grid-template-columns: 1fr;
  }

  .size-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .home-main {
    width: calc(100% - 20px);
    padding-top: 0;
  }

  .banner-arrow {
    width: 36px;
    height: 36px;
    font-size: 22px;
  }

  .banner-arrow.banner-prev {
    left: 10px;
  }

  .banner-arrow.banner-next {
    right: 10px;
  }

  .banner-dots {
    right: 12px;
    bottom: 10px;
  }

  .banner-actions {
    left: 18px;
    bottom: 16px;
    gap: 10px;
  }

  .banner-btn {
    min-width: 112px;
    padding: 9px 16px;
    border-radius: 6px;
    font-size: 14px;
  }

  .product-grid,
  .size-grid {
    grid-template-columns: 1fr;
  }

  .section-header,
  .product-footer,
  .contact-section {
    flex-direction: column;
    align-items: flex-start;
  }

  .section-header a,
  .product-footer a,
  .contact-btn {
    width: 100%;
  }

  .product-footer strong {
    font-size: 26px;
  }
}

/* ===== 首頁商品卡（與 produce.html 一致）===== */
.tv-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border: 1px solid #e6ebf6;
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 12px 26px rgba(17, 26, 51, 0.05);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tv-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 34px rgba(17, 26, 51, 0.1);
}

.tv-card:focus-visible {
  outline: 3px solid rgba(45, 91, 219, 0.3);
  outline-offset: 2px;
}

.tv-media {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: #f5f8ff;
}

.tv-media img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.wish-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid #dce5fb;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: #5f78d6;
  font-size: 18px;
}

.tv-card h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  min-height: 2.8em;
}

.tv-subtitle {
  margin: -4px 0 0;
  color: #4f5a76;
  font-size: 15px;
  font-weight: 600;
}

.spec-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.spec-list span {
  padding: 6px 10px;
  border-radius: 999px;
  background: #f3f6fd;
  color: #50607f;
  font-size: 12px;
  font-weight: 700;
}

.tv-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: auto;
}

.price-box {
  display: grid;
  gap: 4px;
}

.price-box strong {
  color: #255de0;
  font-size: 20px;
  line-height: 1;
}

.price-box span {
  color: #2fa356;
  font-size: 13px;
  font-weight: 800;
}

.cart-btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid #dbe5ff;
  border-radius: 14px;
  background: #ffffff;
  color: #2d5bdb;
  font-size: 20px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.cart-btn:hover {
  background: #eaf0ff;
  border-color: #2d5bdb;
}

.cart-btn.is-added {
  background: linear-gradient(135deg, #2dc45f 0%, #1ea54d 100%);
  border-color: #1ea54d;
  color: #ffffff;
  transform: scale(1.08);
}
