/* ==========================================================================
   *毕节卓高*订单系统* · 网页版（H5）
   视觉对齐微信小程序：主色 #07c160 / 底色 #f5f6f8 / 白底圆角卡片 / 底部弹层
   说明：尺寸用 px（小程序里的 rpx ÷ 2 即为 px），在 375px 宽的手机上与原版等宽。
   ========================================================================== */

:root {
  --green: #07c160;
  --green-d: #06ad56;
  --green-l: #eaf9f0;
  --red: #fa5151;
  --bg: #f5f6f8;
  --card: #ffffff;
  --line: #f0f1f3;
  --line2: #e6e8eb;
  --t1: #222222;
  --t2: #333333;
  --t3: #666666;
  --t4: #999999;
  --t5: #bbbbbb;
  --radius: 10px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  height: 100%;
  /* 禁止缩放（浏览器层）。两层是有意的降级写法：
     · manipulation —— 禁「双击缩放」，所有浏览器都认（顺带消掉 300ms 点击延迟）
     · pan-x pan-y  —— 连「双指缩放」一起禁掉；不认这条的浏览器会保留上一行
     只允许平移(pan)，所以页面里横向表格的左右滑动不受影响，缩放则永不发生。 */
  touch-action: manipulation;
  touch-action: pan-x pan-y;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.45;
  color: var(--t2);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overscroll-behavior-y: none;
  /* 与 html 同一策略，兜底不沿继承链解析 touch-action 的老 WebView */
  touch-action: manipulation;
  touch-action: pan-x pan-y;
}

input,
select,
textarea,
button {
  margin: 0;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: 0;
  border-radius: 0;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

input::-webkit-input-placeholder,
textarea::-webkit-input-placeholder {
  color: var(--t5);
}

/* ---------- 顶部导航 ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  height: calc(48px + var(--safe-t));
  padding: var(--safe-t) 6px 0;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.nav__side {
  flex: none;
  min-width: 62px;
  height: 48px;
  display: flex;
  align-items: center;
  padding: 0 6px;
  font-size: 15px;
  color: var(--t2);
}

.nav__side--r {
  justify-content: flex-end;
  color: var(--green);
}

.nav__back {
  display: flex;
  align-items: center;
  font-size: 24px;
  line-height: 1;
  padding: 0 4px 2px 0;
}

.nav__title {
  flex: 1;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  color: var(--t1);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.nav__btn {
  padding: 6px 10px;
  font-size: 14px;
  color: var(--green);
  border-radius: 6px;
}

.nav__btn:active {
  background: var(--green-l);
}

/* ---------- 页面容器 ---------- */
.screen {
  padding: calc(48px + var(--safe-t)) 0 calc(24px + var(--safe-b));
  min-height: 100vh;
}

.boot {
  padding: 80px 0;
  text-align: center;
  color: var(--t4);
}

.boot__dot {
  width: 26px;
  height: 26px;
  margin: 0 auto 16px;
  border: 3px solid #dfe1e5;
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- 首页 ---------- */
.home {
  padding: 16px;
}

.kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.kpi {
  flex: 1 1 30%;
  min-width: 100px;
  border-radius: 12px;
  padding: 14px 12px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
}

.kpi--asset {
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
}

.kpi--unrecv {
  background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
}

.kpi--profit {
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
}

.kpi__label {
  font-size: 12px;
  color: #555555;
}

.kpi__value {
  margin-top: 7px;
  font-size: 17px;
  font-weight: 700;
  color: #1f1f1f;
  word-break: break-all;
}

.kpis__hint {
  margin: -8px 0 18px;
  font-size: 12px;
  color: var(--t4);
  background: #ffffff;
  border-radius: 10px;
  padding: 12px 14px;
}

.pending {
  margin-bottom: 18px;
}

.pending__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}

.pending__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--t1);
}

.pending__count {
  font-size: 12px;
  color: var(--t4);
}

