/* 工厂 H5 移动端样式：轻量、单列、大按钮、适配 375-430px */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px; color: #2b3444; background: #f2f4f8;
  -webkit-tap-highlight-color: transparent;
}
a { color: #1a5fd0; text-decoration: none; }
:root {
  --blue: #1a5fd0; --blue-d: #1449a3; --line: #e6eaf1;
  --ok: #1f9d55; --warn: #e08a00; --err: #d2493f; --gray: #8b96a8;
}

/* 顶栏 */
.h5-header {
  position: sticky; top: 0; z-index: 20;
  height: 48px; display: flex; align-items: center; gap: 8px;
  padding: 0 12px; background: linear-gradient(135deg, #1a5fd0, #2f7ae5); color: #fff;
}
.h5-header .back { font-size: 20px; line-height: 1; padding: 4px 6px; cursor: pointer; }
.h5-header .h-title { font-size: 16px; font-weight: 600; flex: 1; }
.h5-header .h-right { font-size: 12px; opacity: .9; }

/* 主体 */
.h5-body { padding: 12px 12px 84px; }
.card {
  background: #fff; border-radius: 12px; padding: 14px; margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(26, 95, 208, .06);
}
.card h3 { margin: 0 0 10px; font-size: 15px; }
.card-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.card-title h3 { margin: 0; }
.muted { color: var(--gray); font-size: 12px; }

/* 首页统计 */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat {
  background: #fff; border-radius: 12px; padding: 14px; box-shadow: 0 2px 8px rgba(26,95,208,.06);
}
.stat .n { font-size: 24px; font-weight: 700; color: var(--blue); line-height: 1.2; }
.stat .l { font-size: 12px; color: var(--gray); margin-top: 4px; }

/* 列表项 */
.list-item {
  background: #fff; border-radius: 12px; padding: 12px 14px; margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(26,95,208,.06);
}
.list-item .row1 { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.list-item .no { font-weight: 600; font-size: 14px; }
.list-item .row2 { margin-top: 6px; color: #5a6675; font-size: 13px; display: flex; justify-content: space-between; gap: 8px; }
.list-item .row3 { margin-top: 6px; font-size: 12px; color: var(--gray); display: flex; justify-content: space-between; }
.amount { color: #d2493f; font-weight: 600; }

/* 标签 */
.badge {
  display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11px; line-height: 18px;
  background: #eef2f8; color: #5a6675; white-space: nowrap;
}
.badge.blue { background: #eaf1fe; color: var(--blue); }
.badge.green { background: #e8f7ee; color: var(--ok); }
.badge.orange { background: #fdf3e2; color: var(--warn); }
.badge.red { background: #fdecea; color: var(--err); }
.badge.gray { background: #f0f2f6; color: var(--gray); }

/* 表单 */
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: #5a6675; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
  font-size: 14px; background: #fff; color: #2b3444; outline: none;
  font-family: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue); }
.field textarea { min-height: 76px; resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 40px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; color: #2b3444; font-size: 14px; cursor: pointer; font-family: inherit;
}
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:active { background: var(--blue-d); }
.btn.danger { background: #fff; border-color: #f0b8b2; color: var(--err); }
.btn.ghost { border-color: transparent; background: #f4f6fa; color: #5a6675; }
.btn.block { width: 100%; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12px; border-radius: 6px; }
.btn[disabled] { opacity: .5; }
.btn-row { display: flex; gap: 10px; margin-top: 12px; }
.btn-row .btn { flex: 1; }

/* 详情 KV */
.kv { display: grid; grid-template-columns: 88px 1fr; gap: 8px 10px; font-size: 13px; }
.kv .k { color: var(--gray); }
.kv .v { color: #2b3444; word-break: break-all; }

/* 明细表 */
.mini-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.mini-table th, .mini-table td { padding: 7px 6px; border-bottom: 1px solid #f0f2f6; text-align: left; }
.mini-table th { color: var(--gray); font-weight: 500; background: #fafbfd; }
.mini-table .num { text-align: right; }

/* 时间线 */
.tl { position: relative; padding-left: 22px; }
.tl::before { content: ''; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-item { position: relative; margin-bottom: 14px; font-size: 13px; }
.tl-item::before { content: ''; position: absolute; left: -21px; top: 3px; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 2px #dbe6fb; }

/* 图片 */
.up-cell { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.img-box { position: relative; width: 100%; padding-top: 100%; border-radius: 8px; overflow: hidden; background: #f4f6fa; }
.img-box img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.upload-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 1px dashed #c9d4e5; border-radius: 8px; color: var(--gray); font-size: 12px;
  height: 96px; background: #fbfcfe;
}
.upload-tile span:first-child { font-size: 24px; line-height: 1; margin-bottom: 6px; color: #a9b5c7; }

/* 底部导航 */
.h5-tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; background: #fff; border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.h5-tabbar a {
  flex: 1; text-align: center; padding: 8px 0 6px; font-size: 12px; color: var(--gray);
}
.h5-tabbar a .ico { display: block; font-size: 20px; line-height: 1.3; }
.h5-tabbar a.active { color: var(--blue); font-weight: 600; }

/* 空态 / toast */
.empty { text-align: center; color: var(--gray); font-size: 13px; padding: 28px 0; }
.toast {
  position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%) translateY(10px);
  background: rgba(35, 44, 58, .92); color: #fff; font-size: 13px; padding: 10px 18px; border-radius: 8px;
  opacity: 0; pointer-events: none; transition: all .22s; max-width: 80vw; z-index: 99;
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: rgba(196, 60, 48, .95); }

/* 登录 */
.login-wrap { min-height: 100vh; background: linear-gradient(160deg, #1a5fd0 0%, #4d8df0 45%, #f2f4f8 45.1%); padding: 56px 20px 20px; }
.login-logo { text-align: center; color: #fff; margin-bottom: 24px; }
.login-logo h1 { font-size: 22px; margin: 0 0 6px; letter-spacing: 1px; }
.login-logo p { font-size: 12px; opacity: .85; margin: 0; }
.login-card { background: #fff; border-radius: 14px; padding: 20px; box-shadow: 0 8px 30px rgba(20, 58, 120, .18); }
.login-tabs { display: flex; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.login-tabs div { flex: 1; text-align: center; padding: 8px 0; font-size: 13px; color: var(--gray); cursor: pointer; }
.login-tabs div.active { color: var(--blue); font-weight: 600; border-bottom: 2px solid var(--blue); }
.login-tip { font-size: 12px; color: var(--gray); margin-top: 12px; line-height: 1.7; }

/* 首页快捷入口 */
.grid-entry { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; text-align: center; }
.grid-entry a { padding: 10px 2px; color: #3b4657; font-size: 12px; }
.grid-entry a .ico { display: block; font-size: 22px; margin-bottom: 6px; }

/* 步骤条 */
.steps { display: flex; flex-wrap: wrap; gap: 6px; }
.step { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--gray); background: #f4f6fa; border-radius: 12px; padding: 4px 8px; }
.step .dot { width: 6px; height: 6px; border-radius: 50%; background: #c9d4e5; }
.step.done { color: var(--blue); background: #eaf1fe; }
.step.done .dot { background: var(--blue); }

.hint { color: var(--gray); font-size: 12px; line-height: 1.7; }
.section-title { font-size: 14px; font-weight: 600; margin: 14px 0 8px; display: flex; justify-content: space-between; align-items: center; }
