* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --blue: #1E4E8C; --blue-light: #2E6CB5; --orange: #FF6B35;
  --bg: #F2F5FA; --line: #E6EBF2; --gray: #8A94A6; --red: #D6453D;
  --green: #2E9E5B;
}
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: #1F2D3D; font-size: 14px;
  -webkit-tap-highlight-color: transparent;
}
input, textarea, button { font-family: inherit; }

/* ICP 备案信息 */
.beian-bar { text-align: center; padding: 14px 12px 18px; font-size: 12px; color: var(--gray); }
.beian-bar a { color: var(--gray); text-decoration: none; }
.beian-bar a:hover { text-decoration: underline; color: var(--blue); }
.login-card .beian-bar { padding: 10px 12px 16px; border-top: 1px solid var(--line); }
.app-beian { padding: 22px 12px 28px; }

/* 登录 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-card { width: 100%; max-width: 380px; background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 10px 40px rgba(30,78,140,.12); }
.login-banner { background: linear-gradient(135deg, var(--blue), var(--blue-light)); color: #fff; padding: 28px 24px; }
.login-banner .org { font-size: 18px; font-weight: 700; }
.login-banner .sys { font-size: 13px; opacity: .92; margin-top: 6px; }
.login-form { padding: 22px; }
.login-form input { width: 100%; height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 0 14px; margin-bottom: 12px; font-size: 15px; outline: none; }
.login-form input:focus { border-color: var(--blue); }
.btn-primary { width: 100%; height: 44px; background: var(--blue); color: #fff; border: none; border-radius: 10px; font-size: 16px; cursor: pointer; }
.btn-primary:hover { background: var(--blue-light); }
.err { color: var(--red); font-size: 12px; min-height: 18px; margin-top: 6px; }
.hint { color: var(--gray); font-size: 12px; margin-top: 12px; }
.hint.warn { color: var(--red); font-weight: 600; }

/* 应用框架 */
.app { min-height: 100vh; padding-bottom: 30px; }
.topbar {
  background: linear-gradient(135deg, var(--blue), var(--blue-light)); color: #fff;
  display: flex; align-items: center; padding: 14px 16px;
  position: sticky; top: 0; z-index: 10;
}
.btn-back { background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.4); border-radius: 8px; width: 34px; height: 34px; font-size: 22px; line-height: 1; cursor: pointer; margin-right: 10px; }
.top-title { font-size: 17px; font-weight: 700; flex: 1; }
.btn-outline { background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.5); border-radius: 8px; padding: 7px 13px; cursor: pointer; font-size: 13px; }
.page { padding: 14px; max-width: 720px; margin: 0 auto; }

