/**
 * TCG Market Index - Frontend Styles
 *
 * 大量使用 CSS 變數，在 VC / 主題 CSS 覆寫變數即可微調樣式：
 *   .tcg-mi-container {
 *     --tcg-hot-color: red;
 *     --tcg-card-radius: 8px;
 *     --tcg-card-bg: white;
 *   }
 */

.tcg-mi-container {
  /* === 顏色 === */
  --tcg-bg: #0b0f14;
  /* 1.60.9：真正的半透明玻璃底。保留足夠透明度讓頁面底景進入
     backdrop-filter，同時以深色 tint 維持卡片文字對比。 */
  --tcg-card-bg: linear-gradient(145deg, rgba(27,24,39,.46), rgba(11,13,22,.38));
  --tcg-card-border: rgba(255,255,255,.08);
  --tcg-text: #e8eef7;
  --tcg-text-muted: #ffffff;
  --tcg-line: rgba(255,255,255,.08);

  /* V2.14.1：用戶指定色碼 + 加綠色（對應紅海／成熟／藍海／微型+訊號不明 四象限） */
  --tcg-hot-color:  #ff0000;   /* 紅海（頂部）*/
  --tcg-warm-color: #ffa050;   /* 成熟（保留原橙）*/
  --tcg-cold-color: #006dff;   /* 藍海 */
  --tcg-cool-color: #2dff00;   /* 微型/訊號不明（底部）— 新增 */

  --tcg-status-red: #ff4d4f;
  --tcg-status-orange: #ffa940;
  --tcg-status-green: #52c41a;
  --tcg-status-gray: #8c8c8c;

  /* === 尺寸 === */
  --tcg-card-radius: 16px;
  --tcg-card-padding: 18px;
  --tcg-gap: 16px;
  --tcg-content-gutter: clamp(14px, 1.3vw, 24px);

  /* === 陰影 === */
  --tcg-shadow: 0 10px 30px rgba(0,0,0,.35);

  /* === 字型 === */
  --tcg-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC", "PingFang SC", "Microsoft JhengHei", "Microsoft YaHei", sans-serif;

  /* === 容器基礎 === */
  padding: 20px var(--tcg-content-gutter);
  background: radial-gradient(1200px 500px at 20% -10%, rgba(62,134,255,.18), transparent 60%),
              radial-gradient(900px 500px at 80% 0%, rgba(255,87,51,.12), transparent 55%),
              var(--tcg-bg);
  color: var(--tcg-text);
  font-family: var(--tcg-font);
  border-radius: var(--tcg-card-radius);
  box-sizing: border-box;
  max-width: 1830px;
  margin: 0 auto;
}

/* 1.60.5：Visual Composer 的 full-width row 在約 768px 會以 inline style
   保留桌機內容 gutter，令整個市場區只剩約半個 viewport。只針對實際
   包含市場溫度計的 full-width row 清除該 gutter，不影響其他 VC 區塊。 */
@media (max-width: 1000px) {
  .vce-row[data-vce-full-width="true"]:has(.tcg-mi-container) > .vce-row-content {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
}

.tcg-mi-container *,
.tcg-mi-container *:before,
.tcg-mi-container *:after {
  box-sizing: border-box;
}

/* === 全球市場篩選工具 === */
.tcg-mi-market-tools {
  position: relative;
  margin: 0 0 16px;
  padding: clamp(18px, 1.6vw, 24px);
  overflow: hidden;
  background:
    radial-gradient(700px 180px at 12% -30%, rgba(154,108,255,.18), transparent 68%),
    linear-gradient(145deg, rgba(30,25,42,.92), rgba(16,14,23,.94));
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 20px;
  box-shadow: 0 18px 48px rgba(0,0,0,.24), inset 0 1px 0 rgba(255,255,255,.04);
}
.tcg-mi-market-tools-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}
.tcg-mi-market-tools-heading > span {
  display: block;
  margin-bottom: 6px;
  color: #b992ff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .18em;
}
.tcg-mi-market-tools-heading h2 {
  margin: 0;
  color: #f8f5ff;
  font-size: clamp(24px, 2.1vw, 32px);
  line-height: 1.15;
  letter-spacing: -.035em;
}
.tcg-mi-market-tools-summary {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}
.tcg-mi-filter-result {
  color: #c9c3d2;
  font-size: 13px;
  white-space: nowrap;
}
.tcg-mi-filter-result strong { color: #fff; font-size: 16px; }
.tcg-mi-filter-reset {
  min-height: 38px;
  padding: 8px 13px;
  color: #eadfff;
  background: rgba(154,108,255,.16);
  border: 1px solid rgba(185,146,255,.42);
  border-radius: 10px;
  font: 600 12px/1 var(--tcg-font);
  cursor: pointer;
}
.tcg-mi-filter-reset:hover:not(:disabled) { background: rgba(154,108,255,.27); }
.tcg-mi-filter-reset:disabled { opacity: .42; cursor: default; }
.tcg-mi-market-tools.tcg-mi-has-active-filters {
  border-color: rgba(185,146,255,.36);
}

/* === 圖例／條件群組 === */
.tcg-mi-legend {
  display: grid;
  gap: 12px;
  margin: 14px 0 0;
  padding: 14px 0 0;
  background: transparent;
  border: 0;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: 13px;
}
.tcg-mi-filter-section {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
}
.tcg-mi-legend-group { min-width: 0; }
.tcg-mi-legend-title {
  padding-top: 8px;
  color: #d8d2e1;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
}
.tcg-mi-filter-options,
.tcg-mi-filter-tabs {
  display: flex;
  min-width: 0;
  gap: 8px;
  flex-wrap: wrap;
}
/* V2.19.2：定位聲明 — 我們是市場觀察者，不推薦也不阻止 */
.tcg-mi-legend-note {
  width: 100%;
  margin-top: 0;
  padding-top: 8px;
  border-top: 1px dashed var(--tcg-line);
  font-size: 12px;
  color: #aaa3b6;
}
.tcg-mi-legend-item {
  min-height: 36px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.055);
  border: 1px solid rgba(255,255,255,.13);
  /* V2.20.1 BUGFIX：必須明確指定 color。
     V2.20 把圖例從 <span> 改為 <button> 以支援點擊篩選，但 button 有自己的
     UA 預設樣式、不會繼承容器的 color → 文字變成瀏覽器預設黑色，在深色底上等同隱形。
     放在基底 class（優先級 0,1,0）而非 .tcg-mi-filter（0,2,0），
     這樣後面定義的 .tcg-mi-status-* 顏色才蓋得過來。 */
  color: var(--tcg-text);
}
/* 溫度標籤：給各自的語意色，比單純亮字更好辨識 */
.tcg-mi-legend-cold { color: var(--tcg-cold-color); }
.tcg-mi-legend-warm { color: var(--tcg-warm-color); }
.tcg-mi-legend-hot  { color: var(--tcg-hot-color); }

/* V2.20：圖例改為可點擊的過濾器 */
.tcg-mi-legend-item.tcg-mi-filter {
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
  user-select: none;
}
.tcg-mi-legend-item.tcg-mi-filter:hover {
  transform: translateY(-1px);
  filter: brightness(1.25);
}
/* 選中：外框 + 微光，確保在任何底色上都看得出來 */
.tcg-mi-legend-item.tcg-mi-filter-active {
  outline: 1px solid rgba(232,218,255,.88);
  outline-offset: 1px;
  box-shadow: 0 0 0 3px rgba(154,108,255,.14), 0 0 16px rgba(154,108,255,.18);
  font-weight: 700;
}
/* 只在使用者「真的點了某個象限」時，才把未選中的降低存在感。
   V2.25.10 BUGFIX：原本條件是 :has(.tcg-mi-filter-active)，但「全部」預設就是 active，
     一進頁面就把整排打到 .42 透明 → 灰/暗色系標籤幾乎看不見。
     改為排除「全部」(:not(.tcg-mi-filter-all))：預設狀態全部標籤 100% 清晰，
     只有點了具體象限（全部取消選中）才淡化其他。淡化程度也從 .42 放寬到 .6。
   （:has() 在 Safari <15.4 / 舊 Chrome 不支援 —— 屬漸進增強，不影響功能） */
