* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, "Microsoft YaHei", "Segoe UI", sans-serif; background: #f5f6fa; color: #222; font-size: 14px; }
[v-cloak] { display: none; }

/* 登录 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #2b5cff, #1a3fb0); }
.login-card { width: 360px; background: #fff; padding: 36px 30px; border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,.2); }
.login-card h1 { font-size: 22px; color: #1a3fb0; margin-bottom: 6px; }
.login-card .sub { color: #888; margin-bottom: 24px; font-size: 13px; }
.login-card input { width: 100%; padding: 11px 12px; margin-bottom: 14px; border: 1px solid #dcdcdc; border-radius: 8px; font-size: 14px; }
.login-card button { width: 100%; padding: 11px; background: #2b5cff; color: #fff; border: none; border-radius: 8px; font-size: 15px; cursor: pointer; }
.login-card button:hover { background: #1a3fb0; }
.login-card .hint { margin-top: 16px; font-size: 12px; color: #999; line-height: 1.6; background: #f7f8fb; padding: 10px; border-radius: 6px; }

/* 布局 */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 210px; background: linear-gradient(180deg, #9b90ff 0%, #7e73f2 100%); color: #fff; padding-top: 18px; flex-shrink: 0; transition: width .2s; }
.sidebar .sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 0 14px 16px; border-bottom: 1px solid rgba(255,255,255,0.2); margin-bottom: 10px; min-height: 40px; }
.sidebar .logo { color: #fff; font-size: 17px; font-weight: 700; text-shadow: 0 1px 2px rgba(0,0,0,0.25); }
.sidebar .sidebar-toggle { background: transparent; border: 1px solid rgba(255,255,255,0.4); color: #fff; font-size: 14px; line-height: 1; padding: 5px 8px; border-radius: 5px; cursor: pointer; min-height: 32px; min-width: 32px; }
.sidebar .sidebar-toggle:hover { background: rgba(255,255,255,0.12); }
.sidebar nav a { display: block; padding: 12px 20px; cursor: pointer; color: rgba(255,255,255,0.92); text-decoration: none; border-left: 3px solid transparent; text-shadow: 0 1px 2px rgba(0,0,0,0.18); }
.sidebar nav a:hover { background: rgba(255,255,255,0.12); color: #fff; }
.sidebar nav a.active { background: rgba(255,255,255,0.18); color: #fff; border-left-color: rgba(255,255,255,0.85); border-radius: 0 8px 8px 0; margin-right: 10px; }
.sidebar nav a .ico { margin-right: 8px; }
.sidebar nav a.parent { display: flex; align-items: center; }
.sidebar nav a.parent .arrow { margin-left: auto; transition: transform .2s; }
.sidebar nav a.parent.open .arrow { transform: rotate(90deg); }
.sidebar .sub-nav { padding-left: 18px; margin-top: 4px; }
.sidebar .sub-nav a { padding: 10px 20px; font-size: 13px; }
.sidebar .sub-nav a.active { border-radius: 0 8px 8px 0; margin-right: 10px; }
.sidebar.collapsed { width: 60px; }
.sidebar.collapsed .sidebar-head { padding: 0 8px 16px; justify-content: center; }
.sidebar.collapsed nav a { padding: 12px 0; text-align: center; display: flex; align-items: center; justify-content: center; }
.sidebar.collapsed nav a .ico { margin-right: 0; font-size: 18px; line-height: 1; }
.sidebar.collapsed nav a .nav-label { display: none; }
.sidebar.collapsed nav a.parent .arrow { display: none; }
.sidebar.collapsed nav a.active { margin-right: 4px; border-radius: 8px; }
.sidebar.collapsed .sub-nav { display: none; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { height: 56px; background: #fff; border-bottom: 1px solid #eaeaea; display: flex; align-items: center; justify-content: space-between; padding: 0 22px; }
.topbar .crumb { font-size: 16px; font-weight: 600; }
.topbar .user { display: flex; align-items: center; gap: 14px; color: #555; }
.topbar .user .co { font-weight: 600; color: #1a3fb0; }
.topbar .user .nm { color: #666; }
.topbar .user button { border: 1px solid #dcdcdc; background: #fff; padding: 5px 12px; border-radius: 6px; cursor: pointer; }
.content { padding: 22px; }

/* 消息通知 */
.notify-wrap { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.notify-wrap .bell { font-size: 20px; line-height: 1; }
.notify-badge { position: absolute; top: -6px; right: -8px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: #f5222d; color: #fff; font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.notify-drop { position: absolute; top: 32px; right: -12px; width: 340px; max-height: 420px; overflow-y: auto; background: #fff; border: 1px solid #eaeaea; border-radius: 10px; box-shadow: 0 8px 28px rgba(0,0,0,.12); z-index: 200; padding: 6px 0; }
.notify-head { padding: 12px 16px; font-size: 14px; font-weight: 700; color: #222; border-bottom: 1px solid #f0f0f0; display: flex; align-items: center; justify-content: space-between; }
.notify-head .muted { font-size: 12px; font-weight: 400; color: #999; }
.notify-sec-title { padding: 10px 16px 4px; font-size: 12px; color: #888; }
.notify-item { padding: 10px 16px; cursor: pointer; }
.notify-item:hover { background: #f5f6ff; }
.notify-item-main { font-size: 13px; color: #222; font-weight: 600; }
.notify-item-sub { font-size: 12px; color: #999; margin-top: 3px; }
.notify-empty { padding: 24px 16px; text-align: center; color: #bbb; font-size: 13px; }

/* 卡片 */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.card { background: #fff; border-radius: 10px; padding: 18px 20px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.card .k { color: #888; font-size: 13px; margin-bottom: 8px; }
.card .v { font-size: 24px; font-weight: 700; color: #1a3fb0; }

/* 面板 */
.panel { background: #fff; border-radius: 10px; padding: 20px; margin-bottom: 20px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.panel-title { font-size: 16px; font-weight: 700; margin-bottom: 16px; color: #1f2430; }

/* 按钮与表单 */
button { cursor: pointer; font-family: inherit; }
button:disabled { opacity: .5; cursor: not-allowed; }
button.primary { background: #2b5cff; color: #fff; border: none; border-radius: 6px; padding: 8px 16px; font-size: 14px; }
button.primary:hover { background: #1a3fb0; }
button.ghost { background: #fff; color: #555; border: 1px solid #dcdcdc; border-radius: 6px; padding: 8px 16px; font-size: 14px; }
button.ghost:hover { border-color: #2b5cff; color: #2b5cff; }
button.ok { background: #e8f6ec; border-color: #b6e0c2; color: #1a8a3a; }
button.no { background: #fdecec; border-color: #f3c0c0; color: #c0392b; }
button.sm { padding: 4px 10px; font-size: 12px; }
input, select, textarea { font-family: inherit; font-size: 14px; border: 1px solid #dcdcdc; border-radius: 6px; padding: 8px 10px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: #2b5cff; }
input.mini, select.mini, button.mini { padding: 6px 10px; font-size: 13px; }
input[type="file"] { border: none; padding: 4px 0; }
label { display: block; font-size: 13px; color: #666; margin-bottom: 5px; }
.hint-inline { font-size: 13px; color: #888; }
.spacer { flex: 1; }
.muted { color: #999; }

/* 搜索栏 */
.search-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.search-bar .mini { min-width: 120px; }
.filter-summary { font-size: 13px; color: #666; margin-bottom: 12px; }

/* 表格 */
table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: visible; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid #f0f0f0; }
thead { background: linear-gradient(90deg, #9b90ff 0%, #7e73f2 100%); color: #fff; }
th { font-weight: 600; font-size: 13px; white-space: nowrap; }
tbody tr:hover { background: #f9faff; }
td { font-size: 13px; vertical-align: middle; }
td.ops { text-align: left; white-space: nowrap; }
td.ops button { margin-right: 6px; padding: 4px 10px; border: 1px solid #dcdcdc; background: #fff; border-radius: 6px; cursor: pointer; font-size: 12px; }
td.ops button:hover { border-color: #2b5cff; color: #2b5cff; }
td.ops button.primary { background: #2b5cff; color: #fff; border-color: #2b5cff; }
td.ops button.primary:hover { background: #1a3fb0; color: #fff; }
td.ops button.danger { color: #c0392b; border-color: #e6b3ad; }
td.ops button.danger:hover { background: #fdf0ee; border-color: #c0392b; color: #c0392b; }
td.ops button:disabled { opacity: .45; cursor: not-allowed; }
td.empty { text-align: center; color: #999; padding: 40px 0; }

/* 徽章 */
.badge { display: inline-block; padding: 3px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; }
.badge.draft { background: #f5f6fa; color: #666; }
.badge.pending { background: #fff7e6; color: #fa8c16; }
.badge.approved { background: #e8f6ec; color: #1a8a3a; }
.badge.rejected { background: #fdecec; color: #c0392b; }
.badge.pay.unpaid { background: #fdecec; color: #c0392b; }
.badge.pay.partial { background: #fff7e6; color: #fa8c16; }
.badge.pay.paid { background: #e8f6ec; color: #1a8a3a; }
.badge.pay.over { background: #e6f7ff; color: #1890ff; }
.badge.warn { background: #fff7e6; color: #fa8c16; }
.badge.danger { background: #fdecec; color: #c0392b; }

/* Tab */
.tabs { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs button { padding: 7px 14px; border: 1px solid #dcdcdc; background: #fff; border-radius: 6px; font-size: 13px; }
.tabs button.active { background: #2b5cff; color: #fff; border-color: #2b5cff; }
.tabs button.primary { background: #2b5cff; color: #fff; border-color: #2b5cff; }
.tabs button.primary:hover { background: #1a3fb0; }
.sub-nav-tabs { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 1px solid #eaeaea; padding-bottom: 8px; }
.sub-nav-tabs button { padding: 7px 14px; border: none; background: transparent; border-bottom: 2px solid transparent; font-size: 14px; }
.sub-nav-tabs button.active { color: #2b5cff; border-bottom-color: #2b5cff; }

/* 弹窗 */
/* z-index 需高于移动端全屏页 .m-page(900)，否则从 m-page 里打开的弹窗会被盖住看不见 */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 950; display: flex; align-items: center; justify-content: center; }
.modal-box { background: #fff; border-radius: 12px; width: 720px; max-width: 90vw; max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 16px 48px rgba(0,0,0,.2); }
.modal-box.wide { width: 900px; }
.modal-box > h3 { padding: 16px 20px; border-bottom: 1px solid #f0f0f0; font-size: 16px; font-weight: 700; flex-shrink: 0; }
.modal-head { padding: 16px 20px; border-bottom: 1px solid #f0f0f0; display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { font-size: 16px; font-weight: 700; }
.modal-head .close { font-size: 22px; color: #999; cursor: pointer; }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-foot { padding: 14px 20px; border-top: 1px solid #f0f0f0; display: flex; justify-content: flex-end; gap: 10px; }
.modal-foot button { padding: 8px 16px; border-radius: 6px; border: 1px solid #dcdcdc; background: #fff; }
.modal-foot button.primary { background: #2b5cff; color: #fff; border-color: #2b5cff; }

/* 状态标签（实租场地/房号/合同列表） */
.status-tag { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 12px; }
.status-tag.on { background: #f0f9eb; color: #52c41a; }
.status-tag.off { background: #f5f5f5; color: #999; }
.status-tag.warn { background: #fff7e6; color: #fa8c16; }

/* 表单布局 */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
/* label 包裹 input 的竖排样式（实租场地/房号/合同弹窗用） */
.form-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: #555; }
.form-grid label input,
.form-grid label select,
.form-grid label textarea {
  padding: 8px 10px; border: 1px solid #dcdcdc; border-radius: 7px;
  font-size: 13px; font-family: inherit; background: #fff; color: #333; width: 100%;
  box-sizing: border-box;
}
.form-grid label input:focus,
.form-grid label select:focus,
.form-grid label textarea:focus { outline: none; border-color: #2b5cff; }
.form-grid label textarea { resize: vertical; min-height: 48px; }
.form-grid input[type="file"] { padding: 6px 8px; border: 1px dashed #c8c8c8; border-radius: 7px; background: #fafafa; }
/* 已上传附件列表 */
.file-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.file-list li { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.file-list li a { color: #2b5cff; text-decoration: none; word-break: break-all; }
.file-list li a:hover { text-decoration: underline; }
.form-row { display: flex; gap: 14px; margin-bottom: 12px; }
.form-row .field { flex: 1; }

/* 合同弹窗表单：两列网格 */
.contract-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-content: start; }
.contract-form > .row { display: flex; flex-direction: column; gap: 5px; margin-bottom: 0; }
.contract-form > .row.full { grid-column: 1 / -1; }
.contract-form > .row input,
.contract-form > .row select { width: 100%; }
.contract-form > .row textarea { width: 100%; min-height: 72px; }
.contract-form label { margin-bottom: 0; color: #555; }
.contract-form .upload-box { padding: 12px 10px; }
.contract-form .ocr-hint { font-size: 12px; color: #888; }

.form-box { background: #f9faff; border-radius: 8px; padding: 14px; margin-bottom: 14px; }
.sub-block { border: 1px solid #f0f0f0; border-radius: 8px; padding: 14px; margin-bottom: 14px; }
.sub-head { font-weight: 700; margin-bottom: 10px; }
.sub-title { font-size: 13px; color: #888; margin-bottom: 8px; }

/* 首页 */
.dashboard { display: flex; flex-direction: column; gap: 20px; }
.ranking-table { width: 100%; }
.rank-badge { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; color: #fff; font-size: 12px; font-weight: 700; }
.rank-1 { background: #f5222d; }
.rank-2 { background: #fa8c16; }
.rank-3 { background: #2b5cff; }
.rank-other { background: #d9d9d9; color: #666; }
.rate-pill { display: inline-block; padding: 3px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; }
.rate-good { background: #e8f6ec; color: #1a8a3a; }
.rate-mid { background: #fff7e6; color: #fa8c16; }
.rate-low { background: #fdecec; color: #c0392b; }
.c-rank { text-align: center; }
.c-amount { text-align: right; font-variant-numeric: tabular-nums; }
.c-rate { text-align: center; }
.c-muted { color: #999; }
.income-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 10px; }
.income-card { background: #f9faff; border-radius: 8px; padding: 16px; text-align: center; }
.income-label { font-size: 13px; color: #888; margin-bottom: 6px; }
.income-value { font-size: 22px; font-weight: 700; color: #1a3fb0; }
.income-total { text-align: center; margin-top: 20px; padding-top: 18px; border-top: 1px solid #f0f0f0; }
.income-total-label { color: #888; font-size: 13px; margin-bottom: 6px; }
.income-total-value { font-size: 26px; font-weight: 700; color: #1a8a3a; font-variant-numeric: tabular-nums; }

/* 统计卡片 */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat-card { background: #fff; border-radius: 8px; padding: 16px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.stat-card .k { font-size: 13px; color: #888; margin-bottom: 6px; }
.stat-card .v { font-size: 20px; font-weight: 700; color: #1a3fb0; }
.stat-card.ok .v { color: #1a8a3a; }
.summary-card { background: #fff; border-radius: 8px; padding: 16px; margin-bottom: 16px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.summary-card .k { font-size: 13px; color: #888; }
.summary-card .v { font-size: 20px; font-weight: 700; margin-top: 6px; }

/* 详情表格 */
.detail-table { width: 100%; }
.detail-table th { background: #f9faff; color: #666; width: 120px; }
.detail-table td { color: #333; }
.detail-table .val { font-weight: 600; color: #1f2430; }
.readonly-row { display: flex; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.readonly-row .k { color: #888; font-size: 13px; min-width: 80px; }
.readonly-row .v { color: #333; font-weight: 500; }

/* 文件上传 */
.upload-box { border: 2px dashed #dcdcdc; border-radius: 8px; padding: 20px; text-align: center; color: #888; cursor: pointer; position: relative; overflow: hidden; }
.upload-box:hover { border-color: #2b5cff; color: #2b5cff; }
.upload-box.has-img { padding: 14px; border-style: solid; border-color: #e8e8e8; background: #fafafa; }
.upload-box input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.upload-placeholder { font-size: 13px; color: #999; }
.file-link { display: inline-block; margin-right: 8px; color: #2b5cff; text-decoration: none; }
.img-remove { color: #c0392b; cursor: pointer; font-size: 12px; }
.receipt-img { max-width: 100%; max-height: 220px; border-radius: 6px; display: block; margin: 0 auto 10px; }
.receipt-img-actions { display: flex; align-items: center; justify-content: center; gap: 14px; }
.receipt-img-actions button { padding: 5px 12px; font-size: 12px; }

/* 收款弹窗排版 */
.receipt-contract-row { margin-bottom: 12px; }
.receipt-contract-row select { width: 100%; max-width: 100%; }
.receipt-summary { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.receipt-summary .rs-item { flex: 1; min-width: 120px; background: #f9faff; border-radius: 8px; padding: 10px 12px; }
.receipt-summary .rs-k { display: block; font-size: 12px; color: #888; margin-bottom: 4px; }
.receipt-summary .rs-v { display: block; font-size: 15px; font-weight: 600; color: #1f2430; }
.receipt-screenshot-block { margin-bottom: 16px; }
.rsb-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.rsb-head label { margin-bottom: 0; }
.receipt-form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.receipt-form-grid .field.full { grid-column: 1 / -1; }
.receipt-form-grid .field input,
.receipt-form-grid .field select { width: 100%; }
@media (max-width: 640px) {
  .receipt-form-grid { grid-template-columns: 1fr; }
  .receipt-summary { flex-direction: column; }
}

/* 审批中心 */
.apply-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; padding: 8px 0; }
.apply-card { background: #fff; border: 1px solid #eef0f4; border-radius: 12px; padding: 26px 22px; cursor: pointer; transition: box-shadow .18s, transform .18s, border-color .18s; }
.apply-card:hover { box-shadow: 0 8px 24px rgba(43, 92, 255, .12); transform: translateY(-3px); border-color: #c9d6ff; }
.apply-icon { font-size: 34px; line-height: 1; margin-bottom: 14px; }
.apply-name { font-size: 17px; font-weight: 700; color: #1f2430; margin-bottom: 6px; }
.apply-desc { font-size: 13px; color: #888; margin-bottom: 18px; }
.apply-btn { display: inline-block; padding: 7px 18px; border-radius: 18px; background: #2b5cff; color: #fff; font-size: 13px; }

.approval-ops { display: flex; gap: 6px; flex-wrap: wrap; }
.approval-steps { margin-bottom: 16px; list-style: none; padding-left: 0; }
.approval-steps li { margin-bottom: 16px; border-left: 3px solid #e8e8e8; padding-left: 14px; }
.approval-steps li.step-approved { border-left-color: #1a8a3a; }
.approval-steps li.step-rejected { border-left-color: #c0392b; }
.approval-steps li.step-pending { border-left-color: #2b5cff; }
.step-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.step-idx { width: 24px; height: 24px; border-radius: 50%; background: #2b5cff; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0; }
.step-name { font-weight: 600; font-size: 14px; color: #222; }
.step-mode { font-size: 12px; color: #888; margin-left: auto; }
.step-approver { font-size: 13px; color: #555; }
.step-state { font-size: 12px; padding: 2px 6px; border-radius: 4px; margin-left: 8px; }
.step-state.st-approved { background: #e8f6ec; color: #1a8a3a; }
.step-state.st-rejected { background: #fdecec; color: #c0392b; }
.step-state.st-pending { background: #e6f7ff; color: #1890ff; }
.step-state.st-finished { background: #f0f0f0; color: #666; }
.step-extra { font-size: 12px; color: #999; margin-left: 10px; }
.step-decisions { margin-top: 8px; padding-left: 34px; }
.decision { font-size: 13px; color: #555; margin-bottom: 4px; }
.dcomment { color: #888; margin-left: 6px; }
.dtime { color: #bbb; font-size: 12px; margin-left: 6px; }
.approval-records { margin-top: 16px; }
.approval-status { font-weight: 600; }

/* 审批操作弹框 */
.approval-act { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.approval-act .radio { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 14px; color: #333; }
.approval-act .radio input[type="radio"] { width: 16px; height: 16px; accent-color: #2b5cff; cursor: pointer; }
.approval-act .reject-label { color: #c0392b; }
.approval-act .spacer { flex: 1; }
.modal-body .row textarea { flex: 1; padding: 8px 10px; border: 1px solid #dcdcdc; border-radius: 7px; min-height: 72px; resize: vertical; font-family: inherit; font-size: 13px; }
.modal-foot button.primary.danger { background: #c0392b; }
.modal-body .approval-status .muted { font-size: 12px; color: #999; margin-left: 10px; }

/* 审批流程配置 */
.flow-nodes { border: 1px solid #f0f0f0; border-radius: 8px; padding: 14px; margin-bottom: 14px; }
.flow-sec-title { font-weight: 700; margin-bottom: 10px; }
.flow-field-ops { display: flex; gap: 8px; margin-top: 10px; }
.fields-tip { font-size: 12px; color: #888; margin-bottom: 10px; }
.fields-sec { margin-bottom: 24px; }
.fields-sec .sec-title { font-size: 14px; font-weight: 600; color: #333; }
.fields-sec .link-name { color: #2b5cff; cursor: pointer; }
.fields-sec .link-name:hover { text-decoration: underline; }
.tag-builtin { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 4px; background: #f0f5ff; color: #2b5cff; font-size: 11px; }
tr.row-active { background: #f5f8ff; }
.fields-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.field-group { margin-bottom: 10px; }
.tpl-level { border: 1px solid #f0f0f0; border-radius: 8px; padding: 12px; margin-bottom: 10px; }
.lv-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.chk-group { display: flex; gap: 12px; flex-wrap: wrap; }
.tpl-foot { display: flex; gap: 10px; margin-top: 10px; }
.chip-list { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { background: #f0f0f0; border-radius: 12px; padding: 3px 10px; font-size: 12px; }
.chip-x { margin-left: 6px; color: #999; cursor: pointer; }

/* 客户管理 */
.visit-list { margin-top: 10px; }
.visit-list .item { border-bottom: 1px solid #f0f0f0; padding: 10px 0; }
.hint-row { font-size: 12px; color: #888; margin-top: 4px; }

/* 报表中心 */
.report-landing { padding: 20px; }
.report-section-title { font-size: 16px; font-weight: 700; margin-bottom: 16px; }
.report-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.report-card { background: #fff; border-radius: 10px; padding: 20px; cursor: pointer; transition: box-shadow .18s; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.report-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.report-icon { font-size: 30px; margin-bottom: 10px; }
.report-page-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.report-filters { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.report-summary { background: #f9faff; border-radius: 8px; padding: 14px; margin-bottom: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-6 { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.chart-card { background: #fff; border-radius: 8px; padding: 14px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.pie-chart { width: 100%; height: 240px; }
.pie-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; }

/* Toast */
.toast { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,.75); color: #fff; padding: 10px 22px; border-radius: 20px; z-index: 1000; font-size: 14px; }

/* 系统管理 */
.perms { display: flex; flex-direction: column; gap: 12px; }
.perm-group { border: 1px solid #f0f0f0; border-radius: 8px; padding: 12px; }
.pick-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.pick-panel { background: #f9faff; border-radius: 8px; padding: 10px; max-height: 180px; overflow-y: auto; }
.pick-item { padding: 6px 10px; cursor: pointer; border-radius: 4px; }
.pick-item:hover { background: #e6ecff; }
.switch { display: inline-flex; align-items: center; gap: 8px; }
.add-row { display: flex; gap: 8px; margin-top: 8px; }

/* 通用 */
.text-success { color: #1a8a3a; }
.text-danger { color: #c0392b; }
.text-warning { color: #fa8c16; }
.unpaid { color: #c0392b; }
.warn { color: #fa8c16; }
.danger { color: #c0392b; }
.empty-inline { color: #999; font-size: 13px; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 10px; background: #f0f0f0; font-size: 12px; }

/* 分页 */
.pagination { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 18px; padding: 10px 0; }
.pagination button { padding: 6px 14px; border: 1px solid #dcdcdc; background: #fff; border-radius: 6px; cursor: pointer; font-size: 13px; }
.pagination button:hover:not(:disabled) { border-color: #2b5cff; color: #2b5cff; }
.pagination button:disabled { opacity: .45; cursor: not-allowed; }
.pagination .page-info { font-size: 13px; color: #666; }

/* 操作列更多下拉 */
.more-wrap { display: inline-block; position: relative; }
.more-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 50; min-width: 110px; background: #fff; border: 1px solid #e8e8e8; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 6px 0; }
.more-menu.up { top: auto; bottom: calc(100% + 4px); }
.more-menu button { display: block; width: 100%; text-align: left; padding: 7px 14px; margin: 0; border: none; border-radius: 0; background: #fff; font-size: 13px; color: #333; cursor: pointer; }
.more-menu button:hover { background: #f5f6ff; color: #2b5cff; }
.more-menu button.ok { color: #1a8a3a; }
.more-menu button.no { color: #c0392b; }

/* 表单必填星号 */
.req { color: #e03e3e; margin-right: 2px; }

/* 汉堡按钮：仅移动端出现 */
.nav-toggle { display: none; }


/* ==========================================================
   移动端适配（≤768px）：手机 / 企业微信内打开
   思路：同一套代码自适应，功能与电脑端完全一致
   ========================================================== */
@media (max-width: 768px) {
  /* ---- 导航：侧边栏改抽屉 ---- */
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; margin-right: 10px; flex-shrink: 0;
    font-size: 19px; line-height: 1; color: #555;
    background: #fff; border: 1px solid #dcdcdc; border-radius: 8px; padding: 0;
  }
  .sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; width: 250px; z-index: 500;
    transform: translateX(-100%); transition: transform .25s ease;
    overflow-y: auto; padding-top: 0; box-shadow: 4px 0 20px rgba(0,0,0,.18);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar .logo { padding: calc(16px + env(safe-area-inset-top)) 20px 16px; }
  .sidebar nav a { padding: 14px 20px; font-size: 15px; }
  .nav-mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 499; }

  /* ---- 顶栏 ---- */
  .topbar {
    height: auto; min-height: 52px; gap: 8px;
    padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
  }
  .topbar .crumb { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar .user { gap: 8px; font-size: 12px; }
  .topbar .user .nm { display: none; }
  .topbar .user .co { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .content { padding: 12px 12px calc(24px + env(safe-area-inset-bottom)); min-width: 0; overflow-x: hidden; }
  .panel { padding: 14px; }
  .panel-title { font-size: 15px; }

  /* ---- 表格 → 卡片（列名由 JS 注入 data-label） ---- */
  .content table, .modal-box table { display: block; background: transparent; }
  .content thead, .modal-box thead { display: none; }
  .content tbody, .modal-box tbody { display: block; }
  .content tbody tr, .modal-box tbody tr {
    display: grid; grid-template-columns: 1fr 1fr; gap: 3px 14px;
    background: #fff; border: 1px solid #f0f0f0; border-radius: 10px;
    padding: 11px 13px; margin-bottom: 9px; box-shadow: 0 1px 4px rgba(0,0,0,.06);
  }
  .content tbody td, .modal-box tbody td {
    display: flex; align-items: baseline; gap: 8px; min-width: 0;
    padding: 2px 0; border-bottom: none; font-size: 13px; white-space: normal;
  }
  .content tbody td::before, .modal-box tbody td::before {
    content: attr(data-label); flex: 0 0 auto; min-width: 54px;
    color: #9a9a9a; font-size: 12px; line-height: 1.5;
  }
  .content tbody td.empty::before, .modal-box tbody td.empty::before { content: none; }
  .content tbody td.empty, .modal-box tbody td.empty { grid-column: 1 / -1; display: block; text-align: center; padding: 24px 0; }
  .content tbody td.ops, .modal-box tbody td.ops {
    grid-column: 1 / -1;
    flex-wrap: wrap; gap: 7px; padding-top: 7px; margin-top: 2px;
    border-top: 1px dashed #ececec; white-space: normal;
  }
  .content tbody td.ops::before, .modal-box tbody td.ops::before { display: none; }
  .content tbody td.ops button, .modal-box tbody td.ops button { min-height: 40px; padding: 8px 14px; font-size: 13px; }

  /* 详情表（合同详情等）：不做卡片，压成两列行 */
  .detail-table tbody tr { display: flex; gap: 10px; padding: 9px 0; border: none; border-bottom: 1px solid #f0f0f0; border-radius: 0; box-shadow: none; margin-bottom: 0; background: transparent; }
  .detail-table th { flex: 0 0 92px; width: auto; background: transparent; color: #888; padding: 0; font-size: 13px; }
  .detail-table td { padding: 0; border: none; }
  .detail-table td::before { content: none; }

  /* ---- 网格降级 ---- */
  .cards, .stats-row { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .income-cards { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .income-value { font-size: 17px; }
  .income-card { padding: 12px 6px; }
  .income-total-value { font-size: 22px; }
  .report-cards, .form-grid, .contract-form, .fields-grid, .receipt-form-grid, .grid-2, .apply-grid { grid-template-columns: 1fr; }
  .grid-6 { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .card { padding: 14px; }
  .card .v { font-size: 19px; }

  /* ---- 表单与按钮：加大点击区，16px 防 iOS 聚焦缩放 ---- */
  input, select, textarea { font-size: 16px; padding: 10px; border-radius: 8px; min-height: 42px; }
  input.mini, select.mini, button.mini { min-height: 36px; padding: 8px 10px; font-size: 14px; }
  /* 全局点击区兜底：手机上任何按钮不低于 40px（Apple HIG 建议 44） */
  button { min-height: 40px; padding: 8px 14px; font-size: 14px; border-radius: 8px; }
  button.primary, button.ghost { padding: 10px 16px; font-size: 15px; min-height: 44px; }
  button.sm { min-height: 36px; padding: 7px 12px; font-size: 13px; }
  .tabs button { min-height: 40px; padding: 8px 14px; }
  .sub-nav-tabs button, .sub-tabs button { min-height: 38px; }
  .img-remove, .file-link { min-height: 36px; display: inline-flex; align-items: center; }
  .search-bar, .report-filters { flex-direction: column; align-items: stretch; gap: 8px; }
  .search-bar > *, .report-filters > * { width: 100%; }
  .search-bar .mini { min-width: 0; }
  .add-row { flex-wrap: wrap; }
  .add-row input { flex: 1 1 60%; }

  /* ---- 弹窗：全屏 ---- */
  .modal { align-items: stretch; justify-content: stretch; }
  .modal-box, .modal-box.wide {
    width: 100%; max-width: 100%; height: 100%; max-height: 100%; border-radius: 0;
  }
  .modal-box > h3 { padding: calc(14px + env(safe-area-inset-top)) 16px 14px; }
  .modal-head { padding: calc(14px + env(safe-area-inset-top)) 16px 14px; }
  .modal-body { padding: 14px 12px; -webkit-overflow-scrolling: touch; }
  .modal-foot {
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    position: sticky; bottom: 0; background: #fff;
  }
  .modal-foot button { flex: 1; min-height: 44px; font-size: 15px; }

  /* ---- 消息通知下拉：贴边展开 ---- */
  .notify-drop { position: fixed; top: 54px; left: 8px; right: 8px; width: auto; max-height: 60vh; }

  /* ---- 其他 ---- */
  .login-wrap { padding: 20px; align-items: flex-start; padding-top: 12vh; }
  .login-card { width: 100%; max-width: 360px; padding: 28px 20px; }
  .tabs { gap: 8px; }
  .sub-nav-tabs { overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
  .more-menu { min-width: 130px; }
  .more-menu button { min-height: 40px; }
  .readonly-row { gap: 8px; }
  .readonly-row .k { min-width: 72px; }
  .pie-legend { gap: 8px; font-size: 12px; }
  .toast { top: auto; bottom: 40px; max-width: 86vw; text-align: center; }
}

/* ================= 移动端专属：卡片列表 / 全屏子页 ================= */
/* 说明：这些组件仅在 isMobile（窗口 ≤768px）时渲染，故不重复包 media query */

/* ---- 卡片列表（审批中心、收款管理） ---- */
.m-list { display: flex; flex-direction: column; gap: 10px; }
.m-card {
  background: #fff; border-radius: 12px; padding: 14px 14px 10px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
}
.m-card:active { background: #fafbff; }
.mc-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.mc-title { font-size: 16px; font-weight: 700; color: #1f2430; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-amount { font-size: 17px; font-weight: 700; color: #f5222d; flex-shrink: 0; }
.mc-sub { font-size: 12px; color: #888; margin-top: 4px; }
.mc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; font-size: 13px; color: #555; }
.mc-dot { color: #ccc; }
.mc-node { color: #1a3fb0; }
.mc-cmt { margin-top: 6px; font-size: 12px; color: #777; background: #f7f8fb; border-radius: 6px; padding: 6px 8px; line-height: 1.5; }
.mc-time { margin-top: 6px; font-size: 12px; color: #aaa; }
.mc-my.approve { color: #16a34a; font-weight: 600; }
.mc-my.reject { color: #f5222d; font-weight: 600; }
.mc-foot { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid #f0f0f0; }
.mc-foot button { flex: 1; min-width: 84px; }
.m-card .badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; background: #f0f2f7; color: #555; }
.m-card .badge.pending { background: #fff4e5; color: #d46b08; }
.m-card .badge.approved { background: #e8f8ee; color: #16a34a; }
.m-card .badge.rejected { background: #fdeaea; color: #f5222d; }

/* ---- 全屏子页（审批 / 录收款） ---- */
.m-page {
  position: fixed; inset: 0; z-index: 900;
  display: flex; flex-direction: column;
  background: #f5f6fa;
}
.m-topbar {
  display: flex; align-items: center; justify-content: space-between;
  height: 52px; padding: 0 8px; padding-top: env(safe-area-inset-top);
  background: #fff; border-bottom: 1px solid #eaeaea; flex-shrink: 0;
}
.m-topbar .m-back {
  border: none; background: transparent; color: #1a3fb0; font-size: 16px;
  min-width: 64px; text-align: left; padding: 0 8px; min-height: 44px;
}
.m-topbar .m-title { font-size: 16px; font-weight: 600; color: #222; }
.m-topbar .m-topact {
  min-width: 64px; text-align: right; padding: 0 12px; color: #1a3fb0;
  font-size: 15px; min-height: 44px; display: inline-flex; align-items: center; justify-content: flex-end;
}
.m-body {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 12px 12px calc(16px + env(safe-area-inset-bottom));
}
.m-bottombar {
  flex-shrink: 0; background: #fff; border-top: 1px solid #eaeaea;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 8px;
}
.m-bottombar textarea, .m-bottombar input, .m-bottombar select {
  width: 100%; padding: 10px 12px; border: 1px solid #dcdcdc; border-radius: 8px;
  font-size: 15px; font-family: inherit; background: #fff;
}
.m-bottombar textarea { resize: none; }
.m-actions { display: flex; gap: 8px; }
.m-actions button { flex: 1; min-height: 46px; font-size: 16px; border-radius: 8px; }
.m-actions .primary { flex: 1.3; }
.m-bottombar .block { width: 100%; min-height: 46px; font-size: 16px; border-radius: 8px; }

/* 金额摘要 */
.m-summary {
  background: linear-gradient(135deg, #2b5cff, #5d4ce6); color: #fff;
  border-radius: 12px; padding: 16px 16px 14px; margin-bottom: 12px;
}
.m-summary .ms-amount { font-size: 26px; font-weight: 700; line-height: 1.2; }
.m-summary .ms-sub { font-size: 13px; opacity: .92; margin-top: 6px; }
.m-summary .ms-node { font-size: 12px; opacity: .85; margin-top: 8px; line-height: 1.5; }
.m-summary.sm { padding: 12px 14px; margin-bottom: 12px; }
.m-summary.sm .ms-row { display: flex; justify-content: space-between; font-size: 13px; padding: 3px 0; opacity: .95; }
.m-summary.sm .ms-row b { font-size: 15px; }
.m-summary.sm .ms-row b.unpaid { color: #ffd591; }

/* 分区 */
.m-sec { background: #fff; border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.m-sec-t { font-size: 14px; font-weight: 700; color: #1f2430; margin-bottom: 10px; display: flex; align-items: baseline; gap: 8px; }
.m-sec-h { font-size: 12px; font-weight: 400; color: #aaa; }

/* 键值两列 */
.m-kv { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.m-kv-i { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.m-kv-i.full { grid-column: 1 / -1; }
.m-kv-i .k { font-size: 12px; color: #999; }
.m-kv-i .v { font-size: 14px; color: #222; word-break: break-all; }
.m-files { display: flex; gap: 14px; margin-top: 12px; padding-top: 10px; border-top: 1px solid #f0f0f0; font-size: 14px; }
.m-files a { color: #1a3fb0; text-decoration: none; }

/* 审批进度时间轴 */
.m-steps { display: flex; flex-direction: column; }
.m-step { display: flex; gap: 10px; padding-bottom: 14px; position: relative; }
.m-step:not(:last-child)::before {
  content: ''; position: absolute; left: 4px; top: 14px; bottom: 0; width: 1px; background: #e5e7ef;
}
.m-step .ms-dot { width: 9px; height: 9px; border-radius: 50%; background: #d9dce5; margin-top: 5px; flex-shrink: 0; z-index: 1; }
.m-step.st-approved .ms-dot { background: #16a34a; }
.m-step.st-rejected .ms-dot { background: #f5222d; }
.m-step.st-pending .ms-dot { background: #2b5cff; box-shadow: 0 0 0 3px rgba(43, 92, 255, .15); }
.m-step .ms-body { flex: 1; min-width: 0; }
.m-step .ms-l1 { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 14px; }
.m-step .ms-state { font-size: 12px; color: #888; }
.m-step.st-approved .ms-state { color: #16a34a; }
.m-step.st-rejected .ms-state { color: #f5222d; }
.m-step.st-pending .ms-state { color: #2b5cff; }
.m-step .ms-l2 { font-size: 12px; color: #888; margin-top: 2px; }
.m-step .ms-dec { font-size: 12px; color: #555; margin-top: 6px; background: #f7f8fb; border-radius: 6px; padding: 6px 8px; }
.m-step .ms-dec b.approve { color: #16a34a; }
.m-step .ms-dec b.reject { color: #f5222d; }

/* 列自定义弹窗 */
.col-settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; }
.col-settings-grid .col-cfg { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.col-settings-grid .col-cfg:hover { background: #f5f6ff; }
.col-settings-grid .col-cfg.disabled { opacity: 0.6; cursor: not-allowed; }
.col-settings-grid .col-cfg input { cursor: inherit; }
.col-settings-grid .col-cfg small { margin-left: auto; font-size: 11px; }
@media (max-width: 600px) { .col-settings-grid { grid-template-columns: 1fr; } }

/* 表单字段 */
.m-field { background: #fff; border-radius: 10px; padding: 10px 14px; margin-bottom: 10px; }
.m-field label { display: block; font-size: 12px; color: #999; margin-bottom: 6px; }
.m-field input, .m-field select {
  width: 100%; border: none; font-size: 16px; color: #222; background: transparent;
  padding: 0; min-height: 40px; font-family: inherit;
}
.m-field input:focus, .m-field select:focus { outline: none; }

/* 截图上传 */
.m-shot img { width: 100%; max-height: 240px; object-fit: contain; background: #f7f8fb; border-radius: 8px; }
.m-shot-acts { display: flex; gap: 8px; margin-top: 10px; }
.m-shot-acts button { flex: 1; min-height: 44px; }
.m-shot-empty { display: flex; gap: 10px; }
.m-shot-empty button { flex: 1; min-height: 76px; font-size: 15px; border-radius: 10px; border: 1px dashed #c9cfe0; }
.m-shot-empty .primary { border: none; }
.m-file { display: none; }

/* 悬浮按钮 */
.m-fab {
  position: fixed; right: 16px; bottom: calc(20px + env(safe-area-inset-bottom));
  width: 54px; height: 54px; border-radius: 27px; border: none;
  background: linear-gradient(135deg, #2b5cff, #5d4ce6); color: #fff; font-size: 26px;
  box-shadow: 0 6px 18px rgba(43, 92, 255, .38); z-index: 500; line-height: 1;
}
.m-fab:active { transform: scale(.94); }

/* 移动端隐藏（仅桌面显示的按钮） */
@media (max-width: 768px) { .m-hide { display: none !important; } }

/* ==================== 财务管理 ==================== */
.fin-total { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.fin-total-item {
  background: #fff; border: 1px solid #eef0f5; border-radius: 10px;
  padding: 10px 16px; min-width: 118px; flex: 1;
}
.fin-total-item em { display: block; font-style: normal; font-size: 12px; color: #999; margin-bottom: 4px; }
.fin-total-item b { font-size: 17px; color: #222; }
.fin-total-item b.in, .fin-kv span.in, td.in, .fin-row-main b.in { color: #d4380d; }
.fin-total-item b.out, .fin-kv span.out, td.out, .fin-row-main b.out { color: #389e0d; }
.fin-total-item b.ok, .fin-kv span.ok, td.ok { color: #389e0d; }
.fin-total-item b.no, .fin-kv span.no, .fin-result.no b { color: #cf1322; }
.fin-total-item b.warn, .fin-kv span.warn, td.warn { color: #fa8c16; }

.fin-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }
.fin-card { background: #fff; border: 1px solid #eef0f5; border-radius: 12px; padding: 14px 16px; }
.fin-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.fin-card-head > div:first-child { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fin-card-head b { font-size: 15px; }
.fin-card-body { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.fin-kv { display: flex; justify-content: space-between; font-size: 13px; border-bottom: 1px dashed #f0f0f0; padding: 3px 0; }
.fin-kv em { font-style: normal; color: #999; }
.fin-kv span { color: #333; font-weight: 500; }

.fin-tag {
  display: inline-block; background: #f5f6fa; color: #666; border-radius: 4px;
  padding: 1px 6px; font-size: 11px; line-height: 18px;
}
.fin-upload {
  position: relative; display: inline-flex; align-items: center; cursor: pointer;
  background: #7c6df2; color: #fff; border-radius: 6px; padding: 8px 16px; font-size: 14px;
}
.fin-upload input { position: absolute; left: 0; top: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.fin-upload.disabled { background: #c0c4cc; cursor: not-allowed; }
.fin-tip { font-size: 12px; color: #888; margin: 6px 0 12px; line-height: 1.6; }
.fin-result { border-radius: 8px; padding: 10px 14px; margin-bottom: 12px; font-size: 13px; line-height: 1.7; }
.fin-result.ok { background: #f6ffed; border: 1px solid #b7eb8f; }
.fin-result.no { background: #fff2f0; border: 1px solid #ffccc7; }
.fin-result.ok b { color: #389e0d; }

.fin-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fin-pair-col h4 { margin: 0 0 8px; font-size: 14px; color: #333; }
.fin-list { max-height: 420px; overflow-y: auto; border: 1px solid #eef0f5; border-radius: 10px; background: #fff; }
.fin-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 12px; border-bottom: 1px solid #f5f5f5;
}
.fin-row:last-child { border-bottom: none; }
.fin-row-main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.fin-row-main b { font-size: 15px; }
.fin-row-main span { font-size: 12px; color: #888; }
.fin-row-main em { font-style: normal; font-size: 12px; color: #555; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.fin-row-side { flex-shrink: 0; }

@media (max-width: 768px) {
  .fin-cards { grid-template-columns: 1fr; }
  .fin-pair { grid-template-columns: 1fr; }
  .fin-list { max-height: 300px; }
  .fin-total-item { min-width: 33%; padding: 8px 10px; }
  .fin-total-item b { font-size: 15px; }
  .fin-card-body { grid-template-columns: 1fr; }
  .fin-row-main em { max-width: 100%; }
}

/* Flow Editor - WeChat Work Style */
.flow-editor-modal {
  /* 确保模态框不会超出视口 */
  max-width: 100vw;
  overflow: hidden;
}
.flow-editor-modal .modal-box { 
  width: 90vw !important; 
  max-width: 1100px !important; 
  height: 85vh !important; 
  max-height: 700px !important;
  display: flex !important; 
  flex-direction: column !important;
  margin: 0 auto !important;
  box-sizing: border-box !important;
}
.flow-editor-modal .modal-body { 
  flex: 1; 
  overflow-y: auto; 
  padding: 0 !important; /* 覆盖全局modal-body的padding */
  display: flex; 
  flex-direction: column;
  min-height: 0; /* 关键：允许flex子元素收缩 */
  box-sizing: border-box;
}
/* Modal Footer - 固定在底部 */
.flow-editor-modal .modal-foot { 
  border-top: 1px solid #eef0f5; 
  padding: 16px 20px !important;
  background: #fff; 
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}
.flow-editor-modal .modal-foot button {
  min-width: 80px;
  padding: 8px 20px;
}
.flow-editor-modal .modal-foot button.primary {
  background: #2b5cff;
  color: #fff;
  border: none;
}

/* Basic Info Section */
.flow-basic-info { 
  padding: 20px; 
  border-bottom: 1px solid #eef0f5; 
  background: #fafbfc; 
  flex-shrink: 0; 
}
.flow-basic-info .row { margin-bottom: 12px; }
.flow-basic-info .row:last-child { margin-bottom: 0; }

/* Two-Column Layout */
.flow-editor-content { 
  display: flex; 
  height: 380px; 
  overflow: hidden; 
  flex-shrink: 0;
  border-bottom: 1px solid #eef0f5;
}
.flow-preview-panel { 
  flex: 1; 
  border-right: 1px solid #eef0f5; 
  background: #fff; 
  overflow-y: auto; 
  padding: 20px;
  min-width: 0; /* 防止内容溢出 */
}
.flow-settings-panel { 
  width: 380px; 
  background: #fafbfc; 
  overflow-y: auto; 
  padding: 20px; 
  flex-shrink: 0;
  border-left: 1px solid #eef0f5;
}
.flow-settings-panel.empty-panel { 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  color: #999; 
  font-size: 14px; 
}

/* Panel Header */
.panel-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-shrink: 0; }
.panel-header span { font-size: 14px; font-weight: 500; color: #333; }

/* Field List Container */
.field-list-container { display: flex; flex-direction: column; gap: 8px; }

/* Field Item */
.field-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border: 1px solid #eef0f5; border-radius: 8px; background: #fff;
  cursor: pointer; transition: all 0.2s; user-select: none;
}
.field-item:hover { border-color: #2b5cff; box-shadow: 0 2px 8px rgba(43, 92, 255, 0.08); }
.field-item.active { border-color: #2b5cff; background: #f0f5ff; }
.field-drag-handle { cursor: grab; color: #999; font-size: 18px; line-height: 1; flex-shrink: 0; }
.field-drag-handle:active { cursor: grabbing; }
.field-icon { width: 36px; height: 36px; border-radius: 6px; background: #f0f5ff; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.field-info { flex: 1; min-width: 0; }
.field-name { font-size: 14px; color: #333; font-weight: 500; margin-bottom: 2px; }
.field-name .required-mark { color: #ff4d4f; margin-left: 4px; }
.field-type { font-size: 12px; color: #888; }
.field-actions { display: flex; gap: 6px; flex-shrink: 0; }
.icon-btn { padding: 4px 8px; border: 1px solid #d9d9d9; border-radius: 4px; background: #fff; cursor: pointer; font-size: 14px; line-height: 1; }
.icon-btn:hover { border-color: #2b5cff; color: #2b5cff; }
.icon-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.icon-btn.danger:hover { border-color: #ff4d4f; color: #ff4d4f; }

/* Empty State */
.empty-state { text-align: center; padding: 60px 20px; color: #999; }
.empty-state p { margin: 0; font-size: 13px; }

/* Settings Content */
.settings-content { display: flex; flex-direction: column; gap: 20px; }
.setting-group { display: flex; flex-direction: column; gap: 8px; }
.setting-group label { font-size: 13px; color: #666; font-weight: 500; }
.setting-group input[type="text"],
.setting-group input[type="number"],
.setting-group textarea,
.setting-group select { width: 100%; padding: 8px 12px; border: 1px solid #d9d9d9; border-radius: 6px; font-size: 14px; box-sizing: border-box; }
.setting-group textarea { min-height: 80px; resize: vertical; }
.checkbox-group { flex-direction: row; align-items: center; }
.hint-text { font-size: 12px; color: #999; padding: 8px 0; }

/* Sub-fields in Detail Control */
.detail-subfields { border-top: 1px solid #eef0f5; padding-top: 16px; margin-top: 8px; }
.full-width { width: 100%; margin-top: 8px; }
.empty-subfields { text-align: center; padding: 20px; color: #999; font-size: 13px; background: #f5f5f5; border-radius: 6px; margin-top: 8px; }
.subfield-item { border: 1px solid #eef0f5; border-radius: 6px; background: #fff; padding: 12px; margin-top: 8px; }
.subfield-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.subfield-header span { font-size: 13px; font-weight: 500; color: #333; }
.subfield-row { margin-bottom: 10px; }
.subfield-row:last-child { margin-bottom: 0; }
.subfield-row label { display: block; font-size: 12px; color: #666; margin-bottom: 4px; }
.subfield-row input,
.subfield-row select { width: 100%; padding: 6px 10px; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 13px; box-sizing: border-box; }

/* Approval Nodes Section */
.flow-nodes-section { 
  padding: 20px; 
  background: #fafbfc; 
  flex-shrink: 0;
}
.section-title { margin: 0 0 16px; font-size: 16px; color: #333; font-weight: 500; }
.node-card { border: 1px solid #eef0f5; border-radius: 8px; background: #fff; padding: 16px; margin-bottom: 12px; }
.node-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.node-header span { font-size: 14px; font-weight: 500; color: #333; }
.node-body .row { margin-bottom: 12px; }
.node-body .row:last-child { margin-bottom: 0; }
.tpl-foot { margin-top: 12px; }

/* Responsive */
@media (max-width: 1200px) {
  .flow-editor-modal .modal-box { width: 95vw; height: 90vh; max-height: none; }
  .flow-settings-panel { width: 350px; }
  .flow-editor-content { height: 350px; }
}
@media (max-width: 768px) {
  .flow-editor-modal .modal-box { width: 98vw; height: 95vh; }
  .flow-editor-content { flex-direction: column; height: 300px; }
  .flow-preview-panel { border-right: none; border-bottom: 1px solid #eef0f5; height: 160px; }
  .flow-settings-panel { width: 100%; height: 140px; border-left: none; border-top: 1px solid #eef0f5; }
  .field-item { flex-wrap: wrap; }
  .field-actions { width: 100%; justify-content: flex-end; margin-top: 8px; }
}

/* ================= 移动端企微风格审批中心（hub） ================= */
.m-hub { background: #f7f8fa; }
.m-hub .hub-top { background: #f7f8fa; border-bottom: none; }
.m-hub .hub-top .m-title { font-weight: 600; font-size: 17px; color: #1a1a1a; }
.m-hub .hub-top .m-back { font-size: 26px; background: none; border: none; color: #1a1a1a; min-width: 40px; min-height: 40px; }
.hub-body { padding: 4px 0 calc(70px + env(safe-area-inset-bottom)); }
.hub-search {
  display: flex; align-items: center; gap: 8px;
  margin: 6px 12px 12px; padding: 10px 14px;
  background: #fff; border-radius: 10px;
}
.hub-search .ico { font-size: 15px; opacity: .55; }
.hub-search input { flex: 1; min-width: 0; border: none; background: none; font-size: 15px; color: #333; }
.hub-search input:focus { outline: none; }
.hub-group { background: #fff; border-radius: 12px; margin: 0 12px 12px; overflow: hidden; }
.hub-group-t { padding: 14px 16px 2px; font-size: 13px; color: #9aa0ab; }
.hub-grid { display: grid; grid-template-columns: repeat(3, 1fr); }
.hub-app { padding: 18px 4px 16px; text-align: center; cursor: pointer; }
.hub-app:active { background: #f2f4f8; }
.ha-ico { font-size: 30px; line-height: 1; }
.ha-name { margin-top: 8px; font-size: 13px; color: #333; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hub-list { padding: 0 12px; }
.hub-card {
  position: relative; background: #fff; border-radius: 12px;
  padding: 13px 14px 12px; margin-bottom: 10px; cursor: pointer;
}
.hub-card:active { background: #fafbfc; }
.hc-l1 { display: flex; align-items: center; gap: 6px; padding-right: 40px; }
.hc-title { flex: 1; min-width: 0; font-size: 15px; font-weight: 600; color: #1a1a1a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hc-badge { flex-shrink: 0; font-size: 11px; padding: 1px 7px; border-radius: 4px; }
.hc-time { position: absolute; right: 14px; top: 15px; font-size: 12px; color: #b0b5bf; }
.hc-kv { display: flex; margin-top: 6px; font-size: 13px; line-height: 1.5; }
.hc-kv .k { flex-shrink: 0; color: #9aa0ab; }
.hc-kv .v { flex: 1; min-width: 0; color: #444; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hc-node { margin-top: 7px; font-size: 12px; color: #8a909f; }
.hc-ops { display: flex; justify-content: flex-end; gap: 8px; margin-top: 9px; padding-top: 9px; border-top: 1px solid #f2f3f7; }
.hc-ops button { min-height: 30px; padding: 4px 12px; font-size: 12px; border-radius: 15px; }
.hub-tabbar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 5;
  display: flex; background: #fff; border-top: 1px solid #eceef2;
  padding: 5px 0 calc(5px + env(safe-area-inset-bottom));
}
.ht-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: #7b8190; cursor: pointer; padding: 3px 0; }
.ht-item .ht-ico { font-size: 21px; line-height: 1.1; filter: grayscale(1) opacity(.6); }
.ht-item.active { color: #1677ff; font-weight: 500; }
.ht-item.active .ht-ico { filter: none; }
/* 企微风格徽标配色（审批中=蓝、已通过=绿、已驳回=红） */
.hub-card .badge.pending { background: #e8f3ff; color: #1677ff; }
.hub-card .badge.approved { background: #e8f7ec; color: #12a35a; }
.hub-card .badge.rejected { background: #fdecec; color: #e05252; }
/* 移动端：侧栏折叠按钮点击区兜底 ≥40px（体检报告项） */
@media (max-width: 768px) {
  .sidebar .sidebar-toggle { min-height: 40px; min-width: 40px; padding: 8px 10px; }
}

/* ===== 明细（detail）控件：发起表单可增删行 + 金额自动合计 ===== */
.detail-block { flex: 1; min-width: 0; }
.dtl-card { border: 1px solid #e5e7ee; border-radius: 8px; padding: 10px 12px 4px; margin-bottom: 8px; background: #fafbfd; }
.dtl-head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: #8a909f; margin-bottom: 8px; }
.dtl-row { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.dtl-row label { width: 76px; flex-shrink: 0; font-size: 13px; color: #555; padding-top: 8px; text-align: right; }
.dtl-row textarea, .dtl-row input, .dtl-row select { flex: 1; min-width: 0; }
.dtl-add { width: 100%; min-height: 38px; border: 1px dashed #b6bcff; color: #5d4ce6; background: #fff; border-radius: 8px; cursor: pointer; }
.dtl-add:active { background: #f2f2ff; }
.dtl-sum { font-size: 13px; color: #333; margin-top: 10px; }
.dtl-sum b { color: #e6742a; font-size: 15px; margin: 0 2px; }
td.mono { font-size: 12px; color: #555; }
@media (max-width: 768px) {
  .detail-block { width: 100%; }
  .dtl-row label { width: 68px; text-align: left; padding-top: 8px; }
}
