/* 气合网管理后台外壳：沿用「交易数据及月度运营报表Demo/prototype.html」既有样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif; font-size: 14px; color: #333; background: #f0f2f5; display: flex; height: 100vh; overflow: hidden; }

.sidebar { width: 232px; background: #fff; display: flex; flex-direction: column; flex-shrink: 0; border-right: 1px solid #f0f0f0; }
.sidebar-logo { padding: 18px 20px; font-size: 16px; font-weight: 600; border-bottom: 1px solid #f0f0f0; display: flex; align-items: center; gap: 10px; color: #1a1a1a; }
.sidebar-logo .logo-icon { width: 30px; height: 30px; background: #1677ff; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 14px; color: #fff; }
.sidebar-menu { flex: 1; padding: 12px 0; overflow-y: auto; }
.menu-group { padding: 10px 20px 6px; font-size: 12px; color: #b0b6bf; }
.menu-item { display: flex; align-items: center; gap: 10px; padding: 10px 20px; color: #666; cursor: pointer; transition: all .2s; font-size: 14px; }
.menu-item:hover { color: #1677ff; background: #f0f5ff; }
.menu-item.active { color: #1677ff; background: #e6f4ff; font-weight: 500; border-right: 3px solid #1677ff; }
.menu-item .icon { width: 16px; text-align: center; }
.menu-item .lbl { white-space: nowrap; }
.new-dot { margin-left: auto; white-space: nowrap; font-size: 11px; background: #fff1f0; color: #f5222d; border-radius: 8px; padding: 0 6px; line-height: 17px; }

.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.top-bar { height: 48px; background: #fff; border-bottom: 1px solid #f0f0f0; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; flex-shrink: 0; }
.breadcrumb { font-size: 13px; color: #999; }
.breadcrumb span { color: #333; }
.top-right { display: flex; align-items: center; gap: 12px; }
.bell { font-size: 13px; color: #666; }
.avatar { width: 28px; height: 28px; background: #1677ff; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; }
.uname { font-size: 13px; }

.content { flex: 1; overflow-y: auto; padding: 16px 20px; }
.page-card { background: #fff; border-radius: 8px; box-shadow: 0 1px 2px rgba(0,0,0,.04); overflow: hidden; }

.toolbar { padding: 16px 24px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #f0f0f0; }
.toolbar-left { display: flex; align-items: center; gap: 12px; }
.toolbar-left h1 { font-size: 18px; font-weight: 600; color: #1a1a1a; }
.record-badge { font-size: 12px; color: #666; background: #f5f5f5; padding: 3px 10px; border-radius: 10px; }
.toolbar-right { display: flex; gap: 8px; }

.btn { padding: 7px 16px; border-radius: 6px; font-size: 13px; cursor: pointer; border: 1px solid #d9d9d9; background: #fff; color: #333; transition: all .2s; display: inline-flex; align-items: center; gap: 6px; font-family: inherit; }
.btn:hover { border-color: #1677ff; color: #1677ff; }
.btn:disabled { color: #bfbfbf; background: #f5f5f5; border-color: #d9d9d9; cursor: not-allowed; }
.btn-primary { background: #1677ff; color: #fff; border-color: #1677ff; font-weight: 500; }
.btn-primary:hover { background: #4096ff; border-color: #4096ff; color: #fff; }
.btn-sm { padding: 4px 12px; font-size: 12px; }

.scope-note { padding: 10px 24px; font-size: 12px; color: #8c8c8c; background: #fafcff; border-bottom: 1px solid #f0f0f0; }
.scope-note b { color: #1677ff; font-weight: 500; }

.filter-section { background: #fff; border-bottom: 1px solid #e8e8e8; }
.filter-bar { display: flex; align-items: center; gap: 10px; padding: 14px 24px; flex-wrap: wrap; }
.filter-label { font-weight: 500; font-size: 13px; color: #333; white-space: nowrap; }
.filter-divider { width: 1px; height: 22px; background: #e8e8e8; margin: 0 6px; }
.filter-group label { display: block; font-size: 12px; color: #666; margin-bottom: 5px; }
.filter-input, .filter-select { width: 100%; height: 32px; padding: 0 10px; border: 1px solid #d9d9d9; border-radius: 6px; font-size: 13px; font-family: inherit; color: #333; outline: none; background: #fff; }
.filter-input:focus, .filter-select:focus { border-color: #1677ff; box-shadow: 0 0 0 2px rgba(22,119,255,.1); }
.filter-select.inline { width: 110px; }
.date-inputs { display: flex; align-items: center; gap: 6px; }
.date-input { width: 148px; height: 32px; padding: 0 8px; border: 1px solid #d9d9d9; border-radius: 6px; font-size: 13px; font-family: inherit; color: #333; outline: none; }
.date-input:focus { border-color: #1677ff; }
.date-sep { color: #bbb; }

.advanced-toggle-btn { margin-left: auto; font-size: 12px; color: #1677ff; background: none; border: 0; cursor: pointer; display: flex; align-items: center; gap: 6px; font-family: inherit; padding: 0; }
.advanced-toggle-btn:hover { color: #4096ff; }
.advanced-toggle-btn .adv-arrow { width: 0; height: 0; border: 4px solid transparent; border-top-color: currentColor; margin-top: 3px; transition: transform .2s; }
.advanced-toggle-btn.open .adv-arrow { transform: rotate(180deg); margin-top: -3px; }
.adv-count { background: #1677ff; color: #fff; border-radius: 8px; padding: 0 6px; font-size: 11px; line-height: 16px; font-style: normal; }
.advanced-filters { display: none; padding: 0 24px; }
.advanced-filters.show { display: block; }
.filter-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 20px; padding: 14px 0 16px; border-top: 1px dashed #eee; }

.btn-query { padding: 7px 22px; border-radius: 6px; font-size: 13px; cursor: pointer; border: 1px solid #1677ff; background: #1677ff; color: #fff; font-family: inherit; font-weight: 500; }
.btn-query:hover { background: #4096ff; }
.btn-reset { padding: 7px 18px; border-radius: 6px; font-size: 13px; cursor: pointer; border: 1px solid #d9d9d9; background: #fff; color: #666; font-family: inherit; }
.btn-reset:hover { color: #1677ff; border-color: #1677ff; }

.summary-bar { display: flex; gap: 32px; padding: 12px 24px; background: #f7faff; border-bottom: 1px solid #e8e8e8; flex-wrap: wrap; }
.sum-item { font-size: 12px; color: #8c8c8c; }
.sum-item b { display: block; font-size: 17px; color: #1a1a1a; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }
.sum-item.ok b { color: #52c41a; }
.sum-item.warn b { color: #fa8c16; }
.sum-item.bad b { color: #f5222d; }
.sum-item small { font-size: 11px; color: #bfbfbf; margin-left: 4px; font-weight: 400; }

.batch-bar { display: flex; align-items: center; justify-content: space-between; padding: 10px 24px; border-bottom: 1px solid #f0f0f0; }
.batch-info { font-size: 12px; color: #8c8c8c; }
.batch-actions { display: flex; gap: 8px; }

.table-wrapper { overflow: auto; max-height: calc(100vh - 380px); min-height: 320px; }
table { width: 100%; min-width: 1720px; border-collapse: separate; border-spacing: 0; font-size: 13px; }
thead th { padding: 11px 12px; text-align: left; font-weight: 500; color: #666; background: #fafafa; border-bottom: 1px solid #f0f0f0; white-space: nowrap; position: sticky; top: 0; z-index: 3; }
thead th.right, tbody td.right { text-align: right; }
tbody tr:hover { background: #e6f4ff; }
tbody td { padding: 10px 12px; border-bottom: 1px solid #f5f5f5; white-space: nowrap; font-variant-numeric: tabular-nums; background-clip: padding-box; }
tbody td.chk, thead th.chk { width: 38px; text-align: center; }
td.num { font-variant-numeric: tabular-nums; }
td.ent { max-width: 210px; overflow: hidden; text-overflow: ellipsis; }
.cell-hl-bad { background: #fff1f0; }
.cell-hl-warn { background: #fff7e6; }
.req-no { color: #1677ff; cursor: default; }

/* 冻结列：左侧定位（复选框+需求单号）、右侧操作（数据状态+计入表格） */
.col-reqno { width: 152px; min-width: 152px; }
.col-status { width: 136px; min-width: 136px; }
.col-include { width: 112px; min-width: 112px; }
.sticky-l, .sticky-r { position: sticky; z-index: 2; background: #fff; border-bottom-color: transparent; }
thead .sticky-l, thead .sticky-r { z-index: 5; background: #fafafa; border-bottom: 1px solid #f0f0f0; }
.sl-0 { left: 0; }
.sl-1 { left: 38px; box-shadow: 8px 0 8px -8px rgba(0,0,0,.18); }
.sr-1 { right: 112px; box-shadow: -8px 0 8px -8px rgba(0,0,0,.18); }
.sr-0 { right: 0; }
tbody tr:hover .sticky-l, tbody tr:hover .sticky-r { background: #e6f4ff; }

.tag { display: inline-block; padding: 1px 8px; border-radius: 4px; font-size: 12px; font-weight: 500; }
.tag-green { background: #f6ffed; color: #52c41a; }
.tag-orange { background: #fff7e6; color: #fa8c16; }
.tag-red { background: #fff1f0; color: #f5222d; }
.tag-grey { background: #f5f5f5; color: #8c8c8c; }

.switch { position: relative; display: inline-block; width: 40px; height: 20px; vertical-align: middle; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; background: #bfbfbf; border-radius: 10px; transition: .2s; cursor: pointer; }
.switch .slider::before { content: ""; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + .slider { background: #52c41a; }
.switch input:checked + .slider::before { transform: translateX(20px); }
.switch-lbl { font-size: 12px; color: #8c8c8c; margin-left: 8px; }

.table-footer { padding: 12px 24px; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid #f0f0f0; background: #fafbfc; }
.summary { display: flex; gap: 20px; font-size: 12px; color: #666; }
.summary strong { color: #1a1a1a; font-weight: 600; }
.pagination { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.page-size { display: flex; align-items: center; gap: 4px; color: #666; font-size: 12px; margin-right: 12px; }
.page-size select { padding: 2px 6px; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 12px; }
.page-btn { min-width: 28px; height: 28px; padding: 0 6px; border: 1px solid #d9d9d9; background: #fff; border-radius: 4px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 12px; }
.page-btn:hover { border-color: #1677ff; color: #1677ff; }
.page-btn.active { background: #1677ff; color: #fff; border-color: #1677ff; }
.page-btn.disabled { color: #d9d9d9; cursor: not-allowed; }

.foot-note { padding: 14px 24px 20px; font-size: 12px; color: #bfbfbf; line-height: 1.9; border-top: 1px solid #f5f5f5; }
.foot-note b { color: #fa8c16; font-weight: 500; }

.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: none; align-items: center; justify-content: center; z-index: 1000; }
.modal-mask.show { display: flex; }
.modal { background: #fff; border-radius: 8px; width: 640px; max-width: 92vw; max-height: 86vh; display: flex; flex-direction: column; }
.modal.wide { width: 960px; }
.modal.narrow { width: 460px; }
.modal-head { padding: 14px 20px; border-bottom: 1px solid #f0f0f0; display: flex; align-items: center; gap: 10px; }
.modal-head b { font-size: 15px; }
.modal-sub { font-size: 12px; color: #8c8c8c; }
.modal-close { margin-left: auto; border: 0; background: none; font-size: 20px; color: #999; cursor: pointer; line-height: 1; }
.modal-body { padding: 18px 20px; overflow-y: auto; font-size: 13px; line-height: 1.8; }
.modal-foot { padding: 12px 20px; border-top: 1px solid #f0f0f0; display: flex; justify-content: flex-end; gap: 8px; }
.curve-box { height: 380px; }
.rule-table { width: 100%; border-collapse: collapse; margin: 8px 0 12px; font-size: 12px; }
.rule-table td { border: 1px solid #f0f0f0; padding: 6px 10px; }
.rule-table td:first-child { background: #fafafa; color: #666; width: 120px; }
.rule-body ul { padding-left: 18px; color: #555; }
.rule-tip { font-size: 12px; color: #fa8c16; background: #fff7e6; border-radius: 4px; padding: 8px 10px; }
.rule-stats { margin-top: 12px; font-size: 12px; color: #8c8c8c; background: #fafafa; border-radius: 4px; padding: 10px 12px; font-variant-numeric: tabular-nums; }

.toast { position: fixed; top: 24px; left: 50%; transform: translateX(-50%) translateY(-12px); background: #fdf6ec; color: #e6a23c; border: 1px solid #faecd8; padding: 9px 16px; border-radius: 4px; font-size: 13px; opacity: 0; pointer-events: none; transition: .25s; z-index: 2000; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
