/* 恒链BI 用户、店铺授权与顶部店铺选择独立层。 */
.store-switch { display:inline-flex !important; align-items:center; gap:7px; }
.hl-store-switch-flag img { width:18px; height:12px; object-fit:cover; border:1px solid rgba(255,255,255,.35); vertical-align:middle; }
.hl-store-switch-arrow { font-size:11px; opacity:.8; }

.hl-access-overlay { position:fixed; inset:0; z-index:11000; background:rgba(8,18,33,.56); display:flex; align-items:center; justify-content:center; padding:24px; box-sizing:border-box; }
.hl-store-selector,.hl-auth-modal,.hl-perm-modal { position:relative; width:min(760px,calc(100vw - 40px)); max-height:calc(100vh - 48px); overflow:auto; background:#fff; border-radius:6px; box-shadow:0 14px 42px rgba(0,0,0,.24); color:#2f3845; }
.hl-store-selector { width:min(500px,calc(100vw - 40px)); padding:18px 20px 16px; }
.hl-access-close { border:0; background:transparent; font-size:26px; line-height:1; color:#4d5662; cursor:pointer; padding:5px; }
.hl-store-selector>.hl-access-close { position:absolute; top:8px; right:10px; }
.hl-selector-section-title { font-size:18px; font-weight:700; padding:0 0 14px; }
.hl-site-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; max-width:270px; margin-bottom:26px; }
.hl-site-card { height:36px; border:1px solid #d9e1e9; border-radius:4px; background:#fff; color:#9aa5b2; text-align:left; padding:0 18px; cursor:default; }
.hl-site-card.active { border-color:#8bc8ff; color:#168de2; background:#f4faff; }
.hl-site-card img { width:18px; height:12px; object-fit:cover; margin-right:8px; vertical-align:-1px; border:1px solid rgba(0,0,0,.1); }
.hl-selector-heading { border-top:1px solid #eef1f4; border-bottom:1px solid #eef1f4; padding:13px 0; display:flex; align-items:center; justify-content:space-between; }
.hl-selector-heading strong { font-size:18px; }
.hl-selector-heading span { color:#8b929c; }
.hl-store-search { display:flex; margin:14px 0 10px; }
.hl-store-search input,.hl-user-search input { flex:1; min-width:0; height:34px; border:1px solid #dbe2e9; padding:0 12px; outline:none; box-sizing:border-box; }
.hl-store-search button,.hl-user-search button { width:70px; border:0; background:#159be8; color:#fff; cursor:pointer; }
.hl-store-choice-list { display:flex; flex-wrap:wrap; gap:10px; min-height:84px; align-content:flex-start; }
.hl-store-choice { min-width:142px; max-width:210px; border:1px solid #d8e1ea; border-radius:4px; min-height:38px; display:flex; align-items:center; gap:8px; padding:7px 10px; box-sizing:border-box; cursor:pointer; background:#fff; }
.hl-store-choice:has(input:checked) { border-color:#1a9df0; background:#f1f9ff; color:#168fe0; }
.hl-store-choice input { accent-color:#169cf0; }
.hl-store-choice-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.hl-store-choice-name small { display:block; color:#97a2af; font-size:10px; overflow:hidden; text-overflow:ellipsis; }
.hl-selector-actions,.hl-modal-actions { display:flex; justify-content:flex-end; gap:12px; padding-top:20px; }
.hl-btn-cancel,.hl-btn-primary { min-width:70px; height:36px; padding:0 16px; border-radius:4px; cursor:pointer; }
.hl-btn-cancel { border:1px solid #d7dfe8; background:#fff; color:#59636f; }
.hl-btn-primary { border:1px solid #159be8; background:#159be8; color:#fff; }
.hl-btn-primary:disabled { opacity:.55; cursor:not-allowed; }

.hl-user-workspace { min-height:calc(100vh - 122px); background:#fff; padding:18px 16px 0; box-sizing:border-box; display:flex; flex-direction:column; }
.hl-user-title { font-size:16px; font-weight:700; margin-bottom:13px; }
.hl-user-toolbar { min-height:46px; display:flex; align-items:center; justify-content:space-between; gap:16px; border-top:1px solid #edf1f5; border-bottom:1px solid #edf1f5; }
.hl-user-hint { color:#f45d5d; font-size:12px; }
.hl-user-search { display:flex; width:310px; height:30px; }
.hl-user-search input { height:30px; }
.hl-user-search button { height:30px; width:58px; }
.hl-user-table-wrap { flex:1; overflow:auto; border-left:1px solid #e6ebf0; border-right:1px solid #e6ebf0; }
.hl-user-table { width:100%; border-collapse:collapse; min-width:1100px; table-layout:fixed; }
.hl-user-table th,.hl-user-table td { border-right:1px solid #e6ebf0; border-bottom:1px solid #e6ebf0; padding:9px 8px; text-align:center; font-size:12px; }
.hl-user-table th { background:#f6f8fa; color:#53606e; font-weight:600; }
.hl-user-table th:last-child,.hl-user-table td:last-child { border-right:0; }
.hl-loading-cell,.hl-error-cell,.hl-access-empty { text-align:center !important; color:#98a2ad; padding:25px !important; }
.hl-error-cell { color:#e55a5a; }
.hl-role-admin,.hl-role-user,.hl-status-on,.hl-status-off { display:inline-block; border-radius:3px; padding:2px 7px; }
.hl-role-admin { background:#fff0d8; color:#dc8b15; }
.hl-role-user { background:#eef5ff; color:#428bd2; }
.hl-status-on { background:#eaf8ec; color:#32a74c; }
.hl-status-off { background:#fff0f0; color:#db5b5b; }
.hl-user-actions { white-space:nowrap; }
.hl-user-actions button { height:26px; margin:0 3px; padding:0 8px; border-radius:3px; background:#fff; cursor:pointer; }
.hl-action-store { border:1px solid #f0b15d; color:#db8a1e; }
.hl-action-permission { border:1px solid #64b3e8; color:#278ed3; }
.hl-user-pager { min-height:52px; display:flex; align-items:center; justify-content:space-between; padding:0 4px; border-top:1px solid #e6ebf0; }
.hl-user-pager>div { display:flex; align-items:center; gap:8px; }
.hl-user-pager select,.hl-user-pager button,.hl-user-pager input { height:30px; border:1px solid #d9e1e9; background:#fff; border-radius:3px; box-sizing:border-box; }
.hl-user-pager select { width:84px; padding:0 6px; }
.hl-user-pager button { min-width:30px; cursor:pointer; }
.hl-user-pager button:disabled { color:#c4ccd5; cursor:default; }
.hl-user-pager .hl-user-current { background:#409eff; border-color:#409eff; color:#fff; }
.hl-user-jump { width:42px; text-align:center; }

.hl-auth-modal,.hl-perm-modal { width:min(1180px,calc(100vw - 56px)); padding-bottom:14px; }
.hl-modal-title { height:48px; display:flex; align-items:center; justify-content:space-between; padding:0 18px; border-bottom:1px solid #e7ebef; font-weight:700; font-size:15px; }
.hl-auth-account { padding:16px 20px; color:#606b77; }
.hl-admin-tip { margin-left:18px; padding:3px 8px; border-radius:3px; background:#fff2dd; color:#dd8b17; font-size:12px; }
.hl-country-bar { margin:0 20px; height:42px; background:#f4f6f8; display:flex; align-items:center; gap:7px; padding:0 10px; font-weight:600; }
.hl-country-bar img { width:18px; height:12px; object-fit:cover; border:1px solid rgba(0,0,0,.12); }
.hl-country-bar span { margin-left:auto; color:#9aa4ae; }
.hl-auth-store-list { min-height:110px; padding:16px 34px 26px; display:flex; flex-wrap:wrap; gap:12px; border-bottom:1px solid #edf0f3; }
.hl-auth-store-card { min-width:210px; max-width:280px; min-height:42px; display:flex; align-items:center; gap:8px; border:1px solid #dce3e9; border-radius:4px; padding:6px 10px; cursor:pointer; box-sizing:border-box; }
.hl-auth-store-card:has(input:checked) { border-color:#3fa6ee; background:#f3faff; color:#248fd7; }
.hl-auth-store-card span { position:relative; display:block; min-width:0; padding-right:42px; }
.hl-auth-store-card b { display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-size:12px; }
.hl-auth-store-card small { display:block; color:#96a1ad; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-size:10px; }
.hl-auth-store-card em { position:absolute; top:0; right:0; font-style:normal; font-size:9px; color:#fff; background:#159be8; padding:1px 4px; }
.hl-auth-modal .hl-modal-actions,.hl-perm-modal .hl-modal-actions { padding:16px 20px 0; }

.hl-perm-all { padding:0 20px 12px; border-bottom:1px solid #edf0f3; }
.hl-perm-content { padding:8px 20px 0; max-height:60vh; overflow:auto; }
.hl-perm-group { border-bottom:1px solid #edf0f3; padding:10px 0 12px; }
.hl-perm-group-title { font-weight:700; margin-bottom:8px; }
.hl-perm-grid { display:grid; grid-template-columns:repeat(5,minmax(120px,1fr)); gap:8px 18px; padding-left:22px; }
.hl-perm-grid label,.hl-perm-group-title label,.hl-perm-all label { cursor:pointer; }

.hl-access-toast { position:fixed; z-index:12000; left:50%; top:80px; transform:translateX(-50%); min-width:180px; max-width:70vw; padding:10px 18px; border-radius:4px; background:#233447; color:#fff; text-align:center; box-shadow:0 5px 18px rgba(0,0,0,.18); }
.hl-access-toast.is-error { background:#d9534f; }

@media(max-width:900px){.hl-perm-grid{grid-template-columns:repeat(2,minmax(120px,1fr))}.hl-user-toolbar{align-items:flex-start;flex-direction:column;padding:8px 0}.hl-user-search{width:100%}}

/* 公司 / 用户 / 角色权限管理 */
.hl-user-toolbar-left { display:flex; align-items:center; gap:12px; min-width:0; }
.hl-user-toolbar-left .hl-btn-primary { height:30px; min-width:78px; padding:0 14px; flex:none; }
.hl-user-toolbar-left .hl-btn-outline { height:30px; padding:0 12px; flex:none; }
.hl-btn-outline { border:1px solid #b8d8ef; border-radius:4px; background:#fff; color:#248fd7; cursor:pointer; }
.hl-btn-outline:disabled { opacity:.55; cursor:not-allowed; }
.hl-user-hint b { color:#47586a; font-weight:600; }
.hl-role-empty { display:inline-block; border-radius:3px; padding:2px 7px; background:#f3f4f6; color:#999; }
.hl-system-role { display:inline-block; margin-left:5px; padding:1px 5px; border-radius:3px; font-size:10px; color:#248fd7; background:#eef7ff; border:1px solid #c9e7fb; vertical-align:1px; }
.hl-action-edit { border:1px solid #64b3e8; color:#278ed3; }
.hl-action-password { border:1px solid #8eacd4; color:#396eae; }
.hl-action-delete { border:1px solid #f09b9b; color:#e25555; }
.hl-role-table { min-width:950px; }
.hl-role-footer { justify-content:flex-start; }

.hl-small-modal { position:relative; width:min(520px,calc(100vw - 40px)); background:#fff; border-radius:6px; box-shadow:0 14px 42px rgba(0,0,0,.24); color:#2f3845; overflow:hidden; }
.hl-form-body { padding:20px 24px 4px; }
.hl-form-body>label { display:flex; align-items:center; margin-bottom:15px; font-size:13px; }
.hl-form-body>label>span { width:92px; flex:none; color:#586675; }
.hl-form-body input[type=text],.hl-form-body input[type=password],.hl-form-body select,.hl-form-body textarea { flex:1; min-width:0; border:1px solid #d9e1e9; border-radius:4px; box-sizing:border-box; outline:none; color:#35414d; background:#fff; }
.hl-form-body input[type=text],.hl-form-body input[type=password],.hl-form-body select { height:36px; padding:0 10px; }
.hl-form-body textarea { height:84px; padding:9px 10px; resize:vertical; font-family:inherit; }
.hl-form-body input:disabled { background:#f6f8fa; color:#8995a1; }
.hl-form-body .hl-form-inline { justify-content:flex-start; }
.hl-form-body .hl-form-inline input { margin-right:6px; }
.hl-form-tip { margin:2px 0 12px 92px; color:#9a6b2f; background:#fff8ec; border:1px solid #f7e1ba; border-radius:4px; padding:8px 10px; font-size:12px; line-height:1.6; }
.hl-partial-note { margin:8px 0 12px 92px; border:1px solid #f1b8aa; background:#fff2ef; color:#b04c35; border-radius:4px; padding:9px 10px; line-height:1.6; font-size:12px; }
.hl-partial-note[hidden] { display:none; }
.hl-password-target { margin:0 0 18px; color:#526274; font-size:13px; }
.hl-password-target b { color:#253c55; }
.hl-small-modal .hl-modal-actions { padding:14px 24px 20px; border-top:1px solid #eef1f4; flex-wrap:wrap; }

@media(max-width:900px){
  .hl-user-toolbar-left{align-items:flex-start;flex-direction:column}
  .hl-form-body>label{align-items:flex-start;flex-direction:column;gap:6px}
  .hl-form-body>label>span{width:auto}
  .hl-form-body input[type=text],.hl-form-body input[type=password],.hl-form-body select,.hl-form-body textarea{width:100%;flex:none}
  .hl-form-tip,.hl-partial-note{margin-left:0}
}
.hl-form-body>label.hl-check-line { justify-content:flex-start; gap:7px; padding-left:92px; box-sizing:border-box; }
.hl-form-body>label.hl-check-line>span { width:auto; color:#586675; }
@media (max-width:720px){ .hl-form-body>label.hl-check-line{padding-left:0;flex-direction:row;align-items:center} }

/* 用户/角色页面独立挂载：不再改写 React 管理的 .app-main，避免切换模块白屏 */
.hl-access-page-host {
  display: none;
  width: 100%;
  min-width: 0;
  padding: 18px 22px 28px;
  box-sizing: border-box;
}
body.hl-access-custom-route .page-column > .app-main {
  display: none !important;
}
body.hl-access-custom-route .hl-access-page-host {
  display: block;
}
