/* 1.6.86 手機與摺疊機：只在觸控螢幕或窄螢幕生效，電腦（滑鼠、寬螢幕）一律不套用。 */

/* 1) 廣告框比畫面寬時整頁不能左右晃（全部圖卡庫頁面；只切掉畫面外的部分，廣告本身照常顯示） */
html:has(> body.tll-standalone),body.tll-standalone{overflow-x:clip}
/* 手機用的按鈕平常（電腦）完全不顯示 */
.tll-m-open,.tll-m-view,.tll-m-sheet-head,.tll-m-backdrop{display:none}
/* 手機清單第一排下面的廣告位（整列寬） */
.tll-m-ad{grid-column:1/-1;min-height:100px;margin:2px 0;text-align:center}
.tll-m-ad-label{display:block;font-size:12px;color:#aab8d2;text-align:left}

/* 2) 清單頁：窄螢幕（寬 ≤ 767）與所有觸控螢幕（手機直橫、摺疊機內外螢幕、平板） */
@media (max-width:767px),(pointer:coarse){
 /* 搜尋列黏在上方：搜尋框＋「篩選」＋「顯示」一列 */
 body.tll-m-ready .tll-editor-filter-panel{position:sticky;top:0;z-index:30;margin:0;padding:8px 10px!important;border-radius:0 0 12px 12px!important;background:#151b28!important;box-shadow:0 6px 14px #0006}
 body.tll-m-ready .tll-editor-filters .tll-primary-filters{display:grid!important;grid-template-columns:minmax(0,1fr) auto auto;gap:8px;align-items:center}
 body.tll-m-ready .tll-primary-filters>.tll-editor-filter-field:first-child{grid-column:auto!important}
 body.tll-m-ready .tll-primary-filters .tll-search-label{font-size:0!important;gap:0!important}
 body.tll-m-ready .tll-primary-filters .tll-search-label input{font-size:16px!important;height:44px;min-height:44px}
 body.tll-m-ready .tll-primary-filters>.tll-editor-filter-field:not(:first-child),body.tll-m-ready .tll-editor-filters .tll-filter-compact-footer{display:none!important}
 body.tll-m-ready .tll-m-open,body.tll-m-ready .tll-m-view{display:inline-flex;align-items:center;justify-content:center;gap:4px;height:44px;min-width:44px;padding:0 12px;border:1px solid #46526a;border-radius:9px;background:#101621;color:#eef1f8;font:600 15px/1.2 inherit;white-space:nowrap}
 .tll-m-open[data-count]::after{content:attr(data-count);display:inline-block;min-width:18px;padding:0 5px;border-radius:9px;background:#ffda55;color:#151b28;font-size:12px;line-height:18px;text-align:center}
 .tll-m-view{appearance:none;-webkit-appearance:none;padding:0 10px}
 /* 排序收成一列，標題字藏起來（選單本身的字就看得懂） */
 body.tll-m-ready .tll-library .tll-sort-controls{flex-wrap:nowrap!important;gap:6px!important;margin-top:10px!important}
 body.tll-m-ready .tll-library .tll-sort-controls label{flex:1 1 0!important;font-size:0!important;gap:0!important}
 body.tll-m-ready .tll-library .tll-sort-controls label:has([data-tll-grid-views]){display:none!important}
 body.tll-m-ready .tll-library .tll-sort-controls select{font-size:15px!important}
 body.tll-m-ready .tll-library .tll-sort-controls .tll-figures-entry{padding:8px 10px;font-size:14px}
 /* 預設「發售年月」的說明大家都懂，手機上收起來；換成價格、尺寸等排序時照常顯示 */
 body.tll-m-ready .tll-library .tll-sort-controls:has(select[name=tll_sort] option[value="year"]:checked) .tll-sort-note{display:none}
 /* 卡片小字至少 12px */
 body.tll-m-ready .tll-library .tll-card :is(p,span,small,a,b,strong,em){font-size:max(12px,1em)}
 body.tll-m-ready .tll-library .tll-card .tll-score{font-size:12px}
 /* 篩選面板：從下面滑出 */
 body.tll-m-sheet .tll-editor-filter-panel{position:fixed!important;left:0;right:0;bottom:0;top:auto;z-index:100000;margin:0;max-height:82svh;overflow:auto;padding:14px 16px calc(16px + env(safe-area-inset-bottom))!important;border-radius:16px 16px 0 0!important;border-width:1px 0 0!important;box-shadow:0 -10px 30px #000a}
 body.tll-m-sheet .tll-editor-filters .tll-primary-filters{grid-template-columns:1fr 1fr}
 body.tll-m-sheet .tll-primary-filters>.tll-editor-filter-field:first-child{grid-column:1/-1!important}
 body.tll-m-sheet .tll-primary-filters>.tll-editor-filter-field:not(:first-child){display:block!important}
 body.tll-m-sheet .tll-editor-filters .tll-filter-compact-footer{display:block!important;margin-top:12px}
 body.tll-m-sheet .tll-m-open,body.tll-m-sheet .tll-m-view{display:none}
 body.tll-m-sheet .tll-m-sheet-head{display:flex}
 .tll-m-sheet-head{align-items:center;justify-content:space-between;margin:0 0 10px;font-weight:700;font-size:17px}
 .tll-m-sheet-head button{height:44px;min-width:44px;padding:0 14px;border:1px solid #46526a;border-radius:9px;background:transparent;color:#eef1f8;font:inherit}
 body.tll-m-sheet .tll-m-backdrop{display:block;position:fixed;inset:0;z-index:99999;background:#0009}
 /* 篩選面板裡的按鈕加大 */
 body.tll-m-sheet .tll-filter-actions{display:flex;gap:12px;align-items:center}
 body.tll-m-sheet .tll-filter-actions button{flex:1;height:48px}
 body.tll-m-sheet .tll-filter-actions a{display:inline-flex;align-items:center;min-height:44px;padding:0 6px}
 body.tll-m-sheet .tll-more-filters summary{min-height:44px;display:flex;align-items:center}
}

/* 手機上頁首連結、查詢時間等小字至少 12px（觸控螢幕才套用）；盒組頁數字標題不放大，免得主圖往下移 */
@media (max-width:767px),(pointer:coarse){
 body.tll-standalone .tll-editor-site-link a{font-size:max(13px,1em)}
 body.tll-standalone .tll-shop-checked,body.tll-standalone .tll-detail-ready .tll-muted{font-size:max(12px,1em)}
}
/* 手機橫拿、外螢幕橫拿（觸控、高 ≤ 500）：盒組頁標題區收小，主圖早一點出現 */
@media (pointer:coarse) and (max-height:500px){
 body.tll-standalone.tll-set-detail .tll-app-hero{margin-bottom:6px!important}
 body.tll-standalone.tll-set-detail .tll-app-hero h1{font-size:20px!important;line-height:1.3!important}
 body.tll-standalone.tll-set-detail .tll-detail-summary{gap:6px!important;padding:4px 0!important}
 body.tll-standalone.tll-set-detail .tll-single .tll-detail-summary dd{font-size:17px!important;margin:0}
 body.tll-standalone.tll-set-detail .tll-detail-summary dt{margin:0}
}

/* 3) 盒組頁：觸控的寬螢幕（摺疊機內螢幕、平板、手機橫拿）不再「整頁塞一個螢幕高」，改成整頁往下捲的左右兩欄；
      主圖在左邊跟著畫面、高度用滿一個螢幕，不會被擠小。電腦（滑鼠）不變。 */
@media (pointer:coarse) and (min-width:700px){
 .tll-detail-screen,body.admin-bar .tll-detail-screen{display:block;height:auto}
 body.tll-standalone.tll-set-detail.tll-detail-active .tll-app-detail{display:block;padding:14px 18px 22px}
 body.tll-standalone.tll-set-detail.tll-detail-active .tll-app-content,body.tll-standalone.tll-set-detail.tll-detail-active .tll-single.tll-detail-ready{display:block}
 body.tll-standalone.tll-set-detail.tll-detail-active .tll-detail-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:18px;align-items:start}
 body.tll-standalone.tll-set-detail.tll-detail-active .tll-detail-art{display:block;position:sticky;top:8px}
 body.tll-standalone.tll-set-detail.tll-detail-active .tll-detail-art>.tll-zoom{display:block;height:auto}
 body.tll-standalone.tll-set-detail.tll-detail-active .tll-detail-art .tll-full-card{height:auto;width:auto;max-width:100%;max-height:calc(100svh - 70px);margin:0 auto!important}
 body.tll-standalone.tll-set-detail.tll-detail-active .tll-detail-reader{display:block;overflow:visible}
 body.tll-standalone.tll-set-detail.tll-detail-active .tll-detail-reader-body{height:auto;overflow:visible;padding-right:0;scrollbar-gutter:auto}
 body.tll-standalone.tll-set-detail.tll-detail-active .tll-app-footer{margin:0;padding:14px 18px;min-height:0}
 .tll-detail-ready button{min-height:44px}
}

/* 4) 1.6.94 清單頁：觸控的中等寬度（摺疊機打開的內螢幕、直拿的小平板，寬 700～1023）排 2 欄，卡片和字放大，
      不再像電腦一樣排 4 欄小卡（使用者 11/17 看樣張選 2 欄）。手機（700 以下）、電腦（滑鼠）、大平板橫拿（1024 以上）不變。 */
@media (pointer:coarse) and (min-width:700px) and (max-width:1023px){
 body.tll-standalone .tll-library .tll-result-region .tll-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
 body.tll-standalone .tll-library .tll-result-region .tll-card .tll-set-number{font-size:22px}
 body.tll-standalone .tll-library .tll-result-region .tll-card h3{font-size:22px;line-height:1.35}
}
