/* ============================================
 * adminlte-pay.css
 * 支付管理后台 AdminLTE 模板补充样式
 * 兼容原有 layui 类名 + iframe 多标签框架
 * ============================================ */

/* ---------- 通用 ---------- */
body {
    font-family: "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bs-body-bg, #f4f6f9);
}

/* iframe 子页面内容区 */
.page-padding {
    padding: 1rem 1.25rem;
}

/* ---------- layui 类名兼容（按钮/输入框/表格/卡片） ---------- */
.layui-btn {
    display: inline-block;
    font-weight: 500;
    line-height: 1.5;
    color: #fff;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    background-color: #007bff;
    border: 1px solid #007bff;
    padding: .375rem .75rem;
    font-size: .875rem;
    border-radius: .25rem;
    transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out;
    text-decoration: none;
}
.layui-btn:hover { opacity: .85; color: #fff; text-decoration: none; }
.layui-btn-xs { padding: .25rem .5rem; font-size: .75rem; line-height: 1.5; border-radius: .2rem; }
.layui-btn-sm { padding: .25rem .5rem; font-size: .875rem; line-height: 1.5; border-radius: .2rem; }
.layui-btn-fluid { width: 100%; display: block; }
.layui-btn-normal { background-color: #007bff; border-color: #007bff; }
.layui-btn-warm   { background-color: #ffc107; border-color: #ffc107; color: #111; }
.layui-btn-warm:hover { color: #111; }
.layui-btn-danger { background-color: #dc3545; border-color: #dc3545; }
.layui-btn-primary { background: transparent; color: #007bff; border-color: #007bff; }
.layui-btn-primary:hover { background: #007bff; color: #fff; }

.layui-input, .layui-textarea {
    display: block;
    width: 100%;
    padding: .375rem .75rem;
    font-size: .875rem;
    font-weight: 400;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    appearance: none;
    border-radius: .25rem;
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
    box-sizing: border-box;
}
.layui-input:focus, .layui-textarea:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 .2rem rgba(0, 123, 255, .25);
    outline: 0;
}
.layui-textarea { min-height: 60px; resize: vertical; }
select.layui-input { appearance: auto; }

.layui-form-item { margin-bottom: 1rem; }
.layui-form-label { display: inline-block; margin-bottom: .375rem; font-weight: 500; color: #6c757d; }
.layui-input-block { margin-left: 0; }
.layui-form-mid, .layui-word-aux { font-size: .8125rem; color: #6c757d; margin-top: .25rem; }

/* 表单内下拉框与其他输入控件宽度一致 */
.form-control-block select.form-select {
    width: 100%;
}

.layui-table {
    width: 100%;
    margin-bottom: 1rem;
    color: #212529;
    vertical-align: top;
    border-collapse: collapse;
    border: 0;
}
.layui-table th, .layui-table td {
    padding: .625rem .75rem;
    border-bottom: 1px solid #dee2e6;
    text-align: left;
    font-size: .875rem;
}
.layui-table thead th { background: #f8f9fa; font-weight: 600; border-bottom: 2px solid #dee2e6; }

.layui-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: #fff;
    border: 0;
    border-radius: .25rem;
    box-shadow: 0 0 1px rgba(0,0,0,.125), 0 1px 3px rgba(0,0,0,.2);
    margin-bottom: 1rem;
}
.layui-card-header { padding: .75rem 1.25rem; font-weight: 600; border-bottom: 1px solid rgba(0,0,0,.125); }
.layui-card-body { flex: 1 1 auto; padding: 1.25rem; }

/* 分页 */
.adminlte-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem;
    padding: .75rem 0;
}
.adminlte-pagination .page-link { cursor: pointer; }
.adminlte-pagination select {
    display: inline-block;
    width: auto;
    padding: .25rem 1.75rem .25rem .5rem;
    font-size: .8125rem;
    border-radius: .25rem;
    border: 1px solid #ced4da;
}

/* ---------- 登录页 ---------- */
html, body {
    height: 100%;
}
body.hold-transition {
    margin: 0;
}
.auth-cover {
    min-height: 100vh;
    height: 100%;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #367fa9 0%, #001f3f 100%);
    background-attachment: fixed;
    padding: 1rem;
}
.auth-card { width: 100%; max-width: 420px; }
.auth-card .card { border-radius: .5rem; box-shadow: 0 1rem 3rem rgba(0,0,0,.25); }
.captcha-img img {
    height: 38px;
    border: 1px solid #ced4da;
    width: 100%;
    cursor: pointer;
    border-radius: 0 .25rem .25rem 0;
}

/* ---------- 弹窗 iframe ---------- */
.modal-body iframe { width: 100%; border: 0; display: block; }
.modal-body { padding: 0; overflow: hidden; }

/* ---------- 多标签框架（AdminLTE 4 布局） ---------- */
/* 侧边栏深色背景 */
.app-sidebar {
    background-color: #343a40;
    border-right: 1px solid #2c3136;
}
.app-sidebar .sidebar-brand {
    background-color: #2c3136;
}
.app-sidebar .sidebar-brand .brand-text {
    color: #fff;
}
.app-sidebar .nav-link {
    color: #c2c7d0;
}
.app-sidebar .nav-link:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, .1);
}
.app-sidebar .nav-link.active {
    color: #fff;
    background-color: #007bff;
}

/* app-content 内部 flex：header + tabs + iframe 自动填充 */
.app-content {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 0;
}
.app-content .app-header {
    flex-shrink: 0;
}

/* 内容区 tab 条 */
.content-tabs {
    background: #fff;
    border-bottom: 1px solid #dee2e6;
    border-top: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    overflow: hidden;
    height: 40px;
    flex-shrink: 0;
}
.content-tabs .tab-scroll {
    flex: 1;
    overflow-x: auto;
    white-space: nowrap;
    display: flex;
    scrollbar-width: thin;
    height: 100%;
}
.content-tabs .tab-item {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    padding: 0 .875rem;
    font-size: .85rem;
    color: #6c757d;
    cursor: pointer;
    border-right: 1px solid #dee2e6;
    user-select: none;
    height: 100%;
    background: #f8f9fa;
}
.content-tabs .tab-item.active {
    color: #007bff;
    background: #fff;
    box-shadow: inset 0 -2px 0 #007bff;
    font-weight: 500;
}
.content-tabs .tab-item .tab-close {
    width: 1rem;
    height: 1rem;
    line-height: 1rem;
    text-align: center;
    border-radius: 50%;
    font-size: .75rem;
}
.content-tabs .tab-item .tab-close:hover { background: #dc3545; color: #fff; }

.content-iframe-wrap {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    background: #f4f6f9;
}
.content-iframe-wrap .tab-page { position: absolute; inset: 0; display: none; }
.content-iframe-wrap .tab-page.active { display: block; }
.content-iframe-wrap iframe { width: 100%; height: 100%; border: 0; display: block; }

/* AdminLTE 4 菜单图标与文字间距 */
.sidebar-menu .nav-link .nav-icon {
    margin-right: .5rem;
}
.sidebar-menu .nav-link p {
    margin: 0;
}
.sidebar-menu .nav-link p .nav-arrow {
    margin-left: auto;
}
/* 二级及以上菜单：无图标、向右缩进 */
.sidebar-menu .nav-treeview .nav-link {
    padding-left: 2rem;
}
.sidebar-menu .nav-treeview .nav-link p {
    margin-left: 0;
}

/* ---------- 表格超长单元格悬浮展示 ---------- */
.cell-popover {
    position: fixed;
    z-index: 2000;
    max-width: 360px;
    max-height: 240px;
    overflow: auto;
    background: #343a40;
    color: #fff;
    border-radius: .375rem;
    padding: .5rem .75rem;
    font-size: .85rem;
    line-height: 1.5;
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .3);
    word-break: break-all;
    white-space: pre-wrap;
}

/* ---------- 手机端操作列折叠菜单 ---------- */
.cell-ops {
    white-space: nowrap;
}
.cell-ops-btn {
    white-space: nowrap;
}
.cell-ops-menu {
    position: fixed;
    z-index: 2001;
    min-width: 170px;
    max-height: 340px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: .375rem;
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15);
    padding: .375rem 0;
}
.cell-ops-item {
    display: block;
    padding: .5rem .75rem;
    font-size: .85rem;
    color: #212529;
    text-decoration: none;
    white-space: nowrap;
}
.cell-ops-item:hover {
    background: #f8f9fa;
    color: #212529;
}
.cell-ops-item.text-danger { color: #dc3545; }
.cell-ops-item.text-danger:hover { background: #fdeaea; }
.cell-ops-item.text-warning { color: #d39e00; }
.cell-ops-item.text-primary { color: #0d6efd; }
.cell-ops-item.text-primary:hover { background: #e7f1ff; }

/* toast 提示 */
.adminlte-toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1080;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}
.adminlte-toast {
    min-width: 220px;
    padding: .75rem 1rem;
    border-radius: .25rem;
    color: #fff;
    font-size: .875rem;
    box-shadow: 0 .5rem 1rem rgba(0,0,0,.15);
    animation: adminlteToastIn .25s ease;
}
.adminlte-toast.success { background: #28a745; }
.adminlte-toast.error   { background: #dc3545; }
.adminlte-toast.warning { background: #ffc107; color: #111; }
.adminlte-toast.info    { background: #007bff; }
@keyframes adminlteToastIn {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* 上传缩略图 */
.upload-thumb {
    cursor: pointer;
    max-width: 120px;
    max-height: 80px;
    margin-left: 10px;
    vertical-align: middle;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

/* 表单校验错误提示 */
.form-error { color: #dc3545; font-size: .8125rem; }

/* 手机端：列表表格以卡片形式展示（<768px） */
@media (max-width: 767.98px) {
    .table-card-mode { display: block; width: 100%; }
    .table-card-mode thead { display: none; }
    .table-card-mode tbody { display: block; }
    .table-card-mode tbody tr {
        display: block;
        border: 1px solid #e9ecef;
        border-radius: 8px;
        margin-bottom: 10px;
        padding: 4px 12px;
        background: #fff;
    }
    .table-card-mode td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border: none;
        padding: 5px 0;
        cursor: default !important;
        max-width: none !important;
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: clip !important;
        word-break: break-all;
    }
    /* 值区域允许收缩换行（超长订单号等） */
    .table-card-mode td > * {
        min-width: 0;
    }
    .table-card-mode td::before {
        content: attr(data-label);
        color: #6c757d;
        font-size: 12px;
        flex-shrink: 0;
        margin-right: 10px;
    }
    /* 操作列（无 data-label）：整行按钮区 */
    .table-card-mode td:not([data-label]) {
        display: block;
        border-top: 1px dashed #e9ecef;
        margin-top: 4px;
        padding-top: 8px;
        text-align: left;
    }
    .table-card-mode td:not([data-label])::before { content: none; }
    /* 空状态行 */
    .table-card-mode td[colspan] {
        display: block;
        border: none;
        text-align: center;
        padding: 12px 0;
    }
}
