/* ============================================================================
   css/v2-learn.css — 喵星補習社 MeowLab V2 學習首頁（PR-V2-02）
   載入順序喺 v2-shell.css 之後。範圍只限 #view-learn：
   科目膠囊、知識技能卡（灰／練習中／銅／銀／全息金＋擦亮）、
   今日升級任務面板（桌面右欄）、七日值日貓打卡列。
   顏色／圓角／陰影一律用 tokens-v2.css 變量，唔另立色碼。
   ============================================================================ */

/* ---------- 版面：手機直落（DOM 次序＝英雄→技能→今日→打卡→功能）；≥1024 雙欄 ---------- */
@media (min-width: 1024px) {
  /* 學習首頁自帶右欄（今日任務面板），唔再借 PR-07 浮動 Deck 嗰 316px：
     Deck 只喺 learn 路由隱藏，其他路由（小鎮上層）行為不變 */
  #view-learn { right: 0; }
  body[data-route="learn"] #today-deck { display: none; }
  #view-learn .v2-view-inner { max-width: 1180px; }
  .v2-learn-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 308px;
    align-items: start;
  }
  .v2-learn-layout .learn-slot-hero,
  .v2-learn-layout .learn-slot-wide { grid-column: 1 / -1; }
  .v2-learn-layout .learn-today-card { position: sticky; top: 84px; }
}

/* ---------- 科目膠囊 ---------- */
.learn-main-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  flex-wrap: wrap; margin-bottom: 12px;
}
.learn-main-head .v2-card-title { margin-bottom: 0; }
.learn-grade-label { font-size: var(--fs-tag); font-weight: 700; color: var(--text-secondary); white-space: nowrap; }

.learn-capsules { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.learn-capsule {
  min-height: 48px; padding: 10px 22px;
  background: var(--surface-card); border: 1px solid var(--border-soft);
  border-radius: var(--radius-btn); box-shadow: var(--shadow-bento);
  color: var(--text-secondary); font: inherit; font-size: 16px; font-weight: 800;
  cursor: pointer; white-space: nowrap;
}
.learn-capsule:active { background: var(--brand-mint-soft); }
.learn-capsule.is-active {
  background: var(--brand-emerald); border-color: var(--brand-emerald);
  color: #fff; box-shadow: 0 8px 20px rgba(11, 138, 106, 0.28);
}

/* ---------- 知識技能卡：直身 3:4 全息收藏閃卡（PR-UI-HoloCard） ---------- */
.learn-skill-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 16px;
}
@media (max-width: 767px) {
  .learn-skill-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}

.learn-card-wrap { display: flex; flex-direction: column; min-width: 0; }

/* ---------- v3 精雕典藏技能卡（PR-V2-W1 v3 補完，IVAN 親自拍板）：6 層結構 ----------
   ① 外層立體厚卡磚 .learn-holo-card（漸變金屬邊框＋底唇；金卡 goldRim 流動）
   ② 內卡身 .holo-body（徑向深淺對比金屬面）
   ③ 八角雙線內框 .holo-arch-svg（內嵌 SVG，viewBox 210×290 拉伸滿版）
   ④ 頂部皇冠垂章 .holo-crest-tab（緊貼卡頂中央向下垂出）
   ⑤ 徽章舞台 .holo-emblem：星軌光環 .holo-halo-svg＋凹陷金屬盤 .holo-dish＋破框貓 .holo-cat-pop
   ⑥ 底部象牙銘牌 .holo-plaque＋克制珠光 .holo-foil-sweep／.holo-foil-spot
   進度組 .holo-prog 續外置於卡底正下方 8px（見下方 PR-V2-W1 節） */
