:root {
  color-scheme: light dark;
  --bg: #e7edf1;
  --surface: #f3f6f7;
  --surface-strong: #d9e2e8;
  --surface-raised: #edf2f4;
  --ink: #10232f;
  --muted: #506672;
  --line: #a8b6bf;
  --accent: #9e4d04;
  --accent-ink: #fff6e8;
  --focus: #005f8f;
  --shadow: 0 18px 42px rgba(30, 58, 72, 0.13);
  --radius: 6px;
  --max: 1420px;
  font-family: "Microsoft JhengHei", "PingFang TC", "Noto Sans TC", system-ui, sans-serif;
  font-synthesis: none;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c171e;
    --surface: #13232c;
    --surface-strong: #1c303b;
    --surface-raised: #172832;
    --ink: #edf4f6;
    --muted: #abc0ca;
    --line: #405661;
    --accent: #f2a03f;
    --accent-ink: #251608;
    --focus: #63c7f3;
    --shadow: 0 20px 46px rgba(2, 9, 13, 0.34);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scrollbar-color: var(--accent) var(--surface-strong);
  scrollbar-width: thin;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(112deg, rgba(255, 255, 255, 0.08), transparent 38%, rgba(10, 45, 62, 0.05));
  content: "";
  pointer-events: none;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.24em;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

img {
  display: block;
  height: auto;
  max-width: 100%;
  background: var(--surface-strong);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  letter-spacing: -0.025em;
  line-height: 1.13;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 10;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-ink);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  width: 100%;
  min-height: 70px;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 0 max(24px, calc((100vw - var(--max)) / 2));
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(16px);
}

.wordmark {
  flex: 0 0 auto;
  font-size: clamp(1rem, 1.6vw, 1.28rem);
  font-weight: 800;
  letter-spacing: 0.055em;
  text-decoration: none;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.8vw, 42px);
  white-space: nowrap;
}

.main-nav a {
  position: relative;
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
}

.main-nav a::after {
  position: absolute;
  right: 0;
  bottom: -6px;
  left: 0;
  height: 2px;
  background: var(--accent);
  content: "";
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms ease-out;
}

.main-nav a:hover::after,
.main-nav a:focus-visible::after {
  transform: scaleX(1);
}

.hero {
  display: grid;
  width: min(calc(100% - 48px), var(--max));
  min-height: calc(100dvh - 70px);
  margin: 0 auto;
  grid-template-columns: minmax(0, 0.88fr) minmax(480px, 1.12fr);
  align-items: center;
  gap: clamp(46px, 7vw, 110px);
  padding: 58px 0 72px;
}

.hero__copy {
  max-width: 680px;
}