.pending__empty {
  padding: 28px 0;
  text-align: center;
  font-size: 13px;
  color: var(--t5);
  background: #ffffff;
  border-radius: 12px;
}

.pending__more {
  margin-top: 8px;
  text-align: right;
  font-size: 12px;
  color: var(--green);
}

.grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.grid__item {
  width: calc((100% - 12px) / 2);
  min-height: 92px;
  background: #ffffff;
  border-radius: 12px;
  padding: 18px 16px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.grid__item:active {
  background: #fafbfc;
}

.grid__item:last-child:nth-child(odd) {
  width: 100%;
}

.grid__name,
.grid__count,
.grid__desc {
  width: 100%;
}

.grid__name {
  font-size: 16px;
  font-weight: 600;
  color: var(--t1);
  letter-spacing: 12px;
  text-indent: 6px;
}

.grid__count {
  margin-top: 8px;
  font-size: 12px;
  color: var(--green);
}

.grid__desc {
  margin-top: 5px;
  font-size: 12px;
  color: #8a8f99;
}

.grid__item--danger {
  background: #fff6f6;
}

.grid__item--danger:active {
  background: #ffeeee;
}

.grid__name--danger {
  color: var(--red);
}

/* ---------- 搜索条 / 页信息 / 操作按钮 ---------- */
.bar {
  padding: 0 12px;
}

.bar__input {
  width: 100%;
  height: 38px;
  background: #ffffff;
  border-radius: 8px;
  padding: 0 12px;
  font-size: 16px; /* 必须 ≥16px，否则 iOS 一点搜索框就把页面放大 */
}

.meta {
  padding: 10px 16px 0;
}

.meta__title {
  display: block;
  font-size: 16px;
  font-weight: 600;
  color: var(--t1);
}

.meta__sub {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: var(--t4);
}

.meta__stat {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--green);
}

.acts {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
}

.act {
  flex: 1;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--t2);
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
}

.act--primary {
  background: var(--green);
  color: #ffffff;
}

.act:active {
  opacity: 0.72;
}

/* ---------- 表格（横向滚动） ---------- */
.tw {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  display: inline-block;
  min-width: 100%;
  background: #ffffff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
}

.table--inset {
  margin: 0 12px;
}

