/* =========================
   基础样式：页面通用骨架
   ========================= */
body {
    font-family: Arial, sans-serif;
    background-color: #f8f9fa; /* 淡灰色背景 */
    padding: 10px;
}

.impersonation-banner {
    background: #fff3cd;
    border-top: 1px solid #ffda6a;
    border-bottom: 1px solid #ffda6a;
    color: #332701;
    margin: 0;
    padding: 0.5rem 0;
}

h1, h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #343a40; /* 深色文本 */
}

.container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 10px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
}

/* =========================
   通用表单控件
   ========================= */
.form-label {
    font-weight: bold;
    margin-bottom: 8px;
}

.form-control {
    margin-bottom: 15px;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #ced4da;
}

.form-select {
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #ced4da;
}

.password-input-group {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.password-input-group > input,
.password-input-group > .form-control {
    flex: 1 1 auto;
    min-width: 0;
    margin-bottom: 0;
}

.password-toggle-btn,
[data-password-toggle] {
    width: auto;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    line-height: 1;
    white-space: nowrap;
}

.password-toggle-btn i,
[data-password-toggle] i {
    line-height: 1;
}

.password-modal-input-group {
    display: flex;
    align-items: stretch;
    width: 100%;
}

.password-modal-input-group > .form-control {
    flex: 1 1 auto;
    min-width: 0;
    margin-bottom: 0;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.password-modal-input-group > .password-modal-addon-btn {
    flex: 0 0 44px;
    width: 44px;
    min-width: 44px;
    height: calc(2.25rem + 2px);
    margin: 0 0 0 -1px;
    padding: 0;
    border: 1px solid #ced4da;
    border-radius: 0;
    background: #fff;
    color: #6c757d;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.password-modal-input-group > .password-modal-addon-btn:hover {
    background: #f8f9fa;
    color: #495057;
}

.password-modal-input-group > .password-modal-addon-btn:focus {
    position: relative;
    z-index: 2;
}

.password-modal-input-group > .password-modal-addon-btn:last-child {
    border-top-right-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
}

.password-modal-input-group > .password-modal-addon-btn i {
    line-height: 1;
}

/* =========================
   通用按钮
   ========================= */
button {
    padding: 5px;
    font-size: 16px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
}

button:hover {
    opacity: 0.9;
}

/* =========================
   通用列表项
   ========================= */
.list-group-item {
    font-size: 16px;
    margin-bottom: 1px;
    padding: 1px;
    background-color: #e9ecef;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

/* =========================
   基础小屏适配
   ========================= */
@media (max-width: 1440px) {
    .container {
        padding: 0px;
        max-width: 100%;
    }

    h1, h2 {
        font-size: 20px;
    }

    button {
        font-size: 10px;
        padding: 4px;
    }

    .list-group-item {
        font-size: 16px;
        padding: 0px;
    }
}
/* =========================
   通用表格基础
   ========================= */
table {
    border-collapse: collapse; /* 确保表格边框合并 */
    width: 100%; /* 确保表格宽度100% */
}

tr {
    background-color: transparent; /* 确保行背景透明 */
}

td {
    background-color: transparent; /* 确保单元格背景透明 */
}

/* =========================
   课程归档列表：滚动容器与列宽
   说明：列宽按 nth-child 固定，请与模板列顺序保持一致
   ========================= */
.course-archives-table-wrap {
    max-height: 70vh;
    overflow: auto;
}

.course-archives-table {
    table-layout: fixed;
    width: 100%;
    min-width: 90em;
}

.course-archives-table th,
.course-archives-table td {
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.course-archives-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background-color: #e9ecef;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.2;
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
    word-break: break-all;
}

.course-archives-table thead th.table-sort-asc::after {
    content: " ▲";
    font-size: 12px;
    color: #6c757d;
}

.course-archives-table thead th.table-sort-desc::after {
    content: " ▼";
    font-size: 12px;
    color: #6c757d;
}

.course-archives-table th:nth-child(1),
.course-archives-table td:nth-child(1) {
    width: 2em;
}

.course-archives-table th:nth-child(2),
.course-archives-table td:nth-child(2) {
    width: 6em;
}

.course-archives-table th:nth-child(3),
.course-archives-table td:nth-child(3) {
    width: 4em;
}

.course-archives-table th:nth-child(4),
.course-archives-table td:nth-child(4) {
    width: 9em;
}

.course-archives-table th:nth-child(5),
.course-archives-table td:nth-child(5) {
    width: 6em;
}

.course-archives-table th:nth-child(6),
.course-archives-table td:nth-child(6) {
    width: 8em;
}

.course-archives-table th:nth-child(7),
.course-archives-table td:nth-child(7) {
    width: 2.4em;
}

.course-archives-table th:nth-child(8),
.course-archives-table td:nth-child(8) {
    width: 6em;
}

.course-archives-table th:nth-child(9),
.course-archives-table td:nth-child(9) {
    width: 3em;
}

.course-archives-table th:nth-child(10),
.course-archives-table td:nth-child(10) {
    width: 3em;
}

.course-archives-table th:nth-child(11),
.course-archives-table td:nth-child(11) {
    width: 3em;
}

.course-archives-table th:nth-child(12),
.course-archives-table td:nth-child(12) {
    width: 3em;
}

.course-archives-table th:nth-child(13),
.course-archives-table td:nth-child(13) {
    width: 7em;
}

.course-archives-table th:nth-child(14),
.course-archives-table td:nth-child(14) {
    width: 5em;
}

.course-archives-table th:nth-child(15),
.course-archives-table td:nth-child(15) {
    width: 9em;
}

.course-archives-table td:nth-child(15) {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
}

/* 课程归档列表：操作列按钮排布 */
.course-archives-action-cell {
    white-space: normal;
}

.course-archives-action-wrap {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.course-archives-action-wrap .btn {
    margin: 0 !important;
    white-space: nowrap;
}

@media (max-width: 1200px) {
    /* 课程归档列表：中小屏最小宽度与操作列宽度 */
    .course-archives-table {
        min-width: 98em;
    }
    .course-archives-table th:nth-child(15),
    .course-archives-table td:nth-child(15) {
        width: 10em;
    }
}

/* =========================
   管理页面表格容器（用户管理/增免修列表）
   ========================= */
.manage-users-table-wrap {
    max-height: 70vh;
    overflow-x: auto;
    overflow-y: auto;
}

.manage-users-filter-card {
    margin-bottom: 0;
}

/* 课程增免修列表：固定表头与操作列 */
/* 增免修审批筛选：PC 单行等高对齐，覆盖全局表单控件不一致的高度与底边距。 */
.course-change-admin-filter-row {
    display: grid;
    grid-template-columns: 1fr 0.75fr 1.08fr 1.15fr 1fr 0.85fr 1.08fr 38px 38px;
    column-gap: 0.5rem;
    align-items: end;
}

.course-change-admin-filter-item {
    min-width: 0;
}

.course-change-admin-filter-item .form-label {
    display: block;
    white-space: nowrap;
}

.course-change-admin-filter-control {
    width: 100%;
    height: 38px !important;
    margin-bottom: 0 !important;
    padding: 0.375rem 0.5rem !important;
}

.course-change-admin-filter-action {
    width: 38px;
    height: 38px;
}

@media (max-width: 767.98px) {
    .course-change-admin-filter-row {
        display: flex;
        flex-wrap: nowrap;
        align-items: flex-end;
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .course-change-admin-filter-item {
        flex: 0 0 140px;
        margin-right: 0.5rem;
    }

    .course-change-admin-filter-action {
        flex: 0 0 38px;
        margin-right: 0.5rem;
    }

    .course-change-admin-filter-action:last-child {
        margin-right: 0;
    }
}

.course-change-list-table-wrap {
    max-height: 70vh;
    overflow-x: hidden;
    overflow-y: auto;
}

.course-change-list-table {
    width: 100%;
    min-width: 0;
}

.course-change-list-table thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    background-color: #e9ecef;
}

.course-change-list-table th:last-child,
.course-change-list-table td:last-child {
    position: sticky;
    right: 0;
    background-color: #fff;
    box-shadow: -1px 0 0 #dee2e6;
}

.course-change-list-table th:last-child {
    z-index: 7;
}

.course-change-list-table td:last-child {
    z-index: 3;
}

.course-change-list-table thead th:last-child {
    background-color: #e9ecef;
}

.course-change-list-table td:nth-child(6) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.course-change-list-table .action-column {
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    width: 100%;
    min-width: 84px;
    gap: 0;
}

@media (min-width: 768px) and (max-width: 1200px) {
    .course-change-list-table .action-column {
        gap: 0;
    }

    .course-change-list-table .action-column > * + * {
        margin-left: 0;
    }

    .course-change-list-table .action-column > form {
        display: inline-flex;
        align-items: center;
        margin-left: 0 !important;
    }
}

/* 操作日志：查询块垂直对齐 + 固定表头与类型列宽 */
.operation-log-filter-card .card-body {
    padding: 14px 16px;
}

.operation-log-filter-grid {
    display: grid;
    align-items: end;
    column-gap: 12px;
    row-gap: 12px;
    grid-template-columns: minmax(180px, 1.25fr) minmax(150px, .9fr) minmax(150px, .9fr) minmax(150px, .9fr) minmax(150px, .9fr) minmax(120px, .7fr);
}

.operation-log-filter-grid-secondary {
    margin-top: 12px;
}

.operation-log-filter-grid-secondary .operation-log-filter-actions {
    grid-column: span 2;
}

.operation-log-filter-item {
    min-width: 0;
}

.operation-log-filter-card .form-label,
.operation-log-filter-actions-label {
    display: block;
    margin: 0 0 6px;
    line-height: 1.25;
}

.operation-log-filter-card .form-control,
.operation-log-filter-card .form-select {
    width: 100%;
    height: 38px;
    min-height: 38px;
    margin-bottom: 0;
    padding: 6px 10px;
}

.operation-log-action-buttons {
    display: flex;
    align-items: center;
    min-height: 38px;
}

.operation-log-action-buttons .btn {
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    white-space: nowrap;
}

.operation-log-action-buttons .btn:last-child {
    margin-right: 0;
}

.operation-logs-table-wrap {
    max-height: 70vh;
    overflow-x: auto;
    overflow-y: auto;
}

.operation-logs-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background-color: #e9ecef;
}

.operation-logs-table .operation-logs-type-col {
    width: 22ch;
    min-width: 22ch;
    white-space: normal;
}

.operation-log-display-type {
    font-weight: 600;
    line-height: 1.35;
}

@media (max-width: 1180px) {
    .operation-log-filter-grid-primary,
    .operation-log-filter-grid-secondary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .operation-log-filter-actions,
    .operation-log-filter-grid-secondary .operation-log-filter-actions {
        grid-column: span 3;
    }
}

@media (max-width: 768px) {
    .operation-log-filter-grid-primary,
    .operation-log-filter-grid-secondary {
        grid-template-columns: 1fr;
    }

    .operation-log-filter-actions,
    .operation-log-filter-grid-secondary .operation-log-filter-actions {
        grid-column: auto;
    }

    .operation-log-action-buttons {
        flex-wrap: wrap;
    }

    .operation-log-action-buttons .btn {
        margin-bottom: 8px;
    }
}

/* 意见收集列表：自适应行高 + 图片按钮 + 移动端阅读 */
.admin-feedback-table-wrap {
    overflow-x: auto;
}

.admin-feedback-table {
    width: 100%;
    table-layout: auto;
}

.admin-feedback-table th,
.admin-feedback-table td {
    vertical-align: top;
    line-height: 1.45;
    height: auto;
}

.admin-feedback-content {
    white-space: pre-wrap;
    word-break: break-word;
    min-width: 420px;
}

.admin-feedback-images {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem;
}

@media (max-width: 768px) {
    .admin-feedback-table thead {
        display: none;
    }

    .admin-feedback-table,
    .admin-feedback-table tbody,
    .admin-feedback-table tr,
    .admin-feedback-table td {
        display: block;
        width: 100%;
    }

    .admin-feedback-table tr {
        margin-bottom: 0.75rem;
        padding: 0.6rem 0.75rem;
        border: 1px solid #dee2e6;
        border-radius: 0.5rem;
        background: #fff;
    }

    .admin-feedback-table td {
        border: 0;
        padding: 0.22rem 0;
        text-align: left !important;
    }

    .admin-feedback-table td::before {
        content: attr(data-label) "：";
        color: #6c757d;
        font-weight: 600;
        margin-right: 0.25rem;
    }

    .admin-feedback-images {
        justify-content: flex-start;
    }
}

/* 课程增免修列表：操作图标按钮 */
.course-change-op {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    height: 1.35rem;
    padding: 0;
    margin: 0;
    line-height: 1;
    border: 0;
    background: transparent;
    text-decoration: none;
}

.course-change-op i {
    font-size: 0.85rem;
}

.course-change-op-view i {
    color: #007bff;
}

.course-change-op-proxy i {
    color: #ffc107;
}

.course-change-op-withdraw i {
    color: #fd7e14;
}

.course-change-op-delete i {
    color: #dc3545;
}

.course-change-op-disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.btn-square {
    width: 38px;
    height: 38px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon {
    padding: 0.2rem 0.35rem;
    line-height: 1;
}

.btn-icon i {
    font-size: 0.9rem;
}

/* =========================
   用户管理：主表、跨学院表、责任教授表
   ========================= */
.manage-users-table {
    width: 100%;
    table-layout: auto;
}

.manage-users-table th,
.manage-users-table td {
    text-align: center;
    vertical-align: middle;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    word-break: break-word;
}

.manage-users-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background-color: #e9ecef;
    padding-top: 0.67rem;
    padding-bottom: 0.67rem;
    line-height: 1.35;
}

.manage-users-main-table th:nth-child(1),
.manage-users-main-table td:nth-child(1) {
    width: calc(6em + 1px);
}

.manage-users-main-table th:nth-child(2),
.manage-users-main-table td:nth-child(2) {
    width: 13ch;
    white-space: nowrap;
}

.manage-users-main-table th:nth-child(3),
.manage-users-main-table td:nth-child(3) {
    width: 5em;
    white-space: nowrap;
}

.manage-users-main-table th:nth-child(4),
.manage-users-main-table td:nth-child(4) {
    width: 14em;
}

.manage-users-main-table th:nth-child(5),
.manage-users-main-table td:nth-child(5) {
    width: 13em;
    white-space: normal;
}

.manage-users-main-table th:nth-child(6),
.manage-users-main-table td:nth-child(6) {
    width: 11em;
}

.manage-users-main-table th:nth-child(7),
.manage-users-main-table td:nth-child(7) {
    width: 10em;
}

.manage-users-main-table td:nth-child(7) {
    white-space: nowrap;
}

.manage-users-actions {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 0.12rem;
}

.manage-users-actions form {
    display: inline-flex;
    align-items: center;
    margin: 0;
}

.manage-users-action-link,
.manage-users-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.7em;
    height: 1.7em;
    padding: 0;
    border: none;
    background: transparent;
    color: inherit;
    cursor: pointer;
    text-decoration: none;
}

.manage-users-actions .manage-users-action-link,
.manage-users-actions .binding-edit-btn {
    color: #0d6efd;
}

.manage-users-actions form .manage-users-action-btn,
.manage-users-actions .binding-delete-btn {
    color: #dc3545;
}

.manage-users-actions .impersonate-user-form .manage-users-action-btn {
    color: #198754;
}

.manage-users-actions .reset-password-btn {
    color: #d4a017;
}

.manage-users-actions .reset-signature-popup-btn i {
    background: linear-gradient(135deg, #0d6efd 0%, #20c997 35%, #ffc107 68%, #dc3545 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.manage-users-actions .module-permission-btn {
    color: #198754;
}

.manage-users-action-link:hover,
.manage-users-action-btn:hover {
    opacity: 0.8;
}

.manage-users-toolbar-row > [class*="col-"] {
    display: flex;
    align-items: stretch;
}

.manage-users-toolbar-row > [class*="col-"] > * {
    width: 100%;
}

/* 2026-05-28：角色变更页复选框 flex + label min-width 布局。
   - 保留 flex 自适应换行（label 短行不会被强制拉宽到等列，避免大空白）。
   - 每个 label 锁定 min-width=11em，足以容纳"系部归档员（归档）"这类最长名称；
     勾选框天然按 min-width 步进对齐到同一列。
   - 长名（带 small 后缀的"外院授课(切换至客学院设置)"）按 label 实际宽度撑大该格，
     不影响后续 label 的下行对齐起点。 */
.edit-user-role-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 1.5rem;
    row-gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.edit-user-role-row label {
    line-height: 1.5;
    min-width: 11em;
    white-space: nowrap;
}

@media (max-width: 576px) {
    .edit-user-role-row label {
        min-width: 0;
    }
}

.manage-users-toolbar-panel {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    min-width: 0;
}

.manage-users-toolbar-panel .form-label {
    white-space: nowrap;
}

.manage-users-toolbar-title {
    display: block;
}

.manage-users-filter-inline {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.75rem;
    min-width: 0;
}

.manage-users-filter-input-inline {
    flex: 0 1 16rem;
    width: 16rem;
    max-width: 16rem;
    min-width: 10rem;
    margin-bottom: 0;
}

.manage-users-filter-inline .btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

.manage-users-primary-toolbar {
    justify-content: flex-start;
}

.manage-users-primary-actions {
    display: flex;
    margin-left: 0;
    justify-content: flex-start;
    gap: 0.75rem;
    flex-wrap: nowrap;
}

.manage-users-primary-actions .btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

.manage-users-type-tabs-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: nowrap;
}

.manage-users-type-tabs {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: nowrap;
    min-width: 0;
}

.manage-users-type-tabs .nav-item {
    flex: 0 1 auto;
    min-width: 0;
}

.manage-users-type-tabs .nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    width: 100%;
    min-height: 2.5rem;
    padding: 0.35rem 0.6rem;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
}

.manage-users-type-tabs .nav-link .badge {
    flex: 0 0 auto;
    white-space: nowrap;
}

.manage-users-type-tabs-clear {
    flex: 0 0 auto;
    white-space: nowrap;
}


.cross-users-table-wrap {
    overflow-x: hidden;
}

#crossUsersTable {
    table-layout: fixed;
    width: 100%;
    min-width: 0;
}