.detail-product__category {
  margin: -8px 0 18px;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.hero h1 {
  max-width: 9em;
  margin-bottom: 24px;
  font-family: Bahnschrift, "Microsoft JhengHei", sans-serif;
  font-size: clamp(3rem, 5.4vw, 5.3rem);
  font-stretch: condensed;
  font-weight: 760;
  letter-spacing: -0.035em;
}

.hero__summary {
  max-width: 33em;
  margin-bottom: 32px;
  color: var(--muted);
  font-size: clamp(1rem, 1.4vw, 1.18rem);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 150ms ease-out, background-color 150ms ease-out, border-color 150ms ease-out;
}

.button:active {
  transform: translateY(1px);
}

.button--primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.button--primary:hover {
  background: color-mix(in srgb, var(--accent) 88%, var(--ink));
}

.button--secondary {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.button--secondary:hover {
  border-color: var(--ink);
  background: var(--surface-strong);
}

.hero__media {
  margin: 0;
}

.hero__media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  object-fit: cover;
}

.hero__media figcaption {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.83rem;
}

.catalog-tools,
.product-section,
.service-band,
.detail-main {
  width: min(calc(100% - 48px), var(--max));
  margin-inline: auto;
}

.catalog-tools {
  display: grid;
  grid-template-columns: minmax(260px, 0.75fr) minmax(300px, 1.25fr);
  gap: 26px 70px;
  padding: 86px 0 56px;
  border-top: 1px solid var(--line);
}

.section-heading {
  grid-row: span 2;
}

.section-heading h2,
.product-section h2,
.service-band > h2,
.spec-section > h2,
.related-section > h2 {
  margin-bottom: 14px;
  font-family: Bahnschrift, "Microsoft JhengHei", sans-serif;
  font-size: clamp(2rem, 3.5vw, 3.3rem);
  font-stretch: condensed;
}

.section-heading p,
.product-section__heading p {
  max-width: 45ch;
  margin-bottom: 0;
  color: var(--muted);
}

.search-field {
  display: grid;
  gap: 8px;
}

.search-field label {
  font-size: 0.88rem;
  font-weight: 800;
}

.search-field input {
  width: 100%;
  min-height: 50px;
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
}

.search-field input::placeholder {
  color: var(--muted);
}

.search-field input:focus {
  border-color: var(--focus);
}

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

.category-button {
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 700;
}

.category-button:hover {
  border-color: var(--ink);
  background: var(--surface);
}

.category-button[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.product-section {
  padding: 60px 0 112px;
}

.product-section__heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 34px;
}

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

.product-card {
  min-width: 0;
}

.product-card__image {
  display: block;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface-strong);
}

.product-card__image img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1), filter 300ms ease-out;
}

.product-card:hover .product-card__image img {
  filter: saturate(1.06) contrast(1.03);
  transform: scale(1.025);
}

.product-card__body {
  padding: 16px 4px 0;
}

.product-card__category {
  margin-bottom: 7px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
}

.product-card h3 {
  margin-bottom: 9px;
  font-size: 1.12rem;
}

.product-card h3 a {
  text-decoration: none;
}

.product-card h3 a:hover {
  text-decoration: underline;
}

.product-card__summary {
  min-height: 3.1em;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.product-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.product-card__footer a {
  color: var(--accent);
  font-weight: 800;
  white-space: nowrap;
}

.empty-state,
.detail-error {
  padding: 64px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
}

.empty-state h3,
.detail-error h1 {
  margin-bottom: 10px;
  font-size: 2rem;
}

.empty-state p,
.detail-error p {
  color: var(--muted);
}

.service-band {
  padding: 86px 0 110px;
  border-top: 1px solid var(--line);
}

.service-band > h2 {
  max-width: 12em;
  margin-bottom: 38px;
}

.service-band__items {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-block: 1px solid var(--line);
}

.service-band__items article {
  padding: 30px 32px;
}

.service-band__items article + article {
  border-left: 1px solid var(--line);
}

.service-band__items h3 {
  margin-bottom: 9px;
  color: var(--accent);
  font-size: 1.08rem;
}

.service-band__items p {
  margin-bottom: 0;
  color: var(--muted);
}

.site-footer {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 28px;
  padding: 44px max(24px, calc((100vw - var(--max)) / 2));
  border-top: 1px solid var(--line);
  background: var(--surface-strong);
  font-size: 0.86rem;
}

.site-footer strong {
  font-size: 1rem;
}

.site-footer p {
  margin: 4px 0 0;
  color: var(--muted);
}

.site-footer > a {
  color: var(--accent);
  font-weight: 800;
}

.noscript-message {
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
}

/* Product detail */
.detail-main {
  padding: 26px 0 112px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 26px;
  color: var(--muted);
  font-size: 0.82rem;
}

.breadcrumb a {
  color: var(--ink);
}

.detail-product {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
  gap: clamp(44px, 7vw, 100px);
  align-items: center;
  min-height: calc(100dvh - 140px);
  padding-bottom: 72px;
}

.detail-product__media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  object-fit: cover;
}