.tr {
  display: flex;
  border-bottom: 1px solid var(--line);
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.tr:last-child {
  border-bottom: none;
}

.tr--head {
  background: #f7f8fa;
}

.td {
  flex: none;
  width: 92px;
  padding: 11px 9px;
  font-size: 13px;
  color: var(--t2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.td:first-child {
  width: 102px;
}

.tr--head .td {
  font-size: 12px;
  color: var(--t3);
  font-weight: 600;
}

/* ---------- 订单状态：整行文字按状态染色 ----------
   口径（与 mf-data.js 的 orderRowTone 一致）：
     已出库 = 黄、已完成 = 绿、完工未款 = 红、已收款 = 蓝、
     已备货/已出库且有收款日期 = 粉、其余 = 黑（默认色，不加 class）
   黄字在白底上偏淡，配一层极浅底色保证可读。 */
.tr--out .td,
.ptr--out .ptd {
  color: #d99400;
}

.tr--out,
.ptr--out {
  background: #fffcf0;
}

.tr--done .td,
.ptr--done .ptd {
  color: #12924a;
}

.tr--done,
.ptr--done {
  background: #f4fcf7;
}

.tr--unpaid .td,
.ptr--unpaid .ptd {
  color: #d9363e;
}

.tr--unpaid,
.ptr--unpaid {
  background: #fff6f6;
}

/* 已收款但「连收款日期都没填」= 蓝色（兜底档：正常情况都会被下面的粉色抢先） */
.tr--paid .td,
.ptr--paid .ptd {
  color: #1268d6;
}

.tr--paid,
.ptr--paid {
  background: #f3f8ff;
}

/* 钱已收到、货还没完工 = 粉色：状态是 已备货 / 已出库 / 已收款，且已填收款日期
   （已收款本身就是「收了钱没完工」，所以「已备货 / 已出库 → 已收款」颜色保持不变） */
.tr--pink .td,
.ptr--pink .ptd {
  color: #d63384;
}

.tr--pink,
.ptr--pink {
  background: #fff4fa;
}

/* 状态单元格可点选（弹状态选择），▾ 是提示能点的标记 */
.td--status,
.ptd--status {
  -webkit-tap-highlight-color: transparent;
}

.td__dd {
  margin-left: 3px;
  font-size: 9px;
  color: #c0c4cc;
  vertical-align: middle;
}

/* 首页「未完成订单」小表：与小程序 index.wxss 的 .ptable/.ptr 一致（rpx÷2）。
   ⚠️ .ptr 必须是 display:flex —— 少了它每个 .ptd 退化成块级元素，
   表头和数据会整列竖着摞（2026-09 线上踩过）。 */
.ptable {
  display: inline-block;
  min-width: 100%;
  background: #ffffff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
}

.ptr {
  display: flex;
  border-bottom: 1px solid #f0f1f3;
}

.ptr:last-child {
  border-bottom: none;
}

.ptr--head {
  background: #f7f8fa;
}

.ptd {
  flex: none;
  width: 86px;
  padding: 10px 8px;
  font-size: 12.5px;
  color: var(--t2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ptd:first-child {
  width: 105px;
}

.ptr--head .ptd {
  font-size: 11.5px;
  color: var(--t3);
  font-weight: 600;
}

.empty {
  text-align: center;
  color: var(--t5);
  font-size: 14px;
  padding: 40px 0;
}

.hint {
  text-align: center;
  color: var(--t5);
  font-size: 11px;
  padding: 10px 16px 0;
}

/* ---------- 卡片列表 ---------- */
.list {
  padding: 4px 12px 0;
}

.card {
  background: #ffffff;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
  position: relative;
}

.card--tap:active {
  background: #fafbfc;
}

.card__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--t1);
  padding-right: 52px;
  word-break: break-all;
}

.card__row {
  display: flex;
  align-items: flex-start;
  margin-top: 7px;
  font-size: 13px;
}

.card__label {
  flex: none;
  width: 88px;
  color: var(--t4);
}

.card__value {
  flex: 1;
  color: var(--t2);
  word-break: break-all;
}

.card__del {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 5px 10px;
  font-size: 12px;
  color: var(--red);
  background: #fff5f5;
  border-radius: 6px;
}

.card__del:active {
  background: #ffe9e9;
}

/* 关联带出的只读信息 */
.ref {
  margin-top: 6px;
  background: #f8f9fb;
  border-radius: 8px;
  padding: 8px 10px;
}

.ref__row {
  display: flex;
  font-size: 12px;
  line-height: 1.7;
}

.ref__label {
  flex: none;
  width: 84px;
  color: var(--t4);
}

.ref__value {
  flex: 1;
  color: var(--t2);
  word-break: break-all;
}

/* ---------- 库存结存汇总 ---------- */
.sum {
  margin: 4px 12px 10px;
  background: #ffffff;
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
}

.sum__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}

.sum__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--t1);
}

.sum__warn {
  font-size: 12px;
  color: var(--red);
}

.sum__ok {
  font-size: 12px;
  color: var(--green);
}

.sum__row {
  display: flex;
  align-items: center;
  font-size: 13px;
  padding: 5px 0;
  border-top: 1px solid var(--line);
}

.sum__code {
  flex: none;
  width: 56px;
  color: var(--t3);
}

