/* 山有行 — 全站樣式
   顏色、字體大細等等都集中喺 :root 入面，想調就改呢度。 */

:root {
  --green: #65b670;        /* 頁頭綠 */
  --green-line: #60d675;   /* 內容卡頂部綠線 */
  --green-dark: #3f8f4b;
  --yellow: #eeee22;       /* 選單當前項 */
  --slate: #3e5062;        /* 側欄標題 */
  --bg: #ecf0f5;
  --card: #fff;
  --ink: #333;
  --muted: #777;
  --line: #e4e8ee;
  --page-max: 1200px;
  --pad: clamp(14px, 3vw, 24px);
  --gap: clamp(14px, 2.4vw, 26px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Microsoft JhengHei", 微軟正黑體, "PingFang HK", "PingFang TC", "Noto Sans TC", sans-serif;
  font-size: 15px; line-height: 1.75;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--green-dark); }
h1, h2, h3 { line-height: 1.35; }
.container { max-width: var(--page-max); margin-inline: auto; padding-inline: var(--pad); width: 100%; }
.skip { position: absolute; left: -9999px; top: 0; background: var(--yellow); color: #000; padding: 8px 14px; z-index: 100; }
.skip:focus { left: 0; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ------------------------------------------------------ 頁頭 */

.topbar { background: var(--green); }
.topbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 124px; }
.topbar__logo img { width: clamp(240px, 32vw, 416px); }

.nav__list { list-style: none; margin: 0; padding: 0; display: flex; gap: 0 clamp(14px, 2.2vw, 32px); }
.nav__list > li { position: relative; }
.nav__list a { display: block; color: #fff; text-decoration: none; font-size: 16px; padding: 10px 0; font-weight: 600; }
.nav__list a:hover, .nav__list a.is-current { color: var(--yellow); }
.nav__list > li > a.is-current { box-shadow: inset 0 -2px 0 var(--yellow); }
.nav__sub {
  list-style: none; margin: 0; padding: 6px 0; display: none; position: absolute; top: 100%; left: 50%;
  translate: -50% 0; min-width: 170px; background: #fff; border-top: 3px solid var(--green-line);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .12); z-index: 40;
}
.nav__sub a { color: var(--ink); font-weight: 400; font-size: 14px; padding: 7px 18px; white-space: nowrap; }
.nav__sub a:hover { color: var(--green-dark); background: #f4f8f4; }
.has-sub:hover .nav__sub, .has-sub:focus-within .nav__sub { display: block; }

.nav__toggle { display: none; align-items: center; gap: 8px; background: none; border: 0; color: #fff; font: inherit; font-weight: 600; cursor: pointer; padding: 8px 0; }
.nav__bars { display: grid; gap: 5px; }
.nav__bars i { display: block; width: 22px; height: 2px; background: #fff; }
.nav__toggle em { font-style: normal; }

@media (max-width: 860px) {
  .topbar__inner { flex-wrap: wrap; min-height: 0; padding-block: 12px; }
  .nav__toggle { display: flex; }
  .nav { flex-basis: 100%; }
  .nav__list { display: none; flex-direction: column; gap: 0; }
  .nav__list.is-open { display: flex; }
  .nav__list > li { border-top: 1px solid rgba(255, 255, 255, .25); }
  .nav__list > li > a.is-current { box-shadow: none; }
  .nav__sub { position: static; translate: none; display: block; box-shadow: none; border: 0; background: rgba(255, 255, 255, .12); padding: 0 0 6px; }
  .nav__sub a { color: #fff; padding: 6px 14px; }
}

/* ------------------------------------------------------ 版面：左側欄 + 右內容卡 */

.layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: var(--gap); padding-block: clamp(16px, 3vw, 26px) 40px; align-items: start; }
.layout > .sidebar { grid-column: 1; grid-row: 1; }
.layout > .card { grid-column: 2; grid-row: 1; }
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .layout > .sidebar, .layout > .card { grid-column: 1; grid-row: auto; }
}

.card { background: var(--card); border-top: 6px solid var(--green-line); padding: clamp(18px, 3.4vw, 36px); box-shadow: 0 1px 3px rgba(0, 0, 0, .05); min-width: 0; }
.ptitle { margin: 0 0 1rem; font-size: clamp(1.4rem, 1.1rem + 1.4vw, 2.1rem); color: #5b2c6f; font-weight: 500; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: .6rem; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--green-dark); }
.card p { margin: 0 0 1em; }
.card h2 { font-size: 1.2rem; margin: 1.6rem 0 .8rem; }
.card h2.sub { border-left: 4px solid var(--green-line); padding-left: 10px; }
.lead { font-size: 1.1rem; font-weight: 600; }
.biglist { font-size: 1.15rem; padding-left: 1.6em; margin: 0 0 1.2rem; }
.biglist li { margin-bottom: .2em; }
.fig { margin: 0 0 1.2rem; }
.fig img { margin-inline: auto; }
.fig figcaption { text-align: center; color: var(--muted); font-size: 14px; margin-top: .4rem; }
.meta { color: var(--muted); font-size: 13px; }

/* ------------------------------------------------------ 側欄 */

.sidebar { display: grid; gap: 16px; }
.widget { background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .05); }
.widget__t { margin: 0; background: var(--slate); color: #fff; font-size: 15px; font-weight: 600; padding: 10px 14px; }
.widget__b { padding: 12px 14px; font-size: 13px; }
.widget__b p { margin: 0 0 .35em; }

.search { display: flex; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .05); }
.search input { flex: 1; min-width: 0; border: 0; padding: 12px 14px; font: inherit; font-size: 14px; background: transparent; }
.search input:focus { outline: 2px solid var(--green-line); outline-offset: -2px; }
.search button { border: 0; background: var(--green); color: #fff; padding: 0 16px; font-size: 18px; cursor: pointer; }
.search--big { margin-bottom: 1rem; border: 1px solid var(--line); box-shadow: none; }
.search--big button { font-size: 15px; padding: 0 22px; }

/* 側欄輪播：原站 Huge-IT 橫幅 1440×476，照原比例顯示唔裁切 */
.sideslider { position: relative; overflow: hidden; background: #fff; user-select: none; }
.sideslider__track { position: relative; aspect-ratio: 1440 / 476; }
.sideslider__track img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .5s; }
.sideslider__track img.is-active { opacity: 1; }
.sideslider__arrow {
  position: absolute; top: calc(50% - 10px); translate: 0 -50%; border: 0; background: none; cursor: pointer;
  color: #fff; font-size: 22px; line-height: 1; padding: 10px 8px; text-shadow: 0 1px 6px rgba(0, 0, 0, .55);
}
.sideslider__arrow--prev { left: 0; }
.sideslider__arrow--next { right: 0; }
.sideslider__dots { display: flex; justify-content: center; gap: 6px; padding: 7px 0 8px; }
.sideslider__dots button { width: 7px; height: 7px; border-radius: 50%; border: 0; padding: 0; background: #cfd6de; cursor: pointer; }
.sideslider__dots button.is-active { background: var(--green); }

.widget__b--map { padding: 0; }
.widget__b--map iframe { display: block; width: 100%; aspect-ratio: 4 / 3; border: 0; }

.tree { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.tree li { border-top: 1px solid var(--line); }
.tree > li:first-child { border-top: 0; }
.tree a { display: block; padding: 8px 14px; color: var(--ink); text-decoration: none; }
.tree a:hover, .tree a.is-current { color: var(--green-dark); background: #f4f8f4; }
.tree a.is-current { font-weight: 700; box-shadow: inset 3px 0 0 var(--green-line); }
.tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul a { padding-left: 30px; font-size: 13px; color: #555; }
.tree ul a::before { content: "- "; }

/* ------------------------------------------------------ 產品格 */

.count { color: var(--muted); font-size: 13px; margin: -.4rem 0 .8rem; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 1.2rem; }
.tabs button, .tabs a {
  font: inherit; font-size: 13px; padding: 5px 12px; border: 1px solid var(--line); background: #fff;
  color: #555; cursor: pointer; text-decoration: none; border-radius: 2px;
}
.tabs .is-on { color: var(--green-dark); border-color: var(--green-line); background: #f1faf2; }

.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: var(--gap); }
@media (max-width: 560px) { .pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .pcard__t { font-size: 12px; padding: 6px 6px 10px; } }
.pcard { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .1); transition: box-shadow .2s, transform .2s; }
.pcard:hover { box-shadow: 0 6px 18px rgba(0, 0, 0, .14); transform: translateY(-2px); }
.pcard__pic { aspect-ratio: 1 / 1; background: #f7f7f7; display: grid; place-items: center; overflow: hidden; }
.pcard__pic img { width: 100%; height: 100%; object-fit: contain; }
.pcard__t { padding: 8px 10px 12px; font-size: 13px; line-height: 1.5; text-align: center; }
.pcard[hidden] { display: none; }

.ocards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--gap); }
.ocard { display: grid; grid-template-columns: 84px 1fr; gap: 12px; text-decoration: none; color: var(--ink); border: 1px solid var(--line); padding: 10px; background: #fff; }
.ocard:hover { border-color: var(--green-line); }
.ocard__pic { width: 84px; height: 84px; background: #f7f7f7; display: grid; place-items: center; overflow: hidden; }
.ocard__pic img { width: 100%; height: 100%; object-fit: contain; }
.ocard__pic .ph { color: #bbb; font-size: 13px; }
.ocard strong { display: block; font-size: 15px; }
.ocard em { font-style: normal; color: var(--muted); font-size: 12px; }
.ocard ul { list-style: none; margin: .3rem 0 0; padding: 0; font-size: 12px; color: #666; line-height: 1.5; }

/* ------------------------------------------------------ 產品頁 */

.product { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--gap); align-items: start; }
@media (max-width: 700px) { .product { grid-template-columns: 1fr; } }
.phero { margin: 0; background: #f7f7f7; }
.phero img { width: 100%; max-height: 520px; object-fit: contain; }
.tags { font-size: 13px; margin-bottom: 1rem; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tags span { color: var(--muted); }
.tags a { border: 1px solid var(--line); padding: 2px 10px; text-decoration: none; color: #555; background: #fafafa; }
.tags a:hover { border-color: var(--green-line); color: var(--green-dark); }
.product__info .fig img { max-height: 420px; object-fit: contain; }
.ask { margin-top: 1.2rem !important; padding: 12px 14px; background: #f1faf2; border-left: 4px solid var(--green-line); font-size: 14px; }
.product--gallery { grid-template-columns: 1fr; }
.product--gallery .product__info { max-width: 46em; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--gap); }
.gfig { margin: 0; background: #fafafa; border: 1px solid var(--line); display: flex; flex-direction: column; }
.gfig a { display: grid; place-items: center; aspect-ratio: 1 / 1; background: #fff; overflow: hidden; }
.gfig img { width: 100%; height: 100%; object-fit: contain; }
.gfig figcaption { padding: 8px 10px; font-size: 13px; text-align: center; border-top: 1px solid var(--line); }
.phero figcaption { text-align: center; color: var(--muted); font-size: 13px; padding: 6px; }
@media (max-width: 560px) { .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.pnav { display: flex; justify-content: space-between; gap: 12px; margin: 1.6rem 0 .4rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: 13px; }
.pnav a { text-decoration: none; max-width: 48%; }

/* ------------------------------------------------------ 聯絡 */

.ccards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 0 0 1.4rem; }
.ccard { border: 1px solid var(--line); padding: 14px 16px; }
.ccard dt { color: var(--green-dark); font-weight: 700; font-size: 14px; }
.ccard dd { margin: .2rem 0 0; }
.map { position: relative; aspect-ratio: 4 / 3; max-height: 460px; width: 100%; background: #eef; }
.map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ------------------------------------------------------ 頁尾 / 燈箱 */

.footer { background: #2f3d4a; color: #c9d2db; font-size: 13px; }
.footer p { margin: 0; padding-block: 14px; }
.footer a { color: #fff; }

.lightbox { position: fixed; inset: 0; background: rgba(0, 0, 0, .9); display: grid; place-items: center; z-index: 99; }
.lightbox[hidden] { display: none; }
.lightbox__img { max-width: 94vw; max-height: 90vh; object-fit: contain; }
.lightbox__close { position: absolute; top: 8px; right: 12px; background: none; border: 0; color: #fff; font-size: 2.6rem; cursor: pointer; }