#crossUsersTable th,
#crossUsersTable td {
    padding-left: 0.35rem;
    padding-right: 0.35rem;
}

#crossUsersTable th:nth-child(1),
#crossUsersTable td:nth-child(1) {
    width: 8%;
}

#crossUsersTable th:nth-child(2),
#crossUsersTable td:nth-child(2) {
    width: 11%;
    white-space: nowrap;
}

#crossUsersTable th:nth-child(3),
#crossUsersTable td:nth-child(3) {
    width: 22%;
}

#crossUsersTable th:nth-child(4),
#crossUsersTable td:nth-child(4) {
    width: 19%;
    white-space: normal;
    word-break: break-word;
}

#crossUsersTable td.cross-scope-cell-col {
    text-align: left;
}

#crossUsersTable .cross-scope-cell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.25rem;
    width: 100%;
}

#crossUsersTable .cross-scope-badges {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
    flex: 1 1 auto;
}

#crossUsersTable .cross-scope-badges .badge {
    max-width: 100%;
    white-space: normal;
    text-align: left;
}

#crossUsersTable .cross-scope-btn {
    color: #0d6efd;
    flex: 0 0 auto;
}

#crossUsersTable .cross-scope-btn:hover {
    color: #0a58ca;
}

#crossUsersTable .cross-scope-btn:focus-visible {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

