/* LINE 卡片頂端橫幅的設定畫面(public/card-banner-ui.js):平台管理頁的「卡片廣告」與設定頁的「LINE 卡片活動橫幅」共用,只用 .cbu- 開頭的名字。
 * 商米舊 WebView 守則同 app.css:橫排用 margin 隔開、不靠 flex gap;不用 grid、:has()、:is()、min()、clamp()。觸控區一律 >= 44px。
 * 注意:.set-card label / .set-card input 在 app.css 是「直排 + 方框輸入」,特異性比單一 class 高,
 * 所以這裡的勾選、單選、開關、輸入框一律寫成 .cbu label.xxx / .cbu input.xxx 才蓋得過去。 */
.cbu { text-align: left; }
.cbu-note { margin: 8px 0; padding: 10px 12px; border-radius: 10px; background: #f1f5fb; color: #34415a; line-height: 1.65; font-size: 13.5px; }
.cbu-note.warn { background: #fff4e0; color: #8a4b00; }

/* ---------- 區塊小標 ---------- */
.cbu-sub { margin: 18px 0 4px; font-weight: 800; font-size: 15px; color: var(--ink); }
.cbu-sub small { font-weight: 600; font-size: 12.5px; color: var(--muted); margin-left: 6px; }
.cbu-sec { margin: 12px 0 0; padding: 12px 14px 6px; background: #fafbfd; border: 1px solid var(--line); border-radius: 12px; }
.cbu-sec-t { margin: 0 0 6px; font-weight: 800; font-size: 14px; color: var(--ink); }
.cbu-sec-t::before { content: ''; display: inline-block; width: 4px; height: 14px; margin-right: 8px; border-radius: 2px; background: var(--accent); vertical-align: -2px; }

/* ---------- 開關列(總開關、啟用這一則) ---------- */
.cbu label.cbu-switch { display: block; position: relative; min-height: 48px; margin: 8px 0; padding: 14px 70px 10px 14px; box-sizing: border-box; border: 1px solid var(--line); border-radius: 12px; background: #fff; font-size: 14.5px; font-weight: 700; line-height: 22px; cursor: pointer; }
.cbu label.cbu-switch small { display: block; font-weight: 400; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.cbu label.cbu-switch > input { -webkit-appearance: none; -moz-appearance: none; appearance: none; position: absolute; right: 14px; top: 11px; width: 46px; height: 26px; min-height: 0; margin: 0; padding: 0; border: 0; border-radius: 13px; cursor: pointer; background-color: #c5cad4; background-image: radial-gradient(circle, #fff 0, #fff 10px, rgba(255, 255, 255, 0) 11px); background-repeat: no-repeat; background-size: 26px 26px; background-position: 0 0; -webkit-transition: background-color .15s, background-position .15s; transition: background-color .15s, background-position .15s; }
.cbu label.cbu-switch > input:checked { background-color: var(--ok); background-position: 20px 0; }
.cbu label.cbu-switch.on { border-color: #b7e0c0; background: #f4fbf6; }

/* ---------- 單選:膠囊 ---------- */
.cbu-pills { display: block; margin: 2px 0 6px; }
.cbu label.cbu-opt { display: inline-block; position: relative; min-height: 44px; margin: 0 8px 8px 0; padding: 0 16px 0 40px; box-sizing: border-box; border: 1.5px solid var(--line); border-radius: 999px; background: #fff; font-size: 14.5px; font-weight: 700; line-height: 41px; cursor: pointer; white-space: nowrap; }
.cbu label.cbu-opt > input { position: absolute; left: 14px; top: 11px; width: 18px; height: 18px; min-height: 0; margin: 0; padding: 0; }
.cbu label.cbu-opt.on { border-color: var(--accent); background: #eaf3fd; color: #0b4f94; }
.cbu label.cbu-opt.wide { display: block; white-space: normal; line-height: 1.5; padding: 10px 14px 10px 40px; border-radius: 12px; margin-right: 0; }
.cbu label.cbu-opt.wide > input { top: 13px; }

/* ---------- 多選:卡片式勾選 ---------- */
.cbu-chks { margin: 6px 0; }
.cbu label.cbu-chk { display: block; position: relative; min-height: 44px; margin: 0 0 8px; padding: 10px 14px 10px 42px; box-sizing: border-box; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; font-size: 14.5px; font-weight: 700; line-height: 1.5; cursor: pointer; }
.cbu label.cbu-chk > input { position: absolute; left: 14px; top: 12px; width: 18px; height: 18px; min-height: 0; margin: 0; padding: 0; }
.cbu label.cbu-chk small { display: block; margin: 1px 0 0; font-weight: 400; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.cbu label.cbu-chk.on { border-color: var(--accent); background: #eaf3fd; }
.cbu label.cbu-chk.plain { padding-top: 8px; padding-bottom: 8px; border-width: 1px; font-weight: 600; margin-bottom: 4px; }
.cbu-cos { max-height: 220px; overflow: auto; margin: 6px 0; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }

/* ---------- 橫幅清單 ---------- */
.cbu-list { margin: 8px 0; }
.cbu-empty { margin: 8px 0; padding: 22px 14px; text-align: center; color: var(--muted); font-size: 14px; border: 1.5px dashed var(--line); border-radius: 12px; background: #fcfcfd; }
.cbu-ad { border: 1px solid var(--line); border-radius: 14px; margin: 10px 0; background: #fff; overflow: hidden; }
.cbu-ad.open { border-color: var(--accent); box-shadow: 0 2px 10px rgba(25, 113, 194, .12); }
.cbu-head { display: block; padding: 12px; }
.cbu-top { display: block; }
.cbu-th { float: left; width: 72px; height: 46px; margin: 0 12px 0 0; border-radius: 8px; background-size: cover; background-position: center; background-color: #e4e8ee; overflow: hidden; color: #fff; font-weight: 800; font-size: 12px; line-height: 1.2; text-align: center; }
.cbu-th b { display: block; padding: 6px 4px; word-break: break-all; }
.cbu-main { overflow: hidden; }
.cbu-title { font-weight: 800; font-size: 15.5px; line-height: 1.4; word-break: break-all; }
.cbu-meta { color: var(--muted); font-size: 12.5px; line-height: 1.7; margin-top: 3px; }
.cbu-nums { margin-top: 6px; padding: 6px 10px; border-radius: 8px; background: #f4f6f9; color: #3d4659; font-size: 12.5px; line-height: 1.6; clear: both; }
.cbu-chip { display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; margin-right: 8px; background: #e9ecef; color: #495057; vertical-align: 2px; }
.cbu-chip.on { background: #d3f9d8; color: #1b6b2c; }
.cbu-chip.warn { background: #fff0cc; color: #8a5a00; }
.cbu-btns { margin-top: 8px; clear: both; }
.cbu-btns button, .cbu-foot button, .cbu-up button { min-height: 44px; margin: 0 8px 8px 0; }

/* ---------- 編輯表單 ---------- */
.cbu-form { padding: 2px 12px 12px; border-top: 1px solid var(--line); background: #fcfcfd; }
.cbu-f { display: block; margin: 10px 0; }
.cbu-fl { display: block; font-weight: 700; font-size: 13.5px; margin-bottom: 4px; color: #2d3548; }
.cbu .cbu-f input[type="text"], .cbu .cbu-f input[type="number"], .cbu .cbu-f input[type="date"], .cbu .cbu-f select { display: block; width: 100%; box-sizing: border-box; min-height: 44px; font-size: 16px; padding: 9px 12px; border: 1.5px solid #d3d8e0; border-radius: 10px; background: #fff; }
.cbu .cbu-f input:focus, .cbu .cbu-f select:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(25, 113, 194, .15); }
.cbu-hint { color: var(--muted); font-size: 12.5px; line-height: 1.55; margin-top: 4px; }
.cbu-row2 { display: block; }
.cbu-row2 .cbu-f { display: inline-block; width: 47%; margin-right: 3%; vertical-align: top; }
.cbu-thumb { display: block; max-width: 220px; max-height: 100px; border-radius: 8px; margin: 6px 0; border: 1px solid var(--line); }

/* ---------- 底色:預設色票 + 自選 ---------- */
.cbu-sw { display: block; margin: 2px 0 0; }
.cbu .cbu-swatch { display: inline-block; position: relative; width: 44px; height: 44px; min-height: 0; margin: 0 8px 8px 0; padding: 0; border: 2px solid rgba(0, 0, 0, .12); border-radius: 50%; vertical-align: top; cursor: pointer; box-sizing: border-box; }
.cbu .cbu-swatch.on { border-color: var(--ink); box-shadow: 0 0 0 2px #fff inset; }
.cbu .cbu-swatch.on::after { content: '✓'; position: absolute; left: 0; right: 0; top: 0; line-height: 40px; text-align: center; font-size: 18px; font-weight: 800; color: #fff; text-shadow: 0 0 2px rgba(0, 0, 0, .55); }
.cbu .cbu-swatch.lt.on::after { color: #222; text-shadow: none; }
.cbu .cbu-swatch-c { overflow: hidden; background: linear-gradient(135deg, var(--warn), #f08c00, #ffd43b, #2f9e44, #1971c2, #7048e8); }
.cbu .cbu-swatch-c input { position: absolute; left: 0; top: 0; width: 100%; height: 100%; min-height: 0; margin: 0; padding: 0; opacity: 0; cursor: pointer; border: 0; }

/* ---------- 預覽 ---------- */
.cbu-prev { margin: 8px 0 10px; padding: 14px; background: #8ca3c7; border-radius: 14px; }
.cbu-prev-card { width: 100%; max-width: 300px; margin: 0 auto; background: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.cbu-prev-img { display: block; width: 100%; height: 0; padding-bottom: 45%; background-size: cover; background-position: center; background-color: #dde3ea; }
.cbu-prev-mark { text-align: right; font-size: 10px; color: #999; padding: 1px 6px; }
.cbu-prev-txt { padding: 12px; line-height: 1.5; }
.cbu-prev-txt b { display: block; font-size: 16px; }
.cbu-prev-txt span { display: block; font-size: 13px; }
.cbu-prev-txt i { display: block; font-size: 10px; font-style: normal; opacity: .7; }
.cbu-prev-fake { padding: 10px 12px; font-size: 13px; color: #555; border-top: 1px solid #eee; }

/* ---------- 底部 ---------- */
.cbu-foot { margin-top: 12px; }
.cbu-foot .primary { min-width: 120px; }
/* 存檔列:與 settings-kit.css 的 .ks-save 同一個樣子(上緣分隔線、左邊狀態、右邊 放棄 → 儲存) */
.cbu-savebar { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; margin-top: 16px; padding-top: 10px; border-top: 1px solid var(--line); }
.cbu-savebar .cbu-dirty { margin: 0 10px 8px 0; }
.cbu-savebar .cbu-msg { flex: 1 1 160px; margin: 0 10px 8px 0; }
.cbu-save-b { margin-left: auto; white-space: nowrap; }
.cbu-save-b button { margin: 0 0 8px 8px !important; }
.cbu-msg { margin: 8px 0; font-weight: 700; font-size: 14px; }
.cbu-msg:empty { display: none; }
.cbu-msg.err { color: var(--warn); }
.cbu-msg.ok { color: var(--ok); }
.cbu-dirty { color: var(--amber); font-weight: 800; font-size: 13px; margin-left: 6px; }
.cbu-rep { width: 100%; border-collapse: collapse; font-size: 13.5px; margin: 6px 0 12px; }
.cbu-rep th, .cbu-rep td { border-bottom: 1px solid var(--line); padding: 6px 4px; text-align: right; }
.cbu-rep th:first-child, .cbu-rep td:first-child { text-align: left; }
.cbu-rep th { color: var(--muted); font-weight: 700; font-size: 12.5px; }
.cbu details > summary { cursor: pointer; min-height: 44px; line-height: 44px; font-weight: 800; }
.cbu[hidden] { display: none !important; }
/* 設定頁的「數字欄固定 100px 寬」(#tab-settings .set-card input[type=number])特異性比上面高,橫幅的數字欄要跟其他欄一樣滿版 */
.cbu .cbu-f input[type="number"] { width: 100% !important; max-width: none !important; }
