/* ==========================================================================
   后台样式（前后端不分离版）
   --------------------------------------------------------------------------
   设计原则：
   1. 视觉对齐现有 Vue 后台（supply_admin / registration_admin）：
      侧边栏 172px 白底、顶栏 50px、内容区 #f0f2f5、主色 #409eff
   2. 零构建、零外部依赖：不依赖 Tailwind / Bootstrap / CDN，
      直接用浏览器原生 CSS，断网也能正常显示
   3. 类名按「组件 + 修饰」命名（如 btn btn-primary），与 Element Plus 的
      视觉习惯对应，方便后续从 Vue 后台对照迁移
   ========================================================================== */

/* ============================ 1. 设计变量 ============================ */
:root {
    /* 主色板（与 Element Plus 默认色一致） */
    --primary: #409eff;
    --primary-light-3: #79bbff;
    --primary-light-5: #a0cfff;
    --primary-light-7: #c6e2ff;
    --primary-light-8: #d9ecff;
    --primary-light-9: #ecf5ff;
    --primary-dark-2: #337ecc;

    --success: #67c23a;
    --success-light-9: #f0f9eb;
    --warning: #e6a23c;
    --warning-light-9: #fdf6ec;
    --danger: #f56c6c;
    --danger-light-9: #fef0f0;
    --info: #909399;
    --info-light-9: #f4f4f5;

    /* 文字 */
    --text-primary: #303133;
    --text-regular: #606266;
    --text-secondary: #909399;
    --text-placeholder: #a8abb2;

    /* 边框与填充 */
    --border: #dcdfe6;
    --border-light: #e4e7ed;
    --border-lighter: #ebeef5;
    --border-extra-light: #f1f2f3;
    --fill-light: #f5f7fa;
    --bg-page: #f0f2f5;
    --bg-white: #ffffff;

    /* 布局尺寸（与 Vue 后台保持一致） */
    --aside-width: 172px;
    --header-height: 50px;
    --radius: 4px;
    --radius-lg: 8px;

    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-popup: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* ============================ 2. 基础重置 ============================ */
* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
        'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-page);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    color: var(--primary-light-3);
}

input,
select,
textarea,
button {
    font-family: inherit;
    font-size: inherit;
}

/* ============================ 3. 布局骨架 ============================ */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-aside {
    width: var(--aside-width);
    flex: 0 0 var(--aside-width);
    background: var(--bg-white);
    border-right: 1px solid var(--border-extra-light);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 20;
    overflow-y: auto;
}

.admin-body {
    flex: 1;
    min-width: 0;
    margin-left: var(--aside-width);
    display: flex;
    flex-direction: column;
}

.admin-header {
    height: var(--header-height);
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-extra-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.admin-main {
    flex: 1;
    padding: 16px;
    min-width: 0;
}

/* ============================ 4. 侧边栏 ============================ */
.aside-logo {
    height: var(--header-height);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
    border-bottom: 1px solid var(--border-extra-light);
    flex: 0 0 auto;
    white-space: nowrap;
    overflow: hidden;
}

.aside-menu {
    padding: 8px 0;
    flex: 1;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 42px;
    padding: 0 16px;
    color: #333333;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-left: 3px solid transparent;
    transition: background 0.15s, color 0.15s;
}

.menu-item:hover {
    color: var(--primary);
    background: var(--primary-light-9);
}

.menu-item.is-active {
    color: var(--primary);
    background: var(--primary-light-9);
    border-left-color: var(--primary);
    font-weight: 500;
}

.menu-item .menu-icon {
    width: 16px;
    text-align: center;
    flex: 0 0 16px;
    font-size: 15px;
}

/* 二级菜单 */
.menu-children {
    overflow: hidden;
}

.menu-children .menu-item {
    padding-left: 40px;
    height: 38px;
    font-size: 13px;
    color: var(--text-regular);
}

.menu-group-title {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 42px;
    padding: 0 16px;
    color: #333333;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: background 0.15s, color 0.15s;
}

.menu-group-title:hover {
    color: var(--primary);
    background: var(--primary-light-9);
}

.menu-group-title.is-open {
    color: var(--primary);
}

.menu-arrow {
    margin-left: auto;
    font-size: 12px;
    transition: transform 0.2s;
}

.menu-group-title.is-open .menu-arrow {
    transform: rotate(90deg);
}

/* 二级菜单展开/收起过渡（配合 Alpine x-transition） */
.menu-transition {
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.menu-hidden {
    opacity: 0;
    transform: translateY(-4px);
}

.menu-shown {
    opacity: 1;
    transform: none;
}

/* ============================ 5. 顶栏 ============================ */
.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-regular);
    min-width: 0;
}

