/* ===== 嘉诺工作平台 · 样式 ===== */
:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --border: #e6e8ec;
  --border-strong: #d5d9e0;
  --text: #14181f;
  --text-2: #5c6472;
  --text-3: #9099a8;
  --accent: #2f6feb;
  --accent-soft: #eaf1ff;
  --accent-deep: #1f56c4;
  --danger: #d92d20;
  --danger-soft: #fef1f0;
  --success: #067647;
  --success-soft: #e8f7ef;
  --warn: #b54708;
  --warn-soft: #fdf3e7;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lg: 0 8px 28px rgba(16, 24, 40, .14);
  --maxw: 620px;
}

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

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}
/* iOS Safari：输入框字号 <16px 时聚焦会自动放大页面且不回弹，这里显式兜住 */
input, textarea, select { font-size: 16px; }

svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- 启动 / 忙碌 ---------- */
.boot {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--text-2);
  background: var(--bg);
}
.spinner {
  width: 26px;
  height: 26px;
  border: 2.5px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 启动失败时的自救面板（微信里也能一步操作） ===== */
.boot-error {
  max-width: 340px;
  padding: 22px 18px;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.boot-error h3 { margin: 0 0 8px; font-size: 16px; color: var(--text); }
.boot-error p { margin: 0 0 14px; font-size: 13.5px; line-height: 1.7; color: var(--text-2); }
.boot-error .btn { margin-bottom: 10px; }
.boot-error .btn:last-child { margin-bottom: 0; }

/* ===== 「复制内容」弹层（微信里代替文件下载） ===== */
.copy-tip {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-2);
}
.copy-box {
  width: 100%;
  min-height: 180px;
  max-height: 42vh;
  padding: 12px;
  font-size: 12.5px;
  line-height: 1.6;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  resize: vertical;
  -webkit-user-select: text;
  user-select: text;
}
.modal-foot .btn.block { width: 100%; }

.busy {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(20, 24, 31, .28);
  color: #fff;
  font-size: 14px;
  -webkit-backdrop-filter: blur(1px);
  backdrop-filter: blur(1px);
}
.busy .spinner { border-color: rgba(255,255,255,.35); border-top-color: #fff; }

/* ---------- 通用卡片 / 控件 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background .15s, border-color .15s, opacity .15s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn:active { background: #f0f2f5; }
.btn[disabled] {
  opacity: .5;
  cursor: not-allowed;
}
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn.primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.btn.primary:active { background: #17458f; }
.btn.ghost { background: var(--accent-soft); border-color: transparent; color: var(--accent-deep); }
.btn.ghost:hover { background: #dfeaff; }
.btn.wechat { background: #07c160; border-color: #07c160; color: #fff; }
.btn.wechat:hover { background: #06ad56; border-color: #06ad56; }
.btn.danger { color: var(--danger); border-color: #f3c9c5; background: var(--danger-soft); }
.btn.danger:hover { background: #fce4e2; }
.btn.block { width: 100%; }
.btn.small { padding: 6px 11px; font-size: 13px; }

.field { display: block; margin-bottom: 14px; }
.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
}
input[type="text"], input[type="tel"], input[type="number"], input[type="datetime-local"],
input[type="date"], input[type="search"], textarea, select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 111, 235, .13);
}
textarea { resize: vertical; min-height: 64px; }
input::placeholder, textarea::placeholder { color: var(--text-3); }

.ltabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: #f1f2f5;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}
.ltab {
  flex: 1;
  padding: 9px 4px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.ltab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.hint { font-size: 12.5px; color: var(--text-3); margin: 10px 0 0; line-height: 1.5; }

/* 登录页：记住手机号 / 记住密码 */
.login-opts { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 12px 0 2px; }
.chk {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-2); cursor: pointer;
  -webkit-user-select: none; user-select: none;
}
.chk input {
  width: 16px; height: 16px; margin: 0;
  accent-color: var(--accent); cursor: pointer;
}
.chk input:checked + span { color: var(--text); }
.hint-inline { font-size: 11.5px; font-weight: 400; color: var(--text-3); }
.linkbtn {
  border: none; background: none; padding: 0; margin: 0 0 0 2px;
  font-size: 12.5px; font-weight: 600; color: var(--accent);
  text-decoration: underline; cursor: pointer;
}
.linkbtn:active { opacity: .7; }

/* 管理后台：成员/记录行 */
.admin-row { padding: 11px 14px; border-bottom: 1px solid var(--border); }
.admin-row:last-child { border-bottom: none; }
.ar-top {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 14px; font-weight: 500;
}
.ar-top strong { font-variant-numeric: tabular-nums; font-weight: 600; }
.ar-sub {
  margin-top: 4px; font-size: 12px; color: var(--text-3);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.ar-sub .btn.small { margin-top: 2px; }
/* 管理员视图里标出记录归属人 */
.owner-tag { font-weight: 600; color: var(--accent); }
.field-error { font-size: 12.5px; color: var(--danger); margin: -8px 0 12px; }

.alert {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid #f6d3d0;
  word-break: break-word;
}
.alert.ok { background: var(--success-soft); color: var(--success); border-color: #c7ecda; }

/* ---------- 登录 ---------- */
.login {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 18px 40px;
}
.login-inner { width: 100%; max-width: 400px; }
.brand { text-align: center; margin-bottom: 24px; }
.brand-mark {
  width: 56px; height: 56px;
  margin: 0 auto 12px;
  border-radius: 16px;
  background: linear-gradient(140deg, #3b7bf5, #1f56c4);
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(47, 111, 235, .3);
}
.brand h1 { font-size: 21px; margin: 0 0 6px; letter-spacing: .2px; }
.brand-sub { margin: 0; color: var(--text-2); font-size: 13.5px; }
.login-card { padding: 20px; }

.alt-login {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.or-line {
  display: block;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-3);
  margin-bottom: 12px;
}

.code-row { display: flex; gap: 10px; }
.code-row input { flex: 1; min-width: 0; }
.code-row .btn { flex: 0 0 auto; }

/* ---------- 应用骨架 ---------- */
.app {
  max-width: var(--maxw);
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar h2 { font-size: 17px; margin: 0; font-weight: 700; }
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px 5px 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  max-width: 46%;
}
.user-chip .avatar {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
}
.user-chip .chip-name {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.page { padding: 16px 16px 24px; }

.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--maxw);
  z-index: 40;
  display: flex;
  background: rgba(255, 255, 255, .96);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.navbtn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 9px 0 8px;
  border: none;
  background: transparent;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.navbtn svg { width: 21px; height: 21px; }
.navbtn.active { color: var(--accent); }

/* ---------- 区块标题 ---------- */
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 20px 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
  letter-spacing: .3px;
}
.section-title:first-child { margin-top: 0; }
.section-title .count { font-weight: 500; color: var(--text-3); }

/* ---------- 统计卡 ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 10px;
  text-align: center;
}
.stat .k { font-size: 11.5px; color: var(--text-3); margin-bottom: 4px; }
.stat .v { font-size: 17px; font-weight: 700; letter-spacing: -.3px; }
.stat .v.small { font-size: 15px; }
.stat.hero {
  grid-column: 1 / -1;
  text-align: left;
  padding: 16px;
  background: linear-gradient(140deg, #3b7bf5, #1f56c4);
  border-color: transparent;
  color: #fff;
}
.stat.hero .k { color: rgba(255, 255, 255, .78); font-size: 12.5px; }
.stat.hero .v { font-size: 28px; }

/* ---------- 分类占比条 ---------- */
.bars { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: grid; grid-template-columns: 62px 1fr auto; align-items: center; gap: 10px; font-size: 12.5px; }
.bar-name { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 7px; border-radius: 999px; background: #eef0f3; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; transition: width .3s ease; }
.bar-amt { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- 筛选 ---------- */
.filters { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.chips { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.filter-row { display: flex; gap: 8px; }
.filter-row select { flex: 1; min-width: 0; padding: 9px 10px; font-size: 13.5px; }

/* ---------- 列表 ---------- */
.day-group { margin-bottom: 18px; }
.day-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0 4px 7px;
  font-size: 12.5px;
  color: var(--text-3);
}
.day-head .day-total { font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }

.items {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 13px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  background: var(--surface);
}
.item:last-child { border-bottom: none; }
.item:active { background: var(--surface-2); }
.item.picked { background: var(--accent-soft); }

.tick {
  flex: 0 0 auto;
  width: 20px; height: 20px;
  margin-top: 2px;
  border-radius: 6px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
}
.item.picked .tick { background: var(--accent); border-color: var(--accent); }
.tick svg { width: 13px; height: 13px; color: #fff; stroke-width: 3; }

.cat-dot {
  flex: 0 0 auto;
  width: 34px; height: 34px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff;
}

.item-main { flex: 1; min-width: 0; }
.item-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.item-title {
  font-weight: 600;
  font-size: 14.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.item-amt {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  letter-spacing: -.2px;
}
.item-sub {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-3);
}
.item-sub .meta { display: inline-flex; align-items: center; gap: 3px; }
.item-sub .meta svg { width: 12px; height: 12px; }

.badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .2px;
}
.badge.draft { background: #eef0f3; color: var(--text-2); }
.badge.submitted { background: var(--warn-soft); color: var(--warn); }
.badge.reimbursed { background: var(--success-soft); color: var(--success); }
.badge.pending { background: var(--warn-soft); color: var(--warn); }

.thumbs { display: flex; gap: 4px; margin-top: 7px; }
.thumbs img {
  width: 40px; height: 40px;
  object-fit: cover;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: #f1f2f5;
}
.thumbs .doc {
  width: 40px; height: 40px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: var(--text-3);
}

/* ---------- 空状态 ---------- */
.empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-3);
  font-size: 13.5px;
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}
.empty strong { display: block; color: var(--text-2); font-size: 14.5px; margin-bottom: 5px; }

/* ---------- 记一笔表单 ---------- */
.amount-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.amount-row { display: flex; align-items: center; gap: 6px; }
.amount-row .yuan { font-size: 26px; font-weight: 600; color: var(--text-2); }
.amount-row input {
  border: none;
  padding: 0;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -1px;
  background: transparent;
  box-shadow: none !important;
}
.amount-row input:focus { outline: none; }

.cat-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
}
.cat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 9px 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}
.cat .cat-dot { width: 26px; height: 26px; border-radius: 8px; font-size: 12px; }
.cat.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-deep); }

.rec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 9px;
}
.rec {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
}
.rec img { width: 100%; height: 100%; object-fit: cover; }
.rec .doc { font-size: 11px; font-weight: 700; color: var(--text-3); text-align: center; padding: 4px; }
.rec .rm {
  position: absolute; top: 3px; right: 3px;
  width: 21px; height: 21px;
  border-radius: 50%;
  border: none;
  background: rgba(20, 24, 31, .62);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.rec-add {
  aspect-ratio: 1;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-3);
  font-size: 12px;
  font-weight: 600;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  cursor: pointer;
}
.rec-add svg { width: 20px; height: 20px; }
.rec-add:hover { border-color: var(--accent); color: var(--accent); }