#crossUsersTable th:nth-child(5),
#crossUsersTable td:nth-child(5) {
    width: 24%;
}

#crossUsersTable th:nth-child(6),
#crossUsersTable td:nth-child(6) {
    width: 16%;
    white-space: nowrap;
}

#crossUsersTable .manage-users-actions {
    gap: 0;
}

#crossUsersTable .manage-users-action-link,
#crossUsersTable .manage-users-action-btn {
    width: 1.42em;
    height: 1.42em;
    font-size: 0.95em;
}

#crossUsersTable .module-permission-cell .badge {
    margin-right: 0.12rem !important;
}
/* =========================
   用户管理：责任教授表
   ========================= */
#courseProfessorBindingTable {
    table-layout: fixed;
}

#courseProfessorBindingTable th:nth-child(1),
#courseProfessorBindingTable td:nth-child(1) {
    width: 15em;
}

#courseProfessorBindingTable th:nth-child(2),
#courseProfessorBindingTable td:nth-child(2) {
    width: 11em;
}

#courseProfessorBindingTable th:nth-child(3),
#courseProfessorBindingTable td:nth-child(3) {
    width: 8em;
}

#courseProfessorBindingTable th:nth-child(4),
#courseProfessorBindingTable td:nth-child(4) {
    width: 13em;
}

