/* 回收规则配置管理样式 */

.rule-item {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    background-color: #f8f9fa;
    position: relative;
    cursor: move;
}

.rule-item:hover {
    background-color: #e9ecef;
}

.image-preview {
    max-width: 100px;
    max-height: 100px;
    margin: 5px;
    border-radius: 4px;
    cursor: move;
    transition: all 0.2s;
}

.image-upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.image-upload-area:hover {
    border-color: #007bff;
    background-color: #f8f9fa;
}

.image-upload-area.dragover {
    border-color: #007bff;
    background-color: #e3f2fd;
}

.json-editor {
    min-height: 300px;
    font-family: 'Courier New', monospace;
}

.btn-group-vertical .btn {
    margin-bottom: 5px;
}

.rule-item.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

.rule-item.drag-over {
    border-color: #007bff;
    background-color: #e3f2fd;
}

.drag-handle {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: grab;
    color: #6c757d;
    font-size: 18px;
}

.drag-handle:active {
    cursor: grabbing;
}

.rule-item-content {
    margin-left: 30px;
}

.drag-insertion-line {
    height: 2px;
    background-color: #007bff;
    margin: 5px 0;
    opacity: 0;
    transition: opacity 0.2s;
}

.drag-insertion-line.show {
    opacity: 1;
}

.image-preview:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.image-preview.dragging {
    opacity: 0.5;
    transform: rotate(5deg) scale(1.1);
}

.image-preview.drag-over {
    border: 2px solid #007bff;
    box-shadow: 0 0 10px rgba(0,123,255,0.5);
}

.image-drag-handle {
    position: absolute;
    top: 2px;
    left: 2px;
    background: rgba(0,0,0,0.7);
    color: white;
    border: none;
    border-radius: 3px;
    padding: 2px 4px;
    font-size: 10px;
    cursor: grab;
    opacity: 0;
    transition: opacity 0.2s;
}

.image-drag-handle:active {
    cursor: grabbing;
}

.position-relative:hover .image-drag-handle {
    opacity: 1;
}

.image-insertion-line {
    height: 2px;
    background-color: #28a745;
    margin: 2px 0;
    opacity: 0;
    transition: opacity 0.2s;
}

.image-insertion-line.show {
    opacity: 1;
}

.gallery-upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.gallery-upload-area:hover {
    border-color: #007bff;
    background-color: #f8f9fa;
}

.gallery-upload-area.dragover {
    border-color: #007bff;
    background-color: #e3f2fd;
}

.gallery-image-card {
    position: relative;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s;
}

