:root {
  --brand: #ff7a00;
  --brand2: #ff9d2e;
  --bg: #f5f6fa;
  --card: #fff;
  --text: #1f2329;
  --muted: #737985;
  --line: #e9ebf0;
  --green: #16a34a;
  --red: #e11d48;
  --blue: #2563eb;
  --shadow: 0 8px 26px rgba(25, 28, 33, .08);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }
button, input, textarea { font: inherit; }
button { border: none; }
.safe-top { padding-top: env(safe-area-inset-top); }
.safe-bottom { padding-bottom: env(safe-area-inset-bottom); }
.app-shell { min-height: 100vh; max-width: 520px; margin: 0 auto; background: var(--bg); position: relative; overflow-x: hidden; box-shadow: 0 0 0 1px rgba(0,0,0,.03); }
.topbar { background: linear-gradient(135deg, var(--brand), var(--brand2)); color: white; padding: calc(14px + env(safe-area-inset-top)) 16px 18px; position: sticky; top: 0; z-index: 10; }
.topbar-row { display: flex; align-items: center; gap: 12px; }
.top-title { font-size: 18px; font-weight: 800; flex: 1; text-align: center; }
.back-btn, .ghost-btn { color: #fff; background: rgba(255,255,255,.18); width: 36px; height: 36px; border-radius: 999px; display: grid; place-items: center; font-size: 20px; }
.ghost-btn { font-size: 13px; width: auto; min-width: 54px; padding: 0 10px; }
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 22px; background: linear-gradient(180deg, #fff6ed 0%, #f5f6fa 46%, #f5f6fa 100%); }
.login-card { width: 100%; max-width: 420px; background: white; border-radius: 24px; padding: 26px 20px; box-shadow: var(--shadow); }
.logo { width: 58px; height: 58px; border-radius: 18px; background: linear-gradient(135deg, var(--brand), var(--brand2)); color: white; display: grid; place-items: center; font-weight: 900; font-size: 22px; margin-bottom: 16px; }
.login-card h1 { margin: 0 0 6px; font-size: 25px; }
.login-card p { margin: 0 0 22px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.field { margin: 13px 0; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 7px; }
.field input, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: 14px; padding: 13px 14px; background: #fafbfc; outline: none; }
.field input:focus, .field textarea:focus { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px rgba(255, 122, 0, .12); }
.primary { width: 100%; background: linear-gradient(135deg, var(--brand), var(--brand2)); color: white; border-radius: 14px; padding: 14px 16px; font-weight: 800; margin-top: 10px; box-shadow: 0 8px 18px rgba(255,122,0,.22); }
.secondary { width: 100%; background: #fff; color: var(--brand); border: 1px solid rgba(255,122,0,.38); border-radius: 14px; padding: 13px 16px; font-weight: 700; margin-top: 10px; }
.tiny { color: var(--muted); font-size: 12px; margin-top: 13px; line-height: 1.45; }
.content { padding: 14px 14px 88px; }
.hero { background: linear-gradient(135deg, var(--brand), var(--brand2)); color: white; margin: -14px -14px 14px; padding: 16px 16px 22px; border-bottom-left-radius: 22px; border-bottom-right-radius: 22px; }
.hero-title { font-size: 20px; font-weight: 800; }
.hero-sub { opacity: .92; margin-top: 8px; font-size: 13px; }
.search-box { background: white; border-radius: 14px; padding: 11px 13px; margin-top: 14px; color: #9298a3; }
.card { background: var(--card); border-radius: 17px; box-shadow: 0 2px 12px rgba(30,34,42,.05); border: 1px solid rgba(233,235,240,.75); padding: 14px; margin-bottom: 12px; }
.card-title { display: flex; align-items: center; gap: 8px; font-weight: 800; margin-bottom: 11px; }
.notice-list { display: grid; gap: 9px; font-size: 14px; }
.notice-item { display: flex; justify-content: space-between; gap: 12px; color: #4b5563; }
.notice-item span:last-child { color: #a0a6b1; font-size: 12px; white-space: nowrap; }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 8px; }
.app-item { display: flex; flex-direction: column; align-items: center; gap: 7px; font-size: 12px; color: #30343b; }
.app-icon { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; color: white; font-weight: 900; background: var(--brand); box-shadow: 0 6px 14px rgba(255,122,0,.2); }
.app-icon.blue { background: #3b82f6; }
.app-icon.green { background: #22c55e; }
.app-icon.purple { background: #8b5cf6; }
.app-icon.red { background: #ef4444; }
.app-icon.gray { background: #64748b; }
.tabbar { position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); max-width: 520px; width: 100%; background: rgba(255,255,255,.96); backdrop-filter: blur(12px); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(3, 1fr); padding: 7px 0 calc(7px + env(safe-area-inset-bottom)); z-index: 20; }
.tab { display: grid; place-items: center; gap: 3px; color: #8a919d; font-size: 12px; }
.tab b { font-size: 20px; line-height: 1; }
.tab.active { color: var(--brand); font-weight: 700; }
.customer-card { background: white; border-radius: 16px; padding: 14px; margin-bottom: 12px; border: 1px solid rgba(233,235,240,.9); }
.customer-head { display: flex; align-items: flex-start; gap: 10px; }
.customer-info { flex: 1; min-width: 0; }
.customer-name { font-weight: 850; font-size: 16px; margin-bottom: 5px; }
.customer-addr { color: var(--muted); font-size: 13px; line-height: 1.45; }
.badge { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 800; background: #fff3e7; color: var(--brand); }
.badge.green { background: #eaf8ef; color: var(--green); }
.badge.blue { background: #eaf1ff; color: var(--blue); }
.badge.gray { background: #eef1f5; color: #64748b; }
.meta-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.meta { background: #f8fafc; border-radius: 999px; color: #64748b; padding: 6px 9px; font-size: 12px; }
.action-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 13px; }
.small-btn { border-radius: 12px; padding: 10px; font-weight: 800; color: var(--brand); background: #fff7ed; }
.small-btn.fill { color: #fff; background: var(--brand); }
.status-panel { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.status-tile { background: #f8fafc; border-radius: 14px; padding: 12px 8px; text-align: center; }
.status-tile strong { display: block; font-size: 19px; }
.status-tile span { color: var(--muted); font-size: 12px; }
.loc-box { background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 14px; padding: 13px; color: #475569; line-height: 1.55; font-size: 13px; }
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.photo-add, .photo { aspect-ratio: 1 / 1; border-radius: 14px; background: #f8fafc; border: 1px dashed #cbd5e1; display: grid; place-items: center; color: #94a3b8; overflow: hidden; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-add input { display: none; }
.task-list { display: grid; gap: 8px; }
.task { display: flex; align-items: center; gap: 10px; background: #fafafa; border-radius: 13px; padding: 11px; }
.dot { width: 9px; height: 9px; border-radius: 99px; background: var(--brand); }
.task span { flex: 1; font-size: 14px; }
.toast { position: fixed; left: 50%; bottom: calc(78px + env(safe-area-inset-bottom)); transform: translateX(-50%); max-width: calc(100vw - 32px); background: rgba(31,35,41,.92); color: white; padding: 11px 14px; border-radius: 999px; font-size: 13px; z-index: 100; }
.empty { color: var(--muted); text-align: center; padding: 40px 12px; }
.loading { opacity: .65; pointer-events: none; }
.devbar { background: #fff7ed; color: #9a3412; border: 1px solid #fed7aa; border-radius: 12px; padding: 10px; font-size: 12px; margin-bottom: 12px; line-height: 1.5; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #f8fafc; border-radius: 14px; padding: 10px 12px; margin-top: 12px; font-size: 13px; }
.switch input { transform: scale(1.12); }
@media (min-width: 600px) { body { background: #e9ecf2; } .app-shell { min-height: 96vh; margin-top: 2vh; border-radius: 30px; overflow: hidden; } .tabbar { border-bottom-left-radius: 30px; border-bottom-right-radius: 30px; } }


/* v0.5 拜访任务三类照片独立按钮 */
.visit-shop-card { background:#fff; border-radius:18px; margin-bottom:12px; padding:16px; display:grid; grid-template-columns:96px 1fr; gap:14px; box-shadow:0 2px 12px rgba(30,34,42,.06); border:1px solid rgba(233,235,240,.85); position:relative; }
.shop-cover { width:82px; height:82px; border-radius:14px; background:#f0f0f0; color:#c6c6c6; display:grid; place-items:center; align-self:center; font-size:26px; }
.shop-title { font-size:20px; font-weight:850; line-height:1.3; padding-right:94px; }
.shop-code, .shop-address { color:#6b7280; font-size:15px; line-height:1.45; margin-top:4px; }
.normal-pill { position:absolute; right:18px; top:62px; min-width:86px; height:34px; border-radius:999px; background:linear-gradient(135deg, var(--brand), #f08a00); color:#fff; font-weight:800; display:flex; align-items:center; justify-content:center; gap:8px; }
.normal-pill i { width:24px; height:24px; border-radius:99px; background:#fff; display:block; box-shadow:0 1px 4px rgba(0,0,0,.16); }
.photo-line { margin-top:11px; display:grid; grid-template-columns:70px 1fr 48px; gap:8px; align-items:center; min-height:42px; }
.line-label { color:#3b3f45; font-weight:650; }
.line-photos { display:flex; align-items:center; gap:6px; min-width:0; }
.muted-line { color:#7b808a; }
.mini-empty { color:#a3a8b1; font-size:12px; }
.mini-photo { width:34px; height:34px; border-radius:4px; overflow:hidden; background:#eee; display:inline-flex; }
.mini-photo img { width:100%; height:100%; object-fit:cover; }
.camera-btn { width:42px; height:42px; border-radius:10px; display:grid; place-items:center; color:var(--brand); background:#fff7ed; border:1px solid rgba(255,122,0,.28); font-size:24px; justify-self:end; }
.camera-btn input { display:none; }
.task-photo-card { background:#fff; border-radius:17px; box-shadow:0 2px 12px rgba(30,34,42,.05); border:1px solid rgba(233,235,240,.75); padding:14px 16px; margin-bottom:12px; }
.task-photo-head { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; }
.task-photo-title { font-size:19px; font-weight:750; line-height:1.35; color:#242830; flex:1; }
.task-state { color:#2563eb; font-weight:750; white-space:nowrap; }
.task-state.done { color:#16803a; }
.task-sep { height:1px; background:#edf0f5; margin:13px 0; }
.photo-work-row { display:grid; grid-template-columns:1fr 52px; gap:10px; align-items:center; }
.photo-preview-row { min-height:42px; display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.recognize-btn { margin-top:12px; background:#ff9c45; color:#fff; border-radius:8px; padding:9px 15px; font-weight:750; }
.link-like { margin-top:8px; color:#6b7280; font-size:15px; }
.paid-card .task-state { color:#16803a; }
.compact-card { padding-bottom:12px; }
.bottom-actions { position:fixed; left:50%; bottom:calc(14px + env(safe-area-inset-bottom)); transform:translateX(-50%); width:min(520px, 100%); display:grid; grid-template-columns:1fr 1fr; gap:12px; padding:0 18px; z-index:25; }
.bottom-disabled, .bottom-next { border-radius:8px; height:52px; font-size:18px; font-weight:800; }
.bottom-disabled { background:#ffd6ad; color:#fff; opacity:.82; }
.bottom-next { background:#ff9b39; color:#fff; }
@media (max-width:380px){ .visit-shop-card{grid-template-columns:76px 1fr;padding:14px;gap:10px}.shop-cover{width:66px;height:66px}.shop-title{font-size:18px;padding-right:84px}.normal-pill{right:14px;top:58px;min-width:78px}.photo-line{grid-template-columns:64px 1fr 44px}.task-photo-title{font-size:17px} }

.today-head { display:flex; justify-content:space-between; align-items:center; gap:12px; background:#fff; border-radius:16px; padding:14px; margin-bottom:12px; border:1px solid rgba(233,235,240,.9); }
.today-title { font-size:18px; font-weight:850; }
.today-sub { color:var(--muted); font-size:12px; margin-top:4px; line-height:1.4; }
.mini-refresh { background:#fff7ed; color:var(--brand); border-radius:999px; padding:8px 12px; font-weight:800; white-space:nowrap; }
.list-status { margin-bottom:12px; }
.done-card { opacity:.82; }
.done-card .customer-name { color:#4b5563; }
.paid-meta { color:#b45309; background:#fff7ed; }

/* v0.9 深度还原调试与接口状态 */
.debug-list { display:grid; gap:8px; }
.debug-item { background:#f8fafc; border:1px solid #e5e7eb; border-radius:12px; padding:10px; font-size:12px; }
.debug-item summary { cursor:pointer; font-weight:800; color:#374151; }
.debug-item pre { white-space:pre-wrap; word-break:break-word; max-height:260px; overflow:auto; margin:8px 0 0; color:#475569; }
.no-top { margin-top:0; }

/* v1.0 已拜访照片回显 */
.mini-photo { position:relative; cursor:pointer; }
.mini-photo em { position:absolute; right:2px; bottom:2px; background:rgba(0,0,0,.58); color:#fff; border-radius:6px; padding:1px 4px; font-size:10px; font-style:normal; }
.photo-more { display:inline-grid; place-items:center; min-width:42px; height:42px; border-radius:10px; background:#fff7ed; color:#ff7a00; font-weight:900; cursor:pointer; }
.photo-history { margin-top:8px; background:#fffaf4; border:1px solid #ffe2bf; border-radius:12px; padding:8px 10px; }
.photo-history summary { color:#b45309; font-size:13px; font-weight:800; cursor:pointer; }
.full-photo-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin-top:9px; }
.full-photo { position:relative; aspect-ratio:1/1; border-radius:12px; overflow:hidden; background:#f1f5f9; border:1px solid #e5e7eb; cursor:pointer; }
.full-photo img { width:100%; height:100%; object-fit:cover; display:block; }
.full-photo-mark { position:absolute; left:0; right:0; bottom:0; background:linear-gradient(180deg, transparent, rgba(0,0,0,.65)); color:#fff; font-size:10px; padding:18px 5px 5px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.small-empty { font-size:12px; padding:10px 0; }
.photo-viewer { position:fixed; inset:0; z-index:1000; background:rgba(0,0,0,.92); display:flex; flex-direction:column; align-items:center; justify-content:center; padding:calc(12px + env(safe-area-inset-top)) 12px calc(16px + env(safe-area-inset-bottom)); }
.photo-viewer-bar { position:absolute; left:0; right:0; top:0; padding:calc(12px + env(safe-area-inset-top)) 14px 10px; color:#fff; display:flex; align-items:center; justify-content:space-between; background:linear-gradient(180deg, rgba(0,0,0,.75), transparent); }
.photo-viewer-bar button { color:#fff; background:rgba(255,255,255,.18); border-radius:999px; padding:8px 12px; font-weight:800; }
.photo-viewer img { max-width:100%; max-height:78vh; object-fit:contain; border-radius:10px; }
.photo-viewer-foot { position:absolute; left:0; right:0; bottom:0; padding:10px 14px calc(14px + env(safe-area-inset-bottom)); color:#d1d5db; font-size:12px; text-align:center; background:linear-gradient(0deg, rgba(0,0,0,.75), transparent); }


/* v1.1 下一步进入通宝界面，已完成任务禁止重复结束 */
.tongbao-hero { background:linear-gradient(135deg,#ff7a00,#ffb15a); color:#fff; border-radius:18px; padding:18px 16px; margin-bottom:12px; position:relative; box-shadow:0 8px 22px rgba(255,122,0,.18); }
.tongbao-title { font-size:22px; font-weight:900; }
.tongbao-sub { margin-top:6px; opacity:.92; font-size:13px; padding-right:96px; line-height:1.45; }
.tongbao-state { position:absolute; right:14px; top:16px; border-radius:999px; padding:6px 10px; font-size:12px; font-weight:850; background:rgba(255,255,255,.22); }
.tongbao-state.done { background:rgba(22,163,74,.95); }
.tongbao-panel { background:#fffaf4; border:1px solid #ffe2bf; border-radius:14px; padding:12px; }
.tongbao-placeholder { color:#92400e; font-size:13px; line-height:1.55; }
.tongbao-mini-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin-top:12px; }
.tongbao-mini-grid div { background:#fff; border-radius:12px; padding:12px 8px; text-align:center; border:1px solid #f4e4d1; }
.tongbao-mini-grid strong { display:block; font-size:20px; color:#ff7a00; }
.tongbao-mini-grid span { display:block; margin-top:3px; color:#6b7280; font-size:12px; }
.bottom-next.disabled-next { background:#cbd5e1; color:#fff; }
.completed-actions .bottom-disabled { background:#e2e8f0; color:#64748b; opacity:1; }
.completed-actions .bottom-next { background:#94a3b8; }

.danger-meta { color: var(--red); border-color: rgba(225,29,72,.25); background: rgba(225,29,72,.08); }
.loc-warning { margin-top: 8px; color: var(--red); font-weight: 700; }