#courseProfessorBindingTable th:nth-child(5),
#courseProfessorBindingTable td:nth-child(5) {
    width: 8em;
}

#courseProfessorBindingTable th:nth-child(6),
#courseProfessorBindingTable td:nth-child(6) {
    width: 5em;
    white-space: nowrap;
}

.manage-users-binding-table-wrap {
    max-height: 58vh;
}

.manage-users-binding-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: nowrap;
    overflow-x: auto;
}

.manage-users-binding-toolbar-meta {
    flex: 1 1 auto;
    min-width: 0;
}

.manage-users-binding-toolbar-meta .fw-semibold,
.manage-users-binding-toolbar-meta .text-muted {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.manage-users-binding-toolbar-note {
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
}

.manage-users-binding-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    margin-left: auto;
}

.manage-users-binding-toolbar-actions .btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

.manage-users-binding-filter-input {
    width: 14rem;
    min-width: 12rem;
    flex: 0 0 14rem;
}

.binding-professor-filter-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.binding-professor-filter-row .binding-professor-filter-input.form-control {
    width: 7.5rem !important;
    max-width: 7.5rem;
    flex: 0 0 7.5rem;
}

@media (max-width: 992px) {
    /* 用户管理：移动端横向滚动与最小宽度 */
    .manage-users-table-wrap {
        overflow-x: auto;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .manage-users-table {
        min-width: 920px;
        table-layout: fixed;
    }
    .manage-users-toolbar-row > [class*="col-"] {
        display: block;
    }
    .manage-users-toolbar-panel {
        align-items: stretch;
        flex-wrap: wrap;
    }
    .manage-users-filter-inline {
        flex-wrap: wrap;
    }
    .manage-users-filter-input-inline {
        flex: 1 1 100%;
        width: 100%;
        max-width: none;
    }
    .manage-users-primary-toolbar {
        flex-wrap: wrap;
    }
    .manage-users-main-table {
        min-width: 1080px;
    }
    #crossUsersTable {
        min-width: 0;
    }
    #crossUsersTable .cross-scope-cell {
        gap: 0.25rem;
    }
    #courseProfessorBindingTable {
        min-width: 920px;
    }
    .manage-users-binding-filter-input {
        width: 12rem;
        min-width: 10rem;
        flex-basis: 12rem;
    }
    .binding-professor-filter-row {
        align-items: stretch;
        flex-direction: column;
    }
    .binding-professor-filter-row .binding-professor-filter-input.form-control {
        width: 100% !important;
        max-width: 100%;
        flex-basis: auto;
    }
    .manage-users-table th,
    .manage-users-table td {
        font-size: 13px;
        line-height: 1.3;
        padding: 0.4rem 0.35rem;
    }
    .manage-users-primary-actions {
        flex-wrap: wrap;
    }
    .manage-users-primary-actions .btn {
        flex-basis: auto;
    }
    .manage-users-type-tabs-row {
        align-items: stretch;
    }
    .manage-users-type-tabs {
        flex-wrap: wrap;
    }
    .manage-users-type-tabs .nav-link {
        min-height: auto;
        padding: 0.3rem 0.5rem;
        font-size: 0.92rem;
    }
}

/* =========================
   首页（home 方案）视觉系统
   ========================= */
.home-page {
    --home-blue: #2563eb;
    --home-teal: #06b6d4;
    --home-text: #0f172a;
    --home-muted: #475569;
    --home-border: #e2e8f0;
}

