/* 科華網站：手機版覆寫（僅影響窄螢幕，桌面版維持原樣） */
@media screen and (max-width: 820px) {
  html, body {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    -webkit-text-size-adjust: 100%;
  }
  table {
    width: 100% !important;
    max-width: 100% !important;
    table-layout: auto !important;
  }
  thead, tbody, tr, td, th {
    width: auto !important;
    max-width: 100% !important;
  }
  [style*="width"] {
    width: auto !important;
    max-width: 100% !important;
  }
  /* 內層內容容器（舊版固定 620px）改為滿版 */
  .content, .cred {
    width: 100% !important;
    max-width: 100% !important;
  }
  img, iframe, video, embed, object {
    max-width: 100% !important;
    height: auto !important;
  }
  /* 標頭：LOGO 與選單上下堆疊 */
  td[width="19%"], td[width="979"], td[width="1000"], td[align="right"] {
    display: block !important;
    width: 100% !important;
    text-align: center !important;
  }
  td[width="19%"] a,
  td[width="19%"] img {
    display: block !important;
    margin: 0 auto !important;
    text-align: center !important;
  }
  td[width="979"] > table,
  td[width="1000"] > table,
  td[align="right"] > table {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    width: 100% !important;
  }
  td[width="979"] > table > tbody,
  td[width="1000"] > table > tbody,
  td[align="right"] > table > tbody,
  td[width="979"] > table > tbody > tr,
  td[width="1000"] > table > tbody > tr,
  td[align="right"] > table > tbody > tr {
    display: contents !important;
  }
  td[width="979"] > table > tbody > tr > td,
  td[width="1000"] > table > tbody > tr > td,
  td[align="right"] > table > tbody > tr > td {
    display: block !important;
    width: auto !important;
    max-width: 100% !important;
    padding: 4px 6px !important;
    vertical-align: middle !important;
  }
  td[width="979"] a,
  td[width="1000"] a,
  td[align="right"] a {
    white-space: normal !important;
    font-size: 14px !important;
  }
  /* 相簿頁：不啟用 Galleria，改成縮圖網格 */
  #galleria {
    width: 100vw !important;
    max-width: 100vw !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
  }
  #galleria > a {
    display: inline-block !important;
    width: 23.5% !important;
    margin: 0.5% !important;
    vertical-align: top !important;
    box-sizing: border-box;
  }
  #galleria > a img {
    width: 100% !important;
    height: auto !important;
    display: block;
  }
  body, td, th, div, p, span, li, font {
    font-size: 15px !important;
    line-height: 1.75 !important;
  }
  h1, .title { font-size: 20px !important; line-height: 1.4 !important; }
  h2 { font-size: 18px !important; line-height: 1.4 !important; }
  h3 { font-size: 16px !important; line-height: 1.4 !important; }
  [style*="font-size"] { font-size: 15px !important; }
  .metal-button {
    font-size: 16px !important;
    padding: 12px 18px !important;
    width: auto !important;
    max-width: 100% !important;
    letter-spacing: 0 !important;
  }
  * {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
  }
}
