* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif; background: #f5f6f8; color: #222; }
a { color: inherit; }

/* 登录 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg,#2b5876,#4e4376); }
.login-card { background:#fff; padding:32px 36px; border-radius:12px; width:340px; box-shadow:0 10px 40px rgba(0,0,0,.2); }
.login-card h1 { font-size:20px; margin:0 0 4px; }
.login-card .sub { color:#888; font-size:13px; margin-bottom:20px; }
.login-card input { width:100%; padding:10px 12px; margin-bottom:12px; border:1px solid #ddd; border-radius:8px; font-size:14px; }
.login-card button { width:100%; padding:11px; border:0; border-radius:8px; background:#3a6ea5; color:#fff; font-size:15px; cursor:pointer; }
.login-card button:hover { background:#2f5d8c; }
.err { color:#d33; font-size:13px; min-height:18px; margin-bottom:8px; }

/* 布局 */
.layout { display:flex; min-height:100vh; }
.sidebar { width:200px; background:#1f2937; color:#cfd8e3; padding:18px 0; flex-shrink:0; }
.sidebar .brand { padding:0 20px 16px; font-size:16px; font-weight:600; color:#fff; border-bottom:1px solid #374151; margin-bottom:10px; }
.menu-item { padding:12px 20px; cursor:pointer; font-size:14px; }
.menu-item:hover { background:#374151; }
.menu-item.active { background:#3a6ea5; color:#fff; }
.main { flex:1; display:flex; flex-direction:column; }
.topbar { height:54px; background:#fff; border-bottom:1px solid #e5e7eb; display:flex; align-items:center; justify-content:space-between; padding:0 22px; }
.topbar .u { font-size:14px; color:#555; }
.topbar button { border:1px solid #ddd; background:#fff; padding:6px 14px; border-radius:6px; cursor:pointer; }
.content { padding:22px; overflow:auto; }
.card { background:#fff; border:1px solid #e5e7eb; border-radius:10px; padding:18px; margin-bottom:18px; }
.card h3 { margin:0 0 14px; font-size:15px; }
.row { display:flex; gap:10px; flex-wrap:wrap; align-items:center; margin-bottom:12px; }
/* 侧边栏二级菜单（可展开） */
.menu-item { display:flex; align-items:center; justify-content:space-between; }
.menu-item .arrow { font-size:10px; transition:transform .15s; color:#9aa7b5; }
.menu-item.open .arrow { transform:rotate(90deg); }
.submenu { background:#172130; }
.submenu .sub-item { padding:10px 20px 10px 38px; cursor:pointer; font-size:13px; color:#aab6c4; border-left:2px solid transparent; }
.submenu .sub-item:hover { background:#283548; color:#e6edf5; }
.submenu .sub-item.active { background:#283548; color:#fff; border-left:2px solid #3a6ea5; }
label.lbl { font-size:13px; color:#666; margin-right:4px; }
input.inp, select.inp { padding:8px 10px; border:1px solid #ddd; border-radius:7px; font-size:14px; }
input.w120 { width:130px; } input.w200 { width:210px; }
button.btn { padding:8px 16px; border:0; border-radius:7px; background:#3a6ea5; color:#fff; font-size:14px; cursor:pointer; }
button.btn:hover { background:#2f5d8c; }
button.btn.green { background:#2e8b57; } button.btn.green:hover{background:#267349;}
button.btn.ghost { background:#eef2f7; color:#333; border:1px solid #ddd; }
button.btn:disabled { opacity:.5; cursor:not-allowed; }

/* 内容区顶部子标签（如「用户锁定记录 / 企业每个用户锁定信息」共用一页切换） */
.subtabs { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:14px; border-bottom:1px solid #e5e7eb; padding-bottom:10px; }
.subtabs .tab { padding:7px 16px; border:1px solid #d0d5dd; background:#fff; border-radius:7px; cursor:pointer; font-size:14px; color:#475467; }
.subtabs .tab.on { background:#3a6ea5; border-color:#3a6ea5; color:#fff; }

/* 老接口地址配置框 */
.cfg-box { display:flex; align-items:center; flex-wrap:wrap; gap:10px; padding:12px 14px; margin-bottom:16px; background:#f7f9fc; border:1px solid #e5e7eb; border-radius:8px; }
.cfg-box .lbl { margin:0; }
.msg-inline { font-size:13px; margin-left:4px; }
.msg-inline.ok { color:#167a3a; }
.msg-inline.bad { color:#c0392b; }
.result { margin-top:12px; }
.kv { display:flex; gap:24px; flex-wrap:wrap; }
.kv .k { font-size:13px; color:#888; } .kv .v { font-size:20px; font-weight:600; color:#1f2937; }
.msg { font-size:13px; margin-top:10px; }
.msg.ok { color:#2e8b57; } .msg.bad { color:#d33; }
.empty { color:#999; font-size:13px; padding:14px 0; }

/* 表格 */
.tbl { width:100%; border-collapse:collapse; font-size:13px; margin-top:6px; }
.tbl th, .tbl td { border:1px solid #e5e7eb; padding:8px 10px; text-align:left; }
.tbl th { background:#f3f5f8; color:#555; font-weight:600; white-space:nowrap; }
.tbl tr:nth-child(even) td { background:#fafbfc; }
.pager { margin-top:10px; display:flex; gap:8px; align-items:center; font-size:13px; color:#666; }
.pager button { padding:5px 12px; border:1px solid #ddd; background:#fff; border-radius:6px; cursor:pointer; }

/* 弹窗 */
.modal-mask { position:fixed; inset:0; background:rgba(0,0,0,.4); display:flex; align-items:center; justify-content:center; z-index:50; padding:20px; }
.modal { background:#fff; border-radius:10px; padding:22px; width:380px; max-height:calc(100vh - 40px); overflow-y:auto; }
.modal h3 { margin:0 0 16px; font-size:16px; position:sticky; top:0; background:#fff; padding-bottom:8px; z-index:1; }
.modal label { display:block; font-size:13px; color:#666; margin:10px 0 4px; }
.modal input, .modal select { width:100%; padding:8px 10px; border:1px solid #ddd; border-radius:7px; }
.modal .acts { margin-top:18px; display:flex; gap:10px; justify-content:flex-end; position:sticky; bottom:0; background:#fff; padding-top:14px; border-top:1px solid #f0f2f5; }
.badge { display:inline-block; padding:2px 8px; border-radius:10px; font-size:12px; background:#eef2f7; color:#555; }

/* 角色徽标 / 权限徽标 */
.role-badge { display:inline-block; padding:1px 8px; border-radius:10px; font-size:12px; margin-right:4px; }
.rb-admin { background:#3a6ea5; color:#fff; }
.rb-user { background:#eef2f7; color:#555; }
.perm-cells { max-width:320px; }
.pbadge { display:inline-block; padding:1px 7px; border-radius:9px; font-size:11px; margin:2px 3px 2px 0; }
.pbadge.on { background:#e3f3ea; color:#2e8b57; border:1px solid #bfe3cd; }
.pbadge.off { background:#f3f4f6; color:#aaa; border:1px solid #e5e7eb; }
.pbadge.warn { background:#fff4e0; color:#b26a00; border:1px solid #f5d8a8; }
.pbadge.bad { background:#fdeaea; color:#c0392b; border:1px solid #f3c2c2; }
.pbadge.info { background:#e8f1fb; color:#2f6fab; border:1px solid #c7ddf3; }
.json-box { background:#f7f9fb; border:1px solid #e5e7eb; border-radius:7px; padding:10px; font-size:12px; line-height:1.5; max-height:200px; overflow:auto; white-space:pre-wrap; word-break:break-all; margin:4px 0 10px; }

/* 按钮尺寸变体 */
button.btn.sm { padding:4px 10px; font-size:12px; }
button.btn.danger { background:#c0392b; }
button.btn.danger:hover { background:#a93226; }
button.btn.danger:disabled { opacity:.4; cursor:not-allowed; }
.acts-cell { white-space:nowrap; }
.acts-cell button { margin-right:4px; }
/* 应用列表：倒序的数字 ID 列 */
.tbl td.relay-id { width:52px; color:#888; font-variant-numeric:tabular-nums; white-space:nowrap; }

/* 权限选择网格 */
.perm-grid { display:grid; grid-template-columns:1fr 1fr; gap:4px 16px; margin:6px 0 12px; }
.perm-grid .chk { margin-top:0; }

/* 权限树（一级模块 / 二级子页面，可折叠） */
.perm-toolbar { display:flex; gap:8px; margin:2px 0 8px; }
.perm-toolbar button { font-size:12px; padding:4px 12px; border:1px solid #d0d5dd; background:#fff; border-radius:6px; cursor:pointer; color:#475467; }
.perm-toolbar button:hover { background:#f0f4f8; }
.perm-tree { margin:6px 0 12px; border:1px solid #e5e7eb; border-radius:8px; overflow:hidden; }
.perm-mod { border-bottom:1px solid #eef0f3; }
.perm-mod:last-child { border-bottom:0; }
.perm-mod-head { display:flex; align-items:center; gap:6px; padding:9px 12px; background:#f7f9fc; }
.perm-caret { width:18px; height:18px; flex-shrink:0; display:inline-flex; align-items:center; justify-content:center; cursor:pointer; color:#3a6ea5; font-size:12px; user-select:none; }
.perm-mod-label { display:flex; align-items:center; gap:8px; flex:1; font-weight:600; color:#33475b; font-size:13px; cursor:pointer; }
.perm-mod-label input { width:auto; }
.perm-children { display:grid; grid-template-columns:1fr 1fr; gap:2px 16px; padding:8px 12px 10px 34px; }
.perm-child { margin-top:2px; }
.perm-nochild { display:block; font-size:12px; color:#aaa; padding:6px 12px 10px 34px; }

/* 系统设置 */
.row.col { flex-direction:column; align-items:flex-start; }
.row.col .lbl { margin:10px 0 4px; }
.row.col .inp { width:320px; }
.hint { font-size:13px; color:#888; margin:4px 0 12px; line-height:1.6; }
.hint b { color:#3a6ea5; }
.chk { font-size:13px; color:#666; margin-top:8px; display:flex; align-items:center; gap:6px; }
.chk input { width:auto; }

/* 自定义日期选择器 */
.dp { position: relative; display: inline-block; }
.dp-input { cursor: pointer; background: #fff; }
.dp-pop {
  position: fixed; z-index: 1000;
  width: 250px; background: #fff; border: 1px solid #e5e7eb; border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: 10px; user-select: none;
}
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dp-title { font-size: 14px; font-weight: 600; color: #1f2937; }
.dp-nav { width: 28px; height: 28px; border: 1px solid #e5e7eb; background: #fff; border-radius: 6px; cursor: pointer; font-size: 16px; line-height: 1; color: #555; }
.dp-nav:hover { background: #f0f4f8; }
.dp-week { display: grid; grid-template-columns: repeat(7,1fr); margin-bottom: 4px; }
.dp-week span { text-align: center; font-size: 12px; color: #999; padding: 4px 0; }
.dp-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 2px; }
.dp-cell { text-align: center; font-size: 13px; padding: 6px 0; border-radius: 6px; cursor: pointer; color: #333; }
.dp-cell:hover { background: #eef4fb; }
.dp-cell.other { color: #ccc; }
.dp-cell.empty { cursor: default; }
.dp-cell.today { color: #3a6ea5; font-weight: 600; }
.dp-cell.sel { background: #3a6ea5; color: #fff; }
.dp-cell.sel:hover { background: #2f5d8c; }
.dp-ym { cursor: pointer; padding: 2px 5px; border-radius: 4px; }
.dp-ym:hover { background: #eef4fb; }
.dp-year-grid, .dp-month-grid { display: grid; gap: 4px; margin-top: 4px; }
.dp-year-grid { grid-template-columns: repeat(4, 1fr); }
.dp-month-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
.dp-year-cell, .dp-month-cell { text-align: center; padding: 8px 0; border-radius: 6px; cursor: pointer; font-size: 13px; }
.dp-year-cell:hover, .dp-month-cell:hover { background: #eef4fb; }
.dp-year-cell.sel, .dp-month-cell.sel { background: #3a6ea5; color: #fff; }
