/* 巡检云 · 设计系统（共享 / 移动端 / 落地页） */
:root {
  --primary: #4f46e5;
  --primary-600: #4f46e5;
  --primary-700: #4338ca;
  --primary-soft: #eef2ff;
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --success: #10b981;
  --success-soft: #ecfdf5;
  --warn: #f59e0b;
  --warn-soft: #fffbeb;
  --danger: #ef4444;
  --danger-soft: #fef2f2;
  --info: #0ea5e9;
  --info-soft: #f0f9ff;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 8px 24px rgba(15, 23, 42, .06);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, .14);
  --font: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'HarmonyOS Sans SC', 'Microsoft YaHei', 'Segoe UI', sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.6; }
a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; }
button { font-family: inherit; }
::selection { background: var(--primary-soft); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 10px 18px; font-size: 14px; font-weight: 500; cursor: pointer;
  transition: all .18s ease; user-select: none; white-space: nowrap; background: #fff; color: var(--text);
}
.btn:active { transform: scale(.97); }
.btn-primary { background: linear-gradient(135deg, #6366f1, #4f46e5); color: #fff; box-shadow: 0 4px 14px rgba(79, 70, 229, .35); }
.btn-primary:hover { box-shadow: 0 6px 20px rgba(79, 70, 229, .45); transform: translateY(-1px); }
.btn-primary:disabled { opacity: .55; box-shadow: none; transform: none; cursor: not-allowed; }
.btn-ghost { background: #fff; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: #c7d2fe; color: var(--primary); background: var(--primary-soft); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: #fee2e2; }
.btn-success { background: linear-gradient(135deg, #34d399, #10b981); color: #fff; box-shadow: 0 4px 14px rgba(16, 185, 129, .3); }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 14px 26px; font-size: 16px; border-radius: 12px; }
.btn-block { width: 100%; }

/* ---------- 卡片 / 表单 ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.field { margin-bottom: 16px; }
.field > label { display: block; font-size: 13px; font-weight: 500; color: #334155; margin-bottom: 6px; }
.field .hint { font-size: 12px; color: #94a3b8; margin-top: 4px; }
.input, select.input, textarea.input {
  width: 100%; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 12px; font-size: 14px; font-family: inherit; color: var(--text); background: #fff;
  transition: border-color .18s, box-shadow .18s; outline: none; appearance: none;
}
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, .12); }
textarea.input { resize: vertical; min-height: 80px; }
.input::placeholder { color: #a8b3c5; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .form-row { grid-template-columns: 1fr; } }

/* 开关 */
.switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.switch input { display: none; }
.switch .track { width: 42px; height: 24px; border-radius: 99px; background: #cbd5e1; position: relative; transition: background .2s; flex: none; }
.switch .track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::after { transform: translateX(18px); }

/* 分段选择 */
.seg { display: flex; background: #f1f5f9; border-radius: 10px; padding: 3px; gap: 3px; }
.seg button { flex: 1; border: none; background: transparent; padding: 8px 6px; border-radius: 8px; font-size: 13px; cursor: pointer; color: var(--muted); transition: all .18s; font-weight: 500; }
.seg button.on { background: #fff; color: var(--text); box-shadow: 0 1px 4px rgba(15,23,42,.12); }
.seg button.on.good { color: var(--success); }
.seg button.on.bad { color: var(--danger); }
.seg button.on.na { color: var(--muted); }

/* ---------- 徽章 / 标签 ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 500; line-height: 1.8; }
.badge-success { background: var(--success-soft); color: #059669; }
.badge-danger { background: var(--danger-soft); color: #dc2626; }
.badge-warn { background: var(--warn-soft); color: #d97706; }
.badge-info { background: var(--info-soft); color: #0284c7; }
.badge-muted { background: #f1f5f9; color: var(--muted); }
.badge-primary { background: var(--primary-soft); color: var(--primary); }

/* ---------- Toast / 弹窗 ---------- */
#toastWrap { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 8px; width: max-content; max-width: 92vw; }
.toast { padding: 11px 20px; border-radius: 12px; background: #0f172a; color: #fff; font-size: 14px; box-shadow: var(--shadow-lg); animation: toastIn .3s cubic-bezier(.2, .9, .3, 1.2); display: flex; align-items: center; gap: 8px; }
.toast.ok { background: linear-gradient(135deg, #059669, #10b981); }
.toast.err { background: linear-gradient(135deg, #dc2626, #ef4444); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-14px) scale(.94); } }
.toast.out { animation: toastOut .25s forwards; }
@keyframes toastOut { to { opacity: 0; transform: translateY(-10px); } }

.modal-mask { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); backdrop-filter: blur(2px); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 18px; animation: fadeIn .2s; }
.modal { background: #fff; border-radius: 18px; width: 100%; max-width: 520px; max-height: 88vh; overflow: auto; box-shadow: var(--shadow-lg); animation: popIn .25s cubic-bezier(.2, .9, .3, 1.15); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); font-weight: 600; }
.modal-close { border: none; background: #f1f5f9; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; font-size: 15px; color: var(--muted); transition: .18s; }
.modal-close:hover { background: #e2e8f0; color: var(--text); }
.modal-body { padding: 20px; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: scale(.92) translateY(10px); } }

/* ---------- 移动端公共 ---------- */
.m-wrap { max-width: 640px; margin: 0 auto; padding: 0 16px 110px; }
.m-hero { background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 60%, #9333ea 100%); color: #fff; padding: 26px 20px 56px; border-radius: 0 0 26px 26px; position: relative; overflow: hidden; }
.m-hero::after { content: ''; position: absolute; right: -60px; top: -60px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255, 255, 255, .1); }
.m-hero .m-top { display: flex; justify-content: space-between; align-items: center; font-size: 13px; opacity: .92; margin-bottom: 18px; }
.m-hero h1 { font-size: 22px; margin-bottom: 4px; }
.m-hero .sub { opacity: .85; font-size: 13px; }
.float-card { margin-top: -40px; position: relative; z-index: 2; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.info-grid .it .k { font-size: 12px; color: var(--muted); }
.info-grid .it .v { font-size: 14px; font-weight: 500; word-break: break-all; }
.section-title { font-size: 15px; font-weight: 600; margin: 22px 0 10px; display: flex; align-items: center; gap: 8px; }
.section-title::before { content: ''; width: 4px; height: 16px; border-radius: 4px; background: linear-gradient(180deg, #6366f1, #4f46e5); }

/* 时间线 */
.timeline { position: relative; padding-left: 18px; }
.timeline::before { content: ''; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: var(--border); border-radius: 2px; }
.tl-item { position: relative; padding-bottom: 16px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before { content: ''; position: absolute; left: -18px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid #c7d2fe; }
.tl-item.done::before { border-color: var(--success); }
.tl-item.alert::before { border-color: var(--danger); }
.tl-item .t { font-size: 13px; font-weight: 600; }
.tl-item .d { font-size: 12px; color: var(--muted); }

/* 检查项 */
.item-card { background: #fff; border: 1.5px solid var(--border); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; transition: border-color .2s, box-shadow .2s; animation: slideUp .35s both; }
.item-card.abnormal { border-color: #fca5a5; background: #fffafa; }
.item-card .q { font-weight: 500; font-size: 14px; margin-bottom: 10px; }
.item-extra { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.item-extra.show { max-height: 420px; }
.photo-grid { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.photo-box { width: 74px; height: 74px; border-radius: 10px; border: 1.5px dashed #cbd5e1; display: flex; align-items: center; justify-content: center; cursor: pointer; color: #94a3b8; font-size: 22px; overflow: hidden; position: relative; transition: .18s; background: #f8fafc; }
.photo-box:hover { border-color: var(--primary); color: var(--primary); }
.photo-box img { width: 100%; height: 100%; object-fit: cover; }
.photo-box .del { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; background: rgba(15,23,42,.6); color: #fff; font-size: 12px; display: flex; align-items: center; justify-content: center; }

/* 定位状态条 */
.geo-bar { display: flex; align-items: center; gap: 8px; background: #f8fafc; border: 1px dashed var(--border); border-radius: 10px; padding: 9px 12px; font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.geo-bar .dot { width: 8px; height: 8px; border-radius: 50%; background: #cbd5e1; flex: none; }
.geo-bar.ok .dot { background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.geo-bar.err .dot { background: var(--danger); }
.geo-bar .retry { margin-left: auto; border: none; background: none; color: var(--primary); cursor: pointer; font-size: 13px; }

/* 签名板 */
.sig-pad { border: 1.5px dashed #cbd5e1; border-radius: 12px; background: #fff; position: relative; touch-action: none; }
.sig-pad canvas { display: block; width: 100%; height: 160px; border-radius: 12px; }
.sig-pad .sig-tip { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: #b6c2d4; font-size: 13px; pointer-events: none; }
.sig-clear { position: absolute; right: 10px; top: 10px; font-size: 12px; color: var(--muted); border: none; background: #f1f5f9; padding: 4px 10px; border-radius: 8px; cursor: pointer; z-index: 2; }

/* 底部提交栏 */
.sticky-bar { position: fixed; bottom: 0; left: 0; right: 0; background: rgba(255, 255, 255, .92); backdrop-filter: blur(10px); border-top: 1px solid var(--border); padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); z-index: 100; }
.sticky-bar .inner { max-width: 640px; margin: 0 auto; display: flex; gap: 10px; align-items: center; }
.sticky-bar .tip { font-size: 12px; color: var(--muted); }

/* 成功页 */
.success-panel { text-align: center; padding: 46px 20px; animation: popIn .4s cubic-bezier(.2,.9,.3,1.2); }
.success-panel .ring { width: 84px; height: 84px; margin: 0 auto 18px; border-radius: 50%; background: var(--success-soft); display: flex; align-items: center; justify-content: center; font-size: 40px; color: var(--success); animation: popIn .5s .1s both; }
.success-panel h2 { margin-bottom: 6px; }
.success-panel .no { font-size: 13px; color: var(--muted); }

/* 防伪提示条 */
.secure-note { display: flex; gap: 8px; background: var(--info-soft); color: #0369a1; font-size: 12px; border-radius: 10px; padding: 9px 12px; margin-bottom: 16px; line-height: 1.5; }

/* ---------- 登录页 ---------- */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: radial-gradient(1200px 600px at 20% -10%, rgba(99,102,241,.25), transparent), radial-gradient(900px 500px at 110% 30%, rgba(147,51,234,.18), transparent), #0f172a; padding: 20px; }
.login-card { width: 100%; max-width: 400px; background: #fff; border-radius: 20px; padding: 34px 30px; box-shadow: var(--shadow-lg); animation: popIn .35s; }
.login-card .logo { width: 52px; height: 52px; border-radius: 14px; background: linear-gradient(135deg, #6366f1, #8b5cf6); display: flex; align-items: center; justify-content: center; font-size: 26px; margin-bottom: 16px; }
.login-card h1 { font-size: 20px; margin-bottom: 4px; }
.login-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 24px; }

/* ---------- 落地页 ---------- */
.land-nav { display: flex; align-items: center; justify-content: space-between; padding: 18px 5vw; position: sticky; top: 0; background: rgba(15, 23, 42, .8); backdrop-filter: blur(12px); z-index: 100; }
.land-nav .brand { color: #fff; font-weight: 700; font-size: 17px; display: flex; gap: 9px; align-items: center; }
.land-nav .brand .lg { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, #6366f1, #a855f7); display: flex; align-items: center; justify-content: center; font-size: 17px; }
.land-nav .links { display: flex; gap: 22px; align-items: center; }
.land-nav .links a { color: #cbd5e1; font-size: 14px; transition: color .18s; }
.land-nav .links a:hover { color: #fff; }
.land-hero { text-align: center; padding: 84px 20px 70px; position: relative; overflow: hidden; background: radial-gradient(1000px 500px at 50% -100px, rgba(99,102,241,.35), transparent), #0f172a; }
.land-hero h1 { color: #fff; font-size: clamp(28px, 5vw, 46px); line-height: 1.25; margin-bottom: 18px; letter-spacing: 1px; }
.land-hero h1 .grad { background: linear-gradient(90deg, #a5b4fc, #e879f9); -webkit-background-clip: text; background-clip: text; color: transparent; }
.land-hero p { color: #94a3b8; max-width: 640px; margin: 0 auto 34px; font-size: 16px; }
.land-sec { max-width: 1080px; margin: 0 auto; padding: 66px 20px; }
.land-sec .sec-h { text-align: center; margin-bottom: 42px; }
.land-sec .sec-h .tag { display: inline-block; font-size: 12px; color: var(--primary); background: var(--primary-soft); padding: 3px 14px; border-radius: 99px; font-weight: 600; margin-bottom: 12px; }
.land-sec .sec-h h2 { font-size: clamp(22px, 3.4vw, 30px); }
.land-sec .sec-h p { color: var(--muted); margin-top: 10px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; }
.step-card { background: #fff; border-radius: 18px; padding: 26px 22px; box-shadow: var(--shadow); transition: transform .25s, box-shadow .25s; position: relative; overflow: hidden; }
.step-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.step-card .num { font-size: 13px; font-weight: 700; color: var(--primary); background: var(--primary-soft); width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.step-card h3 { font-size: 16px; margin-bottom: 8px; }
.step-card p { font-size: 13.5px; color: var(--muted); }
.feat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.feat { background: #fff; border-radius: 18px; padding: 24px; box-shadow: var(--shadow); border: 1px solid transparent; transition: .25s; }
.feat:hover { border-color: #c7d2fe; transform: translateY(-4px); }
.feat .ic { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 21px; margin-bottom: 14px; }
.feat h3 { font-size: 15px; margin-bottom: 6px; }
.feat p { font-size: 13px; color: var(--muted); }
.land-footer { background: #0f172a; color: #64748b; text-align: center; padding: 30px 20px; font-size: 13px; }

/* 动画 */
@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } }
.fade-up { animation: slideUp .4s both; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* 空状态 */
.empty { text-align: center; color: #9aa7ba; padding: 42px 10px; font-size: 14px; }
.empty .e-ic { font-size: 34px; margin-bottom: 8px; opacity: .8; }

/* 图片查看 */
.lightbox { position: fixed; inset: 0; background: rgba(0, 0, 0, .86); z-index: 2000; display: flex; align-items: center; justify-content: center; cursor: zoom-out; animation: fadeIn .2s; }
.lightbox img { max-width: 94vw; max-height: 92vh; border-radius: 10px; }