.home-hero-inner {
    border: 1px solid var(--home-border);
    border-radius: 12px;
    padding: 18px 18px;
    background: #ffffff;
}

.home-kicker {
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--home-muted);
}

.home-page h2.home-title {
    text-align: left;
    color: var(--home-text);
    font-weight: 750;
    margin: 0;
}

.home-status-card {
    border: 1px solid var(--home-border);
    border-radius: 12px;
}

.btn-home-primary {
    background-color: var(--home-blue);
    border-color: var(--home-blue);
    color: #ffffff;
}

.btn-home-primary:hover {
    background-color: #1d4ed8;
    border-color: #1d4ed8;
    color: #ffffff;
}

.home-badge-icon {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(37, 99, 235, 0.12);
    color: var(--home-blue);
    flex: 0 0 auto;
}

.home-badge-icon-teal {
    background: rgba(6, 182, 212, 0.14);
    color: #0891b2;
}

.home-section-title {
    font-weight: 750;
    color: var(--home-text);
}

.home-action-card {
    border: 1px solid var(--home-border);
    border-radius: 12px;
    transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
    background: #ffffff;
}

.home-action-card-disabled {
    pointer-events: none;
    opacity: 0.55;
}

.home-action-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    border-color: rgba(37, 99, 235, 0.35);
}


@media (min-width: 1200px) {
    .home-actions-grid.home-actions-tail-1 > [class*="col-"]:last-child,
    .home-kpi-grid.home-kpi-tail-1 > [class*="col-"]:last-child {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .home-actions-grid.home-actions-tail-2 > [class*="col-"]:nth-last-child(-n+2),
    .home-kpi-grid.home-kpi-tail-2 > [class*="col-"]:nth-last-child(-n+2) {
        flex: 0 0 50%;
        max-width: 50%;
    }

    /* 快捷入口与统计卡尾行 3 张统一为各占 1/3 一行并排，
       使 "使用建议与意见收集" 自然落在最后一行最右侧（由 home-feedback-action margin-left:auto 兜底）。 */
    .home-actions-grid.home-actions-tail-3 > [class*="col-"]:nth-last-child(-n+3),
    .home-kpi-grid.home-kpi-tail-3 > [class*="col-"]:nth-last-child(-n+3) {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }

    .home-actions-grid > .home-feedback-action:last-child {
        margin-left: auto;
    }
}

.home-action-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.home-icon-pill {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(37, 99, 235, 0.12);
    color: var(--home-blue);
}

.home-icon-pill-teal {
    background: rgba(6, 182, 212, 0.14);
    color: #0891b2;
}

.home-icon-pill-muted {
    background: rgba(51, 65, 85, 0.16);
    color: #334155;
}

.home-icon-pill-orange {
    background: rgba(245, 158, 11, 0.20);
    color: #d97706;
}

.home-action-go {
    font-size: 12px;
    color: var(--home-muted);
}

.home-action-title {
    font-weight: 700;
    color: var(--home-text);
}

.home-module-card {
    border: 1px solid var(--home-border);
    border-radius: 12px;
}

.home-container {
    /* 2026-09-04（方案一）：导航栏满铺后 body 不再有 20px 内边距，
       首页容器必须自己保留左右内边距，否则窄屏内容会贴边。 */
    background-color: transparent !important;
    box-shadow: none !important;
    padding: 0 20px !important;
    border-radius: 0 !important;
}

.home-surface {
    background: #ffffff;
}

.home-kpi-card .card-body {
    padding: 14px 14px;
}

.home-kpi-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.home-kpi-label {
    font-size: 12px;
    color: var(--home-muted);
}

.home-kpi-value {
    font-size: 26px;
    font-weight: 800;
    color: var(--home-text);
    line-height: 1.1;
}

/* ========================================================================
   首页方案一（2026-09-04）：首屏重排 + 品牌化视觉
   作用域限定在 .home-dashboard，入口页 select_college.html 复用的
   .home-page / .home-variant-a / .home-hero-inner / .home-status-card 等
   旧类不受影响。
   Safari 12：本段不依赖 flex gap 承载间距，一律用 margin。
   ======================================================================== */
.home-dashboard {
    /* 字号阶梯：页面标题 20 / 区块标题 16 / 正文 14 / 辅助 12 */
    --home-fs-title: 20px;
    --home-fs-section: 16px;
    --home-fs-body: 14px;
    --home-fs-meta: 12px;
}

/* ── 身份条：取代原 hero（英文 kicker + 带版本号标题 + 简介 + 登录状态卡）── */
.home-identbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    min-height: 60px;
    padding: 10px 16px;
    margin: 12px 0;
    background: #ffffff;
    border: 1px solid var(--home-border);
    border-radius: 12px;
}

.home-identbar-main {
    display: flex;
    align-items: center;
    min-width: 0;
}

.home-identbar-logo {
    height: 30px;
    width: auto;
    margin-right: 10px;
    flex: 0 0 auto;
}

.home-dashboard h1.home-identbar-title {
    font-size: var(--home-fs-title);
    font-weight: 700;
    color: var(--home-text);
    margin: 0;
    line-height: 1.3;
    white-space: nowrap;
}

.home-identbar-sep {
    display: inline-block;
    width: 1px;
    height: 16px;
    background: var(--home-border);
    margin: 0 12px;
    flex: 0 0 auto;
}