/* 凭证入口在手机上一分为二（拍照 / 相册），两个按钮占满一行并排，便于单手点按 */
.rec-adds {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}
.rec-adds .rec-add {
  aspect-ratio: auto;
  height: 66px;
  flex-direction: row;
  gap: 7px;
  font-size: 13px;
}

.loc-row { display: flex; gap: 8px; }
.loc-row input { flex: 1; min-width: 0; }
.loc-meta { font-size: 12px; color: var(--text-3); margin-top: 6px; display: flex; align-items: center; gap: 5px; }
.loc-meta svg { width: 12px; height: 12px; }

.form-actions { display: flex; gap: 10px; margin-top: 18px; }
.form-actions .btn { flex: 1; padding: 13px; font-size: 15px; }

/* ---------- 底部操作条（多选） ---------- */
.actionbar {
  position: fixed;
  bottom: calc(60px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 24px);
  max-width: calc(var(--maxw) - 24px);
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  background: #1c2331;
  color: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.actionbar .ab-text { flex: 1; font-size: 13px; line-height: 1.35; }
.actionbar .ab-text strong { font-size: 15px; }
.actionbar .btn { flex: 0 0 auto; }
.actionbar .btn.primary { background: var(--accent); border-color: var(--accent); }

/* ---------- 弹层 ---------- */
.modal-mask {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  inset: 0;
  z-index: 80;
  background: rgba(20, 24, 31, .42);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fade .16s ease;
}
@keyframes fade { from { opacity: 0; } }
@media (min-width: 640px) {
  .modal-mask { align-items: center; }
}
.modal {
  width: 100%;
  max-width: var(--maxw);
  max-height: 90vh;
  max-height: 90dvh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: 18px 18px 0 0;
  box-shadow: var(--shadow-lg);
  animation: slideup .2s cubic-bezier(.2, .8, .3, 1);
}
@media (min-width: 640px) {
  .modal { border-radius: 18px; max-height: 84dvh; }
}
@keyframes slideup { from { transform: translateY(18px); opacity: .6; } }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 15px 16px 12px;
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
}
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 700; }
.modal-close {
  width: 30px; height: 30px;
  border: none; border-radius: 50%;
  background: #f1f2f5;
  color: var(--text-2);
  font-size: 17px; line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.modal-body { padding: 16px; overflow-y: auto; flex: 1 1 auto; }
.modal-foot {
  padding: 12px 16px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  flex: 0 0 auto;
}
.modal-foot .btn { flex: 1; }

.dl { display: flex; flex-direction: column; gap: 11px; }
.dl-row { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.dl-row dt { flex: 0 0 auto; font-size: 13px; color: var(--text-3); }
.dl-row dd { margin: 0; text-align: right; font-size: 14px; word-break: break-word; }
.dl-row dd.big { font-size: 20px; font-weight: 700; letter-spacing: -.4px; }

.rec-view { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 9px; margin-top: 6px; }
.rec-view button {
  padding: 0;
  aspect-ratio: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  overflow: hidden;
  cursor: pointer;
}
.rec-view img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rec-view .doc { display: flex; align-items: center; justify-content: center; height: 100%; font-size: 11px; font-weight: 700; color: var(--text-3); }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom));
  transform: translate(-50%, 12px);
  z-index: 100;
  max-width: min(88vw, 460px);
  padding: 10px 16px;
  border-radius: 999px;
  background: #1c2331;
  color: #fff;
  font-size: 13.5px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: #b42318; }
