/* 全站共用：依螢幕寬度調整版面（同一份網頁，手機、平板、電腦共用）。
   分界照 Material Design 的視窗寬度分級：手機 <600、平板 600–839、其餘 ≥840。
   畫板的樣式寫在各元素上，這裡用「樣式裡含有某段文字」來選取。 */
[hidden]{display:none!important}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
header{position:relative}
#explore-panel{position:absolute;left:0;right:0;top:100%;z-index:40}
img{max-width:100%}
summary{cursor:pointer}
[style*="width: 1430px"],[style*="width: 1360px"]{width:auto!important}
[style*="height: 442px"]{height:auto!important}
a:focus-visible,summary:focus-visible{outline:3px solid #4361ee;outline-offset:3px}
table[style]{overflow-wrap:break-word}

/* ── 小筆電、橫放平板：840–1099 ── */
@media (max-width:1099px){
  [style*="repeat(5,"]{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  [style*="padding: 96px 80px"]{padding:64px 40px!important}
  [style*="padding: 0 48px"]{padding-left:32px!important;padding-right:32px!important}
  [style*="font-size: 88px"]{font-size:72px!important}
  [style*="font-size: 64px"],[style*="font-size: 60px"]{font-size:48px!important}
  [style*="font-size: 52px"],[style*="font-size: 48px"]{font-size:40px!important}
  [style*="font-size: 44px"]{font-size:36px!important}
  [style*="width: 698px"],[style*="width: 726px"],[style*="width: 541px"]{width:auto!important;max-width:100%!important}
  [style*="gap: 72px"]{gap:40px!important}
}

/* ── 手機與直放平板：<840。頁首改成「標誌＋選單鈕」，多欄改成上下排 ── */
@media (max-width:839px){
  /* 頁首 */
  header>div:first-child{flex-wrap:nowrap!important;padding:0 16px!important;gap:12px!important;min-height:60px!important}
  header nav[aria-label="工具"]{display:none!important}
  header>div:first-child>div[style*="margin-left: auto"]>a:not(:first-child){display:none!important}
  header>div:first-child>div[style*="margin-left: auto"]>a:first-child{
    font-size:0!important;width:44px;height:44px;padding:0!important;border-radius:12px!important;flex:none;
    background:#f1f4f7 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231c2b33' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 7h16M4 12h16M4 17h16'/%3E%3C/svg%3E") center/22px no-repeat!important}
  header>div:first-child>div[style*="margin-left: auto"]>a[aria-expanded="true"]{
    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231c2b33' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E")!important}
  header>div:first-child>div:first-child{gap:8px!important;min-width:0}
  header>div:first-child>div:first-child a{font-size:17px!important;gap:8px!important;letter-spacing:.02em!important}
  header>div:first-child>div:first-child img{width:28px!important}
  #explore-panel,#explore-open{max-height:calc(100vh - 60px);overflow:auto}
  #explore-panel>div,#explore-open>div{justify-content:start!important;padding:24px 20px 32px!important;gap:24px 32px!important}
  #explore-panel [style*="font-size: 22px"],#explore-open [style*="font-size: 22px"]{font-size:18px!important}
  /* 版面 */
  [style*="minmax(0,4fr) minmax(0,8fr)"],[style*="minmax(0,5fr) minmax(0,7fr)"],[style*="minmax(0,7fr) minmax(0,5fr)"],
  [style*="220px minmax(0,1fr)"],[style*="minmax(0,1fr) auto"]{grid-template-columns:minmax(0,1fr)!important}
  footer [style*="grid-template-columns"]{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:32px 24px!important}
  footer [style*="grid-template-columns"]>div:first-child{grid-column:1/-1}
  [style*="gap: 72px"],[style*="gap: 24px 72px"]{gap:32px!important}
  /* 留白 */
  [style*="padding: 0 48px"]{padding-left:24px!important;padding-right:24px!important}
  [style*="padding: 0 32px"]{padding-left:16px!important;padding-right:16px!important}
  [style*="padding: 112px 0"]{padding-top:72px!important;padding-bottom:72px!important}
  [style*="padding: 112px 0 0"]{padding-bottom:0!important}
  [style*="margin-top: 112px"]{margin-top:72px!important}
  [style*="padding: 96px 80px"]{padding:56px 24px!important}
  [style*="padding: 56px"]{padding:32px!important}
  [style*="padding: 48px 32px 64px"]{padding:40px 24px 48px!important}
  [style*="padding-top: 104px"]{padding-top:72px!important;padding-bottom:72px!important}
  [style*="104px 48px 300px"]{padding:72px 24px 240px!important}
  [style*="padding: 86.4px"]{padding:64px 24px 0!important}
  /* 字級 */
  [style*="font-size: 88px"]{font-size:64px!important}
  [style*="font-size: 64px"],[style*="font-size: 60px"]{font-size:42px!important}
  [style*="font-size: 52px"],[style*="font-size: 48px"]{font-size:34px!important}
  [style*="font-size: 44px"]{font-size:32px!important}
  [style*="font-size: 40px"]{font-size:30px!important}
  [style*="font-size: 34px"]{font-size:28px!important}
  /* 固定寬高 */
  [style*="width: 380px"]{width:auto!important;max-width:100%!important;height:auto!important}
  [style*="height: 335px"]{height:auto!important}
  [style*="height: 702px"]{height:560px!important}
  [style*="height: 640px"]{height:520px!important}
  [style*="height: 560px"]{height:440px!important}
  [style*="height: 520px"]{height:360px!important}
  [style*="min-height: 600px"]{min-height:320px!important}
  [style*="min-height: 380px"]{min-height:280px!important}
  [style*="left: max(48px"]{left:24px!important;right:24px!important}
  [style*="left: 141px"]{left:100px!important;top:22px!important;width:auto!important;height:auto!important}
  h1,h2{text-wrap:balance}
  /* 小卡：字與留白縮一級，標題不折行 */
  [style*="padding: 20px 22px 22px"]{padding:14px 14px 16px!important;gap:6px!important}
  [style*="padding: 20px 22px 22px"]>span{font-size:16px!important}
  [style*="padding: 20px 22px 22px"]>svg{width:20px;height:20px}
}

/* ── 直放平板：600–839。卡片維持並排 ── */
@media (min-width:600px) and (max-width:839px){
  [style*="repeat(5,"]{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  /* 認識 TURING 開頭：跟電腦版一樣，標誌在左、文字在右 */
  #account>div{grid-template-columns:minmax(0,3fr) minmax(0,8fr)!important;gap:32px!important}
}

/* ── 手機：<600。一律單欄，小卡兩欄 ── */
@media (max-width:599px){
  [style*="grid-template-columns"]{grid-template-columns:minmax(0,1fr)!important}
  [style*="repeat(4,"],[style*="repeat(5,"]{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  footer [style*="grid-template-columns"]{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  [style*="padding: 0 48px"]{padding-left:20px!important;padding-right:20px!important}
  [style*="padding: 112px 0"]{padding-top:56px!important;padding-bottom:56px!important}
  [style*="padding: 112px 0 0"]{padding-bottom:0!important}
  [style*="margin-top: 112px"]{margin-top:56px!important}
  [style*="padding: 96px 80px"]{padding:48px 20px!important}
  [style*="padding: 56px"]{padding:28px 24px!important}
  [style*="padding: 48px 32px 64px"]{padding:40px 20px 48px!important}
  [style*="padding-top: 104px"]{padding-top:56px!important;padding-bottom:56px!important}
  [style*="104px 48px 300px"]{padding:56px 20px 152px!important}
  [style*="margin-top: -240px"]{margin-top:-120px!important}
  [style*="padding: 86.4px"]{padding:48px 20px 0!important}
  [style*="padding: 0 22px 20px 48px"]{padding-left:22px!important}
  [style*="font-size: 88px"]{font-size:52px!important}
  [style*="font-size: 64px"],[style*="font-size: 60px"]{font-size:34px!important}
  [style*="font-size: 52px"]{font-size:30px!important}
  [style*="font-size: 48px"],[style*="font-size: 44px"]{font-size:28px!important}
  [style*="font-size: 40px"]{font-size:26px!important}
  [style*="font-size: 34px"]{font-size:24px!important}
  [style*="font-size: 28px"]{font-size:22px!important}
  [style*="font-size: 21px"],[style*="font-size: 20px"]{font-size:17px!important}
  [style*="width: 698px"],[style*="width: 726px"],[style*="width: 541px"]{height:auto!important}
  [style*="height: 702px"]{height:520px!important}
  [style*="height: 640px"]{height:500px!important}
  [style*="height: 560px"]{height:400px!important}
  [style*="height: 520px"]{height:320px!important}
  [style*="min-height: 600px"]{min-height:280px!important}
  [style*="min-height: 380px"]{min-height:240px!important}
  [style*="left: max(48px"]{left:20px!important;right:20px!important;bottom:32px!important}
  [style*="bottom: 72px"]{bottom:40px!important}
  h1[style*="text-wrap: balance"]{word-break:keep-all;overflow-wrap:anywhere}
  header>div:first-child>div:first-child a{font-size:16px!important}
  header>div:first-child>div:first-child img{width:26px!important}
  /* 認識 TURING 開頭：跟電腦版一樣，標誌在左、標題在右；搜尋框以下換到下一列 */
  section#account{padding-top:36px!important}
  #account>div{display:block!important}
  #account>div>img{float:left;width:84px!important;margin:2px 16px 0 0}
  #account h1{font-size:32px!important;line-height:1.25!important}
  #account h2{font-size:22px!important;line-height:1.35!important}
  #account>div>div>div:first-of-type{clear:both;min-height:52px}
  /* 分頁列：維持一列，放不下就左右滑 */
  nav[aria-label="法律文件與支援"]>div{flex-wrap:nowrap!important;overflow-x:auto;gap:22px!important;padding-left:20px!important;padding-right:20px!important;scrollbar-width:none;-webkit-overflow-scrolling:touch}
  nav[aria-label="法律文件與支援"]>div::-webkit-scrollbar{display:none}
  nav[aria-label="法律文件與支援"] a{flex:none;white-space:nowrap}
  /* 表格 */
  table[style]{font-size:14px!important}
  table[style] th,table[style] td{padding-right:12px!important}
}
