/* 维修管家 — 移动优先 */
* { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
:root{
  --pri:#2563eb; --pri-d:#1e40af; --bg:#eef2f7; --card:#fff; --line:#e5eaf2;
  --tx:#1a2233; --tx2:#66738c; --red:#e11d48; --green:#059669; --amber:#d97706;
  --warn:#ea580c; --purple:#7c3aed; --gray:#94a3b8;
}
html,body{ height:100%; }
body{
  font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif;
  background:var(--bg); color:var(--tx); font-size:15px; line-height:1.45;
}
#app{ max-width:560px; margin:0 auto; min-height:100%; display:flex; flex-direction:column; }
/* 顶栏 */
header{ position:sticky; top:0; z-index:20; background:var(--card); border-bottom:1px solid var(--line);
  padding:10px 14px; display:flex; align-items:center; gap:8px; }
header .logo{ width:32px; height:32px; border-radius:9px; background:linear-gradient(135deg,#2563eb,#4f8ef7);
  color:#fff; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:17px; flex:none; }
header h1{ font-size:17px; flex:1; white-space:nowrap; overflow:hidden; }
header .who{ font-size:12px; color:var(--tx2); background:var(--bg); padding:3px 9px; border-radius:20px; flex:none; }
header .out{ color:var(--tx2); font-size:12px; padding:4px; flex:none; }
/* 主体 */
main{ flex:1; padding:12px; padding-bottom:76px; }
.view{ display:none; } .view.on{ display:block; }
/* 底部导航 */
nav{ position:fixed; bottom:0; left:0; right:0; z-index:20; background:var(--card);
  border-top:1px solid var(--line); display:flex; }
nav .wrap{ max-width:560px; margin:0 auto; width:100%; display:flex; }
nav a{ flex:1; text-align:center; padding:7px 0 6px; color:var(--tx2); text-decoration:none; font-size:11px; }
nav a .ic{ display:block; font-size:20px; line-height:1.2; }
nav a.on{ color:var(--pri); font-weight:600; }
nav a.mid .ic{ margin:0 auto -4px; width:52px; height:44px; border-radius:26px; background:linear-gradient(135deg,#2563eb,#4f8ef7);
  color:#fff; font-size:28px; display:flex; align-items:center; justify-content:center; box-shadow:0 4px 10px rgba(37,99,235,.35); }
nav a.mid{ color:var(--pri); }
nav a.mid span{ display:block; margin-top:2px; }
/* 通用控件 */
.btn{ display:inline-flex; align-items:center; justify-content:center; gap:6px; border:none; cursor:pointer;
  background:var(--pri); color:#fff; border-radius:10px; padding:10px 16px; font-size:15px; font-weight:600; }
.btn:active{ transform:scale(.98); }
.btn.block{ width:100%; }
.btn.ghost{ background:#eef3ff; color:var(--pri); }
.btn.gray{ background:#e6eaf0; color:var(--tx2); }
.btn.green{ background:var(--green); }
.btn.red{ background:#fee2e6; color:var(--red); }
.btn.sm{ padding:6px 12px; font-size:13px; border-radius:8px; }
.btn:disabled{ opacity:.5; }
input,select,textarea{ width:100%; border:1.5px solid var(--line); background:#fff; border-radius:10px;
  padding:11px 12px; font-size:16px; color:var(--tx); outline:none; font-family:inherit; }
input:focus,select:focus,textarea:focus{ border-color:var(--pri); }
textarea{ resize:vertical; min-height:64px; }
label.f{ display:block; margin:10px 0 4px; font-size:13px; color:var(--tx2); }
.card{ background:var(--card); border-radius:14px; padding:13px; margin-bottom:10px; box-shadow:0 1px 3px rgba(20,30,60,.05); }
.card h3{ font-size:15px; margin-bottom:8px; display:flex; align-items:center; gap:6px; }
.row{ display:flex; gap:8px; } .row>*{ flex:1; }
/* 状态徽章 */
.badge{ display:inline-flex; align-items:center; gap:4px; font-size:12px; font-weight:600; border-radius:20px; padding:3px 10px; flex:none; }
.b-received{ background:#eef1f6; color:#51607a; }
.b-repairing{ background:#e3edff; color:var(--pri); }
.b-repaired{ background:#e2f7ee; color:var(--green); }
.b-shipped{ background:#f1e8ff; color:var(--purple); }
.b-picked{ background:#e2f7ee; color:var(--green); }
.b-canceled{ background:#e6e8ec; color:var(--gray); text-decoration:line-through; }
.tag{ font-size:11px; border-radius:6px; padding:1px 6px; flex:none; }
.tag.monthly{ background:#fef1de; color:var(--amber); }
.tag.cash{ background:#e7f6ef; color:var(--green); }
.tag.wparts{ background:#fef1de; color:var(--amber); font-weight:600; }
.tag.wcust{ background:#f3e8ff; color:var(--purple); font-weight:600; }
.unpaid{ color:var(--red); font-weight:700; }
.paid{ color:var(--green); }
.muted{ color:var(--tx2); font-size:12px; }
.num{ font-size:15px; font-weight:700; }
/* 首页 */
.hero{ background:linear-gradient(135deg,#1d4ed8,#3b82f6); color:#fff; border-radius:16px; padding:15px;
  margin-bottom:12px; display:flex; justify-content:space-between; align-items:center; }
.hero .d1{ font-size:14px; opacity:.9; } .hero .d2{ font-size:24px; font-weight:800; margin-top:2px; }
.grid2{ display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-bottom:12px; }
.kpi{ background:var(--card); border-radius:14px; padding:13px 14px; box-shadow:0 1px 3px rgba(20,30,60,.05); }
.kpi .n{ font-size:26px; font-weight:800; } .kpi .l{ font-size:12.5px; color:var(--tx2); margin-top:2px; }
.kpi.blue .n{ color:var(--pri); } .kpi.amber .n{ color:var(--amber); } .kpi.green .n{ color:var(--green); }
.kpi.red .n{ color:var(--red); } .kpi.purple .n{ color:var(--purple); }
.money-line{ background:var(--card); border-radius:14px; padding:13px; margin-bottom:12px; display:flex; }
.money-line>div{ flex:1; } .money-line .m{ font-size:11px; color:var(--tx2); }
.money-line .v{ font-size:17px; font-weight:800; margin-top:2px; }
/* 列表卡片 */
.order{ background:var(--card); border-radius:14px; padding:12px 13px; margin-bottom:10px; box-shadow:0 1px 3px rgba(20,30,60,.05);
  display:block; text-decoration:none; color:inherit; border-left:4px solid transparent; }
.order.st-received{ border-left-color:#9db1cc; } .order.st-repairing{ border-left-color:var(--pri); }
.order.st-repaired{ border-left-color:var(--green); } .order.st-shipped{ border-left-color:var(--purple); }
.order.st-picked{ border-left-color:var(--green); } .order.st-canceled{ border-left-color:var(--gray); opacity:.65; }
.o1{ display:flex; align-items:center; gap:8px; }
.o1 .who{ font-weight:700; flex:1; font-size:15px; }
.o2{ display:flex; gap:8px; margin-top:6px; color:var(--tx2); font-size:13px; flex-wrap:wrap; }
.o2 b{ color:var(--tx); font-weight:600; }
.o3{ display:flex; gap:10px; margin-top:8px; font-size:12px; color:var(--tx2); border-top:1px dashed var(--line); padding-top:7px; }
.o3 .ph{ color:var(--tx2); }
/* chips */
.chips{ display:flex; gap:7px; overflow-x:auto; padding:2px 0 10px; scrollbar-width:none; }
.chips::-webkit-scrollbar{ display:none; }
.chip{ flex:none; padding:6px 13px; border-radius:20px; background:#e6eaf0; color:#4b5870; font-size:13px; cursor:pointer; white-space:nowrap; }
.chip.on{ background:var(--pri); color:#fff; font-weight:600; }
.searchbar{ display:flex; gap:8px; margin-bottom:10px; }
/* 详情 */
.dh{ display:flex; align-items:center; gap:10px; margin-bottom:6px; }
.dh .t{ font-size:18px; font-weight:800; flex:1; }
.dline{ display:flex; font-size:13.5px; padding:5px 0; border-bottom:1px dashed #eef1f6; }
.dline .k{ color:var(--tx2); width:74px; flex:none; }
.dline .v{ flex:1; word-break:break-all; }
.tl{ position:relative; padding-left:18px; }
.tl .node{ position:relative; padding:0 0 14px 0; }
.tl .node:before{ content:''; position:absolute; left:-13px; top:4px; width:10px; height:10px; border-radius:50%;
  background:#cbd5e1; border:2px solid #fff; box-shadow:0 0 0 1px #cbd5e1; }
.tl .node.cur:before{ background:var(--pri); box-shadow:0 0 0 1px var(--pri); }
.tl .node:not(:last-child):after{ content:''; position:absolute; left:-9px; top:16px; bottom:-2px; width:2px; background:#e2e8f0; }
.tl .a{ font-weight:600; font-size:13.5px; } .tl .t2{ font-size:11.5px; color:var(--tx2); margin-top:2px; }
/* 照片墙 */
.photos{ display:grid; grid-template-columns:repeat(3,1fr); gap:7px; }
.photos .p{ position:relative; aspect-ratio:1; border-radius:10px; overflow:hidden; background:#eef1f6; }
.photos img{ width:100%; height:100%; object-fit:cover; }
.photos .del{ position:absolute; top:3px; right:3px; background:rgba(0,0,0,.55); color:#fff; border:none;
  width:20px; height:20px; border-radius:50%; font-size:11px; line-height:1; cursor:pointer; }
.photos .add{ border:1.5px dashed var(--line); display:flex; align-items:center; justify-content:center;
  color:var(--tx2); font-size:22px; background:transparent; border-radius:10px; aspect-ratio:1; cursor:pointer; width:100%; }
/* 弹层 */
.mask{ position:fixed; inset:0; background:rgba(15,23,42,.5); z-index:40; display:none; align-items:flex-end; justify-content:center; }
.mask.on{ display:flex; }
.sheet{ background:#fff; width:100%; max-width:560px; border-radius:18px 18px 0 0; padding:16px 16px 26px;
  max-height:92vh; overflow-y:auto; }
.sheet h2{ font-size:17px; margin-bottom:10px; display:flex; align-items:center; }
.sheet h2 .x{ margin-left:auto; cursor:pointer; color:var(--tx2); font-size:20px; padding:0 4px; font-weight:400; }
.center-full{ position:fixed; inset:0; background:var(--bg); z-index:30; display:none; flex-direction:column; }
.center-full.on{ display:flex; }
/* 摄像头 */
#scanBox video{ width:100%; border-radius:14px; background:#000; max-height:52vh; }
.scanline{ height:2px; background:var(--red); position:absolute; left:0; right:0; animation:scan 2.4s infinite; }
@keyframes scan{ 0%{top:12%} 50%{top:86%} 100%{top:12%} }
/* 登录 */
.login{ min-height:100vh; display:flex; flex-direction:column; justify-content:center; padding:30px 26px; background:linear-gradient(160deg,#1e3a8a,#2563eb 60%,#60a5fa); }
.login .lg{ width:66px; height:66px; border-radius:18px; background:rgba(255,255,255,.16); color:#fff;
  display:flex; align-items:center; justify-content:center; font-size:34px; font-weight:800; margin-bottom:14px; }
.login h1{ color:#fff; font-size:24px; } .login p{ color:rgba(255,255,255,.75); font-size:13px; margin:6px 0 24px; }
.login .box{ background:#fff; border-radius:18px; padding:18px 16px; }
.login label{ font-size:12px; color:#64748b; }
.login .btn{ margin-top:14px; }
/* 其它 */
.tip{ background:#fff8ec; border:1px solid #fde6bf; color:#92600a; font-size:12.5px; border-radius:10px; padding:9px 11px; margin-bottom:10px; }
.okbar{ position:fixed; left:50%; transform:translateX(-50%); bottom:90px; background:rgba(17,24,39,.92); color:#fff;
  padding:9px 16px; border-radius:22px; font-size:13.5px; z-index:60; display:none; max-width:90%; text-align:center; }
.okbar.on{ display:block; }
.empty{ text-align:center; color:var(--tx2); font-size:13.5px; padding:34px 0; }
.seg{ display:flex; background:#e6eaf0; border-radius:10px; padding:3px; gap:3px; }
.seg div{ flex:1; text-align:center; padding:8px 0; border-radius:8px; font-size:14px; cursor:pointer; color:#4b5870; font-weight:600; }
.seg div.on{ background:#fff; color:var(--pri); box-shadow:0 1px 4px rgba(20,30,60,.12); }
.mini-ph{ display:flex; gap:7px; flex-wrap:wrap; }
.mini-ph .th{ position:relative; width:64px; height:64px; border-radius:9px; overflow:hidden; background:#eef1f6; }
.mini-ph img{ width:100%; height:100%; object-fit:cover; }
.addbtn{ width:64px; height:64px; border-radius:9px; border:1.5px dashed #c3cde0; background:transparent;
  font-size:24px; color:#7c8aa5; cursor:pointer; }
.st-actions{ display:flex; gap:8px; flex-wrap:wrap; margin-top:4px; }
.linkbox{ background:#f5f8ff; border:1px dashed #b9cdf7; border-radius:10px; padding:9px 11px; font-size:12px; color:#3b6cd6; word-break:break-all; }
table.mini{ width:100%; border-collapse:collapse; font-size:13px; }
table.mini th{ background:#f1f5fb; text-align:left; padding:7px 8px; font-weight:600; color:#3f4c66; position:sticky; top:0; }
table.mini td{ padding:7px 8px; border-bottom:1px solid #eef1f6; }
.floatbtn{ position:fixed; right:18px; bottom:84px; z-index:25; background:var(--pri); color:#fff; border:none;
  width:52px; height:52px; border-radius:50%; font-size:26px; box-shadow:0 6px 16px rgba(37,99,235,.4); }

/* 在途(客户自助登记、货未到) */
.badge.b-incoming{background:#e0e7ff;color:#3730a3}
.order.st-incoming{border-left:4px solid #6366f1}
