/* ===== 响应式面板设计 ===== */

/* 面板内容容器 - 高度自适应 */
.panel-content {
    display: flex;
    flex-direction: column;
    min-height: 70vh; /* 使用视口高度百分比 */
    max-height: 90vh; /* 最大高度限制 */
    height: calc(100vh - 100px); /* 动态计算高度 */
}

/* 订单列表 - 完全自适应 */
.order-list {
    flex: 1;
    overflow-y: auto;
    min-height: 300px;
    max-height: none; /* 移除最大高度限制 */
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    box-shadow:
            inset 0 2px 4px rgba(0, 0, 0, 0.04),
            0 1px 2px rgba(0, 0, 0, 0.05);

    /* 响应式间距 */
    display: flex;
    flex-direction: column;
    gap: clamp(12px, 1.5vh, 20px); /* 动态间距 */
}




/* ===== 日志列表高级自适应设计 ===== */

.log-list {
    /* 动态高度 - 基于视口高度自动计算 */
    height: calc(100vh - 300px); /* 自动适应屏幕高度 */
    min-height: 400px; /* 最小高度保证 */
    max-height: 85vh; /* 最大高度限制 */

    /* 滚动和布局 */
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0px;

    /* 视觉设计 */
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: clamp(12px, 1.5vh, 20px);
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    box-shadow:
            inset 0 2px 4px rgba(0, 0, 0, 0.04),
            0 1px 2px rgba(0, 0, 0, 0.05);

    /* 滚动条美化 */
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

/* 滚动条样式 */
.log-list::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.log-list::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
    margin: 4px 0;
}

.log-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
    border: 2px solid #f1f5f9;
}

.log-list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* 响应式设计 - 大屏幕优化 */
@media (min-height: 900px) {
    .log-list {
        height: calc(100vh - 280px);
        min-height: 500px;
        max-height: 80vh;
        padding: 16px;
        gap: 0px;
    }
}

@media (min-height: 1080px) {
    .log-list {
        height: calc(100vh - 250px);
        min-height: 600px;
        max-height: 85vh;
        padding: 20px;
        gap: 12px;
        border-radius: 16px;
    }
}

@media (min-height: 1440px) {
    .log-list {
        height: calc(100vh - 220px);
        min-height: 700px;
        max-height: 88vh;
        padding: 24px;
        gap:0px;
        border-radius: 20px;
    }

    .log-list::-webkit-scrollbar {
        width: 8px;
        height: 8px;
    }
}

/* 超宽屏优化 */
@media (min-width: 1920px) and (min-height: 1080px) {
    .log-list {
        height: calc(100vh - 200px);
        min-height: 650px;
        max-height: 90vh;
    }
}

/* 4K分辨率优化 */
@media (min-width: 2560px) and (min-height: 1440px) {
    .log-list {
        height: calc(100vh - 180px);
        min-height: 800px;
        max-height: 92vh;
        padding: 32px;
        gap: 0px;
        border-radius: 24px;
    }

    .log-list::-webkit-scrollbar {
        width: 10px;
        height: 10px;
    }
}

/* 日志项自适应设计 */
.log-item {
    padding: clamp(5px, 0.5vh, 10px);
    margin-bottom: clamp(8px, 0.5vh, 12px);
    background: white;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    display: flex;
    align-items: baseline;
    gap: 15px;
}

.log-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #dbeafe;
}



