:root { --brand: #2b5cff; --side: #0d1b3d; --side-active: #2b5cff; --bg: #f0f2f5; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif; font-size: 14px; color: #1f2329; background: var(--bg); }
#app { height: 100%; }
.boot { display: flex; height: 100%; align-items: center; justify-content: center; color: #888; }
a { color: var(--brand); text-decoration: none; cursor: pointer; }

/* 布局 */
.layout { display: flex; height: 100vh; overflow: hidden; }
.aside { width: 208px; background: var(--side); color: #fff; display: flex; flex-direction: column; flex-shrink: 0; transition: width .2s; }
.aside.collapsed { width: 64px; }
.aside .logo { height: 56px; display: flex; align-items: center; gap: 10px; padding: 0 18px; font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; border-bottom: 1px solid rgba(255,255,255,.08); }
.aside .logo i { width: 28px; height: 28px; border-radius: 7px; background: var(--brand); display: inline-flex; align-items: center; justify-content: center; font-style: normal; flex-shrink: 0; }
.aside .el-menu { border-right: 0; flex: 1; overflow-y: auto; overflow-x: hidden; }
.aside .el-menu::-webkit-scrollbar { width: 0; }
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.header { height: 56px; background: #fff; display: flex; align-items: center; padding: 0 16px; gap: 14px; box-shadow: 0 1px 4px rgba(0,21,41,.08); z-index: 2; }
.header .company { font-weight: 600; font-size: 15px; }
.header .spacer { flex: 1; }
.header .hbtn { cursor: pointer; color: #555; display: inline-flex; align-items: center; gap: 4px; }
.tabs-bar { background: #fff; border-bottom: 1px solid #e5e6eb; padding: 0 8px; display: flex; gap: 4px; overflow-x: auto; flex-shrink: 0; }
.tabs-bar::-webkit-scrollbar { height: 0; }
.tabs-bar .tab { padding: 7px 12px; font-size: 13px; color: #555; cursor: pointer; white-space: nowrap; border-bottom: 2px solid transparent; display: flex; align-items: center; gap: 6px; }
.tabs-bar .tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.tabs-bar .tab .x { font-size: 12px; color: #999; border-radius: 50%; width: 14px; height: 14px; display: inline-flex; align-items: center; justify-content: center; }
.tabs-bar .tab .x:hover { background: #ddd; color: #333; }
.content { flex: 1; overflow: auto; padding: 12px; }

/* 卡片/页面 */
.page { background: #fff; border-radius: 6px; padding: 14px 16px; min-height: calc(100% - 4px); }
.page-title { font-size: 16px; font-weight: 600; margin: 0 0 12px; display: flex; align-items: center; gap: 10px; }
.page-title .sub { font-size: 12px; color: #86909c; font-weight: normal; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.toolbar .spacer { flex: 1; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.filters .el-input, .filters .el-select { width: 170px; }
.filters .el-date-editor.el-input__wrapper, .filters .el-range-editor { width: 250px !important; flex-grow: 0; }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 13px; color: #555; }
.sum-bar { display: flex; gap: 20px; font-size: 13px; color: #555; }
.sum-bar b { color: #1f2329; }
.money { font-variant-numeric: tabular-nums; }
.neg { color: #f53f3f; }
.pos { color: #00b42a; }
.muted { color: #86909c; font-size: 12px; }
.link { color: var(--brand); cursor: pointer; }
.link:hover { text-decoration: underline; }
.row-bold td { font-weight: 600; background: #fafbfc !important; }

/* 单据 */
.bill { position: relative; }
.bill .stamp { position: absolute; right: 120px; top: 70px; border: 3px solid #f53f3f; color: #f53f3f; font-size: 22px; font-weight: 700; padding: 2px 14px; border-radius: 6px; transform: rotate(-12deg); opacity: .55; pointer-events: none; z-index: 5; letter-spacing: 4px; }
.bill .stamp.draft { border-color: #ff7d00; color: #ff7d00; }
.bill-head { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 18px; margin-bottom: 8px; }
.bill-head .el-form-item { margin-bottom: 10px; }
.bill-head .el-select, .bill-head .el-date-editor, .bill-head .el-input { width: 100% !important; }
.bill-foot { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 18px; margin-top: 12px; }
.bill-foot .el-form-item { margin-bottom: 10px; }
.bill-foot .el-select, .bill-foot .el-input-number, .bill-foot .el-input { width: 100% !important; }
.bill-grid .el-table__cell { padding: 3px 0 !important; }
.bill-grid .el-input__wrapper, .bill-grid .el-select__wrapper { box-shadow: none !important; background: transparent; padding: 0 6px; }
.bill-grid .el-input__wrapper:hover, .bill-grid .el-select__wrapper:hover, .bill-grid .is-focus .el-input__wrapper, .bill-grid .el-select__wrapper.is-focused { box-shadow: 0 0 0 1px var(--brand) inset !important; background: #fff; }
.bill-grid .el-input-number { width: 100%; }
.bill-grid .el-input-number .el-input__inner { text-align: right; }
.bill-grid .cell { padding: 0 4px !important; }
.bill-grid .gname { line-height: 1.3; }
.bill-grid .gname small { color: #86909c; display: block; font-size: 12px; }
.bill-info { background: #f7f8fa; border-radius: 4px; padding: 8px 12px; font-size: 13px; color: #4e5969; display: flex; flex-wrap: wrap; gap: 6px 22px; margin-bottom: 10px; }
.bill-info b { color: #1f2329; }
.bill-total { font-size: 15px; }
.bill-total b { color: #f53f3f; font-size: 18px; }
.scan-input { width: 220px !important; }

/* 首页 */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 12px; }
.kpi { background: #fff; border-radius: 6px; padding: 14px 16px; position: relative; overflow: hidden; cursor: default; }
.kpi .t { color: #86909c; font-size: 13px; }
.kpi .v { font-size: 24px; font-weight: 600; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .s { font-size: 12px; color: #86909c; margin-top: 4px; }
.kpi.clickable { cursor: pointer; }
.kpi.clickable:hover { box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.panel { background: #fff; border-radius: 6px; padding: 14px 16px; }
.panel h4 { margin: 0 0 10px; font-size: 15px; display: flex; justify-content: space-between; align-items: center; }
.grid2 { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; margin-bottom: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 12px; }
.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.quick .q { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.quick .q:hover { background: #f2f3f5; }
.quick .q .ic { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 18px; }
.todo-item { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed #eee; cursor: pointer; }
.todo-item:hover { color: var(--brand); }

/* 报表中心 */
.rpt-group { margin-bottom: 18px; }
.rpt-group h4 { margin: 0 0 10px; font-size: 15px; border-left: 3px solid var(--brand); padding-left: 8px; }
.rpt-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.rpt-item { border: 1px solid #e5e6eb; border-radius: 6px; padding: 12px 14px; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.rpt-item:hover { border-color: var(--brand); color: var(--brand); }

/* 登录 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #0d1b3d 0%, #2b5cff 60%, #5b8cff 100%); padding: 20px; }
.login-box { width: 900px; max-width: 100%; display: flex; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.login-left { flex: 1; background: #0d1b3d; color: #fff; padding: 44px 36px; display: flex; flex-direction: column; gap: 14px; }
.login-left h1 { margin: 0; font-size: 26px; }
.login-left ul { padding-left: 18px; line-height: 2; color: #c9d6f2; margin: 6px 0 0; }
.login-right { width: 380px; padding: 40px 34px; }
.login-right h2 { margin: 0 0 22px; }
@media (max-width: 760px) { .login-left { display: none; } .login-right { width: 100%; } .grid2, .grid3 { grid-template-columns: 1fr; } .aside { position: fixed; z-index: 10; height: 100%; } .aside.collapsed { width: 0; } }

/* 权限树 */
.perm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.perm-table td, .perm-table th { border: 1px solid #e5e6eb; padding: 6px 8px; text-align: left; }
.perm-table th { background: #f7f8fa; }
.perm-table .grp { background: #f2f6ff; font-weight: 600; }

/* 打印区不显示 */
.print-frame { position: fixed; right: 0; bottom: 0; width: 0; height: 0; border: 0; }
.el-table .cell { line-height: 1.4; }
.el-table th.el-table__cell { background: #f7f8fa !important; color: #4e5969; font-weight: 600; }
.el-dialog__body { padding-top: 10px !important; }
.goods-cell-img { width: 36px; height: 36px; object-fit: cover; border-radius: 4px; background: #f2f3f5; }
.tag-mini { font-size: 12px; padding: 0 5px; border-radius: 3px; background: #e8f3ff; color: #1f6feb; margin-left: 4px; }

/* ===== 生意脑补充 ===== */
.aside .el-sub-menu__title, .aside .el-menu-item { height: 40px !important; line-height: 40px !important; }
.aside .el-menu--inline .el-menu-item { height: 34px !important; line-height: 34px !important; font-size: 13px; }
.menu-search { padding: 8px 10px; }
.menu-search .el-input__wrapper { background: rgba(255,255,255,.08); box-shadow: none; }
.menu-search input { color: #fff; }
.org-switch { min-width: 180px; }
.voucher { max-width: 1200px; }
.voucher-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.voucher-title { flex: 1; text-align: center; font-size: 22px; font-weight: 600; letter-spacing: 8px; }
.vgrid { width: 100%; border-collapse: collapse; table-layout: fixed; }
.vgrid th, .vgrid td { border: 1px solid #c9cdd4; padding: 0; height: 44px; font-size: 13px; }
.vgrid th { background: #f7f8fa; height: 34px; font-weight: 600; }
.vgrid td .el-input__wrapper, .vgrid td .el-select__wrapper { box-shadow: none !important; border-radius: 0; min-height: 42px; }
.vgrid td.amt input { text-align: right; font-variant-numeric: tabular-nums; font-family: Consolas, monospace; }
.vgrid tfoot td { padding: 0 8px; font-weight: 600; }
.vgrid .ops { width: 54px; text-align: center; color: #999; }
.vgrid .ops span { cursor: pointer; margin: 0 2px; }
.vgrid .ops span:hover { color: var(--brand); }
.vfoot { display: flex; gap: 28px; margin-top: 8px; font-size: 13px; color: #4e5969; }
.rpt-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rpt-table th, .rpt-table td { border: 1px solid #e5e6eb; padding: 6px 8px; }
.rpt-table th { background: #f7f8fa; }
.rpt-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.rpt-table tr.b td { font-weight: 600; }
.rpt-table tr.h td { background: #f2f6ff; font-weight: 600; }
.chart { width: 100%; height: 300px; }
.chart.sm { height: 220px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.card { border: 1px solid #e5e6eb; border-radius: 8px; padding: 14px; background: #fff; }
.card h5 { margin: 0 0 8px; font-size: 15px; }
.check-ok { color: #00b42a; } .check-bad { color: #f53f3f; }
.flex { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mt { margin-top: 12px; } .mb { margin-bottom: 12px; }
.w120 { width: 120px !important; } .w160 { width: 160px !important; } .w200 { width: 200px !important; } .w300 { width: 300px !important; }
.lang-flag { font-size: 13px; }
.subject-dropdown .code { color: #86909c; margin-right: 6px; font-family: Consolas, monospace; }
.empty-tip { color: #86909c; padding: 30px; text-align: center; }
.tree-table .el-table__row--level-1 td:first-child .cell { padding-left: 24px !important; }
.bill-items-tools { display: flex; gap: 8px; margin: 6px 0; align-items: center; }
.dc-d { color: #165dff; } .dc-c { color: #f53f3f; }
.board-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.board-grid .panel.full { grid-column: span 2; }
@media (max-width: 900px) { .board-grid { grid-template-columns: 1fr; } .board-grid .panel.full { grid-column: auto; } }
.header > * { white-space: nowrap; }
.board-full { position: fixed; inset: 0; z-index: 2000; background: #0b1530; padding: 60px 16px 16px; overflow: auto; }
.board-full .panel { background: #13214a; color: #dfe7ff; border-color: #22346b; }
.board-full-title { position: absolute; left: 0; right: 0; top: 0; height: 50px; line-height: 50px; text-align: center; color: #fff; font-size: 22px; font-weight: 600; letter-spacing: 2px; }
.card.link { cursor: pointer; transition: box-shadow .2s, transform .2s; }
.card.link:hover { box-shadow: 0 4px 14px rgba(43,92,255,.15); transform: translateY(-1px); }
.row-warn td { background: #fff7f0 !important; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }

/* ---------- 独立页面 ---------- */
body.standalone { background: #f2f4f8; margin: 0; }
.boot { padding: 60px; text-align: center; color: #86909c; }
/* POS 收银台 */
.pos { height: 100vh; display: flex; flex-direction: column; background: #eef1f6; }
.pos-top { height: 48px; background: #0d1b3d; color: #fff; display: flex; align-items: center; gap: 10px; padding: 0 14px; flex-shrink: 0; }
.pos-body { flex: 1; display: grid; grid-template-columns: 420px 1fr; gap: 10px; padding: 10px; min-height: 0; }
.pos-left { background: #fff; border-radius: 8px; display: flex; flex-direction: column; min-height: 0; }
.pos-member { padding: 10px; border-bottom: 1px solid #eee; }
.pos-cart { flex: 1; overflow: auto; padding: 4px 10px; }
.pos-line { padding: 8px 0; border-bottom: 1px dashed #eee; }
.pos-line .n { font-weight: 500; margin-bottom: 4px; }
.pos-sum { border-top: 1px solid #eee; padding: 10px; }
.pos-pay { display: flex; justify-content: space-between; align-items: baseline; margin: 8px 0; font-size: 16px; }
.pos-pay b { font-size: 30px; color: #f53f3f; }
.pos-right { background: #fff; border-radius: 8px; padding: 10px; display: flex; flex-direction: column; min-height: 0; }
.pos-cats { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.pos-cats span, .mall-cats span { padding: 4px 12px; border-radius: 14px; background: #f2f3f5; cursor: pointer; font-size: 13px; }
.pos-cats span.on, .mall-cats span.on { background: #2b5cff; color: #fff; }
.pos-goods { flex: 1; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; align-content: start; }
.pos-g { border: 1px solid #e5e6eb; border-radius: 6px; padding: 6px; cursor: pointer; user-select: none; }
.pos-g:hover { border-color: #2b5cff; box-shadow: 0 2px 8px rgba(43,92,255,.15); }
.pos-g .img, .mall-g .img { height: 80px; background: #f2f4f8; border-radius: 4px; display: flex; align-items: center; justify-content: center; overflow: hidden; color: #2b5cff; font-weight: 600; }
.pos-g .img img, .mall-g .img img { width: 100%; height: 100%; object-fit: cover; }
.pos-g .n { font-size: 13px; margin: 4px 0; height: 34px; overflow: hidden; }
@media (max-width: 900px) { .pos-body { grid-template-columns: 1fr; } }
/* 手机端 */
.m-app { max-width: 560px; margin: 0 auto; min-height: 100vh; background: #f2f4f8; padding-bottom: 60px; }
.m-head { position: sticky; top: 0; z-index: 10; background: #2b5cff; color: #fff; padding: 12px 14px; font-weight: 600; display: flex; justify-content: space-between; }
.m-user { font-weight: 400; font-size: 13px; cursor: pointer; }
.m-body { padding: 10px; }
.m-card { background: #fff; border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; }
.m-hero { background: linear-gradient(135deg, #2b5cff, #5b7cff); color: #fff; }
.m-hero b { font-size: 28px; display: block; margin: 4px 0; }
.m-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.m-grid > div { background: #fff; border-radius: 8px; text-align: center; padding: 14px 0; font-size: 13px; cursor: pointer; line-height: 1.8; }
.m-title { font-weight: 600; margin: 12px 2px 8px; }
.m-tabs, .mall-tabs { position: fixed; bottom: 0; left: 0; right: 0; height: 52px; background: #fff; border-top: 1px solid #e5e6eb; display: flex; z-index: 20; max-width: 560px; margin: 0 auto; }
.m-tabs > div, .mall-tabs > div { flex: 1; display: flex; align-items: center; justify-content: center; cursor: pointer; color: #4e5969; }
.m-tabs > div.on, .mall-tabs > div.on { color: #2b5cff; font-weight: 600; }
.mall-tabs sup { background: #f53f3f; color: #fff; border-radius: 8px; padding: 0 5px; font-size: 10px; margin-left: 2px; }
/* 商城 */
.mall { max-width: 560px; margin: 0 auto; min-height: 100vh; background: #f6f7fb; padding-bottom: 64px; }
.mall-head { position: sticky; top: 0; z-index: 10; background: #fff; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid #eee; }
.mall-head img { width: 28px; height: 28px; border-radius: 4px; object-fit: cover; }
.mall-head .tag { font-size: 12px; color: #2b5cff; background: #eef2ff; padding: 1px 6px; border-radius: 4px; }
.mall-body { padding: 10px; }
.mall-notice { background: #fff7e8; color: #d25f00; padding: 8px 10px; border-radius: 6px; margin-bottom: 8px; font-size: 13px; }
.mall-cats { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 8px; white-space: nowrap; }
.mall-title { font-weight: 600; margin: 10px 2px 8px; }
.mall-goods { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mall-g { background: #fff; border-radius: 8px; padding: 8px; }
.mall-g .img { height: 130px; cursor: pointer; }
.mall-g .n { margin: 6px 0 2px; font-size: 14px; height: 38px; overflow: hidden; cursor: pointer; }
.mall-card { background: #fff; border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; gap: 8px; }
.mall-bar { position: sticky; bottom: 56px; background: #fff; border-radius: 8px; padding: 10px 12px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 -2px 8px rgba(0,0,0,.06); }
