:root {
  --primary: #0F5132;
  --primary-2: #176B45;
  --primary-soft: #E8F1EC;
  --gold: #C0912F;
  --gold-soft: #FAF3E2;
  --bg: #F2F5F3;
  --card: #FFFFFF;
  --text: #16241C;
  --muted: #6B7A72;
  --line: #E4EAE6;
  --danger: #B3261E;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(16, 40, 28, .04), 0 8px 24px rgba(16, 40, 28, .06);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body { overflow: hidden; }

#app { height: 100%; display: flex; flex-direction: column; }

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100%;
  display: flex; flex-direction: column;
  background: linear-gradient(165deg, #0F5132 0%, #14603C 45%, #0A3A24 100%);
  padding: 0 24px calc(28px + var(--safe-bottom));
  overflow-y: auto;
}
.login-brand {
  padding: 64px 4px 36px;
  color: #fff;
}
.login-brand .logo {
  width: 54px; height: 54px; border-radius: 16px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .24);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700; color: #F3E4BE; margin-bottom: 18px;
  backdrop-filter: blur(6px);
}
.login-brand h1 { font-size: 25px; margin: 0 0 6px; letter-spacing: .5px; font-weight: 650; }
.login-brand p { margin: 0; color: rgba(255, 255, 255, .62); font-size: 13.5px; letter-spacing: .3px; }
.login-card {
  background: #fff; border-radius: 22px; padding: 26px 20px 22px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .22);
}
.field-label { font-size: 12.5px; color: var(--muted); margin-bottom: 7px; letter-spacing: .3px; }
.input {
  width: 100%; height: 48px; border-radius: 12px;
  border: 1px solid var(--line); background: #F8FAF9;
  padding: 0 14px; font-size: 15px; color: var(--text);
  outline: none; transition: border-color .18s, background .18s, box-shadow .18s;
  font-family: inherit;
}
.input:focus { border-color: var(--primary-2); background: #fff; box-shadow: 0 0 0 3px rgba(23, 107, 69, .1); }
.input + .field-label, .field-gap { margin-top: 16px; }

.btn {
  height: 48px; width: 100%; border: 0; border-radius: 12px;
  font-size: 16px; font-weight: 600; font-family: inherit;
  background: var(--primary); color: #fff; cursor: pointer;
  transition: transform .12s, opacity .18s;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn:active { transform: scale(.985); }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn.ghost { background: var(--primary-soft); color: var(--primary); }
.btn.outline { background: #fff; color: var(--primary); border: 1px solid var(--line); }
.btn.sm { height: 36px; font-size: 13.5px; width: auto; padding: 0 14px; border-radius: 10px; flex: 0 0 auto; white-space: nowrap; }
.btn.danger { background: #FBEAE9; color: var(--danger); }
.btn-row { display: flex; gap: 10px; }

.login-tip {
  display: none;
}

/* ---------- 顶部 ---------- */
.topbar {
  padding: calc(14px + env(safe-area-inset-top, 0px)) 18px 14px;
  background: linear-gradient(160deg, #10573A 0%, #0F5132 55%, #14603C 100%);
  color: #fff;
  position: relative;
}
.topbar .row1 { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.topbar h2 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: .3px; }
.topbar .sub { font-size: 12.5px; color: rgba(255, 255, 255, .62); margin-top: 3px; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .22);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600; color: #F3E4BE;
}
.role-pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; padding: 2px 8px; border-radius: 20px;
  background: rgba(255, 255, 255, .16); color: #F7EED6; margin-left: 6px;
  vertical-align: middle;
}

/* ---------- 内容区 ---------- */
.content {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding: 0 16px calc(84px + var(--safe-bottom));
}
.content.pull { padding-top: 14px; }

/* 顶部加载进度条：切页时有即时反馈，不必盯着空白等接口 */
#prog {
  position: fixed; top: 0; left: 0; height: 2.5px; width: 0;
  background: linear-gradient(90deg, #C0912F, #E8C87E);
  z-index: 90; opacity: 0; pointer-events: none;
  transition: width .35s cubic-bezier(.2, .8, .3, 1), opacity .25s;
  box-shadow: 0 0 6px rgba(192, 145, 47, .5);
}
#prog.on { opacity: 1; }
#prog.done { opacity: 0; transition: opacity .2s; }

/* 骨架屏：接口未回来时先占位，避免白屏跳动 */
.sk { padding: 16px; }
.sk i {
  display: block; height: 14px; border-radius: 7px; margin-bottom: 12px;
  background: linear-gradient(90deg, #EDF2EF 25%, #E3EAE5 37%, #EDF2EF 63%);
  background-size: 400% 100%;
  animation: sk-shine 1.1s ease-in-out infinite;
}
.sk i:nth-child(1) { height: 74px; border-radius: 14px; }
.sk i:nth-child(2) { width: 72%; }
.sk i:nth-child(3) { width: 46%; margin-bottom: 0; }
@keyframes sk-shine {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px; margin-top: 12px;
}
.card.tight { padding: 14px 14px 6px; }
.card-title {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 14.5px; font-weight: 600; margin-bottom: 12px; letter-spacing: .2px;
}
.card-title .more { font-size: 12.5px; color: var(--muted); font-weight: 400; }
.sec-title {
  font-size: 13px; color: var(--muted); margin: 18px 4px 8px;
  letter-spacing: .4px; display: flex; align-items: center; gap: 6px;
}
.sec-title::before { content: ''; width: 3px; height: 12px; border-radius: 2px; background: var(--gold); }

/* KPI */
.kpi-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.kpi-grid.three { grid-template-columns: repeat(3, 1fr); }
.kpi {
  background: #fff; border-radius: 14px; padding: 13px 14px;
  box-shadow: var(--shadow);
}
.kpi .k-label { font-size: 12px; color: var(--muted); letter-spacing: .2px; }
.kpi .k-value { font-size: 23px; font-weight: 650; margin-top: 4px; letter-spacing: -.4px; font-variant-numeric: tabular-nums; }
.kpi .k-value small { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.kpi .k-foot { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.kpi.accent { background: linear-gradient(150deg, #12583A, #0C4128); color: #fff; }
.kpi.accent .k-label, .kpi.accent .k-foot, .kpi.accent .k-value small { color: rgba(255, 255, 255, .66); }
.kpi.gold { background: linear-gradient(150deg, #F7EDD4, #FAF6EC); }
.kpi.gold .k-value { color: #8A6516; }

/* 快捷入口 */
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.quick {
  background: #fff; border-radius: 14px; padding: 13px 6px 11px; text-align: center;
  box-shadow: var(--shadow); border: 0; font-family: inherit; color: var(--text);
  cursor: pointer;
}
.quick .qi {
  width: 34px; height: 34px; border-radius: 11px; margin: 0 auto 7px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: var(--primary);
}
.quick .qi svg { width: 18px; height: 18px; }
.quick span { font-size: 11.5px; color: #3C4A42; }
.quick.gold .qi { background: var(--gold-soft); color: #9A7420; }

/* 列表项 */
.rec {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 12px 0; border-bottom: 1px solid #F0F3F1;
}
.rec:last-child { border-bottom: 0; }
.rec .lv {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 700; letter-spacing: -.3px;
}
.lv.A { background: #FDECEC; color: #C0342C; }
.lv.B { background: #FBF1DC; color: #A57A18; }
.lv.C { background: #E9F2EE; color: #1B6A47; }
.lv.D { background: #EEF1F0; color: #6B7A72; }
.rec .main { flex: 1; min-width: 0; }
.rec .n1 { display: flex; align-items: baseline; gap: 8px; }
.rec .name { font-size: 14.5px; font-weight: 600; }
.rec .phone { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rec .n2 { font-size: 12px; color: var(--muted); margin-top: 3px; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.rec .date { font-size: 11.5px; color: #9AA7A0; margin-top: 4px; }
.rec .arrow { color: #C6D0CA; align-self: center; font-size: 16px; }
.chip-tag {
  display: inline-block; font-size: 10.5px; padding: 1px 7px; border-radius: 6px;
  background: #F1F4F2; color: #5C6B63; line-height: 1.6;
}
.chip-tag.ok { background: #E9F2EE; color: #1B6A47; }
.chip-tag.warn { background: #FBF1DC; color: #92690F; }
.chip-tag.gold { background: var(--gold-soft); color: #8A6516; }
.chip-tag.deal { background: #0F5132; color: #F3E4BE; }

/* 成交横幅 */
.deal-banner {
  display: flex; align-items: baseline; gap: 8px;
  background: linear-gradient(120deg, #0F5132, #176A45);
  color: #F3E4BE; border-radius: 11px; padding: 9px 12px; margin-bottom: 10px;
  font-size: 12px;
}
.deal-banner b { font-size: 13px; letter-spacing: .5px; }
.deal-banner span { color: rgba(243, 228, 190, .8); }

/* 分段选择 */
.seg { display: flex; background: #F1F4F2; border-radius: 11px; padding: 3px; gap: 2px; }
.seg button {
  flex: 1; height: 34px; border: 0; border-radius: 9px; background: transparent;
  font-size: 13px; color: #5C6B63; font-family: inherit; cursor: pointer;
  transition: all .15s; white-space: nowrap;
}
.seg button.on { background: #fff; color: var(--primary); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }

/* 选项 chips（表单） */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line); background: #F8FAF9; color: #3C4A42;
  border-radius: 10px; padding: 8px 12px; font-size: 13px;
  font-family: inherit; cursor: pointer; transition: all .14s;
}
.chip.on {
  background: var(--primary-soft); border-color: #7FB39A; color: var(--primary);
  font-weight: 600;
}
.chip.gold.on { background: var(--gold-soft); border-color: #DCC084; color: #8A6516; }

/* 表单 */
.form-group { padding: 14px 0 4px; border-bottom: 1px solid #F0F3F1; }
.form-group:last-child { border-bottom: 0; }
.form-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.form-row .lbl { font-size: 14px; color: #3C4A42; flex: 0 0 auto; }
.form-row .lbl i { color: var(--danger); font-style: normal; margin-left: 2px; }
.form-control { flex: 1; min-width: 0; text-align: right; }
.form-control .input { height: 40px; text-align: left; font-size: 14px; background: #fff; border-color: transparent; }
.form-control .input:focus { border-color: var(--primary-2); }
.form-control select.input, .filter-bar select.input, select.input {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.8 6 7.8l3-3' fill='none' stroke='%238A968F' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px 12px;
  padding-right: 28px;
}
.col { padding: 10px 0 12px; }
.col .lbl { font-size: 13.5px; color: #3C4A42; margin-bottom: 8px; display: block; }

/* 底部导航 */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0;
  display: flex; background: #FFFFFF;
  border-top: 1px solid var(--line);
  padding: 6px 4px calc(6px + var(--safe-bottom));
  z-index: 40;
  /* 不用 backdrop-filter：安卓低端机滚动时毛玻璃会持续重绘，明显掉帧 */
}
.tabbar button {
  flex: 1; border: 0; background: transparent; font-family: inherit;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 4px 0; color: #93A19A; font-size: 10.5px; cursor: pointer;
}
.tabbar button svg { width: 22px; height: 22px; stroke-width: 1.7; }
.tabbar button.on { color: var(--primary); font-weight: 600; }
.tabbar .fab {
  flex: 0 0 58px; justify-content: center;
}
.tabbar .fab .circle {
  width: 48px; height: 48px; border-radius: 16px; margin-top: -18px;
  background: linear-gradient(150deg, #176B45, #0F5132); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 18px rgba(15, 81, 50, .3);
}
.tabbar .fab .circle svg { width: 24px; height: 24px; stroke-width: 2.2; }
.tabbar .fab span { margin-top: 2px; }

/* 图表 */
.chart { width: 100%; display: block; }
.legend { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: 10px; }
.legend .li { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #55655C; }
.legend .dot { width: 8px; height: 8px; border-radius: 3px; }

.hbar { display: flex; flex-direction: column; gap: 10px; }
.hbar .row { font-size: 12.5px; }
.hbar .row .t { display: flex; justify-content: space-between; margin-bottom: 4px; color: #3C4A42; }
.hbar .row .t b { font-weight: 600; font-variant-numeric: tabular-nums; }
.hbar .track { height: 8px; border-radius: 5px; background: #F1F4F2; overflow: hidden; }
.hbar .fill { height: 100%; border-radius: 5px; background: linear-gradient(90deg, #2E8B62, #0F5132); transition: width .5s; }
.hbar .fill.gold { background: linear-gradient(90deg, #D9B45F, #C0912F); }

/* 表格 */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; white-space: nowrap; }
table.tbl th, table.tbl td { padding: 8px 6px; text-align: right; border-bottom: 1px solid #F0F3F1; }
table.tbl th:first-child, table.tbl td:first-child { text-align: left; }
table.tbl th { color: var(--muted); font-weight: 500; background: #FAFBFA; font-size: 11.5px; }
table.tbl tr.total td { font-weight: 700; background: #F7FAF8; border-top: 1px solid var(--line); }
table.tbl td.num { font-variant-numeric: tabular-nums; }

/* 空状态 */
.empty { text-align: center; padding: 44px 20px; color: #9AA7A0; font-size: 13.5px; }
.empty .ico { width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 18px; background: #EEF2F0; display: flex; align-items: center; justify-content: center; }
.empty .ico svg { width: 26px; height: 26px; color: #B4C0BA; }

/* Toast / 弹层 */
.toast {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.94);
  background: rgba(20, 32, 26, .92); color: #fff; font-size: 13.5px;
  padding: 11px 18px; border-radius: 12px; z-index: 200;
  opacity: 0; transition: all .2s; pointer-events: none; max-width: 78vw; text-align: center;
}
.toast.on { opacity: 1; transform: translate(-50%, -50%) scale(1); }

.sheet-mask {
  position: fixed; inset: 0; background: rgba(14, 24, 18, .45);
  z-index: 100; display: flex; align-items: flex-end;
  opacity: 0; transition: opacity .2s;
}
.sheet-mask.on { opacity: 1; }
.sheet {
  width: 100%; background: #fff; border-radius: 20px 20px 0 0;
  padding: 18px 18px calc(18px + var(--safe-bottom));
  max-height: 86vh; overflow-y: auto;
  transform: translateY(12px); transition: transform .22s;
}
.sheet-mask.on .sheet { transform: translateY(0); }
.sheet h3 { margin: 0 0 4px; font-size: 16px; }
.sheet .sh-sub { font-size: 12.5px; color: var(--muted); margin-bottom: 14px; }
.sheet .actions { display: flex; gap: 10px; margin-top: 18px; }
/* 长面板：底部按钮常驻，不必滚到最底部 */
.sheet.has-sticky { padding-bottom: 10px; }
.sheet .actions.sticky {
  position: sticky; bottom: 0;
  background: #fff; padding: 12px 0 calc(8px + var(--safe-bottom)); margin-top: 4px;
  border-top: 1px solid #EFF3F0; z-index: 3;
}

.filter-bar { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.filter-bar .input { height: 38px; font-size: 13.5px; }
.filter-bar select.input { flex: 0 0 auto; width: auto; padding-right: 26px; background: #fff; }

/* 已生效筛选标签 */
.fchips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.fchip {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid #CFE0D6; background: var(--primary-soft); color: var(--primary);
  border-radius: 20px; padding: 5px 10px; font-size: 12px; font-family: inherit;
  cursor: pointer; line-height: 1.2; max-width: 100%;
}
.fchip i { font-style: normal; color: #6E9A83; font-size: 13px; line-height: 1; }
.fchip.clear { background: #fff; border-color: var(--line); color: var(--muted); }

/* 筛选面板 */
.fsec { padding: 12px 0; border-bottom: 1px solid #F0F3F1; }
.fsec:last-of-type { border-bottom: 0; }
.fsec-t { font-size: 12.5px; color: var(--muted); margin-bottom: 9px; letter-spacing: .2px; }
.fdate { display: flex; align-items: center; gap: 8px; }
.fdate .input { height: 40px; font-size: 13.5px; flex: 1; min-width: 0; }

.loading-overlay {
  position: fixed; inset: 0; background: rgba(255, 255, 255, .58);
  display: flex; align-items: center; justify-content: center; z-index: 150;
}
.spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2.5px solid #D7E2DC; border-top-color: var(--primary);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.fade-in { animation: fadeIn .25s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.mt8 { margin-top: 8px; } .mt4 { margin-top: 4px; } .mt16 { margin-top: 16px; }
.muted { color: var(--muted); } .tiny { font-size: 12px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.flex { display: flex; align-items: center; gap: 8px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grow { flex: 1; }
.hr { height: 1px; background: #F0F3F1; margin: 12px 0; }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); display: inline-block; }

/* ================= 变更提醒 / 留痕 ================= */
.alert-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border-radius: var(--radius); padding: 14px 16px;
  box-shadow: var(--shadow); margin-top: 12px; cursor: pointer;
  border: 1px solid #EDF1EE;
}
.alert-card.on { border-color: #E7D3A6; background: linear-gradient(135deg, #FFFDF7, #FAF3E2); }
.alert-card .ac-ico {
  position: relative; width: 38px; height: 38px; flex: 0 0 38px; border-radius: 12px;
  background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
}
.alert-card.on .ac-ico { background: #F3E3BB; color: #8A6516; }
.alert-card .ac-ico svg { width: 19px; height: 19px; }
.alert-card .ac-ico .dot {
  position: absolute; top: 7px; right: 7px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--danger); border: 1.5px solid #FFFDF7;
}
.alert-card .ac-t { font-size: 14px; font-weight: 600; display: flex; align-items: baseline; gap: 4px; }
.alert-card .ac-t b { color: var(--danger); font-size: 16px; }
.alert-card .ac-s { font-size: 11.5px; color: var(--muted); margin-top: 3px; line-height: 1.5; }
.alert-card .arrow { color: #C3CDC7; display: flex; }
.alert-card .arrow svg { width: 16px; height: 16px; }

.stat-strip { display: flex; padding: 14px 6px; }
.stat-strip > div { flex: 1; text-align: center; position: relative; }
.stat-strip > div + div::before {
  content: ''; position: absolute; left: 0; top: 4px; bottom: 4px; width: 1px; background: #EFF3F0;
}
.stat-strip b { display: block; font-size: 19px; font-weight: 650; letter-spacing: -.3px; }
.stat-strip b.accent { color: var(--danger); }
.stat-strip span { font-size: 11.5px; color: var(--muted); }

.seg.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.seg.scroll::-webkit-scrollbar { display: none; }
.seg.scroll button { flex: 0 0 auto; white-space: nowrap; padding: 0 10px; }

.badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--danger); color: #fff; font-size: 11px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; line-height: 1;
}
.badge.warn { background: var(--gold); }

.au-item { display: flex; gap: 10px; padding: 13px 0; border-bottom: 1px solid #F2F5F3; }
.au-item:last-child { border-bottom: 0; }
.au-dot {
  width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: 0 0 8px; background: #B9C7BF;
}
.au-dot.ok { background: #2E8B62; }
.au-dot.warn { background: var(--gold); }
.au-dot.danger { background: var(--danger); }
.au-h { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.au-name { font-size: 14px; font-weight: 600; }
.au-tag {
  font-size: 10.5px; padding: 2px 6px; border-radius: 5px; font-weight: 600;
  background: #EFF3F0; color: #5A6B62;
}
.au-tag.ok { background: #E9F2EE; color: #1B6A47; }
.au-tag.warn { background: #FBF1DC; color: #92690F; }
.au-tag.danger { background: #FBEAE8; color: #8A3B36; }
.au-unread { width: 6px; height: 6px; border-radius: 50%; background: var(--danger); display: inline-block; }
.au-sum { font-size: 12.5px; color: #4A5A51; margin-top: 5px; line-height: 1.6; }
.au-chg { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.au-c {
  display: inline-flex; align-items: center; gap: 4px; max-width: 100%;
  background: #F7F9F8; border: 1px solid #EDF1EE; border-radius: 7px;
  padding: 3px 7px; font-size: 11.5px; color: #46564D; line-height: 1.4;
}
.au-c i { font-style: normal; color: var(--muted); }
.au-c em { font-style: normal; color: #A8B5AD; }
.au-c b { font-weight: 600; color: var(--primary); }
.au-c.more { color: var(--muted); background: #fff; }
.au-reason {
  font-size: 11.5px; color: #8A6516; background: #FDF8EC;
  border-radius: 6px; padding: 4px 8px; margin-top: 7px; display: inline-block;
}
.au-foot {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 11px; color: #9AA7A0; margin-top: 8px;
}
.au-link {
  border: 0; background: none; padding: 0; font-family: inherit; font-size: 11.5px;
  color: var(--primary); text-decoration: underline; cursor: pointer;
}
.au-link.danger { color: var(--danger); }

.del-banner {
  background: #FBEAE8; border: 1px solid #F1D5D2; color: #8A3B36;
  border-radius: var(--radius); padding: 14px 16px; margin-top: 12px;
}
.del-banner b { font-size: 14px; }

/* ================= 团队对标（每日更新） ================= */
.bm-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 14px; }
.bm-card { background: #F7FAF8; border: 1px solid var(--line); border-radius: 14px; padding: 12px 12px 10px; }
.bm-card.low { background: #FDF0EF; border-color: #F2CFCB; }
.bm-l { font-size: 12px; color: var(--muted); letter-spacing: .2px; }
.bm-v { font-size: 24px; font-weight: 680; letter-spacing: -.5px; font-variant-numeric: tabular-nums; margin-top: 2px; color: var(--text); }
.bm-v small { font-size: 11.5px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.bm-card.low .bm-v { color: var(--danger); }
.bm-a { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.bm-d { font-style: normal; margin-left: 6px; font-weight: 650; }
.bm-d.up { color: var(--primary-2); }
.bm-d.down { color: var(--danger); }
.bm-warn { font-size: 11px; color: var(--danger); font-weight: 650; margin-top: 7px; background: #FBE3E1; border-radius: 6px; padding: 2px 7px; display: inline-block; }
.bm-ok { font-size: 11px; color: var(--primary-2); margin-top: 7px; display: inline-block; }
.bm-hint { font-size: 12px; color: var(--muted); margin-top: 10px; background: #F4F7F5; border-radius: 10px; padding: 8px 10px; line-height: 1.6; }
.bm-hint.warn { background: #FDF0EF; color: #8C2A22; }
.bm-tbl td.bm-low { color: var(--danger); font-weight: 650; }
.bm-tbl td.bm-high { color: var(--primary-2); font-weight: 600; }
.bm-dot { display: block; font-size: 9px; font-style: normal; font-weight: 600; color: var(--danger); opacity: .9; line-height: 1.25; }
.bm-idle td { font-size: 11.5px; color: var(--muted); background: #FAFBFA; line-height: 1.6; font-weight: 400; }
.bm-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 8px; flex-wrap: wrap; }
.bm-tbl { font-size: 12.5px; table-layout: fixed; width: 100%; }
.bm-tbl th:first-child, .bm-tbl td:first-child { width: 27%; }
.bm-tbl th:not(:first-child), .bm-tbl td:not(:first-child) { width: 18.25%; }
.bm-tbl th, .bm-tbl td { padding: 7px 5px; }
.bm-tbl th:first-child, .bm-tbl td:first-child { padding-left: 6px; }
.bm-tbl th { font-size: 11.5px; font-weight: 600; }

/* ================= 多项目：顶栏项目标识 ================= */
.topbar-proj { margin-top: 12px; display: flex; }
.proj-pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 10px 0 9px; border-radius: 16px;
  background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .2);
  color: #F3E4BE; font-size: 12.5px; font-weight: 600; letter-spacing: .2px;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  cursor: pointer;
}
.proj-pill.static { cursor: default; }
.proj-pill.all { background: rgba(243, 228, 190, .16); border-color: rgba(243, 228, 190, .38); }
.proj-pill svg { width: 13px; height: 13px; opacity: .7; flex: 0 0 auto; }
.pp-dot { width: 6px; height: 6px; border-radius: 50%; background: #8FE3AE; flex: 0 0 auto; box-shadow: 0 0 0 2px rgba(143, 227, 174, .25); }
.proj-pill.all .pp-dot { background: #F3E4BE; box-shadow: 0 0 0 2px rgba(243, 228, 190, .22); }
.role-pill.super { background: rgba(243, 228, 190, .22); color: #FFF6DD; }
.chip-tag.proj { background: #EDF2F6; color: #4A5E70; max-width: 92px; overflow: hidden; text-overflow: ellipsis; }

/* 项目切换弹层 */
.ps-list { display: flex; flex-direction: column; gap: 8px; max-height: 58vh; overflow-y: auto; margin-bottom: 4px; }
.ps-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; text-align: left; padding: 11px 13px; border-radius: 12px;
  border: 1px solid var(--line); background: #fff; cursor: pointer;
}
.ps-row.on { border-color: var(--primary); background: var(--primary-soft); }
.ps-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ps-main b { font-size: 14px; font-weight: 620; color: var(--text); }
.ps-check { color: var(--primary); font-weight: 700; }

/* 项目管理卡片 */
.proj-card {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 13px 14px; margin-top: 10px;
}
.proj-card.off { opacity: .62; }
.pc-name { font-size: 15px; font-weight: 650; color: var(--text); }
.pc-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.pc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 11px; }
.pc-stats div { background: #F7FAF8; border-radius: 10px; padding: 8px 6px; text-align: center; }
.pc-stats b { display: block; font-size: 17px; font-weight: 680; color: var(--primary); font-variant-numeric: tabular-nums; }
.pc-stats span { font-size: 11px; color: var(--muted); }

/* ---------- 批量导入 ---------- */
.imp-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0 6px; }
.imp-stats > div { background: #F5F8F6; border-radius: 10px; padding: 9px 4px; text-align: center; }
.imp-stats b { display: block; font-size: 19px; line-height: 1.2; color: #1B2620; font-weight: 600; }
.imp-stats span { font-size: 11px; color: #7A8A80; }
.imp-stats .ok b { color: #0F5132; }
.imp-stats .warn b { color: #9A6A00; }
.imp-stats .bad b { color: #B3261E; }
.imp-chip { display: inline-block; background: #EAF3ED; color: #0F5132; border-radius: 6px; padding: 3px 7px; font-size: 11px; margin: 0 5px 5px 0; }
.imp-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid #EDF1EE; border-radius: 10px; margin-top: 8px; }
.imp-tbl { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.imp-tbl th, .imp-tbl td { padding: 6px 6px; border-bottom: 1px solid #EDF1EE; text-align: left; white-space: nowrap; }
.imp-tbl th { background: #F6F9F7; color: #5F6E66; font-weight: 500; }
.imp-tbl tr:last-child td { border-bottom: none; }
.imp-opt { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12.5px; color: #3C4A42; }
.imp-opt input[type="checkbox"] { width: 16px; height: 16px; accent-color: #0F5132; }
.imp-note { background: #F7F4E8; border-radius: 10px; padding: 10px; font-size: 12px; line-height: 1.85; color: #5C4A22; margin-top: 10px; }

/* ================= 电脑 / 平板适配（≥900px） =================
   手机端是主场景；桌面端要做到「像一个桌面应用，而不是网页里的一条居中卡片」：
   底色铺满整窗、顶栏通栏、内容限宽居中、KPI 四列、图表限宽、底栏收成居中浮条。
   内容左边缘与顶栏文字严格对齐（同一套 padding 计算）。 */
@media (min-width: 900px) {
  /* --desk-max 是内容区总宽，--desk-pad 是内容内边距；两者共同决定顶栏的水平内缩 */
  :root { --desk-max: 1216px; --desk-pad: 32px; }

  html, body { background: var(--bg); }
  #app {
    max-width: none;
    margin: 0;
    background: var(--bg);
    box-shadow: none;
  }

  .topbar {
    padding-top: 22px;
    padding-bottom: 20px;
    padding-left: max(var(--desk-pad), calc((100% - (var(--desk-max) - 2 * var(--desk-pad))) / 2));
    padding-right: max(var(--desk-pad), calc((100% - (var(--desk-max) - 2 * var(--desk-pad))) / 2));
  }
  .topbar h2 { font-size: 21px; }
  .topbar .sub { font-size: 13px; }

  .content {
    width: 100%;
    max-width: var(--desk-max);
    margin: 0 auto;
    padding: 0 var(--desk-pad) 96px;
  }

  .kpi-grid { grid-template-columns: repeat(4, 1fr); gap: 14px; }
  .kpi-grid.three { grid-template-columns: repeat(3, 1fr); }
  .kpi { padding: 16px 18px; }
  .kpi .k-value { font-size: 26px; }

  .quick-grid { gap: 14px; }
  .quick { padding: 18px 8px 16px; }
  .card { padding: 20px 22px; margin-top: 16px; }
  .sec-title { margin: 22px 4px 10px; }

  /* 折线图保持手机上的可读比例，不随窗口拉成一条长横带 */
  .chart { max-width: 620px; margin: 0 auto; }

  .tabbar {
    left: 50%; right: auto; transform: translateX(-50%);
    width: min(var(--desk-max), 100%);
    border-radius: 16px 16px 0 0;
    padding: 8px 12px calc(8px + var(--safe-bottom));
  }
  .tabbar button { font-size: 11.5px; }
  .tabbar .fab .circle { margin-top: -6px; }

  /* 登录页铺满整窗，品牌区与表单卡居中，保持手机上的卡片比例 */
  .login-wrap { align-items: center; }
  .login-brand { width: 100%; max-width: 400px; padding: 72px 4px 30px; }
  .login-card { width: 100%; max-width: 400px; margin-bottom: 40px; }

  /* 弹层居中限宽，避免电脑上被拉成整屏 */
  .sheet { max-width: 720px; margin: 0 auto; }

  /* 列表在电脑上有足够横向空间 */
  .rec-meta { font-size: 12.5px; }

  /* 电脑上不使用系统默认的白色粗滚动条（桌面应用里很出戏），改为细圆角浮条 */
  ::-webkit-scrollbar { width: 11px; height: 11px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb {
    background: rgba(16, 40, 28, .18);
    border: 3px solid transparent;
    background-clip: content-box;
    border-radius: 10px;
  }
  ::-webkit-scrollbar-thumb:hover { background: rgba(16, 40, 28, .32); background-clip: content-box; }
  ::-webkit-scrollbar-corner { background: transparent; }
}

