/* 圖卡背面的評分（card-back-scores.js）。數值條畫成一格一格的積木條；只用這裡的變數，不靠網站其他樣式。 */
.cbs-face { --cbs-bg: #10213f; --cbs-ink: #f2f6ff; --cbs-mute: #b4c3dc; --cbs-line: rgba(176,208,255,.2); --cbs-hover: rgba(255,255,255,.07); --cbs-sub: rgba(5,12,28,.42); --cbs-groove: rgba(176,208,255,.17); --cbs-focus: #6fd6c4;
  --c0: #76c5f3; --c1: #a9c57a; --c2: #efb16c; --c3: #bcabed; --c4: #82c9bd; padding: 0 !important; color: var(--cbs-ink); background: linear-gradient(160deg, #16305a, #0f1f3d 60%) !important; }
.theme-light .cbs-face { --cbs-ink: #14213a; --cbs-mute: #4a5a76; --cbs-line: rgba(24,48,96,.17); --cbs-hover: rgba(24,48,96,.06); --cbs-sub: #f1f5fb; --cbs-groove: rgba(24,48,96,.14); --cbs-focus: #0f7c6f;
  --c0: #1a6ba3; --c1: #4b7324; --c2: #9a5510; --c3: #6d55b5; --c4: #147d70; background: linear-gradient(160deg, #fff, #f6f9fd) !important; }
.cbs { position: absolute; inset: 0; display: flex; flex-direction: column; box-sizing: border-box; padding: 6px 10px 8px; overflow: hidden; border-radius: inherit; cursor: default; text-align: left; }
.cbs *, .cbs *::before, .cbs *::after { box-sizing: border-box; }
.cbs button { font: inherit; color: inherit; background: none; border: 0; margin: 0; padding: 0; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.cbs button:focus-visible { outline: 3px solid var(--cbs-focus); outline-offset: -3px; border-radius: 8px; }
.cbs button:disabled { cursor: default; }

/* 最上面：盒號、名稱、總分、翻回正面 */
.cbs-head { flex: none; display: flex; align-items: center; gap: 8px; min-height: 46px; padding-left: 4px; }
.cbs-who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.cbs-no { font-size: 13px; font-weight: 800; color: var(--cbs-focus); }
.cbs-name { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cbs-total { flex: none; line-height: 1.05; text-align: right; }
.cbs-total b { font-size: 22px; font-weight: 900; font-variant-numeric: tabular-nums; }
.cbs-total small { display: block; font-size: 11.5px; color: var(--cbs-mute); white-space: nowrap; }
.cbs .cbs-flip { flex: none; height: 44px; padding: 0 10px; border-radius: 11px; border: 1px solid var(--cbs-line); font-size: 13.5px; font-weight: 700; white-space: nowrap; }

/* 五大項：一列一列接著，中間只有細線，每一列至少 44px */
.cbs-list { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; scrollbar-width: thin; position: relative; }
.cbs-axis { --c: var(--c0); flex: 1 0 auto; display: flex; flex-direction: column; border-top: 1px solid var(--cbs-line); }
.cbs-axis.c1 { --c: var(--c1); } .cbs-axis.c2 { --c: var(--c2); } .cbs-axis.c3 { --c: var(--c3); } .cbs-axis.c4 { --c: var(--c4); }
.cbs .cbs-row { display: grid; align-items: center; width: 100%; min-height: 44px; min-width: 0; border-radius: 8px; }
.cbs .cbs-row:not(:disabled):active { background: var(--cbs-hover); }
@media (hover: hover) { .cbs .cbs-row:not(:disabled):hover { background: var(--cbs-hover); } }
.cbs .cbs-top { flex: 1 0 auto; grid-template-columns: 4.3em minmax(0, 1fr) 4.9em 14px; column-gap: 8px; padding: 0 4px; font-size: 15.5px; }
.cbs-top .cbs-name2 { font-weight: 800; color: var(--c); grid-column: 1; } .cbs-top .cbs-bar { grid-column: 2; grid-row: 1; height: 16px; } .cbs-top .cbs-pts { grid-column: 3; grid-row: 1; } .cbs-top .cbs-mark { grid-column: 4; grid-row: 1; }
.cbs-name2 { white-space: nowrap; }
.cbs-pts { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; } .cbs-pts b { font-weight: 800; } .cbs-pts small { font-size: .8em; color: var(--cbs-mute); } .cbs-pts.none { color: var(--cbs-mute); font-size: .85em; }
.cbs-mark { width: 9px; height: 9px; border-right: 2px solid var(--cbs-mute); border-bottom: 2px solid var(--cbs-mute); transform: translateY(-2px) rotate(45deg); justify-self: center; transition: transform .2s; }
.is-open > .cbs-top .cbs-mark { transform: translateY(2px) rotate(-135deg); }
.cbs-mark.go, .only-axes .cbs-mark, .is-wide .cbs-top .cbs-mark { transform: rotate(-45deg); }

.cbs-list.has-more { -webkit-mask-image: linear-gradient(#000 calc(100% - 34px), rgba(0,0,0,.12)); mask-image: linear-gradient(#000 calc(100% - 34px), rgba(0,0,0,.12)); }

/* 數值條：凹槽裡一格一格的積木 */
.cbs-bar { display: block; position: relative; height: 12px; border-radius: 4px; background: var(--cbs-groove); overflow: hidden; }
.cbs-fill { position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(180deg, rgba(255,255,255,.28), transparent 45%), var(--c); clip-path: inset(0 calc((1 - var(--v)) * 100%) 0 0); }
.cbs-bar::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 2px), var(--cbs-bg) calc(10% - 2px) 10%); opacity: .55; }
.theme-light .cbs-face { --cbs-bg: #fff; }
.is-play .cbs-fill { animation: cbs-grow .75s cubic-bezier(.2,.75,.25,1) both; animation-delay: calc(.28s + var(--i) * .06s); }
@keyframes cbs-grow { from { clip-path: inset(0 100% 0 0); } }

/* 展開的 4 個細項（手機兩欄兩列）＋看整項評語 */
.cbs-panel { flex: none; background: var(--cbs-sub); border-radius: 10px; }
.cbs-panel[hidden] { display: none; }
.cbs-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 2px; }
.cbs .cbs-crit { grid-template-columns: 1fr auto; row-gap: 3px; align-content: center; padding: 4px 8px; font-size: 13.5px; line-height: 1.25; }
.cbs-crit .cbs-bar { grid-column: 1 / -1; height: 10px; }
.cbs .cbs-all { grid-template-columns: 1fr 14px; padding: 0 12px 0 8px; font-size: 13.5px; font-weight: 700; color: var(--c); border-top: 1px solid var(--cbs-line); border-radius: 0 0 10px 10px; }
.cbs .is-last { animation: cbs-last 2.1s ease-out; }
@keyframes cbs-last { 0%, 55% { box-shadow: inset 0 0 0 3px var(--cbs-focus); } 100% { box-shadow: inset 0 0 0 3px transparent; } }

/* 只有五大項的盒：五條放大排滿 */
.only-axes .cbs-top { font-size: 17px; } .only-axes .cbs-top .cbs-bar { height: 22px; }

/* 電腦、平板、摺疊機展開：20 項一次列出。高度夠：大項在上、細項兩欄；不夠高：大項移到左邊，右邊還是細項兩欄 */
.cbs.is-wide { padding: 10px 16px 12px; }
.is-wide .cbs-head { min-height: 52px; gap: 12px; } .is-wide .cbs-no { font-size: 15px; } .is-wide .cbs-name { font-size: 17px; } .is-wide .cbs-total b { font-size: 28px; }
.is-wide .cbs-axis { flex-direction: row; align-items: stretch; gap: 8px; padding: 3px 0; }
.is-wide .cbs-all { display: none; }
.is-wide .cbs-panel { flex: 1; min-width: 0; display: flex; } .is-wide .cbs-grid { flex: 1; }
.cbs.is-wide:not(.is-tall) .cbs-top { flex: 0 0 25%; min-width: 92px; grid-template-columns: 1fr 12px; align-content: center; row-gap: 5px; column-gap: 2px; padding: 0 4px; }
.cbs.is-wide:not(.is-tall) .cbs-top .cbs-name2 { grid-column: 1; } .cbs.is-wide:not(.is-tall) .cbs-top .cbs-mark { grid-column: 2; grid-row: 1; width: 8px; height: 8px; }
.cbs.is-wide:not(.is-tall) .cbs-top .cbs-pts { grid-column: 1 / -1; grid-row: 2; text-align: left; } .cbs.is-wide:not(.is-tall) .cbs-top .cbs-bar { grid-column: 1 / -1; grid-row: 3; height: 12px; }
.is-tall .cbs-axis { flex-direction: column; gap: 0; } .cbs.is-tall .cbs-top { flex: 0 0 auto; font-size: 17px; } .cbs.is-tall .cbs-crit { font-size: 15.5px; } .cbs.is-tall .cbs-crit .cbs-bar { height: 13px; }

.cbs.is-roomy .cbs-crit { font-size: 15.5px; row-gap: 5px; } .cbs.is-roomy .cbs-crit .cbs-bar { height: 15px; } .cbs.is-roomy:not(.is-tall) .cbs-top .cbs-bar { height: 16px; } .cbs.is-roomy .cbs-top { font-size: 17px; }
.cbs.is-tall .cbs-crit { font-size: 17px; } .cbs.is-tall .cbs-crit .cbs-bar { height: 17px; } .cbs.is-tall .cbs-top { font-size: 19px; grid-template-columns: 4.3em minmax(0, 1fr) 5em 14px; } .cbs.is-tall .cbs-top .cbs-bar { height: 22px; }

/* 手機橫放：背面只有一百多寬、兩百高，只列五大項（點一下看整項評語），細項和盒名收起來（驗證 A 11/26） */
.cbs.is-mini { padding: 4px 6px 6px; }
.is-mini .cbs-head { min-height: 34px; gap: 4px; padding-left: 2px; }
.is-mini.has-total .cbs-who { display: none; } .is-mini .cbs-no, .is-mini .cbs-name { font-size: 11.5px; }
.is-mini .cbs-total { margin-right: auto; display: flex; align-items: baseline; gap: 3px; text-align: left; } .is-mini .cbs-total b { font-size: 17px; } .is-mini .cbs-total small { font-size: 10px; }
.cbs.is-mini .cbs-flip { height: 32px; padding: 0 7px; border-radius: 9px; font-size: 12px; }
.cbs.is-mini .cbs-top { min-height: 30px; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 5px; padding: 0 2px; font-size: 12px; }
.is-tiny .cbs-total small, .is-tiny .cbs-bar::after { display: none; } .cbs.is-tiny .cbs-flip { padding: 0 5px; font-size: 11.5px; }
.cbs.is-mini .cbs-top .cbs-bar { height: 9px; } .is-mini .cbs-top .cbs-mark { display: none; }
.cbs.is-mini .cbs-intro { padding: 2px 4px; font-size: 12px; } .is-mini .cbs-unrated { font-size: 11.5px; margin: 0 0 4px; padding: 1px 8px; } .is-mini .cbs-foot { font-size: 10px; padding: 3px 4px 0; } .is-mini .cbs-foot span:first-child { display: none; }

/* 正面的提示（盒組頁放） */
.sp-full-card { position: relative; }
.cbs-hint { position: absolute; left: 50%; bottom: 14px; z-index: 6; margin: 0; padding: 9px 16px; border-radius: 999px; background: rgba(8,16,34,.92); color: #f2f6ff; border: 1px solid #6fd6c4; font-size: 14px; font-weight: 700; white-space: nowrap; pointer-events: none; transform: translateX(-50%); animation: cbs-hint 6s ease both; }
@keyframes cbs-hint { 0% { opacity: 0; } 8%, 85% { opacity: 1; } 100% { opacity: 0; } }

/* 還沒有評分：基本介紹 */
.cbs-intro { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 8px; line-height: 1.6; font-size: 14.5px; }
.cbs-unrated { display: inline-block; margin: 2px 0 8px; padding: 3px 12px; border-radius: 8px; border: 1px dashed var(--cbs-mute); color: var(--cbs-mute); font-weight: 700; font-size: 14px; }
.cbs-intro ul { margin: 0; padding-left: 1.1em; color: inherit !important; } .cbs-mute { color: var(--cbs-mute); margin: 8px 0 0; }
.cbs-foot { flex: none; display: flex; justify-content: space-between; padding: 6px 8px 2px; font-size: 12px; color: var(--cbs-mute); }
@media (prefers-reduced-motion: reduce) { .is-play .cbs-fill, .cbs .is-last, .cbs-hint { animation: none; } .cbs-mark { transition: none; } }
