* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: #f2f3f5; color: #1f2329; }
#app { max-width: 520px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; background: #f2f3f5; }

.topbar { position: sticky; top: 0; z-index: 10; background: #1f2329; color: #fff; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; }
.topbar-title { font-weight: 700; font-size: 17px; }
.role-chip { background: #2b3038; color: #ffd666; border: none; border-radius: 14px; padding: 4px 12px; font-size: 13px; }

.content { flex: 1; padding: 12px 12px 80px; overflow-y: auto; }
.card { background: #fff; border-radius: 12px; padding: 14px; margin-bottom: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.card.sub { padding: 10px 12px; margin-bottom: 8px; }
.empty { text-align: center; color: #999; padding: 40px 0; }

.searchbar input { width: 100%; border: 1px solid #e5e6eb; border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0; }
.chip { border: 1px solid #e5e6eb; background: #fff; border-radius: 16px; padding: 5px 12px; font-size: 13px; white-space: nowrap; color: #4e5969; }
.chip-on { background: #1f2329; color: #fff; border-color: #1f2329; }
.worker-filter select { width: 100%; padding: 8px; border-radius: 8px; border: 1px solid #e5e6eb; margin-bottom: 4px; }

.order-card { cursor: pointer; }
.order-head { display: flex; justify-content: space-between; align-items: center; }
.order-name { font-weight: 700; font-size: 15px; }
.order-sub { display: flex; align-items: center; gap: 8px; margin: 8px 0; font-size: 13px; color: #4e5969; flex-wrap: wrap; }
.order-stats { display: flex; gap: 18px; font-size: 13px; color: #4e5969; }
.order-stats b { color: #1f2329; }

.badge { font-size: 12px; padding: 3px 8px; border-radius: 10px; color: #fff; }
.st-pre_comm { background: #86909c; }
.st-in_progress { background: #165dff; }
.st-photos_forwarded { background: #7a4cff; }
.st-verified { background: #00b42a; }
.st-cancelled { background: #f53f3f; }
.st-aftersale { background: #ff7d00; }

.phone { color: #165dff; text-decoration: none; }
.mini-btn { border: 1px solid #165dff; color: #165dff; background: #fff; border-radius: 12px; padding: 2px 10px; font-size: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: #1f2329; color: #fff; border: none; border-radius: 10px; padding: 10px 14px; font-size: 14px; cursor: pointer; }
.btn.ghost { background: #fff; color: #1f2329; border: 1px solid #e5e6eb; }
.btn.primary { background: #00b42a; }
.btn.full { width: 100%; margin: 6px 0; }
.btn.warn { background: #fff; color: #f53f3f; border: 1px solid #f53f3f; }
.btn:disabled { opacity: .5; }
.btn-row { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.back { background: none; border: none; color: #165dff; font-size: 15px; margin-bottom: 8px; }
.row { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 14px; }
.row .k { color: #86909c; width: 56px; }
.block { border-top: 1px solid #f2f3f5; margin-top: 12px; padding-top: 12px; }
.block-title { font-size: 13px; color: #86909c; margin-bottom: 8px; }
textarea { width: 100%; border: 1px solid #e5e6eb; border-radius: 10px; padding: 8px; font-size: 14px; resize: vertical; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { background: #f2f3f5; border-radius: 14px; padding: 4px 10px; font-size: 13px; }
.tag.add { background: #e8f3ff; color: #165dff; }
.hint { font-size: 12px; color: #999; margin: 8px 0 0; }

.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photo-item { border: 1px solid #e5e6eb; border-radius: 8px; padding: 4px; position: relative; }
.ph-thumb { width: 100%; aspect-ratio: 1; background: #f2f3f5; border-radius: 6px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.ph-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ph-none { color: #bbb; font-size: 12px; }
.ph-status { font-size: 11px; text-align: center; margin-top: 2px; }
.ph-uploaded .ph-status { color: #ff7d00; }
.ph-verified .ph-status { color: #00b42a; }
.ph-settled .ph-status { color: #165dff; }
.ph-note { font-size: 11px; color: #86909c; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick { position: absolute; top: 2px; left: 2px; font-size: 10px; background: rgba(255,255,255,.9); border-radius: 6px; padding: 0 4px; }

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { font-size: 13px; color: #4e5969; padding: 4px 0; border-left: 2px solid #e5e6eb; padding-left: 10px; }
.timeline li span { color: #86909c; margin-right: 6px; }

.kv { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; border-bottom: 1px solid #f2f3f5; }
.kv b { font-size: 16px; }
.status-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.sg { background: #f7f8fa; border-radius: 8px; padding: 10px; text-align: center; }
.sg-n { font-size: 20px; font-weight: 700; }
.sg-l { font-size: 12px; color: #86909c; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
.tbl th, .tbl td { border-bottom: 1px solid #f2f3f5; padding: 6px 4px; text-align: center; }

.form-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.form-row label { width: 72px; color: #86909c; font-size: 14px; }
.form-row select, .form-row input { flex: 1; padding: 8px; border: 1px solid #e5e6eb; border-radius: 8px; }
.preview { margin-top: 12px; border: 1px dashed #e5e6eb; border-radius: 10px; padding: 12px; }

.tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 520px; display: flex; background: #fff; border-top: 1px solid #e5e6eb; }
.tab { flex: 1; background: none; border: none; padding: 10px 0; font-size: 13px; color: #86909c; }
.tab-on { color: #1f2329; font-weight: 700; }

.mask { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: flex-end; z-index: 50; }
.sheet { background: #fff; width: 100%; max-width: 520px; margin: 0 auto; border-radius: 16px 16px 0 0; padding: 16px; max-height: 80vh; overflow-y: auto; }
.sheet h3 { margin: 0 0 12px; }
.sheet-item { display: block; width: 100%; text-align: left; background: #f7f8fa; border: none; border-radius: 10px; padding: 12px; margin-bottom: 8px; font-size: 15px; }
.sheet-item small { color: #86909c; margin-left: 6px; }
.sheet-cancel { width: 100%; background: none; border: 1px solid #e5e6eb; border-radius: 10px; padding: 10px; margin-top: 8px; color: #86909c; }
.invite-link { margin-top: 10px; font-size: 13px; color: #4e5969; word-break: break-all; }
.invite-link code { background: #f2f3f5; padding: 4px 6px; border-radius: 6px; display: block; margin: 6px 0; }

.toast { position: fixed; left: 50%; top: 50%; transform: translate(-50%,-50%); background: rgba(0,0,0,.8); color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 14px; z-index: 100; }
