/* ============================================================
   惠米米教培 · H5 工作台（v20261121）
   只放「统一登录 + 员工工作台」新增的组件；学员端样式仍在 app.css，
   两份互不覆盖：学员页不加载本文件，工作台不依赖学员页的类名。
   ============================================================ */

/* ---------- 外壳 ---------- */
.h5 { min-height: 100%; background: var(--bg); }
.h5-body { max-width: 680px; margin: 0 auto; padding: 12px 14px 92px; }
.h5.no-tab .h5-body { padding-bottom: 24px; }

.appbar {
  position: sticky; top: 0; z-index: 40;
  background: linear-gradient(135deg, #2563EB, #1D4ED8);
  color: #fff; padding-top: env(safe-area-inset-top);
}
.appbar-in {
  max-width: 680px; margin: 0 auto; padding: 12px 14px;
  display: flex; align-items: center; gap: 10px; min-height: 52px;
}
.appbar h1 { flex: 1; margin: 0; font-size: 17px; font-weight: 700; letter-spacing: .3px; }
.appbar .ab-btn {
  background: rgba(255,255,255,.16); border: none; color: #fff;
  width: 34px; height: 34px; border-radius: 10px; font-size: 16px;
  display: flex; align-items: center; justify-content: center; flex: none;
}
.appbar .ab-btn:active { background: rgba(255,255,255,.3); }
.appbar .ab-sub { font-size: 12px; opacity: .85; font-weight: 400; }

/* 底部标签栏：与学员端同一套观感，但用独立类名，避免相互影响 */
.mtab {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; background: rgba(255,255,255,.97); backdrop-filter: blur(12px);
  border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom);
}
.mtab a { flex: 1; text-align: center; padding: 7px 0 8px; color: var(--gray); font-size: 11px; }
.mtab a .ico { display: block; font-size: 20px; line-height: 1.25; }
.mtab a.on { color: var(--primary); font-weight: 700; }

