/* 通用 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body,
html {
    width: 100%;
    height: 100%;
    background-color: #f4f7fc;
}

/* 顶部 */
.global-header {
    width: 100%;
    height: 58px;
}

.global-header-body {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 58px;
    line-height: 58px;
    background-color: #fff;
    z-index: 100;
    box-shadow: 0 1px 4px rgba(0, 21, 41, .08);
}

.global-header-left {
    position: absolute;
    left: 0;
}

.global-header-right {
    position: absolute;
    right: 0;
}

.global-header-item {
    cursor: pointer;
}

.global-header-poptip-item {
    height: 36px;
    line-height: 36px;
}

.global-header-link {
    display: block;
    color: #5b6f88;
    height: 100%;
    padding: 0 16px 0 16px;
    border-bottom: 2px solid transparent;
}

.global-header-link:hover {
    background-color: #eef4fc;
    color: #2d3e54;
    border-bottom: 2px solid #0098ff;
}

/* 主体 */
.global-content {
    min-height: calc(100% - 58px - 16px - 48px);
    margin: 8px;
    padding: 16px;
    background-color: #fff;
    border-radius: 18px;
    box-shadow: 0 1px 4px rgba(0, 21, 41, .08);
}

.global-content-breadcrumb {
    height: 32px;
    line-height: 32px;
    margin-bottom: 16px;
}

/* 尾部 */
.global-footer {
    min-height: 48px;
}

.global-footer-filing {
    text-align: center;
    height: 48px;
    padding: 8px;
}

/* 片段 */
.segment {
    border-radius: 15px;
    box-shadow: 0 0 0 1px rgba(39, 41, 43, .15), 0 1px 2px 0 rgba(0, 0, 0, .05);
    padding: 15px 20px;
    overflow-x: auto;
}

/* 不可选择 */
.no-select {
    -webkit-user-select: none; /* Chrome, Safari, Opera */
    -moz-user-select: none; /* Firefox */
    -ms-user-select: none; /* Internet Explorer/Edge */
    user-select: none; /* Standard syntax */
}

/* 分页组件 - 不可点击状态 */
.join .btn.btn-inactive {
    opacity: 0.35;
    pointer-events: none;
}

/* 分页组件 - 页码信息按钮 */
.join .btn.btn-page-info {
    pointer-events: none;
    font-weight: normal;
}

/* 管理后台表格 - Arco Design 风格 */
.table.table-bordered {
    border-collapse: collapse;
    border: 1px solid #e5e6eb;
    border-radius: 0;
}

.table.table-bordered thead th {
    background-color: #f7f8fa;
    font-weight: 600;
    color: #1d2129;
    border-bottom: 1px solid #e5e6eb;
}

.table.table-bordered th,
.table.table-bordered td {
    border: 1px solid #e5e6eb;
    padding: 9px 16px;
    line-height: 1.4;
}

.table.table-bordered tbody tr:hover td {
    background-color: #f2f3f5;
}

/* Badge 自适应不截断 */
.badge {
    white-space: nowrap;
    overflow: visible;
    text-overflow: unset;
    width: auto;
    min-width: fit-content;
    max-width: none;
}

/* Alpine.js x-cloak：在初始化完成前隐藏元素 */
[x-cloak] {
    display: none !important;
}

/* fragment-select 组合输入框（join）兼容：作为首个 join-item 时，
   触发框去右圆角与右边框，与后续 join-item 无缝拼接（分隔线由后续元素左边框提供） */
.join > .join-item:first-child .x-select-trigger {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right-width: 0;
}

/* loading-spinner 兼容修复：DaisyUI 默认使用 mask-image，
   部分 WebKit 内核未加 -webkit- 前缀时会渲染成黑色方块。
   这里改为 border 旋转动画，保证所有浏览器一致。 */
.loading.loading-spinner {
    background-color: transparent !important;
    mask-image: none !important;
    -webkit-mask-image: none !important;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 9999px;
    animation: admin-spin 0.6s linear infinite;
}

@keyframes admin-spin {
    to {
        transform: rotate(360deg);
    }
}

/* 后台侧边栏菜单：紧凑布局，消除项间空白可选区域 */
.menu.menu-sm {
    gap: 0;
}

.menu.menu-sm li {
    padding: 0;
    margin: 0;
}

.menu.menu-sm li > a,
.menu.menu-sm li > details > summary {
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
}

.menu.menu-sm li > details > ul {
    margin-top: 0.125rem;
    padding-left: 0.5rem;
}

.menu.menu-sm li > details > ul > li > a {
    padding: 0.375rem 0.75rem;
}

/* 后台侧边栏搜索框 */
.admin-search {
    border: 1px solid var(--bc, #d1d5db);
    border-radius: 0.5rem;
    background-color: var(--b1, #fff);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.admin-search:focus-within {
    border-color: var(--p, #111);
    box-shadow: 0 0 0 1px var(--p, #111);
}