/* 首页 */
.user-card { background: linear-gradient(135deg, var(--blue), var(--blue-light)); color: #fff; border-radius: 14px; padding: 18px 18px; margin-bottom: 14px; }
.user-card .u-org { font-size: 17px; font-weight: 700; }
.user-card .u-area { font-size: 12px; opacity: .9; margin-top: 4px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px,1fr)); gap: 10px; margin-bottom: 12px; }
.stat { background: #fff; border-radius: 12px; padding: 14px; box-shadow: 0 4px 14px rgba(30,78,140,.06); text-align: center; }
.stat .num { font-size: 26px; font-weight: 700; color: var(--blue); }
.stat.warn .num { color: var(--orange); }
.stat .lbl { font-size: 12px; color: var(--gray); margin-top: 4px; }
.alerts { margin-bottom: 12px; }
.alert-card { background: #FFF6F4; border: 1px solid #FFD9CE; border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.alert-card h4 { color: var(--red); font-size: 14px; margin-bottom: 6px; }
.alert-item { font-size: 13px; color: #7A3B33; line-height: 1.7; }
.alert-item b { color: #B23A2E; }

/* 菜单 */
.menu { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.menu-item { background: #fff; border-radius: 14px; padding: 18px 14px; text-align: center; cursor: pointer; box-shadow: 0 4px 14px rgba(30,78,140,.06); }
.menu-item .mi-ic { font-size: 26px; }
.menu-item .mi-tx { font-size: 14px; color: #33415C; margin-top: 6px; font-weight: 600; }
.menu-item .mi-sub { font-size: 11px; color: var(--gray); margin-top: 2px; }
.menu-item.orange .mi-ic { color: var(--orange); }
.menu-item.blue .mi-ic { color: var(--blue); }
.menu-item.green .mi-ic { color: var(--green); }

/* 页头与按钮 */
.page-head { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.btn-add { background: var(--orange); color: #fff; border: none; border-radius: 10px; padding: 11px 18px; cursor: pointer; font-size: 14px; font-weight: 600; }
.btn-add:hover { background: #F05A22; }
.btn-ghost { background: #fff; border: 1px solid var(--line); color: #4A5568; border-radius: 10px; padding: 11px 18px; cursor: pointer; font-size: 14px; }
.btn-danger { background: #fff; border: 1px solid #F2C7BC; color: var(--red); border-radius: 8px; padding: 7px 12px; cursor: pointer; font-size: 13px; }

/* 列表卡片 */
.list { display: flex; flex-direction: column; gap: 12px; }
.card { background: #fff; border-radius: 14px; padding: 14px; box-shadow: 0 4px 14px rgba(30,78,140,.06); }
.card .c-title { font-size: 16px; font-weight: 700; color: #1F2D3D; }
.card .c-meta { font-size: 12px; color: var(--gray); margin-top: 5px; line-height: 1.6; }
.card .c-actions { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.photo-thumbs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.photo-thumbs img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.badge-ok { color: var(--green); font-weight: 600; }
.badge-bad { color: var(--red); font-weight: 600; }
.empty { padding: 40px 20px; text-align: center; color: var(--gray); font-size: 14px; }

/* 表单 */
.form { background: #fff; border-radius: 14px; padding: 16px; box-shadow: 0 4px 14px rgba(30,78,140,.06); }
.field { margin-bottom: 14px; }
.field-label { font-size: 14px; color: #33415C; margin-bottom: 6px; font-weight: 600; }
.field-label .req { color: var(--red); }
.field input, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; font-size: 15px; outline: none; }
.field textarea { min-height: 80px; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--blue); }
.radio-row { display: flex; gap: 12px; }
.radio-row label { flex: 1; text-align: center; border: 1px solid var(--line); border-radius: 10px; padding: 11px 0; cursor: pointer; font-size: 14px; color: #4A5568; }
.radio-row label.on-ok { border-color: var(--green); color: var(--green); background: #EFFAF3; font-weight: 700; }
.radio-row label.on-bad { border-color: var(--red); color: var(--red); background: #FDF1EF; font-weight: 700; }
.photo-grid { display: flex; gap: 8px; flex-wrap: wrap; }
.photo-box { position: relative; width: 76px; height: 76px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.photo-box img { width: 100%; height: 100%; object-fit: cover; }
.photo-del { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; background: rgba(0,0,0,.55); color: #fff; border-radius: 50%; text-align: center; line-height: 18px; font-size: 14px; cursor: pointer; }
.photo-add { width: 76px; height: 76px; border: 1px dashed var(--gray); border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--gray); cursor: pointer; background: #FAFBFE; }
.photo-add .plus { font-size: 24px; line-height: 1; }
.photo-add .pt { font-size: 10px; margin-top: 2px; }
.btn-block { display: block; width: 100%; margin-top: 16px; }

/* 账号表单 */
.account-form { background: #FAFBFE; border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 12px; display: flex; flex-wrap: wrap; gap: 10px; }
.account-form input { height: 42px; border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; font-size: 14px; outline: none; flex: 1; min-width: 160px; }
.form-actions { display: flex; gap: 10px; width: 100%; }

/* 表格（桌面端） */
@media (min-width: 640px) {
  table { width: 100%; border-collapse: collapse; font-size: 13px; }
  th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
  th { background: #F6F8FC; color: #4A5568; font-weight: 600; }
}
.link-btn { color: var(--blue); cursor: pointer; text-decoration: underline; }

/* 地图与定位 */
.map-card { background: #fff; border-radius: 14px; padding: 14px; box-shadow: 0 4px 14px rgba(30,78,140,.06); margin-bottom: 12px; }
.map-title { font-size: 14px; font-weight: 700; color: #33415C; margin-bottom: 8px; }
.map-box { width: 100%; height: 220px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #EAF0F7; }
.map-box.rect { height: 180px; }
.loc-btns { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.btn-loc { flex: 1; min-width: 110px; background: #EAF1FB; color: var(--blue); border: 1px solid #C9DDF7; border-radius: 9px; padding: 9px 12px; cursor: pointer; font-size: 13px; font-weight: 600; }
.btn-loc.on { background: var(--blue); color: #fff; border-color: var(--blue); }
.loc-result { font-size: 12px; color: var(--gray); margin-top: 6px; line-height: 1.6; }
.loc-result b { color: var(--green); }
select.field-select { width: 100%; height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; font-size: 15px; outline: none; background: #fff; color: #1F2D3D; }
select.field-select:focus { border-color: var(--blue); }

/* 通用弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(18,30,50,.5); z-index: 1000; display: flex; align-items: flex-end; justify-content: center; }
.modal { width: 100%; max-width: 720px; max-height: 86vh; background: #fff; border-radius: 18px 18px 0 0; display: flex; flex-direction: column; animation: modalUp .22s ease; overflow: hidden; }
@keyframes modalUp { from { transform: translateY(40px); opacity: .5; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: center; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.modal-title { flex: 1; font-size: 16px; font-weight: 700; color: #1F2D3D; }
.modal-close { width: 30px; height: 30px; border: none; background: #F2F5FA; border-radius: 50%; font-size: 20px; line-height: 1; color: #4A5568; cursor: pointer; }
.modal-body { padding: 16px 18px 22px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.detail-row { display: flex; padding: 9px 0; border-bottom: 1px dashed #EEF1F6; font-size: 14px; }
.detail-row:last-child { border-bottom: none; }
.detail-row .dk { width: 88px; flex-shrink: 0; color: var(--gray); }
.detail-row .dv { flex: 1; color: #1F2D3D; word-break: break-all; }
.detail-photos { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.detail-photos img { width: 88px; height: 88px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.modal-sub { font-size: 12px; color: var(--gray); margin: 2px 0 8px; }
.modal-list { display: flex; flex-direction: column; gap: 8px; }
.modal-list-item { background: #F7F9FC; border-radius: 10px; padding: 10px 12px; font-size: 14px; line-height: 1.5; }
.modal-list-item b { color: #1F2D3D; }
.modal-tag { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; margin-right: 6px; }
.tag-ok { background: #EFFAF3; color: var(--green); }
.tag-bad { background: #FDF1EF; color: var(--red); }

/* 卡片可点击态与美化 */
.stat { cursor: pointer; transition: transform .12s, box-shadow .12s; position: relative; }
.stat:active { transform: scale(.97); }
.stat .num { font-size: 28px; }
.stat .hint-arrow { display: block; font-size: 10px; color: #B7C0CE; margin-top: 3px; }
.card { position: relative; }
.card.tappable { cursor: pointer; transition: transform .12s, box-shadow .12s; }
.card.tappable:active { transform: scale(.985); }
.card .c-title { display: flex; align-items: center; gap: 6px; }
.card .chev { margin-left: auto; color: #C6CDD8; font-size: 16px; }
.menu-item { transition: transform .12s; }
.menu-item:active { transform: scale(.96); }
.user-card { position: relative; overflow: hidden; }
.user-card::after { content: ''; position: absolute; right: -30px; top: -30px; width: 120px; height: 120px; background: rgba(255,255,255,.08); border-radius: 50%; }
.page-head { align-items: center; }
.empty { color: #A6AEBD; }
.empty .e-ic { font-size: 40px; display: block; margin-bottom: 8px; opacity: .7; }
@media (min-width: 640px) {
  .modal-mask { align-items: center; padding: 20px; }
  .modal { border-radius: 18px; }
}

/* 地图信息卡片（InfoWindow 内嵌） */
.amap-info-content { padding: 0; border-radius: 12px; overflow: hidden; }
.pin-card { width: 240px; font-family: inherit; }
.pin-card .pc-head { display: flex; align-items: center; gap: 6px; padding: 10px 12px; background: linear-gradient(135deg, var(--blue), var(--blue-light)); color: #fff; }
.pin-card .pc-head .pc-ic { font-size: 18px; }
.pin-card .pc-head .pc-t { font-size: 14px; font-weight: 700; flex: 1; }
.pin-card .pc-body { padding: 10px 12px; background: #fff; }
.pin-card .pc-row { display: flex; padding: 3px 0; font-size: 12.5px; }
.pin-card .pc-row .pc-k { width: 62px; flex-shrink: 0; color: var(--gray); }
.pin-card .pc-row .pc-v { flex: 1; color: #1F2D3D; word-break: break-all; }
.pin-card .pc-tags { margin: 6px 0 2px; }
.pin-card .pc-photos { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }
.pin-card .pc-photos img { width: 52px; height: 52px; object-fit: cover; border-radius: 7px; border: 1px solid var(--line); }
.pin-card .pc-coord { display: flex; gap: 10px; margin-top: 4px; }
.pin-card .pc-coord .cc { flex: 1; background: #F2F6FC; border-radius: 8px; padding: 6px 8px; text-align: center; }
.pin-card .pc-coord .cc .cc-k { font-size: 10px; color: var(--gray); }
.pin-card .pc-coord .cc .cc-v { font-size: 13px; font-weight: 700; color: var(--blue); font-family: 'SFMono-Regular', Consolas, monospace; }
.pin-card .pc-foot { padding: 7px 12px; font-size: 11px; color: var(--gray); border-top: 1px solid var(--line); background: #FBFCFE; }
.amap-label { background: rgba(30,78,140,.92); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 10px; white-space: nowrap; box-shadow: 0 2px 8px rgba(0,0,0,.18); }

/* 图片半透明预览层 */
.img-viewer { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.img-viewer-mask { position: absolute; inset: 0; background: rgba(12,20,34,.88); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.img-viewer img { position: relative; max-width: 100%; max-height: 100%; border-radius: 10px; box-shadow: 0 16px 50px rgba(0,0,0,.55); animation: zoomIn .2s ease; }
@keyframes zoomIn { from { transform: scale(.9); opacity: .4; } to { transform: none; opacity: 1; } }
.img-viewer-close { position: absolute; top: 16px; right: 18px; width: 38px; height: 38px; border: 1px solid rgba(255,255,255,.4); background: rgba(255,255,255,.14); color: #fff; border-radius: 50%; font-size: 22px; line-height: 1; cursor: pointer; z-index: 2; }
.img-viewer-close:hover { background: rgba(255,255,255,.28); }
.photo-thumbs img, .detail-photos img, .photo-box img, .pc-photos img, .pin-card .pc-photos img { cursor: zoom-in; }

/* 轻提示（替代原生 alert，手机端不弹系统对话框） */
.toast { position: fixed; left: 50%; top: 74px; transform: translate(-50%, -12px); z-index: 3000;
  max-width: 82vw; padding: 11px 18px; border-radius: 22px; background: rgba(28,38,54,.93); color: #fff;
  font-size: 14px; line-height: 1.55; text-align: center; white-space: pre-line; word-break: break-word;
  box-shadow: 0 8px 24px rgba(12,20,34,.28); opacity: 0; pointer-events: none;
  transition: opacity .22s ease, transform .22s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok { background: rgba(22,120,66,.95); }
.toast.err { background: rgba(190,52,40,.95); }

/* 确认弹窗（替代原生 confirm） */
.confirm-mask { position: fixed; inset: 0; z-index: 3100; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: rgba(15,23,42,.5); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  animation: cfFade .18s ease; }
.confirm-box { width: 100%; max-width: 330px; background: #fff; border-radius: 18px; padding: 24px 20px 16px;
  text-align: center; box-shadow: 0 20px 60px rgba(12,20,34,.32); animation: cfPop .22s cubic-bezier(.2,.9,.3,1.2); }
.confirm-ic { width: 46px; height: 46px; margin: 0 auto 12px; border-radius: 50%; background: #FFF1EC;
  color: var(--orange); font-size: 24px; font-weight: 700; line-height: 46px; }
.confirm-box.danger .confirm-ic { background: #FEECEB; color: var(--red); }
.confirm-title { font-size: 17px; font-weight: 700; color: var(--ink); margin-bottom: 8px; }
.confirm-msg { font-size: 14px; color: var(--gray); line-height: 1.72; white-space: pre-line; word-break: break-word; }
.confirm-actions { display: flex; gap: 10px; margin-top: 20px; }
.confirm-actions button { flex: 1; height: 44px; width: auto; }
.confirm-actions .btn-primary.danger { background: var(--red); }
.confirm-actions .btn-primary.danger:hover { background: #C33A2C; }
@keyframes cfFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes cfPop { from { transform: scale(.92); opacity: .5; } to { transform: none; opacity: 1; } }

/* 只读提示条（行业部门查看时） */
.readonly-tip { display: inline-block; padding: 7px 12px; border-radius: 8px; background: #EEF4FC;
  color: var(--blue); font-size: 13px; line-height: 1.5; }

/* 表单字段说明文字 */
.field-hint { margin-top: 6px; font-size: 12px; color: var(--gray); line-height: 1.5; }

/* 地图标题里的统计小字 */
.map-sub { font-size: 12px; font-weight: 400; color: var(--gray); margin-left: 6px; }

/* 锁定（不可修改）的下拉：灰底 + 深灰字，明确"已固定" */
select.field-select:disabled { background: #F2F4F8; color: #55607A; cursor: not-allowed; opacity: 1; }

/* 详情照片：单张容器 + 加载失败兜底（HEIC/损坏文件也能点开原图） */
.detail-photos .ph-item { position: relative; width: 88px; height: 88px; }
.detail-photos .ph-item img { width: 88px; height: 88px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); display: block; }
.detail-photos .ph-fallback { display: none; width: 88px; height: 88px; border-radius: 10px; border: 1px dashed #E7B9AC;
  background: #FFF6F4; color: #B4462F; font-size: 11px; line-height: 1.35; text-align: center; text-decoration: none;
  align-items: center; justify-content: center; box-sizing: border-box; padding: 6px; }
.detail-photos .ph-broken .ph-fallback { display: flex; }

/* 版本水印：点一下强制更新（应对手机/微信缓存旧页面） */
.build-tag { display: inline-block; margin-left: 10px; color: var(--gray); font-size: 12px;
  text-decoration: underline dotted; cursor: pointer; }
