/* RhinoShield 風手機編輯器 UI（印刷區用線、不填黃） */
.spb-app {
	max-width: 480px;
	margin: 0 auto;
	background: #fff;
	font-family: -apple-system, "Segoe UI", "Microsoft JhengHei", sans-serif;
	border: 1px solid #ececec;
	border-radius: 14px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	position: relative;
	box-shadow: 0 6px 24px rgba( 0, 0, 0, 0.06 );
}
/* 防佈景主題 CSS 滲入撐歪版面（按鈕字級、邊距、box 模型統一）。 */
.spb-app, .spb-app * { box-sizing: border-box; }
.spb-app button { font-family: inherit; line-height: 1.1; margin: 0; box-shadow: none; text-transform: none; letter-spacing: normal; min-height: 0; }

/* 頂部列（壓低高度） */
.spb-topbar {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 6px 10px;
	border-bottom: 1px solid #eee;
}
.spb-icbtn {
	width: 34px; height: 34px;
	border: 1px solid #e2e5ea; background: #fff; border-radius: 9px;
	font-size: 17px; line-height: 1; color: #333; cursor: pointer; padding: 0;
}
.spb-icbtn:disabled { color: #c8ccd2; cursor: default; }
.spb-icbtn:not(:disabled):active { background: #f0f2f5; }
.spb-topbar-spacer { flex: 1; }
.spb-textbtn { border: 0; background: transparent; color: #888; font-size: 14px; cursor: pointer; padding: 8px; }
.spb-textbtn:active { color: #555; }
.spb-finish { border: 0; background: #ffd400; color: #1a1a1a; font-weight: 700; font-size: 15px; border-radius: 999px; padding: 8px 18px; cursor: pointer; }
.spb-finish:hover { background: #f5cb00; }

/* 警告橫幅 */
.spb-warnbar { background: #fdeee7; border-bottom: 1px solid #f3d6c6; padding: 8px 14px; }
.spb-warn-title { font-size: 12px; font-weight: 700; color: #b54708; margin-bottom: 2px; }
.spb-warnbar ul { margin: 0; padding-left: 16px; }
.spb-warnbar li { font-size: 12.5px; color: #b54708; line-height: 1.5; }

/* 中央預覽（壓低上下留白） */
.spb-stage { background: #f6f7f9; padding: 10px 12px 8px; display: flex; flex-direction: column; align-items: center; }
.spb-canvas-wrap { display: inline-block; max-width: 100%; touch-action: manipulation; }
.spb-canvas-wrap canvas { touch-action: manipulation; }
.spb-pill { margin-top: 8px; background: #fff; border: 1px solid #e7e9ee; border-radius: 999px; padding: 5px 14px; font-size: 12.5px; color: #555; }

/* 選中圖層控制列（固定 4 欄格狀，避免手機跑版、可容納置中鈕） */
.spb-objbar { display: grid; grid-template-columns: repeat( 4, 1fr ); gap: 6px; padding: 8px 10px; border-top: 1px solid #eee; background: #fff; }
.spb-obj { background: #f0f2f5; border: 1px solid #d8dce2; border-radius: 10px; padding: 10px 2px; font-size: 13.5px; color: #333; cursor: pointer; line-height: 1.1; touch-action: manipulation; white-space: nowrap; }
.spb-obj.spb-obj-on { background: #d6e4f5; border-color: #2271b1; color: #1a5a8f; }
.spb-obj:active { background: #e2e6ec; }

/* 裁切操作列 */
.spb-cropbar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-top: 1px solid #eee; background: #fff; }
.spb-crop-hint { flex: 1; font-size: 13px; color: #666; }
.spb-cropbar .spb-finish { padding: 10px 16px; }

/* 底部彈出面板 */
.spb-panel { border-top: 1px solid #eee; background: #fff; padding: 12px; max-height: 40vh; overflow: auto; }
.spb-bigbtn { display: block; width: 100%; background: #2b2f36; color: #fff; border: 0; border-radius: 12px; padding: 16px; font-size: 16px; cursor: pointer; }
.spb-bigbtn:active { background: #1f2329; }
.spb-bigbtn-2 { margin-top: 10px; background: #fff; color: #2b2f36; border: 1px solid #cfd4dc; }
.spb-bigbtn-2:active { background: #f0f2f5; }
.spb-text-tools { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.spb-ctrl2 { background: #f0f2f5; border: 1px solid #d8dce2; border-radius: 10px; padding: 10px 16px; font-size: 14px; cursor: pointer; }
.spb-ctrl2:active { background: #e2e6ec; }
.spb-note2 { font-size: 12px; color: #999; }
.spb-note { font-size: 12px; color: #999; margin: 10px 0 0; line-height: 1.5; }
.spb-colors { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 12px; }
.spb-swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #b8bdc6; cursor: pointer; padding: 0; transition: transform 0.1s; }
.spb-swatch:active { transform: scale( 0.88 ); }
/* 白色色票在白底上看不出來 → 給明顯深色外框，讓客人知道白色可選。 */
.spb-swatch[data-c="#ffffff" i] { box-shadow: 0 0 0 2px #555a63; }

/* 背景底色區（照片分頁最上方） */
.spb-bg-section { margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid #f0f1f3; }
.spb-section-label { font-size: 12.5px; font-weight: 700; color: #555; margin-bottom: 8px; }
.spb-bg-colors { display: flex; flex-wrap: wrap; gap: 9px; }
.spb-bg-imgs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.spb-bg-imgs:empty { display: none; }
.spb-bg-thumb { width: 46px; height: 46px; border-radius: 8px; border: 1px solid #d0d5dd; background-size: cover; background-position: center; cursor: pointer; padding: 0; }
.spb-bg-thumb:active { transform: scale( 0.94 ); }

/* 設計分頁「功能規劃中」佔位 */
.spb-coming-soon { text-align: center; padding: 28px 12px; color: #8a8f98; background: #f6f7f9; border: 1px dashed #d6dae0; border-radius: 12px; }
.spb-cs-title { font-size: 16px; font-weight: 700; color: #6b7280; }
.spb-cs-sub { font-size: 13px; margin-top: 6px; }

/* 版型縮圖 */
.spb-tpl-grid { display: grid; grid-template-columns: repeat( 2, 1fr ); gap: 10px; }
.spb-tpl { border: 1px solid #e7e9ee; border-radius: 10px; background: #fff; padding: 6px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.spb-tpl img { width: 100%; height: 120px; object-fit: contain; background: #f6f7f9; border-radius: 6px; }
.spb-tpl span { font-size: 12px; color: #555; }
.spb-tpl:active { background: #f0f2f5; }

/* 圖層清單 */
#spb-layer-list { list-style: none; margin: 0; padding: 0; }
.spb-layer { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid #eee; border-radius: 8px; margin-bottom: 8px; cursor: pointer; font-size: 14px; }
.spb-layer.active { border-color: #2271b1; background: #f0f6fc; }
.spb-layer-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spb-layer-btns { flex-shrink: 0; display: flex; align-items: center; gap: 6px; }
.spb-layer-btns button { flex: none; border: 1px solid #e2e5ea; background: #f4f5f7; border-radius: 7px; width: 34px; height: 34px; padding: 0; cursor: pointer; font-size: 14px; line-height: 1; color: #444; display: flex; align-items: center; justify-content: center; }
.spb-layer-btns button:active { background: #e2e6ec; }
.spb-layer-empty { color: #999; font-size: 13px; padding: 8px; list-style: none; }

/* 底部分類列 */
.spb-tabbar { display: flex; border-top: 1px solid #eee; background: #fff; }
.spb-tab { flex: 1; border: 0; background: transparent; padding: 11px 4px; font-size: 14px; color: #555; cursor: pointer; border-top: 2px solid transparent; }
.spb-tab.active { color: #1a1a1a; font-weight: 700; border-top-color: #1a1a1a; background: #fafafa; }

/* 小提示 toast */
.spb-toast { position: absolute; left: 50%; bottom: 70px; transform: translateX( -50% ); background: rgba( 30, 30, 30, 0.9 ); color: #fff; font-size: 13px; padding: 8px 14px; border-radius: 8px; opacity: 0; pointer-events: none; transition: opacity 0.2s; z-index: 30; white-space: nowrap; }
.spb-toast.show { opacity: 1; }

/* 完成結果（覆蓋全頁） */
#spb-result:not(:empty) { position: fixed; inset: 0; background: rgba( 255, 255, 255, 0.97 ); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
