/* ============================================================================
 * H5 外壳样式：基础 reset / 页面容器 / 仿微信胶囊 / 浮层（toast·modal·loading·actionSheet·preview）/ picker
 * 与 assets/app.css（由小程序 WXSS 转换而来）配合使用
 * ============================================================================ */
:root {
  --rpx: 0.5333px;               /* JS 按屏宽重算：750rpx = 100% 屏宽 */
  --wx-font: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue',
             'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

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

html, body {
  margin: 0; padding: 0;
  height: 100%;
  font-family: var(--wx-font);
  color: #16253d;
  background: #f4f7fe;
  overscroll-behavior-y: contain;
  -webkit-font-smoothing: antialiased;
}

body { font-size: 14px; line-height: 1.5; }

img { display: block; border: 0; }

button { font-family: inherit; font-size: inherit; color: inherit; }

input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }

/* ---------- 页面容器：整页滚动，多页叠放（保留返回时的滚动位置） ---------- */
#app {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  z-index: 0;
  isolation: isolate;
}
.wx-page {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  background: transparent;
}
.wx-page--missing { background: #f4f7fe; }

.wx-comp { display: contents; }

/* ---------- 仿微信胶囊（固定悬浮，层级 88：高于导航 85、低于弹窗 90+） ---------- */
.wx-capsule {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 6px);
  right: 12px;
  width: 87px; height: 32px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.62);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  box-shadow: 0 2rpx 10rpx rgba(31, 58, 110, 0.08);
  display: flex; align-items: center;
  z-index: 88;
  cursor: pointer;
  user-select: none;
  border: 1rpx solid rgba(255, 255, 255, 0.7);
}
.wx-capsule__cell {
  flex: 1; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: #16253d;
}
.wx-capsule__cell:active { opacity: 0.55; }
.wx-capsule__sep { width: 1px; height: 16px; background: rgba(22, 37, 61, 0.14); }
.wx-capsule__dots { letter-spacing: 1px; font-weight: 700; line-height: 1; }