.header-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    color: #444444;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    position: relative;
    padding: 4px 8px;
    border-radius: var(--radius);
    transition: background 0.15s;
}

.header-user:hover {
    background: rgba(0, 0, 0, 0.06);
}

.header-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--primary-light-9);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 13px;
    overflow: hidden;
}

.header-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 6px;
    min-width: 140px;
    background: var(--bg-white);
    border: 1px solid var(--border-lighter);
    border-radius: var(--radius);
    box-shadow: var(--shadow-popup);
    padding: 4px 0;
    display: none;
    z-index: 30;
}

.header-dropdown.is-open {
    display: block;
}

.header-dropdown a,
.header-dropdown button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 16px;
    color: var(--text-regular);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
}

.header-dropdown a:hover,
.header-dropdown button:hover {
    background: var(--primary-light-9);
    color: var(--primary);
}

/* ============================ 6. 卡片 ============================ */
.card {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: 16px;
    margin-bottom: 16px;
}

.card:last-child {
    margin-bottom: 0;
}

.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    gap: 12px;
    flex-wrap: wrap;
}

.page-head h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

/* ============================ 7. 按钮 ============================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 32px;
    padding: 0 15px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-white);
    color: var(--text-regular);
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
    line-height: 1;
}

.btn:hover {
    color: var(--primary);
    border-color: var(--primary-light-5);
    background: var(--primary-light-9);
}

.btn:disabled,
.btn.is-disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-light-3);
    border-color: var(--primary-light-3);
    color: #fff;
}

.btn-success {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}

.btn-success:hover {
    background: #85ce61;
    border-color: #85ce61;
    color: #fff;
}

.btn-danger {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: #f78989;
    border-color: #f78989;
    color: #fff;
}

/* 文字按钮（表格操作列常用） */
.btn-link {
    height: auto;
    padding: 0;
    border: none;
    background: none;
    color: var(--primary);
    font-size: 13px;
}

.btn-link:hover {
    color: var(--primary-light-3);
    background: none;
}

.btn-link.is-danger {
    color: var(--danger);
}

.btn-link.is-danger:hover {
    color: #f78989;
}

.btn-sm {
    height: 28px;
    padding: 0 10px;
    font-size: 12px;
}

/* ============================ 8. 表单 ============================ */
.form-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.form-item {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-regular);
    font-size: 13px;
}

.form-label .required {
    color: var(--danger);
    margin-right: 2px;
}

.form-control {
    width: 100%;
    height: 32px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    background: var(--bg-white);
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light-9);
}

.form-control::placeholder {
    color: var(--text-placeholder);
}

.form-control:disabled {
    background: var(--fill-light);
    color: var(--text-secondary);
    cursor: not-allowed;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a8abb2' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
}

textarea.form-control {
    height: auto;
    min-height: 80px;
    padding: 8px 10px;
    resize: vertical;
    line-height: 1.5;
}

.form-tip {
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-secondary);
}

.form-error {
    margin-top: 4px;
    font-size: 12px;
    color: var(--danger);
}

.form-control.is-error {
    border-color: var(--danger);
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-row > * {
    flex: 1;
    min-width: 0;
}

/* ============================ 9. 表格 ============================ */
.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    border: 1px solid var(--border-lighter);
}

.table th,
.table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-lighter);
    vertical-align: middle;
}

.table th {
    background: var(--fill-light);
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
}

.table tbody tr:hover {
    background: var(--primary-light-9);
}

/* 斑马纹 */
.table-striped tbody tr:nth-child(even) {
    background: #fafafa;
}

.table-striped tbody tr:nth-child(even):hover {
    background: var(--primary-light-9);
}

.table td.col-actions {
    white-space: nowrap;
}

.table .cell-muted {
    color: var(--text-secondary);
}

.table-empty {
    padding: 48px 0;
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
}

/* 固定右列（操作列） */
.table th.col-actions,
.table td.col-actions {
    text-align: right;
}

