/* supply-demand-fix.css - 供应需求模块通用修复样式 */
/* 位置: /MyWebProject/common/css/supply-demand-fix.css */

/* ==================== 字体图标修复 ==================== */
@font-face {
    font-family: 'luckysheet-icons';
    src: url('../../libs/luckysheet/assets/iconfont/iconfont.woff2') format('woff2'),
         url('../../libs/luckysheet/assets/iconfont/iconfont.woff') format('woff'),
         url('../../libs/luckysheet/assets/iconfont/iconfont.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'FontAwesome';
    src: url('../../libs/luckysheet/assets/iconfont/iconfont.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

.luckysheet-iconfont,
[class^="luckysheet-icon-"],
[class*=" luckysheet-icon-"] {
    font-family: 'luckysheet-icons' !important;
    speak: none;
    font-style: normal;
    font-weight: normal;
    font-variant: normal;
    text-transform: none;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.fa, .fas, .far, .fab {
    font-family: 'FontAwesome' !important;
}

/* ==================== 全局样式 ==================== */
body {
    background-color: #f8f9fa;
    font-family: 'Microsoft YaHei', 'Segoe UI', Arial, sans-serif;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1400px;
    padding: 20px;
    margin: 0 auto;
}

/* ==================== 卡片样式 ==================== */
.card {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 8px;
    margin-bottom: 20px;
    background-color: white;
}

.card-header {
    border-radius: 8px 8px 0 0 !important;
    font-size: 1.2rem;
    padding: 15px 20px;
    font-weight: 600;
}

.card-header.bg-info {
    background-color: #17a2b8 !important;
    color: white;
}

.card-header.bg-warning {
    background-color: #ffc107 !important;
    color: #212529;
}

.card-header.bg-light {
    background-color: #f8f9fa !important;
    color: #495057;
}

.card-header.bg-success {
    background-color: #28a745 !important;
    color: white;
}

.card-body {
    padding: 20px;
}

/* ==================== 表单样式 ==================== */
.form-label {
    font-weight: 600;
    margin-bottom: 5px;
    color: #495057;
}

.form-control {
    border-radius: 4px;
    border: 1px solid #ced4da;
    padding: 8px 12px;
    font-size: 14px;
}

.form-control:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    outline: none;
}

.form-control[readonly] {
    background-color: #f8f9fa;
    cursor: not-allowed;
}

/* ==================== 按钮样式 ==================== */
.btn {
    border-radius: 5px;
    padding: 8px 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    margin: 0 5px 5px 0;
    border: none;
    cursor: pointer !important;
    font-size: 14px;
    pointer-events: auto !important;
    position: relative;
    z-index: 1;
}

.btn-primary {
    background-color: #17a2b8;
    color: white;
}

.btn-primary:hover {
    background-color: #138496;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
    transform: translateY(-2px);
}

.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-success:hover {
    background-color: #218838;
    transform: translateY(-2px);
}

.btn-warning {
    background-color: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background-color: #e0a800;
    transform: translateY(-2px);
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
    transform: translateY(-2px);
}

.btn-info {
    background-color: #17a2b8;
    color: white;
}

.btn-info:hover {
    background-color: #138496;
    transform: translateY(-2px);
}

.btn-outline-secondary {
    background-color: transparent;
    border: 1px solid #6c757d;
    color: #6c757d;
}

.btn-outline-secondary:hover {
    background-color: #6c757d;
    color: white;
}

.btn:disabled {
    pointer-events: none !important;
    cursor: not-allowed !important;
    opacity: 0.65 !important;
}

/* ==================== 模态框样式 ==================== */
.modal-content {
    border-radius: 10px;
    border: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    pointer-events: auto !important;
}

.modal-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 15px 20px;
}

.modal-title {
    font-weight: 600;
    color: #343a40;
    margin: 0;
}

.modal-body {
    padding: 20px;
    position: relative;
    min-height: 450px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #dee2e6;
}

.modal .btn {
    pointer-events: auto !important;
    cursor: pointer !important;
    z-index: 99999 !important;
    position: relative !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.modal.show {
    pointer-events: auto !important;
    z-index: 1050 !important;
}

.modal-backdrop.show {
    z-index: 1040 !important;
}

/* ==================== 列表组样式 ==================== */
.list-group {
    border-radius: 5px;
    overflow: hidden;
}

.list-group-item {
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #dee2e6;
    padding: 10px 15px;
    font-size: 14px;
    color: #495057;
    background-color: white;
    border-bottom: none;
}

.list-group-item:last-child {
    border-bottom: 1px solid #dee2e6;
}

.list-group-item:hover {
    background-color: #f8f9fa;
    border-color: #17a2b8;
}

.list-group-item.active {
    background-color: #17a2b8;
    border-color: #17a2b8;
    color: white;
    font-weight: 600;
}

/* ==================== Luckysheet样式 ==================== */
#luckysheet {
    border: 1px solid #dee2e6;
    border-radius: 5px;
    overflow: hidden;
    width: 100%;
    height: 600px;
    margin: 0;
}

.luckysheet-sheet-bar .luckysheet-sheet-bar-item,
.luckysheet-toolbar .luckysheet-toolbar-item,
.luckysheet-toolbar .luckysheet-toolbar-menu-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.luckysheet-sheet-bar .luckysheet-sheet-bar-item i,
.luckysheet-toolbar .luckysheet-toolbar-item i,
.luckysheet-toolbar .luckysheet-toolbar-menu-button i {
    font-family: 'luckysheet-icons' !important;
    font-size: 16px;
}

/* 可选择列样式 */
.luckysheet-cell[data-col="2"],
.luckysheet-cell[data-col="5"],
.luckysheet-cell[data-col="10"],
.luckysheet-cell[data-col="14"] {
    cursor: pointer !important;
    background-color: #e8f4fd !important;
    border-left: 3px solid #2196F3 !important;
}

.luckysheet-cell[data-col="2"]:hover,
.luckysheet-cell[data-col="5"]:hover,
.luckysheet-cell[data-col="10"]:hover,
.luckysheet-cell[data-col="14"]:hover {
    background-color: #d4e8ff !important;
    border: 2px solid #17a2b8 !important;
}

/* 只读列样式 */
.luckysheet-cell[data-col="3"],
.luckysheet-cell[data-col="6"],
.luckysheet-cell[data-col="11"],
.luckysheet-cell[data-col="15"],
.luckysheet-cell[data-col="16"] {
    background-color: #f5f5f5 !important;
    color: #666 !important;
    cursor: not-allowed !important;
}

/* 产品类型标题行样式 */
.product-type-row {
    background-color: #fff3e0 !important;
    font-weight: bold !important;
}

.company-name-row {
    background-color: #f1f8e9 !important;
}

/* ==================== 加载遮罩 ==================== */
#loadingOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    flex-direction: column;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
    color: white;
}

#loadingMessage {
    color: white;
    margin-top: 15px;
    font-size: 16px;
}

/* ==================== 警告框样式 ==================== */
.alert {
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
}

.alert-info {
    background-color: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

.alert-warning {
    background-color: #fff3cd;
    border-color: #ffeeba;
    color: #856404;
}

.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

/* ==================== PDF查看器样式 ==================== */
.pdf-canvas-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pdf-page-canvas {
    display: block;
    margin: 10px auto;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    max-width: 100%;
    height: auto;
}

#pdfLoading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
}

/* ==================== 选择录入方式卡片 ==================== */
.card.text-center {
    transition: all 0.3s ease;
    cursor: pointer;
    height: 100%;
    border: 2px solid transparent;
}

.card.text-center:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    border-color: #17a2b8;
}

/* ==================== 滚动条美化 ==================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ==================== 响应式调整 ==================== */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .card-header h3, .card-header h5 {
        font-size: 1.1rem;
    }
    
    #luckysheet {
        height: 400px;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 10px;
        margin-right: 0;
    }
    
    .modal-dialog.modal-xl {
        margin: 10px;
        max-width: calc(100% - 20px);
    }
    
    .row > .col-md-6, .row > .col-md-4, .row > .col-md-2 {
        margin-bottom: 15px;
    }
}