.sum__name {
  flex: 1;
  color: var(--t2);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.sum__qty {
  flex: none;
  color: var(--t1);
  font-weight: 600;
}

.sum__safe {
  color: var(--t5);
  font-weight: 400;
}

.sum__row.is-low .sum__qty {
  color: var(--red);
}

/* ---------- 表单（动态字段） ---------- */
.form {
  padding: 4px 12px 0;
}

/* 表单行：订单表把短字段（业务经理+施工老师、数量+单价）两两并排一行，省一半竖向空间；
   其余字段仍各自占一整行。见 mf-data.js 的 orderFormHalves / formRows。 */
.frow {
  display: flex;
  align-items: stretch;
}

.frow > .fitem {
  flex: 1;
  min-width: 0;
}

/* 并排两列的内边距收窄一点，窄列里内容区更大 */
.frow--half {
  gap: 8px;
}

.frow--half > .fitem {
  padding-left: 10px;
  padding-right: 10px;
}

.fitem {
  background: #ffffff;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
}

.fitem__label {
  display: block;
  font-size: 12px;
  color: var(--t4);
  margin-bottom: 6px;
}

.fitem__req {
  color: var(--red);
  margin-left: 2px;
}

.fitem__input,
.fitem__area,
.fitem__picker {
  width: 100%;
  min-height: 36px;
  line-height: 36px;
  background: #f7f8fa;
  border-radius: 8px;
  padding: 0 12px;
  font-size: 16px; /* 必须 ≥16px：iOS 点输入框自动放大的唯一触发条件 */
  color: var(--t1);
}

.fitem__area {
  min-height: 68px;
  line-height: 1.5;
  padding: 9px 12px;
  resize: none;
}

/* 只读展示（订单金额 = 单价 × 数量，自动算出不可输入） */
.fitem__ro {
  min-height: 36px;
  line-height: 36px;
  background: #f7f8fa;
  border-radius: 8px;
  padding: 0 12px;
  font-size: 16px;
  font-weight: 600;
  color: var(--t2);
}

.fitem__picker {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fitem__picker.is-ph {
  color: var(--t5);
}

.fitem__picker::after {
  content: "›";
  font-size: 18px;
  color: #c8c9cc;
  margin-left: 6px;
}

/* 下拉/关联字段：原生 select 藏在 picker 壳里，保留系统选择器（手机上体验最好） */
.fitem__picker select {
  flex: 1;
  min-width: 0;
  height: 36px;
  font-size: 16px; /* 同上：select 也参与 iOS 自动放大 */

  color: var(--t1);
  background: none;
  padding: 0;
}

.fitem__picker.is-ph select {
  color: var(--t5);
}

.fitem__row {
  display: flex;
  gap: 8px;
}

.fitem__row > * {
  flex: 1;
  min-width: 0;
}

.fitem__count {
  margin-top: 4px;
  font-size: 11px;
  color: var(--t5);
  text-align: right;
}

.fitem__err {
  margin-top: 4px;
  font-size: 12px;
  color: var(--red);
}

.fitem__sw {
  display: flex;
  align-items: center;
  min-height: 36px;
}

/* 开关 */
.sw {
  position: relative;
  flex: none;
  width: 50px;
  height: 30px;
  border-radius: 15px;
  background: #e5e5e5;
  transition: background 0.18s;
}

.sw::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.18s;
}

.sw.is-on {
  background: var(--green);
}

.sw.is-on::after {
  transform: translateX(20px);
}

.sw.is-disabled {
  opacity: 0.5;
}

/* 底部保存条 */
.footbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  gap: 10px;
  padding: 10px 12px calc(10px + var(--safe-b));
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(6px);
}

.footbar__btn {
  flex: 1;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  background: #f2f3f5;
  border-radius: 8px;
  color: var(--t2);
}

.footbar__btn--primary {
  background: var(--green);
  color: #ffffff;
  font-weight: 600;
}

.footbar__btn--danger {
  background: #fff0f0;
  color: var(--red);
  flex: none;
  padding: 0 18px;
}

.footbar__btn:active {
  opacity: 0.75;
}

.screen--withbar {
  padding-bottom: calc(84px + var(--safe-b));
}

/* ---------- 系统管理：分区 / 行 ---------- */
.sec {
  padding: 0 12px;
  margin-bottom: 18px;
}

.sec__head {
  padding: 0 4px 8px;
}

.sec__title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--t1);
}

