@charset "utf-8";

/*!
 * 后台列表页通用组件 ListPage
 * ------------------------------------------------------------------
 * 全站唯一一份列表页样式，取代原先并存的 .tl-* / .data-table / .table-wrap 三套命名。
 * 结构约定见 static/admin/listpage.js
 */

/* ============================ 搜索卡片 ============================ */
.lp-search {
    background: #fff;
    border: 1px solid #e6e9f0;
    border-radius: 6px;
    padding: 20px 24px;
    margin-bottom: 16px;
}

.lp-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px 20px;
}

@media (max-width: 1280px) {
    .lp-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 820px) {
    .lp-grid { grid-template-columns: 1fr; }
}

.lp-item {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.lp-item > label {
    white-space: nowrap;
    font-size: 13px;
    color: #555;
    width: 84px;
    text-align: right;
    flex-shrink: 0;
}

.lp-item > label::after { content: '：'; }

.lp-item select,
.lp-item input {
    flex: 1;
    height: 34px;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    padding: 0 10px;
    font-size: 13px;
    color: #333;
    background: #fff;
    outline: none;
    transition: border-color .2s;
    box-sizing: border-box;
    min-width: 0;
}

.lp-item select:focus,
.lp-item input:focus { border-color: #4A90D9; }

/* 可清除文本框：input 被包进 .lp-clear-wrap，叉号内嵌在输入框右缘 */
.lp-clear-wrap {
    flex: 1;
    display: flex;
    position: relative;
    min-width: 0;
}

.lp-clear-wrap input { padding-right: 26px; }

.lp-clear {
    position: absolute;
    right: 7px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    line-height: 16px;
    border-radius: 50%;
    background: #c0c4cc;
    color: #fff;
    font-size: 12px;
    text-align: center;
    font-style: normal;
    cursor: pointer;
    z-index: 1;
}

.lp-clear:hover { background: #909399; }

/* 搜索按钮区（由组件自动生成） */
.lp-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding-top: 14px;
    margin-top: 16px;
    border-top: 1px solid #f0f0f0;
}

/* ============================== 按钮 ============================== */
.lp-btn {
    height: 34px;
    border: none;
    border-radius: 4px;
    padding: 0 22px;
    font-size: 13px;
    cursor: pointer;
    transition: all .2s;
    outline: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    background: #fff;
}

.lp-btn .layui-icon,
.lp-btn .fa { font-size: 14px; }

.lp-btn.primary { background: #4A90D9; color: #fff; }
.lp-btn.primary:hover { background: #357ABD; color: #fff; }

.lp-btn.default { color: #666; border: 1px solid #dcdfe6; }
.lp-btn.default:hover { color: #4A90D9; border-color: #4A90D9; }

.lp-btn[disabled] { opacity: .6; cursor: not-allowed; }

/* ============================= 工具栏 ============================= */
.lp-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.lp-toolbar-title { font-size: 14px; color: #333; font-weight: 600; }
.lp-toolbar-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* =========================== 数据容器区 =========================== */
.lp-container {
    background: #fff;
    border: 1px solid #e6e9f0;
    border-radius: 6px;
    min-height: 200px;
    position: relative;
}

/* 三态 */
.lp-state {
    text-align: center;
    padding: 60px 0;
    color: #999;
}

.lp-state .lp-state-icon {
    display: block;
    font-size: 48px;
    line-height: 1;
    margin-bottom: 12px;
    opacity: .5;
}

.lp-state .lp-state-text { font-size: 13px; }

.lp-state.lp-loading .lp-state-icon {
    font-size: 30px;
    opacity: 1;
    animation: lp-spin 1s linear infinite;
}

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

.lp-tip {
    font-size: 12px;
    color: #909399;
    padding: 12px 16px 0;
}

/* ============================== 表格 ============================== */
.lp-table-wrap { overflow-x: auto; }

.lp-table {
    width: 100%;
    /* 必须用 separate：collapse 模式下 Chrome(<91)/部分国产浏览器不支持 sticky 单元格，
       会导致序号列 / 操作列固定失效跟着横向滚动 */
    border-collapse: separate;
    border-spacing: 0;
    font-size: 12px;
    table-layout: fixed;
}

.lp-table thead th {
    background: #f8f9fb;
    color: #555;
    font-weight: 600;
    padding: 12px 18px 12px 10px;
    text-align: left;
    white-space: nowrap;
    border-bottom: 2px solid #e6e9f0;
    font-size: 12px;
    position: relative;
}

.lp-table tbody td {
    padding: 11px 10px;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
    vertical-align: middle;
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lp-table tbody tr:hover { background: #f5f8ff; }
.lp-table tbody tr:last-child td { border-bottom: none; }

/* 列宽拖拽手柄 */
.lp-table thead th .lp-resize {
    position: absolute;
    right: 0;
    top: 0;
    width: 8px;
    height: 100%;
    cursor: col-resize;
    user-select: none;
    background: transparent;
    z-index: 2;
}

.lp-table thead th .lp-resize::before {
    content: '';
    position: absolute;
    right: 3px;
    top: 22%;
    height: 56%;
    width: 1px;
    background: #d8dde5;
}

.lp-table thead th .lp-resize:hover,
.lp-table thead th .lp-resize.active { background: rgba(74, 144, 217, .15); }

.lp-table thead th .lp-resize:hover::before,
.lp-table thead th .lp-resize.active::before { background: #4A90D9; }

/* 固定列（仅当表格带 .lp-fixed 时生效）
   选择器用 .lp-fixed-left / .lp-fixed-right（JS 渲染时打到 th/td 上），
   不依赖 :first-child/:last-child，列结构变化不会错位。
   定位方案：position:relative + JS 滚动时 transform 平移（listpage.js bindFixedScroll），
   不用 position:sticky —— 部分老内核/特殊环境下表格单元格 sticky 会静默失效。 */
.lp-table.lp-fixed .lp-fixed-left {
    position: relative;
    z-index: 2;
    background: #fff;
    box-shadow: 2px 0 6px rgba(0, 0, 0, .06);
}

.lp-table.lp-fixed thead .lp-fixed-left { z-index: 3; background: #f8f9fb; }

.lp-table.lp-fixed .lp-fixed-right {
    position: relative;
    z-index: 2;
    background: #fff;
    box-shadow: -2px 0 6px rgba(0, 0, 0, .06);
    overflow: visible;
}

.lp-table.lp-fixed thead .lp-fixed-right { z-index: 3; background: #f8f9fb; }

.lp-table.lp-fixed tbody tr:hover .lp-fixed-left,
.lp-table.lp-fixed tbody tr:hover .lp-fixed-right { background: #f5f8ff; }

/* 末列手柄移到左边缘，避免被固定边界遮挡 */
.lp-table.lp-fixed thead .lp-fixed-right .lp-resize { right: auto; left: 0; }

/* 单元格修饰 */
.lp-td-center { text-align: center !important; }
.lp-td-wrap { white-space: normal !important; word-break: break-all; }
.lp-td-muted { color: #909399; }

.lp-thumb {
    width: 40px;
    height: 25px;
    object-fit: cover;
    margin-right: 6px;
    vertical-align: middle;
    border-radius: 2px;
}

/* 关键词高亮 */
.lp-kw {
    color: #FF5722;
    background-color: #FFF3E0;
    padding: 0 2px;
    border-radius: 2px;
    font-weight: bold;
}

/* ============================ 状态标签 ============================ */
.lp-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 11px;
    line-height: 18px;
    white-space: nowrap;
}

.lp-tag.success { background: #e6f7e6; color: #389e0d; }
.lp-tag.danger  { background: #fff1f0; color: #cf1322; }
.lp-tag.warning { background: #fff7e6; color: #d46b08; }
.lp-tag.info    { background: #e6f4ff; color: #0958d9; }
.lp-tag.default { background: #f0f0f0; color: #666; }

/* ============================= 操作列 ============================= */
.lp-op {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    white-space: nowrap;
}
.lp-op .layui-btn { margin: 0; }
.lp-op .layui-btn-xs {
    min-width: 56px;
    padding: 0 8px;
    text-align: center;
    box-sizing: border-box;
}

/* ============================== 分页 ============================== */
.lp-page {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px 20px;
    border-top: 1px solid #f0f0f0;
}

.lp-page:empty { display: none; }

.lp-page-info { font-size: 12px; color: #909399; margin-right: auto; }

.lp-page ul.pagination { margin: 0; padding: 0; list-style: none; }
.lp-page ul.pagination li { display: inline-block; }

.lp-page ul.pagination li a,
.lp-page ul.pagination li span {
    display: inline-block;
    min-width: 30px;
    text-align: center;
    padding: 5px 8px;
    margin-left: 4px;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    color: #666;
    font-size: 12px;
    text-decoration: none;
    background: #fff;
    cursor: pointer;
    box-sizing: border-box;
}

.lp-page ul.pagination li.active span {
    background: #4A90D9;
    border-color: #4A90D9;
    color: #fff;
}

.lp-page ul.pagination li.disabled span { color: #ccc; cursor: not-allowed; }

.lp-page ul.pagination li a:hover { color: #4A90D9; border-color: #4A90D9; }

.lp-page .lp-page-size { font-size: 12px; color: #666; }

.lp-page .lp-page-size select {
    height: 30px;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    padding: 0 6px;
    font-size: 12px;
    color: #333;
    background: #fff;
    outline: none;
}
