/* RWD 調整。選擇器前加 body，是為了蓋過 Tailwind CDN 後來插入的樣式。
   斷點：<640 手機、<1024 手機與平板、<1280 使用「選單」按鈕。 */

body .nav-toggle, body .scroll-hint { display: none; }

/* ---------- 頁首選單（<1280） ---------- */
@media (max-width: 1279px) {
  body #mobile-menu .sub-btn { float: right; width: 2.75rem; height: 2.25rem; color: #475569; }
  body #mobile-menu li > a:not(.block.pl-4), body #mobile-menu li > span { min-height: 2.25rem; }
  body #mobile-menu li.has-sub > a.pl-4 { display: none; }
  body #mobile-menu li.has-sub.is-open > a.pl-4 { display: block; clear: both; padding-top: .6rem; padding-bottom: .6rem; }
}

/* ---------- 內頁側欄、頁首橫幅（<1024） ---------- */
@media (max-width: 1023px) {
  body main.max-w-7xl { padding-top: 1rem; padding-bottom: 2rem; }
  body main.max-w-7xl > .grid { gap: 1rem; }
  body main.max-w-7xl aside > .nav-toggle {
    display: flex; width: 100%; justify-content: space-between; align-items: center; gap: .75rem;
    background: #0B192C; color: #fff; border-radius: .75rem; padding: .75rem 1rem; font-size: .875rem; font-weight: 700; text-align: left;
  }
  body main.max-w-7xl aside > :not(.nav-toggle) { display: none; }
  body main.max-w-7xl aside.is-open > :not(.nav-toggle) { display: block; }
  body main.max-w-7xl aside { margin-top: 0; }
  body main + footer, body footer { overflow-wrap: anywhere; }
}

/* ---------- 產品表格改卡片（<1024） ---------- */
@media (max-width: 1023px) {
  body .product-section table, body .product-section thead, body .product-section tbody,
  body .product-section tr, body .product-section td { display: block; width: 100%; }
  body .product-section .head-row { display: none; }
  body .product-section thead tr:not(.head-row) { display: none; padding: .5rem 1rem; }
  body .product-section.show-filters thead tr:not(.head-row) { display: block; }
  body .product-section .product-row { display: block; padding: .5rem 1rem; }
  body .product-section .product-row[hidden] { display: none; }
  body .product-section td[data-label] {
    display: grid; grid-template-columns: minmax(6.5rem, 40%) 1fr; gap: .75rem;
    padding: .3rem 0; text-align: left; white-space: normal; overflow-wrap: anywhere;
  }
  body .product-section td[data-label]::before { content: attr(data-label); color: #64748b; font-size: .75rem; font-weight: 600; font-family: 'Inter', 'Noto Sans TC', sans-serif; }
  body .product-section .product-row td[data-label]:last-child { display: flex; align-items: center; gap: 1rem; padding-top: .6rem; }
  body .product-section .product-row td[data-label]:last-child::before { flex: 0 0 minmax(6.5rem, 40%); margin-right: auto; }
  body .product-section .product-row td:last-child > * { margin: 0; }
  body .product-section .product-row td:last-child a { padding: .45rem 1rem; }
  body .product-section thead td:empty { display: none; }
  body .product-section select[data-col] { max-width: none; min-width: 0; padding-top: .4rem; padding-bottom: .4rem; }
  body .product-section .filter-toggle {
    display: block; width: 100%; padding: .6rem 1.25rem; text-align: left; font-size: .8125rem; font-weight: 600;
    color: #0284C7; background: #f8fafc; border-bottom: 1px solid #e2e8f0;
  }
}
@media (min-width: 1024px) {
  body .product-section .filter-toggle { display: none; }
}

/* ---------- 內文表格：固定第一欄、左右滑動 ---------- */
body .table-scroll { -webkit-overflow-scrolling: touch; }
body .scroll-hint.is-needed { display: block; font-size: .75rem; color: #0284C7; margin-bottom: .35rem; }
body .table-scroll table { line-height: 1.45; }
body .table-scroll.is-scrollable table { border-collapse: separate; border-spacing: 0; border-width: 0; }
body .table-scroll.is-scrollable .col-first { position: sticky; left: 0; z-index: 1; background: #f1f5f9; box-shadow: 2px 0 4px rgba(15, 23, 42, .12); }

/* ---------- 內文圖片 ---------- */
body .content a.zoom { display: inline-block; max-width: 100%; }
@media (max-width: 639px) {
  body .content img { float: none !important; display: block; margin-left: auto; margin-right: auto; }
  body .content table img { max-width: none; }
  body .content a.zoom::after { content: '點圖看原圖'; display: block; text-align: center; font-size: .75rem; }
  body .content ~ * { max-width: 100%; }
}

/* ---------- 手機：首頁與字級 ---------- */
@media (max-width: 639px) {
  body .slider { aspect-ratio: auto; height: 200px; }
  body .slider .slide { object-position: 19% center; }
  body .slide-btn { top: auto; bottom: .25rem; transform: none; width: 2rem; height: 2rem; }
  body main > section.py-20, body main > section.py-16 { padding-top: 2.5rem; padding-bottom: 2.5rem; }
  body main > section .mb-12 { margin-bottom: 1.5rem; }
  body main > section .p-8 { padding: 1.25rem; }
  body > section.py-12 { padding-top: 1.25rem; padding-bottom: 1.25rem; }
  body > section.py-12 h1 { font-size: 1.5rem; line-height: 2rem; }
  body .content { font-size: .9375rem; }
}

/* 各語言的提示文字 */
@media (max-width: 639px) {
  html[lang="en"] body .content a.zoom::after { content: 'Tap to view full size'; }
  html[lang="zh-Hans"] body .content a.zoom::after { content: '点图看原图'; }
}