/* ---------- toast ---------- */
.wx-toast {
  position: fixed; left: 50%; top: 45%;
  transform: translate(-50%, -50%) scale(0.9);
  max-width: 70%;
  background: rgba(20, 26, 38, 0.82);
  color: #fff; border-radius: 12px;
  padding: 18px 20px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-size: 14px; text-align: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
  z-index: 2000;
}
.wx-toast.is-on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.wx-toast__ico {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; font-weight: 700;
}
.wx-toast__ico--ok { background: #1ca06e; color: #fff; }
.wx-toast__ico--err { background: #e2664a; color: #fff; }
.wx-toast__spin {
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: wx-spin 0.8s linear infinite;
}
@keyframes wx-spin { to { transform: rotate(360deg); } }

/* ---------- loading ---------- */
.wx-loading {
  position: fixed; inset: 0;
  display: none; align-items: center; justify-content: center;
  background: rgba(15, 23, 42, 0.28);
  z-index: 2100;
}
.wx-loading.is-on { display: flex; }
.wx-loading__box {
  background: rgba(20, 26, 38, 0.86); color: #fff;
  border-radius: 12px; padding: 20px 24px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  font-size: 14px; min-width: 120px;
}
.wx-loading__spin {
  width: 30px; height: 30px; border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  animation: wx-spin 0.8s linear infinite;
}

/* ---------- modal ---------- */
.wx-modal-mask {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 2200; padding: 48px;
}
.wx-modal {
  background: #fff; border-radius: 14px;
  width: 100%; max-width: 320px;
  overflow: hidden;
  animation: wx-pop 0.16s ease;
}
@keyframes wx-pop { from { transform: scale(0.92); opacity: 0.5; } to { transform: scale(1); opacity: 1; } }
.wx-modal__title {
  padding: 20px 20px 0; text-align: center;
  font-size: 16px; font-weight: 600; color: #16253d;
}
.wx-modal__body {
  padding: 12px 20px 20px; text-align: center;
  font-size: 14px; color: #6b7c96; line-height: 1.6;
  white-space: pre-wrap; word-break: break-all;
}
.wx-modal__btns { display: flex; border-top: 1px solid rgba(22, 37, 61, 0.08); }
.wx-modal__btn {
  flex: 1; height: 46px; border: 0; background: #fff;
  font-size: 15px; color: #16253d; cursor: pointer;
}
.wx-modal__btn--ok { color: #3d82ff; font-weight: 600; }
.wx-modal__btn--cancel { border-right: 1px solid rgba(22, 37, 61, 0.08); }
.wx-modal__btn:active { background: rgba(22, 37, 61, 0.05); }

/* ---------- actionSheet ---------- */
.wx-as-mask {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 2200; padding: 12px;
}
.wx-as { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 8px; }
.wx-as__item {
  height: 50px; border: 0; border-radius: 12px;
  background: #fff; font-size: 15px; color: #16253d; cursor: pointer;
}
.wx-as__item:active { background: #eef3ff; }
.wx-as__item--cancel { font-weight: 600; margin-top: 2px; }

/* ---------- 图片预览 ---------- */
.wx-preview {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.92);
  display: none; align-items: center; justify-content: center;
  z-index: 2300;
}
.wx-preview.is-on { display: flex; }
.wx-preview__img { max-width: 100%; max-height: 88%; object-fit: contain; }
.wx-preview__cnt {
  position: absolute; bottom: calc(env(safe-area-inset-bottom) + 24px);
  left: 0; right: 0; text-align: center;
  color: rgba(255, 255, 255, 0.85); font-size: 13px;
}

/* ---------- picker（覆盖在展示内容上的原生控件） ---------- */
.wx-picker { position: relative; }
.wx-picker__ctrl {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  max-width: 100%; max-height: 100%;
  opacity: 0; border: 0; margin: 0; padding: 0; background: transparent;
  cursor: pointer; appearance: none; -webkit-appearance: none;
}

/* ---------- switch（checkbox 外观微调） ---------- */
input[type="checkbox"] { accent-color: #3d82ff; }

/* ---------- 滚动条（桌面预览时更干净） ---------- */
.wx-page::-webkit-scrollbar { width: 0; height: 0; }

/* ============================================================
   网页端专属：禁用的日历格子不响应点击
   ------------------------------------------------------------
   小程序端点「未来日期」会 wx.showToast('不能设置未来日期')，那是原生交互；
   浏览器里没有这种提示习惯，用户点一下就蹦个 toast 属于纯噪音反馈。
   H5 直接在**指针层**拦掉：未来格（.cal-day.future，考勤日历）与禁用格
   （[data-disabled="true"]）不接收任何鼠标/触摸事件，点击直接穿透到网格容器，
   自然不会再触发 onDayTap → 也就不会弹那枚 toast。
   只在 H5 外壳样式里做，**不碰 miniprogram/pages/kq/kq.js**（不改小程序行为）。
   ============================================================ */
.cal-day.future,
.cal-day[data-disabled="true"],
[data-disabled="true"].cal-day {
  pointer-events: none !important;
  cursor: default !important;
}

.wx-frag { display: contents; }

/* slot 占位：不进布局流，子节点像直接挂在父级 */
.wx-slot { display: contents; }

/* slot 占位：不进布局流，子节点像直接挂在父级 */
.wx-slot { display: contents; }

img[data-mode="aspectFill"] { object-fit: cover; }
img[data-mode="aspectFit"] { object-fit: contain; }
img[data-mode="scaleToFill"] { object-fit: fill; }
img[data-mode="widthFix"], img[data-mode="heightFix"] { object-fit: fill; width: 100%; height: auto; }

div[data-scroll="y"] { overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
div[data-scroll="x"] { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }

iframe { border: 0; width: 100%; height: 100%; }

.wx-picker select.wx-picker__ctrl { direction: ltr; }
