:root { color-scheme: light; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  --background: #f3f5f0;
  --surface: #fff;
  --text: #182420;
  --muted: #4c6257;
  --accent: #1e5a43;
  --on-accent: #fff;
  --line: #dce2da;
  --radius: 12px;
  --shadow: none;
  --body-font: "Microsoft JhengHei", "PingFang TC", system-ui, sans-serif;
  --display-font: var(--body-font);
  --site-width: 1240px;
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: var(--body-font);
  line-height: 1.55;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button, input, select { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.skip-link { position: absolute; z-index: 10; top: 0; left: 1rem; padding: .75rem 1rem; transform: translateY(-120%); background: var(--surface); color: var(--text); }
.skip-link:focus { transform: none; }
.header-inner, .section, .hero-inner, .footer-inner { width: min(calc(100% - 3rem), var(--site-width)); margin-inline: auto; }
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; gap: 1.5rem; align-items: center; justify-content: space-between; min-height: 74px; padding-block: .75rem; }
.brand { font: 750 1.25rem/1.2 var(--display-font); overflow-wrap: anywhere; }
.brand img { display: block; max-width: min(170px, 40vw); max-height: 48px; object-fit: contain; }
.main-nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .7rem 1.5rem; font-size: .9rem; }
.main-nav a:hover, .site-footer a:hover, .catalog-sidebar a:hover { text-decoration: underline; text-underline-offset: .2em; }
.btn { display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: var(--radius); padding: .58rem .88rem; font-weight: 700; font-size: .9rem; line-height: 1.35; width: fit-content; white-space: nowrap; }
.btn-primary { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
.btn:hover { filter: brightness(.94); }
.hero { padding-block: clamp(2.2rem, 4.5vw, 4.5rem); }
.hero-inner { display: grid; grid-template-columns: 1fr 1.05fr; gap: clamp(1.5rem, 5vw, 5rem); align-items: center; }
.hero-copy { min-width: 0; }
.hero-copy h1 { font: 780 clamp(2.15rem, 5vw, 4.55rem)/1.14 var(--display-font); letter-spacing: -.055em; overflow-wrap: anywhere; margin: 0 0 .85rem; }
.hero-copy p { max-width: 59ch; margin: 0 0 1.4rem; color: var(--muted); }
.hero-media { position: relative; min-width: 0; display: grid; overflow: hidden; min-height: 220px; aspect-ratio: 1.25; border-radius: var(--radius); background: color-mix(in srgb, var(--accent) 11%, var(--surface)); }
.hero-media img { width: 100%; height: 100%; min-height: 0; inset: 0; position: absolute; object-fit: contain; }
.hero-inner:has(.hero-media[hidden]) { grid-template-columns: minmax(0, 760px); }
.section { padding-block: 2rem 3.25rem; }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; align-items: center; margin-bottom: 1.3rem; padding-bottom: .95rem; border-bottom: 1px solid var(--line); }
.section-head :is(h1, h2) { margin: 0; font: 750 clamp(1.5rem, 3vw, 2.5rem)/1.15 var(--display-font); letter-spacing: -.04em; }
.category-intro { margin: 0 0 1.4rem; max-width: 75ch; color: var(--muted); }
.category-intro a { color: var(--accent); text-decoration: underline; text-underline-offset: .16em; }
.product-search { width: min(100%, 290px); min-height: 43px; padding: .55rem .8rem; color: var(--text); border: 1px solid var(--line); border-radius: min(var(--radius), 13px); background: var(--surface); }
.product-search::placeholder { color: var(--muted); }
.catalog-layout { display: grid; grid-template-columns: minmax(145px, 18%) minmax(0, 1fr); gap: 1.4rem; align-items: start; }
.catalog-sidebar { display: grid; gap: .25rem; max-height: 600px; overflow: auto; padding: 0 .4rem .5rem; }
.catalog-sidebar a { padding: .4rem .55rem; line-height: 1.35; border-radius: min(var(--radius), 8px); font-size: .875rem; overflow-wrap: anywhere; }
.catalog-sidebar a[aria-current] { background: var(--accent); color: var(--on-accent); }
.catalog-tags summary { cursor: pointer; padding: .4rem .55rem; font-size: .875rem; }
.catalog-tag-links { display: grid; gap: .25rem; }
.product-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.product-card { min-width: 0; display: grid; grid-template-rows: auto 1fr; color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; box-shadow: var(--shadow); }
.product-card:hover .product-body h3 { text-decoration: underline; text-underline-offset: .17em; }
.product-image { display: grid; place-items: center; margin: 0; width: 100%; aspect-ratio: 1; min-width: 0; overflow: hidden; background: color-mix(in srgb, var(--surface), var(--background) 50%); }
.product-image img { width: 100%; height: 100%; object-fit: contain; }
.product-body { padding: .75rem; min-width: 0; display: flex; flex-direction: column; gap: .4rem; justify-content: space-between; }
.product-body h3 { font: 700 .98rem/1.35 var(--display-font); margin: 0; overflow-wrap: anywhere; }
.product-price { display: flex; gap: .45rem; flex-wrap: wrap; margin: 0; color: var(--accent); font-weight: 750; font-variant-numeric: tabular-nums; }
.product-price del { color: var(--muted); font-weight: 500; }
.site-footer { background: var(--surface); border-top: 1px solid var(--line); }
.footer-inner { padding-block: 2rem; display: flex; gap: 1.1rem 2rem; flex-wrap: wrap; justify-content: space-between; align-items: baseline; }
.footer-inner > span { font: 750 1.05rem/1.35 var(--display-font); }
.footer-inner nav { display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; font-size: .9rem; }
.status { color: var(--muted); }
.catalog-empty { padding: .5rem .75rem; grid-column: 1/-1; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: .45rem; color: var(--muted); margin-bottom: 1.4rem; }
.breadcrumbs a { text-decoration: underline; text-underline-offset: .15em; }
.detail-layout { display: grid; align-items: start; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(1rem, 5vw, 4.5rem); }
.gallery { min-width: 0; }
.gallery .product-image { border-radius: var(--radius); border: 1px solid var(--line); }
.gallery-thumbs { margin-top: .8rem; display: grid; gap: .55rem; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); }
.gallery-thumbs button { min-width: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: min(var(--radius), 7px); overflow: hidden; aspect-ratio: 1; }
.gallery-thumbs button[aria-pressed="true"] { border: 2px solid var(--accent); }
.gallery-thumbs img { display: block; width: 100%; height: 100%; object-fit: contain; }
.detail-info h1, .content-page > h1 { font: 750 clamp(1.6rem, 3.5vw, 3rem)/1.22 var(--display-font); letter-spacing: -.04em; margin: 0 0 1rem; overflow-wrap: anywhere; }
.detail-info .product-price { margin-bottom: 1.2rem; font-size: 1.2rem; }
.detail-info .line-link { margin-top: 1rem; }
.variant-select { margin-block: 1.2rem; display: grid; gap: .4rem; max-width: 37ch; }
.variant-select select { color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: min(var(--radius), 8px); min-height: 42px; padding: .35rem .6rem; min-width: 0; }
.detail-description { border-top: 1px solid var(--line); margin-top: 2.5rem; padding-top: 1rem; }
.content-page { min-height: 55vh; }
.rich { overflow-wrap: anywhere; max-width: 870px; }
.rich a { color: var(--accent); text-decoration: underline; text-underline-offset: .18em; }
.rich :where(h2, h3, h4, p, ul, ol) { margin-top: 1em; margin-bottom: 1em; }
.rich img { display: block; height: auto; max-width: 100%; margin-block: .6rem; }
.rich table { display: block; width: max-content; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.rich td, .rich th { border: 1px solid var(--line); padding: .45rem .6rem; }
.home-copy { border-top: 1px solid var(--line); }

[data-merged-catalog] {
  --background: #f6f8f4;
  --surface: #fff;
  --text: #182b24;
  --muted: #496256;
  --accent: #1e614b;
  --line: #dbe5dc;
  --radius: 10px;
  --hero-surface: #18392f;
}
[data-merged-catalog] .hero { padding-block: 1.55rem 0; }
[data-merged-catalog] .hero-inner {
  background: var(--hero-surface);
  color: #fff;
  padding: clamp(1.2rem, 3vw, 2.5rem);
  border-radius: 1.2rem;
  align-items: stretch;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: clamp(1rem, 3vw, 2.75rem);
}
[data-merged-catalog] .hero-inner:has(.hero-media[hidden]) { grid-template-columns: minmax(0, 700px); }
[data-merged-catalog] .hero-copy { align-self: center; padding: clamp(.4rem, 1.6vw, 1.5rem); }
[data-merged-catalog] .hero-copy p { color: #dbe7df; }
[data-merged-catalog] .hero-copy :focus-visible { outline-color: #b2e2bf; }
[data-merged-catalog] .hero-media { min-height: 0; aspect-ratio: 1.32; background: #e5ece4; }
[data-merged-catalog] .hero-media img { object-position: center; }
[data-merged-catalog] .hero-link { color: #fff; border-color: #83ad9a; margin-top: 1rem; }
[data-merged-catalog] .hero-link:hover { background: #234d40; filter: none; }

.merged-search { display: flex; align-items: stretch; gap: .45rem; width: min(100%, 350px); }
.merged-search input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  padding: .52rem .78rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: var(--surface);
}
.merged-search input::placeholder { color: var(--muted); }
.hero .merged-search { width: min(100%, 440px); }
.hero .merged-search button { background: #cce7d2; color: #19382d; border-color: #cce7d2; }
.section.category-shortcuts { padding-block: 1.8rem 0; display: grid; gap: .8rem; }
.category-shortcuts h2 { margin: 0; font-size: 1.15rem; }
.category-shortcuts > div { display: flex; flex-wrap: wrap; gap: .5rem; }
.category-shortcuts a {
  min-width: 0;
  padding: .42rem .85rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 100vmax;
  overflow-wrap: anywhere;
}
.category-shortcuts a:hover { border-color: var(--accent); }
[data-merged-catalog] .product-card:hover, .guide-list a:hover { border-color: var(--accent); }
[data-merged-catalog] .product-card .product-image { border-bottom: 1px solid var(--line); }
.item-source { margin: -.25rem 0 1rem; color: var(--muted); font-size: .88rem; overflow-wrap: anywhere; }
.guide-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .65rem;
  list-style-type: none;
  padding: 0;
  margin: 0;
}
.guide-list a {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .3rem;
  height: 100%;
  min-height: 4rem;
  padding: .8rem 1rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow-wrap: anywhere;
}
.guide-list a span { color: var(--muted); font-size: .86rem; }

@media (max-width: 940px) { .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 690px) {
  .header-inner, .section, .hero-inner, .footer-inner { width: calc(100% - 2rem); }
  .header-inner { flex-wrap: wrap; gap: .8rem; }
  .main-nav { order: 3; justify-content: flex-start; width: 100%; gap: .7rem 1rem; }
  .hero-inner, .catalog-layout, .detail-layout { grid-template-columns: minmax(0, 1fr); }
  .hero-media { aspect-ratio: 1.62; min-height: 0; }
  .catalog-sidebar { display: flex; align-items: flex-start; overflow-x: auto; }
  .catalog-sidebar a { white-space: nowrap; }
  .catalog-tags { flex: 0 0 auto; }
  .catalog-tag-links { width: min(56vw, 16rem); max-height: 15rem; overflow: auto; }
  .catalog-tag-links a { white-space: normal; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
  [data-merged-catalog] .hero-inner { grid-template-columns: minmax(0, 1fr); }
  [data-merged-catalog] .hero-media { aspect-ratio: 2; }
  .guide-list { grid-template-columns: minmax(0, 1fr); }
}
