* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: #f3f4f6; color: #1f2937; max-width: 640px; margin: 0 auto; min-height: 100vh; }

header { background: #111827; color: #fff; padding: 14px 16px 0; position: sticky; top: 0; z-index: 10; }
header h1 { font-size: 20px; margin-bottom: 10px; }
nav { display: flex; gap: 4px; }
.tab { flex: 1; padding: 10px 0; border: none; background: transparent; color: #9ca3af; font-size: 15px; border-radius: 8px 8px 0 0; }
.tab.active { background: #f3f4f6; color: #111827; font-weight: 600; }

main { padding: 12px; }
.view { display: none; }
.view.active { display: block; }
.view-head { display: flex; justify-content: space-between; align-items: center; margin: 6px 2px 10px; color: #6b7280; font-size: 13px; }

.card { background: #fff; border-radius: 12px; padding: 14px; margin-bottom: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.cards { display: flex; flex-direction: column; gap: 10px; }
.hint { color: #9ca3af; text-align: center; padding: 24px 0; }

.order-card { background: #fff; border-radius: 12px; padding: 14px; box-shadow: 0 1px 3px rgba(0,0,0,.08); border-left: 4px solid #f59e0b; }
.order-card .who { font-size: 16px; font-weight: 600; }
.order-card .meta { font-size: 12px; color: #6b7280; margin: 4px 0 8px; }
.order-card .item { display: flex; justify-content: space-between; font-size: 14px; padding: 3px 0; }
.order-card .total { display: flex; justify-content: space-between; font-size: 15px; font-weight: 700; border-top: 1px dashed #e5e7eb; margin-top: 6px; padding-top: 6px; }
.actions { display: flex; gap: 8px; margin-top: 10px; }

label { display: block; font-size: 13px; color: #6b7280; margin: 12px 0 4px; }
select, input { width: 100%; padding: 12px; font-size: 16px; border: 1px solid #d1d5db; border-radius: 8px; background: #fff; }
input:focus, select:focus { outline: 2px solid #3b82f6; border-color: transparent; }

.btn { border: none; border-radius: 8px; padding: 10px 14px; font-size: 15px; cursor: pointer; flex: 1; }
.btn.primary { background: #16a34a; color: #fff; font-weight: 700; }
.btn.warn { background: #dc2626; color: #fff; }
.btn.ghost { background: #f3f4f6; color: #374151; flex: 0 0 auto; }
.btn.big { padding: 14px; font-size: 17px; margin-top: 14px; width: 100%; }
.btn:disabled { opacity: .5; }

.statement-box { background: #f9fafb; border-radius: 8px; padding: 10px 12px; font-size: 14px; line-height: 1.7; margin-top: 8px; }
.statement-box .big { font-size: 18px; font-weight: 700; color: #dc2626; }
.result { margin-top: 10px; font-size: 14px; line-height: 1.6; }
.ok { color: #16a34a; } .err { color: #dc2626; }

.pay-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pay-row .info { font-size: 13px; color: #6b7280; }

.st-cust { display: flex; justify-content: space-between; align-items: center; background: #fff; border-radius: 12px; padding: 14px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.st-cust .name { font-weight: 600; font-size: 15px; }
.st-cust .nums { text-align: right; font-size: 13px; line-height: 1.6; }
.st-cust .owed { color: #dc2626; font-weight: 700; font-size: 16px; }
.st-cust .overdue { color: #b45309; }

#toast { position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%); background: #111827; color: #fff; padding: 12px 20px; border-radius: 999px; font-size: 14px; opacity: 0; transition: opacity .3s; pointer-events: none; z-index: 99; max-width: 90%; text-align: center; }
#toast.show { opacity: 1; }
