/* =========================================================
   box-details.css — 卡盒/卡包詳細頁樣式
   Design tokens mirror card-details.css naming and values.
   Spacing / font tokens defined by card-details.css are reused
   directly (card-details.css is loaded before this file).
   ========================================================= */

/* ── SSR summary for AI crawlers (mirrors card-seo-summary pattern) ─────────
   Visible to bots without JS. For human users (browser sets html.js immediately
   via inline script in <head>), the blocks become sr-only — H1 stays in DOM
   for Google's Web Rendering Service. Box is pure-SSR so no aria-busy toggle. */
.box-seo-summary {
    padding: 0.875rem 1rem;
    margin: 0 0 0.5rem;
    background: var(--bg-secondary, #f8f9fa);
    border: 1px solid var(--border-color, #e8eaed);
    border-radius: 8px;
}
.box-seo-summary__title {
    font-size: 1.375rem;
    font-weight: 700;
    margin: 0 0 0.375rem;
    color: var(--text-color, #202124);
    line-height: 1.35;
}
.box-seo-summary__desc {
    font-size: 0.875rem;
    color: var(--text-muted, #5f6368);
    margin: 0;
    line-height: 1.6;
}
.box-seo-summary__desc a { color: var(--primary-color, #1a73e8); }
.box-seo-detail {
    font-size: 0.85rem;
    color: var(--text-muted, #5f6368);
    margin: 0 0 12px;
    line-height: 1.6;
}
.box-seo-detail a { color: var(--primary-color, #1a73e8); }

/* JS users (browsers): clip these blocks to sr-only — bots skip this rule. */
html.js .box-seo-summary,
html.js .box-seo-detail {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0,0,0,0) !important;
    white-space: nowrap !important;
    border: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* ── Design tokens (light) ────────────────────────────────────────────────── */
:root {
    --primary-color: #14213d;
    --primary-hover: #0a1120;
    --accent-color:  #fca311;
    --accent-soft:   #fff3e0;     /* box-specific: subtle accent tint for hover bg */
    --text-color:    #000000;
    --text-muted:    #666666;
    --bg-color:      #e5e5e5;     /* body / lowest surface */
    --bg-secondary:  #f8f9fa;     /* elevated surface (price block, table header) */
    --card-bg:       #ffffff;
    --border-color:  #e5e5e5;
    --shadow:        0 2.5px 0 0 rgba(0, 0, 0, 0.15); /* Solid Pop 實體硬陰影,對齊 iOS solidCard */
    --shadow-hover:  0 5px 0 0 rgba(0, 0, 0, 0.18);    /* hover:加深往下偏移(仍 blur 0),配 translateY 上抬 */
}

[data-theme="dark"] {
    --primary-color: #101A31;
    --primary-hover: #0B1222;
    --accent-color:  #C17902;
    --accent-soft:   #3a2a05;
    --text-color:    #CECAC4;
    --text-muted:    #A59F97;
    --bg-color:      #272A2C;
    --bg-secondary:  #16181a;
    --card-bg:       #181A1B;
    --border-color:  #34373A;
    --shadow:        0 2.5px 0 0 rgba(0, 0, 0, 0.55); /* 深色:同款硬陰影加深才在近黑底可見 */
    --shadow-hover:  0 5px 0 0 rgba(0, 0, 0, 0.6);
}

/* ── Layout ───────────────────────────────────────────────────────────────── */
/* NOTE: do NOT set padding on #box-detail-main — ID specificity (0,1,0,0)
   would override .box-detail-grid class padding (0,0,1,0) and zero-out the
   horizontal padding, making children hug main edges. Use class rule instead. */
#box-detail-main {
    min-height: 60vh;
    margin-bottom: var(--spacing-lg);
}

/* ── Breadcrumb removed — box now uses card-details.css .breadcrumb-nav classes ── */

/* ── Outer 2-col grid (mirrors .card-details-grid: card frame + sticky col) ─ */
.box-detail-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
    background: var(--card-bg);
    padding: var(--spacing-md);
    border-radius: var(--radius-hero);   /* 主角面板 → Hero 圓角 22 */
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    align-items: start;
    width: 100%;
    margin-bottom: var(--spacing-md);
}

@media (min-width: 768px) {
    .box-detail-grid { padding: var(--spacing-lg); }
}

@media (min-width: 1024px) {
    .box-detail-grid {
        grid-template-columns: 320px 1fr;
        gap: var(--spacing-lg);
    }
}

/* ── Left column: image + CTA container (block, child uses .mt-16) ────── */
.box-image-section {
    width: 100%;
}

/* ── Sticky sidebar (desktop only: image+CTA stay in view while scrolling) ─ */
.box-sticky-sidebar {
    position: relative;
    width: 100%;
}
@media (min-width: 1024px) {
    .box-sticky-sidebar {
        position: sticky;
        /* Account for the page-header height (JS sets --page-header-sticky-offset from .page-header rect) */
        top: calc(var(--spacing-md) + var(--page-header-sticky-offset, 0px));
        align-self: start;
    }
}

/* ── Right column: vertical info stack ─────────────────────────────────── */
.box-info-section {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    min-width: 0; /* allow grid child to shrink for long content */
}

/* ── Header (mirrors .card-header: title → subtitle below) ─────────────── */
.box-header {
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--border-color);
}

/* ── Subtitle (mirrors .card-subtitle: nickname + chips inline) ────────── */
.box-subtitle {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin: 0.5rem 0 0;
    line-height: 1.4;
}
.box-subtitle__nickname {
    flex-shrink: 0;
}
.box-subtitle__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

/* ── Product image (mirrors .card-image-box: BG pattern + framed) ──────── */
.box-detail-img-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: url('../img/BG.svg') center / cover no-repeat, #ffffff;
    border-radius: var(--radius-cell);   /* 商品圖 → 格子圓角 14 */
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: var(--spacing-sm);
    box-sizing: border-box;
}
[data-theme="dark"] .box-detail-img-wrap {
    background: url('../img/BG-dark.svg') center / cover no-repeat, #181A1B;
}

@media (max-width: 767px) {
    .box-detail-img-wrap { padding: var(--spacing-xs); }
}

.box-detail-img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    object-fit: contain;
    display: block;
    transition: transform 0.3s ease;
}

.box-detail-img-wrap:hover .box-detail-img {
    transform: scale(1.04);
}

.box-detail-img-placeholder {
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    font-weight: 500;
    letter-spacing: 0.05em;
}

/* ── Type chip (mirrors .card-chip: small pill, semantic tint) ─────────── */
.box-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 7px;
    border-radius: 99px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.6;
    white-space: nowrap;
    width: fit-content;
    border: 1px solid transparent;
}
.box-type-badge[data-type="BOX"]   { background: #1967d214; color: #1967d2; border-color: #1967d233; }
.box-type-badge[data-type="PACK"]  { background: #13733314; color: #137333; border-color: #13733333; }
.box-type-badge[data-type="SET"]   { background: #7b1fa214; color: #7b1fa2; border-color: #7b1fa233; }
.box-type-badge[data-type="OTHER"] { background: var(--bg-secondary); color: var(--text-muted); border-color: var(--border-color); }

[data-theme="dark"] .box-type-badge[data-type="BOX"]   { background: #1967d220; color: #8ab4f8; border-color: #1967d240; }
[data-theme="dark"] .box-type-badge[data-type="PACK"]  { background: #13733320; color: #81c995; border-color: #13733340; }
[data-theme="dark"] .box-type-badge[data-type="SET"]   { background: #7b1fa220; color: #ce93d8; border-color: #7b1fa240; }

.box-type-badge--sm {
    font-size: var(--font-size-xs);
    padding: 0 6px;
}

/* ── Product title (responsive clamp like .card-title-jp) ──────────────── */
.box-detail-title {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
    color: var(--text-color);
    word-break: break-word;
}

/* ── Price block ──────────────────────────────────────────────────────────── */
.box-price-block {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}
.box-price-jpy {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-color);
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}
.box-price-currency {
    font-size: var(--font-size-sm);
    font-weight: 400;
    color: var(--text-muted);
    margin-left: 0.25rem;
}
.box-price-twd {
    font-size: var(--font-size-base);
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}
.box-price-unavailable {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    font-style: italic;
}

/* ── 官方定價 + 溢價倍數 chip ─────────────────────────────────────────────
   tier 由 PHP 計算 (normal/premium/surge)，CSS 用 data-tier 上色。
   暴漲 (surge) 採紅色強訊號 + 動畫 pulse，警示買家別追高。 */
.box-market-stats {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    /* Left accent bar varies by tier */
    border-left: 4px solid var(--border-color);
}
.box-market-stats[data-markup-tier="normal"]  { border-left-color: #16a34a; }
.box-market-stats[data-markup-tier="premium"] { border-left-color: #f59e0b; }
.box-market-stats[data-markup-tier="surge"]   { border-left-color: #dc2626; }

.box-stat-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
}
.box-stat-label {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    min-width: 80px;
}
.box-stat-value {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-color);
    font-variant-numeric: tabular-nums;
}
.box-stat-secondary {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

/* 溢價倍數 badge — 三階配色，明顯視覺 */
.box-markup-badge {
    display: inline-flex;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    border-radius: 999px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    border: 1.5px solid currentColor;
}
.box-markup-multiplier { font-size: 1.25rem; line-height: 1; }
.box-markup-tier-label { font-size: var(--font-size-sm); font-weight: 600; opacity: 0.9; }

.box-markup-badge[data-tier="normal"] {
    color: #166534;
    background: #dcfce7;
    border-color: #16a34a;
}
.box-markup-badge[data-tier="premium"] {
    color: #92400e;
    background: #fef3c7;
    border-color: #f59e0b;
}
.box-markup-badge[data-tier="surge"] {
    color: #ffffff;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    border-color: #b91c1c;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.35);
    animation: surgePulse 2s ease-in-out infinite;
}
@keyframes surgePulse {
    0%, 100% { box-shadow: 0 2px 8px rgba(220, 38, 38, 0.35); }
    50%      { box-shadow: 0 2px 16px rgba(220, 38, 38, 0.6); }
}

/* Dark mode tweaks */
[data-theme="dark"] .box-markup-badge[data-tier="normal"]  { background: rgba(22,163,74,0.18);  color: #4ade80; }
[data-theme="dark"] .box-markup-badge[data-tier="premium"] { background: rgba(245,158,11,0.18); color: #fbbf24; }
/* surge stays the same — red gradient + white text reads well in dark too */

/* Respect reduced motion — turn off the surge pulse */
@media (prefers-reduced-motion: reduce) {
    .box-markup-badge[data-tier="surge"] { animation: none; }
}

/* ── Snkrdunk 庫存 chip ────────────────────────────────────────────────── */
.box-stock-block {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
}
.box-stock-label {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    min-width: 80px;
}
.box-stock-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.9375rem;
    border: 1.5px solid currentColor;
}
.box-stock-dot {
    width: 0.625rem;
    height: 0.625rem;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}
/* 已售完：紅色（風險訊號）*/
.box-stock-badge[data-tier="soldout"] {
    color: #dc2626;
    background: #fee2e2;
    border-color: #fca5a5;
}
/* 稀少：橘黃（限定訊號）*/
.box-stock-badge[data-tier="limited"] {
    color: #b45309;
    background: #fef3c7;
    border-color: #fbbf24;
}
/* 充裕：綠（充足訊號）*/
.box-stock-badge[data-tier="plenty"] {
    color: #166534;
    background: #dcfce7;
    border-color: #86efac;
}

[data-theme="dark"] .box-stock-badge[data-tier="soldout"] { background: rgba(220,38,38,0.18); color: #f87171; }
[data-theme="dark"] .box-stock-badge[data-tier="limited"] { background: rgba(245,158,11,0.18); color: #fbbf24; }
[data-theme="dark"] .box-stock-badge[data-tier="plenty"]  { background: rgba(22,163,74,0.18); color: #4ade80; }

/* Mobile: stack label + badge if tight */
@media (max-width: 480px) {
    .box-stat-row, .box-stock-block {
        flex-wrap: wrap;
    }
    .box-stat-label, .box-stock-label { min-width: unset; }
}

/* ── Metadata list ────────────────────────────────────────────────────────── */
.box-meta {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs) var(--spacing-sm);
}
.box-meta__item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}
.box-meta__icon { font-size: var(--font-size-base); }

/* ── CTA button (mirrors .action-btn: accent bg + black text, WCAG-safe) ─ */
.btn-snkrdunk {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: var(--min-touch-target);
    padding: 12px;
    background-color: var(--accent-color);
    color: #000;
    font-size: var(--font-size-base);
    font-weight: 600;
    border-radius: var(--radius-btn);   /* 按鈕圓角 16 */
    text-decoration: none;
    transition: opacity 0.2s;
    border: none;
    cursor: pointer;
}
.btn-snkrdunk:hover  { opacity: 0.9; }
.btn-snkrdunk:active { opacity: 0.95; }
.btn-snkrdunk:disabled,
.btn-snkrdunk[aria-disabled="true"] {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

/* ── Keyboard focus (WCAG 2.1 AA) ─────────────────────────────────────────── */
.btn-snkrdunk:focus-visible,
.box-related-card:focus-visible,
.box-pack-tab:focus-visible,
.box-tx-nav-btn:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* ── Disclaimer ───────────────────────────────────────────────────────────── */
.box-detail-disclaimer {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin: 0;
    line-height: var(--line-height-base);
}

/* ── Price chart (inner data-section, no shadow — nested in outer card) ──── */
.box-chart-section {
    padding: var(--spacing-sm);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
}

.box-chart-heading {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0 0 var(--spacing-sm);
}

/* ── Time-range chart controls (mirrors card .chart-controls + .btn-range) ─ */
.box-chart-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.box-btn-range {
    appearance: none;
    -webkit-appearance: none;
    padding: 4px 12px;
    border-radius: 99px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.4;
    min-height: 28px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    white-space: nowrap;
}
.box-btn-range:hover {
    background: var(--accent-soft);
    border-color: var(--accent-color);
    color: var(--accent-color);
}
.box-btn-range.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #000;
    font-weight: 600;
}
.box-btn-range:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* Section title — allow controls to wrap to right side, title left */
.box-market-section .box-section-title {
    flex-wrap: wrap;
    gap: 8px 12px;
}

/* Pack size selector tabs — horizontal scroll strip (works on mobile + desktop) */
.box-pack-tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 6px;
    margin-bottom: var(--spacing-sm);
    padding: 2px 2px 6px;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
    -webkit-overflow-scrolling: touch;
}
.box-pack-tabs::-webkit-scrollbar { height: 4px; }
.box-pack-tabs::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }
.box-pack-tabs::-webkit-scrollbar-track { background: transparent; }

.box-pack-tab {
    flex: 0 0 auto;
    scroll-snap-align: start;
    padding: 4px 10px;
    border-radius: 99px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-muted);
    font-size: var(--font-size-xs);
    font-weight: 500;
    line-height: 1.6;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    white-space: nowrap;
}
.box-pack-tab:hover {
    background: var(--accent-soft);
    border-color: var(--accent-color);
    color: var(--accent-color);
}
.box-pack-tab--active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #000;  /* WCAG: black on amber ≈ 10:1 (light + dark mode both) */
}

/* ── Pack tier color palette (mirrors card grade-tag categorical colors) ─
   tier mapping (pack_count):
     xs:1-3  sm:4-9  md:10-29  lg:30-69  xl:70+   na:fallback */
/* 3-tier palette mirrors card PSA chart: sm 紅 / md 紫 / lg 藍 */
.box-pack-tab[data-tier="sm"] { background: rgba(255,82,82,0.10);   color: #c5221f; border-color: rgba(255,82,82,0.40); }
.box-pack-tab[data-tier="md"] { background: rgba(126,87,194,0.10);  color: #5e35b1; border-color: rgba(126,87,194,0.40); }
.box-pack-tab[data-tier="lg"] { background: rgba(41,182,246,0.10);  color: #0277bd; border-color: rgba(41,182,246,0.40); }

[data-theme="dark"] .box-pack-tab[data-tier="sm"] { background: rgba(255,82,82,0.16);  color: #FF8A80; border-color: rgba(255,82,82,0.45); }
[data-theme="dark"] .box-pack-tab[data-tier="md"] { background: rgba(126,87,194,0.18); color: #B39DDB; border-color: rgba(126,87,194,0.45); }
[data-theme="dark"] .box-pack-tab[data-tier="lg"] { background: rgba(41,182,246,0.18); color: #81D4FA; border-color: rgba(41,182,246,0.45); }

/* Active state always wins: amber bg + black text */
.box-pack-tab.box-pack-tab--active[data-tier] {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #000;
}

/* Chart canvas container */
.box-chart-wrap {
    position: relative;
    width: 100%;
    height: 280px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
}

.box-chart-wrap canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.box-chart-note {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin: var(--spacing-xs) 0 0;
}

.box-chart-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

/* ── Transaction history (inner data-section, no shadow) ──────────────── */
.box-data-section {
    padding: var(--spacing-sm);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
}

.box-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0 0 var(--spacing-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Breakpoints mirror card-details.css .transaction-grid (600 / 1000).
   minmax(0, 1fr) — NOT plain 1fr — otherwise long content (formula) forces track expansion. */
.box-transaction-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--spacing-sm);
}
@media (min-width: 600px) {
    .box-transaction-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1000px) {
    .box-transaction-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Collapsed = keep only 2 rows visible. Strategy: hide ALL, then re-show first N. */
.box-transaction-grid.is-collapsed .box-transaction-column {
    display: none;
}
.box-transaction-grid.is-collapsed .box-transaction-column:nth-child(-n+2) {
    display: flex; /* mobile 1col × 2 rows = 2 items */
}
@media (min-width: 600px) {
    .box-transaction-grid.is-collapsed .box-transaction-column:nth-child(-n+4) {
        display: flex; /* tablet 2col × 2 rows = 4 items */
    }
}
@media (min-width: 1000px) {
    .box-transaction-grid.is-collapsed .box-transaction-column:nth-child(-n+6) {
        display: flex; /* desktop 3col × 2 rows = 6 items */
    }
}

/* Expand button container (mirrors .more-btn-container) */
.box-more-btn-container {
    display: flex;
    justify-content: center;
    margin-top: var(--spacing-sm);
}
/* HTML `hidden` attr must override the `display: flex` above (class beats UA stylesheet) */
.box-more-btn-container[hidden] {
    display: none !important;
}
.box-btn-expand-trans {
    width: auto;
    min-width: 200px;
    max-width: 360px;
    padding: 10px 24px;
    background-color: var(--bg-secondary);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    font-weight: 500;
}
.box-btn-expand-trans:hover {
    opacity: 1;
    background-color: var(--accent-color);
    color: #000;
    border-color: var(--accent-color);
}

/* mirrors .transaction-column: card-bg + card padding/gap */
.box-transaction-column {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 10px 10px 8px;
    min-width: 0; /* let flex item shrink below content size */
    /* NO overflow: hidden — that was clipping text. Inner table-container has its own overflow-x:auto */
}

.box-tx-column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-color);
    min-width: 0;
}
/* Header children: badge stays natural size, count stays fixed; both never shrink */
.box-tx-column-header .box-pack-badge {
    flex-shrink: 0;
}
.box-tx-record-count {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.box-pack-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    background: var(--accent-color);
    color: #000;
    white-space: nowrap;
    border: 1px solid transparent;
}
/* Pack badge — same 3-tier palette as .box-pack-tab above */
.box-pack-badge[data-tier="sm"] { background: rgba(255,82,82,0.10);   color: #c5221f; border-color: rgba(255,82,82,0.40); }
.box-pack-badge[data-tier="md"] { background: rgba(126,87,194,0.10);  color: #5e35b1; border-color: rgba(126,87,194,0.40); }
.box-pack-badge[data-tier="lg"] { background: rgba(41,182,246,0.10);  color: #0277bd; border-color: rgba(41,182,246,0.40); }

[data-theme="dark"] .box-pack-badge[data-tier="sm"] { background: rgba(255,82,82,0.16);  color: #FF8A80; border-color: rgba(255,82,82,0.45); }
[data-theme="dark"] .box-pack-badge[data-tier="md"] { background: rgba(126,87,194,0.18); color: #B39DDB; border-color: rgba(126,87,194,0.45); }
[data-theme="dark"] .box-pack-badge[data-tier="lg"] { background: rgba(41,182,246,0.18); color: #81D4FA; border-color: rgba(41,182,246,0.45); }

/* ── Transaction list (flex rows, NOT table) ──────────────────────────────
   Why not <table>: in a 220px-wide column on desktop 3-col layout, a 2-col
   table with cell padding (8×4=32px wasted) + nowrap content overflows.
   Flex row solves it: date hugs left, price hugs right via justify-between,
   no padding waste, no horizontal scrollbar, naturally RWD. */
.box-transaction-list-container {
    max-height: 250px;
    overflow-y: auto;
    overflow-x: hidden;          /* never horizontal scroll — flex always fits */
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--card-bg);
    box-shadow: var(--shadow);
    -webkit-overflow-scrolling: touch;
    min-width: 0;
}

/* Sticky list header (mimics table thead) */
.box-tx-list-header {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 10px;
    background: var(--bg-color);
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--text-muted);
    position: sticky;
    top: 0;
    z-index: 1;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.box-tx-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.box-tx-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9375rem;   /* 15px — bumped to match card */
    line-height: 1.4;
}
.box-tx-row:last-child { border-bottom: none; }
.box-tx-row:hover     { background: var(--bg-secondary); }

/* ── Date cell (year + month-day, inline by default, stacks when narrow) ── */
.box-tx-date {
    flex-shrink: 0;
    white-space: nowrap;
    color: var(--text-color);
    font-variant-numeric: tabular-nums;
}
.box-tx-date-y::after { content: '-'; }
.box-tx-date-y,
.box-tx-date-md { display: inline; }

.box-tx-price-block {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    min-width: 0;
    text-align: right;
}

/* Container query — mirror card breakpoints (280 / 240) for visual parity.
   Base 15px row / 16px unit. Floor 13px row / 14px unit (≥12px WCAG). */
.box-transaction-column {
    container-type: inline-size;
    container-name: box-tx-col;
}
@container box-tx-col (max-width: 280px) {
    .box-tx-row         { font-size: 0.875rem; padding: 7px 10px; gap: 10px; }  /* 14px row */
    .box-tx-unit        { font-size: 0.9375rem; }                                /* 15px unit */
    .box-tx-formula     { font-size: 0.75rem; }                                  /* 12px */
    .box-tx-list-header { padding: 6px 10px; font-size: 0.75rem; }
}
@container box-tx-col (max-width: 240px) {
    .box-tx-row         { font-size: 0.8125rem; padding: 6px 8px; gap: 8px; }   /* 13px row */
    .box-tx-unit        { font-size: 0.875rem; }                                 /* 14px (floor) */
    .box-tx-formula     { font-size: 0.75rem; }                                  /* 12px (floor) */
    .box-tx-list-header { padding: 6px 8px; font-size: 0.75rem; }

    /* Stack date vertically: year on top, month-day below (mirror card pattern) */
    .box-tx-date-y::after { content: none; }
    .box-tx-date-y,
    .box-tx-date-md { display: block; }
    .box-tx-date-y  { font-size: 0.75rem; color: var(--text-muted); line-height: 1.2; }
    .box-tx-date-md { font-weight: 500; line-height: 1.2; }
}

/* Unit price (primary line in price-block) + formula (small breakdown line) */
.box-tx-unit {
    display: block;
    font-weight: 700;
    color: var(--text-color);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    font-size: 1rem;              /* 16px — primary price, slightly larger than row base */
}
.box-tx-formula {
    display: block;
    margin-top: 1px;
    font-size: 0.8125rem;         /* 13px — secondary metadata (was 12px, bumped) */
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    opacity: 0.85;
    white-space: nowrap;
}

.box-transaction-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    padding: 5px 0 2px;
}

.box-tx-page-label {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    min-width: 44px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.box-tx-nav-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-color);
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    flex-shrink: 0;
    padding: 0;
    line-height: 1;
}
.box-tx-nav-btn:disabled { opacity: 0.35; cursor: default; }
.box-tx-nav-btn:not(:disabled):hover {
    background: var(--accent-color);
    color: #000;
    border-color: var(--accent-color);
}

.box-tx-no-history {
    padding: var(--spacing-lg);
    text-align: center;
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

/* ── Related products (inner data-section, no shadow) ─────────────────── */
.box-related {
    padding: var(--spacing-sm);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
}

.box-related__heading {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0 0 var(--spacing-sm);
}

.box-related-grid {
    display: grid;
    /* 桌機 2 排 × 3 個 = 6（完整顯示），手機 2 排 × 2 個 = 4（nth-child 隱藏第 5/6） */
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--spacing-sm);
}
@media (max-width: 640px) {
    .box-related-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    /* 手機只顯示前 4 個（2 排 × 2 col）— 第 5/6 隱藏避免 1 排 1 個的孤兒尾巴 */
    .box-related-grid .box-related-card:nth-child(n+5) {
        display: none;
    }
}

@media (max-width: 480px) {
    .box-related-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-xs);
    }
}

/* ── Related card ─────────────────────────────────────────────────────────── */
.box-related-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-cell);   /* 相關卡盒格子 → 圓角 14 */
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}
.box-related-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
    border-color: var(--accent-color);
}

.box-related-img-wrap {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: url('../img/BG.svg') center / cover no-repeat, #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: var(--spacing-xs);
    box-sizing: border-box;
}
[data-theme="dark"] .box-related-img-wrap {
    background: url('../img/BG-dark.svg') center / cover no-repeat, #181A1B;
}

.box-related-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: transform 0.25s ease;
}
.box-related-card:hover .box-related-img { transform: scale(1.05); }

.box-related-info {
    padding: 0.625rem 0.75rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    flex: 1;
}

.box-related-title {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-color);
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.box-related-price {
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: var(--accent-color);
    margin: 0;
    margin-top: auto;
    padding-top: 0.25rem;
    font-variant-numeric: tabular-nums;
}
.box-related-price--na {
    color: var(--text-muted);
    font-weight: 400;
}

/* ── 404 state ────────────────────────────────────────────────────────────── */
.box-not-found {
    text-align: center;
    padding: 5rem var(--spacing-sm) var(--spacing-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
}
.box-not-found__icon { font-size: 4rem; line-height: 1; }
.box-not-found__title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-color);
}
.box-not-found__desc {
    color: var(--text-muted);
    margin: 0;
    font-size: var(--font-size-sm);
}

/* ── Fade-in animation ────────────────────────────────────────────────────── */
.fade-in-img {
    animation: fadeInImg 0.4s ease-out both;
}
@keyframes fadeInImg {
    from { opacity: 0; transform: scale(0.97); }
    to   { opacity: 1; transform: scale(1); }
}

/* ── Reduced motion (a11y) ───────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .box-detail-img,
    .box-related-img,
    .box-related-card,
    .box-pack-tab,
    .box-tx-nav-btn,
    .btn-snkrdunk,
    .fade-in-img {
        transition: none !important;
        animation: none !important;
    }
}


/* ─── .box-related--top-cards modifier ──────────────────────────────────────
   本系列高價卡 section 完全沿用 card_details.php 的 .box-related 結構，這裡
   只 override：(1) grid 列數 桌機 3 / 手機 2、(2) info row 固定高度避免 y 軸
   跳動、(3) 條件 badge (PSA10/A/B) 以絕對定位放圖片右上角當 overlay。
   其餘 hover / BG.svg / badge 色階 / see-all 按鈕全部從 card-details.css 繼承。
*/
.box-related--top-cards .box-related-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* info 區排版：title (2-line clamp) → price-row (price + condition inline)
   兩段位置統一避免 y 軸跳動。price-row margin-top:auto 推到底部對齊。 */
.box-related--top-cards .box-related-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 78px;
}
.box-related--top-cards .box-related-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
    min-height: 2.6em;
}
/* 價格 + 條件 badge 並排（PSA10/A/B/C/D 放價格右邊或下方）
   flex-wrap：窄卡片自動換行成 2 行，不擠壓 */
.box-related--top-cards .box-related-price-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: auto;
}
.box-related--top-cards .box-related-price-row .box-related-price {
    margin: 0;
}
/* condition-label 在 price-row 內 — 靠右 + 與 price 垂直置中
   align-items:center 已在父層 .box-related-price-row 上 → 垂直置中
   margin-left:auto → 推到 row 的最右側 */
.box-related--top-cards .box-related-price-row .condition-label {
    margin-left: auto;
    align-self: center;
}

.box-related--top-cards .box-related-img-wrap {
    position: relative;
}

/* ─────────────────────────────────────────────────────────────────────────
   Rarity overlay — 圖片右上角徽章
   設計原則（重設計：解決黑夜模式透明看不清）：
     1. **實心背景** 取代漸層/透明 — 任何卡牌底色下都讀得到
     2. **白色 1px halo + drop shadow** — 從圖片任何顏色都能浮出來
     3. **每個 rarity 一組高對比色配色**（WCAG AA 4.5:1）
     4. **dark mode override**：強化 shadow 不削弱實心 bg
     5. **不擋圖**：8px square 邊距，pointer-events:none 不阻 click
   ───────────────────────────────────────────────────────────────────────── */
.box-rarity-overlay {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 2;
    padding: 3px 7px;
    min-width: 24px;
    border-radius: 6px;
    font-size: 0.6875rem;
    font-weight: 800;
    letter-spacing: 0.4px;
    text-align: center;
    line-height: 1.25;
    white-space: nowrap;
    pointer-events: none;
    /* halo + 陰影：讓 badge 從任何卡牌底色「浮」出來 */
    box-shadow:
        0 0 0 1.5px rgba(255, 255, 255, 0.92),
        0 2px 6px rgba(0, 0, 0, 0.28);
    /* fallback (rarity unknown) — 高對比中性配色 */
    background: #1f2937;
    color: #fff;
}

/* Per-rarity solid colors — WCAG AA 對比合格，無透明 */
.box-rarity-overlay[data-rarity="UR"]     { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); color: #fff; }
.box-rarity-overlay[data-rarity="HR"]     { background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%); color: #fff; }
.box-rarity-overlay[data-rarity="SAR"]    { background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%); color: #4a2200; }
.box-rarity-overlay[data-rarity="SIR"]    { background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%); color: #fff; }
.box-rarity-overlay[data-rarity="SSR"],
.box-rarity-overlay[data-rarity="SR"]     { background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%); color: #4a2200; }
.box-rarity-overlay[data-rarity="CSR"]    { background: linear-gradient(135deg, #fde047 0%, #ca8a04 100%); color: #4a2200; }
.box-rarity-overlay[data-rarity="AR"]     { background: linear-gradient(135deg, #c084fc 0%, #9333ea 100%); color: #fff; }
.box-rarity-overlay[data-rarity="IR"]     { background: linear-gradient(135deg, #a78bfa 0%, #7c3aed 100%); color: #fff; }
.box-rarity-overlay[data-rarity="CHR"]    { background: linear-gradient(135deg, #d946ef 0%, #a21caf 100%); color: #fff; }
.box-rarity-overlay[data-rarity="RRR"]    { background: linear-gradient(135deg, #60a5fa 0%, #1d4ed8 100%); color: #fff; }
.box-rarity-overlay[data-rarity="RR"]     { background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%); color: #fff; }
.box-rarity-overlay[data-rarity="BREAK"]  { background: linear-gradient(135deg, #fb923c 0%, #c2410c 100%); color: #fff; }
.box-rarity-overlay[data-rarity="PR"],
.box-rarity-overlay[data-rarity="TR"]     { background: linear-gradient(135deg, #ec4899 0%, #be185d 100%); color: #fff; }
.box-rarity-overlay[data-rarity="H"]      { background: linear-gradient(135deg, #fb7185 0%, #e11d48 100%); color: #fff; }
.box-rarity-overlay[data-rarity="R"]      { background: #f59e0b; color: #4a2200; }
.box-rarity-overlay[data-rarity="U"]      { background: #16a34a; color: #fff; }
.box-rarity-overlay[data-rarity="C"]      { background: #6b7280; color: #fff; }
.box-rarity-overlay[data-rarity="A"]      { background: linear-gradient(135deg, #818cf8 0%, #4f46e5 100%); color: #fff; }
.box-rarity-overlay[data-rarity="K"]      { background: linear-gradient(135deg, #f59e0b 0%, #a16207 100%); color: #fff; }
.box-rarity-overlay[data-rarity="S"]      { background: linear-gradient(135deg, #a78bfa 0%, #7c3aed 100%); color: #fff; }
.box-rarity-overlay[data-rarity="LEGEND"] { background: linear-gradient(135deg, #fde047 0%, #d97706 100%); color: #4a2200; font-size: 0.625rem; }
.box-rarity-overlay[data-rarity="ACE"]    { background: linear-gradient(135deg, #fb7185 0%, #9f1239 100%); color: #fff; }

/* Dark mode：solid bg 都已是高飽和色不需變，加強 halo 跟 shadow 對抗暗背景 */
[data-theme="dark"] .box-rarity-overlay {
    box-shadow:
        0 0 0 1.5px rgba(255, 255, 255, 0.78),
        0 2px 8px rgba(0, 0, 0, 0.55);
}

/* 手機 2 col + 第 5/6 隱藏（user 要求避免跑版，只顯示 2 排 × 2 個 = 4） */
@media (max-width: 640px) {
    .box-related--top-cards .box-related-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .box-related--top-cards .box-related-card:nth-child(n+5) {
        display: none;
    }
    .box-related--top-cards .box-related-info {
        min-height: 70px;
    }
    /* 手機卡片較窄 — rarity overlay 縮小 px + 邊距，不擋圖 */
    .box-rarity-overlay {
        top: 4px;
        right: 4px;
        padding: 2px 6px;
        font-size: 0.625rem;
        min-width: 22px;
    }
}

/* ─────────────────────────────────────────────────────────────────────────
   Markup overlay — section[4] 相關卡包商品 右上角溢價倍數徽章
   設計語意：紅漲綠跌（東亞金融慣例 / TradingView / 雅虎股市 / Yahoo Finance JP）
     ratio = unit_price / regular_price
       ≥1.5: extreme-up    暴漲（深紅 + pulse 警示）
       1.0~1.5: up         暴漲（紅）
       0.7~1.0: down       暴跌（綠）
       <0.7: extreme-down  暴跌（深綠 + pulse 警示）

   結構：兩列堆疊（上=▲暴漲/▼暴跌 文字標籤，下=倍數）
     - 上方標籤字小、權重重，視為「方向 indicator」
     - 下方倍數字大、tabular-nums，視為「資料 data primary」
   無障礙：
     - 紅綠色盲依賴 ▲▼ arrow + 文字「暴漲/暴跌」雙重編碼（color-not-only）
     - 對比 ≥ 4.5:1 (WCAG AA)：紅底/綠底白字、深紅/深綠白字
     - prefers-reduced-motion 關掉 pulse
     - aria-label 完整描述（PHP 端輸出）
   ───────────────────────────────────────────────────────────────────────── */
.box-related-grid .box-related-img-wrap { position: relative; }

.box-markup-overlay {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 2;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    min-width: 44px;
    padding: 4px 7px 5px;
    border-radius: 8px;
    line-height: 1;
    white-space: nowrap;
    pointer-events: none;
    font-variant-numeric: tabular-nums;
    box-shadow:
        0 0 0 1.5px rgba(255, 255, 255, 0.92),
        0 2px 6px rgba(0, 0, 0, 0.28);
}
.box-markup-label {
    font-size: 0.625rem;       /* 10px — 標籤字小 */
    font-weight: 700;
    letter-spacing: 0.4px;
    opacity: 0.96;
}
.box-markup-value {
    font-size: 0.9375rem;      /* 15px — 倍數字大，視為 primary data */
    font-weight: 900;
    letter-spacing: 0;
    margin-top: 1px;
}

/* ─ 漲 — red family（高於官方定價）─ */
.box-markup-overlay[data-tier="up"] {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
}
.box-markup-overlay[data-tier="extreme-up"] {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    color: #fff;
    animation: markupSurge 2s ease-in-out infinite;
}
/* ─ 跌 — green family（低於官方定價）─ */
.box-markup-overlay[data-tier="down"] {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
}
.box-markup-overlay[data-tier="extreme-down"] {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: #fff;
    animation: markupSurge 2s ease-in-out infinite;
}
@keyframes markupSurge {
    0%, 100% { box-shadow: 0 0 0 1.5px rgba(255,255,255,0.92), 0 2px 6px rgba(0,0,0,0.28); }
    50%      { box-shadow: 0 0 0 1.5px rgba(255,255,255,0.92), 0 0 14px rgba(220,38,38,0.0), 0 2px 14px rgba(0,0,0,0.45); }
}
[data-tier="extreme-up"]   { /* 紅光強化 hint via shadow tint on tier */ }
.box-markup-overlay[data-tier="extreme-up"]   { box-shadow: 0 0 0 1.5px rgba(255,255,255,0.92), 0 0 0 rgba(0,0,0,0), 0 2px 8px rgba(220,38,38,0.55); }
.box-markup-overlay[data-tier="extreme-down"] { box-shadow: 0 0 0 1.5px rgba(255,255,255,0.92), 0 0 0 rgba(0,0,0,0), 0 2px 8px rgba(5,150,105,0.55); }

/* ─ Dark mode：halo + shadow 加重，色相不變（紅/綠語意保留）─ */
[data-theme="dark"] .box-markup-overlay {
    box-shadow:
        0 0 0 1.5px rgba(255, 255, 255, 0.82),
        0 2px 10px rgba(0, 0, 0, 0.65);
}
[data-theme="dark"] .box-markup-overlay[data-tier="extreme-up"] {
    box-shadow:
        0 0 0 1.5px rgba(255, 255, 255, 0.82),
        0 2px 14px rgba(239,68,68,0.7);
}
[data-theme="dark"] .box-markup-overlay[data-tier="extreme-down"] {
    box-shadow:
        0 0 0 1.5px rgba(255, 255, 255, 0.82),
        0 2px 14px rgba(16,185,129,0.7);
}

/* ─ Reduced motion：關掉 pulse（強制顯示靜止深色 shadow）─ */
@media (prefers-reduced-motion: reduce) {
    .box-markup-overlay[data-tier="extreme-up"],
    .box-markup-overlay[data-tier="extreme-down"] { animation: none; }
}

/* ─ 手機 ≤ 640px：縮小 + 縮排避免擠壓圖片，但仍保持兩列可讀 ─ */
@media (max-width: 640px) {
    .box-markup-overlay {
        top: 4px;
        right: 4px;
        min-width: 38px;
        padding: 3px 6px 4px;
        border-radius: 7px;
    }
    .box-markup-label { font-size: 0.5625rem; letter-spacing: 0.3px; }   /* 9px */
    .box-markup-value { font-size: 0.8125rem; }                          /* 13px */
}
