* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif; font-size: 14px; color: #262626; background: #f0f2f5; }
button, input, select { font-family: inherit; font-size: 14px; }
.hidden { display: none !important; }
.layout { height: 100%; display: flex; flex-direction: column; }
.topbar { height: 48px; flex: 0 0 48px; background: #1890ff; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; color: #fff; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.brand-logo { width: 26px; height: 26px; object-fit: contain; }
.brand-name { font-size: 18px; letter-spacing: 2px; white-space: nowrap; }
.icon-btn { border: 0; background: transparent; padding: 6px; cursor: pointer; display: flex; align-items: center; border-radius: 3px; }
.icon-btn:hover { background: rgba(255,255,255,.18); }
.collapse { margin-right: 2px; }
.top-right { display: flex; align-items: center; gap: 14px; }
.top-search { display: flex; align-items: center; gap: 6px; background: rgba(255,255,255,.16); border-radius: 3px; padding: 0 10px; height: 30px; }
.top-search input { border: 0; background: transparent; color: #fff; outline: none; width: 150px; }
.top-search input::placeholder { color: rgba(255,255,255,.75); }
.user { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.avatar { width: 24px; height: 24px; border-radius: 50%; background: rgba(255,255,255,.28); display: flex; align-items: center; justify-content: center; font-size: 12px; }
.logout { border: 0; background: transparent; color: #fff; cursor: pointer; padding: 6px 2px; }
.logout:hover { text-decoration: underline; }
.body { flex: 1; display: flex; min-height: 0; }
.sider { width: 208px; flex: 0 0 208px; background: #fff; border-right: 1px solid #e8e8e8; overflow-y: auto; transition: width .18s, flex-basis .18s; }
.layout.collapsed .sider { width: 0; flex-basis: 0; overflow: hidden; }
.menu { padding: 8px 0 24px; }
.menu-title { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 16px; cursor: pointer; color: #314659; white-space: nowrap; }
.menu-title:hover { color: #1890ff; background: #f5faff; }
.menu-title .dot { width: 14px; height: 14px; border: 2px solid #8cc8ff; border-radius: 3px; flex: 0 0 14px; }
.menu-title .arrow { margin-left: auto; width: 0; height: 0; border-left: 4px solid #8c8c8c; border-top: 4px solid transparent; border-bottom: 4px solid transparent; transition: transform .18s; }
.menu-group.open > .menu-title .arrow { transform: rotate(90deg); }
.menu-children { display: none; }
.menu-group.open .menu-children { display: block; }
.menu-item { height: 38px; line-height: 38px; padding: 0 16px 0 40px; cursor: pointer; color: #595959; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-item:hover { color: #1890ff; background: #f5faff; }
.menu-item.active { color: #1890ff; background: #e6f7ff; border-right: 3px solid #1890ff; }
.menu-single { height: 40px; line-height: 40px; padding: 0 16px; cursor: pointer; color: #314659; display: flex; align-items: center; gap: 10px; }
.menu-single:hover, .menu-single.active { color: #1890ff; background: #e6f7ff; }
.menu-single .dot { width: 14px; height: 14px; border: 2px solid #8cc8ff; border-radius: 50%; }
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tabs { height: 40px; flex: 0 0 40px; background: #fff; border-bottom: 1px solid #e8e8e8; display: flex; align-items: stretch; overflow-x: auto; }
.tab { display: flex; align-items: center; gap: 8px; padding: 0 14px; border-right: 1px solid #f0f0f0; cursor: pointer; color: #595959; white-space: nowrap; font-size: 13px; }
.tab.active { color: #1890ff; background: #f0faff; }
.tab-close { border: 0; background: transparent; color: #8c8c8c; cursor: pointer; font-size: 15px; line-height: 1; padding: 0; }
.tab-close:hover { color: #ff4d4f; }
.views { flex: 1; overflow: auto; padding: 16px; }
.card { background: #fff; border: 1px solid #e8e8e8; border-radius: 3px; padding: 16px; margin-bottom: 16px; }
.welcome { font-size: 20px; margin: 0 0 4px; }
.welcome-sub { color: #8c8c8c; margin: 0; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.stat-card { background: #fff; border: 1px solid #e8e8e8; border-radius: 3px; padding: 18px 20px; }
.stat-label { color: #8c8c8c; font-size: 13px; }
.stat-value { font-size: 28px; margin: 8px 0; color: #262626; }
.stat-hint { color: #8c8c8c; font-size: 12px; }
.chart-row { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.chart-title { font-size: 15px; margin: 0 0 12px; font-weight: 500; }
.chart-svg { width: 100%; height: 180px; display: block; }
.counter-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.counter { text-align: center; border-left: 1px solid #f0f0f0; }
.counter-label { color: #8c8c8c; font-size: 12px; }
.counter-value { font-size: 22px; color: #1890ff; margin-top: 6px; }
.page-head { font-size: 16px; font-weight: 500; margin: 0 0 14px; }
.filter-grid { display: grid; grid-template-columns: repeat(4, minmax(140px, 1fr)); gap: 12px; }
.filter-grid.compact .filter-item:nth-child(n+3) { display: none; }
.filter-item { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: #595959; }
.filter-item input, .edit-input { height: 32px; border: 1px solid #d9d9d9; border-radius: 2px; padding: 0 8px; outline: none; width: 100%; }
.filter-item select { height: 32px; border: 1px solid #d9d9d9; border-radius: 2px; padding: 0 8px; outline: none; width: 100%; background: #fff; color: #262626; }
select.edit-input { background: #fff; color: #262626; }
.filter-item input:focus, .edit-input:focus { border-color: #40a9ff; }
.filter-actions { display: flex; gap: 8px; margin-top: 14px; }
.btn { height: 32px; padding: 0 15px; border: 1px solid #d9d9d9; border-radius: 2px; background: #fff; color: #595959; cursor: pointer; }
.btn:hover { border-color: #40a9ff; color: #1890ff; }
.btn-primary { background: #1890ff; border-color: #1890ff; color: #fff; }
.btn-primary:hover { background: #40a9ff; color: #fff; }
.btn-link { border: 0; background: transparent; color: #1890ff; cursor: pointer; padding: 0 6px; }
.btn-link:hover { text-decoration: underline; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.selection-tip { background: #e6f7ff; border: 1px solid #91d5ff; color: #1890ff; padding: 8px 12px; border-radius: 2px; margin-bottom: 12px; font-size: 13px; }
.table-wrap { overflow-x: auto; border: 1px solid #e8e8e8; border-radius: 2px; }
table.grid { border-collapse: collapse; min-width: 100%; font-size: 13px; white-space: nowrap; }
table.grid th, table.grid td { border-bottom: 1px solid #e8e8e8; padding: 10px 12px; text-align: left; }
table.grid th { background: #fafafa; color: #262626; font-weight: 500; }
table.grid tr:hover td { background: #f5faff; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 2px; font-size: 12px; }
.tag-on { color: #52c41a; background: #f6ffed; border: 1px solid #b7eb8f; }
.tag-off { color: #8c8c8c; background: #fafafa; border: 1px solid #d9d9d9; }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 14px; color: #595959; font-size: 13px; }
.pager select { height: 28px; border: 1px solid #d9d9d9; border-radius: 2px; }
.pager .page-btn { min-width: 28px; height: 28px; border: 1px solid #d9d9d9; background: #fff; border-radius: 2px; cursor: pointer; }
.pager .page-btn.current { border-color: #1890ff; color: #1890ff; }
.pager .page-btn:disabled { color: #bfbfbf; cursor: not-allowed; }
.empty { text-align: center; color: #8c8c8c; padding: 60px 0; }
.empty-icon { font-size: 40px; color: #d9d9d9; }
.context-menu { position: fixed; z-index: 30; background: #fff; border: 1px solid #e8e8e8; box-shadow: 0 4px 12px rgba(0,0,0,.14); border-radius: 2px; padding: 4px 0; min-width: 120px; }
.context-menu button { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 7px 14px; cursor: pointer; color: #595959; }
.context-menu button:hover { background: #e6f7ff; color: #1890ff; }
.modal-mask { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.35); display: flex; align-items: flex-start; justify-content: center; padding-top: 8vh; }
.modal { width: 620px; max-width: 92vw; max-height: 80vh; background: #fff; border-radius: 3px; display: flex; flex-direction: column; box-shadow: 0 8px 30px rgba(0,0,0,.2); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid #e8e8e8; font-size: 16px; }
.modal-head button { border: 0; background: transparent; font-size: 22px; cursor: pointer; color: #8c8c8c; line-height: 1; }
.modal-body { padding: 18px; overflow: auto; }
.modal-foot { padding: 12px 18px; border-top: 1px solid #e8e8e8; display: flex; justify-content: flex-end; gap: 8px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 18px; }
.detail-item { display: flex; gap: 8px; font-size: 13px; padding: 6px 0; border-bottom: 1px dashed #f0f0f0; }
.detail-item .label { color: #8c8c8c; min-width: 90px; }
.edit-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.toast { position: fixed; top: 60px; left: 50%; transform: translateX(-50%); z-index: 50; background: #fff; border: 1px solid #e8e8e8; box-shadow: 0 4px 14px rgba(0,0,0,.14); padding: 10px 18px; border-radius: 3px; color: #262626; }
@media (max-width: 1280px) {
  .sider { width: 180px; flex-basis: 180px; }
  .filter-grid { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
  .chart-row { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .sider { position: absolute; z-index: 20; height: calc(100% - 48px); box-shadow: 4px 0 12px rgba(0,0,0,.1); }
  .layout:not(.collapsed) .sider { width: 208px; flex-basis: 208px; }
  .layout:not(.collapsed) .sider { display: block; }
  .layout.collapsed .sider { display: none; }
  .brand { min-width: 0; }
  .top-search, .brand-name, .user span#userName { display: none; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .filter-grid, .edit-grid, .detail-grid { grid-template-columns: 1fr; }
  .views { padding: 10px; }
}

/* 行操作「更多」下拉 */
.ops-wrap { position: relative; display: inline-block; }
.ops-wrap .caret { font-size: 10px; margin-left: 2px; color: #8c8c8c; }
.ops-menu { position: absolute; right: 0; top: 100%; z-index: 25; background: #fff; border: 1px solid #e8e8e8; box-shadow: 0 4px 12px rgba(0,0,0,.14); border-radius: 2px; padding: 4px 0; min-width: 96px; text-align: left; }
.ops-menu .btn-link { display: block; width: 100%; padding: 6px 14px; text-align: left; }
.ops-menu .btn-link:hover { background: #e6f7ff; color: #1890ff; }
/* 「更多」内的级联子菜单（如会员列表 记录/钱包）：悬停向左展开 */
.ops-menu .menu-sub { display: block; position: relative; padding: 6px 14px 6px 22px; font-size: 13px; color: rgba(0,0,0,.65); cursor: default; }
.ops-menu .menu-sub::before { content: '‹'; position: absolute; left: 8px; color: #8c8c8c; }
.ops-menu .menu-sub:hover { background: #e6f7ff; color: #1890ff; }
.ops-menu .sub-list { display: none; position: absolute; right: 100%; top: -5px; background: #fff; border: 1px solid #e8e8e8; box-shadow: 0 4px 12px rgba(0,0,0,.14); border-radius: 2px; padding: 4px 0; min-width: 96px; }
.ops-menu .menu-sub:hover .sub-list { display: flex; flex-direction: column; }
.ops-menu .sub-list .btn-link { white-space: nowrap; }
/* 404 占位（授权展示 / 报表设计 / SQL监控 / 在线文档等原站 404 路由） */
.state-404 { text-align: center; padding: 72px 0 64px; }
.state-404 .code { font-size: 96px; font-weight: 600; color: #e6f7ff; -webkit-text-stroke: 1px #91d5ff; line-height: 1; margin-bottom: 16px; }
.state-404 p { color: #595959; margin: 0 0 20px; }
/* 支付展示（原站嵌 H5 收银页占位） */
.pay-h5 { display: flex; flex-direction: column; align-items: center; padding: 28px 0; }
.pay-tip { color: #8c8c8c; margin-bottom: 18px; }
.pay-panel { width: 320px; background: #fff; border: 1px solid #e8e8e8; border-radius: 8px; padding: 20px; text-align: center; }
.pay-title { font-size: 18px; font-weight: 600; color: #262626; }
.pay-sub { color: #8c8c8c; margin: 4px 0 16px; }
.pay-block { border: 1px dashed #d9d9d9; border-radius: 4px; color: #bfbfbf; padding: 14px 8px; margin-bottom: 12px; text-align: left; }
/* 调试助手（原站通信调试台占位） */
.debug-console { padding: 8px 0; }
.debug-row { display: flex; align-items: center; gap: 10px; margin: 12px 0; }
.debug-row .label { color: #595959; min-width: 72px; }
.debug-log { flex: 1; height: 130px; border: 1px solid #d9d9d9; border-radius: 3px; padding: 8px; resize: none; background: #fafafa; }
.debug-state { color: #fa8c16; }
/* 部门管理（原站部门树） */
.depart-tree { list-style: none; margin: 8px 0; padding-left: 12px; }
.depart-tree ul { list-style: none; padding-left: 26px; margin: 4px 0; }
.tree-node { display: inline-block; padding: 5px 10px; border: 1px solid #d9d9d9; border-radius: 3px; margin: 3px 6px 3px 0; color: #262626; background: #fafafa; }
.tree-node.leaf { background: #fff; }
/* 资金明细（原站汇总卡片） */
.sum-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.sum-card { border: 1px solid #e8e8e8; border-radius: 4px; overflow: hidden; }
.sum-title { background: #fafafa; padding: 10px 14px; font-weight: 600; color: #262626; border-bottom: 1px solid #f0f0f0; }
.sum-row { display: flex; justify-content: space-between; padding: 9px 14px; border-bottom: 1px dashed #f0f0f0; color: #595959; }
.sum-row b { color: #262626; font-variant-numeric: tabular-nums; }

/* 仿真工作台 */
.sim-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.sim-tab { border: 1px solid #d9d9d9; background: #fff; color: #595959; padding: 6px 14px; border-radius: 3px; cursor: pointer; }
.sim-tab:hover { color: #1890ff; border-color: #91d5ff; }
.sim-tab.active { background: #1890ff; border-color: #1890ff; color: #fff; }
.sim-note { color: #8c8c8c; font-size: 13px; line-height: 1.7; margin: 8px 0 14px; }
.sim-note a { color: #1890ff; }
.sim-chain { display: flex; flex-direction: column; gap: 10px; }
.sim-step { display: flex; gap: 14px; border: 1px solid #e8e8e8; border-radius: 4px; padding: 12px 14px; }
.sim-step-no { flex: 0 0 30px; height: 30px; border-radius: 50%; background: #e6f7ff; color: #1890ff; display: flex; align-items: center; justify-content: center; font-weight: 600; }
.sim-step-body { flex: 1; min-width: 0; }
.sim-step-title { font-weight: 600; color: #262626; margin-bottom: 4px; }
.sim-step-meta { color: #8c8c8c; font-size: 12px; margin: 4px 0; }
.sim-step-io { display: flex; gap: 8px; align-items: baseline; font-size: 12px; margin: 3px 0; }
.sim-step-io span { flex: 0 0 30px; color: #8c8c8c; }
.sim-step-io code { display: block; background: #fafafa; border: 1px solid #f0f0f0; border-radius: 2px; padding: 4px 8px; white-space: pre-wrap; word-break: break-all; color: #314659; flex: 1; }
.sim-rule { margin-bottom: 12px; }
.sim-rule-head { font-size: 15px; margin-bottom: 10px; color: #262626; }
.sim-rule-head b { color: #1890ff; margin-right: 8px; }
.sim-rule-line { display: flex; gap: 12px; padding: 6px 0; border-top: 1px dashed #f0f0f0; }
.sim-rule-line span { flex: 0 0 72px; color: #8c8c8c; font-size: 13px; }
.sim-rule-line p { margin: 0; flex: 1; line-height: 1.7; color: #595959; font-size: 13px; }
.sim-rule-line code { background: #fafafa; padding: 2px 6px; border-radius: 2px; }
.sim-pre { background: #fafafa; border: 1px solid #f0f0f0; padding: 12px; border-radius: 3px; overflow: auto; max-height: 340px; font-size: 12px; line-height: 1.6; }
.sim-tpl-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; max-height: 340px; overflow: auto; }
.sim-tpl-link { color: #1890ff; text-decoration: none; border: 1px solid #e8e8e8; border-radius: 3px; padding: 7px 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sim-tpl-link:hover { background: #e6f7ff; }
.sim-import textarea { width: 100%; border: 1px solid #d9d9d9; border-radius: 3px; padding: 8px; font-family: monospace; resize: vertical; }
.sim-import label { display: block; margin-bottom: 12px; }
.sim-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.sim-form label { display: flex; flex-direction: column; gap: 5px; color: #595959; font-size: 13px; }
.sim-form select, .sim-form input { border: 1px solid #d9d9d9; border-radius: 3px; padding: 6px 8px; min-width: 160px; }
.grid a { color: #1890ff; text-decoration: none; }
.grid a:hover { text-decoration: underline; }
.page-alert { background: #e6f7ff; border: 1px solid #91d5ff; color: #314659; border-radius: 2px; padding: 8px 12px; margin: 10px 0 0; font-size: 13px; }
.page-tabs { display: flex; border-bottom: 1px solid #e8e8e8; margin: 12px 0 0; }
.page-tab { border: 0; background: transparent; padding: 8px 16px; cursor: pointer; color: #595959; border-bottom: 2px solid transparent; }
.page-tab:hover { color: #1890ff; }
.page-tab.current { color: #1890ff; border-bottom-color: #1890ff; font-weight: 600; }
.dict-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed #f0f0f0; }
.dict-label { font-size: 12px; color: #8c8c8c; }
.dict-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #595959; }
.dict-item code { background: #fafafa; border: 1px solid #f0f0f0; border-radius: 2px; padding: 2px 6px; color: #314659; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dict-item select { height: 26px; border: 1px solid #d9d9d9; border-radius: 2px; padding: 0 4px; max-width: 180px; background: #fff; color: #262626; }
.input-hints { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 10px; }
.hint-item { background: #fafafa; border: 1px solid #f0f0f0; border-radius: 2px; padding: 2px 7px; font-size: 12px; color: #8c8c8c; }
.gate-body { max-height: 58vh; overflow: auto; padding: 2px 4px 2px 2px; }
.gate-line { margin: 6px 0; font-size: 13px; line-height: 1.78; color: #262626; }
.gate-line.gate-title { font-size: 15px; font-weight: 600; margin: 12px 0 8px; color: #141414; }
.gate-line.gate-subtitle { font-size: 13px; font-weight: 600; margin: 10px 0 4px; color: #262626; }
.gate-line.gate-policy { font-size: 12px; color: #8c8c8c; margin-top: 14px; line-height: 1.7; }
.gate-actions { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 20px; padding-top: 14px; border-top: 1px solid #f0f0f0; }
.gate-btn { width: 250px; max-width: 100%; }
.ledger-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 6px; }
@media (max-width: 900px) { .ledger-grid { grid-template-columns: 1fr; } }
.ledger-card { border: 1px solid #e8e8e8; border-radius: 3px; padding: 16px 18px; background: #fff; }
.ledger-card:first-child { border-left: 3px solid #8c8c8c; }
.ledger-card:nth-child(2) { border-left: 3px solid #1890ff; }
.ledger-card:nth-child(3) { border-left: 3px solid #52c41a; }
.ledger-name { font-size: 13px; color: #595959; }
.ledger-total { font-size: 24px; font-weight: 600; color: #141414; margin: 8px 0 6px; font-variant-numeric: tabular-nums; }
.ledger-basis { font-size: 12px; color: #8c8c8c; line-height: 1.6; }
.ledger-note { margin-top: 8px; padding-top: 8px; border-top: 1px dashed #f0f0f0; font-size: 12px; color: #595959; line-height: 1.6; }
table.grid th.num, table.grid td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.grid td.pos { color: #cf1322; }
table.grid td.neg { color: #389e0d; }
.diff-basis { display: block; font-size: 12px; color: #8c8c8c; line-height: 1.5; margin-top: 2px; }
.sim-hint { font-size: 12px; color: #8c8c8c; max-width: 240px; line-height: 1.5; }
.sim-switch { display: flex; flex-direction: column; gap: 6px; color: #595959; font-size: 13px; min-width: 320px; }
.sim-switch-row { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: #262626; }
.sim-switch-row input { margin: 0; }
.sim-switch-row b { font-weight: 500; }
.sim-switch-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 14px; }
@media (max-width: 860px) { .sim-switch-grid { grid-template-columns: 1fr; } }
.sim-switch .sim-hint { max-width: none; }
.sim-switch-row input[type="checkbox"] { min-width: 0; width: 16px; height: 16px; flex: none; }
