* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif; background: #f5f5f7; color: #1d1d1f; }
.wrap { max-width: 560px; margin: 0 auto; padding: 12px 12px 40px; }
.hidden { display: none !important; }
.mt8 { margin-top: 8px; }
button { font: inherit; border: none; border-radius: 12px; cursor: pointer; }
input, select { font: inherit; width: 100%; padding: 11px 13px; border: 1px solid #d2d2d7; border-radius: 12px; background: #fff; color: inherit; }
input:focus, select:focus { outline: none; border-color: #0071e3; }
.btn { background: #0071e3; color: #fff; font-weight: 600; padding: 12px 16px; width: 100%; }
.btn:disabled { opacity: .5; }
.btn.ghost { background: #e8e8ed; color: #1d1d1f; }
.btn.danger { background: #ff3b30; }
.link { background: none; color: #0071e3; padding: 6px 4px; font-size: 14px; }
.muted { color: #86868b; }
.small { font-size: 13px; }
.err { background: #fff0ef; color: #c4271c; padding: 10px 12px; border-radius: 12px; font-size: 13px; margin: 8px 0; white-space: pre-wrap; word-break: break-word; }

.login { background: #fff; border-radius: 20px; padding: 26px 20px; margin-top: 8vh; }
.login h1 { font-size: 24px; margin: 0 0 6px; }
.login p { margin: 0 0 18px; }
.login input { margin-bottom: 10px; }
.remember { display: flex; align-items: center; gap: 8px; margin: 4px 0 14px; font-size: 14px; color: #6e6e73; user-select: none; }
.remember input { width: 18px; height: 18px; margin: 0; accent-color: #0071e3; }

.top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.top h1 { font-size: 24px; margin: 0; flex: 1; letter-spacing: -.3px; }
.bal { font-weight: 600; color: #1a7f37; background: #e7f6ec; padding: 5px 10px; border-radius: 999px; font-size: 14px; }
.rent-btn { background: #0071e3; color: #fff; font-weight: 600; padding: 9px 15px; border-radius: 999px; font-size: 15px; box-shadow: 0 2px 8px rgba(0,113,227,.3); }

.renewbar { display: flex; align-items: center; gap: 6px; width: 100%; text-align: left; font: inherit; font-size: 14px; color: #1d1d1f; background: #fff; border: 0; border-radius: 12px; padding: 8px 12px; margin-bottom: 8px; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.renewbar .lbl { color: #86868b; }
.renewbar .amt { font-weight: 600; }
.renewbar .sp { flex: 1; }
.renewbar .ar { color: #86868b; font-size: 12px; }
.renewlist { background: #fff; border-radius: 12px; padding: 4px 12px; margin: -4px 0 8px; font-size: 14px; }
.renewlist .rr { display: flex; gap: 8px; padding: 7px 0; border-top: 1px solid #f0f0f0; }
.renewlist .rr:first-child { border-top: 0; }
.renewlist .rr .d { flex: 1; }
.renewlist .rr .c { color: #86868b; min-width: 52px; text-align: right; }
.renewlist .rr .a { font-weight: 600; min-width: 64px; text-align: right; }
.renewlist .rp { color: #86868b; font-size: 12px; margin: -5px 0 6px; text-align: right; }
.renewlist .foot { color: #86868b; font-size: 12px; padding: 4px 0 6px; }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex-shrink: 0; background: #e8e8ed; color: #1d1d1f; padding: 7px 12px; border-radius: 999px; font-size: 14px; white-space: nowrap; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.tab .cnt { opacity: .6; margin-left: 3px; }
.tab.on { background: #1d1d1f; color: #fff; }
.tab.add { background: #fff; color: #0071e3; border: 1px dashed #b5c9e6; font-weight: 600; }
.tab .dots { margin-left: 8px; opacity: .8; padding: 0 2px; }
.tab .del { margin-left: 8px; background: #ff3b30; color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700; padding: 1px 6px; }

.subbar { display: flex; justify-content: space-between; align-items: center; margin: 0 0 6px; gap: 8px; }
.subbar .acts { display: flex; gap: 2px; flex-shrink: 0; }
.status { background: none; padding: 4px 0; font-size: 12px; color: #86868b; text-align: left; }
.status.paused { color: #0071e3; }

.card { cursor: pointer; -webkit-tap-highlight-color: transparent; background: #fff; border-radius: 14px; padding: 8px 12px; margin-bottom: 6px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.r1 { display: flex; align-items: center; gap: 8px; }
.num { font-size: 19px; font-weight: 700; letter-spacing: .2px; font-variant-numeric: tabular-nums; }
.cp { background: #f0f0f5; color: #0071e3; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; flex-shrink: 0; }
.sp { flex: 1; }
.left { font-size: 13px; font-weight: 600; color: #1a7f37; white-space: nowrap; }
.left.warn { color: #c96a00; }
.left.bad { color: #d70015; }
.arrow { background: none; color: #a1a1a6; font-size: 13px; padding: 2px 2px 2px 6px; }
.r2 { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #6e6e73; margin-top: 1px; min-height: 18px; }
.r2 .sname { flex-shrink: 0; }
.r2 .note { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #86868b; }
.renew { background: #ff9500; color: #fff; font-size: 12px; font-weight: 600; padding: 2px 11px; border-radius: 999px; flex-shrink: 0; margin-left: auto; }
.codebar { margin-top: 5px; background: #eef5ff; border-radius: 10px; padding: 3px 10px; display: flex; align-items: center; gap: 8px; }
.codebar .code { font-size: 21px; font-weight: 700; letter-spacing: 2px; color: #0071e3; font-variant-numeric: tabular-nums; word-break: break-all; }
.codebar .code.txt { font-size: 14px; letter-spacing: 0; font-weight: 500; }
.codebar .ago { font-size: 12px; color: #86868b; flex: 1; white-space: nowrap; }
.details { border-top: 1px solid #f0f0f0; margin-top: 8px; padding-top: 6px; }
.kv { display: flex; justify-content: space-between; font-size: 13px; padding: 3px 0; gap: 12px; }
.kv span:first-child { color: #86868b; flex-shrink: 0; }
.kv span:last-child { text-align: right; word-break: break-word; }
.details label { display: block; font-size: 12px; color: #86868b; margin: 8px 0 3px; }
.details .btn { padding: 9px 12px; font-size: 14px; margin-top: 8px; }
.sms-list { margin-top: 4px; }
.sms { padding: 6px 0; border-bottom: 1px solid #f3f3f3; font-size: 13px; }
.sms:last-child { border-bottom: none; }
.sms b { font-size: 14px; letter-spacing: 1px; }
.section { font-size: 12px; color: #86868b; margin: 12px 4px 6px; }
.inactive-toggle { display: block; margin: 12px auto; }
.empty { text-align: center; padding: 40px 10px; color: #86868b; font-size: 14px; }

.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 10; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: #fff; width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; border-radius: 22px 22px 0 0; padding: 16px 16px calc(20px + env(safe-area-inset-bottom)); }
.sheet h2 { font-size: 20px; margin: 0; flex: 1; }
.sheet-head { display: flex; align-items: center; margin-bottom: 12px; }
.seg { display: flex; background: #f0f0f5; border-radius: 12px; padding: 3px; margin-bottom: 10px; }
.seg button { flex: 1; background: none; padding: 9px 4px; font-size: 14px; border-radius: 10px; color: #1d1d1f; }
.seg button.on { background: #fff; font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.svc-list { margin-top: 6px; max-height: 42vh; overflow-y: auto; }
.svc { display: block; width: 100%; text-align: left; background: none; padding: 11px 6px; border-bottom: 1px solid #f2f2f2; border-radius: 0; font-size: 15px; color: #1d1d1f; }
.svc small { color: #86868b; margin-left: 6px; }
.picked { background: #f5f5f7; border-radius: 14px; padding: 11px 13px; display: flex; align-items: center; margin-bottom: 10px; }
.picked b { flex: 1; font-size: 17px; }
.field { margin-bottom: 10px; }
.field label { display: block; font-size: 13px; color: #86868b; margin-bottom: 4px; }
.field2 { display: flex; gap: 10px; }
.field2 .field { flex: 1; min-width: 0; }
.field2 .field.qty { flex: 0 0 96px; }
.quote .unit { font-size: 16px; font-weight: 500; color: #86868b; margin-right: 6px; }
.quote { text-align: center; padding: 10px 0 6px; }
.quote .price { font-size: 32px; font-weight: 700; }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 20; display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal { background: #fff; border-radius: 20px; padding: 20px; width: 100%; max-width: 340px; text-align: center; }
.modal h3 { margin: 0 0 8px; font-size: 18px; }
.modal .charge { font-size: 28px; font-weight: 700; color: #d70015; margin: 8px 0; }
.modal .row2 { display: flex; gap: 10px; margin-top: 16px; }
.toast { position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%); background: rgba(29,29,31,.92); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px; z-index: 30; pointer-events: none; white-space: nowrap; }
.updbar { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60; background: #007aff; color: #fff; border: 0; border-radius: 999px; padding: 10px 18px; font-size: 14px; font-weight: 600; box-shadow: 0 4px 14px rgba(0,0,0,.18); }

.card:active { background: #f5f5f7; }
.card .details { cursor: auto; }
.r2 .tag-off { flex-shrink: 0; font-size: 11px; color: #b25000; background: #fff3e0; border-radius: 6px; padding: 1px 6px; }
.ar-row { align-items: center; }
.sw { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 2px 0; font: inherit; font-size: 13px; color: #86868b; cursor: pointer; }
.sw i { position: relative; width: 40px; height: 24px; border-radius: 12px; background: #d2d2d7; transition: background .15s; }
.sw i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: left .15s; }
.sw.on i { background: #34c759; }
.sw.on i::after { left: 18px; }
.sw.on b { color: #1a7f37; }
.sw b { font-weight: 600; order: -1; }
.sw:disabled { opacity: .5; }
.refresh-btn { padding: 8px 12px; margin-right: -8px; min-width: 52px; }
.site-btn { display: inline-block; padding: 8px 10px; text-decoration: none; font-size: inherit; }
.logout-wrap { text-align: center; margin: 36px 0 28px; }
.logout-btn { background: none; border: 0; color: #a1a1a6; font-size: 13px; padding: 10px 20px; }

.setup-banner { background: #fff8e6; border: 1px solid #f5d78e; border-radius: 12px; padding: 14px; margin: 8px 0 12px; }
.setup-banner .btn { margin-top: 10px; width: 100%; }
.logout-wrap { display: flex; flex-direction: column; align-items: center; gap: 2px; }
#apiHint { margin: 4px 0 12px; word-break: break-all; }

/* 取消一次性验证：勾选框 + 底部悬浮操作条 */
.pick { display: inline-flex; align-items: center; margin: 0 -2px 0 -4px; padding: 4px; cursor: pointer; }
.pick input { width: 18px; height: 18px; margin: 0; padding: 0; accent-color: #ff3b30; cursor: pointer; }
.cancelbar { position: sticky; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 5; display: flex; align-items: center; gap: 6px; background: #fff; border-radius: 14px; padding: 8px 8px 8px 14px; margin: 8px 0; box-shadow: 0 4px 16px rgba(0,0,0,.14); font-size: 14px; }
.cancelbar .cc { flex: 1; color: #1d1d1f; }
.cancel-picked { background: #ff3b30; color: #fff; font-weight: 600; padding: 8px 14px; border-radius: 999px; font-size: 14px; }
.cancel-picked:disabled { opacity: .5; }
.btn.ghost.warn-txt { color: #d70015; }
#confirmDesc { white-space: pre-line; }
html { scroll-padding-bottom: 80px; }
.cancel-picked.report { background: #ff9500; }
.cancelbar .cancel-picked { padding: 8px 11px; font-size: 13px; }