/* ============================ 10. 分页 ============================ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 14px;
    flex-wrap: wrap;
    font-size: 13px;
}

.pagination-total {
    margin-right: auto;
    color: var(--text-secondary);
}

.pagination button,
.pagination span.page-item {
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    background: var(--bg-white);
    color: var(--text-regular);
    cursor: pointer;
    font-size: 13px;
}

.pagination button:hover:not(:disabled),
.pagination span.page-item:hover {
    color: var(--primary);
    border-color: var(--primary-light-5);
}

.pagination .is-active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.pagination button:disabled {
    color: var(--text-placeholder);
    cursor: not-allowed;
    background: var(--fill-light);
}

.pagination .ellipsis {
    border: none;
    background: none;
    cursor: default;
}

/* ============================ 11. 开关 ============================ */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
    flex: 0 0 40px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch .switch-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #dcdfe6;
    border-radius: 10px;
    transition: background 0.2s;
}

.switch .switch-slider::before {
    content: '';
    position: absolute;
    height: 16px;
    width: 16px;
    left: 2px;
    top: 2px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.switch input:checked + .switch-slider {
    background: var(--primary);
}

.switch input:checked + .switch-slider::before {
    transform: translateX(20px);
}

.switch input:disabled + .switch-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================ 12. 标签 ============================ */
.tag {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 8px;
    border-radius: var(--radius);
    font-size: 12px;
    line-height: 1;
    border: 1px solid transparent;
}

.tag-primary {
    background: var(--primary-light-9);
    color: var(--primary);
    border-color: var(--primary-light-8);
}

.tag-success {
    background: var(--success-light-9);
    color: var(--success);
    border-color: #e1f3d8;
}

.tag-warning {
    background: var(--warning-light-9);
    color: var(--warning);
    border-color: #faecd8;
}

.tag-danger {
    background: var(--danger-light-9);
    color: var(--danger);
    border-color: #fde2e2;
}

.tag-info {
    background: var(--info-light-9);
    color: var(--info);
    border-color: #e9e9eb;
}

/* ============================ 13. 抽屉 / 弹窗 ============================ */
/* 抽屉常驻 DOM、靠 .is-open 切换状态：
   打开/关闭都能走 CSS transition，避免「点一下 → 等 AJAX → 瞬间弹出」的生硬感 */
.drawer-mask {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0s linear 0.2s;
}

.drawer-mask.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.2s ease;
}

.drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 40%;
    min-width: 420px;
    max-width: 90vw;
    background: var(--bg-white);
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    z-index: 101;
    transform: translateX(100%);
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.25s ease, visibility 0s linear 0.25s;
}

.drawer.is-open {
    transform: none;
    visibility: visible;
    pointer-events: auto;
    transition: transform 0.25s ease;
}

.drawer-header {
    height: 52px;
    flex: 0 0 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid var(--border-lighter);
    font-size: 15px;
    font-weight: 500;
}

.drawer-close {
    border: none;
    background: none;
    font-size: 18px;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}

.drawer-close:hover {
    color: var(--primary);
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.drawer-footer {
    flex: 0 0 auto;
    padding: 12px 20px;
    border-top: 1px solid var(--border-lighter);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* 居中弹窗（确认框） */
.dialog-mask {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.dialog {
    width: 420px;
    max-width: 90vw;
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-popup);
}

.dialog-title {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 12px;
}

.dialog-content {
    color: var(--text-regular);
    margin-bottom: 20px;
    line-height: 1.6;
}

.dialog-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ============================ 14. 树形控件 ============================ */
.tree {
    border: 1px solid var(--border-lighter);
    border-radius: var(--radius);
    padding: 8px;
    max-height: 420px;
    overflow-y: auto;
}

.tree-node {
    padding: 4px 0;
}

.tree-node-label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 13px;
    color: var(--text-regular);
}

.tree-node-label:hover {
    background: var(--primary-light-9);
}

.tree-node-children {
    padding-left: 20px;
}

.tree-toggle {
    width: 14px;
    display: inline-flex;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 11px;
    user-select: none;
}

.tree-toggle.is-leaf {
    visibility: hidden;
}

input[type='checkbox'] {
    width: 14px;
    height: 14px;
    accent-color: var(--primary);
    cursor: pointer;
    margin: 0;
}

/* 自定义复选框：权限树专用
   不用原生 input 是因为它的默认勾选行为会与「服务端决定状态」冲突，
   Livewire 重新渲染时容易出现视觉与数据不一致 */
.cbx {
    width: 14px;
    height: 14px;
    border: 1px solid var(--border);
    border-radius: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    flex: 0 0 14px;
    transition: background 0.15s, border-color 0.15s;
}

.cbx.is-checked,
.cbx.is-indeterminate {
    background: var(--primary);
    border-color: var(--primary);
}

.cbx.is-checked::after {
    content: '';
    width: 4px;
    height: 8px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) translate(-1px, -1px);
}