.detail-product__info h1 {
  margin-bottom: 20px;
  font-family: Bahnschrift, "Microsoft JhengHei", sans-serif;
  font-size: clamp(2.6rem, 5vw, 5rem);
  font-stretch: condensed;
  letter-spacing: -0.035em;
}

.detail-product__summary {
  max-width: 42ch;
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 1.08rem;
}

.detail-product__price {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 22px;
  color: var(--accent);
  font-family: Bahnschrift, sans-serif;
  font-size: 2rem;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.detail-product__price span {
  color: var(--muted);
  font-family: "Microsoft JhengHei", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
}

.feature-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 30px;
  padding: 0;
  list-style: none;
}

.feature-list li {
  padding: 11px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
}

.spec-section {
  padding: 80px 0;
  border-top: 1px solid var(--line);
}

.spec-section > h2 {
  margin-bottom: 32px;
}

.spec-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.spec-group {
  padding: 26px;
  border-radius: var(--radius);
  background: var(--surface);
}

.spec-group h3 {
  margin-bottom: 22px;
  color: var(--accent);
  font-size: 1rem;
}

.spec-group ul {
  margin: 0;
  padding-left: 1.15em;
  color: var(--muted);
}

.spec-group li + li {
  margin-top: 9px;
}

.related-section {
  padding: 80px 0 0;
  border-top: 1px solid var(--line);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.related-card a {
  display: block;
  text-decoration: none;
}

.related-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  margin-bottom: 14px;
  border-radius: var(--radius);
  object-fit: cover;
}

.related-card span {
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
}

.related-card h3 {
  margin: 7px 0;
  font-size: 1.05rem;
}

.related-card p {
  color: var(--muted);
  font-size: 0.83rem;
  font-variant-numeric: tabular-nums;
}

.detail-error {
  margin: 80px auto;
}

.detail-error > p:first-child {
  color: var(--accent);
  font-weight: 800;
}

@media (max-width: 1120px) {
  .hero {
    grid-template-columns: minmax(0, 0.92fr) minmax(400px, 1.08fr);
    gap: 42px;
  }

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

  .site-footer {
    grid-template-columns: 1fr auto;
  }

}

@media (max-width: 820px) {
  .site-header {
    min-height: 64px;
    padding-inline: 18px;
  }

  .main-nav a:not(:last-child) {
    display: none;
  }

  .hero,
  .catalog-tools,
  .product-section,
  .service-band,
  .detail-main {
    width: min(calc(100% - 32px), var(--max));
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    gap: 34px;
    padding: 58px 0 70px;
  }

  .hero__copy {
    max-width: none;
  }

  .hero h1 {
    font-size: clamp(2.7rem, 12vw, 4.5rem);
  }

  .hero__media {
    max-width: none;
  }

  .catalog-tools {
    grid-template-columns: 1fr;
    padding-top: 66px;
  }

  .section-heading {
    grid-row: auto;
  }

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

  .service-band__items,
  .spec-grid,
  .related-grid {
    grid-template-columns: 1fr;
  }

  .service-band__items article + article {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .site-footer {
    grid-template-columns: 1fr;
    padding: 38px 18px;
  }

  .detail-product {
    grid-template-columns: 1fr;
    min-height: auto;
    gap: 34px;
    padding: 18px 0 64px;
  }

  .detail-product__info h1 {
    font-size: clamp(2.45rem, 11vw, 4.2rem);
  }
}

@media (max-width: 540px) {
  .wordmark {
    max-width: 12em;
    font-size: 0.92rem;
  }

  .main-nav {
    gap: 12px;
  }

  .main-nav a {
    font-size: 0.82rem;
  }

  .hero__actions,
  .hero__actions .button {
    width: 100%;
  }

  .product-section__heading {
    align-items: start;
    flex-direction: column;
  }

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

  .product-card__summary {
    min-height: auto;
  }

  .feature-list {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .main-nav a::after,
  .button,
  .product-card__image img {
    transition: none;
  }
}
