* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Microsoft YaHei", "PingFang SC", sans-serif; background: #f3f5f7; color: #303133; font-size: 14px; }
a { color: #2f6fdd; text-decoration: none; }
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 200px; background: #1f2d3d; color: #c0c4cc; display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; }
.sidebar .brand { padding: 18px 16px; color: #fff; font-size: 16px; font-weight: 600; border-bottom: 1px solid #2c3e50; }
.sidebar nav { flex: 1; overflow-y: auto; padding: 8px 0; }
.sidebar nav a { display: block; padding: 11px 18px; color: #c0c4cc; }
.sidebar nav a:hover { background: #2c3e50; color: #fff; }
.sidebar nav a.active { background: #2f6fdd; color: #fff; }
.side-foot { padding: 12px 16px; border-top: 1px solid #2c3e50; font-size: 12px; }
.side-foot a { color: #8cc5ff; margin-right: 10px; font-size: 12px; }
.main { flex: 1; margin-left: 200px; padding: 20px 24px; }
.flash { padding: 10px 14px; border-radius: 4px; margin-bottom: 14px; }
.flash.ok { background: #e8f6ec; color: #2b8a3e; border: 1px solid #b7e2c1; }
.flash.err { background: #fdecea; color: #c0392b; border: 1px solid #f5c6c0; }
.card { background: #fff; border-radius: 6px; padding: 18px 20px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.card h2 { font-size: 16px; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid #eee; }
table.tb { width: 100%; border-collapse: collapse; }
table.tb th, table.tb td { padding: 9px 10px; border-bottom: 1px solid #eee; text-align: left; white-space: nowrap; }
table.tb th { background: #fafbfc; color: #606266; font-weight: 600; }
table.tb tr:hover td { background: #f7faff; }
.btn { display: inline-block; padding: 7px 14px; border: none; border-radius: 4px; background: #2f6fdd; color: #fff; cursor: pointer; font-size: 13px; }
.btn:hover { background: #255cbd; }
.btn.gray { background: #909399; }
.btn.red { background: #d9534f; }
.btn.green { background: #2b8a3e; }
.btn.sm { padding: 4px 9px; font-size: 12px; }
form.inline { display: inline; }
.form-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; align-items: center; }
.form-row label { color: #606266; }
input[type=text], input[type=password], input[type=date], input[type=time], input[type=datetime-local], input[type=number], select, textarea {
  padding: 7px 10px; border: 1px solid #dcdfe6; border-radius: 4px; font-size: 13px; min-width: 140px;
}
input:focus, select:focus { outline: none; border-color: #2f6fdd; box-shadow: 0 0 0 3px rgba(47,111,237,.12); }
select {
  appearance: none; -webkit-appearance: none;
  background: #fff url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23909399' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 10px center;
  padding-right: 28px; cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
select:hover { border-color: #b3c4e8; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat-box { background: #fff; border-radius: 6px; padding: 18px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.stat-box .num { font-size: 26px; font-weight: 700; color: #2f6fdd; }
.stat-box .lbl { color: #909399; margin-top: 4px; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; background: #eef2f7; color: #606266; }
.tag.green { background: #e8f6ec; color: #2b8a3e; }
.tag.red { background: #fdecea; color: #c0392b; }
.tag.orange { background: #fdf3e3; color: #b8860b; }
.tag.blue { background: #e8f0fd; color: #2f6fdd; }
.pager { margin-top: 12px; }
.pager a, .pager span { display: inline-block; padding: 5px 10px; margin-right: 4px; border: 1px solid #dcdfe6; border-radius: 4px; background: #fff; }
.pager span.cur { background: #2f6fdd; color: #fff; border-color: #2f6fdd; }
.modal-mask { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.4); display: none; align-items: center; justify-content: center; z-index: 99; }
.modal { background: #fff; border-radius: 6px; padding: 20px; width: 420px; max-width: 92vw; max-height: 86vh; overflow-y: auto; }
.modal h3 { margin-bottom: 14px; font-size: 15px; }
.modal .actions { margin-top: 16px; text-align: right; }
.modal .actions .btn { margin-left: 8px; }
.muted { color: #909399; font-size: 12px; }
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #1f2d3d, #2f6fdd); }
.login-box { background: #fff; border-radius: 8px; padding: 36px 40px; width: 380px; }
.login-box h1 { font-size: 20px; text-align: center; margin-bottom: 24px; }
.login-box .form-row { flex-direction: column; align-items: stretch; }
.login-box input { width: 100%; }
.login-box .btn { width: 100%; padding: 10px; font-size: 15px; }
.error-text { color: #c0392b; text-align: center; margin-bottom: 10px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
/* 角色管理表格：固定列宽布局，长文本用省略号截断，防止横向滚动条 */
table.tb-roles { table-layout: fixed; }
table.tb-roles th, table.tb-roles td { overflow: hidden; vertical-align: top; }
table.tb-roles td.ellip, table.tb-roles th.ellip { max-width: none; text-overflow: ellipsis; white-space: nowrap; }

/* 通用固定列宽表格：列多/长文本时防止横向溢出；长文本列用 .ellip 省略号，操作列放最后 */
table.tb-fixed { table-layout: fixed; width: 100%; }
table.tb-fixed th, table.tb-fixed td { overflow: hidden; vertical-align: top; }
table.tb-fixed td.ellip, table.tb-fixed th.ellip { max-width: none; text-overflow: ellipsis; white-space: nowrap; }
/* 长文本列：在非 fixed 表格中限制最大宽度并省略（用于单列长文本，如日志内容/事由/理由） */
td.ellip, th.ellip { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
