/* =====================================================================
 * app.css —— 安全阀在线校验 App
 * 设计基准：390pt 宽移动端（与截图比例一致）
 * ===================================================================== */

:root{
  --blue:#2a63d4;
  --blue-d:#1f52b5;
  --blue-l:#eef4fe;
  --ink:#1c1f24;
  --ink-2:#42506b;
  --sub:#6b7280;
  --line:#e3e7ee;
  --bg:#f1f3f7;
  --dark:#33383f;
  --ok:#1f9d55;
  --err:#d94a3d;
  --radius:16px;
}

*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;padding:0}
body{
  background:#dfe4ec;
  color:var(--ink);
  font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei","Segoe UI",sans-serif;
  font-size:15px;
  -webkit-font-smoothing:antialiased;
}
button,input,select{font-family:inherit;font-size:inherit;color:inherit}
button{cursor:pointer}

/* ---------- 手机容器 ---------- */
.phone{
  position:relative;
  display:flex;
  flex-direction:column;
  width:100%;
  max-width:430px;
  height:100vh;
  height:100dvh;
  margin:0 auto;
  background:var(--bg);
  overflow:hidden;
}
@media (min-width:520px){
  body{display:flex;align-items:center;justify-content:center;min-height:100vh;background:#cfd7e4}
  .phone{height:min(880px,96vh);border-radius:26px;box-shadow:0 18px 60px rgba(20,40,80,.28);border:1px solid #c3ccdb}
  /* 宽屏预览时弹层收进手机框，避免贴在视口底部与手机框脱节 */
  .modal{inset:0;margin:auto;width:min(430px,100%);height:min(880px,96vh);border-radius:26px;overflow:hidden}
}

/* ---------- 页面 ---------- */
.page{
  position:relative;
  display:none;
  flex:1;
  min-height:0;
  overflow-y:auto;
  overflow-x:hidden;
  -webkit-overflow-scrolling:touch;
  padding-bottom:16px;
}
.page.active{display:block}

/* 顶部蓝色渐变底 */
.hdr-bg{
  position:absolute;
  top:0;left:0;right:0;
  height:320px;
  background:linear-gradient(180deg,#3273dd 0%,#2a63d4 45%,#2055bd 100%);
  z-index:0;
  pointer-events:none;
}

/* ---------- 顶栏 ---------- */
.appbar{
  position:relative;
  z-index:1;
  padding:calc(env(safe-area-inset-top,0px) + 14px) 16px 0;
  color:#fff;
}
.appbar-title{
  text-align:center;
  font-size:17px;
  font-weight:600;
  letter-spacing:.5px;
  margin:6px 0 20px;
}
.status-title{
  font-size:13.5px;
  color:rgba(255,255,255,.92);
  margin:0 2px 9px;
}
.status-row{
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom:44px;
}
.segmented{
  flex:1;
  display:flex;
  background:rgba(255,255,255,.28);
  border-radius:24px;
  padding:3px;
  min-width:0;
}
.seg{
  flex:1;
  height:38px;
  border:0;
  border-radius:20px;
  background:transparent;
  color:#0f2450;
  font-size:15px;
  font-weight:500;
  transition:background .18s,color .18s;
  white-space:nowrap;
}
.seg.is-active{background:var(--blue);color:#fff;font-weight:600;box-shadow:0 2px 6px rgba(15,40,90,.22)}
.bt-btn{
  flex:0 0 auto;
  width:34px;height:34px;
  display:flex;align-items:center;justify-content:center;
  border:0;background:transparent;color:#fff;
  padding:0;
}
.bt-dot{
  flex:0 0 auto;
  width:18px;height:18px;
  border-radius:50%;
  background:rgba(255,255,255,.55);
  position:relative;
  transition:background .2s;
}
.bt-dot::after{
  content:"";
  position:absolute;inset:0;
  background-repeat:no-repeat;
  background-position:center;
  background-size:11px 11px;
}
.bt-dot.ok{background:#2f7bf6}
.bt-dot.ok::after{background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'><path d='M4 12.5l5.2 5.2L20 6.8'/></svg>")}
.bt-dot.err{background:#f3cfcb}
.bt-dot.err::after{background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d94a3d' stroke-width='3.4' stroke-linecap='round'><path d='M6 6l12 12M18 6L6 18'/></svg>")}

/* ---------- 主体 ---------- */
.main{
  position:relative;
  z-index:1;
  padding:0 13px 22px;
  margin-top:0;
}

/* ---------- 卡片 ---------- */
.card{
  background:#fff;
  border-radius:var(--radius);
  padding:16px 16px 18px;
  margin-bottom:12px;
  box-shadow:0 3px 14px rgba(28,52,102,.07);
}
.card-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:11px;
}
.card-head h2{
  margin:0;
  font-size:16.5px;
  font-weight:600;
  letter-spacing:.3px;
}

/* ---------- 表单 ---------- */
.fld{
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom:12px;
}
.fld > label{
  flex:0 0 auto;
  width:86px;
  font-size:15px;
  color:var(--ink);
  letter-spacing:.2px;
}
.fld .ipt{position:relative;flex:1;min-width:0}
.fld input{
  width:100%;
  height:42px;
  border:1px solid #dfe4ec;
  border-radius:8px;
  background:#fff;
  padding:0 46px 0 12px;
  font-size:15px;
  color:var(--ink);
  outline:none;
  transition:border-color .15s,box-shadow .15s;
  -moz-appearance:textfield;
}
.fld input::-webkit-outer-spin-button,
.fld input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
.fld input::placeholder{color:#b9c0cc}
.fld input:focus{border-color:var(--blue);box-shadow:0 0 0 3px rgba(42,99,212,.10)}
.fld input[readonly]{background:#f6f8fb;color:#54637d}
.fld .unit{
  position:absolute;
  right:12px;top:50%;
  transform:translateY(-50%);
  font-size:14px;
  color:var(--sub);
  pointer-events:none;
}
.btn-search{
  flex:0 0 auto;
  height:42px;
  padding:0 14px;
  display:flex;align-items:center;gap:5px;
  border:0;border-radius:8px;
  background:var(--blue);
  color:#fff;
  font-size:15px;
  font-weight:500;
}
.btn-search:active{background:var(--blue-d)}

/* ---------- 主按钮 ---------- */
.btn-row{display:flex;gap:15px;margin-top:15px}
.btn{
  flex:1;
  height:46px;
  border:0;
  border-radius:8px;
  font-size:16.5px;
  font-weight:600;
  letter-spacing:1px;
  transition:transform .1s,filter .15s;
}
.btn:active{transform:scale(.985);filter:brightness(.94)}
.btn-dark{background:var(--dark);color:#fff}
.btn-primary{background:var(--blue);color:#fff}

/* ---------- 结果 ---------- */
.btn-mini{
  height:32px;
  padding:0 13px;
  border:0;
  border-radius:8px;
  background:var(--blue);
  color:#fff;
  font-size:13.5px;
  font-weight:500;
}
.btn-mini:active{background:var(--blue-d)}
.result{
  background:var(--blue-l);
  border-radius:10px;
  padding:12px 14px;
  min-height:88px;
}
.result .empty{
  color:#a7b3c6;
  font-size:13.5px;
  text-align:center;
  padding:26px 0;
}
.rrow{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:12px;
  padding:3.5px 0;
  font-size:14px;
  color:var(--ink-2);
}
.rrow .k{flex:0 0 auto}
.rrow .v{
  font-family:ui-monospace,"Consolas","SF Mono",Menlo,monospace;
  font-weight:600;
  color:#1c2b45;
  white-space:nowrap;
}
.rrow .v i{font-style:normal;font-size:12px;color:#6b7a95;margin-left:3px;font-weight:400}
.rrow.strong{
  margin-top:7px;
  padding-top:8px;
  border-top:1px dashed #c6d5ee;
  font-size:15px;
  color:#26456f;
}
.rrow.strong .v{color:#1a56c4;font-size:20px}
.rrow.err-line{color:var(--err);justify-content:center;font-size:13.5px;padding:24px 0}

/* ---------- 曲线 ---------- */
.chart-tools{
  display:flex;
  align-items:center;
  gap:8px;
  margin-bottom:12px;
}
.sel{
  height:38px;
  border:1px solid #e5e9f0;
  border-radius:8px;
  background:#fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round'><path d='M7 10l5 5 5-5'/></svg>") no-repeat right 8px center;
  background-size:15px;
  padding:0 28px 0 12px;
  font-size:14px;
  color:#39414f;
  -webkit-appearance:none;
  appearance:none;
  outline:none;
  min-width:0;
}
.sel-wide{flex:1 1 0}
.sel:focus{border-color:var(--blue)}
.btn-report{
  flex:0 0 auto;
  height:38px;
  padding:0 14px;
  border:0;
  border-radius:8px;
  background:var(--blue);
  color:#fff;
  font-size:14.5px;
  font-weight:500;
}
.btn-report:active{background:var(--blue-d)}
.chart-wrap{
  background:#f8fafc;
  border-radius:10px;
  height:162px;
  padding:8px 6px 4px;
  position:relative;
}
.chart-wrap canvas{width:100%;height:100%;display:block}

/* ---------- 我的 ---------- */
.profile{display:flex;align-items:center;gap:14px;padding:18px 16px;cursor:pointer;-webkit-tap-highlight-color:transparent}
.profile:active{background:#f7f9fd}
.avatar{
  width:56px;height:56px;
  flex:0 0 auto;
  border-radius:50%;
  background:linear-gradient(160deg,#e8f0ff,#cfe0fb);
  color:var(--blue);
  display:flex;align-items:center;justify-content:center;
}
.p-name{font-size:16.5px;font-weight:600;margin-bottom:4px}
.p-sub{font-size:12.5px;color:var(--sub)}
.list-card{padding:0;overflow:hidden}
.list-item{
  display:flex;
  align-items:center;
  gap:12px;
  width:100%;
  padding:15px 16px;
  border:0;
  border-bottom:1px solid #f0f2f6;
  background:#fff;
  text-align:left;
  font-size:15px;
}
.list-item:last-child{border-bottom:0}
.list-item:active{background:#f7f9fc}
.li-ico{flex:0 0 auto;color:var(--blue);display:flex}
.list-item.danger .li-ico{color:var(--err)}
.list-item.danger .li-text{color:var(--err)}
.li-text{flex:1}
.li-val{font-size:12.5px;color:var(--sub);margin-right:2px}
.li-arrow{color:#c2c9d4;font-size:19px;line-height:1}
.ver{
  text-align:center;
  font-size:12px;
  color:#a8b0bd;
  padding:10px 0 4px;
}

/* ---------- 底部导航 ---------- */
.tabbar{
  flex:0 0 auto;
  display:flex;
  background:#fff;
  border-top:1px solid #ebedf1;
  padding-bottom:env(safe-area-inset-bottom,0);
  z-index:20;
}
.tab{
  flex:1;
  height:56px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:3px;
  border:0;
  background:transparent;
  color:#9aa3af;
  font-size:11px;
  letter-spacing:.3px;
  transition:color .15s;
}
.tab svg{width:22px;height:22px}
.tab.active{color:var(--blue)}
.tab:active{background:#f7f9fc}

/* ---------- 弹层 ---------- */
.modal{
  position:fixed;
  inset:0;
  z-index:100;
  display:none;
}
/* 调试：?noanim 关闭动画，便于截图核对 */
.no-anim *{animation:none!important;transition:none!important}
.modal.open{display:block}
.modal-mask{
  position:absolute;inset:0;
  background:rgba(16,26,44,.45);
  animation:fade .18s ease;
}
@keyframes fade{from{opacity:0}to{opacity:1}}
.modal-panel{
  position:absolute;
  left:50%;bottom:0;
  transform:translateX(-50%);
  width:100%;
  max-width:430px;
  max-height:86vh;
  background:#fff;
  border-radius:20px 20px 0 0;
  padding:18px 16px calc(18px + env(safe-area-inset-bottom,0px));
  overflow-y:auto;
  animation:slide .24s cubic-bezier(.22,.9,.3,1);
}
@keyframes slide{from{transform:translate(-50%,100%)}to{transform:translate(-50%,0)}}
.modal-title{
  display:flex;align-items:center;justify-content:space-between;
  font-size:16.5px;font-weight:600;margin-bottom:14px;
}
.modal-title .close{
  border:0;background:transparent;font-size:22px;color:#9aa3af;line-height:1;padding:0 2px;
}
.modal-panel.center{border-radius:20px;bottom:50%;transform:translate(-50%,50%);max-width:340px}
.modal-panel.center{animation:pop .2s ease}
@keyframes pop{from{opacity:0;transform:translate(-50%,50%) scale(.96)}to{opacity:1;transform:translate(-50%,50%) scale(1)}}

/* 半径库 */
.modal-panel.db-modal{min-height:min(620px,74vh)}
.db-head{display:flex;align-items:flex-start;gap:8px}
.db-head .db-tabs{flex:1;min-width:0}
.db-tool{
  flex:0 0 auto;height:36px;padding:0 12px;
  border:1px solid #dfe7f3;border-radius:9px;background:#fff;
  color:#3f6bc4;font-size:12.5px;font-weight:500;white-space:nowrap;
  transition:background .15s ease,border-color .15s ease;
}
.db-tool:active{background:#eef4fe}
.db-tool:hover{border-color:#b9cef0;background:#f6f9ff}
.db-tabs{
  display:flex;gap:6px;overflow-x:auto;padding:1px 0 10px;
  -webkit-overflow-scrolling:touch;scrollbar-width:none;
}
.db-tabs::-webkit-scrollbar{display:none}
.db-tab{
  flex:0 0 auto;height:30px;padding:0 12px;
  border:0;border-radius:8px;background:#f1f4f9;color:#5b6b83;
  font-size:12.5px;font-weight:500;white-space:nowrap;
  transition:background .15s ease,color .15s ease;
}
.db-tab.on{background:var(--blue);color:#fff;font-weight:600}
.db-search{display:flex;align-items:center;gap:7px;margin-bottom:9px}
.db-search input{
  flex:1;min-width:0;
  height:36px;padding:0 12px;
  border:1px solid #e3e9f3;border-radius:9px;background:#f8fafd;
  font-size:13.5px;outline:none;
  transition:border-color .16s ease,background .16s ease;
}
.db-search input:focus{border-color:#9db8ea;background:#fff}
.db-search input::placeholder{color:#a9b4c4}
.db-note{
  font-size:11.5px;color:#8592a6;line-height:1.7;
  margin:0 0 6px;padding:8px 10px;background:#f7f9fd;border-radius:8px;
}
.db-list{display:flex;flex-direction:column}
.db-row{
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  padding:11px 4px;border-bottom:1px solid #f0f2f6;background:#fff;border:0;
  font-size:15px;text-align:left;width:100%;
}
.db-row:last-child{border-bottom:0}
.db-k{display:flex;flex-direction:column;gap:2px;min-width:0}
.db-1{font-size:14.5px;font-weight:600;color:var(--ink);line-height:1.3}
.db-2{
  font-size:11.5px;color:#8b98ab;line-height:1.3;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.db-row .db-r{
  font-family:ui-monospace,Consolas,monospace;color:var(--blue);font-weight:600;
  font-size:13.5px;white-space:nowrap;flex:0 0 auto;
}
.db-row:active{background:#f7f9fc}
/* 用户上传并审核通过的数据 */
.db-tag{
  display:inline-block;margin-left:6px;padding:0 5px;
  font-size:10px;font-style:normal;font-weight:500;line-height:15px;
  color:#b26a00;background:#fff3e0;border-radius:4px;vertical-align:1px;
}
.db-row.db-own{border-left:2px solid #f0b429;padding-left:8px;margin-left:-2px}

/* 上传表单 */
.up-form{display:flex;flex-direction:column;gap:11px;padding:2px 0 6px}
.up-fld{display:flex;flex-direction:column;gap:6px;font-size:12.5px;color:#6b7a90}
.up-fld input,.up-fld select{
  height:40px;border:1px solid #e3e9f3;border-radius:9px;background:#f8fafd;
  padding:0 12px;font-size:14px;color:var(--ink);outline:none;
  font-family:inherit;
  transition:border-color .16s ease,background .16s ease;
}
.up-fld input:focus,.up-fld select:focus{border-color:#9db8ea;background:#fff}
.up-fld input::placeholder{color:#a9b4c4}
.up-row{display:flex;gap:10px}
.up-row .up-fld{flex:1;min-width:0}
.up-tip{
  font-size:11.5px;line-height:1.75;color:#8592a6;
  background:#f7f9fd;border-radius:8px;padding:9px 11px;
}

/* 我的上传 */
.my-row{padding:11px 2px;border-bottom:1px solid #f0f2f6}
.my-row:last-child{border-bottom:0}
.my-1{display:flex;align-items:center;gap:8px;font-size:14.5px;color:var(--ink)}
.my-1 b{font-weight:600}
.my-2{font-size:11.5px;color:#8b98ab;margin-top:3px;line-height:1.5}
.my-3{font-size:11.5px;color:#d93a3a;margin-top:4px;line-height:1.5}
.my-4{font-size:11px;color:#a7b2c4;margin-top:4px}
.db-st{
  font-size:10.5px;font-style:normal;padding:1px 6px;border-radius:4px;
  background:#f1f4f9;color:#5b6b83;white-space:nowrap;
}
.db-st.ok{background:#e8f7ef;color:#1a9e63}
.db-st.bad{background:#fdecec;color:#d93a3a}
.db-st.wait{background:#fff4e5;color:#d97706}

/* 记录列表 */
.rec-scope{display:flex;gap:8px;margin:12px 0 2px}
.rec-scope button{
  flex:1;height:34px;border:0;border-radius:9px;
  background:#f1f4f9;color:#5b6b83;
  font-size:13px;font-weight:500;
}
.rec-scope button.on{background:var(--blue);color:#fff}
.rec-item{
  display:flex;align-items:center;gap:12px;
  padding:12px 0;border-bottom:1px solid #f0f2f6;
}
.rec-tag{
  flex:0 0 auto;width:52px;height:52px;border-radius:10px;
  background:var(--blue-l);color:var(--blue);
  display:flex;align-items:center;justify-content:center;
  font-size:12.5px;font-weight:600;
}
.rec-main{flex:1;min-width:0}
.rec-line1{font-size:14px;color:var(--ink);margin-bottom:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rec-line1 b{color:var(--blue);font-family:ui-monospace,Consolas,monospace}
.rec-line2{font-size:12px;color:var(--sub)}
.rec-line3{font-size:11.5px;color:#9aa6b8;margin-top:2px;line-height:1.5;word-break:break-word}
.rec-del{
  flex:0 0 auto;border:0;background:transparent;color:#c2c9d4;font-size:19px;padding:6px;
}
.rec-del:active{color:var(--err)}

/* 报告 */
.report h3{font-size:17px;margin:0 0 4px;text-align:center}
.report .rep-sub{text-align:center;font-size:12px;color:var(--sub);margin-bottom:14px}
.report table{width:100%;border-collapse:collapse;font-size:13.5px;margin-bottom:12px}
.report th,.report td{padding:8px 10px;border:1px solid #e6eaf1;text-align:left}
.report th{background:#f6f8fc;color:var(--ink-2);font-weight:500;width:46%}
.report td{font-family:ui-monospace,Consolas,monospace;text-align:right}
.report .rep-chart{background:#f8fafc;border-radius:8px;padding:6px;margin-bottom:12px}
.report .rep-foot{font-size:11.5px;color:var(--sub);line-height:1.7;border-top:1px dashed #e0e5ee;padding-top:10px}
.rep-actions{display:flex;gap:12px;margin-top:4px}
.rep-actions .btn{height:44px;font-size:15px}

/* 设置项 */
.set-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 0;border-bottom:1px solid #f0f2f6}
.set-row:last-of-type{border-bottom:0}
.set-row label{font-size:14.5px;color:var(--ink)}
.set-row input,.set-row select{
  width:150px;height:38px;border:1px solid #e5e9f0;border-radius:8px;
  padding:0 10px;font-size:14px;text-align:right;background:#fff;outline:none;
}
.set-row select{text-align:left}
.set-row input:focus,.set-row select:focus{border-color:var(--blue)}
/* 弹窗里的只读值（如当前手机号） */
.ro-val{
  min-width:150px;height:38px;line-height:38px;padding:0 10px;text-align:right;
  font-size:14px;color:var(--ink-2);background:#f5f7fb;border:1px solid #eef1f6;
  border-radius:8px;font-variant-numeric:tabular-nums;
}
.set-row input[type="tel"]{text-align:left;letter-spacing:.6px;font-variant-numeric:tabular-nums}
.help-body{font-size:13.5px;line-height:1.85;color:var(--ink-2)}
.help-body b{color:var(--ink)}
.help-body code{
  display:block;background:#f6f8fc;border-radius:8px;padding:9px 11px;margin:7px 0;
  font-family:ui-monospace,Consolas,monospace;font-size:12.5px;color:#1a56c4;white-space:pre-wrap;
}

/* 打印报告 */
@media print{
  body{background:#fff}
  .phone,.tabbar{display:none!important}
  .modal{display:block!important;position:static}
  .modal-mask{display:none}
  .modal-panel{position:static;transform:none;box-shadow:none;max-height:none;width:100%;max-width:100%;padding:0;border-radius:0;animation:none}
  .modal-title,.rep-actions{display:none!important}
}

/* =====================================================================
 * 自适应与视觉增强
 *   手机  : 单列全屏（原始形态）
 *   平板  : ≥760px  双列：左输入 / 右结果与曲线
 *   桌面  : ≥1200px 加宽到 1000px，卡片间距放大
 * ===================================================================== */

/* ---- 通用质感 ---- */
.card{
  border-radius:18px;
  box-shadow:0 1px 2px rgba(28,52,102,.04),0 6px 20px rgba(28,52,102,.05);
  transition:box-shadow .22s ease,transform .22s ease;
}
.page.active{animation:pageIn .22s ease both}
@keyframes pageIn{from{opacity:0;transform:translateY(5px)}to{opacity:1;transform:none}}

.hdr-bg::after{
  content:'';position:absolute;inset:0;pointer-events:none;
  background:radial-gradient(620px 260px at 16% -28%,rgba(255,255,255,.26),transparent 68%);
}
.btn{transition:filter .15s ease,box-shadow .18s ease,transform .08s ease}
.btn:active{transform:translateY(1px)}
.btn-primary{box-shadow:0 4px 12px rgba(42,99,212,.18)}
.fld input,.set-row input,.set-row select,.sel{transition:border-color .16s ease,box-shadow .16s ease}
.tab{transition:color .16s ease,background .16s ease}
.tab svg{transition:transform .16s ease}
.tab.active svg{transform:translateY(-1px)}
.tab.active::after{
  content:'';display:block;width:16px;height:2.5px;border-radius:2px;
  background:var(--blue);margin-top:1px;
}
/* ---- 滚动条：原生滚动条彻底不占位，改用 JS 自绘的悬浮细条 ----
   原生滚动条即使 thumb 全透明，仍会占 6px 宽度，那 6px 露出的是 .phone
   底色，蓝色头部右侧就会空出一条白带。这里直接 width:0 消除占位，
   让渐变/卡片铺满到右边缘；滚动时由 .osb 浮层显示位置。 */
.page,.modal-panel{
  scrollbar-width:none;      /* Firefox */
  -ms-overflow-style:none;   /* 老 Edge/IE */
}
.page::-webkit-scrollbar,
.modal-panel::-webkit-scrollbar{width:0;height:0;display:none}

/* 自绘悬浮滚动条（js 里创建、定位） */
.osb{
  position:fixed;
  top:0;right:0;
  width:5px;
  border-radius:999px;
  background:rgba(30,52,92,.30);
  box-shadow:0 0 0 .5px rgba(255,255,255,.28);
  opacity:0;
  transform:scaleX(.6);
  transition:opacity .26s ease,transform .26s ease,background .18s ease;
  pointer-events:none;
  z-index:320;
  will-change:opacity,top,height;
}
.osb.on{opacity:1;transform:scaleX(1)}
.osb.drag{background:rgba(30,52,92,.5);width:6px}

/* 桌面指针设备才加悬停反馈 */
@media (hover:hover) and (pointer:fine){
  .card:hover{box-shadow:0 2px 4px rgba(28,52,102,.05),0 12px 32px rgba(28,52,102,.09);transform:translateY(-1px)}
  .btn-primary:hover{filter:brightness(1.06);box-shadow:0 6px 18px rgba(42,99,212,.30)}
  .btn-dark:hover{filter:brightness(1.14)}
  .btn-mini:hover{filter:brightness(1.06)}
  .tab:hover{color:#5b87d8;background:#f7f9fd}
}

/* ---- 平板及以上：手机框变宽 + 两列 ---- */
@media (min-width:520px){
  body{
    background:
      radial-gradient(1100px 620px at 12% -10%,#eef3fc 0%,rgba(238,243,252,0) 62%),
      radial-gradient(900px 520px at 100% 110%,#dde5f4 0%,rgba(221,229,244,0) 58%),
      #cfd7e4;
  }
}

@media (min-width:760px){
  .phone{max-width:900px;height:min(920px,94vh);border-radius:24px}
  .page{padding-bottom:12px}
  .page .main{
    display:grid;
    grid-template-columns:minmax(0,.95fr) minmax(0,1.05fr);
    gap:16px;
    align-items:start;
    padding:0 16px 20px;
  }
  .page .main > .card{margin-bottom:0}
  .page .main > .card:first-child{grid-column:1;grid-row:1}
  .page .main > .card:not(:first-child){grid-column:2}

  /* 「我的」页保持单列，整块居中 */
  .page[data-page="mine"] .main{
    grid-template-columns:minmax(0,1fr);
    max-width:560px;margin:0 auto;width:100%;
  }
  .page[data-page="mine"] .main > .card:first-child,
  .page[data-page="mine"] .main > .card:not(:first-child){grid-column:1;grid-row:auto}

  .appbar{padding-left:22px;padding-right:22px}
  .appbar-title{font-size:18px;margin-bottom:24px}
  .status-row{margin-bottom:40px}
  .status-row{gap:14px}
  .segmented{max-width:320px}

  /* 底部导航变浮动圆角条 */
  .tabbar{
    width:min(540px,100%);align-self:center;margin:0 auto 14px;
    border-top:0;border-radius:18px;
    box-shadow:0 10px 28px rgba(20,40,80,.14),0 1px 0 rgba(255,255,255,.9) inset;
    overflow:hidden;
  }
  .tab{height:58px;font-size:11.5px}
}

@media (min-width:1200px){
  .phone{max-width:1000px;height:min(940px,92vh)}
  .page .main{gap:20px;padding:0 22px 24px}
  .card{padding:20px 20px 22px}
  .appbar-title{font-size:19px}
}

/* ---- 宽屏二级微调：曲线卡占满整行、蓝底压住卡片上沿 ---- */
@media (min-width:760px){
  .page .main > .card:nth-child(3){grid-column:1 / -1}
  .chart-wrap{height:206px}
  .fld > label{width:96px}
  .page[data-page="mine"] .main{max-width:700px}
}

/* ---- 宽屏弹层跟随加宽的手机框，居中收窄更耐看 ---- */
/* 遮罩固定铺满视口：弹层本身被收窄后，遮罩不能只盖中间一条 */
.modal-mask{position:fixed;inset:0}
@media (min-width:760px){
  .modal{width:min(620px,100%);height:min(920px,94vh);border-radius:24px;overflow:hidden}
  .modal-panel{max-width:100%}
}
@media (min-width:1200px){
  .modal{height:min(940px,92vh)}
}

/* =====================================================================
 * PWA 安装说明与独立运行适配
 * ===================================================================== */

/* 安装弹层里的提示块 */
.ins-warn{
  background:#fff7e8;border:1px solid #ffdfae;color:#8a5a00;
  border-radius:12px;padding:10px 12px;font-size:13px;line-height:1.7;
  margin-bottom:14px;
}
.ins-ok{
  background:#eefaf1;border:1px solid #bfe8cb;color:#1f7a3e;
  border-radius:12px;padding:10px 12px;font-size:13px;line-height:1.7;
  margin-bottom:14px;
}
.ins-note{
  margin-top:16px;padding-top:13px;border-top:1px dashed #e2e8f2;
  color:#5a6b85;font-size:13px;line-height:1.75;
}
.ins-tip{
  margin-top:10px;color:#96a2b5;font-size:12px;line-height:1.7;
}

/* 从桌面图标启动（standalone）时贴合状态栏与手势条 */
@media (display-mode: standalone){
  body{
    padding-top:env(safe-area-inset-top);
    padding-bottom:env(safe-area-inset-bottom);
    background:var(--bg);
  }
  .phone{height:100%;max-width:none;border-radius:0}
  /* 独立运行时底部导航不再需要额外的浮动留白 */
  .tabbar{border-radius:0}
}
body.standalone .phone{height:100%}

/* 安装入口右侧的状态文字略窄，避免挤压 */
.list-item .li-val{max-width:112px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