.sec__tip {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: var(--t4);
  line-height: 1.5;
}

.sec__card {
  background: #ffffff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
}

.row {
  display: flex;
  align-items: center;
  min-height: 46px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
}

.row:last-child {
  border-bottom: none;
}

.row--tap:active {
  background: #fafbfc;
}

.row__label {
  flex: none;
  width: 88px;
  font-size: 14px;
  color: var(--t2);
}

.row__value {
  flex: 1;
  font-size: 13px;
  color: var(--t4);
  text-align: right;
  word-break: break-all;
}

.row__value--warn {
  color: #ff976a;
}

.row__arrow {
  flex: none;
  margin-left: 8px;
  font-size: 17px;
  color: #c8c9cc;
  line-height: 1;
}

.row__input {
  flex: 1;
  height: 36px;
  line-height: 36px;
  font-size: 16px; /* 必须 ≥16px，见文件末尾说明 */

  color: var(--t1);
  text-align: right;
  background: #f7f8fa;
  border-radius: 6px;
  padding: 0 10px;
}

.hintbox {
  margin: 10px 14px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.6;
  color: #7a6a3a;
  background: #fffbe6;
  border-radius: 8px;
}

/* 分段控件 */
.seg {
  flex: none;
  display: flex;
  border: 1px solid var(--line2);
  border-radius: 7px;
  overflow: hidden;
}

.seg__item {
  padding: 5px 12px;
  font-size: 12.5px;
  color: var(--t3);
  background: #ffffff;
}

.seg__item + .seg__item {
  border-left: 1px solid var(--line2);
}

.seg__item.is-on {
  background: var(--green);
  color: #ffffff;
}

/* 权限矩阵 */
.role__head {
  display: flex;
  align-items: center;
  padding: 12px 14px 6px;
}

.role__name {
  font-size: 14px;
  font-weight: 600;
  color: var(--t1);
}

.role__lock {
  margin-left: 8px;
  padding: 1px 7px;
  font-size: 11px;
  color: var(--green);
  background: var(--green-l);
  border-radius: 4px;
}

.perm {
  display: flex;
  align-items: center;
  padding: 7px 14px;
  border-top: 1px solid var(--line);
}

.perm__text {
  flex: 1;
  min-width: 0;
}

.perm__label {
  font-size: 13.5px;
  color: var(--t2);
}

.perm__desc {
  font-size: 11px;
  color: var(--t4);
  line-height: 1.4;
}

.perm__sw {
  flex: none;
  margin-left: 10px;
}

.role__note {
  padding: 8px 14px 12px;
  font-size: 11px;
  color: var(--t4);
}

/* ---------- 字段设置列表 ---------- */
.fld {
  display: flex;
  align-items: center;
  background: #ffffff;
  border-radius: 10px;
  padding: 11px 12px;
  margin: 0 12px 8px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
}

.fld__main {
  flex: 1;
  min-width: 0;
}

.fld__label {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--t1);
  word-break: break-all;
}

.fld__meta {
  margin-top: 4px;
  font-size: 11px;
  color: var(--t4);
  line-height: 1.5;
}

.fld__ops {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
}

.fld__op {
  min-width: 32px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--t3);
  background: #f4f5f7;
  border-radius: 6px;
  padding: 0 7px;
}

.fld__op:active {
  opacity: 0.7;
}

.fld__op--danger {
  color: var(--red);
  background: #fff5f5;
}

.fld__op.is-off {
  opacity: 0.35;
}

.badge {
  display: inline-block;
  margin-left: 6px;
  padding: 0 5px;
  font-size: 10.5px;
  line-height: 16px;
  border-radius: 4px;
  vertical-align: 1px;
}

.badge--sys {
  color: #7a6a3a;
  background: #fffbe6;
}

.badge--sens {
  color: #fa5151;
  background: #fff0f0;
}

/* ---------- 弹层 / 遮罩 ---------- */
.layer {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
}

.layer.is-open {
  display: block;
}

.mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.mask--center {
  align-items: center;
}

.sheet {
  width: 100%;
  max-width: 560px;
  max-height: 86vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #ffffff;
  border-radius: 16px 16px 0 0;
  padding: 20px 16px calc(18px + var(--safe-b));
  animation: slideUp 0.2s ease-out;
}

@keyframes slideUp {
  from {
    transform: translateY(30px);
    opacity: 0.6;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

.dlg {
  width: calc(100% - 64px);
  max-width: 320px;
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  text-align: center;
}

.dlg__title {
  padding: 22px 20px 6px;
  font-size: 16px;
  font-weight: 600;
  color: var(--t1);
}

.dlg__body {
  padding: 0 20px 20px;
  font-size: 13.5px;
  color: var(--t3);
  line-height: 1.6;
  word-break: break-all;
}

.dlg__btns {
  display: flex;
  border-top: 1px solid var(--line);
}

.dlg__btn {
  flex: 1;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--t2);
}

.dlg__btn + .dlg__btn {
  border-left: 1px solid var(--line);
}

.dlg__btn--primary {
  color: var(--green);
  font-weight: 600;
}

.dlg__btn--danger {
  color: var(--red);
  font-weight: 600;
}

.dlg__btn:active {
  background: #fafbfc;
}

.sheet__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--t1);
  text-align: center;
  margin-bottom: 4px;
}

.sheet__tip {
  font-size: 11.5px;
  color: var(--t4);
  line-height: 1.6;
  margin-bottom: 14px;
  text-align: center;
}

.checks {
  display: flex;
  flex-wrap: wrap;
}

.check {
  display: flex;
  align-items: center;
  width: 50%;
  padding: 8px 0;
}

.check--full {
  width: 100%;
}

.check__t {
  margin-left: 8px;
  font-size: 13.5px;
  color: var(--t2);
}

.cbox {
  flex: none;
  width: 19px;
  height: 19px;
  border: 1px solid #d0d2d6;
  border-radius: 50%;
  position: relative;
}

.cbox.is-on {
  background: var(--green);
  border-color: var(--green);
}

.cbox.is-on::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 3px;
  width: 5px;
  height: 9px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;  transform: rotate(45deg);
}

/* ---- 列设置弹层（仅限 #col-list，不影响别处的 .check 两列勾选布局） ---- */
#col-list {
  display: block;
  max-height: 50vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#col-list .check {
  width: 100%;
  padding: 10px 4px;
  border-bottom: 1px solid var(--line);
}

#col-list .check--on .check__t {
  color: var(--t1);
  font-weight: 600;
}

.sheet__tip2 {
  font-size: 12px;
  color: var(--t2);
  text-align: center;
  margin: -6px 0 10px;
}

.colmv {
  flex: none;
  width: 28px;
  height: 26px;
  margin-left: 6px;
  border: 1px solid var(--line2);
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--t2);
  background: #f6f7f9;
  user-select: none;
  -webkit-user-select: none;
}

.colmv--dis {
  color: #c3c6cb;
  background: #f1f2f4;
}

