/* ===== Batch Detail 管理 UI（public.css） ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "Microsoft JhengHei", "PingFang TC", Arial, sans-serif; background: #f4f6f9; color: #333; }

/* ===== 頂部：左標題欄 + 右按鈕區 ===== */
header { background: #243447; color: #fff; height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; }
header h1 { font-size: 17px; font-weight: normal; line-height: 52px; }
header .head-right { display: flex; align-items: center; gap: 14px; }
header .env { font-size: 12px; color: #9fb3c8; }
header .env.ok { color: #7fd6a0; }
header .env.bad { color: #f28b82; }
.btn-bar { display: flex; gap: 8px; }
.btn-bar .btn { min-width: 62px; }

/* ===== 頁籤 ===== */
nav.tabs { background: #fff; border-bottom: 1px solid #e2e6ea; padding: 0 16px; }
nav.tabs .tab { display: inline-block; padding: 12px 20px; cursor: pointer; font-size: 14px; border-bottom: 2px solid transparent; user-select: none; }
nav.tabs .tab.active { color: #1a73e8; border-bottom-color: #1a73e8; }

main { padding: 14px 16px 40px; }

/* ===== 列表：一行 5 個 ===== */
.items-grid { display: flex; flex-wrap: wrap; margin: -6px; }
.item-card { width: 20%; padding: 6px; }
.item-card .card-inner { background: #fff; border: 1px solid #e2e6ea; border-radius: 8px; padding: 8px; height: 100%; position: relative; }

/* ===== 狀態標籤：待發佈 / 已發佈（卡片右上角） ===== */
.status-badge { position: absolute; top: -9px; right: 10px; z-index: 3; font-size: 12px; line-height: 1; padding: 4px 10px; border-radius: 10px; color: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .18); }
.status-badge.st-pending { background: #f39c12; }
.status-badge.st-published { background: #28a745; }

/* ===== owl 輪播內 slide：左原圖 + 右結果圖 + 復選框（圖片統一 2:3） ===== */
.owl-carousel .slide { display: flex; align-items: center; gap: 4px; background: #fff; }
.img-box { flex: 1 1 0; min-width: 0; aspect-ratio: 2 / 3; background: #f0f2f5; border-radius: 4px; overflow: hidden; position: relative; }
.img-box img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-box .noimg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: #b6bcc5; font-size: 12px; }
/* 圖片區復選框：絕對定位到結果圖右上角 */
.img-box .slide-check { position: absolute; top: 6px; right: 6px; z-index: 2; margin: 0; }

/* ===== 復選框美化（圖片區 slide-check + 全選本組 group-check） ===== */
.slide-check, .group-check {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border: 2px solid #c3ccd6;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    transition: background .15s, border-color .15s, box-shadow .15s;
}
.slide-check:hover, .group-check:hover { border-color: #1a73e8; box-shadow: 0 0 0 3px rgba(26, 115, 232, .12); }
.slide-check:checked, .group-check:checked { background: #1a73e8; border-color: #1a73e8; }
.slide-check:checked::after, .group-check:checked::after {
    content: '';
    position: absolute;
    left: 7px;
    top: 2px;
    width: 7px;
    height: 13px;
    border: solid #fff;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
}

/* ===== 圖片描述 ===== */
.img-desc { margin-top: 8px; font-size: 12px; color: #666; line-height: 1.6; word-break: break-word; }
.img-desc:empty { display: none; }

/* owl 導航箭頭：absolute 垂直居中於圖片兩側（選擇器加權，壓過 owl.theme.css 的 opacity:.5 / font-size:12px） */
.owl-carousel { position: relative; }
.owl-carousel .owl-controls .owl-buttons { position: absolute; top: 50%; left: 0; right: 0; margin: 0; transform: translateY(-50%); display: flex; justify-content: space-between; align-items: center; padding: 0 8px; pointer-events: none; }
.owl-carousel.owl-theme .owl-controls .owl-buttons div { background: rgba(36, 52, 71, .85); color: #fff; opacity: 1; filter: none; border-radius: 50%; width: 40px; height: 40px; padding: 0; display: flex; align-items: center; justify-content: center; font-size: 18px; line-height: 1; margin: 0; box-shadow: 0 2px 6px rgba(0, 0, 0, .35); pointer-events: auto; }
.owl-carousel.owl-theme .owl-controls .owl-buttons div:hover { background: #1a73e8; color: #fff; opacity: 1; }

/* ===== 卡片行：左類型 + 右重跑 ===== */
.type-row { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; gap: 6px; }
.type-row .img-type { font-size: 12px; color: #3b6db4; background: #eef3fb; border-radius: 4px; padding: 2px 8px; white-space: nowrap; }
.type-row .btn { padding: 2px 10px; font-size: 12px; }

/* ===== 內容區：左全選本組 + 右產品名（一整行） ===== */
.name-row { display: flex; align-items: center; gap: 6px; margin-top: 8px; border-top: 1px dashed #e8eaee; padding-top: 8px; }
.name-row label { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: #666; white-space: nowrap; cursor: pointer; user-select: none; }
.name-row .pname { flex: 1; font-size: 15px; color: #1a73e8; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.name-row .pname:hover { color: #155ab6; text-decoration: underline; }

/* ===== 分頁 ===== */
.pager { text-align: center; padding: 16px 0 0; }
.pager .pg-btn { display: inline-block; min-width: 32px; padding: 4px 10px; margin: 0 3px; background: #fff; border: 1px solid #d9dee5; border-radius: 4px; cursor: pointer; font-size: 13px; }
.pager .pg-btn.cur { background: #1a73e8; border-color: #1a73e8; color: #fff; cursor: default; }
.pager .pg-btn.disabled { color: #bbb; cursor: default; }
.pager .pg-info { font-size: 12px; color: #888; margin-left: 8px; }

/* ===== 空列表 / 滾動加載提示 ===== */
.empty-tip { text-align: center; color: #999; padding: 70px 0; font-size: 14px; }
.list-status { text-align: center; color: #999; font-size: 13px; padding: 10px 0 0; }

/* ===== 加載遮罩（垂直水平居中，字體放大） ===== */
#loading { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, .35); display: none; align-items: center; justify-content: center; z-index: 99; }
#loading.show { display: flex; }
#loading .box { background: #fff; padding: 28px 48px; border-radius: 10px; font-size: 22px; color: #333; box-shadow: 0 6px 24px rgba(0, 0, 0, .22); }