/* 日志时间 */
.log-time {
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    font-size: clamp(11px, 0.8vh, 13px);
    color: #64748b;
    font-weight: 500;
    padding: 4px 8px;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

/* 日志内容 */
.log-content {
    flex: 1;
    font-size: clamp(12px, 0.9vh, 14px);
    line-height: 2.5;
    color: #1e293b;
    font-weight: 400;
}

/* 状态文字颜色 */
.log-item.info .log-content { color: #1e40af; }
.log-item.success .log-content { color: #065f46; }
.log-item.error .log-content { color: #991b1b; }
.log-item.warning .log-content { color: #92400e; }
.log-item.price .log-content { color: #5b21b6; }

/* 大屏幕字体优化 */
@media (min-height: 1080px) {
    .log-time {
        font-size: 13px;

    }

    .log-content {
        font-size: 14px;
    }
}

@media (min-height: 1440px) {
    .log-time {
        font-size: 14px;
    }

    .log-content {
        font-size: 15px;
    }

    .log-item {
        padding: 16px 20px;
    }
}

/* 空状态 */
.log-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #94a3b8;
    text-align: center;
}

.log-empty i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.log-empty h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #64748b;
}

.log-empty p {
    font-size: 14px;
    color: #94a3b8;
}

/* 横屏模式优化 */
@media (orientation: landscape) and (max-height: 600px) {
    .log-list {
        height: calc(100vh - 180px);
        min-height: 250px;
        max-height: 70vh;
        padding: 10px;
        gap: 0px;
    }

    .log-item {
        padding: 8px 12px;
        margin-bottom: 4px;
    }

    .log-time {
        font-size: 11px;
    }

    .log-content {
        font-size: 12px;
    }
}

/* 移动端适配 */
@media (max-width: 768px) {
    .log-list {
        height: 50vh;
        min-height: 300px;
        max-height: none;
        padding: 12px;
    }

    .log-item {
        flex-direction: column;
        gap: 8px;
    }

    .log-time {
        align-self: flex-start;
    }
}

/* 暗色模式支持 */
@media (prefers-color-scheme: dark) {
    .log-list {
        background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
        border-color: #334155;
        box-shadow:
                inset 0 2px 4px rgba(0, 0, 0, 0.2),
                0 1px 2px rgba(0, 0, 0, 0.3);
    }

    .log-list::-webkit-scrollbar-track {
        background: #334155;
    }

    .log-list::-webkit-scrollbar-thumb {
        background: #475569;
        border-color: #334155;
    }

    .log-item {
        background: #1e293b;
        border-color: #334155;
    }

    .log-time {
        background: #334155;
        border-color: #475569;
        color: #cbd5e1;
    }

    .log-content {
        color: #e2e8f0;
    }

    .log-item.info .log-content { color: #93c5fd; }
    .log-item.success .log-content { color: #86efac; }
    .log-item.error .log-content { color: #fca5a5; }
    .log-item.warning .log-content { color: #fdba74; }
    .log-item.price .log-content { color: #c4b5fd; }

    .log-empty {
        color: #94a3b8;
    }

    .log-empty h4 {
        color: #cbd5e1;
    }
}

/* 打印优化 */
@media print {
    .log-list {
        height: auto;
        max-height: none;
        overflow: visible;
        border: 1px solid #ccc;
        box-shadow: none;
        background: white;
        padding: 12px;
    }

    .log-item {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

/* 性能优化 - 当有大量日志时 */
.log-list.high-volume .log-item {
    transition: none;
}

.log-list.high-volume .log-item:hover {
    transform: none;
    box-shadow: none;
}


/* ===== 所有标签页表格容器自适应高度 ===== */

/* 1. 所有标签页共用样式 */
#all-orders .panel-content,
#quoted-orders .panel-content,
#won-orders .panel-content,
#check-orders .panel-content,
#completed-orders .panel-content {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: calc(100vh - 320px); /* 根据您的主布局计算 */
    min-height: 500px;
    max-height: 85vh;
}

/* 2. 数据表格区域自动撑满 */
.data-table {
    flex: 1;
    min-height: 300px;
    overflow-y: auto;
    position: relative;
}

/* 3. 表格容器美化 */
.data-table .table {
    margin-bottom: 0;
}

/* 4. 分页固定在底部 */
.pagination-container {
    flex-shrink: 0;
    padding: 15px;
    background: white;
    border-top: 1px solid #eee;
    margin-top: 0;
}

/* 5. 表格头固定（可选） */
.data-table .table thead th {
    position: sticky;
    top: 0;
    background: #fafafa;
    z-index: 10;
    border-bottom: 2px solid #dee2e6;
}

/* 6. 加载器居中 */
/*.loader {*/
/*    position: absolute;*/
/*    top: 50%;*/
/*    left: 50%;*/
/*    transform: translate(-50%, -50%);*/
/*    z-index: 5;*/
/*}*/

/* 7. 空状态显示 */
.data-table .empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 300px;
    color: #999;
    flex-direction: column;
}

/* 8. 滚动条美化 */
.data-table::-webkit-scrollbar {
    width: 6px;
}

.data-table::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.data-table::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.data-table::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* 9. 筛选工具栏固定 */
.filter-toolbar {
    flex-shrink: 0;
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 15px;
}

/* 10. 响应式调整 */
@media (max-height: 800px) {
    #all-orders .panel-content,
    #quoted-orders .panel-content,
    #won-orders .panel-content,
    #check-orders .panel-content,
    #completed-orders .panel-content {
        height: calc(100vh - 300px);
        min-height: 400px;
    }
}

@media (min-height: 1080px) {
    #all-orders .panel-content,
    #quoted-orders .panel-content,
    #won-orders .panel-content,
    #check-orders .panel-content,
    #completed-orders .panel-content {
        height: calc(100vh - 350px);
        min-height: 600px;
    }
}

/* 11. 确保表格内容不会溢出 */
.data-table table {
    width: 100%;
    table-layout: auto;
}

.data-table td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

/* 12. 表格操作按钮样式 */
.data-table .btn {
    padding: 3px 8px;
    font-size: 12px;
}

/* 13. 状态徽章样式 */
.data-table .badge {
    font-size: 12px;
    padding: 3px 8px;
}

/* 14. 表格行悬停效果 */
.data-table tbody tr:hover {
    background-color: #f8f9fa;
}

/* 15. 确保分页可见 */
.pagination-container .pagination {
    margin-bottom: 0;
}

.pagination-container .page-link {
    padding: 6px 12px;
    font-size: 14px;
}

/* 16. 如果表格内容过多，显示滚动条 */
.data-table {
    overflow-x: auto;
}

.data-table .table {
    min-width: 1000px; /* 确保所有列都有足够空间 */
}

/* 17. 针对每个标签页的特定调整 */
#all-orders .data-table .table {
    min-width: 1200px; /* 所有订单页面有更多列 */
}

#quoted-orders .data-table .table {
    min-width: 1000px;
}

#won-orders .data-table .table {
    min-width: 1000px;
}

#check-orders .data-table .table {
    min-width: 1100px;
}

#completed-orders .data-table .table {
    min-width: 1000px;
}
/* ===== 快速修复：表格标签页自适应高度 ===== */

/* 所有非自动抢单标签页 */
#all-orders .panel-content,
#quoted-orders .panel-content,
#won-orders .panel-content,
#check-orders .panel-content,
#completed-orders .panel-content {
    display: flex !important;
    flex-direction: column !important;
    height: 600px !important;
    min-height: 500px !important;
    max-height: 80vh !important;
}

/* 表格容器 */
.data-table {
    flex: 1 !important;
    overflow-y: auto !important;
    min-height: 300px !important;
}

/* 分页固定在底部 */
.pagination-container {
    flex-shrink: 0 !important;
    padding: 15px !important;
    background: white !important;
    border-top: 1px solid #eee !important;
}

/* 确保表格内容可见 */
.data-table table {
    min-width: 1000px;
}

.data-table td {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* 报价设置模态框样式优化 */
#priceSettingModal .modal-header {
    background: linear-gradient(135deg, #4a90e2 0%, #2e6fd9 100%);
    color: white;
    padding: 1rem 1.5rem;
    border-bottom: none;
}

#priceSettingModal .modal-header .modal-title {
    font-weight: 600;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
}

#priceSettingModal .modal-header .close {
    color: white;
    opacity: 0.8;
    text-shadow: none;
    margin: -0.5rem -0.5rem -0.5rem auto;
}

