* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
    background: #f0f2f5;
    color: #333;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, #1a73e8, #0d47a1);
    color: white;
    padding: 15px 30px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.header h1 {
    font-size: 22px;
    font-weight: 500;
}

.nav {
    display: flex;
    gap: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}
.user-info #welcomeUser {
    color: rgba(255,255,255,0.9);
}

.nav-link {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    transition: all 0.3s;
}

.nav-link:hover, .nav-link.active {
    background: rgba(255,255,255,0.2);
    color: white;
}

/* Main */
.main {
    background: white;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    min-height: calc(100vh - 140px);
}

/* Dashboard */
.dashboard {
    padding: 20px;
}

.welcome-section {
    text-align: center;
    margin-bottom: 30px;
}

.welcome-section h2 {
    color: #1a73e8;
    margin-bottom: 10px;
}

.subtitle {
    color: #666;
    font-size: 14px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.card:hover {
    border-color: #1a73e8;
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.15);
}

.card-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.card h3 {
    color: #1a73e8;
    margin-bottom: 10px;
}

.card p {
    color: #666;
    font-size: 14px;
}

.stats-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
}

.stats-section h3 {
    margin-bottom: 15px;
    color: #333;
}

.action-list {
    display: flex;
    gap: 10px;
}

/* Buttons */
.btn {
    padding: 8px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    font-weight: 500;
}

.btn-primary {
    background: #1a73e8;
    color: white;
}