.toast.ok { background: #08693f; }

/* ---------- 我的 ---------- */
.me-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.me-head { display: flex; align-items: center; gap: 14px; }
.me-avatar {
  width: 54px; height: 54px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 21px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
}
.me-head .me-name { font-size: 18px; font-weight: 700; }
.me-head .me-sub { font-size: 12.5px; color: var(--text-3); }

.kv { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--text-3); font-size: 13px; }
.kv .v { text-align: right; word-break: break-word; }

@media (max-width: 380px) {
  .cat-grid { grid-template-columns: repeat(4, 1fr); }
  .stat .v { font-size: 15px; }
  .stat.hero .v { font-size: 24px; }
}

/* ---------- 目录内的子按钮（记账 / 发货） ---------- */
.subnav {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: #eceef2;
  border-radius: 12px;
  margin-bottom: 16px;
}
.subnav-btn {
  flex: 1;
  padding: 9px 4px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}
.subnav-btn.active {
  background: var(--surface);
  color: var(--accent-deep);
  box-shadow: var(--shadow);
}

/* ---------- 发货：按天分组（可收起） ---------- */
.day-head.day-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 4px 9px;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.day-name { font-weight: 700; color: var(--text-2); flex: 0 0 auto; }
.day-head.day-btn .day-total { flex: 1; text-align: right; }
.day-caret { color: var(--text-3); font-size: 11px; transition: transform .15s; }
.day-caret.open { transform: rotate(180deg); }
.folded-tip {
  padding: 11px 14px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-3);
  font-size: 12.5px;
  text-align: center;
}