#priceSettingModal .modal-header .close:hover {
    opacity: 1;
    transform: scale(1.1);
}

#priceSettingModal .modal-body {
    padding: 1.5rem;
    background: #f8fafc;
}

#priceSettingModal .form-group label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

#priceSettingModal .input-group {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e5e7eb;
    transition: all 0.3s ease;
}

#priceSettingModal .input-group:focus-within {
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
}

#priceSettingModal .input-group-text {
    background: linear-gradient(to right, #f8fafc, #f1f5f9);
    border: none;
    color: #64748b;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.625rem 0.75rem;
}

#priceSettingModal .input-group-prepend .input-group-text {
    background: linear-gradient(to right, #4a90e2, #2e6fd9);
    color: white;
    font-weight: 600;
    border-radius: 6px 0 0 6px;
}

#priceSettingModal .input-group-append .input-group-text {
    background: #f8fafc;
    border-left: 1px solid #e5e7eb;
    font-weight: 600;
}

#priceSettingModal #basePrice,
#priceSettingModal #discountRate {
    border: none;
    background: white;
    text-align: center;
    font-weight: 600;
    color: #1e293b;
    padding: 0.625rem;
    transition: all 0.2s;
    max-width: 80px;
}

#priceSettingModal #basePrice:focus,
#priceSettingModal #discountRate:focus {
    box-shadow: inset 0 0 0 2px #4a90e2;
    z-index: 3;
}