/* ---------- 登录页 ---------- */
.login { min-height: 100vh; background: linear-gradient(170deg, #2563EB 0%, #1D4ED8 42%, #F1F5F9 42.1%, #F1F5F9 100%); padding: 0 0 30px; }
.login-hero { padding: 44px 24px 30px; color: #fff; }
.login-hero .mark {
  width: 54px; height: 54px; border-radius: 16px; background: rgba(255,255,255,.18);
  display: flex; align-items: center; justify-content: center; font-size: 27px; margin-bottom: 14px;
}
.login-hero h2 { margin: 0 0 6px; font-size: 23px; font-weight: 800; letter-spacing: .5px; }
.login-hero p { margin: 0; font-size: 13px; opacity: .88; line-height: 1.6; }
.login-card { margin: 0 16px; background: #fff; border-radius: 18px; padding: 20px 18px 18px; box-shadow: 0 12px 30px rgba(15,23,42,.12); }
.login-card h3 { margin: 0 0 4px; font-size: 17px; }
.login-card .sub { font-size: 12.5px; color: var(--gray); margin-bottom: 14px; }

.fld2 { margin-bottom: 12px; }
.fld2 > label { display: block; font-size: 12.5px; color: var(--gray); margin-bottom: 6px; }
.inp {
  width: 100%; padding: 13px 14px; border: 1px solid var(--border); border-radius: 12px;
  font-size: 16px; background: #fff; font-family: inherit; color: var(--dark);
  -webkit-appearance: none; appearance: none;
}
.inp:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.inp::placeholder { color: #B6C0CE; }
/* 下拉框：.inp 关掉了原生 appearance，箭头要自己补，否则看着像只读输入框 */
select.inp {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5L6 6.5l5-5' fill='none' stroke='%2394A3B8' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 34px;
}
.pw-wrap { position: relative; }
.pw-wrap .inp { padding-right: 52px; }
.pw-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: none; background: none; color: var(--gray); font-size: 12.5px; padding: 8px 10px;
}

.checkrow { display: flex; align-items: flex-start; gap: 9px; margin: 4px 0 14px; cursor: pointer; }
.checkrow input { width: 19px; height: 19px; margin: 1px 0 0; flex: none; accent-color: var(--primary); }
.checkrow .t { font-size: 13.5px; font-weight: 600; }
.checkrow .d { display: block; font-size: 11.5px; color: var(--muted); font-weight: 400; margin-top: 1px; }

.btn-xl { width: 100%; padding: 15px; border: none; border-radius: 13px; background: var(--primary); color: #fff; font-size: 16.5px; font-weight: 700; font-family: inherit; }
.btn-xl:active { background: var(--primary-dark); }
.btn-xl:disabled { opacity: .55; }
.btn-xl.wx { background: #07C160; }
.btn-xl.line { background: #fff; color: var(--primary); border: 1px solid #CFE0FF; }

.login-foot { margin: 16px 22px 0; text-align: center; font-size: 12.5px; color: var(--gray); line-height: 2; }
.login-foot a { color: var(--primary); }
.login-hint { display: flex; gap: 8px; align-items: flex-start; background: #EFF4FF; color: #1D4ED8; border-radius: 12px; padding: 10px 12px; font-size: 12.5px; line-height: 1.6; margin-bottom: 14px; }
.login-hint.warn { background: #FFF7ED; color: #C2410C; }
.login-hint.ok { background: var(--ok-soft); color: #15803D; }

/* ---------- 工作台首页 ---------- */
.hello { display: flex; align-items: center; gap: 12px; margin: 2px 2px 12px; }
.hello .av {
  width: 44px; height: 44px; border-radius: 14px; flex: none;
  background: linear-gradient(135deg, #DBEAFE, #BFDBFE); color: #1D4ED8;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 17px;
}
.hello .nm { font-size: 17px; font-weight: 800; line-height: 1.3; }
.hello .rl { font-size: 12px; color: var(--gray); }
.hello .wx {
  margin-left: auto; font-size: 11px; padding: 4px 9px; border-radius: 20px;
  background: var(--ok-soft); color: #15803D; font-weight: 600; white-space: nowrap;
}
.hello .wx.off { background: #FFF7ED; color: #C2410C; }

.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.kpi { background: #fff; border-radius: 15px; padding: 13px 14px; box-shadow: 0 3px 12px rgba(15,23,42,.05); }
.kpi .k { font-size: 11.5px; color: var(--gray); display: flex; align-items: center; gap: 4px; }
.kpi .v { font-size: 22px; font-weight: 800; line-height: 1.25; margin-top: 3px; letter-spacing: -.5px; }
.kpi .v small { font-size: 12px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.kpi .s { font-size: 11px; color: var(--muted); }
.kpi.hero { grid-column: span 2; background: linear-gradient(135deg, #1E3A8A, #2563EB); color: #fff; }
.kpi.hero .k, .kpi.hero .s { color: rgba(255,255,255,.78); }
.kpi.hero .v { font-size: 27px; }
.kpi.warn .v { color: #C2410C; }
.kpi.ok .v { color: var(--ok); }

.sec-h { display: flex; align-items: baseline; justify-content: space-between; margin: 16px 2px 8px; }
.sec-h b { font-size: 14.5px; }
.sec-h span { font-size: 12px; color: var(--muted); }

.todos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.todo {
  background: #fff; border-radius: 14px; padding: 13px 14px; box-shadow: 0 3px 12px rgba(15,23,42,.05);
  display: flex; align-items: center; gap: 10px; border: 1px solid transparent;
}
.todo:active { border-color: var(--primary); background: #FAFCFF; }
.todo .n { font-size: 21px; font-weight: 800; line-height: 1.1; }
.todo .n.zero { color: var(--muted); }
.todo .t { font-size: 12.5px; font-weight: 600; }
.todo .h { font-size: 10.5px; color: var(--muted); }

.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; background: #fff; border-radius: 16px; padding: 14px 8px; box-shadow: 0 3px 12px rgba(15,23,42,.05); }
.gcell { text-align: center; padding: 6px 2px; border-radius: 12px; }
.gcell:active { background: var(--primary-soft); }
.gcell .ico { font-size: 23px; line-height: 1.35; display: block; }
.gcell .t { font-size: 11.5px; color: #334155; }
.gcell .b { display: inline-block; min-width: 16px; padding: 0 4px; height: 16px; line-height: 16px; border-radius: 8px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; margin-left: 1px; }

/* ---------- 列表 ---------- */
.searchbar { position: sticky; top: 52px; z-index: 30; background: var(--bg); padding: 8px 0 6px; margin: -4px 0 4px; }
.searchbar .box { display: flex; align-items: center; gap: 8px; background: #fff; border-radius: 12px; padding: 9px 12px; box-shadow: 0 2px 8px rgba(15,23,42,.05); }
.searchbar input { flex: 1; border: none; outline: none; font-size: 15px; background: transparent; font-family: inherit; min-width: 0; }
.searchbar .ph { color: var(--muted); font-size: 14px; }
.searchbar .clr { border: none; background: none; color: var(--muted); font-size: 15px; padding: 0 2px; }

.chips2 { display: flex; gap: 7px; overflow-x: auto; padding: 6px 0 2px; scrollbar-width: none; }
.chips2::-webkit-scrollbar { display: none; }
.chips2 .c {
  flex: none; padding: 6px 13px; border-radius: 18px; border: 1px solid var(--border);
  background: #fff; color: var(--gray); font-size: 12.5px; font-family: inherit; white-space: nowrap;
}
.chips2 .c.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }

.row2 { background: #fff; border-radius: 14px; padding: 13px 14px; margin-bottom: 9px; box-shadow: 0 2px 10px rgba(15,23,42,.05); }
.row2:active { background: #FAFCFF; }
.row2 .top { display: flex; align-items: center; gap: 8px; }
.row2 .nm { font-size: 15.5px; font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row2 .sub { font-size: 12.5px; color: var(--gray); margin-top: 3px; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.row2 .foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border); font-size: 12.5px; color: var(--gray); }
.row2 .amt { font-size: 17px; font-weight: 800; color: var(--dark); }
.row2 .amt.red { color: #DC2626; }

.more { text-align: center; color: var(--gray); font-size: 13px; padding: 14px; }
.spin { width: 15px; height: 15px; border: 2px solid #CBD5E1; border-top-color: var(--primary); border-radius: 50%; display: inline-block; vertical-align: -2px; margin-right: 6px; animation: sp .7s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }

.fab {
  position: fixed; right: 18px; bottom: calc(72px + env(safe-area-inset-bottom));
  width: 52px; height: 52px; border-radius: 50%; border: none; z-index: 45;
  background: var(--primary); color: #fff; font-size: 26px; line-height: 1;
  box-shadow: 0 8px 20px rgba(37,99,235,.4);
}
.fab:active { transform: scale(.95); }
.h5.no-tab .fab { bottom: calc(20px + env(safe-area-inset-bottom)); }

/* ---------- 详情 / 表单 ---------- */
.sec { background: #fff; border-radius: 15px; padding: 4px 14px; margin-bottom: 10px; box-shadow: 0 2px 10px rgba(15,23,42,.05); }
.sec > h4 { margin: 12px 0 2px; font-size: 13px; color: var(--gray); font-weight: 600; }
.kv2 { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid #F1F5F9; font-size: 14px; }
.kv2:last-child { border-bottom: none; }
.kv2 .k { color: var(--gray); flex: none; font-size: 13.5px; }
.kv2 .v { text-align: right; font-weight: 600; word-break: break-all; }
.kv2 .v.dim { color: var(--gray); font-weight: 400; }
.kv2 .v.link { color: var(--primary); }

.acts { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 12px 0 6px; }
.acts .btn, .acts .btn-xl { padding: 12px; font-size: 14.5px; border-radius: 12px; }
.acts .full { grid-column: span 2; }

.form-actions { position: sticky; bottom: 0; background: linear-gradient(to top, var(--bg) 70%, rgba(241,245,249,0)); padding: 12px 0 6px; }

/* ---------- 弹层 ---------- */
.mask { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 80; opacity: 0; transition: opacity .2s; }
.mask.on { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 81;
  background: #fff; border-radius: 18px 18px 0 0; padding: 8px 16px calc(16px + env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform .25s cubic-bezier(.2,.8,.3,1); max-height: 88vh; overflow: auto;
}
.sheet.on { transform: translateY(0); }
.sheet .bar { width: 38px; height: 4px; border-radius: 2px; background: #E2E8F0; margin: 6px auto 12px; }
.sheet h3 { margin: 0 0 4px; font-size: 16.5px; }
.sheet .desc { font-size: 12.5px; color: var(--gray); margin-bottom: 12px; line-height: 1.6; }
.sheet .opt { display: flex; align-items: center; justify-content: space-between; padding: 14px 4px; border-bottom: 1px solid #F1F5F9; font-size: 15px; }
.sheet .opt:last-child { border-bottom: none; }
.sheet .opt.danger { color: var(--danger); }
.sheet .opt .sub { display: block; font-size: 12px; color: var(--muted); }

/* ---------- 骨架屏 ---------- */
.sk { background: #fff; border-radius: 14px; height: 76px; margin-bottom: 9px; position: relative; overflow: hidden; }
.sk::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, #F1F5F9 0%, #F8FAFC 50%, #F1F5F9 100%);
  background-size: 200% 100%; animation: skm 1.1s infinite;
}
@keyframes skm { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ---------- 杂项 ---------- */
.pill { display: inline-block; padding: 1px 8px; border-radius: 20px; font-size: 11.5px; font-weight: 600; background: var(--bg); color: var(--gray); }
.pill.ok { background: var(--ok-soft); color: #15803D; }
.pill.warn { background: #FFF7ED; color: #C2410C; }
.pill.bad { background: var(--danger-soft); color: var(--danger); }
.pill.blue { background: var(--primary-soft); color: var(--primary); }
.hr { height: 1px; background: #F1F5F9; margin: 10px 0; }
.right { text-align: right; }
.center { text-align: center; }
.mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.tiny { font-size: 11.5px; color: var(--muted); }
.toast2 {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.96);
  background: rgba(15,23,42,.9); color: #fff; padding: 12px 20px; border-radius: 12px;
  font-size: 14px; z-index: 99; opacity: 0; pointer-events: none; transition: all .18s; max-width: 80%; text-align: center;
}
.toast2.on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.toast2.err { background: rgba(185,28,28,.94); }

/* 接管态：学员端外壳（顶栏/视图/标签栏/toast）整块让位给工作台 */
html.h5-mode body { padding-bottom: 0; }
html.h5-mode body > .mhead,
html.h5-mode body > .mview,
html.h5-mode body > .tabbar,
html.h5-mode body > #toast { display: none !important; }
html.h5-mode body > #h5root { display: block; }

/* 首页「常用」按钮：白底卡片感，别和背景糊在一起 */
.h5-body .btn.ghost {
  background: #fff; color: var(--primary); border: 1px solid #E2E8F0;
  box-shadow: 0 2px 8px rgba(15,23,42,.04); font-weight: 600;
}
