:root{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:#f4f6f8;color:#17202a}*{box-sizing:border-box}body{margin:0}.shell{max-width:680px;margin:auto;min-height:100vh;background:#fff}.top{position:sticky;top:0;z-index:10;padding:14px 16px;background:#fff;border-bottom:1px solid #e5e7eb}.top h1{font-size:19px;margin:0}.sub{font-size:12px;color:#667085;margin-top:3px}.content{padding:14px 14px 90px}.card{background:#fff;border:1px solid #e6e9ef;border-radius:16px;padding:14px;margin-bottom:12px;box-shadow:0 2px 10px rgba(0,0,0,.03)}.grid3{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.lottery{padding:22px 8px;border:0;border-radius:16px;font-weight:800;font-size:17px;background:#eef3f8}.btn{border:0;border-radius:12px;padding:12px 14px;font-size:16px;font-weight:750;background:#edf1f5;color:#17202a}.btn.primary{background:#17202a;color:white}.btn.danger{background:#fff0f0;color:#b42318}.btn.good{background:#edfdf3;color:#067647}.btn:disabled{opacity:.45}.row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.row>*{flex:1}.tabs{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;margin:10px 0}.tab{padding:11px 4px;border:1px solid #d0d5dd;border-radius:11px;background:#fff;font-weight:700}.tab.active{background:#17202a;color:white}.numbers{display:grid;grid-template-columns:repeat(7,1fr);gap:7px}.num{aspect-ratio:1;border-radius:50%;border:1px solid #d0d5dd;background:white;font-weight:800;font-size:18px}.num.on{background:#17202a;color:#fff}.label{font-size:13px;color:#667085;margin:8px 0 6px;font-weight:700}input,select{width:100%;padding:12px;border:1px solid #cfd5dd;border-radius:11px;font-size:16px;background:white}.quick{display:grid;grid-template-columns:repeat(5,1fr);gap:6px}.quick button{padding:10px 2px;border-radius:10px;border:1px solid #d0d5dd;background:#fff}.quick button.on{background:#17202a;color:#fff}.summary{background:#f7f9fb;border-radius:12px;padding:12px;line-height:1.75}.big{font-size:22px;font-weight:900}.green{color:#067647!important}.red{color:#b42318!important}.muted{color:#667085}.item{padding:11px 0;border-bottom:1px solid #eee}.item:last-child{border-bottom:0}.bottom{position:fixed;bottom:0;left:0;right:0;max-width:680px;margin:auto;display:grid;grid-template-columns:repeat(4,1fr);background:#fff;border-top:1px solid #ddd;padding:7px}.bottom button{border:0;background:white;padding:8px 2px;font-size:12px}.bottom b{display:block;font-size:20px}.pill{display:inline-block;padding:4px 8px;border-radius:999px;background:#eef2f6;font-size:12px}.login{min-height:100vh;display:flex;align-items:center;padding:24px}.login .card{width:100%;max-width:430px;margin:auto}.login h1{font-size:24px}.notice{padding:10px;border-radius:10px;background:#fff8e6;color:#7a4d00;font-size:13px}.winball{background:#e8f7ee;color:#067647;font-weight:900;padding:3px 7px;border-radius:99px}.loseball{background:#f3f4f6;padding:3px 7px;border-radius:99px}@media(min-width:700px){body{background:#e9edf2}.shell{box-shadow:0 0 30px rgba(0,0,0,.08)}}

.top{display:flex;align-items:center;justify-content:space-between;gap:10px}
.topTitle{min-width:0}
.logoutBtn{flex:0 0 auto;border:1px solid #f1b7b2;background:#fff5f4;color:#b42318;border-radius:10px;padding:8px 12px;font-size:14px;font-weight:800}
.btn,.tab,.num,.quick button,.lottery,.logoutBtn,.bottom button{transition:transform .08s ease,opacity .15s ease,box-shadow .15s ease}
.btn:active,.tab:active,.num:active,.quick button:active,.lottery:active,.logoutBtn:active,.bottom button:active{transform:scale(.97)}
.btn.primary:active,.btn.good:active{box-shadow:0 0 0 4px rgba(23,32,42,.10)}
.toast{position:fixed;left:50%;bottom:86px;z-index:9999;max-width:calc(100vw - 28px);transform:translate(-50%,18px);opacity:0;pointer-events:none;padding:12px 16px;border-radius:12px;background:#17202a;color:#fff;font-weight:800;font-size:14px;box-shadow:0 8px 28px rgba(0,0,0,.22);transition:.2s ease;text-align:center}
.toast.show{opacity:1;transform:translate(-50%,0)}
.toast.ok{background:#067647}
.toast.warn{background:#b54708}
.toast.error{background:#b42318}

.draftActions{display:flex;gap:8px;align-items:center;justify-content:flex-end;flex-wrap:nowrap}
.editMini,.dangerMini{border:0;border-radius:12px;padding:9px 12px;font-weight:800;font-size:14px;white-space:nowrap}
.editMini{background:#eef4ff;color:#175cd3}
.dangerMini{background:#fff1f0;color:#d92d20}
.settingInlineRow{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto;gap:10px;align-items:end}
.settingField{min-width:0}
.settingSaveBtn{height:48px;min-width:72px;padding:0 14px;white-space:nowrap;margin:0}
@media(max-width:520px){
  .settingInlineRow{grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto;gap:7px}
  .settingInlineRow .label{font-size:12px;line-height:1.25}
  .settingInlineRow input{padding:10px 9px;font-size:16px}
  .settingSaveBtn{min-width:62px;padding:0 10px;font-size:14px}
}

.specialSetting{display:block;margin-top:10px;font-size:14px}
.item .settingInlineRow .btn{margin-bottom:0}

#draftList .item{position:relative;padding-right:150px;min-height:48px}
#draftList .draftActions{position:absolute;right:0;top:50%;transform:translateY(-50%);display:flex;gap:7px}
@media(max-width:520px){
  #draftList .item{padding-right:132px}
  #draftList .draftActions{gap:5px}
  #draftList .draftActions .btn{font-size:13px;padding:6px 8px!important}
}

.bottom.five{grid-template-columns:repeat(5,1fr)}
.customerCreate{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;margin-top:12px}
.customerRow{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px 0;border-bottom:1px solid #eee}
.customerRow:last-child{border-bottom:0}
.customerRow.inactive{opacity:.55}
.customerActions{display:flex;gap:6px;flex:0 0 auto}
.customerActions .btn{padding:7px 9px;font-size:13px}
.customerPick{margin-top:12px;padding:10px;border-radius:12px;background:#f7f9fb}
.customerMissing{padding:11px;border-radius:10px;background:#fff3f0;color:#b42318;font-weight:800}
.reportWho{padding:10px 0;border-bottom:1px solid #eee;margin-bottom:6px}
@media(max-width:420px){
  .bottom button{font-size:11px}
  .bottom b{font-size:18px}
}

.drawResultTitle{display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:18px;margin:4px 0 8px}
.drawMatchNote{font-size:13px;color:#667085;background:#f7f9fb;border-radius:10px;padding:8px 10px;margin-bottom:8px}
.drawGuard{font-size:13px;color:#175cd3;background:#eef4ff;border-radius:10px;padding:9px 10px}
.specialLabel{font-size:13px;font-weight:800;color:#7a4d00;margin-left:4px}
.autoDrawBtn{background:#eef4ff;color:#175cd3;border:1px solid #b2ccff;font-weight:900}
.autoFetchStatus{margin:9px 2px 12px;font-size:13px;line-height:1.5}
.manualDetails{margin-top:10px;border-top:1px solid #eee;padding-top:10px}
.manualDetails summary{cursor:pointer;font-weight:800;color:#667085;padding:8px 0}
.manualInner{padding-top:5px}

.ownerBreakdown{background:#f7f9fb;border-radius:12px;padding:10px 12px;margin:8px 0 12px;line-height:1.7;font-size:13px}.ownerBreakdown b{display:block;font-size:14px;margin-bottom:3px}

.reportHeader{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 0;border-bottom:1px solid #eee;margin-bottom:6px;flex-wrap:wrap}
.reportHeader .reportWho{padding:0;border:0;margin:0}
.reportDate{font-size:15px;font-weight:800;color:#475467;white-space:nowrap}
@media(max-width:480px){.reportDate{font-size:14px}}

@media(max-width:520px){
  .num{font-size:19px}
}

/* V1.2.4 手機下注介面精簡放大 */
.customerPickInline{
  display:grid;
  grid-template-columns:auto minmax(0,1fr);
  align-items:center;
  gap:10px;
}
.customerPickLabel{
  font-size:15px;
  font-weight:800;
  color:#475467;
  white-space:nowrap;
}
.customerPickInline select{
  min-width:0;
}
.tab{
  font-size:17px;
  font-weight:800;
}
.quick button{
  font-size:17px;
  font-weight:800;
}
@media(max-width:520px){
  .customerPickInline{gap:8px}
  .customerPickLabel{font-size:14px}
  .tab{font-size:18px}
  .quick button{font-size:18px}
}

.userCard{padding:12px 0;border-bottom:1px solid #eee}
.userCard:last-child{border-bottom:0}
.userCard.inactive{opacity:.55}
.userMain{line-height:1.65}
.userActions{display:flex;gap:6px;flex-wrap:wrap;margin-top:8px}
.userActions .btn{padding:8px 10px;font-size:13px}
.warnPill{background:#fff3e0;color:#b54708}
.modalMask{position:fixed;inset:0;z-index:10000;background:rgba(0,0,0,.42);display:flex;align-items:center;justify-content:center;padding:18px}
.modalCard{width:min(100%,460px);max-height:90vh;overflow:auto;background:#fff;border-radius:18px;padding:18px;box-shadow:0 18px 50px rgba(0,0,0,.25)}
.modalButtons{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:16px}
.activeToggle{display:block;margin-top:12px;font-weight:700}

.customerOwner{font-size:12px;margin-top:2px}

/* V1.3.2 分享選單 */
.shareMask{
  position:fixed;inset:0;z-index:12000;
  background:rgba(0,0,0,.42);
  display:flex;align-items:flex-end;justify-content:center;
  padding:14px;
}
.shareCard{
  width:min(100%,520px);
  background:#fff;border-radius:20px;
  padding:18px;
  box-shadow:0 18px 50px rgba(0,0,0,.28);
}
.shareTitle{font-size:21px;font-weight:900;margin-bottom:4px}
.shareHint{font-size:13px;margin:4px 0 14px}
.shareChoice{
  display:block;width:100%;
  border:0;border-radius:13px;
  padding:14px 12px;margin:8px 0;
  font-size:17px;font-weight:850;
  background:#eef2f6;color:#17202a;
}
.lineChoice{background:#06c755;color:#fff}
.shareCancel{width:100%;margin-top:6px}
.shareFallback{
  display:none;width:100%;min-height:120px;
  margin-top:10px;padding:10px;
  border:1px solid #d0d5dd;border-radius:10px;
  font-size:14px;
}

/* V1.3.3 語系與 Android Chrome 提示 */
.topActions{display:flex;align-items:center;gap:7px;flex:0 0 auto}
.langSelect{width:auto;min-width:96px;padding:8px 28px 8px 9px;border-radius:10px;font-size:13px;font-weight:750}
.androidChromeHint{margin:12px 0;padding:11px 12px;border-radius:12px;background:#eef4ff;color:#175cd3;font-size:13px;line-height:1.55}
@media(max-width:420px){
  .langSelect{min-width:88px;font-size:12px;padding-left:7px}
  .logoutBtn{padding:8px 9px}
}

/* V1.3.4 語系選單縮小 */
.langSelect{
  min-width:72px!important;
  width:72px!important;
  padding:7px 20px 7px 6px!important;
  border-radius:8px!important;
  font-size:12px!important;
}
.chromeOpenBtn{
  display:block;
  width:100%;
  margin-top:10px;
  border:0;
  border-radius:11px;
  padding:11px 10px;
  background:#175cd3;
  color:#fff;
  font-size:15px;
  font-weight:850;
}
.chromeOpenBtn:active{transform:scale(.98)}
@media(max-width:420px){
  .langSelect{min-width:68px!important;width:68px!important}
}

/* V1.4 作廢下注與稽核 */
.savedBetTop{display:flex;align-items:center;justify-content:space-between;gap:8px}
.voidBetBtn{padding:6px 10px;font-size:12px;flex:0 0 auto}
.voidedBet{opacity:.72;background:#f8f8f8}
.voidedBet b{text-decoration:line-through}
.voidBadge{display:inline-block;margin-left:5px;padding:2px 7px;border-radius:999px;background:#fee4e2;color:#b42318;font-size:11px;font-weight:850;text-decoration:none}
.voidReason{margin-top:6px;padding:7px 8px;border-radius:8px;background:#fff1f0;color:#b42318;font-size:12px;line-height:1.45}
.auditSummary{font-size:18px;font-weight:900;cursor:pointer;padding:4px 0}
.auditFilters{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:12px}
.auditFilters>.btn,.auditFilters>.auditNote,.auditFilters>#auditList{grid-column:1/-1}
.auditNote{margin-top:7px}
.auditRow{padding:10px 0;border-bottom:1px solid #eee}
.auditAction{display:flex;justify-content:space-between;gap:8px;align-items:flex-start}
.auditAction span{font-size:12px;color:#667085;text-align:right}
.auditTime{font-size:11px;color:#98a2b3;margin-top:2px}
.auditDetail{font-size:13px;color:#475467;margin-top:5px;line-height:1.45;word-break:break-word}

/* V1.5 每日結帳＋客戶帳本 */
.dailyCloseHead{display:flex;align-items:center;justify-content:space-between;gap:10px}
.dailyCloseHead input{width:auto;max-width:155px}
.dailyCloseStats{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:12px 0}
.dailyCloseStats>div,.ledgerSummary>div{background:#f8fafc;border:1px solid #eaecf0;border-radius:11px;padding:9px}
.dailyCloseStats span,.ledgerSummary span{display:block;font-size:12px;color:#667085;margin-bottom:3px}
.dailyCloseStats b,.ledgerSummary b{font-size:17px}
.dailyLotteryRow{display:flex;justify-content:space-between;gap:8px;padding:8px 0;border-bottom:1px solid #eee;font-size:13px}
.dailyLotteryRow span{text-align:right;color:#475467}
.dailyProfit{font-size:20px;font-weight:900;margin-top:12px}
.dailyMeta,.ledgerSub{font-size:12px;color:#667085;margin-top:5px}
.ledgerMini{background:#eef4ff;color:#175cd3}
.ledgerMask{align-items:center}
.ledgerCard{max-height:92vh}
.ledgerTitleRow{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}
.ledgerClose{border:0;background:#f2f4f7;width:34px;height:34px;border-radius:50%;font-size:24px;line-height:28px}
.ledgerFilters{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:12px}
.ledgerFilters>#loadLedgerBtn,.ledgerFilters>#ledgerResult{grid-column:1/-1}
.ledgerSummary{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:10px 0}
.ledgerDate{font-weight:900;font-size:15px;margin:14px 0 4px;padding:6px 8px;background:#f2f4f7;border-radius:8px}
.ledgerItem{padding:10px 2px;border-bottom:1px solid #eee;line-height:1.55}
.ledgerItemTop{display:flex;justify-content:space-between;gap:8px;align-items:center}
.ledgerStatus{font-size:11px;font-weight:800;padding:2px 7px;border-radius:999px;background:#ecfdf3;color:#027a48}
@media(max-width:420px){
  .dailyCloseHead{align-items:flex-start}
  .dailyCloseHead input{max-width:145px}
}

/* V1.5.1 首頁標題精簡 */
.homeTitleHint{
  font-size:13px;
  font-weight:700;
  color:#667085;
}

/* V1.6 資料備份／還原 */
.backupCenter{display:grid;gap:9px;margin-top:12px}
.backupDivider{height:1px;background:#eaecf0;margin:3px 0}
.backupWarn{font-size:12px;line-height:1.5;color:#b42318;background:#fff1f0;border-radius:9px;padding:9px 10px}
#restoreJsonFile{font-size:13px}

/* V1.7 登入安全 */
.userSecurity{font-size:11px;line-height:1.55;color:#667085;margin-top:5px}
.loginLockBadge{display:inline-block;margin-top:3px;padding:2px 7px;border-radius:999px;background:#fff1f0;color:#b42318;font-weight:850}

/* V1.7.1 密碼眼睛＋稽核裝置資訊 */
.passwordWrap{position:relative;width:100%}
.passwordWrap input{width:100%;padding-right:46px!important}
.passwordEye{
  position:absolute;right:5px;top:50%;transform:translateY(-50%);
  width:38px;height:38px;border:0;background:transparent;
  border-radius:9px;font-size:20px;line-height:1;cursor:pointer;
}
.passwordEye:active{background:#f2f4f7}
.auditDevice{font-size:11px;color:#667085;margin-top:3px;line-height:1.45}

/* V1.8 週／月帳務統計中心 */
.accountingPresetRow{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;margin-top:12px}
.accountingPreset.active{background:#101828;color:#fff;border-color:#101828}
.accountingCustomDates{grid-template-columns:1fr 1fr;gap:8px;margin-top:9px}
.accountingPeriodLabel{text-align:center;font-size:12px;font-weight:800;color:#475467;margin-bottom:8px}
.accountingSectionTitle{font-weight:900;margin:14px 0 7px;padding-top:8px;border-top:1px solid #eaecf0}
.accountingLotteryRow{display:grid;grid-template-columns:minmax(90px,1fr) 1.7fr;gap:8px;padding:9px 0;border-bottom:1px solid #f2f4f7}
.accountingLotteryRow>div:first-child{display:flex;flex-direction:column;gap:2px}
.accountingLotteryRow small,.accountingLotteryRow span{font-size:11px;color:#667085}
.accountingMoney{display:grid;grid-template-columns:1fr 1fr auto;align-items:center;gap:5px;text-align:right}
.accountingMoney b{font-size:13px}
.accountingSubDetails{margin-top:10px;border:1px solid #eaecf0;border-radius:10px;padding:0 10px;background:#fcfcfd}
.accountingSubDetails>summary{font-weight:850;padding:10px 0;cursor:pointer}
.accountingDayList,.accountingRankList{padding-bottom:7px}
.accountingDayRow{display:grid;grid-template-columns:1.25fr 1fr 1fr auto;gap:6px;align-items:center;padding:7px 0;border-top:1px solid #f2f4f7;font-size:11px}
.accountingDayRow b{text-align:right;font-size:12px}
.accountingRankRow{display:grid;grid-template-columns:24px 1fr auto;gap:8px;align-items:center;padding:8px 0;border-top:1px solid #f2f4f7}
.accountingRankRow .rankNo{width:22px;height:22px;border-radius:50%;display:grid;place-items:center;background:#f2f4f7;font-size:11px;font-weight:900}
.accountingRankRow>div:nth-child(2){display:flex;flex-direction:column}
.accountingRankRow small{font-size:10px;color:#667085}
.accountingRankRow>div:last-child{display:flex;flex-direction:column;text-align:right;font-size:11px}
.accountingRankRow>div:last-child b{font-size:12px}
@media(max-width:420px){
  .accountingMoney{grid-template-columns:1fr auto}
  .accountingMoney span:first-child{grid-column:1}
  .accountingMoney span:nth-child(2){grid-column:1}
  .accountingMoney b{grid-column:2;grid-row:1/3;align-self:center}
  .accountingDayRow{grid-template-columns:1.2fr 1fr auto}
  .accountingDayRow span:nth-child(3){display:none}
}

/* V1.8.1 週／月帳務分享 */
.accountingShareBtn{font-weight:850}

/* V1.8.2 帳務快速篩選＋CSV */
.accountingQuickFilters{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:9px}
.accountingQuickFilters select{width:100%}
.accountingFilterSummary{text-align:center;font-size:11px;font-weight:800;color:#667085;margin:-2px 0 8px}
.accountingActionGrid{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin-top:10px}
@media(max-width:420px){
  .accountingActionGrid{grid-template-columns:1fr}
}

/* V1.9 開獎資料管理中心 */
.drawMgmtFilters{display:grid;grid-template-columns:1fr 1fr 1fr;gap:7px;margin-top:10px}
.drawMgmtRow{padding:10px 0;border-top:1px solid #eaecf0;display:grid;grid-template-columns:1fr auto;gap:8px}
.drawMgmtMain{min-width:0}
.drawMgmtNums{font-size:15px;font-weight:850;margin:4px 0;word-break:break-word}
.drawMgmtMain small{font-size:10px;color:#667085}
.drawMgmtActions{display:flex;flex-direction:column;gap:5px;justify-content:center}
@media(max-width:420px){
  .drawMgmtFilters{grid-template-columns:1fr 1fr}
  .drawMgmtFilters>div:first-child{grid-column:1/3}
  .drawMgmtRow{grid-template-columns:1fr}
  .drawMgmtActions{flex-direction:row}
  .drawMgmtActions .btn{flex:1}
}

/* V1.9.1 開獎異常偵測 */
.drawAnomalyOk{background:#ecfdf3;color:#027a48;border:1px solid #abefc6;padding:10px 12px;border-radius:10px;font-weight:850}
.drawAnomalyAlert{background:#fffaeb;border:1px solid #fedf89;border-radius:11px;padding:10px 11px;color:#7a2e0e}
.drawAnomalyTitle{font-weight:900;font-size:14px}
.drawAnomalyStats{font-size:11px;margin-top:3px;color:#93370d}
.drawAnomalyAlert details{margin-top:8px}
.drawAnomalyAlert summary{font-weight:850;cursor:pointer}
.drawAnomalyList{margin-top:7px}
.drawAnomalyItem{display:grid;grid-template-columns:1fr auto;gap:8px;padding:8px 0;border-top:1px solid #fedf89;font-size:11px}
.drawAnomalyItem.missing{background:#fffdf5}
.drawAnomalyItem b{font-size:12px}
.drawAnomalyNote{font-size:10px;color:#93370d;margin-top:8px;line-height:1.45}
@media(max-width:420px){
  .drawAnomalyItem{grid-template-columns:1fr}
  .drawAnomalyItem .btn{width:100%}
}

/* V1.9.3 開獎日期快速定位 */
.drawMgmtPresetRow{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;margin-top:9px}
.drawPreset.active{background:#101828;color:#fff;border-color:#101828}
.drawJumpRow{display:grid;grid-template-columns:1fr auto;gap:7px;align-items:end;margin-top:9px}
.drawJumpRow .btn{height:42px}
@media(max-width:420px){
  .drawMgmtPresetRow{grid-template-columns:1fr 1fr}
  .drawJumpRow{grid-template-columns:1fr}
  .drawJumpRow .btn{width:100%}
}

/* V1.9.4 批次補抓 */
.drawBatchRefetchBtn{width:100%;margin-top:8px;font-weight:850}
