/* 汉东方后台 — 基于 doc/模板.html 的 Tailwind 风格扩展 */
.hdf-panel {
    background: #fff;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
    overflow: hidden;
}
.hdf-panel-hd {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.hdf-panel-hd h3 { margin: 0; font-size: 1rem; font-weight: 600; color: #111827; }
.hdf-panel-bd { padding: 1rem 1.5rem 1.5rem; }

.hdf-top-tab {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    color: #6b7280;
    cursor: pointer;
    white-space: nowrap;
    transition: all .2s;
    text-decoration: none;
    font-size: 0.875rem;
}
.hdf-top-tab:hover { background: #f3f4f6; color: #374151; }
.hdf-top-tab.active { background: #4f46e5; color: #fff; }
.hdf-top-tab i { margin-right: 0.5rem; }

.hdf-sub-group { margin-bottom: 0.15rem; }
.hdf-sub-group-head {
    display: flex;
    align-items: stretch;
    border-radius: 0.375rem;
    overflow: hidden;
}
.hdf-sub-fold {
    flex-shrink: 0;
    width: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0;
    color: #94a3b8;
    cursor: pointer;
    transition: color .2s, background .2s;
}
.hdf-sub-fold:hover { background: #1e293b; color: #fff; }
.hdf-sub-chevron {
    font-size: 0.65rem;
    transition: transform .2s ease;
}
.hdf-sub-group.open > .hdf-sub-group-head .hdf-sub-chevron { transform: rotate(90deg); }
.hdf-sub-group-title-link {
    flex: 1;
    min-width: 0;
    border-radius: 0 0.375rem 0.375rem 0;
}
.hdf-sub-label { cursor: default; color: #e2e8f0; font-weight: 500; }
.hdf-sub-group-body {
    display: none;
    padding-left: 0.25rem;
    margin-top: 0.1rem;
}
.hdf-sub-group.open > .hdf-sub-group-body { display: block; }
.hdf-sub-item {
    display: flex;
    align-items: center;
    padding: 0.55rem 1rem;
    border-radius: 0.375rem;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.875rem;
    transition: all .2s;
}
.hdf-sub-item i { width: 1.25rem; margin-right: 0.5rem; font-size: 0.8rem; }
.hdf-sub-item:hover { background: #1e293b; color: #fff; }
.hdf-sub-item.active { background: #4f46e5; color: #fff; }
.hdf-sub-item.indent { padding-left: 2rem; font-size: 0.8125rem; }

/* 左侧侧栏（不依赖 Tailwind slate 色系，兼容 v2 静态 CSS） */
#nav-sub {
    background-color: #0f172a;
    color: #cbd5e1;
    width: 16rem;
    flex-shrink: 0;
}
#nav-sub .hdf-aside-brand {
    background-color: #020617;
    border-bottom: 1px solid #1e293b;
    color: #fff;
}
#nav-sub .hdf-aside-brand .fa-cubes-stacked { color: #6366f1; }
#nav-sub .hdf-aside-foot {
    background-color: #020617;
    border-top: 1px solid #1e293b;
}
#nav-sub .hdf-aside-foot .hdf-user-name { color: #fff; }
#nav-sub .hdf-aside-foot .hdf-user-account { color: #94a3b8; }
#nav-sub .hdf-aside-foot .hdf-logout-btn { color: #94a3b8; }
#nav-sub .hdf-aside-foot .hdf-logout-btn:hover { color: #f87171; }
#nav-sub-inner .hdf-sub-empty { color: #94a3b8; }

/* 侧栏整体收起 */
#nav-sub.hdf-aside-collapsed { width: 0; min-width: 0; padding: 0; overflow: hidden; border: 0; }
#nav-sub.hdf-aside-collapsed > * { opacity: 0; pointer-events: none; }
body.hdf-aside-collapsed #btn-collapse-sub .fa-angles-left { transform: rotate(180deg); display: inline-block; }
#btn-collapse-sub .fa-angles-left { transition: transform .2s; }

.hdf-stat-card {
    background: #fff;
    padding: 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.hdf-stat-card .num { font-size: 1.75rem; font-weight: 700; color: #111827; }
.hdf-stat-card .lbl { font-size: 0.875rem; color: #6b7280; margin-top: 0.25rem; }

/* layui 与 tailwind 共存 */
.layui-table-view { margin: 0; }
/* 固定操作列：右侧阴影与层级 */
.layui-table-view .layui-table-fixed-r {
    box-shadow: -4px 0 8px rgba(15, 23, 42, 0.08);
}
.layui-table-view .layui-table-fixed-r .layui-table-header th,
.layui-table-view .layui-table-fixed-r .layui-table-body td {
    background: #fff;
}
.hdf-card .layui-table-view,
.hdf-panel .layui-table-view {
    border-radius: 8px;
    overflow: hidden;
}
.layui-form-label { width: 100px; }
.layui-input-block { margin-left: 130px; }
.xm-select-parent { width: 100% !important; }

.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #312e81 100%);
}
.login-box {
    width: 400px;
    background: #fff;
    border-radius: 0.75rem;
    padding: 2rem;
    box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
.login-box h2 { text-align: center; margin: 0 0 1.5rem; color: #111827; font-weight: 600; }
.login-divider {
    display: flex;
    align-items: center;
    margin: 1.25rem 0;
    color: #9ca3af;
    font-size: 0.8125rem;
}
.login-divider::before,
.login-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}
.login-divider span { padding: 0 0.75rem; }
.login-wecom-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.65rem 1rem;
    border-radius: 0.375rem;
    background: #07c160;
    color: #fff;
    text-decoration: none;
    font-size: 0.9375rem;
    transition: background .2s;
}
.login-wecom-btn:hover { background: #06ad56; color: #fff; }
.login-wecom-icon { width: 1.25rem; height: 1.25rem; flex-shrink: 0; }
.login-wecom-loading {
    text-align: center;
    padding: 1.5rem 0 0.5rem;
    color: #6b7280;
}
.login-wecom-loading .layui-icon { font-size: 2rem; color: #07c160; margin-bottom: 0.75rem; display: inline-block; }
.login-wecom-loading p { margin: 0; font-size: 0.9375rem; }
.up-sidebar-url {
    display: inline-block;
    max-width: 100%;
    padding: 0.35rem 0.6rem;
    border-radius: 0.375rem;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    color: #374151;
    word-break: break-all;
}

/* 企微账号 Tab 切换 */
.wecom-acc-bar {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 0.85rem 1rem 0.75rem;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.wecom-acc-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
}
.wecom-acc-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #374151;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.wecom-acc-label i { color: #07c160; }
.wecom-acc-cfg {
    font-size: 0.8125rem;
    color: #4f46e5;
    text-decoration: none;
}
.wecom-acc-cfg:hover { text-decoration: underline; }
.wecom-acc-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.wecom-acc-tab {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    min-width: 140px;
    max-width: 260px;
    padding: 0.55rem 0.9rem 0.5rem;
    border: 1.5px solid #e5e7eb;
    border-radius: 0.55rem;
    background: #f9fafb;
    color: #4b5563;
    cursor: pointer;
    text-align: left;
    transition: border-color .15s, background .15s, box-shadow .15s, color .15s;
}
.wecom-acc-tab:hover {
    border-color: #a5b4fc;
    background: #eef2ff;
    color: #3730a3;
}
.wecom-acc-tab.is-active {
    border-color: #4f46e5;
    background: linear-gradient(180deg, #4f46e5 0%, #4338ca 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}
.wecom-acc-tab.is-active:hover {
    border-color: #4338ca;
    background: linear-gradient(180deg, #4338ca 0%, #3730a3 100%);
    color: #fff;
}
.wecom-acc-tab-name {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.3;
    padding-right: 1.1rem;
}
.wecom-acc-tab-name i { opacity: 0.95; }
.wecom-acc-tab-meta {
    font-size: 0.7rem;
    opacity: 0.75;
    line-height: 1.2;
}
.wecom-acc-tab.is-active .wecom-acc-tab-meta { opacity: 0.9; }
.wecom-acc-tab-check {
    position: absolute;
    top: 0.4rem;
    right: 0.45rem;
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 999px;
    background: rgba(255,255,255,.22);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
}
.wecom-acc-hint {
    margin: 0.55rem 0 0;
    font-size: 0.75rem;
    color: #9ca3af;
}
.wecom-acc-empty {
    font-size: 0.875rem;
    color: #b45309;
}
.wecom-acc-empty a { color: #4f46e5; }

/* Layui 默认隐藏 form 内 radio/checkbox，且 [lay-ignore] 优先级不够；原生勾选区强制显示 */
.layui-form .wcm-native-checks input[type=checkbox],
.layui-form .wcm-native-checks input[type=radio],
.layui-form .wcm-group-list input[type=checkbox],
.layui-form .wcm-role-list input[type=checkbox] {
    display: inline-block !important;
    width: 1rem;
    height: 1rem;
    margin: 0 0.35rem 0 0;
    vertical-align: -0.15em;
    -webkit-appearance: auto;
    appearance: auto;
    opacity: 1;
    position: static;
}

/* —— 企微员工 · 组织架构工作台 —— */
.wecom-staff-workbench {
    align-items: stretch;
}
.wecom-org-panel {
    display: flex;
    flex-direction: column;
    min-height: 420px;
    max-height: 72vh;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 48px);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    overflow: hidden;
}
.wecom-org-panel-hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid #eef2f7;
    background: rgba(255, 255, 255, 0.85);
}
.wecom-org-panel-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    letter-spacing: 0.02em;
}
.wecom-org-panel-title i {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eef2ff;
    color: #4f46e5;
    font-size: 12px;
}
.wecom-org-refresh {
    width: 30px;
    height: 30px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #64748b;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, color .15s, border-color .15s;
}
.wecom-org-refresh:hover {
    background: #f1f5f9;
    color: #4f46e5;
    border-color: #c7d2fe;
}
.wecom-org-panel-bd {
    flex: 1;
    overflow: auto;
    padding: 8px 6px 12px;
}
.wecom-org-tree {
    min-height: 200px;
}
.wecom-org-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 220px;
    padding: 24px 16px;
    text-align: center;
    font-size: 12px;
    line-height: 1.6;
    color: #94a3b8;
}
.wecom-org-empty i { font-size: 18px; opacity: .85; }
.wecom-org-empty-err { color: #dc2626; }
.wecom-org-empty-warn { color: #d97706; }

/* layui tree 定制 */
.wecom-org-tree .layui-tree-entry {
    height: auto;
    padding: 2px 4px;
}
.wecom-org-tree .layui-tree-main {
    padding: 6px 8px;
    border-radius: 8px;
    transition: background .12s ease;
}
.wecom-org-tree .layui-tree-txt {
    font-size: 13px;
    color: #475569;
}
.wecom-org-tree .layui-tree-iconClick,
.wecom-org-tree .layui-tree-icon {
    color: #94a3b8;
}
.wecom-org-tree .layui-tree-entry:hover .layui-tree-main {
    background: #f1f5f9;
}
.wecom-org-tree .layui-tree-set.is-selected > .layui-tree-entry .layui-tree-main {
    background: #eef2ff;
}
.wecom-org-tree .layui-tree-set.is-selected > .layui-tree-entry .layui-tree-txt {
    color: #4338ca;
    font-weight: 600;
}
.wecom-org-tree .layui-tree-line .layui-tree-set:before,
.wecom-org-tree .layui-tree-line .layui-tree-entry:before {
    border-color: #e2e8f0;
}

.wecom-staff-main {
    display: flex;
    flex-direction: column;
    min-height: 420px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    overflow: hidden;
}
.wecom-staff-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid #eef2f7;
    background: #fafbfc;
}
.wecom-staff-dept {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}
.wecom-staff-dept i { color: #6366f1; }
.wecom-staff-table-wrap {
    padding: 8px 12px 12px;
    overflow: auto;
}

/* —— 企微员工 · 弹框表单 / 租户多选 —— */
.wecom-staff-form {
    padding: 18px 20px 16px;
}
.wecom-staff-form .layui-form-label {
    width: 72px;
    padding-left: 0;
    color: #64748b;
}
.wecom-staff-form .layui-input-block {
    margin-left: 84px;
}
.wecom-staff-form-ft {
    display: flex;
    justify-content: flex-end;
    padding-top: 8px;
    margin-top: 4px;
    border-top: 1px solid #f1f5f9;
}
.wecom-tenant-field {
    margin-bottom: 16px;
}
.wecom-tenant-field-label {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 4px;
}
.wecom-tenant-req {
    color: #ef4444;
    font-weight: 500;
}
.wecom-tenant-hint {
    margin: 0 0 10px;
    font-size: 12px;
    line-height: 1.5;
    color: #94a3b8;
}
.wecom-tenant-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 220px;
    overflow-y: auto;
}
.wecom-tenant-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s, background .15s, box-shadow .15s;
    user-select: none;
}
.wecom-tenant-chip:hover {
    border-color: #c7d2fe;
    background: #f8fafc;
}
.wecom-tenant-chip.is-on {
    border-color: #818cf8;
    background: #eef2ff;
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.15);
}
.wecom-tenant-chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.wecom-tenant-chip-check {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 1.5px solid #cbd5e1;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: transparent;
    font-size: 10px;
    transition: all .15s;
}
.wecom-tenant-chip.is-on .wecom-tenant-chip-check {
    border-color: #4f46e5;
    background: #4f46e5;
    color: #fff;
}
.wecom-tenant-chip-name {
    font-size: 13px;
    color: #334155;
    font-weight: 500;
    line-height: 1.3;
}
.wecom-tenant-chip.is-on .wecom-tenant-chip-name {
    color: #3730a3;
}
.wecom-tenant-empty {
    padding: 14px 12px;
    border-radius: 10px;
    border: 1px dashed #fcd34d;
    background: #fffbeb;
    color: #b45309;
    font-size: 12px;
    line-height: 1.5;
}