.home-identbar-college {
    font-size: var(--home-fs-body);
    color: var(--home-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-identbar-meta {
    display: flex;
    align-items: center;
    font-size: var(--home-fs-meta);
    color: var(--home-muted);
    font-variant-numeric: tabular-nums;
}

.home-identbar-meta > span {
    margin-left: 16px;
    white-space: nowrap;
}

@media (max-width: 768px) {
    /* 移动端身份条改上下两行，日期/学期左对齐 */
    .home-identbar-meta > span {
        margin-left: 0;
        margin-right: 12px;
    }
    .home-identbar-meta {
        width: 100%;
        margin-top: 6px;
    }
}

/* ── KPI 卡：32px 数值 + 完成率 + 3px 进度条，整卡可点 ── */
.home-dashboard .home-kpi-value {
    font-size: 32px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums;
}

.home-dashboard .home-kpi-top .home-icon-pill {
    /* flex gap 的显式兜底（Safari 12） */
    margin-right: 10px;
}

.home-dashboard .home-kpi-label {
    font-size: var(--home-fs-meta);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-kpi-foot {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-top: 6px;
}

.home-kpi-caption {
    font-size: var(--home-fs-meta);
    color: var(--home-muted);
}

.home-kpi-pct {
    font-size: var(--home-fs-meta);
    font-weight: 700;
    color: var(--home-blue);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    margin-left: 8px;
}

.home-kpi-bar {
    margin-top: 8px;
    height: 3px;
    border-radius: 2px;
    background: rgba(148, 163, 184, 0.25);
    overflow: hidden;
}

.home-kpi-bar > span {
    display: block;
    height: 100%;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--home-blue), var(--home-teal));
}

/* D6（用户 2026-09-04 确认）：KPI 满 5 张时五列均分，不走"尾行 1 张整行满铺"。
   仅作用于 KPI 卡；快捷入口的 home-actions-tail-N 规则不变。 */
@media (min-width: 1200px) {
    .home-kpi-grid.home-kpi-grid-5 > [class*="col-"] {
        flex: 0 0 20%;
        width: 20%;
        max-width: 20%;
    }
}

/* ── 各学院完成度排行（D7）：从 KPI 卡内 128px 滚动小框提出来的整行区块 ── */
.home-rank-item {
    display: flex;
    align-items: center;
    margin-bottom: 7px;
}

.home-rank-name {
    flex: 0 0 8.5em;
    max-width: 8.5em;
    margin-right: 10px;
    font-size: 12.5px;
    color: var(--home-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-rank-track {
    flex: 1 1 auto;
    height: 8px;
    margin-right: 10px;
    border-radius: 4px;
    background: rgba(148, 163, 184, 0.2);
    overflow: hidden;
}

.home-rank-fill {
    display: block;
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--home-blue), var(--home-teal));
}

.home-rank-val {
    flex: 0 0 auto;
    min-width: 7.5em;
    text-align: right;
    font-size: var(--home-fs-meta);
    color: var(--home-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* 排行折叠行：不依赖 [hidden] 的浏览器默认样式（.home-rank-item 是 flex，
   display:flex 会盖掉 [hidden] 的 display:none） */
.home-rank-hidden,
.home-rank-more[hidden] {
    display: none !important;
}

.home-rank-hint {
    font-size: var(--home-fs-meta);
    color: var(--home-muted);
}

.home-rank-more {
    appearance: none;
    -webkit-appearance: none;
    background: none;
    border: 0;
    padding: 2px 0 0;
    font-size: var(--home-fs-meta);
    color: var(--home-blue);
    cursor: pointer;
}

.home-rank-more:hover {
    text-decoration: underline;
}

/* ── 区块标题与空态 ── */
.home-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.home-dashboard .home-section-title {
    font-size: var(--home-fs-section);
}

.home-todo-empty {
    padding: 12px 2px;
    font-size: var(--home-fs-body);
    font-weight: 600;
    color: var(--home-text);
}

.home-todo-empty-scope {
    display: block;
    margin-top: 4px;
    font-size: var(--home-fs-meta);
    font-weight: 400;
    color: var(--home-muted);
}

/* ── 快捷卡：英文副标题改中文一句话说明 ── */
.home-action-desc {
    margin-top: 2px;
    font-size: var(--home-fs-meta);
    color: var(--home-muted);
}

.home-icon-pill-sm {
    width: 30px;
    height: 30px;
    border-radius: 10px;
}

/* ── 卡片层次：双层低透明阴影；hover 只变边框色，不再上浮 ── */
.home-dashboard .home-kpi-card,
.home-dashboard .home-action-card,
.home-dashboard .card.home-surface {
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 14px rgba(15, 23, 42, 0.05);
}

.home-dashboard .home-action-card:hover,
.home-dashboard a.home-kpi-card:hover {
    transform: none;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 14px rgba(15, 23, 42, 0.05);
    border-color: rgba(37, 99, 235, 0.45);
}

.home-dashboard a.home-kpi-card {
    transition: border-color 140ms ease;
}

/* 键盘可见焦点：整卡可点后必须有焦点环 */
.home-dashboard a.card:focus-visible,
.home-dashboard .home-rank-more:focus-visible,
.home-dashboard button:focus-visible {
    outline: 2px solid var(--home-blue);
    outline-offset: 2px;
}

/* ── 方案二（2026-09-04）·角色工作台：待办直达列表 / 数量角标 / 学生申请时间线 / 快捷卡角标 ──
   同行控件严格垂直对齐；不依赖 flex gap（Safari 12），间距一律用 margin。 */
.home-count-badge {
    display: inline-block;
    min-width: 20px;
    padding: 0 6px;
    margin-left: 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
    color: #ffffff;
    background: var(--home-blue);
    vertical-align: 2px;
    font-variant-numeric: tabular-nums;
}

.home-count-badge-orange {
    background: #ea580c;
}

.home-section-link {
    font-size: var(--home-fs-meta);
    color: var(--home-blue);
    text-decoration: none;
    white-space: nowrap;
}

.home-section-link:hover {
    text-decoration: underline;
}

.home-todo-group {
    padding: 8px 0;
    border-top: 1px solid var(--home-border);
}

.home-todo-group:first-child {
    padding-top: 0;
    border-top: 0;
}

.home-todo-group-head {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
}

.home-todo-group-head .home-icon-pill {
    margin-right: 8px;
}

.home-todo-group-title {
    font-size: var(--home-fs-body);
    font-weight: 600;
    color: var(--home-text);
    white-space: nowrap;
}

.home-todo-group-link {
    margin-left: auto;
    font-size: var(--home-fs-meta);
    color: var(--home-blue);
    text-decoration: none;
    white-space: nowrap;
}

.home-todo-group-link:hover {
    text-decoration: underline;
}

.home-todo-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 8px;
    margin: 0 -8px;
    border-radius: 8px;
    font-size: var(--home-fs-body);
    color: var(--home-text);
    text-decoration: none;
}

a.home-todo-item:hover {
    background: rgba(37, 99, 235, 0.06);
    color: var(--home-blue);
    text-decoration: none;
}

.home-todo-item-main {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-todo-item-meta {
    flex: 0 0 auto;
    margin-left: 10px;
    font-size: var(--home-fs-meta);
    color: var(--home-muted);
    white-space: nowrap;
}

.home-todo-item-meta > * {
    margin-left: 6px;
}

.home-todo-status {
    display: inline-block;
    padding: 0 7px;
    border-radius: 9px;
    line-height: 18px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(148, 163, 184, 0.18);
    color: var(--home-muted);
}

.home-todo-status-warn {
    background: rgba(234, 88, 12, 0.12);
    color: #c2410c;
}

.home-todo-status-info {
    background: rgba(37, 99, 235, 0.10);
    color: var(--home-blue);
}

.home-todo-status-danger {
    background: rgba(220, 38, 38, 0.10);
    color: #b91c1c;
}

.home-todo-none {
    padding: 2px 0;
    font-size: var(--home-fs-meta);
    color: var(--home-muted);
}

.home-todo-arrow {
    color: rgba(148, 163, 184, 0.9);
}

/* 学生「我的申请」：一条申请一张小卡，卡内是流程时间线 */
.home-request-item {
    display: block;
    padding: 10px 12px;
    margin-bottom: 8px;
    border: 1px solid var(--home-border);
    border-radius: 10px;
    color: var(--home-text);
    text-decoration: none;
}

a.home-request-item:hover {
    border-color: rgba(37, 99, 235, 0.45);
    color: var(--home-text);
    text-decoration: none;
}

.home-request-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.home-request-title {
    flex: 1 1 auto;
    min-width: 0;
    margin-right: 10px;
    font-size: var(--home-fs-body);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-request-meta {
    margin-top: 6px;
    font-size: var(--home-fs-meta);
    color: var(--home-muted);
}

.home-timeline {
    display: flex;
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
}

.home-timeline-step {
    position: relative;
    flex: 1 1 0;
    text-align: center;
    font-size: 11px;
    color: var(--home-muted);
}

.home-timeline-step::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(148, 163, 184, 0.35);
}

.home-timeline-step:first-child::before {
    left: 50%;
}

.home-timeline-step:last-child::before {
    right: 50%;
}

.home-timeline-dot {
    position: relative;
    z-index: 1;
    display: block;
    width: 14px;
    height: 14px;
    margin: 0 auto 4px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid rgba(148, 163, 184, 0.6);
    box-sizing: border-box;
}

.home-timeline-step.is-done .home-timeline-dot {
    background: var(--home-teal);
    border-color: var(--home-teal);
}

.home-timeline-step.is-done::before {
    background: var(--home-teal);
}

.home-timeline-step.is-current .home-timeline-dot {
    background: var(--home-blue);
    border-color: var(--home-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.home-timeline-step.is-current {
    color: var(--home-blue);
    font-weight: 600;
}

.home-timeline-step.is-returned .home-timeline-dot {
    background: #dc2626;
    border-color: #dc2626;
}

.home-timeline-step.is-returned {
    color: #b91c1c;
    font-weight: 600;
}

/* 快捷卡标题角标：取代"（测试预览）"文字后缀 */
.home-action-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 0 6px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    line-height: 18px;
    vertical-align: 2px;
    background: rgba(148, 163, 184, 0.18);
    color: var(--home-muted);
}

@media (prefers-reduced-motion: reduce) {
    .home-dashboard *,
    .home-dashboard *::before,
    .home-dashboard *::after {
        transition: none !important;
        animation: none !important;
    }
}

/* ========================================================================
   院务通小灵 — 帮助球对话窗口（2026-06-06）
   Safari 12 兼容：不依赖 flex gap 承载交互间距，统一用 margin。
   ======================================================================== */
.ai-assistant-panel {
    position: fixed;
    right: 20px;
    bottom: 92px;
    width: 360px;
    max-width: calc(100vw - 28px);
    height: 520px;
    max-height: calc(100vh - 120px);
    background: #ffffff;
    border: 1px solid #dfe3ea;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(15, 32, 64, 0.22);
    z-index: 1086;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.ai-assistant-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #1e40af);
    flex: 0 0 auto;
}
.ai-assistant-title { font-weight: 600; font-size: 0.95rem; }
.ai-assistant-header-actions { white-space: nowrap; }
.ai-assistant-iconbtn {
    display: inline-block;
    width: 28px;
    height: 28px;
    line-height: 28px;
    text-align: center;
    margin-left: 4px;
    color: #fff;
    background: rgba(255, 255, 255, 0.16);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.85rem;
}
.ai-assistant-iconbtn:hover { background: rgba(255, 255, 255, 0.3); color: #fff; }
.ai-assistant-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 12px;
    background: #f6f8fc;
}
.ai-assistant-tip {
    font-size: 0.85rem;
    color: #51607a;
    background: #eef2fb;
    border: 1px solid #dde6f6;
    border-radius: 10px;
    padding: 10px 12px;
}
.ai-assistant-tip-warn { margin-top: 6px; color: #b4690e; font-size: 0.8rem; }
.ai-msg { margin-bottom: 10px; display: flex; }
.ai-msg-user { justify-content: flex-end; }
.ai-msg-bot { justify-content: flex-start; }
.ai-msg-bubble {
    display: inline-block;
    max-width: 84%;
    padding: 8px 11px;
    border-radius: 12px;
    font-size: 0.88rem;
    line-height: 1.5;
    word-break: break-word;
    white-space: normal;
}
.ai-msg-user .ai-msg-bubble {
    background: #2563eb;
    color: #fff;
    border-bottom-right-radius: 4px;
}
.ai-msg-bot .ai-msg-bubble {
    background: #fff;
    color: #1f2733;
    border: 1px solid #e3e8f0;
    border-bottom-left-radius: 4px;
}
.ai-msg-error { background: #fdecec; color: #b42318; border: 1px solid #f5c2c0; }
.ai-typing span {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin: 0 2px;
    background: #9aa7bd;
    border-radius: 50%;
    -webkit-animation: aiTyping 1s infinite ease-in-out;
    animation: aiTyping 1s infinite ease-in-out;
}
.ai-typing span:nth-child(2) { -webkit-animation-delay: 0.15s; animation-delay: 0.15s; }
.ai-typing span:nth-child(3) { -webkit-animation-delay: 0.3s; animation-delay: 0.3s; }
@-webkit-keyframes aiTyping { 0%,80%,100%{ opacity: 0.3; } 40%{ opacity: 1; } }
@keyframes aiTyping { 0%,80%,100%{ opacity: 0.3; } 40%{ opacity: 1; } }
.ai-assistant-foot {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-end;
    padding: 8px;
    border-top: 1px solid #e6eaf1;
    background: #fff;
}
.ai-assistant-input {
    flex: 1 1 auto;
    resize: none;
    border: 1px solid #cfd6e4;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 0.88rem;
    line-height: 1.4;
    max-height: 120px;
    outline: none;
}
.ai-assistant-input:focus { border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15); }
.ai-assistant-send {
    flex: 0 0 auto;
    margin-left: 8px;
    width: 40px;
    height: 38px;
    border: none;
    border-radius: 8px;
    background: #2563eb;
    color: #fff;
    cursor: pointer;
}
.ai-assistant-send:hover { background: #1d4ed8; }
.ai-assistant-send:disabled { background: #9bb4ef; cursor: default; }
@media (max-width: 768px) {
    .ai-assistant-panel {
        right: 10px;
        left: 10px;
        bottom: 80px;
        width: auto;
        max-width: none;
        height: 70vh;
    }
}

/* ========================================================================
   模块帮助百科（LLM-Wiki 人读视图，2026-06-06）
   ======================================================================== */
.wiki-card {
    border: 1px solid #e3e8f0;
    border-radius: 12px;
    padding: 14px 16px;
    background: #fff;
    transition: box-shadow .15s, border-color .15s;
    color: #1f2733;
}
.wiki-card:hover { border-color: #2563eb; box-shadow: 0 6px 18px rgba(37,99,235,.12); }
.wiki-card-title { font-weight: 700; font-size: 1rem; margin-bottom: 6px; color: #1d4ed8; }
.wiki-card-summary { color: #51607a; font-size: .88rem; line-height: 1.5; }

.wiki-body { font-size: .95rem; line-height: 1.75; color: #1f2733; }
.wiki-body .wiki-h2 { font-size: 1.18rem; font-weight: 700; margin: 22px 0 10px; padding-bottom: 6px; border-bottom: 2px solid #eef2fb; }
.wiki-body .wiki-h3 { font-size: 1.04rem; font-weight: 700; margin: 18px 0 8px; color: #334155; }
.wiki-body .wiki-h4 { font-size: .98rem; font-weight: 700; margin: 14px 0 6px; color: #475569; }
.wiki-body p { margin: 8px 0; }
.wiki-body .wiki-ul, .wiki-body .wiki-ol { margin: 8px 0 8px 1.4em; }
.wiki-body .wiki-ul-sub { margin: 4px 0 4px 1.2em; }
.wiki-body li { margin: 4px 0; }
.wiki-body .wiki-quote {
    margin: 10px 0; padding: 8px 14px;
    background: #f6f8fc; border-left: 4px solid #2563eb; border-radius: 6px; color: #475569;
}
.wiki-body code { background: #f1f5f9; padding: 1px 6px; border-radius: 4px; font-size: .9em; color: #b4690e; }
.wiki-body .wiki-link { color: #2563eb; text-decoration: none; border-bottom: 1px dashed #93b4f0; }
.wiki-body .wiki-link:hover { border-bottom-style: solid; }
.wiki-table-wrap { overflow-x: auto; margin: 12px 0; }
.wiki-body .wiki-table { border-collapse: collapse; width: 100%; font-size: .9rem; }
.wiki-body .wiki-table th, .wiki-body .wiki-table td { border: 1px solid #e3e8f0; padding: 6px 10px; text-align: left; vertical-align: top; }
.wiki-body .wiki-table thead th { background: #eef2fb; font-weight: 700; }
.wiki-related a { text-decoration: none; }
.wiki-related a:hover { text-decoration: underline; }

/* 模块帮助百科 — 文档站式目录树（2026-06-06） */
.wiki-tree-wrap { position: sticky; top: 12px; }
.wiki-tree { border: 1px solid #e6eaf1; border-radius: 10px; background: #fff; padding: 8px; max-height: calc(100vh - 150px); overflow-y: auto; }
.wiki-tree-group { margin-bottom: 8px; }
.wiki-tree-group-title { font-weight: 700; font-size: .85rem; color: #475569; padding: 6px 8px; }
.wiki-tree-list { list-style: none; margin: 0; padding: 0; }
.wiki-tree-list li { margin: 0; }
.wiki-tree-link { display: block; padding: 6px 10px; border-radius: 7px; color: #334155; text-decoration: none; font-size: .9rem; }
.wiki-tree-link:hover { background: #f1f5f9; color: #1d4ed8; }
.wiki-tree-link.active { background: #2563eb; color: #fff; font-weight: 600; }
@media (max-width: 992px) {
    .wiki-tree-wrap { position: static; }
    .wiki-tree { max-height: 320px; }
}

/* 目录树：可折叠分类标题 + 层级编号（2026-06-06） */
.wiki-tree-group-title {
    width: 100%; text-align: left; background: transparent; border: none;
    font-weight: 700; font-size: .85rem; color: #475569; padding: 6px 8px;
    display: flex; align-items: center; gap: 6px; cursor: pointer; border-radius: 7px;
}
.wiki-tree-group-title:hover { background: #f1f5f9; }
.wiki-tree-caret { font-size: .72rem; color: #94a3b8; transition: transform .15s; }
.wiki-tree-group.is-collapsed .wiki-tree-caret { transform: rotate(-90deg); }
.wiki-tree-num { color: #94a3b8; font-variant-numeric: tabular-nums; margin-right: 2px; }
.wiki-tree-link.active .wiki-tree-num { color: #dbe7ff; }
