:root {
  --bg: #f4f6f9; --card: #ffffff; --line: #e5e9f0;
  --txt: #1f2d3d; --sub: #7b8794;
  --pri: #2f6fed; --pri-dark: #2258c4;
  --ok: #16a34a; --warn: #d97706; --danger: #dc2626;
  --pri-soft: #e8effd; --ok-soft: #e6f6ec; --warn-soft: #fdf3e3; --danger-soft: #fdeaea;
  --radius: 12px;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--txt); font-size: 15px; line-height: 1.5; }
a { color: var(--pri); text-decoration: none; }
input, select, textarea, button { font-family: inherit; font-size: 15px; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--txt); outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--pri); }
input[readonly] { background: #f2f4f8; color: var(--sub); }
label { display: block; font-size: 13px; color: var(--sub); margin: 12px 0 5px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px; border: none; border-radius: 8px; cursor: pointer;
  background: var(--pri); color: #fff; font-size: 15px; white-space: nowrap;
}
.btn:active { opacity: .85; }
.btn.block { width: 100%; padding: 13px; }
.btn.ghost { background: #fff; color: var(--pri); border: 1px solid var(--pri); }
.btn.plain { background: #fff; color: var(--txt); border: 1px solid var(--line); }
.btn.warn { background: var(--warn); }
.btn.danger { background: var(--danger); }
.btn.ok { background: var(--ok); }
.btn.sm { padding: 6px 10px; font-size: 13px; border-radius: 6px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.card h3 { font-size: 16px; margin-bottom: 10px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 120px; }
.sub { color: var(--sub); font-size: 13px; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; }
.hr { border: none; border-top: 1px solid var(--line); margin: 12px 0; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; white-space: nowrap; }
.b-pending { background: var(--warn-soft); color: var(--warn); }
.b-confirmed { background: var(--pri-soft); color: var(--pri); }
.b-settled { background: var(--ok-soft); color: var(--ok); }
.b-off { background: #eceff3; color: var(--sub); }

.kv { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--sub); }
.kv .v { font-weight: 600; }
.kv .v.big { font-size: 20px; color: var(--pri); }

/* 顶部栏 */
.topbar { background: var(--pri); color: #fff; padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 20; }
.topbar .t { font-size: 17px; font-weight: 700; }
.topbar .who { font-size: 12px; opacity: .9; text-align: right; cursor: pointer; }
.topbar .who b { display: block; font-size: 14px; }

.wrap { max-width: 720px; margin: 0 auto; padding: 14px; }

/* 底部导航 */
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--line); display: flex; z-index: 20; }
.tabbar button { flex: 1; background: none; border: none; padding: 9px 0 7px; color: var(--sub); font-size: 12px; cursor: pointer; }
.tabbar button .ic { display: block; font-size: 20px; }
.tabbar button.on { color: var(--pri); }
body.has-tab { padding-bottom: 64px; }

/* 列表项 */
.li { display: flex; justify-content: space-between; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 15px; margin-bottom: 10px; cursor: pointer; }
.li .n { font-weight: 600; }
.li .m { font-size: 12px; color: var(--sub); margin-top: 2px; }
.li .arrow { color: #c3cad4; }

/* 弹层 */
.mask { position: fixed; inset: 0; background: rgba(15, 25, 40, .45); z-index: 50; display: none; align-items: center; justify-content: center; padding: 16px; }
.mask.show { display: flex; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; padding: 18px; }
.modal h3 { margin-bottom: 12px; }
.modal .close-x { float: right; border: none; background: none; font-size: 20px; color: var(--sub); cursor: pointer; }

/* toast */
#toast { position: fixed; top: 18%; left: 50%; transform: translateX(-50%); background: rgba(20,30,45,.88); color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 14px; z-index: 99; display: none; max-width: 80vw; text-align: center; }
#toast.err { background: rgba(190, 35, 35, .92); }

/* 图片上传 */
.photos { display: flex; gap: 8px; flex-wrap: wrap; }
.photos .ph { width: 84px; height: 84px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); }
.add-ph { width: 84px; height: 84px; border: 1px dashed #b8c2cf; border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--sub); font-size: 12px; cursor: pointer; background: #fafbfd; }
.add-ph span { font-size: 22px; }

/* 表格（后台） */
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; font-size: 13.5px; white-space: nowrap; }
th { background: #f7f9fc; color: var(--sub); font-weight: 600; }
tr:hover td { background: #fafcff; }

/* 后台布局 */
.admin-shell { display: flex; min-height: 100vh; }
.side { width: 210px; background: #1f2d3d; color: #cfd8e3; flex-shrink: 0; padding: 16px 10px; }
.side .logo { color: #fff; font-weight: 700; font-size: 16px; padding: 4px 10px 16px; }
.side button { display: block; width: 100%; text-align: left; background: none; border: none; color: #cfd8e3; padding: 11px 12px; border-radius: 8px; cursor: pointer; font-size: 14px; margin-bottom: 2px; }
.side button.on, .side button:hover { background: rgba(255,255,255,.1); color: #fff; }
.main { flex: 1; padding: 18px 22px; min-width: 0; }
.main h2 { font-size: 19px; margin-bottom: 14px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.filters input, .filters select { width: auto; min-width: 130px; }
.tbl-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }

/* 空态 */
.empty { text-align: center; color: var(--sub); padding: 40px 0; font-size: 14px; }

/* 身份证预览 */
.idimg { max-width: 200px; max-height: 140px; border-radius: 8px; border: 1px solid var(--line); margin: 4px 8px 4px 0; }