.gallery-image-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.gallery-image-preview {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.gallery-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.gallery-image-card:hover .gallery-image-overlay {
    opacity: 1;
}

.gallery-image-info {
    padding: 10px;
}

.gallery-image-title {
    font-weight: bold;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gallery-image-meta {
    font-size: 12px;
    color: #6c757d;
}

/* 页面切换动画（仅透明度，不使用 transform：避免破坏弹窗 fixed 定位） */
.page-transition {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.page-transition.show {
    opacity: 1;
}

/* 加载状态 */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 1001;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 移动端基础样式 */
.mobile-header {
    z-index: 1030;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.mobile-menu-btn, .mobile-back-btn {
    min-width: 44px;
    min-height: 44px;
    padding: 8px;
    border-radius: 8px;
    touch-action: manipulation;
}

.mobile-title {
    font-size: 1.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

/* 桌面端侧边栏样式 - 确保正常显示 */
@media (min-width: 769px) {
    .sidebar {
        position: relative;
        top: auto;
        left: auto;
        width: auto;
        height: auto;
        z-index: auto;
        transition: none;
        overflow-y: visible;
    }
    
    .sidebar .nav-link {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
        border-radius: 0.375rem;
        border-bottom: none;
        min-height: auto;
        display: flex;
        align-items: center;
        color: #6c757d;
        text-decoration: none;
    }
    
    .sidebar .nav-link:hover {
        background-color: #e9ecef;
        color: #495057;
    }
    
    .sidebar .nav-link.active {
        background-color: #007bff;
        color: white;
    }
    
    .sidebar .nav-link i {
        margin-right: 0.5rem;
        width: auto;
        text-align: left;
    }
}

/* 移动端侧边栏样式 - 只在移动设备上生效 */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100vh;
        z-index: 1040;
        transition: left 0.3s ease-in-out;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .sidebar.show {
        left: 0;
    }
    
    .sidebar .nav-link {
        padding: 12px 20px;
        font-size: 1rem;
        border-radius: 0;
        border-bottom: 1px solid #e9ecef;
        min-height: 48px;
        display: flex;
        align-items: center;
        touch-action: manipulation;
    }
    
    .sidebar .nav-link:hover {
        background-color: #e9ecef;
    }
    
    .sidebar .nav-link.active {
        background-color: #007bff;
        color: white;
    }
    
    .sidebar .nav-link i {
        margin-right: 12px;
        width: 20px;
        text-align: center;
    }
}

/* 移动端遮罩层 */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1035;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
}

.mobile-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* 移动端主内容区 */
@media (max-width: 768px) {
    .main-content {
        margin-left: 0;
        padding: 0;
    }
    
    .main-content .container-fluid {
        padding: 0;
    }
    
    .main-content .d-flex.justify-content-between {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .main-content h1 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .main-content h2 {
        font-size: 1.3rem;
    }
    
    .main-content h3 {
        font-size: 1.1rem;
    }
}

/* 移动端表格优化 */
@media (max-width: 768px) {
    .table-responsive {
        border: none;
        box-shadow: none;
        /* 确保显示滚动条 */
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        /* 强制显示滚动条 */
        scrollbar-width: thin;
        scrollbar-color: #007bff #f1f1f1;
    }
    
    /* Webkit浏览器滚动条样式 */
    .table-responsive::-webkit-scrollbar {
        height: 8px;
    }
    
    .table-responsive::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 4px;
    }
    
    .table-responsive::-webkit-scrollbar-thumb {
        background: #007bff;
        border-radius: 4px;
    }
    
    .table-responsive::-webkit-scrollbar-thumb:hover {
        background: #0056b3;
    }
    
    .table {
        font-size: 0.875rem;
        min-width: 600px; /* 确保表格有最小宽度以触发滚动 */
    }
    
    .table th, .table td {
        padding: 8px 4px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 120px;
    }
    
    .table th:first-child,
    .table td:first-child {
        max-width: 80px;
    }
    
    .table th:last-child,
    .table td:last-child {
        max-width: 100px;
    }
}

/* 移动端按钮组优化 */
@media (max-width: 768px) {
    .btn-group-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .btn-group-actions .btn {
        width: 100%;
        min-height: 44px;
        font-size: 0.9rem;
        padding: 10px 16px;
    }
    
    .btn-sm {
        min-height: 36px;
        padding: 6px 12px;
    }
}

/* 移动端卡片优化 */
@media (max-width: 768px) {
    .card {
        margin-bottom: 15px;
        border-radius: 12px;
    }
    
    .card-header {
        padding: 15px;
        font-size: 1rem;
    }
    
    .card-body {
        padding: 15px;
    }
    
    .card-footer {
        padding: 15px;
    }
}

/* 移动端表单优化 */
@media (max-width: 768px) {
    .form-control, .form-select {
        min-height: 44px;
        font-size: 16px; /* 防止iOS缩放 */
        padding: 10px 12px;
    }
    
    .form-label {
        font-size: 0.9rem;
        font-weight: 600;
        margin-bottom: 8px;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
    
    .input-group {
        flex-wrap: wrap;
    }
    
    .input-group .form-control {
        border-radius: 8px 8px 0 0;
    }
    
    .input-group .btn {
        border-radius: 0 0 8px 8px;
        width: 100%;
        margin-top: -1px;
    }
}

/* 移动端模态框优化 */
@media (max-width: 768px) {
    .modal-dialog {
        margin: 0;
        max-width: 100%;
        height: 100vh;
    }
    
    .modal-content {
        height: 100vh;
        border-radius: 0;
        border: none;
    }
    
    .modal-header {
        padding: 15px 20px;
        border-bottom: 1px solid #dee2e6;
    }
    
    .modal-body {
        padding: 20px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .modal-footer {
        padding: 15px 20px;
        border-top: 1px solid #dee2e6;
        background-color: #f8f9fa;
    }
    
    .modal-footer .btn {
        min-height: 44px;
        flex: 1;
        margin: 0 5px;
    }
}

/* 移动端分页优化 */
@media (max-width: 768px) {
    .pagination {
        justify-content: center;
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .pagination .page-link {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.9rem;
    }
    
    .pagination .page-item:first-child .page-link,
    .pagination .page-item:last-child .page-link {
        border-radius: 8px;
    }
}

/* 移动端图片预览优化 */
@media (max-width: 768px) {
    .image-preview {
        max-width: 80px;
        max-height: 80px;
        border-radius: 8px;
    }
    
    .gallery-image-preview {
        height: 150px;
    }
    
    .gallery-image-card {
        margin-bottom: 15px;
    }
}

/* 移动端拖拽优化 */
@media (max-width: 768px) {
    .rule-item {
        padding: 12px;
        margin-bottom: 12px;
    }
    
    .drag-handle {
        left: 8px;
        font-size: 16px;
    }
    
    .rule-item-content {
        margin-left: 25px;
    }
}

/* 移动端加载状态优化 */
@media (max-width: 768px) {
    .loading::before {
        width: 24px;
        height: 24px;
        margin: -12px 0 0 -12px;
    }
}

/* 移动端警告框优化 */
@media (max-width: 768px) {
    .alert {
        margin: 10px;
        padding: 15px;
        border-radius: 8px;
        font-size: 0.9rem;
    }
    
    .alert .btn-close {
        padding: 0.5rem;
    }
}

/* 移动端工具提示优化 */
@media (max-width: 768px) {
    .tooltip {
        font-size: 0.8rem;
    }
}

/* 移动端进度条优化 */
@media (max-width: 768px) {
    .progress {
        height: 12px;
        border-radius: 6px;
    }
}

/* 移动端状态标签优化 */
@media (max-width: 768px) {
    .status-badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
        border-radius: 0.25rem;
    }
}

/* 移动端表格滚动提示样式 */
.table-scroll-hint {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 8px 12px;
    margin: 10px 0;
    position: relative;
    animation: fadeInUp 0.3s ease-out;
}

.table-scroll-hint .btn-close {
    position: absolute;
    top: 4px;
    right: 8px;
    font-size: 12px;
    padding: 2px;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 移动端特殊交互 */
@media (max-width: 768px) {
    /* 防止双击缩放 */
    * {
        touch-action: manipulation;
    }
    
    /* 优化滚动 */
    .mobile-sidebar,
    .modal-body {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
    
    /* 优化选择文本 */
    .mobile-sidebar .nav-link,
    .btn {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
    
    /* 优化焦点状态 */
    .form-control:focus,
    .form-select:focus,
    .btn:focus {
        outline: 2px solid #007bff;
        outline-offset: 2px;
    }
    
    /* 强制显示滚动条 - 针对移动端 */
    .table-responsive {
        /* 确保滚动条始终可见 */
        overflow-x: scroll !important;
        -webkit-overflow-scrolling: touch;
        
        /* 滚动条样式 */
        scrollbar-width: auto;
        scrollbar-color: #007bff #e9ecef;
    }
    
    /* 为移动端添加滚动指示器 */
    .table-responsive::after {
        content: '';
        position: absolute;
        bottom: 0;
        right: 0;
        width: 20px;
        height: 20px;
        background: linear-gradient(45deg, transparent 30%, #007bff 30%, #007bff 70%, transparent 70%);
        pointer-events: none;
        opacity: 0.6;
    }
    
    /* 滚动条轨道样式 */
    .table-responsive::-webkit-scrollbar {
        height: 12px;
        background-color: #f8f9fa;
    }
    
    .table-responsive::-webkit-scrollbar-track {
        background: #e9ecef;
        border-radius: 6px;
        box-shadow: inset 0 0 2px rgba(0,0,0,0.1);
    }
    
    .table-responsive::-webkit-scrollbar-thumb {
        background: linear-gradient(90deg, #007bff, #0056b3);
        border-radius: 6px;
        border: 2px solid #e9ecef;
    }
    
    .table-responsive::-webkit-scrollbar-thumb:hover {
        background: linear-gradient(90deg, #0056b3, #004085);
    }
    
    .table-responsive::-webkit-scrollbar-corner {
        background: #f8f9fa;
    }
}

/* 表格样式增强 */
.table-responsive {
    border-radius: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.table thead th {
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

/* 按钮组样式 */
.btn-group-actions {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.btn-group-actions .btn {
    flex: 1;
    min-width: 80px;
}

/* 状态标签 */
.status-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
}

.status-active {
    background-color: #d1edff;
    color: #0c5460;
}

.status-inactive {
    background-color: #f8d7da;
    color: #721c24;
}

.status-pending {
    background-color: #fff3cd;
    color: #856404;
}

.status-success {
    background-color: #d4edda;
    color: #155724;
}

.status-danger {
    background-color: #f8d7da;
    color: #721c24;
}

/* 卡片样式 */
.card {
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-radius: 8px;
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
}

/* 表单样式 */
.form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
}

.form-select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
}

/* 分页样式 */
.pagination .page-link {
    color: #007bff;
    border-color: #dee2e6;
}

.pagination .page-link:hover {
    color: #0056b3;
    background-color: #e9ecef;
    border-color: #dee2e6;
}

.pagination .page-item.active .page-link {
    background-color: #007bff;
    border-color: #007bff;
}

/* 模态框样式 */
.modal-content {
    border: none;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.modal-header {
    border-bottom: 1px solid #dee2e6;
    background-color: #f8f9fa;
}

.modal-footer {
    border-top: 1px solid #dee2e6;
    background-color: #f8f9fa;
}

/* 工具提示样式 */
.tooltip {
    font-size: 0.875rem;
}

.tooltip-inner {
    background-color: #212529;
    border-radius: 4px;
}

/* 进度条样式 */
.progress {
    height: 8px;
    border-radius: 4px;
    background-color: #e9ecef;
}

.progress-bar {
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* 警告框样式 */
.alert {
    border: none;
    border-radius: 8px;
    border-left: 4px solid;
}

.alert-success {
    border-left-color: #28a745;
    background-color: #d4edda;
    color: #155724;
}

.alert-danger {
    border-left-color: #dc3545;
    background-color: #f8d7da;
    color: #721c24;
}

.alert-warning {
    border-left-color: #ffc107;
    background-color: #fff3cd;
    color: #856404;
}

.alert-info {
    border-left-color: #17a2b8;
    background-color: #d1ecf1;
    color: #0c5460;
}

/* ===== 纯前端登录遮罩 ===== */
#adminApp { display: none; }
body.logged-in #adminApp { display: block; }
body.logged-in #loginOverlay { display: none; }

#loginOverlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2b5876 0%, #4e4376 100%);
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}

.login-card {
    width: 360px;
    max-width: 90vw;
    background: #fff;
    border-radius: 14px;
    padding: 36px 30px 30px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    text-align: center;
}

.login-logo {
    font-size: 44px;
    color: #4e4376;
    margin-bottom: 10px;
}

.login-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
    color: #212529;
}

.login-sub {
    color: #999;
    font-size: 13px;
    margin-bottom: 24px;
}

.login-error {
    color: #dc3545;
    font-size: 13px;
    margin-bottom: 12px;
}

.login-btn {
    padding: 10px;
    font-size: 16px;
    font-weight: 600;
    background: #4e4376;
    border-color: #4e4376;
}

.login-btn:hover {
    background: #3d3560;
    border-color: #3d3560;
}

.logout-wrap {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #dee2e6;
}


/* ===== 订单审核 - AI识别依据 ===== */
.rec-evidence-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}
.rec-card {
    border: 1px solid #e6e6e6;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    display: flex;
    flex-direction: column;
}
.rec-thumb {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: #f5f5f5;
    cursor: zoom-in;
}
.rec-img-cell {
    width: calc(33.33% - 3px);
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}
.rec-img-cell .rec-thumb {
    height: 110px;
}
.rec-move-btn {
    width: 100%;
    border-radius: 0;
    border: none;
    border-top: 1px solid #eee;
    font-size: 12px;
}
.rec-noimg {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 13px;
}
.rec-body {
    padding: 10px 12px;
    font-size: 13px;
}
.rec-title {
    font-weight: 600;
    margin-bottom: 6px;
    color: #222;
}
.rec-meta {
    color: #666;
    line-height: 1.7;
}
.rec-meta b {
    color: #333;
}
.rec-unsupported {
    margin-top: 8px;
    color: #b45309;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 6px;
    padding: 5px 8px;
    font-size: 12px;
}
.rec-raw {
    margin-top: 8px;
    font-size: 12px;
}
.rec-raw summary {
    cursor: pointer;
    color: #4e4376;
}
.rec-raw pre {
    max-height: 220px;
    overflow: auto;
    font-size: 11px;
    background: #f8f9fa;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 8px;
    margin-top: 6px;
    white-space: pre-wrap;
    word-break: break-all;
}
.rec-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    cursor: zoom-out;
}
.rec-lightbox img {
    max-width: 92%;
    max-height: 92%;
    border-radius: 6px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

/* ===== 合伙人分析 - 纯 CSS 趋势柱状图 ===== */
.pa-trend-chart {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 240px;
    padding: 10px 4px 0;
    overflow-x: auto;
    border-bottom: 1px solid #dee2e6;
}
.pa-bar-col {
    flex: 1 1 0;
    min-width: 34px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
}
.pa-bar {
    width: 100%;
    max-width: 42px;
    background: linear-gradient(180deg, #4e73df 0%, #2a52c9 100%);
    border-radius: 4px 4px 0 0;
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    transition: height .25s ease;
    min-height: 2px;
}
.pa-bar-val {
    position: absolute;
    top: -18px;
    font-size: 11px;
    color: #333;
    white-space: nowrap;
}
.pa-bar-label {
    font-size: 11px;
    color: #6c757d;
    margin-top: 6px;
}

/* ===== 客服消息页 ===== */
.cs-layout {
    height: calc(100vh - 230px);
    min-height: 420px;
}
.cs-left {
    width: 300px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}
.cs-conv-list {
    flex-grow: 1;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 6px;
}
.cs-conv-item {
    padding: 10px 12px;
    border-bottom: 1px solid #f1f3f5;
    cursor: pointer;
}
.cs-conv-item:hover { background: #f8f9fa; }
.cs-conv-item.active { background: #e7f1ff; }
.cs-conv-item .cs-unread {
    background: #dc3545;
    color: #fff;
    border-radius: 10px;
    font-size: 11px;
    padding: 1px 7px;
    margin-left: 6px;
}
.cs-right {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.cs-msg-list {
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 12px;
    background: #f8f9fa;
}
.cs-msg { margin-bottom: 12px; }
.cs-msg .cs-meta { font-size: 11px; color: #adb5bd; margin-bottom: 3px; }
.cs-msg .cs-bubble {
    display: inline-block;
    max-width: 75%;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
    word-break: break-all;
    white-space: pre-wrap;
}
.cs-msg.cs-from-user { text-align: left; }
.cs-msg.cs-from-user .cs-bubble { background: #fff; border: 1px solid #e9ecef; }
.cs-msg.cs-from-cs { text-align: right; }
.cs-msg.cs-from-cs .cs-bubble { background: #0d6efd; color: #fff; }
.cs-msg.cs-sys { text-align: center; }
.cs-msg.cs-sys .cs-bubble { background: transparent; color: #6c757d; font-size: 12px; padding: 4px; }

/* 客服卡片消息：订单 / 品类 */
.cs-card {
    display: inline-block;
    text-align: left;
    width: 320px;
    max-width: 90%;
    background: #fff;
    border: 1px solid #e3e8ef;
    border-radius: 10px;
    padding: 10px 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.cs-card-order { border-left: 3px solid #0d6efd; }
.cs-card-cat { border-left: 3px solid #f0a020; }
.cs-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.cs-card-no { font-size: 14px; font-weight: 600; color: #212529; word-break: break-all; }
.cs-card-line { font-size: 12px; color: #495057; margin-top: 4px; }
.cs-card-std { font-size: 12px; color: #6c757d; margin-top: 6px; line-height: 1.5; max-height: 84px; overflow-y: auto; }

/* 客服媒体消息（图片/视频/文件） */
.cs-media-img { max-width: 260px; max-height: 200px; border-radius: 8px; cursor: pointer; display: block; }
.cs-media-video { max-width: 320px; max-height: 240px; border-radius: 8px; display: block; background: #000; }
.cs-card-file { cursor: pointer; }
.cs-file-name { font-size: 13px; color: #212529; word-break: break-all; max-width: 260px; }

/* 客服快捷回复条 */
.cs-quick-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.cs-quick-chip { display: inline-flex; align-items: center; padding: 3px 10px; border: 1px solid #dee2e6; border-radius: 14px; background: #f8f9fa; font-size: 12px; color: #495057; cursor: pointer; max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-quick-chip:hover { background: #e7f1ff; border-color: #0d6efd; color: #0d6efd; }
.cs-quick-chip img { max-height: 26px; max-width: 60px; border-radius: 4px; margin-right: 2px; }
.cs-quick-chip.cs-quick-video { color: #6c757d; }
