/* 云图卫士通 · 移动端（P3-3）
   设计原则：
   1) 拇指可达——主操作固定在底部，顶部只放「返回/标题」，避免长距离触控；
   2) 触控目标 ≥ 44px（iOS HIG）/ 48px（Material），输入框 16px 字号防 iOS 自动放大；
   3) 不依赖任何 CDN 与外链字体，断网/内网环境可用（与主站一致）；
   4) 只做浅色主题——屏幕在户外强光下更易读，符合一线值守场景。 */
:root {
  --nav: #1B3A6B;
  --nav-2: #2C5390;
  --bg: #F4F6FA;
  --card: #FFFFFF;
  --line: #E3E8F0;
  --text: #1F2937;
  --muted: #6B7A90;
  --red: #C0392B;
  --amber: #C9A55C;
  --green: #1F8A5B;
  --blue: #4A7FD4;
  --r: 12px;
  --tabh: 54px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
input, textarea, select, button { font-family: inherit; }
input, textarea, select { font-size: 16px; } /* 防 iOS 聚焦自动放大 */
.hide { display: none !important; }

/* ============ 登录 ============ */
#splash {
  position: fixed; inset: 0; z-index: 300; background: #fff;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: 0 30px; text-align: center;
}
#splash.hide { display: none !important; }
#login { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 26px 22px; }
#login .lg-mark { width: 62px; height: 62px; border-radius: 15px; display: block; margin: 0 auto 16px; }
#login h1 { font-size: 20px; margin: 0 0 4px; text-align: center; color: var(--nav); letter-spacing: .5px; }
#login .lg-sub { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 26px; }
.lg-box { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px 16px; }
.lg-fld { margin-bottom: 14px; }
.lg-fld label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.lg-fld input {
  width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: #FBFCFE; outline: none; transition: border-color .15s;
}
.lg-fld input:focus { border-color: var(--nav-2); background: #fff; }
.lg-btn {
  width: 100%; padding: 14px; border: 0; border-radius: 10px; background: var(--nav); color: #fff;
  font-size: 16px; font-weight: 600; letter-spacing: 1px; margin-top: 6px;
}
.lg-btn:active { background: #16305a; }
.lg-btn:disabled { opacity: .55; }
.lg-err { color: var(--red); font-size: 13px; min-height: 20px; margin-top: 8px; text-align: center; }
.lg-tip { text-align: center; color: var(--muted); font-size: 12px; margin-top: 18px; line-height: 1.8; }

/* ============ 顶栏 ============ */
.hdr {
  position: sticky; top: 0; z-index: 30; background: var(--nav); color: #fff;
  padding: calc(env(safe-area-inset-top) + 10px) 14px 10px;
  display: flex; align-items: center; gap: 10px; min-height: 48px;
}
.hdr h2 { font-size: 16.5px; margin: 0; font-weight: 600; flex: 1; }
.hdr .hd-sub { font-size: 11.5px; opacity: .78; font-weight: 400; margin-top: 1px; }
.hdr .hd-back {
  background: rgba(255,255,255,.14); border: 0; color: #fff; width: 34px; height: 34px;
  border-radius: 9px; font-size: 17px; line-height: 1; display: flex; align-items: center; justify-content: center;
}
.hdr .hd-act {
  background: rgba(255,255,255,.14); border: 0; color: #fff; padding: 7px 11px;
  border-radius: 9px; font-size: 12.5px;
}

/* ============ 内容区 ============ */
.page { padding: 12px 12px calc(var(--tabh) + env(safe-area-inset-bottom) + 16px); }
.seg { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 9px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button {
  flex: 0 0 auto; border: 1px solid var(--line); background: #fff; color: var(--muted);
  padding: 7px 13px; border-radius: 999px; font-size: 13px;
}
.seg button.on { background: var(--nav); border-color: var(--nav); color: #fff; font-weight: 600; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 13px; margin-bottom: 10px; }
.card:active { background: #FAFBFE; }
.c-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 7px; }
.c-title { font-size: 15.5px; font-weight: 600; line-height: 1.5; margin-bottom: 5px; }
.c-sum { font-size: 13px; color: var(--muted); line-height: 1.65; margin-bottom: 7px; }
.c-meta { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.c-kw { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 5px; }
.c-act { margin-top: 10px; display: flex; gap: 8px; }

.chip {
  font-size: 11px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line);
  background: #F7F9FC; color: var(--muted); white-space: nowrap; line-height: 1.7;
}
.kw { font-size: 11px; padding: 2px 8px; border-radius: 6px; background: #EEF3FB; color: var(--nav-2); }

.bt { border: 0; border-radius: 9px; padding: 10px 14px; font-size: 13.5px; font-weight: 600; }
.bt-nav { background: var(--nav); color: #fff; }
.bt-line { background: #fff; color: var(--nav); border: 1px solid var(--nav); }
.bt-ghost { background: #F1F4F9; color: var(--muted); }
.bt-red { background: var(--red); color: #fff; }
.bt-block { width: 100%; display: block; padding: 14px; font-size: 15.5px; }
.bt:active { opacity: .82; }
.bt:disabled { opacity: .5; }

.empty { text-align: center; color: var(--muted); font-size: 13.5px; padding: 44px 20px; line-height: 1.9; }
.load { text-align: center; color: var(--muted); font-size: 13px; padding: 16px; }
.notice {
  font-size: 12.5px; line-height: 1.75; padding: 9px 11px; border-radius: 9px;
  background: #FFF8EA; border: 1px solid #F0E0BC; color: #8A6A2F; margin-bottom: 10px;
}
.notice.err { background: #FDF0EE; border-color: #F3CFC9; color: var(--red); }
.notice.ok { background: #F0FAF5; border-color: #C7E9D8; color: var(--green); }

/* ============ 详情 / 表单覆盖层 ============ */
.sheet {
  position: fixed; inset: 0; z-index: 60; background: var(--bg);
  display: flex; flex-direction: column; transform: translateY(100%);
  transition: transform .24s ease; visibility: hidden;
}
.sheet.on { transform: translateY(0); visibility: visible; }
.sheet-b { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 12px 12px 24px; }
.sheet-f {
  border-top: 1px solid var(--line); background: #fff; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  display: flex; gap: 9px;
}
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mbox { background: #F7F9FC; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.mbox .k { font-size: 11.5px; color: var(--muted); margin-bottom: 3px; }
.mbox .v { font-size: 17px; font-weight: 700; color: var(--nav); }
.sec-t { font-size: 13.5px; font-weight: 700; color: var(--nav); margin: 16px 0 8px; }
.pf-row { display: flex; align-items: center; gap: 9px; margin-bottom: 7px; font-size: 12.5px; }
.pf-name { width: 84px; flex: 0 0 auto; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-bar { flex: 1; height: 7px; background: #EDF1F7; border-radius: 4px; overflow: hidden; }
.pf-bar i { display: block; height: 100%; background: linear-gradient(90deg, #4A7FD4, #1B3A6B); }
.tl { border-left: 2px solid var(--line); padding-left: 13px; }
.tl-i { position: relative; padding-bottom: 15px; }
.tl-i::before {
  content: ''; position: absolute; left: -19px; top: 5px; width: 9px; height: 9px;
  border-radius: 50%; background: #fff; border: 2px solid var(--blue);
}
.tl-t { font-size: 13.5px; line-height: 1.5; }
.tl-m { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.tl-a { font-size: 12.5px; color: var(--nav-2); text-decoration: none; display: inline-block; margin-top: 4px; }

.fld { margin-bottom: 12px; }
.fld label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.fld label b { color: var(--red); }
.fld textarea, .fld input, .fld select {
  width: 100%; padding: 12px 13px; border: 1px solid var(--line); border-radius: 10px;
  background: #FBFCFE; outline: none; resize: vertical;
}
.fld textarea:focus, .fld input:focus { border-color: var(--nav-2); background: #fff; }
.fld .hint { font-size: 11.5px; color: var(--muted); margin-top: 5px; line-height: 1.65; }

.adv-out {
  font-size: 14px; line-height: 1.85; white-space: pre-wrap; word-break: break-word;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px;
}
.prog { text-align: center; padding: 34px 20px; }
.prog .dot { display: inline-block; width: 8px; height: 8px; margin: 0 3px; border-radius: 50%; background: var(--nav-2); animation: bl 1.2s infinite; }
.prog .dot:nth-child(2) { animation-delay: .2s; }
.prog .dot:nth-child(3) { animation-delay: .4s; }
@keyframes bl { 0%, 60%, 100% { opacity: .22; } 30% { opacity: 1; } }
.prog p { color: var(--muted); font-size: 13px; margin-top: 14px; }

/* 盖章件 */
.up-box {
  border: 2px dashed #C6D2E3; border-radius: 14px; padding: 34px 20px; text-align: center;
  background: #fff; color: var(--muted); font-size: 13.5px;
}
.up-box:active { border-color: var(--nav-2); background: #F7FAFF; }
.up-box .ic { font-size: 34px; display: block; margin-bottom: 10px; }
.up-prev { max-width: 100%; border-radius: 12px; display: block; margin-bottom: 12px; }
.pick-c { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px; margin-bottom: 8px; background: #fff; }
.pick-c.on { border-color: var(--nav); background: #F4F8FF; }
.pick-c .tx { flex: 1; font-size: 13.5px; line-height: 1.55; }
.pick-c .tx em { display: block; font-style: normal; font-size: 11.5px; color: var(--muted); margin-top: 3px; }

/* ============ 底部标签栏 ============ */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: #fff;
  border-top: 1px solid var(--line); display: flex;
  padding-bottom: env(safe-area-inset-bottom);
}
.tabs button {
  flex: 1; border: 0; background: none; color: var(--muted); height: var(--tabh);
  font-size: 11.5px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  position: relative;
}
.tabs button svg { width: 21px; height: 21px; }
.tabs button.on { color: var(--nav); font-weight: 600; }
.tabs .dot {
  position: absolute; top: 6px; left: 50%; margin-left: 4px; min-width: 16px; height: 16px;
  padding: 0 4px; border-radius: 8px; background: var(--red); color: #fff;
  font-size: 10px; line-height: 16px; font-weight: 600;
}

/* 顶部提示条 */
.toast {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 200;
  background: rgba(20, 32, 54, .93); color: #fff; padding: 12px 18px; border-radius: 11px;
  font-size: 13.5px; max-width: 78vw; text-align: center; line-height: 1.6;
}

/* ==================== AI 卫士通（assistant.js）移动端适配 ==================== */
/* assistant.js 的样式以内联 <style> 注入且晚于本文件，故用 !important 覆盖 */
/* 1) 移动端用底部「AI 助理」tab 作入口，不显示桌面悬浮球（避免压住标签栏） */
#yq_asst_btn { display: none !important; }
/* 2) 面板改为接近全屏的底部弹层 */
#yq_asst_panel {
  left: 0 !important; right: 0 !important; bottom: 0 !important;
  width: 100% !important; max-width: 100% !important;
  height: 86vh !important; max-height: 86vh !important;
  border-radius: 16px 16px 0 0 !important;
  padding-bottom: env(safe-area-inset-bottom) !important;
}
#yq_asst_body { -webkit-overflow-scrolling: touch; }