.prow {
  display: flex;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.prow__label {
  flex: none;
  width: 74px;
  font-size: 13.5px;
  color: var(--t2);
}

.prow__input {
  flex: 1;
  height: 38px;
  line-height: 38px;
  font-size: 16px; /* 必须 ≥16px，见文件末尾说明 */

  color: var(--t1);
  background: #f7f8fa;
  border-radius: 8px;
  padding: 0 12px;
}

.sheet__btns {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.sheet__btn {
  flex: 1;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: var(--t2);
  background: #f2f3f5;
  border-radius: 8px;
}

.sheet__btn--primary {
  background: var(--green);
  color: #ffffff;
}

.sheet__btn--danger {
  background: var(--red);
  color: #ffffff;
}

.sheet__btn:active {
  opacity: 0.75;
}

.sheet__sec {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.sheet__secT {
  font-size: 12px;
  color: var(--t4);
  margin-bottom: 8px;
}

/* ---------- 登录页 ---------- */
.login {
  min-height: 100vh;
  padding: 64px 24px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login__logo {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: linear-gradient(135deg, #07c160 0%, #06ad56 100%);
  color: #ffffff;
  font-size: 22px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 1px;
  box-shadow: 0 6px 18px rgba(7, 193, 96, 0.3);
}

.login__title {
  margin-top: 16px;
  font-size: 20px;
  font-weight: 700;
  color: var(--t1);
}

.login__sub {
  margin-top: 6px;
  font-size: 12px;
  color: var(--t4);
}

.login__card {
  width: 100%;
  max-width: 420px;
  margin-top: 28px;
  background: #ffffff;
  border-radius: 14px;
  padding: 6px 16px 16px;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.05);
}

.lg__row {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.lg__row span {
  flex: none;
  width: 60px;
  font-size: 14px;
  color: var(--t3);
}

.lg__row input {
  flex: 1;
  height: 50px;
  font-size: 16px; /* 必须 ≥16px，见文件末尾说明 */

  color: var(--t1);
}

.lg__btn {
  width: 100%;
  height: 46px;
  margin-top: 18px;
  background: var(--green);
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
  border-radius: 8px;
}

.lg__btn:active {
  background: var(--green-d);
}

.lg__btn[disabled] {
  opacity: 0.55;
}

.login__tip {
  margin-top: 18px;
  max-width: 420px;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--t4);
  text-align: center;
}

.login__foot {
  margin-top: auto;
  padding-top: 32px;
  font-size: 11px;
  color: var(--t5);
  text-align: center;
}

/* ---------- toast ---------- */
.toast-wrap {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(72px + var(--safe-b));
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  max-width: 78%;
  padding: 10px 16px;
  font-size: 13.5px;
  line-height: 1.5;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.78);
  border-radius: 8px;
  text-align: center;
  word-break: break-all;
  animation: fadeIn 0.15s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- 空态 / 说明 ---------- */
.note {
  padding: 8px 16px 0;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--t4);
}

.foot {
  padding: 24px 16px 32px;
  text-align: center;
  font-size: 11px;
  color: var(--t5);
}

@media (min-width: 560px) {
  .home,
  .form,
  .list {
    max-width: 560px;
    margin: 0 auto;
  }

  .sec,
  .bar,
  .meta,
  .acts,
  .fld {
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
  }

  .table--inset {
    max-width: 536px;
    margin-left: auto;
    margin-right: auto;
    display: block;
  }
}

/* ==========================================================================
   禁止缩放 · 最后一道保险
   iOS Safari 有一条硬规则：**输入框（input / textarea / select）字号小于 16px 时，
   点它就会强制把整个页面放大**。而页面设了 maximum-scale=1（禁缩放）后，iOS 放大完
   又拒绝缩回 —— 结果就是「页面被放大后卡住，怎么都缩不小」。两者互相打架。
   唯一可靠的办法：页面上每个输入控件的字号都 ≥ 16px。
   这条规则放在文件最末并加 !important，是为了**以后新增的输入框也自动受保护**
   （只约住字号，不影响任何布局尺寸——输入框高度/圆角/内边距都还是原样）。
   ========================================================================== */
input,
select,
textarea {
  font-size: 16px !important;
}

/* ---- 订单新增页：历史记录联想 ---- */
.suggest {
  border: 1px solid var(--line2);
  border-radius: 8px;
  margin-top: 4px;
  background: #ffffff;
  overflow: hidden;
}

.suggest__item {
  padding: 10px 12px;
  font-size: 14px;
  color: var(--t2);
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.suggest__item:last-child {
  border-bottom: none;
}

.suggest__item:active {
  background: var(--green-l);
}

/* 只读视图页只剩「列设置」一个按钮：别 flex 拉满整行，否则像条主操作栏 */
.acts--single .act {
  flex: 0 0 auto;
  padding: 0 18px;
}