/* ---------- 发货：列表项里的照片与按钮 ---------- */
.thumbs img, .rec img, .rec-view img { cursor: zoom-in; }
.d-thumbs { margin-top: 8px; }
.d-thumbs img, .d-thumbs .doc { width: 54px; height: 54px; border-radius: 9px; }
.d-nophoto { margin-top: 7px; font-size: 12px; color: var(--text-3); }
.d-note {
  margin-top: 8px;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 12.5px;
  color: var(--text-2);
}
.d-actions { display: flex; gap: 8px; margin-top: 10px; }
.d-actions .btn { flex: 1; }
.edit-tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 11px;
  font-weight: 600;
}
.edit-banner { padding: 12px 14px; margin-bottom: 14px; }
.edit-banner .eb-title { font-size: 13.5px; font-weight: 700; color: var(--accent-deep); }
.edit-banner .eb-lines {
  display: flex; flex-direction: column; gap: 2px;
  margin-top: 4px; font-size: 12.5px; color: var(--text-2);
}

/* ---------- 发货统计表 ---------- */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.stat-table { border-collapse: collapse; width: 100%; min-width: 620px; font-size: 13px; }
.stat-table th {
  text-align: left;
  padding: 10px 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-3);
  white-space: nowrap;
}
.stat-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.stat-table tbody tr:last-child td { border-bottom: none; }
.stat-table tbody tr { cursor: pointer; }
.stat-table tbody tr:active { background: var(--surface-2); }
.st-time { white-space: nowrap; color: var(--text-2); font-variant-numeric: tabular-nums; }
.st-sub { font-size: 11.5px; color: var(--text-3); }
.st-loc { max-width: 160px; color: var(--text-2); }
.st-pics { display: flex; gap: 4px; align-items: center; }
.st-pic {
  width: 42px; height: 42px;
  object-fit: cover;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: #f1f2f5;
  cursor: zoom-in;
}
span.doc.st-pic {
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: var(--text-3);
}
.st-more { font-size: 11px; color: var(--text-3); }
.st-none { font-size: 12px; color: var(--text-3); }

