:root {
  --brand: #00a7a7;
  --brand-dark: #007c7c;
  --bg: #f2f4f7;
  --card: #ffffff;
  --text: #1f2933;
  --muted: #6b7683;
  --line: #e4e8ee;
  --done: #17a34a;
  --incomplete: #e0a400;
  --pending: #8a94a6;
  --danger: #d9453d;
  --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .06);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
    "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  padding-bottom: 68px;
}

a { color: inherit; text-decoration: none; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--brand);
  color: #fff;
  padding: 12px 16px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: var(--shadow);
}
.topbar h1 { font-size: 17px; margin: 0; font-weight: 600; flex: 1; }
.topbar .back { font-size: 20px; line-height: 1; padding: 2px 6px; }
.topbar .act { font-size: 13px; background: rgba(255,255,255,.2); padding: 5px 10px;
  border-radius: 8px; }

.container { padding: 14px; max-width: 720px; margin: 0 auto; }

.card {
  background: var(--card);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 14px;
  margin-bottom: 12px;
}

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  margin-bottom: 14px; }
.stat {
  background: var(--card); border-radius: 12px; padding: 12px 6px;
  text-align: center; box-shadow: var(--shadow);
}
.stat .num { font-size: 22px; font-weight: 700; }
.stat .lbl { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stat.done .num { color: var(--done); }
.stat.incomplete .num { color: var(--incomplete); }
.stat.pending .num { color: var(--pending); }

.route-card { display: flex; align-items: center; gap: 12px; }
.route-card .ring { flex: 0 0 auto; }
.route-card .info { flex: 1; min-width: 0; }
.route-card .info .name { font-size: 17px; font-weight: 600; }
.route-card .info .meta { font-size: 13px; color: var(--muted); margin-top: 3px; }
.route-card .go { font-size: 22px; color: var(--muted); }

.progress { height: 8px; background: var(--line); border-radius: 6px; overflow: hidden;
  margin-top: 8px; display: flex; }
.progress .p-done { background: var(--done); height: 100%; }
.progress .p-inc { background: var(--incomplete); height: 100%; }

.chip { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px;
  font-weight: 600; }
.chip.done { background: #e3f6ea; color: var(--done); }
.chip.incomplete { background: #fbf1d6; color: #a97e00; }
.chip.pending { background: #eef0f4; color: var(--pending); }

/* 门店卡片 */
.store {
  background: var(--card); border-radius: 14px; box-shadow: var(--shadow);
  margin-bottom: 12px; overflow: hidden;
}
.store.s-done { border-left: 5px solid var(--done); }
.store.s-incomplete { border-left: 5px solid var(--incomplete); }
.store.s-pending { border-left: 5px solid var(--pending); }

.store .head { display: flex; align-items: flex-start; gap: 10px; padding: 13px 14px; }
.store .seq {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%;
  background: var(--brand); color: #fff; font-weight: 700; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.store .title { flex: 1; min-width: 0; }
.store .title .nm { font-size: 16px; font-weight: 600; display: flex;
  align-items: center; gap: 6px; flex-wrap: wrap; }
.store .title .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

.body { padding: 0 14px 14px; }
.addr-row { display: flex; align-items: flex-start; gap: 8px; padding: 7px 0;
  border-top: 1px dashed var(--line); }
.addr-row .flag { flex: 0 0 auto; font-size: 11px; color: #fff; background: var(--muted);
  border-radius: 5px; padding: 1px 6px; margin-top: 2px; }
.addr-row .flag.th { background: #2d6cdf; }
.addr-row .flag.en { background: #7a869a; }
.addr-row .flag.zh { background: var(--brand); }
.addr-row .txt { flex: 1; font-size: 14px; word-break: break-word; }

.kv { display: flex; gap: 10px; margin: 10px 0; }
.kv .box { flex: 1; background: #f6f8fa; border-radius: 10px; padding: 8px; text-align: center; }
.kv .box .n { font-size: 22px; font-weight: 700; color: var(--brand-dark); }
.kv .box .l { font-size: 12px; color: var(--muted); }

.meta-line { font-size: 13px; color: var(--muted); margin: 4px 0; }
.meta-line.avoid { color: var(--danger); font-weight: 600; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  border: none; border-radius: 10px; padding: 9px 12px; font-size: 14px;
  font-weight: 600; cursor: pointer; background: #eef0f4; color: var(--text); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--brand); color: #fff; }
.btn.nav { background: #1a73e8; color: #fff; }
.btn.copy { background: #eef0f4; }
.btn.mini { padding: 4px 9px; font-size: 12px; border-radius: 8px; }
.btn-row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.btn-row .btn { flex: 1; }

.status-row { display: flex; gap: 8px; margin-top: 10px; }
.status-row .sbtn { flex: 1; padding: 9px 4px; border-radius: 10px; border: 1.5px solid var(--line);
  background: #fff; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--muted); }
.status-row .sbtn.active.done { background: var(--done); color: #fff; border-color: var(--done); }
.status-row .sbtn.active.incomplete { background: var(--incomplete); color: #fff; border-color: var(--incomplete); }
.status-row .sbtn.active.pending { background: var(--pending); color: #fff; border-color: var(--pending); }

.field { margin-top: 10px; }
.field label { font-size: 12px; color: var(--muted); display: block; margin-bottom: 4px; }
.field input, .field textarea, .field select {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px;
  font-size: 14px; font-family: inherit; background: #fff; color: var(--text);
}
.field textarea { min-height: 56px; resize: vertical; }
.hidden { display: none !important; }

.filters { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.filters input { flex: 1; min-width: 140px; border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 10px; font-size: 14px; }
.filters select { border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px;
  font-size: 14px; background: #fff; }

.tabbar { position: fixed; bottom: 0; left: 0; right: 0; background: #fff;
  border-top: 1px solid var(--line); display: flex; z-index: 30; }
.tabbar a { flex: 1; text-align: center; padding: 9px 0 10px; font-size: 11px;
  color: var(--muted); }
.tabbar a .ic { font-size: 20px; display: block; }
.tabbar a.on { color: var(--brand); }

.toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%);
  background: rgba(31,41,51,.94); color: #fff; padding: 9px 16px; border-radius: 10px;
  font-size: 13px; z-index: 50; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.show { opacity: 1; }

.person-badge { font-size: 11px; padding: 1px 7px; border-radius: 20px; color: #fff; }

/* 登录页 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 20px; }
.login-box { background: #fff; border-radius: 16px; box-shadow: var(--shadow); padding: 28px 22px;
  width: 100%; max-width: 340px; text-align: center; }
.login-box .logo { font-size: 26px; font-weight: 700; color: var(--brand); }
.login-box .desc { color: var(--muted); font-size: 13px; margin: 6px 0 20px; }
.login-box input { width: 100%; border: 1px solid var(--line); border-radius: 10px;
  padding: 12px; font-size: 15px; margin-bottom: 12px; }
.login-box button { width: 100%; }
.login-box .err { color: var(--danger); font-size: 13px; margin-top: 10px; min-height: 18px; }

#map { width: 100%; }
.leaflet-popup-content { font-size: 13px; }
.updated { font-size: 11px; color: var(--muted); margin-top: 6px; }