.learn-holo-card {
  position: relative;
  aspect-ratio: 3 / 4; width: 100%;
  display: flex; flex-direction: column; align-items: stretch; padding: 3.5px;
  border: none; border-radius: 22px;
  font: inherit; color: var(--text-primary); cursor: pointer;
  background: linear-gradient(155deg, #F1F5F9 0%, #CBD5E1 60%, #A8B8C8 100%);
  box-shadow: 0 4px 0 #94A3B8, 0 12px 24px -8px rgba(100, 116, 139, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.learn-holo-card:hover { transform: translateY(-2px); }
.learn-holo-card:active { transform: translateY(0); }
/* 翡翠邊框：練習中（規格一.1） */
.learn-holo-card.tier-started {
  background: linear-gradient(155deg, #10A37E 0%, #0B8A6A 100%);
  box-shadow: 0 4px 0 #07664E, 0 12px 24px -6px rgba(11, 138, 106, 0.20);
}
/* 翡翠邊框＋外圈：推薦待挑戰 */
.learn-holo-card.tier-grey.is-recommended,
.learn-holo-card.tier-started.is-recommended {
  background: linear-gradient(155deg, #10A37E 0%, #0B8A6A 100%);
  box-shadow: 0 0 0 2px var(--brand-emerald), 0 4px 0 #07664E, 0 12px 24px -6px rgba(11, 138, 106, 0.20);
}
.learn-holo-card.tier-bronze {
  background: linear-gradient(140deg, #FFEBD2 0%, #D48E52 24%, #6D3710 52%, #F4C392 78%, #8F4D1B 100%);
  box-shadow: 0 5px 0 #66320E, 0 16px 30px -6px rgba(115, 58, 18, 0.36);
}
.learn-holo-card.tier-silver {
  background: linear-gradient(140deg, #FFFFFF 0%, #B8CBE0 22%, #5F748D 48%, #F4F9FF 72%, #839AB5 100%);
  box-shadow: 0 5px 0 #4B5F76, 0 16px 32px -6px rgba(45, 65, 92, 0.36);
}
.learn-holo-card.tier-gold {
  background: linear-gradient(135deg, #FFFDE8 0%, #F7C948 20%, #9E5E06 46%, #FFF3AD 68%, #D98E10 88%, #FFF8C8 100%);
  background-size: 200% 200%;
  animation: goldRim 6s ease-in-out infinite;
  box-shadow: 0 5px 0 #824B02, 0 18px 36px -6px rgba(188, 122, 8, 0.48);
}
@keyframes goldRim {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
/* 推薦＋金屬級並存（防禦性，現行推薦邏輯只指向 <60% 單元）：翡翠外圈＋該級金屬底唇／投影 */
.learn-holo-card.tier-bronze.is-recommended { box-shadow: 0 0 0 2px var(--brand-emerald), 0 5px 0 #66320E, 0 16px 30px -6px rgba(115, 58, 18, 0.36); }
.learn-holo-card.tier-silver.is-recommended { box-shadow: 0 0 0 2px var(--brand-emerald), 0 5px 0 #4B5F76, 0 16px 32px -6px rgba(45, 65, 92, 0.36); }
.learn-holo-card.tier-gold.is-recommended { box-shadow: 0 0 0 2px var(--brand-emerald), 0 5px 0 #824B02, 0 18px 36px -6px rgba(188, 122, 8, 0.48); }

/* ② 內卡身：深淺對比金屬面 */
.holo-body {
  position: relative; flex: 1 1 auto; min-width: 0; min-height: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  border-radius: 18.5px; padding: 0 10px 11px; overflow: hidden;
  background: radial-gradient(circle at 50% 40%, #FFFFFF 0%, #F2F6FA 62%, #E3ECF3 100%);
}
.tier-started .holo-body { background: radial-gradient(circle at 50% 40%, #FFFFFF 0%, #EAF7F1 55%, #CFEBDD 100%); }
.tier-bronze .holo-body { background: radial-gradient(circle at 50% 40%, #FFF2E0 0%, #E7B27F 38%, #B46A32 76%, #7D3F14 100%); }
.tier-silver .holo-body { background: radial-gradient(circle at 50% 40%, #FFFFFF 0%, #DFEAF5 36%, #9FB5CE 74%, #6C839E 100%); }
.tier-gold .holo-body { background: radial-gradient(circle at 50% 40%, #FFFDF0 0%, #FCE277 36%, #DB9A1A 74%, #9E5D04 100%); }

/* ③ 八角切角精雕雙線內框（SVG 拉伸滿版；線色跟級別色溫，non-scaling-stroke 保線寬均勻） */
.holo-arch-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.holo-arch-svg .arch-line { fill: none; stroke: rgba(100, 116, 139, 0.45); }
.holo-arch-svg .arch-outer { stroke-width: 1.4; }
.holo-arch-svg .arch-inner { stroke-width: 1; opacity: 0.65; }
.holo-arch-svg .arch-tick { stroke-width: 1.1; opacity: 0.8; }
.holo-arch-svg .arch-diamond { stroke: none; }
.tier-started .holo-arch-svg .arch-line { stroke: rgba(11, 138, 106, 0.42); }
.tier-bronze .holo-arch-svg .arch-line { stroke: rgba(255, 240, 220, 0.80); }
.tier-bronze .holo-arch-svg .arch-diamond { fill: rgba(255, 240, 220, 0.85); }
.tier-silver .holo-arch-svg .arch-line { stroke: rgba(255, 255, 255, 0.88); }
.tier-silver .holo-arch-svg .arch-diamond { fill: rgba(255, 255, 255, 0.9); }
.tier-gold .holo-arch-svg .arch-line { stroke: rgba(255, 246, 190, 0.92); }
.tier-gold .holo-arch-svg .arch-diamond { fill: rgba(255, 246, 190, 0.95); }

/* ④ 頂部皇冠垂章 */
.holo-crest-tab {
  position: relative; z-index: 3; flex: none;
  padding: 5px 14px 6px; border-radius: 0 0 13px 13px;
  font-size: 11.5px; font-weight: 900; letter-spacing: 0.14em; white-space: nowrap;
  color: #fff; background: linear-gradient(180deg, #334155 0%, #1E293B 100%);
  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.25);
}
.holo-crest-tab.crest-rec,
.holo-crest-tab.crest-started { background: linear-gradient(180deg, #10A37E 0%, #0B8A6A 100%); }
.holo-crest-tab.crest-bronze { background: linear-gradient(180deg, #8B4513 0%, #5C2B08 100%); color: #FFE7C7; }
.holo-crest-tab.crest-silver {
  background: linear-gradient(180deg, #334155 0%, #1E293B 100%); color: #E2EEF9;
  border: 1px solid rgba(255, 255, 255, 0.65); border-top: none;
}
.holo-crest-tab.crest-gold {
  background: linear-gradient(180deg, #784200 0%, #4A2500 100%); color: #FFE98A;
  border: 1px solid rgba(247, 201, 72, 0.85); border-top: none;
}
/* 需擦亮膠囊：置右上角，唔同垂章重疊 */
.holo-polish {
  position: absolute; z-index: 6; top: 8px; right: 8px;
  font-size: 10.5px; font-weight: 900; letter-spacing: 0.04em; white-space: nowrap;
  padding: 3.5px 8px; border-radius: 999px;
  background: var(--wrong-trap-bg); color: var(--wrong-text);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.15);
}

/* ⑤ 徽章舞台：嚴禁 overflow:hidden，貓耳／頭頂自然破框 ~8% */
.holo-emblem {
  position: relative; z-index: 1; flex: none;
  width: 112px; height: 112px; margin: 6px 0;
  display: flex; align-items: center; justify-content: center;
}
@media (min-width: 820px) { .holo-emblem { width: 98px; height: 98px; } }
/* 背後星軌光環（viewBox 140，inset -14px 外溢舞台） */
.holo-halo-svg { position: absolute; inset: -14px; width: calc(100% + 28px); height: calc(100% + 28px); pointer-events: none; z-index: 0; }
.holo-halo-svg .halo-ring { fill: none; stroke-width: 1.2; }
.holo-halo-svg .halo-diamond { stroke: none; }
.tier-bronze .holo-halo-svg .halo-ring { stroke: rgba(141, 74, 26, 0.55); }
.tier-bronze .holo-halo-svg .halo-diamond { fill: rgba(141, 74, 26, 0.50); }
.tier-silver .holo-halo-svg { animation: slowSpin 52s linear infinite reverse; }
.tier-silver .holo-halo-svg .halo-ring { stroke: rgba(90, 115, 145, 0.55); }
.tier-silver .holo-halo-svg .halo-diamond { fill: rgba(90, 115, 145, 0.50); }
.tier-gold .holo-halo-svg { animation: slowSpin 38s linear infinite; }
.tier-gold .holo-halo-svg .halo-ring { stroke: rgba(160, 100, 10, 0.60); }
.tier-gold .holo-halo-svg .halo-diamond { fill: rgba(160, 100, 10, 0.55); }
@keyframes slowSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
/* 3D 凹陷金屬盤：沿用 5px 透明邊雙層漸變（padding-box 凹陷盤＋border-box 135° 斜角環） */
.holo-dish {
  position: relative; z-index: 1; flex: none;
  width: 104px; height: 104px; border-radius: 50%; padding: 4px; box-sizing: border-box;
  background: radial-gradient(circle at 35% 30%, #FFFFFF 0%, #EDF2F5 72%);
  border: 3px solid rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.14), 0 4px 10px rgba(0, 0, 0, 0.12);
}
@media (min-width: 820px) { .holo-dish { width: 90px; height: 90px; } }
.tier-bronze .holo-dish {
  border: 5px solid transparent;
  background: radial-gradient(circle at 32% 28%, #FCE9D6 0%, #E7B88E 55%, #C68552 100%) padding-box,
              linear-gradient(135deg, #FFF0DC 0%, #D99559 28%, #8F4E1E 62%, #F3C492 85%, #B56E35 100%) border-box;
  box-shadow: inset 0 4px 8px rgba(85, 42, 10, 0.32), inset 0 -2px 4px rgba(255, 240, 220, 0.45), 0 5px 12px rgba(120, 65, 20, 0.28);
}
.tier-silver .holo-dish {
  border: 5px solid transparent;
  background: radial-gradient(circle at 32% 28%, #FFFFFF 0%, #DCE4EE 55%, #B4C2D4 100%) padding-box,
              linear-gradient(135deg, #FFFFFF 0%, #C8D4E3 26%, #7C8EA6 58%, #EEF4FA 82%, #94A3B8 100%) border-box;
  box-shadow: inset 0 4px 8px rgba(30, 45, 70, 0.26), inset 0 -2px 4px rgba(255, 255, 255, 0.65), 0 5px 12px rgba(51, 65, 85, 0.24);
}
.tier-gold .holo-dish {
  border: 5px solid transparent;
  background: radial-gradient(circle at 32% 28%, #FFFDF0 0%, #FCE588 52%, #E5B232 100%) padding-box,
              linear-gradient(135deg, #FFFCE0 0%, #F7C948 26%, #B87B0E 58%, #FFF2A6 82%, #D4941A 100%) border-box;
  box-shadow: inset 0 4px 8px rgba(130, 80, 0, 0.30), inset 0 -2px 5px rgba(255, 252, 220, 0.65), 0 5px 14px rgba(180, 120, 10, 0.34);
}
/* 3D 破框立體貓：浮於金屬盤之上，頭頂微浮出環外；保留 3.6s 呼吸（keyframes 含完整基底 transform） */
.holo-cat-pop {
  position: absolute; z-index: 2; left: 50%; top: 50%;
  width: 108px; height: 108px; margin: -54px 0 0 -54px;
  object-fit: contain; pointer-events: none;
  transform: translateY(-6px) scale(1.06) translateZ(14px);
  filter: drop-shadow(0 8px 10px rgba(15, 23, 42, 0.28));
  animation: holoCatBreath 3.6s ease-in-out infinite;
}
@media (min-width: 820px) { .holo-cat-pop { width: 94px; height: 94px; margin: -47px 0 0 -47px; } }
@keyframes holoCatBreath {
  0%, 100% { transform: translateY(-6px) scale(1.06) translateZ(14px); }
  50% { transform: translateY(-8.5px) scale(1.06) scaleY(1.015) translateZ(14px); }
}

/* ⑥ 底部獨立典藏銘牌（象牙金屬牌：編碼細字＋粗體單元名固定 2 行高保同行齊平） */
.holo-plaque {
  position: relative; z-index: 2; flex: none; width: 100%;
  text-align: center; padding: 7px 8px 8px;
  border-radius: 12px;
  background: linear-gradient(180deg, #FFFDF6 0%, #F7F0DC 100%);
  border: 1px solid rgba(180, 150, 90, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 2px 6px rgba(15, 23, 42, 0.10);
}
.holo-plaque-meta {
  display: block; font-size: 9.5px; font-weight: 800; letter-spacing: 0.16em;
  color: #8A6D3B; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.holo-plaque-title {
  display: flex; flex-direction: column; justify-content: center; overflow: hidden;
  font-size: 14px; font-weight: 900; line-height: 1.32; color: var(--text-primary);
  min-height: 2.64em; max-height: 2.64em;
}

/* 克制珠光：寬幅彩虹掃影（holoFlow）＋跟手聚光燈（--glare-x/y 由 tilt JS 寫入卡元素） */
.holo-foil-sweep {
  position: absolute; inset: 0; z-index: 4; pointer-events: none;
  background-size: 280% 280%;
  animation-name: holoFlow; animation-timing-function: ease-in-out; animation-iteration-count: infinite;
}
.tier-bronze .holo-foil-sweep {
  background-image: linear-gradient(115deg, rgba(255,255,255,0) 26%, rgba(255,244,220,0.50) 42%, rgba(255,214,170,0.40) 52%, rgba(255,255,255,0) 70%);
  mix-blend-mode: soft-light; animation-duration: 7.2s;
}
.tier-silver .holo-foil-sweep {
  background-image: linear-gradient(115deg, rgba(255,255,255,0) 22%, rgba(255,255,255,0.65) 38%, rgba(165,243,252,0.50) 47%, rgba(251,207,232,0.45) 55%, rgba(167,243,208,0.40) 63%, rgba(255,255,255,0) 78%);
  mix-blend-mode: color-dodge; opacity: 0.72; animation-duration: 5.8s;
}
.tier-gold .holo-foil-sweep {
  background-image: linear-gradient(115deg, rgba(255,255,255,0) 16%, rgba(255,255,255,0.70) 32%, rgba(255,238,175,0.55) 42%, rgba(170,225,255,0.42) 51%, rgba(255,180,225,0.38) 59%, rgba(190,245,215,0.32) 66%, rgba(255,255,255,0) 82%);
  mix-blend-mode: color-dodge; opacity: 0.78; animation-duration: 4.8s;
}
.learn-card-wrap:nth-child(2n) .holo-foil-sweep { animation-delay: -1.8s; }
.learn-card-wrap:nth-child(3n) .holo-foil-sweep { animation-delay: -3.4s; }
@keyframes holoFlow {
  0%, 100% { background-position: 0% 0; }
  50% { background-position: 100% 0; }
}
.holo-foil-spot {
  position: absolute; inset: 0; z-index: 5; pointer-events: none;
  background: radial-gradient(circle at var(--glare-x, 50%) var(--glare-y, 42%), rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0) 46%);
}
/* 金卡專屬星芒微閃點（純 CSS radial 點，唔遮字唔搶貓） */
.holo-twinkle { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.holo-twinkle i {
  position: absolute; width: 16px; height: 16px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 252, 230, 0.95) 0%, rgba(255, 226, 130, 0.55) 34%, rgba(255, 226, 130, 0) 68%);
  animation: sparkleTwinkle 2.8s ease-in-out infinite;
}
.holo-twinkle i:nth-child(1) { top: 15%; left: 13%; }
.holo-twinkle i:nth-child(2) { top: 23%; right: 11%; width: 12px; height: 12px; animation-delay: 0.9s; }
.holo-twinkle i:nth-child(3) { bottom: 27%; left: 19%; width: 11px; height: 11px; animation-delay: 1.7s; }
@keyframes sparkleTwinkle {
  0%, 100% { opacity: 0.15; transform: scale(0.7); }
  50% { opacity: 0.95; transform: scale(1.15); }
}

@media (prefers-reduced-motion: reduce) {
  .learn-holo-card.tier-gold,
  .holo-halo-svg,
  .holo-foil-sweep,
  .holo-cat-pop,
  .holo-twinkle i { animation: none !important; }
}
/* 卡底外置進度條 */
.learn-card-prog { margin-top: 8px; padding: 0 2px; }
.learn-card-prog-row {
  display: flex; align-items: baseline; justify-content: space-between;
  font-size: 12.5px; font-weight: 800; color: var(--text-secondary);
  margin-bottom: 4px;
}
.learn-card-prog-bar {
  height: 6px; border-radius: var(--radius-btn);
  background: rgba(24, 34, 43, 0.10); overflow: hidden;
}
.learn-card-prog-bar i { display: block; height: 100%; border-radius: var(--radius-btn); background: #CBD5E1; }
.learn-card-prog-bar.tier-started i { background: var(--brand-emerald); }
.learn-card-prog-bar.tier-bronze i { background: linear-gradient(90deg, #D89A64, #B87640); }
.learn-card-prog-bar.tier-silver i { background: linear-gradient(90deg, #CBD5E1, #94A3B8); }
.learn-card-prog-bar.tier-gold i { background: linear-gradient(90deg, #F2C54C, #E8A90C); }

/* ⓘ 升卡規則摺疊提示 */
.learn-info-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; margin-left: 2px; vertical-align: 2px;
  border-radius: 50%; border: 1.5px solid var(--border-soft);
  background: var(--surface-subtle); color: var(--text-secondary);
  font: inherit; font-size: 13px; font-weight: 900; line-height: 1;
  cursor: pointer; padding: 0;
}
.learn-info-btn:active { background: var(--brand-mint-soft); }
.learn-info-hint {
  font-size: 13px; font-weight: 700; line-height: 1.5;
  color: var(--brand-emerald-dark); background: var(--brand-mint-soft);
  border-radius: 12px; padding: 8px 12px; margin: 0 0 12px;
}
.learn-info-hint[hidden] { display: none; }

/* ---------- 趴邊探頭貓（PR-UI-HoloCard） ---------- */
.learn-main-card { position: relative; }
.learn-ledge { position: absolute; z-index: 6; }
.learn-ledge-cat-btn {
  display: block; width: 100%; padding: 0;
  background: none; border: none; cursor: pointer; font: inherit;
}
.learn-ledge-cat-img {
  display: block; width: 100%; height: auto; pointer-events: none;
  filter: drop-shadow(0 6px 10px rgba(15, 28, 38, 0.16));
  animation: ledgeBreath 3.5s ease-in-out infinite;
}
@keyframes ledgeBreath {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
.learn-ledge-tag {
  position: absolute; white-space: nowrap; pointer-events: none;
  font-size: 12px; font-weight: 900; color: var(--wrong-text);
  background: var(--wrong-apricot-bg); border: 1px solid var(--wrong-apricot-border);
  padding: 4px 10px; border-radius: var(--radius-btn);
  box-shadow: 0 4px 10px rgba(15, 28, 38, 0.10);
}
.learn-ledge-bubble {
  position: absolute; z-index: 7; display: block;
  width: max-content; max-width: 220px;
  font-size: 13px; font-weight: 800; line-height: 1.45; color: var(--text-primary);
  background: #fff; border: 1px solid var(--border-soft); border-radius: 14px;
  box-shadow: var(--shadow-bento); padding: 8px 12px;
}
.learn-ledge-bubble[hidden] { display: none; }
/* iPad／桌面：貼右邊框斜身探頭 */
@media (min-width: 768px) {
  .learn-ledge { right: -14px; top: 108px; width: 88px; }
  .learn-ledge-cat-btn { transform: rotate(-76deg); transition: transform 0.18s ease; }
  .learn-ledge-cat-btn.is-bounced { transform: rotate(-76deg) scale(1.08); }
  .learn-ledge-tag { right: calc(100% + 4px); top: 30px; }
  .learn-ledge-bubble { right: 0; top: calc(100% + 10px); }
}
/* 手機：頂邊右上角正面趴邊（主卡預留頭頂空間） */
@media (max-width: 767px) {
  .learn-main-card { margin-top: 36px; }
  .learn-ledge { right: 14px; top: -44px; width: 78px; }
  .learn-ledge-cat-btn { transition: transform 0.18s ease; }
  .learn-ledge-cat-btn.is-bounced { transform: scale(1.08); }
  .learn-ledge-tag { right: calc(100% + 6px); top: 16px; }
  .learn-ledge-bubble { right: 0; top: calc(100% + 6px); }
}
@media (prefers-reduced-motion: reduce) {
  .learn-ledge-cat-img { animation: none; }
}

/* 升卡階梯圖例（技能卡網格正上方一行） */
.learn-ladder {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px;
  font-size: 12.5px; font-weight: 800; color: var(--text-secondary);
  margin-bottom: 12px;
}
.learn-ladder-item { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.learn-ladder-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.learn-ladder-dot.dot-grey { background: #CBD5E1; }
.learn-ladder-dot.dot-bronze { background: #C98A4B; }
.learn-ladder-dot.dot-silver { background: #9FB6CC; }
.learn-ladder-dot.dot-gold { background: linear-gradient(135deg, #F2C54C, #FBE27E); }
.learn-ladder-arrow { opacity: 0.55; }

.learn-empty { font-size: 14px; color: var(--text-secondary); line-height: 1.6; }

/* ---------- 今日升級任務面板 ---------- */
.learn-today-card { position: relative; overflow: visible; }
.learn-today-cat {
  display: flex; align-items: flex-end; gap: 8px;
  min-height: 96px; margin-bottom: 10px; padding-right: 76px;
}
/* 複審修正 4：值日貓收回卡內右上角（唔再騎出卡頂撞上方掣）；頁首區 min-height 96px 容納 84px 貓圖 */
.learn-today-cat img {
  position: absolute; top: 6px; right: 12px;
  width: 84px; height: 84px; object-fit: contain;
  filter: drop-shadow(0 8px 14px rgba(15, 28, 38, 0.18));
  pointer-events: none;
}
.learn-today-cat-txt { font-size: 13.5px; font-weight: 700; color: var(--text-secondary); line-height: 1.45; }
.learn-today-cat-txt strong { color: var(--brand-emerald-dark); font-weight: 900; }
.learn-today-cat-txt small { display: block; font-weight: 600; }

.learn-today-list { display: flex; flex-direction: column; gap: 10px; }
.learn-spine-card {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-subtle); border: 1px solid var(--border-soft);
  border-radius: 18px; padding: 12px 14px;
}
.learn-spine-card.kind-sunday { border-color: rgba(190, 145, 30, 0.5); background: #FFFBEB; }
.learn-spine-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.learn-spine-main strong { font-size: 15px; font-weight: 900; color: var(--text-primary); line-height: 1.4; }
.learn-spine-main small { font-size: 12.5px; font-weight: 600; color: var(--text-secondary); line-height: 1.45; }
.learn-spine-go {
  flex: none; min-height: 44px; padding: 9px 18px;
  background: var(--brand-emerald); border: none; border-bottom: 3px solid var(--brand-emerald-dark);
  border-radius: var(--radius-btn);
  color: #fff; font: inherit; font-size: 14px; font-weight: 800; cursor: pointer; white-space: nowrap;
}
.learn-spine-go:active { transform: translateY(1px); border-bottom-width: 2px; }
.learn-spine-head { font-size: 13px; font-weight: 900; color: var(--brand-emerald-dark); margin-bottom: 2px; }
.learn-spine-card .learn-spine-step {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: transparent; border: none; border-top: 1px solid var(--border-soft);
  padding: 9px 2px; font: inherit; cursor: pointer; color: var(--text-primary);
}
.learn-spine-card .learn-spine-step:first-of-type { border-top: none; }
div.learn-spine-step { cursor: default; }
.learn-spine-tick {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-mint-soft); color: var(--brand-emerald-dark);
  font-size: 14px; font-weight: 900;
}
.learn-spine-step.is-done .learn-spine-tick { background: var(--brand-emerald); color: #fff; }
.learn-spine-step .learn-spine-main strong { font-size: 14px; }

/* ---------- 七日值日貓打卡列 ---------- */
.learn-cats-row {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px;
}
@media (max-width: 560px) { .learn-cats-row { gap: 4px; } }
.learn-cat-cell {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 10px 2px 8px; border-radius: 18px;
  background: var(--surface-subtle); border: 1px solid transparent;
  text-align: center;
}
.learn-cat-cell.is-today {
  background: var(--brand-mint-soft); border-color: rgba(11, 138, 106, 0.35);
}
.learn-cat-imgwrap { position: relative; width: 52px; height: 52px; }
.learn-cat-imgwrap img { width: 52px; height: 52px; object-fit: contain; }
.learn-cat-cell:not(.is-checked):not(.is-today) .learn-cat-imgwrap img { opacity: 0.45; }
.learn-cat-tick {
  position: absolute; right: -4px; bottom: -2px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--brand-emerald); color: #fff;
  font-size: 12px; font-weight: 900; line-height: 20px; text-align: center;
  box-shadow: 0 2px 6px rgba(15, 28, 38, 0.25);
}
.learn-cat-name { font-size: 13px; font-weight: 900; color: var(--text-primary); white-space: nowrap; }
.learn-cat-day { font-size: 11.5px; font-weight: 700; color: var(--text-secondary); white-space: nowrap; }
@media (max-width: 560px) {
  .learn-cat-imgwrap, .learn-cat-imgwrap img { width: 40px; height: 40px; }
  .learn-cat-name { font-size: 11.5px; }
  .learn-cat-day { font-size: 10.5px; }
}

/* ---------- PR-Brand：英雄 Logo＋科目招牌貓 ---------- */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.v2-hero-logo {
  display: block; width: 100%; max-width: 400px; height: auto;
  margin: 0 auto 8px;
}
@media (max-width: 599px) {
  .v2-hero-logo { width: 82%; max-width: 290px; }
}
.learn-subject-cat {
  /* PR-UI-HoloCard：招牌貓已進駐每張閃卡中央徽章，大橫條收起唔再顯示 */
  display: none !important;
}
.learn-subject-cat[hidden] { display: none; }
/* PR-UI-Polish 一.5：招牌貓圖固定 76×76 盒（object-fit 保持比例），
   載入前已預留位置，切換科目唔再閃跳／推版 */
.learn-subject-cat-img { width: 76px; height: 76px; object-fit: contain; flex: none; }

/* PR-UI-Polish 三.2：細手機值日貓列 7 格唔爆版（格仔可縮、貓名截尾） */
@media (max-width: 480px) {
  .learn-cats-row { gap: 4px; }
  .learn-cat-cell { min-width: 0; overflow: hidden; }
  .learn-cat-imgwrap { width: 32px; height: 32px; }
  .learn-cat-name { font-size: 10.5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .learn-cat-day { font-size: 9.5px; }
}
.learn-subject-cat-txt { display: flex; flex-direction: column; line-height: 1.3; color: var(--text-primary); font-size: 15px; }
.learn-subject-cat-txt strong { font-size: 17px; font-weight: 900; }
.learn-subject-cat-txt small { color: var(--text-secondary, #5b6b66); font-size: 12.5px; margin-top: 2px; }

/* ============================================================================
   PR-V2-W1（整頁封板）：學習主頁雙版面重構＋五層光學全息卡＋活體貓
   手機 <820：緊湊頂欄→任務精簡卡→主角大卡 scroll-snap 輪播＋金屬圓點
   ≥820：真雙欄 Bento（左技能卡主卡＋右任務／卡牌庫副欄），崖邊貓錨定主卡頂邊
   ============================================================================ */

/* ---------- 版面骨架 ---------- */
.v2-learn-layout { display: flex; flex-direction: column; gap: 14px; }
.v2-learn-layout .learn-today-card { position: relative; top: auto; }
@media (min-width: 820px) {
  .learn-cols { display: grid; grid-template-columns: minmax(0, 1fr) 268px; gap: 16px; align-items: stretch; }
  .learn-rail { display: flex; flex-direction: column; gap: 16px; min-width: 0; height: 100%; }
}
@media (min-width: 1100px) {
  .learn-cols { grid-template-columns: minmax(0, 1fr) 316px; }
}

/* ---------- 緊湊頂欄 ---------- */
.learn-topbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* v3：大張 7 貓 MeowLab Logo 歸位（取代 32px 細品牌）——≥1024 高 64px 左置、820–1023 高 68px、<820 高 84px 於 Logo 行內（右側同行放功能掣）置中 */
.learn-topbar-brand { display: flex; align-items: center; flex: none; }
.learn-logo-hero { display: block; height: 64px; width: auto; max-width: 100%; object-fit: contain; }
.learn-top-actions { display: flex; gap: 6px; flex: none; margin-left: auto; }
.learn-icon-btn {
  width: 40px; height: 40px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: #FFFFFF; border: 1.5px solid rgba(203, 213, 225, 0.85); border-radius: 50%;
  box-shadow: 0 2px 0 rgba(148, 163, 184, 0.30), 0 3px 8px rgba(15, 23, 42, 0.05);
  cursor: pointer; padding: 0;
}
.learn-icon-btn:active { background: var(--brand-mint-soft); }
/* 科目丸：單行橫滑（規格一.3 立體丸） */
.learn-topbar .learn-capsules {
  flex: 1 1 auto; min-width: 0; margin: 0;
  flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 2px 1px 4px;
}
.learn-topbar .learn-capsules::-webkit-scrollbar { display: none; }
.learn-capsule {
  flex: none; min-height: 40px; padding: 8px 17px; font-size: 14.5px;
  border: 1.5px solid rgba(203, 213, 225, 0.85);
  box-shadow: 0 2px 0 rgba(148, 163, 184, 0.30), 0 3px 8px rgba(15, 23, 42, 0.05);
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.22s ease, background 0.15s ease;
}
.learn-capsule.is-active {
  border-color: var(--brand-emerald);
  box-shadow: 0 3px 0 #07664E, 0 6px 14px rgba(11, 138, 106, 0.24);
}
@media (max-width: 819px) {
  /* v3：大 Logo 直接浮於 #EEF2F5 畫布（唔包白卡、無副標）；科目列修正輪：3 粒功能掣移入 Logo 行右側
     （Logo 圖本身 98.5% 滿版，全屏置中＋掣位必然重疊，故 Logo 改於扣除掣位後嘅空間內置中，同 iPad 版式一致），
     科目丸列全寬獨佔一行，6 科一律入鏡 */
  .learn-topbar-brand { order: 0; flex: 1 1 auto; justify-content: center; min-width: 0; }
  .learn-logo-hero { height: 84px; max-width: 100%; }
  .learn-top-actions { order: 1; margin-left: 0; }
  .learn-topbar .learn-capsules { order: 5; flex: 1 1 100%; gap: 6px; }
  .learn-topbar .learn-capsule { min-height: 40px; padding: 7px 11px; font-size: 14px; }
  /* 複審修正 3：升卡階梯圖例手機預設收起，撳 ⓘ 先展開（.is-open 由 learn.js 同步切換） */
  .learn-ladder { display: none; }
  .learn-ladder.is-open { display: flex; }
}
@media (min-width: 820px) and (max-width: 1023px) {
  .learn-logo-hero { height: 68px; }
  /* 複審修正 4：科目列獨立成行（換行），「音樂」膠囊同右側功能掣零接觸、零截斷 */
  .learn-topbar .learn-capsules { order: 5; flex-basis: 100%; }
}
/* 年級／連勝／榮譽分由全域 #v2-topbar 負責（<1024 輕量版、≥1024 完整版），
   頁內頂欄只留大 Logo＋科目丸＋功能掣，避免同屏重複顯示數據 */

/* ---------- 手機（<820）：任務精簡卡＋主角大卡輪播 ---------- */
.learn-today-compact { display: none; }
@media (max-width: 819px) {
  .learn-cols { display: flex; flex-direction: column; }
  .learn-rail { display: contents; }
  .learn-today-card { order: 1; padding: 14px 16px; }
  .learn-main-card { order: 2; margin-top: 0; }
  .learn-vault-card { display: none; }
  .learn-ledge { display: none; }
  .learn-today-full { display: none; }
  .learn-today-compact { display: flex; align-items: center; gap: 12px; min-height: 84px; }
  /* 輪播對稱置中（#174 最後微修）：padding % 以主卡內容盒寬為準，出血 margin 須喺 padding 補返，先令首卡置正中 */
  .learn-skill-grid {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
    gap: 14px; margin-inline: -16px;
    padding: 10px calc((100% - min(240px, 64vw)) / 2 + 16px) 14px;
    scrollbar-width: none;
  }
  .learn-skill-grid::-webkit-scrollbar { display: none; }
  .learn-card-wrap { flex: 0 0 min(240px, 64vw); scroll-snap-align: center; }
}
.ltc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.ltc-title { font-size: 16.5px; font-weight: 900; color: var(--text-primary); }
.ltc-sub { font-size: 12.5px; font-weight: 700; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ltc-bar { height: 8px; border-radius: 999px; background: rgba(24, 34, 43, 0.10); overflow: hidden; }
.ltc-bar i { display: block; height: 100%; background: var(--brand-emerald); border-radius: 999px; }
.ltc-go { align-self: flex-start; min-height: 42px; padding: 9px 18px; font-size: 14.5px; }
.ltc-cat {
  position: relative; flex: none; width: 88px; height: 88px;
  background: none; border: none; padding: 0; cursor: pointer; font: inherit;
}
.ltc-cat img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; filter: drop-shadow(0 6px 10px rgba(15, 28, 38, 0.16)); }
.ltc-bubble {
  position: absolute; z-index: 7; right: 6px; top: -8px;
  width: max-content; max-width: 200px;
  font-size: 12.5px; font-weight: 800; line-height: 1.45; color: var(--text-primary);
  background: #FFFFFF; border: 1px solid var(--border-soft); border-radius: 14px;
  box-shadow: var(--shadow-bento); padding: 7px 11px;
}
.ltc-bubble[hidden] { display: none; }

/* 金屬色圓點指示器（手機輪播） */
.learn-dots { display: none; }
@media (max-width: 819px) {
  .learn-dots { display: flex; justify-content: center; align-items: center; gap: 7px; padding: 2px 0 2px; }
  .learn-dot {
    width: 9px; height: 9px; border-radius: 999px; border: none; padding: 0; cursor: pointer;
    background: #CBD5E1; transition: width 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s ease;
  }
  .learn-dot.tier-started { background: var(--brand-emerald); }
  .learn-dot.tier-bronze { background: #C98A4B; }
  .learn-dot.tier-silver { background: #9FB6CC; }
  .learn-dot.tier-gold { background: linear-gradient(135deg, #F2C54C, #FBE27E); }
  .learn-dot.is-active { width: 22px; }
}

/* ---------- ≥820：主卡網格＋崖邊貓錨定 ---------- */
@media (min-width: 820px) {
  .learn-skill-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .learn-main-card { margin-top: 58px; }
  .learn-ledge { top: -56px; right: 26px; width: 92px; }
  .learn-ledge-cat-btn { transform: none; }
  .learn-ledge-cat-btn.is-bounced { transform: scale(1.08); }
  .learn-ledge-tag { right: calc(100% + 8px); top: 26px; }
  .learn-ledge-bubble { right: 0; top: calc(100% + 8px); }
}
@media (min-width: 820px) and (max-width: 980px) {
  .learn-skill-grid { grid-template-columns: repeat(2, 1fr); }
}

/* 五層光學舊覆蓋（卡磚邊框／液態底／::before 眩光／.holo-sparkles／舊圓章尺寸）已由上方 v3 精雕典藏 6 層結構全數取代，呢段刪除。 */

/* 崖邊貓呼吸統一 3.6s（規格三.1） */
.learn-ledge-cat-img { animation: ledgeBreath 3.6s ease-in-out infinite; }
@keyframes ledgeBreath {
  0%, 100% { transform: translateY(0) scaleY(1); }
  50% { transform: translateY(-2.5px) scaleY(1.015); }
}
/* 進度組外置（複審修正 2）：掌握度＋百分比＋金屬進度條整組置於卡片正下方，
   卡身底部留乾淨金屬邊距，零撞 ::after 內框；級別 class 掛喺進度組自身 */
.holo-prog { width: 100%; margin-top: 8px; padding: 0 2px; }
.holo-prog-row {
  display: flex; align-items: baseline; justify-content: space-between;
  font-size: 12.5px; font-weight: 800; color: var(--text-secondary); margin-bottom: 4px;
}
.holo-prog-bar {
  height: 8px; border-radius: 999px; overflow: hidden;
  background: rgba(24, 34, 43, 0.13); box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.14);
}
.holo-prog-bar i { display: block; height: 100%; border-radius: 999px; background: #CBD5E1; }
.holo-prog.tier-started .holo-prog-bar i { background: var(--brand-emerald); }
.holo-prog.tier-bronze .holo-prog-bar i { background: linear-gradient(90deg, #D89A64, #B87640); }
.holo-prog.tier-silver .holo-prog-bar i { background: linear-gradient(90deg, #CBD5E1, #94A3B8); }
.holo-prog.tier-gold .holo-prog-bar i { background: linear-gradient(90deg, #F2C54C, #E8A90C); }

/* ---------- 右欄：今日任務完整版＋我的卡牌庫 ---------- */
.learn-today-go { width: 100%; margin-top: 12px; }
.learn-vault-card { display: none; }
@media (min-width: 820px) { .learn-vault-card { display: block; } }
.vault-counts { display: flex; gap: 8px; margin-bottom: 12px; }
.vault-count {
  flex: 1; text-align: center; border-radius: 14px; padding: 8px 4px;
  font-size: 12px; font-weight: 800; color: var(--text-secondary);
  background: var(--surface-subtle); border: 1px solid var(--border-soft);
}
.vault-count b { display: block; font-size: 19px; font-weight: 900; color: var(--text-primary); }
.vault-count.v-gold { background: #FFF7DB; border-color: rgba(217, 155, 30, 0.45); }
.vault-count.v-silver { background: #F1F6FB; border-color: rgba(148, 163, 184, 0.5); }
.vault-count.v-bronze { background: #FBF0E4; border-color: rgba(201, 132, 75, 0.45); }
.vault-thumbs { display: flex; gap: 10px; }
.vault-thumb {
  flex: 1; min-width: 0; aspect-ratio: 3 / 4; border-radius: 14px; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 6px 4px; cursor: pointer; font: inherit; color: var(--text-primary);
  border: 2px solid var(--border-soft); background: #FFFFFF;
}
.vault-thumb img { width: 40px; height: 40px; object-fit: contain; }
.vault-thumb span { font-size: 10.5px; font-weight: 800; text-align: center; line-height: 1.3; }
.vault-thumb.tier-gold { background: radial-gradient(circle at 50% 40%, #FFFDF0 0%, #FCE277 36%, #DB9A1A 74%, #9E5D04 100%); border-color: #D99B1E; border-bottom-width: 3.5px; }
.vault-thumb.tier-silver { background: radial-gradient(circle at 50% 40%, #FFFFFF 0%, #DFEAF5 36%, #9FB5CE 74%, #6C839E 100%); border-color: #94A3B8; border-bottom-width: 3.5px; }
.vault-thumb.tier-bronze { background: radial-gradient(circle at 50% 40%, #FFF2E0 0%, #E7B27F 38%, #B46A32 76%, #7D3F14 100%); border-color: #C9844B; border-bottom-width: 3.5px; }
.vault-empty { font-size: 13px; font-weight: 600; color: var(--text-secondary); line-height: 1.55; }

@media (prefers-reduced-motion: reduce) {
  .learn-ledge-cat-img { animation: none; }
}

/* ==========================================================================
   PR-V2-Card-WebGL：WebGL 物理全息卡面＋雙面證書卡背＋鑄造儀式＋集卡冊
   金屬級卡面改用官方 420×560 原畫（GL canvas／靜態 img 二擇一），
   貓與銘牌文字按規格像素百分比定位；CSS 卡面（灰／練習中）不受影響。
   ========================================================================== */
.learn-holo-card.has-gl {
  padding: 0; background: none; border-radius: 20px;
  box-shadow: 0 5px 0 rgba(100, 116, 139, 0.55), 0 16px 30px -8px rgba(15, 23, 42, 0.35);
  animation: none;
}
.learn-holo-card.has-gl.tier-bronze { box-shadow: 0 5px 0 #66320E, 0 16px 30px -6px rgba(115, 58, 18, 0.40); }
.learn-holo-card.has-gl.tier-silver { box-shadow: 0 5px 0 #4B5F76, 0 16px 32px -6px rgba(45, 65, 92, 0.40); }
.learn-holo-card.has-gl.tier-gold { box-shadow: 0 5px 0 #824B02, 0 18px 36px -6px rgba(188, 122, 8, 0.50); }
.holo-gl-face {
  position: absolute; inset: 0; display: block; overflow: hidden; border-radius: 20px;
  container-type: size;
  background: radial-gradient(circle at 50% 40%, #FFFFFF 0%, #F2F6FA 62%, #E3ECF3 100%);
}
.holo-gl-face.tier-bronze { background: radial-gradient(circle at 50% 40%, #FFF2E0 0%, #E7B27F 38%, #B46A32 76%, #7D3F14 100%); }
.holo-gl-face.tier-silver { background: radial-gradient(circle at 50% 40%, #FFFFFF 0%, #DFEAF5 36%, #9FB5CE 74%, #6C839E 100%); }
.holo-gl-face.tier-gold { background: radial-gradient(circle at 50% 40%, #FFFDF0 0%, #FCE277 36%, #DB9A1A 74%, #9E5D04 100%); }
.holo-gl-canvas, .holo-gl-img {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block; border-radius: 20px;
}
.holo-gl-img { object-fit: cover; }
/* 3D 破框貓（規格定位：left 50%／top 46.5%／width 53%） */
.holo-cat-art {
  position: absolute; z-index: 2; left: 50%; top: 46.5%; width: 53%; aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%); object-fit: contain; pointer-events: none;
  filter: drop-shadow(0 9px 11px rgba(15, 23, 42, 0.32));
  animation: glCatBreath 3.6s ease-in-out infinite;
}
@keyframes glCatBreath {
  0%, 100% { transform: translate(-50%, -50%); }
  50% { transform: translate(-50%, -53%); }
}
/* 原生銘牌文字（規格定位：left/right 15%／top 77.0%／height 11.4%） */
.holo-plaque-text {
  position: absolute; z-index: 3; left: 15%; right: 15%; top: 77.0%; height: 11.4%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; pointer-events: none;
}
.hpt-meta {
  display: block; font-size: 4cqw; font-weight: 800; letter-spacing: 0.14em;
  color: #8A6D3B; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.hpt-title {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
  font-size: 5.8cqw; font-weight: 900; line-height: 1.25; color: var(--text-primary);
}
/* 窄卡（iPad／桌面格）：銘牌實體空間有限，標題改單行省略，永不裁切半行 */
@container (max-width: 209px) {
  .hpt-title { -webkit-line-clamp: 1; font-size: 6.2cqw; }
  .hpt-meta { font-size: 4.2cqw; }
}
/* 蒙塵柔霧層＋擦亮掃光（0.75s 一次） */
.holo-mist {
  position: absolute; inset: 0; z-index: 4; pointer-events: none; border-radius: 20px;
  background: linear-gradient(160deg, rgba(241, 245, 249, 0.55) 0%, rgba(203, 213, 225, 0.38) 100%);
  backdrop-filter: blur(1.5px); -webkit-backdrop-filter: blur(1.5px);
}
.holo-polish-sweep {
  position: absolute; inset: 0; z-index: 5; pointer-events: none; border-radius: 20px;
  background: linear-gradient(115deg, rgba(255,255,255,0) 30%, rgba(255,255,255,0.88) 50%, rgba(255,255,255,0) 70%);
  background-size: 260% 260%; background-position: 130% 0;
  animation: polishSweep 0.75s ease-out 1 forwards;
}
@keyframes polishSweep {
  from { background-position: 130% 0; opacity: 1; }
  to { background-position: -40% 0; opacity: 0.9; }
}
/* ---------- 雙面翻牌 ---------- */
.learn-card-wrap.has-flip { position: relative; perspective: 1200px; }
.holo-flip-inner {
  position: relative; transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.25, 0.7, 0.3, 1.15);
}
.learn-card-wrap.is-flipped .holo-flip-inner { transform: rotateY(180deg); }
.holo-flip-inner > .learn-holo-card { backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.learn-card-wrap.is-flipped .learn-holo-card { pointer-events: none; }
.holo-flip-btn {
  position: absolute; z-index: 8; top: 8px; left: 8px;
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 900; color: var(--brand-emerald-dark, #07664E);
  background: #FFFFFF; border: 1px solid var(--border-soft);
  box-shadow: 0 3px 0 rgba(15, 23, 42, 0.18), 0 4px 8px rgba(15, 23, 42, 0.14);
  -webkit-tap-highlight-color: transparent;
}
.holo-flip-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(15, 23, 42, 0.18); }
/* P1（neno 複審）：翻到卡背後隱藏正面 ↻ 掣，免遮證書背左上皇冠＋MEOWLAB 字頭 */
.learn-card-wrap.is-flipped .holo-flip-btn { opacity: 0; pointer-events: none; }
/* 證書卡背：4px 金屬斜邊（雙層背景）＋內層證書框＋級別絲絨 */
.holo-card-back {
  position: absolute; inset: 0; z-index: 1; border-radius: 20px; overflow: hidden;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  transform: rotateY(180deg);
  border: 4px solid transparent; box-sizing: border-box;
  color: #F5EFE6; text-align: left; cursor: default;
  box-shadow: 0 14px 28px -8px rgba(15, 23, 42, 0.35);
}
.holo-card-back.tier-bronze {
  background: linear-gradient(165deg, #472917 0%, #180C06 100%) padding-box,
              linear-gradient(135deg, #FFF0DC 0%, #D99559 30%, #8F4E1E 62%, #F3C492 88%, #B56E35 100%) border-box;
}
.holo-card-back.tier-silver {
  background: linear-gradient(165deg, #253A56 0%, #0D1624 100%) padding-box,
              linear-gradient(135deg, #FFFFFF 0%, #C8D4E3 26%, #7C8EA6 58%, #EEF4FA 82%, #94A3B8 100%) border-box;
}
.holo-card-back.tier-gold {
  background: linear-gradient(165deg, #104538 0%, #051A15 100%) padding-box,
              linear-gradient(135deg, #FFFCE0 0%, #F7C948 26%, #B87B0E 58%, #FFF2A6 82%, #D4941A 100%) border-box;
}
.hcb-frame {
  height: 100%; box-sizing: border-box; overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.35); border-radius: 13px;
  padding: 8px 9px; display: flex; flex-direction: column;
}
.hcb-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.hcb-code {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.14em; white-space: nowrap;
}
.hcb-code .v2-ico { filter: brightness(0) invert(1); opacity: 0.9; }
.hcb-cert {
  font-size: 9px; font-weight: 900; letter-spacing: 0.06em; white-space: nowrap;
  padding: 3px 7px; border-radius: 999px; color: #1E293B; background: linear-gradient(180deg, #FFF7DB, #F2C54C);
}
.tier-silver .hcb-cert { background: linear-gradient(180deg, #FFFFFF, #C8D4E3); }
.tier-bronze .hcb-cert { background: linear-gradient(180deg, #FFE7C7, #D99559); }
.hcb-sub { margin-top: 5px; font-size: 10px; font-weight: 700; letter-spacing: 0.1em; opacity: 0.75; text-align: center; }
.hcb-title { font-size: 13.5px; font-weight: 900; line-height: 1.3; text-align: center; margin-top: 2px; }
.hcb-divider { display: flex; align-items: center; gap: 6px; margin: 5px 2px; }
.hcb-divider i { flex: 1; height: 1px; background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,0.55), rgba(255,255,255,0)); }
.hcb-divider b { width: 7px; height: 7px; transform: rotate(45deg); background: rgba(255, 255, 255, 0.85); flex: none; }
.hcb-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.hcb-cell {
  border: 1px solid rgba(255, 255, 255, 0.22); border-radius: 10px; padding: 5px 7px;
  background: rgba(255, 255, 255, 0.07);
}
.hcb-cell span { display: block; font-size: 9px; font-weight: 700; letter-spacing: 0.08em; opacity: 0.72; }
.hcb-cell b { display: block; font-size: 17px; font-weight: 900; line-height: 1.15; font-variant-numeric: tabular-nums; color: #FFE98A; }
.tier-silver .hcb-cell b { color: #DCE9F7; }
.tier-bronze .hcb-cell b { color: #FFD9A8; }
.hcb-cell b.hcb-target { font-size: 10.5px; line-height: 1.35; padding-top: 3px; }
.hcb-checks {
  margin-top: 6px; border-radius: 10px; padding: 6px 8px; overflow: hidden;
  background: rgba(0, 0, 0, 0.22); border: 1px solid rgba(255, 255, 255, 0.14);
}
.hcb-check { display: flex; align-items: flex-start; gap: 5px; font-size: 10px; font-weight: 700; line-height: 1.34; }
.hcb-check + .hcb-check { margin-top: 3px; }
.hcb-check .v2-ico { flex: none; margin-top: 1px; filter: brightness(0) invert(1); opacity: 0.9; }
.hcb-stamp { margin-top: auto; padding-top: 5px; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.hcb-stamp > span { font-size: 9.5px; font-weight: 700; letter-spacing: 0.05em; opacity: 0.8; white-space: nowrap; }
.hcb-flipback {
  flex: none; font: inherit; font-size: 10px; font-weight: 900; cursor: pointer;
  padding: 4px 9px; border-radius: 999px; color: #F5EFE6;
  background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(255, 255, 255, 0.4);
}
/* ---------- 鑄造儀式 ---------- */
.forge-overlay {
  position: fixed; inset: 0; z-index: 220; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: radial-gradient(ellipse at 50% 36%, rgba(36, 66, 110, 0.92) 0%, rgba(8, 15, 32, 0.97) 68%, rgba(3, 6, 16, 0.99) 100%);
  padding: 20px;
}
.forge-ring {
  position: absolute; left: 50%; top: 38%; width: 300px; height: 300px; margin: -150px 0 0 -150px;
  border-radius: 50%; border: 3px solid rgba(247, 201, 72, 0.85);
  box-shadow: 0 0 44px rgba(247, 201, 72, 0.5), inset 0 0 34px rgba(247, 201, 72, 0.35);
  animation: forgeRing 1.5s ease-out 1 forwards; pointer-events: none;
}
@keyframes forgeRing {
  0% { transform: scale(0.35); opacity: 0; }
  35% { opacity: 1; }
  100% { transform: scale(1.12); opacity: 0.55; }
}
.forge-particles { position: absolute; left: 50%; top: 38%; width: 0; height: 0; pointer-events: none; }
.forge-particles i {
  position: absolute; width: 6px; height: 6px; border-radius: 50%;
  background: radial-gradient(circle, #FFF7DB 0%, #F7C948 70%, rgba(247, 201, 72, 0) 100%);
  animation: forgeStar 1.5s ease-out 1 forwards; opacity: 0;
}
@keyframes forgeStar {
  0% { transform: translate(0, 0) scale(0.4); opacity: 0; }
  25% { opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(1.1); opacity: 0; }
}
.forge-card {
  position: relative; width: min(238px, 62vw); aspect-ratio: 3 / 4; flex: none;
  border-radius: 20px; box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.6);
  animation: forgeSpin 1.5s cubic-bezier(0.2, 0.7, 0.3, 1) 1;
}
@keyframes forgeSpin {
  from { transform: rotateY(0deg) scale(0.82); }
  to { transform: rotateY(720deg) scale(1); }
}
.forge-stamp {
  transform: rotate(-5deg); padding: 6px 14px; border-radius: 10px;
  border: 2px solid rgba(247, 201, 72, 0.9); color: #FFE98A;
  font-size: 13px; font-weight: 900; letter-spacing: 0.08em;
  background: rgba(20, 14, 2, 0.45);
}
.forge-title { margin: 0; color: #FFFFFF; font-size: 22px; font-weight: 900; letter-spacing: 0.06em; }
.forge-collect { display: inline-flex; align-items: center; gap: 8px; }
/* ---------- 集卡冊進度 ---------- */
.vault-album { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 2px 0 12px; }
.vault-album-label { font-size: 12.5px; font-weight: 900; color: var(--text-primary); }
.vault-dots { display: inline-flex; gap: 5px; }
.vault-dot { width: 11px; height: 11px; border-radius: 50%; background: #E2E8F0; border: 1.5px solid #CBD5E1; }
.vault-dot.is-gold {
  background: radial-gradient(circle at 35% 30%, #FFF7DB 0%, #F2C54C 55%, #D99B1E 100%);
  border-color: #B87B0E; box-shadow: 0 0 6px rgba(242, 197, 76, 0.7);
}
.vault-master {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 900; color: #7C4A03;
  padding: 3.5px 9px; border-radius: 999px;
  background: linear-gradient(180deg, #FFF3AD, #F7C948); border: 1px solid #D99B1E;
  box-shadow: 0 2px 8px rgba(217, 155, 30, 0.45);
}
@media (prefers-reduced-motion: reduce) {
  .holo-cat-art, .forge-card, .forge-ring, .forge-particles i, .holo-polish-sweep { animation: none !important; }
  .holo-flip-inner { transition: none; }
}

/* ============================================================================
   PR-A（pr-v2-responsive-bento-polish）— A-1 齊底硬規則 + A-2 學習頁
   A-1：多欄 Bento 一律 align-items: stretch；堆疊欄 height:100%，尾卡 flex:1 食餘高
   A-2.1：≥1024 技能卡單行貨架（flex nowrap + scroll-snap）＋62/38 分欄＋浮動箭嘴
   A-2.2：820–1023 維持 2×2，收緊右欄間距；銘牌標題防孤字（字號／內距微調，≥820）
   ============================================================================ */
.learn-shelf-arrow { display: none; }

@media (min-width: 820px) {
  /* A-1：卡牌庫卡 flex:1 食盡右欄餘高 → 左右欄底齊平 */
  .learn-vault-card { flex: 1 1 auto; }
  /* A-2.2 銘牌防孤字：CSS 卡銘牌標題 14px→13px＋左右內距 8px→6px（單字不再跌落第二行） */
  .holo-plaque { padding-left: 6px; padding-right: 6px; }
  .holo-plaque-title { font-size: 13px; }
}
/* WebGL 卡銘牌：卡面 ≥210px 時標題 5.8cqw→5.4cqw（窄卡 ≤209px 沿用既有單行截斷規則） */
@container (min-width: 210px) {
  .holo-gl-face .hpt-title { font-size: 5.4cqw; }
}
/* A-2.2 直向 820–1023：右欄任務卡垂直間距收緊 */
@media (min-width: 820px) and (max-width: 1023.98px) {
  .learn-rail { gap: 12px; }
  .learn-today-list { gap: 8px; }
  .learn-today-cat { min-height: 88px; margin-bottom: 8px; }
}

/* A-2.1 橫向／桌面 ≥1024：62/38 分欄＋單行貨架＋一屏收緊 */
@media (min-width: 1024px) {
  .learn-cols { grid-template-columns: minmax(0, 1fr) minmax(360px, 38%); }
  /* A-2.1：打卡列全幅 — 版面 flex 欄 align-items:start 令 slot 只得內容寬，
     ≥1024 以 align-self:stretch 撐滿全幅（與上方雙欄同寬） */
  .v2-learn-layout > .learn-slot-wide { align-self: stretch; }
  #view-learn .v2-view-inner { padding-top: 72px; padding-bottom: 10px; }
  #view-learn .v2-learn-layout { gap: 6px; }
  .learn-topbar .learn-brand-logo { max-height: 58px; }
  .learn-main-card { margin-top: 44px; }
  /* 貨架：單行橫排、橫向捲動、scroll-snap 吸附；隱藏捲軸 */
  .learn-skill-grid {
    display: flex; flex-wrap: nowrap; gap: 14px;
    overflow-x: auto; overflow-y: hidden;
    scroll-snap-type: x mandatory;
    padding: 8px 2px 12px; margin: 0;
    scrollbar-width: none; -ms-overflow-style: none;
  }
  .learn-skill-grid::-webkit-scrollbar { display: none; }
  .learn-skill-grid .learn-card-wrap { flex: 0 0 186px; scroll-snap-align: start; }
  /* 浮動 ‹ › 箭嘴：半透明白圓掣，貼主卡左右緣中段；到盡頭自動變淡停用 */
  .learn-shelf-arrow {
    position: absolute; top: 46%; z-index: 6;
    width: 38px; height: 38px; padding: 0; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, 0.85); color: var(--brand-emerald-dark);
    border: 1px solid var(--border-soft);
    box-shadow: 0 6px 16px rgba(15, 28, 38, 0.14);
    cursor: pointer; backdrop-filter: blur(3px);
    transition: opacity 0.15s ease, background 0.15s ease;
  }
  .learn-shelf-arrow:hover { background: rgba(255, 255, 255, 0.97); }
  .learn-shelf-arrow:disabled { opacity: 0.3; pointer-events: none; }
  .learn-shelf-prev { left: 6px; }
  .learn-shelf-next { right: 6px; }
  /* 一屏收緊：右欄值日貓頁首、任務卡與卡牌庫 */
  .learn-rail { gap: 12px; }
  .learn-today-card, .learn-vault-card { padding: 16px 18px; }
  .learn-today-cat { min-height: 62px; margin-bottom: 4px; padding-right: 60px; }
  .learn-today-cat img { width: 56px; height: 56px; }
  .learn-today-full .v2-card-title { margin-bottom: 6px; }
  .learn-today-go { min-height: 42px; margin-top: 8px; padding-top: 9px; padding-bottom: 9px; }
  .learn-spine-card .learn-spine-go { min-height: 38px; padding: 6px 14px; }
  .learn-today-list { gap: 8px; }
  .learn-spine-card { padding: 8px 12px; }
  .learn-spine-main strong { font-size: 14.5px; }
  .learn-spine-main small { font-size: 11.5px; line-height: 1.35; }
  .learn-vault-card .v2-card-title { margin-bottom: 6px; }
  .vault-count { padding: 5px 4px 4px; }
  .vault-counts { gap: 6px; }
  .vault-empty { font-size: 12.5px; }
  .vault-count b { font-size: 17px; }
  .vault-empty { line-height: 1.4; }
  .learn-vault-card .vault-thumbs { max-width: 228px; margin-left: auto; margin-right: auto; width: 100%; }
  /* 打卡列收緊 */
  .learn-slot-wide { padding-top: 10px; padding-bottom: 10px; }
  .learn-slot-wide .v2-card-title { margin-bottom: 6px; }
  #learn-cats-note { margin-top: 4px; }
  .learn-cat-cell { padding: 5px 2px 4px; gap: 2px; }
  .learn-cat-name { font-size: 12px; line-height: 1.25; }
  .learn-cat-day { font-size: 11px; }
  .learn-cat-imgwrap, .learn-cat-imgwrap img { width: 36px; height: 36px; }
}