/* ---------- 图片放大查看 ---------- */
.pv {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  inset: 0;
  z-index: 120;
  display: flex;
  flex-direction: column;
  background: rgba(8, 10, 14, .95);
  animation: fade .15s ease;
}
.pv-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(12px + env(safe-area-inset-top)) 16px 10px;
  color: rgba(255, 255, 255, .85);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.pv-close {
  width: 32px; height: 32px;
  border: none; border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  font-size: 19px; line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.pv-stage {
  flex: 1 1 auto;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  min-height: 0;
}
.pv-img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; cursor: zoom-out; }
.pv-spin {
  position: absolute;
  border-color: rgba(255, 255, 255, .28);
  border-top-color: #fff;
}
.pv-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px calc(16px + env(safe-area-inset-bottom));
  color: rgba(255, 255, 255, .8);
  font-size: 12.5px;
  word-break: break-all;
}
.pv-foot .btn { flex: 0 0 auto; background: rgba(255,255,255,.14); border-color: transparent; color: #fff; }
.pv-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 42px; height: 42px;
  border: none; border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  font-size: 24px; line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.pv-arrow.left { left: 10px; }
.pv-arrow.right { right: 10px; }

/* ===== 添加到主屏幕提示（手机浏览器里打开时出现一次） ===== */
.pwa-tip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 14px;
  padding: 12px 14px;
  background: #eef3ff;
  border: 1px solid #cddcff;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.6;
  color: #1f3a7a;
}
.pwa-tip-text { flex: 1; }
.pwa-tip-close {
  flex: none;
  border: 0;
  background: transparent;
  color: #2f6feb;
  font-size: 13px;
  font-weight: 600;
  padding: 0;
  cursor: pointer;
}

/* ---------- 取不到图的缩略图：画成占位块，不留裂图 ---------- */
/* 优先级要压过 .thumbs img / .rec img 等各自的 background，所以放在文件末尾 */
img.thumb-broken {
  font-size: 0;
  line-height: 0;
  color: transparent;
  cursor: help;
  border: 1px dashed #d3d8e0;
  background-color: #f5f6f8;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 50% 50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aa3b2' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='10.5' width='16' height='9.5' rx='2'/%3E%3Cpath d='M8 10.5V7a4 4 0 0 1 8 0v3.5'/%3E%3C/svg%3E");
}
/* 统计表格里的小图只有 40px，图标放大一点才看得清 */
img.thumb-broken.st-pic { background-size: 62% 62%; }