.cbx.is-indeterminate::after {
    content: '';
    width: 8px;
    height: 2px;
    background: #fff;
}

/* 树形表格的层级缩进 */
.tree-indent {
    display: inline-block;
}

.tree-caret {
    display: inline-block;
    width: 14px;
    color: var(--text-secondary);
    font-size: 11px;
    user-select: none;
}

/* ============================ 15. 顶部提示（Toast） ============================ */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    z-index: 300;
    box-shadow: var(--shadow-popup);
    animation: toast-in 0.25s ease;
}

.toast-success {
    background: var(--success-light-9);
    color: var(--success);
    border: 1px solid #e1f3d8;
}

.toast-error {
    background: var(--danger-light-9);
    color: var(--danger);
    border: 1px solid #fde2e2;
}

.toast-warning {
    background: var(--warning-light-9);
    color: var(--warning);
    border: 1px solid #faecd8;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translate(-50%, -12px);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* ============================ 16. 登录页 ============================ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ecf5ff 0%, #f0f2f5 45%, #e8eef7 100%);
    padding: 20px;
}

.login-card {
    width: 380px;
    max-width: 100%;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    padding: 32px 28px;
}

.login-title {
    font-size: 20px;
    font-weight: 600;
    text-align: center;
    margin: 0 0 6px;
    color: var(--text-primary);
}

.login-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 24px;
}

.login-card .form-control {
    height: 38px;
    margin-bottom: 16px;
}

.login-btn {
    width: 100%;
    height: 38px;
    font-size: 14px;
    margin-top: 4px;
}

/* ============================ 16.1 统计卡片 ============================ */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 0;
}

.stat-icon {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    background: var(--primary-light-9);
    font-size: 20px;
}

.stat-value {
    font-size: 22px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-primary);
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ============================ 17. 工具类 ============================ */
.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
}

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

.gap-8 {
    gap: 8px;
}

.gap-12 {
    gap: 12px;
}

.ml-auto {
    margin-left: auto;
}

.mt-0 {
    margin-top: 0;
}

.mt-12 {
    margin-top: 12px;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-12 {
    margin-bottom: 12px;
}

.text-muted {
    color: var(--text-secondary);
}

.text-danger {
    color: var(--danger);
}

.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
}

.w-100 {
    width: 100%;
}

.nowrap {
    white-space: nowrap;
}

/* Livewire 加载态：请求进行中时给容器加半透明遮罩，避免重复点击 */
.is-loading {
    opacity: 0.6;
    pointer-events: none;
    transition: opacity 0.15s;
}

/* 全局请求进度条：任何 Livewire 请求（含 wire:navigate 换页）进行中时显示 */
.nav-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 100%;
    z-index: 400;
    background: linear-gradient(90deg, var(--primary-light-3), var(--primary));
    transform: scaleX(0);
    transform-origin: 0 50%;
    opacity: 0;
    pointer-events: none;
}

.nav-progress[wire\:loading] {
    opacity: 1;
    animation: nav-progress 1.2s ease-out forwards;
}

@keyframes nav-progress {
    from {
        transform: scaleX(0);
    }

    to {
        transform: scaleX(0.85);
    }
}

/* 换页/整页加载时内容轻微淡入，缓解白屏切换的生硬感 */
@keyframes page-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.admin-main {
    animation: page-in 0.15s ease;
}

/* 空状态插画位（纯 CSS，不依赖图片资源） */
.empty-hint {
    padding: 40px 0;
    text-align: center;
    color: var(--text-secondary);
}

.empty-hint .empty-icon {
    font-size: 32px;
    display: block;
    margin-bottom: 8px;
    opacity: 0.5;
}

/* ============================ 18. 响应式 ============================ */
@media (max-width: 900px) {
    :root {
        --aside-width: 56px;
    }

    .menu-item span.menu-text,
    .menu-group-title span.menu-text,
    .aside-logo span.logo-text {
        display: none;
    }

    .menu-item,
    .menu-group-title {
        justify-content: center;
        padding: 0 8px;
    }

    .menu-children {
        display: none;
    }

    .drawer {
        width: 90vw;
        min-width: 0;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }
}