#priceSettingModal #basePrice {
    border-right: 1px solid #e5e7eb;
    border-left: 1px solid #e5e7eb;
    color: #dc2626;
}

#priceSettingModal #discountRate {
    border-right: 1px solid #e5e7eb;
    color: #059669;
}

#priceSettingModal small.text-muted {
    display: block;
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: white;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    color: #64748b;
    font-size: 0.875rem;
}

#priceSettingModal #formulaText {
    color: #4a90e2;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    background: #eff6ff;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    margin-left: 0.5rem;
}

#priceSettingModal .modal-footer {
    padding: 1rem 1.5rem;
    background: white;
    border-top: 1px solid #e5e7eb;
}

#priceSettingModal .modal-footer .btn {
    padding: 0.5rem 1.5rem;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s;
}

#priceSettingModal .modal-footer .btn-secondary {
    background: #64748b;
    border-color: #64748b;
    color: white;
}

#priceSettingModal .modal-footer .btn-secondary:hover {
    background: #475569;
    border-color: #475569;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(100, 116, 139, 0.2);
}

#priceSettingModal .modal-footer .btn-primary {
    background: linear-gradient(135deg, #4a90e2 0%, #2e6fd9 100%);
    border: none;
    box-shadow: 0 2px 4px rgba(74, 144, 226, 0.3);
}

#priceSettingModal .modal-footer .btn-primary:hover {
    background: linear-gradient(135deg, #2e6fd9 0%, #1d5bbf 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(74, 144, 226, 0.4);
}

/* 数字输入框特定样式 */
#priceSettingModal input[type="number"]::-webkit-inner-spin-button,
#priceSettingModal input[type="number"]::-webkit-outer-spin-button {
    opacity: 1;
    height: 2em;
    cursor: pointer;
}

/* 响应式调整 */
@media (max-width: 576px) {
    #priceSettingModal .modal-dialog {
        margin: 0.5rem;
    }

    #priceSettingModal .input-group-text {
        font-size: 0.8rem;
        padding: 0.5rem;
    }

    #priceSettingModal #basePrice,
    #priceSettingModal #discountRate {
        max-width: 60px;
        padding: 0.5rem;
    }
}

.btn-danger.disabled, .btn-danger:disabled{
    color: #fff;
    background-color: #ba9296;
    border-color: #ffd1d6;
}
.btn-success.disabled, .btn-success:disabled{
    color: #fff;
    background-color: #82ad99;
    border-color: #99b4a7;
}

.mr-1{
    margin-right: 10px;
}
.mr-2{
    margin-right: 20px;
}
.ml-2{
    margin-left: 20px;
}
.ml-1{
     margin-left: 10px;
 }