/* ============================================================
   南虹企业管理系统 · 移动端
   设计系统：酒红 + 暖白卡片，为拇指操作设计
   ============================================================ */

:root {
  --brand: #7C1424;
  --brand-2: #9A1B2C;
  --brand-3: #B22C3D;
  --accent: #D0303F;
  --accent-2: #EE6C76;
  --accent-soft: #FDECEE;
  --mint: #0FA97D;
  --mint-soft: #E6F7F1;
  --amber: #E08A2E;
  --amber-soft: #FDF2E4;
  --red: #B7261F;
  --red-soft: #FCEBE9;
  --violet: #A63D6B;
  --violet-soft: #FBEAF1;

  --bg: #FAF5F5;
  --card: #FFFFFF;
  --ink: #241A1C;
  --ink-2: #6E6063;
  --ink-3: #9C8E91;
  --line: #EFE4E5;

  --r-lg: 20px;
  --r-md: 16px;
  --r-sm: 12px;

  --shadow-card: 0 1px 2px rgba(58,16,19,.04), 0 10px 26px -18px rgba(58,16,19,.35);
  --shadow-float: 0 12px 30px -8px rgba(89,18,24,.35);
  --tab-h: 58px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC",
               "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

body { display: flex; flex-direction: column; }

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { border: none; background: none; padding: 0; cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
input, textarea, select { outline: none; }
::selection { background: #F8D6DA; }

/* ---------- 框架 ---------- */
#app { flex: 1; display: flex; flex-direction: column; min-height: 0; position: relative; }

#view {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--tab-h) + 34px + env(safe-area-inset-bottom));
  scroll-behavior: smooth;
}
#view.no-tab { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
#view::-webkit-scrollbar { display: none; }

.page { animation: pageIn .26s cubic-bezier(.22,.8,.3,1); }
@keyframes pageIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

.wrap { padding: 0 16px; }
.stack > * + * { margin-top: 12px; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }

/* ---------- 状态栏（仅手机框内显示） ---------- */
.statusbar {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 26px 0 30px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .2px;
  color: var(--ink);
  flex: none;
  background: transparent;
  position: relative;
  z-index: 30;
}
.statusbar .sb-right { display: flex; align-items: center; gap: 5px; }
.statusbar svg { display: block; }

/* ---------- 顶部（根页面） ---------- */
.topbar {
  padding: 6px 16px 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.topbar .hello { font-size: 13px; color: var(--ink-3); letter-spacing: .3px; }
.topbar .who {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.4px;
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar .who .badge-role {
  font-size: 10px;
  font-weight: 600;
  color: var(--brand-2);
  background: #F7E9EA;
  border-radius: 6px;
  padding: 3px 6px;
  letter-spacing: .2px;
  transform: translateY(1px);
}
.topbar-acts { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 38px; height: 38px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
  display: grid; place-items: center;
  color: var(--ink-2);
  position: relative;
  transition: transform .16s, background .16s;
}
.icon-btn:active { transform: scale(.94); background: #FBF4F4; }
.icon-btn .dot {
  position: absolute; top: 8px; right: 9px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--red);
  border: 1.5px solid #fff;
}
.avatar {
  width: 40px; height: 40px; border-radius: 14px;
  background: linear-gradient(140deg, #96202F, #7C1424);
  color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: 15px; letter-spacing: .5px;
  box-shadow: 0 6px 14px -6px rgba(89,18,24,.6);
}

/* ---------- 子页面导航栏 ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 52px;
  padding: 0 10px 0 6px;
  background: rgba(242, 245, 249, .92);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
}
.navbar .back {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center; color: var(--ink);
}
.navbar .back:active { background: rgba(41,16,18,.06); }
.navbar .ntitle {
  flex: 1;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.navbar .naction {
  font-size: 14px; color: var(--accent); font-weight: 500;
  padding: 6px 10px; border-radius: 10px;
}
.navbar .naction:active { background: var(--accent-soft); }
.navbar .icon-btn { width: 36px; height: 36px; border-radius: 11px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border-radius: var(--r-md);
  padding: 16px;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(41,16,18,.035);
}
.card.tight { padding: 4px 0; }
.card.flat { box-shadow: none; border: 1px solid var(--line); }
.card-title {
  font-size: 15px; font-weight: 650; letter-spacing: -.2px;
  display: flex; align-items: center; justify-content: space-between;
  margin: 0 0 12px;
}
.card-title .more { font-size: 13px; color: var(--ink-3); font-weight: 500; display:flex; align-items:center; gap:2px; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 20px 4px 10px;
}
.section-head h3 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -.3px; }
.section-head .more { font-size: 13px; color: var(--ink-3); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  border-radius: 22px;
  padding: 18px 18px 16px;
  color: #fff;
  background: linear-gradient(135deg, #7C1424 0%, #8E1B2E 55%, #AE2D3C 100%);
  overflow: hidden;
  box-shadow: 0 16px 34px -18px rgba(89,18,24,.85);
}
.hero::before {
  content: "";
  position: absolute; width: 220px; height: 220px; border-radius: 50%;
  right: -90px; top: -120px;
  background: radial-gradient(circle, rgba(249,102,111,.45), rgba(249,102,111,0) 68%);
}
.hero::after {
  content: "";
  position: absolute; width: 160px; height: 160px; border-radius: 50%;
  left: -70px; bottom: -110px;
  background: radial-gradient(circle, rgba(60, 220, 190, .28), rgba(60, 220, 190, 0) 70%);
}
.hero-top { display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 1; }
.hero-top .lbl { font-size: 12.5px; color: rgba(255,255,255,.72); letter-spacing: .6px; }
.hero-top .pill {
  font-size: 11px; padding: 3px 9px; border-radius: 999px;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.18);
  color: #FEF2F3;
}
.hero-main {
  position: relative; z-index: 1;
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-top: 8px; gap: 10px;
}
.hero-main .big { font-size: 40px; font-weight: 750; line-height: 1; letter-spacing: -1.5px; }
.hero-main .big small { font-size: 15px; font-weight: 600; letter-spacing: 0; margin-left: 4px; opacity: .85; }
.hero-main .sub { font-size: 12.5px; color: rgba(255,255,255,.7); margin-top: 8px; }
.hero-cta {
  display: inline-flex; align-items: center; gap: 4px;
  background: #fff; color: var(--brand);
  font-size: 13px; font-weight: 650;
  padding: 9px 14px; border-radius: 999px;
  box-shadow: 0 6px 16px -6px rgba(0,0,0,.4);
  transition: transform .16s;
}
.hero-cta:active { transform: scale(.96); }
.hero-split { display: flex; gap: 18px; margin-top: 14px; position: relative; z-index: 1; }
.hero-split div { font-size: 12px; color: rgba(255,255,255,.7); }
.hero-split b { display: block; font-size: 16px; color: #fff; font-weight: 650; margin-top: 2px; letter-spacing: -.3px; }

/* ---------- KPI ---------- */
.kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kpi {
  background: #fff; border-radius: var(--r-md); padding: 14px;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(41,16,18,.035);
  position: relative; overflow: hidden;
  transition: transform .16s;
}
.kpi:active { transform: scale(.98); }
.kpi .k-lbl { font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 5px; }
.kpi .k-val {
  font-size: 22px; font-weight: 720; letter-spacing: -.8px; margin-top: 6px;
  font-variant-numeric: tabular-nums;
}
.kpi .k-val small { font-size: 12px; font-weight: 600; color: var(--ink-3); letter-spacing: 0; margin-left: 2px; }
.kpi .k-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; display: flex; align-items: center; gap: 4px; }
.trend-up { color: var(--red); }   /* 中式：涨为红 */
.trend-down { color: var(--mint); }
.kpi .k-ico {
  position: absolute; right: 10px; top: 10px;
  width: 28px; height: 28px; border-radius: 9px;
  display: grid; place-items: center;
}

/* ---------- 快捷入口 ---------- */
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.quick {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 12px 2px 8px; border-radius: 14px;
  transition: background .16s, transform .16s;
}
.quick:active { background: #FBF4F4; transform: scale(.96); }
.quick .qi {
  width: 46px; height: 46px; border-radius: 15px;
  display: grid; place-items: center;
  color: #fff;
  box-shadow: 0 8px 16px -10px rgba(89,18,24,.7);
}
.quick span { font-size: 11.5px; color: var(--ink-2); letter-spacing: -.1px; }

/* ---------- 列表行 ---------- */
.list { background: #fff; border-radius: var(--r-md); box-shadow: var(--shadow-card); overflow: hidden; border: 1px solid rgba(41,16,18,.035); }
.row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 14px;
  position: relative;
  transition: background .14s;
}
.row + .row::before {
  content: ""; position: absolute; left: 14px; right: 0; top: 0; height: 1px;
  background: var(--line);
}
.row:active { background: #FBF4F4; }
.row .ri {
  width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center; flex: none;
}
.row .rb { flex: 1; min-width: 0; }
.row .rt { font-size: 14.5px; font-weight: 550; letter-spacing: -.1px; display:flex; align-items:center; gap:6px; }
.row .rs { font-size: 12px; color: var(--ink-3); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .rv { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.row .chev { color: #C7B9BC; flex: none; display: grid; place-items: center; }
.row .rbadge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--red); color: #fff; font-size: 11px; font-weight: 700;
  display: grid; place-items: center;
}

/* ---------- 标签 / 状态 ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; font-weight: 600; padding: 2.5px 7px; border-radius: 6px;
  letter-spacing: .1px; white-space: nowrap;
}
.tag-gray { background: #F9F4F4; color: #7D6E71; }
.tag-blue { background: var(--accent-soft); color: #A81F31; }
.tag-green { background: var(--mint-soft); color: #0A8663; }
.tag-amber { background: var(--amber-soft); color: #A9631A; }
.tag-red { background: var(--red-soft); color: #B93B36; }
.tag-violet { background: var(--violet-soft); color: #8E2F57; }

/* ---------- 分段 / chips ---------- */
.chips {
  display: flex; gap: 8px; overflow-x: auto;
  padding: 2px 16px 12px; margin: 0 -16px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  padding: 7px 13px; border-radius: 999px;
  background: #fff; border: 1px solid var(--line);
  font-size: 13px; color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 5px;
  transition: all .16s;
}
.chip:active { transform: scale(.96); }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; box-shadow: 0 6px 14px -8px rgba(89,18,24,.8); }
.chip .n { font-size: 11px; opacity: .7; font-variant-numeric: tabular-nums; }

.seg {
  display: flex; background: #EFE4E5; border-radius: 11px; padding: 3px; gap: 2px;
}
.seg button {
  flex: 1; padding: 7px 0; border-radius: 9px; font-size: 13px; color: var(--ink-2);
  transition: all .18s;
}
.seg button.on { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 2px 6px rgba(41,16,18,.08); }

/* ---------- 搜索 ---------- */
.search {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--line);
  border-radius: 13px; padding: 0 12px; height: 42px;
  color: var(--ink-3);
}
.search input {
  flex: 1; border: none; background: transparent; height: 100%;
  font-size: 14px; color: var(--ink);
}
.search input::placeholder { color: #AFA1A4; }

.searchbar-wrap { padding: 4px 16px 10px; }
.searchbar-wrap .search { box-shadow: 0 2px 8px -6px rgba(41,16,18,.4); }

/* ---------- 业务卡片（采购/代发） ---------- */
.biz {
  background: #fff; border-radius: var(--r-md); padding: 14px;
  box-shadow: var(--shadow-card); border: 1px solid rgba(41,16,18,.035);
  transition: transform .16s;
}
.biz:active { transform: scale(.988); }
.biz-top { display: flex; align-items: center; gap: 8px; }
.biz-no { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; letter-spacing: .1px; }
.biz-top .tag { margin-left: auto; }
.biz-main { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-top: 9px; }
.biz-name { font-size: 15.5px; font-weight: 650; letter-spacing: -.2px; line-height: 1.35; }
.biz-meta { font-size: 12px; color: var(--ink-3); margin-top: 5px; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.biz-amt { text-align: right; flex: none; }
.biz-amt b { font-size: 17px; font-weight: 720; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.biz-amt span { display: block; font-size: 11px; color: var(--ink-3); margin-top: 1px; }
.biz-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 11px; padding-top: 10px; border-top: 1px dashed #F8F1F2;
  font-size: 12px; color: var(--ink-3);
}
.biz-foot .who { display: flex; align-items: center; gap: 6px; }
.mini-av {
  width: 20px; height: 20px; border-radius: 7px; background: #F6EDED;
  color: var(--brand-2); font-size: 10px; font-weight: 700;
  display: grid; place-items: center;
}

/* ---------- 详情 ---------- */
.detail-hero {
  padding: 4px 16px 0;
}
.detail-hero h1 { font-size: 21px; font-weight: 720; letter-spacing: -.5px; margin: 0; line-height: 1.3; }
.detail-hero .dmeta { font-size: 12.5px; color: var(--ink-3); margin-top: 6px; display: flex; gap: 10px; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: 88px 1fr; gap: 11px 12px; font-size: 14px; }
.kv dt { color: var(--ink-3); font-size: 13px; }
.kv dd { margin: 0; text-align: right; color: var(--ink); font-weight: 500; word-break: break-all; }
.kv dd.num { font-variant-numeric: tabular-nums; font-weight: 650; }
.kv.two { grid-template-columns: 76px 1fr 76px 1fr; }
.kv.two dd { text-align: left; }

/* 时间线 */
.timeline { display: flex; align-items: flex-start; gap: 0; margin: 4px 0 2px; }
.tl-step { flex: 1; text-align: center; position: relative; }
.tl-dot {
  width: 22px; height: 22px; border-radius: 50%; margin: 0 auto 7px;
  display: grid; place-items: center;
  background: #F0E5E6; color: #AC9EA1; font-size: 11px; font-weight: 700;
  position: relative; z-index: 2;
}
.tl-step.done .tl-dot { background: var(--brand); color: #fff; }
.tl-step.cur .tl-dot { background: #fff; color: var(--accent); border: 2px solid var(--accent); box-shadow: 0 0 0 4px rgba(247,61,67,.12); }
.tl-step::before {
  content: ""; position: absolute; top: 10px; left: -50%; width: 100%; height: 2px;
  background: #F0E5E6; z-index: 1;
}
.tl-step:first-child::before { display: none; }
.tl-step.done::before, .tl-step.cur::before { background: #E6BFC2; }
.tl-lab { font-size: 11.5px; color: var(--ink-2); }
.tl-step.done .tl-lab { color: var(--brand); font-weight: 600; }
.tl-step.cur .tl-lab { color: var(--accent); font-weight: 650; }
.tl-sub { font-size: 10px; color: var(--ink-3); margin-top: 2px; }

/* ---------- 表单 ---------- */
.form-card { padding: 4px 16px; }
.field { padding: 11px 0; }
.field + .field { border-top: 1px solid #FAF5F5; }
.field > label {
  display: block; font-size: 12.5px; color: var(--ink-3); margin-bottom: 7px; letter-spacing: .1px;
}
.field .hint { font-size: 11.5px; color: var(--ink-3); margin-top: 6px; }
.inp, .sel, textarea.inp {
  width: 100%; height: 44px; border-radius: 12px;
  border: 1px solid #EEE3E4; background: #FAF5F5;
  padding: 0 12px; font-size: 15px; color: var(--ink);
  transition: border-color .18s, background .18s, box-shadow .18s;
}
textarea.inp { height: auto; min-height: 84px; padding: 11px 12px; line-height: 1.55; resize: vertical; }
.inp:focus, .sel:focus, textarea.inp:focus {
  border-color: var(--accent); background: #fff;
  box-shadow: 0 0 0 3.5px rgba(247,61,67,.10);
}
.inp:disabled, .inp[readonly] { color: var(--ink-2); background: #FAF4F5; }
.inp::placeholder { color: #B2A4A7; }
.sel {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2393A2AF' stroke-width='2.5' stroke-linecap='round'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right 13px center;
  padding-right: 34px;
}
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.inline-pick {
  display: flex; align-items: center; justify-content: space-between;
  height: 44px; padding: 0 12px; border-radius: 12px;
  background: #FAF5F5; border: 1px solid #EEE3E4; font-size: 15px;
}
.inline-pick.empty { color: #B2A4A7; }
.stepper { display: flex; align-items: center; gap: 0; }
.stepper button {
  width: 40px; height: 44px; background: #FBF4F4; color: var(--ink-2);
  display: grid; place-items: center; font-size: 20px;
}
.stepper button:first-child { border-radius: 12px 0 0 12px; }
.stepper button:last-child { border-radius: 0 12px 12px 0; }
.stepper input { text-align: center; border-radius: 0; border-left: none; border-right: none; }

.form-section-title {
  font-size: 12px; font-weight: 700; color: var(--ink-3);
  letter-spacing: 1.2px; text-transform: uppercase;
  padding: 20px 4px 8px;
}

.btn {
  height: 47px; border-radius: 14px; font-size: 15px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: transform .16s, opacity .16s;
  width: 100%;
}
.btn:active { transform: scale(.98); opacity: .9; }
.btn-primary {
  background: linear-gradient(135deg, #9A1B2C, #7C1424);
  color: #fff; box-shadow: 0 10px 22px -12px rgba(89,18,24,.9);
}
.btn-accent { background: var(--accent); color: #fff; box-shadow: 0 10px 22px -12px rgba(247,61,67,.9); }
.btn-ghost { background: #fff; border: 1px solid var(--line); color: var(--ink); }
.btn-soft { background: var(--accent-soft); color: #A81F31; }
.btn-danger {
  background: #fff; color: #B7261F;
  border: 1.5px solid rgba(183, 38, 31, .38);
}
.btn-sm { height: 38px; border-radius: 11px; font-size: 13.5px; }
.btn-row { display: flex; gap: 10px; }
.btn[disabled] { opacity: .45; }

/* 底部固定操作条 */
.actionbar {
  position: sticky; bottom: 0;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 62%, rgba(242,245,249,0));
  display: flex; gap: 10px;
  z-index: 20;
}
.actionbar .btn { flex: 1; }

/* ---------- FAB ---------- */
.fab {
  position: absolute; right: 18px;
  bottom: calc(var(--tab-h) + 22px + env(safe-area-inset-bottom));
  width: 54px; height: 54px; border-radius: 19px;
  background: linear-gradient(135deg, #96202F, #7C1424);
  color: #fff; display: grid; place-items: center;
  box-shadow: var(--shadow-float);
  z-index: 25;
  transition: transform .16s;
}
.fab:active { transform: scale(.93); }
.fab.no-tab { bottom: calc(24px + env(safe-area-inset-bottom)); }

/* ---------- 底部标签栏 ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0;
  height: calc(var(--tab-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: flex;
  background: rgba(255,255,255,.94);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-top: 1px solid rgba(41,16,18,.07);
  z-index: 50;
}
.tabbar.hidden { display: none; }
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: #A39598; font-size: 10.5px; position: relative;
  transition: color .18s;
}
.tab svg { transition: transform .2s; }
.tab.on { color: var(--brand); font-weight: 650; }
.tab.on svg { transform: translateY(-1px); }
.tab .tb-badge {
  position: absolute; top: 8px; left: 50%; margin-left: 7px;
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px;
  background: var(--red); color: #fff; font-size: 10px; font-weight: 700;
  display: grid; place-items: center; border: 1.5px solid #fff;
}

/* ---------- 空状态 ---------- */
.empty {
  text-align: center; padding: 46px 20px; color: var(--ink-3);
}
.empty .eico {
  width: 62px; height: 62px; border-radius: 22px; margin: 0 auto 14px;
  background: #F9F2F2; display: grid; place-items: center; color: #B5A7AA;
}
.empty p { margin: 0; font-size: 13.5px; }
.empty .sub { font-size: 12px; margin-top: 5px; color: #B9ABAE; }

/* ---------- 底部弹层 ---------- */
.sheet-mask {
  position: fixed; inset: 0; background: rgba(37,11,13,.42);
  z-index: 90; opacity: 0; transition: opacity .22s;
  backdrop-filter: blur(2px);
}
.sheet-mask.show { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 91;
  background: #fff; border-radius: 24px 24px 0 0;
  max-height: 86%; display: flex; flex-direction: column;
  transform: translateY(102%); transition: transform .3s cubic-bezier(.22,.9,.32,1);
  box-shadow: 0 -18px 50px -20px rgba(37,11,13,.5);
}
.sheet.show { transform: translateY(0); }
.sheet-grab { width: 38px; height: 4.5px; border-radius: 3px; background: #E6DADB; margin: 9px auto 0; }
.sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px 12px;
}
.sheet-head h3 { margin: 0; font-size: 16.5px; font-weight: 680; letter-spacing: -.3px; }
.sheet-head .x { color: var(--ink-3); width: 32px; height: 32px; display: grid; place-items: center; }
.sheet-body { overflow-y: auto; padding: 0 18px 18px; -webkit-overflow-scrolling: touch; }
.sheet-foot { padding: 10px 18px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + 30px);
  transform: translate(-50%, 12px); opacity: 0;
  background: rgba(41,16,18,.92); color: #fff;
  font-size: 13.5px; padding: 10px 16px; border-radius: 12px;
  z-index: 120; transition: all .24s; pointer-events: none;
  max-width: 82%; text-align: center;
  box-shadow: 0 10px 30px -8px rgba(0,0,0,.5);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 图表 ---------- */
.chart { display: flex; align-items: flex-end; gap: 6px; height: 132px; padding-top: 6px; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; height: 100%; justify-content: flex-end; }
.chart .bar-wrap { width: 100%; flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.chart .bar { width: 46%; max-width: 13px; border-radius: 5px 5px 3px 3px; background: #E8DCDD; min-height: 3px; transition: height .5s cubic-bezier(.22,.8,.3,1); }
.chart .bar.b2 { background: linear-gradient(180deg, #D93A4C, #F497A0); }
.chart .bar.b1 { background: linear-gradient(180deg, #7C1424, #97323B); }
.chart .xlab { font-size: 10px; color: var(--ink-3); }
.chart .col.on .xlab { color: var(--accent); font-weight: 700; }
.legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--ink-2); margin-bottom: 4px; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 3px; margin-right: 5px; }

.progress { height: 6px; border-radius: 4px; background: #F9F2F3; overflow: hidden; }
.progress span { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #D93A4C, #F497A0); transition: width .6s; }

.rank-row { display: flex; align-items: center; gap: 11px; padding: 10px 0; }
.rank-row + .rank-row { border-top: 1px solid #FAF5F5; }
.rank-no {
  width: 22px; height: 22px; border-radius: 7px; flex: none;
  display: grid; place-items: center; font-size: 11px; font-weight: 700;
  background: #F9F4F4; color: #8F8184;
}
.rank-row:nth-child(1) .rank-no { background: #FFF1DC; color: #B8761B; }
.rank-row:nth-child(2) .rank-no { background: #F9F3F3; color: #827376; }
.rank-row:nth-child(3) .rank-no { background: #FBEDE3; color: #A4663B; }
.rank-b { flex: 1; min-width: 0; }
.rank-b .t { font-size: 13.5px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-b .s { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.rank-v { font-size: 13.5px; font-weight: 650; font-variant-numeric: tabular-nums; flex: none; }

/* ---------- 日历 ---------- */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal .wd { text-align: center; font-size: 11px; color: var(--ink-3); padding: 6px 0; }
.cal .day {
  aspect-ratio: 1 / 1.18; border-radius: 11px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px; font-size: 13px;
  color: var(--ink); position: relative;
}
.cal .day.dim { color: #CABBBD; }
.cal .day.today { background: var(--brand); color: #fff; font-weight: 700; box-shadow: 0 6px 14px -8px rgba(89,18,24,.9); }
.cal .day .mk { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
.cal .day.today .mk { background: #fff; }
.cal .day.off { color: #BEB0B3; }
.cal .day .sh { font-size: 9px; color: var(--mint); line-height: 1; }
.cal .day.today .sh { color: #FBD3D7; }
.cal .day.late .mk { background: var(--amber); }
.cal .day.absent .mk { background: var(--red); }

/* ---------- 打卡 ---------- */
.punch-card {
  background: linear-gradient(150deg, #5F161D 0%, #7C1424 60%, #460E13 100%);
  border-radius: 22px; padding: 18px; color: #fff; position: relative; overflow: hidden;
  box-shadow: 0 16px 34px -18px rgba(89,18,24,.9);
}
.punch-card::after {
  content: ""; position: absolute; width: 180px; height: 180px; border-radius: 50%;
  right: -70px; bottom: -100px;
  background: radial-gradient(circle, rgba(248,93,110,.35), rgba(248,93,110,0) 70%);
}
.punch-row { display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 1; }
.punch-time { font-size: 34px; font-weight: 750; letter-spacing: -1.5px; font-variant-numeric: tabular-nums; }
.punch-date { font-size: 12px; color: rgba(255,255,255,.7); margin-top: 2px; }
.punch-btn {
  width: 74px; height: 74px; border-radius: 50%;
  background: #fff; color: var(--brand); font-size: 14px; font-weight: 700;
  display: grid; place-items: center; gap: 1px;
  box-shadow: 0 0 0 6px rgba(255,255,255,.12);
  transition: transform .16s;
}
.punch-btn:active { transform: scale(.94); }
.punch-btn.done { background: rgba(255,255,255,.16); color: #fff; box-shadow: none; border: 1px solid rgba(255,255,255,.25); }
.punch-meta { display: flex; gap: 16px; margin-top: 14px; font-size: 11.5px; color: rgba(255,255,255,.7); position: relative; z-index: 1; }
.punch-meta b { color: #fff; font-weight: 600; }

/* ---------- 工资条 ---------- */
.payslip {
  background: #fff; border-radius: var(--r-md); overflow: hidden; box-shadow: var(--shadow-card);
}
.payslip-top {
  padding: 18px 16px; background: linear-gradient(135deg, #5D131A, #851F28); color: #fff;
}
.payslip-top .pl { font-size: 12px; color: rgba(255,255,255,.72); }
.payslip-top .pv { font-size: 32px; font-weight: 750; letter-spacing: -1.2px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.payslip-top .pv small { font-size: 13px; font-weight: 600; margin-left: 4px; opacity: .8; }
.pline { display: flex; align-items: center; justify-content: space-between; padding: 11px 16px; font-size: 14px; }
.pline + .pline { border-top: 1px solid #FAF5F5; }
.pline .n { color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.pline .v { font-weight: 600; font-variant-numeric: tabular-nums; }
.pline.total { background: #FCF3F3; }
.pline.total .n { color: var(--ink); font-weight: 650; }
.pline.total .v { color: var(--brand); font-size: 16px; font-weight: 720; }

/* ---------- 员工网格 ---------- */
.people-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.person {
  background: #fff; border-radius: 14px; padding: 12px 8px; text-align: center;
  box-shadow: var(--shadow-card); border: 1px solid rgba(41,16,18,.035);
}
.person .pa {
  width: 42px; height: 42px; border-radius: 14px; margin: 0 auto 8px;
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 15px;
  background: linear-gradient(140deg, #A8323E, #8E1B2E);
}
.person .pn { font-size: 13px; font-weight: 600; }
.person .pd { font-size: 10.5px; color: var(--ink-3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- 权限 ---------- */
.perm-group { padding: 4px 0 2px; }
.perm-group h4 { font-size: 12px; color: var(--ink-3); font-weight: 650; letter-spacing: .8px; margin: 14px 4px 8px; text-transform: uppercase; }
.switch {
  width: 44px; height: 26px; border-radius: 999px; background: #E6DADB;
  position: relative; transition: background .2s; flex: none;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.2); transition: transform .2s;
}
.switch.on { background: var(--mint); }
.switch.on::after { transform: translateX(18px); }

/* ---------- 工具 ---------- */
.muted { color: var(--ink-3); }
.tiny { font-size: 11.5px; }
.right { text-align: right; }
.center { text-align: center; }
.flex { display: flex; align-items: center; }
.between { display: flex; align-items: center; justify-content: space-between; }
.gap6 { gap: 6px; } .gap8 { gap: 8px; } .gap10 { gap: 10px; }
.grow { flex: 1; min-width: 0; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; letter-spacing: -.2px; }
.divider { height: 1px; background: var(--line); margin: 12px 0; }
.scroll-x { overflow-x: auto; scrollbar-width: none; }
.scroll-x::-webkit-scrollbar { display: none; }
.hr-label {
  display: flex; align-items: center; gap: 10px; color: var(--ink-3);
  font-size: 11.5px; margin: 18px 4px 8px;
}
.hr-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.link-row { display: flex; align-items: center; gap: 6px; color: var(--accent); font-size: 13px; }

/* ============================================================
   v2 —— 深蓝导航头（对齐确认稿）
   ============================================================ */
:root {
  --navy-1: #6A101D;   /* 头部主色 */
  --navy-0: #560C16;   /* 状态栏/更深 */
  --amber: #E8912D;
  --amber-2: #F5A623;
}
.mhead {
  background: linear-gradient(180deg, var(--navy-0) 0%, var(--navy-1) 100%);
  color: #fff;
  flex: none;
  position: relative;
  z-index: 30;
}
.mhead .statusbar { color: #fff; height: 34px; font-weight: 500; }
.apphead { display: flex; align-items: center; gap: 12px; padding: 6px 16px 16px; }
.apphead .bh { flex: 1; min-width: 0; }
.apphead .brandline { display: flex; align-items: baseline; gap: 9px; }
.apphead .brand-mark {
  font-size: 19px; font-weight: 800; letter-spacing: 3px;
  background: #fff; color: var(--navy-1);
  border-radius: 7px; padding: 1px 6px 2px; line-height: 1.35;
}
.apphead .bt { font-size: 17.5px; font-weight: 700; letter-spacing: .3px; white-space: nowrap; }
.apphead .bs {
  font-size: 11px; color: rgba(255,255,255,.62); margin-top: 3px; letter-spacing: 1.2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.apphead .u { text-align: center; flex: none; }
.apphead .u .un { font-size: 11.5px; font-weight: 600; }
.apphead .u .ud { font-size: 9.5px; color: rgba(255,255,255,.55); margin-top: 1px; }
.apphead .u .uav {
  width: 30px; height: 30px; border-radius: 50%; margin: 4px auto 0;
  background: #fff; color: var(--navy-1);
  display: grid; place-items: center; font-size: 13px; font-weight: 800;
  box-shadow: 0 0 0 2px rgba(255,255,255,.25);
}

/* 子页面头部（同样深蓝） */
.navbar.on-navy {
  background: linear-gradient(180deg, var(--navy-0), var(--navy-1));
  color: #fff;
  height: 56px;
}
.navbar.on-navy .back { color: #fff; }
.navbar.on-navy .back:active { background: rgba(255,255,255,.14); }
.navbar.on-navy .naction { color: #F5B7BC; }
.navbar.on-navy .icon-btn { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.16); color: #fff; }

/* 内容区起始圆角 */
.page-body-below {
  background: var(--bg);
  border-radius: 18px 18px 0 0;
  margin-top: -14px;
  position: relative;
  z-index: 5;
  padding-top: 14px;
}

/* 金额强调 */
.amt-amber { color: var(--amber); }
.amt-red { color: var(--red); }
.big-money { font-size: 30px; font-weight: 750; letter-spacing: -1px; font-variant-numeric: tabular-nums; }

/* 排行榜（深蓝方块 + 进度条） */
.rank-no.navy { background: var(--navy-1); color: #fff; }
.rank-row:nth-child(1) .rank-no.navy { background: var(--navy-0); }
.rank-row:nth-child(2) .rank-no.navy { background: #8E1B2E; }
.rank-row:nth-child(3) .rank-no.navy { background: #A32B3C; }
.progress.navy span { background: linear-gradient(90deg, #8E1B2E, #B8434F); }

/* 待办行图标块 */
.row .ri.char {
  font-size: 15px; font-weight: 750;
}
.ri.c-blue { background: var(--accent-soft); color: #A81F31; }
.ri.c-amber { background: var(--amber-soft); color: #B96F14; }
.ri.c-green { background: var(--mint-soft); color: #0A8663; }
.ri.c-red { background: var(--red-soft); color: #B93B36; }
.ri.c-navy { background: #F5E8E9; color: var(--navy-1); }
.ri.c-violet { background: var(--violet-soft); color: #8E2F57; }

/* 月份切换胶囊 */
.month-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff; border: 1px solid var(--line);
  border-radius: 10px; padding: 7px 12px;
  font-size: 13.5px; font-weight: 650; color: var(--ink);
  box-shadow: 0 2px 8px -4px rgba(58,16,19,.25);
}
.month-pill .car { color: var(--ink-3); width: 26px; height: 26px; margin: -7px -4px; display: grid; place-items: center; border-radius: 8px; }
.month-pill .car:active { background: #FAF5F5; }

/* 详情区块标题 */
.dsec-title { display: flex; align-items: center; gap: 8px; margin: 0 2px 10px; font-size: 15px; font-weight: 700; letter-spacing: -.2px; }
.dsec-title .ic { color: var(--navy-1); }
.dsec-title .more { margin-left: auto; font-size: 12.5px; color: var(--ink-3); font-weight: 500; }

/* 提交成功横幅 */
.ok-banner {
  display: flex; align-items: center; gap: 10px;
  background: var(--mint-soft); color: #0A8663;
  border-radius: 12px; padding: 10px 12px; font-size: 13px; font-weight: 550;
}

/* 快捷入口彩色图标块（白图标 + 品牌色渐变底） */
.quick .qi.c-navy   { background: linear-gradient(135deg, #6A101D, #8A2C36); }
.quick .qi.c-blue   { background: linear-gradient(135deg, #D93A4C, #EE6C76); }
.quick .qi.c-amber  { background: linear-gradient(135deg, #E08A2E, #F0A94F); }
.quick .qi.c-green  { background: linear-gradient(135deg, #0FA97D, #3EC79B); }
.quick .qi.c-violet { background: linear-gradient(135deg, #A63D6B, #9D85FA); }
.quick .qi.c-red    { background: linear-gradient(135deg, #DC4C46, #F07B74); }

/* 头部用户名过长时省略 */
.apphead .u { max-width: 76px; }
.apphead .u .un, .apphead .u .ud {
  display: block; max-width: 76px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.apphead .u .un { margin: 0 auto; }

/* ============================================================
   登录层（企业系统手机版）
   ============================================================ */
body.logged-out #app,
body.logged-out .tabbar { display: none; }

.login-layer {
  position: fixed; inset: 0; z-index: 999;
  display: none;
  flex-direction: column;
  padding: calc(54px + env(safe-area-inset-top)) 22px calc(28px + env(safe-area-inset-bottom));
  background: linear-gradient(160deg, #560C16 0%, #7C1424 52%, #9A1B2C 100%);
  color: #fff;
  overflow-y: auto;
}
.login-layer.show { display: flex; }

.login-top { text-align: center; margin-bottom: 26px; }
.login-brand {
  width: 58px; height: 58px; margin: 0 auto 14px;
  border-radius: 16px; background: #fff; color: #7C1424;
  display: grid; place-items: center;
  font-size: 22px; font-weight: 800; letter-spacing: 1px;
  box-shadow: 0 8px 24px -8px rgba(0,0,0,.5);
}
.login-title { font-size: 20px; font-weight: 700; letter-spacing: 1.5px; }
.login-sub {
  font-size: 10.5px; letter-spacing: 3px; margin-top: 6px;
  color: rgba(255,255,255,.5);
}

.login-card {
  background: #fff; border-radius: 20px; padding: 22px 18px 18px;
  box-shadow: 0 18px 40px -18px rgba(0,0,0,.55);
  color: #241A1C;
}
.login-h { font-size: 15.5px; font-weight: 700; margin-bottom: 16px; }

.fld { display: block; margin-bottom: 14px; }
.fld-lb {
  display: block; font-size: 12px; color: #7D6E71;
  font-weight: 600; margin-bottom: 6px; letter-spacing: .3px;
}
.fld input {
  width: 100%; height: 50px; box-sizing: border-box;
  border: 1px solid #E6DADB; border-radius: 12px;
  background: #FBF7F7; padding: 0 14px;
  font-size: 16px; color: #241A1C;
  outline: none; transition: border-color .15s, background .15s;
  font-family: inherit;
}
.fld input:focus { border-color: #D0303F; background: #fff; }
.fld input::placeholder { color: #B2A4A7; }

.login-err {
  min-height: 18px; font-size: 12.5px; color: #B7261F;
  margin: -4px 2px 8px; font-weight: 500;
}
.login-btn {
  width: 100%; height: 50px; border: 0; border-radius: 12px;
  background: linear-gradient(180deg, #D93A4C, #C02334);
  color: #fff; font-size: 16.5px; font-weight: 700; letter-spacing: 3px;
  font-family: inherit; cursor: pointer;
  box-shadow: 0 8px 18px -8px rgba(208,48,63,.75);
  transition: transform .08s, opacity .15s;
}
.login-btn:active { transform: scale(.985); opacity: .92; }
.login-btn:disabled { opacity: .6; letter-spacing: 1px; }

.login-tip {
  text-align: center; font-size: 11.5px; color: #9C8E91;
  margin-top: 14px; line-height: 1.5;
}
.login-foot {
  margin-top: auto; padding-top: 26px; text-align: center;
  font-size: 11px; color: rgba(255,255,255,.45); letter-spacing: 1px;
}
