* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    background: white;
    padding: 20px 30px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    color: #2c3e50;
    font-size: 28px;
    font-weight: 600;
}

.header h1 i {
    color: #3498db;
    margin-right: 10px;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 24px;
    color: white;
}

.stat-card:nth-child(1) .stat-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-card:nth-child(2) .stat-icon {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stat-card:nth-child(3) .stat-icon {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.stat-card:nth-child(4) .stat-icon {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.stat-card:nth-child(5) .stat-icon {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.stat-info h3 {
    font-size: 32px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 5px;
}

.stat-info p {
    color: #7f8c8d;
    font-size: 14px;
}

.search-section {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.search-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.filter-group input,
.filter-group select {
    padding: 12px;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: #3498db;
}

.filter-actions {
    display: flex;
    gap: 10px;
}

.progress-overview {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.progress-overview h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 20px;
}

.progress-overview h3 i {
    color: #3498db;
    margin-right: 10px;
}

.progress-content {
    position: relative;
}

.table-section {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    overflow: hidden;
}

.table-header {
    padding: 25px;
    border-bottom: 1px solid #ecf0f1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-header h3 {
    color: #2c3e50;
    font-size: 20px;
}

.table-header h3 i {
    color: #3498db;
    margin-right: 10px;
}

.table-controls select {
    padding: 8px 12px;
    border: 2px solid #ecf0f1;
    border-radius: 6px;
    background: white;
}

.table-container {
    overflow-x: auto;
}

#dataTable {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

#dataTable th,
#dataTable td {
    padding: 12px 8px;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
}

#dataTable th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
    position: sticky;
    top: 0;
    z-index: 10;
}

#dataTable tbody tr:hover {
    background: #f8f9fa;
}

.progress-cell {
    text-align: center;
    font-weight: 600;
}

.progress-cell.completed {
    color: #27ae60;
}

.progress-cell.in-progress {
    color: #f39c12;
}

.progress-cell.not-started {
    color: #e74c3c;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2980b9 0%, #3498db 100%);
    transform: translateY(-2px);
}

.btn-secondary {
    background: #ecf0f1;
    color: #2c3e50;
}

.btn-secondary:hover {
    background: #d5dbdb;
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    padding: 6px 12px;
    font-size: 12px;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c0392b 0%, #e74c3c 100%);
}

.btn-edit {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
    padding: 6px 12px;
    font-size: 12px;
    margin-right: 5px;
}

.btn-edit:hover {
    background: linear-gradient(135deg, #e67e22 0%, #f39c12 100%);
}

.pagination {
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #ecf0f1;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid #ecf0f1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
}

.close {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.close:hover {
    opacity: 0.7;
}

.modal-body {
    padding: 30px;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid #ecf0f1;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 12px;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.checkbox-group {
    display: flex;
    flex-direction: row;
    gap: 20px;
    align-items: center;
    padding-top: 25px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
}

.no-data {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
}

/* 进度概览新增样式 */
.progress-content {
    width: 100%;
}

.order-info-card,
.customer-info-card,
.overall-info-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    width: 100%;
    box-sizing: border-box;
}

.order-info-card h4,
.customer-info-card h4,
.overall-info-card h4 {
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 600;
}

.order-info-card h4 i,
.customer-info-card h4 i,
.overall-info-card h4 i {
    margin-right: 10px;
}

.order-details,
.customer-details,
.overall-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

/* 悬浮提示框样式 */
.tooltip {
    position: absolute;
    z-index: 1001;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    max-width: 400px;
    word-wrap: break-word;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tooltip.show {
    opacity: 1;
}

.tooltip::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: rgba(0, 0, 0, 0.9) transparent transparent transparent;
}

/* 表格行悬浮效果增强 */
#dataTable tbody tr {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#dataTable tbody tr:hover {
    background: #e3f2fd !important;
    box-shadow: inset 0 0 5px rgba(33, 150, 243, 0.2);
}

/* 悬浮框标题样式 */
.tooltip-title {
    font-weight: 600;
    margin-bottom: 8px;
    color: #3498db;
    border-bottom: 1px solid rgba(52, 152, 219, 0.3);
    padding-bottom: 4px;
}

.detail-item {
    display: flex;
    flex-direction: column;
}

.detail-item label {
    font-size: 12px;
    opacity: 0.8;
    margin-bottom: 5px;
}

.detail-item span {
    font-size: 16px;
    font-weight: 600;
}

.charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
    width: 100%;
}

.chart-section {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    min-height: 250px;
    width: 100%;
    overflow: hidden;
}

.no-data-message {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
    font-style: italic;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #ddd;
}

/* 确保布局不会溢出 */
.progress-overview {
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

.progress-content {
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

/* 最近订单详情样式 */
.recent-orders-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    width: 100%;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.recent-orders-card h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 600;
    border-bottom: 1px solid #ecf0f1;
    padding-bottom: 10px;
}

.recent-orders-card h4 i {
    color: #3498db;
    margin-right: 10px;
}

.recent-orders-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.order-detail-card {
    border: 1px solid #ecf0f1;
    border-radius: 8px;
    padding: 15px;
    background: #f8f9fa;
    transition: box-shadow 0.3s ease;
}

.order-detail-card:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.order-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ecf0f1;
}

.order-header h5 {
    color: #2c3e50;
    font-size: 16px;
    margin: 0;
}

.clickable-order {
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 10px;
    border-radius: 6px;
}

.clickable-order:hover {
    color: #3498db;
    background: rgba(52, 152, 219, 0.1);
}

.clickable-order .toggle-icon {
    transition: transform 0.3s ease;
    color: #7f8c8d;
}

.clickable-order.expanded .toggle-icon {
    transform: rotate(0deg);
}

.clickable-order.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.order-date, 
.completion-rate {
    font-size: 14px;
    color: #7f8c8d;
}

.completion-rate {
    font-weight: 600;
    color: #27ae60;
}

.order-items {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.order-item {
    background: white;
    border-radius: 6px;
    padding: 15px;
    border: 1px solid #e8e8e8;
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.item-seq, 
.item-quantity {
    font-size: 14px;
    color: #2c3e50;
}

.item-quantity {
    font-weight: 600;
    color: #3498db;
}

.item-details {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
}

.specification, 
.delivery-date {
    font-size: 14px;
    color: #7f8c8d;
}

.progress-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.progress-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.progress-item {
    display: grid;
    grid-template-columns: 120px 1fr 60px;
    align-items: center;
    gap: 10px;
}

.progress-label {
    font-size: 14px;
    color: #2c3e50;
}

.progress-bar {
    height: 8px;
    background: #ecf0f1;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    transition: width 0.3s ease;
}

.progress-value {
    font-size: 14px;
    font-weight: 600;
    text-align: right;
    color: #2c3e50;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .order-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .item-details {
        flex-direction: column;
        gap: 5px;
    }
    
    .progress-item {
        grid-template-columns: 1fr;
        gap: 5px;
    }
    
    .progress-label {
        font-size: 12px;
    }
}

/* 图表容器优化 */
.chart-container {
    max-width: 100%;
    margin: 20px auto;
    padding: 0;
    box-sizing: border-box;
}

.chart-container canvas {
    max-width: 100% !important;
    height: auto !important;
    width: auto !important;
}

/* 客户订单图表容器 */
#customerOrdersChart {
    max-height: 250px !important;
}

/* 可滚动的图表容器 */
.chart-container-scrollable {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    margin: 20px 0;
    padding: 10px 0;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    background: #f8f9fa;
}

.chart-scroll-content {
    min-width: 600px; /* 最小宽度确保基本显示 */
    width: auto;
    display: inline-block;
    vertical-align: top;
}

.chart-scroll-content canvas {
    max-width: none !important; /* 允许canvas超出容器宽度 */
    width: auto !important;
    height: 200px !important;
}

/* 滚动条样式 */
.chart-container-scrollable::-webkit-scrollbar {
    height: 8px;
}

.chart-container-scrollable::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.chart-container-scrollable::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.chart-container-scrollable::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .chart-container-scrollable {
        margin: 15px 0;
    }
    
    .chart-scroll-content {
        min-width: 400px;
    }
    
    .chart-scroll-content canvas {
        height: 180px !important;
    }
}

#orderProgressChart {
    max-height: 200px !important;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .order-details,
    .customer-details,
    .overall-details {
        grid-template-columns: 1fr;
    }
    
    .charts-row {
        grid-template-columns: 1fr;
    }
    
    .chart-section {
        height: 200px;
    }
}

.error-message {
    background: #e74c3c;
    color: white;
    padding: 15px;
    border-radius: 6px;
    margin: 10px 0;
}

.success-message {
    background: #27ae60;
    color: white;
    padding: 15px;
    border-radius: 6px;
    margin: 10px 0;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .header-actions {
        width: 100%;
        justify-content: center;
    }
    
    .dashboard {
        grid-template-columns: 1fr;
    }
    
    .search-filters {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .table-container {
        font-size: 12px;
    }
    
    #dataTable th,
    #dataTable td {
        padding: 8px 4px;
    }
    
    .pagination {
        flex-direction: column;
        gap: 15px;
    }
    
    .modal-content {
        width: 95%;
        margin: 2% auto;
    }
    
    .modal-body {
        padding: 20px;
    }
}