/* 局域网 ERP 前端样式（无外部依赖，可完全离线运行） */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif; background: #f0f2f5; color: #303133; }
button { font-family: inherit; }

/* 登录页 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1f2d3d 0%, #2b4a6f 100%); }
.login-card { width: 380px; background: #fff; border-radius: 10px; padding: 36px 32px; box-shadow: 0 12px 40px rgba(0,0,0,.25); }
.login-card h1 { font-size: 20px; margin-bottom: 6px; color: #1f2d3d; }
.login-card .sub { font-size: 12px; color: #909399; margin-bottom: 24px; }
.login-card .tip { margin-top: 16px; font-size: 12px; color: #909399; line-height: 1.8; background: #f4f6f9; padding: 10px 12px; border-radius: 6px; }

/* 布局 */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 208px; background: #1f2d3d; color: #c0c4cc; flex-shrink: 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .logo { padding: 18px 16px; font-size: 16px; font-weight: 600; color: #fff; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar .logo small { display: block; font-size: 11px; font-weight: 400; color: #7a8798; margin-top: 4px; }
.menu-group { padding: 10px 0 4px; font-size: 11px; color: #6b7787; padding-left: 16px; }
.menu-item { display: flex; align-items: center; gap: 8px; padding: 10px 16px; cursor: pointer; font-size: 13px; border-left: 3px solid transparent; }
.menu-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.menu-item.active { background: rgba(64,158,255,.15); color: #409eff; border-left-color: #409eff; }
.menu-item .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { height: 52px; background: #fff; border-bottom: 1px solid #e6e8eb; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; position: sticky; top: 0; z-index: 10; }
.topbar .page-title { font-size: 15px; font-weight: 600; }
.topbar .user { font-size: 13px; color: #606266; display: flex; align-items: center; gap: 12px; }
.content { padding: 16px 20px; flex: 1; }

/* 统计卡片 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-card { background: #fff; border-radius: 8px; padding: 16px; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.stat-card .label { font-size: 12px; color: #909399; }
.stat-card .value { font-size: 24px; font-weight: 600; margin-top: 6px; color: #1f2d3d; }
.stat-card.accent .value { color: #f56c6c; }

/* 面板与表格 */
.panel { background: #fff; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,.05); margin-bottom: 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid #ebeef5; flex-wrap: wrap; gap: 8px; }
.panel-head .title { font-size: 14px; font-weight: 600; }
.panel-body { padding: 16px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
table.grid th { background: #f5f7fa; color: #606266; font-weight: 500; text-align: left; padding: 9px 10px; border-bottom: 1px solid #ebeef5; white-space: nowrap; }
table.grid td { padding: 9px 10px; border-bottom: 1px solid #f0f2f5; vertical-align: top; }
table.grid tr:hover td { background: #fafcff; }
.empty { text-align: center; color: #909399; padding: 32px 0; font-size: 13px; }

/* 表单控件 */
input, select, textarea { border: 1px solid #dcdfe6; border-radius: 4px; padding: 6px 9px; font-size: 13px; outline: none; background: #fff; font-family: inherit; }
input:focus, select:focus, textarea:focus { border-color: #409eff; }
.btn { border: none; border-radius: 4px; padding: 7px 14px; font-size: 13px; cursor: pointer; background: #409eff; color: #fff; }
.btn:hover { opacity: .9; }
.btn.plain { background: #fff; color: #606266; border: 1px solid #dcdfe6; }
.btn.danger { background: #f56c6c; }
.btn.warning { background: #e6a23c; }
.btn.small { padding: 4px 9px; font-size: 12px; }
.btn.link { background: none; color: #409eff; padding: 2px 6px; }
.btn.link.danger { color: #f56c6c; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; background: #ecf5ff; color: #409eff; }
.tag.gray { background: #f4f4f5; color: #909399; }
.tag.red { background: #fef0f0; color: #f56c6c; }
.tag.green { background: #f0f9eb; color: #67c23a; }
.tag.orange { background: #fdf6ec; color: #e6a23c; }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: flex-start; justify-content: center; z-index: 100; overflow-y: auto; padding: 40px 16px; }
.modal { background: #fff; border-radius: 8px; width: 560px; max-width: 100%; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid #ebeef5; font-size: 15px; font-weight: 600; }
.modal-head .close { cursor: pointer; color: #909399; font-size: 18px; border: none; background: none; }
.modal-body { padding: 18px; max-height: 60vh; overflow-y: auto; }
.modal-foot { padding: 12px 18px; border-top: 1px solid #ebeef5; display: flex; justify-content: flex-end; gap: 8px; }
.form-row { display: flex; gap: 12px; margin-bottom: 12px; }
.form-row .field { flex: 1; }
.form-row .field label { display: block; font-size: 12px; color: #606266; margin-bottom: 4px; }
.form-row .field input, .form-row .field select, .form-row .field textarea { width: 100%; }
textarea { resize: vertical; min-height: 64px; }

.toast { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); background: #fff; border-left: 4px solid #67c23a; padding: 10px 18px; border-radius: 4px; box-shadow: 0 4px 16px rgba(0,0,0,.15); font-size: 13px; z-index: 200; }
.toast.error { border-left-color: #f56c6c; }
.kv { display: flex; gap: 10px; font-size: 13px; margin-bottom: 8px; }
.kv .k { color: #909399; width: 96px; flex-shrink: 0; }
.notice { background: #fdf6ec; color: #b88230; border: 1px solid #faecd8; border-radius: 6px; padding: 10px 14px; font-size: 12px; line-height: 1.8; margin-bottom: 12px; }
code.snippet { background: #f4f4f5; padding: 1px 6px; border-radius: 3px; font-size: 12px; color: #b88230; }
