/* 材料管理样式 */

/* 材料列表容器 */
#materials-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    padding: 20px;
}

/* 材料卡片 */
.material-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.material-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

/* 材料头部 */
.material-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f5f5f5;
}

.material-name h3 {
    margin: 0 0 4px 0;
    font-size: 18px;
    color: #2c3e50;
}

.material-code {
    font-size: 12px;
    color: #95a5a6;
    font-family: monospace;
}

/* 状态标签 */
.material-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.status-ordered {
    background: #e3f2fd;
    color: #1976d2;
}

.status-arrived {
    background: #e8f5e9;
    color: #388e3c;
}

.status-in-use {
    background: #fff3e0;
    color: #f57c00;
}

.status-depleted {
    background: #ffebee;
    color: #d32f2f;
}

.status-low-stock {
    background: #fff3e0;
    color: #e65100;
}

/* 统计信息 */
.material-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    font-size: 12px;
    color: #7f8c8d;
}

.stat-value {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
}

.stat-highlight {
    grid-column: span 2;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
}

.stat-highlight .stat-label {
    color: rgba(255,255,255,0.9);
}

.stat-highlight .stat-value {
    color: white;
    font-size: 20px;
}

/* 库存进度条 */
.stock-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.stock-bar {
    flex: 1;
    height: 8px;
    background: #ecf0f1;
    border-radius: 4px;
    overflow: hidden;
}

.stock-fill {
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.stock-percentage {
    font-size: 14px;
    font-weight: 600;
    color: #7f8c8d;
    min-width: 40px;
    text-align: right;
}

/* 材料信息 */
.material-info {
    font-size: 13px;
    color: #7f8c8d;
    margin-bottom: 8px;
}

.material-info strong {
    color: #2c3e50;
}

/* 材料操作按钮 */
.material-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #ecf0f1;
}

.material-actions .btn {
    flex: 1;
}

/* 空状态 */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state p {
    font-size: 16px;
    color: #95a5a6;
    margin-bottom: 24px;
}

/* 顶部工具栏 */
.materials-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: white;
    border-bottom: 1px solid #e0e0e0;
}

.toolbar-left {
    display: flex;
    gap: 12px;
    align-items: center;
}

.toolbar-right {
    display: flex;
    gap: 12px;
}

/* 筛选器 */
#filter-material-status {
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

/* 模态框 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    animation: slideUp 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    color: #2c3e50;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #95a5a6;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #ecf0f1;
    color: #2c3e50;
}

.modal-form {
    padding: 24px;
}

/* 表单组 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
    font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
}

.form-group input + input {
    margin-top: 8px;
}

.form-hint {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #95a5a6;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

/* 信息框 */
.info-box {
    background: #f8f9fa;
    border-left: 4px solid #3498db;
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.6;
}

.info-box .highlight {
    color: #e74c3c;
    font-weight: 600;
}

/* 表单操作按钮 */
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e0e0e0;
}

.form-actions .btn {
    flex: 1;
}

/* 按钮样式 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-success {
    background: #2ecc71;
    color: white;
}

.btn-success:hover {
    background: #27ae60;
}

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

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

.btn-secondary {
    background: #ecf0f1;
    color: #7f8c8d;
}

.btn-secondary:hover {
    background: #bdc3c7;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    #materials-list {
        grid-template-columns: 1fr;
        padding: 12px;
    }

    .materials-toolbar {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .toolbar-left,
    .toolbar-right {
        width: 100%;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        margin: 20px;
    }
}


/* 简化版材料管理样式 */
#materials-container {
    padding: 20px;
}

.materials-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.materials-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.material-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.material-card-header {
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 12px;
    margin-bottom: 12px;
}

.material-card-header h4 {
    margin: 0 0 4px 0;
    color: #1f2937;
    font-size: 16px;
}

.material-code {
    font-size: 12px;
    color: #6b7280;
}

.material-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.material-stat {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.material-stat .label {
    color: #6b7280;
}

.material-stat .value {
    font-weight: 600;
    color: #1f2937;
}

.material-stat.highlight {
    background: #f0fdf4;
    padding: 8px;
    border-radius: 4px;
    margin-top: 4px;
}

.material-stat.highlight .label {
    color: #059669;
}

.material-stat.highlight .value {
    color: #059669;
}