.tcg-mi-legend:has(.tcg-mi-filter-active:not(.tcg-mi-filter-all)) .tcg-mi-filter:not(.tcg-mi-filter-active) {
  opacity: .6;
}
.tcg-mi-legend-actions {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 2px;
}
.tcg-mi-filter-hint { font-size: 12px; color: #b8b1c2; }

/* V2.20.1：「全部」按鈕 —— 取代原本的「清除篩選」。
   原設計：只有篩選啟用時才冒出一個「清除篩選」按鈕 → 使用者看不出「現在是全部」這個狀態。
   新設計：「全部」常駐且預設選中，語意直觀（跟地區 tab 的「全部」一致）。 */
.tcg-mi-filter-all {
  font-weight: 600;
}

/* V2.20.1：釘選 bar 固定在底部後會蓋住內容，預留空間 */
.tcg-mi-container.tcg-mi-has-pins {
  padding-bottom: 88px;
}

/* V2.20：釘選工具列
   V2.20.1：改為固定浮動於視窗底部。
     原本內嵌在頁面頂部 —— 使用者滑到第 50 張卡片想切「只看釘選」時得滑回最上面，
     操作路徑太長。釘選是「隨時可能用」的工具，應該永遠在手邊。 */
.tcg-mi-pinbar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 20px;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 8px 8px 8px 18px;
  /* V2.25.2：蘋果風毛玻璃 —— 白色半透明 + 強背景模糊 + 飽和度提升。
     saturate(180%) 是 Apple 材質的關鍵：讓底下的顏色透上來時更鮮活，不是死白。
     inset 頂部亮線是 Apple 控制中心的招牌質感（模擬玻璃邊緣受光）。 */
  background: rgb(255 255 255 / 74%);
  border: 2px solid rgba(255,255,255,.8);
  border-radius: 999px;
  font-size: 14px;
  box-shadow:
    0 8px 40px rgba(0,0,0,.20),
    0 2px 8px rgba(0,0,0,.10),
    inset 0 1px 0 rgba(255,255,255,.8);
  backdrop-filter: blur(6px) saturate(156%);
  -webkit-backdrop-filter: blur(6px) saturate(156%);
  color: #1d1d1f;
  /* V2.20.2 BUGFIX：一定要 width: max-content（否則 left:50% 會砍半、內容斷行變胖橢圓）。 */
  width: max-content;
  max-width: calc(100vw - 32px);
  animation: tcg-mi-pinbar-in .28s cubic-bezier(.32,.72,0,1);
}
@keyframes tcg-mi-pinbar-in {
  from { opacity: 0; transform: translateX(-50%) translateY(14px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.tcg-mi-pinbar-label { display:inline-flex; align-items:center; gap:8px; color:#20252d; white-space:nowrap; font-weight:500; }
.tcg-mi-pinbar-label .tcg-mi-pin-count { display:inline-flex; align-items:center; justify-content:center; min-width:24px; height:24px; box-sizing:border-box; padding-inline:5px; border-radius:50%; background:rgb(0 0 0 / 7%); color:#111827; font-weight:750; }
.tcg-mi-pinbar-icon { display:block; flex:0 0 18px; width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.tcg-mi-pinbar-icon-pin { fill:#e1251b; stroke:none; }
.tcg-mi-pinbar-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  color: #20252d;
  white-space: nowrap;
  user-select: none;
  font-weight: 500;
  position:relative;
  min-height:24px;
  padding-inline-start:16px;
  border-inline-start:1px solid rgb(0 0 0 / 14%);
}
.tcg-mi-pinbar-toggle .tcg-mi-pin-only { position:absolute; width:1px; height:1px; padding:0; margin:0; opacity:0; }
.tcg-mi-pinbar-switch { position:relative; flex:0 0 30px; width:30px; height:18px; border-radius:99px; background:#c2cbd7; transition:background .18s; }
.tcg-mi-pinbar-switch::before { content:""; position:absolute; top:2px; left:2px; width:14px; height:14px; border-radius:50%; background:#fff; box-shadow:0 1px 2px #0001; transition:transform .18s; }
.tcg-mi-pin-only:checked + .tcg-mi-pinbar-switch { background:#df241a; }
.tcg-mi-pin-only:checked + .tcg-mi-pinbar-switch::before { transform:translateX(12px); }
.tcg-mi-pin-only:focus-visible + .tcg-mi-pinbar-switch { outline:2px solid #a61d16; outline-offset:3px; }

/* 按鈕：預設是低調的次要膠囊（清除釘選） */
.tcg-mi-pinbar button {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  min-height:36px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(0,0,0,.05);
  border: 1px solid rgba(0,0,0,.06);
  color: #1d1d1f;
  font-size: 14px;
  line-height:20px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background .18s, transform .1s;
}
.tcg-mi-pinbar button.tcg-mi-pin-clear { min-height:24px; padding:4px 16px; border:0; border-inline-start:1px solid rgb(0 0 0 / 14%); border-radius:0!important; background:transparent; color:#4b5563; font-weight:650; box-shadow:none; }
.tcg-mi-pinbar button.tcg-mi-pin-clear:hover { color:#111827; background:transparent; }
.tcg-mi-pinbar button:hover { background: rgba(0,0,0,.10); }
.tcg-mi-pinbar button:active { transform: scale(.96); }
/* 次要動作：半透明白色複製；主要動作：品牌紅色並排。 */
.tcg-mi-pinbar button.tcg-mi-pin-copy {
  background: rgb(255 255 255 / 56%);
  border-color: rgb(255 255 255 / 40%);
  color: #1d1d1f;
  font-weight: 650;
  box-shadow: none;
}
.tcg-mi-pinbar button.tcg-mi-pin-copy:hover { background: rgb(255 255 255 / 74%); }
.tcg-mi-pinbar button.tcg-mi-compare-open {
  background: #e1251b;
  border-color: #e1251b;
  color: #fff;
  font-weight: 600;
  box-shadow: none;
}
.tcg-mi-pinbar button.tcg-mi-compare-open:hover { background:#bd1d15; border-color:#bd1d15; }
.tcg-mi-pinbar button.tcg-mi-compare-open[hidden] { display: none !important; }
.tcg-mi-pinbar :is(.tcg-mi-pin-copy,.tcg-mi-compare-open):focus-visible { outline: 2px solid #ff8276; outline-offset: 3px; }

/* V2.20：卡片上的釘選按鈕
   V2.20.1 BUGFIX：選擇器必須是 `.tcg-mi-card > .tcg-mi-pin`（優先級 0,2,0）。
     卡片既有規則 `.tcg-mi-card > * { position: relative }`（0,1,1）會蓋掉
     單一 class 的 `.tcg-mi-pin`（0,1,0），導致 absolute 失效、按鈕掉到左上角壓住國旗。 */
.tcg-mi-card > .tcg-mi-pin {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  background: rgba(10,14,20,.75);
  border: 1px solid rgba(255,255,255,.22);
  cursor: pointer;
  /* V2.20.3：平時完全收起，滑鼠移到卡片上才從右上角滑出。
     V2.20.1 的 opacity:.55 常駐是「怕使用者找不到功能」的補償 —— 但代價是
     221 張卡片各有一顆半透明灰鈕常駐在角落，跟徽章、國名搶注意力，
     而它其實是次要動作（看溫度才是主要目的）。收起來讓卡片乾淨，
     hover 才浮出：需要時找得到，不需要時不吵。
     已釘選的卡片不受此規則影響（見下方 .tcg-mi-card-pinned），否則會無法取消釘選。 */
  opacity: 0;
  transform: translateX(6px) scale(.88);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s cubic-bezier(.34,1.4,.64,1),
              background .18s, border-color .18s;
  font-size: 15px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tcg-mi-card:hover > .tcg-mi-pin,
.tcg-mi-card:focus-within > .tcg-mi-pin,
.tcg-mi-card > .tcg-mi-pin:focus-visible {
  opacity: 1;
  transform: translateX(0) scale(1);
  pointer-events: auto;
  border-color: rgba(255,213,79,.5);
}
.tcg-mi-card > .tcg-mi-pin:hover {
  opacity: 1;
  transform: translateX(0) scale(1.15);
  background: rgba(255,213,79,.3);
  border-color: rgba(255,213,79,.9);
}
.tcg-mi-pin-icon { filter: grayscale(1) brightness(1.6); opacity: .9; }
.tcg-mi-card:hover .tcg-mi-pin-icon { filter: grayscale(.3) brightness(1.2); }

/* 已釘選：常駐 + 金色高亮
   V2.20.3：必須明寫 transform/pointer-events 覆蓋收起狀態 ——
   否則釘完後圖示縮回去、也點不到，使用者無法取消釘選。 */
.tcg-mi-card-pinned > .tcg-mi-pin {
  opacity: 1;
  transform: translateX(0) scale(1);
  pointer-events: auto;
  background: rgba(255,213,79,.28);
  border-color: rgba(255,213,79,.8);
  box-shadow: 0 0 12px rgba(255,213,79,.4);
}
.tcg-mi-card-pinned .tcg-mi-pin-icon { filter: none; opacity: 1; }
.tcg-mi-card-pinned {
  border-color: rgba(255,213,79,.55);
  box-shadow: 0 0 0 1px rgba(255,213,79,.3), 0 0 24px rgba(255,213,79,.12), var(--tcg-shadow);
}

/* === 篩選/搜尋控制列 === */
.tcg-mi-controls {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
}
.tcg-mi-controls-right {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(180px, 220px);
  align-items: end;
  gap: 12px;
}

/* V2.20：排序器 */
.tcg-mi-sort {
  display: grid;
  gap: 6px;
}
.tcg-mi-sort-label,
.tcg-mi-control-label {
  display: block;
  font-size: 12px;
  color: #d8d2e1;
  font-weight: 700;
  white-space: nowrap;
}
.tcg-mi-sort select {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.14);
  color: var(--tcg-text);
  border-radius: 10px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  outline: none;
}
.tcg-mi-sort select:focus { border-color: rgba(62,134,255,.5); }
.tcg-mi-sort select option { background: #1a2333; color: var(--tcg-text); }
.tcg-mi-filter-tabs {
  gap: 8px;
}
.tcg-mi-tab {
  min-height: 36px;
  padding: 7px 14px;
  background: rgba(255,255,255,.055);
  border: 1px solid rgba(255,255,255,.13);
  color: #d5cfdd;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  transition: all .2s;
}
.tcg-mi-tab:hover { background: rgba(255,255,255,.08); color: var(--tcg-text); }
.tcg-mi-tab-active {
  background: rgba(154,108,255,.22);
  border-color: rgba(185,146,255,.55);
  color: var(--tcg-text);
  font-weight: 600;
  box-shadow: 0 0 0 3px rgba(154,108,255,.11);
}
.tcg-mi-search { display: grid; min-width: 0; gap: 6px; }
.tcg-mi-search input {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.14);
  color: var(--tcg-text);
  border-radius: 10px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
}
.tcg-mi-search input:focus { border-color: rgba(62,134,255,.5); }

/* === 卡片網格 === */
.tcg-mi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--tcg-gap);
}

.tcg-mi-empty, .tcg-mi-nomatch {
  padding: 40px 20px;
  text-align: center;
  color: var(--tcg-text-muted);
  background: rgba(255,255,255,.03);
  border: 1px dashed var(--tcg-line);
  border-radius: 12px;
}

/* V2.6：资料维护中画面 */
.tcg-mi-maintenance {
  padding: 60px 20px;
  text-align: center;
  background: rgba(255,255,255,.03);
  border: 1px dashed var(--tcg-line);
  border-radius: 16px;
  margin: 20px 0;
}
.tcg-mi-maintenance-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.7;
}
.tcg-mi-maintenance-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--tcg-text);
  margin-bottom: 12px;
}
.tcg-mi-maintenance-desc {
  color: var(--tcg-text-muted);
  font-size: 14px;
  line-height: 1.7;
}

/* === 單一卡片 === */
.tcg-mi-card {
  background: var(--tcg-card-bg);
  /* 1.60.9：模糊卡片後方的頁面底景，不對卡片文字／互動內容套 filter。 */
  -webkit-backdrop-filter: blur(18px) saturate(145%);
  backdrop-filter: blur(18px) saturate(145%);
  border: 1px solid var(--tcg-card-border);
  border-radius: var(--tcg-card-radius);
  box-shadow: var(--tcg-shadow);
  padding: var(--tcg-card-padding);
  position: relative;
  overflow: visible;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 320px;
}
.tcg-mi-card:before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: var(--tcg-card-radius);
  background: radial-gradient(700px 120px at 10% 0%, rgba(120,180,255,.14), transparent 55%),
              radial-gradient(700px 120px at 90% 0%, rgba(255,120,120,.10), transparent 60%);
  pointer-events: none;
}
.tcg-mi-card > * { position: relative; }
.tcg-mi-card:hover,
.tcg-mi-card:focus-within { z-index: 5; }

/* The initial document contains 24 complete cards; the remaining index entries
   stay small and honest until their public markup is loaded after first paint. */
.tcg-mi-card.tcg-mi-card-shell {
  min-height: var(--tcg-mi-lazy-card-height, 320px);
  background: rgba(23, 27, 39, .93);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.tcg-mi-card.tcg-mi-card-shell::before { content: none; }
.tcg-mi-card-shell-score { margin: 18px 0 0; color: var(--tcg-text-muted); font-size: 13px; }
.tcg-mi-card-shell-score strong { color: var(--tcg-text); font-size: 18px; }
.tcg-mi-card-shell-note { margin: 6px 0 42px; color: var(--tcg-text-muted); font-size: 13px; }
.tcg-mi-card-shell > .tcg-mi-detail-btn { top: auto; bottom: 14px; transform: none; }
.tcg-mi-lazy-status { margin: 18px 0; color: var(--tcg-text-muted); font-size: 14px; }
.tcg-mi-lazy-retry:not([hidden]) { display: inline-block; margin: 0 12px 20px 0; }
.tcg-mi-lazy-fallback:not([hidden]) { display: inline-block; margin: 0 0 20px; color: var(--tcg-text); text-decoration: underline; }
@media (max-width: 640px) {
  .tcg-mi-card.tcg-mi-card-shell { min-height: var(--tcg-mi-lazy-card-height, 280px); }
}

/* 不支援玻璃模糊的瀏覽器保留足夠深色與對比，不影響卡片內容。 */
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .tcg-mi-card {
    background: linear-gradient(180deg, rgba(31,35,48,.96), rgba(15,18,27,.96));
  }
}

/* 卡片頂部
   V2.20.3 重新排版：狀態徽章改放到國名下方，不再與國名爭同一條水平線。

   為什麼 V2.20.2 的 `padding-right: 42px` 是錯的修法：
     卡片只有 ~420px 寬，卻要同時容納「國名 + 徽章 + 釘選鈕」三個東西。
     徽章是 `white-space: nowrap`（不可壓縮，最長的「微型市場·流量少價格低」約 200px），
     釘選鈕又從右邊挖走 42px —— 於是所有的擠壓全部由國名這一欄吸收，
     只剩約 40px，「安提瓜和巴布达」被拆成 3 行、英文名 Barbuda 被從中間切成「Barbud / a」。
     把重疊改成換行，不是修好，是把問題搬家。

   正解：一行只放一件事。國名獨佔一行（只需避開右上角的釘選鈕），
   徽章自己一行、拿整個卡片寬度 —— 再長的象限名也不必壓縮任何東西。 */
.tcg-mi-card-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 14px;
}
.tcg-mi-card-name-zh {
  display: block;
  font-size: 18px;
  line-height: 1.3;
  color: var(--tcg-text);
}
.tcg-mi-card-name-en {
  display: block;
  font-size: 12px;
  color: var(--tcg-text-muted);
  margin-top: 2px;
}

/* 狀態徽章 */
.tcg-mi-status {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
}
.tcg-mi-status-red_ocean  { background: rgba(255,77,79,.15);  border-color: rgba(255,77,79,.4);  color: #ff7875; }
.tcg-mi-status-mature     { background: rgba(255,169,64,.15); border-color: rgba(255,169,64,.4); color: #ffc069; }
.tcg-mi-status-blue_ocean { background: rgba(82,196,26,.15);  border-color: rgba(82,196,26,.4);  color: #95de64; }
.tcg-mi-status-marginal   { background: rgba(200,200,200,.12); border-color: rgba(200,200,200,.35); color: #cccccc; }
/* V2.18：新增 4 種象限徽章樣式 */
.tcg-mi-status-high_potential  { background: rgba(255,215,0,.15);  border-color: rgba(255,215,0,.5);  color: #ffd54f; }  /* 🌟 高潛力（金黃）*/
.tcg-mi-status-low_attractive  { background: rgba(120,120,120,.15); border-color: rgba(120,120,120,.4); color: #b0b0b0; }  /* ⚫ 低吸引力（深灰）*/
.tcg-mi-status-oligopoly_micro { background: rgba(180,80,80,.15);   border-color: rgba(180,80,80,.4);   color: #d47474; }  /* ⛔ 微型寡占（暗紅）*/
.tcg-mi-status-contradictory   { background: rgba(255,193,7,.15);   border-color: rgba(255,193,7,.4);   color: #ffca28; }  /* ⚠️ 訊號矛盾（琥珀）*/
.tcg-mi-status-unclear         { background: rgba(150,150,150,.12); border-color: rgba(150,150,150,.35); color: #b8b8b8; }  /* ⚪ 訊號不明（V2.18.6，null status fallback）*/
/* V2.19：中型潛力（🌿 青綠 — 介於 potential 藍與 high_potential 金黃之間，自成一系）*/
.tcg-mi-status-medium_potential { background: rgba(150,220,150,.15); border-color: rgba(150,220,150,.4); color: #a8e6a8; }

/* V2.8：潛力市場（曝光少但人口多，值得關注）*/
.tcg-mi-status-potential  { background: rgba(80,150,255,.15); border-color: rgba(80,150,255,.4); color: #7ab8ff; }

/* 訊號不明的卡片：整張降低存在感（沒有有效資料 → 參考價值低）
   V2.20.1 BUGFIX：實際 class 是 `status-card-unknown`（PHP：$status_key ?: 'unknown'，
     ad_status 為 null 時 $status_key 是空字串 → 落到 'unknown'）。
     舊 CSS 只寫了 marginal，所以「⚪ 訊號不明」的 22 個國家從來沒被灰顯過。 */
.tcg-mi-card.tcg-mi-status-card-unknown,
.tcg-mi-card.tcg-mi-status-card-marginal {
  opacity: .45;
  filter: saturate(.35);
}
.tcg-mi-card.tcg-mi-status-card-unknown:hover,
.tcg-mi-card.tcg-mi-status-card-marginal:hover {
  opacity: .9;
  filter: saturate(.85);
}
/* 釘選的卡片不受灰顯影響 —— 使用者刻意選的，要看得清楚 */
.tcg-mi-card.tcg-mi-status-card-unknown.tcg-mi-card-pinned,
.tcg-mi-card.tcg-mi-status-card-marginal.tcg-mi-card-pinned {
  opacity: 1;
  filter: none;
}

/* ═══════════════════════════════════════════════════════════
   V2.16.5：發光效果精簡版
   - 移除所有數字（.tcg-mi-card-score-num）的發光/脈動
   - 只在「顯示分數 > 70」的卡片（.tcg-mi-super-hot）給溫度計加紅光
   - 不再依 status 分類（成熟/藍海/潛力等）加光
   ─────────────────────────────────────────────────────────── */

.tcg-mi-card.tcg-mi-super-hot .tcg-mi-thermo-fill {
  box-shadow: 0 0 14px 4px rgb(255 0 77 / 77%);
}

/* V2.7.6：國旗（圓形）*/
/* V2.14.1：國旗改成對齊上排的中文名（原本 align-items: center 會讓國旗跑到兩行文字中間，看起來偏低） */
.tcg-mi-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  min-width: 26px;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  vertical-align: middle;
  margin-right: 10px;
  margin-top: 2px;   /* 微調對齊中文名基線 */
  flex-shrink: 0;
}
.tcg-mi-flag img {
  width: 130%;
  height: 130%;
  object-fit: cover;
  display: block;
}
.tcg-mi-card-country {
  display: flex;
  align-items: flex-start;   /* 從中央對齊改成上端對齊 */
  gap: 0;
  /* V2.20.3：只有「國名這一行」需要替右上角的釘選鈕讓位（12px + 34px 鈕 + 8px 呼吸）。
     徽章在下一行，不受影響，可用整個卡片寬度。 */
  width: 100%;
  box-sizing: border-box;
  padding-right: 54px;
}
.tcg-mi-card-country-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  /* 英文名只在「單字本身塞不下」時才斷字，不做 break-all 的逐字硬切 */
  overflow-wrap: break-word;
  word-break: normal;
}
/* V2.13：micro 從綠色（微型）改成藍冷色（冷清） */
.tcg-mi-status-micro      { background: rgba(120,180,220,.15);border-color: rgba(120,180,220,.4);color: #9ec4e0; }
/* V2.19：移除 .tcg-mi-status-cold — determine_status() 從不回傳 'cold'，是 V2.7 之前的遺留 */

/* === 狀態徽章 hover tooltip === */
.tcg-mi-status-wrap {
  position: relative;
  display: inline-block;
}
.tcg-mi-tooltip {
  position: absolute;
  top: calc(100% + 8px);
  /* V2.20.3：徽章從卡片右上角搬到國名下方（靠左），tooltip 的錨點也要跟著換邊。
     沿用 right:0 會讓 300–380px 寬的 tooltip 從徽章右緣往左長，直接穿出卡片左界。 */
  left: 0;
  min-width: 300px;
  max-width: 760px;
  background: #1a2333;
  color: var(--tcg-text);
  border: 1px solid var(--tcg-line);
  border-radius: 10px;
  padding: 14px 16px;
  /* V2.18：字體放大 12→14，line-height 1.6→1.7，讀起來輕鬆 */
  font-size: 14px;
  line-height: 1.7;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity .2s, visibility .2s, transform .2s;
  z-index: 10;
  pointer-events: auto;
}
.tcg-mi-tooltip:before {
  content: '';
  position: absolute;
  top: -6px;
  left: 20px;   /* V2.20.3：跟著 tooltip 換邊，箭頭要指回徽章 */
  width: 12px;
  height: 12px;
  background: #1a2333;
  border-left: 1px solid var(--tcg-line);
  border-top: 1px solid var(--tcg-line);
  transform: rotate(45deg);
}
/* 透明橋：填補徽章與 tooltip 間 8px 空隙，滑鼠移入時 hover 不中斷 */
.tcg-mi-tooltip:after {
  content: '';
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  height: 12px;
}
.tcg-mi-status-wrap:hover .tcg-mi-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.tcg-mi-tooltip-desc { color: var(--tcg-text); margin-bottom: 8px; font-size: 14px; }
.tcg-mi-tooltip-action { color: #ffd54f; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--tcg-line); font-size: 13px; }
.tcg-mi-tooltip-stats {
  color: var(--tcg-text-muted);
  font-size: 12px;
  padding-top: 8px;
  border-top: 1px dashed var(--tcg-line);
}

/* V2.7.6：micro 不再灰調（微型市場資料真實，只是量小）*/
/* V2.19：移除 .tcg-mi-size-micro-DEPRECATED — 選擇器帶 -DEPRECATED 字尾，不匹配任何實際 class */

/* === 規模徽章 === */
.tcg-mi-size-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--tcg-line);
  color: var(--tcg-text-muted);
  font-size: 12px;
  font-weight: 500;
}
.tcg-mi-card-metas {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

/* === 資料來源標示 + 免責聲明 === */
.tcg-mi-data-source {
  margin-top: 24px;
  padding: 20px;
  color: var(--tcg-text-muted);
  font-size: 12px;
  background: rgba(255,255,255,.02);
  border-top: 1px solid var(--tcg-line);
  border-radius: 8px;
}
.tcg-mi-data-source-main {
  text-align: center;
  font-size: 12px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--tcg-line);
  color: var(--tcg-text);
}
.tcg-mi-disclaimer {
  font-size: 12px;
  line-height: 1.7;
  color: var(--tcg-text-muted);
}
.tcg-mi-disclaimer strong {
  display: block;
  margin-bottom: 6px;
  color: var(--tcg-text-muted);
  font-size: 12px;
}
.tcg-mi-disclaimer ol {
  margin: 0;
  padding-left: 20px;
}
.tcg-mi-disclaimer li {
  margin-bottom: 4px;
}

/* === 卡片上的天成大數據品牌 === */
.tcg-mi-card-brand {
  margin-top: 6px;
  font-size: 12px;
  color: var(--tcg-text-muted);
  opacity: 0.7;
  letter-spacing: 0.5px;
}
.tcg-mi-tooltip-brand {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px dashed var(--tcg-line);
  font-size: 12px;
  color: var(--tcg-text-muted);
  font-style: italic;
}

/* 卡片主體：溫度計 + 分數 */
.tcg-mi-card-body {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 16px;
  align-items: center;
  margin: 8px 0 12px;
  flex: 1;
}

/* 溫度計 */
.tcg-mi-thermo {
  position: relative;
  width: 70px;
  height: 180px;
  border-radius: 999px;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--tcg-line);
  padding: 10px;
}
.tcg-mi-thermo-scale {
  position: absolute;
  inset: 10px 8px 10px 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 12px;
  color: rgba(255,255,255,.6);
  text-align: right;
  pointer-events: none;
}
.tcg-mi-thermo-tube {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 12px;
  width: 22px;
  height: 156px;
  border-radius: 999px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  overflow: hidden;
}
/*
  V2.7.6 修正：溫度計 fill 用「固定高度的漸層背景 + bottom 對齊 + no-repeat」
  這樣 fill 高度變化時只是「露出更多底部」，漸層不會被壓扁。
  低分只看到藍色，高分才看到藍→中→紅完整漸層。
  V2.7.7：頂部圓弧（像真水銀那樣），不要一刀切
*/
.tcg-mi-thermo-fill {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  border-top-left-radius: 11px;   /* 頂部圓弧 = 半個 tube 寬 */
  border-top-right-radius: 11px;
  /* V2.16.3：更激進的漸層壓縮
     0% 紅 / 40% 橙 / 65% 藍 / 100% 綠
     → 60 分以上就會看到明顯紅色（原本要 67 分才有一點紅） */
  background: linear-gradient(180deg,
    var(--tcg-hot-color)  0%,     /* 紅 - 紅海 (100 分位置) */
    var(--tcg-warm-color) 40%,    /* 橙 - 邊界 (60 分位置)，之前是 50% */
    var(--tcg-cold-color) 65%,    /* 藍 - 藍海 (35 分位置)，之前是 75% */
    var(--tcg-cool-color) 100%);  /* 綠 - 冷清 (0 分位置) */
  background-size: 100% 156px;   /* 對齊 tube 高度 */
  background-position: 0 100%;   /* 貼齊底部 */
  background-repeat: no-repeat;
  transition: height .6s ease;
}

/* 分數顯示 */
.tcg-mi-card-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.tcg-mi-card-score-num {
  font-size: 56px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
}
.tcg-mi-card-score-label {
  margin-top: 6px;
  font-size: 14px;
  color: var(--tcg-text-muted);
}

/* 溫度色調的卡片變化 */
.tcg-mi-card-hot  .tcg-mi-card-score-num { color: var(--tcg-hot-color); }
.tcg-mi-card-warm .tcg-mi-card-score-num { color: var(--tcg-warm-color); }
.tcg-mi-card-cold .tcg-mi-card-score-num { color: var(--tcg-cold-color); }

/* 卡片底部 */
.tcg-mi-card-footer {
  border-top: 1px solid var(--tcg-line);
  padding-top: 10px;
  margin-top: auto;
}
.tcg-mi-card-meta {
  font-size: 12px;
  color: var(--tcg-text-muted);
}
.tcg-mi-card-note {
  margin-top: 8px;
  padding: 10px 12px;
  background: rgba(255,255,255,.02);
  border: 1px dashed var(--tcg-line);
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.55;
  color: rgba(232,238,247,.85);
}
/* V2.9：自動生成標記 */
.tcg-mi-card-note-auto {
  display: inline-block;
  padding: 1px 6px;
  margin-right: 4px;
  font-size: 12px;
  border-radius: 4px;
  background: rgba(120,150,220,.15);
  color: rgba(180,200,240,.9);
  border: 1px solid rgba(120,150,220,.25);
}

/* === 響應式 === */
@media (max-width: 640px) {
  .tcg-mi-container { padding: 12px; }
  .tcg-mi-grid { grid-template-columns: minmax(0, 1fr); }
  .tcg-mi-market-tools { padding: 16px 14px; border-radius: 16px; }
  .tcg-mi-market-tools-head { display: block; margin-bottom: 16px; }
  .tcg-mi-market-tools-summary { justify-content: space-between; margin-top: 12px; }
  .tcg-mi-controls-right { grid-template-columns: 1fr; }
  .tcg-mi-filter-section { grid-template-columns: 1fr; gap: 7px; }
  .tcg-mi-legend-title { padding-top: 0; }
  .tcg-mi-filter-tabs,
  .tcg-mi-filter-options {
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    padding: 2px 2px 7px;
    scrollbar-width: thin;
  }
  .tcg-mi-tab,
  .tcg-mi-legend-item { flex: 0 0 auto; }
  .tcg-mi-card-score-num { font-size: 44px; }
  .tcg-mi-card { min-height: 280px; }
  .tcg-mi-container .tcg-mi-card > .tcg-mi-pin { right: -8px; }

  /* V2.20：手機版 */
  .tcg-mi-sort select { width: 100%; }

  /* V2.20.1：手機版釘選 bar 貼齊底部整條，不做膠囊 */
  .tcg-mi-pinbar {
    left: 0;
    right: 0;
    bottom: 0;
    transform: none;
    width: auto;          /* 覆蓋桌機版的 max-content：手機要整條滿版 */
    max-width: 100%;
    border-radius: 14px 14px 0 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    font-size: 12px;
    gap: 8px;
    padding: 10px 12px;
  }
  @keyframes tcg-mi-pinbar-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .tcg-mi-pinbar button { padding: 5px 10px; }
  .tcg-mi-container.tcg-mi-has-pins { padding-bottom: 96px; }

  /* v1.71.2：手機版頁尾的資料來源與免責聲明 13px。 */
  .tcg-mi-data-source-main,
  .tcg-mi-disclaimer,
  .tcg-mi-disclaimer strong { font-size: 13px; }
}

/* 觸控裝置（含平板）：沒有 hover，釘選鈕必須常駐可見且可點
   V2.20.3：hover 滑出只是桌機的優化。觸控裝置 :hover 永遠不觸發，
   若不在這裡把 opacity/transform/pointer-events 一起還原，
   手機上釘選鈕會永久隱形且點不到 —— 功能等於消失。 */
@media (hover: none) {
  .tcg-mi-card > .tcg-mi-pin {
    opacity: .8;
    transform: translateX(0) scale(1);
    pointer-events: auto;
  }
}

/* V2.25（決策 65）：市場條件檔案 —— 獨立顯示，不進評分
   V2.25.1：原生 title 太小、無排版 → 改樣式化 tooltip（沿用狀態徽章 tooltip 的視覺）
   顏色語意：綠=合法、黃=僅彩券、灰=灰色市場、暗=監管未明 */
.tcg-mi-reg-wrap {
  position: relative;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--tcg-line);
}
.tcg-mi-reg {
  display: inline-flex;
  flex-wrap: wrap;
  max-width: 100%;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--tcg-text-muted);
  cursor: help;
  line-height: 1.5;
}
.tcg-mi-reg-icon { font-size: 14px; }
.tcg-mi-reg strong { font-weight: 700; font-size: 13.5px; min-width:0; overflow-wrap:anywhere; }
.tcg-mi-reg-legal    strong { color: #95de64; }
.tcg-mi-reg-regional strong, .tcg-reg-value-regional { color: #4fc3f7; }
.tcg-mi-reg-opening strong, .tcg-reg-value-opening { color: #ffc069; }
.tcg-mi-reg-prohibited strong, .tcg-reg-value-prohibited { color: #ff6666; }
.tcg-mi-reg-tip-v.tcg-reg-value-legal { color: #95de64; }
.tcg-mi-reg-tip-v.tcg-reg-value-regional { color: #4fc3f7; }
.tcg-mi-reg-tip-v.tcg-reg-value-opening { color: #ffc069; }
.tcg-mi-reg-tip-v.tcg-reg-value-prohibited { color: #ff6666; }
.tcg-mi-reg-tip-v.tcg-reg-value-unknown { color: #8ea0b6; }
.tcg-mi-reg-offshore-mark { display:inline-block; margin-inline-start:6px; border:1px solid currentColor; border-radius:4px; padding:1px 5px; color:#4fc3f7; font-size:.78em; line-height:1.5; }
.tcg-mi-reg-offshore strong { color: #4fc3f7; }   /* 離岸發牌中心：青藍，與本地合法（綠）區分 */
.tcg-mi-reg-partial  strong { color: #ffc069; }
.tcg-mi-reg-grey     strong { color: #b0b0b0; }
.tcg-mi-reg-unknown  strong { color: #8ea0b6; }
.tcg-mi-reg-hint {
  opacity: .55;
  font-size: 12px;
  border: 1px solid currentColor;
  border-radius: 50%;
  width: 15px; height: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* 樣式化 tooltip */
.tcg-mi-reg-tip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  box-sizing: border-box;
  width: min(420px, calc(100vw - 32px));
  min-width: min(280px, calc(100vw - 56px));
  max-width: min(420px, calc(100vw - 56px));
  max-height: min(65vh, 560px);
  overflow-y: auto;
  background: #1a2333;
  border: 1px solid var(--tcg-line);
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.45);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity .2s, visibility .2s, transform .2s;
  z-index: 12;
  pointer-events: none;
}
.tcg-mi-reg-wrap:hover .tcg-mi-reg-tip, .tcg-mi-reg-wrap:focus-within .tcg-mi-reg-tip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}
.tcg-mi-reg-tip-head {
  font-weight: 700;
  font-size: 13px;
  color: #e8eef7;
  margin-bottom: 8px;
}
/* div 版明細（不用 table，避免主題白底覆蓋）。
   顏色寫死不用變數 —— 這是浮層，主題若覆寫容器變數也不受影響。 */
.tcg-mi-reg-tip-rows { display: flex; flex-direction: column; gap: 6px; }
.tcg-mi-reg-tip-row { display: flex; gap: 10px; font-size: 12.5px; line-height: 1.5; }
.tcg-mi-reg-tip-k {
  flex: 0 0 30%;
  color: #8ea0b6;
  font-weight: 500;
  background: transparent;
}
.tcg-mi-reg-tip-v {
  flex: 1;
  color: #e8eef7;
  background: transparent;
}
.tcg-mi-policy-values { min-width: 0; }
.tcg-mi-policy-item + .tcg-mi-policy-item { margin-top: 6px; }
.tcg-mi-policy-product { white-space: nowrap; }
.tcg-mi-policy-item > .tcg-mi-reg-tip-v { flex: none; }
.tcg-mi-reg-tip-foot {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--tcg-line);
  font-size: 12px;
  color: var(--tcg-text-muted);
  font-style: italic;
}

/* === V2.26（決策 71）相關市場文章（內部連結）=== */
.tcg-mi-articles {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.tcg-mi-articles-title {
  font-size: 12px;
  color: var(--tcg-text-muted, #8ea0b6);
  margin-bottom: 5px;
  letter-spacing: .02em;
}
.tcg-mi-article {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 4px 0;
  text-decoration: none;
  color: #cfe0f5;
  font-size: 12.5px;
  line-height: 1.35;
  transition: color .15s;
}
.tcg-mi-article:hover { color: #ffffff; }
.tcg-mi-article:hover .tcg-mi-article-title { text-decoration: underline; }
.tcg-mi-article-fresh { flex: 0 0 auto; font-size: 12px; }
.tcg-mi-article-title {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tcg-mi-article-date {
  flex: 0 0 auto;
  color: var(--tcg-text-muted, #7f8ea3);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

/* ═══════════════════════════════════════════════════════════════
   卡片三頁滑動（決策：摘要 / 六維+溫度 / 玩家在关注什么）
   橫向 scroll-snap，底部圓點切換；溫度計在頁①②共用。
   ═══════════════════════════════════════════════════════════════ */
.tcg-mi-card-body { display: block; position: relative; min-width: 0; }
.tcg-mi-slides {
  display: flex;
  min-width: 0;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tcg-mi-slides::-webkit-scrollbar { display: none; }
.tcg-mi-slide {
  flex: 0 0 100%;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  scroll-snap-align: start;
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 16px;
  align-items: center;
  height: 180px;
  overflow: hidden;
}
.tcg-mi-slide-demand { display: block; }        /* 玩家關注頁：不放溫度計，單欄 */
.tcg-mi-slide-main { min-width: 0; }
/* Without a thermometer, use both columns for the remaining heading and curve. */
.tcg-mi-slide > .tcg-mi-slide-main:only-child { grid-column: 1 / -1; }
.tcg-mi-slide-summary,
.tcg-mi-slide-dims { align-self: stretch; }
.tcg-mi-score-split,
.tcg-mi-slide-dims { display: grid; grid-template-columns: 78px 1px minmax(0, 1fr); align-items: center; gap: 8px; height: 100%; }
.tcg-mi-score-split > .tcg-mi-score-temp,
.tcg-mi-slide-dims > .tcg-mi-score-temp { min-width: 0; }
.tcg-mi-score-split > .tcg-mi-card-demand { min-width: 0; }
.tcg-mi-score-cap { font-size: 12px; line-height: 1.2; opacity: .82; letter-spacing: 0; margin-bottom: 8px; text-align: center; }
.tcg-mi-score-temp > .tcg-mi-card-score-label { font-size: 12px; text-align: center; overflow-wrap: anywhere; }
.tcg-mi-score-divider { width: 1px; height: 132px; max-height: 100%; background: rgba(255,255,255,.2); }
.tcg-mi-demand-big { font-size: 45px; font-weight: 800; line-height: 1; text-align: center; }
.tcg-mi-dims { min-width: 0; font-size: 12px; line-height: 1.8; }
.tcg-mi-dim-row { display: flex; justify-content: space-between; gap: 8px; }
.tcg-mi-dim-k { min-width: 0; color: rgba(255,255,255,.6); }
.tcg-mi-dim-v { color: #fff; font-weight: 600; max-width: 62%; text-align: right; }
.tcg-mi-dots { display: flex; justify-content: center; gap: 2px; margin: 2px 0 0; }
/* The 32px hit box stays fixed; only the inner 9px dot changes appearance. */
.tcg-mi-dot { --tcg-mi-dot-color: rgba(255,255,255,.25); --tcg-mi-dot-hover: rgba(255,255,255,.55); flex: 0 0 32px; box-sizing: border-box; width: 32px; height: 32px; min-width: 32px; min-height: 32px; margin: 0; padding: 0; border: 0; border-radius: 6px; display: grid; place-items: center; background: transparent; box-shadow: none; cursor: pointer; }
.tcg-mi-dot::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--tcg-mi-dot-color); transition: background .2s, transform .2s; }
.tcg-mi-dot.is-active::before { background: #3fb950; transform: scale(1.15); }
.tcg-mi-dot:not(.is-active):hover::before { background: var(--tcg-mi-dot-hover); }
.tcg-mi-dot:focus-visible { outline: 2px solid #ef6b60; outline-offset: -2px; }

/* 第三頁「玩家在关注什么」——無底色、標題右側玩法風向、榜單內部捲動不撐高（依設計圖） */
.tcg-mi-slide-demand { height: 180px; overflow: hidden; align-content: start; }
.tcg-mi-trend { font-size: 12px; line-height: 1.7; }
.tcg-mi-trend-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 4px; flex-wrap: wrap; }
.tcg-mi-trend-title { font-weight: 700; color: #7cc4ff; white-space: nowrap; }
.tcg-mi-trend-wind { color: rgba(255,255,255,.85); white-space: nowrap; }
.tcg-mi-trend-sub { color: #fff; margin: 2px 0; }
.tcg-mi-trend-list { max-height: 122px; overflow-y: auto; padding-right: 4px; }
.tcg-mi-trend-row { display: flex; justify-content: space-between; gap: 8px; }
.tcg-mi-trend-kw { color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tcg-mi-trend-cat { color: rgba(255,255,255,.75); white-space: nowrap; }

/* ═══ AI 老編點評：截斷預覽 + hover 氣泡框（沿用市場條件 tooltip 的深色風格） ═══ */
.tcg-mi-ainote-wrap { position: relative; cursor: default; }
.tcg-mi-ainote-tip {
  display: none;
  position: absolute;
  left: 0; right: 0;
  bottom: calc(100% + 8px);
  z-index: 60;
  background: #1b1f27;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: 0 10px 28px rgba(0,0,0,.55);
  font-size: 13px;
  line-height: 1.85;
  color: #e8eaed;
  text-align: left;
  max-height: 320px;
  overflow-y: auto;
}
.tcg-mi-ainote-wrap:hover .tcg-mi-ainote-tip { display: block; }
.tcg-mi-ainote-tip-head { font-weight: 700; color: #ffb454; margin-bottom: 6px; }
.tcg-mi-ainote-tip-body { color: #e8eaed; }

/* ═══ 卡片第四分頁：相關市場文章（沿用 footer 文章樣式，去掉外框間距、限制在滑頁高度內） ═══ */
.tcg-mi-slide .tcg-mi-arts-list { max-height: 140px; }
.tcg-mi-slide .tcg-mi-article { display: flex; align-items: baseline; gap: 8px; padding: 3px 0; text-decoration: none; }
.tcg-mi-slide .tcg-mi-article-title { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #7cc4ff; }
.tcg-mi-slide .tcg-mi-article:hover .tcg-mi-article-title { text-decoration: underline; }
.tcg-mi-slide .tcg-mi-article-date { color: rgba(255,255,255,.55); white-space: nowrap; font-size: 11px; }

/* ═══ 卡片第五頁：玩家熱度 12 個月走勢（SVG 漸變曲線：高紅/中黃/低綠，同溫度計配色） ═══ */
.tcg-mi-trend5-svg { width: 100%; height: 106px; display: block; margin-top: 4px; }
.tcg-mi-trend5-months { display: flex; justify-content: space-between; font-size: 11px; color: rgba(255,255,255,.5); margin-top: 2px; }
.tcg-mi-trend5-badge { display: inline-block; border: 1px solid; border-radius: 4px; padding: 0 6px; margin-right: 8px; font-weight: 700; font-size: 12px; }

/* 分頁標題統一加大（2026-07-23：玩家在关注什么／玩家热度走势／相关市场文章 都是標題，原 12px 太小） */
.tcg-mi-trend-title { font-size: 15px; font-weight: 700; }

/* ═══ 頁①「热度走势」並排字 ＋ 頁⑤「全球排位」量尺（2026-07-23 兩口徑分離設計） ═══ */
.tcg-mi-trendword { font-size: 30px; font-weight: 800; line-height: 1.15; text-align: center; white-space: nowrap; }
.tcg-mi-trendword-icon { font-size: 34px; margin-right: 4px; }
.tcg-mi-rank-big { font-size: 30px; font-weight: 800; color: #fff; margin: 6px 0 2px; }
.tcg-mi-rank-total { font-size: 13px; font-weight: 400; color: rgba(255,255,255,.6); }
.tcg-mi-rank-gauge { width: 100%; height: 30px; display: block; }
.tcg-mi-rank-ends { display: flex; justify-content: space-between; font-size: 11px; color: rgba(255,255,255,.5); margin-top: -2px; }
.tcg-mi-rank-nb { font-size: 12px; color: rgba(255,255,255,.7); margin-top: 6px; }
.tcg-mi-rank-tier { display: inline-block; border: 1px solid; border-radius: 4px; padding: 0 6px; font-weight: 700; font-size: 12px; }

/* 分頁副標（白話解釋行，2026-07-23） */
.tcg-mi-trend-sub2 { font-size: 11px; color: rgba(255,255,255,.55); margin: 1px 0 2px; line-height: 1.5; }

/* ═══ 2026-07-23 間距優化：壓縮頁首與名稱行距，把空間撥給圖表 ═══ */
.tcg-mi-card-header { margin-bottom: 4px; }          /* 原 14px */
.tcg-mi-card-body { margin: 2px 0 10px; }            /* 原 8px 0 12px */
.tcg-mi-card-name-en { line-height: 1.3; margin-top: 1px; }  /* 原行高 28px（12px 字），英文行貼近中文名 */
.tcg-mi-slide { height: 192px; }                     /* 180 → 192，圖表更高 */
.tcg-mi-slide-demand { height: 192px; }
.tcg-mi-trend5-svg { height: 116px; }                /* 106 → 116 */

/* ═══ 頁①迷你走勢圖 ＋「较上月」標籤（2026-07-23 第三版走勢設計） ═══ */
.tcg-mi-mini-svg { width: 100%; max-width: 180px; height: 76px; display: block; margin: 4px auto 0; }
.tcg-mi-mini-label { font-size: 16px; font-weight: 700; text-align: center; margin-top: 3px; white-space: nowrap; }
.tcg-mi-mini-vs { font-size: 11px; color: rgba(255,255,255,.5); font-weight: 400; }

/* ═══ 2026-07-23 Andy 重新設計：細管溫度計＋刻度移到管子右側（照設計稿原樣套用） ═══ */
.tcg-mi-thermo {
  position: relative;
  width: 43px;
  height: 180px;
  border-radius: 30px;
  background: rgba(255, 255, 255, .03);
  border: none;
  padding: 10px;
}
.tcg-mi-thermo-scale {
  position: absolute;
  inset: 10px 0px 10px 51px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 12px;
  color: rgba(255, 255, 255, .6);
  text-align: left;
  pointer-events: none;
  width: 100px;
}

/* ═══ 2026-07-23 老編點評浮窗改版：Andy 頭像＋署名，黃底黑字 ═══ */
.tcg-mi-ainote-tip {
  background: #ffc53d;
  border-color: rgba(0,0,0,.2);
  color: #111;
}
.tcg-mi-ainote-tip-head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #111;
  font-weight: 700;
  margin-bottom: 8px;
}
.tcg-mi-ainote-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(0,0,0,.25);
  flex: 0 0 auto;
}
.tcg-mi-ainote-tip-body { color: #111; }

/* ═══ 2026-07-23 老編點評浮窗二修：#ffebbc 柔黃、頭像 50px、字級調整、hover 橋樑防消失 ═══ */
.tcg-mi-ainote-tip {
  bottom: 100%;
  padding-bottom: 10px;   /* 透明橋樑：滑鼠從卡片移進氣泡時 hover 不中斷（修敏感消失 bug） */
  background: transparent;
  border: none;
  box-shadow: none;
  max-height: none;
  overflow: visible;
}
.tcg-mi-ainote-tip-in {
  background: #ffebbc;
  border: 1px solid rgba(0, 0, 0, .2);
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .55);
  max-height: 340px;
  overflow-y: auto;
  color: #111;
  line-height: 1.85;
}
.tcg-mi-ainote-tip-head { font-size: 18px; }
.tcg-mi-ainote-tip-body { font-size: 15px; }
.tcg-mi-ainote-avatar {
  width: 50px;
  height: 50px !important;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(0, 0, 0, .25);
  flex: 0 0 auto;
}

/* ============ V2.32（v1.49.0）：卡片「查看详情」入口 ============ */
.tcg-mi-detail-link {
  color: #58a6ff !important;
  text-decoration: none !important;
  white-space: nowrap;
}
.tcg-mi-detail-link:hover { text-decoration: underline !important; }

/* ============ V2.32.1（v1.49.2）：卡頭改版（Andy 2026-07-24 設計圖） ============ */
/* 徽章上移：與國名同一行、緊跟其右（原在國名下方靠左）。
   最長國名「圣文森特和格林纳丁斯」10 字＋最長徽章同行必擠 → flex-wrap 讓徽章自動
   換行到下一行靠左；padding-right 讓出右上角釘選鈕（34px），兩者永不相撞。 */
.tcg-mi-card-header {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding-right: 40px;
}
/* 徽章 tooltip 改錨定整張卡片：徽章上移後若仍錨定徽章本身（left:0 + 300px 寬），
   從國名右側往右展開會穿出卡片右界。改成貼卡片左右內緣，永遠在卡內。 */
.tcg-mi-status-wrap { position: static; }
.tcg-mi-tooltip { left: 12px; right: 12px; top: 74px; min-width: 0; width: auto; }
/* Keep pagination and the details link in non-overlapping flow; wrap on small cards. */
.tcg-mi-dotsrow {
  position: relative;
  margin-top: 2px;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px 12px;
  flex-wrap: wrap;
}
.tcg-mi-dotsrow .tcg-mi-dots { margin: 0; }
.tcg-mi-dotsrow > .tcg-mi-detail-btn { position: static; transform: none; }
.tcg-mi-detail-btn {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 12.5px;
  line-height: 1;
  color: #e8eaed !important;
  text-decoration: none !important;
  white-space: nowrap;
}
.tcg-mi-detail-btn:hover { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.3); }
/* V2.32.2：國名區塊原有 width:100% 會吃滿整行、把徽章硬擠到下一行 → 收回為內容寬 */
.tcg-mi-card-header .tcg-mi-card-country { width: auto; flex: 0 1 auto; }
/* V2.32.2 定案（覆蓋上方 V2.32.1 的整排 flex 嘗試）：
   徽章掛進國名行盒 .tcg-mi-name-row —— 同行放得下就同行、放不下自動換行到名下靠左。
   header 回歸直欄佈局；padding-right 讓出右上角釘選鈕。 */
.tcg-mi-card-header {
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 9px;
  padding-right: 30px;
}
.tcg-mi-name-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tcg-mi-name-row .tcg-mi-card-name-zh { margin: 0; }
.tcg-mi-name-row .tcg-mi-status { padding: 3px 8px; font-size: 12px; }
/* V2.32.3 定稿（Andy 2026-07-24 第二版設計圖）：國名靠左、徽章靠右對齊同一行；
   放不下時徽章仍自動換行到名下靠左。釘選鈕縮小並貼齊正右上角（紅圈位置）。 */
.tcg-mi-card-header { padding-right: 0; margin-top: 8px; }
.tcg-mi-card-header .tcg-mi-card-country { width: 100%; }
.tcg-mi-card-country-text { flex: 1 1 auto; min-width: 0; }
.tcg-mi-name-row { width: 100%; justify-content: space-between; }
.tcg-mi-card > .tcg-mi-pin { top: 4px; right: 4px; width: 30px; height: 30px; }

/* ============ V2.33（v1.50.0）：釘選鈕騎角＋詳情抽屜 ============ */
/* 釘選鈕壓在卡片右上「邊角」上（半內半外，Andy 效果圖紅圈位置） */
.tcg-mi-card > .tcg-mi-pin { top: -11px; right: -11px; }

/* 詳情抽屜：右側滑出、背景模糊變暗；內容為 /market/xx/ 的 .tcg-cp-page（無導航無 footer） */
.tcg-mi-drawer-backdrop {
  position: fixed; inset: 0; z-index: 99998;
  background: rgba(0,0,0,.55);
  -webkit-backdrop-filter: blur(13px); backdrop-filter: blur(13px); /* V2.33.2 Andy 指定 13px */
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
body.tcg-mi-drawer-open .tcg-mi-drawer-backdrop { opacity: 1; pointer-events: auto; }
.tcg-mi-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 99999;
  width: min(760px, 94vw);
  background: #0d1117;
  box-shadow: -12px 0 40px rgba(0,0,0,.6);
  transform: translateX(102%);
  transition: transform .3s cubic-bezier(.2,.8,.25,1);
  display: flex; flex-direction: column;
}
.tcg-mi-drawer[hidden], .tcg-mi-drawer-backdrop[hidden] { display: none !important; }
.tcg-mi-drawer :focus-visible { outline: 2px solid #ff766b; outline-offset: 3px; }
body.tcg-mi-drawer-open .tcg-mi-drawer { transform: translateX(0); }
body.tcg-mi-drawer-open { overflow: hidden; }
.tcg-mi-drawer-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px; flex: 0 0 auto;
  background: #161b22; border-bottom: 1px solid rgba(255,255,255,.1);
}
.tcg-mi-drawer-bar button, .tcg-mi-drawer-bar a {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px; padding: 7px 14px; font-size: 12.5px; line-height: 1;
  color: #e8eaed !important; cursor: pointer; text-decoration: none !important;
}
.tcg-mi-drawer-bar button:hover, .tcg-mi-drawer-bar a:hover { background: rgba(255,255,255,.16); }
.tcg-mi-drawer-body { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.tcg-mi-drawer-body .tcg-cp-page { padding: 10px 0 40px; }
.tcg-mi-drawer-loading { color: rgba(255,255,255,.6); text-align: center; padding: 60px 20px; font-size: 14px; }
.tcg-mi-drawer-toast {
  position: fixed; z-index: 100000; bottom: 24px; right: 24px;
  background: #3fb950; color: #fff; padding: 9px 16px; border-radius: 8px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .3s;
}
.tcg-mi-drawer-toast.is-on { opacity: 1; }

/* Desktop-only comparison. Single drawer/country pages retain their exact rules.
 * FLIP runs on the outer wrapper; scroll depth transforms only the inner card. */
.tcg-mi-month-guides { display: none; }
.tcg-mi-source-compact { display: none; }
@media (min-width: 1280px) {
  .tcg-mi-drawer .tcg-mi-source-full { display: none; }
  .tcg-mi-drawer .tcg-mi-source-compact { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; font-size: 11px; line-height: 1.6; }
  .tcg-mi-drawer .tcg-mi-source-compact > span { white-space: nowrap; }
  .tcg-mi-drawer .tcg-cp-badges > .tcg-cp-badge:not(.tcg-cp-badge-status) { display: none; }
  /* Guides follow the existing month labels and plot bounds, never the values. */
  .tcg-mi-drawer .tcg-mi-month-guides { display: inline; pointer-events: none; }
  .tcg-mi-drawer .tcg-mi-month-guide { stroke: rgba(255,255,255,.24); stroke-width: 1; stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; fill: none; }
  .tcg-mi-drawer [hidden] { display: none !important; }
  .tcg-mi-pinbar .tcg-mi-compare-open:disabled { opacity: .5; cursor: not-allowed; }
  .tcg-mi-drawer { transition: transform .3s cubic-bezier(.2,.8,.2,1), width .3s cubic-bezier(.2,.8,.2,1); }
  .tcg-mi-drawer.tcg-mi-drawer-has-dock { width: min(760px, calc(100vw - 236px)); }
  .tcg-mi-drawer.tcg-mi-drawer-dual { width: min(1520px, calc(100vw - 236px)); }
  .tcg-mi-drawer-dual > .tcg-mi-drawer-body { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); position: relative; overflow: hidden; min-height: 0; }
  .tcg-mi-compare-pane { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
  .tcg-mi-compare-pane + .tcg-mi-compare-pane { border-left: 1px solid rgba(255,255,255,.16); }
  .tcg-mi-compare-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  .tcg-mi-compare-pane-head { flex: 0 0 48px; box-sizing: border-box; display: flex; align-items: center; gap: 7px; padding: 6px 12px; background: #161b22; border-bottom: 1px solid rgba(255,255,255,.1); color: #e8eaed; font-size: 13px; min-width: 0; }
  .tcg-mi-compare-pane:first-child .tcg-mi-compare-pane-head { padding-right: 32px; }
  .tcg-mi-compare-pane:nth-child(2) .tcg-mi-compare-pane-head { padding-left: 32px; }
  .tcg-mi-compare-pane-head img { width: 25px; height: 25px; border-radius: 50%; object-fit: cover; flex: none; }
  .tcg-mi-compare-pane-head strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tcg-mi-compare-side { font-size: 11px; color: #ffb4ab; flex: none; }
  .tcg-mi-compare-pane-head > .tcg-mi-compare-side { box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; padding: 3px 7px; border: 1px solid #5e6673; border-radius: 6px; color: #d0d5dd; line-height: 1.3; white-space: nowrap; }
  .tcg-mi-compare-pane[data-slot="1"] .tcg-mi-compare-pane-head > .tcg-mi-compare-side { border-color: #9b4942; color: #ffc2bb; }
  .tcg-mi-compare-en-name { color: #a5aebc; font-size: 11px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tcg-mi-compare-pane-head button, .tcg-mi-compare-swap, .tcg-mi-compare-retry { font: inherit; color: #e8eaed; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.06); border-radius: 8px; padding: 5px 7px; cursor: pointer; flex: none; }
  .tcg-mi-compare-pane-head button:hover, .tcg-mi-compare-swap:hover, .tcg-mi-compare-retry:hover { background: rgba(255,255,255,.16); }
  .tcg-mi-compare-pane-head .tcg-mi-compare-open-country,
  .tcg-mi-compare-pane-head .tcg-mi-compare-close-country { box-sizing: border-box; height: 32px; min-height: 32px; display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
  .tcg-mi-compare-pane-head .tcg-mi-compare-open-country { padding: 0 10px; border-radius: 999px !important; }
  .tcg-mi-compare-pane-head .tcg-mi-compare-close-country { width: 32px; flex: 0 0 32px; padding: 0; border-radius: 50% !important; }
  .tcg-mi-compare-pane-head .tcg-mi-compare-close-country:hover,
  .tcg-mi-compare-pane-head .tcg-mi-compare-close-country:focus-visible { background: #da2a21; border-color: #f06b61; color: #fff; }
  .tcg-mi-compare-tools { display: flex; align-items: center; gap: 10px; flex: 1; flex-wrap: wrap; }
  .tcg-mi-compare-jumps { display: flex; align-items: center; gap: 3px; padding-left: 10px; border-left: 1px solid rgba(255,255,255,.13); }
  .tcg-mi-compare-settings { display: flex; align-items: center; gap: 7px; margin-left: auto; }
  .tcg-mi-drawer-dual > .tcg-mi-drawer-bar { flex-wrap: wrap; gap: 6px; padding: 9px 12px; }
  .tcg-mi-drawer-dual > .tcg-mi-drawer-bar button { font-size: 11.5px; padding: 7px 9px; }
  .tcg-mi-compare-jump-label { color: #a5aebc; font-size: 12px; }
  .tcg-mi-drawer-dual .tcg-mi-compare-jump { border: 0; border-radius: 0 !important; background: transparent; color: #c5ccd7; box-shadow: none; }
  .tcg-mi-drawer-dual .tcg-mi-compare-jump:hover { background: transparent !important; color: #fff !important; box-shadow: none !important; text-decoration: underline; text-decoration-color: #f2675b; text-underline-offset: 5px; }
  .tcg-mi-compare-toggle { position: relative; box-sizing: border-box; display: inline-flex; align-items: center; gap: 7px; min-height: 30px; margin: 0; padding: 5px 9px; border: 1px solid rgba(255,255,255,.12); border-radius: 16px; color: #d5dce6; background: rgba(255,255,255,.025); font-size: 11.5px; font-weight: 500; line-height: 1.3; cursor: pointer; white-space: nowrap; }
  .tcg-mi-compare-toggle:hover { border-color: rgba(255,255,255,.3); background: rgba(255,255,255,.055); }
  /* Salient applies checked-control colors and global 200px button corners.
     Keep this override inside the desktop comparison scope only. */
  .tcg-mi-compare-toggle > span { color: inherit !important; }
  .tcg-mi-compare-toggle > input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; opacity: 0; cursor: pointer; }
  .tcg-mi-compare-toggle-track { position: relative; display: inline-block; width: 30px; height: 16px; flex: 0 0 30px; border-radius: 999px; background: #414852; transition: background-color .15s; }
  .tcg-mi-compare-toggle-track::after { content: ''; position: absolute; left: 2px; top: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff; transition: transform .15s; }
  .tcg-mi-compare-sync:checked + .tcg-mi-compare-toggle-track { background: #2f8a57; }
  .tcg-mi-compare-diff:checked + .tcg-mi-compare-toggle-track { background: #a07c1c; }
  .tcg-mi-compare-toggle > input:checked + .tcg-mi-compare-toggle-track::after { transform: translateX(14px); }
  .tcg-mi-compare-toggle > input:focus-visible + .tcg-mi-compare-toggle-track { outline: 2px solid #ffb454; outline-offset: 3px; }
  .tcg-mi-compare-swatch { display: inline-block; width: 10px; height: 10px; border: 1px solid #d3a436; border-radius: 3px; background: rgba(255,197,61,.22); }
  .tcg-mi-compare-swap { position: absolute; top: 9px; left: 50%; z-index: 3; transform: translateX(-50%); width: 30px; height: 30px; border-radius: 50%; padding: 0; background: #28313f; }
  .tcg-mi-compare-dock button { font: inherit; cursor: pointer; text-align: center; box-shadow: none; }
  .tcg-mi-compare-dock button:focus-visible, .tcg-mi-drawer button:focus-visible { outline: 2px solid #ffb454; outline-offset: 2px; }
.tcg-mi-compare-dock { position: absolute; right: calc(100% + 14px); top: 0; bottom: 24px; width: 204px; display: flex; flex-direction: column; gap: 10px; color: #e8eaed; font: 12px/1.4 -apple-system,system-ui,sans-serif; }

/* 標題列（對齊見第 6 節） */
.tcg-mi-compare-dock-head { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 4px;
  height: calc(var(--tcg-mi-dock-label-y, 26px) * 2);
  margin-bottom: calc(var(--tcg-mi-dock-head, 52px) - var(--tcg-mi-dock-label-y, 26px) * 2 - 10px); }
.tcg-mi-compare-dock-label { font-size: 12.5px; font-weight: 600; color: #e8eaed; letter-spacing: .04em; }
.tcg-mi-compare-layout-caption { font-size: 11px; color: #8d96a5; }

/* 小地圖 */
.tcg-mi-compare-viewing { flex: none; display: grid; grid-template-columns: minmax(0,1fr); gap: 4px; padding: 4px; border: 1px solid #2f3540; border-radius: 12px; background: #11151b; box-shadow: 0 8px 20px rgba(0,0,0,.45); }
.tcg-mi-compare-viewing[data-cols="2"] { grid-template-columns: repeat(2, minmax(0,1fr)); }

/* 格子 */
.tcg-mi-compare-current { position: relative; box-sizing: border-box; min-width: 0; min-height: 96px; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 6px 8px; border: 1.5px solid transparent; border-radius: 9px; background: #1a2028; transition: background-color .15s ease, border-color .15s ease; }
.tcg-mi-compare-current img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex: none; }
.tcg-mi-compare-slot-cap { font-size: 10px; color: #8d96a5; }
.tcg-mi-compare-slot-name { max-width: 100%; font-size: 12.5px; font-weight: 600; color: #e8eaed; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 單欄：精簡一列 */
.tcg-mi-compare-current[data-compact="true"] { flex-direction: row; justify-content: flex-start; min-height: 48px; padding: 0 10px 0 12px; gap: 9px; }
.tcg-mi-compare-current[data-compact="true"] .tcg-mi-compare-slot-cap { display: none; }
.tcg-mi-compare-current[data-compact="true"] img,
.tcg-mi-compare-current[data-compact="true"] .tcg-mi-compare-slot-plus { width: 26px; height: 26px; }
.tcg-mi-compare-current[data-compact="true"] .tcg-mi-compare-slot-name { flex: 1; min-width: 0; text-align: left; font-size: 13.5px; }
.tcg-mi-compare-current[data-compact="true"][data-state="idle"] { box-shadow: inset 3px 0 0 #e2231a; }
/* 預覽狀態 */
.tcg-mi-compare-current[data-state="focus"] { border-color: rgba(255,107,94,.7); background: rgba(218,42,33,.10); }
.tcg-mi-compare-current[data-state="replace"],
.tcg-mi-compare-current[data-state="add"] { border-style: dashed; border-color: rgba(255,107,94,.85); background: rgba(218,42,33,.13); }
.tcg-mi-compare-current[data-state="close"] { border-style: dashed; border-color: rgba(255,107,94,.85); background: rgba(5,7,10,.45); }
.tcg-mi-compare-current:not([data-state="idle"]) .tcg-mi-compare-slot-cap,
.tcg-mi-compare-current[data-state="replace"] .tcg-mi-compare-slot-name,
.tcg-mi-compare-current[data-state="close"] .tcg-mi-compare-slot-name,
.tcg-mi-compare-current[data-state="add"] .tcg-mi-compare-slot-name { color: #ffb7b0; }
.tcg-mi-compare-current[data-state="close"] .tcg-mi-compare-slot-name { opacity: .5; }
.tcg-mi-compare-current[data-state="replace"] img,
.tcg-mi-compare-current[data-state="close"] img { opacity: .35; }
/* add 預覽的臨時格「＋」圓圈 */
.tcg-mi-compare-slot-plus { box-sizing: border-box; width: 30px; height: 30px; flex: none; border-radius: 50%; border: 1px dashed #4a515c; color: #8d96a5; display: inline-flex; align-items: center; justify-content: center; }

/* ✕ 取消對比（改成圖示鈕，hover 變紅） */
.tcg-mi-compare-dock .tcg-mi-compare-remove { position: absolute; right: 3px; top: 3px; box-sizing: border-box; width: 22px; height: 22px; margin: 0; padding: 0; border: 0; border-radius: 50% !important; background: transparent; color: #8d96a5; display: flex; align-items: center; justify-content: center; transition: background-color .12s ease, color .12s ease; }
.tcg-mi-compare-dock .tcg-mi-compare-remove:hover,
.tcg-mi-compare-dock .tcg-mi-compare-remove:focus-visible { background: #da2a21; color: #fff; }

/* 分隔線 */
.tcg-mi-compare-dock-divider { flex: 0 0 1px; margin: 4px 2px; background: linear-gradient(90deg,transparent,rgba(255,255,255,.3),transparent); }

/* 其他钉选 標題＋圖例 */
.tcg-mi-compare-other-head { flex: none; display: flex; justify-content: space-between; align-items: center; padding: 0 4px; font-size: 11px; color: #c9d0da; }
.tcg-mi-compare-legend { display: inline-flex; align-items: center; gap: 4px; color: #8d96a5; }

/* 清單 */
.tcg-mi-compare-other-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; overscroll-behavior: contain; padding: 2px 2px 8px; }
.tcg-mi-compare-card-wrap { margin-bottom: 2px; }
.tcg-mi-compare-card { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 4px 0 8px; border: 0; border-radius: 10px; background: transparent; box-shadow: none; }
.tcg-mi-compare-card:hover { background: rgba(255,255,255,.06); border-color: transparent; box-shadow: none; }
.tcg-mi-compare-card img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; flex: none; }
.tcg-mi-compare-card .tcg-mi-compare-name { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal; }
.tcg-mi-compare-card .tcg-mi-compare-reading { flex: none; margin-right: 4px; }
.tcg-mi-compare-card .tcg-mi-compare-score { font-size: 13px; font-weight: 700; }
/* 現有 data-band 配色規則保留：hot #ff5a4d / warm #ffb454 / cold #53caff */

/* ◧ 放到左 / ◨ 放到右 */
.tcg-mi-compare-dock .tcg-mi-compare-side { flex: 0 0 28px; box-sizing: border-box; width: 28px; height: 28px; margin: 0; padding: 0; border: 1px solid #343b46; border-radius: 8px !important; background: transparent; color: #8d96a5; display: inline-flex; align-items: center; justify-content: center; transition: background-color .12s ease, border-color .12s ease, color .12s ease; }
.tcg-mi-compare-dock .tcg-mi-compare-side:hover,
.tcg-mi-compare-dock .tcg-mi-compare-side:focus-visible { border-color: rgba(255,120,110,.6); background: rgba(218,42,33,.18); color: #ffb7b0; }

/* 空狀態、底部留白 */
.tcg-mi-compare-hint { padding: 12px 10px; border: 1px dashed #4a515c; border-radius: 12px; color: #c4cad3; text-align: center; line-height: 1.6; background: rgba(12,15,19,.85); }
.tcg-mi-compare-dock-spacer { height: 22vh; }

/* 預覽遮罩（掛在 drawer，位置由 JS 算） */
.tcg-mi-compare-peek { position: absolute; z-index: 6; pointer-events: none; box-sizing: border-box; display: flex; align-items: flex-start; justify-content: center; padding-top: 96px; border: 2px solid rgba(255,107,94,.7); background: rgba(218,42,33,.05); }
.tcg-mi-compare-peek[hidden] { display: none; }
.tcg-mi-compare-peek[data-kind="replace"] { border-style: dashed; border-color: rgba(255,107,94,.75); background: rgba(218,42,33,.08); }
.tcg-mi-compare-peek[data-kind="close"] { border-style: dashed; border-color: rgba(255,107,94,.75); background: rgba(5,7,10,.55); }
.tcg-mi-compare-peek[data-kind="add"] { border-style: dashed; border-color: rgba(255,107,94,.75); background: linear-gradient(90deg, rgba(12,15,19,.2), rgba(218,42,33,.12)); }
.tcg-mi-compare-peek-pill { padding: 7px 16px; border-radius: 999px; background: #da2a21; color: #fff; font-size: 13.5px; font-weight: 600; white-space: nowrap; box-shadow: 0 8px 20px rgba(0,0,0,.45); }
.tcg-mi-compare-peek[data-kind="close"] .tcg-mi-compare-peek-pill { background: #b9221a; }
.tcg-mi-compare-peek-pill:empty { display: none; }

  .tcg-mi-compare-reading[data-band="hot"] .tcg-mi-compare-score { color: #ff5a4d; }
  .tcg-mi-compare-reading[data-band="warm"] .tcg-mi-compare-score { color: #ffb454; }
  .tcg-mi-compare-reading[data-band="cold"] .tcg-mi-compare-score { color: #53caff; }
  .tcg-mi-drawer-dual .tcg-mi-compare-highlight { background: rgba(255,197,61,.13); box-shadow: inset 0 0 0 1px rgba(255,197,61,.65); border-radius: 5px; }
  .tcg-mi-drawer-dual .tcg-mi-compare-delta { display: table; margin-top: 9px; padding: 4px 7px; border: 1px solid #bd943a; background: rgba(255,197,61,.11); border-radius: 6px; font-size: 12px; line-height: 1.4; color: #f2cc73; }
  /* All compact content rules require BOTH desktop and the dual-state class. */
  .tcg-mi-drawer-dual .tcg-cp-wrap { max-width: none; padding: 0 20px; min-width: 0; }
  .tcg-mi-drawer-dual .tcg-cp-kpis { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .tcg-mi-drawer-dual .tcg-cp-kpi:last-child { grid-column: 1 / -1; }
  .tcg-mi-drawer-dual .tcg-cp-kpi { min-width: 0; padding: 14px; }
  .tcg-mi-drawer-dual .tcg-cp-kpi-big { overflow-wrap: anywhere; }
  .tcg-mi-drawer-dual .tcg-cp-sec { min-width: 0; padding: 18px; }
  .tcg-mi-drawer-dual .tcg-cp-dims { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px 16px; }
  /* Keep equal text insets with differences on or off; no layout shift on toggle. */
  .tcg-mi-drawer-dual .tcg-cp-dim { gap: 10px; min-width: 0; padding: 7px 10px; box-sizing: border-box; }
  /* Remove the legacy 640px cap in compact panes; every cell keeps the same
     inset whether its own value or the entire policy row is highlighted. */
  .tcg-mi-drawer-dual .tcg-regulation-detail .tcg-cp-regs { max-width: none; width: 100%; min-width: 0; }
  .tcg-mi-drawer-dual .tcg-regulation-detail .tcg-cp-reg > * { min-width: 0; padding: 3px 10px; box-sizing: border-box; }
  .tcg-mi-drawer-dual .tcg-regulation-detail .tcg-mi-compare-policy-row { grid-template-columns: max-content minmax(0,1fr); }
  .tcg-mi-drawer-dual .tcg-regulation-detail .tcg-mi-compare-policy-row > :first-child { white-space: nowrap; }
  .tcg-mi-drawer-dual .tcg-regulation-detail .tcg-mi-policy-item { padding: 3px 10px; }
  .tcg-mi-drawer-dual .tcg-cp-badge { white-space: normal; }
  .tcg-mi-drawer-dual .tcg-cp-ud { grid-template-columns: minmax(0,1fr); }
  .tcg-mi-drawer-dual .tcg-cp-td-vol { flex-basis: 90px; font-size: 12px; }
  .tcg-mi-drawer-dual .tcg-cp-td-cat { flex-basis: 64px; }
  .tcg-mi-drawer-dual .tcg-cp-td-cat i { white-space: normal; padding: 1px 4px; }
  .tcg-mi-drawer-dual .tcg-cp-h1 { overflow-wrap: anywhere; }
  @supports (animation-timeline: view()) {
    .tcg-mi-compare-card { animation: tcg-mi-compare-depth linear both; animation-timeline: view(); animation-range: cover 0% cover 38%; }
  }
  @keyframes tcg-mi-compare-depth {
    from { transform: scale(.84); filter: blur(3.5px) brightness(.45); opacity: .4; }
    to { transform: scale(1); filter: blur(0) brightness(1); opacity: 1; }
  }
  @media (prefers-reduced-motion: reduce) {
    .tcg-mi-drawer, .tcg-mi-drawer-backdrop { transition: none !important; }
    .tcg-mi-compare-current, .tcg-mi-compare-dock button, .tcg-mi-compare-card { transition: none !important; }
    .tcg-mi-compare-toggle-track, .tcg-mi-compare-toggle-track::after { transition: none !important; }
    .tcg-mi-compare-card { animation: none !important; transform: none !important; filter: none !important; opacity: 1 !important; }
  }
}
/* V2.33.1：徽章沒貼右緣的元兇＝ .tcg-mi-card-country 原始樣式的 padding-right:54px
   （老佈局留給右上角徽章的預留位）→ 歸零，徽章貼齊卡片內容右緣 */
.tcg-mi-card-header .tcg-mi-card-country { padding-right: 0; }

/* ============================================================
   V2.37 關鍵字 → Wiki 連結（2026-07-27）
   關鍵字本身照舊，只加虛線底線與小圖示；hover 才出氣泡。
   ============================================================ */
.tcg-mi-kw-wiki{
  color:inherit; text-decoration:none;
  border-bottom:1px dashed rgba(255,255,255,.38);
  cursor:pointer;
}
.tcg-mi-kw-wiki:hover{ border-bottom-color:#ffb454; color:#ffd08a; }
.tcg-mi-kw-ico{ font-size:.82em; margin-left:3px; opacity:.55; }
.tcg-mi-kw-wiki:hover .tcg-mi-kw-ico{ opacity:1; }

/* 英文版把標題的中文那半藏起來（翻譯做完前先有正確效果） */
html[lang^="en"] .tcg-wiki-sub{ display:none; }

#tcg-wiki-tips{ display:none; }

.tcg-wiki-pop{
  position:fixed; z-index:100050; width:290px; max-width:calc(100vw - 24px);
  background:#161b22; border:1px solid rgba(255,255,255,.14); border-radius:10px;
  box-shadow:0 12px 34px rgba(0,0,0,.55); padding:13px 15px;
  color:#e6edf3; font-size:13px; line-height:1.62;
  opacity:0; transform:translateY(4px); transition:opacity .14s ease, transform .14s ease;
  pointer-events:none;
}
.tcg-wiki-pop.on{ opacity:1; transform:translateY(0); pointer-events:auto; }
.tcg-wiki-pop b{ display:block; font-size:14px; color:#fff; margin-bottom:6px; }
.tcg-wiki-pop .tcg-wiki-sub{ color:#9aa4b2; font-weight:400; }
.tcg-wiki-pop p{ margin:0 0 11px; color:#c4ccd6; }
.tcg-wiki-pop .tcg-wiki-go{
  display:inline-block; background:#ffb454; color:#161b22; font-weight:600;
  padding:6px 13px; border-radius:6px; text-decoration:none; font-size:12.5px;
}
.tcg-wiki-pop .tcg-wiki-go:hover{ background:#ffc978; }

/* V2.41（v1.60.7）：手機卡片保留單行溫度標題，不改外層卡片欄寬。 */
@media (max-width:640px) {
  .tcg-mi-card {
    -webkit-backdrop-filter: blur(12px) saturate(135%);
    backdrop-filter: blur(12px) saturate(135%);
  }
  .tcg-mi-score-split,
  .tcg-mi-slide-dims { gap:4px; }
  .tcg-mi-score-cap { font-size:12px; }
  .tcg-mi-dims { font-size:13px; }
  .tcg-mi-dim-row { gap:6px; }

  /* v1.71.2 手機卡片字級：標記 12px、輔助說明 13px、內容 14px。 */
  .tcg-mi-mini-vs,
  .tcg-mi-rank-ends,
  .tcg-mi-slide .tcg-mi-article-date { font-size:12px; }
  .tcg-mi-name-row .tcg-mi-status,
  .tcg-mi-card-name-en,
  .tcg-mi-score-temp > .tcg-mi-card-score-label,
  .tcg-mi-rank-tier,
  .tcg-mi-rank-nb,
  .tcg-mi-card-meta,
  .tcg-mi-reg-tip-foot,
  .tcg-mi-tooltip-brand { font-size:13px; }
  .tcg-mi-trend,
  .tcg-mi-rank-total,
  .tcg-mi-detail-btn,
  .tcg-mi-reg,
  .tcg-mi-reg strong,
  .tcg-mi-reg-tip-head,
  .tcg-mi-reg-tip-row,
  .tcg-mi-article,
  .tcg-mi-tooltip-action { font-size:14px; }
  .tcg-mi-trend-sub2 { font-size:12.5px; line-height:1.5; }
  .tcg-mi-card-note { font-size:14px; line-height:1.6; }
  /* 字變大後，「玩家在关注什么」「全球排位」兩頁原本的 192px 放不下，手機上加高到 224px。 */
  .tcg-mi-slide,
  .tcg-mi-slide-demand { height:224px; }
}

@media (prefers-reduced-transparency: reduce) {
  .tcg-mi-card {
    background: linear-gradient(180deg, rgb(31,35,48), rgb(15,18,27));
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

@media (max-width:768px){ .tcg-wiki-pop{ width:calc(100vw - 32px); } }
