* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body {
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #1c1f26;
  color: #1f2430;
}
body { display: flex; align-items: center; justify-content: center; }

/* 9:16 手机外框：最大宽度 420，高度按 9:16 计算 */
.phone {
  position: relative;
  width: 100%;
  max-width: 420px;
  height: 100vh;
  max-height: calc(420px * 16 / 9);
  background: #f5f6f8;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0,0,0,.35);
}
@media (min-width: 440px) {
  .phone { border-radius: 22px; }
}

/* 顶栏 */
.topbar {
  flex: 0 0 auto;
  height: 50px;
  background: #2b6cff;
  color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px;
  font-size: 17px; font-weight: 600;
}
.iconbtn { background: transparent; border: none; color: #fff; font-size: 20px; cursor: pointer; }

/* 设置面板 */
.settings {
  flex: 0 0 auto;
  background: #fff;
  border-bottom: 1px solid #e6e8ec;
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 8px;
}
.settings .lbl { font-size: 13px; color: #555; }
.settings input[type=text] {
  border: 1px solid #cfd4dc; border-radius: 8px; padding: 9px 10px; font-size: 14px;
}
.settings .hint { font-size: 12px; color: #888; }
.settings .row { font-size: 13px; color: #333; display: flex; align-items: center; gap: 6px; }

/* 地图 */
.map { flex: 1 1 auto; position: relative; background: #dfe3ea; min-height: 150px; }
.map-tip {
  position: absolute; left: 50%; top: 12px; transform: translateX(-50%);
  background: rgba(0,0,0,.6); color: #fff; font-size: 12px;
  padding: 5px 12px; border-radius: 14px; z-index: 10; white-space: nowrap;
}
/* 地图中心十字准星 + 坐标信息 */
.map-center {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  pointer-events: none; z-index: 6; text-align: center;
}
.map-center .crosshair {
  font-size: 30px; line-height: 30px; color: #ff3b30; font-weight: 700;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff;
}
.map-center .center-label {
  margin-top: -4px; font-size: 11px; color: #ff3b30; background: rgba(255,255,255,.85);
  padding: 1px 6px; border-radius: 8px; display: inline-block;
}
.center-info {
  position: absolute; left: 50%; top: 8px; transform: translateX(-50%);
  background: rgba(0,0,0,.7); color: #fff; font-size: 11px;
  padding: 4px 10px; border-radius: 12px; z-index: 10; white-space: nowrap;
}

/* 控制条 */
.controls {
  flex: 0 0 auto;
  display: flex; gap: 6px; padding: 8px 10px;
  background: #fff; border-top: 1px solid #e6e8ec; border-bottom: 1px solid #e6e8ec;
}
.sel {
  flex: 1 1 0; min-width: 0; border: 1px solid #cfd4dc; border-radius: 8px;
  font-size: 13px; padding: 7px 4px; background: #fff;
}

/* 按钮 */
.btn { border: none; border-radius: 8px; font-size: 14px; padding: 9px 12px; cursor: pointer; }
.btn.primary { background: #2b6cff; color: #fff; font-weight: 600; }
.btn.ghost { background: #eef1f6; color: #2b6cff; }
.btn.sm { padding: 6px 10px; font-size: 12px; }
.btn.danger { color: #e23b3b; }
.btn:active { opacity: .8; }

/* 底部列表 */
.sheet {
  flex: 0 0 54%;
  background: #fff;
  display: flex; flex-direction: column;
  border-top: 2px solid #2b6cff;
  min-height: 0;
}
.sheet-head {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; font-size: 13px; color: #444; border-bottom: 1px solid #eef0f3;
}
.sheet-actions { display: flex; gap: 6px; }
.list {
  flex: 1 1 auto; min-height: 0;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  touch-action: pan-y; overscroll-behavior: contain;
  list-style: none; padding: 4px 8px 10px;
  scrollbar-width: thin; scrollbar-color: #b9c0cc transparent;
}
.list::-webkit-scrollbar { width: 6px; }
.list::-webkit-scrollbar-thumb { background: #b9c0cc; border-radius: 3px; }

.card {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 10px 8px; border-bottom: 1px solid #f0f2f5;
}
.card .badge {
  flex: 0 0 auto; font-size: 11px; padding: 2px 7px; border-radius: 10px; margin-top: 2px;
}
.badge.ind { background: #fff3e0; color: #e08a00; border: 1px solid #ffd79a; }
.badge.corp { background: #eef1f6; color: #6b7280; }
.badge.unk { background: #f3f4f6; color: #9aa1ac; }
.card .body { flex: 1 1 auto; min-width: 0; }
.card .name { font-size: 14px; font-weight: 600; color: #1f2430; }
.card .meta { font-size: 12px; color: #888; margin-top: 3px; line-height: 1.5; }
.card .meta .tel { color: #2b6cff; }
.card .ops { flex: 0 0 auto; display: flex; flex-direction: column; gap: 5px; align-items: flex-end; }
.card .ops select { font-size: 11px; border: 1px solid #cfd4dc; border-radius: 6px; padding: 3px 4px; max-width: 78px; }
.card .ops .mini { font-size: 11px; color: #e23b3b; background: none; border: none; cursor: pointer; }
.card .ops .mini.nav {
  font-size: 12px; font-weight: 600; color: #fff; background: #1aae6f;
  border: none; border-radius: 14px; padding: 5px 12px; cursor: pointer;
}
.card .ops .mini.nav:active { opacity: .82; }

/* toast */
.toast {
  position: absolute; left: 50%; bottom: 56%; transform: translateX(-50%);
  background: rgba(0,0,0,.8); color: #fff; font-size: 13px;
  padding: 8px 16px; border-radius: 18px; z-index: 30; white-space: nowrap;
}
.hidden { display: none !important; }

/* 主应用容器 */
.app { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }

/* 顶栏操作员区 */
.opzone { display: flex; align-items: center; gap: 8px; }
.opname { font-size: 12px; font-weight: 400; opacity: .9; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 登录 / 注册面板 */
.login {
  position: absolute; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #2b6cff 0%, #1746b8 100%);
  padding: 16px;
}
.login-box {
  width: 100%; max-width: 300px; background: #fff; border-radius: 16px;
  padding: 22px 20px; display: flex; flex-direction: column; gap: 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
}
.login-title { font-size: 19px; font-weight: 700; color: #1f2430; text-align: center; }
.login-sub { font-size: 12px; color: #888; text-align: center; margin-bottom: 4px; }
.login-box input[type=text], .login-box input[type=password] {
  border: 1px solid #cfd4dc; border-radius: 10px; padding: 11px 12px; font-size: 15px;
}
.login-box .btn.primary { margin-top: 4px; font-size: 15px; padding: 11px; }
.login-msg { font-size: 12px; color: #e23b3b; min-height: 16px; text-align: center; }
.login-box .hint { font-size: 11px; color: #999; text-align: center; }

/* 操作员授权管理面板 */
.admin-create { display: flex; gap: 6px; flex-wrap: wrap; }
.admin-create input[type=text], .admin-create input[type=password] {
  flex: 1 1 120px; border: 1px solid #cfd4dc; border-radius: 8px; padding: 8px 10px; font-size: 13px;
}
.oplist { list-style: none; display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow-y: auto; }
.oplist .opitem {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: #f6f8fb; border: 1px solid #eef0f3; border-radius: 8px; padding: 7px 10px; font-size: 13px;
}
.oplist .opname2 { font-weight: 600; color: #1f2430; }
.oplist .oprole { color: #6b7280; font-size: 11px; }
.oplist .op-on { color: #1aae6f; font-size: 12px; }
.oplist .op-off { color: #e23b3b; font-size: 12px; }
.oplist .mini {
  margin-left: auto; font-size: 12px; padding: 4px 10px; border: 1px solid #cfd4dc;
  border-radius: 12px; background: #fff; color: #2b6cff; cursor: pointer;
}