.btn-primary:hover {
    background: #0d47a1;
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-warning {
    background: #fd7e14;
    color: white;
}

.btn-warning:hover {
    background: #e8590c;
}

/* Feeding Container */
.feeding-container {
    padding: 10px;
}

/* Step Indicator */
.step-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.step-num {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #ddd;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 8px;
}

.step.active .step-num {
    background: #1a73e8;
}

.step.completed .step-num {
    background: #28a745;
}

.step-label {
    font-size: 13px;
    color: #666;
}

.step.active .step-label {
    color: #1a73e8;
    font-weight: 500;
}

.step-line {
    width: 80px;
    height: 2px;
    background: #ddd;
    margin: 0 15px;
    margin-bottom: 25px;
}

.step-line.completed {
    background: #28a745;
}

/* Step Panel */
.step-panel {
    animation: fadeIn 0.3s ease;
}

.step-panel.hidden {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
}

.panel-header h3 {
    color: #1a73e8;
}

.panel-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Search Box */
.search-box {
    display: flex;
    gap: 10px;
}

.search-box input {
    padding: 8px 15px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    width: 300px;
}

/* Data Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.data-table th,
.data-table td {
    padding: 10px 12px;
    text-align: left;
    border: 1px solid #e9ecef;
    font-size: 13px;
}

.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
    white-space: nowrap;
}

.data-table tbody tr:hover {
    background: #f1f3f5;
}

.data-table tbody tr.selected {
    background: #e3f2fd;
}

.data-table .loading {
    text-align: center;
    color: #666;
    padding: 30px;
}

.detail-table th,
.detail-table td {
    white-space: nowrap;
}

.editable-col {
    background: #fff3cd !important;
}

.editable-col input {
    width: 100px;
    padding: 4px 8px;
    border: 1px solid #ffc107;
    border-radius: 3px;
}

/* Form */
.form-section {
    margin-bottom: 25px;
}

.form-section h4 {
    color: #495057;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #1a73e8;
    display: inline-block;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.form-item {
    display: flex;
    flex-direction: column;
}

.form-item label {
    font-size: 13px;
    color: #495057;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-item input,
.form-item select {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

.form-item input[readonly] {
    background: #f8f9fa;
    color: #6c757d;
}

.required {
    color: #dc3545;
}

/* Info Banner */
.info-banner {
    display: flex;
    gap: 30px;
    padding: 15px 20px;
    background: #e3f2fd;
    border-radius: 6px;
    margin-bottom: 20px;
}

.info-banner strong {
    color: #1a73e8;
    font-size: 18px;
    margin-left: 5px;
}

/* Table Section */
.table-section {
    margin-bottom: 20px;
}

.table-section h4 {
    color: #495057;
    margin-bottom: 15px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: #1a73e8;
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.picking-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    display: flex;
    gap: 30px;
}

.picking-manual {
    margin-top: 20px;
    padding: 15px;
    background: #fff3cd;
    border-radius: 6px;
}

.manual-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.manual-input-row input {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    width: 150px;
}

.tip {
    color: #dc3545;
    font-size: 13px;
}

/* 填充/折百标志列配色 */
.flag-yes {
    color: #1a7f37;
    font-weight: 600;
    background: #e6f4ea !important;
    text-align: center;
}
.flag-no {
    color: #656d76;
    background: #f6f8fa !important;
    text-align: center;
}

/* 无领料单提示 */
.no-picking {
    color: #dc3545;
    padding: 10px;
    text-align: center;
    font-size: 13px;
    background: #fdecea;
    border-radius: 4px;
}

/* 操作按钮列 */
.action-cell {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    padding: 4px 8px !important;
    line-height: 1;
}
.action-cell .action-btn {
    padding: 4px 10px !important;
    font-size: 12px;
}
.btn.btn-danger {
    background: #dc3545;
    color: #fff;
    border-color: #dc3545;
}
.btn.btn-danger:hover {
    background: #bb2d3b;
    border-color: #bb2d3b;
    color: #fff;
}

/* 批次已选行样式 */
tr.row-batch-done td.batch-filled {
    background: #e6f4ea;
    color: #1a7f37;
    font-weight: 500;
}
tr.row-batch-todo td.batch-empty .tip {
    color: #d97706;
    font-size: 12px;
}

/* 填充物料锁定行 */
tr.row-locked td {
    opacity: 0.6;
    background: #f3f4f6 !important;
}
tr.row-locked td.action-cell .tip {
    color: #6b7280;
    font-size: 13px;
}

/* 汇总脚 tfoot */
.summary-footer tr {
    background: #f1f5f9;
    font-weight: 600;
}
.summary-footer td {
    border-top: 2px solid #cbd5e1;
    padding: 10px 8px !important;
}
.sum-cell {
    text-align: center;
    color: #1d4ed8;
    font-size: 14px;
}
.editable-col-sum {
    background: #dbeafe !important;
}

/* 步骤3底部汇总面板 */
.step3-footer {
    display: flex !important;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}
.summary-box {
    flex: 1 1 500px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 12px 16px;
}
.summary-box p {
    margin: 4px 0;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.summary-box strong {
    font-size: 15px;
    color: #111827;
    display: inline-block;
    min-width: 80px;
    text-align: right;
}
.step3-footer .action-btns {
    flex: 0 0 auto;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
}

/* 校验标签 */
.check-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    line-height: 1.5;
}
.check-tag.check-ok {
    color: #1a7f37;
    background: #dcfce7;
}
.check-tag.check-fail {
    color: #b91c1c;
    background: #fee2e2;
}

/* 领料单表格中的行提示 */
#pickingTableBody td .tip {
    color: #d97706;
    font-size: 11px;
    display: inline-block;
    margin-top: 2px;
}

/* Print Container */
.print-container {
    padding: 10px;
}

.template-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.template-card {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.template-card:hover {
    border-color: #1a73e8;
}

.template-card.active {
    border-color: #1a73e8;
    background: #e3f2fd;
}

.template-icon {
    font-size: 36px;
    margin-bottom: 10px;
}

.template-editor {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
}

.template-section {
    margin-bottom: 20px;
}

.template-section h5 {
    color: #495057;
    margin-bottom: 10px;
}

.field-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 8px;
}

.field-item {
    padding: 8px 12px;
    background: white;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

.header-actions {
    display: flex;
    gap: 10px;
}

/* Action button in table */
.action-btn {
    padding: 4px 10px;
    font-size: 12px;
}

/* Error/success messages */
.message {
    padding: 12px 20px;
    border-radius: 4px;
    margin: 10px 0;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .step-indicator {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .step-line {
        display: none;
    }
    
    .info-banner {
        flex-direction: column;
        gap: 10px;
    }
}